@principal-ai/logo-component 0.1.4 → 0.1.5

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.
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface MazeDemoProps {
3
+ width?: number;
4
+ height?: number;
5
+ mazeColor?: string;
6
+ errorColor?: string;
7
+ searchColor?: string;
8
+ solutionColor?: string;
9
+ mazeSeed?: number;
10
+ }
11
+ export declare const MazeDemo: React.FC<MazeDemoProps>;
12
+ export {};
@@ -0,0 +1,376 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.MazeDemo = void 0;
37
+ const react_1 = __importStar(require("react"));
38
+ const mazeGenerator_1 = require("./utils/mazeGenerator");
39
+ const MazeDemo = ({ width = 450, height = 620, mazeColor = "#6366f1", errorColor = "#ef4444", searchColor = "#f59e0b", solutionColor = "#10b981", mazeSeed = 42, }) => {
40
+ // Maze configuration
41
+ const gridSize = 10;
42
+ const cellSize = 30;
43
+ const padding = 50;
44
+ const mazeWidth = gridSize * cellSize;
45
+ const mazeHeight = gridSize * cellSize;
46
+ const mazeX = (width - mazeWidth) / 2;
47
+ // Key positions
48
+ const startCol = 0;
49
+ const startRow = 0;
50
+ const destCol = 9;
51
+ const destRow = 9;
52
+ // State
53
+ const [revealedCells, setRevealedCells] = (0, react_1.useState)([]);
54
+ const [directionHint, setDirectionHint] = (0, react_1.useState)("");
55
+ const [timeCost, setTimeCost] = (0, react_1.useState)(0);
56
+ const [clickCost, setClickCost] = (0, react_1.useState)(0);
57
+ const [blockageFound, setBlockageFound] = (0, react_1.useState)(false);
58
+ const [startTime, setStartTime] = (0, react_1.useState)(null);
59
+ const [started, setStarted] = (0, react_1.useState)(false);
60
+ const [currentSeed, setCurrentSeed] = (0, react_1.useState)(() => Math.floor(Math.random() * 10000));
61
+ const [blockageInjected, setBlockageInjected] = (0, react_1.useState)(false);
62
+ const [deployed, setDeployed] = (0, react_1.useState)(false);
63
+ const [mode, setMode] = (0, react_1.useState)('initial');
64
+ // Total incident cost
65
+ const incidentCost = timeCost + clickCost;
66
+ // Update currentSeed when mazeSeed prop changes
67
+ (0, react_1.useEffect)(() => {
68
+ setCurrentSeed(mazeSeed);
69
+ }, [mazeSeed]);
70
+ // Increment time cost
71
+ (0, react_1.useEffect)(() => {
72
+ if (blockageFound || !startTime || !started)
73
+ return;
74
+ const interval = setInterval(() => {
75
+ setTimeCost(prev => prev + 1);
76
+ }, 10);
77
+ return () => clearInterval(interval);
78
+ }, [blockageFound, startTime, started]);
79
+ // Generate maze
80
+ const { horizontalWalls, verticalWalls, blockageWall, actualBlockageCol, actualBlockageRow } = (0, react_1.useMemo)(() => {
81
+ let seed = currentSeed;
82
+ const seededRandom = () => {
83
+ seed = (seed * 9301 + 49297) % 233280;
84
+ return seed / 233280;
85
+ };
86
+ const originalRandom = Math.random;
87
+ Math.random = seededRandom;
88
+ const generator = new mazeGenerator_1.MazeGenerator(gridSize, gridSize);
89
+ generator.generate(startRow, startCol);
90
+ let blockCell = { row: 5, col: 5 };
91
+ let direction = 'east';
92
+ let blockageWall = null;
93
+ if (blockageInjected) {
94
+ const path = generator.findPath(startRow, startCol, destRow, destCol);
95
+ if (path.length > 2) {
96
+ const middleStart = Math.floor(path.length * 0.3);
97
+ const middleEnd = Math.floor(path.length * 0.7);
98
+ const blockIndex = Math.floor(seededRandom() * (middleEnd - middleStart)) + middleStart;
99
+ blockCell = path[blockIndex];
100
+ if (blockIndex < path.length - 1) {
101
+ const nextCell = path[blockIndex + 1];
102
+ const rowDiff = nextCell.row - blockCell.row;
103
+ const colDiff = nextCell.col - blockCell.col;
104
+ if (rowDiff === 1)
105
+ direction = 'south';
106
+ else if (rowDiff === -1)
107
+ direction = 'north';
108
+ else if (colDiff === 1)
109
+ direction = 'east';
110
+ else if (colDiff === -1)
111
+ direction = 'west';
112
+ }
113
+ }
114
+ generator.addBlockage(blockCell.row, blockCell.col, direction);
115
+ }
116
+ const walls = generator.getWalls();
117
+ if (blockageInjected) {
118
+ if (direction === 'east' || direction === 'west') {
119
+ const targetCol = direction === 'east' ? blockCell.col + 1 : blockCell.col;
120
+ const targetRow = blockCell.row;
121
+ const wallSegment = walls.vertical.find(wall => {
122
+ const [col, row1, , row2] = wall;
123
+ return col === targetCol && row1 <= targetRow && row2 > targetRow;
124
+ });
125
+ if (wallSegment) {
126
+ const [col, row1, , row2] = wallSegment;
127
+ blockageWall = { type: 'vertical', col, row1, row2 };
128
+ }
129
+ }
130
+ else {
131
+ const targetRow = direction === 'south' ? blockCell.row + 1 : blockCell.row;
132
+ const targetCol = blockCell.col;
133
+ const wallSegment = walls.horizontal.find(wall => {
134
+ const [col1, row, col2] = wall;
135
+ return row === targetRow && col1 <= targetCol && col2 > targetCol;
136
+ });
137
+ if (wallSegment) {
138
+ const [col1, row, col2] = wallSegment;
139
+ blockageWall = { type: 'horizontal', row, col1, col2 };
140
+ }
141
+ }
142
+ }
143
+ Math.random = originalRandom;
144
+ return {
145
+ horizontalWalls: walls.horizontal,
146
+ verticalWalls: walls.vertical,
147
+ blockageWall,
148
+ actualBlockageCol: blockCell.col,
149
+ actualBlockageRow: blockCell.row,
150
+ };
151
+ }, [currentSeed, blockageInjected]);
152
+ // Handlers
153
+ const handleModeSelect = (selectedMode) => {
154
+ setMode(selectedMode);
155
+ };
156
+ const handleDeploy = () => {
157
+ setDeployed(true);
158
+ setTimeout(() => {
159
+ setBlockageInjected(true);
160
+ setStarted(true);
161
+ setStartTime(Date.now());
162
+ }, 3000);
163
+ };
164
+ const handleTryPrincipal = () => {
165
+ setMode('principal');
166
+ setRevealedCells([]);
167
+ setDirectionHint("");
168
+ setBlockageFound(false);
169
+ setTimeCost(0);
170
+ setClickCost(0);
171
+ setStartTime(null);
172
+ setStarted(false);
173
+ setDeployed(false);
174
+ setBlockageInjected(false); // Principal mode still needs to deploy first
175
+ };
176
+ const handleTryAgain = () => {
177
+ setRevealedCells([]);
178
+ setDirectionHint("");
179
+ setBlockageFound(false);
180
+ setTimeCost(0);
181
+ setClickCost(0);
182
+ setStartTime(null);
183
+ setStarted(false);
184
+ setBlockageInjected(false);
185
+ setDeployed(false);
186
+ setMode('initial');
187
+ setCurrentSeed(Math.floor(Math.random() * 10000));
188
+ };
189
+ const handleCellClick = (col, row) => {
190
+ if (blockageFound || !started)
191
+ return;
192
+ // In principal mode, only allow clicking the blockage cell
193
+ if (mode === 'principal') {
194
+ const isBlockageCell = col === actualBlockageCol && row === actualBlockageRow;
195
+ if (isBlockageCell) {
196
+ setDirectionHint("🎯 Blockage Found!");
197
+ setBlockageFound(true);
198
+ }
199
+ return;
200
+ }
201
+ const alreadyRevealed = revealedCells.some(cell => cell.col === col && cell.row === row);
202
+ if (alreadyRevealed)
203
+ return;
204
+ setClickCost(prev => prev + 500);
205
+ setRevealedCells([...revealedCells, { col, row }]);
206
+ const isBlockageCell = col === actualBlockageCol && row === actualBlockageRow;
207
+ if (isBlockageCell) {
208
+ setDirectionHint("🎯 Blockage Found!");
209
+ setBlockageFound(true);
210
+ const cellsToReveal = [...revealedCells];
211
+ for (let r = 0; r < gridSize; r++) {
212
+ for (let c = 0; c < gridSize; c++) {
213
+ const distance = Math.abs(actualBlockageCol - c) + Math.abs(actualBlockageRow - r);
214
+ if (distance <= 3) {
215
+ const alreadyInList = cellsToReveal.some(cell => cell.col === c && cell.row === r);
216
+ if (!alreadyInList) {
217
+ cellsToReveal.push({ col: c, row: r });
218
+ }
219
+ }
220
+ }
221
+ }
222
+ setRevealedCells(cellsToReveal);
223
+ }
224
+ else {
225
+ const colDiff = actualBlockageCol - col;
226
+ const rowDiff = actualBlockageRow - row;
227
+ let direction = "";
228
+ if (Math.abs(rowDiff) > 1) {
229
+ direction += rowDiff > 0 ? "↓ " : "↑ ";
230
+ }
231
+ if (Math.abs(colDiff) > 1) {
232
+ direction += colDiff > 0 ? "→" : "←";
233
+ }
234
+ const distance = Math.abs(colDiff) + Math.abs(rowDiff);
235
+ let proximity = "";
236
+ if (distance <= 2)
237
+ proximity = "Very close!";
238
+ else if (distance <= 4)
239
+ proximity = "Getting warmer...";
240
+ else if (distance <= 6)
241
+ proximity = "Still far...";
242
+ else
243
+ proximity = "Cold...";
244
+ setDirectionHint(`${direction} ${proximity}`);
245
+ }
246
+ };
247
+ // Render maze
248
+ const renderMaze = (showBlockage, opacity = 1) => {
249
+ const elements = [];
250
+ elements.push(react_1.default.createElement("rect", { key: "background", x: mazeX, y: padding, width: mazeWidth, height: mazeHeight, fill: "none", stroke: mazeColor, strokeWidth: "3", opacity: 0.3 * opacity }));
251
+ const isBlockageWall = (type, wall) => {
252
+ if (!showBlockage || !blockageWall)
253
+ return false;
254
+ if (type === 'vertical') {
255
+ const [x, y1, , y2] = wall;
256
+ return (blockageWall.type === 'vertical' &&
257
+ x === blockageWall.col &&
258
+ y1 === blockageWall.row1 &&
259
+ y2 === blockageWall.row2);
260
+ }
261
+ else if (type === 'horizontal') {
262
+ const [x1, y, x2] = wall;
263
+ return (blockageWall.type === 'horizontal' &&
264
+ y === blockageWall.row &&
265
+ x1 === blockageWall.col1 &&
266
+ x2 === blockageWall.col2);
267
+ }
268
+ return false;
269
+ };
270
+ horizontalWalls.forEach((wall, idx) => {
271
+ const [x1, y, x2] = wall;
272
+ const isBlockage = isBlockageWall('horizontal', wall);
273
+ elements.push(react_1.default.createElement("line", { key: `h-wall-${idx}`, x1: mazeX + x1 * cellSize, y1: padding + y * cellSize, x2: mazeX + x2 * cellSize, y2: padding + y * cellSize, stroke: isBlockage ? errorColor : mazeColor, strokeWidth: isBlockage ? 4 : 2.5, strokeLinecap: "round", opacity: opacity }, isBlockage && showBlockage && (react_1.default.createElement("animate", { attributeName: "stroke-width", values: "4;6;4", dur: "1.5s", repeatCount: "indefinite" }))));
274
+ });
275
+ verticalWalls.forEach((wall, idx) => {
276
+ const [x, y1, , y2] = wall;
277
+ const isBlockage = isBlockageWall('vertical', wall);
278
+ elements.push(react_1.default.createElement("line", { key: `v-wall-${idx}`, x1: mazeX + x * cellSize, y1: padding + y1 * cellSize, x2: mazeX + x * cellSize, y2: padding + y2 * cellSize, stroke: isBlockage ? errorColor : mazeColor, strokeWidth: isBlockage ? 4 : 2.5, strokeLinecap: "round", opacity: opacity }, isBlockage && showBlockage && (react_1.default.createElement("animate", { attributeName: "stroke-width", values: "4;6;4", dur: "1.5s", repeatCount: "indefinite" }))));
279
+ });
280
+ for (let row = 0; row <= gridSize; row++) {
281
+ elements.push(react_1.default.createElement("line", { key: `grid-h-${row}`, x1: mazeX, y1: padding + row * cellSize, x2: mazeX + mazeWidth, y2: padding + row * cellSize, stroke: mazeColor, strokeWidth: "0.5", opacity: 0.15 * opacity }));
282
+ }
283
+ for (let col = 0; col <= gridSize; col++) {
284
+ elements.push(react_1.default.createElement("line", { key: `grid-v-${col}`, x1: mazeX + col * cellSize, y1: padding, x2: mazeX + col * cellSize, y2: padding + mazeHeight, stroke: mazeColor, strokeWidth: "0.5", opacity: 0.15 * opacity }));
285
+ }
286
+ return elements;
287
+ };
288
+ const getTitle = () => {
289
+ if (mode === 'principal')
290
+ return "With Principal";
291
+ if (mode === 'agentic')
292
+ return "With Agentic Coding";
293
+ if (mode === 'no-agentic')
294
+ return "Without Agentic Coding";
295
+ return "Choose Your Approach";
296
+ };
297
+ const getSubtitle = () => {
298
+ if (mode === 'principal')
299
+ return "Full visibility - See everything";
300
+ if (started)
301
+ return "Find the blockage";
302
+ if (deployed)
303
+ return "Running smoothly...";
304
+ return "How will you handle production?";
305
+ };
306
+ const showCover = mode === 'agentic' || (deployed && mode === 'no-agentic');
307
+ const coverOpacity = 1; // Always full opacity for the cover
308
+ const mazeOpacity = 1; // Maze always at full opacity, cover handles visibility
309
+ return (react_1.default.createElement("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg" },
310
+ react_1.default.createElement("text", { x: width / 2, y: 25, textAnchor: "middle", fill: mazeColor, fontSize: "16", fontWeight: "bold" }, getTitle()),
311
+ react_1.default.createElement("text", { x: width / 2, y: 40, textAnchor: "middle", fill: mazeColor, fontSize: "11", opacity: "0.6" }, getSubtitle()),
312
+ mode !== 'initial' && (react_1.default.createElement(react_1.default.Fragment, null,
313
+ react_1.default.createElement("g", null, renderMaze(mode === 'principal' || blockageFound, mazeOpacity)),
314
+ react_1.default.createElement("circle", { cx: mazeX + (startCol + 0.5) * cellSize, cy: padding + (startRow + 0.5) * cellSize, r: "5", fill: searchColor }),
315
+ react_1.default.createElement("text", { x: mazeX - 5, y: padding - 5, textAnchor: "end", fontSize: "10", fill: searchColor, fontWeight: "bold" }, "START"),
316
+ react_1.default.createElement("g", null,
317
+ react_1.default.createElement("circle", { cx: mazeX + (destCol + 0.5) * cellSize, cy: padding + (destRow + 0.5) * cellSize, r: "8", fill: "none", stroke: mazeColor, strokeWidth: "1.5", opacity: "0.5" }),
318
+ react_1.default.createElement("circle", { cx: mazeX + (destCol + 0.5) * cellSize, cy: padding + (destRow + 0.5) * cellSize, r: "5", fill: "none", stroke: mazeColor, strokeWidth: "1.5", opacity: "0.6" }),
319
+ react_1.default.createElement("circle", { cx: mazeX + (destCol + 0.5) * cellSize, cy: padding + (destRow + 0.5) * cellSize, r: "2", fill: mazeColor, opacity: "0.7" })),
320
+ react_1.default.createElement("text", { x: mazeX + mazeWidth + 5, y: padding + mazeHeight + 15, textAnchor: "start", fontSize: "9", fill: mazeColor, fontWeight: "bold" }, "DEST"))),
321
+ showCover && (react_1.default.createElement(react_1.default.Fragment, null,
322
+ react_1.default.createElement("defs", null,
323
+ react_1.default.createElement("mask", { id: "mazeCoverMask" },
324
+ react_1.default.createElement("rect", { x: mazeX, y: padding, width: mazeWidth, height: mazeHeight, fill: "white" }),
325
+ revealedCells.map((cell, idx) => (react_1.default.createElement("rect", { key: idx, x: mazeX + cell.col * cellSize, y: padding + cell.row * cellSize, width: cellSize, height: cellSize, fill: "black" }))))),
326
+ react_1.default.createElement("g", null,
327
+ react_1.default.createElement("rect", { x: mazeX, y: padding, width: mazeWidth, height: mazeHeight, fill: "#2a2a2a", opacity: coverOpacity, mask: "url(#mazeCoverMask)" }),
328
+ react_1.default.createElement("rect", { x: mazeX, y: padding, width: mazeWidth, height: mazeHeight, fill: "none", stroke: mazeColor, strokeWidth: "3", opacity: "0.4" }),
329
+ started && revealedCells.length === 0 && (react_1.default.createElement("g", null,
330
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 130, y: padding + mazeHeight / 2 - 40, width: 260, height: 80, fill: "#000000", opacity: "0.7", rx: "8", pointerEvents: "none" }),
331
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight / 2 - 15, textAnchor: "middle", fontSize: "18", fill: errorColor, fontWeight: "bold", pointerEvents: "none" }, "\uD83D\uDEA8 INCIDENT ALERT"),
332
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight / 2 + 10, textAnchor: "middle", fontSize: "13", fill: "#ffffff", fontWeight: "normal", pointerEvents: "none" }, "It's 3:00 AM - Find the blockage!"))),
333
+ started && revealedCells.length > 0 && directionHint && (react_1.default.createElement("g", null,
334
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 100, y: padding + mazeHeight / 2 - 25, width: 200, height: 40, fill: "#000000", opacity: "0.7", rx: "6", pointerEvents: "none" }),
335
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight / 2, textAnchor: "middle", fontSize: "16", fill: "#ffffff", fontWeight: "bold", pointerEvents: "none" }, directionHint)))))),
336
+ started && (react_1.default.createElement("g", null, Array.from({ length: gridSize }).map((_, row) => Array.from({ length: gridSize }).map((_, col) => (react_1.default.createElement("rect", { key: `cell-${row}-${col}`, x: mazeX + col * cellSize, y: padding + row * cellSize, width: cellSize, height: cellSize, fill: "transparent", stroke: "none", style: { cursor: 'pointer' }, onClick: () => handleCellClick(col, row), onMouseEnter: (e) => {
337
+ e.currentTarget.setAttribute('fill', searchColor);
338
+ e.currentTarget.setAttribute('opacity', '0.1');
339
+ }, onMouseLeave: (e) => {
340
+ e.currentTarget.setAttribute('fill', 'transparent');
341
+ e.currentTarget.setAttribute('opacity', '1');
342
+ } })))))),
343
+ mode === 'initial' && (react_1.default.createElement("g", null,
344
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: () => handleModeSelect('no-agentic') },
345
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 130, y: padding + mazeHeight + 25, width: 120, height: 40, fill: searchColor, rx: "6" }),
346
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2 - 70, y: padding + mazeHeight + 52, textAnchor: "middle", fontSize: "12", fill: "#ffffff", fontWeight: "bold", pointerEvents: "none" }, "No Agentic")),
347
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: () => handleModeSelect('agentic') },
348
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 + 10, y: padding + mazeHeight + 25, width: 120, height: 40, fill: mazeColor, rx: "6" }),
349
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2 + 70, y: padding + mazeHeight + 52, textAnchor: "middle", fontSize: "12", fill: "#ffffff", fontWeight: "bold", pointerEvents: "none" }, "Agentic Coding")))),
350
+ (mode === 'no-agentic' || mode === 'agentic' || mode === 'principal') && !deployed && (react_1.default.createElement("g", null,
351
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: handleDeploy },
352
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 60, y: padding + mazeHeight + 25, width: 120, height: 40, fill: searchColor, rx: "6" }),
353
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 52, textAnchor: "middle", fontSize: "16", fill: "#ffffff", fontWeight: "bold", pointerEvents: "none" }, "DEPLOY")))),
354
+ deployed && !started && (react_1.default.createElement("g", null,
355
+ react_1.default.createElement("rect", { x: mazeX, y: padding + mazeHeight + 20, width: mazeWidth, height: 35, fill: solutionColor, opacity: "0.9", rx: "4" }),
356
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 35, textAnchor: "middle", fontSize: "11", fill: "#ffffff", fontWeight: "normal" }, "\u2713 Deployment Successful"),
357
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 50, textAnchor: "middle", fontSize: "14", fill: "#ffffff", fontWeight: "bold" }, "All systems operational"))),
358
+ started && (react_1.default.createElement("g", null,
359
+ react_1.default.createElement("rect", { x: mazeX, y: padding + mazeHeight + 20, width: mazeWidth, height: 35, fill: blockageFound ? solutionColor : errorColor, opacity: "0.9", rx: "4" }),
360
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 35, textAnchor: "middle", fontSize: "11", fill: "#ffffff", fontWeight: "normal" }, blockageFound ? "Incident Resolved!" : "Incident Cost"),
361
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 50, textAnchor: "middle", fontSize: "18", fill: "#ffffff", fontWeight: "bold" },
362
+ "$",
363
+ incidentCost.toLocaleString()))),
364
+ started && blockageFound && mode !== 'principal' && (react_1.default.createElement("g", null,
365
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: handleTryAgain },
366
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 130, y: padding + mazeHeight + 65, width: 120, height: 25, fill: mazeColor, opacity: "0.2", rx: "4" }),
367
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2 - 70, y: padding + mazeHeight + 82, textAnchor: "middle", fontSize: "10", fill: mazeColor, fontWeight: "bold", pointerEvents: "none" }, "Try Again")),
368
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: handleTryPrincipal },
369
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 + 10, y: padding + mazeHeight + 65, width: 120, height: 25, fill: solutionColor, opacity: "0.8", rx: "4" }),
370
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2 + 70, y: padding + mazeHeight + 82, textAnchor: "middle", fontSize: "10", fill: "#ffffff", fontWeight: "bold", pointerEvents: "none" }, "Try with Principal")))),
371
+ mode === 'principal' && blockageFound && (react_1.default.createElement("g", null,
372
+ react_1.default.createElement("g", { style: { cursor: 'pointer' }, onClick: handleTryAgain },
373
+ react_1.default.createElement("rect", { x: mazeX + mazeWidth / 2 - 60, y: padding + mazeHeight + 65, width: 120, height: 25, fill: mazeColor, opacity: "0.3", rx: "4" }),
374
+ react_1.default.createElement("text", { x: mazeX + mazeWidth / 2, y: padding + mazeHeight + 82, textAnchor: "middle", fontSize: "10", fill: mazeColor, fontWeight: "bold", pointerEvents: "none" }, "Try Again"))))));
375
+ };
376
+ exports.MazeDemo = MazeDemo;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface MazeDemoProps {
3
+ width?: number;
4
+ height?: number;
5
+ mazeColor?: string;
6
+ errorColor?: string;
7
+ searchColor?: string;
8
+ solutionColor?: string;
9
+ mazeSeed?: number;
10
+ }
11
+ export declare const MazeDemoNew: React.FC<MazeDemoProps>;
12
+ export {};