devtools-guardian 1.0.1
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/README.md +192 -0
- package/dist/index.d.mts +57 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +657 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +628 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +39 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,657 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
DevToolsProtection: () => DevToolsProtection,
|
|
24
|
+
DevToolsWarningOverlay: () => DevToolsWarningOverlay_default,
|
|
25
|
+
useDevToolsDetector: () => useDevToolsDetector
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
|
|
29
|
+
// src/hooks/useDevToolsDetector.ts
|
|
30
|
+
var import_react = require("react");
|
|
31
|
+
var DEFAULT_BLOCKED_KEYS = [
|
|
32
|
+
// 'F12',
|
|
33
|
+
"Ctrl+Shift+I",
|
|
34
|
+
"Ctrl+Shift+J",
|
|
35
|
+
"Ctrl+Shift+C",
|
|
36
|
+
"Ctrl+U",
|
|
37
|
+
"Ctrl+S"
|
|
38
|
+
];
|
|
39
|
+
var CONSOLE_STYLES = {
|
|
40
|
+
owner: "color:rgba(89, 255, 0, 1);font-size:28px;font-weight:900;font-family:monospace;text-shadow:0 0 10px rgba(89, 255, 0, 1);padding:5px 0;",
|
|
41
|
+
warning: "color:#FF8C00;font-size:22px;font-weight:800;font-family:monospace;text-shadow:0 0 10px rgba(255, 189, 0, 1);padding:5px 0;",
|
|
42
|
+
message: "color:red;font-size:14px;font-family:monospace;font-weight:bold;margin-bottom:8px;",
|
|
43
|
+
labelGreen: "color:#10b981;font-size:13px;font-family:monospace;font-weight:bold;",
|
|
44
|
+
linkPurple: "color:#6366f1;font-size:13px;font-family:monospace;text-decoration:underline;font-weight:bold;"
|
|
45
|
+
};
|
|
46
|
+
var isMobileDevice = () => {
|
|
47
|
+
if (typeof window === "undefined") return false;
|
|
48
|
+
return window.matchMedia("(pointer: coarse)").matches || /Mobi|Android|iPhone|iPad/i.test(navigator.userAgent);
|
|
49
|
+
};
|
|
50
|
+
var isDevMode = () => {
|
|
51
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV === "development") {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
if (typeof window !== "undefined" && window.location) {
|
|
55
|
+
const hostname = window.location.hostname;
|
|
56
|
+
if (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname.startsWith("192.168.") || hostname.startsWith("10.") || hostname.startsWith("172.")) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
function useDevToolsDetector(options = {}) {
|
|
63
|
+
const {
|
|
64
|
+
blockedKeys = DEFAULT_BLOCKED_KEYS,
|
|
65
|
+
disableRightClick = true,
|
|
66
|
+
disableSelection = true,
|
|
67
|
+
onDetect,
|
|
68
|
+
onClose,
|
|
69
|
+
pollInterval = 1500,
|
|
70
|
+
thresholdBuffer = 0
|
|
71
|
+
} = options;
|
|
72
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(false);
|
|
73
|
+
const isOpenRef = (0, import_react.useRef)(false);
|
|
74
|
+
const onDetectRef = (0, import_react.useRef)(onDetect);
|
|
75
|
+
const onCloseRef = (0, import_react.useRef)(onClose);
|
|
76
|
+
(0, import_react.useEffect)(() => {
|
|
77
|
+
onDetectRef.current = onDetect;
|
|
78
|
+
}, [onDetect]);
|
|
79
|
+
(0, import_react.useEffect)(() => {
|
|
80
|
+
onCloseRef.current = onClose;
|
|
81
|
+
}, [onClose]);
|
|
82
|
+
const triggerDetection = (0, import_react.useCallback)(() => {
|
|
83
|
+
if (!isOpenRef.current) {
|
|
84
|
+
isOpenRef.current = true;
|
|
85
|
+
setIsOpen(true);
|
|
86
|
+
onDetectRef.current?.();
|
|
87
|
+
}
|
|
88
|
+
}, []);
|
|
89
|
+
const triggerClose = (0, import_react.useCallback)(() => {
|
|
90
|
+
if (isOpenRef.current) {
|
|
91
|
+
isOpenRef.current = false;
|
|
92
|
+
setIsOpen(false);
|
|
93
|
+
onCloseRef.current?.();
|
|
94
|
+
}
|
|
95
|
+
}, []);
|
|
96
|
+
const printConsoleBranding = (0, import_react.useCallback)(() => {
|
|
97
|
+
console.clear();
|
|
98
|
+
console.log("%c Built with \u2764\uFE0F by Ali Arshad", CONSOLE_STYLES.owner);
|
|
99
|
+
console.log("%c \u26A0 UNAUTHORIZED REVERSE ENGINEERING DETECTED.", CONSOLE_STYLES.warning);
|
|
100
|
+
console.log(
|
|
101
|
+
"%c \u26A0 Stealing code harms innovation. Let's build together instead!",
|
|
102
|
+
CONSOLE_STYLES.message
|
|
103
|
+
);
|
|
104
|
+
console.log(
|
|
105
|
+
"%c \u26A0 Portfolio: %chttps://ali-arshad-110.github.io",
|
|
106
|
+
CONSOLE_STYLES.labelGreen,
|
|
107
|
+
CONSOLE_STYLES.linkPurple
|
|
108
|
+
);
|
|
109
|
+
}, []);
|
|
110
|
+
(0, import_react.useEffect)(() => {
|
|
111
|
+
const blockedSet = new Set(blockedKeys);
|
|
112
|
+
const handleKeyDown = (e) => {
|
|
113
|
+
const key = e.key.toLowerCase();
|
|
114
|
+
if (blockedSet.has("F12") && e.key === "F12") {
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
triggerDetection();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (e.ctrlKey && e.shiftKey) {
|
|
120
|
+
if (blockedSet.has("Ctrl+Shift+I") && key === "i" || blockedSet.has("Ctrl+Shift+J") && key === "j" || blockedSet.has("Ctrl+Shift+C") && key === "c") {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
triggerDetection();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (blockedSet.has("Ctrl+U") && e.ctrlKey && key === "u") {
|
|
127
|
+
e.preventDefault();
|
|
128
|
+
triggerDetection();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (blockedSet.has("Ctrl+S") && e.ctrlKey && key === "s") {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const handleContextMenu = (e) => {
|
|
136
|
+
if (disableRightClick) e.preventDefault();
|
|
137
|
+
};
|
|
138
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
139
|
+
window.addEventListener("contextmenu", handleContextMenu);
|
|
140
|
+
return () => {
|
|
141
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
142
|
+
window.removeEventListener("contextmenu", handleContextMenu);
|
|
143
|
+
};
|
|
144
|
+
}, [blockedKeys, disableRightClick, triggerDetection]);
|
|
145
|
+
(0, import_react.useEffect)(() => {
|
|
146
|
+
const el = document.body;
|
|
147
|
+
if (disableSelection) {
|
|
148
|
+
el.style.userSelect = "none";
|
|
149
|
+
el.style.webkitUserSelect = "none";
|
|
150
|
+
}
|
|
151
|
+
return () => {
|
|
152
|
+
el.style.userSelect = "";
|
|
153
|
+
el.style.webkitUserSelect = "";
|
|
154
|
+
};
|
|
155
|
+
}, [disableSelection]);
|
|
156
|
+
(0, import_react.useEffect)(() => {
|
|
157
|
+
const checkDimensions = () => {
|
|
158
|
+
if (isMobileDevice()) return false;
|
|
159
|
+
const dpr = window.devicePixelRatio || 1;
|
|
160
|
+
const widthThreshold = Math.max(50, 160 / dpr) + thresholdBuffer;
|
|
161
|
+
const heightThreshold = Math.max(120, 250 / dpr) + thresholdBuffer;
|
|
162
|
+
return window.outerWidth - window.innerWidth > widthThreshold || window.outerHeight - window.innerHeight > heightThreshold;
|
|
163
|
+
};
|
|
164
|
+
const handleResize = () => {
|
|
165
|
+
if (checkDimensions()) triggerDetection();
|
|
166
|
+
};
|
|
167
|
+
window.addEventListener("resize", handleResize);
|
|
168
|
+
handleResize();
|
|
169
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
170
|
+
}, [thresholdBuffer, triggerDetection]);
|
|
171
|
+
(0, import_react.useEffect)(() => {
|
|
172
|
+
let consoleGetterFired = false;
|
|
173
|
+
const sentinel = {
|
|
174
|
+
[Symbol.toPrimitive]() {
|
|
175
|
+
consoleGetterFired = true;
|
|
176
|
+
return "devtools-probe";
|
|
177
|
+
},
|
|
178
|
+
toString() {
|
|
179
|
+
consoleGetterFired = true;
|
|
180
|
+
return "devtools-probe";
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const checkDebuggerTiming = () => {
|
|
184
|
+
if (isDevMode()) return false;
|
|
185
|
+
const t0 = performance.now();
|
|
186
|
+
debugger;
|
|
187
|
+
return performance.now() - t0 > 100;
|
|
188
|
+
};
|
|
189
|
+
const checkDimensions = () => {
|
|
190
|
+
if (isMobileDevice()) return false;
|
|
191
|
+
const dpr = window.devicePixelRatio || 1;
|
|
192
|
+
return window.outerWidth - window.innerWidth > Math.max(60, 80 / dpr) + thresholdBuffer || window.outerHeight - window.innerHeight > Math.max(80, 150 / dpr) + thresholdBuffer;
|
|
193
|
+
};
|
|
194
|
+
const tick = () => {
|
|
195
|
+
consoleGetterFired = false;
|
|
196
|
+
const _orig = console.log;
|
|
197
|
+
try {
|
|
198
|
+
console.log = (...args) => {
|
|
199
|
+
if (args[0] === sentinel) return;
|
|
200
|
+
_orig.apply(console, args);
|
|
201
|
+
};
|
|
202
|
+
console.log(sentinel);
|
|
203
|
+
} finally {
|
|
204
|
+
console.log = _orig;
|
|
205
|
+
}
|
|
206
|
+
setTimeout(() => {
|
|
207
|
+
const detected = consoleGetterFired || checkDimensions() || checkDebuggerTiming();
|
|
208
|
+
if (detected) {
|
|
209
|
+
triggerDetection();
|
|
210
|
+
printConsoleBranding();
|
|
211
|
+
} else {
|
|
212
|
+
triggerClose();
|
|
213
|
+
}
|
|
214
|
+
}, 50);
|
|
215
|
+
};
|
|
216
|
+
const intervalId = setInterval(tick, pollInterval);
|
|
217
|
+
tick();
|
|
218
|
+
return () => clearInterval(intervalId);
|
|
219
|
+
}, [pollInterval, thresholdBuffer, triggerDetection, triggerClose, printConsoleBranding]);
|
|
220
|
+
return isOpen;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// src/components/DevToolsWarningOverlay.tsx
|
|
224
|
+
var import_react2 = require("react");
|
|
225
|
+
var import_framer_motion = require("framer-motion");
|
|
226
|
+
|
|
227
|
+
// #style-inject:#style-inject
|
|
228
|
+
function styleInject(css, { insertAt } = {}) {
|
|
229
|
+
if (!css || typeof document === "undefined") return;
|
|
230
|
+
const head = document.head || document.getElementsByTagName("head")[0];
|
|
231
|
+
const style = document.createElement("style");
|
|
232
|
+
style.type = "text/css";
|
|
233
|
+
if (insertAt === "top") {
|
|
234
|
+
if (head.firstChild) {
|
|
235
|
+
head.insertBefore(style, head.firstChild);
|
|
236
|
+
} else {
|
|
237
|
+
head.appendChild(style);
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
head.appendChild(style);
|
|
241
|
+
}
|
|
242
|
+
if (style.styleSheet) {
|
|
243
|
+
style.styleSheet.cssText = css;
|
|
244
|
+
} else {
|
|
245
|
+
style.appendChild(document.createTextNode(css));
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// src/styles/index.css
|
|
250
|
+
styleInject('.dtg-overlay {\n position: fixed;\n inset: 0;\n z-index: 99999;\n display: flex;\n align-items: center;\n justify-content: center;\n user-select: none;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n "Liberation Mono",\n "Courier New",\n monospace;\n background: rgba(3, 5, 8, 0.93);\n backdrop-filter: blur(6px);\n}\n.dtg-canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n opacity: 0.18;\n}\n.dtg-scanlines {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.dtg-vignette {\n position: absolute;\n inset: 0;\n pointer-events: none;\n background:\n radial-gradient(\n ellipse 60% 55% at 50% 50%,\n rgba(190, 18, 60, 0.07) 0%,\n transparent 70%);\n}\n.dtg-card {\n position: relative;\n width: 100%;\n max-width: 512px;\n margin-left: 16px;\n margin-right: 16px;\n border-radius: 12px;\n overflow: hidden;\n background: rgba(8, 12, 18, 0.92);\n border: 1px solid rgba(244, 63, 94, 0.2);\n box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.05), 0 32px 64px rgba(0, 0, 0, 0.6);\n}\n.dtg-card-padding {\n padding: 32px;\n}\n.dtg-neon-edge {\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n transparent 0%,\n #f43f5e 30%,\n #f43f5e 70%,\n transparent 100%);\n box-shadow: 0 0 6px 1px rgba(244, 63, 94, 0.6);\n}\n.dtg-neon-edge-top {\n top: 0;\n}\n.dtg-neon-edge-bottom {\n bottom: 0;\n}\n.dtg-pulse-dot {\n position: relative;\n display: flex;\n height: 10px;\n width: 10px;\n flex-shrink: 0;\n}\n.dtg-pulse-dot-ping {\n position: absolute;\n display: inline-flex;\n height: 100%;\n width: 100%;\n border-radius: 9999px;\n opacity: 0.6;\n animation: dtg-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;\n}\n.dtg-pulse-dot-inner {\n position: relative;\n display: inline-flex;\n border-radius: 9999px;\n height: 10px;\n width: 10px;\n}\n@keyframes dtg-ping {\n 75%, 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n.dtg-creator-grid {\n display: grid;\n grid-template-columns: repeat(3, minmax(0, 1fr));\n gap: 12px;\n padding-top: 4px;\n}\n.dtg-creator-card {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n padding: 16px 8px;\n border-radius: 8px;\n border: 1px solid rgba(148, 163, 184, 0.12);\n background: rgba(15, 20, 30, 0.7);\n text-decoration: none;\n transition: all 0.2s ease-in-out;\n}\n.dtg-creator-icon {\n width: 36px;\n height: 36px;\n border-radius: 9999px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 2px;\n transition: background-color 0.2s, color 0.2s;\n}\n.dtg-creator-label {\n font-size: 13px;\n font-weight: 600;\n color: #e2e8f0;\n}\n.dtg-creator-sub {\n font-size: 10px;\n color: #64748b;\n letter-spacing: 0.025em;\n}\n.dtg-scan-container {\n display: flex;\n flex-direction: column;\n gap: 20px;\n}\n.dtg-flex-row {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.dtg-scan-title {\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.2em;\n text-transform: uppercase;\n color: #fb7185;\n}\n.dtg-steps-list {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin: 0;\n padding: 0;\n list-style: none;\n}\n.dtg-step-item {\n display: flex;\n align-items: start;\n gap: 10px;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 14px;\n}\n.dtg-step-indicator {\n margin-top: 2px;\n width: 16px;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.dtg-step-dot {\n width: 6px;\n height: 6px;\n border-radius: 9999px;\n background-color: #334155;\n display: inline-block;\n}\n.dtg-text-done {\n color: #64748b;\n text-decoration: line-through;\n text-decoration-color: #475569;\n}\n.dtg-text-active {\n color: #fda4af;\n font-weight: 500;\n}\n.dtg-text-pending {\n color: #475569;\n}\n.dtg-progress-track {\n width: 100%;\n height: 3px;\n border-radius: 9999px;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.06);\n}\n.dtg-progress-fill {\n height: 100%;\n border-radius: 9999px;\n background:\n linear-gradient(\n 90deg,\n #be123c,\n #f43f5e,\n #fb7185);\n}\n.dtg-log-stream {\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 10px;\n color: #065f46;\n line-height: 1.625;\n display: flex;\n flex-direction: column;\n gap: 2px;\n opacity: 0.6;\n user-select: none;\n}\n.dtg-warning-container {\n text-align: center;\n display: flex;\n flex-direction: column;\n gap: 24px;\n}\n.dtg-shield-wrapper {\n display: inline-flex;\n padding: 16px;\n border-radius: 9999px;\n border: 1px solid rgba(244, 63, 94, 0.3);\n background: rgba(190, 18, 60, 0.12);\n box-shadow: 0 0 24px rgba(244, 63, 94, 0.18);\n margin: 0 auto;\n}\n.dtg-shield-icon {\n width: 40px;\n height: 40px;\n color: #f43f5e;\n}\n.dtg-warning-title {\n font-size: 20px;\n font-weight: 700;\n letter-spacing: 0.15em;\n text-transform: uppercase;\n color: #f43f5e;\n text-shadow: 0 0 20px rgba(244, 63, 94, 0.35);\n margin: 0;\n}\n.dtg-divider {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 12px;\n margin: 0 auto;\n width: 100%;\n max-width: 320px;\n}\n.dtg-divider-line {\n flex: 1 1 0%;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n transparent,\n rgba(244, 63, 94, 0.4));\n}\n.dtg-divider-line-rev {\n flex: 1 1 0%;\n height: 1px;\n background:\n linear-gradient(\n 90deg,\n rgba(244, 63, 94, 0.4),\n transparent);\n}\n.dtg-divider-text {\n font-size: 9px;\n letter-spacing: 0.25em;\n text-transform: uppercase;\n color: rgba(190, 18, 60, 0.7);\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n}\n.dtg-description {\n color: #94a3b8;\n font-size: 14px;\n line-height: 1.625;\n max-width: 384px;\n margin: 0 auto;\n}\n.dtg-close-button {\n margin-top: 4px;\n padding: 8px 28px;\n border-radius: 4px;\n font-size: 12px;\n font-weight: 600;\n letter-spacing: 0.15em;\n text-transform: uppercase;\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n border: 1px solid rgba(244, 63, 94, 0.25);\n color: #fda4af;\n background: transparent;\n align-self: center;\n}\n.dtg-close-button:hover {\n background: rgba(244, 63, 94, 0.08);\n border-color: rgba(244, 63, 94, 0.5);\n}\n.dtg-footer {\n padding-top: 16px;\n border-top: 1px solid rgba(255, 255, 255, 0.05);\n font-family:\n ui-monospace,\n SFMono-Regular,\n Menlo,\n Monaco,\n Consolas,\n monospace;\n font-size: 9px;\n color: rgba(148, 163, 184, 0.3);\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.dtg-uppercase-track {\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n');
|
|
251
|
+
|
|
252
|
+
// src/components/DevToolsWarningOverlay.tsx
|
|
253
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
254
|
+
var SCAN_STEPS = [
|
|
255
|
+
{ id: "step-1", label: "Tracing unauthorized debugger session..." },
|
|
256
|
+
{ id: "step-2", label: "Analyzing reverse-engineering attempt..." },
|
|
257
|
+
{ id: "step-3", label: "Access monitored \u2014 preparing security report..." }
|
|
258
|
+
];
|
|
259
|
+
var STEP_INTERVAL_MS = 1e3;
|
|
260
|
+
var MATRIX_CHARS = "\uFF71\uFF72\uFF73\uFF74\uFF75\uFF76\uFF77\uFF78\uFF79\uFF7A\uFF7B\uFF7C\uFF7D\uFF7E\uFF7F\uFF80\uFF81\uFF82\uFF83\uFF84\uFF85\uFF86\uFF87\uFF88\uFF89\uFF8A\uFF8B\uFF8C\uFF8D\uFF8E\uFF8F\uFF90\uFF91\uFF92\uFF93\uFF94\uFF95\uFF96\uFF97\uFF98\uFF99\uFF9A\uFF9B\uFF9C\uFF9D0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
261
|
+
var MATRIX_FONT_SIZE = 15;
|
|
262
|
+
var MatrixBackground = () => {
|
|
263
|
+
const canvasRef = (0, import_react2.useRef)(null);
|
|
264
|
+
(0, import_react2.useEffect)(() => {
|
|
265
|
+
const canvas = canvasRef.current;
|
|
266
|
+
if (!canvas) return;
|
|
267
|
+
const ctx = canvas.getContext("2d");
|
|
268
|
+
if (!ctx) return;
|
|
269
|
+
const chars = MATRIX_CHARS.split("");
|
|
270
|
+
let rainDrops = [];
|
|
271
|
+
let animId;
|
|
272
|
+
let mounted = true;
|
|
273
|
+
const initDrops = () => {
|
|
274
|
+
const cols = Math.floor(canvas.width / MATRIX_FONT_SIZE);
|
|
275
|
+
rainDrops = Array.from(
|
|
276
|
+
{ length: cols },
|
|
277
|
+
() => Math.floor(Math.random() * (canvas.height / MATRIX_FONT_SIZE))
|
|
278
|
+
);
|
|
279
|
+
};
|
|
280
|
+
const resize = () => {
|
|
281
|
+
canvas.width = window.innerWidth;
|
|
282
|
+
canvas.height = window.innerHeight;
|
|
283
|
+
initDrops();
|
|
284
|
+
};
|
|
285
|
+
resize();
|
|
286
|
+
const draw = () => {
|
|
287
|
+
if (!mounted) return;
|
|
288
|
+
ctx.fillStyle = "rgba(5, 7, 10, 0.055)";
|
|
289
|
+
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
|
290
|
+
ctx.font = `${MATRIX_FONT_SIZE}px monospace`;
|
|
291
|
+
for (let i = 0; i < rainDrops.length; i++) {
|
|
292
|
+
const ch = chars[Math.floor(Math.random() * chars.length)];
|
|
293
|
+
const x = i * MATRIX_FONT_SIZE;
|
|
294
|
+
const y = rainDrops[i] * MATRIX_FONT_SIZE;
|
|
295
|
+
const r = Math.random();
|
|
296
|
+
if (r > 0.985) {
|
|
297
|
+
ctx.fillStyle = "#f43f5e";
|
|
298
|
+
} else if (r > 0.96) {
|
|
299
|
+
ctx.fillStyle = "#22d3ee";
|
|
300
|
+
} else {
|
|
301
|
+
ctx.fillStyle = "#10b981";
|
|
302
|
+
}
|
|
303
|
+
ctx.fillText(ch, x, y);
|
|
304
|
+
if (y > canvas.height && Math.random() > 0.975) {
|
|
305
|
+
rainDrops[i] = 0;
|
|
306
|
+
}
|
|
307
|
+
rainDrops[i]++;
|
|
308
|
+
}
|
|
309
|
+
animId = requestAnimationFrame(draw);
|
|
310
|
+
};
|
|
311
|
+
animId = requestAnimationFrame(draw);
|
|
312
|
+
window.addEventListener("resize", resize);
|
|
313
|
+
return () => {
|
|
314
|
+
mounted = false;
|
|
315
|
+
cancelAnimationFrame(animId);
|
|
316
|
+
window.removeEventListener("resize", resize);
|
|
317
|
+
};
|
|
318
|
+
}, []);
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
320
|
+
"canvas",
|
|
321
|
+
{
|
|
322
|
+
ref: canvasRef,
|
|
323
|
+
"aria-hidden": "true",
|
|
324
|
+
className: "dtg-canvas"
|
|
325
|
+
}
|
|
326
|
+
);
|
|
327
|
+
};
|
|
328
|
+
var ScanlineOverlay = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
329
|
+
"div",
|
|
330
|
+
{
|
|
331
|
+
"aria-hidden": "true",
|
|
332
|
+
className: "dtg-scanlines",
|
|
333
|
+
style: {
|
|
334
|
+
backgroundImage: [
|
|
335
|
+
"repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px)",
|
|
336
|
+
"repeating-linear-gradient(90deg, rgba(255,0,0,0.025), rgba(0,255,0,0.015), rgba(0,0,255,0.025))"
|
|
337
|
+
].join(", ")
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
var NeonEdge = ({ position }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
342
|
+
"div",
|
|
343
|
+
{
|
|
344
|
+
"aria-hidden": "true",
|
|
345
|
+
className: `dtg-neon-edge dtg-neon-edge-${position}`
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
var PulseDot = ({ color = "#f43f5e" }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dtg-pulse-dot", "aria-hidden": "true", children: [
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
350
|
+
"span",
|
|
351
|
+
{
|
|
352
|
+
className: "dtg-pulse-dot-ping",
|
|
353
|
+
style: { backgroundColor: color }
|
|
354
|
+
}
|
|
355
|
+
),
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
357
|
+
"span",
|
|
358
|
+
{
|
|
359
|
+
className: "dtg-pulse-dot-inner",
|
|
360
|
+
style: { backgroundColor: color }
|
|
361
|
+
}
|
|
362
|
+
)
|
|
363
|
+
] });
|
|
364
|
+
var IconGithub = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className, fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
365
|
+
"path",
|
|
366
|
+
{
|
|
367
|
+
fillRule: "evenodd",
|
|
368
|
+
clipRule: "evenodd",
|
|
369
|
+
d: "M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483\n 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466\n -.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832\n .092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688\n -.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844\n c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651\n .64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855\n 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482C19.138 20.197 22 16.44 22 12.017\n 22 6.484 17.522 2 12 2z"
|
|
370
|
+
}
|
|
371
|
+
) });
|
|
372
|
+
var IconLinkedin = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className, fill: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M19 0H5C2.239 0 0 2.239 0 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5V5c0-2.761-2.238-5-5-5zM8 19H5V8h3v11zM6.5 6.732c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zM20 19h-3v-5.604c0-3.368-4-3.113-4 0V19h-3V8h3v1.765c1.396-2.586 7-2.777 7 2.476V19z" }) });
|
|
373
|
+
var IconGlobe = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { className, fill: "none", stroke: "currentColor", strokeWidth: 1.8, viewBox: "0 0 24 24", "aria-hidden": "true", children: [
|
|
374
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "10" }),
|
|
375
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 2a14.5 14.5 0 010 20M12 2a14.5 14.5 0 000 20M2 12h20" })
|
|
376
|
+
] });
|
|
377
|
+
var IconShield = ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { className, fill: "none", stroke: "currentColor", strokeWidth: 1.5, viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
378
|
+
"path",
|
|
379
|
+
{
|
|
380
|
+
strokeLinecap: "round",
|
|
381
|
+
strokeLinejoin: "round",
|
|
382
|
+
d: "M12 2L4 6v6c0 5.25 3.5 10.15 8 11 4.5-.85 8-5.75 8-11V6l-8-4z"
|
|
383
|
+
}
|
|
384
|
+
) });
|
|
385
|
+
var CreatorCard = ({ href, icon, label, sub, accentColor }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
386
|
+
import_framer_motion.motion.a,
|
|
387
|
+
{
|
|
388
|
+
href,
|
|
389
|
+
target: "_blank",
|
|
390
|
+
rel: "noopener noreferrer",
|
|
391
|
+
whileHover: { y: -2, scale: 1.02 },
|
|
392
|
+
whileTap: { scale: 0.97 },
|
|
393
|
+
transition: { type: "spring", stiffness: 400, damping: 20 },
|
|
394
|
+
className: "dtg-creator-card",
|
|
395
|
+
onMouseEnter: (e) => {
|
|
396
|
+
e.currentTarget.style.borderColor = `${accentColor}55`;
|
|
397
|
+
e.currentTarget.style.background = `${accentColor}0d`;
|
|
398
|
+
},
|
|
399
|
+
onMouseLeave: (e) => {
|
|
400
|
+
e.currentTarget.style.borderColor = "rgba(148,163,184,0.12)";
|
|
401
|
+
e.currentTarget.style.background = "rgba(15,20,30,0.7)";
|
|
402
|
+
},
|
|
403
|
+
children: [
|
|
404
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
405
|
+
"span",
|
|
406
|
+
{
|
|
407
|
+
className: "dtg-creator-icon",
|
|
408
|
+
style: { background: `${accentColor}18`, color: accentColor },
|
|
409
|
+
children: icon
|
|
410
|
+
}
|
|
411
|
+
),
|
|
412
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-creator-label", children: label }),
|
|
413
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-creator-sub", children: sub })
|
|
414
|
+
]
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
var ScanPhase = ({ step }) => {
|
|
418
|
+
const progress = Math.min((step + 1) / SCAN_STEPS.length * 100, 100);
|
|
419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
420
|
+
import_framer_motion.motion.div,
|
|
421
|
+
{
|
|
422
|
+
initial: { opacity: 0, y: 12 },
|
|
423
|
+
animate: { opacity: 1, y: 0 },
|
|
424
|
+
exit: { opacity: 0, y: -12 },
|
|
425
|
+
transition: { duration: 0.25 },
|
|
426
|
+
className: "dtg-scan-container",
|
|
427
|
+
children: [
|
|
428
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dtg-flex-row", children: [
|
|
429
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(PulseDot, {}),
|
|
430
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-scan-title", children: "Security scan running" })
|
|
431
|
+
] }),
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "dtg-steps-list", "aria-live": "polite", "aria-label": "Scan progress", children: SCAN_STEPS.map((s, idx) => {
|
|
433
|
+
const done = idx < step;
|
|
434
|
+
const active = idx === step;
|
|
435
|
+
const pending = idx > step;
|
|
436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
437
|
+
import_framer_motion.motion.li,
|
|
438
|
+
{
|
|
439
|
+
initial: { opacity: 0, x: -8 },
|
|
440
|
+
animate: { opacity: pending ? 0.3 : 1, x: 0 },
|
|
441
|
+
transition: { duration: 0.3, delay: active ? 0.05 : 0 },
|
|
442
|
+
className: "dtg-step-item",
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dtg-step-indicator", children: [
|
|
445
|
+
done && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { style: { width: "14px", height: "14px", color: "#34d399" }, fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }),
|
|
446
|
+
active && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PulseDot, { color: "#f43f5e" }),
|
|
447
|
+
pending && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-step-dot" })
|
|
448
|
+
] }),
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
450
|
+
"span",
|
|
451
|
+
{
|
|
452
|
+
className: done ? "dtg-text-done" : active ? "dtg-text-active" : "dtg-text-pending",
|
|
453
|
+
children: s.label
|
|
454
|
+
}
|
|
455
|
+
)
|
|
456
|
+
]
|
|
457
|
+
},
|
|
458
|
+
s.id
|
|
459
|
+
);
|
|
460
|
+
}) }),
|
|
461
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
role: "progressbar",
|
|
465
|
+
"aria-valuenow": Math.round(progress),
|
|
466
|
+
"aria-valuemin": 0,
|
|
467
|
+
"aria-valuemax": 100,
|
|
468
|
+
"aria-label": "Scan progress",
|
|
469
|
+
className: "dtg-progress-track",
|
|
470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
471
|
+
import_framer_motion.motion.div,
|
|
472
|
+
{
|
|
473
|
+
initial: { width: "0%" },
|
|
474
|
+
animate: { width: `${progress}%` },
|
|
475
|
+
transition: { duration: STEP_INTERVAL_MS / 1e3, ease: "easeInOut" },
|
|
476
|
+
className: "dtg-progress-fill"
|
|
477
|
+
}
|
|
478
|
+
)
|
|
479
|
+
}
|
|
480
|
+
),
|
|
481
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
482
|
+
"div",
|
|
483
|
+
{
|
|
484
|
+
"aria-hidden": "true",
|
|
485
|
+
className: "dtg-log-stream",
|
|
486
|
+
children: [
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
488
|
+
"> pid=",
|
|
489
|
+
"{",
|
|
490
|
+
"0x",
|
|
491
|
+
Math.floor(Math.random() * 65535).toString(16).padStart(4, "0"),
|
|
492
|
+
`'}`,
|
|
493
|
+
" signal=SIGINT"
|
|
494
|
+
] }),
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
496
|
+
"> stack_trace captured at 0x",
|
|
497
|
+
Math.floor(Math.random() * 16777215).toString(16)
|
|
498
|
+
] }),
|
|
499
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
500
|
+
"> hash_check: ",
|
|
501
|
+
step >= 1 ? "MISMATCH \u2717" : "pending..."
|
|
502
|
+
] }),
|
|
503
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
|
|
504
|
+
"> exfil_guard: ",
|
|
505
|
+
step >= 2 ? "BLOCKED \u2717" : "scanning..."
|
|
506
|
+
] })
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
)
|
|
510
|
+
]
|
|
511
|
+
},
|
|
512
|
+
"scan"
|
|
513
|
+
);
|
|
514
|
+
};
|
|
515
|
+
var WarningPhase = ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
516
|
+
import_framer_motion.motion.div,
|
|
517
|
+
{
|
|
518
|
+
initial: { opacity: 0, scale: 0.97 },
|
|
519
|
+
animate: { opacity: 1, scale: 1 },
|
|
520
|
+
transition: { duration: 0.35, type: "spring", stiffness: 260, damping: 22 },
|
|
521
|
+
className: "dtg-warning-container",
|
|
522
|
+
children: [
|
|
523
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
524
|
+
import_framer_motion.motion.div,
|
|
525
|
+
{
|
|
526
|
+
initial: { scale: 0.6, opacity: 0 },
|
|
527
|
+
animate: { scale: 1, opacity: 1 },
|
|
528
|
+
transition: { delay: 0.1, type: "spring", stiffness: 300, damping: 18 },
|
|
529
|
+
className: "dtg-shield-wrapper",
|
|
530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconShield, { className: "dtg-shield-icon" })
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dtg-flex-row", style: { flexDirection: "column", gap: "10px" }, children: [
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { className: "dtg-warning-title", children: "Developer Tools Detected" }),
|
|
535
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dtg-divider", children: [
|
|
536
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dtg-divider-line" }),
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-divider-text", children: "alert" }),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dtg-divider-line-rev" })
|
|
539
|
+
] })
|
|
540
|
+
] }),
|
|
541
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dtg-description", children: "This platform is protected intellectual property. Reverse engineering or code extraction is monitored. If you're curious about what was built here, reach out directly." }),
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dtg-creator-grid", children: [
|
|
543
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
544
|
+
CreatorCard,
|
|
545
|
+
{
|
|
546
|
+
href: "https://github.com/Ali-Arshad-110",
|
|
547
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconGithub, { className: "w-4 h-4" }),
|
|
548
|
+
label: "GitHub",
|
|
549
|
+
sub: "My Work",
|
|
550
|
+
accentColor: "#818cf8"
|
|
551
|
+
}
|
|
552
|
+
),
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
554
|
+
CreatorCard,
|
|
555
|
+
{
|
|
556
|
+
href: "https://www.linkedin.com/in/aliarshad110",
|
|
557
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconLinkedin, { className: "w-4 h-4" }),
|
|
558
|
+
label: "LinkedIn",
|
|
559
|
+
sub: "Connect",
|
|
560
|
+
accentColor: "#38bdf8"
|
|
561
|
+
}
|
|
562
|
+
),
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
564
|
+
CreatorCard,
|
|
565
|
+
{
|
|
566
|
+
href: "https://github.com/Ali-Arshad-110",
|
|
567
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconGlobe, { className: "w-4 h-4" }),
|
|
568
|
+
label: "Portfolio",
|
|
569
|
+
sub: "About me",
|
|
570
|
+
accentColor: "#34d399"
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] }),
|
|
574
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
575
|
+
import_framer_motion.motion.button,
|
|
576
|
+
{
|
|
577
|
+
onClick: onClose,
|
|
578
|
+
whileHover: { scale: 1.03 },
|
|
579
|
+
whileTap: { scale: 0.97 },
|
|
580
|
+
className: "dtg-close-button",
|
|
581
|
+
children: "Close & return to platform"
|
|
582
|
+
}
|
|
583
|
+
),
|
|
584
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dtg-footer", children: [
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dtg-uppercase-track", children: "Secured \xB7 SSL/TLS" }),
|
|
586
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dtg-uppercase-track", children: [
|
|
587
|
+
"Copyright \xA9 ",
|
|
588
|
+
(/* @__PURE__ */ new Date()).getFullYear()
|
|
589
|
+
] })
|
|
590
|
+
] })
|
|
591
|
+
]
|
|
592
|
+
},
|
|
593
|
+
"warning"
|
|
594
|
+
);
|
|
595
|
+
var DevToolsWarningOverlay = ({ onClose }) => {
|
|
596
|
+
const [scanStep, setScanStep] = (0, import_react2.useState)(0);
|
|
597
|
+
const [phase, setPhase] = (0, import_react2.useState)("scan");
|
|
598
|
+
(0, import_react2.useEffect)(() => {
|
|
599
|
+
if (phase !== "scan") return;
|
|
600
|
+
if (scanStep < SCAN_STEPS.length - 1) {
|
|
601
|
+
const t = setTimeout(() => setScanStep((s) => s + 1), STEP_INTERVAL_MS);
|
|
602
|
+
return () => clearTimeout(t);
|
|
603
|
+
} else {
|
|
604
|
+
const t = setTimeout(() => setPhase("warning"), STEP_INTERVAL_MS);
|
|
605
|
+
return () => clearTimeout(t);
|
|
606
|
+
}
|
|
607
|
+
}, [scanStep, phase]);
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
609
|
+
"div",
|
|
610
|
+
{
|
|
611
|
+
role: "alertdialog",
|
|
612
|
+
"aria-modal": "true",
|
|
613
|
+
"aria-label": "Security alert: developer tools detected",
|
|
614
|
+
className: "dtg-overlay",
|
|
615
|
+
children: [
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(MatrixBackground, {}),
|
|
617
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScanlineOverlay, {}),
|
|
618
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-hidden": "true", className: "dtg-vignette" }),
|
|
619
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
620
|
+
import_framer_motion.motion.div,
|
|
621
|
+
{
|
|
622
|
+
initial: { opacity: 0, y: 16, scale: 0.98 },
|
|
623
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
624
|
+
transition: { duration: 0.4, type: "spring", stiffness: 240, damping: 26 },
|
|
625
|
+
className: "dtg-card",
|
|
626
|
+
children: [
|
|
627
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NeonEdge, { position: "top" }),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(NeonEdge, { position: "bottom" }),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dtg-card-padding", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_framer_motion.AnimatePresence, { mode: "wait", children: phase === "scan" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ScanPhase, { step: scanStep }, "scan") : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(WarningPhase, { onClose }, "warning") }) })
|
|
630
|
+
]
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
};
|
|
637
|
+
var DevToolsWarningOverlay_default = DevToolsWarningOverlay;
|
|
638
|
+
|
|
639
|
+
// src/provider/DevToolsProtection.tsx
|
|
640
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
641
|
+
var DevToolsProtection = ({
|
|
642
|
+
children,
|
|
643
|
+
overlay = true
|
|
644
|
+
}) => {
|
|
645
|
+
const isOpen = useDevToolsDetector();
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
647
|
+
children,
|
|
648
|
+
overlay && isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DevToolsWarningOverlay_default, {})
|
|
649
|
+
] });
|
|
650
|
+
};
|
|
651
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
652
|
+
0 && (module.exports = {
|
|
653
|
+
DevToolsProtection,
|
|
654
|
+
DevToolsWarningOverlay,
|
|
655
|
+
useDevToolsDetector
|
|
656
|
+
});
|
|
657
|
+
//# sourceMappingURL=index.js.map
|