@almadar/ui 5.21.10 → 5.21.12

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.
@@ -10,6 +10,7 @@ var LucideIcons2 = require('lucide-react');
10
10
  var PhosphorIcons = require('@phosphor-icons/react');
11
11
  var TablerIcons = require('@tabler/icons-react');
12
12
  var FaIcons = require('react-icons/fa');
13
+ var hooks = require('@almadar/ui/hooks');
13
14
  var evaluator = require('@almadar/evaluator');
14
15
  var reactDom = require('react-dom');
15
16
  var reactRouterDom = require('react-router-dom');
@@ -45,7 +46,6 @@ var react = require('@xyflow/react');
45
46
  var context = require('@almadar/ui/context');
46
47
  var patterns = require('@almadar/patterns');
47
48
  var fiber = require('@react-three/fiber');
48
- var reactQuery = require('@tanstack/react-query');
49
49
 
50
50
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
51
51
 
@@ -1159,11 +1159,11 @@ function ensureObserver() {
1159
1159
  });
1160
1160
  cachedFamily = getCurrentIconFamily();
1161
1161
  }
1162
- function subscribeIconFamily(notify2) {
1162
+ function subscribeIconFamily(notify) {
1163
1163
  ensureObserver();
1164
- listeners.add(notify2);
1164
+ listeners.add(notify);
1165
1165
  return () => {
1166
- listeners.delete(notify2);
1166
+ listeners.delete(notify);
1167
1167
  };
1168
1168
  }
1169
1169
  function getIconFamilySnapshot() {
@@ -2079,521 +2079,11 @@ var init_Button = __esm({
2079
2079
  exports.Button.displayName = "Button";
2080
2080
  }
2081
2081
  });
2082
-
2083
- // locales/en.json
2084
- var en_default;
2085
- var init_en = __esm({
2086
- "locales/en.json"() {
2087
- en_default = {
2088
- $meta: {
2089
- locale: "en",
2090
- direction: "ltr"
2091
- },
2092
- "common.save": "Save",
2093
- "common.cancel": "Cancel",
2094
- "common.delete": "Delete",
2095
- "common.close": "Close",
2096
- "common.confirm": "Are you sure?",
2097
- "common.create": "Create",
2098
- "common.edit": "Edit",
2099
- "common.view": "View",
2100
- "common.add": "Add",
2101
- "common.remove": "Remove",
2102
- "common.search": "Search...",
2103
- "common.filter": "Filter",
2104
- "common.actions": "Actions",
2105
- "common.yes": "Yes",
2106
- "common.no": "No",
2107
- "common.selected": "selected",
2108
- "common.ok": "OK",
2109
- "common.done": "Done",
2110
- "common.apply": "Apply",
2111
- "common.reset": "Reset",
2112
- "common.refresh": "Refresh",
2113
- "common.export": "Export",
2114
- "common.import": "Import",
2115
- "common.copy": "Copy",
2116
- "common.settings": "Settings",
2117
- "nav.previous": "Previous",
2118
- "nav.next": "Next",
2119
- "nav.back": "Back",
2120
- "nav.home": "Home",
2121
- "form.submit": "Submit",
2122
- "form.saving": "Saving...",
2123
- "form.required": "This field is required",
2124
- "form.invalidEmail": "Enter a valid email address",
2125
- "form.selectPlaceholder": "Select {{label}}...",
2126
- "form.searchPlaceholder": "Search {{entity}}...",
2127
- "table.empty.title": "No items found",
2128
- "table.empty.description": "No items to display.",
2129
- "table.search.placeholder": "Search...",
2130
- "table.pagination.showing": "Showing {{start}} to {{end}} of {{total}} results",
2131
- "table.pagination.page": "Page {{page}} of {{totalPages}}",
2132
- "table.bulk.selected": "{{count}} selected",
2133
- "table.loading": "Loading...",
2134
- "status.loading": "Loading...",
2135
- "status.scheduled": "Scheduled",
2136
- "status.inProgress": "In Progress",
2137
- "status.completed": "Completed",
2138
- "status.cancelled": "Cancelled",
2139
- "status.pending": "Pending",
2140
- "status.active": "Active",
2141
- "status.inactive": "Inactive",
2142
- "status.draft": "Draft",
2143
- "status.archived": "Archived",
2144
- "error.generic": "Something went wrong",
2145
- "error.retry": "Try again",
2146
- "error.notFound": "Not found",
2147
- "error.loadFailed": "Failed to load: {{message}}",
2148
- "error.configMissing": "Configuration not found for: {{id}}",
2149
- "common.loading": "Loading...",
2150
- "common.showMore": "Show More",
2151
- "common.showLess": "Show Less",
2152
- "common.noResults": "No results found",
2153
- "common.saveChanges": "Save Changes",
2154
- "common.retry": "Retry",
2155
- "common.open": "Open",
2156
- "common.back": "Back",
2157
- "empty.noItems": "No items",
2158
- "empty.noData": "No data available",
2159
- "empty.noItemsYet": "No items yet",
2160
- "empty.noItemsAdded": "No items added yet",
2161
- "empty.noOptionsFound": "No options found",
2162
- "list.addItemPlaceholder": "Add new item...",
2163
- "error.occurred": "An error occurred",
2164
- "error.failedToLoad": "Failed to load data",
2165
- "wizard.back": "Back",
2166
- "wizard.next": "Next",
2167
- "wizard.complete": "Complete",
2168
- "wizard.stepOf": "Step {{current}} of {{total}}",
2169
- "pagination.previous": "Previous",
2170
- "pagination.next": "Next",
2171
- "pagination.total": "Total:",
2172
- "pagination.show": "Show:",
2173
- "pagination.goTo": "Go to:",
2174
- "pagination.go": "Go",
2175
- "auth.signIn": "Sign in",
2176
- "auth.signOut": "Sign out",
2177
- "dialog.confirm": "Confirm",
2178
- "dialog.cancel": "Cancel",
2179
- "dialog.loading": "Loading...",
2180
- "dialog.delete.title": "Delete {{item}}?",
2181
- "dialog.delete.message": "This action cannot be undone.",
2182
- "trait.availableActions": "Available Actions",
2183
- "trait.transitions": "Transitions",
2184
- "trait.availableNow": "Available now",
2185
- "book.startReading": "Start Reading",
2186
- "book.tableOfContents": "Table of Contents",
2187
- "book.partNumber": "Part {{number}}",
2188
- "book.print": "Print",
2189
- "book.previousPage": "Previous page",
2190
- "book.nextPage": "Next page",
2191
- "quiz.showAnswer": "Show answer",
2192
- "quiz.hideAnswer": "Hide answer",
2193
- "aria.closeModal": "Close modal",
2194
- "aria.closeToast": "Dismiss toast",
2195
- "aria.closeAlert": "Dismiss alert",
2196
- "aria.removeFilter": "Remove filter",
2197
- "aria.closeDrawer": "Close drawer",
2198
- "aria.closePanel": "Close panel",
2199
- "aria.previousImage": "Previous image",
2200
- "aria.nextImage": "Next image",
2201
- "aria.dismiss": "Dismiss",
2202
- "aria.previousSlide": "Previous slide",
2203
- "aria.nextSlide": "Next slide",
2204
- "aria.previousDays": "Previous days",
2205
- "aria.nextDays": "Next days",
2206
- "aria.decrease": "Decrease",
2207
- "aria.increase": "Increase",
2208
- "aria.breadcrumb": "Breadcrumb",
2209
- "aria.tableOfContents": "Table of contents",
2210
- "aria.docsSidebar": "Documentation sidebar",
2211
- "aria.selectAllRows": "Select all rows",
2212
- "aria.selectAll": "Select all",
2213
- "aria.upvote": "Upvote",
2214
- "aria.downvote": "Downvote",
2215
- "aria.qrScanner": "QR scanner",
2216
- "aria.mockScanDev": "Mock scan (dev)",
2217
- "aria.openMenu": "Open menu",
2218
- "aria.closeMenu": "Close menu",
2219
- "aria.openSidebar": "Open sidebar",
2220
- "sidebar.expand": "Expand sidebar",
2221
- "sidebar.collapse": "Collapse sidebar",
2222
- "sidebar.close": "Close sidebar",
2223
- "loading.items": "Loading items...",
2224
- "card.imageAlt": "Image",
2225
- "canvas.emptyMessage": "No content",
2226
- "canvas.errorTitle": "Canvas error",
2227
- "book.noData": "No data",
2228
- "common.notifications": "Notifications",
2229
- "common.remaining": "{{count}} remaining",
2230
- "error.somethingWentWrong": "Something went wrong",
2231
- "error.loadingItems": "Loading items...",
2232
- "error.noItemsFound": "No items found",
2233
- "debug.noEntityData": "No entity data",
2234
- "debug.noEntities": "No entities",
2235
- "debug.noTicks": "No ticks registered",
2236
- "debug.noActiveTraits": "No active traits",
2237
- "debug.noGuardEvaluations": "No guard evaluations",
2238
- "debug.noBridgeData": "No bridge data",
2239
- "debug.status": "Status",
2240
- "debug.eventsForwarded": "Events Forwarded (Client \u2192 Server)",
2241
- "debug.eventsReceived": "Events Received (Server \u2192 Client)",
2242
- "debug.lastHeartbeat": "Last Heartbeat",
2243
- "debug.noEventsYet": "No events yet",
2244
- "debug.noTransitionsRecorded": "No transitions recorded",
2245
- "debug.noVerificationChecks": "No verification checks yet",
2246
- "display.chartError": "Chart error",
2247
- "display.codeViewerError": "Code viewer error",
2248
- "display.noCode": "No code",
2249
- "display.documentError": "Document error",
2250
- "display.noDocument": "No document",
2251
- "display.graphError": "Graph error",
2252
- "display.noGraphData": "No graph data",
2253
- "display.galleryError": "Gallery error",
2254
- "display.noMedia": "No media",
2255
- "display.meterError": "Meter error",
2256
- "display.signaturePadError": "Signature pad error",
2257
- "display.timelineError": "Timeline error",
2258
- "display.noEvents": "No events",
2259
- "template.features": "Features",
2260
- "template.howItWorks": "How It Works",
2261
- "template.showcase": "Showcase",
2262
- "template.faq": "Frequently Asked Questions",
2263
- "template.ourTeam": "Our Team",
2264
- "template.caseStudies": "Case Studies",
2265
- "richBlockEditor.toolbar.text": "Text",
2266
- "richBlockEditor.toolbar.h1": "H1",
2267
- "richBlockEditor.toolbar.h2": "H2",
2268
- "richBlockEditor.toolbar.h3": "H3",
2269
- "richBlockEditor.toolbar.bulletList": "Bullet list",
2270
- "richBlockEditor.toolbar.numbered": "Numbered",
2271
- "richBlockEditor.toolbar.quote": "Quote",
2272
- "richBlockEditor.toolbar.code": "Code",
2273
- "richBlockEditor.toolbar.divider": "Divider",
2274
- "richBlockEditor.toolbar.image": "Image",
2275
- "richBlockEditor.blockType.paragraph": "Text",
2276
- "richBlockEditor.blockType.heading1": "Heading 1",
2277
- "richBlockEditor.blockType.heading2": "Heading 2",
2278
- "richBlockEditor.blockType.heading3": "Heading 3",
2279
- "richBlockEditor.blockType.bulletList": "Bullet list",
2280
- "richBlockEditor.blockType.numberedList": "Numbered list",
2281
- "richBlockEditor.blockType.quote": "Quote",
2282
- "richBlockEditor.blockType.code": "Code",
2283
- "richBlockEditor.blockType.divider": "Divider",
2284
- "richBlockEditor.blockType.image": "Image",
2285
- "richBlockEditor.blockActions": "Block actions",
2286
- "richBlockEditor.duplicate": "Duplicate",
2287
- "richBlockEditor.turnInto": "Turn into",
2288
- "richBlockEditor.placeholder.heading1": "Heading 1",
2289
- "richBlockEditor.placeholder.heading2": "Heading 2",
2290
- "richBlockEditor.placeholder.heading3": "Heading 3",
2291
- "richBlockEditor.placeholder.quote": "Quote",
2292
- "richBlockEditor.placeholder.code": "Enter code",
2293
- "richBlockEditor.placeholder.paragraph": "Start writing...",
2294
- "richBlockEditor.placeholder.listItem": "List item",
2295
- "richBlockEditor.placeholder.caption": "Caption (optional)",
2296
- "richBlockEditor.aria.heading1Block": "Heading 1 block",
2297
- "richBlockEditor.aria.heading2Block": "Heading 2 block",
2298
- "richBlockEditor.aria.heading3Block": "Heading 3 block",
2299
- "richBlockEditor.aria.quoteBlock": "Quote block",
2300
- "richBlockEditor.aria.codeBlock": "Code block",
2301
- "richBlockEditor.aria.codeLanguage": "Code language",
2302
- "richBlockEditor.aria.imageUrl": "Image URL",
2303
- "richBlockEditor.aria.imageCaption": "Image caption",
2304
- "richBlockEditor.aria.listItem": "List item",
2305
- "richBlockEditor.aria.removeListItem": "Remove list item",
2306
- "richBlockEditor.aria.paragraphBlock": "Paragraph block",
2307
- "richBlockEditor.embeddedImage": "Embedded image",
2308
- "richBlockEditor.noImageUrl": "No image URL set",
2309
- "richBlockEditor.addItem": "Add item",
2310
- "richBlockEditor.insertParagraphBelow": "Insert paragraph below",
2311
- "richBlockEditor.editorToolbar": "Block editor toolbar",
2312
- "richBlockEditor.insertEntry": "Insert {{label}}",
2313
- "versionDiff.compare": "Compare",
2314
- "versionDiff.to": "to",
2315
- "versionDiff.beforeRevision": "Before revision",
2316
- "versionDiff.afterRevision": "After revision",
2317
- "versionDiff.switchToInline": "Switch to inline view",
2318
- "versionDiff.switchToSideBySide": "Switch to side-by-side view",
2319
- "versionDiff.revert": "Revert",
2320
- "versionDiff.byAuthor": " by {{author}}",
2321
- "violationAlert.actionType.measure": "Corrective Measure",
2322
- "violationAlert.actionType.admin": "Administrative Action",
2323
- "violationAlert.actionType.penalty": "Penalty Proceedings",
2324
- "violationAlert.fallbackMessage": "Violation",
2325
- "violationAlert.adminLabel": "Admin:",
2326
- "violationAlert.penaltyLabel": "Penalty:",
2327
- "violationAlert.goToField": "Go to field",
2328
- "branchingLogic.title": "Branching logic",
2329
- "branchingLogic.if": "If",
2330
- "branchingLogic.goTo": "go to",
2331
- "branchingLogic.rules": "Rules",
2332
- "branchingLogic.logicGraph": "Logic graph",
2333
- "branchingLogic.addRule": "Add rule",
2334
- "branchingLogic.deleteRule": "Delete rule",
2335
- "branchingLogic.endOfSurvey": "End of survey",
2336
- "branchingLogic.brokenReference": "Broken reference",
2337
- "branchingLogic.selectQuestion": "Select question",
2338
- "branchingLogic.selectTarget": "Select target",
2339
- "branchingLogic.selectValue": "Select value",
2340
- "branchingLogic.addValue": "Add value",
2341
- "branchingLogic.value": "Value",
2342
- "branchingLogic.typeValuePressEnter": "Type value, press Enter",
2343
- "branchingLogic.operatorEquals": "equals",
2344
- "branchingLogic.operatorNotEquals": "does not equal",
2345
- "branchingLogic.operatorContains": "contains",
2346
- "branchingLogic.operatorIn": "is one of",
2347
- "branchingLogic.graphAriaLabel": "Branching logic graph",
2348
- "branchingLogic.ruleCountOne": "{{count}} rule",
2349
- "branchingLogic.ruleCountOther": "{{count}} rules",
2350
- "branchingLogic.brokenCount": "{{count}} broken",
2351
- "branchingLogic.emptyNoQuestions": "Add questions before building branching rules.",
2352
- "branchingLogic.emptyNoRules": "No rules yet. Add a rule to define branching logic.",
2353
- "filterGroup.filters": "Filters",
2354
- "filterGroup.all": "All",
2355
- "filterGroup.clear": "Clear",
2356
- "filterGroup.clearAll": "Clear all",
2357
- "filterGroup.from": "From",
2358
- "filterGroup.to": "To",
2359
- "filterGroup.allOf": "All {{label}}",
2360
- "filterGroup.activeCount": "{{count}} active",
2361
- "debug.guardEvaluationsHint": "Guard evaluations will appear when transitions or ticks with guards execute",
2362
- "debug.expression": "Expression",
2363
- "debug.inputs": "Inputs",
2364
- "debug.trait": "Trait",
2365
- "debug.filterAll": "All",
2366
- "debug.filterPassed": "Passed",
2367
- "debug.filterFailed": "Failed",
2368
- "debug.traitsInitHint": "Traits will appear when the state machine initializes",
2369
- "debug.traitsMountHint": "Traits will appear when components using them are mounted",
2370
- "debug.activeStates": "Active States",
2371
- "debug.availableEvents": "Available Events",
2372
- "debug.noTransitionsFromState": "No transitions from current state",
2373
- "debug.guarded": "guarded",
2374
- "debug.otherEvents": "Other Events (not available from current state)",
2375
- "debug.recentTransitions": "Recent Transitions",
2376
- "debug.transitionsCount": "{{count}} transitions",
2377
- "debug.states": "States",
2378
- "debug.transitions": "Transitions",
2379
- "debug.guards": "Guards",
2380
- "debug.debugModeHint": "Debug mode may not be enabled",
2381
- "debug.entitiesSpawnHint": "Entities will appear when spawned",
2382
- "debug.singleton": "Singleton",
2383
- "debug.singletonsCount": "Singletons ({{count}})",
2384
- "debug.runtimeCount": "Runtime ({{count}})",
2385
- "debug.moreEntities": "+{{count}} more entities",
2386
- "debug.persistent": "Persistent",
2387
- "debug.loadedCount": "{{count}} loaded",
2388
- "debug.notLoaded": "not loaded",
2389
- "debug.eventsExecuteHint": "Events will appear as traits, ticks, and other systems execute",
2390
- "debug.allCount": "All ({{count}})",
2391
- "debug.autoScroll": "Auto-scroll",
2392
- "debug.transitionsProcessHint": "Transitions will appear as the state machine processes events",
2393
- "debug.transitionsRecorded": "{{count}} transitions recorded",
2394
- "debug.guardLabel": "guard:",
2395
- "debug.effectsCount": "{{count}} effects",
2396
- "debug.bridgeInitHint": "The ServerBridge has not been initialized. Bridge health will appear once the runtime connects to the server.",
2397
- "debug.never": "Never",
2398
- "debug.connected": "Connected",
2399
- "debug.disconnected": "Disconnected",
2400
- "debug.lastError": "Last Error",
2401
- "debug.totalEventsProcessed": "{{count}} total events processed",
2402
- "debug.server": "server",
2403
- "debug.clientEffectsCount": "{{count}} clientEffects",
2404
- "debug.emitLabel": "emit:",
2405
- "debug.rowsCount": "{{count}} rows",
2406
- "debug.serverResponse": "server response",
2407
- "debug.collapseVerificationTimeline": "Collapse verification timeline",
2408
- "debug.expandVerificationTimeline": "Expand verification timeline",
2409
- "debug.failCount": "{{count}} fail",
2410
- "debug.ok": "OK",
2411
- "debug.localCount": "{{count}} local",
2412
- "debug.serverCount": "{{count}} server",
2413
- "debug.waitingForTransitions": "Waiting for transitions...",
2414
- "debug.tabDispatch": "Dispatch",
2415
- "debug.tabVerify": "Verify",
2416
- "debug.tabVerifyAlert": "Verify (!)",
2417
- "debug.tabTimeline": "Timeline",
2418
- "debug.tabBridge": "Bridge",
2419
- "debug.tabTraits": "Traits",
2420
- "debug.tabTicks": "Ticks",
2421
- "debug.tabEntities": "Entities",
2422
- "debug.tabEvents": "Events",
2423
- "debug.tabGuards": "Guards",
2424
- "debug.debugger": "Debugger",
2425
- "debug.failedCount": "{{count}} failed",
2426
- "debug.traitsCount": "{{count}} traits",
2427
- "debug.idle": "Idle",
2428
- "debug.openDebugger": "Open Debugger (`)",
2429
- "debug.kflowVerifier": "KFlow Verifier",
2430
- "debug.allPassing": "All passing",
2431
- "debug.runtime": "Runtime",
2432
- "debug.close": "Close (`)",
2433
- "debug.toggleHint": "Press ` to toggle | window.__orbitalVerification for automation",
2434
- "replyTree.expandReplies": "Expand replies",
2435
- "replyTree.collapseReplies": "Collapse replies",
2436
- "replyTree.voteOnReplyBy": "Vote on reply by {{author}}",
2437
- "replyTree.replyTo": "Reply to {{author}}",
2438
- "replyTree.replyToPlaceholder": "Reply to {{author}}\u2026",
2439
- "replyTree.reply": "Reply",
2440
- "replyTree.flagReplyBy": "Flag reply by {{author}}",
2441
- "replyTree.flag": "Flag",
2442
- "replyTree.send": "Send",
2443
- "replyTree.continueThread": "Continue thread",
2444
- "replyTree.noRepliesYet": "No replies yet.",
2445
- "signaturePad.label": "Signature",
2446
- "signaturePad.helperText": "Draw your signature above",
2447
- "signaturePad.clear": "Clear",
2448
- "signaturePad.confirm": "Confirm",
2449
- "qrScanner.cameraUnavailable": "Camera unavailable",
2450
- "qrScanner.paused": "Paused",
2451
- "qrScanner.resumeScanning": "Resume scanning",
2452
- "qrScanner.pauseScanning": "Pause scanning",
2453
- "qrScanner.switchToFrontCamera": "Switch to front camera",
2454
- "qrScanner.switchToRearCamera": "Switch to rear camera",
2455
- "qrScanner.mockScan": "Mock Scan",
2456
- "docSearch.placeholder": "Search documentation...",
2457
- "stateMachine.loading": "Loading state machine\u2026",
2458
- "stateMachine.noStateMachine": "No state machine to visualize",
2459
- "avl.trigger": "Trigger",
2460
- "avl.guard": "Guard",
2461
- "avl.effects": "Effects",
2462
- "avl.props": "Props",
2463
- "avl.entity": "Entity",
2464
- "avl.traits": "Traits",
2465
- "avl.transition": "Transition",
2466
- "avl.onEntity": "on {{entity}}",
2467
- "avl.linkedTo": "linked to {{entity}}",
2468
- "avl.pressEscToZoomOut": "Press Esc to zoom out",
2469
- "avl.zoomIn": "Zoom in",
2470
- "avl.zoomOut": "Zoom out",
2471
- "avl.orbitalLabel": "Orbital: {{name}}",
2472
- "avl.orbitalLabelHighlighted": "Orbital: {{name}} (highlighted)",
2473
- "avl.noTraitData": "No trait data",
2474
- "avl.computingLayout": "Computing layout...",
2475
- "avl.noStateMachine": "No state machine",
2476
- "avl.listensFor": "listens for {{event}}",
2477
- "avl.emits": "emits {{event}}",
2478
- "avl.pageLayout": "Page Layout",
2479
- "avl.overlaySuffix": "(overlay)",
2480
- "orbPreview.previewBadge": "Preview",
2481
- "orbPreview.doubleClickToOpen": "Double-click to open",
2482
- "orbPreview.dropToAddAndOpen": "Drop to add and open",
2483
- "orbPreview.dispatching": "Coordinator is dispatching to this orbital",
2484
- "orbPreview.noPreview": "No preview available",
2485
- "orbPreview.screensCount": "{{count}} screens",
2486
- "detailView.noTransitionData": "No transition data",
2487
- "orbInspector.required": "req",
2488
- "orbInspector.addField": "Add Field",
2489
- "orbInspector.serviceMode": "Service Mode",
2490
- "orbInspector.standalone": "Standalone",
2491
- "orbInspector.embedded": "Embedded",
2492
- "orbInspector.rendersOwnUi": "Renders its own UI",
2493
- "orbInspector.headless": "Headless, wired to other behaviors",
2494
- "orbInspector.addEffect": "Add Effect",
2495
- "orbInspector.guardExpression": "Guard expression",
2496
- "orbInspector.selectPatternForStyles": "Select a pattern to view its style tokens.",
2497
- "orbInspector.tokens": "Tokens",
2498
- "orbInspector.noTokenContract": "No token contract declared for this pattern.",
2499
- "orbInspector.variant": "Variant",
2500
- "orbInspector.size": "Size",
2501
- "orbInspector.statesCount": "{{count}} states",
2502
- "orbInspector.onEntity": " on {{entity}}",
2503
- "orbInspector.projectThemeTokens": "Project theme tokens",
2504
- "orbInspector.tokenGroup.colors": "Colors",
2505
- "orbInspector.tokenGroup.radii": "Radii",
2506
- "orbInspector.tokenGroup.spacing": "Spacing",
2507
- "orbInspector.tokenGroup.shadows": "Shadows",
2508
- "orbInspector.tab.inspector": "Inspector",
2509
- "orbInspector.tab.styles": "Styles",
2510
- "orbInspector.tab.code": "Code",
2511
- "canvas.goBackToOverview": "Go back to overview",
2512
- "canvas.overview": "Overview",
2513
- "canvas.expanded": "Expanded",
2514
- "canvas.modulesCount": "{{count}} modules",
2515
- "canvas.screensCount": "{{count}} screens",
2516
- "canvas.switchToView": "Switch to {{label}} view",
2517
- "lawReference.viewFullText": "View full law text",
2518
- "statCard.defaultLabel": "Stat",
2519
- "statCard.vsLastPeriod": "vs last period",
2520
- "mediaGallery.upload": "Upload",
2521
- "mediaGallery.noMediaDescription": "No media items to display.",
2522
- "pagination.jumpPlaceholder": "Page",
2523
- "table.selectRow": "Select row {{id}}",
2524
- "card.selectItem": "Select {{item}}",
2525
- "card.itemFallback": "item",
2526
- "fileTree.noFiles": "No files",
2527
- "masterDetail.selectItem": "Select an item to view details",
2528
- "empty.createFirst": "Create your first item to get started.",
2529
- "upload.dropOrBrowse": "Drop files here or click to browse",
2530
- "upload.dropFilesHere": "Drop files here",
2531
- "upload.accepted": "Accepted: {{accept}}",
2532
- "upload.maxSize": "Max size: {{size}}",
2533
- "upload.maxFiles": "Up to {{count}} files",
2534
- "upload.error.maxFiles": "Maximum {{count}} files allowed",
2535
- "upload.error.invalidType": "Invalid file type: {{name}}",
2536
- "upload.error.tooLarge": "File too large: {{name}} (max {{size}})",
2537
- "optionConstraint.requiredOne": "Required, pick 1",
2538
- "optionConstraint.optionalOne": "Optional, pick up to 1",
2539
- "optionConstraint.pickExactly": "Pick exactly {{count}}",
2540
- "optionConstraint.pickRange": "Pick {{min}}-{{max}}",
2541
- "optionConstraint.pickAtLeast": "Pick at least {{count}}",
2542
- "optionConstraint.pickUpTo": "Pick up to {{count}}",
2543
- "optionConstraint.optional": "Optional",
2544
- "optionConstraint.outOfStock": "Out of stock",
2545
- "optionConstraint.error.pickOne": "Pick 1 option",
2546
- "optionConstraint.error.pickOnlyOne": "Pick only 1 option",
2547
- "optionConstraint.error.pickMore": "Pick at least {{count}} more",
2548
- "optionConstraint.error.removeOptions": "Remove {{count}} options",
2549
- "stateMachine.pinned": "Pinned",
2550
- "stateMachine.eventCount": "{{count}} events",
2551
- "stateMachine.externalEffects": "External Effects",
2552
- "stateMachine.legend.initial": "Initial",
2553
- "stateMachine.legend.final": "Final",
2554
- "stateMachine.legend.state": "State",
2555
- "stateMachine.legend.multiEvent": "Multi-event",
2556
- "relationSelect.selectPlaceholder": "Select..."
2557
- };
2558
- }
2559
- });
2560
- function useTranslate() {
2561
- return React79.useContext(I18nContext);
2562
- }
2563
- function createTranslate(messages) {
2564
- return (key, params) => {
2565
- let msg = messages[key] ?? coreLocale[key] ?? key;
2566
- if (params) {
2567
- for (const [k, v] of Object.entries(params)) {
2568
- msg = msg.split(`{{${k}}}`).join(String(v));
2569
- }
2570
- }
2571
- return msg;
2572
- };
2573
- }
2574
- var _meta, coreMessages, coreLocale, I18nContext; exports.I18nProvider = void 0;
2575
- var init_useTranslate = __esm({
2576
- "hooks/useTranslate.ts"() {
2577
- "use client";
2578
- init_en();
2579
- ({ $meta: _meta, ...coreMessages } = en_default);
2580
- coreLocale = coreMessages;
2581
- I18nContext = React79.createContext({
2582
- locale: "en",
2583
- direction: "ltr",
2584
- t: (key) => coreLocale[key] ?? key
2585
- // core locale fallback
2586
- });
2587
- I18nContext.displayName = "I18nContext";
2588
- exports.I18nProvider = I18nContext.Provider;
2589
- }
2590
- });
2591
2082
  exports.Input = void 0;
2592
2083
  var init_Input = __esm({
2593
2084
  "components/core/atoms/Input.tsx"() {
2594
2085
  init_cn();
2595
2086
  init_Icon();
2596
- init_useTranslate();
2597
2087
  exports.Input = React79__namespace.default.forwardRef(
2598
2088
  ({
2599
2089
  className,
@@ -2611,7 +2101,7 @@ var init_Input = __esm({
2611
2101
  onChange,
2612
2102
  ...props
2613
2103
  }, ref) => {
2614
- const { t } = useTranslate();
2104
+ const { t } = hooks.useTranslate();
2615
2105
  const type = inputType || htmlType || "text";
2616
2106
  const IconComponent = typeof iconProp === "string" ? resolveIcon(iconProp) : iconProp;
2617
2107
  const resolvedLeftIcon = leftIcon || IconComponent && /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "h-icon-default w-icon-default" });
@@ -3068,7 +2558,6 @@ var init_FilterPill = __esm({
3068
2558
  "components/core/atoms/FilterPill.tsx"() {
3069
2559
  init_cn();
3070
2560
  init_useEventBus();
3071
- init_useTranslate();
3072
2561
  init_Icon();
3073
2562
  variantStyles4 = {
3074
2563
  default: [
@@ -3124,7 +2613,7 @@ var init_FilterPill = __esm({
3124
2613
  ...props
3125
2614
  }, ref) => {
3126
2615
  const eventBus = useEventBus();
3127
- const { t } = useTranslate();
2616
+ const { t } = hooks.useTranslate();
3128
2617
  const payloadLabel = typeof children === "string" || typeof children === "number" ? children : label;
3129
2618
  const handleClick = React79.useCallback(() => {
3130
2619
  onClick?.();
@@ -5015,7 +4504,6 @@ var init_LawReferenceTooltip = __esm({
5015
4504
  init_Typography();
5016
4505
  init_Divider();
5017
4506
  init_cn();
5018
- init_useTranslate();
5019
4507
  positionStyles2 = {
5020
4508
  top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
5021
4509
  bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
@@ -5034,7 +4522,7 @@ var init_LawReferenceTooltip = __esm({
5034
4522
  position = "top",
5035
4523
  className
5036
4524
  }) => {
5037
- const { t } = useTranslate();
4525
+ const { t } = hooks.useTranslate();
5038
4526
  const [isVisible, setIsVisible] = React79__namespace.default.useState(false);
5039
4527
  const timeoutRef = React79__namespace.default.useRef(null);
5040
4528
  const handleMouseEnter = () => {
@@ -6798,7 +6286,6 @@ var init_Modal = __esm({
6798
6286
  init_Overlay();
6799
6287
  init_cn();
6800
6288
  init_useEventBus();
6801
- init_useTranslate();
6802
6289
  sizeClasses6 = {
6803
6290
  sm: "max-w-md",
6804
6291
  md: "max-w-2xl",
@@ -6836,7 +6323,7 @@ var init_Modal = __esm({
6836
6323
  look = "centered-card"
6837
6324
  }) => {
6838
6325
  const eventBus = useEventBus();
6839
- const { t } = useTranslate();
6326
+ const { t } = hooks.useTranslate();
6840
6327
  const modalRef = React79.useRef(null);
6841
6328
  const previousActiveElement = React79.useRef(null);
6842
6329
  const [dragY, setDragY] = React79.useState(0);
@@ -7020,7 +6507,6 @@ var init_Drawer = __esm({
7020
6507
  init_Overlay();
7021
6508
  init_cn();
7022
6509
  init_useEventBus();
7023
- init_useTranslate();
7024
6510
  sizeWidths = {
7025
6511
  sm: "w-full sm:w-80",
7026
6512
  // 320px
@@ -7046,7 +6532,7 @@ var init_Drawer = __esm({
7046
6532
  closeEvent
7047
6533
  }) => {
7048
6534
  const eventBus = useEventBus();
7049
- const { t } = useTranslate();
6535
+ const { t } = hooks.useTranslate();
7050
6536
  const drawerRef = React79.useRef(null);
7051
6537
  const previousActiveElement = React79.useRef(null);
7052
6538
  React79.useEffect(() => {
@@ -7202,7 +6688,6 @@ var init_Toast = __esm({
7202
6688
  init_Badge();
7203
6689
  init_cn();
7204
6690
  init_useEventBus();
7205
- init_useTranslate();
7206
6691
  variantClasses = {
7207
6692
  success: "bg-card border-[length:var(--border-width)] border-success",
7208
6693
  error: "bg-card border-[length:var(--border-width)] border-error",
@@ -7236,7 +6721,7 @@ var init_Toast = __esm({
7236
6721
  actionEvent
7237
6722
  }) => {
7238
6723
  const eventBus = useEventBus();
7239
- const { t } = useTranslate();
6724
+ const { t } = hooks.useTranslate();
7240
6725
  const handleDismiss = () => {
7241
6726
  if (dismissEvent) eventBus.emit(`UI:${dismissEvent}`, {});
7242
6727
  onDismiss?.();
@@ -7329,7 +6814,6 @@ var init_ErrorState = __esm({
7329
6814
  init_Typography();
7330
6815
  init_Icon();
7331
6816
  init_useEventBus();
7332
- init_useTranslate();
7333
6817
  exports.ErrorState = ({
7334
6818
  title,
7335
6819
  message,
@@ -7339,7 +6823,7 @@ var init_ErrorState = __esm({
7339
6823
  retryEvent
7340
6824
  }) => {
7341
6825
  const eventBus = useEventBus();
7342
- const { t } = useTranslate();
6826
+ const { t } = hooks.useTranslate();
7343
6827
  const handleRetry = () => {
7344
6828
  if (retryEvent) eventBus.emit(`UI:${retryEvent}`, {});
7345
6829
  onRetry?.();
@@ -7372,9 +6856,8 @@ var init_ErrorBoundary = __esm({
7372
6856
  "use client";
7373
6857
  init_cn();
7374
6858
  init_ErrorState();
7375
- init_useTranslate();
7376
6859
  DefaultFallback = ({ error, onRetry }) => {
7377
- const { t } = useTranslate();
6860
+ const { t } = hooks.useTranslate();
7378
6861
  return /* @__PURE__ */ jsxRuntime.jsx(
7379
6862
  exports.ErrorState,
7380
6863
  {
@@ -7501,7 +6984,7 @@ function Skeleton({
7501
6984
  fields,
7502
6985
  className
7503
6986
  }) {
7504
- const { t: _t } = useTranslate();
6987
+ const { t: _t } = hooks.useTranslate();
7505
6988
  switch (variant) {
7506
6989
  case "header":
7507
6990
  return /* @__PURE__ */ jsxRuntime.jsx(HeaderSkeleton, { className });
@@ -7522,7 +7005,6 @@ var init_Skeleton = __esm({
7522
7005
  "components/core/molecules/Skeleton.tsx"() {
7523
7006
  "use client";
7524
7007
  init_cn();
7525
- init_useTranslate();
7526
7008
  init_Box();
7527
7009
  init_Stack();
7528
7010
  init_Stack();
@@ -8172,7 +7654,6 @@ exports.AboutPageTemplate = void 0;
8172
7654
  var init_AboutPageTemplate = __esm({
8173
7655
  "components/marketing/templates/AboutPageTemplate.tsx"() {
8174
7656
  init_cn();
8175
- init_useTranslate();
8176
7657
  init_Stack();
8177
7658
  init_Box();
8178
7659
  init_Typography();
@@ -8188,7 +7669,7 @@ var init_AboutPageTemplate = __esm({
8188
7669
  entity,
8189
7670
  className
8190
7671
  }) => {
8191
- const { t } = useTranslate();
7672
+ const { t } = hooks.useTranslate();
8192
7673
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
8193
7674
  if (!resolved) return null;
8194
7675
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -8277,7 +7758,6 @@ var init_Alert = __esm({
8277
7758
  init_Icon();
8278
7759
  init_Typography();
8279
7760
  init_useEventBus();
8280
- init_useTranslate();
8281
7761
  variantBorderClasses = {
8282
7762
  info: "border-info",
8283
7763
  success: "border-success",
@@ -8309,7 +7789,7 @@ var init_Alert = __esm({
8309
7789
  dismissEvent
8310
7790
  }) => {
8311
7791
  const eventBus = useEventBus();
8312
- const { t } = useTranslate();
7792
+ const { t } = hooks.useTranslate();
8313
7793
  const handleDismissCallback = onDismiss || onClose;
8314
7794
  const handleDismiss = () => {
8315
7795
  if (dismissEvent) eventBus.emit(`UI:${dismissEvent}`, {});
@@ -8637,7 +8117,6 @@ var init_Menu = __esm({
8637
8117
  init_Badge();
8638
8118
  init_cn();
8639
8119
  init_useEventBus();
8640
- init_useTranslate();
8641
8120
  exports.Menu = ({
8642
8121
  trigger,
8643
8122
  items,
@@ -8645,7 +8124,7 @@ var init_Menu = __esm({
8645
8124
  className
8646
8125
  }) => {
8647
8126
  const eventBus = useEventBus();
8648
- const { t } = useTranslate();
8127
+ const { t, direction } = hooks.useTranslate();
8649
8128
  const [isOpen, setIsOpen] = React79.useState(false);
8650
8129
  const [activeSubMenu, setActiveSubMenu] = React79.useState(null);
8651
8130
  const [triggerRect, setTriggerRect] = React79.useState(null);
@@ -8699,6 +8178,18 @@ var init_Menu = __esm({
8699
8178
  "bottom-start": "top-full left-0 mt-2",
8700
8179
  "bottom-end": "top-full right-0 mt-2"
8701
8180
  };
8181
+ const rtlMirror = {
8182
+ "top-left": "top-right",
8183
+ "top-right": "top-left",
8184
+ "bottom-left": "bottom-right",
8185
+ "bottom-right": "bottom-left",
8186
+ "top-start": "top-end",
8187
+ "top-end": "top-start",
8188
+ "bottom-start": "bottom-end",
8189
+ "bottom-end": "bottom-start"
8190
+ };
8191
+ const effectivePosition = direction === "rtl" ? rtlMirror[position] ?? position : position;
8192
+ const subMenuSideClass = direction === "rtl" ? "right-full mr-2" : "left-full ml-2";
8702
8193
  const triggerChild = React79__namespace.default.isValidElement(trigger) ? trigger : /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", as: "span", children: trigger });
8703
8194
  const triggerElement = React79__namespace.default.cloneElement(
8704
8195
  triggerChild,
@@ -8726,7 +8217,7 @@ var init_Menu = __esm({
8726
8217
  onMouseEnter: () => hasSubMenu && setActiveSubMenu(itemId),
8727
8218
  "data-testid": item.event ? `action-${item.event}` : void 0,
8728
8219
  className: cn(
8729
- "w-full flex items-center justify-between gap-3 px-4 py-2 text-left",
8220
+ "w-full flex items-center justify-between gap-3 px-4 py-2 text-start",
8730
8221
  "text-sm transition-colors",
8731
8222
  "hover:bg-muted",
8732
8223
  "focus:outline-none focus:bg-muted",
@@ -8745,7 +8236,7 @@ var init_Menu = __esm({
8745
8236
  }
8746
8237
  ),
8747
8238
  item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", children: item.badge }),
8748
- hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: "chevron-right", size: "sm", className: "flex-shrink-0" })
8239
+ hasSubMenu && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: direction === "rtl" ? "chevron-left" : "chevron-right", size: "sm", className: "flex-shrink-0" })
8749
8240
  ] })
8750
8241
  },
8751
8242
  itemId
@@ -8765,7 +8256,8 @@ var init_Menu = __esm({
8765
8256
  exports.Box,
8766
8257
  {
8767
8258
  className: cn(
8768
- "absolute left-full top-0 ml-2 z-50",
8259
+ "absolute top-0 z-50",
8260
+ subMenuSideClass,
8769
8261
  menuContainerStyles
8770
8262
  ),
8771
8263
  children: renderMenuItems(item.subMenu)
@@ -8783,12 +8275,12 @@ var init_Menu = __esm({
8783
8275
  className: cn(
8784
8276
  "absolute z-50",
8785
8277
  menuContainerStyles,
8786
- positionClasses3[position],
8278
+ positionClasses3[effectivePosition],
8787
8279
  className
8788
8280
  ),
8789
8281
  style: {
8790
- left: position.includes("left") ? 0 : "auto",
8791
- right: position.includes("right") ? 0 : "auto"
8282
+ left: effectivePosition.includes("left") ? 0 : "auto",
8283
+ right: effectivePosition.includes("right") ? 0 : "auto"
8792
8284
  },
8793
8285
  role: "menu",
8794
8286
  children: renderMenuItems(items)
@@ -8925,7 +8417,6 @@ var init_FloatingActionButton = __esm({
8925
8417
  init_Typography();
8926
8418
  init_cn();
8927
8419
  init_useEventBus();
8928
- init_useTranslate();
8929
8420
  exports.FloatingActionButton = ({
8930
8421
  action,
8931
8422
  actionPayload,
@@ -8938,7 +8429,7 @@ var init_FloatingActionButton = __esm({
8938
8429
  className
8939
8430
  }) => {
8940
8431
  const eventBus = useEventBus();
8941
- const { t } = useTranslate();
8432
+ const { t } = hooks.useTranslate();
8942
8433
  const resolvedAction = icon ? {
8943
8434
  icon,
8944
8435
  onClick: () => {
@@ -9107,13 +8598,13 @@ var init_MapView = __esm({
9107
8598
  shadowSize: [41, 41]
9108
8599
  });
9109
8600
  L.Marker.prototype.options.icon = defaultIcon;
9110
- const { useEffect: useEffect74, useRef: useRef68, useCallback: useCallback128, useState: useState112 } = React79__namespace.default;
8601
+ const { useEffect: useEffect69, useRef: useRef66, useCallback: useCallback113, useState: useState99 } = React79__namespace.default;
9111
8602
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9112
8603
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9113
8604
  function MapUpdater({ centerLat, centerLng, zoom }) {
9114
8605
  const map = useMap();
9115
- const prevRef = useRef68({ centerLat, centerLng, zoom });
9116
- useEffect74(() => {
8606
+ const prevRef = useRef66({ centerLat, centerLng, zoom });
8607
+ useEffect69(() => {
9117
8608
  const prev = prevRef.current;
9118
8609
  if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
9119
8610
  map.setView([centerLat, centerLng], zoom);
@@ -9124,7 +8615,7 @@ var init_MapView = __esm({
9124
8615
  }
9125
8616
  function MapClickHandler({ onMapClick }) {
9126
8617
  const map = useMap();
9127
- useEffect74(() => {
8618
+ useEffect69(() => {
9128
8619
  if (!onMapClick) return;
9129
8620
  const handler = (e) => {
9130
8621
  onMapClick(e.latlng.lat, e.latlng.lng);
@@ -9152,8 +8643,8 @@ var init_MapView = __esm({
9152
8643
  showAttribution = true
9153
8644
  }) {
9154
8645
  const eventBus = useEventBus2();
9155
- const [clickedPosition, setClickedPosition] = useState112(null);
9156
- const handleMapClick = useCallback128((lat, lng) => {
8646
+ const [clickedPosition, setClickedPosition] = useState99(null);
8647
+ const handleMapClick = useCallback113((lat, lng) => {
9157
8648
  if (showClickedPin) {
9158
8649
  setClickedPosition({ lat, lng });
9159
8650
  }
@@ -9162,7 +8653,7 @@ var init_MapView = __esm({
9162
8653
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9163
8654
  }
9164
8655
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9165
- const handleMarkerClick = useCallback128((marker) => {
8656
+ const handleMarkerClick = useCallback113((marker) => {
9166
8657
  onMarkerClick?.(marker);
9167
8658
  if (markerClickEvent) {
9168
8659
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -9989,7 +9480,7 @@ function ActionTile({
9989
9480
  categoryColors,
9990
9481
  className
9991
9482
  }) {
9992
- useTranslate();
9483
+ hooks.useTranslate();
9993
9484
  const config = SIZE_CONFIG[size];
9994
9485
  const catColor = categoryColors?.[action.category];
9995
9486
  const handleDragStart = React79.useCallback((e) => {
@@ -10028,7 +9519,6 @@ var init_ActionTile = __esm({
10028
9519
  "components/game/organisms/puzzles/sequencer/ActionTile.tsx"() {
10029
9520
  init_atoms2();
10030
9521
  init_cn();
10031
- init_useTranslate();
10032
9522
  DRAG_MIME = "application/x-almadar-slot-item";
10033
9523
  SIZE_CONFIG = {
10034
9524
  sm: { px: "px-2 py-1", icon: "text-lg", text: "text-xs" },
@@ -10047,7 +9537,7 @@ function ActionPalette({
10047
9537
  label,
10048
9538
  className
10049
9539
  }) {
10050
- const { t } = useTranslate();
9540
+ const { t } = hooks.useTranslate();
10051
9541
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
10052
9542
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: label ?? t("sequencer.actions") }),
10053
9543
  /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { className: "flex-wrap", gap: "sm", children: (actions ?? []).map((action) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -10066,7 +9556,6 @@ var init_ActionPalette = __esm({
10066
9556
  "components/game/organisms/puzzles/sequencer/ActionPalette.tsx"() {
10067
9557
  init_atoms2();
10068
9558
  init_cn();
10069
- init_useTranslate();
10070
9559
  init_ActionTile();
10071
9560
  ActionPalette.displayName = "ActionPalette";
10072
9561
  }
@@ -10076,7 +9565,6 @@ var init_AuthLayout = __esm({
10076
9565
  "components/core/templates/AuthLayout.tsx"() {
10077
9566
  "use client";
10078
9567
  init_cn();
10079
- init_useTranslate();
10080
9568
  init_Box();
10081
9569
  init_Stack();
10082
9570
  init_Typography();
@@ -10087,7 +9575,7 @@ var init_AuthLayout = __esm({
10087
9575
  showBranding = true,
10088
9576
  brandingContent
10089
9577
  }) => {
10090
- const { t } = useTranslate();
9578
+ const { t } = hooks.useTranslate();
10091
9579
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.Box, { className: "min-h-screen flex", children: [
10092
9580
  showBranding && /* @__PURE__ */ jsxRuntime.jsxs(
10093
9581
  exports.VStack,
@@ -10221,13 +9709,12 @@ var init_LoadingState = __esm({
10221
9709
  init_atoms2();
10222
9710
  init_Stack();
10223
9711
  init_Typography();
10224
- init_useTranslate();
10225
9712
  exports.LoadingState = ({
10226
9713
  title,
10227
9714
  message,
10228
9715
  className
10229
9716
  }) => {
10230
- const { t } = useTranslate();
9717
+ const { t } = hooks.useTranslate();
10231
9718
  const displayMessage = message ?? t("common.loading");
10232
9719
  return /* @__PURE__ */ jsxRuntime.jsxs(
10233
9720
  exports.VStack,
@@ -10607,7 +10094,7 @@ function IsometricCanvas({
10607
10094
  const unitsProp = Array.isArray(_unitsPropRaw) ? _unitsPropRaw : [];
10608
10095
  const featuresProp = Array.isArray(_featuresPropRaw) ? _featuresPropRaw : [];
10609
10096
  const eventBus = useEventBus();
10610
- const { t } = useTranslate();
10097
+ const { t } = hooks.useTranslate();
10611
10098
  const canvasRef = React79.useRef(null);
10612
10099
  const containerRef = React79.useRef(null);
10613
10100
  const minimapRef = React79.useRef(null);
@@ -11304,7 +10791,6 @@ var init_IsometricCanvas = __esm({
11304
10791
  "use client";
11305
10792
  init_cn();
11306
10793
  init_useEventBus();
11307
- init_useTranslate();
11308
10794
  init_Box();
11309
10795
  init_Stack();
11310
10796
  init_Icon();
@@ -11364,7 +10850,7 @@ function BattleBoard({
11364
10850
  const currentTurn = entity.turn;
11365
10851
  const gameResult = entity.gameResult;
11366
10852
  const eventBus = useEventBus();
11367
- const { t } = useTranslate();
10853
+ const { t } = hooks.useTranslate();
11368
10854
  const [hoveredTile, setHoveredTile] = React79.useState(null);
11369
10855
  const [isShaking, setIsShaking] = React79.useState(false);
11370
10856
  const selectedUnit = React79.useMemo(
@@ -11668,7 +11154,6 @@ var init_BattleBoard = __esm({
11668
11154
  "use client";
11669
11155
  init_cn();
11670
11156
  init_useEventBus();
11671
- init_useTranslate();
11672
11157
  init_Box();
11673
11158
  init_Button();
11674
11159
  init_Typography();
@@ -12428,7 +11913,6 @@ var log4, SWIM_GUTTER, CENTER_W; exports.BehaviorView = void 0;
12428
11913
  var init_BehaviorView = __esm({
12429
11914
  "components/avl/molecules/BehaviorView.tsx"() {
12430
11915
  "use client";
12431
- init_useTranslate();
12432
11916
  init_AvlState();
12433
11917
  init_AvlTransitionLane();
12434
11918
  init_AvlSwimLane();
@@ -12438,7 +11922,7 @@ var init_BehaviorView = __esm({
12438
11922
  SWIM_GUTTER = 120;
12439
11923
  CENTER_W = 360;
12440
11924
  exports.BehaviorView = ({ data }) => {
12441
- const { t } = useTranslate();
11925
+ const { t } = hooks.useTranslate();
12442
11926
  const [layout, setLayout] = React79.useState(null);
12443
11927
  const traitName = data.traits[0]?.name;
12444
11928
  const traitData = traitName ? data.traitDetails[traitName] : void 0;
@@ -12543,14 +12027,13 @@ var MIN_DIAGRAM_WIDTH; exports.ScaledDiagram = void 0;
12543
12027
  var init_ScaledDiagram = __esm({
12544
12028
  "components/core/molecules/ScaledDiagram.tsx"() {
12545
12029
  init_Box();
12546
- init_useTranslate();
12547
12030
  init_cn();
12548
12031
  MIN_DIAGRAM_WIDTH = 200;
12549
12032
  exports.ScaledDiagram = ({
12550
12033
  children,
12551
12034
  className
12552
12035
  }) => {
12553
- const { t: _t } = useTranslate();
12036
+ const { t: _t } = hooks.useTranslate();
12554
12037
  const wrapperRef = React79.useRef(null);
12555
12038
  const contentRef = React79.useRef(null);
12556
12039
  const [layout, setLayout] = React79.useState(null);
@@ -12686,7 +12169,6 @@ var init_CodeBlock = __esm({
12686
12169
  init_Textarea();
12687
12170
  init_Icon();
12688
12171
  init_useEventBus();
12689
- init_useTranslate();
12690
12172
  SyntaxHighlighter__default.default.registerLanguage("json", langJson__default.default);
12691
12173
  SyntaxHighlighter__default.default.registerLanguage("javascript", langJavascript__default.default);
12692
12174
  SyntaxHighlighter__default.default.registerLanguage("js", langJavascript__default.default);
@@ -12775,7 +12257,7 @@ var init_CodeBlock = __esm({
12775
12257
  const isLolo = language === "lolo";
12776
12258
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
12777
12259
  const eventBus = useEventBus();
12778
- const { t } = useTranslate();
12260
+ const { t } = hooks.useTranslate();
12779
12261
  const scrollRef = React79.useRef(null);
12780
12262
  const codeRef = React79.useRef(null);
12781
12263
  const savedScrollLeftRef = React79.useRef(0);
@@ -13193,11 +12675,10 @@ var init_MarkdownContent = __esm({
13193
12675
  init_katex_min();
13194
12676
  init_Box();
13195
12677
  init_CodeBlock();
13196
- init_useTranslate();
13197
12678
  init_cn();
13198
12679
  exports.MarkdownContent = React79__namespace.default.memo(
13199
12680
  ({ content, direction, className }) => {
13200
- const { t: _t } = useTranslate();
12681
+ const { t: _t } = hooks.useTranslate();
13201
12682
  const safeContent = typeof content === "string" ? content : String(content ?? "");
13202
12683
  return /* @__PURE__ */ jsxRuntime.jsx(
13203
12684
  exports.Box,
@@ -13423,7 +12904,7 @@ function Card2({
13423
12904
  longPressPayload
13424
12905
  }) {
13425
12906
  const eventBus = useEventBus();
13426
- const { t } = useTranslate();
12907
+ const { t } = hooks.useTranslate();
13427
12908
  const isClickable = !!onClick || !!action;
13428
12909
  const handleLongPress = React79.useCallback(() => {
13429
12910
  if (longPressEvent) {
@@ -13498,7 +12979,6 @@ var init_Card2 = __esm({
13498
12979
  "components/core/molecules/Card.tsx"() {
13499
12980
  "use client";
13500
12981
  init_useEventBus();
13501
- init_useTranslate();
13502
12982
  init_useLongPress();
13503
12983
  Card2.displayName = "Card";
13504
12984
  }
@@ -13512,14 +12992,13 @@ var init_QuizBlock = __esm({
13512
12992
  init_Button();
13513
12993
  init_Icon();
13514
12994
  init_Box();
13515
- init_useTranslate();
13516
12995
  init_cn();
13517
12996
  exports.QuizBlock = ({
13518
12997
  question,
13519
12998
  answer,
13520
12999
  className
13521
13000
  }) => {
13522
- const { t } = useTranslate();
13001
+ const { t } = hooks.useTranslate();
13523
13002
  const [revealed, setRevealed] = React79.useState(false);
13524
13003
  return /* @__PURE__ */ jsxRuntime.jsx(Card2, { className: cn("my-4 border-blue-200 dark:border-blue-800", className), children: /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "sm", className: "p-4", children: [
13525
13004
  /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "sm", align: "start", children: [
@@ -13555,11 +13034,10 @@ var init_StateMachineView = __esm({
13555
13034
  init_Typography();
13556
13035
  init_Button();
13557
13036
  init_Icon();
13558
- init_useTranslate();
13559
13037
  init_useEventBus();
13560
13038
  init_cn();
13561
13039
  StateNode = ({ state, config }) => {
13562
- const { t } = useTranslate();
13040
+ const { t } = hooks.useTranslate();
13563
13041
  const size = state.radius * 2;
13564
13042
  let borderColor = config.colors.nodeBorder;
13565
13043
  let borderWidth = 2;
@@ -13666,7 +13144,7 @@ var init_StateMachineView = __esm({
13666
13144
  );
13667
13145
  };
13668
13146
  TransitionBundleArrow = ({ bundle, states, bundleIndex, config, onClick, onHover }) => {
13669
- const { t } = useTranslate();
13147
+ const { t } = hooks.useTranslate();
13670
13148
  const groupRef = React79.useRef(null);
13671
13149
  const fromState = states.find((s) => s.name === bundle.from);
13672
13150
  const toState = states.find((s) => s.name === bundle.to);
@@ -13916,7 +13394,7 @@ var init_StateMachineView = __esm({
13916
13394
  );
13917
13395
  };
13918
13396
  BundleTooltip = ({ tooltip, config }) => {
13919
- const { t } = useTranslate();
13397
+ const { t } = hooks.useTranslate();
13920
13398
  if (!tooltip.visible || !tooltip.bundle) return null;
13921
13399
  const { bundle } = tooltip;
13922
13400
  const isSingle = bundle.labels.length === 1;
@@ -14068,7 +13546,7 @@ var init_StateMachineView = __esm({
14068
13546
  );
14069
13547
  };
14070
13548
  EntityBox = ({ entity, config }) => {
14071
- const { t } = useTranslate();
13549
+ const { t } = hooks.useTranslate();
14072
13550
  return /* @__PURE__ */ jsxRuntime.jsxs(
14073
13551
  exports.VStack,
14074
13552
  {
@@ -14109,7 +13587,7 @@ var init_StateMachineView = __esm({
14109
13587
  );
14110
13588
  };
14111
13589
  OutputsBox = ({ outputs, config }) => {
14112
- const { t } = useTranslate();
13590
+ const { t } = hooks.useTranslate();
14113
13591
  return /* @__PURE__ */ jsxRuntime.jsxs(
14114
13592
  exports.VStack,
14115
13593
  {
@@ -14151,7 +13629,7 @@ var init_StateMachineView = __esm({
14151
13629
  );
14152
13630
  };
14153
13631
  Legend = ({ config, y }) => {
14154
- const { t } = useTranslate();
13632
+ const { t } = hooks.useTranslate();
14155
13633
  const items = [
14156
13634
  { key: "initial", label: t("stateMachine.legend.initial"), color: config.colors.initialNode, isMultiEvent: false },
14157
13635
  { key: "final", label: t("stateMachine.legend.final"), color: config.colors.finalNode, isMultiEvent: false },
@@ -14195,7 +13673,7 @@ var init_StateMachineView = __esm({
14195
13673
  isLoading: _isLoading,
14196
13674
  error: _error
14197
13675
  }) => {
14198
- const { t } = useTranslate();
13676
+ const { t } = hooks.useTranslate();
14199
13677
  const [tooltip, setTooltip] = React79.useState({
14200
13678
  visible: false,
14201
13679
  pinned: false,
@@ -14922,7 +14400,6 @@ var init_JazariStateMachine = __esm({
14922
14400
  init_StateMachineView();
14923
14401
  init_visualizer();
14924
14402
  init_svg_paths();
14925
- init_useTranslate();
14926
14403
  init_cn();
14927
14404
  JAZARI_VISUALIZER_CONFIG = {
14928
14405
  ...DEFAULT_CONFIG,
@@ -14958,7 +14435,7 @@ var init_JazariStateMachine = __esm({
14958
14435
  isLoading = false,
14959
14436
  error = null
14960
14437
  }) => {
14961
- const { t } = useTranslate();
14438
+ const { t } = hooks.useTranslate();
14962
14439
  const resolvedTrait = React79.useMemo(
14963
14440
  () => extractTrait(schema, traitProp, traitIndex),
14964
14441
  [schema, traitProp, traitIndex]
@@ -15078,7 +14555,6 @@ var init_ContentRenderer = __esm({
15078
14555
  init_ScaledDiagram();
15079
14556
  init_JazariStateMachine();
15080
14557
  init_parseContentSegments();
15081
- init_useTranslate();
15082
14558
  init_cn();
15083
14559
  exports.ContentRenderer = ({
15084
14560
  content,
@@ -15086,7 +14562,7 @@ var init_ContentRenderer = __esm({
15086
14562
  direction,
15087
14563
  className
15088
14564
  }) => {
15089
- const { t: _t } = useTranslate();
14565
+ const { t: _t } = hooks.useTranslate();
15090
14566
  const segments = React79.useMemo(
15091
14567
  () => segmentsProp ?? parseContentSegments(content),
15092
14568
  [segmentsProp, content]
@@ -15172,14 +14648,13 @@ var init_BookChapterView = __esm({
15172
14648
  init_ScaledDiagram();
15173
14649
  init_ContentRenderer();
15174
14650
  init_JazariStateMachine();
15175
- init_useTranslate();
15176
14651
  init_cn();
15177
14652
  exports.BookChapterView = ({
15178
14653
  chapter,
15179
14654
  direction,
15180
14655
  className
15181
14656
  }) => {
15182
- const { t: _t } = useTranslate();
14657
+ const { t: _t } = hooks.useTranslate();
15183
14658
  return /* @__PURE__ */ jsxRuntime.jsxs(
15184
14659
  exports.VStack,
15185
14660
  {
@@ -15211,7 +14686,6 @@ var init_BookCoverPage = __esm({
15211
14686
  init_Typography();
15212
14687
  init_Button();
15213
14688
  init_Box();
15214
- init_useTranslate();
15215
14689
  init_cn();
15216
14690
  exports.BookCoverPage = ({
15217
14691
  title,
@@ -15221,7 +14695,7 @@ var init_BookCoverPage = __esm({
15221
14695
  direction,
15222
14696
  className
15223
14697
  }) => {
15224
- const { t } = useTranslate();
14698
+ const { t } = hooks.useTranslate();
15225
14699
  return /* @__PURE__ */ jsxRuntime.jsxs(
15226
14700
  exports.VStack,
15227
14701
  {
@@ -15291,7 +14765,6 @@ var init_BookNavBar = __esm({
15291
14765
  init_Typography();
15292
14766
  init_ProgressBar();
15293
14767
  init_Box();
15294
- init_useTranslate();
15295
14768
  init_cn();
15296
14769
  exports.BookNavBar = ({
15297
14770
  currentPage,
@@ -15300,7 +14773,7 @@ var init_BookNavBar = __esm({
15300
14773
  direction,
15301
14774
  className
15302
14775
  }) => {
15303
- const { t } = useTranslate();
14776
+ const { t } = hooks.useTranslate();
15304
14777
  const isRtl = direction === "rtl";
15305
14778
  const progress = totalPages > 1 ? currentPage / (totalPages - 1) * 100 : 0;
15306
14779
  const PrevIcon = isRtl ? LucideIcons2.ChevronRight : LucideIcons2.ChevronLeft;
@@ -15393,7 +14866,6 @@ var init_BookTableOfContents = __esm({
15393
14866
  init_Button();
15394
14867
  init_Box();
15395
14868
  init_Badge();
15396
- init_useTranslate();
15397
14869
  init_cn();
15398
14870
  exports.BookTableOfContents = ({
15399
14871
  parts,
@@ -15401,7 +14873,7 @@ var init_BookTableOfContents = __esm({
15401
14873
  direction,
15402
14874
  className
15403
14875
  }) => {
15404
- const { t } = useTranslate();
14876
+ const { t } = hooks.useTranslate();
15405
14877
  return /* @__PURE__ */ jsxRuntime.jsxs(
15406
14878
  exports.VStack,
15407
14879
  {
@@ -15453,7 +14925,6 @@ var init_EmptyState = __esm({
15453
14925
  init_Stack();
15454
14926
  init_Typography();
15455
14927
  init_useEventBus();
15456
- init_useTranslate();
15457
14928
  ICON_NAME_ALIASES = {
15458
14929
  check: "check-circle",
15459
14930
  error: "x-circle",
@@ -15479,7 +14950,7 @@ var init_EmptyState = __esm({
15479
14950
  look = "icon-only"
15480
14951
  }) => {
15481
14952
  const eventBus = useEventBus();
15482
- const { t } = useTranslate();
14953
+ const { t } = hooks.useTranslate();
15483
14954
  const handleAction = () => {
15484
14955
  if (actionEvent) eventBus.emit(`UI:${actionEvent}`, {});
15485
14956
  onAction?.();
@@ -15624,7 +15095,6 @@ var init_BookViewer = __esm({
15624
15095
  init_Box();
15625
15096
  init_Stack();
15626
15097
  init_useEventBus();
15627
- init_useTranslate();
15628
15098
  init_cn();
15629
15099
  init_BookCoverPage();
15630
15100
  init_BookTableOfContents();
@@ -15650,7 +15120,7 @@ var init_BookViewer = __esm({
15650
15120
  className
15651
15121
  }) => {
15652
15122
  const eventBus = useEventBus();
15653
- const { t } = useTranslate();
15123
+ const { t } = hooks.useTranslate();
15654
15124
  const [currentPage, setCurrentPage] = React79.useState(initialPage);
15655
15125
  const resolvedFieldMap = React79.useMemo(() => resolveFieldMap(fieldMap), [fieldMap]);
15656
15126
  const book = React79.useMemo(() => {
@@ -16056,7 +15526,6 @@ var init_BranchingLogicBuilder = __esm({
16056
15526
  init_FilterPill();
16057
15527
  init_Box();
16058
15528
  init_useEventBus();
16059
- init_useTranslate();
16060
15529
  init_cn();
16061
15530
  END_OF_SURVEY = "end-of-survey";
16062
15531
  RuleRow = ({
@@ -16067,7 +15536,7 @@ var init_BranchingLogicBuilder = __esm({
16067
15536
  onChange,
16068
15537
  onDelete
16069
15538
  }) => {
16070
- const { t } = useTranslate();
15539
+ const { t } = hooks.useTranslate();
16071
15540
  const operatorOptions = React79.useMemo(
16072
15541
  () => [
16073
15542
  { value: "equals", label: t("branchingLogic.operatorEquals") },
@@ -16242,7 +15711,7 @@ var init_BranchingLogicBuilder = __esm({
16242
15711
  NODE_GAP_Y = 80;
16243
15712
  PADDING = 32;
16244
15713
  LogicGraph = ({ questions, rules }) => {
16245
- const { t } = useTranslate();
15714
+ const { t } = hooks.useTranslate();
16246
15715
  const endOfSurveyLabel = t("branchingLogic.endOfSurvey");
16247
15716
  const layout = React79.useMemo(() => {
16248
15717
  const items = [
@@ -16374,7 +15843,7 @@ var init_BranchingLogicBuilder = __esm({
16374
15843
  readOnly = false,
16375
15844
  className
16376
15845
  }) => {
16377
- const { t } = useTranslate();
15846
+ const { t } = hooks.useTranslate();
16378
15847
  const eventBus = useEventBus();
16379
15848
  const questions = Array.isArray(questionsProp) ? questionsProp : [];
16380
15849
  const rulesInitial = Array.isArray(rulesProp) ? rulesProp : [];
@@ -16509,7 +15978,6 @@ var init_Breadcrumb = __esm({
16509
15978
  init_Typography();
16510
15979
  init_cn();
16511
15980
  init_useEventBus();
16512
- init_useTranslate();
16513
15981
  exports.Breadcrumb = ({
16514
15982
  items,
16515
15983
  separator = "chevron-right",
@@ -16517,7 +15985,7 @@ var init_Breadcrumb = __esm({
16517
15985
  className
16518
15986
  }) => {
16519
15987
  const eventBus = useEventBus();
16520
- const { t } = useTranslate();
15988
+ const { t } = hooks.useTranslate();
16521
15989
  const displayItems = maxItems && items.length > maxItems ? [
16522
15990
  ...items.slice(0, 1),
16523
15991
  { label: "...", isCurrent: false },
@@ -16596,7 +16064,7 @@ function BuilderBoard({
16596
16064
  className
16597
16065
  }) {
16598
16066
  const { emit } = useEventBus();
16599
- const { t } = useTranslate();
16067
+ const { t } = hooks.useTranslate();
16600
16068
  const resolved = Array.isArray(entity) ? entity[0] : entity;
16601
16069
  const [placements, setPlacements] = React79.useState({});
16602
16070
  const [headerError, setHeaderError] = React79.useState(false);
@@ -16745,7 +16213,6 @@ var init_BuilderBoard = __esm({
16745
16213
  "components/game/organisms/puzzles/builder/BuilderBoard.tsx"() {
16746
16214
  init_atoms2();
16747
16215
  init_useEventBus();
16748
- init_useTranslate();
16749
16216
  BuilderBoard.displayName = "BuilderBoard";
16750
16217
  }
16751
16218
  });
@@ -17013,7 +16480,7 @@ function CalendarGrid({
17013
16480
  }) {
17014
16481
  const evs = Array.isArray(events2) ? events2 : events2 ? [events2] : [];
17015
16482
  const eventBus = useEventBus();
17016
- const { t } = useTranslate();
16483
+ const { t } = hooks.useTranslate();
17017
16484
  const longPressTimer = React79.useRef(null);
17018
16485
  const resolvedWeekStart = React79.useMemo(
17019
16486
  () => weekStart ? getStartOfWeek(weekStart) : getStartOfWeek(/* @__PURE__ */ new Date()),
@@ -17223,7 +16690,6 @@ var init_CalendarGrid = __esm({
17223
16690
  init_TimeSlotCell();
17224
16691
  init_useEventBus();
17225
16692
  init_useSwipeGesture();
17226
- init_useTranslate();
17227
16693
  SHORT_DATE = { month: "short", day: "numeric" };
17228
16694
  CalendarGrid.displayName = "CalendarGrid";
17229
16695
  }
@@ -18532,7 +17998,6 @@ var init_Pagination = __esm({
18532
17998
  init_Stack();
18533
17999
  init_cn();
18534
18000
  init_useEventBus();
18535
- init_useTranslate();
18536
18001
  exports.Pagination = ({
18537
18002
  currentPage,
18538
18003
  totalPages,
@@ -18551,7 +18016,7 @@ var init_Pagination = __esm({
18551
18016
  pageSizeChangeEvent
18552
18017
  }) => {
18553
18018
  const eventBus = useEventBus();
18554
- const { t } = useTranslate();
18019
+ const { t } = hooks.useTranslate();
18555
18020
  const [jumpToPage, setJumpToPage] = React79.useState("");
18556
18021
  const handlePageChange = (page) => {
18557
18022
  if (pageChangeEvent) eventBus.emit(`UI:${pageChangeEvent}`, { page });
@@ -18736,7 +18201,6 @@ var init_CardGrid = __esm({
18736
18201
  init_cn();
18737
18202
  init_getNestedValue();
18738
18203
  init_useEventBus();
18739
- init_useTranslate();
18740
18204
  init_atoms2();
18741
18205
  init_Badge();
18742
18206
  init_Box();
@@ -18780,7 +18244,7 @@ var init_CardGrid = __esm({
18780
18244
  imageField
18781
18245
  }) => {
18782
18246
  const eventBus = useEventBus();
18783
- const { t } = useTranslate();
18247
+ const { t } = hooks.useTranslate();
18784
18248
  const effectiveFieldNames = normalizeFields(fields).length > 0 ? normalizeFields(fields) : fieldNames ?? normalizeFields(columns);
18785
18249
  const gridTemplateColumns = `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
18786
18250
  const normalizedData = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -18965,7 +18429,6 @@ var init_Carousel = __esm({
18965
18429
  init_cn();
18966
18430
  init_useEventBus();
18967
18431
  init_useSwipeGesture();
18968
- init_useTranslate();
18969
18432
  init_Box();
18970
18433
  init_Stack();
18971
18434
  init_Button();
@@ -18986,7 +18449,7 @@ var init_Carousel = __esm({
18986
18449
  const scrollRef = React79.useRef(null);
18987
18450
  const autoPlayRef = React79.useRef(null);
18988
18451
  const eventBus = useSafeEventBus3();
18989
- const { t } = useTranslate();
18452
+ const { t } = hooks.useTranslate();
18990
18453
  const safeItems = items ?? [];
18991
18454
  const totalSlides = safeItems.length;
18992
18455
  const emitSlideChange = React79.useCallback(
@@ -19202,7 +18665,6 @@ var init_CaseStudyOrganism = __esm({
19202
18665
  "use client";
19203
18666
  init_cn();
19204
18667
  init_useEventBus();
19205
- init_useTranslate();
19206
18668
  init_Stack();
19207
18669
  init_Typography();
19208
18670
  init_SimpleGrid();
@@ -19218,7 +18680,7 @@ var init_CaseStudyOrganism = __esm({
19218
18680
  subtitle
19219
18681
  }) => {
19220
18682
  useEventBus();
19221
- const { t } = useTranslate();
18683
+ const { t } = hooks.useTranslate();
19222
18684
  const items = React79.useMemo(
19223
18685
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
19224
18686
  [entity]
@@ -19407,7 +18869,6 @@ var init_Chart = __esm({
19407
18869
  init_ErrorState();
19408
18870
  init_EmptyState();
19409
18871
  init_useEventBus();
19410
- init_useTranslate();
19411
18872
  CHART_COLORS = [
19412
18873
  "var(--color-primary)",
19413
18874
  "var(--color-success)",
@@ -19980,7 +19441,7 @@ var init_Chart = __esm({
19980
19441
  }) => {
19981
19442
  const resolvedLook = look ?? (chartType ? LOOK_FROM_CHART_TYPE[chartType] : "bar-vertical");
19982
19443
  const eventBus = useEventBus();
19983
- const { t } = useTranslate();
19444
+ const { t } = hooks.useTranslate();
19984
19445
  const handleAction = React79.useCallback(
19985
19446
  (action) => {
19986
19447
  if (action.event) {
@@ -20223,7 +19684,7 @@ function ClassifierBoard({
20223
19684
  className
20224
19685
  }) {
20225
19686
  const { emit } = useEventBus();
20226
- const { t } = useTranslate();
19687
+ const { t } = hooks.useTranslate();
20227
19688
  const resolved = Array.isArray(entity) ? entity[0] : entity;
20228
19689
  const [assignments, setAssignments] = React79.useState({});
20229
19690
  const [headerError, setHeaderError] = React79.useState(false);
@@ -20361,7 +19822,6 @@ var init_ClassifierBoard = __esm({
20361
19822
  "components/game/organisms/puzzles/classifier/ClassifierBoard.tsx"() {
20362
19823
  init_atoms2();
20363
19824
  init_useEventBus();
20364
- init_useTranslate();
20365
19825
  ClassifierBoard.displayName = "ClassifierBoard";
20366
19826
  }
20367
19827
  });
@@ -20371,7 +19831,7 @@ function CodeView({
20371
19831
  defaultExpanded = false,
20372
19832
  className
20373
19833
  }) {
20374
- const { t } = useTranslate();
19834
+ const { t } = hooks.useTranslate();
20375
19835
  const [expanded, setExpanded] = React79.useState(defaultExpanded);
20376
19836
  const jsonString = JSON.stringify(data, null, 2);
20377
19837
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("rounded-lg border border-border overflow-hidden", className), gap: "none", children: [
@@ -20393,7 +19853,6 @@ var init_CodeView = __esm({
20393
19853
  "components/game/organisms/puzzles/state-architect/CodeView.tsx"() {
20394
19854
  init_atoms2();
20395
19855
  init_cn();
20396
- init_useTranslate();
20397
19856
  CodeView.displayName = "CodeView";
20398
19857
  }
20399
19858
  });
@@ -20407,7 +19866,6 @@ var init_Tabs = __esm({
20407
19866
  init_Box();
20408
19867
  init_cn();
20409
19868
  init_useEventBus();
20410
- init_useTranslate();
20411
19869
  exports.Tabs = ({
20412
19870
  items,
20413
19871
  tabs,
@@ -20425,7 +19883,7 @@ var init_Tabs = __esm({
20425
19883
  id: id || value || ""
20426
19884
  }));
20427
19885
  const eventBus = useEventBus();
20428
- const { t } = useTranslate();
19886
+ const { t } = hooks.useTranslate();
20429
19887
  const initialActive = safeItems.find((item) => item.active)?.id;
20430
19888
  const [internalActiveTab, setInternalActiveTab] = React79.useState(
20431
19889
  defaultActiveTab || initialActive || safeItems[0]?.id || ""
@@ -20584,7 +20042,6 @@ var init_CodeViewer = __esm({
20584
20042
  init_EmptyState();
20585
20043
  init_Tabs();
20586
20044
  init_useEventBus();
20587
- init_useTranslate();
20588
20045
  DIFF_STYLES = {
20589
20046
  add: {
20590
20047
  bg: "bg-success/10",
@@ -20622,7 +20079,7 @@ var init_CodeViewer = __esm({
20622
20079
  className
20623
20080
  }) => {
20624
20081
  const eventBus = useEventBus();
20625
- const { t } = useTranslate();
20082
+ const { t } = hooks.useTranslate();
20626
20083
  const [copied, setCopied] = React79.useState(false);
20627
20084
  const [wrap, setWrap] = React79.useState(wordWrap);
20628
20085
  const [activeFileIndex, setActiveFileIndex] = React79.useState(0);
@@ -21013,7 +20470,6 @@ var init_ConfirmDialog = __esm({
21013
20470
  init_Box();
21014
20471
  init_Stack();
21015
20472
  init_cn();
21016
- init_useTranslate();
21017
20473
  variantConfig = {
21018
20474
  danger: {
21019
20475
  icon: LucideIcons2.Trash2,
@@ -21061,7 +20517,7 @@ var init_ConfirmDialog = __esm({
21061
20517
  className
21062
20518
  }) => {
21063
20519
  const config = variantConfig[variant];
21064
- const { t } = useTranslate();
20520
+ const { t } = hooks.useTranslate();
21065
20521
  const resolvedMessage = message ?? description ?? "";
21066
20522
  const resolvedConfirmText = confirmText ?? confirmLabel ?? t("dialog.confirm");
21067
20523
  const resolvedCancelText = cancelText ?? cancelLabel ?? t("dialog.cancel");
@@ -21619,7 +21075,6 @@ var init_DashboardGrid = __esm({
21619
21075
  "components/core/organisms/layout/DashboardGrid.tsx"() {
21620
21076
  init_cn();
21621
21077
  init_Box();
21622
- init_useTranslate();
21623
21078
  gapStyles5 = {
21624
21079
  sm: "gap-2",
21625
21080
  md: "gap-4",
@@ -21646,7 +21101,7 @@ var init_DashboardGrid = __esm({
21646
21101
  cells,
21647
21102
  className
21648
21103
  }) => {
21649
- const { t: _t } = useTranslate();
21104
+ const { t: _t } = hooks.useTranslate();
21650
21105
  return /* @__PURE__ */ jsxRuntime.jsx(
21651
21106
  exports.Box,
21652
21107
  {
@@ -21713,7 +21168,6 @@ var init_DashboardLayout = __esm({
21713
21168
  init_Icon();
21714
21169
  init_useAuthContext();
21715
21170
  init_useEventBus();
21716
- init_useTranslate();
21717
21171
  init_CurrentPagePathContext();
21718
21172
  exports.DashboardLayout = ({
21719
21173
  appName = "{{APP_TITLE}}",
@@ -21770,13 +21224,9 @@ var init_DashboardLayout = __esm({
21770
21224
  const location = reactRouterDom.useLocation();
21771
21225
  const ctxPagePath = useCurrentPagePath();
21772
21226
  const activePath = currentPath ?? ctxPagePath ?? location.pathname;
21773
- const { user: authUser, signOut: authSignOut } = useAuthContext();
21774
- const user = userProp || (authUser ? {
21775
- name: authUser.displayName || authUser.email?.split("@")[0] || "User",
21776
- email: authUser.email || "",
21777
- avatar: authUser.photoURL || void 0
21778
- } : null);
21779
- const { t } = useTranslate();
21227
+ const { signOut: authSignOut } = useAuthContext();
21228
+ const user = userProp || (null);
21229
+ const { t } = hooks.useTranslate();
21780
21230
  const handleSignOut = onSignOutProp || authSignOut;
21781
21231
  const showSidebar = layoutMode === "sidebar";
21782
21232
  const showHeader = layoutMode !== "minimal";
@@ -22442,7 +21892,7 @@ function useDataDnd(args) {
22442
21892
  ({ id, children }) => {
22443
21893
  const {
22444
21894
  attributes,
22445
- listeners: listeners8,
21895
+ listeners: listeners7,
22446
21896
  setNodeRef,
22447
21897
  transform,
22448
21898
  transition,
@@ -22465,7 +21915,7 @@ function useDataDnd(args) {
22465
21915
  ref: setNodeRef,
22466
21916
  style,
22467
21917
  ...attributes,
22468
- ...listeners8,
21918
+ ...listeners7,
22469
21919
  children
22470
21920
  }
22471
21921
  );
@@ -22747,7 +22197,7 @@ function DataGrid({
22747
22197
  look = "dense"
22748
22198
  }) {
22749
22199
  const eventBus = useEventBus();
22750
- const { t } = useTranslate();
22200
+ const { t } = hooks.useTranslate();
22751
22201
  const [selectedIds, setSelectedIds] = React79.useState(/* @__PURE__ */ new Set());
22752
22202
  const [visibleCount, setVisibleCount] = React79.useState(pageSize || Infinity);
22753
22203
  const fieldDefs = fields ?? columns ?? [];
@@ -23062,7 +22512,6 @@ var init_DataGrid = __esm({
23062
22512
  init_cn();
23063
22513
  init_getNestedValue();
23064
22514
  init_useEventBus();
23065
- init_useTranslate();
23066
22515
  init_Box();
23067
22516
  init_Stack();
23068
22517
  init_Typography();
@@ -23187,7 +22636,7 @@ function DataList({
23187
22636
  look = "dense"
23188
22637
  }) {
23189
22638
  const eventBus = useEventBus();
23190
- const { t } = useTranslate();
22639
+ const { t } = hooks.useTranslate();
23191
22640
  const [visibleCount, setVisibleCount] = React79__namespace.default.useState(pageSize || Infinity);
23192
22641
  const fieldDefs = fields ?? columns ?? [];
23193
22642
  const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
@@ -23501,7 +22950,6 @@ var init_DataList = __esm({
23501
22950
  init_cn();
23502
22951
  init_getNestedValue();
23503
22952
  init_useEventBus();
23504
- init_useTranslate();
23505
22953
  init_Box();
23506
22954
  init_Stack();
23507
22955
  init_Typography();
@@ -23556,7 +23004,6 @@ var init_FileTree = __esm({
23556
23004
  init_Box();
23557
23005
  init_Typography();
23558
23006
  init_Icon();
23559
- init_useTranslate();
23560
23007
  TreeNodeItem = ({
23561
23008
  node,
23562
23009
  depth,
@@ -23642,7 +23089,7 @@ var init_FileTree = __esm({
23642
23089
  className,
23643
23090
  indent = 16
23644
23091
  }) => {
23645
- const { t } = useTranslate();
23092
+ const { t } = hooks.useTranslate();
23646
23093
  if (tree.length === 0) {
23647
23094
  return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: `p-4 ${className ?? ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "caption", color: "muted", children: t("fileTree.noFiles") }) });
23648
23095
  }
@@ -23743,14 +23190,6 @@ function useQuerySingleton(query) {
23743
23190
  setSort
23744
23191
  };
23745
23192
  }
23746
- function parseQueryBinding(binding) {
23747
- const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
23748
- const parts = cleaned.split(".");
23749
- return {
23750
- query: parts[0],
23751
- field: parts.length > 1 ? parts.slice(1).join(".") : void 0
23752
- };
23753
- }
23754
23193
  var queryStores;
23755
23194
  var init_useQuerySingleton = __esm({
23756
23195
  "hooks/useQuerySingleton.ts"() {
@@ -23771,7 +23210,6 @@ var init_FilterGroup = __esm({
23771
23210
  init_Icon();
23772
23211
  init_useEventBus();
23773
23212
  init_useQuerySingleton();
23774
- init_useTranslate();
23775
23213
  resolveFilterType = (filter) => filter.filterType ?? filter.type;
23776
23214
  lookStyles6 = {
23777
23215
  toolbar: "",
@@ -23792,7 +23230,7 @@ var init_FilterGroup = __esm({
23792
23230
  isLoading,
23793
23231
  look = "toolbar"
23794
23232
  }) => {
23795
- const { t } = useTranslate();
23233
+ const { t } = hooks.useTranslate();
23796
23234
  const eventBus = useEventBus();
23797
23235
  const queryState = useQuerySingleton(query);
23798
23236
  const [selectedValues, setSelectedValues] = React79.useState(
@@ -24423,7 +23861,6 @@ var init_Coachmark = __esm({
24423
23861
  init_Button();
24424
23862
  init_Icon();
24425
23863
  init_cn();
24426
- init_useTranslate();
24427
23864
  GAP = 10;
24428
23865
  EDGE = 8;
24429
23866
  exports.Coachmark = ({
@@ -24442,7 +23879,7 @@ var init_Coachmark = __esm({
24442
23879
  className
24443
23880
  }) => {
24444
23881
  const cardRef = React79.useRef(null);
24445
- const { t } = useTranslate();
23882
+ const { t } = hooks.useTranslate();
24446
23883
  const rect = useAnchorRect(anchor, open);
24447
23884
  const [pos, setPos] = React79.useState(null);
24448
23885
  const centered = open && !rect && fallbackCentered;
@@ -24664,7 +24101,6 @@ var init_RelationSelect = __esm({
24664
24101
  init_Spinner();
24665
24102
  init_Typography();
24666
24103
  init_debug();
24667
- init_useTranslate();
24668
24104
  isRelationsDebugEnabled = () => isDebugEnabled();
24669
24105
  exports.RelationSelect = ({
24670
24106
  value,
@@ -24681,7 +24117,7 @@ var init_RelationSelect = __esm({
24681
24117
  searchPlaceholder,
24682
24118
  emptyMessage
24683
24119
  }) => {
24684
- const { t } = useTranslate();
24120
+ const { t } = hooks.useTranslate();
24685
24121
  const resolvedPlaceholder = placeholder ?? t("relationSelect.selectPlaceholder");
24686
24122
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
24687
24123
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noOptionsFound");
@@ -24889,7 +24325,6 @@ var init_SearchInput = __esm({
24889
24325
  init_cn();
24890
24326
  init_useEventBus();
24891
24327
  init_useQuerySingleton();
24892
- init_useTranslate();
24893
24328
  exports.SearchInput = ({
24894
24329
  value,
24895
24330
  onSearch,
@@ -24904,7 +24339,7 @@ var init_SearchInput = __esm({
24904
24339
  ...props
24905
24340
  }) => {
24906
24341
  const eventBus = useEventBus();
24907
- const { t } = useTranslate();
24342
+ const { t } = hooks.useTranslate();
24908
24343
  const resolvedPlaceholder = placeholder ?? t("common.search");
24909
24344
  const queryState = useQuerySingleton(query);
24910
24345
  const initialValue = queryState?.search ?? value ?? "";
@@ -24992,7 +24427,6 @@ var init_SidePanel = __esm({
24992
24427
  init_Typography();
24993
24428
  init_cn();
24994
24429
  init_useEventBus();
24995
- init_useTranslate();
24996
24430
  exports.SidePanel = ({
24997
24431
  title,
24998
24432
  children,
@@ -25005,7 +24439,7 @@ var init_SidePanel = __esm({
25005
24439
  closeEvent
25006
24440
  }) => {
25007
24441
  const eventBus = useEventBus();
25008
- const { t } = useTranslate();
24442
+ const { t } = hooks.useTranslate();
25009
24443
  const handleClose = () => {
25010
24444
  if (closeEvent) eventBus.emit(`UI:${closeEvent}`, {});
25011
24445
  onClose();
@@ -25171,7 +24605,6 @@ var init_WizardNavigation = __esm({
25171
24605
  init_Icon();
25172
24606
  init_cn();
25173
24607
  init_useEventBus();
25174
- init_useTranslate();
25175
24608
  exports.WizardNavigation = ({
25176
24609
  currentStep,
25177
24610
  totalSteps,
@@ -25192,7 +24625,7 @@ var init_WizardNavigation = __esm({
25192
24625
  className
25193
24626
  }) => {
25194
24627
  const eventBus = useSafeEventBus4();
25195
- const { t } = useTranslate();
24628
+ const { t } = hooks.useTranslate();
25196
24629
  const resolvedBackLabel = backLabel ?? t("wizard.back");
25197
24630
  const resolvedNextLabel = nextLabel ?? t("wizard.next");
25198
24631
  const resolvedCompleteLabel = completeLabel ?? t("wizard.complete");
@@ -25259,7 +24692,6 @@ var init_RepeatableFormSection = __esm({
25259
24692
  init_Card();
25260
24693
  init_Icon();
25261
24694
  init_useEventBus();
25262
- init_useTranslate();
25263
24695
  exports.RepeatableFormSection = ({
25264
24696
  sectionType,
25265
24697
  title,
@@ -25280,7 +24712,7 @@ var init_RepeatableFormSection = __esm({
25280
24712
  showAuditInfo = false
25281
24713
  }) => {
25282
24714
  const eventBus = useEventBus();
25283
- const { t } = useTranslate();
24715
+ const { t } = hooks.useTranslate();
25284
24716
  const resolvedAddLabel = addLabel ?? t("common.add");
25285
24717
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noItemsAdded");
25286
24718
  const safeItems = items ?? [];
@@ -25390,7 +24822,6 @@ var actionTypeLabelKeys, actionTypeIcons; exports.ViolationAlert = void 0;
25390
24822
  var init_ViolationAlert = __esm({
25391
24823
  "components/core/molecules/ViolationAlert.tsx"() {
25392
24824
  init_cn();
25393
- init_useTranslate();
25394
24825
  init_Box();
25395
24826
  init_Stack();
25396
24827
  init_Typography();
@@ -25416,7 +24847,7 @@ var init_ViolationAlert = __esm({
25416
24847
  className,
25417
24848
  ...flatProps
25418
24849
  }) => {
25419
- const { t } = useTranslate();
24850
+ const { t } = hooks.useTranslate();
25420
24851
  const resolvedViolation = violation ?? {
25421
24852
  law: "",
25422
24853
  article: "",
@@ -25896,7 +25327,6 @@ var init_LineChart = __esm({
25896
25327
  "use client";
25897
25328
  init_cn();
25898
25329
  init_atoms2();
25899
- init_useTranslate();
25900
25330
  exports.LineChart = ({
25901
25331
  data,
25902
25332
  width = 400,
@@ -25908,7 +25338,7 @@ var init_LineChart = __esm({
25908
25338
  areaColor = "var(--color-primary)",
25909
25339
  className
25910
25340
  }) => {
25911
- const { t } = useTranslate();
25341
+ const { t } = hooks.useTranslate();
25912
25342
  const gradientId = React79.useId();
25913
25343
  const safeData = data ?? [];
25914
25344
  const sortedData = React79.useMemo(() => {
@@ -28136,7 +27566,6 @@ var init_GraphView = __esm({
28136
27566
  "use client";
28137
27567
  init_cn();
28138
27568
  init_atoms2();
28139
- init_useTranslate();
28140
27569
  GROUP_COLORS = [
28141
27570
  "#3b82f6",
28142
27571
  // blue-500
@@ -28169,7 +27598,7 @@ var init_GraphView = __esm({
28169
27598
  showLabels = true,
28170
27599
  zoomToFit = true
28171
27600
  }) => {
28172
- const { t } = useTranslate();
27601
+ const { t } = hooks.useTranslate();
28173
27602
  const containerRef = React79.useRef(null);
28174
27603
  const animRef = React79.useRef(0);
28175
27604
  const [simNodes, setSimNodes] = React79.useState([]);
@@ -28462,7 +27891,6 @@ var init_NumberStepper = __esm({
28462
27891
  init_cn();
28463
27892
  init_Icon();
28464
27893
  init_useEventBus();
28465
- init_useTranslate();
28466
27894
  sizeStyles10 = {
28467
27895
  sm: {
28468
27896
  button: "w-7 h-7",
@@ -28496,7 +27924,7 @@ var init_NumberStepper = __esm({
28496
27924
  label
28497
27925
  }) => {
28498
27926
  const eventBus = useSafeEventBus5();
28499
- const { t } = useTranslate();
27927
+ const { t } = hooks.useTranslate();
28500
27928
  const intervalRef = React79.useRef(null);
28501
27929
  const timeoutRef = React79.useRef(null);
28502
27930
  const isAtMin = min !== void 0 && value <= min;
@@ -28803,7 +28231,6 @@ var init_UploadDropZone = __esm({
28803
28231
  init_Icon();
28804
28232
  init_Typography();
28805
28233
  init_useEventBus();
28806
- init_useTranslate();
28807
28234
  exports.UploadDropZone = ({
28808
28235
  accept,
28809
28236
  maxSize,
@@ -28816,7 +28243,7 @@ var init_UploadDropZone = __esm({
28816
28243
  onFiles,
28817
28244
  className
28818
28245
  }) => {
28819
- const { t } = useTranslate();
28246
+ const { t } = hooks.useTranslate();
28820
28247
  const resolvedLabel = label ?? t("upload.dropOrBrowse");
28821
28248
  const [isDragOver, setIsDragOver] = React79.useState(false);
28822
28249
  const [error, setError] = React79.useState(null);
@@ -28970,7 +28397,6 @@ var init_Lightbox = __esm({
28970
28397
  init_Icon();
28971
28398
  init_cn();
28972
28399
  init_useEventBus();
28973
- init_useTranslate();
28974
28400
  exports.Lightbox = ({
28975
28401
  images = [],
28976
28402
  currentIndex = 0,
@@ -28985,7 +28411,7 @@ var init_Lightbox = __esm({
28985
28411
  const [index, setIndex] = React79.useState(currentIndex);
28986
28412
  const [touchStartX, setTouchStartX] = React79.useState(null);
28987
28413
  const eventBus = useSafeEventBus8();
28988
- const { t } = useTranslate();
28414
+ const { t } = hooks.useTranslate();
28989
28415
  React79.useEffect(() => {
28990
28416
  setIndex(currentIndex);
28991
28417
  }, [currentIndex]);
@@ -29223,7 +28649,7 @@ function TableView({
29223
28649
  dndRoot
29224
28650
  }) {
29225
28651
  const eventBus = useEventBus();
29226
- const { t } = useTranslate();
28652
+ const { t } = hooks.useTranslate();
29227
28653
  const [visibleCount, setVisibleCount] = React79__namespace.default.useState(pageSize > 0 ? pageSize : Infinity);
29228
28654
  const [localSelected, setLocalSelected] = React79__namespace.default.useState(/* @__PURE__ */ new Set());
29229
28655
  const colDefs = columns ?? fields ?? [];
@@ -29455,7 +28881,6 @@ var init_TableView = __esm({
29455
28881
  init_cn();
29456
28882
  init_getNestedValue();
29457
28883
  init_useEventBus();
29458
- init_useTranslate();
29459
28884
  init_Box();
29460
28885
  init_Stack();
29461
28886
  init_Typography();
@@ -29659,7 +29084,6 @@ var init_Meter = __esm({
29659
29084
  init_LoadingState();
29660
29085
  init_ErrorState();
29661
29086
  init_useEventBus();
29662
- init_useTranslate();
29663
29087
  DEFAULT_THRESHOLDS = [
29664
29088
  { value: 30, color: "var(--color-error)" },
29665
29089
  { value: 70, color: "var(--color-warning)" },
@@ -29687,7 +29111,7 @@ var init_Meter = __esm({
29687
29111
  className
29688
29112
  }) => {
29689
29113
  const eventBus = useEventBus();
29690
- const { t } = useTranslate();
29114
+ const { t } = hooks.useTranslate();
29691
29115
  const handleAction = React79.useCallback(
29692
29116
  (action) => {
29693
29117
  if (action.event) {
@@ -31606,7 +31030,6 @@ var init_VoteStack = __esm({
31606
31030
  init_cn();
31607
31031
  init_Icon();
31608
31032
  init_useEventBus();
31609
- init_useTranslate();
31610
31033
  sizeStyles12 = {
31611
31034
  sm: {
31612
31035
  button: "w-7 h-7",
@@ -31639,7 +31062,7 @@ var init_VoteStack = __esm({
31639
31062
  const isUp = userVote === "up";
31640
31063
  const isDown = userVote === "down";
31641
31064
  const eventBus = useEventBus();
31642
- const { t } = useTranslate();
31065
+ const { t } = hooks.useTranslate();
31643
31066
  const handleUp = React79.useCallback(() => {
31644
31067
  const next = isUp ? null : "up";
31645
31068
  onVote?.(next);
@@ -32061,7 +31484,6 @@ var init_QrScanner = __esm({
32061
31484
  init_atoms2();
32062
31485
  init_Icon();
32063
31486
  init_useEventBus();
32064
- init_useTranslate();
32065
31487
  exports.QrScanner = ({
32066
31488
  onScan,
32067
31489
  scanEvent,
@@ -32074,7 +31496,7 @@ var init_QrScanner = __esm({
32074
31496
  className
32075
31497
  }) => {
32076
31498
  const eventBus = useEventBus();
32077
- const { t } = useTranslate();
31499
+ const { t } = hooks.useTranslate();
32078
31500
  const videoRef = React79.useRef(null);
32079
31501
  const streamRef = React79.useRef(null);
32080
31502
  const scanIntervalRef = React79.useRef(null);
@@ -32288,7 +31710,6 @@ var init_OptionConstraintGroup = __esm({
32288
31710
  "components/core/molecules/OptionConstraintGroup.tsx"() {
32289
31711
  init_cn();
32290
31712
  init_useEventBus();
32291
- init_useTranslate();
32292
31713
  init_Typography();
32293
31714
  init_Box();
32294
31715
  init_Label();
@@ -32344,7 +31765,7 @@ var init_OptionConstraintGroup = __esm({
32344
31765
  className
32345
31766
  }) => {
32346
31767
  const eventBus = useEventBus();
32347
- const { t } = useTranslate();
31768
+ const { t } = hooks.useTranslate();
32348
31769
  const hint = constraintHint(constraint, t);
32349
31770
  const error = validateSelection(selected, constraint, t);
32350
31771
  const inputName = `option-${groupId}`;
@@ -32768,7 +32189,7 @@ function changeBlockType(block, type) {
32768
32189
  return { id: block.id, type, content: seed };
32769
32190
  }
32770
32191
  function BlockMenu({ block, readOnly, onDelete, onDuplicate, onChangeType }) {
32771
- const { t } = useTranslate();
32192
+ const { t } = hooks.useTranslate();
32772
32193
  const [open, setOpen] = React79.useState(false);
32773
32194
  const ref = React79.useRef(null);
32774
32195
  React79.useEffect(() => {
@@ -32925,7 +32346,7 @@ function BlockRow({
32925
32346
  onInsertAfter,
32926
32347
  onChangeType
32927
32348
  }) {
32928
- const { t } = useTranslate();
32349
+ const { t } = hooks.useTranslate();
32929
32350
  const setContent = React79.useCallback(
32930
32351
  (next) => onUpdate((b) => ({ ...b, content: next })),
32931
32352
  [onUpdate]
@@ -33244,7 +32665,6 @@ var init_RichBlockEditor = __esm({
33244
32665
  init_Input();
33245
32666
  init_Icon();
33246
32667
  init_useEventBus();
33247
- init_useTranslate();
33248
32668
  TOOLBAR_ENTRIES = [
33249
32669
  { type: "paragraph", labelKey: "richBlockEditor.toolbar.text", icon: LucideIcons2.Type },
33250
32670
  { type: "heading-1", labelKey: "richBlockEditor.toolbar.h1", icon: LucideIcons2.Heading1 },
@@ -33301,7 +32721,7 @@ var init_RichBlockEditor = __esm({
33301
32721
  showToolbar = true,
33302
32722
  className
33303
32723
  }) => {
33304
- const { t } = useTranslate();
32724
+ const { t } = hooks.useTranslate();
33305
32725
  const [blocks, setBlocks] = React79.useState(
33306
32726
  () => normalizeBlocks(initialBlocks)
33307
32727
  );
@@ -33435,7 +32855,6 @@ var init_ReplyTree = __esm({
33435
32855
  "use client";
33436
32856
  init_cn();
33437
32857
  init_useEventBus();
33438
- init_useTranslate();
33439
32858
  init_atoms2();
33440
32859
  init_VoteStack();
33441
32860
  ReplyTreeNode = ({
@@ -33455,7 +32874,7 @@ var init_ReplyTree = __esm({
33455
32874
  showActions
33456
32875
  }) => {
33457
32876
  const eventBus = useEventBus();
33458
- const { t } = useTranslate();
32877
+ const { t } = hooks.useTranslate();
33459
32878
  const hasReplies = !!node.replies && node.replies.length > 0;
33460
32879
  const isCollapsed = collapsedSet.has(node.id);
33461
32880
  const atMaxDepth = depth >= maxDepth;
@@ -33646,7 +33065,7 @@ var init_ReplyTree = __esm({
33646
33065
  showActions = true,
33647
33066
  className
33648
33067
  }) => {
33649
- const { t } = useTranslate();
33068
+ const { t } = hooks.useTranslate();
33650
33069
  const nodeList = Array.isArray(nodes) ? nodes : nodes ? [nodes] : [];
33651
33070
  const [collapsedSet, setCollapsedSet] = React79.useState(() => {
33652
33071
  const acc = /* @__PURE__ */ new Set();
@@ -33743,7 +33162,6 @@ var init_VersionDiff = __esm({
33743
33162
  "use client";
33744
33163
  init_cn();
33745
33164
  init_useEventBus();
33746
- init_useTranslate();
33747
33165
  init_atoms2();
33748
33166
  init_Stack();
33749
33167
  INLINE_STYLES = {
@@ -33766,7 +33184,7 @@ var init_VersionDiff = __esm({
33766
33184
  language,
33767
33185
  className
33768
33186
  }) => {
33769
- const { t } = useTranslate();
33187
+ const { t } = hooks.useTranslate();
33770
33188
  const eventBus = useEventBus();
33771
33189
  const revisions = Array.isArray(revisionsProp) ? revisionsProp : [];
33772
33190
  const fallbackBefore = revisions[0]?.id ?? "";
@@ -34059,12 +33477,11 @@ var init_DocBreadcrumb = __esm({
34059
33477
  init_Stack();
34060
33478
  init_Typography();
34061
33479
  init_Icon();
34062
- init_useTranslate();
34063
33480
  exports.DocBreadcrumb = ({
34064
33481
  items,
34065
33482
  className
34066
33483
  }) => {
34067
- const { t } = useTranslate();
33484
+ const { t } = hooks.useTranslate();
34068
33485
  return /* @__PURE__ */ jsxRuntime.jsx(
34069
33486
  exports.Box,
34070
33487
  {
@@ -34315,7 +33732,7 @@ function DocSearch({
34315
33732
  onSearch,
34316
33733
  className
34317
33734
  }) {
34318
- const { t } = useTranslate();
33735
+ const { t } = hooks.useTranslate();
34319
33736
  const resolvedPlaceholder = placeholder ?? t("docSearch.placeholder");
34320
33737
  const [query, setQuery] = React79.useState("");
34321
33738
  const [results, setResults] = React79.useState([]);
@@ -34488,7 +33905,6 @@ var init_DocSearch = __esm({
34488
33905
  init_Typography();
34489
33906
  init_Icon();
34490
33907
  init_Input();
34491
- init_useTranslate();
34492
33908
  }
34493
33909
  });
34494
33910
  var DocSidebarCategory; exports.DocSidebar = void 0;
@@ -34501,7 +33917,6 @@ var init_DocSidebar = __esm({
34501
33917
  init_Stack();
34502
33918
  init_Typography();
34503
33919
  init_Icon();
34504
- init_useTranslate();
34505
33920
  DocSidebarCategory = ({ item, depth }) => {
34506
33921
  const [expanded, setExpanded] = React79.useState(
34507
33922
  () => item.items?.some(function hasActive(child) {
@@ -34586,7 +34001,7 @@ var init_DocSidebar = __esm({
34586
34001
  items,
34587
34002
  className
34588
34003
  }) => {
34589
- const { t } = useTranslate();
34004
+ const { t } = hooks.useTranslate();
34590
34005
  return /* @__PURE__ */ jsxRuntime.jsx(
34591
34006
  exports.Box,
34592
34007
  {
@@ -34608,13 +34023,12 @@ var init_DocTOC = __esm({
34608
34023
  init_Box();
34609
34024
  init_Stack();
34610
34025
  init_Typography();
34611
- init_useTranslate();
34612
34026
  exports.DocTOC = ({
34613
34027
  items,
34614
34028
  activeId,
34615
34029
  className
34616
34030
  }) => {
34617
- const { t } = useTranslate();
34031
+ const { t } = hooks.useTranslate();
34618
34032
  return /* @__PURE__ */ jsxRuntime.jsx(
34619
34033
  exports.Box,
34620
34034
  {
@@ -35342,7 +34756,6 @@ var init_FormSection = __esm({
35342
34756
  init_Button();
35343
34757
  init_Stack();
35344
34758
  init_Icon();
35345
- init_useTranslate();
35346
34759
  init_useEventBus();
35347
34760
  exports.FormSection = ({
35348
34761
  title,
@@ -35355,7 +34768,7 @@ var init_FormSection = __esm({
35355
34768
  className
35356
34769
  }) => {
35357
34770
  const [collapsed, setCollapsed] = React79__namespace.default.useState(defaultCollapsed);
35358
- const { t } = useTranslate();
34771
+ const { t } = hooks.useTranslate();
35359
34772
  const eventBus = useEventBus();
35360
34773
  const gridClass = {
35361
34774
  1: "grid-cols-1",
@@ -35471,7 +34884,6 @@ var init_Header = __esm({
35471
34884
  init_Stack();
35472
34885
  init_Typography();
35473
34886
  init_cn();
35474
- init_useTranslate();
35475
34887
  lookStyles8 = {
35476
34888
  "compact-bar": "",
35477
34889
  hero: "py-section min-h-[200px] [&_h1]:text-display-1",
@@ -35500,7 +34912,7 @@ var init_Header = __esm({
35500
34912
  onLogoClick,
35501
34913
  className
35502
34914
  }) => {
35503
- const { t } = useTranslate();
34915
+ const { t } = hooks.useTranslate();
35504
34916
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
35505
34917
  const userInitials = userAvatar?.initials || userName?.[0]?.toUpperCase() || "U";
35506
34918
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -35791,7 +35203,6 @@ var init_Sidebar = __esm({
35791
35203
  init_Typography();
35792
35204
  init_cn();
35793
35205
  init_useEventBus();
35794
- init_useTranslate();
35795
35206
  SidebarNavItem = ({ item, collapsed }) => {
35796
35207
  const Icon3 = item.icon;
35797
35208
  const isActive = item.active ?? item.isActive;
@@ -35855,7 +35266,7 @@ var init_Sidebar = __esm({
35855
35266
  className
35856
35267
  }) => {
35857
35268
  const { emit } = useEventBus();
35858
- const { t } = useTranslate();
35269
+ const { t } = hooks.useTranslate();
35859
35270
  const [internalCollapsed, setInternalCollapsed] = React79.useState(defaultCollapsed);
35860
35271
  const collapsed = controlledCollapsed !== void 0 ? controlledCollapsed : internalCollapsed;
35861
35272
  const handleToggle = React79.useCallback(() => {
@@ -36045,7 +35456,6 @@ var init_WizardContainer = __esm({
36045
35456
  init_Stack();
36046
35457
  init_Icon();
36047
35458
  init_cn();
36048
- init_useTranslate();
36049
35459
  exports.WizardContainer = ({
36050
35460
  steps,
36051
35461
  currentStep: controlledStep,
@@ -36058,7 +35468,7 @@ var init_WizardContainer = __esm({
36058
35468
  entity: _entity
36059
35469
  // Accept but don't use directly yet
36060
35470
  }) => {
36061
- const { t } = useTranslate();
35471
+ const { t } = hooks.useTranslate();
36062
35472
  const [internalStep, setInternalStep] = React79.useState(0);
36063
35473
  const normalizedControlledStep = (() => {
36064
35474
  if (controlledStep === void 0 || controlledStep === null)
@@ -36222,14 +35632,14 @@ var init_WizardContainer = __esm({
36222
35632
  });
36223
35633
  function calculateComplexity(schema) {
36224
35634
  if (!schema) return 1;
36225
- const entities2 = schema.dataEntities?.length || 0;
35635
+ const entities = schema.dataEntities?.length || 0;
36226
35636
  const pages = schema.ui?.pages?.length || 0;
36227
35637
  const traits2 = schema.traits?.length || 0;
36228
35638
  const sections = schema.ui?.pages?.reduce(
36229
35639
  (acc, page) => acc + (page.sections?.length || 0),
36230
35640
  0
36231
35641
  ) || 0;
36232
- return entities2 * 3 + pages * 2 + traits2 * 2 + sections * 1;
35642
+ return entities * 3 + pages * 2 + traits2 * 2 + sections * 1;
36233
35643
  }
36234
35644
  function getOrbitalType(complexity) {
36235
35645
  if (complexity <= 3) return "1s";
@@ -36619,7 +36029,6 @@ var init_SignaturePad = __esm({
36619
36029
  init_LoadingState();
36620
36030
  init_ErrorState();
36621
36031
  init_useEventBus();
36622
- init_useTranslate();
36623
36032
  exports.SignaturePad = ({
36624
36033
  label,
36625
36034
  helperText,
@@ -36637,7 +36046,7 @@ var init_SignaturePad = __esm({
36637
36046
  className
36638
36047
  }) => {
36639
36048
  const eventBus = useEventBus();
36640
- const { t } = useTranslate();
36049
+ const { t } = hooks.useTranslate();
36641
36050
  const resolvedLabel = label ?? t("signaturePad.label");
36642
36051
  const resolvedHelperText = helperText ?? t("signaturePad.helperText");
36643
36052
  const canvasRef = React79.useRef(null);
@@ -36813,7 +36222,6 @@ var init_DocumentViewer = __esm({
36813
36222
  init_EmptyState();
36814
36223
  init_Tabs();
36815
36224
  init_useEventBus();
36816
- init_useTranslate();
36817
36225
  exports.DocumentViewer = ({
36818
36226
  title,
36819
36227
  src,
@@ -36833,7 +36241,7 @@ var init_DocumentViewer = __esm({
36833
36241
  className
36834
36242
  }) => {
36835
36243
  const eventBus = useEventBus();
36836
- const { t } = useTranslate();
36244
+ const { t } = hooks.useTranslate();
36837
36245
  const [zoom, setZoom] = React79.useState(100);
36838
36246
  const [currentPage, setCurrentPage] = React79.useState(propPage ?? 1);
36839
36247
  const [activeDocIndex, setActiveDocIndex] = React79.useState(0);
@@ -37018,7 +36426,6 @@ var init_GraphCanvas = __esm({
37018
36426
  init_ErrorState();
37019
36427
  init_EmptyState();
37020
36428
  init_useEventBus();
37021
- init_useTranslate();
37022
36429
  GROUP_COLORS2 = [
37023
36430
  "var(--color-primary)",
37024
36431
  "var(--color-success)",
@@ -37045,7 +36452,7 @@ var init_GraphCanvas = __esm({
37045
36452
  className
37046
36453
  }) => {
37047
36454
  const eventBus = useEventBus();
37048
- const { t } = useTranslate();
36455
+ const { t } = hooks.useTranslate();
37049
36456
  const canvasRef = React79.useRef(null);
37050
36457
  const animRef = React79.useRef(0);
37051
36458
  const [zoom, setZoom] = React79.useState(1);
@@ -37515,7 +36922,7 @@ function DataTable({
37515
36922
  null
37516
36923
  );
37517
36924
  const eventBus = useEventBus();
37518
- const { t } = useTranslate();
36925
+ const { t } = hooks.useTranslate();
37519
36926
  const resolvedEmptyTitle = emptyTitle ?? t("table.empty.title");
37520
36927
  const resolvedEmptyDescription = emptyDescription ?? t("table.empty.description");
37521
36928
  const resolvedSearchPlaceholder = searchPlaceholder ?? t("common.search");
@@ -37876,7 +37283,6 @@ var init_DataTable = __esm({
37876
37283
  init_molecules2();
37877
37284
  init_Icon();
37878
37285
  init_useEventBus();
37879
- init_useTranslate();
37880
37286
  init_types3();
37881
37287
  lookStyles9 = {
37882
37288
  dense: "",
@@ -37894,7 +37300,7 @@ function DebuggerBoard({
37894
37300
  className
37895
37301
  }) {
37896
37302
  const { emit } = useEventBus();
37897
- const { t } = useTranslate();
37303
+ const { t } = hooks.useTranslate();
37898
37304
  const resolved = Array.isArray(entity) ? entity[0] : entity;
37899
37305
  const [flaggedLines, setFlaggedLines] = React79.useState(/* @__PURE__ */ new Set());
37900
37306
  const [headerError, setHeaderError] = React79.useState(false);
@@ -38023,7 +37429,6 @@ var init_DebuggerBoard = __esm({
38023
37429
  "components/game/organisms/puzzles/debugger/DebuggerBoard.tsx"() {
38024
37430
  init_atoms2();
38025
37431
  init_useEventBus();
38026
- init_useTranslate();
38027
37432
  DebuggerBoard.displayName = "DebuggerBoard";
38028
37433
  }
38029
37434
  });
@@ -38194,7 +37599,6 @@ var init_DetailPanel = __esm({
38194
37599
  init_cn();
38195
37600
  init_getNestedValue();
38196
37601
  init_useEventBus();
38197
- init_useTranslate();
38198
37602
  ReactMarkdown2 = React79.lazy(() => import('react-markdown'));
38199
37603
  exports.DetailPanel = ({
38200
37604
  title: propTitle,
@@ -38214,7 +37618,7 @@ var init_DetailPanel = __esm({
38214
37618
  error
38215
37619
  }) => {
38216
37620
  const eventBus = useEventBus();
38217
- const { t } = useTranslate();
37621
+ const { t } = hooks.useTranslate();
38218
37622
  const isFieldDefArray = (arr) => {
38219
37623
  if (!arr || arr.length === 0) return false;
38220
37624
  const first = arr[0];
@@ -38707,7 +38111,7 @@ function CompactView({
38707
38111
  stateStyles,
38708
38112
  className
38709
38113
  }) {
38710
- const { t } = useTranslate();
38114
+ const { t } = hooks.useTranslate();
38711
38115
  const config = SIZE_CONFIG2[size || "md"];
38712
38116
  const currentTransitions = trait.transitions.filter((t2) => t2.from === trait.currentState);
38713
38117
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-container bg-card border border-border", className), gap: "sm", children: [
@@ -38743,7 +38147,7 @@ function FullView({
38743
38147
  stateStyles,
38744
38148
  className
38745
38149
  }) {
38746
- const { t } = useTranslate();
38150
+ const { t } = hooks.useTranslate();
38747
38151
  const config = SIZE_CONFIG2[size || "md"];
38748
38152
  const currentTransitions = trait.transitions.filter((t2) => t2.from === trait.currentState);
38749
38153
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-container bg-card border border-border", className), gap: "sm", children: [
@@ -38868,7 +38272,6 @@ var init_TraitStateViewer = __esm({
38868
38272
  "components/game/organisms/TraitStateViewer.tsx"() {
38869
38273
  "use client";
38870
38274
  init_cn();
38871
- init_useTranslate();
38872
38275
  init_Box();
38873
38276
  init_Typography();
38874
38277
  init_Stack();
@@ -38890,7 +38293,7 @@ function RuleEditor({
38890
38293
  disabled = false,
38891
38294
  className
38892
38295
  }) {
38893
- const { t } = useTranslate();
38296
+ const { t } = hooks.useTranslate();
38894
38297
  const handleWhenChange = React79.useCallback((e) => {
38895
38298
  onChange({ ...rule, whenEvent: e.target.value });
38896
38299
  }, [rule, onChange]);
@@ -38927,7 +38330,6 @@ var init_RuleEditor = __esm({
38927
38330
  "components/game/organisms/puzzles/event-handler/RuleEditor.tsx"() {
38928
38331
  init_atoms2();
38929
38332
  init_cn();
38930
- init_useTranslate();
38931
38333
  RuleEditor.displayName = "RuleEditor";
38932
38334
  }
38933
38335
  });
@@ -38937,7 +38339,7 @@ function ObjectRulePanel({
38937
38339
  disabled = false,
38938
38340
  className
38939
38341
  }) {
38940
- const { t } = useTranslate();
38342
+ const { t } = hooks.useTranslate();
38941
38343
  const maxRules = object.maxRules || 3;
38942
38344
  const canAdd = object.rules.length < maxRules;
38943
38345
  const handleRuleChange = React79.useCallback((index, updatedRule) => {
@@ -39002,7 +38404,6 @@ var init_ObjectRulePanel = __esm({
39002
38404
  "components/game/organisms/puzzles/event-handler/ObjectRulePanel.tsx"() {
39003
38405
  init_atoms2();
39004
38406
  init_cn();
39005
- init_useTranslate();
39006
38407
  init_TraitStateViewer();
39007
38408
  init_RuleEditor();
39008
38409
  nextRuleId = 1;
@@ -39015,7 +38416,7 @@ function EventLog({
39015
38416
  label,
39016
38417
  className
39017
38418
  }) {
39018
- const { t } = useTranslate();
38419
+ const { t } = hooks.useTranslate();
39019
38420
  const scrollRef = React79.useRef(null);
39020
38421
  React79.useEffect(() => {
39021
38422
  if (scrollRef.current) {
@@ -39047,7 +38448,6 @@ var init_EventLog = __esm({
39047
38448
  "components/game/organisms/puzzles/event-handler/EventLog.tsx"() {
39048
38449
  init_atoms2();
39049
38450
  init_cn();
39050
- init_useTranslate();
39051
38451
  STATUS_STYLES = {
39052
38452
  pending: "text-muted-foreground",
39053
38453
  active: "text-primary animate-pulse",
@@ -39071,7 +38471,7 @@ function EventHandlerBoard({
39071
38471
  className
39072
38472
  }) {
39073
38473
  const { emit } = useEventBus();
39074
- const { t } = useTranslate();
38474
+ const { t } = hooks.useTranslate();
39075
38475
  const resolved = Array.isArray(entity) ? entity[0] : entity;
39076
38476
  const entityObjects = resolved?.objects ?? [];
39077
38477
  const [objects, setObjects] = React79.useState(entityObjects);
@@ -39261,7 +38661,6 @@ var init_EventHandlerBoard = __esm({
39261
38661
  init_atoms2();
39262
38662
  init_cn();
39263
38663
  init_useEventBus();
39264
- init_useTranslate();
39265
38664
  init_TraitStateViewer();
39266
38665
  init_ObjectRulePanel();
39267
38666
  init_EventLog();
@@ -39331,7 +38730,6 @@ var init_FeatureGridOrganism = __esm({
39331
38730
  "use client";
39332
38731
  init_cn();
39333
38732
  init_useEventBus();
39334
- init_useTranslate();
39335
38733
  init_Stack();
39336
38734
  init_Typography();
39337
38735
  init_FeatureGrid();
@@ -39347,7 +38745,7 @@ var init_FeatureGridOrganism = __esm({
39347
38745
  subtitle
39348
38746
  }) => {
39349
38747
  const eventBus = useEventBus();
39350
- const { t } = useTranslate();
38748
+ const { t } = hooks.useTranslate();
39351
38749
  const items = React79.useMemo(
39352
38750
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
39353
38751
  [entity]
@@ -39514,7 +38912,6 @@ var init_Form = __esm({
39514
38912
  init_RelationSelect();
39515
38913
  init_Alert();
39516
38914
  init_useEventBus();
39517
- init_useTranslate();
39518
38915
  init_debug();
39519
38916
  layoutStyles = {
39520
38917
  vertical: "flex flex-col",
@@ -39565,7 +38962,7 @@ var init_Form = __esm({
39565
38962
  ...props
39566
38963
  }) => {
39567
38964
  const eventBus = useEventBus();
39568
- const { t } = useTranslate();
38965
+ const { t } = hooks.useTranslate();
39569
38966
  const resolvedSubmitLabel = submitLabel ?? t("common.save");
39570
38967
  const resolvedCancelLabel = cancelLabel ?? t("common.cancel");
39571
38968
  const isSchemaEntity = isOrbitalEntitySchema(entity);
@@ -40681,7 +40078,6 @@ var init_HeroOrganism = __esm({
40681
40078
  "use client";
40682
40079
  init_cn();
40683
40080
  init_useEventBus();
40684
- init_useTranslate();
40685
40081
  init_HeroSection();
40686
40082
  init_LoadingState();
40687
40083
  init_ErrorState();
@@ -40693,7 +40089,7 @@ var init_HeroOrganism = __esm({
40693
40089
  children
40694
40090
  }) => {
40695
40091
  const eventBus = useEventBus();
40696
- const { t } = useTranslate();
40092
+ const { t } = hooks.useTranslate();
40697
40093
  const resolved = React79.useMemo(
40698
40094
  () => Array.isArray(entity) ? entity[0] : entity && typeof entity === "object" ? entity : void 0,
40699
40095
  [entity]
@@ -40787,7 +40183,6 @@ exports.LandingPageTemplate = void 0;
40787
40183
  var init_LandingPageTemplate = __esm({
40788
40184
  "components/marketing/templates/LandingPageTemplate.tsx"() {
40789
40185
  init_cn();
40790
- init_useTranslate();
40791
40186
  init_Stack();
40792
40187
  init_Box();
40793
40188
  init_Container();
@@ -40805,7 +40200,7 @@ var init_LandingPageTemplate = __esm({
40805
40200
  featureColumns = 3,
40806
40201
  className
40807
40202
  }) => {
40808
- const { t } = useTranslate();
40203
+ const { t } = hooks.useTranslate();
40809
40204
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
40810
40205
  if (!resolved) return null;
40811
40206
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -40987,7 +40382,6 @@ var init_List = __esm({
40987
40382
  init_cn();
40988
40383
  init_getNestedValue();
40989
40384
  init_useEventBus();
40990
- init_useTranslate();
40991
40385
  init_types3();
40992
40386
  STATUS_STYLES2 = {
40993
40387
  complete: {
@@ -41112,7 +40506,7 @@ var init_List = __esm({
41112
40506
  entityType
41113
40507
  }) => {
41114
40508
  const eventBus = useEventBus();
41115
- const { t } = useTranslate();
40509
+ const { t } = hooks.useTranslate();
41116
40510
  const resolvedEmptyMessage = emptyMessage ?? t("empty.noData");
41117
40511
  const effectiveFieldNames = normalizeFields2(fields).length > 0 ? normalizeFields2(fields) : fieldNames;
41118
40512
  const rawItems = React79.useMemo(() => {
@@ -41459,7 +40853,7 @@ function MasterDetail({
41459
40853
  className,
41460
40854
  ...rest
41461
40855
  }) {
41462
- const { t } = useTranslate();
40856
+ const { t } = hooks.useTranslate();
41463
40857
  const loading = externalLoading ?? false;
41464
40858
  const isLoading = externalIsLoading ?? false;
41465
40859
  const error = externalError ?? null;
@@ -41482,7 +40876,6 @@ var init_MasterDetail = __esm({
41482
40876
  "components/core/organisms/MasterDetail.tsx"() {
41483
40877
  "use client";
41484
40878
  init_DataTable();
41485
- init_useTranslate();
41486
40879
  MasterDetail.displayName = "MasterDetail";
41487
40880
  }
41488
40881
  });
@@ -41491,9 +40884,8 @@ var init_MasterDetailLayout = __esm({
41491
40884
  "components/core/organisms/layout/MasterDetailLayout.tsx"() {
41492
40885
  init_cn();
41493
40886
  init_Typography();
41494
- init_useTranslate();
41495
40887
  DefaultEmptyDetail = () => {
41496
- const { t } = useTranslate();
40888
+ const { t } = hooks.useTranslate();
41497
40889
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center h-full border-2 border-dashed border-border", children: /* @__PURE__ */ jsxRuntime.jsx(
41498
40890
  exports.Typography,
41499
40891
  {
@@ -41552,7 +40944,6 @@ var init_MediaGallery = __esm({
41552
40944
  init_ErrorState();
41553
40945
  init_EmptyState();
41554
40946
  init_useEventBus();
41555
- init_useTranslate();
41556
40947
  COLUMN_CLASSES = {
41557
40948
  2: "grid-cols-2",
41558
40949
  3: "grid-cols-2 sm:grid-cols-3",
@@ -41581,7 +40972,7 @@ var init_MediaGallery = __esm({
41581
40972
  className
41582
40973
  }) => {
41583
40974
  const eventBus = useEventBus();
41584
- const { t } = useTranslate();
40975
+ const { t } = hooks.useTranslate();
41585
40976
  const [lightboxItem, setLightboxItem] = React79.useState(null);
41586
40977
  const closeLightbox = React79.useCallback(() => setLightboxItem(null), []);
41587
40978
  useEventListener("UI:LIGHTBOX_CLOSE", closeLightbox);
@@ -41916,7 +41307,7 @@ function NegotiatorBoard({
41916
41307
  className
41917
41308
  }) {
41918
41309
  const { emit } = useEventBus();
41919
- const { t } = useTranslate();
41310
+ const { t } = hooks.useTranslate();
41920
41311
  const resolved = Array.isArray(entity) ? entity[0] : entity;
41921
41312
  const [history, setHistory] = React79.useState([]);
41922
41313
  const [headerError, setHeaderError] = React79.useState(false);
@@ -42046,7 +41437,6 @@ var init_NegotiatorBoard = __esm({
42046
41437
  "components/game/organisms/puzzles/negotiator/NegotiatorBoard.tsx"() {
42047
41438
  init_atoms2();
42048
41439
  init_useEventBus();
42049
- init_useTranslate();
42050
41440
  NegotiatorBoard.displayName = "NegotiatorBoard";
42051
41441
  }
42052
41442
  });
@@ -42056,7 +41446,6 @@ var init_PricingOrganism = __esm({
42056
41446
  "use client";
42057
41447
  init_cn();
42058
41448
  init_useEventBus();
42059
- init_useTranslate();
42060
41449
  init_Stack();
42061
41450
  init_Typography();
42062
41451
  init_PricingGrid();
@@ -42071,7 +41460,7 @@ var init_PricingOrganism = __esm({
42071
41460
  subtitle
42072
41461
  }) => {
42073
41462
  useEventBus();
42074
- const { t } = useTranslate();
41463
+ const { t } = hooks.useTranslate();
42075
41464
  const items = React79.useMemo(
42076
41465
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
42077
41466
  [entity]
@@ -42106,7 +41495,6 @@ exports.PricingPageTemplate = void 0;
42106
41495
  var init_PricingPageTemplate = __esm({
42107
41496
  "components/marketing/templates/PricingPageTemplate.tsx"() {
42108
41497
  init_cn();
42109
- init_useTranslate();
42110
41498
  init_Stack();
42111
41499
  init_Box();
42112
41500
  init_Container();
@@ -42119,7 +41507,7 @@ var init_PricingPageTemplate = __esm({
42119
41507
  entity,
42120
41508
  className
42121
41509
  }) => {
42122
- const { t } = useTranslate();
41510
+ const { t } = hooks.useTranslate();
42123
41511
  const resolved = entity && typeof entity === "object" && !Array.isArray(entity) ? entity : void 0;
42124
41512
  if (!resolved) return null;
42125
41513
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { gap: "none", className: cn("w-full", className), children: [
@@ -42273,13 +41661,13 @@ function getEntitySnapshot() {
42273
41661
  if (!entityProvider) {
42274
41662
  return null;
42275
41663
  }
42276
- const entities2 = entityProvider();
41664
+ const entities = entityProvider();
42277
41665
  return {
42278
- entities: entities2,
41666
+ entities,
42279
41667
  timestamp: Date.now(),
42280
- totalCount: entities2.length,
41668
+ totalCount: entities.length,
42281
41669
  singletons: {},
42282
- runtime: entities2.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
41670
+ runtime: entities.map((e) => ({ id: e.id, type: e.type, data: e.fields })),
42283
41671
  persistent: {}
42284
41672
  };
42285
41673
  }
@@ -42647,7 +42035,7 @@ var init_WalkMinimap = __esm({
42647
42035
  }
42648
42036
  });
42649
42037
  function TraitsTab({ traits: traits2 }) {
42650
- const { t } = useTranslate();
42038
+ const { t } = hooks.useTranslate();
42651
42039
  if (traits2.length === 0) {
42652
42040
  return /* @__PURE__ */ jsxRuntime.jsx(
42653
42041
  exports.EmptyState,
@@ -42715,12 +42103,11 @@ var init_TraitsTab = __esm({
42715
42103
  init_Typography();
42716
42104
  init_Stack();
42717
42105
  init_EmptyState();
42718
- init_useTranslate();
42719
42106
  TraitsTab.displayName = "TraitsTab";
42720
42107
  }
42721
42108
  });
42722
42109
  function TicksTab({ ticks: ticks2 }) {
42723
- const { t } = useTranslate();
42110
+ const { t } = hooks.useTranslate();
42724
42111
  const activeTicks = ticks2.filter((t2) => t2.active);
42725
42112
  const inactiveTicks = ticks2.filter((t2) => !t2.active);
42726
42113
  if (ticks2.length === 0) {
@@ -42793,12 +42180,11 @@ var init_TicksTab = __esm({
42793
42180
  init_Stack();
42794
42181
  init_Card();
42795
42182
  init_EmptyState();
42796
- init_useTranslate();
42797
42183
  TicksTab.displayName = "TicksTab";
42798
42184
  }
42799
42185
  });
42800
42186
  function EntitiesTab({ snapshot }) {
42801
- const { t } = useTranslate();
42187
+ const { t } = hooks.useTranslate();
42802
42188
  if (!snapshot) {
42803
42189
  return /* @__PURE__ */ jsxRuntime.jsx(
42804
42190
  exports.EmptyState,
@@ -42867,12 +42253,11 @@ var init_EntitiesTab = __esm({
42867
42253
  init_Typography();
42868
42254
  init_Stack();
42869
42255
  init_EmptyState();
42870
- init_useTranslate();
42871
42256
  EntitiesTab.displayName = "EntitiesTab";
42872
42257
  }
42873
42258
  });
42874
42259
  function EventFlowTab({ events: events2 }) {
42875
- const { t } = useTranslate();
42260
+ const { t } = hooks.useTranslate();
42876
42261
  const [filter, setFilter] = React79__namespace.useState("all");
42877
42262
  const containerRef = React79__namespace.useRef(null);
42878
42263
  const [autoScroll, setAutoScroll] = React79__namespace.useState(true);
@@ -42984,7 +42369,6 @@ var init_EventFlowTab = __esm({
42984
42369
  init_Button();
42985
42370
  init_Checkbox();
42986
42371
  init_EmptyState();
42987
- init_useTranslate();
42988
42372
  TYPE_BADGES = {
42989
42373
  trait: { variant: "primary", icon: "\u{1F504}" },
42990
42374
  tick: { variant: "warning", icon: "\u23F1\uFE0F" },
@@ -42997,7 +42381,7 @@ var init_EventFlowTab = __esm({
42997
42381
  }
42998
42382
  });
42999
42383
  function GuardsPanel({ guards }) {
43000
- const { t } = useTranslate();
42384
+ const { t } = hooks.useTranslate();
43001
42385
  const [filter, setFilter] = React79__namespace.useState("all");
43002
42386
  if (guards.length === 0) {
43003
42387
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -43079,12 +42463,11 @@ var init_GuardsPanel = __esm({
43079
42463
  init_ButtonGroup();
43080
42464
  init_Button();
43081
42465
  init_EmptyState();
43082
- init_useTranslate();
43083
42466
  GuardsPanel.displayName = "GuardsPanel";
43084
42467
  }
43085
42468
  });
43086
42469
  function VerificationTab({ checks, summary }) {
43087
- const { t } = useTranslate();
42470
+ const { t } = hooks.useTranslate();
43088
42471
  if (checks.length === 0) {
43089
42472
  return /* @__PURE__ */ jsxRuntime.jsx(
43090
42473
  exports.EmptyState,
@@ -43155,7 +42538,6 @@ var init_VerificationTab = __esm({
43155
42538
  init_Typography();
43156
42539
  init_Stack();
43157
42540
  init_EmptyState();
43158
- init_useTranslate();
43159
42541
  STATUS_CONFIG = {
43160
42542
  pass: { variant: "success", icon: "\u2713", label: "PASS" },
43161
42543
  fail: { variant: "danger", icon: "\u2717", label: "FAIL" },
@@ -43175,7 +42557,7 @@ function EffectBadge({ effect }) {
43175
42557
  ] });
43176
42558
  }
43177
42559
  function TransitionTimeline({ transitions }) {
43178
- const { t } = useTranslate();
42560
+ const { t } = hooks.useTranslate();
43179
42561
  const containerRef = React79__namespace.useRef(null);
43180
42562
  const [autoScroll, setAutoScroll] = React79__namespace.useState(true);
43181
42563
  const [expandedId, setExpandedId] = React79__namespace.useState(null);
@@ -43291,7 +42673,6 @@ var init_TransitionTimeline = __esm({
43291
42673
  init_Typography();
43292
42674
  init_EmptyState();
43293
42675
  init_Checkbox();
43294
- init_useTranslate();
43295
42676
  EFFECT_STATUS_VARIANT = {
43296
42677
  executed: "success",
43297
42678
  failed: "danger",
@@ -43307,7 +42688,7 @@ function StatRow({ label, value, variant }) {
43307
42688
  ] });
43308
42689
  }
43309
42690
  function ServerBridgeTab({ bridge }) {
43310
- const { t } = useTranslate();
42691
+ const { t } = hooks.useTranslate();
43311
42692
  if (!bridge) {
43312
42693
  return /* @__PURE__ */ jsxRuntime.jsx(
43313
42694
  exports.EmptyState,
@@ -43381,7 +42762,6 @@ var init_ServerBridgeTab = __esm({
43381
42762
  init_Stack();
43382
42763
  init_Card();
43383
42764
  init_EmptyState();
43384
- init_useTranslate();
43385
42765
  ServerBridgeTab.displayName = "ServerBridgeTab";
43386
42766
  }
43387
42767
  });
@@ -43460,8 +42840,8 @@ function getAllEvents(traits2) {
43460
42840
  }
43461
42841
  function EventDispatcherTab({ traits: traits2, schema }) {
43462
42842
  const eventBus = useEventBus();
43463
- const { t } = useTranslate();
43464
- const [log18, setLog] = React79__namespace.useState([]);
42843
+ const { t } = hooks.useTranslate();
42844
+ const [log8, setLog] = React79__namespace.useState([]);
43465
42845
  const prevStatesRef = React79__namespace.useRef(/* @__PURE__ */ new Map());
43466
42846
  React79__namespace.useEffect(() => {
43467
42847
  for (const trait of traits2) {
@@ -43525,9 +42905,9 @@ function EventDispatcherTab({ traits: traits2, schema }) {
43525
42905
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.otherEvents") }),
43526
42906
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1", children: unavailableEvents.map((event) => /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", className: "opacity-50", children: event }, event)) })
43527
42907
  ] }),
43528
- log18.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
42908
+ log8.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
43529
42909
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: "medium", className: "text-gray-500 mb-1", children: t("debug.recentTransitions") }),
43530
- /* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children: log18.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(exports.Typography, { variant: "small", className: "font-mono text-xs", children: [
42910
+ /* @__PURE__ */ jsxRuntime.jsx(exports.Stack, { gap: "xs", children: log8.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(exports.Typography, { variant: "small", className: "font-mono text-xs", children: [
43531
42911
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-400", children: entry.traitName }),
43532
42912
  " ",
43533
42913
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: entry.from }),
@@ -43546,7 +42926,6 @@ var init_EventDispatcherTab = __esm({
43546
42926
  init_Stack();
43547
42927
  init_EmptyState();
43548
42928
  init_useEventBus();
43549
- init_useTranslate();
43550
42929
  EventDispatcherTab.displayName = "EventDispatcherTab";
43551
42930
  }
43552
42931
  });
@@ -43557,7 +42936,7 @@ var init_RuntimeDebugger = __esm({
43557
42936
  }
43558
42937
  });
43559
42938
  function ServerResponseRow({ sr }) {
43560
- const { t } = useTranslate();
42939
+ const { t } = hooks.useTranslate();
43561
42940
  const entityEntries = Object.entries(sr.dataEntities);
43562
42941
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 pl-2 border-l border-purple-500/30 py-0.5 text-xs font-mono", children: [
43563
42942
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
@@ -43583,7 +42962,7 @@ function ServerResponseRow({ sr }) {
43583
42962
  ] });
43584
42963
  }
43585
42964
  function TransitionRow({ trace }) {
43586
- const { t } = useTranslate();
42965
+ const { t } = hooks.useTranslate();
43587
42966
  const isServerEntry = !!trace.serverResponse && trace.traitName.startsWith("server:");
43588
42967
  const hasFailedEffects = trace.effects.some((e) => e.status === "failed");
43589
42968
  if (isServerEntry && trace.serverResponse) {
@@ -43632,7 +43011,7 @@ function VerifyModePanel({
43632
43011
  serverCount,
43633
43012
  localCount
43634
43013
  }) {
43635
- const { t } = useTranslate();
43014
+ const { t } = hooks.useTranslate();
43636
43015
  const [expanded, setExpanded] = React79__namespace.useState(true);
43637
43016
  const scrollRef = React79__namespace.useRef(null);
43638
43017
  const prevCountRef = React79__namespace.useRef(0);
@@ -43692,7 +43071,7 @@ function RuntimeDebugger({
43692
43071
  defaultTab,
43693
43072
  schema
43694
43073
  }) {
43695
- const { t } = useTranslate();
43074
+ const { t } = hooks.useTranslate();
43696
43075
  const [isCollapsed, setIsCollapsed] = React79__namespace.useState(mode === "verify" ? true : defaultCollapsed);
43697
43076
  const [isVisible, setIsVisible] = React79__namespace.useState(mode === "inline" || mode === "verify" || isDebugEnabled2());
43698
43077
  const debugData = useDebugData();
@@ -43921,7 +43300,6 @@ var init_RuntimeDebugger2 = __esm({
43921
43300
  init_TransitionTimeline();
43922
43301
  init_ServerBridgeTab();
43923
43302
  init_EventDispatcherTab();
43924
- init_useTranslate();
43925
43303
  init_RuntimeDebugger();
43926
43304
  RuntimeDebugger.displayName = "RuntimeDebugger";
43927
43305
  }
@@ -44215,7 +43593,7 @@ function SequencerBoard({
44215
43593
  className
44216
43594
  }) {
44217
43595
  const { emit } = useEventBus();
44218
- const { t } = useTranslate();
43596
+ const { t } = hooks.useTranslate();
44219
43597
  const resolved = Array.isArray(entity) ? entity[0] : entity;
44220
43598
  const [headerError, setHeaderError] = React79.useState(false);
44221
43599
  const [slots, setSlots] = React79.useState(
@@ -44408,7 +43786,6 @@ var init_SequencerBoard = __esm({
44408
43786
  init_atoms2();
44409
43787
  init_cn();
44410
43788
  init_useEventBus();
44411
- init_useTranslate();
44412
43789
  init_TraitStateViewer();
44413
43790
  init_SequenceBar();
44414
43791
  init_ActionPalette();
@@ -44427,7 +43804,6 @@ var init_ShowcaseOrganism = __esm({
44427
43804
  "use client";
44428
43805
  init_cn();
44429
43806
  init_useEventBus();
44430
- init_useTranslate();
44431
43807
  init_Stack();
44432
43808
  init_Typography();
44433
43809
  init_SimpleGrid();
@@ -44444,7 +43820,7 @@ var init_ShowcaseOrganism = __esm({
44444
43820
  subtitle
44445
43821
  }) => {
44446
43822
  useEventBus();
44447
- const { t } = useTranslate();
43823
+ const { t } = hooks.useTranslate();
44448
43824
  const items = React79.useMemo(
44449
43825
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
44450
43826
  [entity]
@@ -44838,7 +44214,7 @@ function SimulatorBoard({
44838
44214
  className
44839
44215
  }) {
44840
44216
  const { emit } = useEventBus();
44841
- const { t } = useTranslate();
44217
+ const { t } = hooks.useTranslate();
44842
44218
  const resolved = Array.isArray(entity) ? entity[0] : entity;
44843
44219
  const parameters = resolved?.parameters ?? [];
44844
44220
  const [values, setValues] = React79.useState(() => {
@@ -44986,7 +44362,6 @@ var init_SimulatorBoard = __esm({
44986
44362
  "components/game/organisms/puzzles/simulator/SimulatorBoard.tsx"() {
44987
44363
  init_atoms2();
44988
44364
  init_useEventBus();
44989
- init_useTranslate();
44990
44365
  SimulatorBoard.displayName = "SimulatorBoard";
44991
44366
  }
44992
44367
  });
@@ -45202,7 +44577,6 @@ var init_StatCard = __esm({
45202
44577
  init_Button();
45203
44578
  init_Sparkline();
45204
44579
  init_useEventBus();
45205
- init_useTranslate();
45206
44580
  init_Icon();
45207
44581
  exports.StatCard = ({
45208
44582
  label: propLabel,
@@ -45229,7 +44603,7 @@ var init_StatCard = __esm({
45229
44603
  const Icon3 = typeof iconProp === "string" ? resolveIcon(iconProp) ?? void 0 : iconProp;
45230
44604
  const labelToUse = propLabel ?? propTitle;
45231
44605
  const eventBus = useEventBus();
45232
- const { t } = useTranslate();
44606
+ const { t } = hooks.useTranslate();
45233
44607
  const handleActionClick = React79__namespace.default.useCallback(() => {
45234
44608
  if (action?.event) {
45235
44609
  eventBus.emit(`UI:${action.event}`, {});
@@ -45520,7 +44894,7 @@ function VariablePanel({
45520
44894
  variables,
45521
44895
  className
45522
44896
  }) {
45523
- const { t } = useTranslate();
44897
+ const { t } = hooks.useTranslate();
45524
44898
  return /* @__PURE__ */ jsxRuntime.jsxs(exports.VStack, { className: cn("p-3 rounded-lg bg-card border border-border", className), gap: "sm", children: [
45525
44899
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body2", className: "text-muted-foreground font-medium", children: t("stateArchitect.variables", { name: entityName }) }),
45526
44900
  variables.map((v) => {
@@ -45558,7 +44932,6 @@ var init_VariablePanel = __esm({
45558
44932
  "components/game/organisms/puzzles/state-architect/VariablePanel.tsx"() {
45559
44933
  init_atoms2();
45560
44934
  init_cn();
45561
- init_useTranslate();
45562
44935
  VariablePanel.displayName = "VariablePanel";
45563
44936
  }
45564
44937
  });
@@ -45584,7 +44957,7 @@ function StateArchitectBoard({
45584
44957
  className
45585
44958
  }) {
45586
44959
  const { emit } = useEventBus();
45587
- const { t } = useTranslate();
44960
+ const { t } = hooks.useTranslate();
45588
44961
  const resolved = Array.isArray(entity) ? entity[0] : entity;
45589
44962
  const [transitions, setTransitions] = React79.useState(resolved?.transitions ?? []);
45590
44963
  const [headerError, setHeaderError] = React79.useState(false);
@@ -45875,7 +45248,6 @@ var init_StateArchitectBoard = __esm({
45875
45248
  init_atoms2();
45876
45249
  init_cn();
45877
45250
  init_useEventBus();
45878
- init_useTranslate();
45879
45251
  init_TraitStateViewer();
45880
45252
  init_StateNode();
45881
45253
  init_TransitionArrow();
@@ -45895,7 +45267,6 @@ var init_StatsOrganism = __esm({
45895
45267
  "components/marketing/organisms/StatsOrganism.tsx"() {
45896
45268
  "use client";
45897
45269
  init_cn();
45898
- init_useTranslate();
45899
45270
  init_StatsGrid();
45900
45271
  init_LoadingState();
45901
45272
  init_ErrorState();
@@ -45906,7 +45277,7 @@ var init_StatsOrganism = __esm({
45906
45277
  className,
45907
45278
  columns = 3
45908
45279
  }) => {
45909
- const { t } = useTranslate();
45280
+ const { t } = hooks.useTranslate();
45910
45281
  const items = React79.useMemo(
45911
45282
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
45912
45283
  [entity]
@@ -46009,7 +45380,6 @@ var init_StepFlowOrganism = __esm({
46009
45380
  "components/core/organisms/StepFlowOrganism.tsx"() {
46010
45381
  "use client";
46011
45382
  init_cn();
46012
- init_useTranslate();
46013
45383
  init_Stack();
46014
45384
  init_Typography();
46015
45385
  init_StepFlow();
@@ -46025,7 +45395,7 @@ var init_StepFlowOrganism = __esm({
46025
45395
  heading,
46026
45396
  subtitle
46027
45397
  }) => {
46028
- const { t } = useTranslate();
45398
+ const { t } = hooks.useTranslate();
46029
45399
  const items = React79.useMemo(
46030
45400
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
46031
45401
  [entity]
@@ -46179,7 +45549,6 @@ var init_TeamOrganism = __esm({
46179
45549
  "components/marketing/organisms/TeamOrganism.tsx"() {
46180
45550
  "use client";
46181
45551
  init_cn();
46182
- init_useTranslate();
46183
45552
  init_Stack();
46184
45553
  init_Typography();
46185
45554
  init_SimpleGrid();
@@ -46194,7 +45563,7 @@ var init_TeamOrganism = __esm({
46194
45563
  heading,
46195
45564
  subtitle
46196
45565
  }) => {
46197
- const { t } = useTranslate();
45566
+ const { t } = hooks.useTranslate();
46198
45567
  const items = React79.useMemo(
46199
45568
  () => Array.isArray(entity) ? entity : entity && typeof entity === "object" ? [entity] : [],
46200
45569
  [entity]
@@ -46237,7 +45606,6 @@ var init_Timeline = __esm({
46237
45606
  init_LoadingState();
46238
45607
  init_ErrorState();
46239
45608
  init_EmptyState();
46240
- init_useTranslate();
46241
45609
  lookStyles10 = {
46242
45610
  "vertical-compact": "gap-1 [&>*]:py-1",
46243
45611
  "vertical-spacious": "",
@@ -46277,7 +45645,7 @@ var init_Timeline = __esm({
46277
45645
  className,
46278
45646
  look = "vertical-spacious"
46279
45647
  }) => {
46280
- const { t } = useTranslate();
45648
+ const { t } = hooks.useTranslate();
46281
45649
  const entityData = Array.isArray(entity) ? entity : [];
46282
45650
  const items = React79__namespace.default.useMemo(() => {
46283
45651
  if (propItems) return propItems;
@@ -47847,7 +47215,7 @@ function UISlotComponent({
47847
47215
  }) {
47848
47216
  const { slots, clear } = context.useUISlots();
47849
47217
  const eventBus = useEventBus();
47850
- const { t } = useTranslate();
47218
+ const { t } = hooks.useTranslate();
47851
47219
  const suspenseConfig = React79.useContext(SuspenseConfigContext);
47852
47220
  const contained = React79.useContext(SlotContainedContext);
47853
47221
  const content = slots[slot];
@@ -47949,7 +47317,7 @@ function CompiledPortal({ slot, className, pattern, sourceTrait, children }) {
47949
47317
  const [portalRoot, setPortalRoot] = React79.useState(null);
47950
47318
  const slotsBus = context.useUISlots();
47951
47319
  const eventBus = useEventBus();
47952
- const { t } = useTranslate();
47320
+ const { t } = hooks.useTranslate();
47953
47321
  React79.useEffect(() => {
47954
47322
  setPortalRoot(getOrCreatePortalRoot());
47955
47323
  }, []);
@@ -48239,7 +47607,7 @@ function SlotContentRenderer({
48239
47607
  }
48240
47608
  }
48241
47609
  const eventBus = useEventBus();
48242
- const { t } = useTranslate();
47610
+ const { t } = hooks.useTranslate();
48243
47611
  const schemaCtx = useEntitySchemaOptional();
48244
47612
  let entityDef;
48245
47613
  if (typeof entityProp === "string" && entityProp.length > 0 && schemaCtx) {
@@ -48427,7 +47795,6 @@ var init_UISlotRenderer = __esm({
48427
47795
  init_Box();
48428
47796
  init_Typography();
48429
47797
  init_useEventBus();
48430
- init_useTranslate();
48431
47798
  init_slot_types();
48432
47799
  init_cn();
48433
47800
  init_ErrorBoundary();
@@ -49773,1625 +49140,7 @@ init_AboutPageTemplate();
49773
49140
 
49774
49141
  // components/index.ts
49775
49142
  init_cn();
49776
- var log8 = logger.createLogger("almadar:ui:orbital-history");
49777
- function useOrbitalHistory(options) {
49778
- const { appId, authToken, userId, onHistoryChange, onRevertSuccess } = options;
49779
- const getHeaders = React79.useCallback(() => {
49780
- const headers = {
49781
- "Content-Type": "application/json"
49782
- };
49783
- if (authToken) {
49784
- headers["Authorization"] = `Bearer ${authToken}`;
49785
- }
49786
- if (userId) {
49787
- headers["x-user-id"] = userId;
49788
- }
49789
- return headers;
49790
- }, [authToken, userId]);
49791
- const [timeline, setTimeline] = React79.useState([]);
49792
- const [currentVersion, setCurrentVersion] = React79.useState(1);
49793
- const [isLoading, setIsLoading] = React79.useState(false);
49794
- const [error, setError] = React79.useState(null);
49795
- const refresh = React79.useCallback(async () => {
49796
- if (!appId) return;
49797
- setIsLoading(true);
49798
- setError(null);
49799
- try {
49800
- const headers = getHeaders();
49801
- const [changesetsRes, snapshotsRes] = await Promise.all([
49802
- fetch(`/api/graphs/${appId}/history/changesets`, { headers }),
49803
- fetch(`/api/graphs/${appId}/history/snapshots`, { headers })
49804
- ]);
49805
- if (!changesetsRes.ok) {
49806
- throw new Error(`Failed to fetch changesets: ${changesetsRes.status}`);
49807
- }
49808
- if (!snapshotsRes.ok) {
49809
- throw new Error(`Failed to fetch snapshots: ${snapshotsRes.status}`);
49810
- }
49811
- const changesetsData = await changesetsRes.json();
49812
- const snapshotsData = await snapshotsRes.json();
49813
- const changesetItems = (changesetsData.changesets || []).map((cs) => ({
49814
- id: cs.id,
49815
- type: "changeset",
49816
- version: cs.version,
49817
- timestamp: cs.timestamp,
49818
- description: `Version ${cs.version}`,
49819
- source: cs.source,
49820
- summary: cs.summary
49821
- }));
49822
- const snapshotItems = (snapshotsData.snapshots || []).map((snap) => ({
49823
- id: snap.id,
49824
- type: "snapshot",
49825
- version: snap.version,
49826
- timestamp: snap.timestamp,
49827
- description: snap.reason || `Snapshot v${snap.version}`,
49828
- reason: snap.reason
49829
- }));
49830
- const mergedTimeline = [...changesetItems, ...snapshotItems].sort(
49831
- (a, b) => b.timestamp - a.timestamp
49832
- );
49833
- setTimeline(mergedTimeline);
49834
- if (mergedTimeline.length > 0) {
49835
- setCurrentVersion(mergedTimeline[0].version);
49836
- }
49837
- } catch (err) {
49838
- log8.error("Failed to load history", { error: err instanceof Error ? err : String(err) });
49839
- setError(err instanceof Error ? err.message : "Failed to load history");
49840
- } finally {
49841
- setIsLoading(false);
49842
- }
49843
- }, [appId, getHeaders]);
49844
- const revertToSnapshot = React79.useCallback(async (snapshotId) => {
49845
- if (!appId) {
49846
- return { success: false, error: "No app ID provided" };
49847
- }
49848
- try {
49849
- const response = await fetch(`/api/graphs/${appId}/history/revert/${snapshotId}`, {
49850
- method: "POST",
49851
- headers: getHeaders()
49852
- });
49853
- if (!response.ok) {
49854
- const errorData = await response.json().catch(() => ({}));
49855
- throw new Error(errorData.error || `Failed to revert: ${response.status}`);
49856
- }
49857
- const data = await response.json();
49858
- if (data.success && data.schema) {
49859
- await refresh();
49860
- onRevertSuccess?.(data.schema);
49861
- return {
49862
- success: true,
49863
- restoredSchema: data.schema
49864
- };
49865
- }
49866
- return {
49867
- success: false,
49868
- error: data.error || "Unknown error during revert"
49869
- };
49870
- } catch (err) {
49871
- log8.error("Failed to revert", { error: err instanceof Error ? err : String(err) });
49872
- return {
49873
- success: false,
49874
- error: err instanceof Error ? err.message : "Failed to revert"
49875
- };
49876
- }
49877
- }, [appId, getHeaders, refresh, onRevertSuccess]);
49878
- React79.useEffect(() => {
49879
- if (appId && authToken && userId) {
49880
- refresh();
49881
- }
49882
- }, [appId, authToken, userId]);
49883
- React79.useEffect(() => {
49884
- onHistoryChange?.(timeline);
49885
- }, [timeline]);
49886
- return {
49887
- timeline,
49888
- currentVersion,
49889
- isLoading,
49890
- error,
49891
- revertToSnapshot,
49892
- refresh
49893
- };
49894
- }
49895
- var log9 = logger.createLogger("almadar:ui:filesystem");
49896
- function useFileSystem() {
49897
- const [status, setStatus] = React79.useState("idle");
49898
- const [error, setError] = React79.useState(null);
49899
- const [isLoading, setIsLoading] = React79.useState(false);
49900
- const [files, setFiles] = React79.useState([]);
49901
- const [selectedFile, setSelectedFile] = React79.useState(null);
49902
- const [selectedPath, setSelectedPath] = React79.useState(null);
49903
- const [previewUrl, setPreviewUrl] = React79.useState(null);
49904
- const [fileContents, setFileContents] = React79.useState(/* @__PURE__ */ new Map());
49905
- const boot = React79.useCallback(async () => {
49906
- setStatus("booting");
49907
- setError(null);
49908
- setIsLoading(true);
49909
- try {
49910
- log9.debug("Booting WebContainer");
49911
- await new Promise((resolve) => setTimeout(resolve, 100));
49912
- setStatus("ready");
49913
- } catch (err) {
49914
- setError(err instanceof Error ? err.message : "Failed to boot");
49915
- setStatus("error");
49916
- } finally {
49917
- setIsLoading(false);
49918
- }
49919
- }, []);
49920
- const mountFiles = React79.useCallback(async (filesToMount) => {
49921
- setIsLoading(true);
49922
- try {
49923
- let filesArray;
49924
- if (Array.isArray(filesToMount)) {
49925
- filesArray = filesToMount;
49926
- } else {
49927
- filesArray = [];
49928
- const flattenTree = (obj, basePath = "") => {
49929
- for (const [key, value] of Object.entries(obj)) {
49930
- const path = basePath ? `${basePath}/${key}` : key;
49931
- if (value && typeof value === "object" && "file" in value) {
49932
- const fileObj = value;
49933
- filesArray.push({ path, content: fileObj.file.contents || "" });
49934
- } else if (value && typeof value === "object" && "directory" in value) {
49935
- const dirObj = value;
49936
- flattenTree(dirObj.directory, path);
49937
- }
49938
- }
49939
- };
49940
- flattenTree(filesToMount);
49941
- }
49942
- const newContents = /* @__PURE__ */ new Map();
49943
- for (const file of filesArray) {
49944
- newContents.set(file.path, file.content);
49945
- }
49946
- setFileContents(newContents);
49947
- const newTree = [];
49948
- for (const file of filesArray) {
49949
- const parts = file.path.split("/").filter(Boolean);
49950
- let current = newTree;
49951
- for (let i = 0; i < parts.length; i++) {
49952
- const part = parts[i];
49953
- const isFile = i === parts.length - 1;
49954
- const currentPath = "/" + parts.slice(0, i + 1).join("/");
49955
- let node = current.find((n) => n.name === part);
49956
- if (!node) {
49957
- node = {
49958
- path: currentPath,
49959
- name: part,
49960
- type: isFile ? "file" : "directory",
49961
- children: isFile ? void 0 : []
49962
- };
49963
- current.push(node);
49964
- }
49965
- if (!isFile && node && node.children) {
49966
- current = node.children;
49967
- }
49968
- }
49969
- }
49970
- setFiles(newTree);
49971
- setStatus("running");
49972
- } catch (err) {
49973
- log9.error("Failed to mount files", { error: err instanceof Error ? err : String(err) });
49974
- } finally {
49975
- setIsLoading(false);
49976
- }
49977
- }, []);
49978
- const readFile = React79.useCallback(async (path) => {
49979
- return fileContents.get(path) || "";
49980
- }, [fileContents]);
49981
- const writeFile = React79.useCallback(async (path, content) => {
49982
- setFileContents((prev) => {
49983
- const next = new Map(prev);
49984
- next.set(path, content);
49985
- return next;
49986
- });
49987
- }, []);
49988
- const selectFile = React79.useCallback(async (path) => {
49989
- const content = fileContents.get(path) || "";
49990
- const ext = path.split(".").pop()?.toLowerCase() || "";
49991
- const languageMap = {
49992
- ts: "typescript",
49993
- tsx: "typescript",
49994
- js: "javascript",
49995
- jsx: "javascript",
49996
- json: "json",
49997
- md: "markdown",
49998
- css: "css",
49999
- html: "html",
50000
- orb: "json"
50001
- };
50002
- setSelectedPath(path);
50003
- setSelectedFile({
50004
- path,
50005
- content,
50006
- language: languageMap[ext] || "plaintext",
50007
- isDirty: false
50008
- });
50009
- }, [fileContents]);
50010
- const updateContent = React79.useCallback((pathOrContent, contentArg) => {
50011
- const path = contentArg !== void 0 ? pathOrContent : selectedPath;
50012
- const content = contentArg !== void 0 ? contentArg : pathOrContent;
50013
- if (!path) {
50014
- log9.warn("updateContent called without path and no file selected");
50015
- return;
50016
- }
50017
- setFileContents((prev) => {
50018
- const next = new Map(prev);
50019
- next.set(path, content);
50020
- return next;
50021
- });
50022
- if (selectedPath === path) {
50023
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
50024
- }
50025
- }, [selectedPath]);
50026
- const updateSelectedContent = React79.useCallback((content) => {
50027
- setSelectedFile((prev) => prev ? { ...prev, content, isDirty: true } : null);
50028
- }, []);
50029
- const refreshTree = React79.useCallback(async () => {
50030
- log9.debug("Refreshing tree");
50031
- }, []);
50032
- const runCommand = React79.useCallback(async (command) => {
50033
- log9.debug("Running command", { command });
50034
- return { exitCode: 0, output: "" };
50035
- }, []);
50036
- const startDevServer = React79.useCallback(async () => {
50037
- log9.debug("Starting dev server");
50038
- setPreviewUrl("http://localhost:5173");
50039
- }, []);
50040
- return {
50041
- status,
50042
- error,
50043
- isLoading,
50044
- files,
50045
- selectedFile,
50046
- selectedPath,
50047
- previewUrl,
50048
- boot,
50049
- mountFiles,
50050
- readFile,
50051
- writeFile,
50052
- selectFile,
50053
- updateContent,
50054
- updateSelectedContent,
50055
- refreshTree,
50056
- runCommand,
50057
- startDevServer
50058
- };
50059
- }
50060
- var log10 = logger.createLogger("almadar:ui:extensions");
50061
- var defaultManifest = {
50062
- languages: {
50063
- typescript: { extensions: [".ts", ".tsx"], icon: "ts", color: "#3178c6" },
50064
- javascript: { extensions: [".js", ".jsx"], icon: "js", color: "#f7df1e" },
50065
- json: { extensions: [".json", ".orb"], icon: "json", color: "#000000" },
50066
- css: { extensions: [".css"], icon: "css", color: "#264de4" },
50067
- html: { extensions: [".html"], icon: "html", color: "#e34c26" },
50068
- markdown: { extensions: [".md", ".mdx"], icon: "md", color: "#083fa1" }
50069
- },
50070
- extensions: []
50071
- };
50072
- function useExtensions(options) {
50073
- const { appId, loadOnMount = true } = options;
50074
- const [extensions, setExtensions] = React79.useState([]);
50075
- const [manifest] = React79.useState(defaultManifest);
50076
- const [isLoading, setIsLoading] = React79.useState(false);
50077
- const [error, setError] = React79.useState(null);
50078
- const loadExtension = React79.useCallback(async (extensionId) => {
50079
- log10.debug("Loading extension", { extensionId });
50080
- }, []);
50081
- const loadExtensions = React79.useCallback(async () => {
50082
- setIsLoading(true);
50083
- setError(null);
50084
- try {
50085
- const defaultExtensions = [
50086
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50087
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50088
- { id: "json", name: "JSON", language: "json", loaded: true },
50089
- { id: "css", name: "CSS", language: "css", loaded: true },
50090
- { id: "html", name: "HTML", language: "html", loaded: true },
50091
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50092
- ];
50093
- setExtensions(defaultExtensions);
50094
- } catch (err) {
50095
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50096
- } finally {
50097
- setIsLoading(false);
50098
- }
50099
- }, []);
50100
- const getExtensionForFile = React79.useCallback((filename) => {
50101
- const ext = filename.split(".").pop()?.toLowerCase();
50102
- if (!ext) return null;
50103
- const languageMap = {
50104
- ts: "typescript",
50105
- tsx: "typescript",
50106
- js: "javascript",
50107
- jsx: "javascript",
50108
- json: "json",
50109
- md: "markdown",
50110
- css: "css",
50111
- html: "html",
50112
- orb: "json"
50113
- };
50114
- const language = languageMap[ext];
50115
- if (!language) return null;
50116
- return extensions.find((e) => e.language === language) || null;
50117
- }, [extensions]);
50118
- React79.useEffect(() => {
50119
- if (!appId || !loadOnMount) return;
50120
- const loadExtensions2 = async () => {
50121
- setIsLoading(true);
50122
- setError(null);
50123
- try {
50124
- const defaultExtensions = [
50125
- { id: "typescript", name: "TypeScript", language: "typescript", loaded: true },
50126
- { id: "javascript", name: "JavaScript", language: "javascript", loaded: true },
50127
- { id: "json", name: "JSON", language: "json", loaded: true },
50128
- { id: "css", name: "CSS", language: "css", loaded: true },
50129
- { id: "html", name: "HTML", language: "html", loaded: true },
50130
- { id: "markdown", name: "Markdown", language: "markdown", loaded: true }
50131
- ];
50132
- setExtensions(defaultExtensions);
50133
- } catch (err) {
50134
- setError(err instanceof Error ? err.message : "Failed to load extensions");
50135
- } finally {
50136
- setIsLoading(false);
50137
- }
50138
- };
50139
- loadExtensions2();
50140
- }, [appId, loadOnMount]);
50141
- return {
50142
- extensions,
50143
- manifest,
50144
- isLoading,
50145
- error,
50146
- loadExtension,
50147
- loadExtensions,
50148
- getExtensionForFile
50149
- };
50150
- }
50151
- var log11 = logger.createLogger("almadar:ui:file-editor");
50152
- function useFileEditor(options) {
50153
- const { extensions, fileSystem, onSchemaUpdate } = options;
50154
- const [openFiles, setOpenFiles] = React79.useState([]);
50155
- const [activeFilePath, setActiveFilePath] = React79.useState(null);
50156
- const [isSaving, setIsSaving] = React79.useState(false);
50157
- const activeFile = openFiles.find((f3) => f3.path === activeFilePath) || null;
50158
- const openFile = React79.useCallback(async (path) => {
50159
- const existing = openFiles.find((f3) => f3.path === path);
50160
- if (existing) {
50161
- setActiveFilePath(path);
50162
- return;
50163
- }
50164
- try {
50165
- const content = await fileSystem.readFile(path);
50166
- const ext = extensions.getExtensionForFile(path);
50167
- const newFile = {
50168
- path,
50169
- content,
50170
- isDirty: false,
50171
- language: ext?.language
50172
- };
50173
- setOpenFiles((prev) => [...prev, newFile]);
50174
- setActiveFilePath(path);
50175
- } catch (err) {
50176
- log11.error("Failed to open file", { error: err instanceof Error ? err : String(err) });
50177
- }
50178
- }, [openFiles, fileSystem, extensions]);
50179
- const closeFile = React79.useCallback((path) => {
50180
- setOpenFiles((prev) => prev.filter((f3) => f3.path !== path));
50181
- if (activeFilePath === path) {
50182
- const remaining = openFiles.filter((f3) => f3.path !== path);
50183
- setActiveFilePath(remaining.length > 0 ? remaining[0].path : null);
50184
- }
50185
- }, [activeFilePath, openFiles]);
50186
- const setActiveFile = React79.useCallback((path) => {
50187
- setActiveFilePath(path);
50188
- }, []);
50189
- const updateFileContent = React79.useCallback((path, content) => {
50190
- setOpenFiles(
50191
- (prev) => prev.map(
50192
- (f3) => f3.path === path ? { ...f3, content, isDirty: true } : f3
50193
- )
50194
- );
50195
- }, []);
50196
- const handleFileEdit = React79.useCallback(async (path, content) => {
50197
- try {
50198
- await fileSystem.writeFile(path, content);
50199
- let action = "saved";
50200
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50201
- try {
50202
- const schema = JSON.parse(content);
50203
- await onSchemaUpdate?.(schema);
50204
- action = "updated_schema";
50205
- } catch {
50206
- }
50207
- } else if (path.includes("/extensions/")) {
50208
- action = path.endsWith(".new") ? "converted_extension" : "saved_extension";
50209
- }
50210
- return { success: true, action };
50211
- } catch (err) {
50212
- return {
50213
- success: false,
50214
- error: err instanceof Error ? err.message : "Failed to save file"
50215
- };
50216
- }
50217
- }, [fileSystem, onSchemaUpdate]);
50218
- const saveFile = React79.useCallback(async (path) => {
50219
- const file = openFiles.find((f3) => f3.path === path);
50220
- if (!file) return;
50221
- setIsSaving(true);
50222
- try {
50223
- await fileSystem.writeFile(path, file.content);
50224
- setOpenFiles(
50225
- (prev) => prev.map(
50226
- (f3) => f3.path === path ? { ...f3, isDirty: false } : f3
50227
- )
50228
- );
50229
- if (path.endsWith(".orb") || path.endsWith("schema.json")) {
50230
- try {
50231
- const schema = JSON.parse(file.content);
50232
- await onSchemaUpdate?.(schema);
50233
- } catch {
50234
- }
50235
- }
50236
- } catch (err) {
50237
- log11.error("Failed to save file", { error: err instanceof Error ? err : String(err) });
50238
- } finally {
50239
- setIsSaving(false);
50240
- }
50241
- }, [openFiles, fileSystem, onSchemaUpdate]);
50242
- const saveAllFiles = React79.useCallback(async () => {
50243
- setIsSaving(true);
50244
- try {
50245
- const dirtyFiles = openFiles.filter((f3) => f3.isDirty);
50246
- for (const file of dirtyFiles) {
50247
- await saveFile(file.path);
50248
- }
50249
- } finally {
50250
- setIsSaving(false);
50251
- }
50252
- }, [openFiles, saveFile]);
50253
- return {
50254
- openFiles,
50255
- activeFile,
50256
- isSaving,
50257
- openFile,
50258
- closeFile,
50259
- setActiveFile,
50260
- updateFileContent,
50261
- handleFileEdit,
50262
- saveFile,
50263
- saveAllFiles
50264
- };
50265
- }
50266
- var log12 = logger.createLogger("almadar:ui:compile");
50267
- function useCompile() {
50268
- const [isCompiling, setIsCompiling] = React79.useState(false);
50269
- const [stage, setStage] = React79.useState("idle");
50270
- const [lastResult, setLastResult] = React79.useState(null);
50271
- const [error, setError] = React79.useState(null);
50272
- const compileSchema = React79.useCallback(async (schema) => {
50273
- setIsCompiling(true);
50274
- setStage("compiling");
50275
- setError(null);
50276
- try {
50277
- log12.debug("Compiling schema", { name: schema.name });
50278
- const result = {
50279
- success: true,
50280
- files: []
50281
- };
50282
- setLastResult(result);
50283
- setStage("done");
50284
- return result;
50285
- } catch (err) {
50286
- const errorMessage = err instanceof Error ? err.message : "Compilation failed";
50287
- setError(errorMessage);
50288
- setStage("error");
50289
- setLastResult({ success: false, errors: [errorMessage] });
50290
- return null;
50291
- } finally {
50292
- setIsCompiling(false);
50293
- }
50294
- }, []);
50295
- return {
50296
- isCompiling,
50297
- stage,
50298
- lastResult,
50299
- error,
50300
- compileSchema
50301
- };
50302
- }
50303
- var log13 = logger.createLogger("almadar:ui:preview");
50304
- function usePreview(options) {
50305
- const [previewUrl, setPreviewUrl] = React79.useState(null);
50306
- const [isLoading, setIsLoading] = React79.useState(!!options?.appId);
50307
- const [error, setError] = React79.useState(null);
50308
- const [loadError, setLoadError] = React79.useState(null);
50309
- const [app, setApp] = React79.useState(null);
50310
- const [isFullscreen, setIsFullscreen] = React79.useState(false);
50311
- const [isExecutingEvent, setIsExecutingEvent] = React79.useState(false);
50312
- const [errorToast, setErrorToast] = React79.useState(null);
50313
- const [currentStateName, setCurrentStateName] = React79.useState(null);
50314
- const [notificationsList, setNotificationsList] = React79.useState([]);
50315
- const [isPanelOpen, setIsPanelOpen] = React79.useState(false);
50316
- const notifications = React79.useMemo(() => ({
50317
- notifications: notificationsList,
50318
- isPanelOpen,
50319
- closePanel: () => setIsPanelOpen(false),
50320
- dismissNotification: (id) => {
50321
- setNotificationsList((prev) => prev.filter((n) => n.id !== id));
50322
- },
50323
- markAsRead: (id) => {
50324
- setNotificationsList(
50325
- (prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
50326
- );
50327
- },
50328
- clearAll: () => setNotificationsList([])
50329
- }), [notificationsList, isPanelOpen]);
50330
- React79.useEffect(() => {
50331
- const appId = options?.appId;
50332
- if (!appId) {
50333
- setApp(null);
50334
- setIsLoading(false);
50335
- return;
50336
- }
50337
- log13.debug("Setting up preview for app", { appId });
50338
- setPreviewUrl(`/api/orbitals/${appId}`);
50339
- setIsLoading(false);
50340
- }, [options?.appId]);
50341
- const startPreview = React79.useCallback(async () => {
50342
- log13.debug("startPreview called");
50343
- }, []);
50344
- const stopPreview = React79.useCallback(async () => {
50345
- setIsLoading(true);
50346
- try {
50347
- log13.debug("Stopping preview server");
50348
- setPreviewUrl(null);
50349
- setApp(null);
50350
- } finally {
50351
- setIsLoading(false);
50352
- }
50353
- }, []);
50354
- const refresh = React79.useCallback(async () => {
50355
- if (!previewUrl) return;
50356
- log13.debug("Refreshing preview");
50357
- setPreviewUrl(`${previewUrl.split("?")[0]}?t=${Date.now()}`);
50358
- }, [previewUrl]);
50359
- const handleRefresh = React79.useCallback(async () => {
50360
- log13.debug("Handle refresh");
50361
- await refresh();
50362
- }, [refresh]);
50363
- const handleReset = React79.useCallback(async () => {
50364
- log13.debug("Resetting preview");
50365
- setError(null);
50366
- setLoadError(null);
50367
- setErrorToast(null);
50368
- setIsExecutingEvent(false);
50369
- setCurrentStateName(null);
50370
- }, []);
50371
- const toggleFullscreen = React79.useCallback(() => {
50372
- setIsFullscreen((prev) => !prev);
50373
- }, []);
50374
- const dismissErrorToast = React79.useCallback(() => {
50375
- setErrorToast(null);
50376
- }, []);
50377
- return {
50378
- previewUrl,
50379
- isLoading,
50380
- error,
50381
- loadError,
50382
- app,
50383
- isFullscreen,
50384
- isExecutingEvent,
50385
- errorToast,
50386
- currentStateName,
50387
- notifications,
50388
- startPreview,
50389
- stopPreview,
50390
- refresh,
50391
- handleRefresh,
50392
- handleReset,
50393
- toggleFullscreen,
50394
- setErrorToast,
50395
- dismissErrorToast
50396
- };
50397
- }
50398
- var log14 = logger.createLogger("almadar:ui:agent-chat");
50399
- function useAgentChat(options) {
50400
- const [messages, setMessages] = React79.useState([]);
50401
- const [status, setStatus] = React79.useState("idle");
50402
- const [activities, setActivities] = React79.useState([]);
50403
- const [todos, setTodos] = React79.useState([]);
50404
- const [schemaDiffs, setSchemaDiffs] = React79.useState([]);
50405
- const [isLoading, setIsLoading] = React79.useState(false);
50406
- const [error, setError] = React79.useState(null);
50407
- const [threadId] = React79.useState(null);
50408
- const [interrupt, setInterrupt] = React79.useState(null);
50409
- const sendMessage = React79.useCallback(async (content) => {
50410
- setIsLoading(true);
50411
- setStatus("running");
50412
- setError(null);
50413
- try {
50414
- const userMessage = {
50415
- id: Date.now().toString(),
50416
- role: "user",
50417
- content,
50418
- timestamp: Date.now()
50419
- };
50420
- setMessages((prev) => [...prev, userMessage]);
50421
- log14.debug("Sending message", { content });
50422
- const assistantMessage = {
50423
- id: (Date.now() + 1).toString(),
50424
- role: "assistant",
50425
- content: "Agent chat is not yet implemented.",
50426
- timestamp: Date.now()
50427
- };
50428
- setMessages((prev) => [...prev, assistantMessage]);
50429
- setStatus("idle");
50430
- options?.onComplete?.();
50431
- } catch (err) {
50432
- setError(err instanceof Error ? err.message : "Failed to send message");
50433
- setStatus("error");
50434
- } finally {
50435
- setIsLoading(false);
50436
- }
50437
- }, [options]);
50438
- const startGeneration = React79.useCallback(async (skill, prompt, genOptions) => {
50439
- setStatus("running");
50440
- setIsLoading(true);
50441
- setError(null);
50442
- const skillName = Array.isArray(skill) ? skill[0] : skill;
50443
- try {
50444
- log14.debug("Starting generation", () => ({ skillName, prompt, genOptions: JSON.stringify(genOptions) }));
50445
- await new Promise((resolve) => setTimeout(resolve, 100));
50446
- setStatus("complete");
50447
- options?.onComplete?.();
50448
- } catch (err) {
50449
- setError(err instanceof Error ? err.message : "Generation failed");
50450
- setStatus("error");
50451
- } finally {
50452
- setIsLoading(false);
50453
- }
50454
- }, [options]);
50455
- const continueConversation = React79.useCallback(async (message) => {
50456
- log14.debug("Continue conversation", { message: Array.isArray(message) ? message : [message] });
50457
- }, []);
50458
- const resumeWithDecision = React79.useCallback(async (decisions) => {
50459
- log14.debug("Resume with decision", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50460
- setInterrupt(null);
50461
- }, []);
50462
- const cancel = React79.useCallback(() => {
50463
- setStatus("idle");
50464
- setIsLoading(false);
50465
- setInterrupt(null);
50466
- }, []);
50467
- const clearMessages = React79.useCallback(() => {
50468
- setMessages([]);
50469
- }, []);
50470
- const clearHistory = React79.useCallback(() => {
50471
- setMessages([]);
50472
- setActivities([]);
50473
- setTodos([]);
50474
- setSchemaDiffs([]);
50475
- setError(null);
50476
- }, []);
50477
- return {
50478
- messages,
50479
- status,
50480
- activities,
50481
- todos,
50482
- schemaDiffs,
50483
- isLoading,
50484
- error,
50485
- threadId,
50486
- interrupt,
50487
- sendMessage,
50488
- startGeneration,
50489
- continueConversation,
50490
- resumeWithDecision,
50491
- cancel,
50492
- clearMessages,
50493
- clearHistory
50494
- };
50495
- }
50496
- var log15 = logger.createLogger("almadar:ui:validation");
50497
- function useValidation() {
50498
- const [result, setResult] = React79.useState(null);
50499
- const [isValidating, setIsValidating] = React79.useState(false);
50500
- const [error, setError] = React79.useState(null);
50501
- const [stage, setStage] = React79.useState("idle");
50502
- const [isFixing, setIsFixing] = React79.useState(false);
50503
- const [progressMessage, setProgressMessage] = React79.useState(null);
50504
- const validate = React79.useCallback(async (appId) => {
50505
- setIsValidating(true);
50506
- setError(null);
50507
- setStage("validating");
50508
- setProgressMessage("Validating schema...");
50509
- try {
50510
- log15.debug("Validating app", { appId });
50511
- const validationResult = {
50512
- valid: true,
50513
- errors: [],
50514
- warnings: []
50515
- };
50516
- setResult(validationResult);
50517
- setStage("complete");
50518
- setProgressMessage(null);
50519
- return validationResult;
50520
- } catch (err) {
50521
- const errorMessage = err instanceof Error ? err.message : "Validation failed";
50522
- setError(errorMessage);
50523
- const failedResult = {
50524
- valid: false,
50525
- errors: [{ code: "VALIDATION_ERROR", message: errorMessage, severity: "error" }],
50526
- warnings: []
50527
- };
50528
- setResult(failedResult);
50529
- setStage("complete");
50530
- setProgressMessage(null);
50531
- return failedResult;
50532
- } finally {
50533
- setIsValidating(false);
50534
- }
50535
- }, []);
50536
- const clearResult = React79.useCallback(() => {
50537
- setResult(null);
50538
- setError(null);
50539
- }, []);
50540
- const reset = React79.useCallback(() => {
50541
- setResult(null);
50542
- setError(null);
50543
- setStage("idle");
50544
- setIsFixing(false);
50545
- setProgressMessage(null);
50546
- setIsValidating(false);
50547
- }, []);
50548
- return {
50549
- result,
50550
- isValidating,
50551
- error,
50552
- stage,
50553
- isFixing,
50554
- progressMessage,
50555
- errors: result?.errors ?? [],
50556
- warnings: result?.warnings ?? [],
50557
- isValid: result?.valid ?? false,
50558
- validate,
50559
- clearResult,
50560
- reset
50561
- };
50562
- }
50563
- var log16 = logger.createLogger("almadar:ui:deep-agent");
50564
- function useDeepAgentGeneration() {
50565
- const [requests, setRequests] = React79.useState([]);
50566
- const [currentRequest, setCurrentRequest] = React79.useState(null);
50567
- const [isGenerating, setIsGenerating] = React79.useState(false);
50568
- const [isLoading, setIsLoading] = React79.useState(false);
50569
- const [isComplete, setIsComplete] = React79.useState(false);
50570
- const [progress, setProgress] = React79.useState({ stage: "idle", percent: 0, message: "" });
50571
- const [error, setError] = React79.useState(null);
50572
- const [interrupt, setInterrupt] = React79.useState(null);
50573
- const generate = React79.useCallback(async (prompt) => {
50574
- setIsGenerating(true);
50575
- setIsLoading(true);
50576
- setIsComplete(false);
50577
- setError(null);
50578
- setProgress({ stage: "starting", percent: 0, message: "Starting generation..." });
50579
- const request = {
50580
- id: Date.now().toString(),
50581
- prompt,
50582
- status: "running"
50583
- };
50584
- setCurrentRequest(request);
50585
- setRequests((prev) => [...prev, request]);
50586
- try {
50587
- log16.debug("Generating from prompt", { prompt });
50588
- await new Promise((resolve) => setTimeout(resolve, 100));
50589
- request.status = "completed";
50590
- setCurrentRequest(request);
50591
- setIsComplete(true);
50592
- setProgress({ stage: "complete", percent: 100, message: "Generation complete" });
50593
- return null;
50594
- } catch (err) {
50595
- const errorMessage = err instanceof Error ? err.message : "Generation failed";
50596
- setError(errorMessage);
50597
- request.status = "failed";
50598
- request.error = errorMessage;
50599
- setCurrentRequest(request);
50600
- return null;
50601
- } finally {
50602
- setIsGenerating(false);
50603
- setIsLoading(false);
50604
- }
50605
- }, []);
50606
- const startGeneration = React79.useCallback(async (skill, prompt, _options) => {
50607
- log16.debug("Starting generation with skill", { skill });
50608
- await generate(prompt);
50609
- }, [generate]);
50610
- const cancelGeneration = React79.useCallback(() => {
50611
- if (currentRequest) {
50612
- currentRequest.status = "failed";
50613
- currentRequest.error = "Cancelled by user";
50614
- setCurrentRequest(null);
50615
- }
50616
- setIsGenerating(false);
50617
- setIsLoading(false);
50618
- setIsComplete(false);
50619
- setProgress({ stage: "idle", percent: 0, message: "" });
50620
- }, [currentRequest]);
50621
- const clearRequests = React79.useCallback(() => {
50622
- setRequests([]);
50623
- setCurrentRequest(null);
50624
- setError(null);
50625
- setProgress({ stage: "idle", percent: 0, message: "" });
50626
- setIsComplete(false);
50627
- }, []);
50628
- const submitInterruptDecisions = React79.useCallback((decisions) => {
50629
- log16.debug("Submitting interrupt decisions", () => ({ decisions: JSON.stringify(decisions), count: decisions.length }));
50630
- setInterrupt(null);
50631
- }, []);
50632
- return {
50633
- requests,
50634
- currentRequest,
50635
- isGenerating,
50636
- isLoading,
50637
- isComplete,
50638
- progress,
50639
- error,
50640
- interrupt,
50641
- generate,
50642
- startGeneration,
50643
- cancelGeneration,
50644
- clearRequests,
50645
- submitInterruptDecisions
50646
- };
50647
- }
50648
49143
 
50649
- // hooks/index.ts
50650
- init_useEventBus();
50651
- var log17 = logger.createLogger("almadar:ui:ui-slots");
50652
- var DEFAULT_SOURCE_KEY = "__default__";
50653
- var MULTI_SOURCE_STACK_TRAIT = "__multi_source_stack__";
50654
- var ALL_SLOTS2 = [
50655
- "main",
50656
- "sidebar",
50657
- "modal",
50658
- "drawer",
50659
- "overlay",
50660
- "center",
50661
- "toast",
50662
- "hud-top",
50663
- "hud-bottom",
50664
- "hud-left",
50665
- "hud-right",
50666
- "floating"
50667
- ];
50668
- var DEFAULT_SLOTS = ALL_SLOTS2.reduce(
50669
- (acc, slot) => {
50670
- acc[slot] = null;
50671
- return acc;
50672
- },
50673
- {}
50674
- );
50675
- var DEFAULT_SOURCES = ALL_SLOTS2.reduce(
50676
- (acc, slot) => {
50677
- acc[slot] = {};
50678
- return acc;
50679
- },
50680
- {}
50681
- );
50682
- var idCounter = 0;
50683
- function generateId() {
50684
- return `slot-content-${++idCounter}-${Date.now()}`;
50685
- }
50686
- function aggregateSlot(sources) {
50687
- if (!sources) return null;
50688
- const entries = Object.entries(sources);
50689
- if (entries.length === 0) return null;
50690
- if (entries.length === 1) return entries[0][1];
50691
- const children = entries.map(([, entry]) => ({
50692
- type: entry.pattern,
50693
- ...entry.props
50694
- }));
50695
- const stackId = `slot-content-stack-${entries.map(([k]) => k).join("-")}`;
50696
- return {
50697
- id: stackId,
50698
- pattern: "stack",
50699
- props: {
50700
- direction: "vertical",
50701
- gap: "lg",
50702
- children
50703
- },
50704
- priority: 0,
50705
- animation: "fade",
50706
- sourceTrait: MULTI_SOURCE_STACK_TRAIT
50707
- };
50708
- }
50709
- function useUISlotManager() {
50710
- const [sources, setSources] = React79.useState(DEFAULT_SOURCES);
50711
- const subscribersRef = React79.useRef(/* @__PURE__ */ new Set());
50712
- const timersRef = React79.useRef(/* @__PURE__ */ new Map());
50713
- const traitIndexRef = React79.useRef(/* @__PURE__ */ new Map());
50714
- const traitSubscribersRef = React79.useRef(/* @__PURE__ */ new Map());
50715
- const slots = React79.useMemo(() => {
50716
- const out = { ...DEFAULT_SLOTS };
50717
- for (const slot of ALL_SLOTS2) {
50718
- out[slot] = aggregateSlot(sources[slot]);
50719
- }
50720
- return out;
50721
- }, [sources]);
50722
- React79.useEffect(() => {
50723
- return () => {
50724
- timersRef.current.forEach((timer) => clearTimeout(timer));
50725
- timersRef.current.clear();
50726
- };
50727
- }, []);
50728
- const notifySubscribers = React79.useCallback((slot, content) => {
50729
- subscribersRef.current.forEach((callback) => {
50730
- try {
50731
- callback(slot, content);
50732
- } catch (error) {
50733
- log17.error("Subscriber error", { error: error instanceof Error ? error : String(error) });
50734
- }
50735
- });
50736
- }, []);
50737
- const notifyTraitSubscribers = React79.useCallback(
50738
- (traitName, content) => {
50739
- const subs = traitSubscribersRef.current.get(traitName);
50740
- if (!subs) return;
50741
- subs.forEach((callback) => {
50742
- try {
50743
- callback(content);
50744
- } catch (error) {
50745
- log17.error("Trait subscriber error", { traitName, error: error instanceof Error ? error : String(error) });
50746
- }
50747
- });
50748
- },
50749
- []
50750
- );
50751
- const indexTraitRender = React79.useCallback(
50752
- (traitName, content) => {
50753
- traitIndexRef.current.set(traitName, content);
50754
- },
50755
- []
50756
- );
50757
- const unindexTrait = React79.useCallback((traitName) => {
50758
- traitIndexRef.current.delete(traitName);
50759
- }, []);
50760
- const render = React79.useCallback(
50761
- (config) => {
50762
- const id = generateId();
50763
- const sourceKey = config.sourceTrait ?? DEFAULT_SOURCE_KEY;
50764
- const content = {
50765
- id,
50766
- pattern: config.pattern,
50767
- props: config.props ?? {},
50768
- priority: config.priority ?? 0,
50769
- animation: config.animation ?? "fade",
50770
- onDismiss: config.onDismiss,
50771
- sourceTrait: config.sourceTrait,
50772
- slot: config.target,
50773
- transitionEvent: config.transitionEvent,
50774
- fromState: config.fromState,
50775
- entity: config.entity
50776
- };
50777
- if (config.autoDismissMs && config.autoDismissMs > 0) {
50778
- content.autoDismissAt = Date.now() + config.autoDismissMs;
50779
- const timer = setTimeout(() => {
50780
- setSources((prev) => {
50781
- const slotSources = prev[config.target];
50782
- if (slotSources && slotSources[sourceKey]?.id === id) {
50783
- content.onDismiss?.();
50784
- const next = { ...slotSources };
50785
- delete next[sourceKey];
50786
- const updated = { ...prev, [config.target]: next };
50787
- notifySubscribers(config.target, aggregateSlot(next));
50788
- return updated;
50789
- }
50790
- return prev;
50791
- });
50792
- timersRef.current.delete(id);
50793
- }, config.autoDismissMs);
50794
- timersRef.current.set(id, timer);
50795
- }
50796
- setSources((prev) => {
50797
- const slotSources = prev[config.target] ?? {};
50798
- const existing = slotSources[sourceKey];
50799
- if (existing && existing.priority > content.priority) {
50800
- log17.warn("Slot already has higher priority content", {
50801
- slot: config.target,
50802
- sourceKey,
50803
- existingPriority: existing.priority,
50804
- newPriority: content.priority
50805
- });
50806
- return prev;
50807
- }
50808
- const nextSources = {
50809
- ...slotSources,
50810
- [sourceKey]: content
50811
- };
50812
- const nextAll = { ...prev, [config.target]: nextSources };
50813
- if (content.sourceTrait) {
50814
- indexTraitRender(content.sourceTrait, content);
50815
- notifyTraitSubscribers(content.sourceTrait, content);
50816
- }
50817
- log17.info("slot:written", {
50818
- slot: config.target,
50819
- sourceKey,
50820
- sourceTrait: content.sourceTrait,
50821
- patternType: content.pattern,
50822
- priority: content.priority
50823
- });
50824
- notifySubscribers(config.target, aggregateSlot(nextSources));
50825
- return nextAll;
50826
- });
50827
- return id;
50828
- },
50829
- [notifySubscribers, notifyTraitSubscribers, indexTraitRender]
50830
- );
50831
- const clear = React79.useCallback(
50832
- (slot) => {
50833
- setSources((prev) => {
50834
- const slotSources = prev[slot];
50835
- if (!slotSources || Object.keys(slotSources).length === 0) {
50836
- return prev;
50837
- }
50838
- for (const content of Object.values(slotSources)) {
50839
- const timer = timersRef.current.get(content.id);
50840
- if (timer) {
50841
- clearTimeout(timer);
50842
- timersRef.current.delete(content.id);
50843
- }
50844
- content.onDismiss?.();
50845
- if (content.sourceTrait) {
50846
- unindexTrait(content.sourceTrait);
50847
- notifyTraitSubscribers(content.sourceTrait, null);
50848
- }
50849
- }
50850
- notifySubscribers(slot, null);
50851
- return { ...prev, [slot]: {} };
50852
- });
50853
- },
50854
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50855
- );
50856
- const clearBySource = React79.useCallback(
50857
- (slot, sourceTrait) => {
50858
- const sourceKey = sourceTrait;
50859
- setSources((prev) => {
50860
- const slotSources = prev[slot];
50861
- if (!slotSources || !(sourceKey in slotSources)) {
50862
- log17.debug("slot:clear-noop", { slot, sourceTrait, reason: !slotSources ? "no-slot" : "no-source" });
50863
- return prev;
50864
- }
50865
- const content = slotSources[sourceKey];
50866
- const timer = timersRef.current.get(content.id);
50867
- if (timer) {
50868
- clearTimeout(timer);
50869
- timersRef.current.delete(content.id);
50870
- }
50871
- content.onDismiss?.();
50872
- if (content.sourceTrait) {
50873
- unindexTrait(content.sourceTrait);
50874
- notifyTraitSubscribers(content.sourceTrait, null);
50875
- }
50876
- const nextSources = { ...slotSources };
50877
- delete nextSources[sourceKey];
50878
- log17.info("slot:cleared", { slot, sourceTrait, lastPatternType: content.pattern });
50879
- notifySubscribers(slot, aggregateSlot(nextSources));
50880
- return { ...prev, [slot]: nextSources };
50881
- });
50882
- },
50883
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50884
- );
50885
- const clearById = React79.useCallback(
50886
- (id) => {
50887
- setSources((prev) => {
50888
- for (const slot of ALL_SLOTS2) {
50889
- const slotSources = prev[slot];
50890
- if (!slotSources) continue;
50891
- const matchKey = Object.keys(slotSources).find(
50892
- (k) => slotSources[k].id === id
50893
- );
50894
- if (!matchKey) continue;
50895
- const content = slotSources[matchKey];
50896
- const timer = timersRef.current.get(id);
50897
- if (timer) {
50898
- clearTimeout(timer);
50899
- timersRef.current.delete(id);
50900
- }
50901
- content.onDismiss?.();
50902
- if (content.sourceTrait) {
50903
- unindexTrait(content.sourceTrait);
50904
- notifyTraitSubscribers(content.sourceTrait, null);
50905
- }
50906
- const nextSources = { ...slotSources };
50907
- delete nextSources[matchKey];
50908
- notifySubscribers(slot, aggregateSlot(nextSources));
50909
- return { ...prev, [slot]: nextSources };
50910
- }
50911
- return prev;
50912
- });
50913
- },
50914
- [notifySubscribers, notifyTraitSubscribers, unindexTrait]
50915
- );
50916
- const clearAll = React79.useCallback(() => {
50917
- timersRef.current.forEach((timer) => clearTimeout(timer));
50918
- timersRef.current.clear();
50919
- setSources((prev) => {
50920
- for (const slot of ALL_SLOTS2) {
50921
- const slotSources = prev[slot];
50922
- if (!slotSources) continue;
50923
- for (const content of Object.values(slotSources)) {
50924
- content.onDismiss?.();
50925
- if (content.sourceTrait) {
50926
- notifyTraitSubscribers(content.sourceTrait, null);
50927
- }
50928
- }
50929
- notifySubscribers(slot, null);
50930
- }
50931
- return DEFAULT_SOURCES;
50932
- });
50933
- traitIndexRef.current.clear();
50934
- }, [notifySubscribers, notifyTraitSubscribers]);
50935
- const subscribe2 = React79.useCallback((callback) => {
50936
- subscribersRef.current.add(callback);
50937
- return () => {
50938
- subscribersRef.current.delete(callback);
50939
- };
50940
- }, []);
50941
- const hasContent = React79.useCallback(
50942
- (slot) => slots[slot] !== null,
50943
- [slots]
50944
- );
50945
- const getContent = React79.useCallback(
50946
- (slot) => slots[slot],
50947
- [slots]
50948
- );
50949
- const getTraitContent = React79.useCallback(
50950
- (traitName) => traitIndexRef.current.get(traitName) ?? null,
50951
- []
50952
- );
50953
- const subscribeTrait = React79.useCallback(
50954
- (traitName, callback) => {
50955
- let set = traitSubscribersRef.current.get(traitName);
50956
- if (!set) {
50957
- set = /* @__PURE__ */ new Set();
50958
- traitSubscribersRef.current.set(traitName, set);
50959
- }
50960
- set.add(callback);
50961
- return () => {
50962
- const s = traitSubscribersRef.current.get(traitName);
50963
- if (!s) return;
50964
- s.delete(callback);
50965
- if (s.size === 0) {
50966
- traitSubscribersRef.current.delete(traitName);
50967
- }
50968
- };
50969
- },
50970
- []
50971
- );
50972
- const updateTraitContent = React79.useCallback(
50973
- (traitName, content) => {
50974
- const id = generateId();
50975
- const fullContent = { ...content, id, sourceTrait: traitName };
50976
- indexTraitRender(traitName, fullContent);
50977
- notifyTraitSubscribers(traitName, fullContent);
50978
- return id;
50979
- },
50980
- [indexTraitRender, notifyTraitSubscribers]
50981
- );
50982
- return {
50983
- slots,
50984
- render,
50985
- clear,
50986
- clearBySource,
50987
- clearById,
50988
- clearAll,
50989
- subscribe: subscribe2,
50990
- hasContent,
50991
- getContent,
50992
- getTraitContent,
50993
- subscribeTrait,
50994
- updateTraitContent
50995
- };
50996
- }
50997
-
50998
- // hooks/useUIEvents.ts
50999
- init_useEventBus();
51000
- var UI_PREFIX = "UI:";
51001
- function useUIEvents(dispatch, traitName, validEvents, eventBusInstance) {
51002
- const defaultEventBus = useEventBus();
51003
- const eventBus = eventBusInstance ?? defaultEventBus;
51004
- const validEventsKey = validEvents.slice().sort().join(",");
51005
- const stableValidEvents = React79.useMemo(
51006
- () => validEvents,
51007
- [validEventsKey]
51008
- // intentional — validEventsKey is the stable dep
51009
- );
51010
- React79.useEffect(() => {
51011
- const unsubscribes = [];
51012
- for (const smEvent of stableValidEvents) {
51013
- const handler = (event) => {
51014
- if (event.source && event.source.dispatched) {
51015
- return;
51016
- }
51017
- dispatch(smEvent, event.payload);
51018
- };
51019
- unsubscribes.push(
51020
- eventBus.on(`${UI_PREFIX}${traitName}.${smEvent}`, handler)
51021
- );
51022
- }
51023
- return () => {
51024
- for (const unsub of unsubscribes) {
51025
- if (typeof unsub === "function") unsub();
51026
- }
51027
- };
51028
- }, [eventBus, dispatch, traitName, stableValidEvents]);
51029
- }
51030
- function useTraitListens(dispatch, listens, eventBusInstance) {
51031
- const defaultEventBus = useEventBus();
51032
- const eventBus = eventBusInstance ?? defaultEventBus;
51033
- const stableKey = listens.map((l) => `${l.sourceKey}->${l.trigger}`).sort().join("|");
51034
- const stableListens = React79.useMemo(
51035
- () => listens,
51036
- [stableKey]
51037
- // intentional
51038
- );
51039
- React79.useEffect(() => {
51040
- const unsubscribes = [];
51041
- for (const spec of stableListens) {
51042
- const handler = (event) => {
51043
- dispatch(spec.trigger, event.payload);
51044
- };
51045
- unsubscribes.push(eventBus.on(`${UI_PREFIX}${spec.sourceKey}`, handler));
51046
- }
51047
- return () => {
51048
- for (const unsub of unsubscribes) {
51049
- if (typeof unsub === "function") unsub();
51050
- }
51051
- };
51052
- }, [eventBus, dispatch, stableListens]);
51053
- }
51054
-
51055
- // hooks/index.ts
51056
- init_useQuerySingleton();
51057
-
51058
- // stores/entityStore.ts
51059
- var entities = /* @__PURE__ */ new Map();
51060
- var listeners7 = /* @__PURE__ */ new Set();
51061
- var idCounter2 = 0;
51062
- function subscribe(listener) {
51063
- listeners7.add(listener);
51064
- return () => listeners7.delete(listener);
51065
- }
51066
- function notify() {
51067
- listeners7.forEach((listener) => listener());
51068
- }
51069
- function getEntity(id) {
51070
- return entities.get(id);
51071
- }
51072
- function getByType(type) {
51073
- const types = Array.isArray(type) ? type : [type];
51074
- return [...entities.values()].filter((e) => types.includes(e.type));
51075
- }
51076
- function getAllEntities() {
51077
- return [...entities.values()];
51078
- }
51079
- function getSingleton(type) {
51080
- return [...entities.values()].find((e) => e.type === type);
51081
- }
51082
- function spawnEntity(config) {
51083
- const id = config.id ?? `entity_${++idCounter2}`;
51084
- const entity = { ...config, id };
51085
- entities = new Map(entities);
51086
- entities.set(id, entity);
51087
- notify();
51088
- return id;
51089
- }
51090
- function updateEntity(id, updates) {
51091
- const entity = entities.get(id);
51092
- if (entity) {
51093
- entities = new Map(entities);
51094
- entities.set(id, { ...entity, ...updates });
51095
- notify();
51096
- }
51097
- }
51098
- function updateSingleton(type, updates) {
51099
- const entity = getSingleton(type);
51100
- if (entity) {
51101
- updateEntity(entity.id, updates);
51102
- }
51103
- }
51104
- function removeEntity(id) {
51105
- if (entities.has(id)) {
51106
- entities = new Map(entities);
51107
- entities.delete(id);
51108
- notify();
51109
- }
51110
- }
51111
- function clearEntities() {
51112
- entities = /* @__PURE__ */ new Map();
51113
- notify();
51114
- }
51115
- function getSnapshot2() {
51116
- return entities;
51117
- }
51118
-
51119
- // hooks/useEntities.ts
51120
- function useEntities() {
51121
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51122
- return {
51123
- entities: entities2,
51124
- getEntity,
51125
- getByType,
51126
- getAllEntities,
51127
- getSingleton,
51128
- spawnEntity,
51129
- updateEntity,
51130
- updateSingleton,
51131
- removeEntity,
51132
- clearEntities
51133
- };
51134
- }
51135
- function useEntity(id) {
51136
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51137
- return entities2.get(id);
51138
- }
51139
- function useEntitiesByType(type) {
51140
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51141
- return [...entities2.values()].filter((e) => e.type === type);
51142
- }
51143
- function useSingletonEntity(type) {
51144
- const entities2 = React79.useSyncExternalStore(subscribe, getSnapshot2, getSnapshot2);
51145
- return [...entities2.values()].find((e) => e.type === type);
51146
- }
51147
- function usePlayer() {
51148
- const player = useSingletonEntity("Player");
51149
- const update = React79.useCallback((updates) => {
51150
- if (player) updateEntity(player.id, updates);
51151
- }, [player?.id]);
51152
- return { player, updatePlayer: update };
51153
- }
51154
- function usePhysics() {
51155
- const physics = useSingletonEntity("Physics");
51156
- const update = React79.useCallback((updates) => {
51157
- if (physics) updateEntity(physics.id, updates);
51158
- }, [physics?.id]);
51159
- return { physics, updatePhysics: update };
51160
- }
51161
- function useInput() {
51162
- const input = useSingletonEntity("Input");
51163
- const update = React79.useCallback((updates) => {
51164
- if (input) updateEntity(input.id, updates);
51165
- }, [input?.id]);
51166
- return { input, updateInput: update };
51167
- }
51168
-
51169
- // hooks/index.ts
51170
- init_useTranslate();
51171
- init_useAuthContext();
51172
- init_useSwipeGesture();
51173
- init_useLongPress();
51174
- init_useDragReorder();
51175
- init_useInfiniteScroll();
51176
- init_usePullToRefresh();
51177
- function getDistance(touches) {
51178
- const dx = touches[0].clientX - touches[1].clientX;
51179
- const dy = touches[0].clientY - touches[1].clientY;
51180
- return Math.sqrt(dx * dx + dy * dy);
51181
- }
51182
- function usePinchZoom(options = {}) {
51183
- const { minScale = 0.5, maxScale = 4 } = options;
51184
- const [scale, setScale] = React79.useState(1);
51185
- const [isPinching, setIsPinching] = React79.useState(false);
51186
- const initialDistance = React79.useRef(0);
51187
- const initialScale = React79.useRef(1);
51188
- const onTouchStart = React79.useCallback((e) => {
51189
- if (e.touches.length === 2) {
51190
- initialDistance.current = getDistance(e.touches);
51191
- initialScale.current = scale;
51192
- setIsPinching(true);
51193
- }
51194
- }, [scale]);
51195
- const onTouchMove = React79.useCallback((e) => {
51196
- if (e.touches.length !== 2 || !isPinching) return;
51197
- e.preventDefault();
51198
- const currentDistance = getDistance(e.touches);
51199
- const ratio = currentDistance / initialDistance.current;
51200
- const newScale = Math.min(maxScale, Math.max(minScale, initialScale.current * ratio));
51201
- setScale(newScale);
51202
- }, [isPinching, minScale, maxScale]);
51203
- const onTouchEnd = React79.useCallback(() => {
51204
- setIsPinching(false);
51205
- }, []);
51206
- const resetZoom = React79.useCallback(() => {
51207
- setScale(1);
51208
- }, []);
51209
- return {
51210
- scale,
51211
- isPinching,
51212
- gestureProps: {
51213
- onTouchStart,
51214
- onTouchMove,
51215
- onTouchEnd
51216
- },
51217
- resetZoom
51218
- };
51219
- }
51220
-
51221
- // hooks/useDraggable.ts
51222
- init_useEventBus();
51223
- var ALMADAR_DND_MIME = "application/x-almadar-dnd";
51224
- function useDraggable({ payload, disabled = false }) {
51225
- const [isDragging, setIsDragging] = React79.useState(false);
51226
- const eventBus = useEventBus();
51227
- const handleDragStart = React79.useCallback(
51228
- (e) => {
51229
- if (disabled) {
51230
- e.preventDefault();
51231
- return;
51232
- }
51233
- e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
51234
- e.dataTransfer.effectAllowed = "copy";
51235
- setIsDragging(true);
51236
- eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
51237
- },
51238
- [disabled, payload, eventBus]
51239
- );
51240
- const handleDragEnd = React79.useCallback(
51241
- (e) => {
51242
- setIsDragging(false);
51243
- eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
51244
- },
51245
- [payload, eventBus]
51246
- );
51247
- const dragProps = React79.useMemo(
51248
- () => ({
51249
- draggable: !disabled,
51250
- onDragStart: handleDragStart,
51251
- onDragEnd: handleDragEnd,
51252
- "aria-grabbed": isDragging
51253
- }),
51254
- [disabled, handleDragStart, handleDragEnd, isDragging]
51255
- );
51256
- return { dragProps, isDragging };
51257
- }
51258
-
51259
- // hooks/useDropZone.ts
51260
- init_useEventBus();
51261
- function parsePayload(e) {
51262
- try {
51263
- const raw = e.dataTransfer.getData(ALMADAR_DND_MIME);
51264
- if (!raw) return null;
51265
- const parsed = JSON.parse(raw);
51266
- if (typeof parsed.kind !== "string" || !parsed.data) return null;
51267
- return parsed;
51268
- } catch {
51269
- return null;
51270
- }
51271
- }
51272
- function hasAlmadarPayload(e) {
51273
- return e.dataTransfer.types.includes(ALMADAR_DND_MIME);
51274
- }
51275
- function useDropZone({ accepts, onDrop, disabled = false }) {
51276
- const [isOver, setIsOver] = React79.useState(false);
51277
- const eventBus = useEventBus();
51278
- const handleDragOver = React79.useCallback(
51279
- (e) => {
51280
- if (disabled) return;
51281
- if (!hasAlmadarPayload(e)) return;
51282
- e.preventDefault();
51283
- e.dataTransfer.dropEffect = "copy";
51284
- setIsOver(true);
51285
- },
51286
- [disabled]
51287
- );
51288
- const handleDragLeave = React79.useCallback(
51289
- (e) => {
51290
- setIsOver(false);
51291
- },
51292
- []
51293
- );
51294
- const handleDrop = React79.useCallback(
51295
- (e) => {
51296
- e.preventDefault();
51297
- setIsOver(false);
51298
- if (disabled) return;
51299
- const payload = parsePayload(e);
51300
- if (!payload) return;
51301
- if (!accepts.includes(payload.kind)) return;
51302
- const position = { x: e.clientX, y: e.clientY };
51303
- onDrop(payload, position);
51304
- eventBus.emit("UI:DROP", { kind: payload.kind, data: payload.data, ...position });
51305
- },
51306
- [disabled, accepts, onDrop, eventBus]
51307
- );
51308
- const dropProps = React79.useMemo(
51309
- () => ({
51310
- onDragOver: handleDragOver,
51311
- onDragLeave: handleDragLeave,
51312
- onDrop: handleDrop
51313
- }),
51314
- [handleDragOver, handleDragLeave, handleDrop]
51315
- );
51316
- return { dropProps, isOver };
51317
- }
51318
- var API_BASE = typeof process !== "undefined" && process.env?.VITE_API_URL ? process.env.VITE_API_URL : "http://localhost:3000";
51319
- function getUserId() {
51320
- return localStorage.getItem("userId") || "anonymous";
51321
- }
51322
- async function fetchWithAuth(endpoint, options) {
51323
- const userId = getUserId();
51324
- const response = await fetch(`${API_BASE}${endpoint}`, {
51325
- ...options,
51326
- headers: {
51327
- "Content-Type": "application/json",
51328
- "x-user-id": userId,
51329
- ...options?.headers
51330
- }
51331
- });
51332
- if (!response.ok) {
51333
- const error = await response.json().catch(() => ({ error: response.statusText }));
51334
- throw new Error(error.error || error.message || "Request failed");
51335
- }
51336
- return response.json();
51337
- }
51338
- function useGitHubStatus() {
51339
- return reactQuery.useQuery({
51340
- queryKey: ["github", "status"],
51341
- queryFn: () => fetchWithAuth("/api/github/status"),
51342
- staleTime: 6e4,
51343
- // 1 minute
51344
- retry: false
51345
- });
51346
- }
51347
- function useConnectGitHub() {
51348
- const connectGitHub = React79.useCallback(() => {
51349
- const userId = getUserId();
51350
- const state = btoa(JSON.stringify({ userId, returnUrl: window.location.href }));
51351
- window.location.href = `${API_BASE}/api/github/oauth/authorize?state=${state}`;
51352
- }, []);
51353
- return { connectGitHub };
51354
- }
51355
- function useDisconnectGitHub() {
51356
- const queryClient = reactQuery.useQueryClient();
51357
- return reactQuery.useMutation({
51358
- mutationFn: () => fetchWithAuth("/api/github/disconnect", { method: "POST" }),
51359
- onSuccess: () => {
51360
- queryClient.invalidateQueries({ queryKey: ["github", "status"] });
51361
- queryClient.removeQueries({ queryKey: ["github", "repos"] });
51362
- }
51363
- });
51364
- }
51365
- function useGitHubRepos(page = 1, perPage = 30) {
51366
- return reactQuery.useQuery({
51367
- queryKey: ["github", "repos", page, perPage],
51368
- queryFn: () => fetchWithAuth(`/api/github/repos?page=${page}&per_page=${perPage}`),
51369
- enabled: true,
51370
- // Only fetch if user is connected
51371
- staleTime: 3e5
51372
- // 5 minutes
51373
- });
51374
- }
51375
- function useGitHubRepo(owner, repo, enabled = true) {
51376
- return reactQuery.useQuery({
51377
- queryKey: ["github", "repo", owner, repo],
51378
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}`),
51379
- enabled: enabled && !!owner && !!repo,
51380
- staleTime: 3e5
51381
- // 5 minutes
51382
- });
51383
- }
51384
- function useGitHubBranches(owner, repo, enabled = true) {
51385
- return reactQuery.useQuery({
51386
- queryKey: ["github", "branches", owner, repo],
51387
- queryFn: () => fetchWithAuth(`/api/github/repos/${owner}/${repo}/branches`),
51388
- enabled: enabled && !!owner && !!repo,
51389
- staleTime: 6e4
51390
- // 1 minute
51391
- });
51392
- }
51393
-
51394
- exports.ALMADAR_DND_MIME = ALMADAR_DND_MIME;
51395
49144
  exports.ActionButton = ActionButton;
51396
49145
  exports.ActionButtons = ActionButtons;
51397
49146
  exports.ActionCard = Card2;
@@ -51412,7 +49161,6 @@ exports.CombatLog = CombatLog;
51412
49161
  exports.ComboCounter = ComboCounter;
51413
49162
  exports.ControlButton = ControlButton;
51414
49163
  exports.CraftingRecipe = CraftingRecipe;
51415
- exports.DEFAULT_SLOTS = DEFAULT_SLOTS;
51416
49164
  exports.DPad = DPad;
51417
49165
  exports.DamageNumber = DamageNumber;
51418
49166
  exports.DataGrid = DataGrid;
@@ -51506,80 +49254,36 @@ exports.applyTemporaryEffect = applyTemporaryEffect;
51506
49254
  exports.calculateAttackTargets = calculateAttackTargets;
51507
49255
  exports.calculateDamage = calculateDamage;
51508
49256
  exports.calculateValidMoves = calculateValidMoves;
51509
- exports.clearEntities = clearEntities;
51510
49257
  exports.cn = cn;
51511
49258
  exports.combatAnimations = combatAnimations;
51512
49259
  exports.combatClasses = combatClasses;
51513
49260
  exports.combatEffects = combatEffects;
51514
49261
  exports.createInitialGameState = createInitialGameState;
51515
- exports.createTranslate = createTranslate;
51516
49262
  exports.createUnitAnimationState = createUnitAnimationState;
51517
49263
  exports.drawSprite = drawSprite;
51518
49264
  exports.generateCombatMessage = generateCombatMessage;
51519
- exports.getAllEntities = getAllEntities;
51520
- exports.getByType = getByType;
51521
49265
  exports.getCurrentFrame = getCurrentFrame;
51522
- exports.getEntity = getEntity;
51523
- exports.getSingleton = getSingleton;
51524
49266
  exports.getTileDimensions = getTileDimensions;
51525
49267
  exports.inferDirection = inferDirection;
51526
49268
  exports.isoToScreen = isoToScreen;
51527
49269
  exports.mapBookData = mapBookData;
51528
- exports.parseQueryBinding = parseQueryBinding;
51529
- exports.removeEntity = removeEntity;
51530
49270
  exports.resolveFieldMap = resolveFieldMap;
51531
49271
  exports.resolveFrame = resolveFrame;
51532
49272
  exports.resolveSheetDirection = resolveSheetDirection;
51533
49273
  exports.screenToIso = screenToIso;
51534
- exports.spawnEntity = spawnEntity;
51535
49274
  exports.tickAnimationState = tickAnimationState;
51536
49275
  exports.transitionAnimation = transitionAnimation;
51537
- exports.updateEntity = updateEntity;
51538
- exports.updateSingleton = updateSingleton;
51539
- exports.useAgentChat = useAgentChat;
51540
49276
  exports.useAnchorRect = useAnchorRect;
51541
- exports.useAuthContext = useAuthContext;
51542
49277
  exports.useBattleState = useBattleState;
51543
49278
  exports.useCamera = useCamera;
51544
- exports.useCompile = useCompile;
51545
- exports.useConnectGitHub = useConnectGitHub;
51546
- exports.useDeepAgentGeneration = useDeepAgentGeneration;
51547
- exports.useDisconnectGitHub = useDisconnectGitHub;
51548
- exports.useDragReorder = useDragReorder;
51549
- exports.useDraggable = useDraggable;
51550
- exports.useDropZone = useDropZone;
51551
- exports.useEmitEvent = useEmitEvent;
51552
- exports.useEntities = useEntities;
51553
- exports.useEntitiesByType = useEntitiesByType;
51554
- exports.useEntityById = useEntity;
51555
- exports.useEventBus = useEventBus;
51556
- exports.useEventListener = useEventListener;
51557
- exports.useExtensions = useExtensions;
51558
- exports.useFileEditor = useFileEditor;
51559
- exports.useFileSystem = useFileSystem;
51560
49279
  exports.useGameAudio = useGameAudio;
51561
49280
  exports.useGameAudioContext = useGameAudioContext;
51562
- exports.useGitHubBranches = useGitHubBranches;
51563
- exports.useGitHubRepo = useGitHubRepo;
51564
- exports.useGitHubRepos = useGitHubRepos;
51565
- exports.useGitHubStatus = useGitHubStatus;
51566
49281
  exports.useImageCache = useImageCache;
51567
- exports.useInfiniteScroll = useInfiniteScroll;
51568
- exports.useInput = useInput;
51569
- exports.useLongPress = useLongPress;
51570
- exports.useOrbitalHistory = useOrbitalHistory;
51571
- exports.usePhysics = usePhysics;
51572
49282
  exports.usePhysics2D = usePhysics2D;
51573
- exports.usePinchZoom = usePinchZoom;
51574
- exports.usePlayer = usePlayer;
51575
- exports.usePreview = usePreview;
51576
- exports.usePullToRefresh = usePullToRefresh;
51577
- exports.useQuerySingleton = useQuerySingleton;
51578
- exports.useSingletonEntity = useSingletonEntity;
51579
49283
  exports.useSpriteAnimations = useSpriteAnimations;
51580
- exports.useSwipeGesture = useSwipeGesture;
51581
- exports.useTraitListens = useTraitListens;
51582
- exports.useTranslate = useTranslate;
51583
- exports.useUIEvents = useUIEvents;
51584
- exports.useUISlotManager = useUISlotManager;
51585
- exports.useValidation = useValidation;
49284
+ Object.keys(hooks).forEach(function (k) {
49285
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
49286
+ enumerable: true,
49287
+ get: function () { return hooks[k]; }
49288
+ });
49289
+ });