themed-markdown 0.1.82 → 0.1.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -151,7 +151,9 @@ var landingPageTheme = {
151
151
  textMuted: "#6b7280",
152
152
  highlightBg: "#403b0f",
153
153
  highlightBorder: "#80761e",
154
- textOnPrimary: "#000000"
154
+ textOnPrimary: "#000000",
155
+ textOnSecondary: "#ffffff",
156
+ textOnAccent: "#ffffff"
155
157
  },
156
158
  buttons: {
157
159
  primary: {
@@ -253,7 +255,9 @@ var landingPageLightTheme = {
253
255
  textMuted: "#aaaaaa",
254
256
  highlightBg: "#fff9c4",
255
257
  highlightBorder: "#fff389",
256
- textOnPrimary: "#ffffff"
258
+ textOnPrimary: "#ffffff",
259
+ textOnSecondary: "#000000",
260
+ textOnAccent: "#ffffff"
257
261
  },
258
262
  buttons: {
259
263
  primary: {
@@ -356,7 +360,9 @@ var regalTheme = {
356
360
  textMuted: "#8b7968",
357
361
  highlightBg: "#534724",
358
362
  highlightBorder: "#8c701a",
359
- textOnPrimary: "#1a1f2e"
363
+ textOnPrimary: "#1a1f2e",
364
+ textOnSecondary: "#1a1f2e",
365
+ textOnAccent: "#1a1f2e"
360
366
  },
361
367
  buttons: {
362
368
  primary: {
@@ -470,7 +476,9 @@ var terminalTheme = {
470
476
  textMuted: "#666666",
471
477
  highlightBg: "#40391e",
472
478
  highlightBorder: "#7f7530",
473
- textOnPrimary: "#ffffff"
479
+ textOnPrimary: "#ffffff",
480
+ textOnSecondary: "#0a0a0a",
481
+ textOnAccent: "#0a0a0a"
474
482
  },
475
483
  modes: {
476
484
  light: {
@@ -495,7 +503,10 @@ var terminalTheme = {
495
503
  textTertiary: "#999999",
496
504
  textMuted: "#b3b3b3",
497
505
  highlightBg: "#fff9c4",
498
- highlightBorder: "#fff389"
506
+ highlightBorder: "#fff389",
507
+ textOnPrimary: "#ffffff",
508
+ textOnSecondary: "#ffffff",
509
+ textOnAccent: "#ffffff"
499
510
  }
500
511
  },
501
512
  buttons: {
@@ -614,7 +625,9 @@ var matrixTheme = {
614
625
  textMuted: "#484848",
615
626
  highlightBg: "#00360d",
616
627
  highlightBorder: "#006c1b",
617
- textOnPrimary: "#000000"
628
+ textOnPrimary: "#000000",
629
+ textOnSecondary: "#000000",
630
+ textOnAccent: "#000000"
618
631
  },
619
632
  buttons: {
620
633
  primary: {
@@ -732,7 +745,9 @@ var matrixMinimalTheme = {
732
745
  textMuted: "#484848",
733
746
  highlightBg: "#002b0b",
734
747
  highlightBorder: "#005615",
735
- textOnPrimary: "#000000"
748
+ textOnPrimary: "#000000",
749
+ textOnSecondary: "#000000",
750
+ textOnAccent: "#000000"
736
751
  },
737
752
  buttons: {
738
753
  primary: {
@@ -850,7 +865,9 @@ var slateTheme = {
850
865
  textMuted: "#4b5563",
851
866
  highlightBg: "#513c19",
852
867
  highlightBorder: "#875d14",
853
- textOnPrimary: "#1a1c1e"
868
+ textOnPrimary: "#1a1c1e",
869
+ textOnSecondary: "#e5e7eb",
870
+ textOnAccent: "#1a1c1e"
854
871
  },
855
872
  buttons: {
856
873
  primary: {
@@ -4317,2784 +4334,9 @@ var IndustryMarkdownSlide = React13.memo(function IndustryMarkdownSlide2({
4317
4334
  theme: theme2
4318
4335
  }));
4319
4336
  });
4320
- // node_modules/@principal-ade/panels/dist/index.esm.js
4321
- import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
4322
- import r, { useState as o, useRef as i, useCallback as a, useEffect as l, forwardRef as s, useImperativeHandle as c, useMemo as d, useLayoutEffect as u, createContext as p, memo as h, useReducer as m, useContext as f } from "react";
4323
-
4324
- // node_modules/react-resizable-panels/dist/react-resizable-panels.browser.development.js
4325
- import * as React14 from "react";
4326
- import { createContext as createContext2, useLayoutEffect as useLayoutEffect2, useRef as useRef8, forwardRef, createElement, useContext as useContext2, useImperativeHandle, useState as useState10, useCallback as useCallback2, useEffect as useEffect8, useMemo as useMemo3 } from "react";
4327
- var PanelGroupContext = createContext2(null);
4328
- PanelGroupContext.displayName = "PanelGroupContext";
4329
- var DATA_ATTRIBUTES = {
4330
- group: "data-panel-group",
4331
- groupDirection: "data-panel-group-direction",
4332
- groupId: "data-panel-group-id",
4333
- panel: "data-panel",
4334
- panelCollapsible: "data-panel-collapsible",
4335
- panelId: "data-panel-id",
4336
- panelSize: "data-panel-size",
4337
- resizeHandle: "data-resize-handle",
4338
- resizeHandleActive: "data-resize-handle-active",
4339
- resizeHandleEnabled: "data-panel-resize-handle-enabled",
4340
- resizeHandleId: "data-panel-resize-handle-id",
4341
- resizeHandleState: "data-resize-handle-state"
4342
- };
4343
- var PRECISION = 10;
4344
- var useIsomorphicLayoutEffect = useLayoutEffect2;
4345
- var useId = React14["useId".toString()];
4346
- var wrappedUseId = typeof useId === "function" ? useId : () => null;
4347
- var counter = 0;
4348
- function useUniqueId(idFromParams = null) {
4349
- const idFromUseId = wrappedUseId();
4350
- const idRef = useRef8(idFromParams || idFromUseId || null);
4351
- if (idRef.current === null) {
4352
- idRef.current = "" + counter++;
4353
- }
4354
- return idFromParams !== null && idFromParams !== undefined ? idFromParams : idRef.current;
4355
- }
4356
- function PanelWithForwardedRef({
4357
- children,
4358
- className: classNameFromProps = "",
4359
- collapsedSize,
4360
- collapsible,
4361
- defaultSize,
4362
- forwardedRef,
4363
- id: idFromProps,
4364
- maxSize,
4365
- minSize,
4366
- onCollapse,
4367
- onExpand,
4368
- onResize,
4369
- order,
4370
- style: styleFromProps,
4371
- tagName: Type = "div",
4372
- ...rest
4373
- }) {
4374
- const context = useContext2(PanelGroupContext);
4375
- if (context === null) {
4376
- throw Error(`Panel components must be rendered within a PanelGroup container`);
4377
- }
4378
- const {
4379
- collapsePanel,
4380
- expandPanel,
4381
- getPanelSize,
4382
- getPanelStyle,
4383
- groupId,
4384
- isPanelCollapsed,
4385
- reevaluatePanelConstraints,
4386
- registerPanel,
4387
- resizePanel,
4388
- unregisterPanel
4389
- } = context;
4390
- const panelId = useUniqueId(idFromProps);
4391
- const panelDataRef = useRef8({
4392
- callbacks: {
4393
- onCollapse,
4394
- onExpand,
4395
- onResize
4396
- },
4397
- constraints: {
4398
- collapsedSize,
4399
- collapsible,
4400
- defaultSize,
4401
- maxSize,
4402
- minSize
4403
- },
4404
- id: panelId,
4405
- idIsFromProps: idFromProps !== undefined,
4406
- order
4407
- });
4408
- const devWarningsRef = useRef8({
4409
- didLogMissingDefaultSizeWarning: false
4410
- });
4411
- {
4412
- if (!devWarningsRef.current.didLogMissingDefaultSizeWarning)
4413
- ;
4414
- }
4415
- useIsomorphicLayoutEffect(() => {
4416
- const {
4417
- callbacks,
4418
- constraints
4419
- } = panelDataRef.current;
4420
- const prevConstraints = {
4421
- ...constraints
4422
- };
4423
- panelDataRef.current.id = panelId;
4424
- panelDataRef.current.idIsFromProps = idFromProps !== undefined;
4425
- panelDataRef.current.order = order;
4426
- callbacks.onCollapse = onCollapse;
4427
- callbacks.onExpand = onExpand;
4428
- callbacks.onResize = onResize;
4429
- constraints.collapsedSize = collapsedSize;
4430
- constraints.collapsible = collapsible;
4431
- constraints.defaultSize = defaultSize;
4432
- constraints.maxSize = maxSize;
4433
- constraints.minSize = minSize;
4434
- if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) {
4435
- reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
4436
- }
4437
- });
4438
- useIsomorphicLayoutEffect(() => {
4439
- const panelData = panelDataRef.current;
4440
- registerPanel(panelData);
4441
- return () => {
4442
- unregisterPanel(panelData);
4443
- };
4444
- }, [order, panelId, registerPanel, unregisterPanel]);
4445
- useImperativeHandle(forwardedRef, () => ({
4446
- collapse: () => {
4447
- collapsePanel(panelDataRef.current);
4448
- },
4449
- expand: (minSize2) => {
4450
- expandPanel(panelDataRef.current, minSize2);
4451
- },
4452
- getId() {
4453
- return panelId;
4454
- },
4455
- getSize() {
4456
- return getPanelSize(panelDataRef.current);
4457
- },
4458
- isCollapsed() {
4459
- return isPanelCollapsed(panelDataRef.current);
4460
- },
4461
- isExpanded() {
4462
- return !isPanelCollapsed(panelDataRef.current);
4463
- },
4464
- resize: (size) => {
4465
- resizePanel(panelDataRef.current, size);
4466
- }
4467
- }), [collapsePanel, expandPanel, getPanelSize, isPanelCollapsed, panelId, resizePanel]);
4468
- const style = getPanelStyle(panelDataRef.current, defaultSize);
4469
- return createElement(Type, {
4470
- ...rest,
4471
- children,
4472
- className: classNameFromProps,
4473
- id: panelId,
4474
- style: {
4475
- ...style,
4476
- ...styleFromProps
4477
- },
4478
- [DATA_ATTRIBUTES.groupId]: groupId,
4479
- [DATA_ATTRIBUTES.panel]: "",
4480
- [DATA_ATTRIBUTES.panelCollapsible]: collapsible || undefined,
4481
- [DATA_ATTRIBUTES.panelId]: panelId,
4482
- [DATA_ATTRIBUTES.panelSize]: parseFloat("" + style.flexGrow).toFixed(1)
4483
- });
4484
- }
4485
- var Panel = forwardRef((props, ref) => createElement(PanelWithForwardedRef, {
4486
- ...props,
4487
- forwardedRef: ref
4488
- }));
4489
- PanelWithForwardedRef.displayName = "Panel";
4490
- Panel.displayName = "forwardRef(Panel)";
4491
- var nonce;
4492
- function getNonce() {
4493
- return nonce;
4494
- }
4495
- var currentCursorStyle = null;
4496
- var enabled = true;
4497
- var getCustomCursorStyleFunction = null;
4498
- var prevRuleIndex = -1;
4499
- var styleElement = null;
4500
- function getCursorStyle(state, constraintFlags, isPointerDown) {
4501
- const horizontalMin = (constraintFlags & EXCEEDED_HORIZONTAL_MIN) !== 0;
4502
- const horizontalMax = (constraintFlags & EXCEEDED_HORIZONTAL_MAX) !== 0;
4503
- const verticalMin = (constraintFlags & EXCEEDED_VERTICAL_MIN) !== 0;
4504
- const verticalMax = (constraintFlags & EXCEEDED_VERTICAL_MAX) !== 0;
4505
- if (getCustomCursorStyleFunction) {
4506
- return getCustomCursorStyleFunction({
4507
- exceedsHorizontalMaximum: horizontalMax,
4508
- exceedsHorizontalMinimum: horizontalMin,
4509
- exceedsVerticalMaximum: verticalMax,
4510
- exceedsVerticalMinimum: verticalMin,
4511
- intersectsHorizontalDragHandle: state === "horizontal" || state === "intersection",
4512
- intersectsVerticalDragHandle: state === "vertical" || state === "intersection",
4513
- isPointerDown
4514
- });
4515
- }
4516
- if (constraintFlags) {
4517
- if (horizontalMin) {
4518
- if (verticalMin) {
4519
- return "se-resize";
4520
- } else if (verticalMax) {
4521
- return "ne-resize";
4522
- } else {
4523
- return "e-resize";
4524
- }
4525
- } else if (horizontalMax) {
4526
- if (verticalMin) {
4527
- return "sw-resize";
4528
- } else if (verticalMax) {
4529
- return "nw-resize";
4530
- } else {
4531
- return "w-resize";
4532
- }
4533
- } else if (verticalMin) {
4534
- return "s-resize";
4535
- } else if (verticalMax) {
4536
- return "n-resize";
4537
- }
4538
- }
4539
- switch (state) {
4540
- case "horizontal":
4541
- return "ew-resize";
4542
- case "intersection":
4543
- return "move";
4544
- case "vertical":
4545
- return "ns-resize";
4546
- }
4547
- }
4548
- function resetGlobalCursorStyle() {
4549
- if (styleElement !== null) {
4550
- document.head.removeChild(styleElement);
4551
- currentCursorStyle = null;
4552
- styleElement = null;
4553
- prevRuleIndex = -1;
4554
- }
4555
- }
4556
- function setGlobalCursorStyle(state, constraintFlags, isPointerDown) {
4557
- var _styleElement$sheet$i, _styleElement$sheet2;
4558
- if (!enabled) {
4559
- return;
4560
- }
4561
- const style = getCursorStyle(state, constraintFlags, isPointerDown);
4562
- if (currentCursorStyle === style) {
4563
- return;
4564
- }
4565
- currentCursorStyle = style;
4566
- if (styleElement === null) {
4567
- styleElement = document.createElement("style");
4568
- const nonce2 = getNonce();
4569
- if (nonce2) {
4570
- styleElement.setAttribute("nonce", nonce2);
4571
- }
4572
- document.head.appendChild(styleElement);
4573
- }
4574
- if (prevRuleIndex >= 0) {
4575
- var _styleElement$sheet;
4576
- (_styleElement$sheet = styleElement.sheet) === null || _styleElement$sheet === undefined || _styleElement$sheet.removeRule(prevRuleIndex);
4577
- }
4578
- prevRuleIndex = (_styleElement$sheet$i = (_styleElement$sheet2 = styleElement.sheet) === null || _styleElement$sheet2 === undefined ? undefined : _styleElement$sheet2.insertRule(`*{cursor: ${style} !important;}`)) !== null && _styleElement$sheet$i !== undefined ? _styleElement$sheet$i : -1;
4579
- }
4580
- function isKeyDown(event) {
4581
- return event.type === "keydown";
4582
- }
4583
- function isPointerEvent(event) {
4584
- return event.type.startsWith("pointer");
4585
- }
4586
- function isMouseEvent(event) {
4587
- return event.type.startsWith("mouse");
4588
- }
4589
- function getResizeEventCoordinates(event) {
4590
- if (isPointerEvent(event)) {
4591
- if (event.isPrimary) {
4592
- return {
4593
- x: event.clientX,
4594
- y: event.clientY
4595
- };
4596
- }
4597
- } else if (isMouseEvent(event)) {
4598
- return {
4599
- x: event.clientX,
4600
- y: event.clientY
4601
- };
4602
- }
4603
- return {
4604
- x: Infinity,
4605
- y: Infinity
4606
- };
4607
- }
4608
- function getInputType() {
4609
- if (typeof matchMedia === "function") {
4610
- return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
4611
- }
4612
- }
4613
- function intersects(rectOne, rectTwo, strict) {
4614
- if (strict) {
4615
- return rectOne.x < rectTwo.x + rectTwo.width && rectOne.x + rectOne.width > rectTwo.x && rectOne.y < rectTwo.y + rectTwo.height && rectOne.y + rectOne.height > rectTwo.y;
4616
- } else {
4617
- return rectOne.x <= rectTwo.x + rectTwo.width && rectOne.x + rectOne.width >= rectTwo.x && rectOne.y <= rectTwo.y + rectTwo.height && rectOne.y + rectOne.height >= rectTwo.y;
4618
- }
4619
- }
4620
- function compare(a, b) {
4621
- if (a === b)
4622
- throw new Error("Cannot compare node with itself");
4623
- const ancestors = {
4624
- a: get_ancestors(a),
4625
- b: get_ancestors(b)
4626
- };
4627
- let common_ancestor;
4628
- while (ancestors.a.at(-1) === ancestors.b.at(-1)) {
4629
- a = ancestors.a.pop();
4630
- b = ancestors.b.pop();
4631
- common_ancestor = a;
4632
- }
4633
- assert(common_ancestor, "Stacking order can only be calculated for elements with a common ancestor");
4634
- const z_indexes = {
4635
- a: get_z_index(find_stacking_context(ancestors.a)),
4636
- b: get_z_index(find_stacking_context(ancestors.b))
4637
- };
4638
- if (z_indexes.a === z_indexes.b) {
4639
- const children = common_ancestor.childNodes;
4640
- const furthest_ancestors = {
4641
- a: ancestors.a.at(-1),
4642
- b: ancestors.b.at(-1)
4643
- };
4644
- let i = children.length;
4645
- while (i--) {
4646
- const child = children[i];
4647
- if (child === furthest_ancestors.a)
4648
- return 1;
4649
- if (child === furthest_ancestors.b)
4650
- return -1;
4651
- }
4652
- }
4653
- return Math.sign(z_indexes.a - z_indexes.b);
4654
- }
4655
- var props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
4656
- function is_flex_item(node) {
4657
- var _get_parent;
4658
- const display = getComputedStyle((_get_parent = get_parent(node)) !== null && _get_parent !== undefined ? _get_parent : node).display;
4659
- return display === "flex" || display === "inline-flex";
4660
- }
4661
- function creates_stacking_context(node) {
4662
- const style = getComputedStyle(node);
4663
- if (style.position === "fixed")
4664
- return true;
4665
- if (style.zIndex !== "auto" && (style.position !== "static" || is_flex_item(node)))
4666
- return true;
4667
- if (+style.opacity < 1)
4668
- return true;
4669
- if ("transform" in style && style.transform !== "none")
4670
- return true;
4671
- if ("webkitTransform" in style && style.webkitTransform !== "none")
4672
- return true;
4673
- if ("mixBlendMode" in style && style.mixBlendMode !== "normal")
4674
- return true;
4675
- if ("filter" in style && style.filter !== "none")
4676
- return true;
4677
- if ("webkitFilter" in style && style.webkitFilter !== "none")
4678
- return true;
4679
- if ("isolation" in style && style.isolation === "isolate")
4680
- return true;
4681
- if (props.test(style.willChange))
4682
- return true;
4683
- if (style.webkitOverflowScrolling === "touch")
4684
- return true;
4685
- return false;
4686
- }
4687
- function find_stacking_context(nodes) {
4688
- let i = nodes.length;
4689
- while (i--) {
4690
- const node = nodes[i];
4691
- assert(node, "Missing node");
4692
- if (creates_stacking_context(node))
4693
- return node;
4694
- }
4695
- return null;
4696
- }
4697
- function get_z_index(node) {
4698
- return node && Number(getComputedStyle(node).zIndex) || 0;
4699
- }
4700
- function get_ancestors(node) {
4701
- const ancestors = [];
4702
- while (node) {
4703
- ancestors.push(node);
4704
- node = get_parent(node);
4705
- }
4706
- return ancestors;
4707
- }
4708
- function get_parent(node) {
4709
- const {
4710
- parentNode
4711
- } = node;
4712
- if (parentNode && parentNode instanceof ShadowRoot) {
4713
- return parentNode.host;
4714
- }
4715
- return parentNode;
4716
- }
4717
- var EXCEEDED_HORIZONTAL_MIN = 1;
4718
- var EXCEEDED_HORIZONTAL_MAX = 2;
4719
- var EXCEEDED_VERTICAL_MIN = 4;
4720
- var EXCEEDED_VERTICAL_MAX = 8;
4721
- var isCoarsePointer = getInputType() === "coarse";
4722
- var intersectingHandles = [];
4723
- var isPointerDown = false;
4724
- var ownerDocumentCounts = new Map;
4725
- var panelConstraintFlags = new Map;
4726
- var registeredResizeHandlers = new Set;
4727
- function registerResizeHandle(resizeHandleId, element, direction, hitAreaMargins, setResizeHandlerState) {
4728
- var _ownerDocumentCounts$;
4729
- const {
4730
- ownerDocument
4731
- } = element;
4732
- const data = {
4733
- direction,
4734
- element,
4735
- hitAreaMargins,
4736
- setResizeHandlerState
4737
- };
4738
- const count = (_ownerDocumentCounts$ = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$ !== undefined ? _ownerDocumentCounts$ : 0;
4739
- ownerDocumentCounts.set(ownerDocument, count + 1);
4740
- registeredResizeHandlers.add(data);
4741
- updateListeners();
4742
- return function unregisterResizeHandle() {
4743
- var _ownerDocumentCounts$2;
4744
- panelConstraintFlags.delete(resizeHandleId);
4745
- registeredResizeHandlers.delete(data);
4746
- const count2 = (_ownerDocumentCounts$2 = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$2 !== undefined ? _ownerDocumentCounts$2 : 1;
4747
- ownerDocumentCounts.set(ownerDocument, count2 - 1);
4748
- updateListeners();
4749
- if (count2 === 1) {
4750
- ownerDocumentCounts.delete(ownerDocument);
4751
- }
4752
- if (intersectingHandles.includes(data)) {
4753
- const index = intersectingHandles.indexOf(data);
4754
- if (index >= 0) {
4755
- intersectingHandles.splice(index, 1);
4756
- }
4757
- updateCursor();
4758
- setResizeHandlerState("up", true, null);
4759
- }
4760
- };
4761
- }
4762
- function handlePointerDown(event) {
4763
- const {
4764
- target
4765
- } = event;
4766
- const {
4767
- x,
4768
- y
4769
- } = getResizeEventCoordinates(event);
4770
- isPointerDown = true;
4771
- recalculateIntersectingHandles({
4772
- target,
4773
- x,
4774
- y
4775
- });
4776
- updateListeners();
4777
- if (intersectingHandles.length > 0) {
4778
- updateResizeHandlerStates("down", event);
4779
- updateCursor();
4780
- event.preventDefault();
4781
- if (!isWithinResizeHandle(target)) {
4782
- event.stopImmediatePropagation();
4783
- }
4784
- }
4785
- }
4786
- function handlePointerMove(event) {
4787
- const {
4788
- x,
4789
- y
4790
- } = getResizeEventCoordinates(event);
4791
- if (isPointerDown && event.type !== "pointerleave" && event.buttons === 0) {
4792
- isPointerDown = false;
4793
- updateResizeHandlerStates("up", event);
4794
- }
4795
- if (!isPointerDown) {
4796
- const {
4797
- target
4798
- } = event;
4799
- recalculateIntersectingHandles({
4800
- target,
4801
- x,
4802
- y
4803
- });
4804
- }
4805
- updateResizeHandlerStates("move", event);
4806
- updateCursor();
4807
- if (intersectingHandles.length > 0) {
4808
- event.preventDefault();
4809
- }
4810
- }
4811
- function handlePointerUp(event) {
4812
- const {
4813
- target
4814
- } = event;
4815
- const {
4816
- x,
4817
- y
4818
- } = getResizeEventCoordinates(event);
4819
- panelConstraintFlags.clear();
4820
- isPointerDown = false;
4821
- if (intersectingHandles.length > 0) {
4822
- event.preventDefault();
4823
- if (!isWithinResizeHandle(target)) {
4824
- event.stopImmediatePropagation();
4825
- }
4826
- }
4827
- updateResizeHandlerStates("up", event);
4828
- recalculateIntersectingHandles({
4829
- target,
4830
- x,
4831
- y
4832
- });
4833
- updateCursor();
4834
- updateListeners();
4835
- }
4836
- function isWithinResizeHandle(element) {
4837
- let currentElement = element;
4838
- while (currentElement) {
4839
- if (currentElement.hasAttribute(DATA_ATTRIBUTES.resizeHandle)) {
4840
- return true;
4841
- }
4842
- currentElement = currentElement.parentElement;
4843
- }
4844
- return false;
4845
- }
4846
- function recalculateIntersectingHandles({
4847
- target,
4848
- x,
4849
- y
4850
- }) {
4851
- intersectingHandles.splice(0);
4852
- let targetElement = null;
4853
- if (target instanceof HTMLElement || target instanceof SVGElement) {
4854
- targetElement = target;
4855
- }
4856
- registeredResizeHandlers.forEach((data) => {
4857
- const {
4858
- element: dragHandleElement,
4859
- hitAreaMargins
4860
- } = data;
4861
- const dragHandleRect = dragHandleElement.getBoundingClientRect();
4862
- const {
4863
- bottom,
4864
- left,
4865
- right,
4866
- top
4867
- } = dragHandleRect;
4868
- const margin = isCoarsePointer ? hitAreaMargins.coarse : hitAreaMargins.fine;
4869
- const eventIntersects = x >= left - margin && x <= right + margin && y >= top - margin && y <= bottom + margin;
4870
- if (eventIntersects) {
4871
- if (targetElement !== null && document.contains(targetElement) && dragHandleElement !== targetElement && !dragHandleElement.contains(targetElement) && !targetElement.contains(dragHandleElement) && compare(targetElement, dragHandleElement) > 0) {
4872
- let currentElement = targetElement;
4873
- let didIntersect = false;
4874
- while (currentElement) {
4875
- if (currentElement.contains(dragHandleElement)) {
4876
- break;
4877
- } else if (intersects(currentElement.getBoundingClientRect(), dragHandleRect, true)) {
4878
- didIntersect = true;
4879
- break;
4880
- }
4881
- currentElement = currentElement.parentElement;
4882
- }
4883
- if (didIntersect) {
4884
- return;
4885
- }
4886
- }
4887
- intersectingHandles.push(data);
4888
- }
4889
- });
4890
- }
4891
- function reportConstraintsViolation(resizeHandleId, flag) {
4892
- panelConstraintFlags.set(resizeHandleId, flag);
4893
- }
4894
- function updateCursor() {
4895
- let intersectsHorizontal = false;
4896
- let intersectsVertical = false;
4897
- intersectingHandles.forEach((data) => {
4898
- const {
4899
- direction
4900
- } = data;
4901
- if (direction === "horizontal") {
4902
- intersectsHorizontal = true;
4903
- } else {
4904
- intersectsVertical = true;
4905
- }
4906
- });
4907
- let constraintFlags = 0;
4908
- panelConstraintFlags.forEach((flag) => {
4909
- constraintFlags |= flag;
4910
- });
4911
- if (intersectsHorizontal && intersectsVertical) {
4912
- setGlobalCursorStyle("intersection", constraintFlags, isPointerDown);
4913
- } else if (intersectsHorizontal) {
4914
- setGlobalCursorStyle("horizontal", constraintFlags, isPointerDown);
4915
- } else if (intersectsVertical) {
4916
- setGlobalCursorStyle("vertical", constraintFlags, isPointerDown);
4917
- } else {
4918
- resetGlobalCursorStyle();
4919
- }
4920
- }
4921
- var listenersAbortController;
4922
- function updateListeners() {
4923
- var _listenersAbortContro;
4924
- (_listenersAbortContro = listenersAbortController) === null || _listenersAbortContro === undefined || _listenersAbortContro.abort();
4925
- listenersAbortController = new AbortController;
4926
- const options = {
4927
- capture: true,
4928
- signal: listenersAbortController.signal
4929
- };
4930
- if (!registeredResizeHandlers.size) {
4931
- return;
4932
- }
4933
- if (isPointerDown) {
4934
- if (intersectingHandles.length > 0) {
4935
- ownerDocumentCounts.forEach((count, ownerDocument) => {
4936
- const {
4937
- body
4938
- } = ownerDocument;
4939
- if (count > 0) {
4940
- body.addEventListener("contextmenu", handlePointerUp, options);
4941
- body.addEventListener("pointerleave", handlePointerMove, options);
4942
- body.addEventListener("pointermove", handlePointerMove, options);
4943
- }
4944
- });
4945
- }
4946
- ownerDocumentCounts.forEach((_, ownerDocument) => {
4947
- const {
4948
- body
4949
- } = ownerDocument;
4950
- body.addEventListener("pointerup", handlePointerUp, options);
4951
- body.addEventListener("pointercancel", handlePointerUp, options);
4952
- });
4953
- } else {
4954
- ownerDocumentCounts.forEach((count, ownerDocument) => {
4955
- const {
4956
- body
4957
- } = ownerDocument;
4958
- if (count > 0) {
4959
- body.addEventListener("pointerdown", handlePointerDown, options);
4960
- body.addEventListener("pointermove", handlePointerMove, options);
4961
- }
4962
- });
4963
- }
4964
- }
4965
- function updateResizeHandlerStates(action, event) {
4966
- registeredResizeHandlers.forEach((data) => {
4967
- const {
4968
- setResizeHandlerState
4969
- } = data;
4970
- const isActive = intersectingHandles.includes(data);
4971
- setResizeHandlerState(action, isActive, event);
4972
- });
4973
- }
4974
- function useForceUpdate() {
4975
- const [_, setCount] = useState10(0);
4976
- return useCallback2(() => setCount((prevCount) => prevCount + 1), []);
4977
- }
4978
- function assert(expectedCondition, message) {
4979
- if (!expectedCondition) {
4980
- console.error(message);
4981
- throw Error(message);
4982
- }
4983
- }
4984
- function fuzzyCompareNumbers(actual, expected, fractionDigits = PRECISION) {
4985
- if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
4986
- return 0;
4987
- } else {
4988
- return actual > expected ? 1 : -1;
4989
- }
4990
- }
4991
- function fuzzyNumbersEqual$1(actual, expected, fractionDigits = PRECISION) {
4992
- return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
4993
- }
4994
- function fuzzyNumbersEqual(actual, expected, fractionDigits) {
4995
- return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
4996
- }
4997
- function fuzzyLayoutsEqual(actual, expected, fractionDigits) {
4998
- if (actual.length !== expected.length) {
4999
- return false;
5000
- }
5001
- for (let index = 0;index < actual.length; index++) {
5002
- const actualSize = actual[index];
5003
- const expectedSize = expected[index];
5004
- if (!fuzzyNumbersEqual(actualSize, expectedSize, fractionDigits)) {
5005
- return false;
5006
- }
5007
- }
5008
- return true;
5009
- }
5010
- function resizePanel({
5011
- panelConstraints: panelConstraintsArray,
5012
- panelIndex,
5013
- size
5014
- }) {
5015
- const panelConstraints = panelConstraintsArray[panelIndex];
5016
- assert(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
5017
- let {
5018
- collapsedSize = 0,
5019
- collapsible,
5020
- maxSize = 100,
5021
- minSize = 0
5022
- } = panelConstraints;
5023
- if (fuzzyCompareNumbers(size, minSize) < 0) {
5024
- if (collapsible) {
5025
- const halfwayPoint = (collapsedSize + minSize) / 2;
5026
- if (fuzzyCompareNumbers(size, halfwayPoint) < 0) {
5027
- size = collapsedSize;
5028
- } else {
5029
- size = minSize;
5030
- }
5031
- } else {
5032
- size = minSize;
5033
- }
5034
- }
5035
- size = Math.min(maxSize, size);
5036
- size = parseFloat(size.toFixed(PRECISION));
5037
- return size;
5038
- }
5039
- function adjustLayoutByDelta({
5040
- delta,
5041
- initialLayout,
5042
- panelConstraints: panelConstraintsArray,
5043
- pivotIndices,
5044
- prevLayout,
5045
- trigger
5046
- }) {
5047
- if (fuzzyNumbersEqual(delta, 0)) {
5048
- return initialLayout;
5049
- }
5050
- const nextLayout = [...initialLayout];
5051
- const [firstPivotIndex, secondPivotIndex] = pivotIndices;
5052
- assert(firstPivotIndex != null, "Invalid first pivot index");
5053
- assert(secondPivotIndex != null, "Invalid second pivot index");
5054
- let deltaApplied = 0;
5055
- {
5056
- if (trigger === "keyboard") {
5057
- {
5058
- const index = delta < 0 ? secondPivotIndex : firstPivotIndex;
5059
- const panelConstraints = panelConstraintsArray[index];
5060
- assert(panelConstraints, `Panel constraints not found for index ${index}`);
5061
- const {
5062
- collapsedSize = 0,
5063
- collapsible,
5064
- minSize = 0
5065
- } = panelConstraints;
5066
- if (collapsible) {
5067
- const prevSize = initialLayout[index];
5068
- assert(prevSize != null, `Previous layout not found for panel index ${index}`);
5069
- if (fuzzyNumbersEqual(prevSize, collapsedSize)) {
5070
- const localDelta = minSize - prevSize;
5071
- if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
5072
- delta = delta < 0 ? 0 - localDelta : localDelta;
5073
- }
5074
- }
5075
- }
5076
- }
5077
- {
5078
- const index = delta < 0 ? firstPivotIndex : secondPivotIndex;
5079
- const panelConstraints = panelConstraintsArray[index];
5080
- assert(panelConstraints, `No panel constraints found for index ${index}`);
5081
- const {
5082
- collapsedSize = 0,
5083
- collapsible,
5084
- minSize = 0
5085
- } = panelConstraints;
5086
- if (collapsible) {
5087
- const prevSize = initialLayout[index];
5088
- assert(prevSize != null, `Previous layout not found for panel index ${index}`);
5089
- if (fuzzyNumbersEqual(prevSize, minSize)) {
5090
- const localDelta = prevSize - collapsedSize;
5091
- if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) {
5092
- delta = delta < 0 ? 0 - localDelta : localDelta;
5093
- }
5094
- }
5095
- }
5096
- }
5097
- }
5098
- }
5099
- {
5100
- const increment = delta < 0 ? 1 : -1;
5101
- let index = delta < 0 ? secondPivotIndex : firstPivotIndex;
5102
- let maxAvailableDelta = 0;
5103
- while (true) {
5104
- const prevSize = initialLayout[index];
5105
- assert(prevSize != null, `Previous layout not found for panel index ${index}`);
5106
- const maxSafeSize = resizePanel({
5107
- panelConstraints: panelConstraintsArray,
5108
- panelIndex: index,
5109
- size: 100
5110
- });
5111
- const delta2 = maxSafeSize - prevSize;
5112
- maxAvailableDelta += delta2;
5113
- index += increment;
5114
- if (index < 0 || index >= panelConstraintsArray.length) {
5115
- break;
5116
- }
5117
- }
5118
- const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
5119
- delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
5120
- }
5121
- {
5122
- const pivotIndex = delta < 0 ? firstPivotIndex : secondPivotIndex;
5123
- let index = pivotIndex;
5124
- while (index >= 0 && index < panelConstraintsArray.length) {
5125
- const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
5126
- const prevSize = initialLayout[index];
5127
- assert(prevSize != null, `Previous layout not found for panel index ${index}`);
5128
- const unsafeSize = prevSize - deltaRemaining;
5129
- const safeSize = resizePanel({
5130
- panelConstraints: panelConstraintsArray,
5131
- panelIndex: index,
5132
- size: unsafeSize
5133
- });
5134
- if (!fuzzyNumbersEqual(prevSize, safeSize)) {
5135
- deltaApplied += prevSize - safeSize;
5136
- nextLayout[index] = safeSize;
5137
- if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), undefined, {
5138
- numeric: true
5139
- }) >= 0) {
5140
- break;
5141
- }
5142
- }
5143
- if (delta < 0) {
5144
- index--;
5145
- } else {
5146
- index++;
5147
- }
5148
- }
5149
- }
5150
- if (fuzzyLayoutsEqual(prevLayout, nextLayout)) {
5151
- return prevLayout;
5152
- }
5153
- {
5154
- const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
5155
- const prevSize = initialLayout[pivotIndex];
5156
- assert(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
5157
- const unsafeSize = prevSize + deltaApplied;
5158
- const safeSize = resizePanel({
5159
- panelConstraints: panelConstraintsArray,
5160
- panelIndex: pivotIndex,
5161
- size: unsafeSize
5162
- });
5163
- nextLayout[pivotIndex] = safeSize;
5164
- if (!fuzzyNumbersEqual(safeSize, unsafeSize)) {
5165
- let deltaRemaining = unsafeSize - safeSize;
5166
- const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
5167
- let index = pivotIndex2;
5168
- while (index >= 0 && index < panelConstraintsArray.length) {
5169
- const prevSize2 = nextLayout[index];
5170
- assert(prevSize2 != null, `Previous layout not found for panel index ${index}`);
5171
- const unsafeSize2 = prevSize2 + deltaRemaining;
5172
- const safeSize2 = resizePanel({
5173
- panelConstraints: panelConstraintsArray,
5174
- panelIndex: index,
5175
- size: unsafeSize2
5176
- });
5177
- if (!fuzzyNumbersEqual(prevSize2, safeSize2)) {
5178
- deltaRemaining -= safeSize2 - prevSize2;
5179
- nextLayout[index] = safeSize2;
5180
- }
5181
- if (fuzzyNumbersEqual(deltaRemaining, 0)) {
5182
- break;
5183
- }
5184
- if (delta > 0) {
5185
- index--;
5186
- } else {
5187
- index++;
5188
- }
5189
- }
5190
- }
5191
- }
5192
- const totalSize = nextLayout.reduce((total, size) => size + total, 0);
5193
- if (!fuzzyNumbersEqual(totalSize, 100)) {
5194
- return prevLayout;
5195
- }
5196
- return nextLayout;
5197
- }
5198
- function calculateAriaValues({
5199
- layout,
5200
- panelsArray,
5201
- pivotIndices
5202
- }) {
5203
- let currentMinSize = 0;
5204
- let currentMaxSize = 100;
5205
- let totalMinSize = 0;
5206
- let totalMaxSize = 0;
5207
- const firstIndex = pivotIndices[0];
5208
- assert(firstIndex != null, "No pivot index found");
5209
- panelsArray.forEach((panelData, index) => {
5210
- const {
5211
- constraints
5212
- } = panelData;
5213
- const {
5214
- maxSize = 100,
5215
- minSize = 0
5216
- } = constraints;
5217
- if (index === firstIndex) {
5218
- currentMinSize = minSize;
5219
- currentMaxSize = maxSize;
5220
- } else {
5221
- totalMinSize += minSize;
5222
- totalMaxSize += maxSize;
5223
- }
5224
- });
5225
- const valueMax = Math.min(currentMaxSize, 100 - totalMinSize);
5226
- const valueMin = Math.max(currentMinSize, 100 - totalMaxSize);
5227
- const valueNow = layout[firstIndex];
5228
- return {
5229
- valueMax,
5230
- valueMin,
5231
- valueNow
5232
- };
5233
- }
5234
- function getResizeHandleElementsForGroup(groupId, scope = document) {
5235
- return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES.resizeHandleId}][data-panel-group-id="${groupId}"]`));
5236
- }
5237
- function getResizeHandleElementIndex(groupId, id, scope = document) {
5238
- const handles = getResizeHandleElementsForGroup(groupId, scope);
5239
- const index = handles.findIndex((handle) => handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId) === id);
5240
- return index !== null && index !== undefined ? index : null;
5241
- }
5242
- function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
5243
- const index = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
5244
- return index != null ? [index, index + 1] : [-1, -1];
5245
- }
5246
- function isHTMLElement(target) {
5247
- if (target instanceof HTMLElement) {
5248
- return true;
5249
- }
5250
- return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
5251
- }
5252
- function getPanelGroupElement(id, rootElement = document) {
5253
- if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
5254
- return rootElement;
5255
- }
5256
- const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
5257
- if (element) {
5258
- return element;
5259
- }
5260
- return null;
5261
- }
5262
- function getResizeHandleElement(id, scope = document) {
5263
- const element = scope.querySelector(`[${DATA_ATTRIBUTES.resizeHandleId}="${id}"]`);
5264
- if (element) {
5265
- return element;
5266
- }
5267
- return null;
5268
- }
5269
- function getResizeHandlePanelIds(groupId, handleId, panelsArray, scope = document) {
5270
- var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
5271
- const handle = getResizeHandleElement(handleId, scope);
5272
- const handles = getResizeHandleElementsForGroup(groupId, scope);
5273
- const index = handle ? handles.indexOf(handle) : -1;
5274
- const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index]) === null || _panelsArray$index === undefined ? undefined : _panelsArray$index.id) !== null && _panelsArray$index$id !== undefined ? _panelsArray$index$id : null;
5275
- const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index + 1]) === null || _panelsArray === undefined ? undefined : _panelsArray.id) !== null && _panelsArray$id !== undefined ? _panelsArray$id : null;
5276
- return [idBefore, idAfter];
5277
- }
5278
- function useWindowSplitterPanelGroupBehavior({
5279
- committedValuesRef,
5280
- eagerValuesRef,
5281
- groupId,
5282
- layout,
5283
- panelDataArray,
5284
- panelGroupElement,
5285
- setLayout
5286
- }) {
5287
- const devWarningsRef = useRef8({
5288
- didWarnAboutMissingResizeHandle: false
5289
- });
5290
- useIsomorphicLayoutEffect(() => {
5291
- if (!panelGroupElement) {
5292
- return;
5293
- }
5294
- const resizeHandleElements = getResizeHandleElementsForGroup(groupId, panelGroupElement);
5295
- for (let index = 0;index < panelDataArray.length - 1; index++) {
5296
- const {
5297
- valueMax,
5298
- valueMin,
5299
- valueNow
5300
- } = calculateAriaValues({
5301
- layout,
5302
- panelsArray: panelDataArray,
5303
- pivotIndices: [index, index + 1]
5304
- });
5305
- const resizeHandleElement = resizeHandleElements[index];
5306
- if (resizeHandleElement == null) {
5307
- {
5308
- const {
5309
- didWarnAboutMissingResizeHandle
5310
- } = devWarningsRef.current;
5311
- if (!didWarnAboutMissingResizeHandle) {
5312
- devWarningsRef.current.didWarnAboutMissingResizeHandle = true;
5313
- console.warn(`WARNING: Missing resize handle for PanelGroup "${groupId}"`);
5314
- }
5315
- }
5316
- } else {
5317
- const panelData = panelDataArray[index];
5318
- assert(panelData, `No panel data found for index "${index}"`);
5319
- resizeHandleElement.setAttribute("aria-controls", panelData.id);
5320
- resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
5321
- resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
5322
- resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
5323
- }
5324
- }
5325
- return () => {
5326
- resizeHandleElements.forEach((resizeHandleElement, index) => {
5327
- resizeHandleElement.removeAttribute("aria-controls");
5328
- resizeHandleElement.removeAttribute("aria-valuemax");
5329
- resizeHandleElement.removeAttribute("aria-valuemin");
5330
- resizeHandleElement.removeAttribute("aria-valuenow");
5331
- });
5332
- };
5333
- }, [groupId, layout, panelDataArray, panelGroupElement]);
5334
- useEffect8(() => {
5335
- if (!panelGroupElement) {
5336
- return;
5337
- }
5338
- const eagerValues = eagerValuesRef.current;
5339
- assert(eagerValues, `Eager values not found`);
5340
- const {
5341
- panelDataArray: panelDataArray2
5342
- } = eagerValues;
5343
- const groupElement = getPanelGroupElement(groupId, panelGroupElement);
5344
- assert(groupElement != null, `No group found for id "${groupId}"`);
5345
- const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
5346
- assert(handles, `No resize handles found for group id "${groupId}"`);
5347
- const cleanupFunctions = handles.map((handle) => {
5348
- const handleId = handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId);
5349
- assert(handleId, `Resize handle element has no handle id attribute`);
5350
- const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelDataArray2, panelGroupElement);
5351
- if (idBefore == null || idAfter == null) {
5352
- return () => {};
5353
- }
5354
- const onKeyDown = (event) => {
5355
- if (event.defaultPrevented) {
5356
- return;
5357
- }
5358
- switch (event.key) {
5359
- case "Enter": {
5360
- event.preventDefault();
5361
- const index = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
5362
- if (index >= 0) {
5363
- const panelData = panelDataArray2[index];
5364
- assert(panelData, `No panel data found for index ${index}`);
5365
- const size = layout[index];
5366
- const {
5367
- collapsedSize = 0,
5368
- collapsible,
5369
- minSize = 0
5370
- } = panelData.constraints;
5371
- if (size != null && collapsible) {
5372
- const nextLayout = adjustLayoutByDelta({
5373
- delta: fuzzyNumbersEqual(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
5374
- initialLayout: layout,
5375
- panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
5376
- pivotIndices: determinePivotIndices(groupId, handleId, panelGroupElement),
5377
- prevLayout: layout,
5378
- trigger: "keyboard"
5379
- });
5380
- if (layout !== nextLayout) {
5381
- setLayout(nextLayout);
5382
- }
5383
- }
5384
- }
5385
- break;
5386
- }
5387
- }
5388
- };
5389
- handle.addEventListener("keydown", onKeyDown);
5390
- return () => {
5391
- handle.removeEventListener("keydown", onKeyDown);
5392
- };
5393
- });
5394
- return () => {
5395
- cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
5396
- };
5397
- }, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
5398
- }
5399
- function areEqual(arrayA, arrayB) {
5400
- if (arrayA.length !== arrayB.length) {
5401
- return false;
5402
- }
5403
- for (let index = 0;index < arrayA.length; index++) {
5404
- if (arrayA[index] !== arrayB[index]) {
5405
- return false;
5406
- }
5407
- }
5408
- return true;
5409
- }
5410
- function getResizeEventCursorPosition(direction, event) {
5411
- const isHorizontal = direction === "horizontal";
5412
- const {
5413
- x,
5414
- y
5415
- } = getResizeEventCoordinates(event);
5416
- return isHorizontal ? x : y;
5417
- }
5418
- function calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement) {
5419
- const isHorizontal = direction === "horizontal";
5420
- const handleElement = getResizeHandleElement(dragHandleId, panelGroupElement);
5421
- assert(handleElement, `No resize handle element found for id "${dragHandleId}"`);
5422
- const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
5423
- assert(groupId, `Resize handle element has no group id attribute`);
5424
- let {
5425
- initialCursorPosition
5426
- } = initialDragState;
5427
- const cursorPosition = getResizeEventCursorPosition(direction, event);
5428
- const groupElement = getPanelGroupElement(groupId, panelGroupElement);
5429
- assert(groupElement, `No group element found for id "${groupId}"`);
5430
- const groupRect = groupElement.getBoundingClientRect();
5431
- const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
5432
- const offsetPixels = cursorPosition - initialCursorPosition;
5433
- const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
5434
- return offsetPercentage;
5435
- }
5436
- function calculateDeltaPercentage(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
5437
- if (isKeyDown(event)) {
5438
- const isHorizontal = direction === "horizontal";
5439
- let delta = 0;
5440
- if (event.shiftKey) {
5441
- delta = 100;
5442
- } else if (keyboardResizeBy != null) {
5443
- delta = keyboardResizeBy;
5444
- } else {
5445
- delta = 10;
5446
- }
5447
- let movement = 0;
5448
- switch (event.key) {
5449
- case "ArrowDown":
5450
- movement = isHorizontal ? 0 : delta;
5451
- break;
5452
- case "ArrowLeft":
5453
- movement = isHorizontal ? -delta : 0;
5454
- break;
5455
- case "ArrowRight":
5456
- movement = isHorizontal ? delta : 0;
5457
- break;
5458
- case "ArrowUp":
5459
- movement = isHorizontal ? 0 : -delta;
5460
- break;
5461
- case "End":
5462
- movement = 100;
5463
- break;
5464
- case "Home":
5465
- movement = -100;
5466
- break;
5467
- }
5468
- return movement;
5469
- } else {
5470
- if (initialDragState == null) {
5471
- return 0;
5472
- }
5473
- return calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement);
5474
- }
5475
- }
5476
- function calculateUnsafeDefaultLayout({
5477
- panelDataArray
5478
- }) {
5479
- const layout = Array(panelDataArray.length);
5480
- const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
5481
- let numPanelsWithSizes = 0;
5482
- let remainingSize = 100;
5483
- for (let index = 0;index < panelDataArray.length; index++) {
5484
- const panelConstraints = panelConstraintsArray[index];
5485
- assert(panelConstraints, `Panel constraints not found for index ${index}`);
5486
- const {
5487
- defaultSize
5488
- } = panelConstraints;
5489
- if (defaultSize != null) {
5490
- numPanelsWithSizes++;
5491
- layout[index] = defaultSize;
5492
- remainingSize -= defaultSize;
5493
- }
5494
- }
5495
- for (let index = 0;index < panelDataArray.length; index++) {
5496
- const panelConstraints = panelConstraintsArray[index];
5497
- assert(panelConstraints, `Panel constraints not found for index ${index}`);
5498
- const {
5499
- defaultSize
5500
- } = panelConstraints;
5501
- if (defaultSize != null) {
5502
- continue;
5503
- }
5504
- const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
5505
- const size = remainingSize / numRemainingPanels;
5506
- numPanelsWithSizes++;
5507
- layout[index] = size;
5508
- remainingSize -= size;
5509
- }
5510
- return layout;
5511
- }
5512
- function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
5513
- layout.forEach((size, index) => {
5514
- const panelData = panelsArray[index];
5515
- assert(panelData, `Panel data not found for index ${index}`);
5516
- const {
5517
- callbacks,
5518
- constraints,
5519
- id: panelId
5520
- } = panelData;
5521
- const {
5522
- collapsedSize = 0,
5523
- collapsible
5524
- } = constraints;
5525
- const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
5526
- if (lastNotifiedSize == null || size !== lastNotifiedSize) {
5527
- panelIdToLastNotifiedSizeMap[panelId] = size;
5528
- const {
5529
- onCollapse,
5530
- onExpand,
5531
- onResize
5532
- } = callbacks;
5533
- if (onResize) {
5534
- onResize(size, lastNotifiedSize);
5535
- }
5536
- if (collapsible && (onCollapse || onExpand)) {
5537
- if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1(size, collapsedSize)) {
5538
- onExpand();
5539
- }
5540
- if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1(size, collapsedSize)) {
5541
- onCollapse();
5542
- }
5543
- }
5544
- }
5545
- });
5546
- }
5547
- function compareLayouts(a, b) {
5548
- if (a.length !== b.length) {
5549
- return false;
5550
- } else {
5551
- for (let index = 0;index < a.length; index++) {
5552
- if (a[index] != b[index]) {
5553
- return false;
5554
- }
5555
- }
5556
- }
5557
- return true;
5558
- }
5559
- function computePanelFlexBoxStyle({
5560
- defaultSize,
5561
- dragState,
5562
- layout,
5563
- panelData,
5564
- panelIndex,
5565
- precision = 3
5566
- }) {
5567
- const size = layout[panelIndex];
5568
- let flexGrow;
5569
- if (size == null) {
5570
- flexGrow = defaultSize != null ? defaultSize.toFixed(precision) : "1";
5571
- } else if (panelData.length === 1) {
5572
- flexGrow = "1";
5573
- } else {
5574
- flexGrow = size.toFixed(precision);
5575
- }
5576
- return {
5577
- flexBasis: 0,
5578
- flexGrow,
5579
- flexShrink: 1,
5580
- overflow: "hidden",
5581
- pointerEvents: dragState !== null ? "none" : undefined
5582
- };
5583
- }
5584
- function debounce(callback, durationMs = 10) {
5585
- let timeoutId = null;
5586
- let callable = (...args) => {
5587
- if (timeoutId !== null) {
5588
- clearTimeout(timeoutId);
5589
- }
5590
- timeoutId = setTimeout(() => {
5591
- callback(...args);
5592
- }, durationMs);
5593
- };
5594
- return callable;
5595
- }
5596
- function initializeDefaultStorage(storageObject) {
5597
- try {
5598
- if (typeof localStorage !== "undefined") {
5599
- storageObject.getItem = (name) => {
5600
- return localStorage.getItem(name);
5601
- };
5602
- storageObject.setItem = (name, value) => {
5603
- localStorage.setItem(name, value);
5604
- };
5605
- } else {
5606
- throw new Error("localStorage not supported in this environment");
5607
- }
5608
- } catch (error) {
5609
- console.error(error);
5610
- storageObject.getItem = () => null;
5611
- storageObject.setItem = () => {};
5612
- }
5613
- }
5614
- function getPanelGroupKey(autoSaveId) {
5615
- return `react-resizable-panels:${autoSaveId}`;
5616
- }
5617
- function getPanelKey(panels) {
5618
- return panels.map((panel) => {
5619
- const {
5620
- constraints,
5621
- id,
5622
- idIsFromProps,
5623
- order
5624
- } = panel;
5625
- if (idIsFromProps) {
5626
- return id;
5627
- } else {
5628
- return order ? `${order}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
5629
- }
5630
- }).sort((a, b) => a.localeCompare(b)).join(",");
5631
- }
5632
- function loadSerializedPanelGroupState(autoSaveId, storage) {
5633
- try {
5634
- const panelGroupKey = getPanelGroupKey(autoSaveId);
5635
- const serialized = storage.getItem(panelGroupKey);
5636
- if (serialized) {
5637
- const parsed = JSON.parse(serialized);
5638
- if (typeof parsed === "object" && parsed != null) {
5639
- return parsed;
5640
- }
5641
- }
5642
- } catch (error) {}
5643
- return null;
5644
- }
5645
- function loadPanelGroupState(autoSaveId, panels, storage) {
5646
- var _loadSerializedPanelG, _state$panelKey;
5647
- const state = (_loadSerializedPanelG = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG !== undefined ? _loadSerializedPanelG : {};
5648
- const panelKey = getPanelKey(panels);
5649
- return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== undefined ? _state$panelKey : null;
5650
- }
5651
- function savePanelGroupState(autoSaveId, panels, panelSizesBeforeCollapse, sizes, storage) {
5652
- var _loadSerializedPanelG2;
5653
- const panelGroupKey = getPanelGroupKey(autoSaveId);
5654
- const panelKey = getPanelKey(panels);
5655
- const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== undefined ? _loadSerializedPanelG2 : {};
5656
- state[panelKey] = {
5657
- expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
5658
- layout: sizes
5659
- };
5660
- try {
5661
- storage.setItem(panelGroupKey, JSON.stringify(state));
5662
- } catch (error) {
5663
- console.error(error);
5664
- }
5665
- }
5666
- function validatePanelConstraints({
5667
- panelConstraints: panelConstraintsArray,
5668
- panelId,
5669
- panelIndex
5670
- }) {
5671
- {
5672
- const warnings = [];
5673
- const panelConstraints = panelConstraintsArray[panelIndex];
5674
- assert(panelConstraints, `No panel constraints found for index ${panelIndex}`);
5675
- const {
5676
- collapsedSize = 0,
5677
- collapsible = false,
5678
- defaultSize,
5679
- maxSize = 100,
5680
- minSize = 0
5681
- } = panelConstraints;
5682
- if (minSize > maxSize) {
5683
- warnings.push(`min size (${minSize}%) should not be greater than max size (${maxSize}%)`);
5684
- }
5685
- if (defaultSize != null) {
5686
- if (defaultSize < 0) {
5687
- warnings.push("default size should not be less than 0");
5688
- } else if (defaultSize < minSize && (!collapsible || defaultSize !== collapsedSize)) {
5689
- warnings.push("default size should not be less than min size");
5690
- }
5691
- if (defaultSize > 100) {
5692
- warnings.push("default size should not be greater than 100");
5693
- } else if (defaultSize > maxSize) {
5694
- warnings.push("default size should not be greater than max size");
5695
- }
5696
- }
5697
- if (collapsedSize > minSize) {
5698
- warnings.push("collapsed size should not be greater than min size");
5699
- }
5700
- if (warnings.length > 0) {
5701
- const name = panelId != null ? `Panel "${panelId}"` : "Panel";
5702
- console.warn(`${name} has an invalid configuration:
5703
-
5704
- ${warnings.join(`
5705
- `)}`);
5706
- return false;
5707
- }
5708
- }
5709
- return true;
5710
- }
5711
- function validatePanelGroupLayout({
5712
- layout: prevLayout,
5713
- panelConstraints
5714
- }) {
5715
- const nextLayout = [...prevLayout];
5716
- const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
5717
- if (nextLayout.length !== panelConstraints.length) {
5718
- throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
5719
- } else if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
5720
- {
5721
- console.warn(`WARNING: Invalid layout total size: ${nextLayout.map((size) => `${size}%`).join(", ")}. Layout normalization will be applied.`);
5722
- }
5723
- for (let index = 0;index < panelConstraints.length; index++) {
5724
- const unsafeSize = nextLayout[index];
5725
- assert(unsafeSize != null, `No layout data found for index ${index}`);
5726
- const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
5727
- nextLayout[index] = safeSize;
5728
- }
5729
- }
5730
- let remainingSize = 0;
5731
- for (let index = 0;index < panelConstraints.length; index++) {
5732
- const unsafeSize = nextLayout[index];
5733
- assert(unsafeSize != null, `No layout data found for index ${index}`);
5734
- const safeSize = resizePanel({
5735
- panelConstraints,
5736
- panelIndex: index,
5737
- size: unsafeSize
5738
- });
5739
- if (unsafeSize != safeSize) {
5740
- remainingSize += unsafeSize - safeSize;
5741
- nextLayout[index] = safeSize;
5742
- }
5743
- }
5744
- if (!fuzzyNumbersEqual(remainingSize, 0)) {
5745
- for (let index = 0;index < panelConstraints.length; index++) {
5746
- const prevSize = nextLayout[index];
5747
- assert(prevSize != null, `No layout data found for index ${index}`);
5748
- const unsafeSize = prevSize + remainingSize;
5749
- const safeSize = resizePanel({
5750
- panelConstraints,
5751
- panelIndex: index,
5752
- size: unsafeSize
5753
- });
5754
- if (prevSize !== safeSize) {
5755
- remainingSize -= safeSize - prevSize;
5756
- nextLayout[index] = safeSize;
5757
- if (fuzzyNumbersEqual(remainingSize, 0)) {
5758
- break;
5759
- }
5760
- }
5761
- }
5762
- }
5763
- return nextLayout;
5764
- }
5765
- var LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100;
5766
- var defaultStorage = {
5767
- getItem: (name) => {
5768
- initializeDefaultStorage(defaultStorage);
5769
- return defaultStorage.getItem(name);
5770
- },
5771
- setItem: (name, value) => {
5772
- initializeDefaultStorage(defaultStorage);
5773
- defaultStorage.setItem(name, value);
5774
- }
5775
- };
5776
- var debounceMap = {};
5777
- function PanelGroupWithForwardedRef({
5778
- autoSaveId = null,
5779
- children,
5780
- className: classNameFromProps = "",
5781
- direction,
5782
- forwardedRef,
5783
- id: idFromProps = null,
5784
- onLayout = null,
5785
- keyboardResizeBy = null,
5786
- storage = defaultStorage,
5787
- style: styleFromProps,
5788
- tagName: Type = "div",
5789
- ...rest
5790
- }) {
5791
- const groupId = useUniqueId(idFromProps);
5792
- const panelGroupElementRef = useRef8(null);
5793
- const [dragState, setDragState] = useState10(null);
5794
- const [layout, setLayout] = useState10([]);
5795
- const forceUpdate = useForceUpdate();
5796
- const panelIdToLastNotifiedSizeMapRef = useRef8({});
5797
- const panelSizeBeforeCollapseRef = useRef8(new Map);
5798
- const prevDeltaRef = useRef8(0);
5799
- const committedValuesRef = useRef8({
5800
- autoSaveId,
5801
- direction,
5802
- dragState,
5803
- id: groupId,
5804
- keyboardResizeBy,
5805
- onLayout,
5806
- storage
5807
- });
5808
- const eagerValuesRef = useRef8({
5809
- layout,
5810
- panelDataArray: [],
5811
- panelDataArrayChanged: false
5812
- });
5813
- const devWarningsRef = useRef8({
5814
- didLogIdAndOrderWarning: false,
5815
- didLogPanelConstraintsWarning: false,
5816
- prevPanelIds: []
5817
- });
5818
- useImperativeHandle(forwardedRef, () => ({
5819
- getId: () => committedValuesRef.current.id,
5820
- getLayout: () => {
5821
- const {
5822
- layout: layout2
5823
- } = eagerValuesRef.current;
5824
- return layout2;
5825
- },
5826
- setLayout: (unsafeLayout) => {
5827
- const {
5828
- onLayout: onLayout2
5829
- } = committedValuesRef.current;
5830
- const {
5831
- layout: prevLayout,
5832
- panelDataArray
5833
- } = eagerValuesRef.current;
5834
- const safeLayout = validatePanelGroupLayout({
5835
- layout: unsafeLayout,
5836
- panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
5837
- });
5838
- if (!areEqual(prevLayout, safeLayout)) {
5839
- setLayout(safeLayout);
5840
- eagerValuesRef.current.layout = safeLayout;
5841
- if (onLayout2) {
5842
- onLayout2(safeLayout);
5843
- }
5844
- callPanelCallbacks(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
5845
- }
5846
- }
5847
- }), []);
5848
- useIsomorphicLayoutEffect(() => {
5849
- committedValuesRef.current.autoSaveId = autoSaveId;
5850
- committedValuesRef.current.direction = direction;
5851
- committedValuesRef.current.dragState = dragState;
5852
- committedValuesRef.current.id = groupId;
5853
- committedValuesRef.current.onLayout = onLayout;
5854
- committedValuesRef.current.storage = storage;
5855
- });
5856
- useWindowSplitterPanelGroupBehavior({
5857
- committedValuesRef,
5858
- eagerValuesRef,
5859
- groupId,
5860
- layout,
5861
- panelDataArray: eagerValuesRef.current.panelDataArray,
5862
- setLayout,
5863
- panelGroupElement: panelGroupElementRef.current
5864
- });
5865
- useEffect8(() => {
5866
- const {
5867
- panelDataArray
5868
- } = eagerValuesRef.current;
5869
- if (autoSaveId) {
5870
- if (layout.length === 0 || layout.length !== panelDataArray.length) {
5871
- return;
5872
- }
5873
- let debouncedSave = debounceMap[autoSaveId];
5874
- if (debouncedSave == null) {
5875
- debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL);
5876
- debounceMap[autoSaveId] = debouncedSave;
5877
- }
5878
- const clonedPanelDataArray = [...panelDataArray];
5879
- const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
5880
- debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
5881
- }
5882
- }, [autoSaveId, layout, storage]);
5883
- useEffect8(() => {
5884
- {
5885
- const {
5886
- panelDataArray
5887
- } = eagerValuesRef.current;
5888
- const {
5889
- didLogIdAndOrderWarning,
5890
- didLogPanelConstraintsWarning,
5891
- prevPanelIds
5892
- } = devWarningsRef.current;
5893
- if (!didLogIdAndOrderWarning) {
5894
- const panelIds = panelDataArray.map(({
5895
- id
5896
- }) => id);
5897
- devWarningsRef.current.prevPanelIds = panelIds;
5898
- const panelsHaveChanged = prevPanelIds.length > 0 && !areEqual(prevPanelIds, panelIds);
5899
- if (panelsHaveChanged) {
5900
- if (panelDataArray.find(({
5901
- idIsFromProps,
5902
- order
5903
- }) => !idIsFromProps || order == null)) {
5904
- devWarningsRef.current.didLogIdAndOrderWarning = true;
5905
- console.warn(`WARNING: Panel id and order props recommended when panels are dynamically rendered`);
5906
- }
5907
- }
5908
- }
5909
- if (!didLogPanelConstraintsWarning) {
5910
- const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
5911
- for (let panelIndex = 0;panelIndex < panelConstraints.length; panelIndex++) {
5912
- const panelData = panelDataArray[panelIndex];
5913
- assert(panelData, `Panel data not found for index ${panelIndex}`);
5914
- const isValid = validatePanelConstraints({
5915
- panelConstraints,
5916
- panelId: panelData.id,
5917
- panelIndex
5918
- });
5919
- if (!isValid) {
5920
- devWarningsRef.current.didLogPanelConstraintsWarning = true;
5921
- break;
5922
- }
5923
- }
5924
- }
5925
- }
5926
- });
5927
- const collapsePanel = useCallback2((panelData) => {
5928
- const {
5929
- onLayout: onLayout2
5930
- } = committedValuesRef.current;
5931
- const {
5932
- layout: prevLayout,
5933
- panelDataArray
5934
- } = eagerValuesRef.current;
5935
- if (panelData.constraints.collapsible) {
5936
- const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5937
- const {
5938
- collapsedSize = 0,
5939
- panelSize,
5940
- pivotIndices
5941
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
5942
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5943
- if (!fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
5944
- panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
5945
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
5946
- const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
5947
- const nextLayout = adjustLayoutByDelta({
5948
- delta,
5949
- initialLayout: prevLayout,
5950
- panelConstraints: panelConstraintsArray,
5951
- pivotIndices,
5952
- prevLayout,
5953
- trigger: "imperative-api"
5954
- });
5955
- if (!compareLayouts(prevLayout, nextLayout)) {
5956
- setLayout(nextLayout);
5957
- eagerValuesRef.current.layout = nextLayout;
5958
- if (onLayout2) {
5959
- onLayout2(nextLayout);
5960
- }
5961
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5962
- }
5963
- }
5964
- }
5965
- }, []);
5966
- const expandPanel = useCallback2((panelData, minSizeOverride) => {
5967
- const {
5968
- onLayout: onLayout2
5969
- } = committedValuesRef.current;
5970
- const {
5971
- layout: prevLayout,
5972
- panelDataArray
5973
- } = eagerValuesRef.current;
5974
- if (panelData.constraints.collapsible) {
5975
- const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5976
- const {
5977
- collapsedSize = 0,
5978
- panelSize = 0,
5979
- minSize: minSizeFromProps = 0,
5980
- pivotIndices
5981
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
5982
- const minSize = minSizeOverride !== null && minSizeOverride !== undefined ? minSizeOverride : minSizeFromProps;
5983
- if (fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
5984
- const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
5985
- const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
5986
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
5987
- const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
5988
- const nextLayout = adjustLayoutByDelta({
5989
- delta,
5990
- initialLayout: prevLayout,
5991
- panelConstraints: panelConstraintsArray,
5992
- pivotIndices,
5993
- prevLayout,
5994
- trigger: "imperative-api"
5995
- });
5996
- if (!compareLayouts(prevLayout, nextLayout)) {
5997
- setLayout(nextLayout);
5998
- eagerValuesRef.current.layout = nextLayout;
5999
- if (onLayout2) {
6000
- onLayout2(nextLayout);
6001
- }
6002
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
6003
- }
6004
- }
6005
- }
6006
- }, []);
6007
- const getPanelSize = useCallback2((panelData) => {
6008
- const {
6009
- layout: layout2,
6010
- panelDataArray
6011
- } = eagerValuesRef.current;
6012
- const {
6013
- panelSize
6014
- } = panelDataHelper(panelDataArray, panelData, layout2);
6015
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
6016
- return panelSize;
6017
- }, []);
6018
- const getPanelStyle = useCallback2((panelData, defaultSize) => {
6019
- const {
6020
- panelDataArray
6021
- } = eagerValuesRef.current;
6022
- const panelIndex = findPanelDataIndex(panelDataArray, panelData);
6023
- return computePanelFlexBoxStyle({
6024
- defaultSize,
6025
- dragState,
6026
- layout,
6027
- panelData: panelDataArray,
6028
- panelIndex
6029
- });
6030
- }, [dragState, layout]);
6031
- const isPanelCollapsed = useCallback2((panelData) => {
6032
- const {
6033
- layout: layout2,
6034
- panelDataArray
6035
- } = eagerValuesRef.current;
6036
- const {
6037
- collapsedSize = 0,
6038
- collapsible,
6039
- panelSize
6040
- } = panelDataHelper(panelDataArray, panelData, layout2);
6041
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
6042
- return collapsible === true && fuzzyNumbersEqual$1(panelSize, collapsedSize);
6043
- }, []);
6044
- const isPanelExpanded = useCallback2((panelData) => {
6045
- const {
6046
- layout: layout2,
6047
- panelDataArray
6048
- } = eagerValuesRef.current;
6049
- const {
6050
- collapsedSize = 0,
6051
- collapsible,
6052
- panelSize
6053
- } = panelDataHelper(panelDataArray, panelData, layout2);
6054
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
6055
- return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0;
6056
- }, []);
6057
- const registerPanel = useCallback2((panelData) => {
6058
- const {
6059
- panelDataArray
6060
- } = eagerValuesRef.current;
6061
- panelDataArray.push(panelData);
6062
- panelDataArray.sort((panelA, panelB) => {
6063
- const orderA = panelA.order;
6064
- const orderB = panelB.order;
6065
- if (orderA == null && orderB == null) {
6066
- return 0;
6067
- } else if (orderA == null) {
6068
- return -1;
6069
- } else if (orderB == null) {
6070
- return 1;
6071
- } else {
6072
- return orderA - orderB;
6073
- }
6074
- });
6075
- eagerValuesRef.current.panelDataArrayChanged = true;
6076
- forceUpdate();
6077
- }, [forceUpdate]);
6078
- useIsomorphicLayoutEffect(() => {
6079
- if (eagerValuesRef.current.panelDataArrayChanged) {
6080
- eagerValuesRef.current.panelDataArrayChanged = false;
6081
- const {
6082
- autoSaveId: autoSaveId2,
6083
- onLayout: onLayout2,
6084
- storage: storage2
6085
- } = committedValuesRef.current;
6086
- const {
6087
- layout: prevLayout,
6088
- panelDataArray
6089
- } = eagerValuesRef.current;
6090
- let unsafeLayout = null;
6091
- if (autoSaveId2) {
6092
- const state = loadPanelGroupState(autoSaveId2, panelDataArray, storage2);
6093
- if (state) {
6094
- panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
6095
- unsafeLayout = state.layout;
6096
- }
6097
- }
6098
- if (unsafeLayout == null) {
6099
- unsafeLayout = calculateUnsafeDefaultLayout({
6100
- panelDataArray
6101
- });
6102
- }
6103
- const nextLayout = validatePanelGroupLayout({
6104
- layout: unsafeLayout,
6105
- panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
6106
- });
6107
- if (!areEqual(prevLayout, nextLayout)) {
6108
- setLayout(nextLayout);
6109
- eagerValuesRef.current.layout = nextLayout;
6110
- if (onLayout2) {
6111
- onLayout2(nextLayout);
6112
- }
6113
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
6114
- }
6115
- }
6116
- });
6117
- useIsomorphicLayoutEffect(() => {
6118
- const eagerValues = eagerValuesRef.current;
6119
- return () => {
6120
- eagerValues.layout = [];
6121
- };
6122
- }, []);
6123
- const registerResizeHandle2 = useCallback2((dragHandleId) => {
6124
- let isRTL = false;
6125
- const panelGroupElement = panelGroupElementRef.current;
6126
- if (panelGroupElement) {
6127
- const style2 = window.getComputedStyle(panelGroupElement, null);
6128
- if (style2.getPropertyValue("direction") === "rtl") {
6129
- isRTL = true;
6130
- }
6131
- }
6132
- return function resizeHandler(event) {
6133
- event.preventDefault();
6134
- const panelGroupElement2 = panelGroupElementRef.current;
6135
- if (!panelGroupElement2) {
6136
- return () => null;
6137
- }
6138
- const {
6139
- direction: direction2,
6140
- dragState: dragState2,
6141
- id: groupId2,
6142
- keyboardResizeBy: keyboardResizeBy2,
6143
- onLayout: onLayout2
6144
- } = committedValuesRef.current;
6145
- const {
6146
- layout: prevLayout,
6147
- panelDataArray
6148
- } = eagerValuesRef.current;
6149
- const {
6150
- initialLayout
6151
- } = dragState2 !== null && dragState2 !== undefined ? dragState2 : {};
6152
- const pivotIndices = determinePivotIndices(groupId2, dragHandleId, panelGroupElement2);
6153
- let delta = calculateDeltaPercentage(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
6154
- const isHorizontal = direction2 === "horizontal";
6155
- if (isHorizontal && isRTL) {
6156
- delta = -delta;
6157
- }
6158
- const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
6159
- const nextLayout = adjustLayoutByDelta({
6160
- delta,
6161
- initialLayout: initialLayout !== null && initialLayout !== undefined ? initialLayout : prevLayout,
6162
- panelConstraints,
6163
- pivotIndices,
6164
- prevLayout,
6165
- trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
6166
- });
6167
- const layoutChanged = !compareLayouts(prevLayout, nextLayout);
6168
- if (isPointerEvent(event) || isMouseEvent(event)) {
6169
- if (prevDeltaRef.current != delta) {
6170
- prevDeltaRef.current = delta;
6171
- if (!layoutChanged && delta !== 0) {
6172
- if (isHorizontal) {
6173
- reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
6174
- } else {
6175
- reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
6176
- }
6177
- } else {
6178
- reportConstraintsViolation(dragHandleId, 0);
6179
- }
6180
- }
6181
- }
6182
- if (layoutChanged) {
6183
- setLayout(nextLayout);
6184
- eagerValuesRef.current.layout = nextLayout;
6185
- if (onLayout2) {
6186
- onLayout2(nextLayout);
6187
- }
6188
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
6189
- }
6190
- };
6191
- }, []);
6192
- const resizePanel2 = useCallback2((panelData, unsafePanelSize) => {
6193
- const {
6194
- onLayout: onLayout2
6195
- } = committedValuesRef.current;
6196
- const {
6197
- layout: prevLayout,
6198
- panelDataArray
6199
- } = eagerValuesRef.current;
6200
- const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
6201
- const {
6202
- panelSize,
6203
- pivotIndices
6204
- } = panelDataHelper(panelDataArray, panelData, prevLayout);
6205
- assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
6206
- const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
6207
- const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
6208
- const nextLayout = adjustLayoutByDelta({
6209
- delta,
6210
- initialLayout: prevLayout,
6211
- panelConstraints: panelConstraintsArray,
6212
- pivotIndices,
6213
- prevLayout,
6214
- trigger: "imperative-api"
6215
- });
6216
- if (!compareLayouts(prevLayout, nextLayout)) {
6217
- setLayout(nextLayout);
6218
- eagerValuesRef.current.layout = nextLayout;
6219
- if (onLayout2) {
6220
- onLayout2(nextLayout);
6221
- }
6222
- callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
6223
- }
6224
- }, []);
6225
- const reevaluatePanelConstraints = useCallback2((panelData, prevConstraints) => {
6226
- const {
6227
- layout: layout2,
6228
- panelDataArray
6229
- } = eagerValuesRef.current;
6230
- const {
6231
- collapsedSize: prevCollapsedSize = 0,
6232
- collapsible: prevCollapsible
6233
- } = prevConstraints;
6234
- const {
6235
- collapsedSize: nextCollapsedSize = 0,
6236
- collapsible: nextCollapsible,
6237
- maxSize: nextMaxSize = 100,
6238
- minSize: nextMinSize = 0
6239
- } = panelData.constraints;
6240
- const {
6241
- panelSize: prevPanelSize
6242
- } = panelDataHelper(panelDataArray, panelData, layout2);
6243
- if (prevPanelSize == null) {
6244
- return;
6245
- }
6246
- if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
6247
- if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) {
6248
- resizePanel2(panelData, nextCollapsedSize);
6249
- }
6250
- } else if (prevPanelSize < nextMinSize) {
6251
- resizePanel2(panelData, nextMinSize);
6252
- } else if (prevPanelSize > nextMaxSize) {
6253
- resizePanel2(panelData, nextMaxSize);
6254
- }
6255
- }, [resizePanel2]);
6256
- const startDragging = useCallback2((dragHandleId, event) => {
6257
- const {
6258
- direction: direction2
6259
- } = committedValuesRef.current;
6260
- const {
6261
- layout: layout2
6262
- } = eagerValuesRef.current;
6263
- if (!panelGroupElementRef.current) {
6264
- return;
6265
- }
6266
- const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
6267
- assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
6268
- const initialCursorPosition = getResizeEventCursorPosition(direction2, event);
6269
- setDragState({
6270
- dragHandleId,
6271
- dragHandleRect: handleElement.getBoundingClientRect(),
6272
- initialCursorPosition,
6273
- initialLayout: layout2
6274
- });
6275
- }, []);
6276
- const stopDragging = useCallback2(() => {
6277
- setDragState(null);
6278
- }, []);
6279
- const unregisterPanel = useCallback2((panelData) => {
6280
- const {
6281
- panelDataArray
6282
- } = eagerValuesRef.current;
6283
- const index = findPanelDataIndex(panelDataArray, panelData);
6284
- if (index >= 0) {
6285
- panelDataArray.splice(index, 1);
6286
- delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
6287
- eagerValuesRef.current.panelDataArrayChanged = true;
6288
- forceUpdate();
6289
- }
6290
- }, [forceUpdate]);
6291
- const context = useMemo3(() => ({
6292
- collapsePanel,
6293
- direction,
6294
- dragState,
6295
- expandPanel,
6296
- getPanelSize,
6297
- getPanelStyle,
6298
- groupId,
6299
- isPanelCollapsed,
6300
- isPanelExpanded,
6301
- reevaluatePanelConstraints,
6302
- registerPanel,
6303
- registerResizeHandle: registerResizeHandle2,
6304
- resizePanel: resizePanel2,
6305
- startDragging,
6306
- stopDragging,
6307
- unregisterPanel,
6308
- panelGroupElement: panelGroupElementRef.current
6309
- }), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle2, resizePanel2, startDragging, stopDragging, unregisterPanel]);
6310
- const style = {
6311
- display: "flex",
6312
- flexDirection: direction === "horizontal" ? "row" : "column",
6313
- height: "100%",
6314
- overflow: "hidden",
6315
- width: "100%"
6316
- };
6317
- return createElement(PanelGroupContext.Provider, {
6318
- value: context
6319
- }, createElement(Type, {
6320
- ...rest,
6321
- children,
6322
- className: classNameFromProps,
6323
- id: idFromProps,
6324
- ref: panelGroupElementRef,
6325
- style: {
6326
- ...style,
6327
- ...styleFromProps
6328
- },
6329
- [DATA_ATTRIBUTES.group]: "",
6330
- [DATA_ATTRIBUTES.groupDirection]: direction,
6331
- [DATA_ATTRIBUTES.groupId]: groupId
6332
- }));
6333
- }
6334
- var PanelGroup = forwardRef((props2, ref) => createElement(PanelGroupWithForwardedRef, {
6335
- ...props2,
6336
- forwardedRef: ref
6337
- }));
6338
- PanelGroupWithForwardedRef.displayName = "PanelGroup";
6339
- PanelGroup.displayName = "forwardRef(PanelGroup)";
6340
- function findPanelDataIndex(panelDataArray, panelData) {
6341
- return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
6342
- }
6343
- function panelDataHelper(panelDataArray, panelData, layout) {
6344
- const panelIndex = findPanelDataIndex(panelDataArray, panelData);
6345
- const isLastPanel = panelIndex === panelDataArray.length - 1;
6346
- const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
6347
- const panelSize = layout[panelIndex];
6348
- return {
6349
- ...panelData.constraints,
6350
- panelSize,
6351
- pivotIndices
6352
- };
6353
- }
6354
- function useWindowSplitterResizeHandlerBehavior({
6355
- disabled,
6356
- handleId,
6357
- resizeHandler,
6358
- panelGroupElement
6359
- }) {
6360
- useEffect8(() => {
6361
- if (disabled || resizeHandler == null || panelGroupElement == null) {
6362
- return;
6363
- }
6364
- const handleElement = getResizeHandleElement(handleId, panelGroupElement);
6365
- if (handleElement == null) {
6366
- return;
6367
- }
6368
- const onKeyDown = (event) => {
6369
- if (event.defaultPrevented) {
6370
- return;
6371
- }
6372
- switch (event.key) {
6373
- case "ArrowDown":
6374
- case "ArrowLeft":
6375
- case "ArrowRight":
6376
- case "ArrowUp":
6377
- case "End":
6378
- case "Home": {
6379
- event.preventDefault();
6380
- resizeHandler(event);
6381
- break;
6382
- }
6383
- case "F6": {
6384
- event.preventDefault();
6385
- const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
6386
- assert(groupId, `No group element found for id "${groupId}"`);
6387
- const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
6388
- const index = getResizeHandleElementIndex(groupId, handleId, panelGroupElement);
6389
- assert(index !== null, `No resize element found for id "${handleId}"`);
6390
- const nextIndex = event.shiftKey ? index > 0 ? index - 1 : handles.length - 1 : index + 1 < handles.length ? index + 1 : 0;
6391
- const nextHandle = handles[nextIndex];
6392
- nextHandle.focus();
6393
- break;
6394
- }
6395
- }
6396
- };
6397
- handleElement.addEventListener("keydown", onKeyDown);
6398
- return () => {
6399
- handleElement.removeEventListener("keydown", onKeyDown);
6400
- };
6401
- }, [panelGroupElement, disabled, handleId, resizeHandler]);
6402
- }
6403
- function PanelResizeHandle({
6404
- children = null,
6405
- className: classNameFromProps = "",
6406
- disabled = false,
6407
- hitAreaMargins,
6408
- id: idFromProps,
6409
- onBlur,
6410
- onClick,
6411
- onDragging,
6412
- onFocus,
6413
- onPointerDown,
6414
- onPointerUp,
6415
- style: styleFromProps = {},
6416
- tabIndex = 0,
6417
- tagName: Type = "div",
6418
- ...rest
6419
- }) {
6420
- var _hitAreaMargins$coars, _hitAreaMargins$fine;
6421
- const elementRef = useRef8(null);
6422
- const callbacksRef = useRef8({
6423
- onClick,
6424
- onDragging,
6425
- onPointerDown,
6426
- onPointerUp
6427
- });
6428
- useEffect8(() => {
6429
- callbacksRef.current.onClick = onClick;
6430
- callbacksRef.current.onDragging = onDragging;
6431
- callbacksRef.current.onPointerDown = onPointerDown;
6432
- callbacksRef.current.onPointerUp = onPointerUp;
6433
- });
6434
- const panelGroupContext = useContext2(PanelGroupContext);
6435
- if (panelGroupContext === null) {
6436
- throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
6437
- }
6438
- const {
6439
- direction,
6440
- groupId,
6441
- registerResizeHandle: registerResizeHandleWithParentGroup,
6442
- startDragging,
6443
- stopDragging,
6444
- panelGroupElement
6445
- } = panelGroupContext;
6446
- const resizeHandleId = useUniqueId(idFromProps);
6447
- const [state, setState] = useState10("inactive");
6448
- const [isFocused, setIsFocused] = useState10(false);
6449
- const [resizeHandler, setResizeHandler] = useState10(null);
6450
- const committedValuesRef = useRef8({
6451
- state
6452
- });
6453
- useIsomorphicLayoutEffect(() => {
6454
- committedValuesRef.current.state = state;
6455
- });
6456
- useEffect8(() => {
6457
- if (disabled) {
6458
- setResizeHandler(null);
6459
- } else {
6460
- const resizeHandler2 = registerResizeHandleWithParentGroup(resizeHandleId);
6461
- setResizeHandler(() => resizeHandler2);
6462
- }
6463
- }, [disabled, resizeHandleId, registerResizeHandleWithParentGroup]);
6464
- const coarseHitAreaMargins = (_hitAreaMargins$coars = hitAreaMargins === null || hitAreaMargins === undefined ? undefined : hitAreaMargins.coarse) !== null && _hitAreaMargins$coars !== undefined ? _hitAreaMargins$coars : 15;
6465
- const fineHitAreaMargins = (_hitAreaMargins$fine = hitAreaMargins === null || hitAreaMargins === undefined ? undefined : hitAreaMargins.fine) !== null && _hitAreaMargins$fine !== undefined ? _hitAreaMargins$fine : 5;
6466
- useEffect8(() => {
6467
- if (disabled || resizeHandler == null) {
6468
- return;
6469
- }
6470
- const element = elementRef.current;
6471
- assert(element, "Element ref not attached");
6472
- let didMove = false;
6473
- const setResizeHandlerState = (action, isActive, event) => {
6474
- if (!isActive) {
6475
- setState("inactive");
6476
- return;
6477
- }
6478
- switch (action) {
6479
- case "down": {
6480
- setState("drag");
6481
- didMove = false;
6482
- assert(event, 'Expected event to be defined for "down" action');
6483
- startDragging(resizeHandleId, event);
6484
- const {
6485
- onDragging: onDragging2,
6486
- onPointerDown: onPointerDown2
6487
- } = callbacksRef.current;
6488
- onDragging2 === null || onDragging2 === undefined || onDragging2(true);
6489
- onPointerDown2 === null || onPointerDown2 === undefined || onPointerDown2();
6490
- break;
6491
- }
6492
- case "move": {
6493
- const {
6494
- state: state2
6495
- } = committedValuesRef.current;
6496
- didMove = true;
6497
- if (state2 !== "drag") {
6498
- setState("hover");
6499
- }
6500
- assert(event, 'Expected event to be defined for "move" action');
6501
- resizeHandler(event);
6502
- break;
6503
- }
6504
- case "up": {
6505
- setState("hover");
6506
- stopDragging();
6507
- const {
6508
- onClick: onClick2,
6509
- onDragging: onDragging2,
6510
- onPointerUp: onPointerUp2
6511
- } = callbacksRef.current;
6512
- onDragging2 === null || onDragging2 === undefined || onDragging2(false);
6513
- onPointerUp2 === null || onPointerUp2 === undefined || onPointerUp2();
6514
- if (!didMove) {
6515
- onClick2 === null || onClick2 === undefined || onClick2();
6516
- }
6517
- break;
6518
- }
6519
- }
6520
- };
6521
- return registerResizeHandle(resizeHandleId, element, direction, {
6522
- coarse: coarseHitAreaMargins,
6523
- fine: fineHitAreaMargins
6524
- }, setResizeHandlerState);
6525
- }, [coarseHitAreaMargins, direction, disabled, fineHitAreaMargins, registerResizeHandleWithParentGroup, resizeHandleId, resizeHandler, startDragging, stopDragging]);
6526
- useWindowSplitterResizeHandlerBehavior({
6527
- disabled,
6528
- handleId: resizeHandleId,
6529
- resizeHandler,
6530
- panelGroupElement
6531
- });
6532
- const style = {
6533
- touchAction: "none",
6534
- userSelect: "none"
6535
- };
6536
- return createElement(Type, {
6537
- ...rest,
6538
- children,
6539
- className: classNameFromProps,
6540
- id: idFromProps,
6541
- onBlur: () => {
6542
- setIsFocused(false);
6543
- onBlur === null || onBlur === undefined || onBlur();
6544
- },
6545
- onFocus: () => {
6546
- setIsFocused(true);
6547
- onFocus === null || onFocus === undefined || onFocus();
6548
- },
6549
- ref: elementRef,
6550
- role: "separator",
6551
- style: {
6552
- ...style,
6553
- ...styleFromProps
6554
- },
6555
- tabIndex,
6556
- [DATA_ATTRIBUTES.groupDirection]: direction,
6557
- [DATA_ATTRIBUTES.groupId]: groupId,
6558
- [DATA_ATTRIBUTES.resizeHandle]: "",
6559
- [DATA_ATTRIBUTES.resizeHandleActive]: state === "drag" ? "pointer" : isFocused ? "keyboard" : undefined,
6560
- [DATA_ATTRIBUTES.resizeHandleEnabled]: !disabled,
6561
- [DATA_ATTRIBUTES.resizeHandleId]: resizeHandleId,
6562
- [DATA_ATTRIBUTES.resizeHandleState]: state
6563
- });
6564
- }
6565
- PanelResizeHandle.displayName = "PanelResizeHandle";
6566
-
6567
- // node_modules/@principal-ade/panels/dist/index.esm.js
6568
- import { flushSync as y, unstable_batchedUpdates as w, createPortal as x } from "react-dom";
6569
- function C(e2) {
6570
- return { "--panel-background": e2.colors.background, "--panel-border": e2.colors.border, "--panel-handle": e2.colors.backgroundSecondary, "--panel-handle-hover": e2.colors.backgroundHover, "--panel-handle-active": e2.colors.primary, "--panel-button-bg": e2.colors.surface, "--panel-button-hover": e2.colors.backgroundHover, "--panel-button-border": e2.colors.border, "--panel-button-icon": e2.colors.textSecondary, "--panel-accent-bg": e2.colors.primary + "15" };
6571
- }
6572
- var R = ({ leftPanel: n2, rightPanel: r2, collapsibleSide: s2 = "left", defaultSize: c2 = 25, minSize: d2 = 5, className: u2 = "", collapsed: p2 = false, style: h2, showCollapseButton: m2 = false, animationDuration: f2 = 300, animationEasing: y2 = "cubic-bezier(0.4, 0, 0.2, 1)", onCollapseStart: w2, onCollapseComplete: x2, onExpandStart: S, onExpandComplete: R2, theme: N }) => {
6573
- const [E, D] = o(p2), [z, M] = o(false), [T, A] = o(false), [k, L] = o(p2), [P, F] = o(p2 ? 0 : c2), $ = i(null), B = i(undefined), O = i(undefined), I = i(undefined), q = a((e2, t2, n3) => {
6574
- if (!$.current)
6575
- return;
6576
- B.current && cancelAnimationFrame(B.current), O.current = performance.now();
6577
- const r3 = (o2) => {
6578
- if (!O.current || !$.current)
6579
- return;
6580
- const i2 = o2 - O.current, a2 = Math.min(i2 / f2, 1), l2 = a2 < 0.5 ? 4 * a2 * a2 * a2 : 1 - Math.pow(-2 * a2 + 2, 3) / 2, s3 = e2 + (t2 - e2) * l2;
6581
- $.current.resize(s3), a2 < 1 ? B.current = requestAnimationFrame(r3) : (t2 === 0 ? $.current.collapse() : $.current.resize(t2), M(false), n3 && n3());
6582
- };
6583
- B.current = requestAnimationFrame(r3);
6584
- }, [f2]), W = a(() => {
6585
- z || T || (M(true), D(true), w2 && w2(), q(P, 0, () => {
6586
- F(0), L(true), x2 && x2();
6587
- }));
6588
- }, [z, T, P, q, w2, x2]), _ = a(() => {
6589
- z || T || (M(true), D(false), L(false), S && S(), q(0, c2, () => {
6590
- F(c2), R2 && R2();
6591
- }));
6592
- }, [z, T, c2, q, S, R2]), j = a(() => {
6593
- E ? _() : W();
6594
- }, [E, W, _]), H = a((e2) => {
6595
- z || (F(e2), e2 > 0 && D(false));
6596
- }, [z]), K = a(() => {
6597
- A(true);
6598
- }, []), U = a(() => {
6599
- A(false);
6600
- }, []);
6601
- l(() => {
6602
- p2 !== E && (p2 ? W() : _());
6603
- }, [p2]), l(() => {
6604
- p2 && !z ? L(true) : p2 || z || L(false);
6605
- }, [p2, z]), l(() => {
6606
- const e2 = B.current, t2 = I.current;
6607
- return () => {
6608
- e2 && cancelAnimationFrame(e2), t2 && clearTimeout(t2);
6609
- };
6610
- }, []);
6611
- const X = s2 === "left", Y = E ? X ? "▸" : "◂" : X ? "◂" : "▸", V = C(N), J = z && !T ? { transition: `flex ${f2}ms ${y2}` } : undefined, G = (e2) => {
6612
- let t2 = "hybrid-panel";
6613
- return e2 && (t2 += " collapsible-panel", z && !T && (t2 += " animating"), E && (t2 += " collapsed")), t2;
6614
- };
6615
- return e("div", { className: `animated-resizable-layout ${u2}`, style: { ...V, ...h2 }, children: /* @__PURE__ */ t(PanelGroup, { direction: "horizontal", onLayout: U, children: [
6616
- /* @__PURE__ */ e(Panel, { ref: X ? $ : undefined, collapsible: X, defaultSize: X ? p2 ? 0 : c2 : undefined, minSize: X ? d2 : 30, collapsedSize: 0, onResize: X ? H : undefined, onCollapse: X ? () => D(true) : undefined, onExpand: X ? () => D(false) : undefined, className: G(X), style: X ? J : undefined, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: X && E ? 0 : 1, transition: z ? `opacity ${0.5 * f2}ms ${y2}` : "none" }, children: n2 }) }),
6617
- /* @__PURE__ */ e(PanelResizeHandle, { className: "resize-handle " + (k ? "collapsed" : ""), onDragging: K, style: k ? { visibility: "hidden", width: 0 } : undefined, children: m2 && /* @__PURE__ */ e("div", { className: "handle-bar", children: /* @__PURE__ */ e("button", { onClick: j, className: "collapse-toggle", disabled: z, "aria-label": E ? "Expand panel" : "Collapse panel", children: Y }) }) }),
6618
- /* @__PURE__ */ e(Panel, { ref: X ? undefined : $, collapsible: !X, defaultSize: X ? undefined : p2 ? 0 : c2, minSize: X ? 30 : d2, collapsedSize: 0, onResize: X ? undefined : H, onCollapse: X ? undefined : () => D(true), onExpand: X ? undefined : () => D(false), className: G(!X), style: X ? undefined : J, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: !X && E ? 0 : 1, transition: z ? `opacity ${0.5 * f2}ms ${y2}` : "none" }, children: r2 }) })
6619
- ] }) });
6620
- };
6621
- var z = s(({ panels: o2, className: a2 = "", style: s2, theme: d2, minPanelWidth: u2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m2, preventKeyboardScroll: f2 = true, disableSwipe: g = false }, v) => {
6622
- const b = i(null), y2 = i(false), w2 = i(null), x2 = C(d2);
6623
- c(v, () => ({ scrollToPanel: (e2) => {
6624
- if (!b.current)
6625
- return;
6626
- const t2 = b.current, n2 = t2.children[e2];
6627
- if (n2) {
6628
- y2.current = true, w2.current && clearTimeout(w2.current);
6629
- const e3 = n2.offsetLeft;
6630
- t2.scrollTo({ left: e3, behavior: "smooth" }), w2.current = setTimeout(() => {
6631
- y2.current = false;
6632
- }, 500);
6633
- }
6634
- }, getCurrentPanel: () => {
6635
- if (!b.current || b.current.children.length === 0)
6636
- return 0;
6637
- const e2 = b.current, t2 = e2.getBoundingClientRect().left;
6638
- let n2 = 0, r2 = 1 / 0;
6639
- for (let o3 = 0;o3 < e2.children.length; o3++) {
6640
- const i2 = e2.children[o3].getBoundingClientRect(), a3 = Math.abs(i2.left - t2);
6641
- a3 < r2 && (r2 = a3, n2 = o3);
6642
- }
6643
- return n2;
6644
- } }));
6645
- l(() => {
6646
- if (!f2 || !b.current)
6647
- return;
6648
- const e2 = b.current, t2 = (e3) => {
6649
- const t3 = e3.target;
6650
- if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
6651
- return;
6652
- [" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e3.key) && e3.preventDefault();
6653
- };
6654
- return e2.addEventListener("keydown", t2), () => {
6655
- e2.removeEventListener("keydown", t2);
6656
- };
6657
- }, [f2]), l(() => () => {
6658
- w2.current && clearTimeout(w2.current);
6659
- }, []);
6660
- const S = o2.length, R2 = 2 * u2;
6661
- let N;
6662
- N = S === 1 || S === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
6663
- const E = r.useId().replace(/:/g, "_");
6664
- return t(n, { children: [
6665
- S === 2 && /* @__PURE__ */ e("style", { children: `
6666
- .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
6667
- width: 100%;
6668
- }
6669
- @container (min-width: ${R2}px) {
6670
- .snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
6671
- width: 50%;
6672
- }
6673
- }
6674
- ` }),
6675
- /* @__PURE__ */ e("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a2}`, style: { ...x2, ...s2, "--snap-carousel-min-width": `${u2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": N, "--snap-carousel-panel-count": S, "--snap-carousel-two-panel-threshold": `${R2}px` }, onScroll: (e2) => {
6676
- if (!m2 || !b.current || b.current.children.length === 0)
6677
- return;
6678
- if (y2.current)
6679
- return;
6680
- const t2 = b.current, n2 = t2.getBoundingClientRect().left;
6681
- let r2 = 0, o3 = 1 / 0;
6682
- for (let i2 = 0;i2 < t2.children.length; i2++) {
6683
- const e3 = t2.children[i2].getBoundingClientRect(), a3 = Math.abs(e3.left - n2);
6684
- a3 < o3 && (o3 = a3, r2 = i2);
6685
- }
6686
- m2(r2);
6687
- }, "data-panel-count": S, "data-carousel-id": E, children: o2.map((t2, n2) => /* @__PURE__ */ e("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
6688
- ] });
6689
- });
6690
- z.displayName = "SnapCarousel";
6691
- var A = typeof window != "undefined" && window.document !== undefined && window.document.createElement !== undefined;
6692
- function k(e2) {
6693
- const t2 = Object.prototype.toString.call(e2);
6694
- return t2 === "[object Window]" || t2 === "[object global]";
6695
- }
6696
- function L(e2) {
6697
- return "nodeType" in e2;
6698
- }
6699
- function P(e2) {
6700
- var t2, n2;
6701
- return e2 ? k(e2) ? e2 : L(e2) && (t2 = (n2 = e2.ownerDocument) == null ? undefined : n2.defaultView) != null ? t2 : window : window;
6702
- }
6703
- function F(e2) {
6704
- const { Document: t2 } = P(e2);
6705
- return e2 instanceof t2;
6706
- }
6707
- function $(e2) {
6708
- return !k(e2) && e2 instanceof P(e2).HTMLElement;
6709
- }
6710
- function B(e2) {
6711
- return e2 instanceof P(e2).SVGElement;
6712
- }
6713
- function O(e2) {
6714
- return e2 ? k(e2) ? e2.document : L(e2) ? F(e2) ? e2 : $(e2) || B(e2) ? e2.ownerDocument : document : document : document;
6715
- }
6716
- function X(e2) {
6717
- return function(t2) {
6718
- for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
6719
- r2[o2 - 1] = arguments[o2];
6720
- return r2.reduce((t3, n3) => {
6721
- const r3 = Object.entries(n3);
6722
- for (const [o3, i2] of r3) {
6723
- const n4 = t3[o3];
6724
- n4 != null && (t3[o3] = n4 + e2 * i2);
6725
- }
6726
- return t3;
6727
- }, { ...t2 });
6728
- };
6729
- }
6730
- var Y = /* @__PURE__ */ X(1);
6731
- var V = /* @__PURE__ */ X(-1);
6732
- function J(e2) {
6733
- if (!e2)
6734
- return false;
6735
- const { KeyboardEvent: t2 } = P(e2.target);
6736
- return t2 && e2 instanceof t2;
6737
- }
6738
- function G(e2) {
6739
- if (function(e3) {
6740
- if (!e3)
6741
- return false;
6742
- const { TouchEvent: t2 } = P(e3.target);
6743
- return t2 && e3 instanceof t2;
6744
- }(e2)) {
6745
- if (e2.touches && e2.touches.length) {
6746
- const { clientX: t2, clientY: n2 } = e2.touches[0];
6747
- return { x: t2, y: n2 };
6748
- }
6749
- if (e2.changedTouches && e2.changedTouches.length) {
6750
- const { clientX: t2, clientY: n2 } = e2.changedTouches[0];
6751
- return { x: t2, y: n2 };
6752
- }
6753
- }
6754
- return function(e3) {
6755
- return "clientX" in e3 && "clientY" in e3;
6756
- }(e2) ? { x: e2.clientX, y: e2.clientY } : null;
6757
- }
6758
- var le;
6759
- var se;
6760
- (se = le || (le = {})).DragStart = "dragStart", se.DragMove = "dragMove", se.DragEnd = "dragEnd", se.DragCancel = "dragCancel", se.DragOver = "dragOver", se.RegisterDroppable = "registerDroppable", se.SetDroppableDisabled = "setDroppableDisabled", se.UnregisterDroppable = "unregisterDroppable";
6761
- var de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
6762
- var xe = { ignoreTransform: false };
6763
- function Ce(e2, t2) {
6764
- t2 === undefined && (t2 = xe);
6765
- let n2 = e2.getBoundingClientRect();
6766
- if (t2.ignoreTransform) {
6767
- const { transform: t3, transformOrigin: r3 } = P(e2).getComputedStyle(e2);
6768
- t3 && (n2 = function(e3, t4, n3) {
6769
- const r4 = function(e4) {
6770
- if (e4.startsWith("matrix3d(")) {
6771
- const t5 = e4.slice(9, -1).split(/, /);
6772
- return { x: +t5[12], y: +t5[13], scaleX: +t5[0], scaleY: +t5[5] };
6773
- }
6774
- if (e4.startsWith("matrix(")) {
6775
- const t5 = e4.slice(7, -1).split(/, /);
6776
- return { x: +t5[4], y: +t5[5], scaleX: +t5[0], scaleY: +t5[3] };
6777
- }
6778
- return null;
6779
- }(t4);
6780
- if (!r4)
6781
- return e3;
6782
- const { scaleX: o3, scaleY: i3, x: a3, y: l3 } = r4, s3 = e3.left - a3 - (1 - o3) * parseFloat(n3), c2 = e3.top - l3 - (1 - i3) * parseFloat(n3.slice(n3.indexOf(" ") + 1)), d2 = o3 ? e3.width / o3 : e3.width, u2 = i3 ? e3.height / i3 : e3.height;
6783
- return { width: d2, height: u2, top: c2, right: s3 + d2, bottom: c2 + u2, left: s3 };
6784
- }(n2, t3, r3));
6785
- }
6786
- const { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 } = n2;
6787
- return { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 };
6788
- }
6789
- function Se(e2) {
6790
- return Ce(e2, { ignoreTransform: true });
6791
- }
6792
- function Re(e2, t2) {
6793
- const n2 = [];
6794
- return e2 ? function r(o2) {
6795
- if (t2 != null && n2.length >= t2)
6796
- return n2;
6797
- if (!o2)
6798
- return n2;
6799
- if (F(o2) && o2.scrollingElement != null && !n2.includes(o2.scrollingElement))
6800
- return n2.push(o2.scrollingElement), n2;
6801
- if (!$(o2) || B(o2))
6802
- return n2;
6803
- if (n2.includes(o2))
6804
- return n2;
6805
- const i2 = P(e2).getComputedStyle(o2);
6806
- return o2 !== e2 && function(e3, t3) {
6807
- t3 === undefined && (t3 = P(e3).getComputedStyle(e3));
6808
- const n3 = /(auto|scroll|overlay)/;
6809
- return ["overflow", "overflowX", "overflowY"].some((e4) => {
6810
- const r2 = t3[e4];
6811
- return typeof r2 == "string" && n3.test(r2);
6812
- });
6813
- }(o2, i2) && n2.push(o2), function(e3, t3) {
6814
- return t3 === undefined && (t3 = P(e3).getComputedStyle(e3)), t3.position === "fixed";
6815
- }(o2, i2) ? n2 : r(o2.parentNode);
6816
- }(e2) : n2;
6817
- }
6818
- function Ne(e2) {
6819
- const [t2] = Re(e2, 1);
6820
- return t2 != null ? t2 : null;
6821
- }
6822
- var Te;
6823
- var Ae;
6824
- function ke(e2) {
6825
- return !(!A || !e2) && e2 === document.scrollingElement;
6826
- }
6827
- function Le(e2) {
6828
- const t2 = { x: 0, y: 0 }, n2 = ke(e2) ? { height: window.innerHeight, width: window.innerWidth } : { height: e2.clientHeight, width: e2.clientWidth }, r2 = { x: e2.scrollWidth - n2.width, y: e2.scrollHeight - n2.height };
6829
- return { isTop: e2.scrollTop <= t2.y, isLeft: e2.scrollLeft <= t2.x, isBottom: e2.scrollTop >= r2.y, isRight: e2.scrollLeft >= r2.x, maxScroll: r2, minScroll: t2 };
6830
- }
6831
- (Ae = Te || (Te = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
6832
- function $e(e2) {
6833
- if (e2 === document.scrollingElement) {
6834
- const { innerWidth: e3, innerHeight: t3 } = window;
6835
- return { top: 0, left: 0, right: e3, bottom: t3, width: e3, height: t3 };
6836
- }
6837
- const { top: t2, left: n2, right: r2, bottom: o2 } = e2.getBoundingClientRect();
6838
- return { top: t2, left: n2, right: r2, bottom: o2, width: e2.clientWidth, height: e2.clientHeight };
6839
- }
6840
- class qe {
6841
- constructor(e2) {
6842
- this.target = undefined, this.listeners = [], this.removeAll = () => {
6843
- this.listeners.forEach((e3) => {
6844
- var t2;
6845
- return (t2 = this.target) == null ? undefined : t2.removeEventListener(...e3);
6846
- });
6847
- }, this.target = e2;
6848
- }
6849
- add(e2, t2, n2) {
6850
- var r2;
6851
- (r2 = this.target) == null || r2.addEventListener(e2, t2, n2), this.listeners.push([e2, t2, n2]);
6852
- }
6853
- }
6854
- function We(e2, t2) {
6855
- const n2 = Math.abs(e2.x), r2 = Math.abs(e2.y);
6856
- return typeof t2 == "number" ? Math.sqrt(n2 ** 2 + r2 ** 2) > t2 : ("x" in t2) && ("y" in t2) ? n2 > t2.x && r2 > t2.y : ("x" in t2) ? n2 > t2.x : ("y" in t2) && r2 > t2.y;
6857
- }
6858
- var _e;
6859
- var je;
6860
- var He;
6861
- var Ke;
6862
- function Ue(e2) {
6863
- e2.preventDefault();
6864
- }
6865
- function Xe(e2) {
6866
- e2.stopPropagation();
6867
- }
6868
- (je = _e || (_e = {})).Click = "click", je.DragStart = "dragstart", je.Keydown = "keydown", je.ContextMenu = "contextmenu", je.Resize = "resize", je.SelectionChange = "selectionchange", je.VisibilityChange = "visibilitychange", (Ke = He || (He = {})).Space = "Space", Ke.Down = "ArrowDown", Ke.Right = "ArrowRight", Ke.Left = "ArrowLeft", Ke.Up = "ArrowUp", Ke.Esc = "Escape", Ke.Enter = "Enter", Ke.Tab = "Tab";
6869
- var Ye = { start: [He.Space, He.Enter], cancel: [He.Esc], end: [He.Space, He.Enter, He.Tab] };
6870
- var Ve = (e2, t2) => {
6871
- let { currentCoordinates: n2 } = t2;
6872
- switch (e2.code) {
6873
- case He.Right:
6874
- return { ...n2, x: n2.x + 25 };
6875
- case He.Left:
6876
- return { ...n2, x: n2.x - 25 };
6877
- case He.Down:
6878
- return { ...n2, y: n2.y + 25 };
6879
- case He.Up:
6880
- return { ...n2, y: n2.y - 25 };
6881
- }
6882
- };
6883
-
6884
- class Je {
6885
- constructor(e2) {
6886
- this.props = undefined, this.autoScrollEnabled = false, this.referenceCoordinates = undefined, this.listeners = undefined, this.windowListeners = undefined, this.props = e2;
6887
- const { event: { target: t2 } } = e2;
6888
- this.props = e2, this.listeners = new qe(O(t2)), this.windowListeners = new qe(P(t2)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
6889
- }
6890
- attach() {
6891
- this.handleStart(), this.windowListeners.add(_e.Resize, this.handleCancel), this.windowListeners.add(_e.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(_e.Keydown, this.handleKeyDown));
6892
- }
6893
- handleStart() {
6894
- const { activeNode: e2, onStart: t2 } = this.props, n2 = e2.node.current;
6895
- n2 && function(e3, t3) {
6896
- if (t3 === undefined && (t3 = Ce), !e3)
6897
- return;
6898
- const { top: n3, left: r2, bottom: o2, right: i2 } = t3(e3);
6899
- Ne(e3) && (o2 <= 0 || i2 <= 0 || n3 >= window.innerHeight || r2 >= window.innerWidth) && e3.scrollIntoView({ block: "center", inline: "center" });
6900
- }(n2), t2(de);
6901
- }
6902
- handleKeyDown(e2) {
6903
- if (J(e2)) {
6904
- const { active: t2, context: n2, options: r2 } = this.props, { keyboardCodes: o2 = Ye, coordinateGetter: i2 = Ve, scrollBehavior: a2 = "smooth" } = r2, { code: l2 } = e2;
6905
- if (o2.end.includes(l2))
6906
- return void this.handleEnd(e2);
6907
- if (o2.cancel.includes(l2))
6908
- return void this.handleCancel(e2);
6909
- const { collisionRect: s2 } = n2.current, c2 = s2 ? { x: s2.left, y: s2.top } : de;
6910
- this.referenceCoordinates || (this.referenceCoordinates = c2);
6911
- const d2 = i2(e2, { active: t2, context: n2.current, currentCoordinates: c2 });
6912
- if (d2) {
6913
- const t3 = V(d2, c2), r3 = { x: 0, y: 0 }, { scrollableAncestors: o3 } = n2.current;
6914
- for (const n3 of o3) {
6915
- const o4 = e2.code, { isTop: i3, isRight: l3, isLeft: s3, isBottom: c3, maxScroll: u2, minScroll: p2 } = Le(n3), h2 = $e(n3), m2 = { x: Math.min(o4 === He.Right ? h2.right - h2.width / 2 : h2.right, Math.max(o4 === He.Right ? h2.left : h2.left + h2.width / 2, d2.x)), y: Math.min(o4 === He.Down ? h2.bottom - h2.height / 2 : h2.bottom, Math.max(o4 === He.Down ? h2.top : h2.top + h2.height / 2, d2.y)) }, f2 = o4 === He.Right && !l3 || o4 === He.Left && !s3, g = o4 === He.Down && !c3 || o4 === He.Up && !i3;
6916
- if (f2 && m2.x !== d2.x) {
6917
- const e3 = n3.scrollLeft + t3.x, i4 = o4 === He.Right && e3 <= u2.x || o4 === He.Left && e3 >= p2.x;
6918
- if (i4 && !t3.y)
6919
- return void n3.scrollTo({ left: e3, behavior: a2 });
6920
- r3.x = i4 ? n3.scrollLeft - e3 : o4 === He.Right ? n3.scrollLeft - u2.x : n3.scrollLeft - p2.x, r3.x && n3.scrollBy({ left: -r3.x, behavior: a2 });
6921
- break;
6922
- }
6923
- if (g && m2.y !== d2.y) {
6924
- const e3 = n3.scrollTop + t3.y, i4 = o4 === He.Down && e3 <= u2.y || o4 === He.Up && e3 >= p2.y;
6925
- if (i4 && !t3.x)
6926
- return void n3.scrollTo({ top: e3, behavior: a2 });
6927
- r3.y = i4 ? n3.scrollTop - e3 : o4 === He.Down ? n3.scrollTop - u2.y : n3.scrollTop - p2.y, r3.y && n3.scrollBy({ top: -r3.y, behavior: a2 });
6928
- break;
6929
- }
6930
- }
6931
- this.handleMove(e2, Y(V(d2, this.referenceCoordinates), r3));
6932
- }
6933
- }
6934
- }
6935
- handleMove(e2, t2) {
6936
- const { onMove: n2 } = this.props;
6937
- e2.preventDefault(), n2(t2);
6938
- }
6939
- handleEnd(e2) {
6940
- const { onEnd: t2 } = this.props;
6941
- e2.preventDefault(), this.detach(), t2();
6942
- }
6943
- handleCancel(e2) {
6944
- const { onCancel: t2 } = this.props;
6945
- e2.preventDefault(), this.detach(), t2();
6946
- }
6947
- detach() {
6948
- this.listeners.removeAll(), this.windowListeners.removeAll();
6949
- }
6950
- }
6951
- function Ge(e2) {
6952
- return Boolean(e2 && "distance" in e2);
6953
- }
6954
- function Qe(e2) {
6955
- return Boolean(e2 && "delay" in e2);
6956
- }
6957
- Je.activators = [{ eventName: "onKeyDown", handler: (e2, t2, n2) => {
6958
- let { keyboardCodes: r2 = Ye, onActivation: o2 } = t2, { active: i2 } = n2;
6959
- const { code: a2 } = e2.nativeEvent;
6960
- if (r2.start.includes(a2)) {
6961
- const t3 = i2.activatorNode.current;
6962
- return (!t3 || e2.target === t3) && (e2.preventDefault(), o2 == null || o2({ event: e2.nativeEvent }), true);
6963
- }
6964
- return false;
6965
- } }];
6966
-
6967
- class Ze {
6968
- constructor(e2, t2, n2) {
6969
- var r2;
6970
- n2 === undefined && (n2 = function(e3) {
6971
- const { EventTarget: t3 } = P(e3);
6972
- return e3 instanceof t3 ? e3 : O(e3);
6973
- }(e2.event.target)), this.props = undefined, this.events = undefined, this.autoScrollEnabled = true, this.document = undefined, this.activated = false, this.initialCoordinates = undefined, this.timeoutId = null, this.listeners = undefined, this.documentListeners = undefined, this.windowListeners = undefined, this.props = e2, this.events = t2;
6974
- const { event: o2 } = e2, { target: i2 } = o2;
6975
- this.props = e2, this.events = t2, this.document = O(i2), this.documentListeners = new qe(this.document), this.listeners = new qe(n2), this.windowListeners = new qe(P(i2)), this.initialCoordinates = (r2 = G(o2)) != null ? r2 : de, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
6976
- }
6977
- attach() {
6978
- const { events: e2, props: { options: { activationConstraint: t2, bypassActivationConstraint: n2 } } } = this;
6979
- if (this.listeners.add(e2.move.name, this.handleMove, { passive: false }), this.listeners.add(e2.end.name, this.handleEnd), e2.cancel && this.listeners.add(e2.cancel.name, this.handleCancel), this.windowListeners.add(_e.Resize, this.handleCancel), this.windowListeners.add(_e.DragStart, Ue), this.windowListeners.add(_e.VisibilityChange, this.handleCancel), this.windowListeners.add(_e.ContextMenu, Ue), this.documentListeners.add(_e.Keydown, this.handleKeydown), t2) {
6980
- if (n2 != null && n2({ event: this.props.event, activeNode: this.props.activeNode, options: this.props.options }))
6981
- return this.handleStart();
6982
- if (Qe(t2))
6983
- return this.timeoutId = setTimeout(this.handleStart, t2.delay), void this.handlePending(t2);
6984
- if (Ge(t2))
6985
- return void this.handlePending(t2);
6986
- }
6987
- this.handleStart();
6988
- }
6989
- detach() {
6990
- this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
6991
- }
6992
- handlePending(e2, t2) {
6993
- const { active: n2, onPending: r2 } = this.props;
6994
- r2(n2, e2, this.initialCoordinates, t2);
6995
- }
6996
- handleStart() {
6997
- const { initialCoordinates: e2 } = this, { onStart: t2 } = this.props;
6998
- e2 && (this.activated = true, this.documentListeners.add(_e.Click, Xe, { capture: true }), this.removeTextSelection(), this.documentListeners.add(_e.SelectionChange, this.removeTextSelection), t2(e2));
6999
- }
7000
- handleMove(e2) {
7001
- var t2;
7002
- const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove: i2, options: { activationConstraint: a2 } } = o2;
7003
- if (!r2)
7004
- return;
7005
- const l2 = (t2 = G(e2)) != null ? t2 : de, s2 = V(r2, l2);
7006
- if (!n2 && a2) {
7007
- if (Ge(a2)) {
7008
- if (a2.tolerance != null && We(s2, a2.tolerance))
7009
- return this.handleCancel();
7010
- if (We(s2, a2.distance))
7011
- return this.handleStart();
7012
- }
7013
- return Qe(a2) && We(s2, a2.tolerance) ? this.handleCancel() : void this.handlePending(a2, s2);
7014
- }
7015
- e2.cancelable && e2.preventDefault(), i2(l2);
7016
- }
7017
- handleEnd() {
7018
- const { onAbort: e2, onEnd: t2 } = this.props;
7019
- this.detach(), this.activated || e2(this.props.active), t2();
7020
- }
7021
- handleCancel() {
7022
- const { onAbort: e2, onCancel: t2 } = this.props;
7023
- this.detach(), this.activated || e2(this.props.active), t2();
7024
- }
7025
- handleKeydown(e2) {
7026
- e2.code === He.Esc && this.handleCancel();
7027
- }
7028
- removeTextSelection() {
7029
- var e2;
7030
- (e2 = this.document.getSelection()) == null || e2.removeAllRanges();
7031
- }
7032
- }
7033
- var et = { cancel: { name: "pointercancel" }, move: { name: "pointermove" }, end: { name: "pointerup" } };
7034
-
7035
- class tt extends Ze {
7036
- constructor(e2) {
7037
- const { event: t2 } = e2, n2 = O(t2.target);
7038
- super(e2, et, n2);
7039
- }
7040
- }
7041
- tt.activators = [{ eventName: "onPointerDown", handler: (e2, t2) => {
7042
- let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
7043
- return !(!n2.isPrimary || n2.button !== 0) && (r2 == null || r2({ event: n2 }), true);
7044
- } }];
7045
- var nt = { move: { name: "mousemove" }, end: { name: "mouseup" } };
7046
- var rt;
7047
- var ot;
7048
- (ot = rt || (rt = {}))[ot.RightClick = 2] = "RightClick";
7049
- (class extends Ze {
7050
- constructor(e2) {
7051
- super(e2, nt, O(e2.event.target));
7052
- }
7053
- }).activators = [{ eventName: "onMouseDown", handler: (e2, t2) => {
7054
- let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
7055
- return n2.button !== rt.RightClick && (r2 == null || r2({ event: n2 }), true);
7056
- } }];
7057
- var it = { cancel: { name: "touchcancel" }, move: { name: "touchmove" }, end: { name: "touchend" } };
7058
- var at;
7059
- var lt;
7060
- var st;
7061
- var ct;
7062
- (class extends Ze {
7063
- constructor(e2) {
7064
- super(e2, it);
7065
- }
7066
- static setup() {
7067
- return window.addEventListener(it.move.name, e2, { capture: false, passive: false }), function() {
7068
- window.removeEventListener(it.move.name, e2);
7069
- };
7070
- function e2() {}
7071
- }
7072
- }).activators = [{ eventName: "onTouchStart", handler: (e2, t2) => {
7073
- let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
7074
- const { touches: o2 } = n2;
7075
- return !(o2.length > 1) && (r2 == null || r2({ event: n2 }), true);
7076
- } }], (lt = at || (at = {}))[lt.Pointer = 0] = "Pointer", lt[lt.DraggableRect = 1] = "DraggableRect", (ct = st || (st = {}))[ct.TreeOrder = 0] = "TreeOrder", ct[ct.ReversedTreeOrder = 1] = "ReversedTreeOrder";
7077
- var ut = { x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } };
7078
- var pt;
7079
- var ht;
7080
- var mt;
7081
- (ht = pt || (pt = {}))[ht.Always = 0] = "Always", ht[ht.BeforeDragging = 1] = "BeforeDragging", ht[ht.WhileDragging = 2] = "WhileDragging", (mt || (mt = {})).Optimized = "optimized";
7082
- var Dt = { draggable: { measure: Se }, droppable: { measure: Se, strategy: pt.WhileDragging, frequency: mt.Optimized }, dragOverlay: { measure: Ce } };
7083
- var Ft = /* @__PURE__ */ p({ ...de, scaleX: 1, scaleY: 1 });
7084
- var $t;
7085
- var Bt;
7086
- (Bt = $t || ($t = {}))[Bt.Uninitialized = 0] = "Uninitialized", Bt[Bt.Initializing = 1] = "Initializing", Bt[Bt.Initialized = 2] = "Initialized";
7087
- var Ut;
7088
- var Xt = (() => {
7089
- if (typeof window != "undefined") {
7090
- const e2 = window;
7091
- return e2.__principlemd_theme_context__ || (e2.__principlemd_theme_context__ = p(undefined)), e2.__principlemd_theme_context__;
7092
- }
7093
- return Ut || (Ut = p(undefined)), Ut;
7094
- })();
7095
-
7096
4337
  // industryMarkdown/components/SlidePresentation.tsx
7097
- import React18, { useState as useState11, useCallback as useCallback3, useRef as useRef10, useEffect as useEffect10 } from "react";
4338
+ import { AnimatedResizableLayout } from "@principal-ade/panels";
4339
+ import React17, { useState as useState10, useCallback as useCallback2, useRef as useRef9, useEffect as useEffect9 } from "react";
7098
4340
 
7099
4341
  // industryMarkdown/utils/extractSlideTitles.ts
7100
4342
  function extractSlideTitle2(content, slideIndex) {
@@ -7126,17 +4368,17 @@ import {
7126
4368
  PanelRightClose,
7127
4369
  Columns,
7128
4370
  ExternalLink,
7129
- X as X2
4371
+ X
7130
4372
  } from "lucide-react";
7131
- import React16 from "react";
4373
+ import React15 from "react";
7132
4374
 
7133
4375
  // industryMarkdown/components/FocusLeftIcon.tsx
7134
- import React15 from "react";
4376
+ import React14 from "react";
7135
4377
  var FocusLeftIcon = ({
7136
4378
  size = 18,
7137
4379
  color = "currentColor",
7138
4380
  style
7139
- }) => /* @__PURE__ */ React15.createElement("svg", {
4381
+ }) => /* @__PURE__ */ React14.createElement("svg", {
7140
4382
  width: size,
7141
4383
  height: size,
7142
4384
  viewBox: "0 0 24 24",
@@ -7146,13 +4388,13 @@ var FocusLeftIcon = ({
7146
4388
  strokeLinecap: "round",
7147
4389
  strokeLinejoin: "round",
7148
4390
  style
7149
- }, /* @__PURE__ */ React15.createElement("rect", {
4391
+ }, /* @__PURE__ */ React14.createElement("rect", {
7150
4392
  x: "3",
7151
4393
  y: "3",
7152
4394
  width: "18",
7153
4395
  height: "18",
7154
4396
  rx: "1"
7155
- }), /* @__PURE__ */ React15.createElement("path", {
4397
+ }), /* @__PURE__ */ React14.createElement("path", {
7156
4398
  d: "M9 12L15 12M15 12L12 9M15 12L12 15",
7157
4399
  strokeWidth: "1.5"
7158
4400
  }));
@@ -7160,7 +4402,7 @@ var FocusRightIcon = ({
7160
4402
  size = 18,
7161
4403
  color = "currentColor",
7162
4404
  style
7163
- }) => /* @__PURE__ */ React15.createElement("svg", {
4405
+ }) => /* @__PURE__ */ React14.createElement("svg", {
7164
4406
  width: size,
7165
4407
  height: size,
7166
4408
  viewBox: "0 0 24 24",
@@ -7170,13 +4412,13 @@ var FocusRightIcon = ({
7170
4412
  strokeLinecap: "round",
7171
4413
  strokeLinejoin: "round",
7172
4414
  style
7173
- }, /* @__PURE__ */ React15.createElement("rect", {
4415
+ }, /* @__PURE__ */ React14.createElement("rect", {
7174
4416
  x: "3",
7175
4417
  y: "3",
7176
4418
  width: "18",
7177
4419
  height: "18",
7178
4420
  rx: "1"
7179
- }), /* @__PURE__ */ React15.createElement("path", {
4421
+ }), /* @__PURE__ */ React14.createElement("path", {
7180
4422
  d: "M15 12L9 12M9 12L12 9M9 12L12 15",
7181
4423
  strokeWidth: "1.5"
7182
4424
  }));
@@ -7193,8 +4435,8 @@ var HeaderButton = ({
7193
4435
  minWidth,
7194
4436
  padding
7195
4437
  }) => {
7196
- const [isHovered, setIsHovered] = React16.useState(false);
7197
- return /* @__PURE__ */ React16.createElement("button", {
4438
+ const [isHovered, setIsHovered] = React15.useState(false);
4439
+ return /* @__PURE__ */ React15.createElement("button", {
7198
4440
  onClick,
7199
4441
  disabled,
7200
4442
  onMouseEnter: () => setIsHovered(true),
@@ -7246,7 +4488,7 @@ var SlideNavigationHeader = ({
7246
4488
  onCollapseRight
7247
4489
  }) => {
7248
4490
  const navigationHeight = "48px";
7249
- return /* @__PURE__ */ React16.createElement("div", {
4491
+ return /* @__PURE__ */ React15.createElement("div", {
7250
4492
  style: {
7251
4493
  height: navigationHeight,
7252
4494
  minHeight: navigationHeight,
@@ -7258,41 +4500,41 @@ var SlideNavigationHeader = ({
7258
4500
  backgroundColor: theme2.colors.background,
7259
4501
  flexShrink: 0
7260
4502
  }
7261
- }, /* @__PURE__ */ React16.createElement("div", {
4503
+ }, /* @__PURE__ */ React15.createElement("div", {
7262
4504
  style: {
7263
4505
  display: "flex",
7264
4506
  alignItems: "center",
7265
4507
  gap: theme2.space[2]
7266
4508
  }
7267
- }, /* @__PURE__ */ React16.createElement(HeaderButton, {
4509
+ }, /* @__PURE__ */ React15.createElement(HeaderButton, {
7268
4510
  onClick: onToggleTOC,
7269
4511
  active: showTOC,
7270
4512
  theme: theme2,
7271
4513
  title: tocDisplayMode === "sidebar" ? showTOC ? "Hide table of contents (T)" : "Show table of contents (T)" : showTOC ? "Close table of contents (Esc)" : "Open table of contents (T)"
7272
- }, /* @__PURE__ */ React16.createElement(Menu, {
4514
+ }, /* @__PURE__ */ React15.createElement(Menu, {
7273
4515
  size: 18
7274
- })), /* @__PURE__ */ React16.createElement(HeaderButton, {
4516
+ })), /* @__PURE__ */ React15.createElement(HeaderButton, {
7275
4517
  onClick: onPrevious,
7276
4518
  disabled: currentSlide === 0,
7277
4519
  theme: theme2,
7278
4520
  title: "Previous slide",
7279
4521
  minWidth: isMobile ? undefined : "100px",
7280
4522
  width: isMobile ? "36px" : undefined
7281
- }, /* @__PURE__ */ React16.createElement(ChevronLeft, {
4523
+ }, /* @__PURE__ */ React15.createElement(ChevronLeft, {
7282
4524
  size: 18
7283
- }), !isMobile && "Previous"), viewMode === "book" && onCollapseLeft && /* @__PURE__ */ React16.createElement(HeaderButton, {
4525
+ }), !isMobile && "Previous"), viewMode === "book" && onCollapseLeft && /* @__PURE__ */ React15.createElement(HeaderButton, {
7284
4526
  onClick: onCollapseLeft,
7285
4527
  active: collapseRight,
7286
4528
  theme: theme2,
7287
4529
  title: collapseLeft ? "Expand left panel" : collapseRight ? "Show both panels" : "Focus on left panel"
7288
- }, collapseLeft ? /* @__PURE__ */ React16.createElement(PanelLeftClose, {
4530
+ }, collapseLeft ? /* @__PURE__ */ React15.createElement(PanelLeftClose, {
7289
4531
  size: 18,
7290
4532
  style: { transform: "rotate(180deg)" }
7291
- }) : collapseRight ? /* @__PURE__ */ React16.createElement(Columns, {
4533
+ }) : collapseRight ? /* @__PURE__ */ React15.createElement(Columns, {
7292
4534
  size: 18
7293
- }) : /* @__PURE__ */ React16.createElement(FocusLeftIcon, {
4535
+ }) : /* @__PURE__ */ React15.createElement(FocusLeftIcon, {
7294
4536
  size: 18
7295
- }))), showSlideCounter && /* @__PURE__ */ React16.createElement("div", {
4537
+ }))), showSlideCounter && /* @__PURE__ */ React15.createElement("div", {
7296
4538
  style: {
7297
4539
  display: "flex",
7298
4540
  alignItems: "center",
@@ -7300,72 +4542,72 @@ var SlideNavigationHeader = ({
7300
4542
  fontSize: theme2.fontSizes[1],
7301
4543
  fontFamily: theme2.fonts.monospace
7302
4544
  }
7303
- }, viewMode === "book" ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("span", {
4545
+ }, viewMode === "book" ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("span", {
7304
4546
  style: { fontWeight: 600 }
7305
- }, Math.floor(currentSlide / 2) + 1), /* @__PURE__ */ React16.createElement("span", {
4547
+ }, Math.floor(currentSlide / 2) + 1), /* @__PURE__ */ React15.createElement("span", {
7306
4548
  style: { opacity: 0.5, margin: "0 0.4em" }
7307
- }, "of"), /* @__PURE__ */ React16.createElement("span", {
4549
+ }, "of"), /* @__PURE__ */ React15.createElement("span", {
7308
4550
  style: { fontWeight: 600 }
7309
- }, Math.ceil(totalSlides / 2))) : /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement("span", {
4551
+ }, Math.ceil(totalSlides / 2))) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("span", {
7310
4552
  style: { fontWeight: 600 }
7311
- }, currentSlide + 1), /* @__PURE__ */ React16.createElement("span", {
4553
+ }, currentSlide + 1), /* @__PURE__ */ React15.createElement("span", {
7312
4554
  style: { opacity: 0.5, margin: "0 0.4em" }
7313
- }, "of"), /* @__PURE__ */ React16.createElement("span", {
4555
+ }, "of"), /* @__PURE__ */ React15.createElement("span", {
7314
4556
  style: { fontWeight: 600 }
7315
- }, totalSlides))), /* @__PURE__ */ React16.createElement("div", {
4557
+ }, totalSlides))), /* @__PURE__ */ React15.createElement("div", {
7316
4558
  style: {
7317
4559
  display: "flex",
7318
4560
  alignItems: "center",
7319
4561
  gap: theme2.space[2]
7320
4562
  }
7321
- }, viewMode === "book" && onCollapseRight && /* @__PURE__ */ React16.createElement(HeaderButton, {
4563
+ }, viewMode === "book" && onCollapseRight && /* @__PURE__ */ React15.createElement(HeaderButton, {
7322
4564
  onClick: onCollapseRight,
7323
4565
  active: collapseLeft,
7324
4566
  theme: theme2,
7325
4567
  title: collapseRight ? "Expand right panel" : collapseLeft ? "Show both panels" : "Focus on right panel"
7326
- }, collapseRight ? /* @__PURE__ */ React16.createElement(PanelRightClose, {
4568
+ }, collapseRight ? /* @__PURE__ */ React15.createElement(PanelRightClose, {
7327
4569
  size: 18,
7328
4570
  style: { transform: "rotate(180deg)" }
7329
- }) : collapseLeft ? /* @__PURE__ */ React16.createElement(Columns, {
4571
+ }) : collapseLeft ? /* @__PURE__ */ React15.createElement(Columns, {
7330
4572
  size: 18
7331
- }) : /* @__PURE__ */ React16.createElement(FocusRightIcon, {
4573
+ }) : /* @__PURE__ */ React15.createElement(FocusRightIcon, {
7332
4574
  size: 18
7333
- })), /* @__PURE__ */ React16.createElement(HeaderButton, {
4575
+ })), /* @__PURE__ */ React15.createElement(HeaderButton, {
7334
4576
  onClick: onNext,
7335
4577
  disabled: currentSlide === totalSlides - 1,
7336
4578
  theme: theme2,
7337
4579
  title: "Next slide",
7338
4580
  minWidth: isMobile ? undefined : "100px",
7339
4581
  width: isMobile ? "36px" : undefined
7340
- }, !isMobile && "Next", /* @__PURE__ */ React16.createElement(ChevronRight, {
4582
+ }, !isMobile && "Next", /* @__PURE__ */ React15.createElement(ChevronRight, {
7341
4583
  size: 18
7342
- })), showPopoutButton && onPopout && !isPopout && /* @__PURE__ */ React16.createElement(HeaderButton, {
4584
+ })), showPopoutButton && onPopout && !isPopout && /* @__PURE__ */ React15.createElement(HeaderButton, {
7343
4585
  onClick: onPopout,
7344
4586
  theme: theme2,
7345
4587
  title: "Pop out to new window"
7346
- }, /* @__PURE__ */ React16.createElement(ExternalLink, {
4588
+ }, /* @__PURE__ */ React15.createElement(ExternalLink, {
7347
4589
  size: 18
7348
- })), isPopout && onClose && /* @__PURE__ */ React16.createElement(HeaderButton, {
4590
+ })), isPopout && onClose && /* @__PURE__ */ React15.createElement(HeaderButton, {
7349
4591
  onClick: onClose,
7350
4592
  theme: theme2,
7351
4593
  title: "Close window"
7352
- }, /* @__PURE__ */ React16.createElement(X2, {
4594
+ }, /* @__PURE__ */ React15.createElement(X, {
7353
4595
  size: 18
7354
- })), showFullscreenButton && !showPopoutButton && /* @__PURE__ */ React16.createElement(HeaderButton, {
4596
+ })), showFullscreenButton && !showPopoutButton && /* @__PURE__ */ React15.createElement(HeaderButton, {
7355
4597
  onClick: onToggleFullscreen,
7356
4598
  disabled: isMobile,
7357
4599
  theme: theme2,
7358
4600
  title: isMobile ? "Fullscreen not available on mobile" : isFullscreen ? "Exit fullscreen (F)" : "Enter fullscreen (F)"
7359
- }, isFullscreen ? /* @__PURE__ */ React16.createElement(Minimize2, {
4601
+ }, isFullscreen ? /* @__PURE__ */ React15.createElement(Minimize2, {
7360
4602
  size: 18
7361
- }) : /* @__PURE__ */ React16.createElement(Maximize2, {
4603
+ }) : /* @__PURE__ */ React15.createElement(Maximize2, {
7362
4604
  size: 18
7363
4605
  }))));
7364
4606
  };
7365
4607
 
7366
4608
  // industryMarkdown/components/SlideSearchBar.tsx
7367
- import { Search, X as X3 } from "lucide-react";
7368
- import React17, { useRef as useRef9, useEffect as useEffect9 } from "react";
4609
+ import { Search, X as X2 } from "lucide-react";
4610
+ import React16, { useRef as useRef8, useEffect as useEffect8 } from "react";
7369
4611
  var SlideSearchBar = ({
7370
4612
  showSearch,
7371
4613
  searchQuery,
@@ -7379,13 +4621,13 @@ var SlideSearchBar = ({
7379
4621
  onClose,
7380
4622
  onClear
7381
4623
  }) => {
7382
- const searchInputRef = useRef9(null);
7383
- useEffect9(() => {
4624
+ const searchInputRef = useRef8(null);
4625
+ useEffect8(() => {
7384
4626
  if (showSearch && searchInputRef.current) {
7385
4627
  searchInputRef.current.focus();
7386
4628
  }
7387
4629
  }, [showSearch]);
7388
- return /* @__PURE__ */ React17.createElement("div", {
4630
+ return /* @__PURE__ */ React16.createElement("div", {
7389
4631
  style: {
7390
4632
  position: "fixed",
7391
4633
  bottom: 0,
@@ -7402,14 +4644,14 @@ var SlideSearchBar = ({
7402
4644
  padding: `0 ${theme2.space[3]}px`,
7403
4645
  gap: theme2.space[3]
7404
4646
  }
7405
- }, /* @__PURE__ */ React17.createElement(Search, {
4647
+ }, /* @__PURE__ */ React16.createElement(Search, {
7406
4648
  size: 20,
7407
4649
  style: { color: theme2.colors.textSecondary, flexShrink: 0 }
7408
- }), /* @__PURE__ */ React17.createElement("input", {
4650
+ }), /* @__PURE__ */ React16.createElement("input", {
7409
4651
  ref: searchInputRef,
7410
4652
  type: "text",
7411
4653
  value: searchQuery,
7412
- onChange: (e2) => setSearchQuery(e2.target.value),
4654
+ onChange: (e) => setSearchQuery(e.target.value),
7413
4655
  placeholder: "Search slides...",
7414
4656
  style: {
7415
4657
  flex: "0 0 auto",
@@ -7423,20 +4665,20 @@ var SlideSearchBar = ({
7423
4665
  fontFamily: theme2.fonts.body,
7424
4666
  outline: "none"
7425
4667
  },
7426
- onFocus: (e2) => {
7427
- e2.currentTarget.style.borderColor = theme2.colors.primary;
4668
+ onFocus: (e) => {
4669
+ e.currentTarget.style.borderColor = theme2.colors.primary;
7428
4670
  },
7429
- onBlur: (e2) => {
7430
- e2.currentTarget.style.borderColor = theme2.colors.border;
4671
+ onBlur: (e) => {
4672
+ e.currentTarget.style.borderColor = theme2.colors.border;
7431
4673
  }
7432
- }), searchQuery && /* @__PURE__ */ React17.createElement("div", {
4674
+ }), searchQuery && /* @__PURE__ */ React16.createElement("div", {
7433
4675
  style: {
7434
4676
  color: theme2.colors.textSecondary,
7435
4677
  fontSize: theme2.fontSizes[0],
7436
4678
  fontFamily: theme2.fonts.body,
7437
4679
  flexShrink: 0
7438
4680
  }
7439
- }, searchResults.length > 0 ? /* @__PURE__ */ React17.createElement(React17.Fragment, null, searchResults.reduce((sum, r2) => sum + r2.count, 0), " matches in ", searchResults.length, " ", "slide", searchResults.length !== 1 ? "s" : "") : "No results"), /* @__PURE__ */ React17.createElement("div", {
4681
+ }, searchResults.length > 0 ? /* @__PURE__ */ React16.createElement(React16.Fragment, null, searchResults.reduce((sum, r) => sum + r.count, 0), " matches in ", searchResults.length, " ", "slide", searchResults.length !== 1 ? "s" : "") : "No results"), /* @__PURE__ */ React16.createElement("div", {
7440
4682
  style: {
7441
4683
  flex: 1,
7442
4684
  display: "flex",
@@ -7447,7 +4689,7 @@ var SlideSearchBar = ({
7447
4689
  minHeight: "32px",
7448
4690
  padding: `0 ${theme2.space[1]}px`
7449
4691
  }
7450
- }, searchQuery && !searchResults.some((r2) => r2.slideIndex === searchStartSlide) && /* @__PURE__ */ React17.createElement("div", {
4692
+ }, searchQuery && !searchResults.some((r) => r.slideIndex === searchStartSlide) && /* @__PURE__ */ React16.createElement("div", {
7451
4693
  style: {
7452
4694
  display: "inline-flex",
7453
4695
  alignItems: "center",
@@ -7463,11 +4705,11 @@ var SlideSearchBar = ({
7463
4705
  flexShrink: 0,
7464
4706
  opacity: 0.7
7465
4707
  }
7466
- }, /* @__PURE__ */ React17.createElement("span", {
4708
+ }, /* @__PURE__ */ React16.createElement("span", {
7467
4709
  style: { fontWeight: 600 }
7468
- }, "#", searchStartSlide + 1, " (start)"), /* @__PURE__ */ React17.createElement("span", {
4710
+ }, "#", searchStartSlide + 1, " (start)"), /* @__PURE__ */ React16.createElement("span", {
7469
4711
  style: { opacity: 0.8 }
7470
- }, "(no matches)")), searchResults.map((result, index) => /* @__PURE__ */ React17.createElement("button", {
4712
+ }, "(no matches)")), searchResults.map((result, index) => /* @__PURE__ */ React16.createElement("button", {
7471
4713
  key: result.slideIndex,
7472
4714
  onClick: () => onResultClick(index, result.slideIndex),
7473
4715
  style: {
@@ -7486,22 +4728,22 @@ var SlideSearchBar = ({
7486
4728
  whiteSpace: "nowrap",
7487
4729
  flexShrink: 0
7488
4730
  },
7489
- onMouseOver: (e2) => {
4731
+ onMouseOver: (e) => {
7490
4732
  if (currentSearchResult !== index) {
7491
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
4733
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
7492
4734
  }
7493
4735
  },
7494
- onMouseOut: (e2) => {
4736
+ onMouseOut: (e) => {
7495
4737
  if (currentSearchResult !== index) {
7496
- e2.currentTarget.style.backgroundColor = theme2.colors.background;
4738
+ e.currentTarget.style.backgroundColor = theme2.colors.background;
7497
4739
  }
7498
4740
  },
7499
4741
  title: `Slide ${result.slideIndex + 1}: ${slideTitles[result.slideIndex]}`
7500
- }, /* @__PURE__ */ React17.createElement("span", {
4742
+ }, /* @__PURE__ */ React16.createElement("span", {
7501
4743
  style: { fontWeight: 600 }
7502
- }, "#", result.slideIndex + 1), /* @__PURE__ */ React17.createElement("span", {
4744
+ }, "#", result.slideIndex + 1), /* @__PURE__ */ React16.createElement("span", {
7503
4745
  style: { opacity: 0.8 }
7504
- }, "(", result.count, " match", result.count !== 1 ? "es" : "", ")")))), searchQuery && onClear && /* @__PURE__ */ React17.createElement("button", {
4746
+ }, "(", result.count, " match", result.count !== 1 ? "es" : "", ")")))), searchQuery && onClear && /* @__PURE__ */ React16.createElement("button", {
7505
4747
  onClick: () => {
7506
4748
  onClear();
7507
4749
  searchInputRef.current?.focus();
@@ -7520,14 +4762,14 @@ var SlideSearchBar = ({
7520
4762
  transition: "all 0.2s ease",
7521
4763
  flexShrink: 0
7522
4764
  },
7523
- onMouseOver: (e2) => {
7524
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
4765
+ onMouseOver: (e) => {
4766
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
7525
4767
  },
7526
- onMouseOut: (e2) => {
7527
- e2.currentTarget.style.backgroundColor = "transparent";
4768
+ onMouseOut: (e) => {
4769
+ e.currentTarget.style.backgroundColor = "transparent";
7528
4770
  },
7529
4771
  title: "Clear search"
7530
- }, "Clear"), /* @__PURE__ */ React17.createElement("button", {
4772
+ }, "Clear"), /* @__PURE__ */ React16.createElement("button", {
7531
4773
  onClick: onClose,
7532
4774
  style: {
7533
4775
  display: "flex",
@@ -7543,14 +4785,14 @@ var SlideSearchBar = ({
7543
4785
  transition: "all 0.2s ease",
7544
4786
  flexShrink: 0
7545
4787
  },
7546
- onMouseOver: (e2) => {
7547
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
4788
+ onMouseOver: (e) => {
4789
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
7548
4790
  },
7549
- onMouseOut: (e2) => {
7550
- e2.currentTarget.style.backgroundColor = "transparent";
4791
+ onMouseOut: (e) => {
4792
+ e.currentTarget.style.backgroundColor = "transparent";
7551
4793
  },
7552
4794
  title: "Close search (Esc)"
7553
- }, /* @__PURE__ */ React17.createElement(X3, {
4795
+ }, /* @__PURE__ */ React16.createElement(X2, {
7554
4796
  size: 16
7555
4797
  })));
7556
4798
  };
@@ -7582,8 +4824,8 @@ var SlidePresentation = ({
7582
4824
  fontSizeScale,
7583
4825
  theme: theme2
7584
4826
  }) => {
7585
- const [isMobile, setIsMobile] = useState11(false);
7586
- useEffect10(() => {
4827
+ const [isMobile, setIsMobile] = useState10(false);
4828
+ useEffect9(() => {
7587
4829
  const checkMobile = () => {
7588
4830
  setIsMobile(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || window.innerWidth < 768);
7589
4831
  };
@@ -7593,17 +4835,17 @@ var SlidePresentation = ({
7593
4835
  }, []);
7594
4836
  const effectiveTocDisplayMode = isMobile ? "overlay" : tocDisplayMode;
7595
4837
  const defaultTocOpen = initialTocOpen ?? effectiveTocDisplayMode === "sidebar";
7596
- const [currentSlide, setCurrentSlide] = useState11(initialSlide);
7597
- const [isFullscreen, setIsFullscreen] = useState11(false);
7598
- const [showTOC, setShowTOC] = useState11(defaultTocOpen);
7599
- const [showSearch, setShowSearch] = useState11(false);
7600
- const [searchQuery, setSearchQuery] = useState11("");
7601
- const [searchResults, setSearchResults] = useState11([]);
7602
- const [currentSearchResult, setCurrentSearchResult] = useState11(-1);
7603
- const [searchStartSlide, setSearchStartSlide] = useState11(0);
7604
- const containerRef = useRef10(null);
4838
+ const [currentSlide, setCurrentSlide] = useState10(initialSlide);
4839
+ const [isFullscreen, setIsFullscreen] = useState10(false);
4840
+ const [showTOC, setShowTOC] = useState10(defaultTocOpen);
4841
+ const [showSearch, setShowSearch] = useState10(false);
4842
+ const [searchQuery, setSearchQuery] = useState10("");
4843
+ const [searchResults, setSearchResults] = useState10([]);
4844
+ const [currentSearchResult, setCurrentSearchResult] = useState10(-1);
4845
+ const [searchStartSlide, setSearchStartSlide] = useState10(0);
4846
+ const containerRef = useRef9(null);
7605
4847
  const slideTitles = extractAllSlideTitles(slides);
7606
- const navigateToSlide = useCallback3((slideIndex) => {
4848
+ const navigateToSlide = useCallback2((slideIndex) => {
7607
4849
  if (slideIndex >= 0 && slideIndex < slides.length) {
7608
4850
  setCurrentSlide(slideIndex);
7609
4851
  onSlideChange?.(slideIndex);
@@ -7612,7 +4854,7 @@ var SlidePresentation = ({
7612
4854
  }
7613
4855
  }
7614
4856
  }, [slides.length, onSlideChange, effectiveTocDisplayMode]);
7615
- useEffect10(() => {
4857
+ useEffect9(() => {
7616
4858
  if (!searchQuery.trim()) {
7617
4859
  setSearchResults([]);
7618
4860
  setCurrentSearchResult(-1);
@@ -7630,7 +4872,7 @@ var SlidePresentation = ({
7630
4872
  setSearchResults(results);
7631
4873
  setCurrentSearchResult(-1);
7632
4874
  }, [searchQuery, slides]);
7633
- const navigateToSearchResult = useCallback3((resultIndex) => {
4875
+ const navigateToSearchResult = useCallback2((resultIndex) => {
7634
4876
  if (searchResults.length === 0)
7635
4877
  return;
7636
4878
  let newIndex = resultIndex;
@@ -7645,22 +4887,22 @@ var SlidePresentation = ({
7645
4887
  navigateToSlide(targetSlide);
7646
4888
  }
7647
4889
  }, [searchResults, navigateToSlide, currentSlide, currentSearchResult]);
7648
- const closeSearch = useCallback3(() => {
4890
+ const closeSearch = useCallback2(() => {
7649
4891
  setShowSearch(false);
7650
4892
  }, []);
7651
- const clearSearch = useCallback3(() => {
4893
+ const clearSearch = useCallback2(() => {
7652
4894
  setSearchQuery("");
7653
4895
  setSearchResults([]);
7654
4896
  setCurrentSearchResult(-1);
7655
4897
  setSearchStartSlide(0);
7656
4898
  }, []);
7657
- const goToPreviousSlide = useCallback3(() => {
4899
+ const goToPreviousSlide = useCallback2(() => {
7658
4900
  navigateToSlide(currentSlide - 1);
7659
4901
  }, [currentSlide, navigateToSlide]);
7660
- const goToNextSlide = useCallback3(() => {
4902
+ const goToNextSlide = useCallback2(() => {
7661
4903
  navigateToSlide(currentSlide + 1);
7662
4904
  }, [currentSlide, navigateToSlide]);
7663
- const toggleFullscreen = useCallback3(() => {
4905
+ const toggleFullscreen = useCallback2(() => {
7664
4906
  if (!containerRef.current)
7665
4907
  return;
7666
4908
  if (!isFullscreen) {
@@ -7671,7 +4913,7 @@ var SlidePresentation = ({
7671
4913
  setIsFullscreen(false);
7672
4914
  }
7673
4915
  }, [isFullscreen]);
7674
- useEffect10(() => {
4916
+ useEffect9(() => {
7675
4917
  const handleKeyDown = (event) => {
7676
4918
  if (event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement) {
7677
4919
  if (showSearch && (event.key === "Tab" || event.key === "Enter" || event.key === "Escape")) {} else {
@@ -7789,12 +5031,12 @@ var SlidePresentation = ({
7789
5031
  currentSearchResult,
7790
5032
  tocDisplayMode
7791
5033
  ]);
7792
- useEffect10(() => {
5034
+ useEffect9(() => {
7793
5035
  if (currentSlide >= slides.length && slides.length > 0) {
7794
5036
  setCurrentSlide(slides.length - 1);
7795
5037
  }
7796
5038
  }, [slides.length, currentSlide]);
7797
- return /* @__PURE__ */ React18.createElement("div", {
5039
+ return /* @__PURE__ */ React17.createElement("div", {
7798
5040
  ref: containerRef,
7799
5041
  style: {
7800
5042
  height: containerHeight,
@@ -7803,7 +5045,7 @@ var SlidePresentation = ({
7803
5045
  backgroundColor: theme2.colors.background,
7804
5046
  position: "relative"
7805
5047
  }
7806
- }, showNavigation && /* @__PURE__ */ React18.createElement(SlideNavigationHeader, {
5048
+ }, showNavigation && /* @__PURE__ */ React17.createElement(SlideNavigationHeader, {
7807
5049
  currentSlide,
7808
5050
  totalSlides: slides.length,
7809
5051
  showTOC,
@@ -7821,18 +5063,18 @@ var SlidePresentation = ({
7821
5063
  onToggleFullscreen: toggleFullscreen,
7822
5064
  onPopout,
7823
5065
  onClose
7824
- }), /* @__PURE__ */ React18.createElement("div", {
5066
+ }), /* @__PURE__ */ React17.createElement("div", {
7825
5067
  style: {
7826
5068
  flex: 1,
7827
5069
  overflow: "hidden",
7828
5070
  position: "relative",
7829
5071
  display: "flex"
7830
5072
  }
7831
- }, effectiveTocDisplayMode === "sidebar" ? /* @__PURE__ */ React18.createElement(R, {
5073
+ }, effectiveTocDisplayMode === "sidebar" ? /* @__PURE__ */ React17.createElement(AnimatedResizableLayout, {
7832
5074
  key: `toc-${tocSidebarPosition}`,
7833
5075
  collapsed: !showTOC,
7834
5076
  collapsibleSide: tocSidebarPosition,
7835
- leftPanel: tocSidebarPosition === "left" ? /* @__PURE__ */ React18.createElement("div", {
5077
+ leftPanel: tocSidebarPosition === "left" ? /* @__PURE__ */ React17.createElement("div", {
7836
5078
  style: {
7837
5079
  height: "100%",
7838
5080
  width: "100%",
@@ -7840,7 +5082,7 @@ var SlidePresentation = ({
7840
5082
  overflowY: "auto",
7841
5083
  overflowX: "hidden"
7842
5084
  }
7843
- }, /* @__PURE__ */ React18.createElement("div", {
5085
+ }, /* @__PURE__ */ React17.createElement("div", {
7844
5086
  style: {
7845
5087
  padding: theme2.space[3],
7846
5088
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -7849,7 +5091,7 @@ var SlidePresentation = ({
7849
5091
  top: 0,
7850
5092
  zIndex: 1
7851
5093
  }
7852
- }, /* @__PURE__ */ React18.createElement("h3", {
5094
+ }, /* @__PURE__ */ React17.createElement("h3", {
7853
5095
  style: {
7854
5096
  margin: 0,
7855
5097
  fontSize: theme2.fontSizes[3],
@@ -7857,16 +5099,16 @@ var SlidePresentation = ({
7857
5099
  color: theme2.colors.text,
7858
5100
  fontWeight: 600
7859
5101
  }
7860
- }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
5102
+ }, "Table of Contents"), /* @__PURE__ */ React17.createElement("p", {
7861
5103
  style: {
7862
5104
  margin: `${theme2.space[1]}px 0 0 0`,
7863
5105
  fontSize: theme2.fontSizes[0],
7864
5106
  color: theme2.colors.textSecondary,
7865
5107
  fontFamily: theme2.fonts.body
7866
5108
  }
7867
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
5109
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React17.createElement("div", {
7868
5110
  style: { padding: theme2.space[2] }
7869
- }, slideTitles.map((title, index) => /* @__PURE__ */ React18.createElement("button", {
5111
+ }, slideTitles.map((title, index) => /* @__PURE__ */ React17.createElement("button", {
7870
5112
  key: index,
7871
5113
  onClick: () => navigateToSlide(index),
7872
5114
  style: {
@@ -7885,19 +5127,19 @@ var SlidePresentation = ({
7885
5127
  transition: "all 0.2s ease",
7886
5128
  position: "relative"
7887
5129
  },
7888
- onMouseOver: (e2) => {
5130
+ onMouseOver: (e) => {
7889
5131
  if (currentSlide !== index) {
7890
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
5132
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
7891
5133
  }
7892
5134
  },
7893
- onMouseOut: (e2) => {
5135
+ onMouseOut: (e) => {
7894
5136
  if (currentSlide !== index) {
7895
- e2.currentTarget.style.backgroundColor = "transparent";
5137
+ e.currentTarget.style.backgroundColor = "transparent";
7896
5138
  }
7897
5139
  }
7898
- }, /* @__PURE__ */ React18.createElement("div", {
5140
+ }, /* @__PURE__ */ React17.createElement("div", {
7899
5141
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
7900
- }, /* @__PURE__ */ React18.createElement("span", {
5142
+ }, /* @__PURE__ */ React17.createElement("span", {
7901
5143
  style: {
7902
5144
  display: "inline-block",
7903
5145
  minWidth: "24px",
@@ -7905,14 +5147,14 @@ var SlidePresentation = ({
7905
5147
  fontFamily: theme2.fonts.monospace,
7906
5148
  opacity: 0.6
7907
5149
  }
7908
- }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
5150
+ }, index + 1, "."), /* @__PURE__ */ React17.createElement("span", {
7909
5151
  style: {
7910
5152
  flex: 1,
7911
5153
  overflow: "hidden",
7912
5154
  textOverflow: "ellipsis",
7913
5155
  whiteSpace: "nowrap"
7914
5156
  }
7915
- }, title)), currentSlide === index && /* @__PURE__ */ React18.createElement("div", {
5157
+ }, title)), currentSlide === index && /* @__PURE__ */ React17.createElement("div", {
7916
5158
  style: {
7917
5159
  position: "absolute",
7918
5160
  left: 0,
@@ -7923,9 +5165,9 @@ var SlidePresentation = ({
7923
5165
  backgroundColor: currentSlide === index ? theme2.colors.background : theme2.colors.primary,
7924
5166
  borderRadius: "0 2px 2px 0"
7925
5167
  }
7926
- }))))) : /* @__PURE__ */ React18.createElement("div", {
5168
+ }))))) : /* @__PURE__ */ React17.createElement("div", {
7927
5169
  style: { height: "100%", width: "100%", position: "relative" }
7928
- }, slides.length > 0 ? /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
5170
+ }, slides.length > 0 ? /* @__PURE__ */ React17.createElement(IndustryMarkdownSlide, {
7929
5171
  content: slides[currentSlide] || "",
7930
5172
  slideIdPrefix: `${slideIdPrefix}-${currentSlide}`,
7931
5173
  slideIndex: currentSlide,
@@ -7940,7 +5182,7 @@ var SlidePresentation = ({
7940
5182
  handlePromptCopy,
7941
5183
  fontSizeScale,
7942
5184
  searchQuery: showSearch ? searchQuery : undefined
7943
- }) : /* @__PURE__ */ React18.createElement("div", {
5185
+ }) : /* @__PURE__ */ React17.createElement("div", {
7944
5186
  style: {
7945
5187
  height: "100%",
7946
5188
  display: "flex",
@@ -7951,7 +5193,7 @@ var SlidePresentation = ({
7951
5193
  fontFamily: theme2.fonts.body
7952
5194
  }
7953
5195
  }, "No slides available")),
7954
- rightPanel: tocSidebarPosition === "right" ? /* @__PURE__ */ React18.createElement("div", {
5196
+ rightPanel: tocSidebarPosition === "right" ? /* @__PURE__ */ React17.createElement("div", {
7955
5197
  style: {
7956
5198
  height: "100%",
7957
5199
  width: "100%",
@@ -7959,7 +5201,7 @@ var SlidePresentation = ({
7959
5201
  overflowY: "auto",
7960
5202
  overflowX: "hidden"
7961
5203
  }
7962
- }, /* @__PURE__ */ React18.createElement("div", {
5204
+ }, /* @__PURE__ */ React17.createElement("div", {
7963
5205
  style: {
7964
5206
  padding: theme2.space[3],
7965
5207
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -7968,7 +5210,7 @@ var SlidePresentation = ({
7968
5210
  top: 0,
7969
5211
  zIndex: 1
7970
5212
  }
7971
- }, /* @__PURE__ */ React18.createElement("h3", {
5213
+ }, /* @__PURE__ */ React17.createElement("h3", {
7972
5214
  style: {
7973
5215
  margin: 0,
7974
5216
  fontSize: theme2.fontSizes[3],
@@ -7976,16 +5218,16 @@ var SlidePresentation = ({
7976
5218
  color: theme2.colors.text,
7977
5219
  fontWeight: 600
7978
5220
  }
7979
- }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
5221
+ }, "Table of Contents"), /* @__PURE__ */ React17.createElement("p", {
7980
5222
  style: {
7981
5223
  margin: `${theme2.space[1]}px 0 0 0`,
7982
5224
  fontSize: theme2.fontSizes[0],
7983
5225
  color: theme2.colors.textSecondary,
7984
5226
  fontFamily: theme2.fonts.body
7985
5227
  }
7986
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
5228
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React17.createElement("div", {
7987
5229
  style: { padding: theme2.space[2] }
7988
- }, slideTitles.map((title, index) => /* @__PURE__ */ React18.createElement("button", {
5230
+ }, slideTitles.map((title, index) => /* @__PURE__ */ React17.createElement("button", {
7989
5231
  key: index,
7990
5232
  onClick: () => navigateToSlide(index),
7991
5233
  style: {
@@ -8004,19 +5246,19 @@ var SlidePresentation = ({
8004
5246
  transition: "all 0.2s ease",
8005
5247
  position: "relative"
8006
5248
  },
8007
- onMouseOver: (e2) => {
5249
+ onMouseOver: (e) => {
8008
5250
  if (currentSlide !== index) {
8009
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
5251
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
8010
5252
  }
8011
5253
  },
8012
- onMouseOut: (e2) => {
5254
+ onMouseOut: (e) => {
8013
5255
  if (currentSlide !== index) {
8014
- e2.currentTarget.style.backgroundColor = "transparent";
5256
+ e.currentTarget.style.backgroundColor = "transparent";
8015
5257
  }
8016
5258
  }
8017
- }, /* @__PURE__ */ React18.createElement("div", {
5259
+ }, /* @__PURE__ */ React17.createElement("div", {
8018
5260
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
8019
- }, /* @__PURE__ */ React18.createElement("span", {
5261
+ }, /* @__PURE__ */ React17.createElement("span", {
8020
5262
  style: {
8021
5263
  display: "inline-block",
8022
5264
  minWidth: "24px",
@@ -8024,14 +5266,14 @@ var SlidePresentation = ({
8024
5266
  fontFamily: theme2.fonts.monospace,
8025
5267
  opacity: 0.6
8026
5268
  }
8027
- }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
5269
+ }, index + 1, "."), /* @__PURE__ */ React17.createElement("span", {
8028
5270
  style: {
8029
5271
  flex: 1,
8030
5272
  overflow: "hidden",
8031
5273
  textOverflow: "ellipsis",
8032
5274
  whiteSpace: "nowrap"
8033
5275
  }
8034
- }, title)), currentSlide === index && /* @__PURE__ */ React18.createElement("div", {
5276
+ }, title)), currentSlide === index && /* @__PURE__ */ React17.createElement("div", {
8035
5277
  style: {
8036
5278
  position: "absolute",
8037
5279
  left: 0,
@@ -8042,9 +5284,9 @@ var SlidePresentation = ({
8042
5284
  backgroundColor: currentSlide === index ? theme2.colors.background : theme2.colors.primary,
8043
5285
  borderRadius: "0 2px 2px 0"
8044
5286
  }
8045
- }))))) : /* @__PURE__ */ React18.createElement("div", {
5287
+ }))))) : /* @__PURE__ */ React17.createElement("div", {
8046
5288
  style: { height: "100%", width: "100%", position: "relative" }
8047
- }, slides.length > 0 ? /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
5289
+ }, slides.length > 0 ? /* @__PURE__ */ React17.createElement(IndustryMarkdownSlide, {
8048
5290
  content: slides[currentSlide] || "",
8049
5291
  slideIdPrefix: `${slideIdPrefix}-${currentSlide}`,
8050
5292
  slideIndex: currentSlide,
@@ -8059,7 +5301,7 @@ var SlidePresentation = ({
8059
5301
  handlePromptCopy,
8060
5302
  fontSizeScale,
8061
5303
  searchQuery: showSearch ? searchQuery : undefined
8062
- }) : /* @__PURE__ */ React18.createElement("div", {
5304
+ }) : /* @__PURE__ */ React17.createElement("div", {
8063
5305
  style: {
8064
5306
  height: "100%",
8065
5307
  display: "flex",
@@ -8074,7 +5316,7 @@ var SlidePresentation = ({
8074
5316
  minSize: 15,
8075
5317
  showCollapseButton: false,
8076
5318
  theme: theme2
8077
- }) : /* @__PURE__ */ React18.createElement(React18.Fragment, null, effectiveTocDisplayMode === "overlay" && /* @__PURE__ */ React18.createElement("div", {
5319
+ }) : /* @__PURE__ */ React17.createElement(React17.Fragment, null, effectiveTocDisplayMode === "overlay" && /* @__PURE__ */ React17.createElement("div", {
8078
5320
  style: {
8079
5321
  position: "absolute",
8080
5322
  top: 0,
@@ -8089,7 +5331,7 @@ var SlidePresentation = ({
8089
5331
  overflowY: "auto",
8090
5332
  overflowX: "hidden"
8091
5333
  }
8092
- }, /* @__PURE__ */ React18.createElement("div", {
5334
+ }, /* @__PURE__ */ React17.createElement("div", {
8093
5335
  style: {
8094
5336
  padding: theme2.space[3],
8095
5337
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -8098,7 +5340,7 @@ var SlidePresentation = ({
8098
5340
  top: 0,
8099
5341
  zIndex: 1
8100
5342
  }
8101
- }, /* @__PURE__ */ React18.createElement("h3", {
5343
+ }, /* @__PURE__ */ React17.createElement("h3", {
8102
5344
  style: {
8103
5345
  margin: 0,
8104
5346
  fontSize: theme2.fontSizes[3],
@@ -8106,16 +5348,16 @@ var SlidePresentation = ({
8106
5348
  color: theme2.colors.text,
8107
5349
  fontWeight: 600
8108
5350
  }
8109
- }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
5351
+ }, "Table of Contents"), /* @__PURE__ */ React17.createElement("p", {
8110
5352
  style: {
8111
5353
  margin: `${theme2.space[1]}px 0 0 0`,
8112
5354
  fontSize: theme2.fontSizes[0],
8113
5355
  color: theme2.colors.textSecondary,
8114
5356
  fontFamily: theme2.fonts.body
8115
5357
  }
8116
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
5358
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React17.createElement("div", {
8117
5359
  style: { padding: theme2.space[2] }
8118
- }, slideTitles.map((title, index) => /* @__PURE__ */ React18.createElement("button", {
5360
+ }, slideTitles.map((title, index) => /* @__PURE__ */ React17.createElement("button", {
8119
5361
  key: index,
8120
5362
  onClick: () => navigateToSlide(index),
8121
5363
  style: {
@@ -8134,19 +5376,19 @@ var SlidePresentation = ({
8134
5376
  transition: "all 0.2s ease",
8135
5377
  position: "relative"
8136
5378
  },
8137
- onMouseOver: (e2) => {
5379
+ onMouseOver: (e) => {
8138
5380
  if (currentSlide !== index) {
8139
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
5381
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
8140
5382
  }
8141
5383
  },
8142
- onMouseOut: (e2) => {
5384
+ onMouseOut: (e) => {
8143
5385
  if (currentSlide !== index) {
8144
- e2.currentTarget.style.backgroundColor = "transparent";
5386
+ e.currentTarget.style.backgroundColor = "transparent";
8145
5387
  }
8146
5388
  }
8147
- }, /* @__PURE__ */ React18.createElement("div", {
5389
+ }, /* @__PURE__ */ React17.createElement("div", {
8148
5390
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
8149
- }, /* @__PURE__ */ React18.createElement("span", {
5391
+ }, /* @__PURE__ */ React17.createElement("span", {
8150
5392
  style: {
8151
5393
  display: "inline-block",
8152
5394
  minWidth: "24px",
@@ -8154,14 +5396,14 @@ var SlidePresentation = ({
8154
5396
  fontFamily: theme2.fonts.monospace,
8155
5397
  opacity: 0.6
8156
5398
  }
8157
- }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
5399
+ }, index + 1, "."), /* @__PURE__ */ React17.createElement("span", {
8158
5400
  style: {
8159
5401
  flex: 1,
8160
5402
  overflow: "hidden",
8161
5403
  textOverflow: "ellipsis",
8162
5404
  whiteSpace: "nowrap"
8163
5405
  }
8164
- }, title)), currentSlide === index && /* @__PURE__ */ React18.createElement("div", {
5406
+ }, title)), currentSlide === index && /* @__PURE__ */ React17.createElement("div", {
8165
5407
  style: {
8166
5408
  position: "absolute",
8167
5409
  left: 0,
@@ -8172,7 +5414,7 @@ var SlidePresentation = ({
8172
5414
  backgroundColor: currentSlide === index ? theme2.colors.background : theme2.colors.primary,
8173
5415
  borderRadius: "0 2px 2px 0"
8174
5416
  }
8175
- }))))), effectiveTocDisplayMode === "overlay" && showTOC && /* @__PURE__ */ React18.createElement("div", {
5417
+ }))))), effectiveTocDisplayMode === "overlay" && showTOC && /* @__PURE__ */ React17.createElement("div", {
8176
5418
  onClick: () => setShowTOC(false),
8177
5419
  style: {
8178
5420
  position: "absolute",
@@ -8184,12 +5426,12 @@ var SlidePresentation = ({
8184
5426
  zIndex: 9,
8185
5427
  cursor: "pointer"
8186
5428
  }
8187
- }), /* @__PURE__ */ React18.createElement("div", {
5429
+ }), /* @__PURE__ */ React17.createElement("div", {
8188
5430
  style: {
8189
5431
  flex: 1,
8190
5432
  position: "relative"
8191
5433
  }
8192
- }, slides.length > 0 ? /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
5434
+ }, slides.length > 0 ? /* @__PURE__ */ React17.createElement(IndustryMarkdownSlide, {
8193
5435
  content: slides[currentSlide] || "",
8194
5436
  slideIdPrefix: `${slideIdPrefix}-${currentSlide}`,
8195
5437
  slideIndex: currentSlide,
@@ -8204,7 +5446,7 @@ var SlidePresentation = ({
8204
5446
  handlePromptCopy,
8205
5447
  fontSizeScale,
8206
5448
  searchQuery: showSearch ? searchQuery : undefined
8207
- }) : /* @__PURE__ */ React18.createElement("div", {
5449
+ }) : /* @__PURE__ */ React17.createElement("div", {
8208
5450
  style: {
8209
5451
  height: "100%",
8210
5452
  display: "flex",
@@ -8214,7 +5456,7 @@ var SlidePresentation = ({
8214
5456
  fontSize: theme2.fontSizes[2],
8215
5457
  fontFamily: theme2.fonts.body
8216
5458
  }
8217
- }, "No slides available")))), showNavigation && slides.length > 1 && /* @__PURE__ */ React18.createElement("div", {
5459
+ }, "No slides available")))), showNavigation && slides.length > 1 && /* @__PURE__ */ React17.createElement("div", {
8218
5460
  style: {
8219
5461
  position: "absolute",
8220
5462
  bottom: 0,
@@ -8224,14 +5466,14 @@ var SlidePresentation = ({
8224
5466
  backgroundColor: theme2.colors.border,
8225
5467
  opacity: 0.3
8226
5468
  }
8227
- }, /* @__PURE__ */ React18.createElement("div", {
5469
+ }, /* @__PURE__ */ React17.createElement("div", {
8228
5470
  style: {
8229
5471
  height: "100%",
8230
5472
  width: `${(currentSlide + 1) / slides.length * 100}%`,
8231
5473
  backgroundColor: theme2.colors.primary,
8232
5474
  transition: "width 0.3s ease"
8233
5475
  }
8234
- })), /* @__PURE__ */ React18.createElement(SlideSearchBar, {
5476
+ })), /* @__PURE__ */ React17.createElement(SlideSearchBar, {
8235
5477
  showSearch,
8236
5478
  searchQuery,
8237
5479
  setSearchQuery,
@@ -8249,7 +5491,8 @@ var SlidePresentation = ({
8249
5491
  }));
8250
5492
  };
8251
5493
  // industryMarkdown/components/SlidePresentationBook.tsx
8252
- import React19, { useState as useState12, useCallback as useCallback4, useRef as useRef11, useEffect as useEffect11 } from "react";
5494
+ import { AnimatedResizableLayout as AnimatedResizableLayout2 } from "@principal-ade/panels";
5495
+ import React18, { useState as useState11, useCallback as useCallback3, useRef as useRef10, useEffect as useEffect10 } from "react";
8253
5496
  var SlidePresentationBook = ({
8254
5497
  slides,
8255
5498
  initialSlide = 0,
@@ -8279,8 +5522,8 @@ var SlidePresentationBook = ({
8279
5522
  repositoryInfo,
8280
5523
  width
8281
5524
  }) => {
8282
- const [isMobile, setIsMobile] = useState12(false);
8283
- useEffect11(() => {
5525
+ const [isMobile, setIsMobile] = useState11(false);
5526
+ useEffect10(() => {
8284
5527
  const checkMobile = () => {
8285
5528
  setIsMobile(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent) || window.innerWidth < 768);
8286
5529
  };
@@ -8291,20 +5534,20 @@ var SlidePresentationBook = ({
8291
5534
  const effectiveTocDisplayMode = isMobile && viewMode === "single" ? "overlay" : tocDisplayMode ?? (viewMode === "single" ? "sidebar" : "overlay");
8292
5535
  const defaultTocOpen = initialTocOpen ?? false;
8293
5536
  const adjustedInitialSlide = viewMode === "book" ? Math.floor(initialSlide / 2) * 2 : initialSlide;
8294
- const [currentSlide, setCurrentSlide] = useState12(adjustedInitialSlide);
8295
- const [isFullscreen, setIsFullscreen] = useState12(false);
8296
- const [showTOC, setShowTOC] = useState12(defaultTocOpen);
8297
- const [showSearch, setShowSearch] = useState12(false);
8298
- const [searchQuery, setSearchQuery] = useState12("");
8299
- const [searchResults, setSearchResults] = useState12([]);
8300
- const [currentSearchResult, setCurrentSearchResult] = useState12(-1);
8301
- const [searchStartSlide, setSearchStartSlide] = useState12(0);
8302
- const [collapsedSide, setCollapsedSide] = useState12(null);
8303
- const [lastInteractedSide, setLastInteractedSide] = useState12("left");
8304
- const containerRef = useRef11(null);
5537
+ const [currentSlide, setCurrentSlide] = useState11(adjustedInitialSlide);
5538
+ const [isFullscreen, setIsFullscreen] = useState11(false);
5539
+ const [showTOC, setShowTOC] = useState11(defaultTocOpen);
5540
+ const [showSearch, setShowSearch] = useState11(false);
5541
+ const [searchQuery, setSearchQuery] = useState11("");
5542
+ const [searchResults, setSearchResults] = useState11([]);
5543
+ const [currentSearchResult, setCurrentSearchResult] = useState11(-1);
5544
+ const [searchStartSlide, setSearchStartSlide] = useState11(0);
5545
+ const [collapsedSide, setCollapsedSide] = useState11(null);
5546
+ const [lastInteractedSide, setLastInteractedSide] = useState11("left");
5547
+ const containerRef = useRef10(null);
8305
5548
  const slideTitles = extractAllSlideTitles(slides);
8306
5549
  const stepSize = viewMode === "book" ? 2 : 1;
8307
- const navigateToSlide = useCallback4((slideIndex) => {
5550
+ const navigateToSlide = useCallback3((slideIndex) => {
8308
5551
  const targetSlide = viewMode === "book" ? Math.floor(slideIndex / 2) * 2 : slideIndex;
8309
5552
  if (targetSlide >= 0 && targetSlide < slides.length) {
8310
5553
  setCurrentSlide(targetSlide);
@@ -8314,7 +5557,7 @@ var SlidePresentationBook = ({
8314
5557
  }
8315
5558
  }
8316
5559
  }, [slides.length, onSlideChange, viewMode, effectiveTocDisplayMode]);
8317
- useEffect11(() => {
5560
+ useEffect10(() => {
8318
5561
  if (!searchQuery.trim()) {
8319
5562
  setSearchResults([]);
8320
5563
  setCurrentSearchResult(-1);
@@ -8332,7 +5575,7 @@ var SlidePresentationBook = ({
8332
5575
  setSearchResults(results);
8333
5576
  setCurrentSearchResult(-1);
8334
5577
  }, [searchQuery, slides]);
8335
- const navigateToSearchResult = useCallback4((resultIndex) => {
5578
+ const navigateToSearchResult = useCallback3((resultIndex) => {
8336
5579
  if (searchResults.length === 0)
8337
5580
  return;
8338
5581
  let newIndex = resultIndex;
@@ -8347,22 +5590,22 @@ var SlidePresentationBook = ({
8347
5590
  navigateToSlide(targetSlide);
8348
5591
  }
8349
5592
  }, [searchResults, navigateToSlide, currentSlide, currentSearchResult]);
8350
- const closeSearch = useCallback4(() => {
5593
+ const closeSearch = useCallback3(() => {
8351
5594
  setShowSearch(false);
8352
5595
  }, []);
8353
- const clearSearch = useCallback4(() => {
5596
+ const clearSearch = useCallback3(() => {
8354
5597
  setSearchQuery("");
8355
5598
  setSearchResults([]);
8356
5599
  setCurrentSearchResult(-1);
8357
5600
  setSearchStartSlide(0);
8358
5601
  }, []);
8359
- const goToPreviousSlide = useCallback4(() => {
5602
+ const goToPreviousSlide = useCallback3(() => {
8360
5603
  navigateToSlide(currentSlide - stepSize);
8361
5604
  }, [currentSlide, navigateToSlide, stepSize]);
8362
- const goToNextSlide = useCallback4(() => {
5605
+ const goToNextSlide = useCallback3(() => {
8363
5606
  navigateToSlide(currentSlide + stepSize);
8364
5607
  }, [currentSlide, navigateToSlide, stepSize]);
8365
- const handleCollapseLeft = useCallback4(() => {
5608
+ const handleCollapseLeft = useCallback3(() => {
8366
5609
  if (collapsedSide === "left") {
8367
5610
  setCollapsedSide(null);
8368
5611
  } else if (collapsedSide === "right") {
@@ -8372,7 +5615,7 @@ var SlidePresentationBook = ({
8372
5615
  setCollapsedSide("right");
8373
5616
  }
8374
5617
  }, [collapsedSide]);
8375
- const handleCollapseRight = useCallback4(() => {
5618
+ const handleCollapseRight = useCallback3(() => {
8376
5619
  if (collapsedSide === "right") {
8377
5620
  setCollapsedSide(null);
8378
5621
  } else if (collapsedSide === "left") {
@@ -8382,7 +5625,7 @@ var SlidePresentationBook = ({
8382
5625
  setCollapsedSide("left");
8383
5626
  }
8384
5627
  }, [collapsedSide]);
8385
- const toggleFullscreen = useCallback4(() => {
5628
+ const toggleFullscreen = useCallback3(() => {
8386
5629
  if (!containerRef.current)
8387
5630
  return;
8388
5631
  if (!isFullscreen) {
@@ -8393,7 +5636,7 @@ var SlidePresentationBook = ({
8393
5636
  setIsFullscreen(false);
8394
5637
  }
8395
5638
  }, [isFullscreen]);
8396
- useEffect11(() => {
5639
+ useEffect10(() => {
8397
5640
  const handleKeyDown = (event) => {
8398
5641
  if (event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement) {
8399
5642
  if (showSearch && (event.key === "Tab" || event.key === "Enter" || event.key === "Escape")) {} else {
@@ -8512,14 +5755,14 @@ var SlidePresentationBook = ({
8512
5755
  searchResults,
8513
5756
  effectiveTocDisplayMode
8514
5757
  ]);
8515
- useEffect11(() => {
5758
+ useEffect10(() => {
8516
5759
  if (currentSlide >= slides.length && slides.length > 0) {
8517
5760
  setCurrentSlide(slides.length - 1);
8518
5761
  }
8519
5762
  }, [slides.length, currentSlide]);
8520
5763
  const leftSlideIndex = currentSlide;
8521
5764
  const rightSlideIndex = viewMode === "book" ? currentSlide + 1 : -1;
8522
- return /* @__PURE__ */ React19.createElement("div", {
5765
+ return /* @__PURE__ */ React18.createElement("div", {
8523
5766
  ref: containerRef,
8524
5767
  style: {
8525
5768
  height: containerHeight,
@@ -8528,7 +5771,7 @@ var SlidePresentationBook = ({
8528
5771
  backgroundColor: theme2.colors.background,
8529
5772
  position: "relative"
8530
5773
  }
8531
- }, showNavigation && /* @__PURE__ */ React19.createElement(SlideNavigationHeader, {
5774
+ }, showNavigation && /* @__PURE__ */ React18.createElement(SlideNavigationHeader, {
8532
5775
  currentSlide,
8533
5776
  totalSlides: slides.length,
8534
5777
  showTOC,
@@ -8551,7 +5794,7 @@ var SlidePresentationBook = ({
8551
5794
  onClose,
8552
5795
  onCollapseLeft: handleCollapseLeft,
8553
5796
  onCollapseRight: handleCollapseRight
8554
- }), /* @__PURE__ */ React19.createElement("div", {
5797
+ }), /* @__PURE__ */ React18.createElement("div", {
8555
5798
  style: {
8556
5799
  flex: 1,
8557
5800
  width: "100%",
@@ -8559,11 +5802,11 @@ var SlidePresentationBook = ({
8559
5802
  position: "relative",
8560
5803
  display: "flex"
8561
5804
  }
8562
- }, viewMode === "single" && effectiveTocDisplayMode === "sidebar" ? /* @__PURE__ */ React19.createElement(R, {
5805
+ }, viewMode === "single" && effectiveTocDisplayMode === "sidebar" ? /* @__PURE__ */ React18.createElement(AnimatedResizableLayout2, {
8563
5806
  key: `toc-${tocSidebarPosition}`,
8564
5807
  collapsed: !showTOC,
8565
5808
  collapsibleSide: tocSidebarPosition,
8566
- leftPanel: tocSidebarPosition === "left" ? /* @__PURE__ */ React19.createElement("div", {
5809
+ leftPanel: tocSidebarPosition === "left" ? /* @__PURE__ */ React18.createElement("div", {
8567
5810
  style: {
8568
5811
  height: "100%",
8569
5812
  width: "100%",
@@ -8571,7 +5814,7 @@ var SlidePresentationBook = ({
8571
5814
  overflowY: "auto",
8572
5815
  overflowX: "hidden"
8573
5816
  }
8574
- }, /* @__PURE__ */ React19.createElement("div", {
5817
+ }, /* @__PURE__ */ React18.createElement("div", {
8575
5818
  style: {
8576
5819
  padding: theme2.space[3],
8577
5820
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -8580,7 +5823,7 @@ var SlidePresentationBook = ({
8580
5823
  top: 0,
8581
5824
  zIndex: 1
8582
5825
  }
8583
- }, /* @__PURE__ */ React19.createElement("h3", {
5826
+ }, /* @__PURE__ */ React18.createElement("h3", {
8584
5827
  style: {
8585
5828
  margin: 0,
8586
5829
  fontSize: theme2.fontSizes[3],
@@ -8588,18 +5831,18 @@ var SlidePresentationBook = ({
8588
5831
  color: theme2.colors.text,
8589
5832
  fontWeight: 600
8590
5833
  }
8591
- }, "Table of Contents"), /* @__PURE__ */ React19.createElement("p", {
5834
+ }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
8592
5835
  style: {
8593
5836
  margin: `${theme2.space[1]}px 0 0 0`,
8594
5837
  fontSize: theme2.fontSizes[0],
8595
5838
  color: theme2.colors.textSecondary,
8596
5839
  fontFamily: theme2.fonts.body
8597
5840
  }
8598
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React19.createElement("div", {
5841
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
8599
5842
  style: { padding: theme2.space[2] }
8600
5843
  }, slideTitles.map((title, index) => {
8601
5844
  const isCurrentPage = index === currentSlide;
8602
- return /* @__PURE__ */ React19.createElement("button", {
5845
+ return /* @__PURE__ */ React18.createElement("button", {
8603
5846
  key: index,
8604
5847
  onClick: () => navigateToSlide(index),
8605
5848
  style: {
@@ -8618,19 +5861,19 @@ var SlidePresentationBook = ({
8618
5861
  transition: "all 0.2s ease",
8619
5862
  position: "relative"
8620
5863
  },
8621
- onMouseOver: (e2) => {
5864
+ onMouseOver: (e) => {
8622
5865
  if (!isCurrentPage) {
8623
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
5866
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
8624
5867
  }
8625
5868
  },
8626
- onMouseOut: (e2) => {
5869
+ onMouseOut: (e) => {
8627
5870
  if (!isCurrentPage) {
8628
- e2.currentTarget.style.backgroundColor = "transparent";
5871
+ e.currentTarget.style.backgroundColor = "transparent";
8629
5872
  }
8630
5873
  }
8631
- }, /* @__PURE__ */ React19.createElement("div", {
5874
+ }, /* @__PURE__ */ React18.createElement("div", {
8632
5875
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
8633
- }, /* @__PURE__ */ React19.createElement("span", {
5876
+ }, /* @__PURE__ */ React18.createElement("span", {
8634
5877
  style: {
8635
5878
  display: "inline-block",
8636
5879
  minWidth: "24px",
@@ -8638,14 +5881,14 @@ var SlidePresentationBook = ({
8638
5881
  fontFamily: theme2.fonts.monospace,
8639
5882
  opacity: 0.6
8640
5883
  }
8641
- }, index + 1, "."), /* @__PURE__ */ React19.createElement("span", {
5884
+ }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
8642
5885
  style: {
8643
5886
  flex: 1,
8644
5887
  overflow: "hidden",
8645
5888
  textOverflow: "ellipsis",
8646
5889
  whiteSpace: "nowrap"
8647
5890
  }
8648
- }, title)), isCurrentPage && /* @__PURE__ */ React19.createElement("div", {
5891
+ }, title)), isCurrentPage && /* @__PURE__ */ React18.createElement("div", {
8649
5892
  style: {
8650
5893
  position: "absolute",
8651
5894
  left: 0,
@@ -8657,9 +5900,9 @@ var SlidePresentationBook = ({
8657
5900
  borderRadius: "0 2px 2px 0"
8658
5901
  }
8659
5902
  }));
8660
- }))) : /* @__PURE__ */ React19.createElement("div", {
5903
+ }))) : /* @__PURE__ */ React18.createElement("div", {
8661
5904
  style: { height: "100%", width: "100%", position: "relative" }
8662
- }, slides.length > 0 ? /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
5905
+ }, slides.length > 0 ? /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
8663
5906
  content: slides[leftSlideIndex] || "",
8664
5907
  slideIdPrefix: `${slideIdPrefix}-${leftSlideIndex}`,
8665
5908
  slideIndex: leftSlideIndex,
@@ -8676,7 +5919,7 @@ var SlidePresentationBook = ({
8676
5919
  searchQuery: showSearch ? searchQuery : undefined,
8677
5920
  repositoryInfo,
8678
5921
  containerWidth: width
8679
- }) : /* @__PURE__ */ React19.createElement("div", {
5922
+ }) : /* @__PURE__ */ React18.createElement("div", {
8680
5923
  style: {
8681
5924
  height: "100%",
8682
5925
  display: "flex",
@@ -8687,7 +5930,7 @@ var SlidePresentationBook = ({
8687
5930
  fontFamily: theme2.fonts.body
8688
5931
  }
8689
5932
  }, "No slides available")),
8690
- rightPanel: tocSidebarPosition === "right" ? /* @__PURE__ */ React19.createElement("div", {
5933
+ rightPanel: tocSidebarPosition === "right" ? /* @__PURE__ */ React18.createElement("div", {
8691
5934
  style: {
8692
5935
  height: "100%",
8693
5936
  width: "100%",
@@ -8695,7 +5938,7 @@ var SlidePresentationBook = ({
8695
5938
  overflowY: "auto",
8696
5939
  overflowX: "hidden"
8697
5940
  }
8698
- }, /* @__PURE__ */ React19.createElement("div", {
5941
+ }, /* @__PURE__ */ React18.createElement("div", {
8699
5942
  style: {
8700
5943
  padding: theme2.space[3],
8701
5944
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -8704,7 +5947,7 @@ var SlidePresentationBook = ({
8704
5947
  top: 0,
8705
5948
  zIndex: 1
8706
5949
  }
8707
- }, /* @__PURE__ */ React19.createElement("h3", {
5950
+ }, /* @__PURE__ */ React18.createElement("h3", {
8708
5951
  style: {
8709
5952
  margin: 0,
8710
5953
  fontSize: theme2.fontSizes[3],
@@ -8712,18 +5955,18 @@ var SlidePresentationBook = ({
8712
5955
  color: theme2.colors.text,
8713
5956
  fontWeight: 600
8714
5957
  }
8715
- }, "Table of Contents"), /* @__PURE__ */ React19.createElement("p", {
5958
+ }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
8716
5959
  style: {
8717
5960
  margin: `${theme2.space[1]}px 0 0 0`,
8718
5961
  fontSize: theme2.fontSizes[0],
8719
5962
  color: theme2.colors.textSecondary,
8720
5963
  fontFamily: theme2.fonts.body
8721
5964
  }
8722
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React19.createElement("div", {
5965
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
8723
5966
  style: { padding: theme2.space[2] }
8724
5967
  }, slideTitles.map((title, index) => {
8725
5968
  const isCurrentPage = index === currentSlide;
8726
- return /* @__PURE__ */ React19.createElement("button", {
5969
+ return /* @__PURE__ */ React18.createElement("button", {
8727
5970
  key: index,
8728
5971
  onClick: () => navigateToSlide(index),
8729
5972
  style: {
@@ -8742,19 +5985,19 @@ var SlidePresentationBook = ({
8742
5985
  transition: "all 0.2s ease",
8743
5986
  position: "relative"
8744
5987
  },
8745
- onMouseOver: (e2) => {
5988
+ onMouseOver: (e) => {
8746
5989
  if (!isCurrentPage) {
8747
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
5990
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
8748
5991
  }
8749
5992
  },
8750
- onMouseOut: (e2) => {
5993
+ onMouseOut: (e) => {
8751
5994
  if (!isCurrentPage) {
8752
- e2.currentTarget.style.backgroundColor = "transparent";
5995
+ e.currentTarget.style.backgroundColor = "transparent";
8753
5996
  }
8754
5997
  }
8755
- }, /* @__PURE__ */ React19.createElement("div", {
5998
+ }, /* @__PURE__ */ React18.createElement("div", {
8756
5999
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
8757
- }, /* @__PURE__ */ React19.createElement("span", {
6000
+ }, /* @__PURE__ */ React18.createElement("span", {
8758
6001
  style: {
8759
6002
  display: "inline-block",
8760
6003
  minWidth: "24px",
@@ -8762,14 +6005,14 @@ var SlidePresentationBook = ({
8762
6005
  fontFamily: theme2.fonts.monospace,
8763
6006
  opacity: 0.6
8764
6007
  }
8765
- }, index + 1, "."), /* @__PURE__ */ React19.createElement("span", {
6008
+ }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
8766
6009
  style: {
8767
6010
  flex: 1,
8768
6011
  overflow: "hidden",
8769
6012
  textOverflow: "ellipsis",
8770
6013
  whiteSpace: "nowrap"
8771
6014
  }
8772
- }, title)), isCurrentPage && /* @__PURE__ */ React19.createElement("div", {
6015
+ }, title)), isCurrentPage && /* @__PURE__ */ React18.createElement("div", {
8773
6016
  style: {
8774
6017
  position: "absolute",
8775
6018
  left: 0,
@@ -8781,9 +6024,9 @@ var SlidePresentationBook = ({
8781
6024
  borderRadius: "0 2px 2px 0"
8782
6025
  }
8783
6026
  }));
8784
- }))) : /* @__PURE__ */ React19.createElement("div", {
6027
+ }))) : /* @__PURE__ */ React18.createElement("div", {
8785
6028
  style: { height: "100%", width: "100%", position: "relative" }
8786
- }, slides.length > 0 ? /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
6029
+ }, slides.length > 0 ? /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
8787
6030
  content: slides[leftSlideIndex] || "",
8788
6031
  slideIdPrefix: `${slideIdPrefix}-${leftSlideIndex}`,
8789
6032
  slideIndex: leftSlideIndex,
@@ -8800,7 +6043,7 @@ var SlidePresentationBook = ({
8800
6043
  searchQuery: showSearch ? searchQuery : undefined,
8801
6044
  repositoryInfo,
8802
6045
  containerWidth: width
8803
- }) : /* @__PURE__ */ React19.createElement("div", {
6046
+ }) : /* @__PURE__ */ React18.createElement("div", {
8804
6047
  style: {
8805
6048
  height: "100%",
8806
6049
  display: "flex",
@@ -8815,7 +6058,7 @@ var SlidePresentationBook = ({
8815
6058
  minSize: 15,
8816
6059
  showCollapseButton: false,
8817
6060
  theme: theme2
8818
- }) : /* @__PURE__ */ React19.createElement(React19.Fragment, null, effectiveTocDisplayMode === "overlay" && /* @__PURE__ */ React19.createElement("div", {
6061
+ }) : /* @__PURE__ */ React18.createElement(React18.Fragment, null, effectiveTocDisplayMode === "overlay" && /* @__PURE__ */ React18.createElement("div", {
8819
6062
  style: {
8820
6063
  position: "absolute",
8821
6064
  ...isMobile ? {
@@ -8841,7 +6084,7 @@ var SlidePresentationBook = ({
8841
6084
  overflowY: "auto",
8842
6085
  overflowX: "hidden"
8843
6086
  }
8844
- }, /* @__PURE__ */ React19.createElement("div", {
6087
+ }, /* @__PURE__ */ React18.createElement("div", {
8845
6088
  style: {
8846
6089
  padding: theme2.space[3],
8847
6090
  borderBottom: `1px solid ${theme2.colors.border}`,
@@ -8850,7 +6093,7 @@ var SlidePresentationBook = ({
8850
6093
  top: 0,
8851
6094
  zIndex: 1
8852
6095
  }
8853
- }, /* @__PURE__ */ React19.createElement("h3", {
6096
+ }, /* @__PURE__ */ React18.createElement("h3", {
8854
6097
  style: {
8855
6098
  margin: 0,
8856
6099
  fontSize: theme2.fontSizes[3],
@@ -8858,18 +6101,18 @@ var SlidePresentationBook = ({
8858
6101
  color: theme2.colors.text,
8859
6102
  fontWeight: 600
8860
6103
  }
8861
- }, "Table of Contents"), /* @__PURE__ */ React19.createElement("p", {
6104
+ }, "Table of Contents"), /* @__PURE__ */ React18.createElement("p", {
8862
6105
  style: {
8863
6106
  margin: `${theme2.space[1]}px 0 0 0`,
8864
6107
  fontSize: theme2.fontSizes[0],
8865
6108
  color: theme2.colors.textSecondary,
8866
6109
  fontFamily: theme2.fonts.body
8867
6110
  }
8868
- }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React19.createElement("div", {
6111
+ }, slides.length, " ", slides.length === 1 ? "slide" : "slides")), /* @__PURE__ */ React18.createElement("div", {
8869
6112
  style: { padding: theme2.space[2] }
8870
6113
  }, slideTitles.map((title, index) => {
8871
6114
  const isCurrentPage = viewMode === "book" ? index === leftSlideIndex || index === rightSlideIndex : index === currentSlide;
8872
- return /* @__PURE__ */ React19.createElement("button", {
6115
+ return /* @__PURE__ */ React18.createElement("button", {
8873
6116
  key: index,
8874
6117
  onClick: () => navigateToSlide(index),
8875
6118
  style: {
@@ -8888,19 +6131,19 @@ var SlidePresentationBook = ({
8888
6131
  transition: "all 0.2s ease",
8889
6132
  position: "relative"
8890
6133
  },
8891
- onMouseOver: (e2) => {
6134
+ onMouseOver: (e) => {
8892
6135
  if (!isCurrentPage) {
8893
- e2.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
6136
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundHover;
8894
6137
  }
8895
6138
  },
8896
- onMouseOut: (e2) => {
6139
+ onMouseOut: (e) => {
8897
6140
  if (!isCurrentPage) {
8898
- e2.currentTarget.style.backgroundColor = "transparent";
6141
+ e.currentTarget.style.backgroundColor = "transparent";
8899
6142
  }
8900
6143
  }
8901
- }, /* @__PURE__ */ React19.createElement("div", {
6144
+ }, /* @__PURE__ */ React18.createElement("div", {
8902
6145
  style: { display: "flex", alignItems: "center", gap: theme2.space[2] }
8903
- }, /* @__PURE__ */ React19.createElement("span", {
6146
+ }, /* @__PURE__ */ React18.createElement("span", {
8904
6147
  style: {
8905
6148
  display: "inline-block",
8906
6149
  minWidth: "24px",
@@ -8908,14 +6151,14 @@ var SlidePresentationBook = ({
8908
6151
  fontFamily: theme2.fonts.monospace,
8909
6152
  opacity: 0.6
8910
6153
  }
8911
- }, index + 1, "."), /* @__PURE__ */ React19.createElement("span", {
6154
+ }, index + 1, "."), /* @__PURE__ */ React18.createElement("span", {
8912
6155
  style: {
8913
6156
  flex: 1,
8914
6157
  overflow: "hidden",
8915
6158
  textOverflow: "ellipsis",
8916
6159
  whiteSpace: "nowrap"
8917
6160
  }
8918
- }, title)), isCurrentPage && /* @__PURE__ */ React19.createElement("div", {
6161
+ }, title)), isCurrentPage && /* @__PURE__ */ React18.createElement("div", {
8919
6162
  style: {
8920
6163
  position: "absolute",
8921
6164
  left: 0,
@@ -8927,7 +6170,7 @@ var SlidePresentationBook = ({
8927
6170
  borderRadius: "0 2px 2px 0"
8928
6171
  }
8929
6172
  }));
8930
- }))), effectiveTocDisplayMode === "overlay" && showTOC && /* @__PURE__ */ React19.createElement("div", {
6173
+ }))), effectiveTocDisplayMode === "overlay" && showTOC && /* @__PURE__ */ React18.createElement("div", {
8931
6174
  onClick: () => setShowTOC(false),
8932
6175
  style: {
8933
6176
  position: "absolute",
@@ -8939,7 +6182,7 @@ var SlidePresentationBook = ({
8939
6182
  zIndex: 9,
8940
6183
  cursor: "pointer"
8941
6184
  }
8942
- }), /* @__PURE__ */ React19.createElement("div", {
6185
+ }), /* @__PURE__ */ React18.createElement("div", {
8943
6186
  style: {
8944
6187
  flex: 1,
8945
6188
  position: "relative",
@@ -8949,18 +6192,18 @@ var SlidePresentationBook = ({
8949
6192
  backgroundColor: theme2.colors.background,
8950
6193
  width: "100%"
8951
6194
  }
8952
- }, slides.length > 0 ? viewMode === "book" && slides.length > 1 ? /* @__PURE__ */ React19.createElement(R, {
6195
+ }, slides.length > 0 ? viewMode === "book" && slides.length > 1 ? /* @__PURE__ */ React18.createElement(AnimatedResizableLayout2, {
8953
6196
  key: `${lastInteractedSide}-${collapsedSide}`,
8954
6197
  collapsed: collapsedSide !== null,
8955
6198
  collapsibleSide: lastInteractedSide,
8956
- leftPanel: /* @__PURE__ */ React19.createElement("div", {
6199
+ leftPanel: /* @__PURE__ */ React18.createElement("div", {
8957
6200
  style: {
8958
6201
  height: "100%",
8959
6202
  width: "100%",
8960
6203
  position: "relative",
8961
6204
  overflow: "hidden"
8962
6205
  }
8963
- }, /* @__PURE__ */ React19.createElement("div", {
6206
+ }, /* @__PURE__ */ React18.createElement("div", {
8964
6207
  style: {
8965
6208
  height: "100%",
8966
6209
  width: "100%",
@@ -8975,7 +6218,7 @@ var SlidePresentationBook = ({
8975
6218
  right: 0,
8976
6219
  bottom: 0
8977
6220
  }
8978
- }, /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
6221
+ }, /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
8979
6222
  content: slides[leftSlideIndex] || "",
8980
6223
  slideIdPrefix: `${slideIdPrefix}-${leftSlideIndex}`,
8981
6224
  slideIndex: leftSlideIndex,
@@ -9000,14 +6243,14 @@ var SlidePresentationBook = ({
9000
6243
  },
9001
6244
  disableScroll: false
9002
6245
  }))),
9003
- rightPanel: rightSlideIndex < slides.length ? /* @__PURE__ */ React19.createElement("div", {
6246
+ rightPanel: rightSlideIndex < slides.length ? /* @__PURE__ */ React18.createElement("div", {
9004
6247
  style: {
9005
6248
  height: "100%",
9006
6249
  width: "100%",
9007
6250
  position: "relative",
9008
6251
  overflow: "hidden"
9009
6252
  }
9010
- }, /* @__PURE__ */ React19.createElement("div", {
6253
+ }, /* @__PURE__ */ React18.createElement("div", {
9011
6254
  style: {
9012
6255
  height: "100%",
9013
6256
  width: "100%",
@@ -9022,7 +6265,7 @@ var SlidePresentationBook = ({
9022
6265
  right: 0,
9023
6266
  bottom: 0
9024
6267
  }
9025
- }, /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
6268
+ }, /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
9026
6269
  content: slides[rightSlideIndex] || "",
9027
6270
  slideIdPrefix: `${slideIdPrefix}-${rightSlideIndex}`,
9028
6271
  slideIndex: rightSlideIndex,
@@ -9046,7 +6289,7 @@ var SlidePresentationBook = ({
9046
6289
  top: `${theme2.space[3]}px`
9047
6290
  },
9048
6291
  disableScroll: false
9049
- }))) : /* @__PURE__ */ React19.createElement("div", {
6292
+ }))) : /* @__PURE__ */ React18.createElement("div", {
9050
6293
  style: {
9051
6294
  height: "100%",
9052
6295
  backgroundColor: theme2.colors.background,
@@ -9066,7 +6309,7 @@ var SlidePresentationBook = ({
9066
6309
  minSize: 30,
9067
6310
  showCollapseButton: false,
9068
6311
  theme: theme2
9069
- }) : /* @__PURE__ */ React19.createElement("div", {
6312
+ }) : /* @__PURE__ */ React18.createElement("div", {
9070
6313
  style: {
9071
6314
  flex: "1 1 0%",
9072
6315
  backgroundColor: "transparent",
@@ -9081,7 +6324,7 @@ var SlidePresentationBook = ({
9081
6324
  justifyContent: "center"
9082
6325
  } : {}
9083
6326
  }
9084
- }, /* @__PURE__ */ React19.createElement("div", {
6327
+ }, /* @__PURE__ */ React18.createElement("div", {
9085
6328
  style: {
9086
6329
  ...viewMode === "book" && slides.length === 1 ? {
9087
6330
  width: "50%",
@@ -9093,7 +6336,7 @@ var SlidePresentationBook = ({
9093
6336
  height: "100%"
9094
6337
  }
9095
6338
  }
9096
- }, /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
6339
+ }, /* @__PURE__ */ React18.createElement(IndustryMarkdownSlide, {
9097
6340
  content: slides[leftSlideIndex] || "",
9098
6341
  slideIdPrefix: `${slideIdPrefix}-${leftSlideIndex}`,
9099
6342
  slideIndex: leftSlideIndex,
@@ -9112,7 +6355,7 @@ var SlidePresentationBook = ({
9112
6355
  containerWidth: width,
9113
6356
  transparentBackground: false,
9114
6357
  disableScroll: false
9115
- }))) : /* @__PURE__ */ React19.createElement("div", {
6358
+ }))) : /* @__PURE__ */ React18.createElement("div", {
9116
6359
  style: {
9117
6360
  height: "100%",
9118
6361
  display: "flex",
@@ -9122,7 +6365,7 @@ var SlidePresentationBook = ({
9122
6365
  fontSize: theme2.fontSizes[2],
9123
6366
  fontFamily: theme2.fonts.body
9124
6367
  }
9125
- }, "No slides available")), viewMode === "book" && slides.length > 1 && /* @__PURE__ */ React19.createElement(React19.Fragment, null, /* @__PURE__ */ React19.createElement("div", {
6368
+ }, "No slides available")), viewMode === "book" && slides.length > 1 && /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement("div", {
9126
6369
  style: {
9127
6370
  position: "absolute",
9128
6371
  bottom: theme2.space[3],
@@ -9131,7 +6374,7 @@ var SlidePresentationBook = ({
9131
6374
  color: theme2.colors.textSecondary,
9132
6375
  fontFamily: theme2.fonts.monospace
9133
6376
  }
9134
- }, leftSlideIndex + 1), rightSlideIndex < slides.length && /* @__PURE__ */ React19.createElement("div", {
6377
+ }, leftSlideIndex + 1), rightSlideIndex < slides.length && /* @__PURE__ */ React18.createElement("div", {
9135
6378
  style: {
9136
6379
  position: "absolute",
9137
6380
  bottom: theme2.space[3],
@@ -9140,7 +6383,7 @@ var SlidePresentationBook = ({
9140
6383
  color: theme2.colors.textSecondary,
9141
6384
  fontFamily: theme2.fonts.monospace
9142
6385
  }
9143
- }, rightSlideIndex + 1)))), showNavigation && slides.length > 1 && /* @__PURE__ */ React19.createElement("div", {
6386
+ }, rightSlideIndex + 1)))), showNavigation && slides.length > 1 && /* @__PURE__ */ React18.createElement("div", {
9144
6387
  style: {
9145
6388
  position: "absolute",
9146
6389
  bottom: 0,
@@ -9150,14 +6393,14 @@ var SlidePresentationBook = ({
9150
6393
  backgroundColor: theme2.colors.border,
9151
6394
  opacity: 0.3
9152
6395
  }
9153
- }, /* @__PURE__ */ React19.createElement("div", {
6396
+ }, /* @__PURE__ */ React18.createElement("div", {
9154
6397
  style: {
9155
6398
  height: "100%",
9156
6399
  width: `${(currentSlide + stepSize) / slides.length * 100}%`,
9157
6400
  backgroundColor: theme2.colors.primary,
9158
6401
  transition: "width 0.3s ease"
9159
6402
  }
9160
- })), /* @__PURE__ */ React19.createElement(SlideSearchBar, {
6403
+ })), /* @__PURE__ */ React18.createElement(SlideSearchBar, {
9161
6404
  showSearch,
9162
6405
  searchQuery,
9163
6406
  setSearchQuery,
@@ -9175,7 +6418,7 @@ var SlidePresentationBook = ({
9175
6418
  }));
9176
6419
  };
9177
6420
  // industryMarkdown/components/DocumentView.tsx
9178
- import React20, { useRef as useRef12 } from "react";
6421
+ import React19, { useRef as useRef11 } from "react";
9179
6422
  var DocumentView = ({
9180
6423
  content,
9181
6424
  onCheckboxChange,
@@ -9194,22 +6437,22 @@ var DocumentView = ({
9194
6437
  transparentBackground = false,
9195
6438
  editable = false
9196
6439
  }) => {
9197
- const containerRef = useRef12(null);
6440
+ const containerRef = useRef11(null);
9198
6441
  const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
9199
- return /* @__PURE__ */ React20.createElement("div", {
6442
+ return /* @__PURE__ */ React19.createElement("div", {
9200
6443
  ref: containerRef,
9201
6444
  style: {
9202
6445
  height: "100%",
9203
6446
  overflow: "auto",
9204
6447
  backgroundColor
9205
6448
  }
9206
- }, /* @__PURE__ */ React20.createElement("div", {
6449
+ }, /* @__PURE__ */ React19.createElement("div", {
9207
6450
  style: {
9208
6451
  maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
9209
6452
  margin: "0 auto",
9210
6453
  height: "100%"
9211
6454
  }
9212
- }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
6455
+ }, /* @__PURE__ */ React19.createElement(IndustryMarkdownSlide, {
9213
6456
  content,
9214
6457
  slideIdPrefix,
9215
6458
  slideIndex: 0,
@@ -9230,7 +6473,7 @@ var DocumentView = ({
9230
6473
  })));
9231
6474
  };
9232
6475
  // industryMarkdown/components/SkillMarkdown.tsx
9233
- import React21 from "react";
6476
+ import React20 from "react";
9234
6477
  var formatRelativeTime = (dateString) => {
9235
6478
  try {
9236
6479
  const date = new Date(dateString);
@@ -9261,15 +6504,15 @@ var SkillMetadataSection = ({
9261
6504
  metadata,
9262
6505
  theme: theme2
9263
6506
  }) => {
9264
- return /* @__PURE__ */ React21.createElement("div", {
6507
+ return /* @__PURE__ */ React20.createElement("div", {
9265
6508
  style: {
9266
6509
  borderBottom: `2px solid ${theme2.colors.border}`,
9267
6510
  paddingBottom: theme2.space[3],
9268
6511
  marginBottom: theme2.space[2]
9269
6512
  }
9270
- }, /* @__PURE__ */ React21.createElement("div", {
6513
+ }, /* @__PURE__ */ React20.createElement("div", {
9271
6514
  style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start", marginBottom: theme2.space[2] }
9272
- }, /* @__PURE__ */ React21.createElement("h1", {
6515
+ }, /* @__PURE__ */ React20.createElement("h1", {
9273
6516
  style: {
9274
6517
  fontSize: theme2.fontSizes[6],
9275
6518
  fontWeight: 700,
@@ -9277,9 +6520,9 @@ var SkillMetadataSection = ({
9277
6520
  color: theme2.colors.text,
9278
6521
  fontFamily: theme2.fonts.heading
9279
6522
  }
9280
- }, metadata.name), (metadata.metadata?.["last-updated"] || metadata.license) && /* @__PURE__ */ React21.createElement("div", {
6523
+ }, metadata.name), (metadata.metadata?.["last-updated"] || metadata.license) && /* @__PURE__ */ React20.createElement("div", {
9281
6524
  style: { display: "flex", flexDirection: "column", alignItems: "flex-end", gap: theme2.space[1], marginLeft: theme2.space[3], marginTop: theme2.space[1] }
9282
- }, metadata.metadata?.["last-updated"] && /* @__PURE__ */ React21.createElement("span", {
6525
+ }, metadata.metadata?.["last-updated"] && /* @__PURE__ */ React20.createElement("span", {
9283
6526
  style: {
9284
6527
  fontSize: theme2.fontSizes[0],
9285
6528
  color: theme2.colors.textSecondary,
@@ -9287,7 +6530,7 @@ var SkillMetadataSection = ({
9287
6530
  fontWeight: 500,
9288
6531
  whiteSpace: "nowrap"
9289
6532
  }
9290
- }, formatRelativeTime(metadata.metadata["last-updated"])), metadata.license && /* @__PURE__ */ React21.createElement("span", {
6533
+ }, formatRelativeTime(metadata.metadata["last-updated"])), metadata.license && /* @__PURE__ */ React20.createElement("span", {
9291
6534
  style: {
9292
6535
  fontSize: theme2.fontSizes[1],
9293
6536
  color: theme2.colors.textSecondary,
@@ -9295,7 +6538,7 @@ var SkillMetadataSection = ({
9295
6538
  fontWeight: 500,
9296
6539
  whiteSpace: "nowrap"
9297
6540
  }
9298
- }, metadata.license))), /* @__PURE__ */ React21.createElement("p", {
6541
+ }, metadata.license))), /* @__PURE__ */ React20.createElement("p", {
9299
6542
  style: {
9300
6543
  fontSize: theme2.fontSizes[3],
9301
6544
  color: theme2.colors.textSecondary,
@@ -9314,9 +6557,9 @@ var SkillMarkdown = ({
9314
6557
  showRawOnError = false,
9315
6558
  containerWidth
9316
6559
  }) => {
9317
- const [parsed, setParsed] = React21.useState(null);
9318
- const [error, setError] = React21.useState(null);
9319
- React21.useEffect(() => {
6560
+ const [parsed, setParsed] = React20.useState(null);
6561
+ const [error, setError] = React20.useState(null);
6562
+ React20.useEffect(() => {
9320
6563
  try {
9321
6564
  const skill = parseSkillMarkdown(content);
9322
6565
  setParsed(skill);
@@ -9330,16 +6573,16 @@ var SkillMarkdown = ({
9330
6573
  }
9331
6574
  }, [content, onParsed, onError]);
9332
6575
  if (!theme2 || !theme2.space) {
9333
- return /* @__PURE__ */ React21.createElement("div", {
6576
+ return /* @__PURE__ */ React20.createElement("div", {
9334
6577
  className,
9335
6578
  style: { width: "100%", height: "100%" }
9336
- }, /* @__PURE__ */ React21.createElement("div", {
6579
+ }, /* @__PURE__ */ React20.createElement("div", {
9337
6580
  style: { padding: "2rem", textAlign: "center", color: "#856404" }
9338
6581
  }, "Error: Theme not available. Wrap component in ThemeProvider."));
9339
6582
  }
9340
6583
  if (error) {
9341
6584
  if (showRawOnError) {
9342
- return /* @__PURE__ */ React21.createElement("div", {
6585
+ return /* @__PURE__ */ React20.createElement("div", {
9343
6586
  className,
9344
6587
  style: {
9345
6588
  width: "100%",
@@ -9347,9 +6590,9 @@ var SkillMarkdown = ({
9347
6590
  overflow: "auto",
9348
6591
  background: theme2.colors.background
9349
6592
  }
9350
- }, /* @__PURE__ */ React21.createElement("div", {
6593
+ }, /* @__PURE__ */ React20.createElement("div", {
9351
6594
  style: { padding: theme2.space[3] }
9352
- }, /* @__PURE__ */ React21.createElement(IndustryMarkdownSlide, {
6595
+ }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
9353
6596
  content,
9354
6597
  theme: theme2,
9355
6598
  slideIdPrefix: "skill-fallback",
@@ -9358,7 +6601,7 @@ var SkillMarkdown = ({
9358
6601
  containerWidth
9359
6602
  })));
9360
6603
  }
9361
- return /* @__PURE__ */ React21.createElement("div", {
6604
+ return /* @__PURE__ */ React20.createElement("div", {
9362
6605
  className,
9363
6606
  style: {
9364
6607
  display: "flex",
@@ -9371,7 +6614,7 @@ var SkillMarkdown = ({
9371
6614
  background: theme2.colors.background,
9372
6615
  overflow: "auto"
9373
6616
  }
9374
- }, /* @__PURE__ */ React21.createElement("div", {
6617
+ }, /* @__PURE__ */ React20.createElement("div", {
9375
6618
  style: {
9376
6619
  background: "#fff3cd",
9377
6620
  border: "1px solid #ffc107",
@@ -9379,9 +6622,9 @@ var SkillMarkdown = ({
9379
6622
  padding: theme2.space[4],
9380
6623
  maxWidth: "600px"
9381
6624
  }
9382
- }, /* @__PURE__ */ React21.createElement("h2", {
6625
+ }, /* @__PURE__ */ React20.createElement("h2", {
9383
6626
  style: { color: "#856404", marginTop: 0 }
9384
- }, "Failed to parse SKILL.md"), /* @__PURE__ */ React21.createElement("p", {
6627
+ }, "Failed to parse SKILL.md"), /* @__PURE__ */ React20.createElement("p", {
9385
6628
  style: {
9386
6629
  fontWeight: 600,
9387
6630
  color: "#856404",
@@ -9389,9 +6632,9 @@ var SkillMarkdown = ({
9389
6632
  textTransform: "uppercase",
9390
6633
  letterSpacing: "0.5px"
9391
6634
  }
9392
- }, error instanceof SkillParseError && "Parse Error", error instanceof SkillValidationError && "Validation Error", !(error instanceof SkillParseError) && !(error instanceof SkillValidationError) && "Error"), /* @__PURE__ */ React21.createElement("p", {
6635
+ }, error instanceof SkillParseError && "Parse Error", error instanceof SkillValidationError && "Validation Error", !(error instanceof SkillParseError) && !(error instanceof SkillValidationError) && "Error"), /* @__PURE__ */ React20.createElement("p", {
9393
6636
  style: { color: "#856404", margin: `${theme2.space[3]} 0` }
9394
- }, error.message), error instanceof SkillValidationError && error.field && /* @__PURE__ */ React21.createElement("p", {
6637
+ }, error.message), error instanceof SkillValidationError && error.field && /* @__PURE__ */ React20.createElement("p", {
9395
6638
  style: {
9396
6639
  fontFamily: theme2.fonts.monospace,
9397
6640
  color: "#856404",
@@ -9400,7 +6643,7 @@ var SkillMarkdown = ({
9400
6643
  }, "Field: ", error.field)));
9401
6644
  }
9402
6645
  if (!parsed) {
9403
- return /* @__PURE__ */ React21.createElement("div", {
6646
+ return /* @__PURE__ */ React20.createElement("div", {
9404
6647
  className,
9405
6648
  style: {
9406
6649
  display: "flex",
@@ -9415,7 +6658,7 @@ var SkillMarkdown = ({
9415
6658
  }
9416
6659
  }, "Loading...");
9417
6660
  }
9418
- return /* @__PURE__ */ React21.createElement("div", {
6661
+ return /* @__PURE__ */ React20.createElement("div", {
9419
6662
  className,
9420
6663
  style: {
9421
6664
  width: "100%",
@@ -9424,25 +6667,25 @@ var SkillMarkdown = ({
9424
6667
  flexDirection: "column",
9425
6668
  background: theme2.colors.background
9426
6669
  }
9427
- }, /* @__PURE__ */ React21.createElement("div", {
6670
+ }, /* @__PURE__ */ React20.createElement("div", {
9428
6671
  style: { padding: theme2.space[3], paddingBottom: 0 }
9429
- }, /* @__PURE__ */ React21.createElement(SkillMetadataSection, {
6672
+ }, /* @__PURE__ */ React20.createElement(SkillMetadataSection, {
9430
6673
  metadata: parsed.metadata,
9431
6674
  theme: theme2
9432
- })), /* @__PURE__ */ React21.createElement("div", {
6675
+ })), /* @__PURE__ */ React20.createElement("div", {
9433
6676
  style: { flex: 1, overflow: "auto", padding: theme2.space[3], paddingTop: 0 }
9434
- }, /* @__PURE__ */ React21.createElement("div", {
6677
+ }, /* @__PURE__ */ React20.createElement("div", {
9435
6678
  style: { display: "flex", gap: theme2.space[4], alignItems: "flex-start" }
9436
- }, /* @__PURE__ */ React21.createElement("div", {
6679
+ }, /* @__PURE__ */ React20.createElement("div", {
9437
6680
  style: { flex: 1, minWidth: 0 }
9438
- }, /* @__PURE__ */ React21.createElement(IndustryMarkdownSlide, {
6681
+ }, /* @__PURE__ */ React20.createElement(IndustryMarkdownSlide, {
9439
6682
  content: parsed.body,
9440
6683
  theme: theme2,
9441
6684
  slideIdPrefix: "skill-body",
9442
6685
  slideIndex: 0,
9443
6686
  isVisible: true,
9444
6687
  containerWidth
9445
- })), (parsed.metadata.compatibility || parsed.metadata["allowed-tools"] || parsed.metadata.metadata) && /* @__PURE__ */ React21.createElement("div", {
6688
+ })), (parsed.metadata.compatibility || parsed.metadata["allowed-tools"] || parsed.metadata.metadata) && /* @__PURE__ */ React20.createElement("div", {
9446
6689
  style: {
9447
6690
  width: "300px",
9448
6691
  flexShrink: 0,
@@ -9451,9 +6694,9 @@ var SkillMarkdown = ({
9451
6694
  position: "sticky",
9452
6695
  top: theme2.space[3]
9453
6696
  }
9454
- }, parsed.metadata.compatibility && /* @__PURE__ */ React21.createElement("div", {
6697
+ }, parsed.metadata.compatibility && /* @__PURE__ */ React20.createElement("div", {
9455
6698
  style: { marginBottom: theme2.space[3] }
9456
- }, /* @__PURE__ */ React21.createElement("div", {
6699
+ }, /* @__PURE__ */ React20.createElement("div", {
9457
6700
  style: {
9458
6701
  fontFamily: theme2.fonts.heading,
9459
6702
  fontWeight: 600,
@@ -9463,11 +6706,11 @@ var SkillMarkdown = ({
9463
6706
  color: theme2.colors.textSecondary,
9464
6707
  marginBottom: theme2.space[1]
9465
6708
  }
9466
- }, "Compatibility"), /* @__PURE__ */ React21.createElement("div", {
6709
+ }, "Compatibility"), /* @__PURE__ */ React20.createElement("div", {
9467
6710
  style: { fontSize: theme2.fontSizes[1], color: theme2.colors.text, fontFamily: theme2.fonts.body }
9468
- }, parsed.metadata.compatibility)), parsed.metadata["allowed-tools"] && parsed.metadata["allowed-tools"].length > 0 && /* @__PURE__ */ React21.createElement("div", {
6711
+ }, parsed.metadata.compatibility)), parsed.metadata["allowed-tools"] && parsed.metadata["allowed-tools"].length > 0 && /* @__PURE__ */ React20.createElement("div", {
9469
6712
  style: { marginBottom: theme2.space[3] }
9470
- }, /* @__PURE__ */ React21.createElement("div", {
6713
+ }, /* @__PURE__ */ React20.createElement("div", {
9471
6714
  style: {
9472
6715
  fontFamily: theme2.fonts.heading,
9473
6716
  fontWeight: 600,
@@ -9477,9 +6720,9 @@ var SkillMarkdown = ({
9477
6720
  color: theme2.colors.textSecondary,
9478
6721
  marginBottom: theme2.space[1]
9479
6722
  }
9480
- }, "Allowed Tools"), /* @__PURE__ */ React21.createElement("div", {
6723
+ }, "Allowed Tools"), /* @__PURE__ */ React20.createElement("div", {
9481
6724
  style: { display: "flex", flexWrap: "wrap", gap: theme2.space[1] }
9482
- }, parsed.metadata["allowed-tools"].map((tool, index) => /* @__PURE__ */ React21.createElement("span", {
6725
+ }, parsed.metadata["allowed-tools"].map((tool, index) => /* @__PURE__ */ React20.createElement("span", {
9483
6726
  key: index,
9484
6727
  style: {
9485
6728
  display: "inline-block",
@@ -9494,7 +6737,7 @@ var SkillMarkdown = ({
9494
6737
  fontWeight: 500,
9495
6738
  fontFamily: theme2.fonts.monospace
9496
6739
  }
9497
- }, tool)))), parsed.metadata.metadata && Object.keys(parsed.metadata.metadata).length > 0 && /* @__PURE__ */ React21.createElement("div", null, /* @__PURE__ */ React21.createElement("div", {
6740
+ }, tool)))), parsed.metadata.metadata && Object.keys(parsed.metadata.metadata).length > 0 && /* @__PURE__ */ React20.createElement("div", null, /* @__PURE__ */ React20.createElement("div", {
9498
6741
  style: {
9499
6742
  fontFamily: theme2.fonts.heading,
9500
6743
  fontWeight: 600,
@@ -9504,18 +6747,18 @@ var SkillMarkdown = ({
9504
6747
  color: theme2.colors.textSecondary,
9505
6748
  marginBottom: theme2.space[1]
9506
6749
  }
9507
- }, "Metadata"), /* @__PURE__ */ React21.createElement("div", {
6750
+ }, "Metadata"), /* @__PURE__ */ React20.createElement("div", {
9508
6751
  style: { display: "flex", flexDirection: "column", gap: theme2.space[1] }
9509
- }, Object.entries(parsed.metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ React21.createElement("div", {
6752
+ }, Object.entries(parsed.metadata.metadata).filter(([key]) => key !== "last-updated").map(([key, value]) => /* @__PURE__ */ React20.createElement("div", {
9510
6753
  key
9511
- }, /* @__PURE__ */ React21.createElement("div", {
6754
+ }, /* @__PURE__ */ React20.createElement("div", {
9512
6755
  style: {
9513
6756
  fontSize: theme2.fontSizes[0],
9514
6757
  fontWeight: 600,
9515
6758
  color: theme2.colors.textSecondary,
9516
6759
  fontFamily: theme2.fonts.body
9517
6760
  }
9518
- }, key, ":"), /* @__PURE__ */ React21.createElement("div", {
6761
+ }, key, ":"), /* @__PURE__ */ React20.createElement("div", {
9519
6762
  style: {
9520
6763
  fontSize: theme2.fontSizes[1],
9521
6764
  color: theme2.colors.text,