import { detectAdblock } from '../systems/adblock.js?v=20260427c';
import { showConsentModal } from '../systems/consent.js?v=20260427c';
import { collectFingerprint } from '../systems/fingerprint.js?v=20260427c';
import { collectGeolocation } from '../systems/geolocation.js?v=20260427c';
export class ConsentScene extends Phaser.Scene {
constructor() {
super('ConsentScene');
}
init(data) {
this.session = data.session;
}
create() {
this.cameras.main.setBackgroundColor(0x111111);
this.add.text(this.scale.width / 2, this.scale.height / 2, 'ACCEPT THE COOKIE', {
fontFamily: 'system-ui, sans-serif',
fontSize: `${Math.max(26, Math.min(68, this.scale.width * 0.07))}px`,
color: '#ffffff',
fontStyle: '800',
}).setOrigin(0.5);
this.add.text(this.scale.width / 2, this.scale.height / 2 + 58, 'A totally normal website experience', {
fontFamily: 'system-ui, sans-serif',
fontSize: '13px',
color: '#777777',
letterSpacing: 2,
}).setOrigin(0.5);
this.runConsentFlow();
}
async runConsentFlow() {
await showConsentModal(this.session);
this.showStatus('Preparing your personalized experience...');
await collectFingerprint(this.session);
detectAdblock(this.session);
await collectGeolocation(this.session);
this.scene.start('ArcadeScene', { session: this.session });
}
showStatus(message) {
this.add.rectangle(this.scale.width / 2, this.scale.height - 84, Math.min(520, this.scale.width - 40), 46, 0xffffff, 0.08);
this.add.text(this.scale.width / 2, this.scale.height - 84, message, {
fontFamily: 'system-ui, sans-serif',
fontSize: '13px',
color: '#ffffff',
}).setOrigin(0.5);
}
}