@idosgames/react 0.4.6 → 0.5.0

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/ui/index.cjs CHANGED
@@ -1,7 +1,8 @@
1
- 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var Ve=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function vn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Ut={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=Ut,n={...e.theme,...It(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},wn(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,...It(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 xn(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,l,u]=[...o].map(d=>parseInt(d+d,16));return [i,r,l,o.length===4?u/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 Dt(t){let e=xn(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 qe=t=>(Dt(t)??0)>.5,kn=t=>qe(t.text)?"#1d2233":t.text;function Y(t){let e=Dt(t);return e===null||e>.35?we:"none"}function wn(t,e){let n=l=>e[l]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[l,u]of o)!n(l)&&n(u)&&(t[l]=qe(t[u])?kn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=qe(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=Y(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 It(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function ae(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 z={muted:false,volume:1,reducedMotion:false};function He(t){if(!t)return {...z};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:_(Number(e.volume),0,1,z.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...z}}}function Ye(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 At(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:Ve.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 Sn={countTick:45,coin:60,click:30},le=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=Sn[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=At(e,this.config);if(i.kind==="none")return;let r=Ye(this.config,this.prefs,i.volume);if(r<=0)return;let l=this.context();l&&(i.kind==="synth"?this.playSynth(l,i.preset,r):this.playFile(l,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 l of n.notes??[]){let u=i+(l.at??0),d=u+Math.max(.01,l.dur),p=e.createOscillator();p.type=l.wave??"sine",p.frequency.setValueAtTime(l.freq,u),l.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,l.gain??.4);c.gain.setValueAtTime(1e-4,u),c.gain.exponentialRampToValueAtTime(f,u+Math.min(.012,l.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(u),p.stop(d+.02);}for(let l of n.noise??[]){let u=i+(l.at??0),d=Math.max(.01,l.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 m=e.createBiquadFilter();m.type="bandpass",m.Q.value=1.2,m.frequency.setValueAtTime(l.freq??3e3,u),l.slideTo&&m.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),u+d);let b=e.createGain();b.gain.setValueAtTime(Math.max(1e-4,l.gain??.15),u),b.gain.exponentialRampToValueAtTime(1e-4,u+d),f.connect(m).connect(b).connect(r),f.start(u),f.stop(u+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 l=e.createBufferSource();l.buffer=r;let u=e.createGain();u.gain.value=o,l.connect(u).connect(e.destination),l.start();}};var je={info:3500,success:3e3,reward:4500,warning:5500,error:6500},Cn={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(u=>u.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(u=>!u.input.key&&u.level===o&&u.input.title===n.title&&u.input.message===n.message));if(r){let u={...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),u],this.play(o),this.emit(),r.id}let l={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,l].slice(-3),this.play(o),this.emit(),l.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 l=this.waiting.get(i.id);this.waiting.set(i.id,u=>{l?.(u),r(u);});})}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?.(Cn[e]);}emit(){for(let e of [...this.listeners])e();}};function Qe(){return new Re}function Xe(t,e){let n=t.theme,o=ae(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":Y(n.onGreen),"--idos-ui-on-gold-outline":Y(n.onGold),"--idos-ui-on-blue-outline":Y(n.onBlue),"--idos-ui-on-red-outline":Y(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},Je=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Me={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},ue="cubic-bezier(.2, .9, .3, 1.25)",W="cubic-bezier(.2, .8, .2, 1)",de="cubic-bezier(.5, 0, .75, .2)",Ze=`
1
+ 'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime'),reactDom=require('react-dom');var je=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function Ln(e){return e}var Se="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Ft={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:Se,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:{}}},_=(e,t,n,o)=>typeof e=="number"&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):o;function Ce(e){let t=Ft,n={...t.theme,...Kt(e?.theme??{})};n.rarity={...t.theme.rarity,...e?.theme?.rarity??{}},Pn(n,e?.theme??{}),n.radius=_(n.radius,0,64,t.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,t.theme.buttonRadius);let o={...t.motion,...Kt(e?.motion??{})};o.speed=_(o.speed,.1,5,t.motion.speed),o.intensity=_(o.intensity,0,3,t.motion.intensity);let i=e?.sound??{},r={enabled:i.enabled??t.sound.enabled,volume:_(i.volume??t.sound.volume,0,1,t.sound.volume),events:{...t.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function Mn(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,l,u]=[...o].map(d=>parseInt(d+d,16));return [i,r,l,o.length===4?u/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(t),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 Gt(e){let t=Mn(e);if(!t)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(t[0])+.7152*n(t[1])+.0722*n(t[2])}var Ye=e=>(Gt(e)??0)>.5,Tn=e=>Ye(e.text)?"#1d2233":e.text;function j(e){let t=Gt(e);return t===null||t>.35?Se:"none"}function Pn(e,t){let n=l=>t[l]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[l,u]of o)!n(l)&&n(u)&&(e[l]=Ye(e[u])?Tn(e):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Ye(e.panel);i&&r&&!n("shadow")&&(e.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(e.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(e.panelShadow=r?`0 6px 18px ${e.shadow}, 0 1px 0 ${e.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${e.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(e.textOutline=j(e.text)),n("line")||(e.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(e.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(e.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(e.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(e.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(e.glow=`color-mix(in srgb, ${e.blue} ${r?18:30}%, transparent)`));}function Kt(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function le(e,t){if(!e.enabled||t)return {fast:0,normal:0,slow:0};let n=1/e.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var z={muted:false,volume:1,reducedMotion:false};function Qe(e){if(!e)return {...z};try{let t=JSON.parse(e);return {muted:t.muted===!0,volume:_(Number(t.volume),0,1,z.volume),reducedMotion:t.reducedMotion===!0}}catch{return {...z}}}function Xe(e,t,n=1){return !e.enabled||t.muted?0:_(e.volume*t.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 _t(e,t){let n=t.events[e];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Re[e],volume:1}:typeof n=="string"?{kind:"synth",preset:je.includes(n)?Re[n]:Re[e],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var En={countTick:45,coin:60,click:30},ue=class{constructor(t,n){this.config=t;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(t,n){this.config=t,this.prefs=n;}attach(t=typeof window<"u"?window:void 0){if(!t||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)t.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)t.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(t){if(!this.unlocked)return;let n=En[t],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(t)??-1/0)<n)return;this.lastPlayed.set(t,o);let i=_t(t,this.config);if(i.kind==="none")return;let r=Xe(this.config,this.prefs,i.volume);if(r<=0)return;let l=this.context();l&&(i.kind==="synth"?this.playSynth(l,i.preset,r):this.playFile(l,i.url,r));}context(){if(this.ctx)return this.ctx;let t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;try{this.ctx=new t;}catch{return null}return this.ctx}playSynth(t,n,o){let i=t.currentTime+.005,r=t.createGain();r.gain.value=o,r.connect(t.destination);for(let l of n.notes??[]){let u=i+(l.at??0),d=u+Math.max(.01,l.dur),p=t.createOscillator();p.type=l.wave??"sine",p.frequency.setValueAtTime(l.freq,u),l.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),d);let c=t.createGain(),f=Math.max(1e-4,l.gain??.4);c.gain.setValueAtTime(1e-4,u),c.gain.exponentialRampToValueAtTime(f,u+Math.min(.012,l.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(u),p.stop(d+.02);}for(let l of n.noise??[]){let u=i+(l.at??0),d=Math.max(.01,l.dur),p=t.createBuffer(1,Math.ceil(t.sampleRate*d),t.sampleRate),c=p.getChannelData(0);for(let C=0;C<c.length;C++)c[C]=Math.random()*2-1;let f=t.createBufferSource();f.buffer=p;let g=t.createBiquadFilter();g.type="bandpass",g.Q.value=1.2,g.frequency.setValueAtTime(l.freq??3e3,u),l.slideTo&&g.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),u+d);let v=t.createGain();v.gain.setValueAtTime(Math.max(1e-4,l.gain??.15),u),v.gain.exponentialRampToValueAtTime(1e-4,u+d),f.connect(g).connect(v).connect(r),f.start(u),f.stop(u+d+.02);}}async playFile(t,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=>t.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let l=t.createBufferSource();l.buffer=r;let u=t.createGain();u.gain.value=o,l.connect(u).connect(t.destination),l.start();}};var Je={info:3500,success:3e3,reward:4500,warning:5500,error:6500},Un={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Ne=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=t=>(this.listeners.add(t),()=>this.listeners.delete(t));setPlayer(t){this.player=t;}setSourceResolver(t){this.resolver=t,this.emit();}source(t){if(!t)return null;try{return this.resolver?.(t)??null}catch{return null}}toast(t){let n=typeof t=="string"?{message:t}:t,o=n.level??"info",i=n.key?this.toastList.find(u=>u.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(u=>!u.input.key&&u.level===o&&u.input.title===n.title&&u.input.message===n.message));if(r){let u={...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),u],this.play(o),this.emit(),r.id}let l={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,l].slice(-3),this.play(o),this.emit(),l.id}alert(t){let n=t.level??"info";if(t.key){let i=this.alertQueue.find(r=>r.input.key===t.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:t,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let l=this.waiting.get(i.id);this.waiting.set(i.id,u=>{l?.(u),r(u);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:t,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(t,n=null){if(this.toastList.some(r=>r.id===t)){this.toastList=this.toastList.filter(r=>r.id!==t),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==t),this.alertQueue.length===o)return;let i=this.waiting.get(t);this.waiting.delete(t),i?.(n),this.emit();}clear(){for(let t of this.waiting.values())t(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(t){this.player?.(Un[t]);}emit(){for(let t of [...this.listeners])t();}};function Ze(){return new Ne}function et(e,t){let n=e.theme,o=le(e.motion,t),i=e.motion.enabled&&!t;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":j(n.onGreen),"--idos-ui-on-gold-outline":j(n.onGold),"--idos-ui-on-blue-outline":j(n.onBlue),"--idos-ui-on-red-outline":j(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?e.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},I={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},tt=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Le={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},de="cubic-bezier(.2, .9, .3, 1.25)",W="cubic-bezier(.2, .8, .2, 1)",ce="cubic-bezier(.5, 0, .75, .2)",nt=`
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 } }
5
+ .idos-select option { background: var(--idos-ui-panel-deep); color: var(--idos-ui-text) }
5
6
  @keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }
6
7
  @keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }
7
8
  @keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }
@@ -35,4 +36,4 @@
35
36
  .idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }
36
37
  .idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }
37
38
  [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 $t(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function Ot(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 l of e){let u=Ot(l).map(m=>({key:m,el:document.querySelector(`[data-resource-counter="${Bt(m)}"]`)})).find(m=>m.el&&Mn(m.el));if(!u?.el)continue;let d=et(u.el.getBoundingClientRect(),o),p=n(l),c=p?et(p,o):{x:o.width/2,y:o.height/2},f=$t(l.amount);for(let m=0;m<f;m++)r.push({key:this.nextKey++,line:l,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:m*55,durationMs:i,target:u.key}),this.holds.set(u.key,(this.holds.get(u.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),Nn(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=et(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 et(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function Mn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function Nn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${Bt(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function Bt(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var zt=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",Ft="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function Kt(t){if(!(t instanceof HTMLElement)||t.hasAttribute(Ft))return;t.setAttribute(Ft,"");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 tt(t){t instanceof Element&&(t.matches(zt)&&Kt(t),t.querySelectorAll(zt).forEach(Kt));}function Gt(t){if(typeof MutationObserver>"u")return ()=>{};tt(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?tt(o.target):o.addedNodes.forEach(tt);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Wt="idos-ui-prefs";function In(){try{return He(typeof localStorage<"u"?localStorage.getItem(Wt):null)}catch{return {...z}}}function Un(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function qt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&Un(),o=t.motion.enabled&&!n;return {on:o,durations:ae(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 _t=Se(null),Dn=new j,An={config:_t,prefs:z,setPrefs:()=>{},motion:qt(_t,z),play:()=>{},layer:null,fx:Dn,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Vt=react.createContext(An);function k(){return react.useContext(Vt)}function $n(){return k().play}function On(){return k().motion}function Bn(){let t=k();return [t.prefs,t.setPrefs]}function zn(){return k().celebrate}function Fn(){return k().toast}function Kn(){return k().notify}function Gn({config:t,children:e,overlays:n,notifications:o}){let i=react.useMemo(()=>Se(t),[t]),[r,l]=react.useState(In),u=react.useCallback(S=>{l(H=>{let Et={...H,...S};try{localStorage.setItem(Wt,JSON.stringify(Et));}catch{}return Et});},[]),d=react.useRef(null);d.current??=new le(i.sound,r),react.useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),react.useEffect(()=>{let S=d.current;return S?.attach(),()=>S?.dispose()},[]);let p=react.useCallback(S=>d.current?.play(S),[]),c=react.useMemo(()=>qt(i,r),[i,r]),f=react.useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[m,b]=react.useState(null);react.useEffect(()=>f.setLayer(m),[f,m]);let[C,P]=react.useState(null),D=react.useRef(C);D.current=C;let E=react.useCallback((S,H)=>{if(S.length===0){H?.onDone?.();return}f.reserve(S),P({lines:S,options:H});},[f]),q=react.useCallback(()=>{let S=D.current;S&&f.release(S.lines),P(null),S?.options?.onDone?.();},[f]),ke=react.useRef(null),L=o??(ke.current??=Qe());react.useEffect(()=>(L.setPlayer(p),()=>L.setPlayer(null)),[L,p]);let V=react.useMemo(()=>({toast:S=>L.toast(S),alert:S=>L.alert(S),dismiss:S=>L.dismiss(S)}),[L]),I=react.useCallback((S,H="info")=>{L.toast({message:S,level:H});},[L]),re=react.useMemo(()=>({config:i,prefs:r,setPrefs:u,motion:c,play:p,layer:m,fx:f,celebrate:E,toast:I,notify:V,provided:true}),[i,r,u,c,p,m,f,E,I,V]),se=react.useRef(null);react.useEffect(()=>se.current?Gt(se.current):void 0,[]);let G=!c.on;return jsxRuntime.jsx(Vt.Provider,{value:re,children:jsxRuntime.jsxs("div",{ref:se,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...Xe(i,G)},children:[jsxRuntime.jsx("style",{children:Ze}),e,jsxRuntime.jsx("div",{ref:b,"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:q,notifications:L})})]})})}function pe(t){let{fx:e}=k();return react.useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var Ht=typeof window<"u"?react.useLayoutEffect:react.useEffect;var Vn=react.createContext(null);function O(){return react.useContext(Vn)}function it(){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 Yt(t,e,n=it()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function Hn(t,e,n=it()){let[o,i=o,r=i]=e.split("|"),l=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?l==="one"?o:l==="few"?i:r:l==="one"?o:i}var Yn={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",dailyLimitReached:"Today's reward limit is reached \u2014 come back tomorrow",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",cryptoTotal:"Balance",cryptoBacked:"Crypto",cryptoUnbacked:"IOU (not backed yet)",cryptoIouHint:"IOUs spend in the app like crypto; the developer backs them with real crypto later."},jn={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",dailyLimitReached:"\u0421\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u043B\u0438\u043C\u0438\u0442 \u043D\u0430\u0433\u0440\u0430\u0434 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D \u2014 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430",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",cryptoTotal:"\u0411\u0430\u043B\u0430\u043D\u0441",cryptoBacked:"\u041A\u0440\u0438\u043F\u0442\u0430",cryptoUnbacked:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 (\u043F\u043E\u043A\u0430 \u043D\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u044B)",cryptoIouHint:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 \u0442\u0440\u0430\u0442\u044F\u0442\u0441\u044F \u0432 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u043A\u0430\u043A \u043A\u0440\u0438\u043F\u0442\u0430; \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u043F\u043E\u0437\u0436\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0442 \u0438\u0445 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u0440\u0438\u043F\u0442\u043E\u0439."},w=Yt(Yn,jn);function Qn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?w("notEnough"):/CRYPTO_SERVER_GRANT_CAP_EXCEEDED/.test(t)?w("dailyLimitReached"):t.length>140?`${t.slice(0,140)}\u2026`:t:w("error")}function at(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;if(n.Type==="CryptoCurrency"&&n.CurrencyID&&n.AmountUsd!=null){let i=Number(n.AmountUsd);Number.isFinite(i)&&i>0&&e.push({kind:"crypto",id:n.CurrencyID,amount:i,usd:true});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==="CryptoCurrency"&&n.CurrencyID?e.push({kind:"crypto",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 jt(e)}function lt(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 me(t){switch(lt(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function ut(t,e){let{system:n,entity:o}=lt(t);return n==="TimedEvent"?(e?J(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||w("tokenEvent"):n==="Season"?w("tokenSeason"):n==="Quest"?w("tokenQuest"):n==="Leaderboard"?w("tokenScore"):t.id}function jt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}${n.usd?":usd":""}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function Qt(t){return at(t?.Standard)}function Xn(t){return at(t?.Standard)}function Jn(t){let e=t?.Resources?.Grant;return Qt(e)}function Zn(t,e,n){return t.every(o=>o.kind==="currency"?Number(e?.[o.id]?.Amount??0)>=o.amount:o.kind==="crypto"&&n&&!o.usd?Number(n[o.id]?.Amount??0)>=o.amount:true)}function Le(t){return t.usd?`$${eo(t.amount)}`:F(t.amount)}function eo(t){return t.toFixed(2).replace(/\.00$/,"")}function F(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${rt(t/1e9)}B`:e>=1e6?`${rt(t/1e6)}M`:e>=1e5?`${rt(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function dt(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);if(e>=1e5)return F(t);let n=e>=100?1:e>=1?2:4;return t.toLocaleString("en-US",{maximumFractionDigits:n}).replace(/,/g," ")}function rt(t){return t.toFixed(2).replace(/\.?0+$/,"")}function ct(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),l=Math.floor(i%3600/60),u=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(l).padStart(2,"0")}m`:`${l}m ${String(u).padStart(2,"0")}s`}var Xt=640,Jt=1024;function ge(t){return t>=Jt?"desktop":t>=Xt?"tablet":"phone"}function J(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function ft(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 st=["Legendary","Epic","Rare","Uncommon","Common"];function to(t){let e=st.indexOf(t??"");return e<0?st.length:e}function pt(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}))}function mt(t,e){return e?.[t]?.UnbackedRewardCurrencyID||`${t}_IOU`}function gt(t,e,n){let o=Number(t?.InventoryV2?.CryptoCurrencies?.[e]?.Amount??0)||0,i=mt(e,n),r=t?.InventoryV2?.VirtualCurrencies?.[i],l=r&&Number(r.Amount??0)||0;return {currencyID:e,backed:o,unbacked:l,total:o+l,iouID:r?i:null}}function no(t){return new Set(Object.keys(t??{}).map(e=>mt(e,t)))}var Zt=["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 en(t){return Zt.includes(t)}function Te(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function yt(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 oo=/^(https?:|\/|data:)/;function M({glyph:t,size:e=24,color:n}){return en(t)?jsxRuntime.jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:io(t,n)}):oo.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 io(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 so(t){let[e,n]=react.useState("phone");return Ht(()=>{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 Ie(){let{layer:t}=k(),e=react.useRef(null);e.current=t;let[n,o]=react.useState(()=>t?ge(t.getBoundingClientRect().width):"phone");return react.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 Ue(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 l=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(l)},[t,e,n]),{mounted:n,closing:i}}function nn(t,e=600,n){let[o,i]=react.useState(t),r=react.useRef(t),l=react.useRef(n);return l.current=n,react.useEffect(()=>{let u=r.current;if(u===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let m=Math.min(1,(f-d)/e),b=1-Math.pow(1-m,3),C=m>=1?t:Math.round(u+(t-u)*b);C!==r.current&&l.current?.(),r.current=C,i(C),m<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function De(t,e){let n=k(),o=pe(l=>l.holding(t)>0),i=react.useRef(e);o||(i.current=e);let r=o?i.current:e;return nn(r,n.motion.on?650:0,()=>n.play("countTick"))}function A(){let t=O(),e=k(),[,n]=react.useReducer(d=>d+1,0);react.useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=react.useMemo(()=>t&&o?ft(J(t,"Item")):new Map,[t,o]),r=react.useMemo(()=>t&&o?J(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),l=react.useMemo(()=>t&&o?J(t,"Currency")?.CryptoCurrencies??{}:{},[t,o]),u=react.useCallback(d=>d?t?.localization.has(d)?t.localization.t(d):d:"",[t]);return react.useMemo(()=>({items:i,currencies:r,cryptoCurrencies:l,localize:u,currencyName:d=>u(r[d]?.DisplayName||l[d]?.DisplayName||d),itemName:d=>u(i.get(d)?.DisplayName||d),iconOf:d=>{if(d.kind==="currency")return r[d.id]?.ImagePath||Te(d.id);if(d.kind==="crypto"){let p=l[d.id]?.AssetPaths;return p?.Default||p?.Icon||Te(d.id)}if(d.kind==="item"){let p=i.get(d.id);return p?.ImagePath||yt(p?.Tags,p?.ItemClass)}return "box"},rarityColor:d=>e.config.theme.rarity[d??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,l,u,e.config.theme.rarity])}function ht(){let t=O(),e=A(),[,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,l])=>[r,Number(l?.Amount??0)]).sort(([r],[l])=>r.localeCompare(l))}function ao(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 Ae={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},te={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 $e(t){let[e,n]=Ae[t],o=te[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 on(t,e=false,n="md"){let[o,i]=Ae[e?"grey":t],r=te[e?"grey":t],l=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:l,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 B({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:l=false,style:u,className:d="",sound:p="click",title:c,...f}){let{play:m}=k();return jsxRuntime.jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${l&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:b=>{p&&m(p),e?.(b);},style:{...on(n,i,o),...u},children:r?jsxRuntime.jsx(rn,{size:18}):t})}function ye({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:l}){let{play:u}=k();return jsxRuntime.jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{u("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Ae[i][0]}, ${Ae[i][1]})`:a.well,color:i?te[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsxRuntime.jsx(M,{glyph:t,size:o*.55}),l?jsxRuntime.jsx(he,{count:l}):null]})}function rn({size:t=28}){return jsxRuntime.jsx("span",{"aria-label":w("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 he({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,...te.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function sn({line:t,size:e=20,big:n=false,dim:o=false}){let i=A(),r=O();return jsxRuntime.jsxs("span",{title:Oe(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(M,{glyph:t.kind==="token"?me(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:Le(t)]})}function Oe(t,e,n){return t.kind==="currency"||t.kind==="crypto"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(ut(t,n)):t.id}function uo({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(sn,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function bt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=A(),r=De(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,...Me,cursor:o?"pointer":"default"},children:[jsxRuntime.jsx(M,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:F(r)})]})}function co({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:l=false}){let u=A(),{play:d}=k(),p=u.items.get(t),c=u.rarityColor(p?.Metadata?.RarityID);return jsxRuntime.jsxs("button",{type:"button",className:"idos-press",title:u.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:l?.45:1,flex:"none"},children:[jsxRuntime.jsx(M,{glyph:u.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",F(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 fo({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)),[l,u]=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, ${l}, ${u})`,borderRadius:i/2,transition:`width ${a.slow} ${W}`}}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${F(t)} / ${F(e)}`})]})}function vt({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 po({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(M,{glyph:t,size:56}),jsxRuntime.jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function mo({children:t,minHeight:e=240}){return jsxRuntime.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function go({at:t,now:e,label:n}){let o=ct(t,e);return o?jsxRuntime.jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function yo({tabs:t,value:e,onChange:n,style:o}){let{play:i}=k();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 l=r.id===e;return jsxRuntime.jsxs("button",{role:"tab","aria-selected":l,type:"button",className:"idos-press",onClick:()=>{l||(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:l?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:l?`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(M,{glyph:r.glyph,size:20}):null,jsxRuntime.jsx("span",{style:{...x,...l?te.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsxRuntime.jsx(he,{count:r.badge}):null]},r.id)})})}function xt(){let{motion:t}=k();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function ho({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=k();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 an={...U,padding:"12px 14px",fontSize:15,color:a.text,fontFamily:a.font,outline:"none",boxSizing:"border-box"};function bo({style:t,...e}){return jsxRuntime.jsx("input",{...e,style:{...an,...t}})}function vo({style:t,...e}){return jsxRuntime.jsx("textarea",{...e,style:{...an,resize:"vertical",...t}})}function xo({label:t,children:e}){return jsxRuntime.jsxs("div",{style:{display:"grid",gap:6},children:[jsxRuntime.jsx("div",{style:{...x,fontSize:13,color:a.textDim},children:t}),e]})}function ko({currencyID:t,size:e=24,align:n="left"}){let o=O(),i=A(),[r,l]=react.useState(false),u=gt(o?.data.user.state,t,i.cryptoCurrencies),d=De(`crypto:${t}`,u.total),p=i.cryptoCurrencies[t]?.DisplayDecimals??4,c=b=>b.toLocaleString("en-US",{maximumFractionDigits:Math.max(0,p)}).replace(/,/g," "),f=i.currencyName(t),m=(b,C,P=false)=>jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx("span",{style:{...x,fontSize:13,color:a.textDim},children:b}),jsxRuntime.jsx("span",{style:{...x,fontSize:14,color:P?a.textDim:a.text},children:C})]});return jsxRuntime.jsxs("div",{"data-resource-counter":`crypto:${t}`,style:{position:"relative",display:"inline-flex"},onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxRuntime.jsxs("button",{type:"button","aria-label":f,"aria-expanded":r,onClick:()=>l(b=>!b),onBlur:()=>l(false),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Me,cursor:"pointer",font:"inherit"},children:[jsxRuntime.jsx(M,{glyph:i.iconOf({kind:"crypto",id:t,amount:0}),size:e}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:dt(d)}),u.unbacked>0?jsxRuntime.jsx("span",{"aria-hidden":true,style:{width:6,height:6,borderRadius:"50%",background:a.gold}}):null]}),r?jsxRuntime.jsxs("div",{role:"tooltip",style:{...U,position:"absolute",top:"calc(100% + 8px)",[n]:0,zIndex:30,minWidth:220,maxWidth:280,padding:"10px 12px",display:"grid",gap:6,animation:`idos-drop-in ${a.fast} ${W} both`},children:[jsxRuntime.jsx("span",{style:{...x,fontSize:15},children:f}),m(w("cryptoBacked"),c(u.backed)),u.iouID?m(w("cryptoUnbacked"),c(u.unbacked),u.unbacked===0):null,jsxRuntime.jsx("div",{style:{height:1,background:a.line}}),m(w("cryptoTotal"),c(u.total)),u.iouID?jsxRuntime.jsx("span",{style:{fontSize:12,color:a.textDim,lineHeight:1.35},children:w("cryptoIouHint")}):null]}):null]})}var Ct=react.createContext(()=>{});function ne(){return react.useContext(Ct)}function Rt({children:t}){let{layer:e}=k();return e?reactDom.createPortal(t,e):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}var Be=[],kt=new Set,wt=0,St=false,Fe=()=>{for(let t of [...kt])t();};function Ro(t){St!==t&&(St=t,Fe());}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}Be.push(e);let i=()=>n(r=>r+1);return kt.add(i),i(),()=>{let r=Be.indexOf(e);r>=0&&Be.splice(r,1),kt.delete(i),Fe();}},[t,e]),t?(!o.current&&Be[0]===e&&wt===0&&!St&&(o.current=true),o.current):true}function No(t){react.useEffect(()=>{if(t)return wt+=1,Fe(),()=>{wt-=1,Fe();}},[t]);}function oe({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:l=true,sound:u=true,panelStyle:d,queued:p=false}){let c=k(),f=Ie(),m=c.motion.durations.normal,[b,C]=react.useState(false),P=Mo(p&&n);No(!p&&n);let{mounted:D,closing:E}=Ue(n&&P&&!b,m),q=react.useRef(e);q.current=e;let ke=react.useRef(false);react.useEffect(()=>{!u||!n||!P||ke.current||(ke.current=true,c.play("open"));},[u,n,P,c]);let L=react.useCallback(()=>{b||(c.play("close"),C(true));},[b,c]);react.useEffect(()=>{b&&!D&&q.current?.();},[b,D]);let V=l&&e!==void 0;if(react.useEffect(()=>{if(!V||!D)return;let G=S=>{S.key==="Escape"&&L();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[V,D,L]),!D)return null;let I=r==="sheet"||r==="auto"&&f==="phone",re=E,se=I?re?`idos-sheet-out ${a.normal} ${de} both`:`idos-sheet-in ${a.slow} ${W} both`:re?`idos-pop-out ${a.normal} ${de} both`:`idos-pop-in ${a.slow} ${ue} both`;return jsxRuntime.jsx(Rt,{children:jsxRuntime.jsx(Ct.Provider,{value:L,children:jsxRuntime.jsx("div",{role:"dialog","aria-modal":"true",onClick:V?L:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:I?"end stretch":"center",padding:I?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${re?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxRuntime.jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...U,width:I?"100%":`min(${i}px, 100%)`,maxHeight:I?"88%":"min(86vh, 100%)",overflowY:"auto",padding:I?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:I?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:se,...d},children:[I?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(ye,{glyph:"close",label:w("close"),onClick:L,size:36,tone:"red",style:{position:"absolute",top:I?12:8,right:I?12:8,border:"3px solid #fff"}}):null,t]})})})})}function Lo({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxRuntime.jsxs(oe,{title:t,onClose:r,width:380,children:[e,jsxRuntime.jsx(To,{confirmLabel:n,tone:o,onConfirm:i})]})}function To({confirmLabel:t,tone:e,onConfirm:n}){let o=ne(),[i,r]=react.useState(false);return jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsxRuntime.jsx(B,{tone:"grey",onClick:o,children:w("cancel")}),jsxRuntime.jsx(B,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(l=>{r(false),l!==true&&o();});},children:t??w("confirm")})]})}function Po({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:l=true}){let u=k(),[d,p]=react.useState(false),{mounted:c,closing:f}=Ue(i&&!d,u.motion.durations.normal),m=react.useRef(n);m.current=n,react.useEffect(()=>{u.play("open");},[]),react.useEffect(()=>{d&&!c&&m.current();},[d,c]);let b=react.useCallback(()=>{u.play("close"),p(true);},[u]);return react.useEffect(()=>{if(!c)return;let C=P=>{P.key==="Escape"&&b();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,b]),c?jsxRuntime.jsx(Rt,{children:jsxRuntime.jsx(Ct.Provider,{value:b,children:jsxRuntime.jsxs("div",{style:{position:u.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:Je,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?de:W} 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(ye,{glyph:"back",label:w("back"),onClick:b,size:38}):null,e?jsxRuntime.jsx(M,{glyph:e,size:30}):null,jsxRuntime.jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),l?jsxRuntime.jsx(Eo,{}):null,r?null:jsxRuntime.jsx(ye,{glyph:"close",label:w("close"),onClick:b,size:38,tone:"red"})]}),jsxRuntime.jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function Eo(){let t=ht(),e=Ie(),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(bt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var Ge={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},Mt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function Uo({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 cn({level:t,icon:e,size:n}){return jsxRuntime.jsx("span",{style:{...$e(Ge[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(M,{glyph:e,size:n*.62}):jsxRuntime.jsx(Uo,{level:t,size:n*.56})})}function fn({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(M,{glyph:t.icon,size:14}):null,jsxRuntime.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function Do(t){return react.useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),react.useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function pn({store:t}){Do(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(Ao,{store:t,toast:n},n.id))}),e?jsxRuntime.jsx(Oo,{store:t,alert:e,queued:t.queued},e.id):null]})}function Ao({store:t,toast:e}){let n=k(),o=e.input,i=Ge[e.level],r=o.duration??je[e.level],l=t.source(o.source),u=o.actions?.[0],[d,p]=react.useState(false),[c,f]=react.useState(false),m=n.motion.durations.normal,b=react.useRef(()=>{});b.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),m));};let C=react.useRef(r);react.useEffect(()=>{C.current=r;},[r,e.revision]),react.useEffect(()=>{if(r<=0||c||d)return;let E=Date.now(),q=setTimeout(()=>b.current(),C.current);return ()=>{clearTimeout(q),C.current-=Date.now()-E;}},[r,c,d,e.revision]);let P=l?.open,D=E=>{E.onPress?.(),E.openFeature&&t.source(E.openFeature)?.open?.(),b.current();};return jsxRuntime.jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:P?()=>{P(),b.current();}:void 0,className:P?"idos-press":void 0,style:{...U,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:P?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${Mt[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 ${Mt[i]}`}}):jsxRuntime.jsx(cn,{level:e.level,icon:o.icon,size:34}),jsxRuntime.jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[l?jsxRuntime.jsx(fn,{source:l}):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,u?jsxRuntime.jsx("div",{style:{marginTop:6},onClick:E=>E.stopPropagation(),children:jsxRuntime.jsx(B,{size:"sm",tone:i,onClick:()=>D(u),children:u.label})}):null]}),e.count>1?jsxRuntime.jsxs("span",{style:{...$e(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":w("close"),onClick:E=>{E.stopPropagation(),b.current();},style:$o,children:jsxRuntime.jsx(M,{glyph:"close",size:14})}),r>0?jsxRuntime.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:Mt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var $o={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 Oo({store:t,alert:e,queued:n}){let o=react.useRef(null);return react.useEffect(()=>t.play(e.level),[t,e.level]),jsxRuntime.jsx(oe,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsxRuntime.jsx(Bo,{store:t,alert:e,queued:n,chosen:o})})}function Bo({store:t,alert:e,queued:n,chosen:o}){let i=ne(),r=e.input,l=Ge[e.level],u=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:w("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(cn,{level:e.level,icon:r.icon,size:64})}),u?jsxRuntime.jsx(fn,{source:u}):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,m)=>f.primary||!p&&m===0?jsxRuntime.jsx(B,{tone:l,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:zo,children:f.label},f.id??f.label))})]})}var zo={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 Ko(t){return jsxRuntime.jsx(Go,{state:t})}function Go({state:t}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(qo,{}),jsxRuntime.jsx(Ho,{}),jsxRuntime.jsx(jo,{}),t.celebration?jsxRuntime.jsx(_o,{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(pn,{store:t.notifications})]})}var _e=560;function _o({lines:t,title:e,sound:n="reward",onDone:o}){let i=k(),r=A(),l=O(),u=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=>u.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxRuntime.jsxs(oe,{title:e??w("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:_e,height:_e,left:`calc(50% - ${_e/2}px)`,top:`calc(50% - ${_e/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} ${ue} ${i.motion.on?.12*f:0}s both`},children:[jsxRuntime.jsx("div",{ref:m=>{m&&u.current.set(`${c.kind}:${c.id}`,m);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsxRuntime.jsx(M,{glyph:c.kind==="token"?me(c):r.iconOf(c),size:46})}),jsxRuntime.jsxs("div",{style:{...x,fontSize:16},children:["+",Le(c)]}),jsxRuntime.jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Oe(c,r,l)})]},`${c.kind}:${c.id}`))]}),jsxRuntime.jsx(Wo,{onPress:p})]})}function Wo({onPress:t}){let e=ne();return jsxRuntime.jsx(B,{attract:true,onClick:()=>{t(),e();},children:w("great")})}function qo(){let t=pe(e=>e.flights);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx(Vo,{flight:e},e.key))})}function Vo({flight:t}){let e=react.useRef(null),n=k(),o=A();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,l=t.to.y-t.from.y,u=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${u}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${l}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(M,{glyph:o.iconOf(t.line),size:32})})}var mn=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function Ho(){let t=pe(e=>e.bursts);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.map(e=>jsxRuntime.jsx(Yo,{x:e.at.x,y:e.at.y},e.key))})}function Yo({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,l)=>{if(typeof r.animate!="function")return;let u=l/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(u)*d}px, ${Math.sin(u)*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:mn[i%mn.length]}},i))})}function jo(){let t=O(),[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:w("offline")}):null}var Pt=["economy","events","social","profile","other"];function bn(t){return [...t].sort((e,n)=>{let o=Pt.indexOf(e.group??"other")-Pt.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function Qo({items:t,onOpen:e}){let{play:n}=k(),o=xt(),i=pt(bn(t),l=>l.group??"other"),r=0;return jsxRuntime.jsx("div",{style:{display:"grid",gap:18},children:i.map(l=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(vt,{children:Pt.includes(l.key)?w(l.key):l.key}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:l.items.map(u=>jsxRuntime.jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${u.id}`,onClick:()=>{n("click"),e(u.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(M,{glyph:u.icon??"box",size:40}),jsxRuntime.jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:u.label}),jsxRuntime.jsx(he,{count:u.badge??0})]},u.id))})]},l.key))})}exports.Badge=he;exports.Button=B;exports.Card=ho;exports.Center=mo;exports.ConfirmPopup=Lo;exports.CryptoBalanceChip=ko;exports.DEFAULT_PLAYER_PREFS=z;exports.DEFAULT_UI_CONFIG=Ut;exports.DESKTOP_MIN_PX=Jt;exports.EASE_IN=de;exports.EASE_OUT=W;exports.EASE_POP=ue;exports.EmptyState=po;exports.FeatureGrid=Qo;exports.Field=xo;exports.FxStore=j;exports.GLYPHS=Zt;exports.Icon=M;exports.IconButton=ye;exports.ItemTile=co;exports.KIT_CSS=Ze;exports.KitPortal=Rt;exports.LEVEL_TONE=Ge;exports.NotificationStore=Re;exports.ON_TONE=te;exports.Popup=oe;exports.ProgressBar=fo;exports.RARITY_ORDER=st;exports.ResourceBadge=sn;exports.ResourceCounter=bt;exports.ResourceList=uo;exports.SOUND_PRESETS=Ce;exports.SectionTitle=vt;exports.Spinner=rn;exports.TABLET_MIN_PX=Xt;exports.TOAST_DURATION=je;exports.Tabs=yo;exports.TextArea=vo;exports.TextInput=bo;exports.Timer=go;exports.UI_SOUND_EVENTS=Ve;exports.UiKitProvider=Gn;exports.UiSoundEngine=le;exports.Window=Po;exports.bundleLines=at;exports.buttonStyle=on;exports.canAfford=Zn;exports.configSection=J;exports.costLines=Xn;exports.countdown=ct;exports.counterKeys=Ot;exports.createNotificationStore=Qe;exports.cryptoBalance=gt;exports.currencyGlyph=Te;exports.defineUiConfig=vn;exports.effectiveVolume=Ye;exports.errorText=Qn;exports.formatAmount=F;exports.formatCryptoAmount=dt;exports.grantLines=Qt;exports.grantedBy=Jn;exports.groupBy=pt;exports.iconsFor=$t;exports.iouCurrencies=no;exports.iouCurrencyOf=mt;exports.isGlyph=en;exports.itemDefinitions=ft;exports.itemGlyph=yt;exports.layoutFor=ge;exports.makeT=Yt;exports.mergeLines=jt;exports.motionDurations=ae;exports.outlined=x;exports.panel=U;exports.parsePlayerPrefs=He;exports.pickLanguage=it;exports.plural=Hn;exports.rarityRank=to;exports.renderKitOverlays=Ko;exports.resolveSound=At;exports.resolveUiConfig=Se;exports.resourceName=Oe;exports.screenBackground=Je;exports.setAutoPopupsHeld=Ro;exports.sortFeatures=bn;exports.themeVars=Xe;exports.tokenGlyph=me;exports.tokenName=ut;exports.tokenParts=lt;exports.toneSurface=$e;exports.uiT=w;exports.useAnimatedNumber=nn;exports.useBalances=ht;exports.useCatalog=A;exports.useCelebrate=zn;exports.useCounterValue=De;exports.useGameLayout=Ie;exports.useLayout=so;exports.useMotion=On;exports.useNotify=Kn;exports.useNow=ao;exports.usePlayerPrefs=Bn;exports.usePopupClose=ne;exports.usePresence=Ue;exports.useSound=$n;exports.useStagger=xt;exports.useToast=Fn;exports.useUiKit=k;exports.v=a;exports.well=Me;
39
+ `;function Wt(e){return !Number.isFinite(e)||e<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(e+1))))}function qt(e){return e.kind==="currency"?[e.id]:e.kind==="item"?[`item:${e.id}`,"inventory"]:[]}var Q=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));setMotion(t){this.motion=t;}setPlayer(t){this.player=t;}setLayer(t){this.layerEl=t;}holding(t){return (this.holds.get(t)??0)+(this.reserved.get(t)??0)}reserve(t){if(this.motion?.rewardFlight){for(let n of t)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(t){let n=false;for(let o of t){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(t,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 l of t){let u=qt(l).map(g=>({key:g,el:document.querySelector(`[data-resource-counter="${Vt(g)}"]`)})).find(g=>g.el&&Dn(g.el));if(!u?.el)continue;let d=ot(u.el.getBoundingClientRect(),o),p=n(l),c=p?ot(p,o):{x:o.width/2,y:o.height/2},f=Wt(l.amount);for(let g=0;g<f;g++)r.push({key:this.nextKey++,line:l,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:g*55,durationMs:i,target:u.key}),this.holds.set(u.key,(this.holds.get(u.key)??0)+1);}this.release(t),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(t){let n=this.flights.find(i=>i.key===t);if(!n)return;this.flights=this.flights.filter(i=>i.key!==t);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),An(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(t){if(!this.motion?.particles||!this.layerEl||!t)return;let n=ot(t.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 t of this.listeners)t();}};function ot(e,t){return {x:e.left-t.left+e.width/2,y:e.top-t.top+e.height/2}}function Dn(e){let t=e.getBoundingClientRect();return t.width>0&&t.height>0}function An(e){if(!(typeof document>"u"))for(let t of document.querySelectorAll(`[data-resource-counter="${Vt(e)}"]`))t.classList.remove("idos-bump"),t.offsetWidth,t.classList.add("idos-bump");}function Vt(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}var Ht=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",Yt="data-idos-idle",X=(e,t)=>e+Math.random()*(t-e);function jt(e){if(!(e instanceof HTMLElement)||e.hasAttribute(Yt))return;e.setAttribute(Yt,"");let t=e.style,n=X(1.6,2.8);t.setProperty("--idos-float-speed",n.toFixed(2)),t.setProperty("--idos-float-phase",(-X(0,n)).toFixed(2)),t.setProperty("--idos-float-amp",X(3,7).toFixed(1)),t.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*X(0,1.5)).toFixed(2));let o=X(5,7.5);t.setProperty("--idos-shine-speed",o.toFixed(2)),t.setProperty("--idos-shine-phase",(-X(0,o)).toFixed(2));}function it(e){e instanceof Element&&(e.matches(Ht)&&jt(e),e.querySelectorAll(Ht).forEach(jt));}function Qt(e){if(typeof MutationObserver>"u")return ()=>{};it(e);let t=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?it(o.target):o.addedNodes.forEach(it);});return t.observe(e,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>t.disconnect()}var Jt="idos-ui-prefs";function Kn(){try{return Qe(typeof localStorage<"u"?localStorage.getItem(Jt):null)}catch{return {...z}}}function Fn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Zt(e,t){let n=t.reducedMotion||e.motion.respectReducedMotion&&Fn(),o=e.motion.enabled&&!n;return {on:o,durations:le(e.motion,n),intensity:o?e.motion.intensity:0,rewardFlight:o&&e.motion.rewardFlight,particles:o&&e.motion.particles,stagger:o&&e.motion.stagger}}var Xt=Ce(null),Gn=new Q,_n={config:Xt,prefs:z,setPrefs:()=>{},motion:Zt(Xt,z),play:()=>{},layer:null,fx:Gn,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},en=react.createContext(_n);function k(){return react.useContext(en)}function Wn(){return k().play}function qn(){return k().motion}function Vn(){let e=k();return [e.prefs,e.setPrefs]}function Hn(){return k().celebrate}function Yn(){return k().toast}function jn(){return k().notify}function Qn({config:e,children:t,overlays:n,notifications:o}){let i=react.useMemo(()=>Ce(e),[e]),[r,l]=react.useState(Kn),u=react.useCallback(S=>{l(Y=>{let zt={...Y,...S};try{localStorage.setItem(Jt,JSON.stringify(zt));}catch{}return zt});},[]),d=react.useRef(null);d.current??=new ue(i.sound,r),react.useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),react.useEffect(()=>{let S=d.current;return S?.attach(),()=>S?.dispose()},[]);let p=react.useCallback(S=>d.current?.play(S),[]),c=react.useMemo(()=>Zt(i,r),[i,r]),f=react.useRef(new Q).current;f.setMotion(c),f.setPlayer(p);let[g,v]=react.useState(null);react.useEffect(()=>f.setLayer(g),[f,g]);let[C,P]=react.useState(null),D=react.useRef(C);D.current=C;let E=react.useCallback((S,Y)=>{if(S.length===0){Y?.onDone?.();return}f.reserve(S),P({lines:S,options:Y});},[f]),V=react.useCallback(()=>{let S=D.current;S&&f.release(S.lines),P(null),S?.options?.onDone?.();},[f]),we=react.useRef(null),M=o??(we.current??=Ze());react.useEffect(()=>(M.setPlayer(p),()=>M.setPlayer(null)),[M,p]);let H=react.useMemo(()=>({toast:S=>M.toast(S),alert:S=>M.alert(S),dismiss:S=>M.dismiss(S)}),[M]),U=react.useCallback((S,Y="info")=>{M.toast({message:S,level:Y});},[M]),se=react.useMemo(()=>({config:i,prefs:r,setPrefs:u,motion:c,play:p,layer:g,fx:f,celebrate:E,toast:U,notify:H,provided:true}),[i,r,u,c,p,g,f,E,U,H]),ae=react.useRef(null);react.useEffect(()=>ae.current?Qt(ae.current):void 0,[]);let G=!c.on;return jsxRuntime.jsx(en.Provider,{value:se,children:jsxRuntime.jsxs("div",{ref:ae,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...et(i,G)},children:[jsxRuntime.jsx("style",{children:nt}),t,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:C,finishCelebration:V,notifications:M})})]})})}function ge(e){let{fx:t}=k();return react.useSyncExternalStore(t.subscribe,()=>e(t),()=>e(t))}var tn=typeof window<"u"?react.useLayoutEffect:react.useEffect;var eo=react.createContext(null);function O(){return react.useContext(eo)}var at="idos:language",lt="idos:language";function to(){if(typeof navigator>"u")return "en";let e=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(t=>e.startsWith(t))?"ru":"en"}function no(){try{let e=globalThis.localStorage?.getItem(at);return e==="en"||e==="ru"?e:null}catch{return null}}var Te=no(),Pe=new Set;function q(){return Te??to()}function ut(e){if(e!=="en"&&e!=="ru")return;let t=e!==q();Te=e;try{globalThis.localStorage?.setItem(at,e);}catch{}if(t){for(let n of [...Pe])n(e);typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent(lt,{detail:e}));}}function dt(e){return Pe.add(e),()=>Pe.delete(e)}typeof window<"u"&&window.addEventListener(lt,e=>{let t=e.detail;if((t==="en"||t==="ru")&&t!==Te){Te=t;for(let n of [...Pe])n(t);}});function nn(e,t,n){return o=>((n??q())==="ru"?t:e)[o]??e[o]??o}function oo(e,t,n=q()){let[o,i=o,r=i]=t.split("|"),l=new Intl.PluralRules(n).select(Math.abs(Math.trunc(e)));return n==="ru"?l==="one"?o:l==="few"?i:r:l==="one"?o:i}var io={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",dailyLimitReached:"Today's reward limit is reached \u2014 come back tomorrow",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",cryptoTotal:"Balance",cryptoBacked:"Crypto",cryptoUnbacked:"IOU (not backed yet)",cryptoIouHint:"IOUs spend in the app like crypto; the developer backs them with real crypto later."},ro={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",dailyLimitReached:"\u0421\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u043B\u0438\u043C\u0438\u0442 \u043D\u0430\u0433\u0440\u0430\u0434 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D \u2014 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430",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",cryptoTotal:"\u0411\u0430\u043B\u0430\u043D\u0441",cryptoBacked:"\u041A\u0440\u0438\u043F\u0442\u0430",cryptoUnbacked:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 (\u043F\u043E\u043A\u0430 \u043D\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u044B)",cryptoIouHint:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 \u0442\u0440\u0430\u0442\u044F\u0442\u0441\u044F \u0432 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u043A\u0430\u043A \u043A\u0440\u0438\u043F\u0442\u0430; \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u043F\u043E\u0437\u0436\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0442 \u0438\u0445 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u0440\u0438\u043F\u0442\u043E\u0439."},w=nn(io,ro);function so(e){return e?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(e)?w("notEnough"):/CRYPTO_SERVER_GRANT_CAP_EXCEEDED/.test(e)?w("dailyLimitReached"):e.length>140?`${e.slice(0,140)}\u2026`:e:w("error")}function pt(e){let t=[];for(let n of e?.Entries??[]){if(!n)continue;if(n.Type==="CryptoCurrency"&&n.CurrencyID&&n.AmountUsd!=null){let i=Number(n.AmountUsd);Number.isFinite(i)&&i>0&&t.push({kind:"crypto",id:n.CurrencyID,amount:i,usd:true});continue}let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?t.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="CryptoCurrency"&&n.CurrencyID?t.push({kind:"crypto",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?t.push({kind:"item",id:n.ItemID,amount:o}):t.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of e?.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||t.push({kind:"token",id:`${o}:${i}`,amount:r});}return on(t)}function gt(e){let t=e.id.indexOf(":");return t<0?{system:e.id,entity:""}:{system:e.id.slice(0,t),entity:e.id.slice(t+1)}}function me(e){switch(gt(e).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function mt(e,t){let{system:n,entity:o}=gt(e);return n==="TimedEvent"?(t?Z(t,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||w("tokenEvent"):n==="Season"?w("tokenSeason"):n==="Quest"?w("tokenQuest"):n==="Leaderboard"?w("tokenScore"):e.id}function on(e){let t=new Map;for(let n of e){let o=`${n.kind}:${n.id}${n.usd?":usd":""}`,i=t.get(o);i?i.amount+=n.amount:t.set(o,{...n});}return [...t.values()]}function rn(e){return pt(e?.Standard)}function ao(e){return pt(e?.Standard)}function lo(e){let t=e?.Resources?.Grant;return rn(t)}function uo(e,t,n){return e.every(o=>o.kind==="currency"?Number(t?.[o.id]?.Amount??0)>=o.amount:o.kind==="crypto"&&n&&!o.usd?Number(n[o.id]?.Amount??0)>=o.amount:true)}function Ee(e){return e.usd?`$${co(e.amount)}`:K(e.amount)}function co(e){return e.toFixed(2).replace(/\.00$/,"")}function K(e){if(!Number.isFinite(e))return "0";let t=Math.abs(e);return t>=1e9?`${ct(e/1e9)}B`:t>=1e6?`${ct(e/1e6)}M`:t>=1e5?`${ct(e/1e3)}K`:Math.round(e).toLocaleString("en-US").replace(/,/g," ")}function ht(e){if(!Number.isFinite(e))return "0";let t=Math.abs(e);if(t>=1e5)return K(e);let n=t>=100?1:t>=1?2:4;return e.toLocaleString("en-US",{maximumFractionDigits:n}).replace(/,/g," ")}function ct(e){return e.toFixed(2).replace(/\.?0+$/,"")}function yt(e,t){if(!e)return null;let n=new Date(e);if(n.getUTCFullYear()>=9e3)return null;let o=n.getTime()-t;if(!Number.isFinite(o)||o<=0)return null;let i=Math.floor(o/1e3),r=Math.floor(i/3600),l=Math.floor(i%3600/60),u=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(l).padStart(2,"0")}m`:`${l}m ${String(u).padStart(2,"0")}s`}var sn=640,an=1024;function he(e){return e>=an?"desktop":e>=sn?"tablet":"phone"}function Z(e,t){let n=e.data.config.getSection(t);return n!==void 0?n:e.data.config.titlePublicConfiguration?.[t]??void 0}function bt(e){let t=new Map;for(let n of Object.values(e?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&t.set(i.ItemID??o,i);return t}var ft=["Legendary","Epic","Rare","Uncommon","Common"];function fo(e){let t=ft.indexOf(e??"");return t<0?ft.length:t}function vt(e,t){let n=new Map;for(let o of e){let i=t(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}function xt(e,t){return t?.[e]?.UnbackedRewardCurrencyID||`${e}_IOU`}function kt(e,t,n){let o=Number(e?.InventoryV2?.CryptoCurrencies?.[t]?.Amount??0)||0,i=xt(t,n),r=e?.InventoryV2?.VirtualCurrencies?.[i],l=r&&Number(r.Amount??0)||0;return {currencyID:t,backed:o,unbacked:l,total:o+l,iouID:r?i:null}}function po(e){return new Set(Object.keys(e??{}).map(t=>xt(t,e)))}var ln=["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 un(e){return ln.includes(e)}function Ue(e){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(e)?"gem":/^(en|energy|dice|di)$/i.test(e)?"energy":"coin"}function wt(e,t){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 [...e??[],t??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var go=/^(https?:|\/|data:)/;function N({glyph:e,size:t=24,color:n}){return un(e)?jsxRuntime.jsx("svg",{width:t,height:t,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:mo(e,n)}):go.test(e)?jsxRuntime.jsx("img",{src:e,alt:"",width:t,height:t,style:{flex:"none",display:"block",objectFit:"contain"}}):jsxRuntime.jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:t,height:t,fontSize:t*.8,lineHeight:1},children:e})}function mo(e,t){switch(e){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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsxRuntime.jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:t??"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:t??"currentColor",strokeWidth:"2.6"}),jsxRuntime.jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:t??"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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#4fb1ff"}),jsxRuntime.jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:t??"#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:t??"#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:t??"#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:t??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:t??"#d7e3f4"}),jsxRuntime.jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:t??"#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:t??"#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:t??"#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:t??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:t??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:t??"currentColor"}),jsxRuntime.jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:t??"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:t??"#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:t??"#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:t??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsxRuntime.jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsxRuntime.jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsxRuntime.jsx("path",{d:"M16 7v18M7 16h18",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsxRuntime.jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:t??"#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:t??"#ff5a7a"});case "offer":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:t??"#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:t??"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:t??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:t??"#ff5a5a"}),jsxRuntime.jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:t??"#ff5a5a"})]});case "edit":return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:t??"#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:t??"#9aa6ff"}),jsxRuntime.jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function yo(e){let[t,n]=react.useState("phone");return tn(()=>{let o=e.current;if(!o)return;let i=()=>n(he(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[e]),t}function Ae(){let{layer:e}=k(),t=react.useRef(null);t.current=e;let[n,o]=react.useState(()=>e?he(e.getBoundingClientRect().width):"phone");return react.useEffect(()=>{if(!e)return;let i=()=>o(he(e.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(e),()=>r.disconnect()},[e]),n}function $e(e,t){let[n,o]=react.useState(e),[i,r]=react.useState(false);return react.useEffect(()=>{if(e){o(true),r(false);return}if(!n)return;if(t<=0){o(false);return}r(true);let l=setTimeout(()=>{o(false),r(false);},t);return ()=>clearTimeout(l)},[e,t,n]),{mounted:n,closing:i}}function cn(e,t=600,n){let[o,i]=react.useState(e),r=react.useRef(e),l=react.useRef(n);return l.current=n,react.useEffect(()=>{let u=r.current;if(u===e)return;if(t<=0){r.current=e,i(e);return}let d=performance.now(),p=0,c=f=>{let g=Math.min(1,(f-d)/t),v=1-Math.pow(1-g,3),C=g>=1?e:Math.round(u+(e-u)*v);C!==r.current&&l.current?.(),r.current=C,i(C),g<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[e,t]),o}function Oe(e,t){let n=k(),o=ge(l=>l.holding(e)>0),i=react.useRef(t);o||(i.current=t);let r=o?i.current:t;return cn(r,n.motion.on?650:0,()=>n.play("countTick"))}function A(){let e=O(),t=k(),[,n]=react.useReducer(d=>d+1,0);react.useEffect(()=>e?.on("user:anyUpdated",()=>n()),[e]);let o=e?.data.config.titlePublicConfiguration??null,i=react.useMemo(()=>e&&o?bt(Z(e,"Item")):new Map,[e,o]),r=react.useMemo(()=>e&&o?Z(e,"Currency")?.VirtualCurrencies??{}:{},[e,o]),l=react.useMemo(()=>e&&o?Z(e,"Currency")?.CryptoCurrencies??{}:{},[e,o]),u=react.useCallback(d=>d?e?.localization.has(d)?e.localization.t(d):d:"",[e]);return react.useMemo(()=>({items:i,currencies:r,cryptoCurrencies:l,localize:u,currencyName:d=>u(r[d]?.DisplayName||l[d]?.DisplayName||d),itemName:d=>u(i.get(d)?.DisplayName||d),iconOf:d=>{if(d.kind==="currency")return r[d.id]?.ImagePath||Ue(d.id);if(d.kind==="crypto"){let p=l[d.id]?.AssetPaths;return p?.Default||p?.Icon||Ue(d.id)}if(d.kind==="item"){let p=i.get(d.id);return p?.ImagePath||wt(p?.Tags,p?.ItemClass)}return "box"},rarityColor:d=>t.config.theme.rarity[d??""]??t.config.theme.rarity.Common??"#a9b3c9"}),[i,r,l,u,t.config.theme.rarity])}function St(){let e=O(),t=A(),[,n]=react.useReducer(r=>r+1,0);react.useEffect(()=>e?.on("user:anyUpdated",()=>n()),[e]);let o=e?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(t.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,l])=>[r,Number(l?.Amount??0)]).sort(([r],[l])=>r.localeCompare(l))}function bo(e=1e3){let[t,n]=react.useState(()=>Date.now());return react.useEffect(()=>{let o=setInterval(()=>n(Date.now()),e);return ()=>clearInterval(o)},[e]),t}var Be={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ne={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:Se}};function ze(e){let[t,n]=Be[e],o=ne[e];return {background:`linear-gradient(180deg, ${t} 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 fn(e,t=false,n="md"){let[o,i]=Be[t?"grey":e],r=ne[t?"grey":e],l=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:l,minHeight:n==="sm"?34:44,cursor:t?"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:t?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function B({children:e,onClick:t,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:l=false,style:u,className:d="",sound:p="click",title:c,...f}){let{play:g}=k();return jsxRuntime.jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${l&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&g(p),t?.(v);},style:{...fn(n,i,o),...u},children:r?jsxRuntime.jsx(pn,{size:18}):e})}function ye({glyph:e,onClick:t,label:n,size:o=40,tone:i,style:r,badge:l}){let{play:u}=k();return jsxRuntime.jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{u("click"),t();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Be[i][0]}, ${Be[i][1]})`:a.well,color:i?ne[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsxRuntime.jsx(N,{glyph:e,size:o*.55}),l?jsxRuntime.jsx(be,{count:l}):null]})}function pn({size:e=28}){return jsxRuntime.jsx("span",{"aria-label":w("loading"),style:{width:e,height:e,borderRadius:"50%",border:`${Math.max(2,e/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function be({count:e,dot:t=false,style:n}){return !e||e<=0?null:jsxRuntime.jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:t?12:20,height:t?12:20,padding:t?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ne.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:t?null:e>99?"99+":e})}function gn({line:e,size:t=20,big:n=false,dim:o=false}){let i=A(),r=O();return jsxRuntime.jsxs("span",{title:Ke(e,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:e.kind==="token"?me(e):i.iconOf(e),size:t}),e.kind==="item"&&e.amount===1?null:Ee(e)]})}function Ke(e,t,n){return e.kind==="currency"||e.kind==="crypto"?t.currencyName(e.id):e.kind==="item"?t.itemName(e.id):e.kind==="token"?t.localize(mt(e,n)):e.id}function xo({lines:e,size:t=18,gap:n=8,dimIf:o}){return jsxRuntime.jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:e.map(i=>jsxRuntime.jsx(gn,{line:i,size:t,dim:o?.(i)},`${i.kind}:${i.id}`))})}function Ct({currencyID:e,amount:t,size:n=24,onClick:o}){let i=A(),r=Oe(e,t);return jsxRuntime.jsxs("div",{"data-resource-counter":e,title:i.currencyName(e),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Le,cursor:o?"pointer":"default"},children:[jsxRuntime.jsx(N,{glyph:i.iconOf({kind:"currency",id:e,amount:0}),size:n}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:K(r)})]})}function ko({itemID:e,count:t,level:n,onClick:o,size:i=76,selected:r=false,dim:l=false}){let u=A(),{play:d}=k(),p=u.items.get(e),c=u.rarityColor(p?.Metadata?.RarityID);return jsxRuntime.jsxs("button",{type:"button",className:"idos-press",title:u.itemName(e),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:l?.45:1,flex:"none"},children:[jsxRuntime.jsx(N,{glyph:u.iconOf({kind:"item",id:e,amount:1}),size:i*.56}),t!==void 0&&t>1?jsxRuntime.jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",K(t)]}):null,n!==void 0&&n>0?jsxRuntime.jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function wo({value:e,max:t,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,e/Math.max(1,t)*100)),[l,u]=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, ${l}, ${u})`,borderRadius:i/2,transition:`width ${a.slow} ${W}`}}),jsxRuntime.jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${K(e)} / ${K(t)}`})]})}function Rt({children:e,right:t}){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:e}),t]})}function So({glyph:e,text:t,action:n}){return jsxRuntime.jsxs("div",{style:{...I,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsxRuntime.jsx(N,{glyph:e,size:56}),jsxRuntime.jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:t}),n]})}function Co({children:e,minHeight:t=240}){return jsxRuntime.jsx("div",{style:{display:"grid",placeItems:"center",minHeight:t},children:e})}function Ro({at:e,now:t,label:n}){let o=yt(e,t);return o?jsxRuntime.jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function Nt({tabs:e,value:t,onChange:n,style:o}){let{play:i}=k();return e.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:e.map(r=>{let l=r.id===t;return jsxRuntime.jsxs("button",{role:"tab","aria-selected":l,type:"button",className:"idos-press",onClick:()=>{l||(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:l?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:l?`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,...l?ne.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsxRuntime.jsx(be,{count:r.badge}):null]},r.id)})})}function Lt(){let{motion:e}=k();return t=>e.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(t,14)*35}ms both`}:{}}function No({children:e,style:t,highlight:n=false,onClick:o}){let{play:i}=k();return jsxRuntime.jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...I,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:I.border,...t},children:e})}var Mt={...I,padding:"12px 14px",fontSize:15,color:a.text,fontFamily:a.font,outline:"none",boxSizing:"border-box"};function Lo({style:e,...t}){return jsxRuntime.jsx("input",{...t,style:{...Mt,...e}})}function Mo({style:e,...t}){return jsxRuntime.jsx("textarea",{...t,style:{...Mt,resize:"vertical",...e}})}function To({style:e,children:t,...n}){return jsxRuntime.jsx("select",{...n,className:`idos-select ${n.className??""}`,style:{...Mt,padding:"9px 12px",cursor:n.disabled?"default":"pointer",...e},children:t})}function Po({label:e,children:t}){return jsxRuntime.jsxs("div",{style:{display:"grid",gap:6},children:[jsxRuntime.jsx("div",{style:{...x,fontSize:13,color:a.textDim},children:e}),t]})}function Eo({currencyID:e,size:t=24,align:n="left"}){let o=O(),i=A(),[r,l]=react.useState(false),u=kt(o?.data.user.state,e,i.cryptoCurrencies),d=Oe(`crypto:${e}`,u.total),p=i.cryptoCurrencies[e]?.DisplayDecimals??4,c=v=>v.toLocaleString("en-US",{maximumFractionDigits:Math.max(0,p)}).replace(/,/g," "),f=i.currencyName(e),g=(v,C,P=false)=>jsxRuntime.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[jsxRuntime.jsx("span",{style:{...x,fontSize:13,color:a.textDim},children:v}),jsxRuntime.jsx("span",{style:{...x,fontSize:14,color:P?a.textDim:a.text},children:C})]});return jsxRuntime.jsxs("div",{"data-resource-counter":`crypto:${e}`,style:{position:"relative",display:"inline-flex"},onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxRuntime.jsxs("button",{type:"button","aria-label":f,"aria-expanded":r,onClick:()=>l(v=>!v),onBlur:()=>l(false),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Le,cursor:"pointer",font:"inherit"},children:[jsxRuntime.jsx(N,{glyph:i.iconOf({kind:"crypto",id:e,amount:0}),size:t}),jsxRuntime.jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:ht(d)}),u.unbacked>0?jsxRuntime.jsx("span",{"aria-hidden":true,style:{width:6,height:6,borderRadius:"50%",background:a.gold}}):null]}),r?jsxRuntime.jsxs("div",{role:"tooltip",style:{...I,position:"absolute",top:"calc(100% + 8px)",[n]:0,zIndex:30,minWidth:220,maxWidth:280,padding:"10px 12px",display:"grid",gap:6,animation:`idos-drop-in ${a.fast} ${W} both`},children:[jsxRuntime.jsx("span",{style:{...x,fontSize:15},children:f}),g(w("cryptoBacked"),c(u.backed)),u.iouID?g(w("cryptoUnbacked"),c(u.unbacked),u.unbacked===0):null,jsxRuntime.jsx("div",{style:{height:1,background:a.line}}),g(w("cryptoTotal"),c(u.total)),u.iouID?jsxRuntime.jsx("span",{style:{fontSize:12,color:a.textDim,lineHeight:1.35},children:w("cryptoIouHint")}):null]}):null]})}var Ut=react.createContext(()=>{});function oe(){return react.useContext(Ut)}function It({children:e}){let{layer:t}=k();return t?reactDom.createPortal(e,t):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}var Fe=[],Tt=new Set,Pt=0,Et=false,_e=()=>{for(let e of [...Tt])e();};function Ao(e){Et!==e&&(Et=e,_e());}function $o(e){let[t]=react.useState(()=>Symbol("auto-popup")),[,n]=react.useState(0),o=react.useRef(false);return react.useEffect(()=>{if(!e){o.current=false;return}Fe.push(t);let i=()=>n(r=>r+1);return Tt.add(i),i(),()=>{let r=Fe.indexOf(t);r>=0&&Fe.splice(r,1),Tt.delete(i),_e();}},[e,t]),e?(!o.current&&Fe[0]===t&&Pt===0&&!Et&&(o.current=true),o.current):true}function Oo(e){react.useEffect(()=>{if(e)return Pt+=1,_e(),()=>{Pt-=1,_e();}},[e]);}function ie({children:e,onClose:t,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:l=true,sound:u=true,panelStyle:d,queued:p=false}){let c=k(),f=Ae(),g=c.motion.durations.normal,[v,C]=react.useState(false),P=$o(p&&n);Oo(!p&&n);let{mounted:D,closing:E}=$e(n&&P&&!v,g),V=react.useRef(t);V.current=t;let we=react.useRef(false);react.useEffect(()=>{!u||!n||!P||we.current||(we.current=true,c.play("open"));},[u,n,P,c]);let M=react.useCallback(()=>{v||(c.play("close"),C(true));},[v,c]);react.useEffect(()=>{v&&!D&&V.current?.();},[v,D]);let H=l&&t!==void 0;if(react.useEffect(()=>{if(!H||!D)return;let G=S=>{S.key==="Escape"&&M();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[H,D,M]),!D)return null;let U=r==="sheet"||r==="auto"&&f==="phone",se=E,ae=U?se?`idos-sheet-out ${a.normal} ${ce} both`:`idos-sheet-in ${a.slow} ${W} both`:se?`idos-pop-out ${a.normal} ${ce} both`:`idos-pop-in ${a.slow} ${de} both`;return jsxRuntime.jsx(It,{children:jsxRuntime.jsx(Ut.Provider,{value:M,children:jsxRuntime.jsx("div",{role:"dialog","aria-modal":"true",onClick:H?M:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:U?"end stretch":"center",padding:U?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${se?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxRuntime.jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...I,width:U?"100%":`min(${i}px, 100%)`,maxHeight:U?"88%":"min(86vh, 100%)",overflowY:"auto",padding:U?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:U?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:ae,...d},children:[U?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,t?jsxRuntime.jsx(ye,{glyph:"close",label:w("close"),onClick:M,size:36,tone:"red",style:{position:"absolute",top:U?12:8,right:U?12:8,border:"3px solid #fff"}}):null,e]})})})})}function Bo({title:e,children:t,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxRuntime.jsxs(ie,{title:e,onClose:r,width:380,children:[t,jsxRuntime.jsx(zo,{confirmLabel:n,tone:o,onConfirm:i})]})}function zo({confirmLabel:e,tone:t,onConfirm:n}){let o=oe(),[i,r]=react.useState(false);return jsxRuntime.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsxRuntime.jsx(B,{tone:"grey",onClick:o,children:w("cancel")}),jsxRuntime.jsx(B,{tone:t,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(l=>{r(false),l!==true&&o();});},children:e??w("confirm")})]})}function Ko({title:e,icon:t,onClose:n,children:o,open:i=true,back:r=false,balances:l=true}){let u=k(),[d,p]=react.useState(false),{mounted:c,closing:f}=$e(i&&!d,u.motion.durations.normal),g=react.useRef(n);g.current=n,react.useEffect(()=>{u.play("open");},[]),react.useEffect(()=>{d&&!c&&g.current();},[d,c]);let v=react.useCallback(()=>{u.play("close"),p(true);},[u]);return react.useEffect(()=>{if(!c)return;let C=P=>{P.key==="Escape"&&v();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,v]),c?jsxRuntime.jsx(It,{children:jsxRuntime.jsx(Ut.Provider,{value:v,children:jsxRuntime.jsxs("div",{style:{position:u.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:tt,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ce:W} 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(ye,{glyph:"back",label:w("back"),onClick:v,size:38}):null,t?jsxRuntime.jsx(N,{glyph:t,size:30}):null,jsxRuntime.jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),l?jsxRuntime.jsx(Fo,{}):null,r?null:jsxRuntime.jsx(ye,{glyph:"close",label:w("close"),onClick:v,size:38,tone:"red"})]}),jsxRuntime.jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function Fo(){let e=St(),t=Ae(),n=t==="phone"?e.slice(0,2):e;return jsxRuntime.jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsxRuntime.jsx(Ct,{currencyID:o,amount:i,size:t==="phone"?18:22},o))})}var qe={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},Dt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function _o({level:e,size:t}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsxRuntime.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",children:e==="success"?jsxRuntime.jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):e==="error"?jsxRuntime.jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):e==="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"})]}):e==="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 bn({level:e,icon:t,size:n}){return jsxRuntime.jsx("span",{style:{...ze(qe[e]),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:t?jsxRuntime.jsx(N,{glyph:t,size:n*.62}):jsxRuntime.jsx(_o,{level:e,size:n*.56})})}function vn({source:e}){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:[e.icon?jsxRuntime.jsx(N,{glyph:e.icon,size:14}):null,jsxRuntime.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]})}function Wo(e){return react.useSyncExternalStore(e.subscribe,()=>e.toasts,()=>e.toasts),react.useSyncExternalStore(e.subscribe,()=>e.currentAlert,()=>e.currentAlert),e}function xn({store:e}){Wo(e);let t=e.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:e.toasts.map(n=>jsxRuntime.jsx(qo,{store:e,toast:n},n.id))}),t?jsxRuntime.jsx(Ho,{store:e,alert:t,queued:e.queued},t.id):null]})}function qo({store:e,toast:t}){let n=k(),o=t.input,i=qe[t.level],r=o.duration??Je[t.level],l=e.source(o.source),u=o.actions?.[0],[d,p]=react.useState(false),[c,f]=react.useState(false),g=n.motion.durations.normal,v=react.useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>e.dismiss(t.id),g));};let C=react.useRef(r);react.useEffect(()=>{C.current=r;},[r,t.revision]),react.useEffect(()=>{if(r<=0||c||d)return;let E=Date.now(),V=setTimeout(()=>v.current(),C.current);return ()=>{clearTimeout(V),C.current-=Date.now()-E;}},[r,c,d,t.revision]);let P=l?.open,D=E=>{E.onPress?.(),E.openFeature&&e.source(E.openFeature)?.open?.(),v.current();};return jsxRuntime.jsxs("div",{role:t.level==="error"||t.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:P?()=>{P(),v.current();}:void 0,className:P?"idos-press":void 0,style:{...I,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:P?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${Dt[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 ${Dt[i]}`}}):jsxRuntime.jsx(bn,{level:t.level,icon:o.icon,size:34}),jsxRuntime.jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[l?jsxRuntime.jsx(vn,{source:l}):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,u?jsxRuntime.jsx("div",{style:{marginTop:6},onClick:E=>E.stopPropagation(),children:jsxRuntime.jsx(B,{size:"sm",tone:i,onClick:()=>D(u),children:u.label})}):null]}),t.count>1?jsxRuntime.jsxs("span",{style:{...ze(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",t.count]}):null,jsxRuntime.jsx("button",{type:"button","aria-label":w("close"),onClick:E=>{E.stopPropagation(),v.current();},style:Vo,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:Dt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},t.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 Ho({store:e,alert:t,queued:n}){let o=react.useRef(null);return react.useEffect(()=>e.play(t.level),[e,t.level]),jsxRuntime.jsx(ie,{queued:true,sound:false,width:380,onClose:()=>e.dismiss(t.id,o.current),children:jsxRuntime.jsx(Yo,{store:e,alert:t,queued:n,chosen:o})})}function Yo({store:e,alert:t,queued:n,chosen:o}){let i=oe(),r=t.input,l=qe[t.level],u=e.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:w("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&e.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:t.level==="reward"?"idos-bounce":void 0,children:jsxRuntime.jsx(bn,{level:t.level,icon:r.icon,size:64})}),u?jsxRuntime.jsx(vn,{source:u}):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,g)=>f.primary||!p&&g===0?jsxRuntime.jsx(B,{tone:l,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:jo,children:f.label},f.id??f.label))})]})}var jo={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 Xo(e){return jsxRuntime.jsx(Jo,{state:e})}function Jo({state:e}){return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ti,{}),jsxRuntime.jsx(oi,{}),jsxRuntime.jsx(ri,{}),e.celebration?jsxRuntime.jsx(Zo,{lines:e.celebration.lines,title:e.celebration.options?.title,sound:e.celebration.options?.sound,onDone:e.finishCelebration},e.celebration.lines.map(t=>t.id).join()):null,jsxRuntime.jsx(xn,{store:e.notifications})]})}var Ve=560;function Zo({lines:e,title:t,sound:n="reward",onDone:o}){let i=k(),r=A(),l=O(),u=react.useRef(new Map),d=react.useRef(false);react.useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(e,c=>u.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxRuntime.jsxs(ie,{title:t??w("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:Ve,height:Ve,left:`calc(50% - ${Ve/2}px)`,top:`calc(50% - ${Ve/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%"}})}),e.map((c,f)=>jsxRuntime.jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${de} ${i.motion.on?.12*f:0}s both`},children:[jsxRuntime.jsx("div",{ref:g=>{g&&u.current.set(`${c.kind}:${c.id}`,g);},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"?me(c):r.iconOf(c),size:46})}),jsxRuntime.jsxs("div",{style:{...x,fontSize:16},children:["+",Ee(c)]}),jsxRuntime.jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ke(c,r,l)})]},`${c.kind}:${c.id}`))]}),jsxRuntime.jsx(ei,{onPress:p})]})}function ei({onPress:e}){let t=oe();return jsxRuntime.jsx(B,{attract:true,onClick:()=>{e(),t();},children:w("great")})}function ti(){let e=ge(t=>t.flights);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map(t=>jsxRuntime.jsx(ni,{flight:t},t.key))})}function ni({flight:e}){let t=react.useRef(null),n=k(),o=A();return react.useLayoutEffect(()=>{let i=t.current;if(!i||typeof i.animate!="function"){n.fx.arrive(e.key);return}let r=e.to.x-e.from.x,l=e.to.y-e.from.y,u=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${u}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${l}px) scale(.55)`,opacity:1}],{duration:e.durationMs,delay:e.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(e.key),()=>{d.onfinish=null,d.cancel();}},[]),jsxRuntime.jsx("div",{ref:t,style:{position:"absolute",left:e.from.x-16,top:e.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsxRuntime.jsx(N,{glyph:o.iconOf(e.line),size:32})})}var kn=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function oi(){let e=ge(t=>t.bursts);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.map(t=>jsxRuntime.jsx(ii,{x:t.at.x,y:t.at.y},t.key))})}function ii({x:e,y:t}){let n=react.useRef(null);return react.useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,l)=>{if(typeof r.animate!="function")return;let u=l/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(u)*d}px, ${Math.sin(u)*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:e,top:t,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:kn[i%kn.length]}},i))})}function ri(){let e=O(),[t,n]=react.useState(false);return react.useEffect(()=>{if(!e)return;let o,i=e.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[e]),t?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:w("offline")}):null}var ai=e=>dt(e);function Cn(){return react.useSyncExternalStore(ai,q,q)}function li({style:e}){let t=Cn();return jsxRuntime.jsx(Nt,{tabs:[{id:"en",label:"English"},{id:"ru",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"}],value:t,onChange:ut,style:e})}var Bt=["economy","events","social","profile","other"];function Nn(e){return [...e].sort((t,n)=>{let o=Bt.indexOf(t.group??"other")-Bt.indexOf(n.group??"other");return o!==0?o:(t.order??100)-(n.order??100)||t.label.localeCompare(n.label)})}function di({items:e,onOpen:t}){let{play:n}=k(),o=Lt(),i=vt(Nn(e),l=>l.group??"other"),r=0;return jsxRuntime.jsx("div",{style:{display:"grid",gap:18},children:i.map(l=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Rt,{children:Bt.includes(l.key)?w(l.key):l.key}),jsxRuntime.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:l.items.map(u=>jsxRuntime.jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${u.id}`,onClick:()=>{n("click"),t(u.id);},style:{...I,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsxRuntime.jsx(N,{glyph:u.icon??"box",size:40}),jsxRuntime.jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:u.label}),jsxRuntime.jsx(be,{count:u.badge??0})]},u.id))})]},l.key))})}exports.Badge=be;exports.Button=B;exports.Card=No;exports.Center=Co;exports.ConfirmPopup=Bo;exports.CryptoBalanceChip=Eo;exports.DEFAULT_PLAYER_PREFS=z;exports.DEFAULT_UI_CONFIG=Ft;exports.DESKTOP_MIN_PX=an;exports.EASE_IN=ce;exports.EASE_OUT=W;exports.EASE_POP=de;exports.EmptyState=So;exports.FeatureGrid=di;exports.Field=Po;exports.FxStore=Q;exports.GLYPHS=ln;exports.Icon=N;exports.IconButton=ye;exports.ItemTile=ko;exports.KIT_CSS=nt;exports.KitPortal=It;exports.LANGUAGE_EVENT=lt;exports.LANGUAGE_KEY=at;exports.LEVEL_TONE=qe;exports.LanguageSwitch=li;exports.NotificationStore=Ne;exports.ON_TONE=ne;exports.Popup=ie;exports.ProgressBar=wo;exports.RARITY_ORDER=ft;exports.ResourceBadge=gn;exports.ResourceCounter=Ct;exports.ResourceList=xo;exports.SOUND_PRESETS=Re;exports.SectionTitle=Rt;exports.Select=To;exports.Spinner=pn;exports.TABLET_MIN_PX=sn;exports.TOAST_DURATION=Je;exports.Tabs=Nt;exports.TextArea=Mo;exports.TextInput=Lo;exports.Timer=Ro;exports.UI_SOUND_EVENTS=je;exports.UiKitProvider=Qn;exports.UiSoundEngine=ue;exports.Window=Ko;exports.bundleLines=pt;exports.buttonStyle=fn;exports.canAfford=uo;exports.configSection=Z;exports.costLines=ao;exports.countdown=yt;exports.counterKeys=qt;exports.createNotificationStore=Ze;exports.cryptoBalance=kt;exports.currencyGlyph=Ue;exports.defineUiConfig=Ln;exports.effectiveVolume=Xe;exports.errorText=so;exports.formatAmount=K;exports.formatCryptoAmount=ht;exports.grantLines=rn;exports.grantedBy=lo;exports.groupBy=vt;exports.iconsFor=Wt;exports.iouCurrencies=po;exports.iouCurrencyOf=xt;exports.isGlyph=un;exports.itemDefinitions=bt;exports.itemGlyph=wt;exports.layoutFor=he;exports.makeT=nn;exports.mergeLines=on;exports.motionDurations=le;exports.onLanguageChange=dt;exports.outlined=x;exports.panel=I;exports.parsePlayerPrefs=Qe;exports.pickLanguage=q;exports.plural=oo;exports.rarityRank=fo;exports.renderKitOverlays=Xo;exports.resolveSound=_t;exports.resolveUiConfig=Ce;exports.resourceName=Ke;exports.screenBackground=tt;exports.setAutoPopupsHeld=Ao;exports.setLanguage=ut;exports.sortFeatures=Nn;exports.themeVars=et;exports.tokenGlyph=me;exports.tokenName=mt;exports.tokenParts=gt;exports.toneSurface=ze;exports.uiT=w;exports.useAnimatedNumber=cn;exports.useBalances=St;exports.useCatalog=A;exports.useCelebrate=Hn;exports.useCounterValue=Oe;exports.useGameLayout=Ae;exports.useLanguage=Cn;exports.useLayout=yo;exports.useMotion=qn;exports.useNotify=jn;exports.useNow=bo;exports.usePlayerPrefs=Vn;exports.usePopupClose=oe;exports.usePresence=$e;exports.useSound=Wn;exports.useStagger=Lt;exports.useToast=Yn;exports.useUiKit=k;exports.v=a;exports.well=Le;
@@ -1,4 +1,4 @@
1
- import { ReactNode, CSSProperties, MouseEvent, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
1
+ import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
2
2
  import { TitlePublicConfigurationModel, IDosGamesClient, ResourceConsume, ResourceGrant } from '@idosgames/core';
3
3
 
4
4
  /** Interface sound events. Components of the kit play theirs by themselves. */
@@ -763,6 +763,8 @@ declare function Card({ children, style, highlight, onClick, }: {
763
763
  declare function TextInput({ style, ...rest }: InputHTMLAttributes<HTMLInputElement>): ReactNode;
764
764
  /** A multi-line text field. */
765
765
  declare function TextArea({ style, ...rest }: TextareaHTMLAttributes<HTMLTextAreaElement>): ReactNode;
766
+ /** A drop-down choice in the look of the kit's fields; `<option>`s go inside as children. */
767
+ declare function Select({ style, children, ...rest }: SelectHTMLAttributes<HTMLSelectElement>): ReactNode;
766
768
  /** A label above a control (a field of a form). */
767
769
  declare function Field({ label, children, }: {
768
770
  label: string;
@@ -780,10 +782,25 @@ declare function CryptoBalanceChip({ currencyID, size, align, }: {
780
782
  }): ReactNode;
781
783
 
782
784
  type UiLanguage = "en" | "ru";
785
+ /** localStorage key of the player's interface language. */
786
+ declare const LANGUAGE_KEY = "idos:language";
787
+ /** Window event fired when the interface language changes; `detail` is the new language. */
788
+ declare const LANGUAGE_EVENT = "idos:language";
789
+ /** The interface language now: the player's choice, else the browser's. */
783
790
  declare function pickLanguage(): UiLanguage;
791
+ /**
792
+ * Switch the interface language for the whole app: saved for the next visits, every `makeT` table
793
+ * answers in it from now on, subscribers (`onLanguageChange`, the lobby) re-render, games hear
794
+ * LANGUAGE_EVENT.
795
+ */
796
+ declare function setLanguage(language: UiLanguage): void;
797
+ /** Called after the language changes (also when a game switches it). Returns the unsubscribe. */
798
+ declare function onLanguageChange(fn: (l: UiLanguage) => void): () => void;
784
799
  /**
785
800
  * A module's string table: `const t = makeT(EN, RU)`, then `t("buy")`. The Russian table must have
786
801
  * every key of the English one (the type says so), so a missing translation is a compile error.
802
+ * Without `language` the table answers in the CURRENT interface language at every call — so a
803
+ * module-level `t` follows the language switch.
787
804
  */
788
805
  declare function makeT<K extends string>(en: Record<K, string>, ru: Record<K, string>, language?: UiLanguage): (key: K) => string;
789
806
  /**
@@ -829,10 +846,17 @@ declare const EN: {
829
846
  };
830
847
  type UiStringKey = keyof typeof EN;
831
848
  /** Strings of the kit itself. */
832
- declare const uiT: (key: "close" | "claim" | "error" | "events" | "other" | "back" | "confirm" | "cancel" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "offline" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
849
+ declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
833
850
  /** Turns a server error into words the player understands; long texts are cut. */
834
851
  declare function errorText(error: string | null | undefined): string;
835
852
 
853
+ /** The interface language now; the component re-renders when it changes. */
854
+ declare function useLanguage(): UiLanguage;
855
+ /** English / Русский — switches the whole app (saved for the next visits). */
856
+ declare function LanguageSwitch({ style, }: {
857
+ style?: CSSProperties;
858
+ }): ReactNode;
859
+
836
860
  /** CSS variables of a resolved config, to put on the kit root. */
837
861
  declare function themeVars(config: UiKitConfig, reducedMotion: boolean): CSSProperties;
838
862
  /** Shorthands for inline styles, so components never spell a variable name twice. */
@@ -897,7 +921,7 @@ declare const EASE_IN = "cubic-bezier(.5, 0, .75, .2)";
897
921
  * Keyframes and the few class-based effects inline styles cannot express. Overshoots are written as
898
922
  * `calc(1 + X * var(--idos-ui-k))`, so `motion.intensity` 0 flattens them and 2 doubles them.
899
923
  */
900
- declare const KIT_CSS = "\n@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 } }\n@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 } }\n@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }\n@keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }\n@keyframes idos-drop-out { from { transform: none; opacity: 1 } to { transform: translateY(-10px) scale(.97); opacity: 0 } }\n@keyframes idos-timer { from { transform: scaleX(1) } to { transform: scaleX(0) } }\n@keyframes idos-sheet-in { 0% { transform: translateY(100%) } 75% { transform: translateY(calc(-2% * var(--idos-ui-k, 1))) } 100% { transform: none } }\n@keyframes idos-sheet-out { from { transform: none } to { transform: translateY(100%) } }\n@keyframes idos-window-in { from { transform: translateY(24px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-window-out { from { transform: none; opacity: 1 } to { transform: translateY(24px) scale(.98); opacity: 0 } }\n@keyframes idos-bounce { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(calc(-1px * var(--idos-float-amp, 5) * var(--idos-ui-k, 1))) rotate(calc(1deg * var(--idos-float-tilt, 0) * var(--idos-ui-k, 1))) } }\n@keyframes idos-shine { 0% { transform: translateX(-120%) skewX(-20deg) } 60%, 100% { transform: translateX(220%) skewX(-20deg) } }\n@keyframes idos-spin { to { transform: rotate(360deg) } }\n@keyframes idos-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent } 50% { box-shadow: 0 0 18px 4px color-mix(in srgb, var(--idos-ui-gold) 55%, transparent) } }\n@keyframes idos-pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(calc(1 + .18 * var(--idos-ui-k, 1))) } }\n@keyframes idos-bump { 0% { transform: scale(1) } 40% { transform: scale(calc(1 + .22 * var(--idos-ui-k, 1))) } 100% { transform: scale(1) } }\n@keyframes idos-shake { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(calc(-9deg * var(--idos-ui-k, 1))) } 40% { transform: rotate(calc(8deg * var(--idos-ui-k, 1))) } 60% { transform: rotate(calc(-6deg * var(--idos-ui-k, 1))) } 80% { transform: rotate(calc(4deg * var(--idos-ui-k, 1))) } }\n@keyframes idos-star { 0% { transform: scale(0) rotate(-40deg) } 60% { transform: scale(calc(1 + .15 * var(--idos-ui-k, 1))) rotate(8deg) } 100% { transform: scale(1) rotate(0) } }\n@keyframes idos-rays { to { transform: rotate(360deg) } }\n.idos-press { transition: transform var(--idos-ui-fast) ease, filter var(--idos-ui-fast) ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation }\n.idos-press:not(:disabled):hover { filter: brightness(1.07) }\n.idos-press:not(:disabled):active { transform: translateY(3px) scale(.96); filter: brightness(.95); transition-duration: 40ms }\n.idos-shine { position: relative; overflow: hidden }\n.idos-shine::after { content: \"\"; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; pointer-events: none;\n background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);\n animation: idos-shine calc(var(--idos-ui-slow) * var(--idos-shine-speed, 6)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-shine-phase, 0)) infinite }\n.idos-bounce { animation: idos-bounce calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-glow { animation: idos-glow calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1) * 1.4) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-pulse { animation: idos-pulse calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-bump { animation: idos-bump var(--idos-ui-normal) ease-out }\n.idos-scroll { scrollbar-width: thin; scrollbar-color: var(--idos-ui-panel-edge) transparent; overscroll-behavior: contain }\n.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }\n.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }\n[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 }\n";
924
+ declare const KIT_CSS = "\n@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 } }\n@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 } }\n@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }\n.idos-select option { background: var(--idos-ui-panel-deep); color: var(--idos-ui-text) }\n@keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }\n@keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }\n@keyframes idos-drop-out { from { transform: none; opacity: 1 } to { transform: translateY(-10px) scale(.97); opacity: 0 } }\n@keyframes idos-timer { from { transform: scaleX(1) } to { transform: scaleX(0) } }\n@keyframes idos-sheet-in { 0% { transform: translateY(100%) } 75% { transform: translateY(calc(-2% * var(--idos-ui-k, 1))) } 100% { transform: none } }\n@keyframes idos-sheet-out { from { transform: none } to { transform: translateY(100%) } }\n@keyframes idos-window-in { from { transform: translateY(24px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-window-out { from { transform: none; opacity: 1 } to { transform: translateY(24px) scale(.98); opacity: 0 } }\n@keyframes idos-bounce { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(calc(-1px * var(--idos-float-amp, 5) * var(--idos-ui-k, 1))) rotate(calc(1deg * var(--idos-float-tilt, 0) * var(--idos-ui-k, 1))) } }\n@keyframes idos-shine { 0% { transform: translateX(-120%) skewX(-20deg) } 60%, 100% { transform: translateX(220%) skewX(-20deg) } }\n@keyframes idos-spin { to { transform: rotate(360deg) } }\n@keyframes idos-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent } 50% { box-shadow: 0 0 18px 4px color-mix(in srgb, var(--idos-ui-gold) 55%, transparent) } }\n@keyframes idos-pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(calc(1 + .18 * var(--idos-ui-k, 1))) } }\n@keyframes idos-bump { 0% { transform: scale(1) } 40% { transform: scale(calc(1 + .22 * var(--idos-ui-k, 1))) } 100% { transform: scale(1) } }\n@keyframes idos-shake { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(calc(-9deg * var(--idos-ui-k, 1))) } 40% { transform: rotate(calc(8deg * var(--idos-ui-k, 1))) } 60% { transform: rotate(calc(-6deg * var(--idos-ui-k, 1))) } 80% { transform: rotate(calc(4deg * var(--idos-ui-k, 1))) } }\n@keyframes idos-star { 0% { transform: scale(0) rotate(-40deg) } 60% { transform: scale(calc(1 + .15 * var(--idos-ui-k, 1))) rotate(8deg) } 100% { transform: scale(1) rotate(0) } }\n@keyframes idos-rays { to { transform: rotate(360deg) } }\n.idos-press { transition: transform var(--idos-ui-fast) ease, filter var(--idos-ui-fast) ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation }\n.idos-press:not(:disabled):hover { filter: brightness(1.07) }\n.idos-press:not(:disabled):active { transform: translateY(3px) scale(.96); filter: brightness(.95); transition-duration: 40ms }\n.idos-shine { position: relative; overflow: hidden }\n.idos-shine::after { content: \"\"; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; pointer-events: none;\n background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);\n animation: idos-shine calc(var(--idos-ui-slow) * var(--idos-shine-speed, 6)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-shine-phase, 0)) infinite }\n.idos-bounce { animation: idos-bounce calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-glow { animation: idos-glow calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1) * 1.4) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-pulse { animation: idos-pulse calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-bump { animation: idos-bump var(--idos-ui-normal) ease-out }\n.idos-scroll { scrollbar-width: thin; scrollbar-color: var(--idos-ui-panel-edge) transparent; overscroll-behavior: contain }\n.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }\n.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }\n[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 }\n";
901
925
 
902
926
  /** The layout for the element's current width, following it as it resizes. */
903
927
  declare function useLayout(ref: {
@@ -1009,4 +1033,4 @@ declare function FeatureGrid({ items, onOpen, }: {
1009
1033
  /** The theme tone of each level: colour of its badge, its stripe, its main button. */
1010
1034
  declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
1011
1035
 
1012
- export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, 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, TextArea, TextInput, Timer, type TitleSections, 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, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, 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 };
1036
+ export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LANGUAGE_EVENT, LANGUAGE_KEY, LEVEL_TONE, LanguageSwitch, 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, Select, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, TextArea, TextInput, Timer, type TitleSections, 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, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, onLanguageChange, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, setLanguage, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLanguage, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
@@ -1,4 +1,4 @@
1
- import { ReactNode, CSSProperties, MouseEvent, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
1
+ import { ReactNode, CSSProperties, MouseEvent, SelectHTMLAttributes, TextareaHTMLAttributes, InputHTMLAttributes } from 'react';
2
2
  import { TitlePublicConfigurationModel, IDosGamesClient, ResourceConsume, ResourceGrant } from '@idosgames/core';
3
3
 
4
4
  /** Interface sound events. Components of the kit play theirs by themselves. */
@@ -763,6 +763,8 @@ declare function Card({ children, style, highlight, onClick, }: {
763
763
  declare function TextInput({ style, ...rest }: InputHTMLAttributes<HTMLInputElement>): ReactNode;
764
764
  /** A multi-line text field. */
765
765
  declare function TextArea({ style, ...rest }: TextareaHTMLAttributes<HTMLTextAreaElement>): ReactNode;
766
+ /** A drop-down choice in the look of the kit's fields; `<option>`s go inside as children. */
767
+ declare function Select({ style, children, ...rest }: SelectHTMLAttributes<HTMLSelectElement>): ReactNode;
766
768
  /** A label above a control (a field of a form). */
767
769
  declare function Field({ label, children, }: {
768
770
  label: string;
@@ -780,10 +782,25 @@ declare function CryptoBalanceChip({ currencyID, size, align, }: {
780
782
  }): ReactNode;
781
783
 
782
784
  type UiLanguage = "en" | "ru";
785
+ /** localStorage key of the player's interface language. */
786
+ declare const LANGUAGE_KEY = "idos:language";
787
+ /** Window event fired when the interface language changes; `detail` is the new language. */
788
+ declare const LANGUAGE_EVENT = "idos:language";
789
+ /** The interface language now: the player's choice, else the browser's. */
783
790
  declare function pickLanguage(): UiLanguage;
791
+ /**
792
+ * Switch the interface language for the whole app: saved for the next visits, every `makeT` table
793
+ * answers in it from now on, subscribers (`onLanguageChange`, the lobby) re-render, games hear
794
+ * LANGUAGE_EVENT.
795
+ */
796
+ declare function setLanguage(language: UiLanguage): void;
797
+ /** Called after the language changes (also when a game switches it). Returns the unsubscribe. */
798
+ declare function onLanguageChange(fn: (l: UiLanguage) => void): () => void;
784
799
  /**
785
800
  * A module's string table: `const t = makeT(EN, RU)`, then `t("buy")`. The Russian table must have
786
801
  * every key of the English one (the type says so), so a missing translation is a compile error.
802
+ * Without `language` the table answers in the CURRENT interface language at every call — so a
803
+ * module-level `t` follows the language switch.
787
804
  */
788
805
  declare function makeT<K extends string>(en: Record<K, string>, ru: Record<K, string>, language?: UiLanguage): (key: K) => string;
789
806
  /**
@@ -829,10 +846,17 @@ declare const EN: {
829
846
  };
830
847
  type UiStringKey = keyof typeof EN;
831
848
  /** Strings of the kit itself. */
832
- declare const uiT: (key: "close" | "claim" | "error" | "events" | "other" | "back" | "confirm" | "cancel" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "offline" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
849
+ declare const uiT: (key: "close" | "claim" | "error" | "events" | "cancel" | "offline" | "other" | "back" | "confirm" | "youGot" | "great" | "loading" | "ok" | "loadingNamed" | "stillLoading" | "retry" | "notEnough" | "dailyLimitReached" | "more" | "menu" | "nothingHere" | "economy" | "social" | "profile" | "free" | "claimAll" | "tokenEvent" | "tokenSeason" | "tokenQuest" | "tokenScore" | "cryptoTotal" | "cryptoBacked" | "cryptoUnbacked" | "cryptoIouHint") => string;
833
850
  /** Turns a server error into words the player understands; long texts are cut. */
834
851
  declare function errorText(error: string | null | undefined): string;
835
852
 
853
+ /** The interface language now; the component re-renders when it changes. */
854
+ declare function useLanguage(): UiLanguage;
855
+ /** English / Русский — switches the whole app (saved for the next visits). */
856
+ declare function LanguageSwitch({ style, }: {
857
+ style?: CSSProperties;
858
+ }): ReactNode;
859
+
836
860
  /** CSS variables of a resolved config, to put on the kit root. */
837
861
  declare function themeVars(config: UiKitConfig, reducedMotion: boolean): CSSProperties;
838
862
  /** Shorthands for inline styles, so components never spell a variable name twice. */
@@ -897,7 +921,7 @@ declare const EASE_IN = "cubic-bezier(.5, 0, .75, .2)";
897
921
  * Keyframes and the few class-based effects inline styles cannot express. Overshoots are written as
898
922
  * `calc(1 + X * var(--idos-ui-k))`, so `motion.intensity` 0 flattens them and 2 doubles them.
899
923
  */
900
- declare const KIT_CSS = "\n@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 } }\n@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 } }\n@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }\n@keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }\n@keyframes idos-drop-out { from { transform: none; opacity: 1 } to { transform: translateY(-10px) scale(.97); opacity: 0 } }\n@keyframes idos-timer { from { transform: scaleX(1) } to { transform: scaleX(0) } }\n@keyframes idos-sheet-in { 0% { transform: translateY(100%) } 75% { transform: translateY(calc(-2% * var(--idos-ui-k, 1))) } 100% { transform: none } }\n@keyframes idos-sheet-out { from { transform: none } to { transform: translateY(100%) } }\n@keyframes idos-window-in { from { transform: translateY(24px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-window-out { from { transform: none; opacity: 1 } to { transform: translateY(24px) scale(.98); opacity: 0 } }\n@keyframes idos-bounce { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(calc(-1px * var(--idos-float-amp, 5) * var(--idos-ui-k, 1))) rotate(calc(1deg * var(--idos-float-tilt, 0) * var(--idos-ui-k, 1))) } }\n@keyframes idos-shine { 0% { transform: translateX(-120%) skewX(-20deg) } 60%, 100% { transform: translateX(220%) skewX(-20deg) } }\n@keyframes idos-spin { to { transform: rotate(360deg) } }\n@keyframes idos-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent } 50% { box-shadow: 0 0 18px 4px color-mix(in srgb, var(--idos-ui-gold) 55%, transparent) } }\n@keyframes idos-pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(calc(1 + .18 * var(--idos-ui-k, 1))) } }\n@keyframes idos-bump { 0% { transform: scale(1) } 40% { transform: scale(calc(1 + .22 * var(--idos-ui-k, 1))) } 100% { transform: scale(1) } }\n@keyframes idos-shake { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(calc(-9deg * var(--idos-ui-k, 1))) } 40% { transform: rotate(calc(8deg * var(--idos-ui-k, 1))) } 60% { transform: rotate(calc(-6deg * var(--idos-ui-k, 1))) } 80% { transform: rotate(calc(4deg * var(--idos-ui-k, 1))) } }\n@keyframes idos-star { 0% { transform: scale(0) rotate(-40deg) } 60% { transform: scale(calc(1 + .15 * var(--idos-ui-k, 1))) rotate(8deg) } 100% { transform: scale(1) rotate(0) } }\n@keyframes idos-rays { to { transform: rotate(360deg) } }\n.idos-press { transition: transform var(--idos-ui-fast) ease, filter var(--idos-ui-fast) ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation }\n.idos-press:not(:disabled):hover { filter: brightness(1.07) }\n.idos-press:not(:disabled):active { transform: translateY(3px) scale(.96); filter: brightness(.95); transition-duration: 40ms }\n.idos-shine { position: relative; overflow: hidden }\n.idos-shine::after { content: \"\"; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; pointer-events: none;\n background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);\n animation: idos-shine calc(var(--idos-ui-slow) * var(--idos-shine-speed, 6)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-shine-phase, 0)) infinite }\n.idos-bounce { animation: idos-bounce calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-glow { animation: idos-glow calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1) * 1.4) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-pulse { animation: idos-pulse calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-bump { animation: idos-bump var(--idos-ui-normal) ease-out }\n.idos-scroll { scrollbar-width: thin; scrollbar-color: var(--idos-ui-panel-edge) transparent; overscroll-behavior: contain }\n.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }\n.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }\n[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 }\n";
924
+ declare const KIT_CSS = "\n@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 } }\n@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 } }\n@keyframes idos-fade-in { from { opacity: 0 } to { opacity: 1 } }\n.idos-select option { background: var(--idos-ui-panel-deep); color: var(--idos-ui-text) }\n@keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }\n@keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }\n@keyframes idos-drop-out { from { transform: none; opacity: 1 } to { transform: translateY(-10px) scale(.97); opacity: 0 } }\n@keyframes idos-timer { from { transform: scaleX(1) } to { transform: scaleX(0) } }\n@keyframes idos-sheet-in { 0% { transform: translateY(100%) } 75% { transform: translateY(calc(-2% * var(--idos-ui-k, 1))) } 100% { transform: none } }\n@keyframes idos-sheet-out { from { transform: none } to { transform: translateY(100%) } }\n@keyframes idos-window-in { from { transform: translateY(24px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes idos-window-out { from { transform: none; opacity: 1 } to { transform: translateY(24px) scale(.98); opacity: 0 } }\n@keyframes idos-bounce { 0%, 100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(calc(-1px * var(--idos-float-amp, 5) * var(--idos-ui-k, 1))) rotate(calc(1deg * var(--idos-float-tilt, 0) * var(--idos-ui-k, 1))) } }\n@keyframes idos-shine { 0% { transform: translateX(-120%) skewX(-20deg) } 60%, 100% { transform: translateX(220%) skewX(-20deg) } }\n@keyframes idos-spin { to { transform: rotate(360deg) } }\n@keyframes idos-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent } 50% { box-shadow: 0 0 18px 4px color-mix(in srgb, var(--idos-ui-gold) 55%, transparent) } }\n@keyframes idos-pulse { 0%, 100% { transform: scale(1) } 50% { transform: scale(calc(1 + .18 * var(--idos-ui-k, 1))) } }\n@keyframes idos-bump { 0% { transform: scale(1) } 40% { transform: scale(calc(1 + .22 * var(--idos-ui-k, 1))) } 100% { transform: scale(1) } }\n@keyframes idos-shake { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(calc(-9deg * var(--idos-ui-k, 1))) } 40% { transform: rotate(calc(8deg * var(--idos-ui-k, 1))) } 60% { transform: rotate(calc(-6deg * var(--idos-ui-k, 1))) } 80% { transform: rotate(calc(4deg * var(--idos-ui-k, 1))) } }\n@keyframes idos-star { 0% { transform: scale(0) rotate(-40deg) } 60% { transform: scale(calc(1 + .15 * var(--idos-ui-k, 1))) rotate(8deg) } 100% { transform: scale(1) rotate(0) } }\n@keyframes idos-rays { to { transform: rotate(360deg) } }\n.idos-press { transition: transform var(--idos-ui-fast) ease, filter var(--idos-ui-fast) ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation }\n.idos-press:not(:disabled):hover { filter: brightness(1.07) }\n.idos-press:not(:disabled):active { transform: translateY(3px) scale(.96); filter: brightness(.95); transition-duration: 40ms }\n.idos-shine { position: relative; overflow: hidden }\n.idos-shine::after { content: \"\"; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; pointer-events: none;\n background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);\n animation: idos-shine calc(var(--idos-ui-slow) * var(--idos-shine-speed, 6)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-shine-phase, 0)) infinite }\n.idos-bounce { animation: idos-bounce calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-glow { animation: idos-glow calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1) * 1.4) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-pulse { animation: idos-pulse calc(var(--idos-ui-slow) * var(--idos-float-speed, 2.1)) ease-in-out calc(var(--idos-ui-slow) * var(--idos-float-phase, 0)) infinite }\n.idos-bump { animation: idos-bump var(--idos-ui-normal) ease-out }\n.idos-scroll { scrollbar-width: thin; scrollbar-color: var(--idos-ui-panel-edge) transparent; overscroll-behavior: contain }\n.idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }\n.idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }\n[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 }\n";
901
925
 
902
926
  /** The layout for the element's current width, following it as it resizes. */
903
927
  declare function useLayout(ref: {
@@ -1009,4 +1033,4 @@ declare function FeatureGrid({ items, onOpen, }: {
1009
1033
  /** The theme tone of each level: colour of its badge, its stripe, its main button. */
1010
1034
  declare const LEVEL_TONE: Record<NotificationLevel, ButtonTone>;
1011
1035
 
1012
- export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, 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, TextArea, TextInput, Timer, type TitleSections, 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, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, 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 };
1036
+ export { Badge, type Burst, Button, type ButtonProps, type ButtonTone, Card, type Catalog, type CelebrateOptions, Center, ConfirmPopup, CryptoBalanceChip, type CryptoBalanceView, type CurrencySection, DEFAULT_PLAYER_PREFS, DEFAULT_UI_CONFIG, DESKTOP_MIN_PX, EASE_IN, EASE_OUT, EASE_POP, EmptyState, FeatureGrid, type FeatureMenuItem, Field, type Flight, FxStore, GLYPHS, type Glyph, Icon, IconButton, type ItemDefinitionView, type ItemSection, ItemTile, KIT_CSS, type KitNotify, type KitOverlayState, KitPortal, LANGUAGE_EVENT, LANGUAGE_KEY, LEVEL_TONE, LanguageSwitch, 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, Select, type ShownNotification, Spinner, type SynthNoise, type SynthNote, type SynthPreset, TABLET_MIN_PX, TOAST_DURATION, type TabItem, Tabs, TextArea, TextInput, Timer, type TitleSections, 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, cryptoBalance, currencyGlyph, defineUiConfig, effectiveVolume, errorText, formatAmount, formatCryptoAmount, grantLines, grantedBy, groupBy, iconsFor, iouCurrencies, iouCurrencyOf, isGlyph, itemDefinitions, itemGlyph, layoutFor, makeT, mergeLines, motionDurations, onLanguageChange, outlined, panel, parsePlayerPrefs, pickLanguage, plural, rarityRank, renderKitOverlays, resolveSound, resolveUiConfig, resourceName, screenBackground, setAutoPopupsHeld, setLanguage, sortFeatures, themeVars, tokenGlyph, tokenName, tokenParts, toneSurface, uiT, useAnimatedNumber, useBalances, useCatalog, useCelebrate, useCounterValue, useGameLayout, useLanguage, useLayout, useMotion, useNotify, useNow, usePlayerPrefs, usePopupClose, usePresence, useSound, useStagger, useToast, useUiKit, v, well };
package/dist/ui/index.js CHANGED
@@ -1,7 +1,8 @@
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 Ve=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function vn(t){return t}var we="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",It={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:{}}},G=(t,e,n,o)=>typeof t=="number"&&Number.isFinite(t)?Math.min(n,Math.max(e,t)):o;function Se(t){let e=It,n={...e.theme,...Ut(t?.theme??{})};n.rarity={...e.theme.rarity,...t?.theme?.rarity??{}},wn(n,t?.theme??{}),n.radius=G(n.radius,0,64,e.theme.radius),n.buttonRadius=G(n.buttonRadius,0,64,e.theme.buttonRadius);let o={...e.motion,...Ut(t?.motion??{})};o.speed=G(o.speed,.1,5,e.motion.speed),o.intensity=G(o.intensity,0,3,e.motion.intensity);let i=t?.sound??{},r={enabled:i.enabled??e.sound.enabled,volume:G(i.volume??e.sound.volume,0,1,e.sound.volume),events:{...e.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function xn(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,l,u]=[...o].map(d=>parseInt(d+d,16));return [i,r,l,o.length===4?u/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 Dt(t){let e=xn(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 qe=t=>(Dt(t)??0)>.5,kn=t=>qe(t.text)?"#1d2233":t.text;function Y(t){let e=Dt(t);return e===null||e>.35?we:"none"}function wn(t,e){let n=l=>e[l]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[l,u]of o)!n(l)&&n(u)&&(t[l]=qe(t[u])?kn(t):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=qe(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=Y(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 Ut(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}function ae(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 z={muted:false,volume:1,reducedMotion:false};function He(t){if(!t)return {...z};try{let e=JSON.parse(t);return {muted:e.muted===!0,volume:G(Number(e.volume),0,1,z.volume),reducedMotion:e.reducedMotion===!0}}catch{return {...z}}}function Ye(t,e,n=1){return !t.enabled||e.muted?0:G(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 At(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:Ve.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 Sn={countTick:45,coin:60,click:30},le=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=Sn[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=At(e,this.config);if(i.kind==="none")return;let r=Ye(this.config,this.prefs,i.volume);if(r<=0)return;let l=this.context();l&&(i.kind==="synth"?this.playSynth(l,i.preset,r):this.playFile(l,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 l of n.notes??[]){let u=i+(l.at??0),d=u+Math.max(.01,l.dur),p=e.createOscillator();p.type=l.wave??"sine",p.frequency.setValueAtTime(l.freq,u),l.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),d);let c=e.createGain(),f=Math.max(1e-4,l.gain??.4);c.gain.setValueAtTime(1e-4,u),c.gain.exponentialRampToValueAtTime(f,u+Math.min(.012,l.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(u),p.stop(d+.02);}for(let l of n.noise??[]){let u=i+(l.at??0),d=Math.max(.01,l.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 m=e.createBiquadFilter();m.type="bandpass",m.Q.value=1.2,m.frequency.setValueAtTime(l.freq??3e3,u),l.slideTo&&m.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),u+d);let b=e.createGain();b.gain.setValueAtTime(Math.max(1e-4,l.gain??.15),u),b.gain.exponentialRampToValueAtTime(1e-4,u+d),f.connect(m).connect(b).connect(r),f.start(u),f.stop(u+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 l=e.createBufferSource();l.buffer=r;let u=e.createGain();u.gain.value=o,l.connect(u).connect(e.destination),l.start();}};var je={info:3500,success:3e3,reward:4500,warning:5500,error:6500},Cn={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(u=>u.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(u=>!u.input.key&&u.level===o&&u.input.title===n.title&&u.input.message===n.message));if(r){let u={...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),u],this.play(o),this.emit(),r.id}let l={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,l].slice(-3),this.play(o),this.emit(),l.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 l=this.waiting.get(i.id);this.waiting.set(i.id,u=>{l?.(u),r(u);});})}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?.(Cn[e]);}emit(){for(let e of [...this.listeners])e();}};function Qe(){return new Re}function Xe(t,e){let n=t.theme,o=ae(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":Y(n.onGreen),"--idos-ui-on-gold-outline":Y(n.onGold),"--idos-ui-on-blue-outline":Y(n.onBlue),"--idos-ui-on-red-outline":Y(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},I={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},Je=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Me={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},ue="cubic-bezier(.2, .9, .3, 1.25)",W="cubic-bezier(.2, .8, .2, 1)",de="cubic-bezier(.5, 0, .75, .2)",Ze=`
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 je=["click","tab","open","close","reward","coin","purchase","claim","error","notify","lootbox","levelUp","countTick"];function Nn(e){return e}var Se="0 2px 0 rgba(0,0,0,.45), 0 0 1px rgba(0,0,0,.6)",Ft={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:Se,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:{}}},_=(e,t,n,o)=>typeof e=="number"&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):o;function Ce(e){let t=Ft,n={...t.theme,...Kt(e?.theme??{})};n.rarity={...t.theme.rarity,...e?.theme?.rarity??{}},Pn(n,e?.theme??{}),n.radius=_(n.radius,0,64,t.theme.radius),n.buttonRadius=_(n.buttonRadius,0,64,t.theme.buttonRadius);let o={...t.motion,...Kt(e?.motion??{})};o.speed=_(o.speed,.1,5,t.motion.speed),o.intensity=_(o.intensity,0,3,t.motion.intensity);let i=e?.sound??{},r={enabled:i.enabled??t.sound.enabled,volume:_(i.volume??t.sound.volume,0,1,t.sound.volume),events:{...t.sound.events,...i.events??{}}};return {theme:n,motion:o,sound:r}}function Mn(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let o=n[1];if(o.length===3||o.length===4){let[i,r,l,u]=[...o].map(d=>parseInt(d+d,16));return [i,r,l,o.length===4?u/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(t),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 Gt(e){let t=Mn(e);if(!t)return null;let n=o=>{let i=o/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4};return .2126*n(t[0])+.7152*n(t[1])+.0722*n(t[2])}var Ye=e=>(Gt(e)??0)>.5,Tn=e=>Ye(e.text)?"#1d2233":e.text;function j(e){let t=Gt(e);return t===null||t>.35?Se:"none"}function Pn(e,t){let n=l=>t[l]!==void 0,o=[["onGreen","green"],["onGold","gold"],["onBlue","blue"],["onRed","red"]];for(let[l,u]of o)!n(l)&&n(u)&&(e[l]=Ye(e[u])?Tn(e):"#ffffff");let i=n("panel")||n("text")||n("bgTop")||n("bgBottom"),r=Ye(e.panel);i&&r&&!n("shadow")&&(e.shadow="rgba(20, 30, 40, 0.1)"),i&&r&&!n("backdrop")&&(e.backdrop="rgba(20, 35, 40, 0.4)"),!n("panelShadow")&&(i||n("shadow"))&&(e.panelShadow=r?`0 6px 18px ${e.shadow}, 0 1px 0 ${e.shadow}, inset 0 1px 0 rgba(255, 255, 255, 0.7)`:`0 6px 0 ${e.shadow}, inset 0 2px 0 rgba(255, 255, 255, 0.12)`),i&&(n("textOutline")||(e.textOutline=j(e.text)),n("line")||(e.line=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.2)"),n("well")||(e.well=r?"rgba(0, 0, 0, 0.06)":"rgba(0, 0, 0, 0.35)"),n("wellSoft")||(e.wellSoft=r?"rgba(0, 0, 0, 0.05)":"rgba(0, 0, 0, 0.3)"),n("wellShadow")||(e.wellShadow=r?"inset 0 1px 2px rgba(0, 0, 0, 0.1)":"inset 0 2px 4px rgba(0, 0, 0, 0.4)"),n("edge")||(e.edge=r?"rgba(0, 0, 0, 0.14)":"rgba(0, 0, 0, 0.35)"),n("glow")||(e.glow=`color-mix(in srgb, ${e.blue} ${r?18:30}%, transparent)`));}function Kt(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function le(e,t){if(!e.enabled||t)return {fast:0,normal:0,slow:0};let n=1/e.speed;return {fast:Math.round(120*n),normal:Math.round(240*n),slow:Math.round(520*n)}}var z={muted:false,volume:1,reducedMotion:false};function Qe(e){if(!e)return {...z};try{let t=JSON.parse(e);return {muted:t.muted===!0,volume:_(Number(t.volume),0,1,z.volume),reducedMotion:t.reducedMotion===!0}}catch{return {...z}}}function Xe(e,t,n=1){return !e.enabled||t.muted?0:_(e.volume*t.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 _t(e,t){let n=t.events[e];return n===false?{kind:"none"}:n===void 0?{kind:"synth",preset:Re[e],volume:1}:typeof n=="string"?{kind:"synth",preset:je.includes(n)?Re[n]:Re[e],volume:1}:"url"in n?{kind:"file",url:n.url,volume:n.volume??1}:{kind:"synth",preset:n.synth,volume:n.volume??1}}var En={countTick:45,coin:60,click:30},ue=class{constructor(t,n){this.config=t;this.prefs=n;}config;prefs;ctx=null;unlocked=false;buffers=new Map;lastPlayed=new Map;detach=null;update(t,n){this.config=t,this.prefs=n;}attach(t=typeof window<"u"?window:void 0){if(!t||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)t.addEventListener(i,n,{passive:true});this.detach=()=>{for(let i of o)t.removeEventListener(i,n);};}dispose(){this.detach?.(),this.detach=null,this.ctx?.close(),this.ctx=null;}play(t){if(!this.unlocked)return;let n=En[t],o=typeof performance<"u"?performance.now():Date.now();if(n&&o-(this.lastPlayed.get(t)??-1/0)<n)return;this.lastPlayed.set(t,o);let i=_t(t,this.config);if(i.kind==="none")return;let r=Xe(this.config,this.prefs,i.volume);if(r<=0)return;let l=this.context();l&&(i.kind==="synth"?this.playSynth(l,i.preset,r):this.playFile(l,i.url,r));}context(){if(this.ctx)return this.ctx;let t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;try{this.ctx=new t;}catch{return null}return this.ctx}playSynth(t,n,o){let i=t.currentTime+.005,r=t.createGain();r.gain.value=o,r.connect(t.destination);for(let l of n.notes??[]){let u=i+(l.at??0),d=u+Math.max(.01,l.dur),p=t.createOscillator();p.type=l.wave??"sine",p.frequency.setValueAtTime(l.freq,u),l.slideTo&&p.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),d);let c=t.createGain(),f=Math.max(1e-4,l.gain??.4);c.gain.setValueAtTime(1e-4,u),c.gain.exponentialRampToValueAtTime(f,u+Math.min(.012,l.dur/3)),c.gain.exponentialRampToValueAtTime(1e-4,d),p.connect(c).connect(r),p.start(u),p.stop(d+.02);}for(let l of n.noise??[]){let u=i+(l.at??0),d=Math.max(.01,l.dur),p=t.createBuffer(1,Math.ceil(t.sampleRate*d),t.sampleRate),c=p.getChannelData(0);for(let C=0;C<c.length;C++)c[C]=Math.random()*2-1;let f=t.createBufferSource();f.buffer=p;let g=t.createBiquadFilter();g.type="bandpass",g.Q.value=1.2,g.frequency.setValueAtTime(l.freq??3e3,u),l.slideTo&&g.frequency.exponentialRampToValueAtTime(Math.max(20,l.slideTo),u+d);let v=t.createGain();v.gain.setValueAtTime(Math.max(1e-4,l.gain??.15),u),v.gain.exponentialRampToValueAtTime(1e-4,u+d),f.connect(g).connect(v).connect(r),f.start(u),f.stop(u+d+.02);}}async playFile(t,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=>t.decodeAudioData(d)).catch(()=>null),this.buffers.set(n,i));let r=await i;if(!r)return;let l=t.createBufferSource();l.buffer=r;let u=t.createGain();u.gain.value=o,l.connect(u).connect(t.destination),l.start();}};var Je={info:3500,success:3e3,reward:4500,warning:5500,error:6500},Un={info:"notify",success:"notify",warning:"notify",error:"error",reward:"reward"},Le=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=t=>(this.listeners.add(t),()=>this.listeners.delete(t));setPlayer(t){this.player=t;}setSourceResolver(t){this.resolver=t,this.emit();}source(t){if(!t)return null;try{return this.resolver?.(t)??null}catch{return null}}toast(t){let n=typeof t=="string"?{message:t}:t,o=n.level??"info",i=n.key?this.toastList.find(u=>u.input.key===n.key):void 0,r=i??(n.key?void 0:this.toastList.find(u=>!u.input.key&&u.level===o&&u.input.title===n.title&&u.input.message===n.message));if(r){let u={...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),u],this.play(o),this.emit(),r.id}let l={id:`n${this.nextId++}`,kind:"toast",level:o,input:n,count:1,revision:0};return this.toastList=[...this.toastList,l].slice(-3),this.play(o),this.emit(),l.id}alert(t){let n=t.level??"info";if(t.key){let i=this.alertQueue.find(r=>r.input.key===t.key);if(i)return this.alertQueue=this.alertQueue.map(r=>r.id===i.id?{...r,level:n,input:t,revision:r.revision+1}:r),this.emit(),new Promise(r=>{let l=this.waiting.get(i.id);this.waiting.set(i.id,u=>{l?.(u),r(u);});})}let o={id:`n${this.nextId++}`,kind:"alert",level:n,input:t,count:1,revision:0};return this.alertQueue=[...this.alertQueue,o],this.emit(),new Promise(i=>this.waiting.set(o.id,i))}dismiss(t,n=null){if(this.toastList.some(r=>r.id===t)){this.toastList=this.toastList.filter(r=>r.id!==t),this.emit();return}let o=this.alertQueue.length;if(this.alertQueue=this.alertQueue.filter(r=>r.id!==t),this.alertQueue.length===o)return;let i=this.waiting.get(t);this.waiting.delete(t),i?.(n),this.emit();}clear(){for(let t of this.waiting.values())t(null);this.waiting.clear(),this.toastList=[],this.alertQueue=[],this.emit();}play(t){this.player?.(Un[t]);}emit(){for(let t of [...this.listeners])t();}};function Ze(){return new Le}function et(e,t){let n=e.theme,o=le(e.motion,t),i=e.motion.enabled&&!t;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":j(n.onGreen),"--idos-ui-on-gold-outline":j(n.onGold),"--idos-ui-on-blue-outline":j(n.onBlue),"--idos-ui-on-red-outline":j(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?e.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},I={background:`linear-gradient(180deg, ${a.panel} 0%, ${a.panelDeep} 100%)`,border:`2px solid ${a.panelEdge}`,borderRadius:a.radius,boxShadow:a.panelShadow},tt=`radial-gradient(120% 60% at 50% 0%, ${a.glow} 0%, transparent 60%), linear-gradient(180deg, ${a.bgTop} 0%, ${a.bgBottom} 100%)`,Ne={background:a.well,border:`2px solid ${a.panelEdge}`,boxShadow:a.wellShadow},de="cubic-bezier(.2, .9, .3, 1.25)",W="cubic-bezier(.2, .8, .2, 1)",ce="cubic-bezier(.5, 0, .75, .2)",nt=`
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 } }
5
+ .idos-select option { background: var(--idos-ui-panel-deep); color: var(--idos-ui-text) }
5
6
  @keyframes idos-fade-out { from { opacity: 1 } to { opacity: 0 } }
6
7
  @keyframes idos-rise-in { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }
7
8
  @keyframes idos-drop-in { 0% { transform: translateY(-16px) scale(.97); opacity: 0 } 70% { transform: translateY(calc(2px * var(--idos-ui-k, 1))); opacity: 1 } 100% { transform: none; opacity: 1 } }
@@ -35,4 +36,4 @@ import {c}from'../chunk-UYRDWMMD.js';import {createContext,useContext,useMemo,us
35
36
  .idos-scroll::-webkit-scrollbar { width: 6px; height: 6px }
36
37
  .idos-scroll::-webkit-scrollbar-thumb { background: var(--idos-ui-panel-edge); border-radius: 3px }
37
38
  [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 $t(t){return !Number.isFinite(t)||t<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(t+1))))}function Ot(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 l of e){let u=Ot(l).map(m=>({key:m,el:document.querySelector(`[data-resource-counter="${Bt(m)}"]`)})).find(m=>m.el&&Mn(m.el));if(!u?.el)continue;let d=et(u.el.getBoundingClientRect(),o),p=n(l),c=p?et(p,o):{x:o.width/2,y:o.height/2},f=$t(l.amount);for(let m=0;m<f;m++)r.push({key:this.nextKey++,line:l,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:m*55,durationMs:i,target:u.key}),this.holds.set(u.key,(this.holds.get(u.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),Nn(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=et(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 et(t,e){return {x:t.left-e.left+t.width/2,y:t.top-e.top+t.height/2}}function Mn(t){let e=t.getBoundingClientRect();return e.width>0&&e.height>0}function Nn(t){if(!(typeof document>"u"))for(let e of document.querySelectorAll(`[data-resource-counter="${Bt(t)}"]`))e.classList.remove("idos-bump"),e.offsetWidth,e.classList.add("idos-bump");}function Bt(t){return typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/["\\]/g,"\\$&")}var zt=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",Ft="data-idos-idle",Q=(t,e)=>t+Math.random()*(e-t);function Kt(t){if(!(t instanceof HTMLElement)||t.hasAttribute(Ft))return;t.setAttribute(Ft,"");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 tt(t){t instanceof Element&&(t.matches(zt)&&Kt(t),t.querySelectorAll(zt).forEach(Kt));}function _t(t){if(typeof MutationObserver>"u")return ()=>{};tt(t);let e=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?tt(o.target):o.addedNodes.forEach(tt);});return e.observe(t,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>e.disconnect()}var Wt="idos-ui-prefs";function Un(){try{return He(typeof localStorage<"u"?localStorage.getItem(Wt):null)}catch{return {...z}}}function In(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function qt(t,e){let n=e.reducedMotion||t.motion.respectReducedMotion&&In(),o=t.motion.enabled&&!n;return {on:o,durations:ae(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 Gt=Se(null),Dn=new j,An={config:Gt,prefs:z,setPrefs:()=>{},motion:qt(Gt,z),play:()=>{},layer:null,fx:Dn,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},Vt=createContext(An);function k(){return useContext(Vt)}function $n(){return k().play}function On(){return k().motion}function Bn(){let t=k();return [t.prefs,t.setPrefs]}function zn(){return k().celebrate}function Fn(){return k().toast}function Kn(){return k().notify}function _n({config:t,children:e,overlays:n,notifications:o}){let i=useMemo(()=>Se(t),[t]),[r,l]=useState(Un),u=useCallback(S=>{l(H=>{let Et={...H,...S};try{localStorage.setItem(Wt,JSON.stringify(Et));}catch{}return Et});},[]),d=useRef(null);d.current??=new le(i.sound,r),useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),useEffect(()=>{let S=d.current;return S?.attach(),()=>S?.dispose()},[]);let p=useCallback(S=>d.current?.play(S),[]),c=useMemo(()=>qt(i,r),[i,r]),f=useRef(new j).current;f.setMotion(c),f.setPlayer(p);let[m,b]=useState(null);useEffect(()=>f.setLayer(m),[f,m]);let[C,P]=useState(null),D=useRef(C);D.current=C;let E=useCallback((S,H)=>{if(S.length===0){H?.onDone?.();return}f.reserve(S),P({lines:S,options:H});},[f]),q=useCallback(()=>{let S=D.current;S&&f.release(S.lines),P(null),S?.options?.onDone?.();},[f]),ke=useRef(null),L=o??(ke.current??=Qe());useEffect(()=>(L.setPlayer(p),()=>L.setPlayer(null)),[L,p]);let V=useMemo(()=>({toast:S=>L.toast(S),alert:S=>L.alert(S),dismiss:S=>L.dismiss(S)}),[L]),U=useCallback((S,H="info")=>{L.toast({message:S,level:H});},[L]),re=useMemo(()=>({config:i,prefs:r,setPrefs:u,motion:c,play:p,layer:m,fx:f,celebrate:E,toast:U,notify:V,provided:true}),[i,r,u,c,p,m,f,E,U,V]),se=useRef(null);useEffect(()=>se.current?_t(se.current):void 0,[]);let _=!c.on;return jsx(Vt.Provider,{value:re,children:jsxs("div",{ref:se,"data-idos-ui":"","data-idos-motion":_?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...Xe(i,_)},children:[jsx("style",{children:Ze}),e,jsx("div",{ref:b,"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:q,notifications:L})})]})})}function pe(t){let{fx:e}=k();return useSyncExternalStore(e.subscribe,()=>t(e),()=>t(e))}var Ht=typeof window<"u"?useLayoutEffect:useEffect;function it(){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 Yt(t,e,n=it()){let o=n==="ru"?e:t;return i=>o[i]??t[i]??i}function Wn(t,e,n=it()){let[o,i=o,r=i]=e.split("|"),l=new Intl.PluralRules(n).select(Math.abs(Math.trunc(t)));return n==="ru"?l==="one"?o:l==="few"?i:r:l==="one"?o:i}var qn={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",dailyLimitReached:"Today's reward limit is reached \u2014 come back tomorrow",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",cryptoTotal:"Balance",cryptoBacked:"Crypto",cryptoUnbacked:"IOU (not backed yet)",cryptoIouHint:"IOUs spend in the app like crypto; the developer backs them with real crypto later."},Vn={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",dailyLimitReached:"\u0421\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u043B\u0438\u043C\u0438\u0442 \u043D\u0430\u0433\u0440\u0430\u0434 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D \u2014 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430",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",cryptoTotal:"\u0411\u0430\u043B\u0430\u043D\u0441",cryptoBacked:"\u041A\u0440\u0438\u043F\u0442\u0430",cryptoUnbacked:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 (\u043F\u043E\u043A\u0430 \u043D\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u044B)",cryptoIouHint:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 \u0442\u0440\u0430\u0442\u044F\u0442\u0441\u044F \u0432 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u043A\u0430\u043A \u043A\u0440\u0438\u043F\u0442\u0430; \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u043F\u043E\u0437\u0436\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0442 \u0438\u0445 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u0440\u0438\u043F\u0442\u043E\u0439."},w=Yt(qn,Vn);function Hn(t){return t?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(t)?w("notEnough"):/CRYPTO_SERVER_GRANT_CAP_EXCEEDED/.test(t)?w("dailyLimitReached"):t.length>140?`${t.slice(0,140)}\u2026`:t:w("error")}function at(t){let e=[];for(let n of t?.Entries??[]){if(!n)continue;if(n.Type==="CryptoCurrency"&&n.CurrencyID&&n.AmountUsd!=null){let i=Number(n.AmountUsd);Number.isFinite(i)&&i>0&&e.push({kind:"crypto",id:n.CurrencyID,amount:i,usd:true});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==="CryptoCurrency"&&n.CurrencyID?e.push({kind:"crypto",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 jt(e)}function lt(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 me(t){switch(lt(t).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function ut(t,e){let{system:n,entity:o}=lt(t);return n==="TimedEvent"?(e?J(e,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||w("tokenEvent"):n==="Season"?w("tokenSeason"):n==="Quest"?w("tokenQuest"):n==="Leaderboard"?w("tokenScore"):t.id}function jt(t){let e=new Map;for(let n of t){let o=`${n.kind}:${n.id}${n.usd?":usd":""}`,i=e.get(o);i?i.amount+=n.amount:e.set(o,{...n});}return [...e.values()]}function Qt(t){return at(t?.Standard)}function Yn(t){return at(t?.Standard)}function jn(t){let e=t?.Resources?.Grant;return Qt(e)}function Qn(t,e,n){return t.every(o=>o.kind==="currency"?Number(e?.[o.id]?.Amount??0)>=o.amount:o.kind==="crypto"&&n&&!o.usd?Number(n[o.id]?.Amount??0)>=o.amount:true)}function Le(t){return t.usd?`$${Xn(t.amount)}`:F(t.amount)}function Xn(t){return t.toFixed(2).replace(/\.00$/,"")}function F(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);return e>=1e9?`${rt(t/1e9)}B`:e>=1e6?`${rt(t/1e6)}M`:e>=1e5?`${rt(t/1e3)}K`:Math.round(t).toLocaleString("en-US").replace(/,/g," ")}function dt(t){if(!Number.isFinite(t))return "0";let e=Math.abs(t);if(e>=1e5)return F(t);let n=e>=100?1:e>=1?2:4;return t.toLocaleString("en-US",{maximumFractionDigits:n}).replace(/,/g," ")}function rt(t){return t.toFixed(2).replace(/\.?0+$/,"")}function ct(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),l=Math.floor(i%3600/60),u=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(l).padStart(2,"0")}m`:`${l}m ${String(u).padStart(2,"0")}s`}var Xt=640,Jt=1024;function ge(t){return t>=Jt?"desktop":t>=Xt?"tablet":"phone"}function J(t,e){let n=t.data.config.getSection(e);return n!==void 0?n:t.data.config.titlePublicConfiguration?.[e]??void 0}function ft(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 st=["Legendary","Epic","Rare","Uncommon","Common"];function Jn(t){let e=st.indexOf(t??"");return e<0?st.length:e}function pt(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}))}function mt(t,e){return e?.[t]?.UnbackedRewardCurrencyID||`${t}_IOU`}function gt(t,e,n){let o=Number(t?.InventoryV2?.CryptoCurrencies?.[e]?.Amount??0)||0,i=mt(e,n),r=t?.InventoryV2?.VirtualCurrencies?.[i],l=r&&Number(r.Amount??0)||0;return {currencyID:e,backed:o,unbacked:l,total:o+l,iouID:r?i:null}}function Zn(t){return new Set(Object.keys(t??{}).map(e=>mt(e,t)))}var Zt=["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 en(t){return Zt.includes(t)}function Te(t){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(t)?"gem":/^(en|energy|dice|di)$/i.test(t)?"energy":"coin"}function yt(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 eo=/^(https?:|\/|data:)/;function M({glyph:t,size:e=24,color:n}){return en(t)?jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:to(t,n)}):eo.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 to(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 oo(t){let[e,n]=useState("phone");return Ht(()=>{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 Ue(){let{layer:t}=k(),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 Ie(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 l=setTimeout(()=>{o(false),r(false);},e);return ()=>clearTimeout(l)},[t,e,n]),{mounted:n,closing:i}}function nn(t,e=600,n){let[o,i]=useState(t),r=useRef(t),l=useRef(n);return l.current=n,useEffect(()=>{let u=r.current;if(u===t)return;if(e<=0){r.current=t,i(t);return}let d=performance.now(),p=0,c=f=>{let m=Math.min(1,(f-d)/e),b=1-Math.pow(1-m,3),C=m>=1?t:Math.round(u+(t-u)*b);C!==r.current&&l.current?.(),r.current=C,i(C),m<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[t,e]),o}function De(t,e){let n=k(),o=pe(l=>l.holding(t)>0),i=useRef(e);o||(i.current=e);let r=o?i.current:e;return nn(r,n.motion.on?650:0,()=>n.play("countTick"))}function A(){let t=c(),e=k(),[,n]=useReducer(d=>d+1,0);useEffect(()=>t?.on("user:anyUpdated",()=>n()),[t]);let o=t?.data.config.titlePublicConfiguration??null,i=useMemo(()=>t&&o?ft(J(t,"Item")):new Map,[t,o]),r=useMemo(()=>t&&o?J(t,"Currency")?.VirtualCurrencies??{}:{},[t,o]),l=useMemo(()=>t&&o?J(t,"Currency")?.CryptoCurrencies??{}:{},[t,o]),u=useCallback(d=>d?t?.localization.has(d)?t.localization.t(d):d:"",[t]);return useMemo(()=>({items:i,currencies:r,cryptoCurrencies:l,localize:u,currencyName:d=>u(r[d]?.DisplayName||l[d]?.DisplayName||d),itemName:d=>u(i.get(d)?.DisplayName||d),iconOf:d=>{if(d.kind==="currency")return r[d.id]?.ImagePath||Te(d.id);if(d.kind==="crypto"){let p=l[d.id]?.AssetPaths;return p?.Default||p?.Icon||Te(d.id)}if(d.kind==="item"){let p=i.get(d.id);return p?.ImagePath||yt(p?.Tags,p?.ItemClass)}return "box"},rarityColor:d=>e.config.theme.rarity[d??""]??e.config.theme.rarity.Common??"#a9b3c9"}),[i,r,l,u,e.config.theme.rarity])}function ht(){let t=c(),e=A(),[,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,l])=>[r,Number(l?.Amount??0)]).sort(([r],[l])=>r.localeCompare(l))}function io(t=1e3){let[e,n]=useState(()=>Date.now());return useEffect(()=>{let o=setInterval(()=>n(Date.now()),t);return ()=>clearInterval(o)},[t]),e}var Ae={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},te={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 $e(t){let[e,n]=Ae[t],o=te[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 on(t,e=false,n="md"){let[o,i]=Ae[e?"grey":t],r=te[e?"grey":t],l=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:l,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 B({children:t,onClick:e,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:l=false,style:u,className:d="",sound:p="click",title:c,...f}){let{play:m}=k();return jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${l&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:b=>{p&&m(p),e?.(b);},style:{...on(n,i,o),...u},children:r?jsx(rn,{size:18}):t})}function ye({glyph:t,onClick:e,label:n,size:o=40,tone:i,style:r,badge:l}){let{play:u}=k();return jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{u("click"),e();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Ae[i][0]}, ${Ae[i][1]})`:a.well,color:i?te[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsx(M,{glyph:t,size:o*.55}),l?jsx(he,{count:l}):null]})}function rn({size:t=28}){return jsx("span",{"aria-label":w("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 he({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,...te.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:e?null:t>99?"99+":t})}function sn({line:t,size:e=20,big:n=false,dim:o=false}){let i=A(),r=c();return jsxs("span",{title:Oe(t,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsx(M,{glyph:t.kind==="token"?me(t):i.iconOf(t),size:e}),t.kind==="item"&&t.amount===1?null:Le(t)]})}function Oe(t,e,n){return t.kind==="currency"||t.kind==="crypto"?e.currencyName(t.id):t.kind==="item"?e.itemName(t.id):t.kind==="token"?e.localize(ut(t,n)):t.id}function so({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(sn,{line:i,size:e,dim:o?.(i)},`${i.kind}:${i.id}`))})}function bt({currencyID:t,amount:e,size:n=24,onClick:o}){let i=A(),r=De(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,...Me,cursor:o?"pointer":"default"},children:[jsx(M,{glyph:i.iconOf({kind:"currency",id:t,amount:0}),size:n}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:F(r)})]})}function ao({itemID:t,count:e,level:n,onClick:o,size:i=76,selected:r=false,dim:l=false}){let u=A(),{play:d}=k(),p=u.items.get(t),c=u.rarityColor(p?.Metadata?.RarityID);return jsxs("button",{type:"button",className:"idos-press",title:u.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:l?.45:1,flex:"none"},children:[jsx(M,{glyph:u.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",F(e)]}):null,n!==void 0&&n>0?jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function lo({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)),[l,u]=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, ${l}, ${u})`,borderRadius:i/2,transition:`width ${a.slow} ${W}`}}),jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${F(t)} / ${F(e)}`})]})}function vt({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 uo({glyph:t,text:e,action:n}){return jsxs("div",{style:{...I,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsx(M,{glyph:t,size:56}),jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:e}),n]})}function co({children:t,minHeight:e=240}){return jsx("div",{style:{display:"grid",placeItems:"center",minHeight:e},children:t})}function fo({at:t,now:e,label:n}){let o=ct(t,e);return o?jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function po({tabs:t,value:e,onChange:n,style:o}){let{play:i}=k();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 l=r.id===e;return jsxs("button",{role:"tab","aria-selected":l,type:"button",className:"idos-press",onClick:()=>{l||(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:l?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:l?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsx(M,{glyph:r.glyph,size:20}):null,jsx("span",{style:{...x,...l?te.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsx(he,{count:r.badge}):null]},r.id)})})}function xt(){let{motion:t}=k();return e=>t.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(e,14)*35}ms both`}:{}}function mo({children:t,style:e,highlight:n=false,onClick:o}){let{play:i}=k();return jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...I,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:I.border,...e},children:t})}var an={...I,padding:"12px 14px",fontSize:15,color:a.text,fontFamily:a.font,outline:"none",boxSizing:"border-box"};function go({style:t,...e}){return jsx("input",{...e,style:{...an,...t}})}function yo({style:t,...e}){return jsx("textarea",{...e,style:{...an,resize:"vertical",...t}})}function ho({label:t,children:e}){return jsxs("div",{style:{display:"grid",gap:6},children:[jsx("div",{style:{...x,fontSize:13,color:a.textDim},children:t}),e]})}function bo({currencyID:t,size:e=24,align:n="left"}){let o=c(),i=A(),[r,l]=useState(false),u=gt(o?.data.user.state,t,i.cryptoCurrencies),d=De(`crypto:${t}`,u.total),p=i.cryptoCurrencies[t]?.DisplayDecimals??4,c$1=b=>b.toLocaleString("en-US",{maximumFractionDigits:Math.max(0,p)}).replace(/,/g," "),f=i.currencyName(t),m=(b,C,P=false)=>jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[jsx("span",{style:{...x,fontSize:13,color:a.textDim},children:b}),jsx("span",{style:{...x,fontSize:14,color:P?a.textDim:a.text},children:C})]});return jsxs("div",{"data-resource-counter":`crypto:${t}`,style:{position:"relative",display:"inline-flex"},onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxs("button",{type:"button","aria-label":f,"aria-expanded":r,onClick:()=>l(b=>!b),onBlur:()=>l(false),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Me,cursor:"pointer",font:"inherit"},children:[jsx(M,{glyph:i.iconOf({kind:"crypto",id:t,amount:0}),size:e}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:dt(d)}),u.unbacked>0?jsx("span",{"aria-hidden":true,style:{width:6,height:6,borderRadius:"50%",background:a.gold}}):null]}),r?jsxs("div",{role:"tooltip",style:{...I,position:"absolute",top:"calc(100% + 8px)",[n]:0,zIndex:30,minWidth:220,maxWidth:280,padding:"10px 12px",display:"grid",gap:6,animation:`idos-drop-in ${a.fast} ${W} both`},children:[jsx("span",{style:{...x,fontSize:15},children:f}),m(w("cryptoBacked"),c$1(u.backed)),u.iouID?m(w("cryptoUnbacked"),c$1(u.unbacked),u.unbacked===0):null,jsx("div",{style:{height:1,background:a.line}}),m(w("cryptoTotal"),c$1(u.total)),u.iouID?jsx("span",{style:{fontSize:12,color:a.textDim,lineHeight:1.35},children:w("cryptoIouHint")}):null]}):null]})}var Ct=createContext(()=>{});function ne(){return useContext(Ct)}function Rt({children:t}){let{layer:e}=k();return e?createPortal(t,e):jsx(Fragment,{children:t})}var Be=[],kt=new Set,wt=0,St=false,Fe=()=>{for(let t of [...kt])t();};function wo(t){St!==t&&(St=t,Fe());}function So(t){let[e]=useState(()=>Symbol("auto-popup")),[,n]=useState(0),o=useRef(false);return useEffect(()=>{if(!t){o.current=false;return}Be.push(e);let i=()=>n(r=>r+1);return kt.add(i),i(),()=>{let r=Be.indexOf(e);r>=0&&Be.splice(r,1),kt.delete(i),Fe();}},[t,e]),t?(!o.current&&Be[0]===e&&wt===0&&!St&&(o.current=true),o.current):true}function Co(t){useEffect(()=>{if(t)return wt+=1,Fe(),()=>{wt-=1,Fe();}},[t]);}function oe({children:t,onClose:e,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:l=true,sound:u=true,panelStyle:d,queued:p=false}){let c=k(),f=Ue(),m=c.motion.durations.normal,[b,C]=useState(false),P=So(p&&n);Co(!p&&n);let{mounted:D,closing:E}=Ie(n&&P&&!b,m),q=useRef(e);q.current=e;let ke=useRef(false);useEffect(()=>{!u||!n||!P||ke.current||(ke.current=true,c.play("open"));},[u,n,P,c]);let L=useCallback(()=>{b||(c.play("close"),C(true));},[b,c]);useEffect(()=>{b&&!D&&q.current?.();},[b,D]);let V=l&&e!==void 0;if(useEffect(()=>{if(!V||!D)return;let _=S=>{S.key==="Escape"&&L();};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[V,D,L]),!D)return null;let U=r==="sheet"||r==="auto"&&f==="phone",re=E,se=U?re?`idos-sheet-out ${a.normal} ${de} both`:`idos-sheet-in ${a.slow} ${W} both`:re?`idos-pop-out ${a.normal} ${de} both`:`idos-pop-in ${a.slow} ${ue} both`;return jsx(Rt,{children:jsx(Ct.Provider,{value:L,children:jsx("div",{role:"dialog","aria-modal":"true",onClick:V?L:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:U?"end stretch":"center",padding:U?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${re?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxs("div",{onClick:_=>_.stopPropagation(),className:"idos-scroll",style:{...I,width:U?"100%":`min(${i}px, 100%)`,maxHeight:U?"88%":"min(86vh, 100%)",overflowY:"auto",padding:U?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:U?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:se,...d},children:[U?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(ye,{glyph:"close",label:w("close"),onClick:L,size:36,tone:"red",style:{position:"absolute",top:U?12:8,right:U?12:8,border:"3px solid #fff"}}):null,t]})})})})}function Ro({title:t,children:e,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxs(oe,{title:t,onClose:r,width:380,children:[e,jsx(Mo,{confirmLabel:n,tone:o,onConfirm:i})]})}function Mo({confirmLabel:t,tone:e,onConfirm:n}){let o=ne(),[i,r]=useState(false);return jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsx(B,{tone:"grey",onClick:o,children:w("cancel")}),jsx(B,{tone:e,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(l=>{r(false),l!==true&&o();});},children:t??w("confirm")})]})}function No({title:t,icon:e,onClose:n,children:o,open:i=true,back:r=false,balances:l=true}){let u=k(),[d,p]=useState(false),{mounted:c,closing:f}=Ie(i&&!d,u.motion.durations.normal),m=useRef(n);m.current=n,useEffect(()=>{u.play("open");},[]),useEffect(()=>{d&&!c&&m.current();},[d,c]);let b=useCallback(()=>{u.play("close"),p(true);},[u]);return useEffect(()=>{if(!c)return;let C=P=>{P.key==="Escape"&&b();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,b]),c?jsx(Rt,{children:jsx(Ct.Provider,{value:b,children:jsxs("div",{style:{position:u.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:Je,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?de:W} 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(ye,{glyph:"back",label:w("back"),onClick:b,size:38}):null,e?jsx(M,{glyph:e,size:30}):null,jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t}),l?jsx(Lo,{}):null,r?null:jsx(ye,{glyph:"close",label:w("close"),onClick:b,size:38,tone:"red"})]}),jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function Lo(){let t=ht(),e=Ue(),n=e==="phone"?t.slice(0,2):t;return jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsx(bt,{currencyID:o,amount:i,size:e==="phone"?18:22},o))})}var _e={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},Mt={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function Po({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 cn({level:t,icon:e,size:n}){return jsx("span",{style:{...$e(_e[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(M,{glyph:e,size:n*.62}):jsx(Po,{level:t,size:n*.56})})}function fn({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(M,{glyph:t.icon,size:14}):null,jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label})]})}function Eo(t){return useSyncExternalStore(t.subscribe,()=>t.toasts,()=>t.toasts),useSyncExternalStore(t.subscribe,()=>t.currentAlert,()=>t.currentAlert),t}function pn({store:t}){Eo(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(Uo,{store:t,toast:n},n.id))}),e?jsx(Do,{store:t,alert:e,queued:t.queued},e.id):null]})}function Uo({store:t,toast:e}){let n=k(),o=e.input,i=_e[e.level],r=o.duration??je[e.level],l=t.source(o.source),u=o.actions?.[0],[d,p]=useState(false),[c,f]=useState(false),m=n.motion.durations.normal,b=useRef(()=>{});b.current=()=>{d||(p(true),setTimeout(()=>t.dismiss(e.id),m));};let C=useRef(r);useEffect(()=>{C.current=r;},[r,e.revision]),useEffect(()=>{if(r<=0||c||d)return;let E=Date.now(),q=setTimeout(()=>b.current(),C.current);return ()=>{clearTimeout(q),C.current-=Date.now()-E;}},[r,c,d,e.revision]);let P=l?.open,D=E=>{E.onPress?.(),E.openFeature&&t.source(E.openFeature)?.open?.(),b.current();};return jsxs("div",{role:e.level==="error"||e.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:P?()=>{P(),b.current();}:void 0,className:P?"idos-press":void 0,style:{...I,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:P?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${Mt[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 ${Mt[i]}`}}):jsx(cn,{level:e.level,icon:o.icon,size:34}),jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[l?jsx(fn,{source:l}):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,u?jsx("div",{style:{marginTop:6},onClick:E=>E.stopPropagation(),children:jsx(B,{size:"sm",tone:i,onClick:()=>D(u),children:u.label})}):null]}),e.count>1?jsxs("span",{style:{...$e(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":w("close"),onClick:E=>{E.stopPropagation(),b.current();},style:Io,children:jsx(M,{glyph:"close",size:14})}),r>0?jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:Mt[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},e.revision):null]})}var Io={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 Do({store:t,alert:e,queued:n}){let o=useRef(null);return useEffect(()=>t.play(e.level),[t,e.level]),jsx(oe,{queued:true,sound:false,width:380,onClose:()=>t.dismiss(e.id,o.current),children:jsx(Ao,{store:t,alert:e,queued:n,chosen:o})})}function Ao({store:t,alert:e,queued:n,chosen:o}){let i=ne(),r=e.input,l=_e[e.level],u=t.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:w("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(cn,{level:e.level,icon:r.icon,size:64})}),u?jsx(fn,{source:u}):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,m)=>f.primary||!p&&m===0?jsx(B,{tone:l,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:$o,children:f.label},f.id??f.label))})]})}var $o={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 Bo(t){return jsx(zo,{state:t})}function zo({state:t}){return jsxs(Fragment,{children:[jsx(_o,{}),jsx(Wo,{}),jsx(Vo,{}),t.celebration?jsx(Fo,{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(pn,{store:t.notifications})]})}var Ge=560;function Fo({lines:t,title:e,sound:n="reward",onDone:o}){let i=k(),r=A(),l=c(),u=useRef(new Map),d=useRef(false);useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(t,c=>u.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxs(oe,{title:e??w("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:Ge,height:Ge,left:`calc(50% - ${Ge/2}px)`,top:`calc(50% - ${Ge/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} ${ue} ${i.motion.on?.12*f:0}s both`},children:[jsx("div",{ref:m=>{m&&u.current.set(`${c.kind}:${c.id}`,m);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsx(M,{glyph:c.kind==="token"?me(c):r.iconOf(c),size:46})}),jsxs("div",{style:{...x,fontSize:16},children:["+",Le(c)]}),jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Oe(c,r,l)})]},`${c.kind}:${c.id}`))]}),jsx(Ko,{onPress:p})]})}function Ko({onPress:t}){let e=ne();return jsx(B,{attract:true,onClick:()=>{t(),e();},children:w("great")})}function _o(){let t=pe(e=>e.flights);return jsx(Fragment,{children:t.map(e=>jsx(Go,{flight:e},e.key))})}function Go({flight:t}){let e=useRef(null),n=k(),o=A();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,l=t.to.y-t.from.y,u=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${u}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${l}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(M,{glyph:o.iconOf(t.line),size:32})})}var mn=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function Wo(){let t=pe(e=>e.bursts);return jsx(Fragment,{children:t.map(e=>jsx(qo,{x:e.at.x,y:e.at.y},e.key))})}function qo({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,l)=>{if(typeof r.animate!="function")return;let u=l/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(u)*d}px, ${Math.sin(u)*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:mn[i%mn.length]}},i))})}function Vo(){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:w("offline")}):null}var Pt=["economy","events","social","profile","other"];function bn(t){return [...t].sort((e,n)=>{let o=Pt.indexOf(e.group??"other")-Pt.indexOf(n.group??"other");return o!==0?o:(e.order??100)-(n.order??100)||e.label.localeCompare(n.label)})}function Ho({items:t,onOpen:e}){let{play:n}=k(),o=xt(),i=pt(bn(t),l=>l.group??"other"),r=0;return jsx("div",{style:{display:"grid",gap:18},children:i.map(l=>jsxs("div",{children:[jsx(vt,{children:Pt.includes(l.key)?w(l.key):l.key}),jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:l.items.map(u=>jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${u.id}`,onClick:()=>{n("click"),e(u.id);},style:{...I,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsx(M,{glyph:u.icon??"box",size:40}),jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:u.label}),jsx(he,{count:u.badge??0})]},u.id))})]},l.key))})}export{he as Badge,B as Button,mo as Card,co as Center,Ro as ConfirmPopup,bo as CryptoBalanceChip,z as DEFAULT_PLAYER_PREFS,It as DEFAULT_UI_CONFIG,Jt as DESKTOP_MIN_PX,de as EASE_IN,W as EASE_OUT,ue as EASE_POP,uo as EmptyState,Ho as FeatureGrid,ho as Field,j as FxStore,Zt as GLYPHS,M as Icon,ye as IconButton,ao as ItemTile,Ze as KIT_CSS,Rt as KitPortal,_e as LEVEL_TONE,Re as NotificationStore,te as ON_TONE,oe as Popup,lo as ProgressBar,st as RARITY_ORDER,sn as ResourceBadge,bt as ResourceCounter,so as ResourceList,Ce as SOUND_PRESETS,vt as SectionTitle,rn as Spinner,Xt as TABLET_MIN_PX,je as TOAST_DURATION,po as Tabs,yo as TextArea,go as TextInput,fo as Timer,Ve as UI_SOUND_EVENTS,_n as UiKitProvider,le as UiSoundEngine,No as Window,at as bundleLines,on as buttonStyle,Qn as canAfford,J as configSection,Yn as costLines,ct as countdown,Ot as counterKeys,Qe as createNotificationStore,gt as cryptoBalance,Te as currencyGlyph,vn as defineUiConfig,Ye as effectiveVolume,Hn as errorText,F as formatAmount,dt as formatCryptoAmount,Qt as grantLines,jn as grantedBy,pt as groupBy,$t as iconsFor,Zn as iouCurrencies,mt as iouCurrencyOf,en as isGlyph,ft as itemDefinitions,yt as itemGlyph,ge as layoutFor,Yt as makeT,jt as mergeLines,ae as motionDurations,x as outlined,I as panel,He as parsePlayerPrefs,it as pickLanguage,Wn as plural,Jn as rarityRank,Bo as renderKitOverlays,At as resolveSound,Se as resolveUiConfig,Oe as resourceName,Je as screenBackground,wo as setAutoPopupsHeld,bn as sortFeatures,Xe as themeVars,me as tokenGlyph,ut as tokenName,lt as tokenParts,$e as toneSurface,w as uiT,nn as useAnimatedNumber,ht as useBalances,A as useCatalog,zn as useCelebrate,De as useCounterValue,Ue as useGameLayout,oo as useLayout,On as useMotion,Kn as useNotify,io as useNow,Bn as usePlayerPrefs,ne as usePopupClose,Ie as usePresence,$n as useSound,xt as useStagger,Fn as useToast,k as useUiKit,a as v,Me as well};
39
+ `;function Wt(e){return !Number.isFinite(e)||e<=0?0:Math.max(2,Math.min(8,Math.ceil(Math.log2(e+1))))}function qt(e){return e.kind==="currency"?[e.id]:e.kind==="item"?[`item:${e.id}`,"inventory"]:[]}var Q=class{listeners=new Set;nextKey=1;motion=null;player=null;layerEl=null;holds=new Map;reserved=new Map;flights=[];bursts=[];version=0;subscribe=t=>(this.listeners.add(t),()=>this.listeners.delete(t));setMotion(t){this.motion=t;}setPlayer(t){this.player=t;}setLayer(t){this.layerEl=t;}holding(t){return (this.holds.get(t)??0)+(this.reserved.get(t)??0)}reserve(t){if(this.motion?.rewardFlight){for(let n of t)n.kind==="currency"&&this.reserved.set(n.id,(this.reserved.get(n.id)??0)+1);this.changed();}}release(t){let n=false;for(let o of t){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(t,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 l of t){let u=qt(l).map(g=>({key:g,el:document.querySelector(`[data-resource-counter="${Vt(g)}"]`)})).find(g=>g.el&&An(g.el));if(!u?.el)continue;let d=ot(u.el.getBoundingClientRect(),o),p=n(l),c=p?ot(p,o):{x:o.width/2,y:o.height/2},f=Wt(l.amount);for(let g=0;g<f;g++)r.push({key:this.nextKey++,line:l,from:{x:c.x+(Math.random()-.5)*36,y:c.y+(Math.random()-.5)*36},to:d,delayMs:g*55,durationMs:i,target:u.key}),this.holds.set(u.key,(this.holds.get(u.key)??0)+1);}this.release(t),r.length!==0&&(this.flights=[...this.flights,...r],this.changed());}arrive(t){let n=this.flights.find(i=>i.key===t);if(!n)return;this.flights=this.flights.filter(i=>i.key!==t);let o=(this.holds.get(n.target)??1)-1;o<=0?(this.holds.delete(n.target),Dn(n.target)):this.holds.set(n.target,o),this.player?.(n.line.kind==="currency"?"coin":"countTick"),this.changed();}burst(t){if(!this.motion?.particles||!this.layerEl||!t)return;let n=ot(t.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 t of this.listeners)t();}};function ot(e,t){return {x:e.left-t.left+e.width/2,y:e.top-t.top+e.height/2}}function An(e){let t=e.getBoundingClientRect();return t.width>0&&t.height>0}function Dn(e){if(!(typeof document>"u"))for(let t of document.querySelectorAll(`[data-resource-counter="${Vt(e)}"]`))t.classList.remove("idos-bump"),t.offsetWidth,t.classList.add("idos-bump");}function Vt(e){return typeof CSS<"u"&&CSS.escape?CSS.escape(e):e.replace(/["\\]/g,"\\$&")}var Ht=".idos-bounce, .idos-shine, .idos-glow, .idos-pulse",Yt="data-idos-idle",X=(e,t)=>e+Math.random()*(t-e);function jt(e){if(!(e instanceof HTMLElement)||e.hasAttribute(Yt))return;e.setAttribute(Yt,"");let t=e.style,n=X(1.6,2.8);t.setProperty("--idos-float-speed",n.toFixed(2)),t.setProperty("--idos-float-phase",(-X(0,n)).toFixed(2)),t.setProperty("--idos-float-amp",X(3,7).toFixed(1)),t.setProperty("--idos-float-tilt",((Math.random()<.5?-1:1)*X(0,1.5)).toFixed(2));let o=X(5,7.5);t.setProperty("--idos-shine-speed",o.toFixed(2)),t.setProperty("--idos-shine-phase",(-X(0,o)).toFixed(2));}function it(e){e instanceof Element&&(e.matches(Ht)&&jt(e),e.querySelectorAll(Ht).forEach(jt));}function Qt(e){if(typeof MutationObserver>"u")return ()=>{};it(e);let t=new MutationObserver(n=>{for(let o of n)o.type==="attributes"?it(o.target):o.addedNodes.forEach(it);});return t.observe(e,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]}),()=>t.disconnect()}var Jt="idos-ui-prefs";function Kn(){try{return Qe(typeof localStorage<"u"?localStorage.getItem(Jt):null)}catch{return {...z}}}function Fn(){try{return typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return false}}function Zt(e,t){let n=t.reducedMotion||e.motion.respectReducedMotion&&Fn(),o=e.motion.enabled&&!n;return {on:o,durations:le(e.motion,n),intensity:o?e.motion.intensity:0,rewardFlight:o&&e.motion.rewardFlight,particles:o&&e.motion.particles,stagger:o&&e.motion.stagger}}var Xt=Ce(null),Gn=new Q,_n={config:Xt,prefs:z,setPrefs:()=>{},motion:Zt(Xt,z),play:()=>{},layer:null,fx:Gn,celebrate:()=>{},toast:()=>{},notify:{toast:()=>"",alert:()=>Promise.resolve(null),dismiss:()=>{}},provided:false},en=createContext(_n);function k(){return useContext(en)}function Wn(){return k().play}function qn(){return k().motion}function Vn(){let e=k();return [e.prefs,e.setPrefs]}function Hn(){return k().celebrate}function Yn(){return k().toast}function jn(){return k().notify}function Qn({config:e,children:t,overlays:n,notifications:o}){let i=useMemo(()=>Ce(e),[e]),[r,l]=useState(Kn),u=useCallback(S=>{l(Y=>{let zt={...Y,...S};try{localStorage.setItem(Jt,JSON.stringify(zt));}catch{}return zt});},[]),d=useRef(null);d.current??=new ue(i.sound,r),useEffect(()=>{d.current?.update(i.sound,r);},[i.sound,r]),useEffect(()=>{let S=d.current;return S?.attach(),()=>S?.dispose()},[]);let p=useCallback(S=>d.current?.play(S),[]),c=useMemo(()=>Zt(i,r),[i,r]),f=useRef(new Q).current;f.setMotion(c),f.setPlayer(p);let[g,v]=useState(null);useEffect(()=>f.setLayer(g),[f,g]);let[C,P]=useState(null),A=useRef(C);A.current=C;let E=useCallback((S,Y)=>{if(S.length===0){Y?.onDone?.();return}f.reserve(S),P({lines:S,options:Y});},[f]),V=useCallback(()=>{let S=A.current;S&&f.release(S.lines),P(null),S?.options?.onDone?.();},[f]),we=useRef(null),M=o??(we.current??=Ze());useEffect(()=>(M.setPlayer(p),()=>M.setPlayer(null)),[M,p]);let H=useMemo(()=>({toast:S=>M.toast(S),alert:S=>M.alert(S),dismiss:S=>M.dismiss(S)}),[M]),U=useCallback((S,Y="info")=>{M.toast({message:S,level:Y});},[M]),se=useMemo(()=>({config:i,prefs:r,setPrefs:u,motion:c,play:p,layer:g,fx:f,celebrate:E,toast:U,notify:H,provided:true}),[i,r,u,c,p,g,f,E,U,H]),ae=useRef(null);useEffect(()=>ae.current?Qt(ae.current):void 0,[]);let G=!c.on;return jsx(en.Provider,{value:se,children:jsxs("div",{ref:ae,"data-idos-ui":"","data-idos-motion":G?"off":"on",style:{display:"contents",color:"var(--idos-ui-text)",...et(i,G)},children:[jsx("style",{children:nt}),t,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:V,notifications:M})})]})})}function ge(e){let{fx:t}=k();return useSyncExternalStore(t.subscribe,()=>e(t),()=>e(t))}var tn=typeof window<"u"?useLayoutEffect:useEffect;var at="idos:language",lt="idos:language";function Jn(){if(typeof navigator>"u")return "en";let e=(navigator.language||"").toLowerCase();return ["ru","kk","uk","be","ky","uz","tg"].some(t=>e.startsWith(t))?"ru":"en"}function Zn(){try{let e=globalThis.localStorage?.getItem(at);return e==="en"||e==="ru"?e:null}catch{return null}}var Te=Zn(),Pe=new Set;function q(){return Te??Jn()}function ut(e){if(e!=="en"&&e!=="ru")return;let t=e!==q();Te=e;try{globalThis.localStorage?.setItem(at,e);}catch{}if(t){for(let n of [...Pe])n(e);typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent(lt,{detail:e}));}}function dt(e){return Pe.add(e),()=>Pe.delete(e)}typeof window<"u"&&window.addEventListener(lt,e=>{let t=e.detail;if((t==="en"||t==="ru")&&t!==Te){Te=t;for(let n of [...Pe])n(t);}});function nn(e,t,n){return o=>((n??q())==="ru"?t:e)[o]??e[o]??o}function eo(e,t,n=q()){let[o,i=o,r=i]=t.split("|"),l=new Intl.PluralRules(n).select(Math.abs(Math.trunc(e)));return n==="ru"?l==="one"?o:l==="few"?i:r:l==="one"?o:i}var to={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",dailyLimitReached:"Today's reward limit is reached \u2014 come back tomorrow",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",cryptoTotal:"Balance",cryptoBacked:"Crypto",cryptoUnbacked:"IOU (not backed yet)",cryptoIouHint:"IOUs spend in the app like crypto; the developer backs them with real crypto later."},no={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",dailyLimitReached:"\u0421\u0443\u0442\u043E\u0447\u043D\u044B\u0439 \u043B\u0438\u043C\u0438\u0442 \u043D\u0430\u0433\u0440\u0430\u0434 \u0438\u0441\u0447\u0435\u0440\u043F\u0430\u043D \u2014 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442\u0435 \u0437\u0430\u0432\u0442\u0440\u0430",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",cryptoTotal:"\u0411\u0430\u043B\u0430\u043D\u0441",cryptoBacked:"\u041A\u0440\u0438\u043F\u0442\u0430",cryptoUnbacked:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 (\u043F\u043E\u043A\u0430 \u043D\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0435\u043D\u044B)",cryptoIouHint:"\u0420\u0430\u0441\u043F\u0438\u0441\u043A\u0438 \u0442\u0440\u0430\u0442\u044F\u0442\u0441\u044F \u0432 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0438 \u043A\u0430\u043A \u043A\u0440\u0438\u043F\u0442\u0430; \u0440\u0430\u0437\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A \u043F\u043E\u0437\u0436\u0435 \u043E\u0431\u0435\u0441\u043F\u0435\u0447\u0438\u0442 \u0438\u0445 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u0440\u0438\u043F\u0442\u043E\u0439."},w=nn(to,no);function oo(e){return e?/insufficient|not enough|недостаточно|NOT_ENOUGH/i.test(e)?w("notEnough"):/CRYPTO_SERVER_GRANT_CAP_EXCEEDED/.test(e)?w("dailyLimitReached"):e.length>140?`${e.slice(0,140)}\u2026`:e:w("error")}function pt(e){let t=[];for(let n of e?.Entries??[]){if(!n)continue;if(n.Type==="CryptoCurrency"&&n.CurrencyID&&n.AmountUsd!=null){let i=Number(n.AmountUsd);Number.isFinite(i)&&i>0&&t.push({kind:"crypto",id:n.CurrencyID,amount:i,usd:true});continue}let o=Number(n.Amount??0);!Number.isFinite(o)||o<=0||(n.Type==="VirtualCurrency"&&n.CurrencyID?t.push({kind:"currency",id:n.CurrencyID,amount:o}):n.Type==="CryptoCurrency"&&n.CurrencyID?t.push({kind:"crypto",id:n.CurrencyID,amount:o}):n.Type==="Item"&&n.ItemID?t.push({kind:"item",id:n.ItemID,amount:o}):t.push({kind:"other",id:n.CurrencyID??n.ItemID??n.Type??"?",amount:o}));}for(let n of e?.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||t.push({kind:"token",id:`${o}:${i}`,amount:r});}return on(t)}function gt(e){let t=e.id.indexOf(":");return t<0?{system:e.id,entity:""}:{system:e.id.slice(0,t),entity:e.id.slice(t+1)}}function me(e){switch(gt(e).system){case "TimedEvent":return "star";case "Season":return "trophy";case "Quest":return "quest";case "Leaderboard":return "crown";default:return "ticket"}}function mt(e,t){let{system:n,entity:o}=gt(e);return n==="TimedEvent"?(t?Z(t,"TimedEvent")?.Definitions?.[o]?.Content?.Token?.DisplayName:null)||w("tokenEvent"):n==="Season"?w("tokenSeason"):n==="Quest"?w("tokenQuest"):n==="Leaderboard"?w("tokenScore"):e.id}function on(e){let t=new Map;for(let n of e){let o=`${n.kind}:${n.id}${n.usd?":usd":""}`,i=t.get(o);i?i.amount+=n.amount:t.set(o,{...n});}return [...t.values()]}function rn(e){return pt(e?.Standard)}function io(e){return pt(e?.Standard)}function ro(e){let t=e?.Resources?.Grant;return rn(t)}function so(e,t,n){return e.every(o=>o.kind==="currency"?Number(t?.[o.id]?.Amount??0)>=o.amount:o.kind==="crypto"&&n&&!o.usd?Number(n[o.id]?.Amount??0)>=o.amount:true)}function Ee(e){return e.usd?`$${ao(e.amount)}`:K(e.amount)}function ao(e){return e.toFixed(2).replace(/\.00$/,"")}function K(e){if(!Number.isFinite(e))return "0";let t=Math.abs(e);return t>=1e9?`${ct(e/1e9)}B`:t>=1e6?`${ct(e/1e6)}M`:t>=1e5?`${ct(e/1e3)}K`:Math.round(e).toLocaleString("en-US").replace(/,/g," ")}function ht(e){if(!Number.isFinite(e))return "0";let t=Math.abs(e);if(t>=1e5)return K(e);let n=t>=100?1:t>=1?2:4;return e.toLocaleString("en-US",{maximumFractionDigits:n}).replace(/,/g," ")}function ct(e){return e.toFixed(2).replace(/\.?0+$/,"")}function yt(e,t){if(!e)return null;let n=new Date(e);if(n.getUTCFullYear()>=9e3)return null;let o=n.getTime()-t;if(!Number.isFinite(o)||o<=0)return null;let i=Math.floor(o/1e3),r=Math.floor(i/3600),l=Math.floor(i%3600/60),u=i%60;return r>=24?`${Math.floor(r/24)}d ${r%24}h`:r>0?`${r}h ${String(l).padStart(2,"0")}m`:`${l}m ${String(u).padStart(2,"0")}s`}var sn=640,an=1024;function he(e){return e>=an?"desktop":e>=sn?"tablet":"phone"}function Z(e,t){let n=e.data.config.getSection(t);return n!==void 0?n:e.data.config.titlePublicConfiguration?.[t]??void 0}function bt(e){let t=new Map;for(let n of Object.values(e?.Catalogs??{}))for(let[o,i]of Object.entries(n?.Items??{}))i&&t.set(i.ItemID??o,i);return t}var ft=["Legendary","Epic","Rare","Uncommon","Common"];function lo(e){let t=ft.indexOf(e??"");return t<0?ft.length:t}function vt(e,t){let n=new Map;for(let o of e){let i=t(o),r=n.get(i);r?r.push(o):n.set(i,[o]);}return [...n.entries()].map(([o,i])=>({key:o,items:i}))}function xt(e,t){return t?.[e]?.UnbackedRewardCurrencyID||`${e}_IOU`}function kt(e,t,n){let o=Number(e?.InventoryV2?.CryptoCurrencies?.[t]?.Amount??0)||0,i=xt(t,n),r=e?.InventoryV2?.VirtualCurrencies?.[i],l=r&&Number(r.Amount??0)||0;return {currencyID:t,backed:o,unbacked:l,total:o+l,iouID:r?i:null}}function uo(e){return new Set(Object.keys(e??{}).map(t=>xt(t,e)))}var ln=["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 un(e){return ln.includes(e)}function Ue(e){return /^(ge|gem|gems|dia|diamond|cr|crystal)/i.test(e)?"gem":/^(en|energy|dice|di)$/i.test(e)?"energy":"coin"}function wt(e,t){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 [...e??[],t??""]){let i=n[o.toLowerCase()];if(i)return i}return "box"}var co=/^(https?:|\/|data:)/;function L({glyph:e,size:t=24,color:n}){return un(e)?jsx("svg",{width:t,height:t,viewBox:"0 0 32 32","aria-hidden":"true",style:{flex:"none",display:"block"},children:fo(e,n)}):co.test(e)?jsx("img",{src:e,alt:"",width:t,height:t,style:{flex:"none",display:"block",objectFit:"contain"}}):jsx("span",{"aria-hidden":"true",style:{flex:"none",display:"inline-grid",placeItems:"center",width:t,height:t,fontSize:t*.8,lineHeight:1},children:e})}function fo(e,t){switch(e){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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#ffd24a",stroke:"#e89a12",strokeWidth:"1.2",strokeLinejoin:"round"});case "check":return jsxs(Fragment,{children:[jsx("circle",{cx:"16",cy:"16",r:"13",fill:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"currentColor",strokeWidth:"2.8",strokeLinecap:"round"}),jsx("path",{d:"M14 16h14M23 10.5l5.5 5.5-5.5 5.5",fill:"none",stroke:t??"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:t??"currentColor",strokeWidth:"2.6"}),jsx("path",{d:"M6 22V7a3 3 0 013-3h11",fill:"none",stroke:t??"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})]});case "hero":return jsxs(Fragment,{children:[jsx("path",{d:"M6 15a10 10 0 0120 0v5H6z",fill:t??"#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:t??"#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:t??"#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:t??"#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:t??"#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:t??"#4fb1ff"}),jsx("path",{d:"M3 26a8 7 0 0116 0z",fill:t??"#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:t??"#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:t??"#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:t??"#59d35b",strokeWidth:"3",strokeLinecap:"round"})]});case "swords":return jsxs(Fragment,{children:[jsx("path",{d:"M5 4l14 14-2 2L3 6V4z",fill:t??"#d7e3f4"}),jsx("path",{d:"M27 4L13 18l2 2L29 6V4z",fill:t??"#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:t??"#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:t??"#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:t??"currentColor"}),jsx("path",{d:"M21 11a6 6 0 010 10M24 7a11 11 0 010 18",fill:"none",stroke:t??"currentColor",strokeWidth:"2.4",strokeLinecap:"round"})]});case "mute":return jsxs(Fragment,{children:[jsx("path",{d:"M5 12h5l7-6v20l-7-6H5z",fill:t??"currentColor"}),jsx("path",{d:"M21 12l7 8M28 12l-7 8",stroke:t??"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:t??"#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:t??"#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:t??"currentColor",strokeWidth:"3",strokeLinecap:"round"});case "close":return jsx("path",{d:"M9 9l14 14M23 9L9 23",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "back":return jsx("path",{d:"M19 7l-9 9 9 9",fill:"none",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"});case "plus":return jsx("path",{d:"M16 7v18M7 16h18",stroke:t??"currentColor",strokeWidth:"3.2",strokeLinecap:"round"});case "energy":return jsx("path",{d:"M18 3L7 18h8l-2 11 12-16h-8z",fill:t??"#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:t??"#ff5a7a"});case "offer":return jsxs(Fragment,{children:[jsx("path",{d:"M4 16L16 4h10v10L14 26z",fill:t??"#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:t??"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:t??"#ff5a5a"}),jsx("rect",{x:"6",y:"6",width:"20",height:"3.5",rx:"1.2",fill:t??"#ff5a5a"}),jsx("rect",{x:"13",y:"3.5",width:"6",height:"3",rx:"1",fill:t??"#ff5a5a"})]});case "edit":return jsxs(Fragment,{children:[jsx("path",{d:"M6 22l14-14 4 4-14 14H6z",fill:t??"#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:t??"#9aa6ff"}),jsx("path",{d:"M4 9l12 6 12-6M16 15v14",fill:"none",stroke:"#5b67c9",strokeWidth:"1.8",strokeLinejoin:"round"})]})}}function go(e){let[t,n]=useState("phone");return tn(()=>{let o=e.current;if(!o)return;let i=()=>n(he(o.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(o),()=>r.disconnect()},[e]),t}function De(){let{layer:e}=k(),t=useRef(null);t.current=e;let[n,o]=useState(()=>e?he(e.getBoundingClientRect().width):"phone");return useEffect(()=>{if(!e)return;let i=()=>o(he(e.getBoundingClientRect().width));if(i(),typeof ResizeObserver>"u")return;let r=new ResizeObserver(i);return r.observe(e),()=>r.disconnect()},[e]),n}function $e(e,t){let[n,o]=useState(e),[i,r]=useState(false);return useEffect(()=>{if(e){o(true),r(false);return}if(!n)return;if(t<=0){o(false);return}r(true);let l=setTimeout(()=>{o(false),r(false);},t);return ()=>clearTimeout(l)},[e,t,n]),{mounted:n,closing:i}}function cn(e,t=600,n){let[o,i]=useState(e),r=useRef(e),l=useRef(n);return l.current=n,useEffect(()=>{let u=r.current;if(u===e)return;if(t<=0){r.current=e,i(e);return}let d=performance.now(),p=0,c=f=>{let g=Math.min(1,(f-d)/t),v=1-Math.pow(1-g,3),C=g>=1?e:Math.round(u+(e-u)*v);C!==r.current&&l.current?.(),r.current=C,i(C),g<1&&(p=requestAnimationFrame(c));};return p=requestAnimationFrame(c),()=>cancelAnimationFrame(p)},[e,t]),o}function Oe(e,t){let n=k(),o=ge(l=>l.holding(e)>0),i=useRef(t);o||(i.current=t);let r=o?i.current:t;return cn(r,n.motion.on?650:0,()=>n.play("countTick"))}function D(){let e=c(),t=k(),[,n]=useReducer(d=>d+1,0);useEffect(()=>e?.on("user:anyUpdated",()=>n()),[e]);let o=e?.data.config.titlePublicConfiguration??null,i=useMemo(()=>e&&o?bt(Z(e,"Item")):new Map,[e,o]),r=useMemo(()=>e&&o?Z(e,"Currency")?.VirtualCurrencies??{}:{},[e,o]),l=useMemo(()=>e&&o?Z(e,"Currency")?.CryptoCurrencies??{}:{},[e,o]),u=useCallback(d=>d?e?.localization.has(d)?e.localization.t(d):d:"",[e]);return useMemo(()=>({items:i,currencies:r,cryptoCurrencies:l,localize:u,currencyName:d=>u(r[d]?.DisplayName||l[d]?.DisplayName||d),itemName:d=>u(i.get(d)?.DisplayName||d),iconOf:d=>{if(d.kind==="currency")return r[d.id]?.ImagePath||Ue(d.id);if(d.kind==="crypto"){let p=l[d.id]?.AssetPaths;return p?.Default||p?.Icon||Ue(d.id)}if(d.kind==="item"){let p=i.get(d.id);return p?.ImagePath||wt(p?.Tags,p?.ItemClass)}return "box"},rarityColor:d=>t.config.theme.rarity[d??""]??t.config.theme.rarity.Common??"#a9b3c9"}),[i,r,l,u,t.config.theme.rarity])}function St(){let e=c(),t=D(),[,n]=useReducer(r=>r+1,0);useEffect(()=>e?.on("user:anyUpdated",()=>n()),[e]);let o=e?.data.user.state?.InventoryV2?.VirtualCurrencies??{},i=Object.keys(t.currencies);return Object.entries(o).filter(([r])=>i.length===0||i.includes(r)).map(([r,l])=>[r,Number(l?.Amount??0)]).sort(([r],[l])=>r.localeCompare(l))}function mo(e=1e3){let[t,n]=useState(()=>Date.now());return useEffect(()=>{let o=setInterval(()=>n(Date.now()),e);return ()=>clearInterval(o)},[e]),t}var Be={green:[a.green,a.greenDeep],gold:[a.gold,a.goldDeep],blue:[a.blue,a.blueDeep],red:[a.red,a.redDeep],grey:["#8e95b8","#5b6187"]},ne={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:Se}};function ze(e){let[t,n]=Be[e],o=ne[e];return {background:`linear-gradient(180deg, ${t} 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 fn(e,t=false,n="md"){let[o,i]=Be[t?"grey":e],r=ne[t?"grey":e],l=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:l,minHeight:n==="sm"?34:44,cursor:t?"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:t?.75:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:6}}function B({children:e,onClick:t,tone:n="green",size:o="md",disabled:i=false,busy:r=false,attract:l=false,style:u,className:d="",sound:p="click",title:c,...f}){let{play:g}=k();return jsx("button",{type:"button",title:c,"data-tutorial-anchor":f["data-tutorial-anchor"],className:`idos-press ${l&&!i?"idos-shine idos-bounce":""} ${d}`,disabled:i||r,onClick:v=>{p&&g(p),t?.(v);},style:{...fn(n,i,o),...u},children:r?jsx(pn,{size:18}):e})}function ye({glyph:e,onClick:t,label:n,size:o=40,tone:i,style:r,badge:l}){let{play:u}=k();return jsxs("button",{type:"button","aria-label":n,title:n,className:"idos-press",onClick:()=>{u("click"),t();},style:{position:"relative",width:o,height:o,borderRadius:"50%",border:`2px solid ${a.panelEdge}`,background:i?`linear-gradient(180deg, ${Be[i][0]}, ${Be[i][1]})`:a.well,color:i?ne[i].color:a.text,display:"grid",placeItems:"center",cursor:"pointer",padding:0,flex:"none",...r},children:[jsx(L,{glyph:e,size:o*.55}),l?jsx(be,{count:l}):null]})}function pn({size:e=28}){return jsx("span",{"aria-label":w("loading"),style:{width:e,height:e,borderRadius:"50%",border:`${Math.max(2,e/8)}px solid color-mix(in srgb, currentColor 25%, transparent)`,borderTopColor:"currentColor",animation:"idos-spin .8s linear infinite",display:"inline-block",flex:"none"}})}function be({count:e,dot:t=false,style:n}){return !e||e<=0?null:jsx("span",{className:"idos-pulse",style:{position:"absolute",top:-4,right:-4,minWidth:t?12:20,height:t?12:20,padding:t?0:"0 5px",borderRadius:999,background:a.red,border:"2px solid #fff",...x,...ne.red,fontSize:11,lineHeight:"16px",textAlign:"center",pointerEvents:"none",zIndex:1,...n},children:t?null:e>99?"99+":e})}function gn({line:e,size:t=20,big:n=false,dim:o=false}){let i=D(),r=c();return jsxs("span",{title:Ke(e,i,r),style:{display:"inline-flex",alignItems:"center",gap:4,...x,fontSize:n?18:14,color:o?a.red:a.text},children:[jsx(L,{glyph:e.kind==="token"?me(e):i.iconOf(e),size:t}),e.kind==="item"&&e.amount===1?null:Ee(e)]})}function Ke(e,t,n){return e.kind==="currency"||e.kind==="crypto"?t.currencyName(e.id):e.kind==="item"?t.itemName(e.id):e.kind==="token"?t.localize(mt(e,n)):e.id}function yo({lines:e,size:t=18,gap:n=8,dimIf:o}){return jsx("span",{style:{display:"inline-flex",gap:n,flexWrap:"wrap",alignItems:"center",justifyContent:"center"},children:e.map(i=>jsx(gn,{line:i,size:t,dim:o?.(i)},`${i.kind}:${i.id}`))})}function Ct({currencyID:e,amount:t,size:n=24,onClick:o}){let i=D(),r=Oe(e,t);return jsxs("div",{"data-resource-counter":e,title:i.currencyName(e),onClick:o,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Ne,cursor:o?"pointer":"default"},children:[jsx(L,{glyph:i.iconOf({kind:"currency",id:e,amount:0}),size:n}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:K(r)})]})}function bo({itemID:e,count:t,level:n,onClick:o,size:i=76,selected:r=false,dim:l=false}){let u=D(),{play:d}=k(),p=u.items.get(e),c=u.rarityColor(p?.Metadata?.RarityID);return jsxs("button",{type:"button",className:"idos-press",title:u.itemName(e),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:l?.45:1,flex:"none"},children:[jsx(L,{glyph:u.iconOf({kind:"item",id:e,amount:1}),size:i*.56}),t!==void 0&&t>1?jsxs("span",{style:{position:"absolute",right:4,bottom:2,...x,fontSize:14},children:["\xD7",K(t)]}):null,n!==void 0&&n>0?jsxs("span",{style:{position:"absolute",left:5,top:2,...x,fontSize:12},children:["Lv",n]}):null]})}function vo({value:e,max:t,tone:n="green",label:o,height:i=18}){let r=Math.max(0,Math.min(100,e/Math.max(1,t)*100)),[l,u]=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, ${l}, ${u})`,borderRadius:i/2,transition:`width ${a.slow} ${W}`}}),jsx("div",{style:{position:"absolute",inset:0,display:"grid",placeItems:"center",...x,fontSize:Math.max(10,i-6)},children:o??`${K(e)} / ${K(t)}`})]})}function Rt({children:e,right:t}){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:e}),t]})}function xo({glyph:e,text:t,action:n}){return jsxs("div",{style:{...I,padding:24,textAlign:"center",display:"grid",gap:12,justifyItems:"center",animation:`idos-rise-in ${a.normal} ease both`},children:[jsx(L,{glyph:e,size:56}),jsx("div",{style:{...x,fontWeight:700,color:a.textDim,fontSize:15,maxWidth:340},children:t}),n]})}function ko({children:e,minHeight:t=240}){return jsx("div",{style:{display:"grid",placeItems:"center",minHeight:t},children:e})}function wo({at:e,now:t,label:n}){let o=yt(e,t);return o?jsxs("span",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,whiteSpace:"nowrap"},children:[n?`${n} `:"",o]}):null}function Lt({tabs:e,value:t,onChange:n,style:o}){let{play:i}=k();return e.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:e.map(r=>{let l=r.id===t;return jsxs("button",{role:"tab","aria-selected":l,type:"button",className:"idos-press",onClick:()=>{l||(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:l?`linear-gradient(180deg, ${a.blue}, ${a.blueDeep})`:"transparent",boxShadow:l?`0 3px 0 ${a.edge}, inset 0 2px 0 rgba(255,255,255,.3)`:"none",transition:`background ${a.fast} ease`},children:[r.glyph?jsx(L,{glyph:r.glyph,size:20}):null,jsx("span",{style:{...x,...l?ne.blue:{color:a.textDim},fontSize:14},children:r.label}),r.badge?jsx(be,{count:r.badge}):null]},r.id)})})}function Nt(){let{motion:e}=k();return t=>e.stagger?{animation:`idos-rise-in ${a.normal} ease ${Math.min(t,14)*35}ms both`}:{}}function So({children:e,style:t,highlight:n=false,onClick:o}){let{play:i}=k();return jsx("div",{className:o?"idos-press":void 0,onClick:o?()=>{i("click"),o();}:void 0,style:{...I,padding:12,cursor:o?"pointer":void 0,border:n?`2px solid ${a.gold}`:I.border,...t},children:e})}var Mt={...I,padding:"12px 14px",fontSize:15,color:a.text,fontFamily:a.font,outline:"none",boxSizing:"border-box"};function Co({style:e,...t}){return jsx("input",{...t,style:{...Mt,...e}})}function Ro({style:e,...t}){return jsx("textarea",{...t,style:{...Mt,resize:"vertical",...e}})}function Lo({style:e,children:t,...n}){return jsx("select",{...n,className:`idos-select ${n.className??""}`,style:{...Mt,padding:"9px 12px",cursor:n.disabled?"default":"pointer",...e},children:t})}function No({label:e,children:t}){return jsxs("div",{style:{display:"grid",gap:6},children:[jsx("div",{style:{...x,fontSize:13,color:a.textDim},children:e}),t]})}function Mo({currencyID:e,size:t=24,align:n="left"}){let o=c(),i=D(),[r,l]=useState(false),u=kt(o?.data.user.state,e,i.cryptoCurrencies),d=Oe(`crypto:${e}`,u.total),p=i.cryptoCurrencies[e]?.DisplayDecimals??4,c$1=v=>v.toLocaleString("en-US",{maximumFractionDigits:Math.max(0,p)}).replace(/,/g," "),f=i.currencyName(e),g=(v,C,P=false)=>jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[jsx("span",{style:{...x,fontSize:13,color:a.textDim},children:v}),jsx("span",{style:{...x,fontSize:14,color:P?a.textDim:a.text},children:C})]});return jsxs("div",{"data-resource-counter":`crypto:${e}`,style:{position:"relative",display:"inline-flex"},onMouseEnter:()=>l(true),onMouseLeave:()=>l(false),children:[jsxs("button",{type:"button","aria-label":f,"aria-expanded":r,onClick:()=>l(v=>!v),onBlur:()=>l(false),style:{display:"inline-flex",alignItems:"center",gap:6,padding:"4px 12px 4px 6px",borderRadius:999,...Ne,cursor:"pointer",font:"inherit"},children:[jsx(L,{glyph:i.iconOf({kind:"crypto",id:e,amount:0}),size:t}),jsx("span",{style:{...x,fontSize:15,minWidth:36,textAlign:"right"},children:ht(d)}),u.unbacked>0?jsx("span",{"aria-hidden":true,style:{width:6,height:6,borderRadius:"50%",background:a.gold}}):null]}),r?jsxs("div",{role:"tooltip",style:{...I,position:"absolute",top:"calc(100% + 8px)",[n]:0,zIndex:30,minWidth:220,maxWidth:280,padding:"10px 12px",display:"grid",gap:6,animation:`idos-drop-in ${a.fast} ${W} both`},children:[jsx("span",{style:{...x,fontSize:15},children:f}),g(w("cryptoBacked"),c$1(u.backed)),u.iouID?g(w("cryptoUnbacked"),c$1(u.unbacked),u.unbacked===0):null,jsx("div",{style:{height:1,background:a.line}}),g(w("cryptoTotal"),c$1(u.total)),u.iouID?jsx("span",{style:{fontSize:12,color:a.textDim,lineHeight:1.35},children:w("cryptoIouHint")}):null]}):null]})}var Ut=createContext(()=>{});function oe(){return useContext(Ut)}function It({children:e}){let{layer:t}=k();return t?createPortal(e,t):jsx(Fragment,{children:e})}var Fe=[],Tt=new Set,Pt=0,Et=false,_e=()=>{for(let e of [...Tt])e();};function Uo(e){Et!==e&&(Et=e,_e());}function Io(e){let[t]=useState(()=>Symbol("auto-popup")),[,n]=useState(0),o=useRef(false);return useEffect(()=>{if(!e){o.current=false;return}Fe.push(t);let i=()=>n(r=>r+1);return Tt.add(i),i(),()=>{let r=Fe.indexOf(t);r>=0&&Fe.splice(r,1),Tt.delete(i),_e();}},[e,t]),e?(!o.current&&Fe[0]===t&&Pt===0&&!Et&&(o.current=true),o.current):true}function Ao(e){useEffect(()=>{if(e)return Pt+=1,_e(),()=>{Pt-=1,_e();}},[e]);}function ie({children:e,onClose:t,open:n=true,title:o,width:i=400,variant:r="auto",dismissible:l=true,sound:u=true,panelStyle:d,queued:p=false}){let c=k(),f=De(),g=c.motion.durations.normal,[v,C]=useState(false),P=Io(p&&n);Ao(!p&&n);let{mounted:A,closing:E}=$e(n&&P&&!v,g),V=useRef(t);V.current=t;let we=useRef(false);useEffect(()=>{!u||!n||!P||we.current||(we.current=true,c.play("open"));},[u,n,P,c]);let M=useCallback(()=>{v||(c.play("close"),C(true));},[v,c]);useEffect(()=>{v&&!A&&V.current?.();},[v,A]);let H=l&&t!==void 0;if(useEffect(()=>{if(!H||!A)return;let G=S=>{S.key==="Escape"&&M();};return window.addEventListener("keydown",G),()=>window.removeEventListener("keydown",G)},[H,A,M]),!A)return null;let U=r==="sheet"||r==="auto"&&f==="phone",se=E,ae=U?se?`idos-sheet-out ${a.normal} ${ce} both`:`idos-sheet-in ${a.slow} ${W} both`:se?`idos-pop-out ${a.normal} ${ce} both`:`idos-pop-in ${a.slow} ${de} both`;return jsx(It,{children:jsx(Ut.Provider,{value:M,children:jsx("div",{role:"dialog","aria-modal":"true",onClick:H?M:void 0,style:{position:c.layer?"absolute":"fixed",inset:0,zIndex:20,background:a.backdrop,display:"grid",placeItems:U?"end stretch":"center",padding:U?0:16,pointerEvents:"auto",fontFamily:a.font,color:a.text,animation:`${se?"idos-fade-out":"idos-fade-in"} ${a.normal} ease both`},children:jsxs("div",{onClick:G=>G.stopPropagation(),className:"idos-scroll",style:{...I,width:U?"100%":`min(${i}px, 100%)`,maxHeight:U?"88%":"min(86vh, 100%)",overflowY:"auto",padding:U?"22px 16px calc(18px + env(safe-area-inset-bottom))":18,borderRadius:U?`${a.radius} ${a.radius} 0 0`:a.radius,display:"grid",gap:14,position:"relative",animation:ae,...d},children:[U?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,t?jsx(ye,{glyph:"close",label:w("close"),onClick:M,size:36,tone:"red",style:{position:"absolute",top:U?12:8,right:U?12:8,border:"3px solid #fff"}}):null,e]})})})})}function Do({title:e,children:t,confirmLabel:n,tone:o="green",onConfirm:i,onClose:r}){return jsxs(ie,{title:e,onClose:r,width:380,children:[t,jsx($o,{confirmLabel:n,tone:o,onConfirm:i})]})}function $o({confirmLabel:e,tone:t,onConfirm:n}){let o=oe(),[i,r]=useState(false);return jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:10},children:[jsx(B,{tone:"grey",onClick:o,children:w("cancel")}),jsx(B,{tone:t,busy:i,onClick:()=>{r(true),Promise.resolve(n()).then(l=>{r(false),l!==true&&o();});},children:e??w("confirm")})]})}function Oo({title:e,icon:t,onClose:n,children:o,open:i=true,back:r=false,balances:l=true}){let u=k(),[d,p]=useState(false),{mounted:c,closing:f}=$e(i&&!d,u.motion.durations.normal),g=useRef(n);g.current=n,useEffect(()=>{u.play("open");},[]),useEffect(()=>{d&&!c&&g.current();},[d,c]);let v=useCallback(()=>{u.play("close"),p(true);},[u]);return useEffect(()=>{if(!c)return;let C=P=>{P.key==="Escape"&&v();};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[c,v]),c?jsx(It,{children:jsx(Ut.Provider,{value:v,children:jsxs("div",{style:{position:u.layer?"absolute":"fixed",inset:0,zIndex:10,display:"grid",gridTemplateRows:"auto minmax(0, 1fr)",background:tt,color:a.text,fontFamily:a.font,pointerEvents:"auto",animation:`${f?"idos-window-out":"idos-window-in"} ${a.normal} ${f?ce:W} 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(ye,{glyph:"back",label:w("back"),onClick:v,size:38}):null,t?jsx(L,{glyph:t,size:30}):null,jsx("div",{style:{...x,fontSize:20,flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e}),l?jsx(Bo,{}):null,r?null:jsx(ye,{glyph:"close",label:w("close"),onClick:v,size:38,tone:"red"})]}),jsx("div",{className:"idos-scroll",style:{overflowY:"auto",padding:"14px 14px 24px"},children:o})]})})}):null}function Bo(){let e=St(),t=De(),n=t==="phone"?e.slice(0,2):e;return jsx("div",{style:{display:"flex",gap:6,flex:"none"},children:n.map(([o,i])=>jsx(Ct,{currencyID:o,amount:i,size:t==="phone"?18:22},o))})}var qe={info:"blue",success:"green",warning:"gold",error:"red",reward:"gold"},At={blue:a.blue,green:a.green,gold:a.gold,red:a.red,grey:a.textDim};function Ko({level:e,size:t}){let n={fill:"none",stroke:"currentColor",strokeWidth:2.6,strokeLinecap:"round",strokeLinejoin:"round"};return jsx("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",children:e==="success"?jsx("path",{d:"M5 12.5l4.5 4.5L19 7.5",...n}):e==="error"?jsx("path",{d:"M7 7l10 10M17 7L7 17",...n}):e==="warning"?jsxs(Fragment,{children:[jsx("path",{d:"M12 6v8",...n}),jsx("circle",{cx:"12",cy:"18.2",r:"1.6",fill:"currentColor"})]}):e==="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 bn({level:e,icon:t,size:n}){return jsx("span",{style:{...ze(qe[e]),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:t?jsx(L,{glyph:t,size:n*.62}):jsx(Ko,{level:e,size:n*.56})})}function vn({source:e}){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:[e.icon?jsx(L,{glyph:e.icon,size:14}):null,jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label})]})}function Fo(e){return useSyncExternalStore(e.subscribe,()=>e.toasts,()=>e.toasts),useSyncExternalStore(e.subscribe,()=>e.currentAlert,()=>e.currentAlert),e}function xn({store:e}){Fo(e);let t=e.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:e.toasts.map(n=>jsx(Go,{store:e,toast:n},n.id))}),t?jsx(Wo,{store:e,alert:t,queued:e.queued},t.id):null]})}function Go({store:e,toast:t}){let n=k(),o=t.input,i=qe[t.level],r=o.duration??Je[t.level],l=e.source(o.source),u=o.actions?.[0],[d,p]=useState(false),[c,f]=useState(false),g=n.motion.durations.normal,v=useRef(()=>{});v.current=()=>{d||(p(true),setTimeout(()=>e.dismiss(t.id),g));};let C=useRef(r);useEffect(()=>{C.current=r;},[r,t.revision]),useEffect(()=>{if(r<=0||c||d)return;let E=Date.now(),V=setTimeout(()=>v.current(),C.current);return ()=>{clearTimeout(V),C.current-=Date.now()-E;}},[r,c,d,t.revision]);let P=l?.open,A=E=>{E.onPress?.(),E.openFeature&&e.source(E.openFeature)?.open?.(),v.current();};return jsxs("div",{role:t.level==="error"||t.level==="warning"?"alert":"status",onPointerEnter:()=>f(true),onPointerLeave:()=>f(false),onClick:P?()=>{P(),v.current();}:void 0,className:P?"idos-press":void 0,style:{...I,position:"relative",overflow:"hidden",pointerEvents:"auto",cursor:P?"pointer":"default",display:"flex",gap:10,alignItems:"flex-start",padding:"10px 10px 12px 14px",boxShadow:`${a.panelShadow}, inset 4px 0 0 ${At[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 ${At[i]}`}}):jsx(bn,{level:t.level,icon:o.icon,size:34}),jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gap:2},children:[l?jsx(vn,{source:l}):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,u?jsx("div",{style:{marginTop:6},onClick:E=>E.stopPropagation(),children:jsx(B,{size:"sm",tone:i,onClick:()=>A(u),children:u.label})}):null]}),t.count>1?jsxs("span",{style:{...ze(i),flex:"none",alignSelf:"center",borderRadius:999,padding:"1px 8px",fontSize:12,fontWeight:800},children:["\xD7",t.count]}):null,jsx("button",{type:"button","aria-label":w("close"),onClick:E=>{E.stopPropagation(),v.current();},style:_o,children:jsx(L,{glyph:"close",size:14})}),r>0?jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,right:0,bottom:0,height:3,background:At[i],opacity:.8,transformOrigin:"left center",animation:`idos-timer ${r}ms linear forwards`,animationPlayState:c||d?"paused":"running"}},t.revision):null]})}var _o={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:e,alert:t,queued:n}){let o=useRef(null);return useEffect(()=>e.play(t.level),[e,t.level]),jsx(ie,{queued:true,sound:false,width:380,onClose:()=>e.dismiss(t.id,o.current),children:jsx(qo,{store:e,alert:t,queued:n,chosen:o})})}function qo({store:e,alert:t,queued:n,chosen:o}){let i=oe(),r=t.input,l=qe[t.level],u=e.source(r.source),d=r.actions&&r.actions.length>0?r.actions:[{id:"ok",label:w("ok"),primary:true}],p=d.some(f=>f.primary),c=f=>{o.current=f.id??f.label,f.onPress?.(),f.openFeature&&e.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:t.level==="reward"?"idos-bounce":void 0,children:jsx(bn,{level:t.level,icon:r.icon,size:64})}),u?jsx(vn,{source:u}):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,g)=>f.primary||!p&&g===0?jsx(B,{tone:l,onClick:()=>c(f),style:{width:"100%"},children:f.label},f.id??f.label):jsx("button",{type:"button",className:"idos-press",onClick:()=>c(f),style:Vo,children:f.label},f.id??f.label))})]})}var Vo={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 Yo(e){return jsx(jo,{state:e})}function jo({state:e}){return jsxs(Fragment,{children:[jsx(Jo,{}),jsx(ei,{}),jsx(ni,{}),e.celebration?jsx(Qo,{lines:e.celebration.lines,title:e.celebration.options?.title,sound:e.celebration.options?.sound,onDone:e.finishCelebration},e.celebration.lines.map(t=>t.id).join()):null,jsx(xn,{store:e.notifications})]})}var Ve=560;function Qo({lines:e,title:t,sound:n="reward",onDone:o}){let i=k(),r=D(),l=c(),u=useRef(new Map),d=useRef(false);useEffect(()=>{i.play(n);},[]);let p=()=>{d.current||(d.current=true,i.fx.fly(e,c=>u.current.get(`${c.kind}:${c.id}`)?.getBoundingClientRect()??null));};return jsxs(ie,{title:t??w("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:Ve,height:Ve,left:`calc(50% - ${Ve/2}px)`,top:`calc(50% - ${Ve/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%"}})}),e.map((c,f)=>jsxs("div",{style:{display:"grid",justifyItems:"center",gap:4,zIndex:1,animation:`idos-pop-in ${a.slow} ${de} ${i.motion.on?.12*f:0}s both`},children:[jsx("div",{ref:g=>{g&&u.current.set(`${c.kind}:${c.id}`,g);},style:{width:70,height:70,borderRadius:18,display:"grid",placeItems:"center",background:a.wellSoft,border:`2px solid ${a.line}`},children:jsx(L,{glyph:c.kind==="token"?me(c):r.iconOf(c),size:46})}),jsxs("div",{style:{...x,fontSize:16},children:["+",Ee(c)]}),jsx("div",{style:{...x,fontSize:12,color:a.textDim,fontWeight:700,maxWidth:96,textAlign:"center"},children:Ke(c,r,l)})]},`${c.kind}:${c.id}`))]}),jsx(Xo,{onPress:p})]})}function Xo({onPress:e}){let t=oe();return jsx(B,{attract:true,onClick:()=>{e(),t();},children:w("great")})}function Jo(){let e=ge(t=>t.flights);return jsx(Fragment,{children:e.map(t=>jsx(Zo,{flight:t},t.key))})}function Zo({flight:e}){let t=useRef(null),n=k(),o=D();return useLayoutEffect(()=>{let i=t.current;if(!i||typeof i.animate!="function"){n.fx.arrive(e.key);return}let r=e.to.x-e.from.x,l=e.to.y-e.from.y,u=(Math.random()-.5)*120,d=i.animate([{transform:"translate(0px, 0px) scale(.4)",opacity:0},{transform:`translate(${u}px, ${ -40-Math.random()*40}px) scale(1.15)`,opacity:1,offset:.3},{transform:`translate(${r}px, ${l}px) scale(.55)`,opacity:1}],{duration:e.durationMs,delay:e.delayMs,easing:"cubic-bezier(.45,.05,.55,.95)",fill:"both"});return d.onfinish=()=>n.fx.arrive(e.key),()=>{d.onfinish=null,d.cancel();}},[]),jsx("div",{ref:t,style:{position:"absolute",left:e.from.x-16,top:e.from.y-16,width:32,height:32,zIndex:60,pointerEvents:"none",opacity:0},children:jsx(L,{glyph:o.iconOf(e.line),size:32})})}var kn=["#ffd24a","#ffffff","#59d35b","#4fb1ff","#ff7ab8"];function ei(){let e=ge(t=>t.bursts);return jsx(Fragment,{children:e.map(t=>jsx(ti,{x:t.at.x,y:t.at.y},t.key))})}function ti({x:e,y:t}){let n=useRef(null);return useLayoutEffect(()=>{let o=n.current;if(!o)return;let i=[];return o.querySelectorAll("span").forEach((r,l)=>{if(typeof r.animate!="function")return;let u=l/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(u)*d}px, ${Math.sin(u)*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:e,top:t,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:kn[i%kn.length]}},i))})}function ni(){let e=c(),[t,n]=useState(false);return useEffect(()=>{if(!e)return;let o,i=e.on("error:connection",()=>{n(true),clearTimeout(o),o=setTimeout(()=>n(false),5e3);});return ()=>{i(),clearTimeout(o);}},[e]),t?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:w("offline")}):null}var ii=e=>dt(e);function Cn(){return useSyncExternalStore(ii,q,q)}function ri({style:e}){let t=Cn();return jsx(Lt,{tabs:[{id:"en",label:"English"},{id:"ru",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439"}],value:t,onChange:ut,style:e})}var Bt=["economy","events","social","profile","other"];function Ln(e){return [...e].sort((t,n)=>{let o=Bt.indexOf(t.group??"other")-Bt.indexOf(n.group??"other");return o!==0?o:(t.order??100)-(n.order??100)||t.label.localeCompare(n.label)})}function ai({items:e,onOpen:t}){let{play:n}=k(),o=Nt(),i=vt(Ln(e),l=>l.group??"other"),r=0;return jsx("div",{style:{display:"grid",gap:18},children:i.map(l=>jsxs("div",{children:[jsx(Rt,{children:Bt.includes(l.key)?w(l.key):l.key}),jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(104px, 1fr))",gap:10},children:l.items.map(u=>jsxs("button",{type:"button",className:"idos-press","data-tutorial-anchor":`feature:${u.id}`,onClick:()=>{n("click"),t(u.id);},style:{...I,position:"relative",padding:"12px 6px 10px",display:"grid",justifyItems:"center",gap:6,cursor:"pointer",color:a.text,...o(r++)},children:[jsx(L,{glyph:u.icon??"box",size:40}),jsx("span",{style:{...x,fontSize:13,textAlign:"center",lineHeight:1.15},children:u.label}),jsx(be,{count:u.badge??0})]},u.id))})]},l.key))})}export{be as Badge,B as Button,So as Card,ko as Center,Do as ConfirmPopup,Mo as CryptoBalanceChip,z as DEFAULT_PLAYER_PREFS,Ft as DEFAULT_UI_CONFIG,an as DESKTOP_MIN_PX,ce as EASE_IN,W as EASE_OUT,de as EASE_POP,xo as EmptyState,ai as FeatureGrid,No as Field,Q as FxStore,ln as GLYPHS,L as Icon,ye as IconButton,bo as ItemTile,nt as KIT_CSS,It as KitPortal,lt as LANGUAGE_EVENT,at as LANGUAGE_KEY,qe as LEVEL_TONE,ri as LanguageSwitch,Le as NotificationStore,ne as ON_TONE,ie as Popup,vo as ProgressBar,ft as RARITY_ORDER,gn as ResourceBadge,Ct as ResourceCounter,yo as ResourceList,Re as SOUND_PRESETS,Rt as SectionTitle,Lo as Select,pn as Spinner,sn as TABLET_MIN_PX,Je as TOAST_DURATION,Lt as Tabs,Ro as TextArea,Co as TextInput,wo as Timer,je as UI_SOUND_EVENTS,Qn as UiKitProvider,ue as UiSoundEngine,Oo as Window,pt as bundleLines,fn as buttonStyle,so as canAfford,Z as configSection,io as costLines,yt as countdown,qt as counterKeys,Ze as createNotificationStore,kt as cryptoBalance,Ue as currencyGlyph,Nn as defineUiConfig,Xe as effectiveVolume,oo as errorText,K as formatAmount,ht as formatCryptoAmount,rn as grantLines,ro as grantedBy,vt as groupBy,Wt as iconsFor,uo as iouCurrencies,xt as iouCurrencyOf,un as isGlyph,bt as itemDefinitions,wt as itemGlyph,he as layoutFor,nn as makeT,on as mergeLines,le as motionDurations,dt as onLanguageChange,x as outlined,I as panel,Qe as parsePlayerPrefs,q as pickLanguage,eo as plural,lo as rarityRank,Yo as renderKitOverlays,_t as resolveSound,Ce as resolveUiConfig,Ke as resourceName,tt as screenBackground,Uo as setAutoPopupsHeld,ut as setLanguage,Ln as sortFeatures,et as themeVars,me as tokenGlyph,mt as tokenName,gt as tokenParts,ze as toneSurface,w as uiT,cn as useAnimatedNumber,St as useBalances,D as useCatalog,Hn as useCelebrate,Oe as useCounterValue,De as useGameLayout,Cn as useLanguage,go as useLayout,qn as useMotion,jn as useNotify,mo as useNow,Vn as usePlayerPrefs,oe as usePopupClose,$e as usePresence,Wn as useSound,Nt as useStagger,Yn as useToast,k as useUiKit,a as v,Ne as well};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idosgames/react",
3
- "version": "0.4.6",
3
+ "version": "0.5.0",
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",