@idosgames/react 0.4.2 → 0.4.4
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/index.cjs +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/dist/ui/index.cjs +2 -2
- package/dist/ui/index.d.cts +3 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var p=react.createContext(null);function k({client:e,children:t}){return jsxRuntime.jsx(p.Provider,{value:e,children:t})}function a(){let e=react.useContext(p);if(!e)throw new Error("useIDosGamesClient must be used within <IDosGamesProvider>.");return e}function R(){return react.useContext(p)}var P=react.createContext(null);function T({children:e}){let[t,r]=react.useState(null),o=react.useCallback((l,c="info")=>{r({text:l,kind:c});},[]),s=react.useCallback(()=>{r(null);},[]),n=react.useMemo(()=>({message:t,setStatus:o,clear:s}),[t,o,s]);return jsxRuntime.jsx(P.Provider,{value:n,children:e})}function E(){let e=react.useContext(P);if(!e)throw new Error("useStatus must be used within <StatusProvider>.");return e}var C=new WeakMap;function y(e){if(!e)return null;let t={};for(let[r,o]of Object.entries(e))t[r]=Array.isArray(o)?[...o]:o!==null&&typeof o=="object"?{...o}:o;return t}function M(e){let t=C.get(e);if(t)return t;let r=y(e.data.user.state),o=new Set;e.on("user:anyUpdated",()=>{r=y(e.data.user.state);for(let n of [...o])n();});let s={subscribe(n){return o.add(n),()=>{o.delete(n);}},get:()=>r};return C.set(e,s),s}function q(){let e=a(),t=M(e);return react.useSyncExternalStore(t.subscribe,t.get,t.get)}function A(e,t){let r=a();react.useEffect(()=>r.on(e,t),[r,e,t]);}function W(e){let t=a(),[r,o]=react.useState("idle"),[s,n]=react.useState(null),l=react.useMemo(()=>t.checkout.availableOptions(e),[t,e]),c=react.useCallback(u=>t.checkout.requirementOf(u),[t]),v=react.useCallback(async(u,O)=>{let m=t.checkout.requirementOf(u);n(null),o(m.kind==="store"?"awaiting-store":m.shortfall?"awaiting-wallet":"purchasing");try{let i=await O(u);return i.ok?(o("done"),i):(n(i.error),o("failed"),i)}catch(i){return n(i instanceof Error?i.message:String(i)),o("failed"),null}},[t]),x=react.useCallback(()=>{o("idle"),n(null);},[]);return {options:l,requirementOf:c,stage:r,error:s,pay:v,reset:x}}function F(e){let t=react.createContext(null);function r({controller:s,children:n}){return jsxRuntime.jsx(t.Provider,{value:s,children:n})}function o(){let s=react.useContext(t);if(s===null)throw new Error(`use${e} must be used within its <${e}Provider>.`);return s}return [r,o]}exports.IDosGamesProvider=k;exports.StatusProvider=T;exports.createControllerContext=F;exports.useIDosGamesClient=a;exports.useOptionalIDosGamesClient=R;exports.usePayment=W;exports.useSdkEvent=A;exports.useStatus=E;exports.useUserState=q;
|
package/dist/index.d.cts
CHANGED
|
@@ -24,7 +24,10 @@ declare function StatusProvider({ children, }: {
|
|
|
24
24
|
}): ReactNode;
|
|
25
25
|
declare function useStatus(): StatusApi;
|
|
26
26
|
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Live user state that re-renders the component whenever the SDK cache changes. Every change gives
|
|
29
|
+
* a NEW object (and new container objects), so it is safe as an effect / memo dependency.
|
|
30
|
+
*/
|
|
28
31
|
declare function useUserState(): UserState | null;
|
|
29
32
|
/** Subscribe to a typed SDK event for the lifetime of the component. */
|
|
30
33
|
declare function useSdkEvent<K extends keyof SdkEvents>(event: K, handler: (payload: SdkEvents[K]) => void): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,7 +24,10 @@ declare function StatusProvider({ children, }: {
|
|
|
24
24
|
}): ReactNode;
|
|
25
25
|
declare function useStatus(): StatusApi;
|
|
26
26
|
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Live user state that re-renders the component whenever the SDK cache changes. Every change gives
|
|
29
|
+
* a NEW object (and new container objects), so it is safe as an effect / memo dependency.
|
|
30
|
+
*/
|
|
28
31
|
declare function useUserState(): UserState | null;
|
|
29
32
|
/** Subscribe to a typed SDK event for the lifetime of the component. */
|
|
30
33
|
declare function useSdkEvent<K extends keyof SdkEvents>(event: K, handler: (payload: SdkEvents[K]) => void): void;
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-UYRDWMMD.js';export{a as IDosGamesProvider,b as useIDosGamesClient,c as useOptionalIDosGamesClient}from'./chunk-UYRDWMMD.js';import {createContext,useState,useCallback,useMemo,useContext,
|
|
1
|
+
import {b as b$1}from'./chunk-UYRDWMMD.js';export{a as IDosGamesProvider,b as useIDosGamesClient,c as useOptionalIDosGamesClient}from'./chunk-UYRDWMMD.js';import {createContext,useState,useCallback,useMemo,useContext,useSyncExternalStore,useEffect}from'react';import {jsx}from'react/jsx-runtime';var S=createContext(null);function T({children:t}){let[e,o]=useState(null),r=useCallback((l,c="info")=>{o({text:l,kind:c});},[]),s=useCallback(()=>{o(null);},[]),n=useMemo(()=>({message:e,setStatus:r,clear:s}),[e,r,s]);return jsx(S.Provider,{value:n,children:t})}function b(){let t=useContext(S);if(!t)throw new Error("useStatus must be used within <StatusProvider>.");return t}var f=new WeakMap;function P(t){if(!t)return null;let e={};for(let[o,r]of Object.entries(t))e[o]=Array.isArray(r)?[...r]:r!==null&&typeof r=="object"?{...r}:r;return e}function G(t){let e=f.get(t);if(e)return e;let o=P(t.data.user.state),r=new Set;t.on("user:anyUpdated",()=>{o=P(t.data.user.state);for(let n of [...r])n();});let s={subscribe(n){return r.add(n),()=>{r.delete(n);}},get:()=>o};return f.set(t,s),s}function I(){let t=b$1(),e=G(t);return useSyncExternalStore(e.subscribe,e.get,e.get)}function K(t,e){let o=b$1();useEffect(()=>o.on(t,e),[o,t,e]);}function q(t){let e=b$1(),[o,r]=useState("idle"),[s,n]=useState(null),l=useMemo(()=>e.checkout.availableOptions(t),[e,t]),c=useCallback(u=>e.checkout.requirementOf(u),[e]),y=useCallback(async(u,x)=>{let d=e.checkout.requirementOf(u);n(null),r(d.kind==="store"?"awaiting-store":d.shortfall?"awaiting-wallet":"purchasing");try{let i=await x(u);return i.ok?(r("done"),i):(n(i.error),r("failed"),i)}catch(i){return n(i instanceof Error?i.message:String(i)),r("failed"),null}},[e]),v=useCallback(()=>{r("idle"),n(null);},[]);return {options:l,requirementOf:c,stage:o,error:s,pay:y,reset:v}}function $(t){let e=createContext(null);function o({controller:s,children:n}){return jsx(e.Provider,{value:s,children:n})}function r(){let s=useContext(e);if(s===null)throw new Error(`use${t} must be used within its <${t}Provider>.`);return s}return [o,r]}export{T as StatusProvider,$ as createControllerContext,q as usePayment,K as useSdkEvent,b as useStatus,I as useUserState};
|
package/dist/ui/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Ke=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function pn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Pt={theme:{bgTop:"#232a6b",bgBottom:"#0d1033",panel:"#2c3480",panelDeep:"#1d2360",panelEdge:"#4f5bc9",text:"#ffffff",textDim:"#aeb6f0",gold:"#ffd24a",goldDeep:"#e89a12",green:"#59d35b",greenDeep:"#2b9936",blue:"#4fb1ff",blueDeep:"#2276d6",red:"#ff5a5a",redDeep:"#b83232",shadow:"rgba(4, 6, 30, 0.55)",backdrop:"rgba(5, 7, 30, 0.72)",onGreen:"#ffffff",onGold:"#ffffff",onBlue:"#ffffff",onRed:"#ffffff",textOutline:we,line:"rgba(255, 255, 255, 0.2)",well:"rgba(8, 10, 40, 0.6)",wellSoft:"rgba(0, 0, 0, 0.3)",wellShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.4)",edge:"rgba(0, 0, 0, 0.35)",glow:"rgba(90, 110, 255, 0.35)",panelShadow:"0 6px 0 rgba(4, 6, 30, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.12)",radius:18,buttonRadius:14,font:"'Baloo 2', 'Nunito', 'Trebuchet MS', system-ui, sans-serif",rarity:{Common:"#a9b3c9",Uncommon:"#63d86b",Rare:"#4fb1ff",Epic:"#b879ff",Legendary:"#ffb52e"}},motion:{enabled:true,speed:1,intensity:1,rewardFlight:true,particles:true,stagger:true,respectReducedMotion:true},sound:{enabled:true,volume:.6,events:{}}},_=(t,e,n,o)=>typeof t=="number"&&Number.isFinite(t)?Math.min(n,Math.max(e,t)):o;function Se(t){let e=Pt,n={...e.theme,...Nt(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},hn(n,t?.theme??{}),n.radius=_(n.radius,0,64,e.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,e.theme.buttonRadius);let o={...e.motion,...Nt(t?.motion??{})};o.speed=_(o.speed,.1,5,e.motion.speed),o.intensity=_(o.intensity,0,3,e.motion.intensity);let i=t?.sound??{},r={enabled:i.enabled??e.sound.enabled,volume:_(i.volume??e.sound.volume,0,1,e.sound.volume),events:{...e.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function mn(t){if(typeof t!="string")return null;let e=t.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(e);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,u,l]=[...o].map(d=>parseInt(d+d,16));return [i,r,u,o.length===4?l/255:1]}if(o.length===6||o.length===8){let i=r=>parseInt(o.slice(r,r+2),16);return [i(0),i(2),i(4),o.length===8?i(6)/255:1]}return null}if(n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/.exec(e),n){let o=n[4]===void 0?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]);return [parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),o]}return null}function Lt(t){let e=mn(t);if(!e)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(e[0])+.7152*n(e[1])+.0722*n(e[2])}var Be=t=>(Lt(t)??0)>.5,gn=t=>Be(t.text)?"#1d2233":t.text;function H(t){let e=Lt(t);return e===null||e>.35?we:"none"}function hn(t,e){let n=u=>e[u]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[u,l]of o)!n(u)&&n(l)&&(t[u]=Be(t[l])?gn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Be(t.panel);i&&r&&!n("shadow")&&(t.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(t.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(t.panelShadow=r?`0 6px 18px ${t.shadow}, 0 1px 0 ${t.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${t.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(t.textOutline=H(t.text)),n("line")||(t.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(t.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(t.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(t.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(t.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(t.glow=`color-mix(in srgb, ${t.blue} ${r?18:30}%, transparent)`));}function Nt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function se(t,e){if(!t.enabled||e)return {fast:0,normal:0,slow:0};let n=1/t.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var B={muted:false,volume:1,reducedMotion:false};function Fe(t){if(!t)return {...B};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:_(Number(e.volume),0,1,B.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...B}}}function Ge(t,e,n=1){return !t.enabled||e.muted?0:_(t.volume*e.volume*n,0,1,0)}var Ce={click:{notes:[{freq:1100,slideTo:760,dur:.045,wave:"triangle",gain:.5}]},tab:{notes:[{freq:660,slideTo:880,dur:.06,wave:"sine",gain:.45}]},open:{notes:[{freq:520,dur:.07,wave:"sine",gain:.35},{freq:780,at:.05,dur:.09,wave:"sine",gain:.35}],noise:[{dur:.12,gain:.12,freq:1800,slideTo:4200}]},close:{notes:[{freq:700,slideTo:420,dur:.1,wave:"sine",gain:.3}],noise:[{dur:.1,gain:.08,freq:3e3,slideTo:1200}]},coin:{notes:[{freq:1320,dur:.06,wave:"square",gain:.18},{freq:1760,at:.06,dur:.16,wave:"square",gain:.18}]},reward:{notes:[{freq:523,dur:.09,wave:"triangle",gain:.45},{freq:659,at:.08,dur:.09,wave:"triangle",gain:.45},{freq:784,at:.16,dur:.09,wave:"triangle",gain:.45},{freq:1047,at:.24,dur:.22,wave:"triangle",gain:.5}],noise:[{at:.24,dur:.25,gain:.06,freq:6e3}]},claim:{notes:[{freq:784,dur:.07,wave:"triangle",gain:.45},{freq:1175,at:.07,dur:.16,wave:"triangle",gain:.45}],noise:[{at:.05,dur:.2,gain:.07,freq:7e3}]},purchase:{notes:[{freq:1500,dur:.05,wave:"square",gain:.15},{freq:2e3,at:.05,dur:.18,wave:"square",gain:.15}],noise:[{dur:.08,gain:.25,freq:2500}]},error:{notes:[{freq:220,dur:.1,wave:"square",gain:.2},{freq:175,at:.1,dur:.16,wave:"square",gain:.2}]},notify:{notes:[{freq:880,dur:.12,wave:"sine",gain:.4},{freq:1175,at:.1,dur:.25,wave:"sine",gain:.35}]},lootbox:{noise:[{dur:.45,gain:.18,freq:400,slideTo:5e3}],notes:[{freq:523,at:.42,dur:.3,wave:"triangle",gain:.35},{freq:659,at:.42,dur:.3,wave:"triangle",gain:.3},{freq:784,at:.42,dur:.35,wave:"triangle",gain:.3}]},levelUp:{notes:[{freq:392,dur:.1,wave:"square",gain:.2},{freq:523,at:.1,dur:.1,wave:"square",gain:.2},{freq:659,at:.2,dur:.1,wave:"square",gain:.2},{freq:784,at:.3,dur:.35,wave:"square",gain:.22}]},countTick:{notes:[{freq:2e3,dur:.018,wave:"sine",gain:.12}]}};function Tt(t,e){let n=e.events[t];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Ce[t],volume:1}:typeof n=="string"?{kind:"synth",preset:Ke.includes(n)?Ce[n]:Ce[t],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var yn={countTick:45,coin:60,click:30},ae=class{constructor(e,n){this.config=e;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(e,n){this.config=e,this.prefs=n;}attach(e=typeof window<"u"?window:void 0){if(!e||this.detach)return;let n=()=>{this.unlocked=true;let i=this.context();i&&i.state==="suspended"&&i.resume();},o=["pointerdown","keydown","touchstart"];for(let i of o)e.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)e.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(e){if(!this.unlocked)return;let n=yn[e],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(e)??-1/0)<n)return;this.lastPlayed.set(e,o);let i=Tt(e,this.config);if(i.kind==="none")return;let r=Ge(this.config,this.prefs,i.volume);if(r<=0)return;let u=this.context();u&&(i.kind==="synth"?this.playSynth(u,i.preset,r):this.playFile(u,i.url,r));}context(){if(this.ctx)return this.ctx;let e=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;try{this.ctx=new e;}catch{return null}return this.ctx}playSynth(e,n,o){let i=e.currentTime+.005,r=e.createGain();r.gain.value=o,r.connect(e.destination);for(let u of n.notes??[]){let l=i+(u.at??0),d=l+Math.max(.01,u.dur),p=e.createOscillator();p.type=u.wave??"sine",p.frequency.setValueAtTime(u.freq,l),u.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,u.gain??.4);c.gain.setValueAtTime(1e-4,l),c.gain.exponentialRampToValueAtTime(f,l+Math.min(.012,u.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(l),p.stop(d+.02);}for(let u of n.noise??[]){let l=i+(u.at??0),d=Math.max(.01,u.dur),p=e.createBuffer(1,Math.ceil(e.sampleRate*d),e.sampleRate),c=p.getChannelData(0);for(let R=0;R<c.length;R++)c[R]=Math.random()*2-1;let f=e.createBufferSource();f.buffer=p;let y=e.createBiquadFilter();y.type="bandpass",y.Q.value=1.2,y.frequency.setValueAtTime(u.freq??3e3,l),u.slideTo&&y.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),l+d);let v=e.createGain();v.gain.setValueAtTime(Math.max(1e-4,u.gain??.15),l),v.gain.exponentialRampToValueAtTime(1e-4,l+d),f.connect(y).connect(v).connect(r),f.start(l),f.stop(l+d+.02);}}async playFile(e,n,o){let i=this.buffers.get(n);i||(i=fetch(n).then(d=>d.ok?d.arrayBuffer():Promise.reject(new Error(String(d.status)))).then(d=>e.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let u=e.createBufferSource();u.buffer=r;let l=e.createGain();l.gain.value=o,u.connect(l).connect(e.destination),u.start();}};var _e={info:3500,success:3e3,reward:4500,warning:5500,error:6500},bn={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Re=class{toastList=[];alertQueue=[];waiting=new Map;listeners=new Set;nextId=1;player=null;resolver=null;get toasts(){return this.toastList}get currentAlert(){return this.alertQueue[0]??null}get queued(){return Math.max(0,this.alertQueue.length-1)}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setPlayer(e){this.player=e;}setSourceResolver(e){this.resolver=e,this.emit();}source(e){if(!e)return null;try{return this.resolver?.(e)??null}catch{return null}}toast(e){let n=typeof e=="string"?{message:e}:e,o=n.level??"info",i=n.key?this.toastList.find(l=>l.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(l=>!l.input.key&&l.level===o&&l.input.title===n.title&&l.input.message===n.message));if(r){let l={...r,level:o,input:n,count:i?r.count:r.count+1,revision:r.revision+1};return this.toastList=[...this.toastList.filter(d=>d.id!==r.id),l],this.play(o),this.emit(),r.id}let u={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,u].slice(-3),this.play(o),this.emit(),u.id}alert(e){let n=e.level??"info";if(e.key){let i=this.alertQueue.find(r=>r.input.key===e.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:e,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let u=this.waiting.get(i.id);this.waiting.set(i.id,l=>{u?.(l),r(l);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:e,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(e,n=null){if(this.toastList.some(r=>r.id===e)){this.toastList=this.toastList.filter(r=>r.id!==e),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==e),this.alertQueue.length===o)return;let i=this.waiting.get(e);this.waiting.delete(e),i?.(n),this.emit();}clear(){for(let e of this.waiting.values())e(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(e){this.player?.(bn[e]);}emit(){for(let e of [...this.listeners])e();}};function We(){return new Re}function qe(t,e){let n=t.theme,o=se(t.motion,e),i=t.motion.enabled&&!e;return {"--idos-ui-bg-top":n.bgTop,"--idos-ui-bg-bottom":n.bgBottom,"--idos-ui-panel":n.panel,"--idos-ui-panel-deep":n.panelDeep,"--idos-ui-panel-edge":n.panelEdge,"--idos-ui-text":n.text,"--idos-ui-text-dim":n.textDim,"--idos-ui-gold":n.gold,"--idos-ui-gold-deep":n.goldDeep,"--idos-ui-green":n.green,"--idos-ui-green-deep":n.greenDeep,"--idos-ui-blue":n.blue,"--idos-ui-blue-deep":n.blueDeep,"--idos-ui-red":n.red,"--idos-ui-red-deep":n.redDeep,"--idos-ui-shadow":n.shadow,"--idos-ui-backdrop":n.backdrop,"--idos-ui-on-green":n.onGreen,"--idos-ui-on-gold":n.onGold,"--idos-ui-on-blue":n.onBlue,"--idos-ui-on-red":n.onRed,"--idos-ui-on-green-outline":H(n.onGreen),"--idos-ui-on-gold-outline":H(n.onGold),"--idos-ui-on-blue-outline":H(n.onBlue),"--idos-ui-on-red-outline":H(n.onRed),"--idos-ui-text-outline":n.textOutline,"--idos-ui-line":n.line,"--idos-ui-well":n.well,"--idos-ui-well-soft":n.wellSoft,"--idos-ui-well-shadow":n.wellShadow,"--idos-ui-edge":n.edge,"--idos-ui-glow":n.glow,"--idos-ui-panel-shadow":n.panelShadow,"--idos-ui-radius":`${n.radius}px`,"--idos-ui-button-radius":`${n.buttonRadius}px`,"--idos-ui-font":n.font,"--idos-ui-fast":`${o.fast}ms`,"--idos-ui-normal":`${o.normal}ms`,"--idos-ui-slow":`${o.slow}ms`,"--idos-ui-k":String(i?t.motion.intensity:0)}}var a={bgTop:"var(--idos-ui-bg-top)",bgBottom:"var(--idos-ui-bg-bottom)",panel:"var(--idos-ui-panel)",panelDeep:"var(--idos-ui-panel-deep)",panelEdge:"var(--idos-ui-panel-edge)",text:"var(--idos-ui-text)",textDim:"var(--idos-ui-text-dim)",gold:"var(--idos-ui-gold)",goldDeep:"var(--idos-ui-gold-deep)",green:"var(--idos-ui-green)",greenDeep:"var(--idos-ui-green-deep)",blue:"var(--idos-ui-blue)",blueDeep:"var(--idos-ui-blue-deep)",red:"var(--idos-ui-red)",redDeep:"var(--idos-ui-red-deep)",shadow:"var(--idos-ui-shadow)",backdrop:"var(--idos-ui-backdrop)",onGreen:"var(--idos-ui-on-green)",onGold:"var(--idos-ui-on-gold)",onBlue:"var(--idos-ui-on-blue)",onRed:"var(--idos-ui-on-red)",onGreenOutline:"var(--idos-ui-on-green-outline)",onGoldOutline:"var(--idos-ui-on-gold-outline)",onBlueOutline:"var(--idos-ui-on-blue-outline)",onRedOutline:"var(--idos-ui-on-red-outline)",textOutline:"var(--idos-ui-text-outline)",line:"var(--idos-ui-line)",well:"var(--idos-ui-well)",wellSoft:"var(--idos-ui-well-soft)",wellShadow:"var(--idos-ui-well-shadow)",edge:"var(--idos-ui-edge)",glow:"var(--idos-ui-glow)",panelShadow:"var(--idos-ui-panel-shadow)",radius:"var(--idos-ui-radius)",buttonRadius:"var(--idos-ui-button-radius)",font:"var(--idos-ui-font)",fast:"var(--idos-ui-fast)",normal:"var(--idos-ui-normal)",slow:"var(--idos-ui-slow)"},x={color:a.text,fontWeight:800,textShadow:a.textOutline,letterSpacing:.2},U={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},Ve=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,He={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},le="cubic-bezier(.2, .9, .3, 1.25)",Y="cubic-bezier(.2, .8, .2, 1)",ue="cubic-bezier(.5, 0, .75, .2)",Ye=`
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Ke=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function mn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Lt={theme:{bgTop:"#232a6b",bgBottom:"#0d1033",panel:"#2c3480",panelDeep:"#1d2360",panelEdge:"#4f5bc9",text:"#ffffff",textDim:"#aeb6f0",gold:"#ffd24a",goldDeep:"#e89a12",green:"#59d35b",greenDeep:"#2b9936",blue:"#4fb1ff",blueDeep:"#2276d6",red:"#ff5a5a",redDeep:"#b83232",shadow:"rgba(4, 6, 30, 0.55)",backdrop:"rgba(5, 7, 30, 0.72)",onGreen:"#ffffff",onGold:"#ffffff",onBlue:"#ffffff",onRed:"#ffffff",textOutline:we,line:"rgba(255, 255, 255, 0.2)",well:"rgba(8, 10, 40, 0.6)",wellSoft:"rgba(0, 0, 0, 0.3)",wellShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.4)",edge:"rgba(0, 0, 0, 0.35)",glow:"rgba(90, 110, 255, 0.35)",panelShadow:"0 6px 0 rgba(4, 6, 30, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.12)",radius:18,buttonRadius:14,font:"'Baloo 2', 'Nunito', 'Trebuchet MS', system-ui, sans-serif",rarity:{Common:"#a9b3c9",Uncommon:"#63d86b",Rare:"#4fb1ff",Epic:"#b879ff",Legendary:"#ffb52e"}},motion:{enabled:true,speed:1,intensity:1,rewardFlight:true,particles:true,stagger:true,respectReducedMotion:true},sound:{enabled:true,volume:.6,events:{}}},_=(t,e,n,o)=>typeof t=="number"&&Number.isFinite(t)?Math.min(n,Math.max(e,t)):o;function Se(t){let e=Lt,n={...e.theme,...Pt(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},yn(n,t?.theme??{}),n.radius=_(n.radius,0,64,e.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,e.theme.buttonRadius);let o={...e.motion,...Pt(t?.motion??{})};o.speed=_(o.speed,.1,5,e.motion.speed),o.intensity=_(o.intensity,0,3,e.motion.intensity);let i=t?.sound??{},r={enabled:i.enabled??e.sound.enabled,volume:_(i.volume??e.sound.volume,0,1,e.sound.volume),events:{...e.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function gn(t){if(typeof t!="string")return null;let e=t.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(e);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,u,l]=[...o].map(d=>parseInt(d+d,16));return [i,r,u,o.length===4?l/255:1]}if(o.length===6||o.length===8){let i=r=>parseInt(o.slice(r,r+2),16);return [i(0),i(2),i(4),o.length===8?i(6)/255:1]}return null}if(n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/.exec(e),n){let o=n[4]===void 0?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]);return [parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),o]}return null}function Tt(t){let e=gn(t);if(!e)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(e[0])+.7152*n(e[1])+.0722*n(e[2])}var Fe=t=>(Tt(t)??0)>.5,hn=t=>Fe(t.text)?"#1d2233":t.text;function H(t){let e=Tt(t);return e===null||e>.35?we:"none"}function yn(t,e){let n=u=>e[u]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[u,l]of o)!n(u)&&n(l)&&(t[u]=Fe(t[l])?hn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Fe(t.panel);i&&r&&!n("shadow")&&(t.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(t.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(t.panelShadow=r?`0 6px 18px ${t.shadow}, 0 1px 0 ${t.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${t.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(t.textOutline=H(t.text)),n("line")||(t.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(t.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(t.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(t.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(t.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(t.glow=`color-mix(in srgb, ${t.blue} ${r?18:30}%, transparent)`));}function Pt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function se(t,e){if(!t.enabled||e)return {fast:0,normal:0,slow:0};let n=1/t.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var B={muted:false,volume:1,reducedMotion:false};function Ge(t){if(!t)return {...B};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:_(Number(e.volume),0,1,B.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...B}}}function _e(t,e,n=1){return !t.enabled||e.muted?0:_(t.volume*e.volume*n,0,1,0)}var Ce={click:{notes:[{freq:1100,slideTo:760,dur:.045,wave:"triangle",gain:.5}]},tab:{notes:[{freq:660,slideTo:880,dur:.06,wave:"sine",gain:.45}]},open:{notes:[{freq:520,dur:.07,wave:"sine",gain:.35},{freq:780,at:.05,dur:.09,wave:"sine",gain:.35}],noise:[{dur:.12,gain:.12,freq:1800,slideTo:4200}]},close:{notes:[{freq:700,slideTo:420,dur:.1,wave:"sine",gain:.3}],noise:[{dur:.1,gain:.08,freq:3e3,slideTo:1200}]},coin:{notes:[{freq:1320,dur:.06,wave:"square",gain:.18},{freq:1760,at:.06,dur:.16,wave:"square",gain:.18}]},reward:{notes:[{freq:523,dur:.09,wave:"triangle",gain:.45},{freq:659,at:.08,dur:.09,wave:"triangle",gain:.45},{freq:784,at:.16,dur:.09,wave:"triangle",gain:.45},{freq:1047,at:.24,dur:.22,wave:"triangle",gain:.5}],noise:[{at:.24,dur:.25,gain:.06,freq:6e3}]},claim:{notes:[{freq:784,dur:.07,wave:"triangle",gain:.45},{freq:1175,at:.07,dur:.16,wave:"triangle",gain:.45}],noise:[{at:.05,dur:.2,gain:.07,freq:7e3}]},purchase:{notes:[{freq:1500,dur:.05,wave:"square",gain:.15},{freq:2e3,at:.05,dur:.18,wave:"square",gain:.15}],noise:[{dur:.08,gain:.25,freq:2500}]},error:{notes:[{freq:220,dur:.1,wave:"square",gain:.2},{freq:175,at:.1,dur:.16,wave:"square",gain:.2}]},notify:{notes:[{freq:880,dur:.12,wave:"sine",gain:.4},{freq:1175,at:.1,dur:.25,wave:"sine",gain:.35}]},lootbox:{noise:[{dur:.45,gain:.18,freq:400,slideTo:5e3}],notes:[{freq:523,at:.42,dur:.3,wave:"triangle",gain:.35},{freq:659,at:.42,dur:.3,wave:"triangle",gain:.3},{freq:784,at:.42,dur:.35,wave:"triangle",gain:.3}]},levelUp:{notes:[{freq:392,dur:.1,wave:"square",gain:.2},{freq:523,at:.1,dur:.1,wave:"square",gain:.2},{freq:659,at:.2,dur:.1,wave:"square",gain:.2},{freq:784,at:.3,dur:.35,wave:"square",gain:.22}]},countTick:{notes:[{freq:2e3,dur:.018,wave:"sine",gain:.12}]}};function Et(t,e){let n=e.events[t];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Ce[t],volume:1}:typeof n=="string"?{kind:"synth",preset:Ke.includes(n)?Ce[n]:Ce[t],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var bn={countTick:45,coin:60,click:30},ae=class{constructor(e,n){this.config=e;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(e,n){this.config=e,this.prefs=n;}attach(e=typeof window<"u"?window:void 0){if(!e||this.detach)return;let n=()=>{this.unlocked=true;let i=this.context();i&&i.state==="suspended"&&i.resume();},o=["pointerdown","keydown","touchstart"];for(let i of o)e.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)e.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(e){if(!this.unlocked)return;let n=bn[e],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(e)??-1/0)<n)return;this.lastPlayed.set(e,o);let i=Et(e,this.config);if(i.kind==="none")return;let r=_e(this.config,this.prefs,i.volume);if(r<=0)return;let u=this.context();u&&(i.kind==="synth"?this.playSynth(u,i.preset,r):this.playFile(u,i.url,r));}context(){if(this.ctx)return this.ctx;let e=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;try{this.ctx=new e;}catch{return null}return this.ctx}playSynth(e,n,o){let i=e.currentTime+.005,r=e.createGain();r.gain.value=o,r.connect(e.destination);for(let u of n.notes??[]){let l=i+(u.at??0),d=l+Math.max(.01,u.dur),p=e.createOscillator();p.type=u.wave??"sine",p.frequency.setValueAtTime(u.freq,l),u.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,u.gain??.4);c.gain.setValueAtTime(1e-4,l),c.gain.exponentialRampToValueAtTime(f,l+Math.min(.012,u.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(l),p.stop(d+.02);}for(let u of n.noise??[]){let l=i+(u.at??0),d=Math.max(.01,u.dur),p=e.createBuffer(1,Math.ceil(e.sampleRate*d),e.sampleRate),c=p.getChannelData(0);for(let R=0;R<c.length;R++)c[R]=Math.random()*2-1;let f=e.createBufferSource();f.buffer=p;let y=e.createBiquadFilter();y.type="bandpass",y.Q.value=1.2,y.frequency.setValueAtTime(u.freq??3e3,l),u.slideTo&&y.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),l+d);let v=e.createGain();v.gain.setValueAtTime(Math.max(1e-4,u.gain??.15),l),v.gain.exponentialRampToValueAtTime(1e-4,l+d),f.connect(y).connect(v).connect(r),f.start(l),f.stop(l+d+.02);}}async playFile(e,n,o){let i=this.buffers.get(n);i||(i=fetch(n).then(d=>d.ok?d.arrayBuffer():Promise.reject(new Error(String(d.status)))).then(d=>e.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let u=e.createBufferSource();u.buffer=r;let l=e.createGain();l.gain.value=o,u.connect(l).connect(e.destination),u.start();}};var We={info:3500,success:3e3,reward:4500,warning:5500,error:6500},vn={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Re=class{toastList=[];alertQueue=[];waiting=new Map;listeners=new Set;nextId=1;player=null;resolver=null;get toasts(){return this.toastList}get currentAlert(){return this.alertQueue[0]??null}get queued(){return Math.max(0,this.alertQueue.length-1)}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setPlayer(e){this.player=e;}setSourceResolver(e){this.resolver=e,this.emit();}source(e){if(!e)return null;try{return this.resolver?.(e)??null}catch{return null}}toast(e){let n=typeof e=="string"?{message:e}:e,o=n.level??"info",i=n.key?this.toastList.find(l=>l.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(l=>!l.input.key&&l.level===o&&l.input.title===n.title&&l.input.message===n.message));if(r){let l={...r,level:o,input:n,count:i?r.count:r.count+1,revision:r.revision+1};return this.toastList=[...this.toastList.filter(d=>d.id!==r.id),l],this.play(o),this.emit(),r.id}let u={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,u].slice(-3),this.play(o),this.emit(),u.id}alert(e){let n=e.level??"info";if(e.key){let i=this.alertQueue.find(r=>r.input.key===e.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:e,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let u=this.waiting.get(i.id);this.waiting.set(i.id,l=>{u?.(l),r(l);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:e,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(e,n=null){if(this.toastList.some(r=>r.id===e)){this.toastList=this.toastList.filter(r=>r.id!==e),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==e),this.alertQueue.length===o)return;let i=this.waiting.get(e);this.waiting.delete(e),i?.(n),this.emit();}clear(){for(let e of this.waiting.values())e(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(e){this.player?.(vn[e]);}emit(){for(let e of [...this.listeners])e();}};function qe(){return new Re}function Ve(t,e){let n=t.theme,o=se(t.motion,e),i=t.motion.enabled&&!e;return {"--idos-ui-bg-top":n.bgTop,"--idos-ui-bg-bottom":n.bgBottom,"--idos-ui-panel":n.panel,"--idos-ui-panel-deep":n.panelDeep,"--idos-ui-panel-edge":n.panelEdge,"--idos-ui-text":n.text,"--idos-ui-text-dim":n.textDim,"--idos-ui-gold":n.gold,"--idos-ui-gold-deep":n.goldDeep,"--idos-ui-green":n.green,"--idos-ui-green-deep":n.greenDeep,"--idos-ui-blue":n.blue,"--idos-ui-blue-deep":n.blueDeep,"--idos-ui-red":n.red,"--idos-ui-red-deep":n.redDeep,"--idos-ui-shadow":n.shadow,"--idos-ui-backdrop":n.backdrop,"--idos-ui-on-green":n.onGreen,"--idos-ui-on-gold":n.onGold,"--idos-ui-on-blue":n.onBlue,"--idos-ui-on-red":n.onRed,"--idos-ui-on-green-outline":H(n.onGreen),"--idos-ui-on-gold-outline":H(n.onGold),"--idos-ui-on-blue-outline":H(n.onBlue),"--idos-ui-on-red-outline":H(n.onRed),"--idos-ui-text-outline":n.textOutline,"--idos-ui-line":n.line,"--idos-ui-well":n.well,"--idos-ui-well-soft":n.wellSoft,"--idos-ui-well-shadow":n.wellShadow,"--idos-ui-edge":n.edge,"--idos-ui-glow":n.glow,"--idos-ui-panel-shadow":n.panelShadow,"--idos-ui-radius":`${n.radius}px`,"--idos-ui-button-radius":`${n.buttonRadius}px`,"--idos-ui-font":n.font,"--idos-ui-fast":`${o.fast}ms`,"--idos-ui-normal":`${o.normal}ms`,"--idos-ui-slow":`${o.slow}ms`,"--idos-ui-k":String(i?t.motion.intensity:0)}}var a={bgTop:"var(--idos-ui-bg-top)",bgBottom:"var(--idos-ui-bg-bottom)",panel:"var(--idos-ui-panel)",panelDeep:"var(--idos-ui-panel-deep)",panelEdge:"var(--idos-ui-panel-edge)",text:"var(--idos-ui-text)",textDim:"var(--idos-ui-text-dim)",gold:"var(--idos-ui-gold)",goldDeep:"var(--idos-ui-gold-deep)",green:"var(--idos-ui-green)",greenDeep:"var(--idos-ui-green-deep)",blue:"var(--idos-ui-blue)",blueDeep:"var(--idos-ui-blue-deep)",red:"var(--idos-ui-red)",redDeep:"var(--idos-ui-red-deep)",shadow:"var(--idos-ui-shadow)",backdrop:"var(--idos-ui-backdrop)",onGreen:"var(--idos-ui-on-green)",onGold:"var(--idos-ui-on-gold)",onBlue:"var(--idos-ui-on-blue)",onRed:"var(--idos-ui-on-red)",onGreenOutline:"var(--idos-ui-on-green-outline)",onGoldOutline:"var(--idos-ui-on-gold-outline)",onBlueOutline:"var(--idos-ui-on-blue-outline)",onRedOutline:"var(--idos-ui-on-red-outline)",textOutline:"var(--idos-ui-text-outline)",line:"var(--idos-ui-line)",well:"var(--idos-ui-well)",wellSoft:"var(--idos-ui-well-soft)",wellShadow:"var(--idos-ui-well-shadow)",edge:"var(--idos-ui-edge)",glow:"var(--idos-ui-glow)",panelShadow:"var(--idos-ui-panel-shadow)",radius:"var(--idos-ui-radius)",buttonRadius:"var(--idos-ui-button-radius)",font:"var(--idos-ui-font)",fast:"var(--idos-ui-fast)",normal:"var(--idos-ui-normal)",slow:"var(--idos-ui-slow)"},x={color:a.text,fontWeight:800,textShadow:a.textOutline,letterSpacing:.2},U={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},He=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Ye={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},le="cubic-bezier(.2, .9, .3, 1.25)",Y="cubic-bezier(.2, .8, .2, 1)",ue="cubic-bezier(.5, 0, .75, .2)",je=`
|
|
2
2
|
@keyframes idos-pop-in { 0% { transform: scale(.7); opacity: 0 } 65% { transform: scale(calc(1 + .06 * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: scale(1); opacity: 1 } }
|
|
3
3
|
@keyframes idos-pop-out { 0% { transform: scale(1); opacity: 1 } 30% { transform: scale(calc(1 + .03 * var(--idos-ui-k, 1))) } 100% { transform: scale(.75); opacity: 0 } }
|
|
4
4
|
@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }
|
|
36
36
|
.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }
|
|
37
37
|
[data-idos-motion="off"] .idos-shine::after, [data-idos-motion="off"] .idos-bounce, [data-idos-motion="off"] .idos-glow, [data-idos-motion="off"] .idos-pulse, [data-idos-motion="off"] .idos-bump { animation: none }
|
|
38
|
-
`;function Et(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function Ut(t){return t.kind==="currency"?[t.id]:t.kind==="item"?[`item:${t.id}`,"inventory"]:[]}var j=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setMotion(e){this.motion=e;}setPlayer(e){this.player=e;}setLayer(e){this.layerEl=e;}holding(e){return (this.holds.get(e)??0)+(this.reserved.get(e)??0)}reserve(e){if(this.motion?.rewardFlight){for(let n of e)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(e){let n=false;for(let o of e){if(o.kind!=="currency")continue;let i=(this.reserved.get(o.id)??0)-1;i<=0?this.reserved.delete(o.id):this.reserved.set(o.id,i),n=true;}n&&this.changed();}fly(e,n){if(!this.motion?.rewardFlight||!this.layerEl||typeof document>"u")return;let o=this.layerEl.getBoundingClientRect(),i=Math.max(200,this.motion.durations.slow+180),r=[];for(let u of e){let l=Ut(u).map(y=>({key:y,el:document.querySelector(`[data-resource-counter="${It(y)}"]`)})).find(y=>y.el&&xn(y.el));if(!l?.el)continue;let d=je(l.el.getBoundingClientRect(),o),p=n(u),c=p?je(p,o):{x:o.width/2,y:o.height/2},f=Et(u.amount);for(let y=0;y<f;y++)r.push({key:this.nextKey++,line:u,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:y*55,durationMs:i,target:l.key}),this.holds.set(l.key,(this.holds.get(l.key)??0)+1);}this.release(e),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(e){let n=this.flights.find(i=>i.key===e);if(!n)return;this.flights=this.flights.filter(i=>i.key!==e);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),kn(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(e){if(!this.motion?.particles||!this.layerEl||!e)return;let n=je(e.getBoundingClientRect(),this.layerEl.getBoundingClientRect()),o=this.nextKey++;this.bursts=[...this.bursts,{key:o,at:n}],this.changed(),setTimeout(()=>{this.bursts=this.bursts.filter(i=>i.key!==o),this.changed();},900);}changed(){this.version+=1;for(let e of this.listeners)e();}};function je(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function xn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function kn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${It(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function It(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var Dt=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",$t="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function At(t){if(!(t instanceof HTMLElement)||t.hasAttribute($t))return;t.setAttribute($t,"");let e=t.style,n=Q(1.6,2.8);e.setProperty("--idos-float-speed",n.toFixed(2)),e.setProperty("--idos-float-phase",(-Q(0,n)).toFixed(2)),e.setProperty("--idos-float-amp",Q(3,7).toFixed(1)),e.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*Q(0,1.5)).toFixed(2));let o=Q(5,7.5);e.setProperty("--idos-shine-speed",o.toFixed(2)),e.setProperty("--idos-shine-phase",(-Q(0,o)).toFixed(2));}function Qe(t){t instanceof Element&&(t.matches(Dt)&&At(t),t.querySelectorAll(Dt).forEach(At));}function Ot(t){if(typeof MutationObserver>"u")return ()=>{};Qe(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?Qe(o.target):o.addedNodes.forEach(Qe);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Bt="idos-ui-prefs";function Mn(){try{return Fe(typeof localStorage<"u"?localStorage.getItem(Bt):null)}catch{return {...B}}}function Nn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Kt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&Nn(),o=t.motion.enabled&&!n;return {on:o,durations:se(t.motion,n),intensity:o?t.motion.intensity:0,rewardFlight:o&&t.motion.rewardFlight,particles:o&&t.motion.particles,stagger:o&&t.motion.stagger}}var zt=Se(null),Pn=new j,Ln={config:zt,prefs:B,setPrefs:()=>{},motion:Kt(zt,B),play:()=>{},layer:null,fx:Pn,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Ft=react.createContext(Ln);function b(){return react.useContext(Ft)}function Tn(){return b().play}function En(){return b().motion}function Un(){let t=b();return [t.prefs,t.setPrefs]}function In(){return b().celebrate}function Dn(){return b().toast}function $n(){return b().notify}function An({config:t,children:e,overlays:n,notifications:o}){let i=react.useMemo(()=>Se(t),[t]),[r,u]=react.useState(Mn),l=react.useCallback(w=>{u(V=>{let Mt={...V,...w};try{localStorage.setItem(Bt,JSON.stringify(Mt));}catch{}return Mt});},[]),d=react.useRef(null);d.current??=new ae(i.sound,r),react.useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),react.useEffect(()=>{let w=d.current;return w?.attach(),()=>w?.dispose()},[]);let p=react.useCallback(w=>d.current?.play(w),[]),c=react.useMemo(()=>Kt(i,r),[i,r]),f=react.useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[y,v]=react.useState(null);react.useEffect(()=>f.setLayer(y),[f,y]);let[R,T]=react.useState(null),D=react.useRef(R);D.current=R;let L=react.useCallback((w,V)=>{if(w.length===0){V?.onDone?.();return}f.reserve(w),T({lines:w,options:V});},[f]),W=react.useCallback(()=>{let w=D.current;w&&f.release(w.lines),T(null),w?.options?.onDone?.();},[f]),ke=react.useRef(null),P=o??(ke.current??=We());react.useEffect(()=>(P.setPlayer(p),()=>P.setPlayer(null)),[P,p]);let q=react.useMemo(()=>({toast:w=>P.toast(w),alert:w=>P.alert(w),dismiss:w=>P.dismiss(w)}),[P]),E=react.useCallback((w,V="info")=>{P.toast({message:w,level:V});},[P]),ie=react.useMemo(()=>({config:i,prefs:r,setPrefs:l,motion:c,play:p,layer:y,fx:f,celebrate:L,toast:E,notify:q,provided:true}),[i,r,l,c,p,y,f,L,E,q]),re=react.useRef(null);react.useEffect(()=>re.current?Ot(re.current):void 0,[]);let G=!c.on;return jsxRuntime.jsx(Ft.Provider,{value:ie,children:jsxRuntime.jsxs("div",{ref:re,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...qe(i,G)},children:[jsxRuntime.jsx("style",{children:Ye}),e,jsxRuntime.jsx("div",{ref:v,"data-idos-ui-layer":"",style:{position:"absolute",inset:0,zIndex:50,pointerEvents:"none",fontFamily:"var(--idos-ui-font)",overflow:"hidden"},children:n?.({celebration:R,finishCelebration:W,notifications:P})})]})})}function fe(t){let{fx:e}=b();return react.useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var Gt=typeof window<"u"?react.useLayoutEffect:react.useEffect;var Kn=react.createContext(null);function K(){return react.useContext(Kn)}function Ze(){if(typeof navigator>"u")return "en";let t=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(e=>t.startsWith(e))?"ru":"en"}function _t(t,e,n=Ze()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function Fn(t,e,n=Ze()){let[o,i=o,r=i]=e.split("|"),u=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?u==="one"?o:u==="few"?i:r:u==="one"?o:i}var Gn={close:"Close",back:"Back",confirm:"Confirm",cancel:"Cancel",youGot:"You got",great:"Great!",loading:"Loading\u2026",ok:"OK",loadingNamed:"Loading {name}\u2026",stillLoading:"Still loading \u2014 the first start can take a little longer",retry:"Retry",error:"Something went wrong",notEnough:"Not enough resources",offline:"No connection. Retrying\u2026",more:"More",menu:"Menu",nothingHere:"Nothing here yet",economy:"Economy",events:"Activities",social:"Social",profile:"Profile",other:"Other",free:"Free",claim:"Claim",claimAll:"Claim all",tokenEvent:"Event points",tokenSeason:"Season status",tokenQuest:"Quest points",tokenScore:"Rating points"},_n={close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",back:"\u041D\u0430\u0437\u0430\u0434",confirm:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0430",youGot:"\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438",great:"\u041E\u0442\u043B\u0438\u0447\u043D\u043E!",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",ok:"\u041F\u043E\u043D\u044F\u0442\u043D\u043E",loadingNamed:"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \xAB{name}\xBB\u2026",stillLoading:"\u0415\u0449\u0451 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u2014 \u043F\u0435\u0440\u0432\u044B\u0439 \u0437\u0430\u043F\u0443\u0441\u043A \u0431\u044B\u0432\u0430\u0435\u0442 \u0434\u043E\u043B\u044C\u0448\u0435",retry:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",error:"\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A",notEnough:"\u041D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432",offline:"\u041D\u0435\u0442 \u0441\u0432\u044F\u0437\u0438. \u041F\u0440\u043E\u0431\u0443\u0435\u043C \u0441\u043D\u043E\u0432\u0430\u2026",more:"\u0415\u0449\u0451",menu:"\u041C\u0435\u043D\u044E",nothingHere:"\u041F\u043E\u043A\u0430 \u043F\u0443\u0441\u0442\u043E",economy:"\u042D\u043A\u043E\u043D\u043E\u043C\u0438\u043A\u0430",events:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F",social:"\u0414\u0440\u0443\u0437\u044C\u044F \u0438 \u043E\u0431\u0449\u0435\u043D\u0438\u0435",profile:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",other:"\u0420\u0430\u0437\u043D\u043E\u0435",free:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E",claim:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C",claimAll:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0451",tokenEvent:"\u041E\u0447\u043A\u0438 \u0438\u0432\u0435\u043D\u0442\u0430",tokenSeason:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0437\u043E\u043D\u0430",tokenQuest:"\u041E\u0447\u043A\u0438 \u0437\u0430\u0434\u0430\u043D\u0438\u0439",tokenScore:"\u041E\u0447\u043A\u0438 \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u0430"},k=_t(Gn,_n);function Wn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?k("notEnough"):t.length>140?`${t.slice(0,140)}\u2026`:t:k("error")}function nt(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?e.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?e.push({kind:"item",id:n.ItemID,amount:o}):e.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of t?.EventTokens??[]){let o=n?.Address?.Type,i=(n?.Address?.EntityID??"").split(":")[0];if(!o||!i)continue;let r=Number(n?.Applied??n?.Amount??0);!Number.isFinite(r)||r<=0||e.push({kind:"token",id:`${o}:${i}`,amount:r});}return Wt(e)}function ot(t){let e=t.id.indexOf(":");return e<0?{system:t.id,entity:""}:{system:t.id.slice(0,e),entity:t.id.slice(e+1)}}function pe(t){switch(ot(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function it(t,e){let{system:n,entity:o}=ot(t);return n==="TimedEvent"?(e?ge(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||k("tokenEvent"):n==="Season"?k("tokenSeason"):n==="Quest"?k("tokenQuest"):n==="Leaderboard"?k("tokenScore"):t.id}function Wt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function qt(t){return nt(t?.Standard)}function qn(t){return nt(t?.Standard)}function Vn(t){let e=t?.Resources?.Grant;return qt(e)}function Hn(t,e){return t.every(n=>n.kind!=="currency"||Number(e?.[n.id]?.Amount??0)>=n.amount)}function A(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${et(t/1e9)}B`:e>=1e6?`${et(t/1e6)}M`:e>=1e5?`${et(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function et(t){return t.toFixed(2).replace(/\.?0+$/,"")}function rt(t,e){if(!t)return null;let n=new Date(t).getTime()-e;if(!Number.isFinite(n)||n<=0)return null;let o=Math.floor(n/1e3),i=Math.floor(o/3600),r=Math.floor(o%3600/60),u=o%60;return i>=24?`${Math.floor(i/24)}d ${i%24}h`:i>0?`${i}h ${String(r).padStart(2,"0")}m`:`${r}m ${String(u).padStart(2,"0")}s`}var Vt=640,Ht=1024;function me(t){return t>=Ht?"desktop":t>=Vt?"tablet":"phone"}function ge(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function st(t){let e=new Map;for(let n of Object.values(t?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&e.set(i.ItemID??o,i);return e}var tt=["Legendary","Epic","Rare","Uncommon","Common"];function Yn(t){let e=tt.indexOf(t??"");return e<0?tt.length:e}function at(t,e){let n=new Map;for(let o of t){let i=e(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}var Yt=["coin","gem","potion","scroll","sword","shield","crown","gift","bag","box","trophy","calendar","star","check","lock","shop","chest","quest","user","logout","copy","hero","hammer","market","flame","ticket","friends","chat","link","swords","gear","globe","sound","mute","bell","bulb","menu","close","back","plus","energy","heart","offer","clock","trash","edit"];function jt(t){return Yt.includes(t)}function lt(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function ut(t,e){let n={potion:"potion",scroll:"scroll",weapon:"sword",sword:"sword",armor:"shield",shield:"shield",helmet:"hero",crown:"crown",chest:"chest",lootbox:"chest",gift:"gift",ticket:"ticket"};for(let o of [...t??[],e??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var jn=/^(https?:|\/|data:)/;function N({glyph:t,size:e=24,color:n}){return jt(t)?jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:Qn(t,n)}):jn.test(t)?jsxRuntime.jsx("img",{src:t,alt:"",width:e,height:e,style:{flex:"none",display:"block",objectFit:"contain"}}):jsxRuntime.jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:e,height:e,fontSize:e*.8,lineHeight:1},children:t})}function Qn(t,e){switch(t){case "coin":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"12",fill:"#c77a0c"}),jsxRuntime.jsx("circle",{cx:"16",cy:"15",r:"12",fill:e??"#ffcf3a"}),jsxRuntime.jsx("circle",{cx:"16",cy:"15",r:"8.5",fill:"none",stroke:"#e89a12",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M16 9.5v11M13 12.5h4.5a2 2 0 010 4H13",stroke:"#b86d06",strokeWidth:"2.2",fill:"none",strokeLinecap:"round"})]});case "gem":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M9 5h14l6 8-13 15L3 13z",fill:e??"#5ce1ff"}),jsxRuntime.jsx("path",{d:"M9 5l3 8h8l3-8M3 13h26M12 13l4 15 4-15",fill:"none",stroke:"#1f8fc7",strokeWidth:"1.6",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M11 7l2 5",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",opacity:".8"})]});case "potion":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"12.5",y:"3",width:"7",height:"6",rx:"1.5",fill:"#c9a36a"}),jsxRuntime.jsx("path",{d:"M13 9h6v4l6 8a7 7 0 01-6 9h-6a7 7 0 01-6-9l6-8z",fill:e??"#ff5a7a"}),jsxRuntime.jsx("path",{d:"M9 21h14",stroke:"#fff",strokeWidth:"1.5",opacity:".45"}),jsxRuntime.jsx("circle",{cx:"13",cy:"22",r:"1.6",fill:"#fff",opacity:".7"})]});case "scroll":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"6",y:"7",width:"20",height:"18",rx:"2",fill:e??"#f3dca2"}),jsxRuntime.jsx("rect",{x:"4",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsxRuntime.jsx("rect",{x:"24",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsxRuntime.jsx("path",{d:"M11 12h10M11 16h10M11 20h7",stroke:"#9c7338",strokeWidth:"1.8",strokeLinecap:"round"})]});case "sword":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M22 3l7 0 0 7L14 25l-4-3z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M24 5L12 21",stroke:"#fff",strokeWidth:"1.4",opacity:".7"}),jsxRuntime.jsx("path",{d:"M6 19l7 7",stroke:"#8a5a26",strokeWidth:"3.4",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M4 27l3 -3",stroke:"#e0b44a",strokeWidth:"4",strokeLinecap:"round"})]});case "shield":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3l11 4v8c0 7-5 12-11 14C10 27 5 22 5 15V7z",fill:e??"#b57a3c"}),jsxRuntime.jsx("path",{d:"M16 6l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V9z",fill:"#d89b54"}),jsxRuntime.jsx("path",{d:"M16 6v20M8 14h16",stroke:"#8a5424",strokeWidth:"1.8"})]});case "crown":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 11l6 5 6-9 6 9 6-5-3 14H7z",fill:e??"#ffcf3a"}),jsxRuntime.jsx("rect",{x:"7",y:"24",width:"18",height:"4",rx:"1.5",fill:"#e89a12"}),jsxRuntime.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"#ff5a7a"}),jsxRuntime.jsx("circle",{cx:"10",cy:"20",r:"1.4",fill:"#5ce1ff"}),jsxRuntime.jsx("circle",{cx:"22",cy:"20",r:"1.4",fill:"#5ce1ff"})]});case "gift":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"13",width:"22",height:"15",rx:"2",fill:e??"#ff6b8b"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"26",height:"6",rx:"2",fill:"#ff8aa3"}),jsxRuntime.jsx("rect",{x:"14",y:"9",width:"4",height:"19",fill:"#ffd24a"}),jsxRuntime.jsx("path",{d:"M16 9c-2-5-8-5-7-1 1 2 5 1 7 1zm0 0c2-5 8-5 7-1-1 2-5 1-7 1z",fill:"#ffd24a"})]});case "bag":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M11 9h10l5 5v11a4 4 0 01-4 4H10a4 4 0 01-4-4V14z",fill:e??"#c98a3c"}),jsxRuntime.jsx("path",{d:"M11 9l2-5h6l2 5",fill:"#a86c26"}),jsxRuntime.jsx("circle",{cx:"16",cy:"19",r:"4.5",fill:"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M16 16.5v5",stroke:"#b86d06",strokeWidth:"1.8",strokeLinecap:"round"})]});case "trophy":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M9 4h14v7a7 7 0 01-14 0z",fill:e??"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M9 7H4c0 5 3 7 6 7M23 7h5c0 5-3 7-6 7",fill:"none",stroke:"#e89a12",strokeWidth:"2.2"}),jsxRuntime.jsx("rect",{x:"14",y:"17",width:"4",height:"6",fill:"#e89a12"}),jsxRuntime.jsx("rect",{x:"9",y:"23",width:"14",height:"5",rx:"1.5",fill:"#b86d06"})]});case "calendar":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"4",y:"6",width:"24",height:"22",rx:"3",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"4",y:"6",width:"24",height:"7",rx:"3",fill:e??"#ff5a5a"}),jsxRuntime.jsx("path",{d:"M10 3v6M22 3v6",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M10 18h3M15 18h3M20 18h3M10 23h3M15 23h3",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"})]});case "star":return jsxRuntime.jsx("path",{d:"M16 3l3.9 8 8.6 1.2-6.3 6 1.6 8.6L16 22.7 8.2 26.8l1.6-8.6-6.3-6 8.6-1.2z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "check":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"13",fill:e??"#59d35b"}),jsxRuntime.jsx("path",{d:"M9.5 16.5l4.5 4.5 8.5-9",fill:"none",stroke:"#fff",strokeWidth:"3.4",strokeLinecap:"round",strokeLinejoin:"round"})]});case "lock":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M10 14v-4a6 6 0 0112 0v4",fill:"none",stroke:"#8e95b8",strokeWidth:"3"}),jsxRuntime.jsx("rect",{x:"7",y:"14",width:"18",height:"14",rx:"3",fill:e??"#c3c8e3"}),jsxRuntime.jsx("circle",{cx:"16",cy:"21",r:"2.2",fill:"#5b6187"})]});case "shop":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 12l3-7h18l3 7z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("path",{d:"M4 12h24v2a3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0z",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"6",y:"16",width:"20",height:"12",rx:"1.5",fill:"#ffd9a8"}),jsxRuntime.jsx("rect",{x:"13",y:"20",width:"6",height:"8",fill:"#c98a3c"})]});case "chest":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 13a11 7 0 0122 0v2H5z",fill:e??"#b57a3c"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"2",fill:"#d89b54"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"3",fill:"#8a5424"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"4",height:"7",rx:"1",fill:"#ffd24a"})]});case "quest":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"20",height:"24",rx:"3",fill:"#f3dca2"}),jsxRuntime.jsx("path",{d:"M11 11l2 2 4-4M11 18l2 2 4-4",fill:"none",stroke:e??"#2b9936",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M19 12h3M19 19h3",stroke:"#9c7338",strokeWidth:"2",strokeLinecap:"round"})]});case "user":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"14",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"12.5",r:"5.2",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M6.5 25.5a10 7 0 0119 0A13.6 13.6 0 0116 30a13.6 13.6 0 01-9.5-4.5z",fill:"#fff"})]});case "logout":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M18 5H9a3 3 0 00-3 3v16a3 3 0 003 3h9",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})]});case "copy":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"10",y:"10",width:"16",height:"18",rx:"3",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6"}),jsxRuntime.jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "hero":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M6 15a10 10 0 0120 0v5H6z",fill:e??"#b8c4d9"}),jsxRuntime.jsx("path",{d:"M6 15a10 10 0 0120 0",fill:"none",stroke:"#6f7c99",strokeWidth:"1.6"}),jsxRuntime.jsx("rect",{x:"9",y:"16",width:"14",height:"3",rx:"1",fill:"#2a3150"}),jsxRuntime.jsx("path",{d:"M16 3v5",stroke:"#ff5a5a",strokeWidth:"3",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M8 20h16l-2 8H10z",fill:"#8a96b3"})]});case "hammer":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M14 13l12 12-3 3-12-12z",fill:"#a8743d"}),jsxRuntime.jsx("path",{d:"M5 9l7-6 8 8-7 6z",fill:e??"#c3c8e3"}),jsxRuntime.jsx("path",{d:"M5 9l7-6 2 2-7 6z",fill:"#e6e9f7"})]});case "market":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M3 11l3-7h20l3 7z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M3 11h26v2a3 3 0 01-6.5 0 3 3 0 01-6.5 0 3 3 0 01-6.5 0A3 3 0 013 13z",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"1.5",fill:"#d8e7ff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"21.5",r:"4",fill:"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M16 19.5v4",stroke:"#b86d06",strokeWidth:"1.6",strokeLinecap:"round"})]});case "flame":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3c1 5 8 8 8 16a8 8 0 01-16 0c0-4 2-6 3-8 1 3 3 4 3 4 0-5 1-8 2-12z",fill:e??"#ff7a2e"}),jsxRuntime.jsx("path",{d:"M16 15c1 3 4 4 4 8a4 4 0 01-8 0c0-2 1-3 2-4 .5 1 1.5 1.5 1.5 1.5 0-2 .2-3.5.5-5.5z",fill:"#ffd24a"})]});case "ticket":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 9h24v4a3 3 0 000 6v4H4v-4a3 3 0 000-6z",fill:e??"#b879ff"}),jsxRuntime.jsx("path",{d:"M20 9v14",stroke:"#fff",strokeWidth:"1.6",strokeDasharray:"2 2"}),jsxRuntime.jsx("path",{d:"M11 13l1.2 2.4 2.6.4-1.9 1.8.5 2.6-2.4-1.3-2.3 1.3.4-2.6-1.9-1.8 2.6-.4z",fill:"#ffd24a"})]});case "friends":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"4.5",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"21.5",cy:"12",r:"4",fill:"#59d35b"}),jsxRuntime.jsx("path",{d:"M15 26a7 6.5 0 0114 0z",fill:"#59d35b"})]});case "chat":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 7a3 3 0 013-3h18a3 3 0 013 3v12a3 3 0 01-3 3H13l-6 5v-5H7a3 3 0 01-3-3z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"11",cy:"13",r:"1.8",fill:"#fff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"13",r:"1.8",fill:"#fff"}),jsxRuntime.jsx("circle",{cx:"21",cy:"13",r:"1.8",fill:"#fff"})]});case "link":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M13 19l6-6",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M14 9l2-2a5 5 0 017 7l-2 2M18 23l-2 2a5 5 0 01-7-7l2-2",fill:"none",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M8 22l4 4M24 22l-4 4",stroke:"#8a5a26",strokeWidth:"3.2",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M6 20l6 6M26 20l-6 6",stroke:"#e0b44a",strokeWidth:"2",strokeLinecap:"round"})]});case "gear":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M14 3h4l.7 3.3 2.6 1.1 2.8-1.9 2.8 2.8-1.9 2.8 1.1 2.6L29 14v4l-3.3.7-1.1 2.6 1.9 2.8-2.8 2.8-2.8-1.9-2.6 1.1L18 29h-4l-.7-3.3-2.6-1.1-2.8 1.9-2.8-2.8 1.9-2.8-1.1-2.6L3 18v-4l3.3-.7 1.1-2.6-1.9-2.8 2.8-2.8 2.8 1.9 2.6-1.1z",fill:e??"#aeb6f0"}),jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"4.5",fill:"#2c3480"})]});case "globe":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M4 16h24M16 4c-4 4-4 20 0 24M16 4c4 4 4 20 0 24",fill:"none",stroke:"#fff",strokeWidth:"1.6"})]});case "sound":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:e??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "bell":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 4a8 8 0 018 8v6l3 4H5l3-4v-6a8 8 0 018-8z",fill:e??"#ffd24a"}),jsxRuntime.jsx("circle",{cx:"16",cy:"26",r:"3",fill:"#e89a12"})]});case "bulb":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3a9 9 0 015 16.5V23h-10v-3.5A9 9 0 0116 3z",fill:e??"#ffe066"}),jsxRuntime.jsx("rect",{x:"11",y:"24",width:"10",height:"3",rx:"1",fill:"#aeb6f0"}),jsxRuntime.jsx("rect",{x:"12.5",y:"27.5",width:"7",height:"2.5",rx:"1",fill:"#8e95b8"})]});case "menu":return jsxRuntime.jsx("path",{d:"M6 9h20M6 16h20M6 23h20",stroke:e??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsxRuntime.jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsxRuntime.jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsxRuntime.jsx("path",{d:"M16 7v18M7 16h18",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsxRuntime.jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "heart":return jsxRuntime.jsx("path",{d:"M16 27S4 20 4 11.5A6.5 6.5 0 0116 8a6.5 6.5 0 0112 3.5C28 20 16 27 16 27z",fill:e??"#ff5a7a"});case "offer":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("circle",{cx:"21",cy:"9",r:"2.2",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M11 17l6-6",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round"})]});case "clock":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M16 9v7l5 3",fill:"none",stroke:"#2c3480",strokeWidth:"2.6",strokeLinecap:"round"})]});case "trash":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M8 10h16l-1.5 17h-13z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:e??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:e??"#ff5a5a"})]});case "edit":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:e??"#ffd24a"}),jsxRuntime.jsx("path",{d:"M20 8l2-2a2.8 2.8 0 014 4l-2 2",fill:"#e89a12"})]});default:return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3l12 6v14l-12 6-12-6V9z",fill:e??"#9aa6ff"}),jsxRuntime.jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function Jn(t){let[e,n]=react.useState("phone");return Gt(()=>{let o=t.current;if(!o)return;let i=()=>n(me(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[t]),e}function Pe(){let{layer:t}=b(),e=react.useRef(null);e.current=t;let[n,o]=react.useState(()=>t?me(t.getBoundingClientRect().width):"phone");return react.useEffect(()=>{if(!t)return;let i=()=>o(me(t.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(t),()=>r.disconnect()},[t]),n}function Le(t,e){let[n,o]=react.useState(t),[i,r]=react.useState(false);return react.useEffect(()=>{if(t){o(true),r(false);return}if(!n)return;if(e<=0){o(false);return}r(true);let u=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(u)},[t,e,n]),{mounted:n,closing:i}}function Xt(t,e=600,n){let[o,i]=react.useState(t),r=react.useRef(t),u=react.useRef(n);return u.current=n,react.useEffect(()=>{let l=r.current;if(l===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let y=Math.min(1,(f-d)/e),v=1-Math.pow(1-y,3),R=Math.round(l+(t-l)*v);R!==r.current&&u.current?.(),r.current=R,i(R),y<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function ct(t,e){let n=b(),o=fe(u=>u.holding(t)>0),i=react.useRef(e);o||(i.current=e);let r=o?i.current:e;return Xt(r,n.motion.on?650:0,()=>n.play("countTick"))}function O(){let t=K(),e=b(),[,n]=react.useReducer(l=>l+1,0);react.useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=react.useMemo(()=>t&&o?st(ge(t,"Item")):new Map,[t,o]),r=react.useMemo(()=>t&&o?ge(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),u=react.useCallback(l=>l?t?.localization.has(l)?t.localization.t(l):l:"",[t]);return react.useMemo(()=>({items:i,currencies:r,localize:u,currencyName:l=>u(r[l]?.DisplayName||l),itemName:l=>u(i.get(l)?.DisplayName||l),iconOf:l=>{if(l.kind==="currency")return r[l.id]?.ImagePath||lt(l.id);if(l.kind==="item"){let d=i.get(l.id);return d?.ImagePath||ut(d?.Tags,d?.ItemClass)}return "box"},rarityColor:l=>e.config.theme.rarity[l??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,u,e.config.theme.rarity])}function ft(){let t=K(),e=O(),[,n]=react.useReducer(r=>r+1,0);react.useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(e.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,u])=>[r,Number(u?.Amount??0)]).sort(([r],[u])=>r.localeCompare(u))}function Zn(t=1e3){let[e,n]=react.useState(()=>Date.now());return react.useEffect(()=>{let o=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(o)},[t]),e}var Te={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ee={green:{color:a.onGreen,textShadow:a.onGreenOutline},gold:{color:a.onGold,textShadow:a.onGoldOutline},blue:{color:a.onBlue,textShadow:a.onBlueOutline},red:{color:a.onRed,textShadow:a.onRedOutline},grey:{color:"#ffffff",textShadow:we}};function Ee(t){let[e,n]=Te[t],o=ee[t];return {background:`linear-gradient(180deg, ${e} 0%, ${n} 100%)`,color:o.color,"--idos-ui-text":o.color,"--idos-ui-text-dim":`color-mix(in srgb, ${o.color} 80%, transparent)`,"--idos-ui-text-outline":o.textShadow}}function Jt(t,e=false,n="md"){let[o,i]=Te[e?"grey":t],r=ee[e?"grey":t],u=n==="sm"?"6px 12px":n==="lg"?"12px 22px":"10px 18px";return {...x,...r,fontFamily:a.font,fontSize:n==="sm"?13:n==="lg"?18:16,border:"none",borderRadius:a.buttonRadius,padding:u,minHeight:n==="sm"?34:44,cursor:e?"default":"pointer",background:`linear-gradient(180deg, ${o} 0%, ${i} 100%)`,boxShadow:`0 4px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.35)`,opacity:e?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function z({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:u=false,style:l,className:d="",sound:p="click",title:c,...f}){let{play:y}=b();return jsxRuntime.jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${u&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&y(p),e?.(v);},style:{...Jt(n,i,o),...l},children:r?jsxRuntime.jsx(Zt,{size:18}):t})}function he({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:u}){let{play:l}=b();return jsxRuntime.jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{l("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Te[i][0]}, ${Te[i][1]})`:a.well,color:i?ee[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsxRuntime.jsx(N,{glyph:t,size:o*.55}),u?jsxRuntime.jsx(ye,{count:u}):null]})}function Zt({size:t=28}){return jsxRuntime.jsx("span",{"aria-label":k("loading"),style:{width:t,height:t,borderRadius:"50%",border:`${Math.max(2,t/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function ye({count:t,dot:e=false,style:n}){return !t||t<=0?null:jsxRuntime.jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:e?12:20,height:e?12:20,padding:e?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ee.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function en({line:t,size:e=20,big:n=false,dim:o=false}){let i=O(),r=K();return jsxRuntime.jsxs("span",{title:Ue(t,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsxRuntime.jsx(N,{glyph:t.kind==="token"?pe(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:A(t.amount)]})}function Ue(t,e,n){return t.kind==="currency"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(it(t,n)):t.id}function eo({lines:t,size:e=18,gap:n=8,dimIf:o}){return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:t.map(i=>jsxRuntime.jsx(en,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function pt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=O(),r=ct(t,e);return jsxRuntime.jsxs("div",{"data-resource-counter":t,title:i.currencyName(t),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...He,cursor:o?"pointer":"default"},children:[jsxRuntime.jsx(N,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:A(r)})]})}function to({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:u=false}){let l=O(),{play:d}=b(),p=l.items.get(t),c=l.rarityColor(p?.Metadata?.RarityID);return jsxRuntime.jsxs("button",{type:"button",className:"idos-press",title:l.itemName(t),onClick:o?()=>{d("click"),o();}:void 0,style:{position:"relative",width:i,height:i,borderRadius:16,border:`3px solid ${r?a.text:c}`,background:`radial-gradient(circle at 50% 35%, ${c}55 0%, ${a.panelDeep} 70%)`,boxShadow:r?`0 0 0 3px ${a.gold}, 0 4px 0 ${a.shadow}`:`0 4px 0 ${a.shadow}, inset 0 0 12px ${c}44`,display:"grid",placeItems:"center",cursor:o?"pointer":"default",padding:0,opacity:u?.45:1,flex:"none"},children:[jsxRuntime.jsx(N,{glyph:l.iconOf({kind:"item",id:t,amount:1}),size:i*.56}),e!==void 0&&e>1?jsxRuntime.jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",A(e)]}):null,n!==void 0&&n>0?jsxRuntime.jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function no({value:t,max:e,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,t/Math.max(1,e)*100)),[u,l]=n==="gold"?[a.gold,a.goldDeep]:n==="blue"?[a.blue,a.blueDeep]:[a.green,a.greenDeep];return jsxRuntime.jsxs("div",{style:{position:"relative",height:i,borderRadius:i/2,background:a.wellSoft,boxShadow:a.wellShadow,overflow:"hidden"},children:[jsxRuntime.jsx("div",{style:{width:`${r}%`,height:"100%",background:`linear-gradient(180deg, ${u}, ${l})`,borderRadius:i/2,transition:`width ${a.slow} ${Y}`}}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${A(t)} / ${A(e)}`})]})}function mt({children:t,right:e}){return jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,margin:"4px 4px 10px"},children:[jsxRuntime.jsx("div",{style:{...x,fontSize:19,fontFamily:a.font},children:t}),e]})}function oo({glyph:t,text:e,action:n}){return jsxRuntime.jsxs("div",{style:{...U,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsxRuntime.jsx(N,{glyph:t,size:56}),jsxRuntime.jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function io({children:t,minHeight:e=240}){return jsxRuntime.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function ro({at:t,now:e,label:n}){let o=rt(t,e);return o?jsxRuntime.jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function so({tabs:t,value:e,onChange:n,style:o}){let{play:i}=b();return t.length<2?null:jsxRuntime.jsx("div",{className:"idos-scroll",role:"tablist",style:{display:"flex",gap:6,padding:4,borderRadius:16,background:a.wellSoft,overflowX:"auto",...o},children:t.map(r=>{let u=r.id===e;return jsxRuntime.jsxs("button",{role:"tab","aria-selected":u,type:"button",className:"idos-press",onClick:()=>{u||(i("tab"),n(r.id));},style:{position:"relative",flex:"1 0 auto",border:"none",borderRadius:12,padding:"8px 14px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,whiteSpace:"nowrap",background:u?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:u?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsxRuntime.jsx(N,{glyph:r.glyph,size:20}):null,jsxRuntime.jsx("span",{style:{...x,...u?ee.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsxRuntime.jsx(ye,{count:r.badge}):null]},r.id)})})}function gt(){let{motion:t}=b();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function ao({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=b();return jsxRuntime.jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...U,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:U.border,...e},children:t})}var vt=react.createContext(()=>{});function te(){return react.useContext(vt)}function xt({children:t}){let{layer:e}=b();return e?reactDom.createPortal(t,e):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}var Ie=[],ht=new Set,yt=0,bt=()=>{for(let t of [...ht])t();};function fo(t){let[e]=react.useState(()=>Symbol("auto-popup")),[,n]=react.useState(0),o=react.useRef(false);return react.useEffect(()=>{if(!t){o.current=false;return}Ie.push(e);let i=()=>n(r=>r+1);return ht.add(i),i(),()=>{let r=Ie.indexOf(e);r>=0&&Ie.splice(r,1),ht.delete(i),bt();}},[t,e]),t?(!o.current&&Ie[0]===e&&yt===0&&(o.current=true),o.current):true}function po(t){react.useEffect(()=>{if(t)return yt+=1,bt(),()=>{yt-=1,bt();}},[t]);}function ne({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:u=true,sound:l=true,panelStyle:d,queued:p=false}){let c=b(),f=Pe(),y=c.motion.durations.normal,[v,R]=react.useState(false),T=fo(p&&n);po(!p&&n);let{mounted:D,closing:L}=Le(n&&T&&!v,y),W=react.useRef(e);W.current=e;let ke=react.useRef(false);react.useEffect(()=>{!l||!n||!T||ke.current||(ke.current=true,c.play("open"));},[l,n,T,c]);let P=react.useCallback(()=>{v||(c.play("close"),R(true));},[v,c]);react.useEffect(()=>{v&&!D&&W.current?.();},[v,D]);let q=u&&e!==void 0;if(react.useEffect(()=>{if(!q||!D)return;let G=w=>{w.key==="Escape"&&P();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[q,D,P]),!D)return null;let E=r==="sheet"||r==="auto"&&f==="phone",ie=L,re=E?ie?`idos-sheet-out ${a.normal} ${ue} both`:`idos-sheet-in ${a.slow} ${Y} both`:ie?`idos-pop-out ${a.normal} ${ue} both`:`idos-pop-in ${a.slow} ${le} both`;return jsxRuntime.jsx(xt,{children:jsxRuntime.jsx(vt.Provider,{value:P,children:jsxRuntime.jsx("div",{role:"dialog","aria-modal":"true",onClick:q?P:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:E?"end stretch":"center",padding:E?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${ie?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxRuntime.jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...U,width:E?"100%":`min(${i}px, 100%)`,maxHeight:E?"88%":"min(86vh, 100%)",overflowY:"auto",padding:E?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:E?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:re,...d},children:[E?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:8,left:"50%",width:44,height:5,marginLeft:-22,borderRadius:3,background:a.line}}):null,o?jsxRuntime.jsx("div",{style:{...x,fontSize:21,textAlign:"center",fontFamily:a.font,padding:"0 30px"},children:o}):null,e?jsxRuntime.jsx(he,{glyph:"close",label:k("close"),onClick:P,size:36,tone:"red",style:{position:"absolute",top:E?12:8,right:E?12:8,border:"3px solid #fff"}}):null,t]})})})})}function mo({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxRuntime.jsxs(ne,{title:t,onClose:r,width:380,children:[e,jsxRuntime.jsx(go,{confirmLabel:n,tone:o,onConfirm:i})]})}function go({confirmLabel:t,tone:e,onConfirm:n}){let o=te(),[i,r]=react.useState(false);return jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsxRuntime.jsx(z,{tone:"grey",onClick:o,children:k("cancel")}),jsxRuntime.jsx(z,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(u=>{r(false),u!==true&&o();});},children:t??k("confirm")})]})}function ho({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:u=true}){let l=b(),[d,p]=react.useState(false),{mounted:c,closing:f}=Le(i&&!d,l.motion.durations.normal),y=react.useRef(n);y.current=n,react.useEffect(()=>{l.play("open");},[]),react.useEffect(()=>{d&&!c&&y.current();},[d,c]);let v=react.useCallback(()=>{l.play("close"),p(true);},[l]);return react.useEffect(()=>{if(!c)return;let R=T=>{T.key==="Escape"&&v();};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[c,v]),c?jsxRuntime.jsx(xt,{children:jsxRuntime.jsx(vt.Provider,{value:v,children:jsxRuntime.jsxs("div",{style:{position:l.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:Ve,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ue:Y} both`},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"12px 14px",borderBottom:`2px solid ${a.panelEdge}`,background:a.wellSoft},children:[r?jsxRuntime.jsx(he,{glyph:"back",label:k("back"),onClick:v,size:38}):null,e?jsxRuntime.jsx(N,{glyph:e,size:30}):null,jsxRuntime.jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),u?jsxRuntime.jsx(yo,{}):null,r?null:jsxRuntime.jsx(he,{glyph:"close",label:k("close"),onClick:v,size:38,tone:"red"})]}),jsxRuntime.jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function yo(){let t=ft(),e=Pe(),n=e==="phone"?t.slice(0,2):t;return jsxRuntime.jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsxRuntime.jsx(pt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var Ae={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},kt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function vo({level:t,size:e}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:t==="success"?jsxRuntime.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):t==="error"?jsxRuntime.jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):t==="warning"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 6v8",...n}),jsxRuntime.jsx("circle",{cx:"12",cy:"18.2",r:"1.6",fill:"currentColor"})]}):t==="reward"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"4",y:"10",width:"16",height:"10",rx:"1.5",...n}),jsxRuntime.jsx("path",{d:"M3 10h18M12 10v10M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z",...n,strokeWidth:2.2})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"6.5",r:"1.6",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 11v7",...n})]})})}function rn({level:t,icon:e,size:n}){return jsxRuntime.jsx("span",{style:{...Ee(Ae[t]),width:n,height:n,flex:"none",borderRadius:"50%",display:"grid",placeItems:"center",boxShadow:`0 2px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`},children:e?jsxRuntime.jsx(N,{glyph:e,size:n*.62}):jsxRuntime.jsx(vo,{level:t,size:n*.56})})}function sn({source:t}){return jsxRuntime.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:11,fontWeight:800,letterSpacing:.3,textTransform:"uppercase",color:a.textDim,minWidth:0},children:[t.icon?jsxRuntime.jsx(N,{glyph:t.icon,size:14}):null,jsxRuntime.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function xo(t){return react.useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),react.useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function an({store:t}){xo(t);let e=t.currentAlert;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:"calc(env(safe-area-inset-top, 0px) + 10px)",left:"50%",transform:"translateX(-50%)",width:"min(440px, calc(100% - 20px))",display:"flex",flexDirection:"column",gap:8,zIndex:45,pointerEvents:"none"},children:t.toasts.map(n=>jsxRuntime.jsx(ko,{store:t,toast:n},n.id))}),e?jsxRuntime.jsx(So,{store:t,alert:e,queued:t.queued},e.id):null]})}function ko({store:t,toast:e}){let n=b(),o=e.input,i=Ae[e.level],r=o.duration??_e[e.level],u=t.source(o.source),l=o.actions?.[0],[d,p]=react.useState(false),[c,f]=react.useState(false),y=n.motion.durations.normal,v=react.useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),y));};let R=react.useRef(r);react.useEffect(()=>{R.current=r;},[r,e.revision]),react.useEffect(()=>{if(r<=0||c||d)return;let L=Date.now(),W=setTimeout(()=>v.current(),R.current);return ()=>{clearTimeout(W),R.current-=Date.now()-L;}},[r,c,d,e.revision]);let T=u?.open,D=L=>{L.onPress?.(),L.openFeature&&t.source(L.openFeature)?.open?.(),v.current();};return jsxRuntime.jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:T?()=>{T(),v.current();}:void 0,className:T?"idos-press":void 0,style:{...U,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:T?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${kt[i]}`,animation:`${d?"idos-drop-out":"idos-drop-in"} ${a.normal} ease both`},children:[o.image?jsxRuntime.jsx("img",{src:o.image,alt:"",style:{width:42,height:42,flex:"none",objectFit:"cover",borderRadius:10,border:`2px solid ${kt[i]}`}}):jsxRuntime.jsx(rn,{level:e.level,icon:o.icon,size:34}),jsxRuntime.jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[u?jsxRuntime.jsx(sn,{source:u}):null,o.title?jsxRuntime.jsx("div",{style:{...x,fontSize:15,lineHeight:1.25},children:o.title}):null,o.message?jsxRuntime.jsx("div",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.35,color:o.title?a.textDim:a.text,overflowWrap:"anywhere"},children:o.message}):null,l?jsxRuntime.jsx("div",{style:{marginTop:6},onClick:L=>L.stopPropagation(),children:jsxRuntime.jsx(z,{size:"sm",tone:i,onClick:()=>D(l),children:l.label})}):null]}),e.count>1?jsxRuntime.jsxs("span",{style:{...Ee(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",e.count]}):null,jsxRuntime.jsx("button",{type:"button","aria-label":k("close"),onClick:L=>{L.stopPropagation(),v.current();},style:wo,children:jsxRuntime.jsx(N,{glyph:"close",size:14})}),r>0?jsxRuntime.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:kt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var wo={flex:"none",width:26,height:26,display:"grid",placeItems:"center",border:"none",borderRadius:"50%",background:a.wellSoft,color:a.textDim,cursor:"pointer",padding:0};function So({store:t,alert:e,queued:n}){let o=react.useRef(null);return react.useEffect(()=>t.play(e.level),[t,e.level]),jsxRuntime.jsx(ne,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsxRuntime.jsx(Co,{store:t,alert:e,queued:n,chosen:o})})}function Co({store:t,alert:e,queued:n,chosen:o}){let i=te(),r=e.input,u=Ae[e.level],l=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:k("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&t.source(f.openFeature)?.open?.(),i();};return jsxRuntime.jsxs("div",{role:"alertdialog","aria-label":r.title??r.message??"",style:{display:"grid",gap:12,justifyItems:"center",textAlign:"center"},children:[n>0?jsxRuntime.jsxs("span",{style:{justifySelf:"start",fontSize:12,fontWeight:800,color:a.textDim},children:["+",n]}):null,r.image?jsxRuntime.jsx("img",{src:r.image,alt:"",style:{maxWidth:"100%",maxHeight:180,objectFit:"contain",borderRadius:14}}):jsxRuntime.jsx("div",{className:e.level==="reward"?"idos-bounce":void 0,children:jsxRuntime.jsx(rn,{level:e.level,icon:r.icon,size:64})}),l?jsxRuntime.jsx(sn,{source:l}):null,r.title?jsxRuntime.jsx("div",{style:{...x,fontSize:21,fontFamily:a.font,lineHeight:1.2},children:r.title}):null,r.message?jsxRuntime.jsx("div",{style:{fontSize:15,fontWeight:600,lineHeight:1.45,color:r.title?a.textDim:a.text,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:r.message}):null,jsxRuntime.jsx("div",{style:{display:"grid",gap:8,width:"100%",marginTop:4},children:d.map((f,y)=>f.primary||!p&&y===0?jsxRuntime.jsx(z,{tone:u,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsxRuntime.jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:Ro,children:f.label},f.id??f.label))})]})}var Ro={width:"100%",minHeight:44,borderRadius:a.buttonRadius,border:`1px solid ${a.line}`,background:a.wellSoft,color:a.text,fontFamily:a.font,fontSize:15,fontWeight:800,cursor:"pointer"};function No(t){return jsxRuntime.jsx(Po,{state:t})}function Po({state:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Eo,{}),jsxRuntime.jsx(Io,{}),jsxRuntime.jsx($o,{}),t.celebration?jsxRuntime.jsx(Lo,{lines:t.celebration.lines,title:t.celebration.options?.title,sound:t.celebration.options?.sound,onDone:t.finishCelebration},t.celebration.lines.map(e=>e.id).join()):null,jsxRuntime.jsx(an,{store:t.notifications})]})}var Oe=560;function Lo({lines:t,title:e,sound:n="reward",onDone:o}){let i=b(),r=O(),u=K(),l=react.useRef(new Map),d=react.useRef(false);react.useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(t,c=>l.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxRuntime.jsxs(ne,{title:e??k("youGot"),onClose:()=>{p(),o();},sound:false,variant:"center",width:420,children:[jsxRuntime.jsxs("div",{style:{position:"relative",overflow:"hidden",display:"flex",flexWrap:"wrap",gap:14,justifyContent:"center",padding:"22px 0"},children:[jsxRuntime.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none",maskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)"},children:jsxRuntime.jsx("div",{style:{position:"absolute",width:Oe,height:Oe,left:`calc(50% - ${Oe/2}px)`,top:`calc(50% - ${Oe/2}px)`,background:`repeating-conic-gradient(color-mix(in srgb, ${a.gold} 16%, transparent) 0 12deg, transparent 12deg 24deg)`,animation:i.motion.on?"idos-rays 14s linear infinite":"none",borderRadius:"50%"}})}),t.map((c,f)=>jsxRuntime.jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${le} ${i.motion.on?.12*f:0}s both`},children:[jsxRuntime.jsx("div",{ref:y=>{y&&l.current.set(`${c.kind}:${c.id}`,y);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsxRuntime.jsx(N,{glyph:c.kind==="token"?pe(c):r.iconOf(c),size:46})}),jsxRuntime.jsxs("div",{style:{...x,fontSize:16},children:["+",A(c.amount)]}),jsxRuntime.jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ue(c,r,u)})]},`${c.kind}:${c.id}`))]}),jsxRuntime.jsx(To,{onPress:p})]})}function To({onPress:t}){let e=te();return jsxRuntime.jsx(z,{attract:true,onClick:()=>{t(),e();},children:k("great")})}function Eo(){let t=fe(e=>e.flights);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx(Uo,{flight:e},e.key))})}function Uo({flight:t}){let e=react.useRef(null),n=b(),o=O();return react.useLayoutEffect(()=>{let i=e.current;if(!i||typeof i.animate!="function"){n.fx.arrive(t.key);return}let r=t.to.x-t.from.x,u=t.to.y-t.from.y,l=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${l}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${u}px) scale(.55)`,opacity:1}],{duration:t.durationMs,delay:t.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(t.key),()=>{d.onfinish=null,d.cancel();}},[]),jsxRuntime.jsx("div",{ref:e,style:{position:"absolute",left:t.from.x-16,top:t.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsxRuntime.jsx(N,{glyph:o.iconOf(t.line),size:32})})}var ln=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function Io(){let t=fe(e=>e.bursts);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx(Do,{x:e.at.x,y:e.at.y},e.key))})}function Do({x:t,y:e}){let n=react.useRef(null);return react.useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,u)=>{if(typeof r.animate!="function")return;let l=u/16*Math.PI*2+Math.random()*.3,d=50+Math.random()*60;i.push(r.animate([{transform:"translate(0,0) scale(1)",opacity:1},{transform:`translate(${Math.cos(l)*d}px, ${Math.sin(l)*d+20}px) scale(.2)`,opacity:0}],{duration:650+Math.random()*200,easing:"cubic-bezier(.1,.8,.3,1)",fill:"forwards"}));}),()=>i.forEach(r=>r.cancel())},[]),jsxRuntime.jsx("div",{ref:n,style:{position:"absolute",left:t,top:e,width:0,height:0,zIndex:61,pointerEvents:"none"},children:Array.from({length:16},(o,i)=>jsxRuntime.jsx("span",{style:{position:"absolute",left:-4,top:-4,width:8,height:8,borderRadius:i%3===0?2:"50%",background:ln[i%ln.length]}},i))})}function $o(){let t=K(),[e,n]=react.useState(false);return react.useEffect(()=>{if(!t)return;let o,i=t.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[t]),e?jsxRuntime.jsx("div",{role:"alert",style:{position:"absolute",top:"calc(8px + env(safe-area-inset-top))",left:"50%",transform:"translateX(-50%)",zIndex:45,padding:"6px 14px",borderRadius:999,background:a.red,...x,color:a.onRed,textShadow:a.onRedOutline,fontSize:13,pointerEvents:"none",animation:`idos-rise-in ${a.normal} ease both`},children:k("offline")}):null}var Rt=["economy","events","social","profile","other"];function fn(t){return [...t].sort((e,n)=>{let o=Rt.indexOf(e.group??"other")-Rt.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function Ao({items:t,onOpen:e}){let{play:n}=b(),o=gt(),i=at(fn(t),u=>u.group??"other"),r=0;return jsxRuntime.jsx("div",{style:{display:"grid",gap:18},children:i.map(u=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(mt,{children:Rt.includes(u.key)?k(u.key):u.key}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:u.items.map(l=>jsxRuntime.jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${l.id}`,onClick:()=>{n("click"),e(l.id);},style:{...U,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsxRuntime.jsx(N,{glyph:l.icon??"box",size:40}),jsxRuntime.jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:l.label}),jsxRuntime.jsx(ye,{count:l.badge??0})]},l.id))})]},u.key))})}exports.Badge=ye;exports.Button=z;exports.Card=ao;exports.Center=io;exports.ConfirmPopup=mo;exports.DEFAULT_PLAYER_PREFS=B;exports.DEFAULT_UI_CONFIG=Pt;exports.DESKTOP_MIN_PX=Ht;exports.EASE_IN=ue;exports.EASE_OUT=Y;exports.EASE_POP=le;exports.EmptyState=oo;exports.FeatureGrid=Ao;exports.FxStore=j;exports.GLYPHS=Yt;exports.Icon=N;exports.IconButton=he;exports.ItemTile=to;exports.KIT_CSS=Ye;exports.KitPortal=xt;exports.LEVEL_TONE=Ae;exports.NotificationStore=Re;exports.ON_TONE=ee;exports.Popup=ne;exports.ProgressBar=no;exports.RARITY_ORDER=tt;exports.ResourceBadge=en;exports.ResourceCounter=pt;exports.ResourceList=eo;exports.SOUND_PRESETS=Ce;exports.SectionTitle=mt;exports.Spinner=Zt;exports.TABLET_MIN_PX=Vt;exports.TOAST_DURATION=_e;exports.Tabs=so;exports.Timer=ro;exports.UI_SOUND_EVENTS=Ke;exports.UiKitProvider=An;exports.UiSoundEngine=ae;exports.Window=ho;exports.bundleLines=nt;exports.buttonStyle=Jt;exports.canAfford=Hn;exports.configSection=ge;exports.costLines=qn;exports.countdown=rt;exports.counterKeys=Ut;exports.createNotificationStore=We;exports.currencyGlyph=lt;exports.defineUiConfig=pn;exports.effectiveVolume=Ge;exports.errorText=Wn;exports.formatAmount=A;exports.grantLines=qt;exports.grantedBy=Vn;exports.groupBy=at;exports.iconsFor=Et;exports.isGlyph=jt;exports.itemDefinitions=st;exports.itemGlyph=ut;exports.layoutFor=me;exports.makeT=_t;exports.mergeLines=Wt;exports.motionDurations=se;exports.outlined=x;exports.panel=U;exports.parsePlayerPrefs=Fe;exports.pickLanguage=Ze;exports.plural=Fn;exports.rarityRank=Yn;exports.renderKitOverlays=No;exports.resolveSound=Tt;exports.resolveUiConfig=Se;exports.resourceName=Ue;exports.screenBackground=Ve;exports.sortFeatures=fn;exports.themeVars=qe;exports.tokenGlyph=pe;exports.tokenName=it;exports.tokenParts=ot;exports.toneSurface=Ee;exports.uiT=k;exports.useAnimatedNumber=Xt;exports.useBalances=ft;exports.useCatalog=O;exports.useCelebrate=In;exports.useCounterValue=ct;exports.useGameLayout=Pe;exports.useLayout=Jn;exports.useMotion=En;exports.useNotify=$n;exports.useNow=Zn;exports.usePlayerPrefs=Un;exports.usePopupClose=te;exports.usePresence=Le;exports.useSound=Tn;exports.useStagger=gt;exports.useToast=Dn;exports.useUiKit=b;exports.v=a;exports.well=He;
|
|
38
|
+
`;function Ut(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function It(t){return t.kind==="currency"?[t.id]:t.kind==="item"?[`item:${t.id}`,"inventory"]:[]}var j=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setMotion(e){this.motion=e;}setPlayer(e){this.player=e;}setLayer(e){this.layerEl=e;}holding(e){return (this.holds.get(e)??0)+(this.reserved.get(e)??0)}reserve(e){if(this.motion?.rewardFlight){for(let n of e)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(e){let n=false;for(let o of e){if(o.kind!=="currency")continue;let i=(this.reserved.get(o.id)??0)-1;i<=0?this.reserved.delete(o.id):this.reserved.set(o.id,i),n=true;}n&&this.changed();}fly(e,n){if(!this.motion?.rewardFlight||!this.layerEl||typeof document>"u")return;let o=this.layerEl.getBoundingClientRect(),i=Math.max(200,this.motion.durations.slow+180),r=[];for(let u of e){let l=It(u).map(y=>({key:y,el:document.querySelector(`[data-resource-counter="${Dt(y)}"]`)})).find(y=>y.el&&kn(y.el));if(!l?.el)continue;let d=Qe(l.el.getBoundingClientRect(),o),p=n(u),c=p?Qe(p,o):{x:o.width/2,y:o.height/2},f=Ut(u.amount);for(let y=0;y<f;y++)r.push({key:this.nextKey++,line:u,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:y*55,durationMs:i,target:l.key}),this.holds.set(l.key,(this.holds.get(l.key)??0)+1);}this.release(e),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(e){let n=this.flights.find(i=>i.key===e);if(!n)return;this.flights=this.flights.filter(i=>i.key!==e);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),wn(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(e){if(!this.motion?.particles||!this.layerEl||!e)return;let n=Qe(e.getBoundingClientRect(),this.layerEl.getBoundingClientRect()),o=this.nextKey++;this.bursts=[...this.bursts,{key:o,at:n}],this.changed(),setTimeout(()=>{this.bursts=this.bursts.filter(i=>i.key!==o),this.changed();},900);}changed(){this.version+=1;for(let e of this.listeners)e();}};function Qe(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function kn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function wn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${Dt(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function Dt(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var At=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",$t="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function Ot(t){if(!(t instanceof HTMLElement)||t.hasAttribute($t))return;t.setAttribute($t,"");let e=t.style,n=Q(1.6,2.8);e.setProperty("--idos-float-speed",n.toFixed(2)),e.setProperty("--idos-float-phase",(-Q(0,n)).toFixed(2)),e.setProperty("--idos-float-amp",Q(3,7).toFixed(1)),e.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*Q(0,1.5)).toFixed(2));let o=Q(5,7.5);e.setProperty("--idos-shine-speed",o.toFixed(2)),e.setProperty("--idos-shine-phase",(-Q(0,o)).toFixed(2));}function Xe(t){t instanceof Element&&(t.matches(At)&&Ot(t),t.querySelectorAll(At).forEach(Ot));}function zt(t){if(typeof MutationObserver>"u")return ()=>{};Xe(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?Xe(o.target):o.addedNodes.forEach(Xe);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Ft="idos-ui-prefs";function Nn(){try{return Ge(typeof localStorage<"u"?localStorage.getItem(Ft):null)}catch{return {...B}}}function Pn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Kt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&Pn(),o=t.motion.enabled&&!n;return {on:o,durations:se(t.motion,n),intensity:o?t.motion.intensity:0,rewardFlight:o&&t.motion.rewardFlight,particles:o&&t.motion.particles,stagger:o&&t.motion.stagger}}var Bt=Se(null),Ln=new j,Tn={config:Bt,prefs:B,setPrefs:()=>{},motion:Kt(Bt,B),play:()=>{},layer:null,fx:Ln,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Gt=react.createContext(Tn);function b(){return react.useContext(Gt)}function En(){return b().play}function Un(){return b().motion}function In(){let t=b();return [t.prefs,t.setPrefs]}function Dn(){return b().celebrate}function An(){return b().toast}function $n(){return b().notify}function On({config:t,children:e,overlays:n,notifications:o}){let i=react.useMemo(()=>Se(t),[t]),[r,u]=react.useState(Nn),l=react.useCallback(w=>{u(V=>{let Nt={...V,...w};try{localStorage.setItem(Ft,JSON.stringify(Nt));}catch{}return Nt});},[]),d=react.useRef(null);d.current??=new ae(i.sound,r),react.useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),react.useEffect(()=>{let w=d.current;return w?.attach(),()=>w?.dispose()},[]);let p=react.useCallback(w=>d.current?.play(w),[]),c=react.useMemo(()=>Kt(i,r),[i,r]),f=react.useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[y,v]=react.useState(null);react.useEffect(()=>f.setLayer(y),[f,y]);let[R,T]=react.useState(null),D=react.useRef(R);D.current=R;let L=react.useCallback((w,V)=>{if(w.length===0){V?.onDone?.();return}f.reserve(w),T({lines:w,options:V});},[f]),W=react.useCallback(()=>{let w=D.current;w&&f.release(w.lines),T(null),w?.options?.onDone?.();},[f]),ke=react.useRef(null),P=o??(ke.current??=qe());react.useEffect(()=>(P.setPlayer(p),()=>P.setPlayer(null)),[P,p]);let q=react.useMemo(()=>({toast:w=>P.toast(w),alert:w=>P.alert(w),dismiss:w=>P.dismiss(w)}),[P]),E=react.useCallback((w,V="info")=>{P.toast({message:w,level:V});},[P]),ie=react.useMemo(()=>({config:i,prefs:r,setPrefs:l,motion:c,play:p,layer:y,fx:f,celebrate:L,toast:E,notify:q,provided:true}),[i,r,l,c,p,y,f,L,E,q]),re=react.useRef(null);react.useEffect(()=>re.current?zt(re.current):void 0,[]);let G=!c.on;return jsxRuntime.jsx(Gt.Provider,{value:ie,children:jsxRuntime.jsxs("div",{ref:re,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...Ve(i,G)},children:[jsxRuntime.jsx("style",{children:je}),e,jsxRuntime.jsx("div",{ref:v,"data-idos-ui-layer":"",style:{position:"absolute",inset:0,zIndex:50,pointerEvents:"none",fontFamily:"var(--idos-ui-font)",overflow:"hidden"},children:n?.({celebration:R,finishCelebration:W,notifications:P})})]})})}function fe(t){let{fx:e}=b();return react.useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var _t=typeof window<"u"?react.useLayoutEffect:react.useEffect;var Kn=react.createContext(null);function F(){return react.useContext(Kn)}function et(){if(typeof navigator>"u")return "en";let t=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(e=>t.startsWith(e))?"ru":"en"}function Wt(t,e,n=et()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function Gn(t,e,n=et()){let[o,i=o,r=i]=e.split("|"),u=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?u==="one"?o:u==="few"?i:r:u==="one"?o:i}var _n={close:"Close",back:"Back",confirm:"Confirm",cancel:"Cancel",youGot:"You got",great:"Great!",loading:"Loading\u2026",ok:"OK",loadingNamed:"Loading {name}\u2026",stillLoading:"Still loading \u2014 the first start can take a little longer",retry:"Retry",error:"Something went wrong",notEnough:"Not enough resources",offline:"No connection. Retrying\u2026",more:"More",menu:"Menu",nothingHere:"Nothing here yet",economy:"Economy",events:"Activities",social:"Social",profile:"Profile",other:"Other",free:"Free",claim:"Claim",claimAll:"Claim all",tokenEvent:"Event points",tokenSeason:"Season status",tokenQuest:"Quest points",tokenScore:"Rating points"},Wn={close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",back:"\u041D\u0430\u0437\u0430\u0434",confirm:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0430",youGot:"\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438",great:"\u041E\u0442\u043B\u0438\u0447\u043D\u043E!",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",ok:"\u041F\u043E\u043D\u044F\u0442\u043D\u043E",loadingNamed:"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \xAB{name}\xBB\u2026",stillLoading:"\u0415\u0449\u0451 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u2014 \u043F\u0435\u0440\u0432\u044B\u0439 \u0437\u0430\u043F\u0443\u0441\u043A \u0431\u044B\u0432\u0430\u0435\u0442 \u0434\u043E\u043B\u044C\u0448\u0435",retry:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",error:"\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A",notEnough:"\u041D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432",offline:"\u041D\u0435\u0442 \u0441\u0432\u044F\u0437\u0438. \u041F\u0440\u043E\u0431\u0443\u0435\u043C \u0441\u043D\u043E\u0432\u0430\u2026",more:"\u0415\u0449\u0451",menu:"\u041C\u0435\u043D\u044E",nothingHere:"\u041F\u043E\u043A\u0430 \u043F\u0443\u0441\u0442\u043E",economy:"\u042D\u043A\u043E\u043D\u043E\u043C\u0438\u043A\u0430",events:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F",social:"\u0414\u0440\u0443\u0437\u044C\u044F \u0438 \u043E\u0431\u0449\u0435\u043D\u0438\u0435",profile:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",other:"\u0420\u0430\u0437\u043D\u043E\u0435",free:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E",claim:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C",claimAll:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0451",tokenEvent:"\u041E\u0447\u043A\u0438 \u0438\u0432\u0435\u043D\u0442\u0430",tokenSeason:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0437\u043E\u043D\u0430",tokenQuest:"\u041E\u0447\u043A\u0438 \u0437\u0430\u0434\u0430\u043D\u0438\u0439",tokenScore:"\u041E\u0447\u043A\u0438 \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u0430"},k=Wt(_n,Wn);function qn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?k("notEnough"):t.length>140?`${t.slice(0,140)}\u2026`:t:k("error")}function ot(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?e.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?e.push({kind:"item",id:n.ItemID,amount:o}):e.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of t?.EventTokens??[]){let o=n?.Address?.Type,i=(n?.Address?.EntityID??"").split(":")[0];if(!o||!i)continue;let r=Number(n?.Applied??n?.Amount??0);!Number.isFinite(r)||r<=0||e.push({kind:"token",id:`${o}:${i}`,amount:r});}return qt(e)}function it(t){let e=t.id.indexOf(":");return e<0?{system:t.id,entity:""}:{system:t.id.slice(0,e),entity:t.id.slice(e+1)}}function pe(t){switch(it(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function rt(t,e){let{system:n,entity:o}=it(t);return n==="TimedEvent"?(e?ge(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||k("tokenEvent"):n==="Season"?k("tokenSeason"):n==="Quest"?k("tokenQuest"):n==="Leaderboard"?k("tokenScore"):t.id}function qt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function Vt(t){return ot(t?.Standard)}function Vn(t){return ot(t?.Standard)}function Hn(t){let e=t?.Resources?.Grant;return Vt(e)}function Yn(t,e){return t.every(n=>n.kind!=="currency"||Number(e?.[n.id]?.Amount??0)>=n.amount)}function $(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${tt(t/1e9)}B`:e>=1e6?`${tt(t/1e6)}M`:e>=1e5?`${tt(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function tt(t){return t.toFixed(2).replace(/\.?0+$/,"")}function st(t,e){if(!t)return null;let n=new Date(t);if(n.getUTCFullYear()>=9e3)return null;let o=n.getTime()-e;if(!Number.isFinite(o)||o<=0)return null;let i=Math.floor(o/1e3),r=Math.floor(i/3600),u=Math.floor(i%3600/60),l=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(u).padStart(2,"0")}m`:`${u}m ${String(l).padStart(2,"0")}s`}var Ht=640,Yt=1024;function me(t){return t>=Yt?"desktop":t>=Ht?"tablet":"phone"}function ge(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function at(t){let e=new Map;for(let n of Object.values(t?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&e.set(i.ItemID??o,i);return e}var nt=["Legendary","Epic","Rare","Uncommon","Common"];function jn(t){let e=nt.indexOf(t??"");return e<0?nt.length:e}function lt(t,e){let n=new Map;for(let o of t){let i=e(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}var jt=["coin","gem","potion","scroll","sword","shield","crown","gift","bag","box","trophy","calendar","star","check","lock","shop","chest","quest","user","logout","copy","hero","hammer","market","flame","ticket","friends","chat","link","swords","gear","globe","sound","mute","bell","bulb","menu","close","back","plus","energy","heart","offer","clock","trash","edit"];function Qt(t){return jt.includes(t)}function ut(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function dt(t,e){let n={potion:"potion",scroll:"scroll",weapon:"sword",sword:"sword",armor:"shield",shield:"shield",helmet:"hero",crown:"crown",chest:"chest",lootbox:"chest",gift:"gift",ticket:"ticket"};for(let o of [...t??[],e??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var Qn=/^(https?:|\/|data:)/;function N({glyph:t,size:e=24,color:n}){return Qt(t)?jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:Xn(t,n)}):Qn.test(t)?jsxRuntime.jsx("img",{src:t,alt:"",width:e,height:e,style:{flex:"none",display:"block",objectFit:"contain"}}):jsxRuntime.jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:e,height:e,fontSize:e*.8,lineHeight:1},children:t})}function Xn(t,e){switch(t){case "coin":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"17",r:"12",fill:"#c77a0c"}),jsxRuntime.jsx("circle",{cx:"16",cy:"15",r:"12",fill:e??"#ffcf3a"}),jsxRuntime.jsx("circle",{cx:"16",cy:"15",r:"8.5",fill:"none",stroke:"#e89a12",strokeWidth:"2"}),jsxRuntime.jsx("path",{d:"M16 9.5v11M13 12.5h4.5a2 2 0 010 4H13",stroke:"#b86d06",strokeWidth:"2.2",fill:"none",strokeLinecap:"round"})]});case "gem":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M9 5h14l6 8-13 15L3 13z",fill:e??"#5ce1ff"}),jsxRuntime.jsx("path",{d:"M9 5l3 8h8l3-8M3 13h26M12 13l4 15 4-15",fill:"none",stroke:"#1f8fc7",strokeWidth:"1.6",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M11 7l2 5",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",opacity:".8"})]});case "potion":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"12.5",y:"3",width:"7",height:"6",rx:"1.5",fill:"#c9a36a"}),jsxRuntime.jsx("path",{d:"M13 9h6v4l6 8a7 7 0 01-6 9h-6a7 7 0 01-6-9l6-8z",fill:e??"#ff5a7a"}),jsxRuntime.jsx("path",{d:"M9 21h14",stroke:"#fff",strokeWidth:"1.5",opacity:".45"}),jsxRuntime.jsx("circle",{cx:"13",cy:"22",r:"1.6",fill:"#fff",opacity:".7"})]});case "scroll":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"6",y:"7",width:"20",height:"18",rx:"2",fill:e??"#f3dca2"}),jsxRuntime.jsx("rect",{x:"4",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsxRuntime.jsx("rect",{x:"24",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsxRuntime.jsx("path",{d:"M11 12h10M11 16h10M11 20h7",stroke:"#9c7338",strokeWidth:"1.8",strokeLinecap:"round"})]});case "sword":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M22 3l7 0 0 7L14 25l-4-3z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M24 5L12 21",stroke:"#fff",strokeWidth:"1.4",opacity:".7"}),jsxRuntime.jsx("path",{d:"M6 19l7 7",stroke:"#8a5a26",strokeWidth:"3.4",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M4 27l3 -3",stroke:"#e0b44a",strokeWidth:"4",strokeLinecap:"round"})]});case "shield":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3l11 4v8c0 7-5 12-11 14C10 27 5 22 5 15V7z",fill:e??"#b57a3c"}),jsxRuntime.jsx("path",{d:"M16 6l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V9z",fill:"#d89b54"}),jsxRuntime.jsx("path",{d:"M16 6v20M8 14h16",stroke:"#8a5424",strokeWidth:"1.8"})]});case "crown":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 11l6 5 6-9 6 9 6-5-3 14H7z",fill:e??"#ffcf3a"}),jsxRuntime.jsx("rect",{x:"7",y:"24",width:"18",height:"4",rx:"1.5",fill:"#e89a12"}),jsxRuntime.jsx("circle",{cx:"16",cy:"18",r:"2",fill:"#ff5a7a"}),jsxRuntime.jsx("circle",{cx:"10",cy:"20",r:"1.4",fill:"#5ce1ff"}),jsxRuntime.jsx("circle",{cx:"22",cy:"20",r:"1.4",fill:"#5ce1ff"})]});case "gift":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"5",y:"13",width:"22",height:"15",rx:"2",fill:e??"#ff6b8b"}),jsxRuntime.jsx("rect",{x:"3",y:"9",width:"26",height:"6",rx:"2",fill:"#ff8aa3"}),jsxRuntime.jsx("rect",{x:"14",y:"9",width:"4",height:"19",fill:"#ffd24a"}),jsxRuntime.jsx("path",{d:"M16 9c-2-5-8-5-7-1 1 2 5 1 7 1zm0 0c2-5 8-5 7-1-1 2-5 1-7 1z",fill:"#ffd24a"})]});case "bag":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M11 9h10l5 5v11a4 4 0 01-4 4H10a4 4 0 01-4-4V14z",fill:e??"#c98a3c"}),jsxRuntime.jsx("path",{d:"M11 9l2-5h6l2 5",fill:"#a86c26"}),jsxRuntime.jsx("circle",{cx:"16",cy:"19",r:"4.5",fill:"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M16 16.5v5",stroke:"#b86d06",strokeWidth:"1.8",strokeLinecap:"round"})]});case "trophy":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M9 4h14v7a7 7 0 01-14 0z",fill:e??"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M9 7H4c0 5 3 7 6 7M23 7h5c0 5-3 7-6 7",fill:"none",stroke:"#e89a12",strokeWidth:"2.2"}),jsxRuntime.jsx("rect",{x:"14",y:"17",width:"4",height:"6",fill:"#e89a12"}),jsxRuntime.jsx("rect",{x:"9",y:"23",width:"14",height:"5",rx:"1.5",fill:"#b86d06"})]});case "calendar":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"4",y:"6",width:"24",height:"22",rx:"3",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"4",y:"6",width:"24",height:"7",rx:"3",fill:e??"#ff5a5a"}),jsxRuntime.jsx("path",{d:"M10 3v6M22 3v6",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M10 18h3M15 18h3M20 18h3M10 23h3M15 23h3",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"})]});case "star":return jsxRuntime.jsx("path",{d:"M16 3l3.9 8 8.6 1.2-6.3 6 1.6 8.6L16 22.7 8.2 26.8l1.6-8.6-6.3-6 8.6-1.2z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "check":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"13",fill:e??"#59d35b"}),jsxRuntime.jsx("path",{d:"M9.5 16.5l4.5 4.5 8.5-9",fill:"none",stroke:"#fff",strokeWidth:"3.4",strokeLinecap:"round",strokeLinejoin:"round"})]});case "lock":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M10 14v-4a6 6 0 0112 0v4",fill:"none",stroke:"#8e95b8",strokeWidth:"3"}),jsxRuntime.jsx("rect",{x:"7",y:"14",width:"18",height:"14",rx:"3",fill:e??"#c3c8e3"}),jsxRuntime.jsx("circle",{cx:"16",cy:"21",r:"2.2",fill:"#5b6187"})]});case "shop":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 12l3-7h18l3 7z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("path",{d:"M4 12h24v2a3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0z",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"6",y:"16",width:"20",height:"12",rx:"1.5",fill:"#ffd9a8"}),jsxRuntime.jsx("rect",{x:"13",y:"20",width:"6",height:"8",fill:"#c98a3c"})]});case "chest":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 13a11 7 0 0122 0v2H5z",fill:e??"#b57a3c"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"2",fill:"#d89b54"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"3",fill:"#8a5424"}),jsxRuntime.jsx("rect",{x:"14",y:"14",width:"4",height:"7",rx:"1",fill:"#ffd24a"})]});case "quest":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"6",y:"4",width:"20",height:"24",rx:"3",fill:"#f3dca2"}),jsxRuntime.jsx("path",{d:"M11 11l2 2 4-4M11 18l2 2 4-4",fill:"none",stroke:e??"#2b9936",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntime.jsx("path",{d:"M19 12h3M19 19h3",stroke:"#9c7338",strokeWidth:"2",strokeLinecap:"round"})]});case "user":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"14",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"12.5",r:"5.2",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M6.5 25.5a10 7 0 0119 0A13.6 13.6 0 0116 30a13.6 13.6 0 01-9.5-4.5z",fill:"#fff"})]});case "logout":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M18 5H9a3 3 0 00-3 3v16a3 3 0 003 3h9",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})]});case "copy":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"10",y:"10",width:"16",height:"18",rx:"3",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6"}),jsxRuntime.jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "hero":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M6 15a10 10 0 0120 0v5H6z",fill:e??"#b8c4d9"}),jsxRuntime.jsx("path",{d:"M6 15a10 10 0 0120 0",fill:"none",stroke:"#6f7c99",strokeWidth:"1.6"}),jsxRuntime.jsx("rect",{x:"9",y:"16",width:"14",height:"3",rx:"1",fill:"#2a3150"}),jsxRuntime.jsx("path",{d:"M16 3v5",stroke:"#ff5a5a",strokeWidth:"3",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M8 20h16l-2 8H10z",fill:"#8a96b3"})]});case "hammer":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M14 13l12 12-3 3-12-12z",fill:"#a8743d"}),jsxRuntime.jsx("path",{d:"M5 9l7-6 8 8-7 6z",fill:e??"#c3c8e3"}),jsxRuntime.jsx("path",{d:"M5 9l7-6 2 2-7 6z",fill:"#e6e9f7"})]});case "market":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M3 11l3-7h20l3 7z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M3 11h26v2a3 3 0 01-6.5 0 3 3 0 01-6.5 0 3 3 0 01-6.5 0A3 3 0 013 13z",fill:"#fff"}),jsxRuntime.jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"1.5",fill:"#d8e7ff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"21.5",r:"4",fill:"#ffcf3a"}),jsxRuntime.jsx("path",{d:"M16 19.5v4",stroke:"#b86d06",strokeWidth:"1.6",strokeLinecap:"round"})]});case "flame":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3c1 5 8 8 8 16a8 8 0 01-16 0c0-4 2-6 3-8 1 3 3 4 3 4 0-5 1-8 2-12z",fill:e??"#ff7a2e"}),jsxRuntime.jsx("path",{d:"M16 15c1 3 4 4 4 8a4 4 0 01-8 0c0-2 1-3 2-4 .5 1 1.5 1.5 1.5 1.5 0-2 .2-3.5.5-5.5z",fill:"#ffd24a"})]});case "ticket":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 9h24v4a3 3 0 000 6v4H4v-4a3 3 0 000-6z",fill:e??"#b879ff"}),jsxRuntime.jsx("path",{d:"M20 9v14",stroke:"#fff",strokeWidth:"1.6",strokeDasharray:"2 2"}),jsxRuntime.jsx("path",{d:"M11 13l1.2 2.4 2.6.4-1.9 1.8.5 2.6-2.4-1.3-2.3 1.3.4-2.6-1.9-1.8 2.6-.4z",fill:"#ffd24a"})]});case "friends":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"11",cy:"11",r:"4.5",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"21.5",cy:"12",r:"4",fill:"#59d35b"}),jsxRuntime.jsx("path",{d:"M15 26a7 6.5 0 0114 0z",fill:"#59d35b"})]});case "chat":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 7a3 3 0 013-3h18a3 3 0 013 3v12a3 3 0 01-3 3H13l-6 5v-5H7a3 3 0 01-3-3z",fill:e??"#4fb1ff"}),jsxRuntime.jsx("circle",{cx:"11",cy:"13",r:"1.8",fill:"#fff"}),jsxRuntime.jsx("circle",{cx:"16",cy:"13",r:"1.8",fill:"#fff"}),jsxRuntime.jsx("circle",{cx:"21",cy:"13",r:"1.8",fill:"#fff"})]});case "link":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M13 19l6-6",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M14 9l2-2a5 5 0 017 7l-2 2M18 23l-2 2a5 5 0 01-7-7l2-2",fill:"none",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:e??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M8 22l4 4M24 22l-4 4",stroke:"#8a5a26",strokeWidth:"3.2",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M6 20l6 6M26 20l-6 6",stroke:"#e0b44a",strokeWidth:"2",strokeLinecap:"round"})]});case "gear":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M14 3h4l.7 3.3 2.6 1.1 2.8-1.9 2.8 2.8-1.9 2.8 1.1 2.6L29 14v4l-3.3.7-1.1 2.6 1.9 2.8-2.8 2.8-2.8-1.9-2.6 1.1L18 29h-4l-.7-3.3-2.6-1.1-2.8 1.9-2.8-2.8 1.9-2.8-1.1-2.6L3 18v-4l3.3-.7 1.1-2.6-1.9-2.8 2.8-2.8 2.8 1.9 2.6-1.1z",fill:e??"#aeb6f0"}),jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"4.5",fill:"#2c3480"})]});case "globe":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M4 16h24M16 4c-4 4-4 20 0 24M16 4c4 4 4 20 0 24",fill:"none",stroke:"#fff",strokeWidth:"1.6"})]});case "sound":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:e??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "bell":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 4a8 8 0 018 8v6l3 4H5l3-4v-6a8 8 0 018-8z",fill:e??"#ffd24a"}),jsxRuntime.jsx("circle",{cx:"16",cy:"26",r:"3",fill:"#e89a12"})]});case "bulb":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3a9 9 0 015 16.5V23h-10v-3.5A9 9 0 0116 3z",fill:e??"#ffe066"}),jsxRuntime.jsx("rect",{x:"11",y:"24",width:"10",height:"3",rx:"1",fill:"#aeb6f0"}),jsxRuntime.jsx("rect",{x:"12.5",y:"27.5",width:"7",height:"2.5",rx:"1",fill:"#8e95b8"})]});case "menu":return jsxRuntime.jsx("path",{d:"M6 9h20M6 16h20M6 23h20",stroke:e??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsxRuntime.jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsxRuntime.jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsxRuntime.jsx("path",{d:"M16 7v18M7 16h18",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsxRuntime.jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "heart":return jsxRuntime.jsx("path",{d:"M16 27S4 20 4 11.5A6.5 6.5 0 0116 8a6.5 6.5 0 0112 3.5C28 20 16 27 16 27z",fill:e??"#ff5a7a"});case "offer":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("circle",{cx:"21",cy:"9",r:"2.2",fill:"#fff"}),jsxRuntime.jsx("path",{d:"M11 17l6-6",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round"})]});case "clock":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"currentColor"}),jsxRuntime.jsx("path",{d:"M16 9v7l5 3",fill:"none",stroke:"#2c3480",strokeWidth:"2.6",strokeLinecap:"round"})]});case "trash":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M8 10h16l-1.5 17h-13z",fill:e??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:e??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:e??"#ff5a5a"})]});case "edit":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:e??"#ffd24a"}),jsxRuntime.jsx("path",{d:"M20 8l2-2a2.8 2.8 0 014 4l-2 2",fill:"#e89a12"})]});default:return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M16 3l12 6v14l-12 6-12-6V9z",fill:e??"#9aa6ff"}),jsxRuntime.jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function Zn(t){let[e,n]=react.useState("phone");return _t(()=>{let o=t.current;if(!o)return;let i=()=>n(me(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[t]),e}function Pe(){let{layer:t}=b(),e=react.useRef(null);e.current=t;let[n,o]=react.useState(()=>t?me(t.getBoundingClientRect().width):"phone");return react.useEffect(()=>{if(!t)return;let i=()=>o(me(t.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(t),()=>r.disconnect()},[t]),n}function Le(t,e){let[n,o]=react.useState(t),[i,r]=react.useState(false);return react.useEffect(()=>{if(t){o(true),r(false);return}if(!n)return;if(e<=0){o(false);return}r(true);let u=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(u)},[t,e,n]),{mounted:n,closing:i}}function Jt(t,e=600,n){let[o,i]=react.useState(t),r=react.useRef(t),u=react.useRef(n);return u.current=n,react.useEffect(()=>{let l=r.current;if(l===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let y=Math.min(1,(f-d)/e),v=1-Math.pow(1-y,3),R=Math.round(l+(t-l)*v);R!==r.current&&u.current?.(),r.current=R,i(R),y<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function ft(t,e){let n=b(),o=fe(u=>u.holding(t)>0),i=react.useRef(e);o||(i.current=e);let r=o?i.current:e;return Jt(r,n.motion.on?650:0,()=>n.play("countTick"))}function O(){let t=F(),e=b(),[,n]=react.useReducer(l=>l+1,0);react.useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=react.useMemo(()=>t&&o?at(ge(t,"Item")):new Map,[t,o]),r=react.useMemo(()=>t&&o?ge(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),u=react.useCallback(l=>l?t?.localization.has(l)?t.localization.t(l):l:"",[t]);return react.useMemo(()=>({items:i,currencies:r,localize:u,currencyName:l=>u(r[l]?.DisplayName||l),itemName:l=>u(i.get(l)?.DisplayName||l),iconOf:l=>{if(l.kind==="currency")return r[l.id]?.ImagePath||ut(l.id);if(l.kind==="item"){let d=i.get(l.id);return d?.ImagePath||dt(d?.Tags,d?.ItemClass)}return "box"},rarityColor:l=>e.config.theme.rarity[l??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,u,e.config.theme.rarity])}function pt(){let t=F(),e=O(),[,n]=react.useReducer(r=>r+1,0);react.useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(e.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,u])=>[r,Number(u?.Amount??0)]).sort(([r],[u])=>r.localeCompare(u))}function eo(t=1e3){let[e,n]=react.useState(()=>Date.now());return react.useEffect(()=>{let o=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(o)},[t]),e}var Te={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ee={green:{color:a.onGreen,textShadow:a.onGreenOutline},gold:{color:a.onGold,textShadow:a.onGoldOutline},blue:{color:a.onBlue,textShadow:a.onBlueOutline},red:{color:a.onRed,textShadow:a.onRedOutline},grey:{color:"#ffffff",textShadow:we}};function Ee(t){let[e,n]=Te[t],o=ee[t];return {background:`linear-gradient(180deg, ${e} 0%, ${n} 100%)`,color:o.color,"--idos-ui-text":o.color,"--idos-ui-text-dim":`color-mix(in srgb, ${o.color} 80%, transparent)`,"--idos-ui-text-outline":o.textShadow}}function Zt(t,e=false,n="md"){let[o,i]=Te[e?"grey":t],r=ee[e?"grey":t],u=n==="sm"?"6px 12px":n==="lg"?"12px 22px":"10px 18px";return {...x,...r,fontFamily:a.font,fontSize:n==="sm"?13:n==="lg"?18:16,border:"none",borderRadius:a.buttonRadius,padding:u,minHeight:n==="sm"?34:44,cursor:e?"default":"pointer",background:`linear-gradient(180deg, ${o} 0%, ${i} 100%)`,boxShadow:`0 4px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.35)`,opacity:e?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function z({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:u=false,style:l,className:d="",sound:p="click",title:c,...f}){let{play:y}=b();return jsxRuntime.jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${u&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&y(p),e?.(v);},style:{...Zt(n,i,o),...l},children:r?jsxRuntime.jsx(en,{size:18}):t})}function he({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:u}){let{play:l}=b();return jsxRuntime.jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{l("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Te[i][0]}, ${Te[i][1]})`:a.well,color:i?ee[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsxRuntime.jsx(N,{glyph:t,size:o*.55}),u?jsxRuntime.jsx(ye,{count:u}):null]})}function en({size:t=28}){return jsxRuntime.jsx("span",{"aria-label":k("loading"),style:{width:t,height:t,borderRadius:"50%",border:`${Math.max(2,t/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function ye({count:t,dot:e=false,style:n}){return !t||t<=0?null:jsxRuntime.jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:e?12:20,height:e?12:20,padding:e?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ee.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function tn({line:t,size:e=20,big:n=false,dim:o=false}){let i=O(),r=F();return jsxRuntime.jsxs("span",{title:Ue(t,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsxRuntime.jsx(N,{glyph:t.kind==="token"?pe(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:$(t.amount)]})}function Ue(t,e,n){return t.kind==="currency"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(rt(t,n)):t.id}function to({lines:t,size:e=18,gap:n=8,dimIf:o}){return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:t.map(i=>jsxRuntime.jsx(tn,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function mt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=O(),r=ft(t,e);return jsxRuntime.jsxs("div",{"data-resource-counter":t,title:i.currencyName(t),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Ye,cursor:o?"pointer":"default"},children:[jsxRuntime.jsx(N,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:$(r)})]})}function no({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:u=false}){let l=O(),{play:d}=b(),p=l.items.get(t),c=l.rarityColor(p?.Metadata?.RarityID);return jsxRuntime.jsxs("button",{type:"button",className:"idos-press",title:l.itemName(t),onClick:o?()=>{d("click"),o();}:void 0,style:{position:"relative",width:i,height:i,borderRadius:16,border:`3px solid ${r?a.text:c}`,background:`radial-gradient(circle at 50% 35%, ${c}55 0%, ${a.panelDeep} 70%)`,boxShadow:r?`0 0 0 3px ${a.gold}, 0 4px 0 ${a.shadow}`:`0 4px 0 ${a.shadow}, inset 0 0 12px ${c}44`,display:"grid",placeItems:"center",cursor:o?"pointer":"default",padding:0,opacity:u?.45:1,flex:"none"},children:[jsxRuntime.jsx(N,{glyph:l.iconOf({kind:"item",id:t,amount:1}),size:i*.56}),e!==void 0&&e>1?jsxRuntime.jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",$(e)]}):null,n!==void 0&&n>0?jsxRuntime.jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function oo({value:t,max:e,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,t/Math.max(1,e)*100)),[u,l]=n==="gold"?[a.gold,a.goldDeep]:n==="blue"?[a.blue,a.blueDeep]:[a.green,a.greenDeep];return jsxRuntime.jsxs("div",{style:{position:"relative",height:i,borderRadius:i/2,background:a.wellSoft,boxShadow:a.wellShadow,overflow:"hidden"},children:[jsxRuntime.jsx("div",{style:{width:`${r}%`,height:"100%",background:`linear-gradient(180deg, ${u}, ${l})`,borderRadius:i/2,transition:`width ${a.slow} ${Y}`}}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${$(t)} / ${$(e)}`})]})}function gt({children:t,right:e}){return jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,margin:"4px 4px 10px"},children:[jsxRuntime.jsx("div",{style:{...x,fontSize:19,fontFamily:a.font},children:t}),e]})}function io({glyph:t,text:e,action:n}){return jsxRuntime.jsxs("div",{style:{...U,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsxRuntime.jsx(N,{glyph:t,size:56}),jsxRuntime.jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function ro({children:t,minHeight:e=240}){return jsxRuntime.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function so({at:t,now:e,label:n}){let o=st(t,e);return o?jsxRuntime.jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function ao({tabs:t,value:e,onChange:n,style:o}){let{play:i}=b();return t.length<2?null:jsxRuntime.jsx("div",{className:"idos-scroll",role:"tablist",style:{display:"flex",gap:6,padding:4,borderRadius:16,background:a.wellSoft,overflowX:"auto",...o},children:t.map(r=>{let u=r.id===e;return jsxRuntime.jsxs("button",{role:"tab","aria-selected":u,type:"button",className:"idos-press",onClick:()=>{u||(i("tab"),n(r.id));},style:{position:"relative",flex:"1 0 auto",border:"none",borderRadius:12,padding:"8px 14px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,whiteSpace:"nowrap",background:u?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:u?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsxRuntime.jsx(N,{glyph:r.glyph,size:20}):null,jsxRuntime.jsx("span",{style:{...x,...u?ee.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsxRuntime.jsx(ye,{count:r.badge}):null]},r.id)})})}function ht(){let{motion:t}=b();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function lo({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=b();return jsxRuntime.jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...U,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:U.border,...e},children:t})}var xt=react.createContext(()=>{});function te(){return react.useContext(xt)}function kt({children:t}){let{layer:e}=b();return e?reactDom.createPortal(t,e):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}var Ie=[],yt=new Set,bt=0,vt=false,Ae=()=>{for(let t of [...yt])t();};function po(t){vt!==t&&(vt=t,Ae());}function mo(t){let[e]=react.useState(()=>Symbol("auto-popup")),[,n]=react.useState(0),o=react.useRef(false);return react.useEffect(()=>{if(!t){o.current=false;return}Ie.push(e);let i=()=>n(r=>r+1);return yt.add(i),i(),()=>{let r=Ie.indexOf(e);r>=0&&Ie.splice(r,1),yt.delete(i),Ae();}},[t,e]),t?(!o.current&&Ie[0]===e&&bt===0&&!vt&&(o.current=true),o.current):true}function go(t){react.useEffect(()=>{if(t)return bt+=1,Ae(),()=>{bt-=1,Ae();}},[t]);}function ne({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:u=true,sound:l=true,panelStyle:d,queued:p=false}){let c=b(),f=Pe(),y=c.motion.durations.normal,[v,R]=react.useState(false),T=mo(p&&n);go(!p&&n);let{mounted:D,closing:L}=Le(n&&T&&!v,y),W=react.useRef(e);W.current=e;let ke=react.useRef(false);react.useEffect(()=>{!l||!n||!T||ke.current||(ke.current=true,c.play("open"));},[l,n,T,c]);let P=react.useCallback(()=>{v||(c.play("close"),R(true));},[v,c]);react.useEffect(()=>{v&&!D&&W.current?.();},[v,D]);let q=u&&e!==void 0;if(react.useEffect(()=>{if(!q||!D)return;let G=w=>{w.key==="Escape"&&P();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[q,D,P]),!D)return null;let E=r==="sheet"||r==="auto"&&f==="phone",ie=L,re=E?ie?`idos-sheet-out ${a.normal} ${ue} both`:`idos-sheet-in ${a.slow} ${Y} both`:ie?`idos-pop-out ${a.normal} ${ue} both`:`idos-pop-in ${a.slow} ${le} both`;return jsxRuntime.jsx(kt,{children:jsxRuntime.jsx(xt.Provider,{value:P,children:jsxRuntime.jsx("div",{role:"dialog","aria-modal":"true",onClick:q?P:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:E?"end stretch":"center",padding:E?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${ie?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxRuntime.jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...U,width:E?"100%":`min(${i}px, 100%)`,maxHeight:E?"88%":"min(86vh, 100%)",overflowY:"auto",padding:E?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:E?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:re,...d},children:[E?jsxRuntime.jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:8,left:"50%",width:44,height:5,marginLeft:-22,borderRadius:3,background:a.line}}):null,o?jsxRuntime.jsx("div",{style:{...x,fontSize:21,textAlign:"center",fontFamily:a.font,padding:"0 30px"},children:o}):null,e?jsxRuntime.jsx(he,{glyph:"close",label:k("close"),onClick:P,size:36,tone:"red",style:{position:"absolute",top:E?12:8,right:E?12:8,border:"3px solid #fff"}}):null,t]})})})})}function ho({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxRuntime.jsxs(ne,{title:t,onClose:r,width:380,children:[e,jsxRuntime.jsx(yo,{confirmLabel:n,tone:o,onConfirm:i})]})}function yo({confirmLabel:t,tone:e,onConfirm:n}){let o=te(),[i,r]=react.useState(false);return jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsxRuntime.jsx(z,{tone:"grey",onClick:o,children:k("cancel")}),jsxRuntime.jsx(z,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(u=>{r(false),u!==true&&o();});},children:t??k("confirm")})]})}function bo({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:u=true}){let l=b(),[d,p]=react.useState(false),{mounted:c,closing:f}=Le(i&&!d,l.motion.durations.normal),y=react.useRef(n);y.current=n,react.useEffect(()=>{l.play("open");},[]),react.useEffect(()=>{d&&!c&&y.current();},[d,c]);let v=react.useCallback(()=>{l.play("close"),p(true);},[l]);return react.useEffect(()=>{if(!c)return;let R=T=>{T.key==="Escape"&&v();};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[c,v]),c?jsxRuntime.jsx(kt,{children:jsxRuntime.jsx(xt.Provider,{value:v,children:jsxRuntime.jsxs("div",{style:{position:l.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:He,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ue:Y} both`},children:[jsxRuntime.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"12px 14px",borderBottom:`2px solid ${a.panelEdge}`,background:a.wellSoft},children:[r?jsxRuntime.jsx(he,{glyph:"back",label:k("back"),onClick:v,size:38}):null,e?jsxRuntime.jsx(N,{glyph:e,size:30}):null,jsxRuntime.jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),u?jsxRuntime.jsx(vo,{}):null,r?null:jsxRuntime.jsx(he,{glyph:"close",label:k("close"),onClick:v,size:38,tone:"red"})]}),jsxRuntime.jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function vo(){let t=pt(),e=Pe(),n=e==="phone"?t.slice(0,2):t;return jsxRuntime.jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsxRuntime.jsx(mt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var Oe={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},wt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function ko({level:t,size:e}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:t==="success"?jsxRuntime.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):t==="error"?jsxRuntime.jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):t==="warning"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M12 6v8",...n}),jsxRuntime.jsx("circle",{cx:"12",cy:"18.2",r:"1.6",fill:"currentColor"})]}):t==="reward"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("rect",{x:"4",y:"10",width:"16",height:"10",rx:"1.5",...n}),jsxRuntime.jsx("path",{d:"M3 10h18M12 10v10M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z",...n,strokeWidth:2.2})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("circle",{cx:"12",cy:"6.5",r:"1.6",fill:"currentColor"}),jsxRuntime.jsx("path",{d:"M12 11v7",...n})]})})}function sn({level:t,icon:e,size:n}){return jsxRuntime.jsx("span",{style:{...Ee(Oe[t]),width:n,height:n,flex:"none",borderRadius:"50%",display:"grid",placeItems:"center",boxShadow:`0 2px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`},children:e?jsxRuntime.jsx(N,{glyph:e,size:n*.62}):jsxRuntime.jsx(ko,{level:t,size:n*.56})})}function an({source:t}){return jsxRuntime.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:11,fontWeight:800,letterSpacing:.3,textTransform:"uppercase",color:a.textDim,minWidth:0},children:[t.icon?jsxRuntime.jsx(N,{glyph:t.icon,size:14}):null,jsxRuntime.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function wo(t){return react.useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),react.useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function ln({store:t}){wo(t);let e=t.currentAlert;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{style:{position:"absolute",top:"calc(env(safe-area-inset-top, 0px) + 10px)",left:"50%",transform:"translateX(-50%)",width:"min(440px, calc(100% - 20px))",display:"flex",flexDirection:"column",gap:8,zIndex:45,pointerEvents:"none"},children:t.toasts.map(n=>jsxRuntime.jsx(So,{store:t,toast:n},n.id))}),e?jsxRuntime.jsx(Ro,{store:t,alert:e,queued:t.queued},e.id):null]})}function So({store:t,toast:e}){let n=b(),o=e.input,i=Oe[e.level],r=o.duration??We[e.level],u=t.source(o.source),l=o.actions?.[0],[d,p]=react.useState(false),[c,f]=react.useState(false),y=n.motion.durations.normal,v=react.useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),y));};let R=react.useRef(r);react.useEffect(()=>{R.current=r;},[r,e.revision]),react.useEffect(()=>{if(r<=0||c||d)return;let L=Date.now(),W=setTimeout(()=>v.current(),R.current);return ()=>{clearTimeout(W),R.current-=Date.now()-L;}},[r,c,d,e.revision]);let T=u?.open,D=L=>{L.onPress?.(),L.openFeature&&t.source(L.openFeature)?.open?.(),v.current();};return jsxRuntime.jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:T?()=>{T(),v.current();}:void 0,className:T?"idos-press":void 0,style:{...U,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:T?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${wt[i]}`,animation:`${d?"idos-drop-out":"idos-drop-in"} ${a.normal} ease both`},children:[o.image?jsxRuntime.jsx("img",{src:o.image,alt:"",style:{width:42,height:42,flex:"none",objectFit:"cover",borderRadius:10,border:`2px solid ${wt[i]}`}}):jsxRuntime.jsx(sn,{level:e.level,icon:o.icon,size:34}),jsxRuntime.jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[u?jsxRuntime.jsx(an,{source:u}):null,o.title?jsxRuntime.jsx("div",{style:{...x,fontSize:15,lineHeight:1.25},children:o.title}):null,o.message?jsxRuntime.jsx("div",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.35,color:o.title?a.textDim:a.text,overflowWrap:"anywhere"},children:o.message}):null,l?jsxRuntime.jsx("div",{style:{marginTop:6},onClick:L=>L.stopPropagation(),children:jsxRuntime.jsx(z,{size:"sm",tone:i,onClick:()=>D(l),children:l.label})}):null]}),e.count>1?jsxRuntime.jsxs("span",{style:{...Ee(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",e.count]}):null,jsxRuntime.jsx("button",{type:"button","aria-label":k("close"),onClick:L=>{L.stopPropagation(),v.current();},style:Co,children:jsxRuntime.jsx(N,{glyph:"close",size:14})}),r>0?jsxRuntime.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:wt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var Co={flex:"none",width:26,height:26,display:"grid",placeItems:"center",border:"none",borderRadius:"50%",background:a.wellSoft,color:a.textDim,cursor:"pointer",padding:0};function Ro({store:t,alert:e,queued:n}){let o=react.useRef(null);return react.useEffect(()=>t.play(e.level),[t,e.level]),jsxRuntime.jsx(ne,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsxRuntime.jsx(Mo,{store:t,alert:e,queued:n,chosen:o})})}function Mo({store:t,alert:e,queued:n,chosen:o}){let i=te(),r=e.input,u=Oe[e.level],l=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:k("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&t.source(f.openFeature)?.open?.(),i();};return jsxRuntime.jsxs("div",{role:"alertdialog","aria-label":r.title??r.message??"",style:{display:"grid",gap:12,justifyItems:"center",textAlign:"center"},children:[n>0?jsxRuntime.jsxs("span",{style:{justifySelf:"start",fontSize:12,fontWeight:800,color:a.textDim},children:["+",n]}):null,r.image?jsxRuntime.jsx("img",{src:r.image,alt:"",style:{maxWidth:"100%",maxHeight:180,objectFit:"contain",borderRadius:14}}):jsxRuntime.jsx("div",{className:e.level==="reward"?"idos-bounce":void 0,children:jsxRuntime.jsx(sn,{level:e.level,icon:r.icon,size:64})}),l?jsxRuntime.jsx(an,{source:l}):null,r.title?jsxRuntime.jsx("div",{style:{...x,fontSize:21,fontFamily:a.font,lineHeight:1.2},children:r.title}):null,r.message?jsxRuntime.jsx("div",{style:{fontSize:15,fontWeight:600,lineHeight:1.45,color:r.title?a.textDim:a.text,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:r.message}):null,jsxRuntime.jsx("div",{style:{display:"grid",gap:8,width:"100%",marginTop:4},children:d.map((f,y)=>f.primary||!p&&y===0?jsxRuntime.jsx(z,{tone:u,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsxRuntime.jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:No,children:f.label},f.id??f.label))})]})}var No={width:"100%",minHeight:44,borderRadius:a.buttonRadius,border:`1px solid ${a.line}`,background:a.wellSoft,color:a.text,fontFamily:a.font,fontSize:15,fontWeight:800,cursor:"pointer"};function Lo(t){return jsxRuntime.jsx(To,{state:t})}function To({state:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Io,{}),jsxRuntime.jsx(Ao,{}),jsxRuntime.jsx(Oo,{}),t.celebration?jsxRuntime.jsx(Eo,{lines:t.celebration.lines,title:t.celebration.options?.title,sound:t.celebration.options?.sound,onDone:t.finishCelebration},t.celebration.lines.map(e=>e.id).join()):null,jsxRuntime.jsx(ln,{store:t.notifications})]})}var ze=560;function Eo({lines:t,title:e,sound:n="reward",onDone:o}){let i=b(),r=O(),u=F(),l=react.useRef(new Map),d=react.useRef(false);react.useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(t,c=>l.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxRuntime.jsxs(ne,{title:e??k("youGot"),onClose:()=>{p(),o();},sound:false,variant:"center",width:420,children:[jsxRuntime.jsxs("div",{style:{position:"relative",overflow:"hidden",display:"flex",flexWrap:"wrap",gap:14,justifyContent:"center",padding:"22px 0"},children:[jsxRuntime.jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none",maskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)"},children:jsxRuntime.jsx("div",{style:{position:"absolute",width:ze,height:ze,left:`calc(50% - ${ze/2}px)`,top:`calc(50% - ${ze/2}px)`,background:`repeating-conic-gradient(color-mix(in srgb, ${a.gold} 16%, transparent) 0 12deg, transparent 12deg 24deg)`,animation:i.motion.on?"idos-rays 14s linear infinite":"none",borderRadius:"50%"}})}),t.map((c,f)=>jsxRuntime.jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${le} ${i.motion.on?.12*f:0}s both`},children:[jsxRuntime.jsx("div",{ref:y=>{y&&l.current.set(`${c.kind}:${c.id}`,y);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsxRuntime.jsx(N,{glyph:c.kind==="token"?pe(c):r.iconOf(c),size:46})}),jsxRuntime.jsxs("div",{style:{...x,fontSize:16},children:["+",$(c.amount)]}),jsxRuntime.jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ue(c,r,u)})]},`${c.kind}:${c.id}`))]}),jsxRuntime.jsx(Uo,{onPress:p})]})}function Uo({onPress:t}){let e=te();return jsxRuntime.jsx(z,{attract:true,onClick:()=>{t(),e();},children:k("great")})}function Io(){let t=fe(e=>e.flights);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx(Do,{flight:e},e.key))})}function Do({flight:t}){let e=react.useRef(null),n=b(),o=O();return react.useLayoutEffect(()=>{let i=e.current;if(!i||typeof i.animate!="function"){n.fx.arrive(t.key);return}let r=t.to.x-t.from.x,u=t.to.y-t.from.y,l=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${l}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${u}px) scale(.55)`,opacity:1}],{duration:t.durationMs,delay:t.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(t.key),()=>{d.onfinish=null,d.cancel();}},[]),jsxRuntime.jsx("div",{ref:e,style:{position:"absolute",left:t.from.x-16,top:t.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsxRuntime.jsx(N,{glyph:o.iconOf(t.line),size:32})})}var un=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function Ao(){let t=fe(e=>e.bursts);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx($o,{x:e.at.x,y:e.at.y},e.key))})}function $o({x:t,y:e}){let n=react.useRef(null);return react.useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,u)=>{if(typeof r.animate!="function")return;let l=u/16*Math.PI*2+Math.random()*.3,d=50+Math.random()*60;i.push(r.animate([{transform:"translate(0,0) scale(1)",opacity:1},{transform:`translate(${Math.cos(l)*d}px, ${Math.sin(l)*d+20}px) scale(.2)`,opacity:0}],{duration:650+Math.random()*200,easing:"cubic-bezier(.1,.8,.3,1)",fill:"forwards"}));}),()=>i.forEach(r=>r.cancel())},[]),jsxRuntime.jsx("div",{ref:n,style:{position:"absolute",left:t,top:e,width:0,height:0,zIndex:61,pointerEvents:"none"},children:Array.from({length:16},(o,i)=>jsxRuntime.jsx("span",{style:{position:"absolute",left:-4,top:-4,width:8,height:8,borderRadius:i%3===0?2:"50%",background:un[i%un.length]}},i))})}function Oo(){let t=F(),[e,n]=react.useState(false);return react.useEffect(()=>{if(!t)return;let o,i=t.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[t]),e?jsxRuntime.jsx("div",{role:"alert",style:{position:"absolute",top:"calc(8px + env(safe-area-inset-top))",left:"50%",transform:"translateX(-50%)",zIndex:45,padding:"6px 14px",borderRadius:999,background:a.red,...x,color:a.onRed,textShadow:a.onRedOutline,fontSize:13,pointerEvents:"none",animation:`idos-rise-in ${a.normal} ease both`},children:k("offline")}):null}var Mt=["economy","events","social","profile","other"];function pn(t){return [...t].sort((e,n)=>{let o=Mt.indexOf(e.group??"other")-Mt.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function zo({items:t,onOpen:e}){let{play:n}=b(),o=ht(),i=lt(pn(t),u=>u.group??"other"),r=0;return jsxRuntime.jsx("div",{style:{display:"grid",gap:18},children:i.map(u=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(gt,{children:Mt.includes(u.key)?k(u.key):u.key}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:u.items.map(l=>jsxRuntime.jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${l.id}`,onClick:()=>{n("click"),e(l.id);},style:{...U,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsxRuntime.jsx(N,{glyph:l.icon??"box",size:40}),jsxRuntime.jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:l.label}),jsxRuntime.jsx(ye,{count:l.badge??0})]},l.id))})]},u.key))})}exports.Badge=ye;exports.Button=z;exports.Card=lo;exports.Center=ro;exports.ConfirmPopup=ho;exports.DEFAULT_PLAYER_PREFS=B;exports.DEFAULT_UI_CONFIG=Lt;exports.DESKTOP_MIN_PX=Yt;exports.EASE_IN=ue;exports.EASE_OUT=Y;exports.EASE_POP=le;exports.EmptyState=io;exports.FeatureGrid=zo;exports.FxStore=j;exports.GLYPHS=jt;exports.Icon=N;exports.IconButton=he;exports.ItemTile=no;exports.KIT_CSS=je;exports.KitPortal=kt;exports.LEVEL_TONE=Oe;exports.NotificationStore=Re;exports.ON_TONE=ee;exports.Popup=ne;exports.ProgressBar=oo;exports.RARITY_ORDER=nt;exports.ResourceBadge=tn;exports.ResourceCounter=mt;exports.ResourceList=to;exports.SOUND_PRESETS=Ce;exports.SectionTitle=gt;exports.Spinner=en;exports.TABLET_MIN_PX=Ht;exports.TOAST_DURATION=We;exports.Tabs=ao;exports.Timer=so;exports.UI_SOUND_EVENTS=Ke;exports.UiKitProvider=On;exports.UiSoundEngine=ae;exports.Window=bo;exports.bundleLines=ot;exports.buttonStyle=Zt;exports.canAfford=Yn;exports.configSection=ge;exports.costLines=Vn;exports.countdown=st;exports.counterKeys=It;exports.createNotificationStore=qe;exports.currencyGlyph=ut;exports.defineUiConfig=mn;exports.effectiveVolume=_e;exports.errorText=qn;exports.formatAmount=$;exports.grantLines=Vt;exports.grantedBy=Hn;exports.groupBy=lt;exports.iconsFor=Ut;exports.isGlyph=Qt;exports.itemDefinitions=at;exports.itemGlyph=dt;exports.layoutFor=me;exports.makeT=Wt;exports.mergeLines=qt;exports.motionDurations=se;exports.outlined=x;exports.panel=U;exports.parsePlayerPrefs=Ge;exports.pickLanguage=et;exports.plural=Gn;exports.rarityRank=jn;exports.renderKitOverlays=Lo;exports.resolveSound=Et;exports.resolveUiConfig=Se;exports.resourceName=Ue;exports.screenBackground=He;exports.setAutoPopupsHeld=po;exports.sortFeatures=pn;exports.themeVars=Ve;exports.tokenGlyph=pe;exports.tokenName=rt;exports.tokenParts=it;exports.toneSurface=Ee;exports.uiT=k;exports.useAnimatedNumber=Jt;exports.useBalances=pt;exports.useCatalog=O;exports.useCelebrate=Dn;exports.useCounterValue=ft;exports.useGameLayout=Pe;exports.useLayout=Zn;exports.useMotion=Un;exports.useNotify=$n;exports.useNow=eo;exports.usePlayerPrefs=In;exports.usePopupClose=te;exports.usePresence=Le;exports.useSound=En;exports.useStagger=ht;exports.useToast=An;exports.useUiKit=b;exports.v=a;exports.well=Ye;
|
package/dist/ui/index.d.cts
CHANGED
|
@@ -854,6 +854,8 @@ declare function usePopupClose(): () => void;
|
|
|
854
854
|
declare function KitPortal({ children }: {
|
|
855
855
|
children: ReactNode;
|
|
856
856
|
}): ReactNode;
|
|
857
|
+
/** Holds (or releases) the auto-popup queue — the host calls it as the player enters/leaves a game. */
|
|
858
|
+
declare function setAutoPopupsHeld(held: boolean): void;
|
|
857
859
|
interface PopupProps {
|
|
858
860
|
children: ReactNode;
|
|
859
861
|
/** Called after the exit animation. Without it the popup cannot be dismissed by the player. */
|
|
@@ -915,4 +917,4 @@ declare function FeatureGrid({ items, onOpen, }: {
|
|
|
915
917
|
/** The theme tone of each level: colour of its badge, its stripe, its main button. */
|
|
916
918
|
declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
|
|
917
919
|
|
|
918
|
-
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LEVEL_TONE, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, Timer, UI_SOUND_EVENTS, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, grantLines, grantedBy, groupBy, iconsFor, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|
|
920
|
+
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LEVEL_TONE, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, Timer, UI_SOUND_EVENTS, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, grantLines, grantedBy, groupBy, iconsFor, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -854,6 +854,8 @@ declare function usePopupClose(): () => void;
|
|
|
854
854
|
declare function KitPortal({ children }: {
|
|
855
855
|
children: ReactNode;
|
|
856
856
|
}): ReactNode;
|
|
857
|
+
/** Holds (or releases) the auto-popup queue — the host calls it as the player enters/leaves a game. */
|
|
858
|
+
declare function setAutoPopupsHeld(held: boolean): void;
|
|
857
859
|
interface PopupProps {
|
|
858
860
|
children: ReactNode;
|
|
859
861
|
/** Called after the exit animation. Without it the popup cannot be dismissed by the player. */
|
|
@@ -915,4 +917,4 @@ declare function FeatureGrid({ items, onOpen, }: {
|
|
|
915
917
|
/** The theme tone of each level: colour of its badge, its stripe, its main button. */
|
|
916
918
|
declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
|
|
917
919
|
|
|
918
|
-
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LEVEL_TONE, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, Timer, UI_SOUND_EVENTS, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, grantLines, grantedBy, groupBy, iconsFor, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|
|
920
|
+
export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LEVEL_TONE, type Layout, type NotificationAction, type NotificationInput, type NotificationLevel, type NotificationSource, NotificationStore, ON_TONE, type Point, Popup, type PopupProps, ProgressBar, RARITY_ORDER, type ResolvedSound, ResourceBadge, ResourceCounter, type ResourceKind, type ResourceLine, ResourceList, SOUND_PRESETS, SectionTitle, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, Timer, UI_SOUND_EVENTS, type UiKitConfig, type UiKitConfigInput, UiKitProvider, type UiKitProviderProps, type UiKitValue, type UiLanguage, type UiMotion, type UiMotionConfig, type UiPlayerPrefs, type UiSoundConfig, UiSoundEngine, type UiSoundEvent, type UiSoundSpec, type UiStringKey, type UiThemeConfig, Window, bundleLines, buttonStyle, canAfford, configSection, costLines, countdown, counterKeys, createNotificationStore, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, grantLines, grantedBy, groupBy, iconsFor, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
|
package/dist/ui/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {c}from'../chunk-UYRDWMMD.js';import {createContext,useContext,useMemo,useState,useCallback,useRef,useEffect,useReducer,useLayoutEffect,useSyncExternalStore}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';var Ke=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function pn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Lt={theme:{bgTop:"#232a6b",bgBottom:"#0d1033",panel:"#2c3480",panelDeep:"#1d2360",panelEdge:"#4f5bc9",text:"#ffffff",textDim:"#aeb6f0",gold:"#ffd24a",goldDeep:"#e89a12",green:"#59d35b",greenDeep:"#2b9936",blue:"#4fb1ff",blueDeep:"#2276d6",red:"#ff5a5a",redDeep:"#b83232",shadow:"rgba(4, 6, 30, 0.55)",backdrop:"rgba(5, 7, 30, 0.72)",onGreen:"#ffffff",onGold:"#ffffff",onBlue:"#ffffff",onRed:"#ffffff",textOutline:we,line:"rgba(255, 255, 255, 0.2)",well:"rgba(8, 10, 40, 0.6)",wellSoft:"rgba(0, 0, 0, 0.3)",wellShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.4)",edge:"rgba(0, 0, 0, 0.35)",glow:"rgba(90, 110, 255, 0.35)",panelShadow:"0 6px 0 rgba(4, 6, 30, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.12)",radius:18,buttonRadius:14,font:"'Baloo 2', 'Nunito', 'Trebuchet MS', system-ui, sans-serif",rarity:{Common:"#a9b3c9",Uncommon:"#63d86b",Rare:"#4fb1ff",Epic:"#b879ff",Legendary:"#ffb52e"}},motion:{enabled:true,speed:1,intensity:1,rewardFlight:true,particles:true,stagger:true,respectReducedMotion:true},sound:{enabled:true,volume:.6,events:{}}},_=(t,e,n,o)=>typeof t=="number"&&Number.isFinite(t)?Math.min(n,Math.max(e,t)):o;function Se(t){let e=Lt,n={...e.theme,...Nt(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},hn(n,t?.theme??{}),n.radius=_(n.radius,0,64,e.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,e.theme.buttonRadius);let o={...e.motion,...Nt(t?.motion??{})};o.speed=_(o.speed,.1,5,e.motion.speed),o.intensity=_(o.intensity,0,3,e.motion.intensity);let i=t?.sound??{},r={enabled:i.enabled??e.sound.enabled,volume:_(i.volume??e.sound.volume,0,1,e.sound.volume),events:{...e.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function gn(t){if(typeof t!="string")return null;let e=t.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(e);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,u,l]=[...o].map(d=>parseInt(d+d,16));return [i,r,u,o.length===4?l/255:1]}if(o.length===6||o.length===8){let i=r=>parseInt(o.slice(r,r+2),16);return [i(0),i(2),i(4),o.length===8?i(6)/255:1]}return null}if(n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/.exec(e),n){let o=n[4]===void 0?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]);return [parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),o]}return null}function Pt(t){let e=gn(t);if(!e)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(e[0])+.7152*n(e[1])+.0722*n(e[2])}var Be=t=>(Pt(t)??0)>.5,mn=t=>Be(t.text)?"#1d2233":t.text;function H(t){let e=Pt(t);return e===null||e>.35?we:"none"}function hn(t,e){let n=u=>e[u]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[u,l]of o)!n(u)&&n(l)&&(t[u]=Be(t[l])?mn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Be(t.panel);i&&r&&!n("shadow")&&(t.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(t.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(t.panelShadow=r?`0 6px 18px ${t.shadow}, 0 1px 0 ${t.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${t.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(t.textOutline=H(t.text)),n("line")||(t.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(t.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(t.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(t.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(t.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(t.glow=`color-mix(in srgb, ${t.blue} ${r?18:30}%, transparent)`));}function Nt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function se(t,e){if(!t.enabled||e)return {fast:0,normal:0,slow:0};let n=1/t.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var K={muted:false,volume:1,reducedMotion:false};function Fe(t){if(!t)return {...K};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:_(Number(e.volume),0,1,K.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...K}}}function Ge(t,e,n=1){return !t.enabled||e.muted?0:_(t.volume*e.volume*n,0,1,0)}var Re={click:{notes:[{freq:1100,slideTo:760,dur:.045,wave:"triangle",gain:.5}]},tab:{notes:[{freq:660,slideTo:880,dur:.06,wave:"sine",gain:.45}]},open:{notes:[{freq:520,dur:.07,wave:"sine",gain:.35},{freq:780,at:.05,dur:.09,wave:"sine",gain:.35}],noise:[{dur:.12,gain:.12,freq:1800,slideTo:4200}]},close:{notes:[{freq:700,slideTo:420,dur:.1,wave:"sine",gain:.3}],noise:[{dur:.1,gain:.08,freq:3e3,slideTo:1200}]},coin:{notes:[{freq:1320,dur:.06,wave:"square",gain:.18},{freq:1760,at:.06,dur:.16,wave:"square",gain:.18}]},reward:{notes:[{freq:523,dur:.09,wave:"triangle",gain:.45},{freq:659,at:.08,dur:.09,wave:"triangle",gain:.45},{freq:784,at:.16,dur:.09,wave:"triangle",gain:.45},{freq:1047,at:.24,dur:.22,wave:"triangle",gain:.5}],noise:[{at:.24,dur:.25,gain:.06,freq:6e3}]},claim:{notes:[{freq:784,dur:.07,wave:"triangle",gain:.45},{freq:1175,at:.07,dur:.16,wave:"triangle",gain:.45}],noise:[{at:.05,dur:.2,gain:.07,freq:7e3}]},purchase:{notes:[{freq:1500,dur:.05,wave:"square",gain:.15},{freq:2e3,at:.05,dur:.18,wave:"square",gain:.15}],noise:[{dur:.08,gain:.25,freq:2500}]},error:{notes:[{freq:220,dur:.1,wave:"square",gain:.2},{freq:175,at:.1,dur:.16,wave:"square",gain:.2}]},notify:{notes:[{freq:880,dur:.12,wave:"sine",gain:.4},{freq:1175,at:.1,dur:.25,wave:"sine",gain:.35}]},lootbox:{noise:[{dur:.45,gain:.18,freq:400,slideTo:5e3}],notes:[{freq:523,at:.42,dur:.3,wave:"triangle",gain:.35},{freq:659,at:.42,dur:.3,wave:"triangle",gain:.3},{freq:784,at:.42,dur:.35,wave:"triangle",gain:.3}]},levelUp:{notes:[{freq:392,dur:.1,wave:"square",gain:.2},{freq:523,at:.1,dur:.1,wave:"square",gain:.2},{freq:659,at:.2,dur:.1,wave:"square",gain:.2},{freq:784,at:.3,dur:.35,wave:"square",gain:.22}]},countTick:{notes:[{freq:2e3,dur:.018,wave:"sine",gain:.12}]}};function Tt(t,e){let n=e.events[t];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Re[t],volume:1}:typeof n=="string"?{kind:"synth",preset:Ke.includes(n)?Re[n]:Re[t],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var yn={countTick:45,coin:60,click:30},ae=class{constructor(e,n){this.config=e;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(e,n){this.config=e,this.prefs=n;}attach(e=typeof window<"u"?window:void 0){if(!e||this.detach)return;let n=()=>{this.unlocked=true;let i=this.context();i&&i.state==="suspended"&&i.resume();},o=["pointerdown","keydown","touchstart"];for(let i of o)e.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)e.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(e){if(!this.unlocked)return;let n=yn[e],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(e)??-1/0)<n)return;this.lastPlayed.set(e,o);let i=Tt(e,this.config);if(i.kind==="none")return;let r=Ge(this.config,this.prefs,i.volume);if(r<=0)return;let u=this.context();u&&(i.kind==="synth"?this.playSynth(u,i.preset,r):this.playFile(u,i.url,r));}context(){if(this.ctx)return this.ctx;let e=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;try{this.ctx=new e;}catch{return null}return this.ctx}playSynth(e,n,o){let i=e.currentTime+.005,r=e.createGain();r.gain.value=o,r.connect(e.destination);for(let u of n.notes??[]){let l=i+(u.at??0),d=l+Math.max(.01,u.dur),p=e.createOscillator();p.type=u.wave??"sine",p.frequency.setValueAtTime(u.freq,l),u.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,u.gain??.4);c.gain.setValueAtTime(1e-4,l),c.gain.exponentialRampToValueAtTime(f,l+Math.min(.012,u.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(l),p.stop(d+.02);}for(let u of n.noise??[]){let l=i+(u.at??0),d=Math.max(.01,u.dur),p=e.createBuffer(1,Math.ceil(e.sampleRate*d),e.sampleRate),c=p.getChannelData(0);for(let C=0;C<c.length;C++)c[C]=Math.random()*2-1;let f=e.createBufferSource();f.buffer=p;let y=e.createBiquadFilter();y.type="bandpass",y.Q.value=1.2,y.frequency.setValueAtTime(u.freq??3e3,l),u.slideTo&&y.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),l+d);let v=e.createGain();v.gain.setValueAtTime(Math.max(1e-4,u.gain??.15),l),v.gain.exponentialRampToValueAtTime(1e-4,l+d),f.connect(y).connect(v).connect(r),f.start(l),f.stop(l+d+.02);}}async playFile(e,n,o){let i=this.buffers.get(n);i||(i=fetch(n).then(d=>d.ok?d.arrayBuffer():Promise.reject(new Error(String(d.status)))).then(d=>e.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let u=e.createBufferSource();u.buffer=r;let l=e.createGain();l.gain.value=o,u.connect(l).connect(e.destination),u.start();}};var _e={info:3500,success:3e3,reward:4500,warning:5500,error:6500},bn={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Ce=class{toastList=[];alertQueue=[];waiting=new Map;listeners=new Set;nextId=1;player=null;resolver=null;get toasts(){return this.toastList}get currentAlert(){return this.alertQueue[0]??null}get queued(){return Math.max(0,this.alertQueue.length-1)}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setPlayer(e){this.player=e;}setSourceResolver(e){this.resolver=e,this.emit();}source(e){if(!e)return null;try{return this.resolver?.(e)??null}catch{return null}}toast(e){let n=typeof e=="string"?{message:e}:e,o=n.level??"info",i=n.key?this.toastList.find(l=>l.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(l=>!l.input.key&&l.level===o&&l.input.title===n.title&&l.input.message===n.message));if(r){let l={...r,level:o,input:n,count:i?r.count:r.count+1,revision:r.revision+1};return this.toastList=[...this.toastList.filter(d=>d.id!==r.id),l],this.play(o),this.emit(),r.id}let u={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,u].slice(-3),this.play(o),this.emit(),u.id}alert(e){let n=e.level??"info";if(e.key){let i=this.alertQueue.find(r=>r.input.key===e.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:e,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let u=this.waiting.get(i.id);this.waiting.set(i.id,l=>{u?.(l),r(l);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:e,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(e,n=null){if(this.toastList.some(r=>r.id===e)){this.toastList=this.toastList.filter(r=>r.id!==e),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==e),this.alertQueue.length===o)return;let i=this.waiting.get(e);this.waiting.delete(e),i?.(n),this.emit();}clear(){for(let e of this.waiting.values())e(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(e){this.player?.(bn[e]);}emit(){for(let e of [...this.listeners])e();}};function We(){return new Ce}function qe(t,e){let n=t.theme,o=se(t.motion,e),i=t.motion.enabled&&!e;return {"--idos-ui-bg-top":n.bgTop,"--idos-ui-bg-bottom":n.bgBottom,"--idos-ui-panel":n.panel,"--idos-ui-panel-deep":n.panelDeep,"--idos-ui-panel-edge":n.panelEdge,"--idos-ui-text":n.text,"--idos-ui-text-dim":n.textDim,"--idos-ui-gold":n.gold,"--idos-ui-gold-deep":n.goldDeep,"--idos-ui-green":n.green,"--idos-ui-green-deep":n.greenDeep,"--idos-ui-blue":n.blue,"--idos-ui-blue-deep":n.blueDeep,"--idos-ui-red":n.red,"--idos-ui-red-deep":n.redDeep,"--idos-ui-shadow":n.shadow,"--idos-ui-backdrop":n.backdrop,"--idos-ui-on-green":n.onGreen,"--idos-ui-on-gold":n.onGold,"--idos-ui-on-blue":n.onBlue,"--idos-ui-on-red":n.onRed,"--idos-ui-on-green-outline":H(n.onGreen),"--idos-ui-on-gold-outline":H(n.onGold),"--idos-ui-on-blue-outline":H(n.onBlue),"--idos-ui-on-red-outline":H(n.onRed),"--idos-ui-text-outline":n.textOutline,"--idos-ui-line":n.line,"--idos-ui-well":n.well,"--idos-ui-well-soft":n.wellSoft,"--idos-ui-well-shadow":n.wellShadow,"--idos-ui-edge":n.edge,"--idos-ui-glow":n.glow,"--idos-ui-panel-shadow":n.panelShadow,"--idos-ui-radius":`${n.radius}px`,"--idos-ui-button-radius":`${n.buttonRadius}px`,"--idos-ui-font":n.font,"--idos-ui-fast":`${o.fast}ms`,"--idos-ui-normal":`${o.normal}ms`,"--idos-ui-slow":`${o.slow}ms`,"--idos-ui-k":String(i?t.motion.intensity:0)}}var a={bgTop:"var(--idos-ui-bg-top)",bgBottom:"var(--idos-ui-bg-bottom)",panel:"var(--idos-ui-panel)",panelDeep:"var(--idos-ui-panel-deep)",panelEdge:"var(--idos-ui-panel-edge)",text:"var(--idos-ui-text)",textDim:"var(--idos-ui-text-dim)",gold:"var(--idos-ui-gold)",goldDeep:"var(--idos-ui-gold-deep)",green:"var(--idos-ui-green)",greenDeep:"var(--idos-ui-green-deep)",blue:"var(--idos-ui-blue)",blueDeep:"var(--idos-ui-blue-deep)",red:"var(--idos-ui-red)",redDeep:"var(--idos-ui-red-deep)",shadow:"var(--idos-ui-shadow)",backdrop:"var(--idos-ui-backdrop)",onGreen:"var(--idos-ui-on-green)",onGold:"var(--idos-ui-on-gold)",onBlue:"var(--idos-ui-on-blue)",onRed:"var(--idos-ui-on-red)",onGreenOutline:"var(--idos-ui-on-green-outline)",onGoldOutline:"var(--idos-ui-on-gold-outline)",onBlueOutline:"var(--idos-ui-on-blue-outline)",onRedOutline:"var(--idos-ui-on-red-outline)",textOutline:"var(--idos-ui-text-outline)",line:"var(--idos-ui-line)",well:"var(--idos-ui-well)",wellSoft:"var(--idos-ui-well-soft)",wellShadow:"var(--idos-ui-well-shadow)",edge:"var(--idos-ui-edge)",glow:"var(--idos-ui-glow)",panelShadow:"var(--idos-ui-panel-shadow)",radius:"var(--idos-ui-radius)",buttonRadius:"var(--idos-ui-button-radius)",font:"var(--idos-ui-font)",fast:"var(--idos-ui-fast)",normal:"var(--idos-ui-normal)",slow:"var(--idos-ui-slow)"},x={color:a.text,fontWeight:800,textShadow:a.textOutline,letterSpacing:.2},U={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},Ve=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,He={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},le="cubic-bezier(.2, .9, .3, 1.25)",Y="cubic-bezier(.2, .8, .2, 1)",ue="cubic-bezier(.5, 0, .75, .2)",Ye=`
|
|
1
|
+
import {c}from'../chunk-UYRDWMMD.js';import {createContext,useContext,useMemo,useState,useCallback,useRef,useEffect,useReducer,useLayoutEffect,useSyncExternalStore}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {createPortal}from'react-dom';var Ke=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function gn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Lt={theme:{bgTop:"#232a6b",bgBottom:"#0d1033",panel:"#2c3480",panelDeep:"#1d2360",panelEdge:"#4f5bc9",text:"#ffffff",textDim:"#aeb6f0",gold:"#ffd24a",goldDeep:"#e89a12",green:"#59d35b",greenDeep:"#2b9936",blue:"#4fb1ff",blueDeep:"#2276d6",red:"#ff5a5a",redDeep:"#b83232",shadow:"rgba(4, 6, 30, 0.55)",backdrop:"rgba(5, 7, 30, 0.72)",onGreen:"#ffffff",onGold:"#ffffff",onBlue:"#ffffff",onRed:"#ffffff",textOutline:we,line:"rgba(255, 255, 255, 0.2)",well:"rgba(8, 10, 40, 0.6)",wellSoft:"rgba(0, 0, 0, 0.3)",wellShadow:"inset 0 2px 4px rgba(0, 0, 0, 0.4)",edge:"rgba(0, 0, 0, 0.35)",glow:"rgba(90, 110, 255, 0.35)",panelShadow:"0 6px 0 rgba(4, 6, 30, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.12)",radius:18,buttonRadius:14,font:"'Baloo 2', 'Nunito', 'Trebuchet MS', system-ui, sans-serif",rarity:{Common:"#a9b3c9",Uncommon:"#63d86b",Rare:"#4fb1ff",Epic:"#b879ff",Legendary:"#ffb52e"}},motion:{enabled:true,speed:1,intensity:1,rewardFlight:true,particles:true,stagger:true,respectReducedMotion:true},sound:{enabled:true,volume:.6,events:{}}},_=(t,e,n,o)=>typeof t=="number"&&Number.isFinite(t)?Math.min(n,Math.max(e,t)):o;function Se(t){let e=Lt,n={...e.theme,...Pt(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},yn(n,t?.theme??{}),n.radius=_(n.radius,0,64,e.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,e.theme.buttonRadius);let o={...e.motion,...Pt(t?.motion??{})};o.speed=_(o.speed,.1,5,e.motion.speed),o.intensity=_(o.intensity,0,3,e.motion.intensity);let i=t?.sound??{},r={enabled:i.enabled??e.sound.enabled,volume:_(i.volume??e.sound.volume,0,1,e.sound.volume),events:{...e.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function mn(t){if(typeof t!="string")return null;let e=t.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(e);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,u,l]=[...o].map(d=>parseInt(d+d,16));return [i,r,u,o.length===4?l/255:1]}if(o.length===6||o.length===8){let i=r=>parseInt(o.slice(r,r+2),16);return [i(0),i(2),i(4),o.length===8?i(6)/255:1]}return null}if(n=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:[\s,/]+([\d.]+%?))?\s*\)$/.exec(e),n){let o=n[4]===void 0?1:n[4].endsWith("%")?parseFloat(n[4])/100:parseFloat(n[4]);return [parseFloat(n[1]),parseFloat(n[2]),parseFloat(n[3]),o]}return null}function Tt(t){let e=mn(t);if(!e)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(e[0])+.7152*n(e[1])+.0722*n(e[2])}var Fe=t=>(Tt(t)??0)>.5,hn=t=>Fe(t.text)?"#1d2233":t.text;function H(t){let e=Tt(t);return e===null||e>.35?we:"none"}function yn(t,e){let n=u=>e[u]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[u,l]of o)!n(u)&&n(l)&&(t[u]=Fe(t[l])?hn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Fe(t.panel);i&&r&&!n("shadow")&&(t.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(t.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(t.panelShadow=r?`0 6px 18px ${t.shadow}, 0 1px 0 ${t.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${t.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(t.textOutline=H(t.text)),n("line")||(t.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(t.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(t.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(t.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(t.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(t.glow=`color-mix(in srgb, ${t.blue} ${r?18:30}%, transparent)`));}function Pt(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function se(t,e){if(!t.enabled||e)return {fast:0,normal:0,slow:0};let n=1/t.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var F={muted:false,volume:1,reducedMotion:false};function Ge(t){if(!t)return {...F};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:_(Number(e.volume),0,1,F.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...F}}}function _e(t,e,n=1){return !t.enabled||e.muted?0:_(t.volume*e.volume*n,0,1,0)}var Re={click:{notes:[{freq:1100,slideTo:760,dur:.045,wave:"triangle",gain:.5}]},tab:{notes:[{freq:660,slideTo:880,dur:.06,wave:"sine",gain:.45}]},open:{notes:[{freq:520,dur:.07,wave:"sine",gain:.35},{freq:780,at:.05,dur:.09,wave:"sine",gain:.35}],noise:[{dur:.12,gain:.12,freq:1800,slideTo:4200}]},close:{notes:[{freq:700,slideTo:420,dur:.1,wave:"sine",gain:.3}],noise:[{dur:.1,gain:.08,freq:3e3,slideTo:1200}]},coin:{notes:[{freq:1320,dur:.06,wave:"square",gain:.18},{freq:1760,at:.06,dur:.16,wave:"square",gain:.18}]},reward:{notes:[{freq:523,dur:.09,wave:"triangle",gain:.45},{freq:659,at:.08,dur:.09,wave:"triangle",gain:.45},{freq:784,at:.16,dur:.09,wave:"triangle",gain:.45},{freq:1047,at:.24,dur:.22,wave:"triangle",gain:.5}],noise:[{at:.24,dur:.25,gain:.06,freq:6e3}]},claim:{notes:[{freq:784,dur:.07,wave:"triangle",gain:.45},{freq:1175,at:.07,dur:.16,wave:"triangle",gain:.45}],noise:[{at:.05,dur:.2,gain:.07,freq:7e3}]},purchase:{notes:[{freq:1500,dur:.05,wave:"square",gain:.15},{freq:2e3,at:.05,dur:.18,wave:"square",gain:.15}],noise:[{dur:.08,gain:.25,freq:2500}]},error:{notes:[{freq:220,dur:.1,wave:"square",gain:.2},{freq:175,at:.1,dur:.16,wave:"square",gain:.2}]},notify:{notes:[{freq:880,dur:.12,wave:"sine",gain:.4},{freq:1175,at:.1,dur:.25,wave:"sine",gain:.35}]},lootbox:{noise:[{dur:.45,gain:.18,freq:400,slideTo:5e3}],notes:[{freq:523,at:.42,dur:.3,wave:"triangle",gain:.35},{freq:659,at:.42,dur:.3,wave:"triangle",gain:.3},{freq:784,at:.42,dur:.35,wave:"triangle",gain:.3}]},levelUp:{notes:[{freq:392,dur:.1,wave:"square",gain:.2},{freq:523,at:.1,dur:.1,wave:"square",gain:.2},{freq:659,at:.2,dur:.1,wave:"square",gain:.2},{freq:784,at:.3,dur:.35,wave:"square",gain:.22}]},countTick:{notes:[{freq:2e3,dur:.018,wave:"sine",gain:.12}]}};function Et(t,e){let n=e.events[t];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Re[t],volume:1}:typeof n=="string"?{kind:"synth",preset:Ke.includes(n)?Re[n]:Re[t],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var bn={countTick:45,coin:60,click:30},ae=class{constructor(e,n){this.config=e;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(e,n){this.config=e,this.prefs=n;}attach(e=typeof window<"u"?window:void 0){if(!e||this.detach)return;let n=()=>{this.unlocked=true;let i=this.context();i&&i.state==="suspended"&&i.resume();},o=["pointerdown","keydown","touchstart"];for(let i of o)e.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)e.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(e){if(!this.unlocked)return;let n=bn[e],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(e)??-1/0)<n)return;this.lastPlayed.set(e,o);let i=Et(e,this.config);if(i.kind==="none")return;let r=_e(this.config,this.prefs,i.volume);if(r<=0)return;let u=this.context();u&&(i.kind==="synth"?this.playSynth(u,i.preset,r):this.playFile(u,i.url,r));}context(){if(this.ctx)return this.ctx;let e=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!e)return null;try{this.ctx=new e;}catch{return null}return this.ctx}playSynth(e,n,o){let i=e.currentTime+.005,r=e.createGain();r.gain.value=o,r.connect(e.destination);for(let u of n.notes??[]){let l=i+(u.at??0),d=l+Math.max(.01,u.dur),p=e.createOscillator();p.type=u.wave??"sine",p.frequency.setValueAtTime(u.freq,l),u.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,u.gain??.4);c.gain.setValueAtTime(1e-4,l),c.gain.exponentialRampToValueAtTime(f,l+Math.min(.012,u.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(l),p.stop(d+.02);}for(let u of n.noise??[]){let l=i+(u.at??0),d=Math.max(.01,u.dur),p=e.createBuffer(1,Math.ceil(e.sampleRate*d),e.sampleRate),c=p.getChannelData(0);for(let C=0;C<c.length;C++)c[C]=Math.random()*2-1;let f=e.createBufferSource();f.buffer=p;let y=e.createBiquadFilter();y.type="bandpass",y.Q.value=1.2,y.frequency.setValueAtTime(u.freq??3e3,l),u.slideTo&&y.frequency.exponentialRampToValueAtTime(Math.max(20,u.slideTo),l+d);let v=e.createGain();v.gain.setValueAtTime(Math.max(1e-4,u.gain??.15),l),v.gain.exponentialRampToValueAtTime(1e-4,l+d),f.connect(y).connect(v).connect(r),f.start(l),f.stop(l+d+.02);}}async playFile(e,n,o){let i=this.buffers.get(n);i||(i=fetch(n).then(d=>d.ok?d.arrayBuffer():Promise.reject(new Error(String(d.status)))).then(d=>e.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let u=e.createBufferSource();u.buffer=r;let l=e.createGain();l.gain.value=o,u.connect(l).connect(e.destination),u.start();}};var We={info:3500,success:3e3,reward:4500,warning:5500,error:6500},vn={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Ce=class{toastList=[];alertQueue=[];waiting=new Map;listeners=new Set;nextId=1;player=null;resolver=null;get toasts(){return this.toastList}get currentAlert(){return this.alertQueue[0]??null}get queued(){return Math.max(0,this.alertQueue.length-1)}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setPlayer(e){this.player=e;}setSourceResolver(e){this.resolver=e,this.emit();}source(e){if(!e)return null;try{return this.resolver?.(e)??null}catch{return null}}toast(e){let n=typeof e=="string"?{message:e}:e,o=n.level??"info",i=n.key?this.toastList.find(l=>l.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(l=>!l.input.key&&l.level===o&&l.input.title===n.title&&l.input.message===n.message));if(r){let l={...r,level:o,input:n,count:i?r.count:r.count+1,revision:r.revision+1};return this.toastList=[...this.toastList.filter(d=>d.id!==r.id),l],this.play(o),this.emit(),r.id}let u={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,u].slice(-3),this.play(o),this.emit(),u.id}alert(e){let n=e.level??"info";if(e.key){let i=this.alertQueue.find(r=>r.input.key===e.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:e,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let u=this.waiting.get(i.id);this.waiting.set(i.id,l=>{u?.(l),r(l);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:e,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(e,n=null){if(this.toastList.some(r=>r.id===e)){this.toastList=this.toastList.filter(r=>r.id!==e),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==e),this.alertQueue.length===o)return;let i=this.waiting.get(e);this.waiting.delete(e),i?.(n),this.emit();}clear(){for(let e of this.waiting.values())e(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(e){this.player?.(vn[e]);}emit(){for(let e of [...this.listeners])e();}};function qe(){return new Ce}function Ve(t,e){let n=t.theme,o=se(t.motion,e),i=t.motion.enabled&&!e;return {"--idos-ui-bg-top":n.bgTop,"--idos-ui-bg-bottom":n.bgBottom,"--idos-ui-panel":n.panel,"--idos-ui-panel-deep":n.panelDeep,"--idos-ui-panel-edge":n.panelEdge,"--idos-ui-text":n.text,"--idos-ui-text-dim":n.textDim,"--idos-ui-gold":n.gold,"--idos-ui-gold-deep":n.goldDeep,"--idos-ui-green":n.green,"--idos-ui-green-deep":n.greenDeep,"--idos-ui-blue":n.blue,"--idos-ui-blue-deep":n.blueDeep,"--idos-ui-red":n.red,"--idos-ui-red-deep":n.redDeep,"--idos-ui-shadow":n.shadow,"--idos-ui-backdrop":n.backdrop,"--idos-ui-on-green":n.onGreen,"--idos-ui-on-gold":n.onGold,"--idos-ui-on-blue":n.onBlue,"--idos-ui-on-red":n.onRed,"--idos-ui-on-green-outline":H(n.onGreen),"--idos-ui-on-gold-outline":H(n.onGold),"--idos-ui-on-blue-outline":H(n.onBlue),"--idos-ui-on-red-outline":H(n.onRed),"--idos-ui-text-outline":n.textOutline,"--idos-ui-line":n.line,"--idos-ui-well":n.well,"--idos-ui-well-soft":n.wellSoft,"--idos-ui-well-shadow":n.wellShadow,"--idos-ui-edge":n.edge,"--idos-ui-glow":n.glow,"--idos-ui-panel-shadow":n.panelShadow,"--idos-ui-radius":`${n.radius}px`,"--idos-ui-button-radius":`${n.buttonRadius}px`,"--idos-ui-font":n.font,"--idos-ui-fast":`${o.fast}ms`,"--idos-ui-normal":`${o.normal}ms`,"--idos-ui-slow":`${o.slow}ms`,"--idos-ui-k":String(i?t.motion.intensity:0)}}var a={bgTop:"var(--idos-ui-bg-top)",bgBottom:"var(--idos-ui-bg-bottom)",panel:"var(--idos-ui-panel)",panelDeep:"var(--idos-ui-panel-deep)",panelEdge:"var(--idos-ui-panel-edge)",text:"var(--idos-ui-text)",textDim:"var(--idos-ui-text-dim)",gold:"var(--idos-ui-gold)",goldDeep:"var(--idos-ui-gold-deep)",green:"var(--idos-ui-green)",greenDeep:"var(--idos-ui-green-deep)",blue:"var(--idos-ui-blue)",blueDeep:"var(--idos-ui-blue-deep)",red:"var(--idos-ui-red)",redDeep:"var(--idos-ui-red-deep)",shadow:"var(--idos-ui-shadow)",backdrop:"var(--idos-ui-backdrop)",onGreen:"var(--idos-ui-on-green)",onGold:"var(--idos-ui-on-gold)",onBlue:"var(--idos-ui-on-blue)",onRed:"var(--idos-ui-on-red)",onGreenOutline:"var(--idos-ui-on-green-outline)",onGoldOutline:"var(--idos-ui-on-gold-outline)",onBlueOutline:"var(--idos-ui-on-blue-outline)",onRedOutline:"var(--idos-ui-on-red-outline)",textOutline:"var(--idos-ui-text-outline)",line:"var(--idos-ui-line)",well:"var(--idos-ui-well)",wellSoft:"var(--idos-ui-well-soft)",wellShadow:"var(--idos-ui-well-shadow)",edge:"var(--idos-ui-edge)",glow:"var(--idos-ui-glow)",panelShadow:"var(--idos-ui-panel-shadow)",radius:"var(--idos-ui-radius)",buttonRadius:"var(--idos-ui-button-radius)",font:"var(--idos-ui-font)",fast:"var(--idos-ui-fast)",normal:"var(--idos-ui-normal)",slow:"var(--idos-ui-slow)"},x={color:a.text,fontWeight:800,textShadow:a.textOutline,letterSpacing:.2},U={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},He=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Ye={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},le="cubic-bezier(.2, .9, .3, 1.25)",Y="cubic-bezier(.2, .8, .2, 1)",ue="cubic-bezier(.5, 0, .75, .2)",je=`
|
|
2
2
|
@keyframes idos-pop-in { 0% { transform: scale(.7); opacity: 0 } 65% { transform: scale(calc(1 + .06 * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: scale(1); opacity: 1 } }
|
|
3
3
|
@keyframes idos-pop-out { 0% { transform: scale(1); opacity: 1 } 30% { transform: scale(calc(1 + .03 * var(--idos-ui-k, 1))) } 100% { transform: scale(.75); opacity: 0 } }
|
|
4
4
|
@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }
|
|
@@ -35,4 +35,4 @@ import {c}from'../chunk-UYRDWMMD.js';import {createContext,useContext,useMemo,us
|
|
|
35
35
|
.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }
|
|
36
36
|
.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }
|
|
37
37
|
[data-idos-motion="off"] .idos-shine::after, [data-idos-motion="off"] .idos-bounce, [data-idos-motion="off"] .idos-glow, [data-idos-motion="off"] .idos-pulse, [data-idos-motion="off"] .idos-bump { animation: none }
|
|
38
|
-
`;function Et(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function Ut(t){return t.kind==="currency"?[t.id]:t.kind==="item"?[`item:${t.id}`,"inventory"]:[]}var j=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setMotion(e){this.motion=e;}setPlayer(e){this.player=e;}setLayer(e){this.layerEl=e;}holding(e){return (this.holds.get(e)??0)+(this.reserved.get(e)??0)}reserve(e){if(this.motion?.rewardFlight){for(let n of e)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(e){let n=false;for(let o of e){if(o.kind!=="currency")continue;let i=(this.reserved.get(o.id)??0)-1;i<=0?this.reserved.delete(o.id):this.reserved.set(o.id,i),n=true;}n&&this.changed();}fly(e,n){if(!this.motion?.rewardFlight||!this.layerEl||typeof document>"u")return;let o=this.layerEl.getBoundingClientRect(),i=Math.max(200,this.motion.durations.slow+180),r=[];for(let u of e){let l=Ut(u).map(y=>({key:y,el:document.querySelector(`[data-resource-counter="${It(y)}"]`)})).find(y=>y.el&&xn(y.el));if(!l?.el)continue;let d=je(l.el.getBoundingClientRect(),o),p=n(u),c=p?je(p,o):{x:o.width/2,y:o.height/2},f=Et(u.amount);for(let y=0;y<f;y++)r.push({key:this.nextKey++,line:u,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:y*55,durationMs:i,target:l.key}),this.holds.set(l.key,(this.holds.get(l.key)??0)+1);}this.release(e),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(e){let n=this.flights.find(i=>i.key===e);if(!n)return;this.flights=this.flights.filter(i=>i.key!==e);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),kn(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(e){if(!this.motion?.particles||!this.layerEl||!e)return;let n=je(e.getBoundingClientRect(),this.layerEl.getBoundingClientRect()),o=this.nextKey++;this.bursts=[...this.bursts,{key:o,at:n}],this.changed(),setTimeout(()=>{this.bursts=this.bursts.filter(i=>i.key!==o),this.changed();},900);}changed(){this.version+=1;for(let e of this.listeners)e();}};function je(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function xn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function kn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${It(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function It(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var Dt=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",$t="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function At(t){if(!(t instanceof HTMLElement)||t.hasAttribute($t))return;t.setAttribute($t,"");let e=t.style,n=Q(1.6,2.8);e.setProperty("--idos-float-speed",n.toFixed(2)),e.setProperty("--idos-float-phase",(-Q(0,n)).toFixed(2)),e.setProperty("--idos-float-amp",Q(3,7).toFixed(1)),e.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*Q(0,1.5)).toFixed(2));let o=Q(5,7.5);e.setProperty("--idos-shine-speed",o.toFixed(2)),e.setProperty("--idos-shine-phase",(-Q(0,o)).toFixed(2));}function Qe(t){t instanceof Element&&(t.matches(Dt)&&At(t),t.querySelectorAll(Dt).forEach(At));}function Ot(t){if(typeof MutationObserver>"u")return ()=>{};Qe(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?Qe(o.target):o.addedNodes.forEach(Qe);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Bt="idos-ui-prefs";function Mn(){try{return Fe(typeof localStorage<"u"?localStorage.getItem(Bt):null)}catch{return {...K}}}function Nn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Kt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&Nn(),o=t.motion.enabled&&!n;return {on:o,durations:se(t.motion,n),intensity:o?t.motion.intensity:0,rewardFlight:o&&t.motion.rewardFlight,particles:o&&t.motion.particles,stagger:o&&t.motion.stagger}}var zt=Se(null),Ln=new j,Pn={config:zt,prefs:K,setPrefs:()=>{},motion:Kt(zt,K),play:()=>{},layer:null,fx:Ln,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Ft=createContext(Pn);function b(){return useContext(Ft)}function Tn(){return b().play}function En(){return b().motion}function Un(){let t=b();return [t.prefs,t.setPrefs]}function In(){return b().celebrate}function Dn(){return b().toast}function $n(){return b().notify}function An({config:t,children:e,overlays:n,notifications:o}){let i=useMemo(()=>Se(t),[t]),[r,u]=useState(Mn),l=useCallback(w=>{u(V=>{let Mt={...V,...w};try{localStorage.setItem(Bt,JSON.stringify(Mt));}catch{}return Mt});},[]),d=useRef(null);d.current??=new ae(i.sound,r),useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),useEffect(()=>{let w=d.current;return w?.attach(),()=>w?.dispose()},[]);let p=useCallback(w=>d.current?.play(w),[]),c=useMemo(()=>Kt(i,r),[i,r]),f=useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[y,v]=useState(null);useEffect(()=>f.setLayer(y),[f,y]);let[C,T]=useState(null),D=useRef(C);D.current=C;let P=useCallback((w,V)=>{if(w.length===0){V?.onDone?.();return}f.reserve(w),T({lines:w,options:V});},[f]),W=useCallback(()=>{let w=D.current;w&&f.release(w.lines),T(null),w?.options?.onDone?.();},[f]),ke=useRef(null),L=o??(ke.current??=We());useEffect(()=>(L.setPlayer(p),()=>L.setPlayer(null)),[L,p]);let q=useMemo(()=>({toast:w=>L.toast(w),alert:w=>L.alert(w),dismiss:w=>L.dismiss(w)}),[L]),E=useCallback((w,V="info")=>{L.toast({message:w,level:V});},[L]),ie=useMemo(()=>({config:i,prefs:r,setPrefs:l,motion:c,play:p,layer:y,fx:f,celebrate:P,toast:E,notify:q,provided:true}),[i,r,l,c,p,y,f,P,E,q]),re=useRef(null);useEffect(()=>re.current?Ot(re.current):void 0,[]);let G=!c.on;return jsx(Ft.Provider,{value:ie,children:jsxs("div",{ref:re,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...qe(i,G)},children:[jsx("style",{children:Ye}),e,jsx("div",{ref:v,"data-idos-ui-layer":"",style:{position:"absolute",inset:0,zIndex:50,pointerEvents:"none",fontFamily:"var(--idos-ui-font)",overflow:"hidden"},children:n?.({celebration:C,finishCelebration:W,notifications:L})})]})})}function fe(t){let{fx:e}=b();return useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var Gt=typeof window<"u"?useLayoutEffect:useEffect;function Ze(){if(typeof navigator>"u")return "en";let t=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(e=>t.startsWith(e))?"ru":"en"}function _t(t,e,n=Ze()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function zn(t,e,n=Ze()){let[o,i=o,r=i]=e.split("|"),u=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?u==="one"?o:u==="few"?i:r:u==="one"?o:i}var Bn={close:"Close",back:"Back",confirm:"Confirm",cancel:"Cancel",youGot:"You got",great:"Great!",loading:"Loading\u2026",ok:"OK",loadingNamed:"Loading {name}\u2026",stillLoading:"Still loading \u2014 the first start can take a little longer",retry:"Retry",error:"Something went wrong",notEnough:"Not enough resources",offline:"No connection. Retrying\u2026",more:"More",menu:"Menu",nothingHere:"Nothing here yet",economy:"Economy",events:"Activities",social:"Social",profile:"Profile",other:"Other",free:"Free",claim:"Claim",claimAll:"Claim all",tokenEvent:"Event points",tokenSeason:"Season status",tokenQuest:"Quest points",tokenScore:"Rating points"},Kn={close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",back:"\u041D\u0430\u0437\u0430\u0434",confirm:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0430",youGot:"\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438",great:"\u041E\u0442\u043B\u0438\u0447\u043D\u043E!",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",ok:"\u041F\u043E\u043D\u044F\u0442\u043D\u043E",loadingNamed:"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \xAB{name}\xBB\u2026",stillLoading:"\u0415\u0449\u0451 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u2014 \u043F\u0435\u0440\u0432\u044B\u0439 \u0437\u0430\u043F\u0443\u0441\u043A \u0431\u044B\u0432\u0430\u0435\u0442 \u0434\u043E\u043B\u044C\u0448\u0435",retry:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",error:"\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A",notEnough:"\u041D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432",offline:"\u041D\u0435\u0442 \u0441\u0432\u044F\u0437\u0438. \u041F\u0440\u043E\u0431\u0443\u0435\u043C \u0441\u043D\u043E\u0432\u0430\u2026",more:"\u0415\u0449\u0451",menu:"\u041C\u0435\u043D\u044E",nothingHere:"\u041F\u043E\u043A\u0430 \u043F\u0443\u0441\u0442\u043E",economy:"\u042D\u043A\u043E\u043D\u043E\u043C\u0438\u043A\u0430",events:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F",social:"\u0414\u0440\u0443\u0437\u044C\u044F \u0438 \u043E\u0431\u0449\u0435\u043D\u0438\u0435",profile:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",other:"\u0420\u0430\u0437\u043D\u043E\u0435",free:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E",claim:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C",claimAll:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0451",tokenEvent:"\u041E\u0447\u043A\u0438 \u0438\u0432\u0435\u043D\u0442\u0430",tokenSeason:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0437\u043E\u043D\u0430",tokenQuest:"\u041E\u0447\u043A\u0438 \u0437\u0430\u0434\u0430\u043D\u0438\u0439",tokenScore:"\u041E\u0447\u043A\u0438 \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u0430"},k=_t(Bn,Kn);function Fn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?k("notEnough"):t.length>140?`${t.slice(0,140)}\u2026`:t:k("error")}function nt(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?e.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?e.push({kind:"item",id:n.ItemID,amount:o}):e.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of t?.EventTokens??[]){let o=n?.Address?.Type,i=(n?.Address?.EntityID??"").split(":")[0];if(!o||!i)continue;let r=Number(n?.Applied??n?.Amount??0);!Number.isFinite(r)||r<=0||e.push({kind:"token",id:`${o}:${i}`,amount:r});}return Wt(e)}function ot(t){let e=t.id.indexOf(":");return e<0?{system:t.id,entity:""}:{system:t.id.slice(0,e),entity:t.id.slice(e+1)}}function pe(t){switch(ot(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function it(t,e){let{system:n,entity:o}=ot(t);return n==="TimedEvent"?(e?me(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||k("tokenEvent"):n==="Season"?k("tokenSeason"):n==="Quest"?k("tokenQuest"):n==="Leaderboard"?k("tokenScore"):t.id}function Wt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function qt(t){return nt(t?.Standard)}function Gn(t){return nt(t?.Standard)}function _n(t){let e=t?.Resources?.Grant;return qt(e)}function Wn(t,e){return t.every(n=>n.kind!=="currency"||Number(e?.[n.id]?.Amount??0)>=n.amount)}function A(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${et(t/1e9)}B`:e>=1e6?`${et(t/1e6)}M`:e>=1e5?`${et(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function et(t){return t.toFixed(2).replace(/\.?0+$/,"")}function rt(t,e){if(!t)return null;let n=new Date(t).getTime()-e;if(!Number.isFinite(n)||n<=0)return null;let o=Math.floor(n/1e3),i=Math.floor(o/3600),r=Math.floor(o%3600/60),u=o%60;return i>=24?`${Math.floor(i/24)}d ${i%24}h`:i>0?`${i}h ${String(r).padStart(2,"0")}m`:`${r}m ${String(u).padStart(2,"0")}s`}var Vt=640,Ht=1024;function ge(t){return t>=Ht?"desktop":t>=Vt?"tablet":"phone"}function me(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function st(t){let e=new Map;for(let n of Object.values(t?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&e.set(i.ItemID??o,i);return e}var tt=["Legendary","Epic","Rare","Uncommon","Common"];function qn(t){let e=tt.indexOf(t??"");return e<0?tt.length:e}function at(t,e){let n=new Map;for(let o of t){let i=e(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}var Yt=["coin","gem","potion","scroll","sword","shield","crown","gift","bag","box","trophy","calendar","star","check","lock","shop","chest","quest","user","logout","copy","hero","hammer","market","flame","ticket","friends","chat","link","swords","gear","globe","sound","mute","bell","bulb","menu","close","back","plus","energy","heart","offer","clock","trash","edit"];function jt(t){return Yt.includes(t)}function lt(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function ut(t,e){let n={potion:"potion",scroll:"scroll",weapon:"sword",sword:"sword",armor:"shield",shield:"shield",helmet:"hero",crown:"crown",chest:"chest",lootbox:"chest",gift:"gift",ticket:"ticket"};for(let o of [...t??[],e??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var Vn=/^(https?:|\/|data:)/;function N({glyph:t,size:e=24,color:n}){return jt(t)?jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:Hn(t,n)}):Vn.test(t)?jsx("img",{src:t,alt:"",width:e,height:e,style:{flex:"none",display:"block",objectFit:"contain"}}):jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:e,height:e,fontSize:e*.8,lineHeight:1},children:t})}function Hn(t,e){switch(t){case "coin":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"17",r:"12",fill:"#c77a0c"}),jsx("circle",{cx:"16",cy:"15",r:"12",fill:e??"#ffcf3a"}),jsx("circle",{cx:"16",cy:"15",r:"8.5",fill:"none",stroke:"#e89a12",strokeWidth:"2"}),jsx("path",{d:"M16 9.5v11M13 12.5h4.5a2 2 0 010 4H13",stroke:"#b86d06",strokeWidth:"2.2",fill:"none",strokeLinecap:"round"})]});case "gem":return jsxs(Fragment,{children:[jsx("path",{d:"M9 5h14l6 8-13 15L3 13z",fill:e??"#5ce1ff"}),jsx("path",{d:"M9 5l3 8h8l3-8M3 13h26M12 13l4 15 4-15",fill:"none",stroke:"#1f8fc7",strokeWidth:"1.6",strokeLinejoin:"round"}),jsx("path",{d:"M11 7l2 5",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",opacity:".8"})]});case "potion":return jsxs(Fragment,{children:[jsx("rect",{x:"12.5",y:"3",width:"7",height:"6",rx:"1.5",fill:"#c9a36a"}),jsx("path",{d:"M13 9h6v4l6 8a7 7 0 01-6 9h-6a7 7 0 01-6-9l6-8z",fill:e??"#ff5a7a"}),jsx("path",{d:"M9 21h14",stroke:"#fff",strokeWidth:"1.5",opacity:".45"}),jsx("circle",{cx:"13",cy:"22",r:"1.6",fill:"#fff",opacity:".7"})]});case "scroll":return jsxs(Fragment,{children:[jsx("rect",{x:"6",y:"7",width:"20",height:"18",rx:"2",fill:e??"#f3dca2"}),jsx("rect",{x:"4",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsx("rect",{x:"24",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsx("path",{d:"M11 12h10M11 16h10M11 20h7",stroke:"#9c7338",strokeWidth:"1.8",strokeLinecap:"round"})]});case "sword":return jsxs(Fragment,{children:[jsx("path",{d:"M22 3l7 0 0 7L14 25l-4-3z",fill:e??"#d7e3f4"}),jsx("path",{d:"M24 5L12 21",stroke:"#fff",strokeWidth:"1.4",opacity:".7"}),jsx("path",{d:"M6 19l7 7",stroke:"#8a5a26",strokeWidth:"3.4",strokeLinecap:"round"}),jsx("path",{d:"M4 27l3 -3",stroke:"#e0b44a",strokeWidth:"4",strokeLinecap:"round"})]});case "shield":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3l11 4v8c0 7-5 12-11 14C10 27 5 22 5 15V7z",fill:e??"#b57a3c"}),jsx("path",{d:"M16 6l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V9z",fill:"#d89b54"}),jsx("path",{d:"M16 6v20M8 14h16",stroke:"#8a5424",strokeWidth:"1.8"})]});case "crown":return jsxs(Fragment,{children:[jsx("path",{d:"M4 11l6 5 6-9 6 9 6-5-3 14H7z",fill:e??"#ffcf3a"}),jsx("rect",{x:"7",y:"24",width:"18",height:"4",rx:"1.5",fill:"#e89a12"}),jsx("circle",{cx:"16",cy:"18",r:"2",fill:"#ff5a7a"}),jsx("circle",{cx:"10",cy:"20",r:"1.4",fill:"#5ce1ff"}),jsx("circle",{cx:"22",cy:"20",r:"1.4",fill:"#5ce1ff"})]});case "gift":return jsxs(Fragment,{children:[jsx("rect",{x:"5",y:"13",width:"22",height:"15",rx:"2",fill:e??"#ff6b8b"}),jsx("rect",{x:"3",y:"9",width:"26",height:"6",rx:"2",fill:"#ff8aa3"}),jsx("rect",{x:"14",y:"9",width:"4",height:"19",fill:"#ffd24a"}),jsx("path",{d:"M16 9c-2-5-8-5-7-1 1 2 5 1 7 1zm0 0c2-5 8-5 7-1-1 2-5 1-7 1z",fill:"#ffd24a"})]});case "bag":return jsxs(Fragment,{children:[jsx("path",{d:"M11 9h10l5 5v11a4 4 0 01-4 4H10a4 4 0 01-4-4V14z",fill:e??"#c98a3c"}),jsx("path",{d:"M11 9l2-5h6l2 5",fill:"#a86c26"}),jsx("circle",{cx:"16",cy:"19",r:"4.5",fill:"#ffcf3a"}),jsx("path",{d:"M16 16.5v5",stroke:"#b86d06",strokeWidth:"1.8",strokeLinecap:"round"})]});case "trophy":return jsxs(Fragment,{children:[jsx("path",{d:"M9 4h14v7a7 7 0 01-14 0z",fill:e??"#ffcf3a"}),jsx("path",{d:"M9 7H4c0 5 3 7 6 7M23 7h5c0 5-3 7-6 7",fill:"none",stroke:"#e89a12",strokeWidth:"2.2"}),jsx("rect",{x:"14",y:"17",width:"4",height:"6",fill:"#e89a12"}),jsx("rect",{x:"9",y:"23",width:"14",height:"5",rx:"1.5",fill:"#b86d06"})]});case "calendar":return jsxs(Fragment,{children:[jsx("rect",{x:"4",y:"6",width:"24",height:"22",rx:"3",fill:"#fff"}),jsx("rect",{x:"4",y:"6",width:"24",height:"7",rx:"3",fill:e??"#ff5a5a"}),jsx("path",{d:"M10 3v6M22 3v6",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"}),jsx("path",{d:"M10 18h3M15 18h3M20 18h3M10 23h3M15 23h3",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"})]});case "star":return jsx("path",{d:"M16 3l3.9 8 8.6 1.2-6.3 6 1.6 8.6L16 22.7 8.2 26.8l1.6-8.6-6.3-6 8.6-1.2z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "check":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"13",fill:e??"#59d35b"}),jsx("path",{d:"M9.5 16.5l4.5 4.5 8.5-9",fill:"none",stroke:"#fff",strokeWidth:"3.4",strokeLinecap:"round",strokeLinejoin:"round"})]});case "lock":return jsxs(Fragment,{children:[jsx("path",{d:"M10 14v-4a6 6 0 0112 0v4",fill:"none",stroke:"#8e95b8",strokeWidth:"3"}),jsx("rect",{x:"7",y:"14",width:"18",height:"14",rx:"3",fill:e??"#c3c8e3"}),jsx("circle",{cx:"16",cy:"21",r:"2.2",fill:"#5b6187"})]});case "shop":return jsxs(Fragment,{children:[jsx("path",{d:"M4 12l3-7h18l3 7z",fill:e??"#ff5a5a"}),jsx("path",{d:"M4 12h24v2a3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0z",fill:"#fff"}),jsx("rect",{x:"6",y:"16",width:"20",height:"12",rx:"1.5",fill:"#ffd9a8"}),jsx("rect",{x:"13",y:"20",width:"6",height:"8",fill:"#c98a3c"})]});case "chest":return jsxs(Fragment,{children:[jsx("path",{d:"M5 13a11 7 0 0122 0v2H5z",fill:e??"#b57a3c"}),jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"2",fill:"#d89b54"}),jsx("rect",{x:"5",y:"15",width:"22",height:"3",fill:"#8a5424"}),jsx("rect",{x:"14",y:"14",width:"4",height:"7",rx:"1",fill:"#ffd24a"})]});case "quest":return jsxs(Fragment,{children:[jsx("rect",{x:"6",y:"4",width:"20",height:"24",rx:"3",fill:"#f3dca2"}),jsx("path",{d:"M11 11l2 2 4-4M11 18l2 2 4-4",fill:"none",stroke:e??"#2b9936",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M19 12h3M19 19h3",stroke:"#9c7338",strokeWidth:"2",strokeLinecap:"round"})]});case "user":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"14",fill:e??"#4fb1ff"}),jsx("circle",{cx:"16",cy:"12.5",r:"5.2",fill:"#fff"}),jsx("path",{d:"M6.5 25.5a10 7 0 0119 0A13.6 13.6 0 0116 30a13.6 13.6 0 01-9.5-4.5z",fill:"#fff"})]});case "logout":return jsxs(Fragment,{children:[jsx("path",{d:"M18 5H9a3 3 0 00-3 3v16a3 3 0 003 3h9",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})]});case "copy":return jsxs(Fragment,{children:[jsx("rect",{x:"10",y:"10",width:"16",height:"18",rx:"3",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6"}),jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "hero":return jsxs(Fragment,{children:[jsx("path",{d:"M6 15a10 10 0 0120 0v5H6z",fill:e??"#b8c4d9"}),jsx("path",{d:"M6 15a10 10 0 0120 0",fill:"none",stroke:"#6f7c99",strokeWidth:"1.6"}),jsx("rect",{x:"9",y:"16",width:"14",height:"3",rx:"1",fill:"#2a3150"}),jsx("path",{d:"M16 3v5",stroke:"#ff5a5a",strokeWidth:"3",strokeLinecap:"round"}),jsx("path",{d:"M8 20h16l-2 8H10z",fill:"#8a96b3"})]});case "hammer":return jsxs(Fragment,{children:[jsx("path",{d:"M14 13l12 12-3 3-12-12z",fill:"#a8743d"}),jsx("path",{d:"M5 9l7-6 8 8-7 6z",fill:e??"#c3c8e3"}),jsx("path",{d:"M5 9l7-6 2 2-7 6z",fill:"#e6e9f7"})]});case "market":return jsxs(Fragment,{children:[jsx("path",{d:"M3 11l3-7h20l3 7z",fill:e??"#4fb1ff"}),jsx("path",{d:"M3 11h26v2a3 3 0 01-6.5 0 3 3 0 01-6.5 0 3 3 0 01-6.5 0A3 3 0 013 13z",fill:"#fff"}),jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"1.5",fill:"#d8e7ff"}),jsx("circle",{cx:"16",cy:"21.5",r:"4",fill:"#ffcf3a"}),jsx("path",{d:"M16 19.5v4",stroke:"#b86d06",strokeWidth:"1.6",strokeLinecap:"round"})]});case "flame":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3c1 5 8 8 8 16a8 8 0 01-16 0c0-4 2-6 3-8 1 3 3 4 3 4 0-5 1-8 2-12z",fill:e??"#ff7a2e"}),jsx("path",{d:"M16 15c1 3 4 4 4 8a4 4 0 01-8 0c0-2 1-3 2-4 .5 1 1.5 1.5 1.5 1.5 0-2 .2-3.5.5-5.5z",fill:"#ffd24a"})]});case "ticket":return jsxs(Fragment,{children:[jsx("path",{d:"M4 9h24v4a3 3 0 000 6v4H4v-4a3 3 0 000-6z",fill:e??"#b879ff"}),jsx("path",{d:"M20 9v14",stroke:"#fff",strokeWidth:"1.6",strokeDasharray:"2 2"}),jsx("path",{d:"M11 13l1.2 2.4 2.6.4-1.9 1.8.5 2.6-2.4-1.3-2.3 1.3.4-2.6-1.9-1.8 2.6-.4z",fill:"#ffd24a"})]});case "friends":return jsxs(Fragment,{children:[jsx("circle",{cx:"11",cy:"11",r:"4.5",fill:e??"#4fb1ff"}),jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:e??"#4fb1ff"}),jsx("circle",{cx:"21.5",cy:"12",r:"4",fill:"#59d35b"}),jsx("path",{d:"M15 26a7 6.5 0 0114 0z",fill:"#59d35b"})]});case "chat":return jsxs(Fragment,{children:[jsx("path",{d:"M4 7a3 3 0 013-3h18a3 3 0 013 3v12a3 3 0 01-3 3H13l-6 5v-5H7a3 3 0 01-3-3z",fill:e??"#4fb1ff"}),jsx("circle",{cx:"11",cy:"13",r:"1.8",fill:"#fff"}),jsx("circle",{cx:"16",cy:"13",r:"1.8",fill:"#fff"}),jsx("circle",{cx:"21",cy:"13",r:"1.8",fill:"#fff"})]});case "link":return jsxs(Fragment,{children:[jsx("path",{d:"M13 19l6-6",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"}),jsx("path",{d:"M14 9l2-2a5 5 0 017 7l-2 2M18 23l-2 2a5 5 0 01-7-7l2-2",fill:"none",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxs(Fragment,{children:[jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:e??"#d7e3f4"}),jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:e??"#d7e3f4"}),jsx("path",{d:"M8 22l4 4M24 22l-4 4",stroke:"#8a5a26",strokeWidth:"3.2",strokeLinecap:"round"}),jsx("path",{d:"M6 20l6 6M26 20l-6 6",stroke:"#e0b44a",strokeWidth:"2",strokeLinecap:"round"})]});case "gear":return jsxs(Fragment,{children:[jsx("path",{d:"M14 3h4l.7 3.3 2.6 1.1 2.8-1.9 2.8 2.8-1.9 2.8 1.1 2.6L29 14v4l-3.3.7-1.1 2.6 1.9 2.8-2.8 2.8-2.8-1.9-2.6 1.1L18 29h-4l-.7-3.3-2.6-1.1-2.8 1.9-2.8-2.8 1.9-2.8-1.1-2.6L3 18v-4l3.3-.7 1.1-2.6-1.9-2.8 2.8-2.8 2.8 1.9 2.6-1.1z",fill:e??"#aeb6f0"}),jsx("circle",{cx:"16",cy:"16",r:"4.5",fill:"#2c3480"})]});case "globe":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"#4fb1ff"}),jsx("path",{d:"M4 16h24M16 4c-4 4-4 20 0 24M16 4c4 4 4 20 0 24",fill:"none",stroke:"#fff",strokeWidth:"1.6"})]});case "sound":return jsxs(Fragment,{children:[jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:e??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxs(Fragment,{children:[jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "bell":return jsxs(Fragment,{children:[jsx("path",{d:"M16 4a8 8 0 018 8v6l3 4H5l3-4v-6a8 8 0 018-8z",fill:e??"#ffd24a"}),jsx("circle",{cx:"16",cy:"26",r:"3",fill:"#e89a12"})]});case "bulb":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3a9 9 0 015 16.5V23h-10v-3.5A9 9 0 0116 3z",fill:e??"#ffe066"}),jsx("rect",{x:"11",y:"24",width:"10",height:"3",rx:"1",fill:"#aeb6f0"}),jsx("rect",{x:"12.5",y:"27.5",width:"7",height:"2.5",rx:"1",fill:"#8e95b8"})]});case "menu":return jsx("path",{d:"M6 9h20M6 16h20M6 23h20",stroke:e??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsx("path",{d:"M16 7v18M7 16h18",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "heart":return jsx("path",{d:"M16 27S4 20 4 11.5A6.5 6.5 0 0116 8a6.5 6.5 0 0112 3.5C28 20 16 27 16 27z",fill:e??"#ff5a7a"});case "offer":return jsxs(Fragment,{children:[jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:e??"#ff5a5a"}),jsx("circle",{cx:"21",cy:"9",r:"2.2",fill:"#fff"}),jsx("path",{d:"M11 17l6-6",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round"})]});case "clock":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"currentColor"}),jsx("path",{d:"M16 9v7l5 3",fill:"none",stroke:"#2c3480",strokeWidth:"2.6",strokeLinecap:"round"})]});case "trash":return jsxs(Fragment,{children:[jsx("path",{d:"M8 10h16l-1.5 17h-13z",fill:e??"#ff5a5a"}),jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:e??"#ff5a5a"}),jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:e??"#ff5a5a"})]});case "edit":return jsxs(Fragment,{children:[jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:e??"#ffd24a"}),jsx("path",{d:"M20 8l2-2a2.8 2.8 0 014 4l-2 2",fill:"#e89a12"})]});default:return jsxs(Fragment,{children:[jsx("path",{d:"M16 3l12 6v14l-12 6-12-6V9z",fill:e??"#9aa6ff"}),jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function jn(t){let[e,n]=useState("phone");return Gt(()=>{let o=t.current;if(!o)return;let i=()=>n(ge(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[t]),e}function Le(){let{layer:t}=b(),e=useRef(null);e.current=t;let[n,o]=useState(()=>t?ge(t.getBoundingClientRect().width):"phone");return useEffect(()=>{if(!t)return;let i=()=>o(ge(t.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(t),()=>r.disconnect()},[t]),n}function Pe(t,e){let[n,o]=useState(t),[i,r]=useState(false);return useEffect(()=>{if(t){o(true),r(false);return}if(!n)return;if(e<=0){o(false);return}r(true);let u=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(u)},[t,e,n]),{mounted:n,closing:i}}function Xt(t,e=600,n){let[o,i]=useState(t),r=useRef(t),u=useRef(n);return u.current=n,useEffect(()=>{let l=r.current;if(l===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let y=Math.min(1,(f-d)/e),v=1-Math.pow(1-y,3),C=Math.round(l+(t-l)*v);C!==r.current&&u.current?.(),r.current=C,i(C),y<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function ct(t,e){let n=b(),o=fe(u=>u.holding(t)>0),i=useRef(e);o||(i.current=e);let r=o?i.current:e;return Xt(r,n.motion.on?650:0,()=>n.play("countTick"))}function O(){let t=c(),e=b(),[,n]=useReducer(l=>l+1,0);useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=useMemo(()=>t&&o?st(me(t,"Item")):new Map,[t,o]),r=useMemo(()=>t&&o?me(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),u=useCallback(l=>l?t?.localization.has(l)?t.localization.t(l):l:"",[t]);return useMemo(()=>({items:i,currencies:r,localize:u,currencyName:l=>u(r[l]?.DisplayName||l),itemName:l=>u(i.get(l)?.DisplayName||l),iconOf:l=>{if(l.kind==="currency")return r[l.id]?.ImagePath||lt(l.id);if(l.kind==="item"){let d=i.get(l.id);return d?.ImagePath||ut(d?.Tags,d?.ItemClass)}return "box"},rarityColor:l=>e.config.theme.rarity[l??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,u,e.config.theme.rarity])}function ft(){let t=c(),e=O(),[,n]=useReducer(r=>r+1,0);useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(e.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,u])=>[r,Number(u?.Amount??0)]).sort(([r],[u])=>r.localeCompare(u))}function Qn(t=1e3){let[e,n]=useState(()=>Date.now());return useEffect(()=>{let o=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(o)},[t]),e}var Te={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ee={green:{color:a.onGreen,textShadow:a.onGreenOutline},gold:{color:a.onGold,textShadow:a.onGoldOutline},blue:{color:a.onBlue,textShadow:a.onBlueOutline},red:{color:a.onRed,textShadow:a.onRedOutline},grey:{color:"#ffffff",textShadow:we}};function Ee(t){let[e,n]=Te[t],o=ee[t];return {background:`linear-gradient(180deg, ${e} 0%, ${n} 100%)`,color:o.color,"--idos-ui-text":o.color,"--idos-ui-text-dim":`color-mix(in srgb, ${o.color} 80%, transparent)`,"--idos-ui-text-outline":o.textShadow}}function Jt(t,e=false,n="md"){let[o,i]=Te[e?"grey":t],r=ee[e?"grey":t],u=n==="sm"?"6px 12px":n==="lg"?"12px 22px":"10px 18px";return {...x,...r,fontFamily:a.font,fontSize:n==="sm"?13:n==="lg"?18:16,border:"none",borderRadius:a.buttonRadius,padding:u,minHeight:n==="sm"?34:44,cursor:e?"default":"pointer",background:`linear-gradient(180deg, ${o} 0%, ${i} 100%)`,boxShadow:`0 4px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.35)`,opacity:e?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function z({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:u=false,style:l,className:d="",sound:p="click",title:c,...f}){let{play:y}=b();return jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${u&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&y(p),e?.(v);},style:{...Jt(n,i,o),...l},children:r?jsx(Zt,{size:18}):t})}function he({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:u}){let{play:l}=b();return jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{l("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Te[i][0]}, ${Te[i][1]})`:a.well,color:i?ee[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsx(N,{glyph:t,size:o*.55}),u?jsx(ye,{count:u}):null]})}function Zt({size:t=28}){return jsx("span",{"aria-label":k("loading"),style:{width:t,height:t,borderRadius:"50%",border:`${Math.max(2,t/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function ye({count:t,dot:e=false,style:n}){return !t||t<=0?null:jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:e?12:20,height:e?12:20,padding:e?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ee.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function en({line:t,size:e=20,big:n=false,dim:o=false}){let i=O(),r=c();return jsxs("span",{title:Ue(t,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsx(N,{glyph:t.kind==="token"?pe(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:A(t.amount)]})}function Ue(t,e,n){return t.kind==="currency"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(it(t,n)):t.id}function Xn({lines:t,size:e=18,gap:n=8,dimIf:o}){return jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:t.map(i=>jsx(en,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function pt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=O(),r=ct(t,e);return jsxs("div",{"data-resource-counter":t,title:i.currencyName(t),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...He,cursor:o?"pointer":"default"},children:[jsx(N,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:A(r)})]})}function Jn({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:u=false}){let l=O(),{play:d}=b(),p=l.items.get(t),c=l.rarityColor(p?.Metadata?.RarityID);return jsxs("button",{type:"button",className:"idos-press",title:l.itemName(t),onClick:o?()=>{d("click"),o();}:void 0,style:{position:"relative",width:i,height:i,borderRadius:16,border:`3px solid ${r?a.text:c}`,background:`radial-gradient(circle at 50% 35%, ${c}55 0%, ${a.panelDeep} 70%)`,boxShadow:r?`0 0 0 3px ${a.gold}, 0 4px 0 ${a.shadow}`:`0 4px 0 ${a.shadow}, inset 0 0 12px ${c}44`,display:"grid",placeItems:"center",cursor:o?"pointer":"default",padding:0,opacity:u?.45:1,flex:"none"},children:[jsx(N,{glyph:l.iconOf({kind:"item",id:t,amount:1}),size:i*.56}),e!==void 0&&e>1?jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",A(e)]}):null,n!==void 0&&n>0?jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function Zn({value:t,max:e,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,t/Math.max(1,e)*100)),[u,l]=n==="gold"?[a.gold,a.goldDeep]:n==="blue"?[a.blue,a.blueDeep]:[a.green,a.greenDeep];return jsxs("div",{style:{position:"relative",height:i,borderRadius:i/2,background:a.wellSoft,boxShadow:a.wellShadow,overflow:"hidden"},children:[jsx("div",{style:{width:`${r}%`,height:"100%",background:`linear-gradient(180deg, ${u}, ${l})`,borderRadius:i/2,transition:`width ${a.slow} ${Y}`}}),jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${A(t)} / ${A(e)}`})]})}function gt({children:t,right:e}){return jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,margin:"4px 4px 10px"},children:[jsx("div",{style:{...x,fontSize:19,fontFamily:a.font},children:t}),e]})}function eo({glyph:t,text:e,action:n}){return jsxs("div",{style:{...U,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsx(N,{glyph:t,size:56}),jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function to({children:t,minHeight:e=240}){return jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function no({at:t,now:e,label:n}){let o=rt(t,e);return o?jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function oo({tabs:t,value:e,onChange:n,style:o}){let{play:i}=b();return t.length<2?null:jsx("div",{className:"idos-scroll",role:"tablist",style:{display:"flex",gap:6,padding:4,borderRadius:16,background:a.wellSoft,overflowX:"auto",...o},children:t.map(r=>{let u=r.id===e;return jsxs("button",{role:"tab","aria-selected":u,type:"button",className:"idos-press",onClick:()=>{u||(i("tab"),n(r.id));},style:{position:"relative",flex:"1 0 auto",border:"none",borderRadius:12,padding:"8px 14px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,whiteSpace:"nowrap",background:u?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:u?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsx(N,{glyph:r.glyph,size:20}):null,jsx("span",{style:{...x,...u?ee.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsx(ye,{count:r.badge}):null]},r.id)})})}function mt(){let{motion:t}=b();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function io({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=b();return jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...U,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:U.border,...e},children:t})}var vt=createContext(()=>{});function te(){return useContext(vt)}function xt({children:t}){let{layer:e}=b();return e?createPortal(t,e):jsx(Fragment,{children:t})}var Ie=[],ht=new Set,yt=0,bt=()=>{for(let t of [...ht])t();};function lo(t){let[e]=useState(()=>Symbol("auto-popup")),[,n]=useState(0),o=useRef(false);return useEffect(()=>{if(!t){o.current=false;return}Ie.push(e);let i=()=>n(r=>r+1);return ht.add(i),i(),()=>{let r=Ie.indexOf(e);r>=0&&Ie.splice(r,1),ht.delete(i),bt();}},[t,e]),t?(!o.current&&Ie[0]===e&&yt===0&&(o.current=true),o.current):true}function uo(t){useEffect(()=>{if(t)return yt+=1,bt(),()=>{yt-=1,bt();}},[t]);}function ne({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:u=true,sound:l=true,panelStyle:d,queued:p=false}){let c=b(),f=Le(),y=c.motion.durations.normal,[v,C]=useState(false),T=lo(p&&n);uo(!p&&n);let{mounted:D,closing:P}=Pe(n&&T&&!v,y),W=useRef(e);W.current=e;let ke=useRef(false);useEffect(()=>{!l||!n||!T||ke.current||(ke.current=true,c.play("open"));},[l,n,T,c]);let L=useCallback(()=>{v||(c.play("close"),C(true));},[v,c]);useEffect(()=>{v&&!D&&W.current?.();},[v,D]);let q=u&&e!==void 0;if(useEffect(()=>{if(!q||!D)return;let G=w=>{w.key==="Escape"&&L();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[q,D,L]),!D)return null;let E=r==="sheet"||r==="auto"&&f==="phone",ie=P,re=E?ie?`idos-sheet-out ${a.normal} ${ue} both`:`idos-sheet-in ${a.slow} ${Y} both`:ie?`idos-pop-out ${a.normal} ${ue} both`:`idos-pop-in ${a.slow} ${le} both`;return jsx(xt,{children:jsx(vt.Provider,{value:L,children:jsx("div",{role:"dialog","aria-modal":"true",onClick:q?L:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:E?"end stretch":"center",padding:E?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${ie?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...U,width:E?"100%":`min(${i}px, 100%)`,maxHeight:E?"88%":"min(86vh, 100%)",overflowY:"auto",padding:E?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:E?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:re,...d},children:[E?jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:8,left:"50%",width:44,height:5,marginLeft:-22,borderRadius:3,background:a.line}}):null,o?jsx("div",{style:{...x,fontSize:21,textAlign:"center",fontFamily:a.font,padding:"0 30px"},children:o}):null,e?jsx(he,{glyph:"close",label:k("close"),onClick:L,size:36,tone:"red",style:{position:"absolute",top:E?12:8,right:E?12:8,border:"3px solid #fff"}}):null,t]})})})})}function co({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxs(ne,{title:t,onClose:r,width:380,children:[e,jsx(fo,{confirmLabel:n,tone:o,onConfirm:i})]})}function fo({confirmLabel:t,tone:e,onConfirm:n}){let o=te(),[i,r]=useState(false);return jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsx(z,{tone:"grey",onClick:o,children:k("cancel")}),jsx(z,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(u=>{r(false),u!==true&&o();});},children:t??k("confirm")})]})}function po({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:u=true}){let l=b(),[d,p]=useState(false),{mounted:c,closing:f}=Pe(i&&!d,l.motion.durations.normal),y=useRef(n);y.current=n,useEffect(()=>{l.play("open");},[]),useEffect(()=>{d&&!c&&y.current();},[d,c]);let v=useCallback(()=>{l.play("close"),p(true);},[l]);return useEffect(()=>{if(!c)return;let C=T=>{T.key==="Escape"&&v();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,v]),c?jsx(xt,{children:jsx(vt.Provider,{value:v,children:jsxs("div",{style:{position:l.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:Ve,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ue:Y} both`},children:[jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"12px 14px",borderBottom:`2px solid ${a.panelEdge}`,background:a.wellSoft},children:[r?jsx(he,{glyph:"back",label:k("back"),onClick:v,size:38}):null,e?jsx(N,{glyph:e,size:30}):null,jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),u?jsx(go,{}):null,r?null:jsx(he,{glyph:"close",label:k("close"),onClick:v,size:38,tone:"red"})]}),jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function go(){let t=ft(),e=Le(),n=e==="phone"?t.slice(0,2):t;return jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsx(pt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var Ae={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},kt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function ho({level:t,size:e}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:t==="success"?jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):t==="error"?jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):t==="warning"?jsxs(Fragment,{children:[jsx("path",{d:"M12 6v8",...n}),jsx("circle",{cx:"12",cy:"18.2",r:"1.6",fill:"currentColor"})]}):t==="reward"?jsxs(Fragment,{children:[jsx("rect",{x:"4",y:"10",width:"16",height:"10",rx:"1.5",...n}),jsx("path",{d:"M3 10h18M12 10v10M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z",...n,strokeWidth:2.2})]}):jsxs(Fragment,{children:[jsx("circle",{cx:"12",cy:"6.5",r:"1.6",fill:"currentColor"}),jsx("path",{d:"M12 11v7",...n})]})})}function rn({level:t,icon:e,size:n}){return jsx("span",{style:{...Ee(Ae[t]),width:n,height:n,flex:"none",borderRadius:"50%",display:"grid",placeItems:"center",boxShadow:`0 2px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`},children:e?jsx(N,{glyph:e,size:n*.62}):jsx(ho,{level:t,size:n*.56})})}function sn({source:t}){return jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:11,fontWeight:800,letterSpacing:.3,textTransform:"uppercase",color:a.textDim,minWidth:0},children:[t.icon?jsx(N,{glyph:t.icon,size:14}):null,jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function yo(t){return useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function an({store:t}){yo(t);let e=t.currentAlert;return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",top:"calc(env(safe-area-inset-top, 0px) + 10px)",left:"50%",transform:"translateX(-50%)",width:"min(440px, calc(100% - 20px))",display:"flex",flexDirection:"column",gap:8,zIndex:45,pointerEvents:"none"},children:t.toasts.map(n=>jsx(bo,{store:t,toast:n},n.id))}),e?jsx(xo,{store:t,alert:e,queued:t.queued},e.id):null]})}function bo({store:t,toast:e}){let n=b(),o=e.input,i=Ae[e.level],r=o.duration??_e[e.level],u=t.source(o.source),l=o.actions?.[0],[d,p]=useState(false),[c,f]=useState(false),y=n.motion.durations.normal,v=useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),y));};let C=useRef(r);useEffect(()=>{C.current=r;},[r,e.revision]),useEffect(()=>{if(r<=0||c||d)return;let P=Date.now(),W=setTimeout(()=>v.current(),C.current);return ()=>{clearTimeout(W),C.current-=Date.now()-P;}},[r,c,d,e.revision]);let T=u?.open,D=P=>{P.onPress?.(),P.openFeature&&t.source(P.openFeature)?.open?.(),v.current();};return jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:T?()=>{T(),v.current();}:void 0,className:T?"idos-press":void 0,style:{...U,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:T?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${kt[i]}`,animation:`${d?"idos-drop-out":"idos-drop-in"} ${a.normal} ease both`},children:[o.image?jsx("img",{src:o.image,alt:"",style:{width:42,height:42,flex:"none",objectFit:"cover",borderRadius:10,border:`2px solid ${kt[i]}`}}):jsx(rn,{level:e.level,icon:o.icon,size:34}),jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[u?jsx(sn,{source:u}):null,o.title?jsx("div",{style:{...x,fontSize:15,lineHeight:1.25},children:o.title}):null,o.message?jsx("div",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.35,color:o.title?a.textDim:a.text,overflowWrap:"anywhere"},children:o.message}):null,l?jsx("div",{style:{marginTop:6},onClick:P=>P.stopPropagation(),children:jsx(z,{size:"sm",tone:i,onClick:()=>D(l),children:l.label})}):null]}),e.count>1?jsxs("span",{style:{...Ee(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",e.count]}):null,jsx("button",{type:"button","aria-label":k("close"),onClick:P=>{P.stopPropagation(),v.current();},style:vo,children:jsx(N,{glyph:"close",size:14})}),r>0?jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:kt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var vo={flex:"none",width:26,height:26,display:"grid",placeItems:"center",border:"none",borderRadius:"50%",background:a.wellSoft,color:a.textDim,cursor:"pointer",padding:0};function xo({store:t,alert:e,queued:n}){let o=useRef(null);return useEffect(()=>t.play(e.level),[t,e.level]),jsx(ne,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsx(ko,{store:t,alert:e,queued:n,chosen:o})})}function ko({store:t,alert:e,queued:n,chosen:o}){let i=te(),r=e.input,u=Ae[e.level],l=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:k("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&t.source(f.openFeature)?.open?.(),i();};return jsxs("div",{role:"alertdialog","aria-label":r.title??r.message??"",style:{display:"grid",gap:12,justifyItems:"center",textAlign:"center"},children:[n>0?jsxs("span",{style:{justifySelf:"start",fontSize:12,fontWeight:800,color:a.textDim},children:["+",n]}):null,r.image?jsx("img",{src:r.image,alt:"",style:{maxWidth:"100%",maxHeight:180,objectFit:"contain",borderRadius:14}}):jsx("div",{className:e.level==="reward"?"idos-bounce":void 0,children:jsx(rn,{level:e.level,icon:r.icon,size:64})}),l?jsx(sn,{source:l}):null,r.title?jsx("div",{style:{...x,fontSize:21,fontFamily:a.font,lineHeight:1.2},children:r.title}):null,r.message?jsx("div",{style:{fontSize:15,fontWeight:600,lineHeight:1.45,color:r.title?a.textDim:a.text,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:r.message}):null,jsx("div",{style:{display:"grid",gap:8,width:"100%",marginTop:4},children:d.map((f,y)=>f.primary||!p&&y===0?jsx(z,{tone:u,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:wo,children:f.label},f.id??f.label))})]})}var wo={width:"100%",minHeight:44,borderRadius:a.buttonRadius,border:`1px solid ${a.line}`,background:a.wellSoft,color:a.text,fontFamily:a.font,fontSize:15,fontWeight:800,cursor:"pointer"};function Ro(t){return jsx(Co,{state:t})}function Co({state:t}){return jsxs(Fragment,{children:[jsx(Lo,{}),jsx(To,{}),jsx(Uo,{}),t.celebration?jsx(Mo,{lines:t.celebration.lines,title:t.celebration.options?.title,sound:t.celebration.options?.sound,onDone:t.finishCelebration},t.celebration.lines.map(e=>e.id).join()):null,jsx(an,{store:t.notifications})]})}var Oe=560;function Mo({lines:t,title:e,sound:n="reward",onDone:o}){let i=b(),r=O(),u=c(),l=useRef(new Map),d=useRef(false);useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(t,c=>l.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxs(ne,{title:e??k("youGot"),onClose:()=>{p(),o();},sound:false,variant:"center",width:420,children:[jsxs("div",{style:{position:"relative",overflow:"hidden",display:"flex",flexWrap:"wrap",gap:14,justifyContent:"center",padding:"22px 0"},children:[jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none",maskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)"},children:jsx("div",{style:{position:"absolute",width:Oe,height:Oe,left:`calc(50% - ${Oe/2}px)`,top:`calc(50% - ${Oe/2}px)`,background:`repeating-conic-gradient(color-mix(in srgb, ${a.gold} 16%, transparent) 0 12deg, transparent 12deg 24deg)`,animation:i.motion.on?"idos-rays 14s linear infinite":"none",borderRadius:"50%"}})}),t.map((c,f)=>jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${le} ${i.motion.on?.12*f:0}s both`},children:[jsx("div",{ref:y=>{y&&l.current.set(`${c.kind}:${c.id}`,y);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsx(N,{glyph:c.kind==="token"?pe(c):r.iconOf(c),size:46})}),jsxs("div",{style:{...x,fontSize:16},children:["+",A(c.amount)]}),jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ue(c,r,u)})]},`${c.kind}:${c.id}`))]}),jsx(No,{onPress:p})]})}function No({onPress:t}){let e=te();return jsx(z,{attract:true,onClick:()=>{t(),e();},children:k("great")})}function Lo(){let t=fe(e=>e.flights);return jsx(Fragment,{children:t.map(e=>jsx(Po,{flight:e},e.key))})}function Po({flight:t}){let e=useRef(null),n=b(),o=O();return useLayoutEffect(()=>{let i=e.current;if(!i||typeof i.animate!="function"){n.fx.arrive(t.key);return}let r=t.to.x-t.from.x,u=t.to.y-t.from.y,l=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${l}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${u}px) scale(.55)`,opacity:1}],{duration:t.durationMs,delay:t.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(t.key),()=>{d.onfinish=null,d.cancel();}},[]),jsx("div",{ref:e,style:{position:"absolute",left:t.from.x-16,top:t.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsx(N,{glyph:o.iconOf(t.line),size:32})})}var ln=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function To(){let t=fe(e=>e.bursts);return jsx(Fragment,{children:t.map(e=>jsx(Eo,{x:e.at.x,y:e.at.y},e.key))})}function Eo({x:t,y:e}){let n=useRef(null);return useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,u)=>{if(typeof r.animate!="function")return;let l=u/16*Math.PI*2+Math.random()*.3,d=50+Math.random()*60;i.push(r.animate([{transform:"translate(0,0) scale(1)",opacity:1},{transform:`translate(${Math.cos(l)*d}px, ${Math.sin(l)*d+20}px) scale(.2)`,opacity:0}],{duration:650+Math.random()*200,easing:"cubic-bezier(.1,.8,.3,1)",fill:"forwards"}));}),()=>i.forEach(r=>r.cancel())},[]),jsx("div",{ref:n,style:{position:"absolute",left:t,top:e,width:0,height:0,zIndex:61,pointerEvents:"none"},children:Array.from({length:16},(o,i)=>jsx("span",{style:{position:"absolute",left:-4,top:-4,width:8,height:8,borderRadius:i%3===0?2:"50%",background:ln[i%ln.length]}},i))})}function Uo(){let t=c(),[e,n]=useState(false);return useEffect(()=>{if(!t)return;let o,i=t.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[t]),e?jsx("div",{role:"alert",style:{position:"absolute",top:"calc(8px + env(safe-area-inset-top))",left:"50%",transform:"translateX(-50%)",zIndex:45,padding:"6px 14px",borderRadius:999,background:a.red,...x,color:a.onRed,textShadow:a.onRedOutline,fontSize:13,pointerEvents:"none",animation:`idos-rise-in ${a.normal} ease both`},children:k("offline")}):null}var Ct=["economy","events","social","profile","other"];function fn(t){return [...t].sort((e,n)=>{let o=Ct.indexOf(e.group??"other")-Ct.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function Io({items:t,onOpen:e}){let{play:n}=b(),o=mt(),i=at(fn(t),u=>u.group??"other"),r=0;return jsx("div",{style:{display:"grid",gap:18},children:i.map(u=>jsxs("div",{children:[jsx(gt,{children:Ct.includes(u.key)?k(u.key):u.key}),jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:u.items.map(l=>jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${l.id}`,onClick:()=>{n("click"),e(l.id);},style:{...U,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsx(N,{glyph:l.icon??"box",size:40}),jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:l.label}),jsx(ye,{count:l.badge??0})]},l.id))})]},u.key))})}export{ye as Badge,z as Button,io as Card,to as Center,co as ConfirmPopup,K as DEFAULT_PLAYER_PREFS,Lt as DEFAULT_UI_CONFIG,Ht as DESKTOP_MIN_PX,ue as EASE_IN,Y as EASE_OUT,le as EASE_POP,eo as EmptyState,Io as FeatureGrid,j as FxStore,Yt as GLYPHS,N as Icon,he as IconButton,Jn as ItemTile,Ye as KIT_CSS,xt as KitPortal,Ae as LEVEL_TONE,Ce as NotificationStore,ee as ON_TONE,ne as Popup,Zn as ProgressBar,tt as RARITY_ORDER,en as ResourceBadge,pt as ResourceCounter,Xn as ResourceList,Re as SOUND_PRESETS,gt as SectionTitle,Zt as Spinner,Vt as TABLET_MIN_PX,_e as TOAST_DURATION,oo as Tabs,no as Timer,Ke as UI_SOUND_EVENTS,An as UiKitProvider,ae as UiSoundEngine,po as Window,nt as bundleLines,Jt as buttonStyle,Wn as canAfford,me as configSection,Gn as costLines,rt as countdown,Ut as counterKeys,We as createNotificationStore,lt as currencyGlyph,pn as defineUiConfig,Ge as effectiveVolume,Fn as errorText,A as formatAmount,qt as grantLines,_n as grantedBy,at as groupBy,Et as iconsFor,jt as isGlyph,st as itemDefinitions,ut as itemGlyph,ge as layoutFor,_t as makeT,Wt as mergeLines,se as motionDurations,x as outlined,U as panel,Fe as parsePlayerPrefs,Ze as pickLanguage,zn as plural,qn as rarityRank,Ro as renderKitOverlays,Tt as resolveSound,Se as resolveUiConfig,Ue as resourceName,Ve as screenBackground,fn as sortFeatures,qe as themeVars,pe as tokenGlyph,it as tokenName,ot as tokenParts,Ee as toneSurface,k as uiT,Xt as useAnimatedNumber,ft as useBalances,O as useCatalog,In as useCelebrate,ct as useCounterValue,Le as useGameLayout,jn as useLayout,En as useMotion,$n as useNotify,Qn as useNow,Un as usePlayerPrefs,te as usePopupClose,Pe as usePresence,Tn as useSound,mt as useStagger,Dn as useToast,b as useUiKit,a as v,He as well};
|
|
38
|
+
`;function Ut(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function It(t){return t.kind==="currency"?[t.id]:t.kind==="item"?[`item:${t.id}`,"inventory"]:[]}var j=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));setMotion(e){this.motion=e;}setPlayer(e){this.player=e;}setLayer(e){this.layerEl=e;}holding(e){return (this.holds.get(e)??0)+(this.reserved.get(e)??0)}reserve(e){if(this.motion?.rewardFlight){for(let n of e)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(e){let n=false;for(let o of e){if(o.kind!=="currency")continue;let i=(this.reserved.get(o.id)??0)-1;i<=0?this.reserved.delete(o.id):this.reserved.set(o.id,i),n=true;}n&&this.changed();}fly(e,n){if(!this.motion?.rewardFlight||!this.layerEl||typeof document>"u")return;let o=this.layerEl.getBoundingClientRect(),i=Math.max(200,this.motion.durations.slow+180),r=[];for(let u of e){let l=It(u).map(y=>({key:y,el:document.querySelector(`[data-resource-counter="${Dt(y)}"]`)})).find(y=>y.el&&kn(y.el));if(!l?.el)continue;let d=Qe(l.el.getBoundingClientRect(),o),p=n(u),c=p?Qe(p,o):{x:o.width/2,y:o.height/2},f=Ut(u.amount);for(let y=0;y<f;y++)r.push({key:this.nextKey++,line:u,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:y*55,durationMs:i,target:l.key}),this.holds.set(l.key,(this.holds.get(l.key)??0)+1);}this.release(e),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(e){let n=this.flights.find(i=>i.key===e);if(!n)return;this.flights=this.flights.filter(i=>i.key!==e);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),wn(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(e){if(!this.motion?.particles||!this.layerEl||!e)return;let n=Qe(e.getBoundingClientRect(),this.layerEl.getBoundingClientRect()),o=this.nextKey++;this.bursts=[...this.bursts,{key:o,at:n}],this.changed(),setTimeout(()=>{this.bursts=this.bursts.filter(i=>i.key!==o),this.changed();},900);}changed(){this.version+=1;for(let e of this.listeners)e();}};function Qe(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function kn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function wn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${Dt(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function Dt(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var At=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",$t="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function Ot(t){if(!(t instanceof HTMLElement)||t.hasAttribute($t))return;t.setAttribute($t,"");let e=t.style,n=Q(1.6,2.8);e.setProperty("--idos-float-speed",n.toFixed(2)),e.setProperty("--idos-float-phase",(-Q(0,n)).toFixed(2)),e.setProperty("--idos-float-amp",Q(3,7).toFixed(1)),e.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*Q(0,1.5)).toFixed(2));let o=Q(5,7.5);e.setProperty("--idos-shine-speed",o.toFixed(2)),e.setProperty("--idos-shine-phase",(-Q(0,o)).toFixed(2));}function Xe(t){t instanceof Element&&(t.matches(At)&&Ot(t),t.querySelectorAll(At).forEach(Ot));}function zt(t){if(typeof MutationObserver>"u")return ()=>{};Xe(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?Xe(o.target):o.addedNodes.forEach(Xe);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Ft="idos-ui-prefs";function Nn(){try{return Ge(typeof localStorage<"u"?localStorage.getItem(Ft):null)}catch{return {...F}}}function Pn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Kt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&Pn(),o=t.motion.enabled&&!n;return {on:o,durations:se(t.motion,n),intensity:o?t.motion.intensity:0,rewardFlight:o&&t.motion.rewardFlight,particles:o&&t.motion.particles,stagger:o&&t.motion.stagger}}var Bt=Se(null),Ln=new j,Tn={config:Bt,prefs:F,setPrefs:()=>{},motion:Kt(Bt,F),play:()=>{},layer:null,fx:Ln,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Gt=createContext(Tn);function b(){return useContext(Gt)}function En(){return b().play}function Un(){return b().motion}function In(){let t=b();return [t.prefs,t.setPrefs]}function Dn(){return b().celebrate}function An(){return b().toast}function $n(){return b().notify}function On({config:t,children:e,overlays:n,notifications:o}){let i=useMemo(()=>Se(t),[t]),[r,u]=useState(Nn),l=useCallback(w=>{u(V=>{let Nt={...V,...w};try{localStorage.setItem(Ft,JSON.stringify(Nt));}catch{}return Nt});},[]),d=useRef(null);d.current??=new ae(i.sound,r),useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),useEffect(()=>{let w=d.current;return w?.attach(),()=>w?.dispose()},[]);let p=useCallback(w=>d.current?.play(w),[]),c=useMemo(()=>Kt(i,r),[i,r]),f=useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[y,v]=useState(null);useEffect(()=>f.setLayer(y),[f,y]);let[C,T]=useState(null),D=useRef(C);D.current=C;let L=useCallback((w,V)=>{if(w.length===0){V?.onDone?.();return}f.reserve(w),T({lines:w,options:V});},[f]),W=useCallback(()=>{let w=D.current;w&&f.release(w.lines),T(null),w?.options?.onDone?.();},[f]),ke=useRef(null),P=o??(ke.current??=qe());useEffect(()=>(P.setPlayer(p),()=>P.setPlayer(null)),[P,p]);let q=useMemo(()=>({toast:w=>P.toast(w),alert:w=>P.alert(w),dismiss:w=>P.dismiss(w)}),[P]),E=useCallback((w,V="info")=>{P.toast({message:w,level:V});},[P]),ie=useMemo(()=>({config:i,prefs:r,setPrefs:l,motion:c,play:p,layer:y,fx:f,celebrate:L,toast:E,notify:q,provided:true}),[i,r,l,c,p,y,f,L,E,q]),re=useRef(null);useEffect(()=>re.current?zt(re.current):void 0,[]);let G=!c.on;return jsx(Gt.Provider,{value:ie,children:jsxs("div",{ref:re,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...Ve(i,G)},children:[jsx("style",{children:je}),e,jsx("div",{ref:v,"data-idos-ui-layer":"",style:{position:"absolute",inset:0,zIndex:50,pointerEvents:"none",fontFamily:"var(--idos-ui-font)",overflow:"hidden"},children:n?.({celebration:C,finishCelebration:W,notifications:P})})]})})}function fe(t){let{fx:e}=b();return useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var _t=typeof window<"u"?useLayoutEffect:useEffect;function et(){if(typeof navigator>"u")return "en";let t=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(e=>t.startsWith(e))?"ru":"en"}function Wt(t,e,n=et()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function Bn(t,e,n=et()){let[o,i=o,r=i]=e.split("|"),u=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?u==="one"?o:u==="few"?i:r:u==="one"?o:i}var Fn={close:"Close",back:"Back",confirm:"Confirm",cancel:"Cancel",youGot:"You got",great:"Great!",loading:"Loading\u2026",ok:"OK",loadingNamed:"Loading {name}\u2026",stillLoading:"Still loading \u2014 the first start can take a little longer",retry:"Retry",error:"Something went wrong",notEnough:"Not enough resources",offline:"No connection. Retrying\u2026",more:"More",menu:"Menu",nothingHere:"Nothing here yet",economy:"Economy",events:"Activities",social:"Social",profile:"Profile",other:"Other",free:"Free",claim:"Claim",claimAll:"Claim all",tokenEvent:"Event points",tokenSeason:"Season status",tokenQuest:"Quest points",tokenScore:"Rating points"},Kn={close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",back:"\u041D\u0430\u0437\u0430\u0434",confirm:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0430",youGot:"\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438",great:"\u041E\u0442\u043B\u0438\u0447\u043D\u043E!",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",ok:"\u041F\u043E\u043D\u044F\u0442\u043D\u043E",loadingNamed:"\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043C \xAB{name}\xBB\u2026",stillLoading:"\u0415\u0449\u0451 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044F \u2014 \u043F\u0435\u0440\u0432\u044B\u0439 \u0437\u0430\u043F\u0443\u0441\u043A \u0431\u044B\u0432\u0430\u0435\u0442 \u0434\u043E\u043B\u044C\u0448\u0435",retry:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",error:"\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A",notEnough:"\u041D\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u043E\u0432",offline:"\u041D\u0435\u0442 \u0441\u0432\u044F\u0437\u0438. \u041F\u0440\u043E\u0431\u0443\u0435\u043C \u0441\u043D\u043E\u0432\u0430\u2026",more:"\u0415\u0449\u0451",menu:"\u041C\u0435\u043D\u044E",nothingHere:"\u041F\u043E\u043A\u0430 \u043F\u0443\u0441\u0442\u043E",economy:"\u042D\u043A\u043E\u043D\u043E\u043C\u0438\u043A\u0430",events:"\u0421\u043E\u0431\u044B\u0442\u0438\u044F",social:"\u0414\u0440\u0443\u0437\u044C\u044F \u0438 \u043E\u0431\u0449\u0435\u043D\u0438\u0435",profile:"\u041F\u0440\u043E\u0444\u0438\u043B\u044C",other:"\u0420\u0430\u0437\u043D\u043E\u0435",free:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u043E",claim:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C",claimAll:"\u0417\u0430\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0451",tokenEvent:"\u041E\u0447\u043A\u0438 \u0438\u0432\u0435\u043D\u0442\u0430",tokenSeason:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0437\u043E\u043D\u0430",tokenQuest:"\u041E\u0447\u043A\u0438 \u0437\u0430\u0434\u0430\u043D\u0438\u0439",tokenScore:"\u041E\u0447\u043A\u0438 \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u0430"},k=Wt(Fn,Kn);function Gn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?k("notEnough"):t.length>140?`${t.slice(0,140)}\u2026`:t:k("error")}function ot(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?e.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?e.push({kind:"item",id:n.ItemID,amount:o}):e.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of t?.EventTokens??[]){let o=n?.Address?.Type,i=(n?.Address?.EntityID??"").split(":")[0];if(!o||!i)continue;let r=Number(n?.Applied??n?.Amount??0);!Number.isFinite(r)||r<=0||e.push({kind:"token",id:`${o}:${i}`,amount:r});}return qt(e)}function it(t){let e=t.id.indexOf(":");return e<0?{system:t.id,entity:""}:{system:t.id.slice(0,e),entity:t.id.slice(e+1)}}function pe(t){switch(it(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function rt(t,e){let{system:n,entity:o}=it(t);return n==="TimedEvent"?(e?me(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||k("tokenEvent"):n==="Season"?k("tokenSeason"):n==="Quest"?k("tokenQuest"):n==="Leaderboard"?k("tokenScore"):t.id}function qt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function Vt(t){return ot(t?.Standard)}function _n(t){return ot(t?.Standard)}function Wn(t){let e=t?.Resources?.Grant;return Vt(e)}function qn(t,e){return t.every(n=>n.kind!=="currency"||Number(e?.[n.id]?.Amount??0)>=n.amount)}function $(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${tt(t/1e9)}B`:e>=1e6?`${tt(t/1e6)}M`:e>=1e5?`${tt(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function tt(t){return t.toFixed(2).replace(/\.?0+$/,"")}function st(t,e){if(!t)return null;let n=new Date(t);if(n.getUTCFullYear()>=9e3)return null;let o=n.getTime()-e;if(!Number.isFinite(o)||o<=0)return null;let i=Math.floor(o/1e3),r=Math.floor(i/3600),u=Math.floor(i%3600/60),l=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(u).padStart(2,"0")}m`:`${u}m ${String(l).padStart(2,"0")}s`}var Ht=640,Yt=1024;function ge(t){return t>=Yt?"desktop":t>=Ht?"tablet":"phone"}function me(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function at(t){let e=new Map;for(let n of Object.values(t?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&e.set(i.ItemID??o,i);return e}var nt=["Legendary","Epic","Rare","Uncommon","Common"];function Vn(t){let e=nt.indexOf(t??"");return e<0?nt.length:e}function lt(t,e){let n=new Map;for(let o of t){let i=e(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}var jt=["coin","gem","potion","scroll","sword","shield","crown","gift","bag","box","trophy","calendar","star","check","lock","shop","chest","quest","user","logout","copy","hero","hammer","market","flame","ticket","friends","chat","link","swords","gear","globe","sound","mute","bell","bulb","menu","close","back","plus","energy","heart","offer","clock","trash","edit"];function Qt(t){return jt.includes(t)}function ut(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function dt(t,e){let n={potion:"potion",scroll:"scroll",weapon:"sword",sword:"sword",armor:"shield",shield:"shield",helmet:"hero",crown:"crown",chest:"chest",lootbox:"chest",gift:"gift",ticket:"ticket"};for(let o of [...t??[],e??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var Hn=/^(https?:|\/|data:)/;function N({glyph:t,size:e=24,color:n}){return Qt(t)?jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:Yn(t,n)}):Hn.test(t)?jsx("img",{src:t,alt:"",width:e,height:e,style:{flex:"none",display:"block",objectFit:"contain"}}):jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:e,height:e,fontSize:e*.8,lineHeight:1},children:t})}function Yn(t,e){switch(t){case "coin":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"17",r:"12",fill:"#c77a0c"}),jsx("circle",{cx:"16",cy:"15",r:"12",fill:e??"#ffcf3a"}),jsx("circle",{cx:"16",cy:"15",r:"8.5",fill:"none",stroke:"#e89a12",strokeWidth:"2"}),jsx("path",{d:"M16 9.5v11M13 12.5h4.5a2 2 0 010 4H13",stroke:"#b86d06",strokeWidth:"2.2",fill:"none",strokeLinecap:"round"})]});case "gem":return jsxs(Fragment,{children:[jsx("path",{d:"M9 5h14l6 8-13 15L3 13z",fill:e??"#5ce1ff"}),jsx("path",{d:"M9 5l3 8h8l3-8M3 13h26M12 13l4 15 4-15",fill:"none",stroke:"#1f8fc7",strokeWidth:"1.6",strokeLinejoin:"round"}),jsx("path",{d:"M11 7l2 5",stroke:"#fff",strokeWidth:"1.6",strokeLinecap:"round",opacity:".8"})]});case "potion":return jsxs(Fragment,{children:[jsx("rect",{x:"12.5",y:"3",width:"7",height:"6",rx:"1.5",fill:"#c9a36a"}),jsx("path",{d:"M13 9h6v4l6 8a7 7 0 01-6 9h-6a7 7 0 01-6-9l6-8z",fill:e??"#ff5a7a"}),jsx("path",{d:"M9 21h14",stroke:"#fff",strokeWidth:"1.5",opacity:".45"}),jsx("circle",{cx:"13",cy:"22",r:"1.6",fill:"#fff",opacity:".7"})]});case "scroll":return jsxs(Fragment,{children:[jsx("rect",{x:"6",y:"7",width:"20",height:"18",rx:"2",fill:e??"#f3dca2"}),jsx("rect",{x:"4",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsx("rect",{x:"24",y:"5",width:"4",height:"22",rx:"2",fill:"#c49a52"}),jsx("path",{d:"M11 12h10M11 16h10M11 20h7",stroke:"#9c7338",strokeWidth:"1.8",strokeLinecap:"round"})]});case "sword":return jsxs(Fragment,{children:[jsx("path",{d:"M22 3l7 0 0 7L14 25l-4-3z",fill:e??"#d7e3f4"}),jsx("path",{d:"M24 5L12 21",stroke:"#fff",strokeWidth:"1.4",opacity:".7"}),jsx("path",{d:"M6 19l7 7",stroke:"#8a5a26",strokeWidth:"3.4",strokeLinecap:"round"}),jsx("path",{d:"M4 27l3 -3",stroke:"#e0b44a",strokeWidth:"4",strokeLinecap:"round"})]});case "shield":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3l11 4v8c0 7-5 12-11 14C10 27 5 22 5 15V7z",fill:e??"#b57a3c"}),jsx("path",{d:"M16 6l8 3v6c0 5-3.5 9-8 11-4.5-2-8-6-8-11V9z",fill:"#d89b54"}),jsx("path",{d:"M16 6v20M8 14h16",stroke:"#8a5424",strokeWidth:"1.8"})]});case "crown":return jsxs(Fragment,{children:[jsx("path",{d:"M4 11l6 5 6-9 6 9 6-5-3 14H7z",fill:e??"#ffcf3a"}),jsx("rect",{x:"7",y:"24",width:"18",height:"4",rx:"1.5",fill:"#e89a12"}),jsx("circle",{cx:"16",cy:"18",r:"2",fill:"#ff5a7a"}),jsx("circle",{cx:"10",cy:"20",r:"1.4",fill:"#5ce1ff"}),jsx("circle",{cx:"22",cy:"20",r:"1.4",fill:"#5ce1ff"})]});case "gift":return jsxs(Fragment,{children:[jsx("rect",{x:"5",y:"13",width:"22",height:"15",rx:"2",fill:e??"#ff6b8b"}),jsx("rect",{x:"3",y:"9",width:"26",height:"6",rx:"2",fill:"#ff8aa3"}),jsx("rect",{x:"14",y:"9",width:"4",height:"19",fill:"#ffd24a"}),jsx("path",{d:"M16 9c-2-5-8-5-7-1 1 2 5 1 7 1zm0 0c2-5 8-5 7-1-1 2-5 1-7 1z",fill:"#ffd24a"})]});case "bag":return jsxs(Fragment,{children:[jsx("path",{d:"M11 9h10l5 5v11a4 4 0 01-4 4H10a4 4 0 01-4-4V14z",fill:e??"#c98a3c"}),jsx("path",{d:"M11 9l2-5h6l2 5",fill:"#a86c26"}),jsx("circle",{cx:"16",cy:"19",r:"4.5",fill:"#ffcf3a"}),jsx("path",{d:"M16 16.5v5",stroke:"#b86d06",strokeWidth:"1.8",strokeLinecap:"round"})]});case "trophy":return jsxs(Fragment,{children:[jsx("path",{d:"M9 4h14v7a7 7 0 01-14 0z",fill:e??"#ffcf3a"}),jsx("path",{d:"M9 7H4c0 5 3 7 6 7M23 7h5c0 5-3 7-6 7",fill:"none",stroke:"#e89a12",strokeWidth:"2.2"}),jsx("rect",{x:"14",y:"17",width:"4",height:"6",fill:"#e89a12"}),jsx("rect",{x:"9",y:"23",width:"14",height:"5",rx:"1.5",fill:"#b86d06"})]});case "calendar":return jsxs(Fragment,{children:[jsx("rect",{x:"4",y:"6",width:"24",height:"22",rx:"3",fill:"#fff"}),jsx("rect",{x:"4",y:"6",width:"24",height:"7",rx:"3",fill:e??"#ff5a5a"}),jsx("path",{d:"M10 3v6M22 3v6",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"}),jsx("path",{d:"M10 18h3M15 18h3M20 18h3M10 23h3M15 23h3",stroke:"#5b6187",strokeWidth:"2.4",strokeLinecap:"round"})]});case "star":return jsx("path",{d:"M16 3l3.9 8 8.6 1.2-6.3 6 1.6 8.6L16 22.7 8.2 26.8l1.6-8.6-6.3-6 8.6-1.2z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "check":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"13",fill:e??"#59d35b"}),jsx("path",{d:"M9.5 16.5l4.5 4.5 8.5-9",fill:"none",stroke:"#fff",strokeWidth:"3.4",strokeLinecap:"round",strokeLinejoin:"round"})]});case "lock":return jsxs(Fragment,{children:[jsx("path",{d:"M10 14v-4a6 6 0 0112 0v4",fill:"none",stroke:"#8e95b8",strokeWidth:"3"}),jsx("rect",{x:"7",y:"14",width:"18",height:"14",rx:"3",fill:e??"#c3c8e3"}),jsx("circle",{cx:"16",cy:"21",r:"2.2",fill:"#5b6187"})]});case "shop":return jsxs(Fragment,{children:[jsx("path",{d:"M4 12l3-7h18l3 7z",fill:e??"#ff5a5a"}),jsx("path",{d:"M4 12h24v2a3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0 3 3 0 01-6 0z",fill:"#fff"}),jsx("rect",{x:"6",y:"16",width:"20",height:"12",rx:"1.5",fill:"#ffd9a8"}),jsx("rect",{x:"13",y:"20",width:"6",height:"8",fill:"#c98a3c"})]});case "chest":return jsxs(Fragment,{children:[jsx("path",{d:"M5 13a11 7 0 0122 0v2H5z",fill:e??"#b57a3c"}),jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"2",fill:"#d89b54"}),jsx("rect",{x:"5",y:"15",width:"22",height:"3",fill:"#8a5424"}),jsx("rect",{x:"14",y:"14",width:"4",height:"7",rx:"1",fill:"#ffd24a"})]});case "quest":return jsxs(Fragment,{children:[jsx("rect",{x:"6",y:"4",width:"20",height:"24",rx:"3",fill:"#f3dca2"}),jsx("path",{d:"M11 11l2 2 4-4M11 18l2 2 4-4",fill:"none",stroke:e??"#2b9936",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"}),jsx("path",{d:"M19 12h3M19 19h3",stroke:"#9c7338",strokeWidth:"2",strokeLinecap:"round"})]});case "user":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"14",fill:e??"#4fb1ff"}),jsx("circle",{cx:"16",cy:"12.5",r:"5.2",fill:"#fff"}),jsx("path",{d:"M6.5 25.5a10 7 0 0119 0A13.6 13.6 0 0116 30a13.6 13.6 0 01-9.5-4.5z",fill:"#fff"})]});case "logout":return jsxs(Fragment,{children:[jsx("path",{d:"M18 5H9a3 3 0 00-3 3v16a3 3 0 003 3h9",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:e??"currentColor",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})]});case "copy":return jsxs(Fragment,{children:[jsx("rect",{x:"10",y:"10",width:"16",height:"18",rx:"3",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6"}),jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "hero":return jsxs(Fragment,{children:[jsx("path",{d:"M6 15a10 10 0 0120 0v5H6z",fill:e??"#b8c4d9"}),jsx("path",{d:"M6 15a10 10 0 0120 0",fill:"none",stroke:"#6f7c99",strokeWidth:"1.6"}),jsx("rect",{x:"9",y:"16",width:"14",height:"3",rx:"1",fill:"#2a3150"}),jsx("path",{d:"M16 3v5",stroke:"#ff5a5a",strokeWidth:"3",strokeLinecap:"round"}),jsx("path",{d:"M8 20h16l-2 8H10z",fill:"#8a96b3"})]});case "hammer":return jsxs(Fragment,{children:[jsx("path",{d:"M14 13l12 12-3 3-12-12z",fill:"#a8743d"}),jsx("path",{d:"M5 9l7-6 8 8-7 6z",fill:e??"#c3c8e3"}),jsx("path",{d:"M5 9l7-6 2 2-7 6z",fill:"#e6e9f7"})]});case "market":return jsxs(Fragment,{children:[jsx("path",{d:"M3 11l3-7h20l3 7z",fill:e??"#4fb1ff"}),jsx("path",{d:"M3 11h26v2a3 3 0 01-6.5 0 3 3 0 01-6.5 0 3 3 0 01-6.5 0A3 3 0 013 13z",fill:"#fff"}),jsx("rect",{x:"5",y:"15",width:"22",height:"13",rx:"1.5",fill:"#d8e7ff"}),jsx("circle",{cx:"16",cy:"21.5",r:"4",fill:"#ffcf3a"}),jsx("path",{d:"M16 19.5v4",stroke:"#b86d06",strokeWidth:"1.6",strokeLinecap:"round"})]});case "flame":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3c1 5 8 8 8 16a8 8 0 01-16 0c0-4 2-6 3-8 1 3 3 4 3 4 0-5 1-8 2-12z",fill:e??"#ff7a2e"}),jsx("path",{d:"M16 15c1 3 4 4 4 8a4 4 0 01-8 0c0-2 1-3 2-4 .5 1 1.5 1.5 1.5 1.5 0-2 .2-3.5.5-5.5z",fill:"#ffd24a"})]});case "ticket":return jsxs(Fragment,{children:[jsx("path",{d:"M4 9h24v4a3 3 0 000 6v4H4v-4a3 3 0 000-6z",fill:e??"#b879ff"}),jsx("path",{d:"M20 9v14",stroke:"#fff",strokeWidth:"1.6",strokeDasharray:"2 2"}),jsx("path",{d:"M11 13l1.2 2.4 2.6.4-1.9 1.8.5 2.6-2.4-1.3-2.3 1.3.4-2.6-1.9-1.8 2.6-.4z",fill:"#ffd24a"})]});case "friends":return jsxs(Fragment,{children:[jsx("circle",{cx:"11",cy:"11",r:"4.5",fill:e??"#4fb1ff"}),jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:e??"#4fb1ff"}),jsx("circle",{cx:"21.5",cy:"12",r:"4",fill:"#59d35b"}),jsx("path",{d:"M15 26a7 6.5 0 0114 0z",fill:"#59d35b"})]});case "chat":return jsxs(Fragment,{children:[jsx("path",{d:"M4 7a3 3 0 013-3h18a3 3 0 013 3v12a3 3 0 01-3 3H13l-6 5v-5H7a3 3 0 01-3-3z",fill:e??"#4fb1ff"}),jsx("circle",{cx:"11",cy:"13",r:"1.8",fill:"#fff"}),jsx("circle",{cx:"16",cy:"13",r:"1.8",fill:"#fff"}),jsx("circle",{cx:"21",cy:"13",r:"1.8",fill:"#fff"})]});case "link":return jsxs(Fragment,{children:[jsx("path",{d:"M13 19l6-6",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"}),jsx("path",{d:"M14 9l2-2a5 5 0 017 7l-2 2M18 23l-2 2a5 5 0 01-7-7l2-2",fill:"none",stroke:e??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxs(Fragment,{children:[jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:e??"#d7e3f4"}),jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:e??"#d7e3f4"}),jsx("path",{d:"M8 22l4 4M24 22l-4 4",stroke:"#8a5a26",strokeWidth:"3.2",strokeLinecap:"round"}),jsx("path",{d:"M6 20l6 6M26 20l-6 6",stroke:"#e0b44a",strokeWidth:"2",strokeLinecap:"round"})]});case "gear":return jsxs(Fragment,{children:[jsx("path",{d:"M14 3h4l.7 3.3 2.6 1.1 2.8-1.9 2.8 2.8-1.9 2.8 1.1 2.6L29 14v4l-3.3.7-1.1 2.6 1.9 2.8-2.8 2.8-2.8-1.9-2.6 1.1L18 29h-4l-.7-3.3-2.6-1.1-2.8 1.9-2.8-2.8 1.9-2.8-1.1-2.6L3 18v-4l3.3-.7 1.1-2.6-1.9-2.8 2.8-2.8 2.8 1.9 2.6-1.1z",fill:e??"#aeb6f0"}),jsx("circle",{cx:"16",cy:"16",r:"4.5",fill:"#2c3480"})]});case "globe":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"#4fb1ff"}),jsx("path",{d:"M4 16h24M16 4c-4 4-4 20 0 24M16 4c4 4 4 20 0 24",fill:"none",stroke:"#fff",strokeWidth:"1.6"})]});case "sound":return jsxs(Fragment,{children:[jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:e??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxs(Fragment,{children:[jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:e??"currentColor"}),jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:e??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "bell":return jsxs(Fragment,{children:[jsx("path",{d:"M16 4a8 8 0 018 8v6l3 4H5l3-4v-6a8 8 0 018-8z",fill:e??"#ffd24a"}),jsx("circle",{cx:"16",cy:"26",r:"3",fill:"#e89a12"})]});case "bulb":return jsxs(Fragment,{children:[jsx("path",{d:"M16 3a9 9 0 015 16.5V23h-10v-3.5A9 9 0 0116 3z",fill:e??"#ffe066"}),jsx("rect",{x:"11",y:"24",width:"10",height:"3",rx:"1",fill:"#aeb6f0"}),jsx("rect",{x:"12.5",y:"27.5",width:"7",height:"2.5",rx:"1",fill:"#8e95b8"})]});case "menu":return jsx("path",{d:"M6 9h20M6 16h20M6 23h20",stroke:e??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsx("path",{d:"M16 7v18M7 16h18",stroke:e??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:e??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "heart":return jsx("path",{d:"M16 27S4 20 4 11.5A6.5 6.5 0 0116 8a6.5 6.5 0 0112 3.5C28 20 16 27 16 27z",fill:e??"#ff5a7a"});case "offer":return jsxs(Fragment,{children:[jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:e??"#ff5a5a"}),jsx("circle",{cx:"21",cy:"9",r:"2.2",fill:"#fff"}),jsx("path",{d:"M11 17l6-6",stroke:"#fff",strokeWidth:"1.8",strokeLinecap:"round"})]});case "clock":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"12",fill:e??"currentColor"}),jsx("path",{d:"M16 9v7l5 3",fill:"none",stroke:"#2c3480",strokeWidth:"2.6",strokeLinecap:"round"})]});case "trash":return jsxs(Fragment,{children:[jsx("path",{d:"M8 10h16l-1.5 17h-13z",fill:e??"#ff5a5a"}),jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:e??"#ff5a5a"}),jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:e??"#ff5a5a"})]});case "edit":return jsxs(Fragment,{children:[jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:e??"#ffd24a"}),jsx("path",{d:"M20 8l2-2a2.8 2.8 0 014 4l-2 2",fill:"#e89a12"})]});default:return jsxs(Fragment,{children:[jsx("path",{d:"M16 3l12 6v14l-12 6-12-6V9z",fill:e??"#9aa6ff"}),jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function Qn(t){let[e,n]=useState("phone");return _t(()=>{let o=t.current;if(!o)return;let i=()=>n(ge(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[t]),e}function Pe(){let{layer:t}=b(),e=useRef(null);e.current=t;let[n,o]=useState(()=>t?ge(t.getBoundingClientRect().width):"phone");return useEffect(()=>{if(!t)return;let i=()=>o(ge(t.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(t),()=>r.disconnect()},[t]),n}function Le(t,e){let[n,o]=useState(t),[i,r]=useState(false);return useEffect(()=>{if(t){o(true),r(false);return}if(!n)return;if(e<=0){o(false);return}r(true);let u=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(u)},[t,e,n]),{mounted:n,closing:i}}function Jt(t,e=600,n){let[o,i]=useState(t),r=useRef(t),u=useRef(n);return u.current=n,useEffect(()=>{let l=r.current;if(l===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let y=Math.min(1,(f-d)/e),v=1-Math.pow(1-y,3),C=Math.round(l+(t-l)*v);C!==r.current&&u.current?.(),r.current=C,i(C),y<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function ft(t,e){let n=b(),o=fe(u=>u.holding(t)>0),i=useRef(e);o||(i.current=e);let r=o?i.current:e;return Jt(r,n.motion.on?650:0,()=>n.play("countTick"))}function O(){let t=c(),e=b(),[,n]=useReducer(l=>l+1,0);useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=useMemo(()=>t&&o?at(me(t,"Item")):new Map,[t,o]),r=useMemo(()=>t&&o?me(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),u=useCallback(l=>l?t?.localization.has(l)?t.localization.t(l):l:"",[t]);return useMemo(()=>({items:i,currencies:r,localize:u,currencyName:l=>u(r[l]?.DisplayName||l),itemName:l=>u(i.get(l)?.DisplayName||l),iconOf:l=>{if(l.kind==="currency")return r[l.id]?.ImagePath||ut(l.id);if(l.kind==="item"){let d=i.get(l.id);return d?.ImagePath||dt(d?.Tags,d?.ItemClass)}return "box"},rarityColor:l=>e.config.theme.rarity[l??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,u,e.config.theme.rarity])}function pt(){let t=c(),e=O(),[,n]=useReducer(r=>r+1,0);useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(e.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,u])=>[r,Number(u?.Amount??0)]).sort(([r],[u])=>r.localeCompare(u))}function Xn(t=1e3){let[e,n]=useState(()=>Date.now());return useEffect(()=>{let o=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(o)},[t]),e}var Te={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ee={green:{color:a.onGreen,textShadow:a.onGreenOutline},gold:{color:a.onGold,textShadow:a.onGoldOutline},blue:{color:a.onBlue,textShadow:a.onBlueOutline},red:{color:a.onRed,textShadow:a.onRedOutline},grey:{color:"#ffffff",textShadow:we}};function Ee(t){let[e,n]=Te[t],o=ee[t];return {background:`linear-gradient(180deg, ${e} 0%, ${n} 100%)`,color:o.color,"--idos-ui-text":o.color,"--idos-ui-text-dim":`color-mix(in srgb, ${o.color} 80%, transparent)`,"--idos-ui-text-outline":o.textShadow}}function Zt(t,e=false,n="md"){let[o,i]=Te[e?"grey":t],r=ee[e?"grey":t],u=n==="sm"?"6px 12px":n==="lg"?"12px 22px":"10px 18px";return {...x,...r,fontFamily:a.font,fontSize:n==="sm"?13:n==="lg"?18:16,border:"none",borderRadius:a.buttonRadius,padding:u,minHeight:n==="sm"?34:44,cursor:e?"default":"pointer",background:`linear-gradient(180deg, ${o} 0%, ${i} 100%)`,boxShadow:`0 4px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.35)`,opacity:e?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function z({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:u=false,style:l,className:d="",sound:p="click",title:c,...f}){let{play:y}=b();return jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${u&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&y(p),e?.(v);},style:{...Zt(n,i,o),...l},children:r?jsx(en,{size:18}):t})}function he({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:u}){let{play:l}=b();return jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{l("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Te[i][0]}, ${Te[i][1]})`:a.well,color:i?ee[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsx(N,{glyph:t,size:o*.55}),u?jsx(ye,{count:u}):null]})}function en({size:t=28}){return jsx("span",{"aria-label":k("loading"),style:{width:t,height:t,borderRadius:"50%",border:`${Math.max(2,t/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function ye({count:t,dot:e=false,style:n}){return !t||t<=0?null:jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:e?12:20,height:e?12:20,padding:e?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ee.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function tn({line:t,size:e=20,big:n=false,dim:o=false}){let i=O(),r=c();return jsxs("span",{title:Ue(t,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsx(N,{glyph:t.kind==="token"?pe(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:$(t.amount)]})}function Ue(t,e,n){return t.kind==="currency"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(rt(t,n)):t.id}function Jn({lines:t,size:e=18,gap:n=8,dimIf:o}){return jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:t.map(i=>jsx(tn,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function gt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=O(),r=ft(t,e);return jsxs("div",{"data-resource-counter":t,title:i.currencyName(t),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Ye,cursor:o?"pointer":"default"},children:[jsx(N,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:$(r)})]})}function Zn({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:u=false}){let l=O(),{play:d}=b(),p=l.items.get(t),c=l.rarityColor(p?.Metadata?.RarityID);return jsxs("button",{type:"button",className:"idos-press",title:l.itemName(t),onClick:o?()=>{d("click"),o();}:void 0,style:{position:"relative",width:i,height:i,borderRadius:16,border:`3px solid ${r?a.text:c}`,background:`radial-gradient(circle at 50% 35%, ${c}55 0%, ${a.panelDeep} 70%)`,boxShadow:r?`0 0 0 3px ${a.gold}, 0 4px 0 ${a.shadow}`:`0 4px 0 ${a.shadow}, inset 0 0 12px ${c}44`,display:"grid",placeItems:"center",cursor:o?"pointer":"default",padding:0,opacity:u?.45:1,flex:"none"},children:[jsx(N,{glyph:l.iconOf({kind:"item",id:t,amount:1}),size:i*.56}),e!==void 0&&e>1?jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",$(e)]}):null,n!==void 0&&n>0?jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function eo({value:t,max:e,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,t/Math.max(1,e)*100)),[u,l]=n==="gold"?[a.gold,a.goldDeep]:n==="blue"?[a.blue,a.blueDeep]:[a.green,a.greenDeep];return jsxs("div",{style:{position:"relative",height:i,borderRadius:i/2,background:a.wellSoft,boxShadow:a.wellShadow,overflow:"hidden"},children:[jsx("div",{style:{width:`${r}%`,height:"100%",background:`linear-gradient(180deg, ${u}, ${l})`,borderRadius:i/2,transition:`width ${a.slow} ${Y}`}}),jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${$(t)} / ${$(e)}`})]})}function mt({children:t,right:e}){return jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,margin:"4px 4px 10px"},children:[jsx("div",{style:{...x,fontSize:19,fontFamily:a.font},children:t}),e]})}function to({glyph:t,text:e,action:n}){return jsxs("div",{style:{...U,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsx(N,{glyph:t,size:56}),jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function no({children:t,minHeight:e=240}){return jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function oo({at:t,now:e,label:n}){let o=st(t,e);return o?jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function io({tabs:t,value:e,onChange:n,style:o}){let{play:i}=b();return t.length<2?null:jsx("div",{className:"idos-scroll",role:"tablist",style:{display:"flex",gap:6,padding:4,borderRadius:16,background:a.wellSoft,overflowX:"auto",...o},children:t.map(r=>{let u=r.id===e;return jsxs("button",{role:"tab","aria-selected":u,type:"button",className:"idos-press",onClick:()=>{u||(i("tab"),n(r.id));},style:{position:"relative",flex:"1 0 auto",border:"none",borderRadius:12,padding:"8px 14px",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6,whiteSpace:"nowrap",background:u?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:u?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsx(N,{glyph:r.glyph,size:20}):null,jsx("span",{style:{...x,...u?ee.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsx(ye,{count:r.badge}):null]},r.id)})})}function ht(){let{motion:t}=b();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function ro({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=b();return jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...U,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:U.border,...e},children:t})}var xt=createContext(()=>{});function te(){return useContext(xt)}function kt({children:t}){let{layer:e}=b();return e?createPortal(t,e):jsx(Fragment,{children:t})}var Ie=[],yt=new Set,bt=0,vt=false,Ae=()=>{for(let t of [...yt])t();};function uo(t){vt!==t&&(vt=t,Ae());}function co(t){let[e]=useState(()=>Symbol("auto-popup")),[,n]=useState(0),o=useRef(false);return useEffect(()=>{if(!t){o.current=false;return}Ie.push(e);let i=()=>n(r=>r+1);return yt.add(i),i(),()=>{let r=Ie.indexOf(e);r>=0&&Ie.splice(r,1),yt.delete(i),Ae();}},[t,e]),t?(!o.current&&Ie[0]===e&&bt===0&&!vt&&(o.current=true),o.current):true}function fo(t){useEffect(()=>{if(t)return bt+=1,Ae(),()=>{bt-=1,Ae();}},[t]);}function ne({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:u=true,sound:l=true,panelStyle:d,queued:p=false}){let c=b(),f=Pe(),y=c.motion.durations.normal,[v,C]=useState(false),T=co(p&&n);fo(!p&&n);let{mounted:D,closing:L}=Le(n&&T&&!v,y),W=useRef(e);W.current=e;let ke=useRef(false);useEffect(()=>{!l||!n||!T||ke.current||(ke.current=true,c.play("open"));},[l,n,T,c]);let P=useCallback(()=>{v||(c.play("close"),C(true));},[v,c]);useEffect(()=>{v&&!D&&W.current?.();},[v,D]);let q=u&&e!==void 0;if(useEffect(()=>{if(!q||!D)return;let G=w=>{w.key==="Escape"&&P();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[q,D,P]),!D)return null;let E=r==="sheet"||r==="auto"&&f==="phone",ie=L,re=E?ie?`idos-sheet-out ${a.normal} ${ue} both`:`idos-sheet-in ${a.slow} ${Y} both`:ie?`idos-pop-out ${a.normal} ${ue} both`:`idos-pop-in ${a.slow} ${le} both`;return jsx(kt,{children:jsx(xt.Provider,{value:P,children:jsx("div",{role:"dialog","aria-modal":"true",onClick:q?P:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:E?"end stretch":"center",padding:E?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${ie?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...U,width:E?"100%":`min(${i}px, 100%)`,maxHeight:E?"88%":"min(86vh, 100%)",overflowY:"auto",padding:E?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:E?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:re,...d},children:[E?jsx("div",{"aria-hidden":"true",style:{position:"absolute",top:8,left:"50%",width:44,height:5,marginLeft:-22,borderRadius:3,background:a.line}}):null,o?jsx("div",{style:{...x,fontSize:21,textAlign:"center",fontFamily:a.font,padding:"0 30px"},children:o}):null,e?jsx(he,{glyph:"close",label:k("close"),onClick:P,size:36,tone:"red",style:{position:"absolute",top:E?12:8,right:E?12:8,border:"3px solid #fff"}}):null,t]})})})})}function po({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxs(ne,{title:t,onClose:r,width:380,children:[e,jsx(go,{confirmLabel:n,tone:o,onConfirm:i})]})}function go({confirmLabel:t,tone:e,onConfirm:n}){let o=te(),[i,r]=useState(false);return jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsx(z,{tone:"grey",onClick:o,children:k("cancel")}),jsx(z,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(u=>{r(false),u!==true&&o();});},children:t??k("confirm")})]})}function mo({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:u=true}){let l=b(),[d,p]=useState(false),{mounted:c,closing:f}=Le(i&&!d,l.motion.durations.normal),y=useRef(n);y.current=n,useEffect(()=>{l.play("open");},[]),useEffect(()=>{d&&!c&&y.current();},[d,c]);let v=useCallback(()=>{l.play("close"),p(true);},[l]);return useEffect(()=>{if(!c)return;let C=T=>{T.key==="Escape"&&v();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,v]),c?jsx(kt,{children:jsx(xt.Provider,{value:v,children:jsxs("div",{style:{position:l.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:He,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ue:Y} both`},children:[jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"12px 14px",borderBottom:`2px solid ${a.panelEdge}`,background:a.wellSoft},children:[r?jsx(he,{glyph:"back",label:k("back"),onClick:v,size:38}):null,e?jsx(N,{glyph:e,size:30}):null,jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),u?jsx(ho,{}):null,r?null:jsx(he,{glyph:"close",label:k("close"),onClick:v,size:38,tone:"red"})]}),jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function ho(){let t=pt(),e=Pe(),n=e==="phone"?t.slice(0,2):t;return jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsx(gt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var Oe={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},wt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function bo({level:t,size:e}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:t==="success"?jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):t==="error"?jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):t==="warning"?jsxs(Fragment,{children:[jsx("path",{d:"M12 6v8",...n}),jsx("circle",{cx:"12",cy:"18.2",r:"1.6",fill:"currentColor"})]}):t==="reward"?jsxs(Fragment,{children:[jsx("rect",{x:"4",y:"10",width:"16",height:"10",rx:"1.5",...n}),jsx("path",{d:"M3 10h18M12 10v10M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z",...n,strokeWidth:2.2})]}):jsxs(Fragment,{children:[jsx("circle",{cx:"12",cy:"6.5",r:"1.6",fill:"currentColor"}),jsx("path",{d:"M12 11v7",...n})]})})}function sn({level:t,icon:e,size:n}){return jsx("span",{style:{...Ee(Oe[t]),width:n,height:n,flex:"none",borderRadius:"50%",display:"grid",placeItems:"center",boxShadow:`0 2px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`},children:e?jsx(N,{glyph:e,size:n*.62}):jsx(bo,{level:t,size:n*.56})})}function an({source:t}){return jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:11,fontWeight:800,letterSpacing:.3,textTransform:"uppercase",color:a.textDim,minWidth:0},children:[t.icon?jsx(N,{glyph:t.icon,size:14}):null,jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function vo(t){return useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function ln({store:t}){vo(t);let e=t.currentAlert;return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",top:"calc(env(safe-area-inset-top, 0px) + 10px)",left:"50%",transform:"translateX(-50%)",width:"min(440px, calc(100% - 20px))",display:"flex",flexDirection:"column",gap:8,zIndex:45,pointerEvents:"none"},children:t.toasts.map(n=>jsx(xo,{store:t,toast:n},n.id))}),e?jsx(wo,{store:t,alert:e,queued:t.queued},e.id):null]})}function xo({store:t,toast:e}){let n=b(),o=e.input,i=Oe[e.level],r=o.duration??We[e.level],u=t.source(o.source),l=o.actions?.[0],[d,p]=useState(false),[c,f]=useState(false),y=n.motion.durations.normal,v=useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),y));};let C=useRef(r);useEffect(()=>{C.current=r;},[r,e.revision]),useEffect(()=>{if(r<=0||c||d)return;let L=Date.now(),W=setTimeout(()=>v.current(),C.current);return ()=>{clearTimeout(W),C.current-=Date.now()-L;}},[r,c,d,e.revision]);let T=u?.open,D=L=>{L.onPress?.(),L.openFeature&&t.source(L.openFeature)?.open?.(),v.current();};return jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:T?()=>{T(),v.current();}:void 0,className:T?"idos-press":void 0,style:{...U,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:T?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${wt[i]}`,animation:`${d?"idos-drop-out":"idos-drop-in"} ${a.normal} ease both`},children:[o.image?jsx("img",{src:o.image,alt:"",style:{width:42,height:42,flex:"none",objectFit:"cover",borderRadius:10,border:`2px solid ${wt[i]}`}}):jsx(sn,{level:e.level,icon:o.icon,size:34}),jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[u?jsx(an,{source:u}):null,o.title?jsx("div",{style:{...x,fontSize:15,lineHeight:1.25},children:o.title}):null,o.message?jsx("div",{style:{fontSize:13.5,fontWeight:600,lineHeight:1.35,color:o.title?a.textDim:a.text,overflowWrap:"anywhere"},children:o.message}):null,l?jsx("div",{style:{marginTop:6},onClick:L=>L.stopPropagation(),children:jsx(z,{size:"sm",tone:i,onClick:()=>D(l),children:l.label})}):null]}),e.count>1?jsxs("span",{style:{...Ee(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",e.count]}):null,jsx("button",{type:"button","aria-label":k("close"),onClick:L=>{L.stopPropagation(),v.current();},style:ko,children:jsx(N,{glyph:"close",size:14})}),r>0?jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:wt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var ko={flex:"none",width:26,height:26,display:"grid",placeItems:"center",border:"none",borderRadius:"50%",background:a.wellSoft,color:a.textDim,cursor:"pointer",padding:0};function wo({store:t,alert:e,queued:n}){let o=useRef(null);return useEffect(()=>t.play(e.level),[t,e.level]),jsx(ne,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsx(So,{store:t,alert:e,queued:n,chosen:o})})}function So({store:t,alert:e,queued:n,chosen:o}){let i=te(),r=e.input,u=Oe[e.level],l=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:k("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&t.source(f.openFeature)?.open?.(),i();};return jsxs("div",{role:"alertdialog","aria-label":r.title??r.message??"",style:{display:"grid",gap:12,justifyItems:"center",textAlign:"center"},children:[n>0?jsxs("span",{style:{justifySelf:"start",fontSize:12,fontWeight:800,color:a.textDim},children:["+",n]}):null,r.image?jsx("img",{src:r.image,alt:"",style:{maxWidth:"100%",maxHeight:180,objectFit:"contain",borderRadius:14}}):jsx("div",{className:e.level==="reward"?"idos-bounce":void 0,children:jsx(sn,{level:e.level,icon:r.icon,size:64})}),l?jsx(an,{source:l}):null,r.title?jsx("div",{style:{...x,fontSize:21,fontFamily:a.font,lineHeight:1.2},children:r.title}):null,r.message?jsx("div",{style:{fontSize:15,fontWeight:600,lineHeight:1.45,color:r.title?a.textDim:a.text,whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:r.message}):null,jsx("div",{style:{display:"grid",gap:8,width:"100%",marginTop:4},children:d.map((f,y)=>f.primary||!p&&y===0?jsx(z,{tone:u,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:Ro,children:f.label},f.id??f.label))})]})}var Ro={width:"100%",minHeight:44,borderRadius:a.buttonRadius,border:`1px solid ${a.line}`,background:a.wellSoft,color:a.text,fontFamily:a.font,fontSize:15,fontWeight:800,cursor:"pointer"};function Mo(t){return jsx(No,{state:t})}function No({state:t}){return jsxs(Fragment,{children:[jsx(To,{}),jsx(Uo,{}),jsx(Do,{}),t.celebration?jsx(Po,{lines:t.celebration.lines,title:t.celebration.options?.title,sound:t.celebration.options?.sound,onDone:t.finishCelebration},t.celebration.lines.map(e=>e.id).join()):null,jsx(ln,{store:t.notifications})]})}var ze=560;function Po({lines:t,title:e,sound:n="reward",onDone:o}){let i=b(),r=O(),u=c(),l=useRef(new Map),d=useRef(false);useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(t,c=>l.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxs(ne,{title:e??k("youGot"),onClose:()=>{p(),o();},sound:false,variant:"center",width:420,children:[jsxs("div",{style:{position:"relative",overflow:"hidden",display:"flex",flexWrap:"wrap",gap:14,justifyContent:"center",padding:"22px 0"},children:[jsx("div",{"aria-hidden":"true",style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none",maskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)",WebkitMaskImage:"radial-gradient(closest-side, #000 35%, transparent 100%)"},children:jsx("div",{style:{position:"absolute",width:ze,height:ze,left:`calc(50% - ${ze/2}px)`,top:`calc(50% - ${ze/2}px)`,background:`repeating-conic-gradient(color-mix(in srgb, ${a.gold} 16%, transparent) 0 12deg, transparent 12deg 24deg)`,animation:i.motion.on?"idos-rays 14s linear infinite":"none",borderRadius:"50%"}})}),t.map((c,f)=>jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${le} ${i.motion.on?.12*f:0}s both`},children:[jsx("div",{ref:y=>{y&&l.current.set(`${c.kind}:${c.id}`,y);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsx(N,{glyph:c.kind==="token"?pe(c):r.iconOf(c),size:46})}),jsxs("div",{style:{...x,fontSize:16},children:["+",$(c.amount)]}),jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ue(c,r,u)})]},`${c.kind}:${c.id}`))]}),jsx(Lo,{onPress:p})]})}function Lo({onPress:t}){let e=te();return jsx(z,{attract:true,onClick:()=>{t(),e();},children:k("great")})}function To(){let t=fe(e=>e.flights);return jsx(Fragment,{children:t.map(e=>jsx(Eo,{flight:e},e.key))})}function Eo({flight:t}){let e=useRef(null),n=b(),o=O();return useLayoutEffect(()=>{let i=e.current;if(!i||typeof i.animate!="function"){n.fx.arrive(t.key);return}let r=t.to.x-t.from.x,u=t.to.y-t.from.y,l=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${l}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${u}px) scale(.55)`,opacity:1}],{duration:t.durationMs,delay:t.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(t.key),()=>{d.onfinish=null,d.cancel();}},[]),jsx("div",{ref:e,style:{position:"absolute",left:t.from.x-16,top:t.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsx(N,{glyph:o.iconOf(t.line),size:32})})}var un=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function Uo(){let t=fe(e=>e.bursts);return jsx(Fragment,{children:t.map(e=>jsx(Io,{x:e.at.x,y:e.at.y},e.key))})}function Io({x:t,y:e}){let n=useRef(null);return useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,u)=>{if(typeof r.animate!="function")return;let l=u/16*Math.PI*2+Math.random()*.3,d=50+Math.random()*60;i.push(r.animate([{transform:"translate(0,0) scale(1)",opacity:1},{transform:`translate(${Math.cos(l)*d}px, ${Math.sin(l)*d+20}px) scale(.2)`,opacity:0}],{duration:650+Math.random()*200,easing:"cubic-bezier(.1,.8,.3,1)",fill:"forwards"}));}),()=>i.forEach(r=>r.cancel())},[]),jsx("div",{ref:n,style:{position:"absolute",left:t,top:e,width:0,height:0,zIndex:61,pointerEvents:"none"},children:Array.from({length:16},(o,i)=>jsx("span",{style:{position:"absolute",left:-4,top:-4,width:8,height:8,borderRadius:i%3===0?2:"50%",background:un[i%un.length]}},i))})}function Do(){let t=c(),[e,n]=useState(false);return useEffect(()=>{if(!t)return;let o,i=t.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[t]),e?jsx("div",{role:"alert",style:{position:"absolute",top:"calc(8px + env(safe-area-inset-top))",left:"50%",transform:"translateX(-50%)",zIndex:45,padding:"6px 14px",borderRadius:999,background:a.red,...x,color:a.onRed,textShadow:a.onRedOutline,fontSize:13,pointerEvents:"none",animation:`idos-rise-in ${a.normal} ease both`},children:k("offline")}):null}var Mt=["economy","events","social","profile","other"];function pn(t){return [...t].sort((e,n)=>{let o=Mt.indexOf(e.group??"other")-Mt.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function Ao({items:t,onOpen:e}){let{play:n}=b(),o=ht(),i=lt(pn(t),u=>u.group??"other"),r=0;return jsx("div",{style:{display:"grid",gap:18},children:i.map(u=>jsxs("div",{children:[jsx(mt,{children:Mt.includes(u.key)?k(u.key):u.key}),jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:u.items.map(l=>jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${l.id}`,onClick:()=>{n("click"),e(l.id);},style:{...U,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsx(N,{glyph:l.icon??"box",size:40}),jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:l.label}),jsx(ye,{count:l.badge??0})]},l.id))})]},u.key))})}export{ye as Badge,z as Button,ro as Card,no as Center,po as ConfirmPopup,F as DEFAULT_PLAYER_PREFS,Lt as DEFAULT_UI_CONFIG,Yt as DESKTOP_MIN_PX,ue as EASE_IN,Y as EASE_OUT,le as EASE_POP,to as EmptyState,Ao as FeatureGrid,j as FxStore,jt as GLYPHS,N as Icon,he as IconButton,Zn as ItemTile,je as KIT_CSS,kt as KitPortal,Oe as LEVEL_TONE,Ce as NotificationStore,ee as ON_TONE,ne as Popup,eo as ProgressBar,nt as RARITY_ORDER,tn as ResourceBadge,gt as ResourceCounter,Jn as ResourceList,Re as SOUND_PRESETS,mt as SectionTitle,en as Spinner,Ht as TABLET_MIN_PX,We as TOAST_DURATION,io as Tabs,oo as Timer,Ke as UI_SOUND_EVENTS,On as UiKitProvider,ae as UiSoundEngine,mo as Window,ot as bundleLines,Zt as buttonStyle,qn as canAfford,me as configSection,_n as costLines,st as countdown,It as counterKeys,qe as createNotificationStore,ut as currencyGlyph,gn as defineUiConfig,_e as effectiveVolume,Gn as errorText,$ as formatAmount,Vt as grantLines,Wn as grantedBy,lt as groupBy,Ut as iconsFor,Qt as isGlyph,at as itemDefinitions,dt as itemGlyph,ge as layoutFor,Wt as makeT,qt as mergeLines,se as motionDurations,x as outlined,U as panel,Ge as parsePlayerPrefs,et as pickLanguage,Bn as plural,Vn as rarityRank,Mo as renderKitOverlays,Et as resolveSound,Se as resolveUiConfig,Ue as resourceName,He as screenBackground,uo as setAutoPopupsHeld,pn as sortFeatures,Ve as themeVars,pe as tokenGlyph,rt as tokenName,it as tokenParts,Ee as toneSurface,k as uiT,Jt as useAnimatedNumber,pt as useBalances,O as useCatalog,Dn as useCelebrate,ft as useCounterValue,Pe as useGameLayout,Qn as useLayout,Un as useMotion,$n as useNotify,Xn as useNow,In as usePlayerPrefs,te as usePopupClose,Le as usePresence,En as useSound,ht as useStagger,An as useToast,b as useUiKit,a as v,Ye as well};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idosgames/react",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Shared React glue for the iDosGames host shell and modules: the client provider, status provider, live-state hooks, and a controller-context factory. Extracted from what every template used to copy-paste. The /ui subpath is the interface kit every module is built from: popups and windows with animations, synthesized interface sounds, rewards that fly to their counters, and one config file for the whole game.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"//": "react/react-dom are peers (consumer-provided, never bundled). @idosgames/core is a real range for the same reason as in @idosgames/wallet — a published package must pin the core whose types it references.",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@idosgames/core": "^0.
|
|
53
|
+
"@idosgames/core": "^0.21.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"react": "^18.3.1 || ^19.0.0",
|