PageSourceSearch

https://www.blackswan.paris/cdn/shop/t/69/assets/bundle-easter-egg-20260925T073311-sh.js

js blackswan.paris collected 2026-09-26 14:23:49 UTC 51,318 bytes, 812 lines download raw bytes

1import{E as Be}from"./index-20260925T073311-sh.js";const Me="merchant-revenue-rush-muted",ce=.178,qe=.112,P=16;let C=null,T=!1,le=!1,G=!1,_=null,x=null,O=0,W=0;const de=[[92.5,0,92.5,123.5,0,138.6,92.5,0,82.4,0,82.4,110,0,123.5,82.4,0],[69.3,92.5,0,138.6,69.3,0,123.5,0,73.4,98,0,146.8,73.4,0,164.8,146.8],[92.5,185,0,164.8,138.6,0,123.5,0,110,0,138.6,0,164.8,185,207.7,0],[46.2,92.5,138.6,92.5,55,110,164.8,110,61.7,123.5,185,123.5,69.3,138.6,207.7,138.6]],$e=[[740,0,932.3,0,1108.7,0,932.3,830.6,740,0,622.3,0,740,830.6,932.3,0],[554.4,622.3,740,0,830.6,0,740,622.3,554.4,0,466.2,0,554.4,622.3,740,932.3],[1108.7,0,987.8,830.6,740,0,830.6,987.8,932.3,0,740,0,622.3,740,830.6,0],[740,830.6,932.3,1108.7,0,932.3,830.6,740,622.3,0,740,0,932.3,1108.7,1244.5,0]],Ve=[[[370,466.2,554.4],0,0,0,[415.3,554.4,622.3],0,0,0,[329.6,415.3,554.4],0,0,0,[370,466.2,622.3],0,0,0],[[277.2,370,554.4],0,0,[329.6,415.3,622.3],0,0,[370,466.2,740],0,[246.9,329.6,493.9],0,0,[277.2,370,554.4],0,0,[329.6,466.2,622.3],0],[[370,554.4,740],0,[415.3,622.3,830.6],0,0,0,[329.6,493.9,659.3],0,[277.2,415.3,554.4],0,0,0,[311.1,466.2,622.3],0,[370,554.4,740],0],[[185,277.2,370],0,0,0,[220,329.6,440],0,0,0,[246.9,370,493.9],0,0,0,[277.2,415.3,554.4],0,0,0]],He=[[1,2,0,2,3,2,0,2,1,2,2,1,3,0,2,2],[1,0,2,2,3,2,1,2,0,2,2,1,3,2,0,2],[1,2,1,2,3,0,2,2,1,0,2,2,3,2,1,2],[1,0,2,1,3,2,2,0,1,2,0,1,3,2,2,2]];function ie(){if(!le){le=!0;try{T=localStorage.getItem(Me)==="true"}catch{T=!1}}}function Ge(){try{localStorage.setItem(Me,String(T))}catch{}}function _e(t,e,s){return Math.max(e,Math.min(s,t))}function ze(t){return t*t*(3-2*t)}function he(){const t=ze(O);return ce+(qe-ce)*t}function B(){if(ie(),T)return null;if(!C)try{C=new AudioContext}catch{return null}return C.state==="suspended"&&C.resume(),C}function M(t,e,s,i="square",n=.12,a=0){const c=B();if(!c)return;const r=c.currentTime+a,o=c.createOscillator(),d=c.createGain();o.type=i,o.frequency.setValueAtTime(t,r),o.frequency.exponentialRampToValueAtTime(Math.max(1,e),r+s),d.gain.setValueAtTime(n,r),d.gain.exponentialRampToValueAtTime(.001,r+s),o.connect(d),d.connect(c.destination),o.start(r),o.stop(r+s)}function ue(t,e=.08,s=0){const i=B();if(!i)return;const n=i.currentTime+s,a=Math.floor(i.sampleRate*t),c=i.createBuffer(1,a,i.sampleRate),r=c.getChannelData(0);for(let f=0;f<a;f+=1)r[f]=Math.random()*2-1;const o=i.createBufferSource(),d=i.createGain();o.buffer=c,d.gain.setValueAtTime(e,n),d.gain.exponentialRampToValueAtTime(.001,n+t),o.connect(d),d.connect(i.destination),o.start(n)}function Fe(t,e,s){const i=t.createOscillator(),n=t.createGain();i.type="sine",i.frequency.setValueAtTime(150,s),i.frequency.exponentialRampToValueAtTime(40,s+.08),n.gain.setValueAtTime(.055,s),n.gain.exponentialRampToValueAtTime(.001,s+.1),i.connect(n),n.connect(e),i.start(s),i.stop(s+.1)}function Ie(t,e,s){const i=Math.floor(t.sampleRate*.018),n=t.createBuffer(1,i,t.sampleRate),a=n.getChannelData(0);for(let o=0;o<i;o+=1)a[o]=Math.random()*2-1;const c=t.createBufferSource(),r=t.createGain();c.buffer=n,r.gain.setValueAtTime(.014,s),r.gain.exponentialRampToValueAtTime(.001,s+.018),c.connect(r),r.connect(e),c.start(s)}function Oe(t,e,s){const i=Math.floor(t.sampleRate*.05),n=t.createBuffer(1,i,t.sampleRate),a=n.getChannelData(0);for(let f=0;f<i;f+=1)a[f]=Math.random()*2-1;const c=t.createBufferSource(),r=t.createGain();c.buffer=n,r.gain.setValueAtTime(.025,s),r.gain.exponentialRampToValueAtTime(.001,s+.05),c.connect(r),r.connect(e),c.start(s);const o=t.createOscillator(),d=t.createGain();o.type="square",o.frequency.setValueAtTime(190,s),o.frequency.exponentialRampToValueAtTime(92,s+.04),d.gain.setValueAtTime(.018,s),d.gain.exponentialRampToValueAtTime(.001,s+.04),o.connect(d),d.connect(e),o.start(s),o.stop(s+.05)}function pe(t,e,s,i,n){const a=Math.floor(W/2)%de.length;W+=1;const c=de[a],r=$e[a],o=Ve[a],d=He[a],f=.02+n*.014,v=.009+n*.009,m=.004+n*.003;for(let p=0;p<P;p+=1){const h=s+p*i,u=c[p];if(u===0)continue;const l=t.createOscillator(),g=t.createGain();l.type=p%4===0?"sawtooth":"square",l.frequency.setValueAtTime(u,h),g.gain.setValueAtTime(f,h),g.gain.setValueAtTime(f,h+i*.48),g.gain.linearRampToValueAtTime(0,h+i*.72),l.connect(g),g.connect(e),l.start(h),l.stop(h+i)}for(let p=0;p<P;p+=1){const h=s+p*i,u=r[p];if(u===0)continue;const l=t.createOscillator(),g=t.createGain();l.type=p%4===0?"square":"triangle",l.frequency.setValueAtTime(u,h),g.gain.setValueAtTime(v,h),g.gain.setValueAtTime(v,h+i*.34),g.gain.linearRampToValueAtTime(0,h+i*.58),l.connect(g),g.connect(e),l.start(h),l.stop(h+i*.7)}for(let p=0;p<P;p+=1){const h=o[p];if(h===0)continue;const u=s+p*i;for(const l of h){const g=t.createOscillator(),y=t.createGain();g.type="sawtooth",g.frequency.setValueAtTime(l,u),y.gain.setValueAtTime(m,u),y.gain.setValueAtTime(m,u+i*.9),y.gain.linearRampToValueAtTime(0,u+i*1.6),g.connect(y),y.connect(e),g.start(u),g.stop(u+i*1.7)}}for(let p=0;p<P;p+=1){const h=s+p*i,u=d[p];u===1&&Fe(t,e,h),u===2&&Ie(t,e,h),u===3&&Oe(t,e,h)}}function Z(){B()}function we(){M(92,220,.24,"triangle",.06),M(220,160,.18,"square",.035,.64),M(620,980,.07,"square",.06,1.45),ue(.04,.035,1.48),M(520,210,.12,"sawtooth",.045,1.86),ue(.09,.045,2.2),M(180,740,.22,"square",.07,2.24)}function Se(){M(220,440,.055,"square",.055)}
1function z(){[330,440,660].forEach((t,e)=>{M(t,t*1.08,.09,"square",.045,e*.055)})}function F(){M(140,80,.12,"square",.035)}function Te(){[440,330,220,110].forEach((t,e)=>{M(t,Math.max(1,t*.82),.16,"square",.055,e*.13)})}function Ae(){M(520,760,.08,"triangle",.035)}function E(){const t=B();if(!t||G)return;G=!0,W=0,x=t.createGain(),x.gain.setValueAtTime(.42,t.currentTime),x.connect(t.destination);let e=he(),s=P*e,i=t.currentTime+.05;pe(t,x,i,e,O),i+=s,_=window.setInterval(()=>{if(!G||!x)return;const n=B();n&&(e=he(),s=P*e,!(i-n.currentTime>=s*.62)&&(pe(n,x,i,e,O),i+=s))},180)}function N(){if(G=!1,_!==null&&(window.clearInterval(_),_=null),!!x){try{const t=C?.currentTime??0;x.gain.cancelScheduledValues(t),x.gain.setValueAtTime(x.gain.value,t),x.gain.linearRampToValueAtTime(0,t+.22)}catch{}x=null}}function Ce(t){ie(),T=t,Ge(),T&&N()}function S(t){O=_e(t,0,1)}function J(){return ie(),T}const rt=Object.freeze(Object.defineProperty({__proto__:null,initAudio:Z,isMuted:J,playDenied:F,playGameOver:Te,playLaunch:Se,playShare:Ae,playTransitionIntro:we,playUpgrade:z,setMusicIntensity:S,setMuted:Ce,startMusic:E,stopMusic:N},Symbol.toStringTag,{value:"Module"})),Ne="blackswan:easter-egg",j="__merchantRevenueRushPending",Ue="Easter Egg Game Opened",ge="merchant-revenue-rush-best",I=12e4,De=3200,Xe=220,je=90,Ke=7,fe=500,me=`
2  <svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
3    <path d="M13.596 12.7417C10.2585 10.2444 6.94961 8.77167 5.6252 8.23366L3.53537 10.3139L3.57897 10.35C3.61678 10.3815 7.38826 13.5251 9.84689 16.9978C11.1709 18.8676 12.1686 20.7428 12.8206 22.5849L3.18739 12.9959L1.14232 15.0316L5.74248 24.1897C3.01803 22.8518 0.509242 22.1095 0 21.9651V24.7915C1.08098 25.1686 3.50297 26.2108 6.44346 28H10.6609L10.6123 27.8998L7.37359 21.2174L13.6481 28H16.55C16.5619 27.4466 16.5454 26.8833 16.5002 26.3253C16.4123 25.2412 16.214 24.1329 15.9111 23.0315C15.209 20.4789 13.7314 17.5727 11.9132 15.0155C11.9132 15.0155 15.9686 18.5373 17.2332 20.4763C18.7733 22.8376 19.5541 25.3687 19.5541 28H22.3704C22.3704 24.8061 21.4302 21.7512 19.5757 18.9194C18.124 16.7021 16.1121 14.6238 13.5968 12.7413L13.596 12.7417ZM18.6676 10.1557C18.0241 9.53818 17.4639 8.9706 17.1271 8.27475C16.3687 6.79742 17.0654 4.57855 18.5349 3.79476C20.5063 2.62234 22.7948 4.0847 24.0266 5.84044L27.8073 10.4452C27.8787 10.5286 28.0149 10.4671 27.9987 10.3588C28.0187 10.0892 27.2078 6.0482 27.4601 5.92108C28.4751 3.2483 26.6685 1.81167 24.7904 0.747551C17.8628 -2.42024 10.3889 5.12232 15.9474 11.3243C21.2034 16.1541 25.0898 20.3703 25.1863 28H27.9906C28.1765 20.7915 23.9652 14.628 18.6668 10.1553L18.6676 10.1557Z" fill="currentColor"/>
4  </svg>
5`;function Ye(t){window.umami?.track(Ue,{game_name:"merchant_revenue_rush",page_path:window.location.pathname,with_transition:t})}const k=[{id:"seo",label:"SEO",description:"Organic visitors",baseCost:35,costMultiplier:1.42},{id:"socialAds",label:"Social Ads",description:"Fast paid visitors",baseCost:75,costMultiplier:1.5},{id:"retargeting",label:"Retargeting",description:"Makes ads convert harder",baseCost:240,costMultiplier:1.65},{id:"performance",label:"Performance",description:"Lower load time",baseCost:360,costMultiplier:1.58},{id:"sales",label:"Flash Sale",description:"Short conversion rush",baseCost:620,costMultiplier:2.35}];function ke(){return{seo:0,retargeting:0,socialAds:0,performance:0,sales:0}}function We(t){return t>=1e6?`${(t/1e6).toFixed(2)}M`:t>=1e4?`${Math.floor(t/1e3)}k`:t>=1e3?`${(t/1e3).toFixed(1)}k`:`${Math.floor(t)}`}function A(t){return`${We(t)} EUR`}function L(t,e){return Math.floor(t.baseCost*t.costMultiplier**e)}function U(t,e,s){return[t.temporaryBonus,t.saleBonus].reduce((n,a)=>!a||a.kind!==s||e>=a.until?n:n+a.value,0)}function R(t,e){const s=1+t.upgrades.retargeting*.24,i=t.upgrades.seo*14+t.upgrades.seo**2*2.8,n=t.upgrades.socialAds*42*s,a=1+U(t,e,"traffic"),c=1+Math.sin(e*.004+t.elapsedMs*7e-4)*.035;return Math.max(1,(je+i+n)*a*c)}function Q(t,e){const s=t.upgrades.performance,i=Math.log10(R(t,e)+1),n=U(t,e,"performance");return Math.max(.65,3.8-s*.34-s**1.35*.045+i*.1-n)}function Ze(t){return 126+t.upgrades.retargeting*16+t.upgrades.performance*8+t.upgrades.sales*22}function Je(t,e){const s=Q(t,e),i=Math.max(.52,1-Math.max(0,s-1.25)*.13),n=t.upgrades.sales*.2,a=t.upgrades.retargeting*.38,c=t.upgrades.socialAds*.028,r=R(t,e),o=Math.min(1.1,Math.log10(r+1)*.16),d=Math.sin(e*.003+t.elapsedMs*9e-4)*.08;return Math.max(.6,Math.min(12,(1.65+o+a+n-c+d)*i))}function ee(t,e){const s=Je(t,e),i=U(t,e,"conversion");return Math.min(12,s+i)}function te(t,e,s,i){return e*(s/100)*Ze(t)/60*Ke*(1+U(t,i,"revenue"))}let V;function Qe(){return{revenue:0,cash:0,revenuePerSecond:0,upgrades:ke(),elapsedMs:0,bestScore:0,visits:0,conversionRate:0,loadTime:3.8,statsHistory:[],runHistory:[]}}function et(t,e){const i=[{kind:"traffic",label:"+65% visitors",value:.65,startedAt:t,until:t+1e4},{kind:"conversion",label:"+2.2 pts conversion",value:2.2,startedAt:t,until:t+1e4},{kind:"performance",label:"-1.1s load time",value:1.1,startedAt:t,until:t+1e4},{kind:"revenue",label:"x3 revenue pulse",value:2,startedAt:t,until:t+1e4}];return i[e%i.length]}function ve(t,e,s){const i={...t,upgrades:{...t.upgrades}},n=i.upgrades[e.id],a=L(e,n);return i.cash-=a,i.upgrades[e.id]=n+1,e.id==="sales"&&(i.saleBonus={kind:"conversion",label:"Flash sale",value:2.8+n*.22,startedAt:s,until:s+6e3+n*450}),i}function se(t,e){const s=R(t,e),i=ee(t,e);t.revenuePerSecond=te(t,s,i,e)}function tt(t,e){let s,i=0;const n=t.revenuePerSecond;for(const c of k){const r=L(c,t.upgrades[c.id]);if(t.cash<r)continue;const o=ve(t,c,e);se(o,e);const d=(o.revenuePerSecond-n)/Math.max(1,r);d>i&&(i=d,s=c)}if(!s)return!1;const a=ve(t,s,e);return t.cash=a.cash,t.upgrades=a.upgrades,t.saleBonus=a.saleBonus,se(t,e),!0}function st(){const t=Qe();let e=0;for(let s=0;s<=I;s+=fe){t.elapsedMs=s,t.temporaryBonus&&s>=t.temporaryBonus.until&&(t.temporaryBonus=void 0),t.saleBonus&&s>=t.saleBonus.until&&(t.saleBonus=void 0),!t.temporaryBonus&&s>=12e3+e*18e3&&(t.temporaryBonus=et(s,e),e+=1),se(t,s);const i=t.revenuePerSecond*(fe/1e3);t.revenue+=i,t.cash+=i;let n=0;for(;n<8&&tt(t,s);)n+=1}return Math.max(1,t.revenue)}function H(t){return t>=1e6?Math.round(t/5e4)*5e4:t>=1e5?Math.round(t/1e4)*1e4:t>=1e4?Math.round(t/1e3)*1e3:Math.round(t/100)*100}
5function it(){if(V)return V;const t=st();return V={c:H(t*.12),b:H(t*.3),a:H(t*.55),s:H(t*.85)},V}function xe(t){const e=it();return t>=e.s?"S":t>=e.a?"A":t>=e.b?"B":t>=e.c?"C":"D"}function ye(t){return t<.5?4*t*t*t:1-(-2*t+2)**3/2}function K(t){return 1-(1-t)**3}function w(t,e,s){return Math.max(0,Math.min(1,(t-e)/(s-e)))}function nt(){return["127.0.0.1","localhost"].includes(window.location.hostname)}function be(t){return t<12?0:Math.max(0,Math.min(1,(Math.log10(t+1)-1.1)/2.15))}function Y(t,e,s,i,n){const a=Math.max(1,n-i);return t.map((c,r)=>{const o=r/Math.max(1,t.length-1)*e,d=s-(c-i)/a*s;return`${r===0?"M":"L"}${o.toFixed(1)} ${d.toFixed(1)}`}).join("")}class Pe extends Be{#t;#a;#k;#P=0;#i=!1;#n=!1;#c=0;#R=0;#v=0;#E=0;#N;#L="";#U="";#e=this.#H();#h=!1;#B=0;#x="";#u=0;#p=0;#y=0;#D=0;#q=0;#$=.5;#g=.22;#V="Catch the spike";#f="";#l="";#d=0;#s=0;#m=0;#b=.5;#M=0;constructor(){super(),this.#t=this.attachShadow({mode:"open"})}onStart(){this.#h=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.#W(),window.addEventListener(Ne,()=>this.#X(!0),{signal:this.signal}),window.addEventListener("resize",()=>this.#Y(),{signal:this.signal}),window.addEventListener("pagehide",()=>this.#w(),{signal:this.signal}),document.addEventListener("visibilitychange",()=>{document.hidden&&this.#w()},{signal:this.signal}),window[j]&&(window[j]=!1,this.#X(!0))}#H(){return{revenue:0,cash:0,revenuePerSecond:0,upgrades:ke(),elapsedMs:0,bestScore:Number(localStorage.getItem(ge)||"0"),visits:0,conversionRate:0,loadTime:3.8,statsHistory:Array.from({length:34},()=>({sampledAt:0,visits:0,conversionRate:0,loadTime:3.8})),runHistory:[]}}#W(){this.#t.innerHTML=`
6      <style>
7        :host {
8          --reveal-x: -14vw;
9          --army-opacity: 0;
10          --hero-hop: 0px;
11          --hero-opacity: 1;
12          --hero-rotate: 0deg;
13          --hero-scale-x: 1;
14          --hero-scale-y: 1;
15          --hero-surprise: 0;
16          --hero-x: -52vw;
17          color-scheme: dark;
18          font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
19        }
20
21        .overlay {
22          position: fixed;
23          inset: 0;
24          z-index: 9999;
25          display: none;
26          color: #f8f7ed;
27          background: #070707;
28          -webkit-tap-highlight-color: transparent;
29          user-select: none;
30          -webkit-user-select: none;
31        }
32
33        .overlay.is-open {
34          display: block;
35        }
36
37        .overlay.is-revealing {
38          clip-path: polygon(
39            0 0,
40            var(--reveal-x) 0,
41            calc(var(--reveal-x) + 42px) 12%,
42            calc(var(--reveal-x) - 18px) 27%,
43            calc(var(--reveal-x) + 34px) 43%,
44            calc(var(--reveal-x) - 22px) 60%,
45            calc(var(--reveal-x) + 28px) 78%,
46            calc(var(--reveal-x) - 12px) 100%,
47            0 100%
48          );
49          will-change: clip-path;
50        }
51
52        .transition {
53          position: fixed;
54          inset: 0;
55          z-index: 10000;
56          display: none;
57          overflow: hidden;
58          pointer-events: none;
59          color: #050d23;
60          background: transparent;
61        }
62
63        .transition.is-running {
64          display: block;
65        }
66
67        .transition-logo {
68          position: absolute;
69          top: var(--top);
70          left: 0;
71          display: grid;
72          place-items: center;
73          width: var(--size);
74          height: var(--size);
75          color: #f8f7ed;
76          filter:
77            drop-shadow(3px 3px 0 #e3042a)
78            drop-shadow(-2px -2px 0 #243180)
79            drop-shadow(0 0 1px #070707);
80          opacity: var(--army-opacity);
81          transform:
82            translate3d(calc(var(--reveal-x) + var(--pull-offset, 0px)), -50%, 0)
83            translateX(-50%)
84            rotate(var(--rotate));
85          will-change: transform;
86        }
87
88        .transition-hero {
89          position: absolute;
90          top: 50%;
91          left: 0;
92          display: grid;
93          place-items: center;
94          width: min(90svh, 92vw);
95          height: min(90svh, 92vw);
96          color: #050d23;
97          filter:
98            drop-shadow(10px 10px 0 #e3042a)
99            drop-shadow(-8px -8px 0 #243180)
100            drop-shadow(0 0 2px #f8f7ed);
101          opacity: var(--hero-opacity);
102          transform:
103            translate3d(var(--hero-x), calc(-50% + var(--hero-hop)), 0)
104            translateX(-50%)
105            scaleX(var(--hero-scale-x))
106            scaleY(var(--hero-scale-y))
107            rotate(var(--hero-rotate));
108          transform-origin: 50% 68%;
109          will-change: transform, opacity;
110        }
111
112        .transition-hero svg {
113          width: 100%;
114          height: 100%;
115        }
116
117        .transition-hero::after {
118          content: "!";
119          position: absolute;
120          top: 10%;
121          right: 9%;
122          display: grid;
123          place-items: center;
124          width: clamp(34px, 8svh, 72px);
125          height: clamp(34px, 8svh, 72px);
126          border: 2px solid #070707;
127          color: #e3042a;
128          background: #f8f7ed;
129          box-shadow: 5px 5px 0 #243180;
130          font-size: clamp(28px, 7svh, 60px);
131          line-height: 1;
132          opacity: var(--hero-surprise);
133          transform:
134            translateY(calc(var(--hero-surprise) * -12px))
135            scale(var(--hero-surprise));
136          transform-origin: center;
137        }
138
139        .transition-logo svg {
140          width: 100%;
141          height: 100%;
142          position: relative;
143          z-index: 1;
144        }
145
146        canvas {
147          position: absolute;
148          inset: 0;
149          width: 100%;
150          height: 100%;
151          image-rendering: pixelated;
152        }
153
154        .screen {
155          position: relative;
156          z-index: 1;
157          display: grid;
158          grid-template-rows: auto 1fr;
159          min-height: 100svh;
160          padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
161          background:
162            linear-gradient(180deg, rgb(0 0 0 / 0.2), rgb(0 0 0 / 0.72)),
163            repeating-linear-gradient(0deg, rgb(255 255 255 / 0.04) 0 1px, transparent 1px 4px);
164        }
165
166        .topbar,
167        .game,
168        .end {
169          border: 2px solid #f8f7ed;
170          background: rgb(7 7 7 / 0.88);
171          box-shadow: 8px 8px 0 #e3042a;
172        }
173
174        .topbar {
175          display: grid;
176          grid-template-columns: 1fr auto;
177          gap: 12px;
178          align-items: center;
179          padding: 12px;
180        }
181
182        .brand {
183          display: flex;
184          flex-wrap: wrap;
185          gap: 8px 14px;
186          align-items: baseline;
187          min-width: 0;
188        }
189
190        .title {
191          font-size: clamp(18px, 4vw, 34px);
192          line-height: 0.95;
193          text-transform: uppercase;
194        }
195
196        .meta {
197          color: #a7f3d0;
198          font-size: 12px;
199          line-height: 1.25;
200          text-transform: uppercase;
201        }
202
203        .close,
204        .sound,
205        .challenge-button,
206        .upgrade,
207        .share,
208        .restart {
209          border: 2px solid currentColor;
210          border-radius: 0;
211          color: inherit;
212          background: #111;
213          font: inherit;
214          text-transform: uppercase;
215          cursor: pointer;
216          touch-action: manipulation;
217          user-select: none;
218          -webkit-user-select: none;
219        }
220
221        .close {
222          min-height: 44px;
223          padding: 8px 12px;
224        }
225
226        .sound {
227          min-height: 44px;
228          padding: 8px 12px;
229          color: #a7f3d0;
230        }
231
232        .top-actions {
233          display: flex;
234          flex-wrap: wrap;
235          gap: 10px;
236          justify-content: flex-end;
237        }
238
239        .content {
240          display: grid;
241          place-items: center;
242          min-height: 0;
243          padding-block: 14px 4px;
244        }
245
246        .game {
247          display: grid;
248          grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
249          gap: 16px;
250          width: min(1100px, 100%);
251          max-height: calc(100svh - 112px);
252          min-height: min(680px, calc(100svh - 112px));
253          padding: 16px;
254        }
255
256        .game[hidden] {
257          display: none;
258        }
259
260        .stage,
261        .shop {
262          min-height: 0;
263        }
264
265        .stage {
266          display: grid;
267          grid-template-rows: auto auto 1fr auto;
268          gap: 14px;
269        }
270
271        .scoreline {
272          display: grid;
273          grid-template-columns: repeat(3, 1fr);
274          gap: 10px;
275        }
276
277        .stat {
278          min-width: 0;
279          border: 1px solid rgb(248 247 237 / 0.42);
280          padding: 10px;
281          background: rgb(255 255 255 / 0.05);
282        }
283
284        .stat span {
285          display: block;
286          color: #a7f3d0;
287          font-size: 11px;
288          line-height: 1.2;
289          text-transform: uppercase;
290        }
291
292        .stat strong {
293          display: block;
294          margin-top: 5px;
295          overflow: hidden;
296          font-size: clamp(17px, 3vw, 28px);
297          line-height: 1;
298          text-overflow: ellipsis;
299          white-space: nowrap;
300        }
301
302        .traffic-panel {
303          display: grid;
304          gap: 8px;
305          border: 1px solid rgb(248 247 237 / 0.42);
306          padding: 10px;
307          background: rgb(255 255 255 / 0.04);
308        }
309
310        .traffic-head {
311          display: flex;
312          flex-wrap: wrap;
313          gap: 8px 14px;
314          align-items: baseline;
315          justify-content: space-between;
316        }
317
318        .traffic-title {
319          color: #f8f7ed;
320          font-size: 13px;
321          line-height: 1;
322          text-transform: uppercase;
323        }
324
325        .traffic-legend {
326          display: flex;
327          flex-wrap: wrap;
328          gap: 8px 12px;
329          color: rgb(248 247 237 / 0.72);
330          font-size: 10px;
331          line-height: 1;
332          text-transform: uppercase;
333        }
334
335        .traffic-legend span {
336          display: inline-flex;
337          gap: 5px;
338          align-items: center;
339        }
340
341        .traffic-legend span::before {
342          content: "";
343          width: 10px;
344          height: 2px;
345          background: var(--color);
346        }
347
348        .traffic-chart {
349          display: block;
350          width: 100%;
351          height: 82px;
352          overflow: visible;
353        }
354
355        .traffic-chart .grid {
356          stroke: rgb(248 247 237 / 0.11);
357          stroke-width: 1;
358        }
359
360        .traffic-chart .visits {
361          fill: none;
362          stroke: #a7f3d0;
363          stroke-width: 2.5;
364          vector-effect: non-scaling-stroke;
365        }
366
367        .traffic-chart .conversion {
368          fill: none;
369          stroke: #ff4f7b;
370          stroke-width: 2.5;
371          vector-effect: non-scaling-stroke;
372        }
373
374        .traffic-chart .load {
375          fill: none;
376          stroke: #7dd3fc;
377          stroke-width: 2.5;
378          vector-effect: non-scaling-stroke;
379        }
380
381        .traffic-values {
382          display: grid;
383          grid-template-columns: repeat(3, 1fr);
384          gap: 8px;
385          color: rgb(248 247 237 / 0.72);
386          font-size: 11px;
387          line-height: 1.2;
388          text-transform: uppercase;
389        }
390
391        .traffic-values strong {
392          display: block;
393          margin-top: 2px;
394          color: #f8f7ed;
395          font-size: 14px;
396          line-height: 1;
397        }
398
399        .challenge-wrap {
400          display: grid;
401          align-content: center;
402          gap: 12px;
403          min-height: 0;
404        }
405
406        .challenge-card {
407          display: grid;
408          gap: 14px;
409          width: min(78vw, 430px);
410          margin-inline: auto;
411          padding: 18px;
412          border: 2px solid #f8f7ed;
413          background: rgb(7 7 7 / 0.9);
414          box-shadow: 10px 10px 0 #243180, -10px -10px 0 #e3042a;
415        }
416
417        .challenge-title {
418          display: block;
419          color: #a7f3d0;
420          font-size: 13px;
421          line-height: 1;
422          text-transform: uppercase;
423        }
424
425        .challenge-copy {
426          margin: 0;
427          color: #f8f7ed;
428          font-size: clamp(20px, 5vw, 42px);
429          line-height: 0.95;
430          text-transform: uppercase;
431        }
432
433        .challenge-track {
434          position: relative;
435          height: 36px;
436          border: 1px solid rgb(248 247 237 / 0.5);
437          background: rgb(248 247 237 / 0.08);
438          overflow: hidden;
439        }
440
441        .challenge-target,
442        .challenge-cursor {
443          position: absolute;
444          top: 0;
445          bottom: 0;
446          transform: translateX(-50%);
447        }
448
449        .challenge-target {
450          left: calc(var(--target, 50) * 1%);
451          width: calc(var(--window, 22) * 1%);
452          background: rgb(167 243 208 / 0.34);
453          box-shadow:
454            inset 0 0 0 1px rgb(167 243 208 / 0.38),
455            0 0 18px rgb(167 243 208 / 0.18);
456        }
457
458        .challenge-cursor {
459          left: calc(var(--cursor, 0) * 1%);
460          width: 4px;
461          background: #ff4f7b;
462          box-shadow: 0 0 0 2px rgb(7 7 7 / 0.9);
463        }
464
465        .challenge-card.is-bonus .challenge-track {
466          background: rgb(248 247 237 / 0.08);
467        }
468
469        .challenge-card.is-bonus .challenge-target {
470          left: 0;
471          width: calc(var(--bonus-progress, 0) * 1%);
472          transform: none;
473          background: linear-gradient(90deg, #7dd3fc, #a7f3d0);
474        }
475
476        .challenge-card.is-bonus .challenge-cursor,
477        .challenge-card.is-bonus .challenge-button {
478          display: none;
479        }
480
481        .challenge-button {
482          min-height: 52px;
483          padding: 10px 14px;
484          color: #070707;
485          background: #f8f7ed;
486          font-size: 16px;
487        }
488
489        .bonus {
490          min-height: 17px;
491          color: #7dd3fc;
492          font-size: 13px;
493          line-height: 1.3;
494          text-transform: uppercase;
495        }
496
497        .hint {
498          color: rgb(248 247 237 / 0.72);
499          font-size: 12px;
500          line-height: 1.4;
501          text-align: center;
502        }
503
504        .shop {
505          display: grid;
506          grid-template-rows: auto 1fr;
507          gap: 12px;
508          overflow: hidden;
509        }
510
511        .shop h2,
512        .end h2 {
513          margin: 0;
514          font-size: 18px;
515          line-height: 1;
516          text-transform: uppercase;
517        }
518
519        .upgrades {
520          display: grid;
521          gap: 10px;
522          overflow: auto;
523          padding-right: 4px;
524        }
525
526        .upgrade {
527          display: grid;
528          grid-template-columns: 1fr auto;
529          gap: 8px;
530          align-items: center;
531          min-height: 74px;
532          padding: 10px;
533          text-align: left;
534        }
535
536        .upgrade:disabled {
537          cursor: not-allowed;
538          opacity: 0.48;
539        }
540
541        .upgrade-title,
542        .upgrade-price {
543          display: block;
544          font-size: 14px;
545          line-height: 1.1;
546        }
547
548        .upgrade-desc,
549        .upgrade-level {
550          display: block;
551          margin-top: 5px;
552          color: rgb(248 247 237 / 0.7);
553          font-size: 11px;
554          line-height: 1.25;
555        }
556
557        .end {
558          display: none;
559          width: min(520px, 100%);
560          padding: 18px;
561        }
562
563        .end.is-visible {
564          display: grid;
565          gap: 14px;
566        }
567
568        .run-chart {
569          display: grid;
570          gap: 8px;
571          border: 1px solid rgb(248 247 237 / 0.42);
572          padding: 10px;
573          background: rgb(255 255 255 / 0.04);
574        }
575
576        .run-chart .traffic-chart {
577          height: 96px;
578        }
579
580        .grade {
581          color: #a7f3d0;
582          font-size: clamp(52px, 18vw, 120px);
583          line-height: 0.9;
584        }
585
586        .end-actions {
587          display: grid;
588          grid-template-columns: 1fr 1fr;
589          gap: 10px;
590        }
591
592        .share,
593        .restart {
594          min-height: 46px;
595          padding: 10px;
596        }
597
598        .sr-only {
599          position: absolute;
600          width: 1px;
601          height: 1px;
602          padding: 0;
603          margin: -1px;
604          overflow: hidden;
605          clip: rect(0, 0, 0, 0);
606          white-space: nowrap;
607          border: 0;
608        }
609
610        @media (max-width: 760px) {
611          .screen {
612            padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
613          }
614
615          .topbar {
616            grid-template-columns: 1fr;
617          }
618
619          .close {
620            width: 100%;
621          }
622
623          .top-actions {
624            display: grid;
625            grid-template-columns: 1fr 1fr;
626          }
627
628          .content {
629            align-items: stretch;
630          }
631
632          .game {
633            grid-template-columns: 1fr;
634            grid-template-rows: minmax(0, 1fr) minmax(190px, 35svh);
635            min-height: calc(100svh - 146px);
636            max-height: calc(100svh - 146px);
637            padding: 10px;
638            box-shadow: 5px 5px 0 #e3042a;
639          }
640
641          .scoreline {
642            grid-template-columns: 1fr 1fr;
643          }
644
645          .scoreline .stat:first-child {
646            grid-column: 1 / -1;
647          }
648
649          .traffic-panel {
650            gap: 6px;
651            padding: 8px;
652          }
653
654          .traffic-chart {
655            height: 58px;
656          }
657
658          .challenge-card {
659            width: min(82vw, 340px);
660            box-shadow: 6px 6px 0 #243180, -6px -6px 0 #e3042a;
661          }
662
663          .upgrades {
664            grid-auto-flow: column;
665            grid-auto-columns: minmax(210px, 76%);
666            overflow-x: auto;
667            overflow-y: hidden;
668            padding: 0 0 4px;
669          }
670        }
671
672        @media (prefers-reduced-motion: reduce) {
673          *,
674          *::before,
675          *::after {
676            transition-duration: 1ms !important;
677            animation-duration: 1ms !important;
678          }
679
680          .transition-logo {
681            display: none;
682          }
683        }
684      </style>
685      <div class="transition" aria-hidden="true" data-transition></div>
686      <div class="overlay" role="dialog" aria-modal="true" aria-labelledby="revenue-game-title">
687        <canvas aria-hidden="true"></canvas>
688        <div class="screen">
689          <div class="topbar">
690            <div class="brand">
691              <div class="title" id="revenue-game-title">Merchant Revenue Rush</div>
692              <div class="meta">
692120s arcade challenge - fictional revenue</div>
693            </div>
694            <div class="top-actions">
695              <button class="sound" type="button" data-action="sound" data-sound></button>
696              <button class="close" type="button" data-action="close">Back to site</button>
697            </div>
698          </div>
699          <div class="content">
700            <div class="game">
701              <section class="stage" aria-label="Game board">
702                <div class="scoreline" aria-live="polite">
703                  <div class="stat">
704                    <span>Available budget</span>
705                    <strong data-score>0 EUR</strong>
706                  </div>
707                  <div class="stat">
708                    <span>Per second</span>
709                    <strong data-rps>0 EUR</strong>
710                  </div>
711                  <div class="stat">
712                    <span>Time</span>
713                    <strong data-time>120s</strong>
714                  </div>
715                </div>
716                <div class="traffic-panel" aria-label="Live site statistics">
717                  <div class="traffic-head">
718                    <div class="traffic-title">Site pulse - 15s</div>
719                    <div class="traffic-legend">
720                      <span style="--color: #a7f3d0">Visits</span>
721                      <span style="--color: #ff4f7b">Conversion</span>
722                      <span style="--color: #7dd3fc">Load</span>
723                    </div>
724                  </div>
725                  <svg class="traffic-chart" viewBox="0 0 320 82" preserveAspectRatio="none" aria-hidden="true">
726                    <path class="grid" d="M0 20H320M0 41H320M0 62H320" />
727                    <path class="visits" data-visits-line d="" />
728                    <path class="conversion" data-conversion-line d="" />
729                    <path class="load" data-load-line d="" />
730                  </svg>
731                  <div class="traffic-values">
732                    <span>Visits/min<strong data-visits>0</strong></span>
733                    <span>Conv. rate<strong data-conversion>0%</strong></span>
734                    <span>Load time<strong data-load-time>0.0s</strong></span>
735                  </div>
736                </div>
737                <div class="challenge-wrap">
738                  <div class="challenge-card" aria-describedby="challenge-hint">
739                    <span class="challenge-title" data-challenge-label>Catch the spike</span>
740                    <p class="challenge-copy" data-challenge-copy>Hit the green window</p>
741                    <div class="challenge-track" data-challenge-track>
742                      <span class="challenge-target"></span>
743                      <span class="challenge-cursor"></span>
744                    </div>
745                    <button class="challenge-button" type="button" data-action="challenge">
746                      Lock bonus
747                    </button>
748                    <div class="bonus" data-bonus aria-live="polite"></div>
749                  </div>
750                </div>
751                <div class="hint" id="challenge-hint">
752                  Complete quick challenges to trigger temporary growth boosts.
753                </div>
754              </section>
755              <section class="shop" aria-label="Growth methods">
756                <h2>Growth methods</h2>
757                <div class="upgrades" data-upgrades></div>
758              </section>
759            </div>
760            <section class="end" aria-label="Game result">
761              <h2>Result</h2>
762              <div class="grade" data-grade>D</div>
763              <div class="stat">
764                <span>Final cumulative revenue</span>
765                <strong data-final-score>0 EUR</strong>
766              </div>
767              <div class="stat">
768                <span>Best local score</span>
769                <strong data-best-score>0 EUR</strong>
770              </div>
771              <div class="run-chart" aria-label="Run statistics">
772                <div class="traffic-head">
773                  <div class="traffic-title">Run recap</div>
774                  <div class="traffic-legend">
775                    <span style="--color: #a7f3d0">Visits</span>
776                    <span style="--color: #ff4f7b">Conversion</span>
777                    <span style="--color: #7dd3fc">Load</span>
778                  </div>
779                </div>
780                <svg class="traffic-chart" viewBox="0 0 320 96" preserveAspectRatio="none" aria-hidden="true">
781                  <path class="grid" d="M0 24H320M0 48H320M0 72H320" />
782                  <path class="visits" data-run-visits-line d="" />
783                  <path class="conversion" data-run-conversion-line d="" />
784                  <path class="load" data-run-load-line d="" />
785                </svg>
786                <div class="traffic-values">
787                  <span>Peak visits<strong data-run-visits>0</strong></span>
788                  <span>Peak conv.<strong data-run-conversion>0%</strong></span>
789                  <span>Best load<strong data-run-load-time>0.0s</strong></span>
790                </div>
791              </div>
792              <div class="end-actions">
793                <button class="restart" type="button" data-action="restart">Replay</button>
794                <button class="share" type="button" data-action="share">Copy score</button>
795              </div>
796              <p class="hint" data-share-status aria-live="polite"></p>
797            </section>
798          </div>
799        </div>
800      </div>
801    `,this.#a=this.#t.querySelector("canvas")??void 0,this.#k=this.#a?.getContext("2d")??void 0,nt()&&(this.dataset.devTrigger="true"),this.#A(),this.#t.addEventListener("click",e=>this.#te(e),{signal:this.signal}),this.#t.addEventListener("pointerdown",e=>this.#ee(e),{signal:this.signal}),window.addEventListener("keydown",e=>this.#se(e),{signal:this.signal})}#X(e=!0){if(this.#i)return;window[j]=!1,this.#i=!0,this.dataset.gameActive="true",Ye(e),this.#n=!1,this.#e=this.#H(),this.#x="",this.#y=0,this.#r(performance.now()),this.#l="",this.#d=0,this.#s=0,this.#m=0,this.#b=this.#S(performance.now()),this.#M=performance.now(),delete this.dataset.bonusKind,S(0),this.#N=document.activeElement instanceof HTMLElement?document.activeElement:void 0,this.#de(),this.#Y();const s=this.#C;s?.classList.add("is-open"),this.#I?.removeAttribute("hidden"),this.#O?.classList.remove("is-visible"),this.#o(),Z();const i=e&&!this.#h?De:0;i>0&&(we(),s?.classList.add("is-revealing"),this.#Z(i)),this.#J(i);const n=this.#h?80:Xe,a=performance.now();this.#c=a+i+n,this.#R=this.#c,this.#v=a,this.#z(a),this.#t.querySelector(".close")?.focus()}#w(){this.#i&&(this.#i=!1,delete this.dataset.gameActive,delete this.dataset.bonusKind,window.cancelAnimationFrame(this.#P),this.#_(),N(),S(0),this.#G(),this.#C?.classList.remove("is-open","is-revealing"),this.#he(),this.#N?.focus())}#Z(e){const s=this.#F;if(!s){this.#C?.classList.remove("is-revealing");return}this.#G();const i=window.innerHeight||900,n=window.innerWidth||1440,a=n*-.12,c=n*1.12,r=n*-.42,o=n*.5,d=n*1.34,f=Math.max(8,Math.min(14,Math.ceil(i/96))),v=document.createDocumentFragment();for(let u=0;u<f;u+=1){const l=document.createElement("span"),g=(u+.5)/f*100,y=(u%3-1)*2.1,b=36+u%4*7,D=(u%5-2)*7;l.className="transition-logo",l.innerHTML=me,l.style.setProperty("--top",`${g+y}%`),l.style.setProperty("--size",`${b}px`),l.style.setProperty("--pull-offset",`${D}px`),l.style.setProperty("--rotate",`${u%2===0?-5:5}deg`),v.append(l)}const m=document.createElement("span");m.className="transition-hero",m.innerHTML=me,v.append(m),this.style.setProperty("--reveal-x",`${a}px`),this.style.setProperty("--army-opacity","0"),this.style.setProperty("--hero-x",`${r}px`),this.style.setProperty("--hero-hop","0px"),this.style.setProperty("--hero-opacity","1"),this.style.setProperty("--hero-rotate","0deg"),this.style.setProperty("--hero-scale-x","1"),this.style.setProperty("--hero-scale-y","1"),this.style.setProperty("--hero-surprise","0"),s.replaceChildren(v),s.classList.add("is-running");const p=performance.now(),h=u=>{const l=Math.min(1,(u-p)/e),g=K(w(l,0,.34)),y=ye(w(l,.34,.46)),b=w(l,.46,.62),D=K(w(l,.62,.7)),ne=K(w(l,.7,1)),Re=ye(w(l,.7,1)),Ee=w(l,.68,.76),q=Math.sin(b*Math.PI),Le=a+(c-a)*Re;let ae=r+(o-r)*g,$=1,re=1,oe=0,X=0;if(l>=.34&&l<.46?$=1-y*2:l>=.46&&l<.62?($=-(1-q*.22),re=1+q*.12,oe=-q*48,X=Math.sin(b*Math.PI*2)*3):l>=.62&&l<.7?$=-1+D*2:l>=.7&&(ae=o+(d-o)*ne,X=-8*ne),this.style.setProperty("--reveal-x",`${Le}px`),this.style.setProperty("--army-opacity",String(Ee)),this.style.setProperty("--hero-x",`${ae}px`),this.style.setProperty("--hero-hop",`${oe}px`),this.style.setProperty("--hero-rotate",`${X}deg`),this.style.setProperty("--hero-scale-x",String($)),this.style.setProperty("--hero-scale-y",String(re)),this.style.setProperty("--hero-surprise",String(q)),this.style.setProperty("--hero-opacity",String(1-w(l,.92,1))),l<1){this.#u=window.requestAnimationFrame(h);return}this.#C?.classList.remove("is-revealing"),this.#G()};this.#u=window.requestAnimationFrame(h)}#G(){this.#u&&(window.cancelAnimationFrame(this.#u),this.#u=0),this.#F?.classList.remove("is-running"),this.#F?.replaceChildren(),this.style.removeProperty("--reveal-x"),this.style.removeProperty("--army-opacity"),this.style.removeProperty("--hero-hop"),this.style.removeProperty("--hero-opacity"),this.style.removeProperty("--hero-rotate"),this.style.removeProperty("--hero-scale-x"),this.style.removeProperty("--hero-scale-y"),this.style.removeProperty("--hero-surprise"),this.style.removeProperty("--hero-x")}#J(e){if(this.#_(),e<=0){E(),this.#A();return}this.#p=window.setTimeout(()=>{this.#p=0,E(),this.#A()},e)}#_(){this.#p&&(window.clearTimeout(this.#p),this.#p=0)}#Q(){if(!this.#i)return;window.cancelAnimationFrame(this.#P),this.#n=!1,this.#e=this.#H(),this.#x="",this.#y=0,this.#r(performance.now()),this.#l="",this.#d=0,this.#s=0,this.#m=0,this.#b=this.#S(performance.now()),this.#M=performance.now(),delete this.dataset.bonusKind,S(0),this.#I?.removeAttribute("hidden"),this.#O?.classList.remove("is-visible");const e=performance.now();this.#c=e,this.#R=e,this.#v=e,this.#z(e),E(),this.#t.querySelector('[data-action="challenge"]')?.focus(),this.#o()}#ee(e){const s=e.target;!(s instanceof HTMLElement)||s.closest("[data-action]")?.dataset.action!=="challenge"||!this.#i||this.#n||(e.preventDefault(),this.#m=performance.now(),this.#T(this.#m))}#te(e){const s=e.target;if(!(s instanceof HTMLElement))return;const i=s.closest("[data-action]"),n=i?.dataset.action;if(n==="sound"){const a=!J();Ce(a),a||(Z(),S(be(this.#e.revenuePerSecond)),this.#i&&!this.#n&&E(),z()),this.#A();return}if(n==="close"){this.#w();return}if(!this.#i||this.#n){n==="restart"&&this.#Q(),n==="share"&&this.#le();return}if(n==="challenge"){const a=performance.now();if(a-this.#m<450){e.preventDefault();return}this.#T(a);return}if(n==="buy"){const a=i?.dataset.upgrade;if(!a)return;this.#j(a)?z():F()}}#se(e){if(!this.#i)return;if(e.key==="Escape"){e.preventDefault(),this.#w();return}if(this.#n)return;if(e.key===" "){e.preventDefault(),this.#T(performance.now());return}if(e.key==="Enter"){const i=e.target;if(i instanceof HTMLButtonElement&&i.dataset.action!=="challenge")return;e.preventDefault(),this.#T(performance.now());return}const s=Number(e.key)-1;s>=0&&s<k.length&&(e.preventDefault(),this.#j(k[s].id)?z():F())}#r(e){const s=["Catch the ROAS spike","Compress assets","Fix checkout friction","Reply to comments","Sync stock alerts"],i=Math.min(1,Math.max(0,Math.log10(this.#e.revenue+1)/6));this.#D=e,this.#q=e+15e3,this.#g=.24-i*.15,this.#$=this.#g/2+Math.random()*(1-this.#g),this.#V=s[Math.floor(Math.random()*s.length)],this.#f=""}#S(e){const s=e-this.#D,i=.0046+Math.min(.0022,this.#e.elapsedMs/7e7);return(Math.sin(s*i)+1)/2}#T(e){const s=this.#e.temporaryBonus;if(s&&e<s.until)return;const i=e-this.#M<140?this.#b:this.#S(e);if(!(Math.abs(i-this.#$)<=this.#g/2+.018)){F(),this.#s=Math.max(0,this.#s-1),this.#l="Missed.",this.#d=e+1200,this.#r(e),this.#o();return}if(Se(),this.#s+=1,this.#B=e,this.#s<3){this.#l=`Hit ${this.#s}/3.`,this.#d=e+1400,this.#r(e),this.#o();return}this.#s=0,this.#ie(e),this.#r(e),this.#o()}#ie(e){const s=[{kind:"traffic",label:"+65% visitors",value:.65,startedAt:e,until:e+11200},{kind:"conversion",label:"+2.2 pts conversion",value:2.2,startedAt:e,until:e+9100},{kind:"performance",label:"-1.1s load time",value:1.1,startedAt:e,until:e+13300},{kind:"revenue",label:"x3 revenue pulse",value:2,startedAt:e,until:e+8e3}],i=s[Math.floor(Math.random()*s.length)];this.#e.temporaryBonus=i,this.#l="Bonus locked.",this.#d=e+1400,this.dataset.bonusKind=i.kind}#j(e){const s=k.find(c=>c.id===e);if(!s)return!1;const i=this.#e.upgrades[e],n=L(s,i);if(this.#e.cash<n)return!1;this.#e.cash-=n,this.#e.upgrades[e]=i+1;const a=performance.now();return e==="sales"&&(this.#e.saleBonus={kind:"conversion",label:"Flash sale",value:2.8+i*.22,startedAt:a,until:a+6e3+i*450},this.#B=a),this.#e.conversionRate=ee(this.#e,a),this.#e.loadTime=Q(this.#e,a),this.#e.revenuePerSecond=te(this.#e,R(this.#e,a),this.#e.conversionRate,a),S(be(this.#e.revenuePerSecond)),this.#o(),!0}#z(e){if(!this.#i)return;const s=Math.min(100,e-this.#v);if(this.#v=e,!this.#n&&e>=this.#c){this.#e.elapsedMs=Math.min(I,e-this.#R),this.#ae(s,e);const i=this.#e.revenuePerSecond*(s/1e3);this.#e.revenue+=i,this.#e.cash+=i,this.#e.elapsedMs>=I?this.#ne():this.#o()}this.#ue(e),this.#P=window.requestAnimationFrame(i=>this.#z(i))}#ne(){this.#n=!0,this.#_(),N(),S(0),Te();const e=Math.floor(this.#e.revenue),s=Math.max(e,this.#e.bestScore);this.#e.bestScore=s,localStorage.setItem(ge,String(s)),this.#I?.setAttribute("hidden","true"),this.#O?.classList.add("is-visible"),this.#t.querySelector("[data-grade]").textContent=xe(e),this.#t.querySelector("[data-final-score]").textContent=A(e),this.#t.querySelector("[data-best-score]").textContent=A(s),this.#oe();const i=this.#t.querySelector("[data-share-status]");i&&(i.textContent=""),this.#t.querySelector('[data-action="restart"]')?.focus()}#ae(e,s){this.#e.temporaryBonus&&s>=this.#e.temporaryBonus.until&&(this.#e.temporaryBonus=void 0,delete this.dataset.bonusKind,this.#s=0,this.#r(s)),this.#e.saleBonus&&s>=this.#e.saleBonus.until&&(this.#e.saleBonus=void 0),!this.#e.temporaryBonus&&s>=this.#q&&(this.#s=0,this.#r(s));const i=ee(this.#e,s),a=R(this.#e,s),c=Q(this.#e,s);if(this.#e.visits+=a*(e/6e4),this.#e.conversionRate=i,this.#e.loadTime=c,this.#e.revenuePerSecond=te(this.#e,a,i,s),s-this.#y<500)return;this.#y=s;const r=this.#e.statsHistory[this.#e.statsHistory.length-1]??this.#e,o=r.visits+(a-r.visits)*.42,d=r.conversionRate+(this.#e.conversionRate-r.conversionRate)*.36,f=r.loadTime+(this.#e.loadTime-r.loadTime)*.34,v={sampledAt:s,visits:o,conversionRate:d,loadTime:f};this.#e.runHistory=[...this.#e.runHistory.slice(-239),v],this.#e.statsHistory=[...this.#e.statsHistory.slice(-39),v].filter(m=>m.sampledAt!==0&&s-m.sampledAt<=15e3)}#o(){this.#t.querySelector("[data-score]").textContent=A(this.#e.cash),this.#t.querySelector("[data-rps]").textContent=`${A(this.#e.revenuePerSecond)}/s`,this.#t.querySelector("[data-time]").textContent=`${Math.ceil((I-this.#e.elapsedMs)/1e3)}s`,this.#re();const e=this.#t.querySelector("[data-upgrades]");if(!e)return;const s=k.map(i=>{const n=this.#e.upgrades[i.id],a=L(i,n),c=this.#e.cash>=a?"1":"0";return`${i.id}:${n}:${a}:${c}`}).join("|");s!==this.#x&&(this.#x=s,e.innerHTML=k.map((i,n)=>{const a=this.#e.upgrades[i.id],c=L(i,a),r=this.#e.cash<c?"disabled":"";return`
802          <button class="upgrade" type="button" data-action="buy" data-upgrade="${i.id}" ${r}>
803            <span>
804              <span class="upgrade-title">${n+1}. ${i.label}</span>
805              <span class="upgrade-desc">${i.description}</span>
806            </span>
807            <span>
808              <span class="upgrade-price">${A(c)}</span>
809              <span class="upgrade-level">lvl ${a}</span>
810            </span>
811          </button>
812        `}).join(""))}#re(){this.#K({points:this.#e.statsHistory,width:320,height:82,visitsSelector:"[data-visits-line]",conversionSelector:"[data-conversion-line]",loadSelector:"[data-load-line]"}),this.#t.querySelector("[data-visits]").textContent=String(Math.round(R(this.#e,performance.now()))),this.#t.querySelector("[data-conversion]").textContent=`${this.#e.conversionRate.toFixed(1)}%`,this.#t.querySelector("[data-load-time]").textContent=`${this.#e.loadTime.toFixed(1)}s`,this.#ce()}#K({points:e,width:s,height:i,visitsSelector:n,conversionSelector:a,loadSelector:c}){if(e.length===0)return;const r=e.map(b=>b.conversionRate),o=e.map(b=>b.loadTime),d=e.map(b=>b.visits),f=Math.max(10,...d),v=Math.max(0,Math.min(...d)-f*.08),m=Math.max(3,...r),p=Math.max(0,Math.min(...r)-m*.08),h=Math.max(4,...o),u=Math.max(0,Math.min(...o)-h*.08),l=this.#t.querySelector(n),g=this.#t.querySelector(a),y=this.#t.querySelector(c);l?.setAttribute("d",Y(d,s,i,v,f)),g?.setAttribute("d",Y(r,s,i,p,m)),y?.setAttribute("d",Y(o,s,i,u,h))}#oe(){const e=this.#e.runHistory.length>0?this.#e.runHistory:this.#e.statsHistory;if(e.length===0)return;this.#K({points:e,width:320,height:96,visitsSelector:"[data-run-visits-line]",conversionSelector:"[data-run-conversion-line]",loadSelector:"[data-run-load-line]"});const s=e.map(a=>a.visits),i=e.map(a=>a.conversionRate),n=e.map(a=>a.loadTime);this.#t.querySelector("[data-run-visits]").textContent=String(Math.round(Math.max(0,...s))),this.#t.querySelector("[data-run-conversion]").textContent=`${Math.max(0,...i).toFixed(1)}%`,this.#t.querySelector("[data-run-load-time]").textContent=`${Math.min(...n,9.9).toFixed(1)}s`}#ce(){const e=performance.now(),s=this.#e.temporaryBonus,i=this.#t.querySelector("[data-challenge-track]"),n=this.#t.querySelector(".challenge-card"),a=this.#t.querySelector("[data-challenge-label]"),c=this.#t.querySelector("[data-challenge-copy]"),r=this.#t.querySelector("[data-bonus]");if(s&&e<s.until){const h=Math.max(0,s.until-e),u=Math.max(1,s.until-s.startedAt),l=h/u*100,g=`bonus:${s.label}:${Math.round(l)}:${Math.ceil(h/1e3)}`;if(g===this.#f)return;this.#f=g,n?.classList.add("is-bonus"),i?.style.setProperty("--bonus-progress",l.toFixed(2)),a.textContent=`Bonus active - ${Math.ceil(h/1e3)}s`,c.textContent=s.label,r.textContent="Next challenge after bonus.";return}const o=this.#S(e)*100,d=this.#$*100,f=Math.max(0,this.#q-e),v=e<this.#d?this.#l:"",m=this.#g*100,p=`${Math.round(o)}:${Math.round(d)}:${Math.round(m)}:${this.#V}:${Math.ceil(f/1e3)}:${v}:${this.#s}`;p!==this.#f&&(this.#f=p,this.#b=o/100,this.#M=e,n?.classList.remove("is-bonus"),i?.style.setProperty("--cursor",o.toFixed(2)),i?.style.setProperty("--target",d.toFixed(2)),i?.style.setProperty("--window",m.toFixed(2)),i?.style.removeProperty("--bonus-progress"),a.textContent=`${this.#V} - ${Math.ceil(f/1e3)}s`,c.textContent=`Hit the green window ${this.#s}/3`,r.textContent=v)}#A(){const e=this.#t.querySelector("[data-sound]");if(!e)return;const s=J();e.textContent=s?"Sound off":"Sound on",e.setAttribute("aria-pressed",String(!s))}async#le(){const e=Math.floor(this.#e.revenue),s=`Merchant Revenue Rush: ${A(e)} in cumulative revenue over 120s. Grade ${xe(e)}.`,i=this.#t.querySelector("[data-share-status]");try{await navigator.clipboard.writeText(s),Ae(),i&&(i.textContent="Score copied.")}catch{i&&(i.textContent=s)}}#de(){this.#E=window.scrollY,this.#L=document.body.getAttribute("style")||"",this.#U=document.documentElement.style.overflow,document.body.style.position="fixed",document.body.style.top=`-${this.#E}px`,document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%",document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"}#he(){this.#L?document.body.setAttribute("style",this.#L):document.body.removeAttribute("style"),document.documentElement.style.overflow=this.#U,window.scrollTo(0,this.#E)}#Y(){if(!this.#a)return;const e=Math.min(window.devicePixelRatio||1,1.5);this.#a.width=Math.floor(window.innerWidth*e),this.#a.height=Math.floor(window.innerHeight*e)}#ue(e){if(!this.#a||!this.#k)return;const{width:s,height:i}=this.#a,n=this.#k,a=this.#h?28:16,c=this.#c>e?1-(this.#c-e)/(this.#h?120:900):1;n.clearRect(0,0,s,i),n.fillStyle="#070707",n.fillRect(0,0,s,i);const r=this.#e.temporaryBonus?.kind==="conversion"?1:0;for(let o=0;o<i;o+=a)for(let d=0;d<s;d+=a){const f=Math.sin((d*.01+o*.015+e*(.006+r*.012))*.7),v=Math.random()>c?.28:0,m=Math.max(0,1-(e-this.#B)/220),p=Math.floor(12+v*210+m*180+r*62),h=Math.floor(18+Math.max(0,f)*58+m*46+r*18),u=Math.floor(24+Math.max(0,-f)*92);n.fillStyle=`rgb(${p} ${h} ${u})`,n.fillRect(d,o,a-2,a-2)}}get#C(){return this.#t.querySelector(".overlay")}get#F(){return this.#t.querySelector(".transition")}get#I(){return this.#t.querySelector(".game")}get#O(){return this.#t.querySelector(".end")}}customElements.define("revenue-game",Pe);const ot=Object.freeze(Object.defineProperty({__proto__:null,RevenueGame:Pe},Symbol.toStringTag,{value:"Module"}));
812export{ot as a,rt as r};

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