@industry-theme/backlogmd-kanban-panel 1.0.33 → 1.0.34

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.
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value;
3
3
  var __publicField = (obj, key2, value) => __defNormalProp(obj, typeof key2 !== "symbol" ? key2 + "" : key2, value);
4
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
4
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
5
5
  import * as React2 from "react";
6
6
  import React2__default, { useLayoutEffect, useEffect, useRef, useMemo, useCallback, useState, createContext, memo, useReducer, useContext, forwardRef, cloneElement, createElement, useImperativeHandle } from "react";
7
7
  import { unstable_batchedUpdates, createPortal } from "react-dom";
@@ -33,7 +33,7 @@ function isDocument(node2) {
33
33
  } = getWindow(node2);
34
34
  return node2 instanceof Document;
35
35
  }
36
- function isHTMLElement(node2) {
36
+ function isHTMLElement$1(node2) {
37
37
  if (isWindow(node2)) {
38
38
  return false;
39
39
  }
@@ -55,15 +55,15 @@ function getOwnerDocument(target) {
55
55
  if (isDocument(target)) {
56
56
  return target;
57
57
  }
58
- if (isHTMLElement(target) || isSVGElement(target)) {
58
+ if (isHTMLElement$1(target) || isSVGElement(target)) {
59
59
  return target.ownerDocument;
60
60
  }
61
61
  return document;
62
62
  }
63
- const useIsomorphicLayoutEffect$1 = canUseDOM ? useLayoutEffect : useEffect;
63
+ const useIsomorphicLayoutEffect$2 = canUseDOM ? useLayoutEffect : useEffect;
64
64
  function useEvent(handler) {
65
65
  const handlerRef = useRef(handler);
66
- useIsomorphicLayoutEffect$1(() => {
66
+ useIsomorphicLayoutEffect$2(() => {
67
67
  handlerRef.current = handler;
68
68
  });
69
69
  return useCallback(function() {
@@ -91,7 +91,7 @@ function useLatestValue(value, dependencies) {
91
91
  dependencies = [value];
92
92
  }
93
93
  const valueRef = useRef(value);
94
- useIsomorphicLayoutEffect$1(() => {
94
+ useIsomorphicLayoutEffect$2(() => {
95
95
  if (valueRef.current !== value) {
96
96
  valueRef.current = value;
97
97
  }
@@ -133,7 +133,7 @@ function usePrevious(value) {
133
133
  return ref.current;
134
134
  }
135
135
  let ids = {};
136
- function useUniqueId$1(prefix, value) {
136
+ function useUniqueId$2(prefix, value) {
137
137
  return useMemo(() => {
138
138
  if (value) {
139
139
  return value;
@@ -396,7 +396,7 @@ function Accessibility(_ref) {
396
396
  announce,
397
397
  announcement
398
398
  } = useAnnouncement();
399
- const liveRegionId = useUniqueId$1("DndLiveRegion");
399
+ const liveRegionId = useUniqueId$2("DndLiveRegion");
400
400
  const [mounted, setMounted] = useState(false);
401
401
  useEffect(() => {
402
402
  setMounted(true);
@@ -731,7 +731,7 @@ function getScrollableAncestors(element2, limit) {
731
731
  scrollParents.push(node2.scrollingElement);
732
732
  return scrollParents;
733
733
  }
734
- if (!isHTMLElement(node2) || isSVGElement(node2)) {
734
+ if (!isHTMLElement$1(node2) || isSVGElement(node2)) {
735
735
  return scrollParents;
736
736
  }
737
737
  if (scrollParents.includes(node2)) {
@@ -770,7 +770,7 @@ function getScrollableElement(element2) {
770
770
  if (isDocument(element2) || element2 === getOwnerDocument(element2).scrollingElement) {
771
771
  return window;
772
772
  }
773
- if (isHTMLElement(element2)) {
773
+ if (isHTMLElement$1(element2)) {
774
774
  return element2;
775
775
  }
776
776
  return null;
@@ -2015,7 +2015,7 @@ function useRect(element2, measure, fallbackRect) {
2015
2015
  const resizeObserver = useResizeObserver({
2016
2016
  callback: measureRect
2017
2017
  });
2018
- useIsomorphicLayoutEffect$1(() => {
2018
+ useIsomorphicLayoutEffect$2(() => {
2019
2019
  measureRect();
2020
2020
  if (element2) {
2021
2021
  resizeObserver == null ? void 0 : resizeObserver.observe(element2);
@@ -2189,7 +2189,7 @@ function useRects(elements, measure) {
2189
2189
  const resizeObserver = useResizeObserver({
2190
2190
  callback: measureRects
2191
2191
  });
2192
- useIsomorphicLayoutEffect$1(() => {
2192
+ useIsomorphicLayoutEffect$2(() => {
2193
2193
  resizeObserver == null ? void 0 : resizeObserver.disconnect();
2194
2194
  measureRects();
2195
2195
  elements.forEach((element2) => resizeObserver == null ? void 0 : resizeObserver.observe(element2));
@@ -2204,7 +2204,7 @@ function getMeasurableNode(node2) {
2204
2204
  return node2;
2205
2205
  }
2206
2206
  const firstChild = node2.children[0];
2207
- return isHTMLElement(firstChild) ? firstChild : node2;
2207
+ return isHTMLElement$1(firstChild) ? firstChild : node2;
2208
2208
  }
2209
2209
  function useDragOverlayMeasuring(_ref) {
2210
2210
  let {
@@ -2215,7 +2215,7 @@ function useDragOverlayMeasuring(_ref) {
2215
2215
  for (const {
2216
2216
  target
2217
2217
  } of entries) {
2218
- if (isHTMLElement(target)) {
2218
+ if (isHTMLElement$1(target)) {
2219
2219
  setRect((rect2) => {
2220
2220
  const newRect = measure(target);
2221
2221
  return rect2 ? {
@@ -2551,7 +2551,7 @@ function useLayoutShiftScrollCompensation(_ref) {
2551
2551
  x: config,
2552
2552
  y: config
2553
2553
  } : config;
2554
- useIsomorphicLayoutEffect$1(() => {
2554
+ useIsomorphicLayoutEffect$2(() => {
2555
2555
  const disabled = !x && !y;
2556
2556
  if (disabled || !activeNode) {
2557
2557
  initialized.current = false;
@@ -2641,7 +2641,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2641
2641
  const [activeSensor, setActiveSensor] = useState(null);
2642
2642
  const [activatorEvent, setActivatorEvent] = useState(null);
2643
2643
  const latestProps = useLatestValue(props, Object.values(props));
2644
- const draggableDescribedById = useUniqueId$1("DndDescribedBy", id);
2644
+ const draggableDescribedById = useUniqueId$2("DndDescribedBy", id);
2645
2645
  const enabledDroppableContainers = useMemo(() => droppableContainers.getEnabled(), [droppableContainers]);
2646
2646
  const measuringConfiguration = useMeasuringConfiguration(measuring);
2647
2647
  const {
@@ -2912,7 +2912,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2912
2912
  }, [draggableNodes, instantiateSensor]);
2913
2913
  const activators = useCombineActivators(sensors, bindActivatorToSensorInstantiator);
2914
2914
  useSensorSetup(sensors);
2915
- useIsomorphicLayoutEffect$1(() => {
2915
+ useIsomorphicLayoutEffect$2(() => {
2916
2916
  if (activeNodeRect && status === Status.Initializing) {
2917
2917
  setStatus(Status.Initialized);
2918
2918
  }
@@ -2996,7 +2996,7 @@ const DndContext = /* @__PURE__ */ memo(function DndContext2(_ref) {
2996
2996
  // eslint-disable-next-line react-hooks/exhaustive-deps
2997
2997
  [overId]
2998
2998
  );
2999
- useIsomorphicLayoutEffect$1(() => {
2999
+ useIsomorphicLayoutEffect$2(() => {
3000
3000
  sensorContext.current = {
3001
3001
  activatorEvent,
3002
3002
  active,
@@ -3102,7 +3102,7 @@ function useDraggable(_ref) {
3102
3102
  disabled = false,
3103
3103
  attributes
3104
3104
  } = _ref;
3105
- const key2 = useUniqueId$1(ID_PREFIX);
3105
+ const key2 = useUniqueId$2(ID_PREFIX);
3106
3106
  const {
3107
3107
  activators,
3108
3108
  activatorEvent,
@@ -3123,7 +3123,7 @@ function useDraggable(_ref) {
3123
3123
  const [activatorNode, setActivatorNodeRef] = useNodeRef();
3124
3124
  const listeners = useSyntheticListeners(activators, id);
3125
3125
  const dataRef = useLatestValue(data);
3126
- useIsomorphicLayoutEffect$1(
3126
+ useIsomorphicLayoutEffect$2(
3127
3127
  () => {
3128
3128
  draggableNodes.set(id, {
3129
3129
  id,
@@ -3178,7 +3178,7 @@ function useDroppable(_ref) {
3178
3178
  id,
3179
3179
  resizeObserverConfig
3180
3180
  } = _ref;
3181
- const key2 = useUniqueId$1(ID_PREFIX$1);
3181
+ const key2 = useUniqueId$2(ID_PREFIX$1);
3182
3182
  const {
3183
3183
  active,
3184
3184
  dispatch,
@@ -3296,7 +3296,7 @@ function AnimationManager(_ref) {
3296
3296
  if (!children2 && !clonedChildren && previousChildren) {
3297
3297
  setClonedChildren(previousChildren);
3298
3298
  }
3299
- useIsomorphicLayoutEffect$1(() => {
3299
+ useIsomorphicLayoutEffect$2(() => {
3300
3300
  if (!element2) {
3301
3301
  return;
3302
3302
  }
@@ -3740,7 +3740,7 @@ const createLucideIcon = (iconName, iconNode) => {
3740
3740
  * This source code is licensed under the ISC license.
3741
3741
  * See the LICENSE file in the root directory of this source tree.
3742
3742
  */
3743
- const __iconNode$j = [
3743
+ const __iconNode$k = [
3744
3744
  ["path", { d: "M12 8V4H8", key: "hb8ula" }],
3745
3745
  ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
3746
3746
  ["path", { d: "M2 14h2", key: "vft8re" }],
@@ -3748,75 +3748,75 @@ const __iconNode$j = [
3748
3748
  ["path", { d: "M15 13v2", key: "1xurst" }],
3749
3749
  ["path", { d: "M9 13v2", key: "rq6x2g" }]
3750
3750
  ];
3751
- const Bot = createLucideIcon("bot", __iconNode$j);
3751
+ const Bot = createLucideIcon("bot", __iconNode$k);
3752
3752
  /**
3753
3753
  * @license lucide-react v0.552.0 - ISC
3754
3754
  *
3755
3755
  * This source code is licensed under the ISC license.
3756
3756
  * See the LICENSE file in the root directory of this source tree.
3757
3757
  */
3758
- const __iconNode$i = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
3759
- const Check = createLucideIcon("check", __iconNode$i);
3758
+ const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
3759
+ const Check = createLucideIcon("check", __iconNode$j);
3760
3760
  /**
3761
3761
  * @license lucide-react v0.552.0 - ISC
3762
3762
  *
3763
3763
  * This source code is licensed under the ISC license.
3764
3764
  * See the LICENSE file in the root directory of this source tree.
3765
3765
  */
3766
- const __iconNode$h = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
3767
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$h);
3766
+ const __iconNode$i = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
3767
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$i);
3768
3768
  /**
3769
3769
  * @license lucide-react v0.552.0 - ISC
3770
3770
  *
3771
3771
  * This source code is licensed under the ISC license.
3772
3772
  * See the LICENSE file in the root directory of this source tree.
3773
3773
  */
3774
- const __iconNode$g = [
3774
+ const __iconNode$h = [
3775
3775
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3776
3776
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
3777
3777
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
3778
3778
  ];
3779
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
3779
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$h);
3780
3780
  /**
3781
3781
  * @license lucide-react v0.552.0 - ISC
3782
3782
  *
3783
3783
  * This source code is licensed under the ISC license.
3784
3784
  * See the LICENSE file in the root directory of this source tree.
3785
3785
  */
3786
- const __iconNode$f = [
3786
+ const __iconNode$g = [
3787
3787
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
3788
3788
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
3789
3789
  ];
3790
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$f);
3790
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$g);
3791
3791
  /**
3792
3792
  * @license lucide-react v0.552.0 - ISC
3793
3793
  *
3794
3794
  * This source code is licensed under the ISC license.
3795
3795
  * See the LICENSE file in the root directory of this source tree.
3796
3796
  */
3797
- const __iconNode$e = [
3797
+ const __iconNode$f = [
3798
3798
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
3799
3799
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
3800
3800
  ];
3801
- const CircleCheck = createLucideIcon("circle-check", __iconNode$e);
3801
+ const CircleCheck = createLucideIcon("circle-check", __iconNode$f);
3802
3802
  /**
3803
3803
  * @license lucide-react v0.552.0 - ISC
3804
3804
  *
3805
3805
  * This source code is licensed under the ISC license.
3806
3806
  * See the LICENSE file in the root directory of this source tree.
3807
3807
  */
3808
- const __iconNode$d = [
3808
+ const __iconNode$e = [
3809
3809
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
3810
3810
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
3811
3811
  ];
3812
- const Copy = createLucideIcon("copy", __iconNode$d);
3812
+ const Copy = createLucideIcon("copy", __iconNode$e);
3813
3813
  /**
3814
3814
  * @license lucide-react v0.552.0 - ISC
3815
3815
  *
3816
3816
  * This source code is licensed under the ISC license.
3817
3817
  * See the LICENSE file in the root directory of this source tree.
3818
3818
  */
3819
- const __iconNode$c = [
3819
+ const __iconNode$d = [
3820
3820
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
3821
3821
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
3822
3822
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -3826,191 +3826,2267 @@ const __iconNode$c = [
3826
3826
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
3827
3827
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
3828
3828
  ];
3829
- const Expand = createLucideIcon("expand", __iconNode$c);
3829
+ const Expand = createLucideIcon("expand", __iconNode$d);
3830
3830
  /**
3831
3831
  * @license lucide-react v0.552.0 - ISC
3832
3832
  *
3833
3833
  * This source code is licensed under the ISC license.
3834
3834
  * See the LICENSE file in the root directory of this source tree.
3835
3835
  */
3836
- const __iconNode$b = [
3836
+ const __iconNode$c = [
3837
3837
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
3838
3838
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
3839
3839
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
3840
3840
  ];
3841
- const ExternalLink = createLucideIcon("external-link", __iconNode$b);
3841
+ const ExternalLink = createLucideIcon("external-link", __iconNode$c);
3842
3842
  /**
3843
3843
  * @license lucide-react v0.552.0 - ISC
3844
3844
  *
3845
3845
  * This source code is licensed under the ISC license.
3846
3846
  * See the LICENSE file in the root directory of this source tree.
3847
3847
  */
3848
- const __iconNode$a = [
3848
+ const __iconNode$b = [
3849
3849
  [
3850
3850
  "path",
3851
3851
  {
3852
3852
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
3853
3853
  key: "1oefj6"
3854
3854
  }
3855
- ],
3856
- ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
3857
- ["path", { d: "M10 9H8", key: "b1mrlr" }],
3858
- ["path", { d: "M16 13H8", key: "t4e002" }],
3859
- ["path", { d: "M16 17H8", key: "z1uh3a" }]
3860
- ];
3861
- const FileText = createLucideIcon("file-text", __iconNode$a);
3862
- /**
3863
- * @license lucide-react v0.552.0 - ISC
3864
- *
3865
- * This source code is licensed under the ISC license.
3866
- * See the LICENSE file in the root directory of this source tree.
3867
- */
3868
- const __iconNode$9 = [
3869
- ["path", { d: "M12 10v6", key: "1bos4e" }],
3870
- ["path", { d: "M9 13h6", key: "1uhe8q" }],
3871
- [
3872
- "path",
3873
- {
3874
- d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
3875
- key: "1kt360"
3855
+ ],
3856
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
3857
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
3858
+ ["path", { d: "M16 13H8", key: "t4e002" }],
3859
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
3860
+ ];
3861
+ const FileText = createLucideIcon("file-text", __iconNode$b);
3862
+ /**
3863
+ * @license lucide-react v0.552.0 - ISC
3864
+ *
3865
+ * This source code is licensed under the ISC license.
3866
+ * See the LICENSE file in the root directory of this source tree.
3867
+ */
3868
+ const __iconNode$a = [
3869
+ ["path", { d: "M12 10v6", key: "1bos4e" }],
3870
+ ["path", { d: "M9 13h6", key: "1uhe8q" }],
3871
+ [
3872
+ "path",
3873
+ {
3874
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
3875
+ key: "1kt360"
3876
+ }
3877
+ ]
3878
+ ];
3879
+ const FolderPlus = createLucideIcon("folder-plus", __iconNode$a);
3880
+ /**
3881
+ * @license lucide-react v0.552.0 - ISC
3882
+ *
3883
+ * This source code is licensed under the ISC license.
3884
+ * See the LICENSE file in the root directory of this source tree.
3885
+ */
3886
+ const __iconNode$9 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
3887
+ const LoaderCircle = createLucideIcon("loader-circle", __iconNode$9);
3888
+ /**
3889
+ * @license lucide-react v0.552.0 - ISC
3890
+ *
3891
+ * This source code is licensed under the ISC license.
3892
+ * See the LICENSE file in the root directory of this source tree.
3893
+ */
3894
+ const __iconNode$8 = [
3895
+ ["path", { d: "M12 13v8", key: "1l5pq0" }],
3896
+ ["path", { d: "M12 3v3", key: "1n5kay" }],
3897
+ [
3898
+ "path",
3899
+ {
3900
+ d: "M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",
3901
+ key: "1btarq"
3902
+ }
3903
+ ]
3904
+ ];
3905
+ const Milestone = createLucideIcon("milestone", __iconNode$8);
3906
+ /**
3907
+ * @license lucide-react v0.552.0 - ISC
3908
+ *
3909
+ * This source code is licensed under the ISC license.
3910
+ * See the LICENSE file in the root directory of this source tree.
3911
+ */
3912
+ const __iconNode$7 = [
3913
+ ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
3914
+ ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
3915
+ ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
3916
+ ];
3917
+ const Monitor = createLucideIcon("monitor", __iconNode$7);
3918
+ /**
3919
+ * @license lucide-react v0.552.0 - ISC
3920
+ *
3921
+ * This source code is licensed under the ISC license.
3922
+ * See the LICENSE file in the root directory of this source tree.
3923
+ */
3924
+ const __iconNode$6 = [
3925
+ ["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
3926
+ ["path", { d: "M2 12H22", key: "1m8cig" }]
3927
+ ];
3928
+ const MoveRight = createLucideIcon("move-right", __iconNode$6);
3929
+ /**
3930
+ * @license lucide-react v0.552.0 - ISC
3931
+ *
3932
+ * This source code is licensed under the ISC license.
3933
+ * See the LICENSE file in the root directory of this source tree.
3934
+ */
3935
+ const __iconNode$5 = [
3936
+ [
3937
+ "path",
3938
+ {
3939
+ d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
3940
+ key: "10ikf1"
3941
+ }
3942
+ ]
3943
+ ];
3944
+ const Play = createLucideIcon("play", __iconNode$5);
3945
+ /**
3946
+ * @license lucide-react v0.552.0 - ISC
3947
+ *
3948
+ * This source code is licensed under the ISC license.
3949
+ * See the LICENSE file in the root directory of this source tree.
3950
+ */
3951
+ const __iconNode$4 = [
3952
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
3953
+ ["path", { d: "M12 5v14", key: "s699le" }]
3954
+ ];
3955
+ const Plus = createLucideIcon("plus", __iconNode$4);
3956
+ /**
3957
+ * @license lucide-react v0.552.0 - ISC
3958
+ *
3959
+ * This source code is licensed under the ISC license.
3960
+ * See the LICENSE file in the root directory of this source tree.
3961
+ */
3962
+ const __iconNode$3 = [
3963
+ ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
3964
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
3965
+ ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
3966
+ ["path", { d: "M8 16H3v5", key: "1cv678" }]
3967
+ ];
3968
+ const RefreshCw = createLucideIcon("refresh-cw", __iconNode$3);
3969
+ /**
3970
+ * @license lucide-react v0.552.0 - ISC
3971
+ *
3972
+ * This source code is licensed under the ISC license.
3973
+ * See the LICENSE file in the root directory of this source tree.
3974
+ */
3975
+ const __iconNode$2 = [
3976
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
3977
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
3978
+ ];
3979
+ const Search = createLucideIcon("search", __iconNode$2);
3980
+ /**
3981
+ * @license lucide-react v0.552.0 - ISC
3982
+ *
3983
+ * This source code is licensed under the ISC license.
3984
+ * See the LICENSE file in the root directory of this source tree.
3985
+ */
3986
+ const __iconNode$1 = [
3987
+ ["path", { d: "M10 11v6", key: "nco0om" }],
3988
+ ["path", { d: "M14 11v6", key: "outv1u" }],
3989
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
3990
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
3991
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
3992
+ ];
3993
+ const Trash2 = createLucideIcon("trash-2", __iconNode$1);
3994
+ /**
3995
+ * @license lucide-react v0.552.0 - ISC
3996
+ *
3997
+ * This source code is licensed under the ISC license.
3998
+ * See the LICENSE file in the root directory of this source tree.
3999
+ */
4000
+ const __iconNode = [
4001
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
4002
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
4003
+ ];
4004
+ const X = createLucideIcon("x", __iconNode);
4005
+ var ThemeContext$1;
4006
+ var getThemeContext$1 = () => {
4007
+ if (typeof window !== "undefined") {
4008
+ const globalWindow = window;
4009
+ if (!globalWindow.__principlemd_theme_context__) {
4010
+ globalWindow.__principlemd_theme_context__ = createContext(void 0);
4011
+ }
4012
+ return globalWindow.__principlemd_theme_context__;
4013
+ } else {
4014
+ if (!ThemeContext$1) {
4015
+ ThemeContext$1 = createContext(void 0);
4016
+ }
4017
+ return ThemeContext$1;
4018
+ }
4019
+ };
4020
+ var ThemeContextSingleton = getThemeContext$1();
4021
+ var useTheme = () => {
4022
+ const context = useContext(ThemeContextSingleton);
4023
+ if (!context) {
4024
+ throw new Error("useTheme must be used within a ThemeProvider");
4025
+ }
4026
+ return context;
4027
+ };
4028
+ const PanelGroupContext$1 = createContext(null);
4029
+ PanelGroupContext$1.displayName = "PanelGroupContext";
4030
+ const DATA_ATTRIBUTES$1 = {
4031
+ group: "data-panel-group",
4032
+ groupDirection: "data-panel-group-direction",
4033
+ groupId: "data-panel-group-id",
4034
+ panel: "data-panel",
4035
+ panelCollapsible: "data-panel-collapsible",
4036
+ panelId: "data-panel-id",
4037
+ panelSize: "data-panel-size",
4038
+ resizeHandleId: "data-panel-resize-handle-id"
4039
+ };
4040
+ const PRECISION$1 = 10;
4041
+ const useIsomorphicLayoutEffect$1 = useLayoutEffect;
4042
+ const useId$1 = React2["useId".toString()];
4043
+ const wrappedUseId$1 = typeof useId$1 === "function" ? useId$1 : () => null;
4044
+ let counter$1 = 0;
4045
+ function useUniqueId$1(idFromParams = null) {
4046
+ const idFromUseId = wrappedUseId$1();
4047
+ const idRef = useRef(idFromParams || idFromUseId || null);
4048
+ if (idRef.current === null) {
4049
+ idRef.current = "" + counter$1++;
4050
+ }
4051
+ return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
4052
+ }
4053
+ function PanelWithForwardedRef$1({
4054
+ children: children2,
4055
+ className: classNameFromProps = "",
4056
+ collapsedSize,
4057
+ collapsible,
4058
+ defaultSize,
4059
+ forwardedRef,
4060
+ id: idFromProps,
4061
+ maxSize,
4062
+ minSize,
4063
+ onCollapse,
4064
+ onExpand,
4065
+ onResize,
4066
+ order: order2,
4067
+ style: styleFromProps,
4068
+ tagName: Type = "div",
4069
+ ...rest
4070
+ }) {
4071
+ const context = useContext(PanelGroupContext$1);
4072
+ if (context === null) {
4073
+ throw Error(`Panel components must be rendered within a PanelGroup container`);
4074
+ }
4075
+ const {
4076
+ collapsePanel,
4077
+ expandPanel,
4078
+ getPanelSize,
4079
+ getPanelStyle,
4080
+ groupId,
4081
+ isPanelCollapsed,
4082
+ reevaluatePanelConstraints,
4083
+ registerPanel,
4084
+ resizePanel: resizePanel2,
4085
+ unregisterPanel
4086
+ } = context;
4087
+ const panelId = useUniqueId$1(idFromProps);
4088
+ const panelDataRef = useRef({
4089
+ callbacks: {
4090
+ onCollapse,
4091
+ onExpand,
4092
+ onResize
4093
+ },
4094
+ constraints: {
4095
+ collapsedSize,
4096
+ collapsible,
4097
+ defaultSize,
4098
+ maxSize,
4099
+ minSize
4100
+ },
4101
+ id: panelId,
4102
+ idIsFromProps: idFromProps !== void 0,
4103
+ order: order2
4104
+ });
4105
+ useRef({
4106
+ didLogMissingDefaultSizeWarning: false
4107
+ });
4108
+ useIsomorphicLayoutEffect$1(() => {
4109
+ const {
4110
+ callbacks,
4111
+ constraints
4112
+ } = panelDataRef.current;
4113
+ const prevConstraints = {
4114
+ ...constraints
4115
+ };
4116
+ panelDataRef.current.id = panelId;
4117
+ panelDataRef.current.idIsFromProps = idFromProps !== void 0;
4118
+ panelDataRef.current.order = order2;
4119
+ callbacks.onCollapse = onCollapse;
4120
+ callbacks.onExpand = onExpand;
4121
+ callbacks.onResize = onResize;
4122
+ constraints.collapsedSize = collapsedSize;
4123
+ constraints.collapsible = collapsible;
4124
+ constraints.defaultSize = defaultSize;
4125
+ constraints.maxSize = maxSize;
4126
+ constraints.minSize = minSize;
4127
+ if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) {
4128
+ reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
4129
+ }
4130
+ });
4131
+ useIsomorphicLayoutEffect$1(() => {
4132
+ const panelData = panelDataRef.current;
4133
+ registerPanel(panelData);
4134
+ return () => {
4135
+ unregisterPanel(panelData);
4136
+ };
4137
+ }, [order2, panelId, registerPanel, unregisterPanel]);
4138
+ useImperativeHandle(forwardedRef, () => ({
4139
+ collapse: () => {
4140
+ collapsePanel(panelDataRef.current);
4141
+ },
4142
+ expand: (minSize2) => {
4143
+ expandPanel(panelDataRef.current, minSize2);
4144
+ },
4145
+ getId() {
4146
+ return panelId;
4147
+ },
4148
+ getSize() {
4149
+ return getPanelSize(panelDataRef.current);
4150
+ },
4151
+ isCollapsed() {
4152
+ return isPanelCollapsed(panelDataRef.current);
4153
+ },
4154
+ isExpanded() {
4155
+ return !isPanelCollapsed(panelDataRef.current);
4156
+ },
4157
+ resize: (size) => {
4158
+ resizePanel2(panelDataRef.current, size);
4159
+ }
4160
+ }), [collapsePanel, expandPanel, getPanelSize, isPanelCollapsed, panelId, resizePanel2]);
4161
+ const style2 = getPanelStyle(panelDataRef.current, defaultSize);
4162
+ return createElement(Type, {
4163
+ ...rest,
4164
+ children: children2,
4165
+ className: classNameFromProps,
4166
+ id: panelId,
4167
+ style: {
4168
+ ...style2,
4169
+ ...styleFromProps
4170
+ },
4171
+ // CSS selectors
4172
+ [DATA_ATTRIBUTES$1.groupId]: groupId,
4173
+ [DATA_ATTRIBUTES$1.panel]: "",
4174
+ [DATA_ATTRIBUTES$1.panelCollapsible]: collapsible || void 0,
4175
+ [DATA_ATTRIBUTES$1.panelId]: panelId,
4176
+ [DATA_ATTRIBUTES$1.panelSize]: parseFloat("" + style2.flexGrow).toFixed(1)
4177
+ });
4178
+ }
4179
+ const Panel$1 = forwardRef((props, ref) => createElement(PanelWithForwardedRef$1, {
4180
+ ...props,
4181
+ forwardedRef: ref
4182
+ }));
4183
+ PanelWithForwardedRef$1.displayName = "Panel";
4184
+ Panel$1.displayName = "forwardRef(Panel)";
4185
+ function isKeyDown$1(event) {
4186
+ return event.type === "keydown";
4187
+ }
4188
+ function isPointerEvent$1(event) {
4189
+ return event.type.startsWith("pointer");
4190
+ }
4191
+ function isMouseEvent$1(event) {
4192
+ return event.type.startsWith("mouse");
4193
+ }
4194
+ function getResizeEventCoordinates$1(event) {
4195
+ if (isPointerEvent$1(event)) {
4196
+ if (event.isPrimary) {
4197
+ return {
4198
+ x: event.clientX,
4199
+ y: event.clientY
4200
+ };
4201
+ }
4202
+ } else if (isMouseEvent$1(event)) {
4203
+ return {
4204
+ x: event.clientX,
4205
+ y: event.clientY
4206
+ };
4207
+ }
4208
+ return {
4209
+ x: Infinity,
4210
+ y: Infinity
4211
+ };
4212
+ }
4213
+ function getInputType$1() {
4214
+ if (typeof matchMedia === "function") {
4215
+ return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
4216
+ }
4217
+ }
4218
+ const EXCEEDED_HORIZONTAL_MIN$1 = 1;
4219
+ const EXCEEDED_HORIZONTAL_MAX$1 = 2;
4220
+ const EXCEEDED_VERTICAL_MIN$1 = 4;
4221
+ const EXCEEDED_VERTICAL_MAX$1 = 8;
4222
+ getInputType$1() === "coarse";
4223
+ let panelConstraintFlags$1 = /* @__PURE__ */ new Map();
4224
+ function reportConstraintsViolation$1(resizeHandleId, flag) {
4225
+ panelConstraintFlags$1.set(resizeHandleId, flag);
4226
+ }
4227
+ function useForceUpdate$1() {
4228
+ const [_, setCount] = useState(0);
4229
+ return useCallback(() => setCount((prevCount) => prevCount + 1), []);
4230
+ }
4231
+ function assert$1(expectedCondition, message) {
4232
+ if (!expectedCondition) {
4233
+ console.error(message);
4234
+ throw Error(message);
4235
+ }
4236
+ }
4237
+ function fuzzyCompareNumbers$1(actual, expected, fractionDigits = PRECISION$1) {
4238
+ if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) {
4239
+ return 0;
4240
+ } else {
4241
+ return actual > expected ? 1 : -1;
4242
+ }
4243
+ }
4244
+ function fuzzyNumbersEqual$1$1(actual, expected, fractionDigits = PRECISION$1) {
4245
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
4246
+ }
4247
+ function fuzzyNumbersEqual$2(actual, expected, fractionDigits) {
4248
+ return fuzzyCompareNumbers$1(actual, expected, fractionDigits) === 0;
4249
+ }
4250
+ function fuzzyLayoutsEqual$1(actual, expected, fractionDigits) {
4251
+ if (actual.length !== expected.length) {
4252
+ return false;
4253
+ }
4254
+ for (let index2 = 0; index2 < actual.length; index2++) {
4255
+ const actualSize = actual[index2];
4256
+ const expectedSize = expected[index2];
4257
+ if (!fuzzyNumbersEqual$2(actualSize, expectedSize, fractionDigits)) {
4258
+ return false;
4259
+ }
4260
+ }
4261
+ return true;
4262
+ }
4263
+ function resizePanel$1({
4264
+ panelConstraints: panelConstraintsArray,
4265
+ panelIndex,
4266
+ size
4267
+ }) {
4268
+ const panelConstraints = panelConstraintsArray[panelIndex];
4269
+ assert$1(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
4270
+ let {
4271
+ collapsedSize = 0,
4272
+ collapsible,
4273
+ maxSize = 100,
4274
+ minSize = 0
4275
+ } = panelConstraints;
4276
+ if (fuzzyCompareNumbers$1(size, minSize) < 0) {
4277
+ if (collapsible) {
4278
+ const halfwayPoint = (collapsedSize + minSize) / 2;
4279
+ if (fuzzyCompareNumbers$1(size, halfwayPoint) < 0) {
4280
+ size = collapsedSize;
4281
+ } else {
4282
+ size = minSize;
4283
+ }
4284
+ } else {
4285
+ size = minSize;
4286
+ }
4287
+ }
4288
+ size = Math.min(maxSize, size);
4289
+ size = parseFloat(size.toFixed(PRECISION$1));
4290
+ return size;
4291
+ }
4292
+ function adjustLayoutByDelta$1({
4293
+ delta,
4294
+ initialLayout,
4295
+ panelConstraints: panelConstraintsArray,
4296
+ pivotIndices,
4297
+ prevLayout,
4298
+ trigger
4299
+ }) {
4300
+ if (fuzzyNumbersEqual$2(delta, 0)) {
4301
+ return initialLayout;
4302
+ }
4303
+ const nextLayout = [...initialLayout];
4304
+ const [firstPivotIndex, secondPivotIndex] = pivotIndices;
4305
+ assert$1(firstPivotIndex != null, "Invalid first pivot index");
4306
+ assert$1(secondPivotIndex != null, "Invalid second pivot index");
4307
+ let deltaApplied = 0;
4308
+ {
4309
+ if (trigger === "keyboard") {
4310
+ {
4311
+ const index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4312
+ const panelConstraints = panelConstraintsArray[index2];
4313
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4314
+ const {
4315
+ collapsedSize = 0,
4316
+ collapsible,
4317
+ minSize = 0
4318
+ } = panelConstraints;
4319
+ if (collapsible) {
4320
+ const prevSize = initialLayout[index2];
4321
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4322
+ if (fuzzyNumbersEqual$2(prevSize, collapsedSize)) {
4323
+ const localDelta = minSize - prevSize;
4324
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
4325
+ delta = delta < 0 ? 0 - localDelta : localDelta;
4326
+ }
4327
+ }
4328
+ }
4329
+ }
4330
+ {
4331
+ const index2 = delta < 0 ? firstPivotIndex : secondPivotIndex;
4332
+ const panelConstraints = panelConstraintsArray[index2];
4333
+ assert$1(panelConstraints, `No panel constraints found for index ${index2}`);
4334
+ const {
4335
+ collapsedSize = 0,
4336
+ collapsible,
4337
+ minSize = 0
4338
+ } = panelConstraints;
4339
+ if (collapsible) {
4340
+ const prevSize = initialLayout[index2];
4341
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4342
+ if (fuzzyNumbersEqual$2(prevSize, minSize)) {
4343
+ const localDelta = prevSize - collapsedSize;
4344
+ if (fuzzyCompareNumbers$1(localDelta, Math.abs(delta)) > 0) {
4345
+ delta = delta < 0 ? 0 - localDelta : localDelta;
4346
+ }
4347
+ }
4348
+ }
4349
+ }
4350
+ }
4351
+ }
4352
+ {
4353
+ const increment2 = delta < 0 ? 1 : -1;
4354
+ let index2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4355
+ let maxAvailableDelta = 0;
4356
+ while (true) {
4357
+ const prevSize = initialLayout[index2];
4358
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4359
+ const maxSafeSize = resizePanel$1({
4360
+ panelConstraints: panelConstraintsArray,
4361
+ panelIndex: index2,
4362
+ size: 100
4363
+ });
4364
+ const delta2 = maxSafeSize - prevSize;
4365
+ maxAvailableDelta += delta2;
4366
+ index2 += increment2;
4367
+ if (index2 < 0 || index2 >= panelConstraintsArray.length) {
4368
+ break;
4369
+ }
4370
+ }
4371
+ const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
4372
+ delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
4373
+ }
4374
+ {
4375
+ const pivotIndex = delta < 0 ? firstPivotIndex : secondPivotIndex;
4376
+ let index2 = pivotIndex;
4377
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
4378
+ const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
4379
+ const prevSize = initialLayout[index2];
4380
+ assert$1(prevSize != null, `Previous layout not found for panel index ${index2}`);
4381
+ const unsafeSize = prevSize - deltaRemaining;
4382
+ const safeSize = resizePanel$1({
4383
+ panelConstraints: panelConstraintsArray,
4384
+ panelIndex: index2,
4385
+ size: unsafeSize
4386
+ });
4387
+ if (!fuzzyNumbersEqual$2(prevSize, safeSize)) {
4388
+ deltaApplied += prevSize - safeSize;
4389
+ nextLayout[index2] = safeSize;
4390
+ if (deltaApplied.toFixed(3).localeCompare(Math.abs(delta).toFixed(3), void 0, {
4391
+ numeric: true
4392
+ }) >= 0) {
4393
+ break;
4394
+ }
4395
+ }
4396
+ if (delta < 0) {
4397
+ index2--;
4398
+ } else {
4399
+ index2++;
4400
+ }
4401
+ }
4402
+ }
4403
+ if (fuzzyLayoutsEqual$1(prevLayout, nextLayout)) {
4404
+ return prevLayout;
4405
+ }
4406
+ {
4407
+ const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
4408
+ const prevSize = initialLayout[pivotIndex];
4409
+ assert$1(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
4410
+ const unsafeSize = prevSize + deltaApplied;
4411
+ const safeSize = resizePanel$1({
4412
+ panelConstraints: panelConstraintsArray,
4413
+ panelIndex: pivotIndex,
4414
+ size: unsafeSize
4415
+ });
4416
+ nextLayout[pivotIndex] = safeSize;
4417
+ if (!fuzzyNumbersEqual$2(safeSize, unsafeSize)) {
4418
+ let deltaRemaining = unsafeSize - safeSize;
4419
+ const pivotIndex2 = delta < 0 ? secondPivotIndex : firstPivotIndex;
4420
+ let index2 = pivotIndex2;
4421
+ while (index2 >= 0 && index2 < panelConstraintsArray.length) {
4422
+ const prevSize2 = nextLayout[index2];
4423
+ assert$1(prevSize2 != null, `Previous layout not found for panel index ${index2}`);
4424
+ const unsafeSize2 = prevSize2 + deltaRemaining;
4425
+ const safeSize2 = resizePanel$1({
4426
+ panelConstraints: panelConstraintsArray,
4427
+ panelIndex: index2,
4428
+ size: unsafeSize2
4429
+ });
4430
+ if (!fuzzyNumbersEqual$2(prevSize2, safeSize2)) {
4431
+ deltaRemaining -= safeSize2 - prevSize2;
4432
+ nextLayout[index2] = safeSize2;
4433
+ }
4434
+ if (fuzzyNumbersEqual$2(deltaRemaining, 0)) {
4435
+ break;
4436
+ }
4437
+ if (delta > 0) {
4438
+ index2--;
4439
+ } else {
4440
+ index2++;
4441
+ }
4442
+ }
4443
+ }
4444
+ }
4445
+ const totalSize = nextLayout.reduce((total, size) => size + total, 0);
4446
+ if (!fuzzyNumbersEqual$2(totalSize, 100)) {
4447
+ return prevLayout;
4448
+ }
4449
+ return nextLayout;
4450
+ }
4451
+ function calculateAriaValues$1({
4452
+ layout,
4453
+ panelsArray,
4454
+ pivotIndices
4455
+ }) {
4456
+ let currentMinSize = 0;
4457
+ let currentMaxSize = 100;
4458
+ let totalMinSize = 0;
4459
+ let totalMaxSize = 0;
4460
+ const firstIndex = pivotIndices[0];
4461
+ assert$1(firstIndex != null, "No pivot index found");
4462
+ panelsArray.forEach((panelData, index2) => {
4463
+ const {
4464
+ constraints
4465
+ } = panelData;
4466
+ const {
4467
+ maxSize = 100,
4468
+ minSize = 0
4469
+ } = constraints;
4470
+ if (index2 === firstIndex) {
4471
+ currentMinSize = minSize;
4472
+ currentMaxSize = maxSize;
4473
+ } else {
4474
+ totalMinSize += minSize;
4475
+ totalMaxSize += maxSize;
4476
+ }
4477
+ });
4478
+ const valueMax = Math.min(currentMaxSize, 100 - totalMinSize);
4479
+ const valueMin = Math.max(currentMinSize, 100 - totalMaxSize);
4480
+ const valueNow = layout[firstIndex];
4481
+ return {
4482
+ valueMax,
4483
+ valueMin,
4484
+ valueNow
4485
+ };
4486
+ }
4487
+ function getResizeHandleElementsForGroup$1(groupId, scope = document) {
4488
+ return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES$1.resizeHandleId}][data-panel-group-id="${groupId}"]`));
4489
+ }
4490
+ function getResizeHandleElementIndex$1(groupId, id, scope = document) {
4491
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
4492
+ const index2 = handles.findIndex((handle2) => handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId) === id);
4493
+ return index2 !== null && index2 !== void 0 ? index2 : null;
4494
+ }
4495
+ function determinePivotIndices$1(groupId, dragHandleId, panelGroupElement) {
4496
+ const index2 = getResizeHandleElementIndex$1(groupId, dragHandleId, panelGroupElement);
4497
+ return index2 != null ? [index2, index2 + 1] : [-1, -1];
4498
+ }
4499
+ function isHTMLElement(target) {
4500
+ if (target instanceof HTMLElement) {
4501
+ return true;
4502
+ }
4503
+ return typeof target === "object" && target !== null && "tagName" in target && "getAttribute" in target;
4504
+ }
4505
+ function getPanelGroupElement$1(id, rootElement = document) {
4506
+ if (isHTMLElement(rootElement) && rootElement.dataset.panelGroupId == id) {
4507
+ return rootElement;
4508
+ }
4509
+ const element2 = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
4510
+ if (element2) {
4511
+ return element2;
4512
+ }
4513
+ return null;
4514
+ }
4515
+ function getResizeHandleElement$1(id, scope = document) {
4516
+ const element2 = scope.querySelector(`[${DATA_ATTRIBUTES$1.resizeHandleId}="${id}"]`);
4517
+ if (element2) {
4518
+ return element2;
4519
+ }
4520
+ return null;
4521
+ }
4522
+ function getResizeHandlePanelIds$1(groupId, handleId, panelsArray, scope = document) {
4523
+ var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
4524
+ const handle2 = getResizeHandleElement$1(handleId, scope);
4525
+ const handles = getResizeHandleElementsForGroup$1(groupId, scope);
4526
+ const index2 = handle2 ? handles.indexOf(handle2) : -1;
4527
+ const idBefore = (_panelsArray$index$id = (_panelsArray$index = panelsArray[index2]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null;
4528
+ const idAfter = (_panelsArray$id = (_panelsArray = panelsArray[index2 + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null;
4529
+ return [idBefore, idAfter];
4530
+ }
4531
+ function useWindowSplitterPanelGroupBehavior$1({
4532
+ committedValuesRef,
4533
+ eagerValuesRef,
4534
+ groupId,
4535
+ layout,
4536
+ panelDataArray,
4537
+ panelGroupElement,
4538
+ setLayout
4539
+ }) {
4540
+ useRef({
4541
+ didWarnAboutMissingResizeHandle: false
4542
+ });
4543
+ useIsomorphicLayoutEffect$1(() => {
4544
+ if (!panelGroupElement) {
4545
+ return;
4546
+ }
4547
+ const resizeHandleElements = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
4548
+ for (let index2 = 0; index2 < panelDataArray.length - 1; index2++) {
4549
+ const {
4550
+ valueMax,
4551
+ valueMin,
4552
+ valueNow
4553
+ } = calculateAriaValues$1({
4554
+ layout,
4555
+ panelsArray: panelDataArray,
4556
+ pivotIndices: [index2, index2 + 1]
4557
+ });
4558
+ const resizeHandleElement = resizeHandleElements[index2];
4559
+ if (resizeHandleElement == null) ;
4560
+ else {
4561
+ const panelData = panelDataArray[index2];
4562
+ assert$1(panelData, `No panel data found for index "${index2}"`);
4563
+ resizeHandleElement.setAttribute("aria-controls", panelData.id);
4564
+ resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
4565
+ resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
4566
+ resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
4567
+ }
4568
+ }
4569
+ return () => {
4570
+ resizeHandleElements.forEach((resizeHandleElement, index2) => {
4571
+ resizeHandleElement.removeAttribute("aria-controls");
4572
+ resizeHandleElement.removeAttribute("aria-valuemax");
4573
+ resizeHandleElement.removeAttribute("aria-valuemin");
4574
+ resizeHandleElement.removeAttribute("aria-valuenow");
4575
+ });
4576
+ };
4577
+ }, [groupId, layout, panelDataArray, panelGroupElement]);
4578
+ useEffect(() => {
4579
+ if (!panelGroupElement) {
4580
+ return;
4581
+ }
4582
+ const eagerValues = eagerValuesRef.current;
4583
+ assert$1(eagerValues, `Eager values not found`);
4584
+ const {
4585
+ panelDataArray: panelDataArray2
4586
+ } = eagerValues;
4587
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
4588
+ assert$1(groupElement != null, `No group found for id "${groupId}"`);
4589
+ const handles = getResizeHandleElementsForGroup$1(groupId, panelGroupElement);
4590
+ assert$1(handles, `No resize handles found for group id "${groupId}"`);
4591
+ const cleanupFunctions = handles.map((handle2) => {
4592
+ const handleId = handle2.getAttribute(DATA_ATTRIBUTES$1.resizeHandleId);
4593
+ assert$1(handleId, `Resize handle element has no handle id attribute`);
4594
+ const [idBefore, idAfter] = getResizeHandlePanelIds$1(groupId, handleId, panelDataArray2, panelGroupElement);
4595
+ if (idBefore == null || idAfter == null) {
4596
+ return () => {
4597
+ };
4598
+ }
4599
+ const onKeyDown = (event) => {
4600
+ if (event.defaultPrevented) {
4601
+ return;
4602
+ }
4603
+ switch (event.key) {
4604
+ case "Enter": {
4605
+ event.preventDefault();
4606
+ const index2 = panelDataArray2.findIndex((panelData) => panelData.id === idBefore);
4607
+ if (index2 >= 0) {
4608
+ const panelData = panelDataArray2[index2];
4609
+ assert$1(panelData, `No panel data found for index ${index2}`);
4610
+ const size = layout[index2];
4611
+ const {
4612
+ collapsedSize = 0,
4613
+ collapsible,
4614
+ minSize = 0
4615
+ } = panelData.constraints;
4616
+ if (size != null && collapsible) {
4617
+ const nextLayout = adjustLayoutByDelta$1({
4618
+ delta: fuzzyNumbersEqual$2(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
4619
+ initialLayout: layout,
4620
+ panelConstraints: panelDataArray2.map((panelData2) => panelData2.constraints),
4621
+ pivotIndices: determinePivotIndices$1(groupId, handleId, panelGroupElement),
4622
+ prevLayout: layout,
4623
+ trigger: "keyboard"
4624
+ });
4625
+ if (layout !== nextLayout) {
4626
+ setLayout(nextLayout);
4627
+ }
4628
+ }
4629
+ }
4630
+ break;
4631
+ }
4632
+ }
4633
+ };
4634
+ handle2.addEventListener("keydown", onKeyDown);
4635
+ return () => {
4636
+ handle2.removeEventListener("keydown", onKeyDown);
4637
+ };
4638
+ });
4639
+ return () => {
4640
+ cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
4641
+ };
4642
+ }, [panelGroupElement, committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, setLayout]);
4643
+ }
4644
+ function areEqual$1(arrayA, arrayB) {
4645
+ if (arrayA.length !== arrayB.length) {
4646
+ return false;
4647
+ }
4648
+ for (let index2 = 0; index2 < arrayA.length; index2++) {
4649
+ if (arrayA[index2] !== arrayB[index2]) {
4650
+ return false;
4651
+ }
4652
+ }
4653
+ return true;
4654
+ }
4655
+ function getResizeEventCursorPosition$1(direction, event) {
4656
+ const isHorizontal = direction === "horizontal";
4657
+ const {
4658
+ x,
4659
+ y
4660
+ } = getResizeEventCoordinates$1(event);
4661
+ return isHorizontal ? x : y;
4662
+ }
4663
+ function calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement) {
4664
+ const isHorizontal = direction === "horizontal";
4665
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElement);
4666
+ assert$1(handleElement, `No resize handle element found for id "${dragHandleId}"`);
4667
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES$1.groupId);
4668
+ assert$1(groupId, `Resize handle element has no group id attribute`);
4669
+ let {
4670
+ initialCursorPosition
4671
+ } = initialDragState;
4672
+ const cursorPosition = getResizeEventCursorPosition$1(direction, event);
4673
+ const groupElement = getPanelGroupElement$1(groupId, panelGroupElement);
4674
+ assert$1(groupElement, `No group element found for id "${groupId}"`);
4675
+ const groupRect = groupElement.getBoundingClientRect();
4676
+ const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
4677
+ const offsetPixels = cursorPosition - initialCursorPosition;
4678
+ const offsetPercentage = offsetPixels / groupSizeInPixels * 100;
4679
+ return offsetPercentage;
4680
+ }
4681
+ function calculateDeltaPercentage$1(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
4682
+ if (isKeyDown$1(event)) {
4683
+ const isHorizontal = direction === "horizontal";
4684
+ let delta = 0;
4685
+ if (event.shiftKey) {
4686
+ delta = 100;
4687
+ } else if (keyboardResizeBy != null) {
4688
+ delta = keyboardResizeBy;
4689
+ } else {
4690
+ delta = 10;
4691
+ }
4692
+ let movement = 0;
4693
+ switch (event.key) {
4694
+ case "ArrowDown":
4695
+ movement = isHorizontal ? 0 : delta;
4696
+ break;
4697
+ case "ArrowLeft":
4698
+ movement = isHorizontal ? -delta : 0;
4699
+ break;
4700
+ case "ArrowRight":
4701
+ movement = isHorizontal ? delta : 0;
4702
+ break;
4703
+ case "ArrowUp":
4704
+ movement = isHorizontal ? 0 : -delta;
4705
+ break;
4706
+ case "End":
4707
+ movement = 100;
4708
+ break;
4709
+ case "Home":
4710
+ movement = -100;
4711
+ break;
4712
+ }
4713
+ return movement;
4714
+ } else {
4715
+ if (initialDragState == null) {
4716
+ return 0;
4717
+ }
4718
+ return calculateDragOffsetPercentage$1(event, dragHandleId, direction, initialDragState, panelGroupElement);
4719
+ }
4720
+ }
4721
+ function calculateUnsafeDefaultLayout$1({
4722
+ panelDataArray
4723
+ }) {
4724
+ const layout = Array(panelDataArray.length);
4725
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
4726
+ let numPanelsWithSizes = 0;
4727
+ let remainingSize = 100;
4728
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
4729
+ const panelConstraints = panelConstraintsArray[index2];
4730
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4731
+ const {
4732
+ defaultSize
4733
+ } = panelConstraints;
4734
+ if (defaultSize != null) {
4735
+ numPanelsWithSizes++;
4736
+ layout[index2] = defaultSize;
4737
+ remainingSize -= defaultSize;
4738
+ }
4739
+ }
4740
+ for (let index2 = 0; index2 < panelDataArray.length; index2++) {
4741
+ const panelConstraints = panelConstraintsArray[index2];
4742
+ assert$1(panelConstraints, `Panel constraints not found for index ${index2}`);
4743
+ const {
4744
+ defaultSize
4745
+ } = panelConstraints;
4746
+ if (defaultSize != null) {
4747
+ continue;
4748
+ }
4749
+ const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
4750
+ const size = remainingSize / numRemainingPanels;
4751
+ numPanelsWithSizes++;
4752
+ layout[index2] = size;
4753
+ remainingSize -= size;
4754
+ }
4755
+ return layout;
4756
+ }
4757
+ function callPanelCallbacks$1(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
4758
+ layout.forEach((size, index2) => {
4759
+ const panelData = panelsArray[index2];
4760
+ assert$1(panelData, `Panel data not found for index ${index2}`);
4761
+ const {
4762
+ callbacks,
4763
+ constraints,
4764
+ id: panelId
4765
+ } = panelData;
4766
+ const {
4767
+ collapsedSize = 0,
4768
+ collapsible
4769
+ } = constraints;
4770
+ const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
4771
+ if (lastNotifiedSize == null || size !== lastNotifiedSize) {
4772
+ panelIdToLastNotifiedSizeMap[panelId] = size;
4773
+ const {
4774
+ onCollapse,
4775
+ onExpand,
4776
+ onResize
4777
+ } = callbacks;
4778
+ if (onResize) {
4779
+ onResize(size, lastNotifiedSize);
4780
+ }
4781
+ if (collapsible && (onCollapse || onExpand)) {
4782
+ if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1$1(size, collapsedSize)) {
4783
+ onExpand();
4784
+ }
4785
+ if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1$1(size, collapsedSize)) {
4786
+ onCollapse();
4787
+ }
4788
+ }
4789
+ }
4790
+ });
4791
+ }
4792
+ function compareLayouts$1(a, b) {
4793
+ if (a.length !== b.length) {
4794
+ return false;
4795
+ } else {
4796
+ for (let index2 = 0; index2 < a.length; index2++) {
4797
+ if (a[index2] != b[index2]) {
4798
+ return false;
4799
+ }
4800
+ }
4801
+ }
4802
+ return true;
4803
+ }
4804
+ function computePanelFlexBoxStyle$1({
4805
+ defaultSize,
4806
+ dragState,
4807
+ layout,
4808
+ panelData,
4809
+ panelIndex,
4810
+ precision = 3
4811
+ }) {
4812
+ const size = layout[panelIndex];
4813
+ let flexGrow;
4814
+ if (size == null) {
4815
+ flexGrow = defaultSize != void 0 ? defaultSize.toFixed(precision) : "1";
4816
+ } else if (panelData.length === 1) {
4817
+ flexGrow = "1";
4818
+ } else {
4819
+ flexGrow = size.toFixed(precision);
4820
+ }
4821
+ return {
4822
+ flexBasis: 0,
4823
+ flexGrow,
4824
+ flexShrink: 1,
4825
+ // Without this, Panel sizes may be unintentionally overridden by their content
4826
+ overflow: "hidden",
4827
+ // Disable pointer events inside of a panel during resize
4828
+ // This avoid edge cases like nested iframes
4829
+ pointerEvents: dragState !== null ? "none" : void 0
4830
+ };
4831
+ }
4832
+ function debounce$1(callback, durationMs = 10) {
4833
+ let timeoutId = null;
4834
+ let callable = (...args) => {
4835
+ if (timeoutId !== null) {
4836
+ clearTimeout(timeoutId);
4837
+ }
4838
+ timeoutId = setTimeout(() => {
4839
+ callback(...args);
4840
+ }, durationMs);
4841
+ };
4842
+ return callable;
4843
+ }
4844
+ function initializeDefaultStorage$1(storageObject) {
4845
+ try {
4846
+ if (typeof localStorage !== "undefined") {
4847
+ storageObject.getItem = (name2) => {
4848
+ return localStorage.getItem(name2);
4849
+ };
4850
+ storageObject.setItem = (name2, value) => {
4851
+ localStorage.setItem(name2, value);
4852
+ };
4853
+ } else {
4854
+ throw new Error("localStorage not supported in this environment");
4855
+ }
4856
+ } catch (error) {
4857
+ console.error(error);
4858
+ storageObject.getItem = () => null;
4859
+ storageObject.setItem = () => {
4860
+ };
4861
+ }
4862
+ }
4863
+ function getPanelGroupKey$1(autoSaveId) {
4864
+ return `react-resizable-panels:${autoSaveId}`;
4865
+ }
4866
+ function getPanelKey$1(panels2) {
4867
+ return panels2.map((panel) => {
4868
+ const {
4869
+ constraints,
4870
+ id,
4871
+ idIsFromProps,
4872
+ order: order2
4873
+ } = panel;
4874
+ if (idIsFromProps) {
4875
+ return id;
4876
+ } else {
4877
+ return order2 ? `${order2}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
4878
+ }
4879
+ }).sort((a, b) => a.localeCompare(b)).join(",");
4880
+ }
4881
+ function loadSerializedPanelGroupState$1(autoSaveId, storage) {
4882
+ try {
4883
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
4884
+ const serialized = storage.getItem(panelGroupKey);
4885
+ if (serialized) {
4886
+ const parsed = JSON.parse(serialized);
4887
+ if (typeof parsed === "object" && parsed != null) {
4888
+ return parsed;
4889
+ }
4890
+ }
4891
+ } catch (error) {
4892
+ }
4893
+ return null;
4894
+ }
4895
+ function loadPanelGroupState$1(autoSaveId, panels2, storage) {
4896
+ var _loadSerializedPanelG, _state$panelKey;
4897
+ const state = (_loadSerializedPanelG = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {};
4898
+ const panelKey = getPanelKey$1(panels2);
4899
+ return (_state$panelKey = state[panelKey]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
4900
+ }
4901
+ function savePanelGroupState$1(autoSaveId, panels2, panelSizesBeforeCollapse, sizes, storage) {
4902
+ var _loadSerializedPanelG2;
4903
+ const panelGroupKey = getPanelGroupKey$1(autoSaveId);
4904
+ const panelKey = getPanelKey$1(panels2);
4905
+ const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState$1(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
4906
+ state[panelKey] = {
4907
+ expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
4908
+ layout: sizes
4909
+ };
4910
+ try {
4911
+ storage.setItem(panelGroupKey, JSON.stringify(state));
4912
+ } catch (error) {
4913
+ console.error(error);
4914
+ }
4915
+ }
4916
+ function validatePanelGroupLayout$1({
4917
+ layout: prevLayout,
4918
+ panelConstraints
4919
+ }) {
4920
+ const nextLayout = [...prevLayout];
4921
+ const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
4922
+ if (nextLayout.length !== panelConstraints.length) {
4923
+ throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
4924
+ } else if (!fuzzyNumbersEqual$2(nextLayoutTotalSize, 100) && nextLayout.length > 0) {
4925
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4926
+ const unsafeSize = nextLayout[index2];
4927
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
4928
+ const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
4929
+ nextLayout[index2] = safeSize;
4930
+ }
4931
+ }
4932
+ let remainingSize = 0;
4933
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4934
+ const unsafeSize = nextLayout[index2];
4935
+ assert$1(unsafeSize != null, `No layout data found for index ${index2}`);
4936
+ const safeSize = resizePanel$1({
4937
+ panelConstraints,
4938
+ panelIndex: index2,
4939
+ size: unsafeSize
4940
+ });
4941
+ if (unsafeSize != safeSize) {
4942
+ remainingSize += unsafeSize - safeSize;
4943
+ nextLayout[index2] = safeSize;
4944
+ }
4945
+ }
4946
+ if (!fuzzyNumbersEqual$2(remainingSize, 0)) {
4947
+ for (let index2 = 0; index2 < panelConstraints.length; index2++) {
4948
+ const prevSize = nextLayout[index2];
4949
+ assert$1(prevSize != null, `No layout data found for index ${index2}`);
4950
+ const unsafeSize = prevSize + remainingSize;
4951
+ const safeSize = resizePanel$1({
4952
+ panelConstraints,
4953
+ panelIndex: index2,
4954
+ size: unsafeSize
4955
+ });
4956
+ if (prevSize !== safeSize) {
4957
+ remainingSize -= safeSize - prevSize;
4958
+ nextLayout[index2] = safeSize;
4959
+ if (fuzzyNumbersEqual$2(remainingSize, 0)) {
4960
+ break;
4961
+ }
4962
+ }
4963
+ }
4964
+ }
4965
+ return nextLayout;
4966
+ }
4967
+ const LOCAL_STORAGE_DEBOUNCE_INTERVAL$1 = 100;
4968
+ const defaultStorage$1 = {
4969
+ getItem: (name2) => {
4970
+ initializeDefaultStorage$1(defaultStorage$1);
4971
+ return defaultStorage$1.getItem(name2);
4972
+ },
4973
+ setItem: (name2, value) => {
4974
+ initializeDefaultStorage$1(defaultStorage$1);
4975
+ defaultStorage$1.setItem(name2, value);
4976
+ }
4977
+ };
4978
+ const debounceMap$1 = {};
4979
+ function PanelGroupWithForwardedRef$1({
4980
+ autoSaveId = null,
4981
+ children: children2,
4982
+ className: classNameFromProps = "",
4983
+ direction,
4984
+ forwardedRef,
4985
+ id: idFromProps = null,
4986
+ onLayout = null,
4987
+ keyboardResizeBy = null,
4988
+ storage = defaultStorage$1,
4989
+ style: styleFromProps,
4990
+ tagName: Type = "div",
4991
+ ...rest
4992
+ }) {
4993
+ const groupId = useUniqueId$1(idFromProps);
4994
+ const panelGroupElementRef = useRef(null);
4995
+ const [dragState, setDragState] = useState(null);
4996
+ const [layout, setLayout] = useState([]);
4997
+ const forceUpdate = useForceUpdate$1();
4998
+ const panelIdToLastNotifiedSizeMapRef = useRef({});
4999
+ const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
5000
+ const prevDeltaRef = useRef(0);
5001
+ const committedValuesRef = useRef({
5002
+ autoSaveId,
5003
+ direction,
5004
+ dragState,
5005
+ id: groupId,
5006
+ keyboardResizeBy,
5007
+ onLayout,
5008
+ storage
5009
+ });
5010
+ const eagerValuesRef = useRef({
5011
+ layout,
5012
+ panelDataArray: [],
5013
+ panelDataArrayChanged: false
5014
+ });
5015
+ useRef({
5016
+ didLogIdAndOrderWarning: false,
5017
+ didLogPanelConstraintsWarning: false,
5018
+ prevPanelIds: []
5019
+ });
5020
+ useImperativeHandle(forwardedRef, () => ({
5021
+ getId: () => committedValuesRef.current.id,
5022
+ getLayout: () => {
5023
+ const {
5024
+ layout: layout2
5025
+ } = eagerValuesRef.current;
5026
+ return layout2;
5027
+ },
5028
+ setLayout: (unsafeLayout) => {
5029
+ const {
5030
+ onLayout: onLayout2
5031
+ } = committedValuesRef.current;
5032
+ const {
5033
+ layout: prevLayout,
5034
+ panelDataArray
5035
+ } = eagerValuesRef.current;
5036
+ const safeLayout = validatePanelGroupLayout$1({
5037
+ layout: unsafeLayout,
5038
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
5039
+ });
5040
+ if (!areEqual$1(prevLayout, safeLayout)) {
5041
+ setLayout(safeLayout);
5042
+ eagerValuesRef.current.layout = safeLayout;
5043
+ if (onLayout2) {
5044
+ onLayout2(safeLayout);
5045
+ }
5046
+ callPanelCallbacks$1(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
5047
+ }
5048
+ }
5049
+ }), []);
5050
+ useIsomorphicLayoutEffect$1(() => {
5051
+ committedValuesRef.current.autoSaveId = autoSaveId;
5052
+ committedValuesRef.current.direction = direction;
5053
+ committedValuesRef.current.dragState = dragState;
5054
+ committedValuesRef.current.id = groupId;
5055
+ committedValuesRef.current.onLayout = onLayout;
5056
+ committedValuesRef.current.storage = storage;
5057
+ });
5058
+ useWindowSplitterPanelGroupBehavior$1({
5059
+ committedValuesRef,
5060
+ eagerValuesRef,
5061
+ groupId,
5062
+ layout,
5063
+ panelDataArray: eagerValuesRef.current.panelDataArray,
5064
+ setLayout,
5065
+ panelGroupElement: panelGroupElementRef.current
5066
+ });
5067
+ useEffect(() => {
5068
+ const {
5069
+ panelDataArray
5070
+ } = eagerValuesRef.current;
5071
+ if (autoSaveId) {
5072
+ if (layout.length === 0 || layout.length !== panelDataArray.length) {
5073
+ return;
5074
+ }
5075
+ let debouncedSave = debounceMap$1[autoSaveId];
5076
+ if (debouncedSave == null) {
5077
+ debouncedSave = debounce$1(savePanelGroupState$1, LOCAL_STORAGE_DEBOUNCE_INTERVAL$1);
5078
+ debounceMap$1[autoSaveId] = debouncedSave;
5079
+ }
5080
+ const clonedPanelDataArray = [...panelDataArray];
5081
+ const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
5082
+ debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
5083
+ }
5084
+ }, [autoSaveId, layout, storage]);
5085
+ useEffect(() => {
5086
+ });
5087
+ const collapsePanel = useCallback((panelData) => {
5088
+ const {
5089
+ onLayout: onLayout2
5090
+ } = committedValuesRef.current;
5091
+ const {
5092
+ layout: prevLayout,
5093
+ panelDataArray
5094
+ } = eagerValuesRef.current;
5095
+ if (panelData.constraints.collapsible) {
5096
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5097
+ const {
5098
+ collapsedSize = 0,
5099
+ panelSize,
5100
+ pivotIndices
5101
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5102
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5103
+ if (!fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
5104
+ panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
5105
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5106
+ const delta = isLastPanel ? panelSize - collapsedSize : collapsedSize - panelSize;
5107
+ const nextLayout = adjustLayoutByDelta$1({
5108
+ delta,
5109
+ initialLayout: prevLayout,
5110
+ panelConstraints: panelConstraintsArray,
5111
+ pivotIndices,
5112
+ prevLayout,
5113
+ trigger: "imperative-api"
5114
+ });
5115
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5116
+ setLayout(nextLayout);
5117
+ eagerValuesRef.current.layout = nextLayout;
5118
+ if (onLayout2) {
5119
+ onLayout2(nextLayout);
5120
+ }
5121
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5122
+ }
5123
+ }
5124
+ }
5125
+ }, []);
5126
+ const expandPanel = useCallback((panelData, minSizeOverride) => {
5127
+ const {
5128
+ onLayout: onLayout2
5129
+ } = committedValuesRef.current;
5130
+ const {
5131
+ layout: prevLayout,
5132
+ panelDataArray
5133
+ } = eagerValuesRef.current;
5134
+ if (panelData.constraints.collapsible) {
5135
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5136
+ const {
5137
+ collapsedSize = 0,
5138
+ panelSize = 0,
5139
+ minSize: minSizeFromProps = 0,
5140
+ pivotIndices
5141
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5142
+ const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
5143
+ if (fuzzyNumbersEqual$1$1(panelSize, collapsedSize)) {
5144
+ const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
5145
+ const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
5146
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5147
+ const delta = isLastPanel ? panelSize - baseSize : baseSize - panelSize;
5148
+ const nextLayout = adjustLayoutByDelta$1({
5149
+ delta,
5150
+ initialLayout: prevLayout,
5151
+ panelConstraints: panelConstraintsArray,
5152
+ pivotIndices,
5153
+ prevLayout,
5154
+ trigger: "imperative-api"
5155
+ });
5156
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5157
+ setLayout(nextLayout);
5158
+ eagerValuesRef.current.layout = nextLayout;
5159
+ if (onLayout2) {
5160
+ onLayout2(nextLayout);
5161
+ }
5162
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5163
+ }
5164
+ }
5165
+ }
5166
+ }, []);
5167
+ const getPanelSize = useCallback((panelData) => {
5168
+ const {
5169
+ layout: layout2,
5170
+ panelDataArray
5171
+ } = eagerValuesRef.current;
5172
+ const {
5173
+ panelSize
5174
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5175
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5176
+ return panelSize;
5177
+ }, []);
5178
+ const getPanelStyle = useCallback((panelData, defaultSize) => {
5179
+ const {
5180
+ panelDataArray
5181
+ } = eagerValuesRef.current;
5182
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
5183
+ return computePanelFlexBoxStyle$1({
5184
+ defaultSize,
5185
+ dragState,
5186
+ layout,
5187
+ panelData: panelDataArray,
5188
+ panelIndex
5189
+ });
5190
+ }, [dragState, layout]);
5191
+ const isPanelCollapsed = useCallback((panelData) => {
5192
+ const {
5193
+ layout: layout2,
5194
+ panelDataArray
5195
+ } = eagerValuesRef.current;
5196
+ const {
5197
+ collapsedSize = 0,
5198
+ collapsible,
5199
+ panelSize
5200
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5201
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5202
+ return collapsible === true && fuzzyNumbersEqual$1$1(panelSize, collapsedSize);
5203
+ }, []);
5204
+ const isPanelExpanded = useCallback((panelData) => {
5205
+ const {
5206
+ layout: layout2,
5207
+ panelDataArray
5208
+ } = eagerValuesRef.current;
5209
+ const {
5210
+ collapsedSize = 0,
5211
+ collapsible,
5212
+ panelSize
5213
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5214
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5215
+ return !collapsible || fuzzyCompareNumbers$1(panelSize, collapsedSize) > 0;
5216
+ }, []);
5217
+ const registerPanel = useCallback((panelData) => {
5218
+ const {
5219
+ panelDataArray
5220
+ } = eagerValuesRef.current;
5221
+ panelDataArray.push(panelData);
5222
+ panelDataArray.sort((panelA, panelB) => {
5223
+ const orderA = panelA.order;
5224
+ const orderB = panelB.order;
5225
+ if (orderA == null && orderB == null) {
5226
+ return 0;
5227
+ } else if (orderA == null) {
5228
+ return -1;
5229
+ } else if (orderB == null) {
5230
+ return 1;
5231
+ } else {
5232
+ return orderA - orderB;
5233
+ }
5234
+ });
5235
+ eagerValuesRef.current.panelDataArrayChanged = true;
5236
+ forceUpdate();
5237
+ }, [forceUpdate]);
5238
+ useIsomorphicLayoutEffect$1(() => {
5239
+ if (eagerValuesRef.current.panelDataArrayChanged) {
5240
+ eagerValuesRef.current.panelDataArrayChanged = false;
5241
+ const {
5242
+ autoSaveId: autoSaveId2,
5243
+ onLayout: onLayout2,
5244
+ storage: storage2
5245
+ } = committedValuesRef.current;
5246
+ const {
5247
+ layout: prevLayout,
5248
+ panelDataArray
5249
+ } = eagerValuesRef.current;
5250
+ let unsafeLayout = null;
5251
+ if (autoSaveId2) {
5252
+ const state = loadPanelGroupState$1(autoSaveId2, panelDataArray, storage2);
5253
+ if (state) {
5254
+ panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
5255
+ unsafeLayout = state.layout;
5256
+ }
5257
+ }
5258
+ if (unsafeLayout == null) {
5259
+ unsafeLayout = calculateUnsafeDefaultLayout$1({
5260
+ panelDataArray
5261
+ });
5262
+ }
5263
+ const nextLayout = validatePanelGroupLayout$1({
5264
+ layout: unsafeLayout,
5265
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
5266
+ });
5267
+ if (!areEqual$1(prevLayout, nextLayout)) {
5268
+ setLayout(nextLayout);
5269
+ eagerValuesRef.current.layout = nextLayout;
5270
+ if (onLayout2) {
5271
+ onLayout2(nextLayout);
5272
+ }
5273
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5274
+ }
5275
+ }
5276
+ });
5277
+ useIsomorphicLayoutEffect$1(() => {
5278
+ const eagerValues = eagerValuesRef.current;
5279
+ return () => {
5280
+ eagerValues.layout = [];
5281
+ };
5282
+ }, []);
5283
+ const registerResizeHandle = useCallback((dragHandleId) => {
5284
+ let isRTL = false;
5285
+ const panelGroupElement = panelGroupElementRef.current;
5286
+ if (panelGroupElement) {
5287
+ const style3 = window.getComputedStyle(panelGroupElement, null);
5288
+ if (style3.getPropertyValue("direction") === "rtl") {
5289
+ isRTL = true;
5290
+ }
5291
+ }
5292
+ return function resizeHandler(event) {
5293
+ event.preventDefault();
5294
+ const panelGroupElement2 = panelGroupElementRef.current;
5295
+ if (!panelGroupElement2) {
5296
+ return () => null;
5297
+ }
5298
+ const {
5299
+ direction: direction2,
5300
+ dragState: dragState2,
5301
+ id: groupId2,
5302
+ keyboardResizeBy: keyboardResizeBy2,
5303
+ onLayout: onLayout2
5304
+ } = committedValuesRef.current;
5305
+ const {
5306
+ layout: prevLayout,
5307
+ panelDataArray
5308
+ } = eagerValuesRef.current;
5309
+ const {
5310
+ initialLayout
5311
+ } = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
5312
+ const pivotIndices = determinePivotIndices$1(groupId2, dragHandleId, panelGroupElement2);
5313
+ let delta = calculateDeltaPercentage$1(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
5314
+ const isHorizontal = direction2 === "horizontal";
5315
+ if (isHorizontal && isRTL) {
5316
+ delta = -delta;
5317
+ }
5318
+ const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
5319
+ const nextLayout = adjustLayoutByDelta$1({
5320
+ delta,
5321
+ initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
5322
+ panelConstraints,
5323
+ pivotIndices,
5324
+ prevLayout,
5325
+ trigger: isKeyDown$1(event) ? "keyboard" : "mouse-or-touch"
5326
+ });
5327
+ const layoutChanged = !compareLayouts$1(prevLayout, nextLayout);
5328
+ if (isPointerEvent$1(event) || isMouseEvent$1(event)) {
5329
+ if (prevDeltaRef.current != delta) {
5330
+ prevDeltaRef.current = delta;
5331
+ if (!layoutChanged && delta !== 0) {
5332
+ if (isHorizontal) {
5333
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN$1 : EXCEEDED_HORIZONTAL_MAX$1);
5334
+ } else {
5335
+ reportConstraintsViolation$1(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN$1 : EXCEEDED_VERTICAL_MAX$1);
5336
+ }
5337
+ } else {
5338
+ reportConstraintsViolation$1(dragHandleId, 0);
5339
+ }
5340
+ }
5341
+ }
5342
+ if (layoutChanged) {
5343
+ setLayout(nextLayout);
5344
+ eagerValuesRef.current.layout = nextLayout;
5345
+ if (onLayout2) {
5346
+ onLayout2(nextLayout);
5347
+ }
5348
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5349
+ }
5350
+ };
5351
+ }, []);
5352
+ const resizePanel2 = useCallback((panelData, unsafePanelSize) => {
5353
+ const {
5354
+ onLayout: onLayout2
5355
+ } = committedValuesRef.current;
5356
+ const {
5357
+ layout: prevLayout,
5358
+ panelDataArray
5359
+ } = eagerValuesRef.current;
5360
+ const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
5361
+ const {
5362
+ panelSize,
5363
+ pivotIndices
5364
+ } = panelDataHelper$1(panelDataArray, panelData, prevLayout);
5365
+ assert$1(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
5366
+ const isLastPanel = findPanelDataIndex$1(panelDataArray, panelData) === panelDataArray.length - 1;
5367
+ const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
5368
+ const nextLayout = adjustLayoutByDelta$1({
5369
+ delta,
5370
+ initialLayout: prevLayout,
5371
+ panelConstraints: panelConstraintsArray,
5372
+ pivotIndices,
5373
+ prevLayout,
5374
+ trigger: "imperative-api"
5375
+ });
5376
+ if (!compareLayouts$1(prevLayout, nextLayout)) {
5377
+ setLayout(nextLayout);
5378
+ eagerValuesRef.current.layout = nextLayout;
5379
+ if (onLayout2) {
5380
+ onLayout2(nextLayout);
5381
+ }
5382
+ callPanelCallbacks$1(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
5383
+ }
5384
+ }, []);
5385
+ const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
5386
+ const {
5387
+ layout: layout2,
5388
+ panelDataArray
5389
+ } = eagerValuesRef.current;
5390
+ const {
5391
+ collapsedSize: prevCollapsedSize = 0,
5392
+ collapsible: prevCollapsible
5393
+ } = prevConstraints;
5394
+ const {
5395
+ collapsedSize: nextCollapsedSize = 0,
5396
+ collapsible: nextCollapsible,
5397
+ maxSize: nextMaxSize = 100,
5398
+ minSize: nextMinSize = 0
5399
+ } = panelData.constraints;
5400
+ const {
5401
+ panelSize: prevPanelSize
5402
+ } = panelDataHelper$1(panelDataArray, panelData, layout2);
5403
+ if (prevPanelSize == null) {
5404
+ return;
5405
+ }
5406
+ if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1$1(prevPanelSize, prevCollapsedSize)) {
5407
+ if (!fuzzyNumbersEqual$1$1(prevCollapsedSize, nextCollapsedSize)) {
5408
+ resizePanel2(panelData, nextCollapsedSize);
5409
+ }
5410
+ } else if (prevPanelSize < nextMinSize) {
5411
+ resizePanel2(panelData, nextMinSize);
5412
+ } else if (prevPanelSize > nextMaxSize) {
5413
+ resizePanel2(panelData, nextMaxSize);
5414
+ }
5415
+ }, [resizePanel2]);
5416
+ const startDragging = useCallback((dragHandleId, event) => {
5417
+ const {
5418
+ direction: direction2
5419
+ } = committedValuesRef.current;
5420
+ const {
5421
+ layout: layout2
5422
+ } = eagerValuesRef.current;
5423
+ if (!panelGroupElementRef.current) {
5424
+ return;
5425
+ }
5426
+ const handleElement = getResizeHandleElement$1(dragHandleId, panelGroupElementRef.current);
5427
+ assert$1(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
5428
+ const initialCursorPosition = getResizeEventCursorPosition$1(direction2, event);
5429
+ setDragState({
5430
+ dragHandleId,
5431
+ dragHandleRect: handleElement.getBoundingClientRect(),
5432
+ initialCursorPosition,
5433
+ initialLayout: layout2
5434
+ });
5435
+ }, []);
5436
+ const stopDragging = useCallback(() => {
5437
+ setDragState(null);
5438
+ }, []);
5439
+ const unregisterPanel = useCallback((panelData) => {
5440
+ const {
5441
+ panelDataArray
5442
+ } = eagerValuesRef.current;
5443
+ const index2 = findPanelDataIndex$1(panelDataArray, panelData);
5444
+ if (index2 >= 0) {
5445
+ panelDataArray.splice(index2, 1);
5446
+ delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
5447
+ eagerValuesRef.current.panelDataArrayChanged = true;
5448
+ forceUpdate();
5449
+ }
5450
+ }, [forceUpdate]);
5451
+ const context = useMemo(() => ({
5452
+ collapsePanel,
5453
+ direction,
5454
+ dragState,
5455
+ expandPanel,
5456
+ getPanelSize,
5457
+ getPanelStyle,
5458
+ groupId,
5459
+ isPanelCollapsed,
5460
+ isPanelExpanded,
5461
+ reevaluatePanelConstraints,
5462
+ registerPanel,
5463
+ registerResizeHandle,
5464
+ resizePanel: resizePanel2,
5465
+ startDragging,
5466
+ stopDragging,
5467
+ unregisterPanel,
5468
+ panelGroupElement: panelGroupElementRef.current
5469
+ }), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle, resizePanel2, startDragging, stopDragging, unregisterPanel]);
5470
+ const style2 = {
5471
+ display: "flex",
5472
+ flexDirection: direction === "horizontal" ? "row" : "column",
5473
+ height: "100%",
5474
+ overflow: "hidden",
5475
+ width: "100%"
5476
+ };
5477
+ return createElement(PanelGroupContext$1.Provider, {
5478
+ value: context
5479
+ }, createElement(Type, {
5480
+ ...rest,
5481
+ children: children2,
5482
+ className: classNameFromProps,
5483
+ id: idFromProps,
5484
+ ref: panelGroupElementRef,
5485
+ style: {
5486
+ ...style2,
5487
+ ...styleFromProps
5488
+ },
5489
+ // CSS selectors
5490
+ [DATA_ATTRIBUTES$1.group]: "",
5491
+ [DATA_ATTRIBUTES$1.groupDirection]: direction,
5492
+ [DATA_ATTRIBUTES$1.groupId]: groupId
5493
+ }));
5494
+ }
5495
+ const PanelGroup$1 = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef$1, {
5496
+ ...props,
5497
+ forwardedRef: ref
5498
+ }));
5499
+ PanelGroupWithForwardedRef$1.displayName = "PanelGroup";
5500
+ PanelGroup$1.displayName = "forwardRef(PanelGroup)";
5501
+ function findPanelDataIndex$1(panelDataArray, panelData) {
5502
+ return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
5503
+ }
5504
+ function panelDataHelper$1(panelDataArray, panelData, layout) {
5505
+ const panelIndex = findPanelDataIndex$1(panelDataArray, panelData);
5506
+ const isLastPanel = panelIndex === panelDataArray.length - 1;
5507
+ const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
5508
+ const panelSize = layout[panelIndex];
5509
+ return {
5510
+ ...panelData.constraints,
5511
+ panelSize,
5512
+ pivotIndices
5513
+ };
5514
+ }
5515
+ function C(e) {
5516
+ return { "--panel-background": e.colors.background, "--panel-border": e.colors.border, "--panel-handle": e.colors.backgroundSecondary, "--panel-handle-hover": e.colors.backgroundHover, "--panel-handle-active": e.colors.primary, "--panel-button-bg": e.colors.surface, "--panel-button-hover": e.colors.backgroundHover, "--panel-button-border": e.colors.border, "--panel-button-icon": e.colors.textSecondary, "--panel-accent-bg": e.colors.primary + "15" };
5517
+ }
5518
+ const z = forwardRef(({ panels: o, className: a = "", style: s2, theme: d, minPanelWidth: u = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m, preventKeyboardScroll: f = true, disableSwipe: g = false }, v) => {
5519
+ const b = useRef(null), y = C(d);
5520
+ useImperativeHandle(v, () => ({ scrollToPanel: (e) => {
5521
+ if (!b.current) return;
5522
+ const t = b.current, n = t.children[e];
5523
+ if (n) {
5524
+ const e2 = n.offsetLeft;
5525
+ t.scrollTo({ left: e2, behavior: "smooth" });
5526
+ }
5527
+ }, getCurrentPanel: () => {
5528
+ if (!b.current || 0 === b.current.children.length) return 0;
5529
+ const e = b.current, t = e.getBoundingClientRect().left;
5530
+ let n = 0, r2 = 1 / 0;
5531
+ for (let o2 = 0; o2 < e.children.length; o2++) {
5532
+ const i = e.children[o2].getBoundingClientRect(), a2 = Math.abs(i.left - t);
5533
+ a2 < r2 && (r2 = a2, n = o2);
5534
+ }
5535
+ return n;
5536
+ } }));
5537
+ useEffect(() => {
5538
+ if (!f || !b.current) return;
5539
+ const e = b.current, t = (e2) => {
5540
+ const t2 = e2.target;
5541
+ if ("INPUT" === t2.tagName || "TEXTAREA" === t2.tagName || "SELECT" === t2.tagName || t2.isContentEditable || null !== t2.closest(".xterm") || null !== t2.closest('[contenteditable="true"]')) return;
5542
+ [" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e2.key) && e2.preventDefault();
5543
+ };
5544
+ return e.addEventListener("keydown", t), () => {
5545
+ e.removeEventListener("keydown", t);
5546
+ };
5547
+ }, [f]);
5548
+ const w = o.length, x = 2 * u;
5549
+ let S2;
5550
+ S2 = 1 === w || 2 === w ? "100%" : `max(${u}px, ${100 * p2}%)`;
5551
+ const R = React2__default.useId().replace(/:/g, "_");
5552
+ return jsxs(Fragment, { children: [
5553
+ 2 === w && /* @__PURE__ */ jsx("style", { children: `
5554
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
5555
+ width: 100%;
5556
+ }
5557
+ @container (min-width: ${x}px) {
5558
+ .snap-carousel-container[data-carousel-id="${R}"][data-panel-count="2"] .snap-carousel-panel {
5559
+ width: 50%;
5560
+ }
5561
+ }
5562
+ ` }),
5563
+ /* @__PURE__ */ jsx("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a}`, style: { ...y, ...s2, "--snap-carousel-min-width": `${u}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": S2, "--snap-carousel-panel-count": w, "--snap-carousel-two-panel-threshold": `${x}px` }, onScroll: (e) => {
5564
+ if (!m || !b.current || 0 === b.current.children.length) return;
5565
+ const t = b.current, n = t.getBoundingClientRect().left;
5566
+ let r2 = 0, o2 = 1 / 0;
5567
+ for (let i = 0; i < t.children.length; i++) {
5568
+ const e2 = t.children[i].getBoundingClientRect(), a2 = Math.abs(e2.left - n);
5569
+ a2 < o2 && (o2 = a2, r2 = i);
5570
+ }
5571
+ m(r2);
5572
+ }, "data-panel-count": w, "data-carousel-id": R, children: o.map((t, n) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t }, n)) })
5573
+ ] });
5574
+ });
5575
+ z.displayName = "SnapCarousel";
5576
+ var le$1, se$1;
5577
+ (se$1 = le$1 || (le$1 = {})).DragStart = "dragStart", se$1.DragMove = "dragMove", se$1.DragEnd = "dragEnd", se$1.DragCancel = "dragCancel", se$1.DragOver = "dragOver", se$1.RegisterDroppable = "registerDroppable", se$1.SetDroppableDisabled = "setDroppableDisabled", se$1.UnregisterDroppable = "unregisterDroppable";
5578
+ const de = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
5579
+ var Te$1, Ae;
5580
+ (Ae = Te$1 || (Te$1 = {}))[Ae.Forward = 1] = "Forward", Ae[Ae.Backward = -1] = "Backward";
5581
+ var _e$1, je$1, He$1, Ke$1;
5582
+ (je$1 = _e$1 || (_e$1 = {})).Click = "click", je$1.DragStart = "dragstart", je$1.Keydown = "keydown", je$1.ContextMenu = "contextmenu", je$1.Resize = "resize", je$1.SelectionChange = "selectionchange", je$1.VisibilityChange = "visibilitychange", (Ke$1 = He$1 || (He$1 = {})).Space = "Space", Ke$1.Down = "ArrowDown", Ke$1.Right = "ArrowRight", Ke$1.Left = "ArrowLeft", Ke$1.Up = "ArrowUp", Ke$1.Esc = "Escape", Ke$1.Enter = "Enter", Ke$1.Tab = "Tab";
5583
+ ({ start: [He$1.Space, He$1.Enter], cancel: [He$1.Esc], end: [He$1.Space, He$1.Enter, He$1.Tab] });
5584
+ var rt, ot$1;
5585
+ (ot$1 = rt || (rt = {}))[ot$1.RightClick = 2] = "RightClick";
5586
+ var at, lt$1, st$1, ct$1;
5587
+ (lt$1 = at || (at = {}))[lt$1.Pointer = 0] = "Pointer", lt$1[lt$1.DraggableRect = 1] = "DraggableRect", (ct$1 = st$1 || (st$1 = {}))[ct$1.TreeOrder = 0] = "TreeOrder", ct$1[ct$1.ReversedTreeOrder = 1] = "ReversedTreeOrder";
5588
+ ({ x: { [Te$1.Backward]: false, [Te$1.Forward]: false }, y: { [Te$1.Backward]: false, [Te$1.Forward]: false } });
5589
+ var pt, ht$1, mt$1;
5590
+ (ht$1 = pt || (pt = {}))[ht$1.Always = 0] = "Always", ht$1[ht$1.BeforeDragging = 1] = "BeforeDragging", ht$1[ht$1.WhileDragging = 2] = "WhileDragging", (mt$1 || (mt$1 = {})).Optimized = "optimized";
5591
+ ({ droppable: { strategy: pt.WhileDragging, frequency: mt$1.Optimized } });
5592
+ /* @__PURE__ */ createContext({ ...de, scaleX: 1, scaleY: 1 });
5593
+ var $t, Bt$1;
5594
+ (Bt$1 = $t || ($t = {}))[Bt$1.Uninitialized = 0] = "Uninitialized", Bt$1[Bt$1.Initializing = 1] = "Initializing", Bt$1[Bt$1.Initialized = 2] = "Initialized";
5595
+ var Ut;
5596
+ (() => {
5597
+ if ("undefined" != typeof window) {
5598
+ const e = window;
5599
+ return e.__principlemd_theme_context__ || (e.__principlemd_theme_context__ = createContext(void 0)), e.__principlemd_theme_context__;
5600
+ }
5601
+ return Ut || (Ut = createContext(void 0)), Ut;
5602
+ })();
5603
+ var _e = Object.defineProperty;
5604
+ var Ee = (o, e, t) => e in o ? _e(o, e, { enumerable: true, configurable: true, writable: true, value: t }) : o[e] = t;
5605
+ var le = (o, e, t) => Ee(o, typeof e != "symbol" ? e + "" : e, t);
5606
+ class De {
5607
+ constructor() {
5608
+ le(this, "PRESETS_KEY", "panel-layouts:workspace-presets");
5609
+ le(this, "REPO_STATE_PREFIX", "panel-layouts:repo-state:");
5610
+ }
5611
+ /**
5612
+ * Load all user-created workspace presets
5613
+ */
5614
+ async loadWorkspacePresets() {
5615
+ try {
5616
+ const e = localStorage.getItem(this.PRESETS_KEY);
5617
+ return e ? JSON.parse(e) : {};
5618
+ } catch (e) {
5619
+ return console.error("Failed to load workspace presets:", e), {};
3876
5620
  }
3877
- ]
3878
- ];
3879
- const FolderPlus = createLucideIcon("folder-plus", __iconNode$9);
3880
- /**
3881
- * @license lucide-react v0.552.0 - ISC
3882
- *
3883
- * This source code is licensed under the ISC license.
3884
- * See the LICENSE file in the root directory of this source tree.
3885
- */
3886
- const __iconNode$8 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
3887
- const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
3888
- /**
3889
- * @license lucide-react v0.552.0 - ISC
3890
- *
3891
- * This source code is licensed under the ISC license.
3892
- * See the LICENSE file in the root directory of this source tree.
3893
- */
3894
- const __iconNode$7 = [
3895
- ["path", { d: "M12 13v8", key: "1l5pq0" }],
3896
- ["path", { d: "M12 3v3", key: "1n5kay" }],
3897
- [
3898
- "path",
3899
- {
3900
- d: "M4 6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h13a2 2 0 0 0 1.152-.365l3.424-2.317a1 1 0 0 0 0-1.635l-3.424-2.318A2 2 0 0 0 17 6z",
3901
- key: "1btarq"
5621
+ }
5622
+ /**
5623
+ * Save workspace presets
5624
+ */
5625
+ async saveWorkspacePresets(e) {
5626
+ try {
5627
+ localStorage.setItem(this.PRESETS_KEY, JSON.stringify(e));
5628
+ } catch (t) {
5629
+ throw console.error("Failed to save workspace presets:", t), t;
3902
5630
  }
3903
- ]
3904
- ];
3905
- const Milestone = createLucideIcon("milestone", __iconNode$7);
3906
- /**
3907
- * @license lucide-react v0.552.0 - ISC
3908
- *
3909
- * This source code is licensed under the ISC license.
3910
- * See the LICENSE file in the root directory of this source tree.
3911
- */
3912
- const __iconNode$6 = [
3913
- ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
3914
- ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
3915
- ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
3916
- ];
3917
- const Monitor = createLucideIcon("monitor", __iconNode$6);
3918
- /**
3919
- * @license lucide-react v0.552.0 - ISC
3920
- *
3921
- * This source code is licensed under the ISC license.
3922
- * See the LICENSE file in the root directory of this source tree.
3923
- */
3924
- const __iconNode$5 = [
3925
- ["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
3926
- ["path", { d: "M2 12H22", key: "1m8cig" }]
3927
- ];
3928
- const MoveRight = createLucideIcon("move-right", __iconNode$5);
3929
- /**
3930
- * @license lucide-react v0.552.0 - ISC
3931
- *
3932
- * This source code is licensed under the ISC license.
3933
- * See the LICENSE file in the root directory of this source tree.
3934
- */
3935
- const __iconNode$4 = [
3936
- [
3937
- "path",
3938
- {
3939
- d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",
3940
- key: "10ikf1"
5631
+ }
5632
+ /**
5633
+ * Load repository-specific workspace state
5634
+ */
5635
+ async loadRepositoryState(e) {
5636
+ try {
5637
+ const t = `${this.REPO_STATE_PREFIX}${e}`, r2 = localStorage.getItem(t);
5638
+ return r2 ? JSON.parse(r2) : null;
5639
+ } catch (t) {
5640
+ return console.error(
5641
+ `Failed to load repository state for ${e}:`,
5642
+ t
5643
+ ), null;
3941
5644
  }
3942
- ]
3943
- ];
3944
- const Play = createLucideIcon("play", __iconNode$4);
3945
- /**
3946
- * @license lucide-react v0.552.0 - ISC
3947
- *
3948
- * This source code is licensed under the ISC license.
3949
- * See the LICENSE file in the root directory of this source tree.
3950
- */
3951
- const __iconNode$3 = [
3952
- ["path", { d: "M5 12h14", key: "1ays0h" }],
3953
- ["path", { d: "M12 5v14", key: "s699le" }]
3954
- ];
3955
- const Plus = createLucideIcon("plus", __iconNode$3);
3956
- /**
3957
- * @license lucide-react v0.552.0 - ISC
3958
- *
3959
- * This source code is licensed under the ISC license.
3960
- * See the LICENSE file in the root directory of this source tree.
3961
- */
3962
- const __iconNode$2 = [
3963
- ["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
3964
- ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
3965
- ["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
3966
- ["path", { d: "M8 16H3v5", key: "1cv678" }]
3967
- ];
3968
- const RefreshCw = createLucideIcon("refresh-cw", __iconNode$2);
3969
- /**
3970
- * @license lucide-react v0.552.0 - ISC
3971
- *
3972
- * This source code is licensed under the ISC license.
3973
- * See the LICENSE file in the root directory of this source tree.
3974
- */
3975
- const __iconNode$1 = [
3976
- ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
3977
- ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
3978
- ];
3979
- const Search = createLucideIcon("search", __iconNode$1);
3980
- /**
3981
- * @license lucide-react v0.552.0 - ISC
3982
- *
3983
- * This source code is licensed under the ISC license.
3984
- * See the LICENSE file in the root directory of this source tree.
3985
- */
3986
- const __iconNode = [
3987
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
3988
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
3989
- ];
3990
- const X = createLucideIcon("x", __iconNode);
3991
- var ThemeContext$1;
3992
- var getThemeContext$1 = () => {
3993
- if (typeof window !== "undefined") {
3994
- const globalWindow = window;
3995
- if (!globalWindow.__principlemd_theme_context__) {
3996
- globalWindow.__principlemd_theme_context__ = createContext(void 0);
5645
+ }
5646
+ /**
5647
+ * Save repository-specific workspace state
5648
+ */
5649
+ async saveRepositoryState(e, t) {
5650
+ try {
5651
+ const r2 = `${this.REPO_STATE_PREFIX}${e}`;
5652
+ localStorage.setItem(r2, JSON.stringify(t));
5653
+ } catch (r2) {
5654
+ throw console.error(
5655
+ `Failed to save repository state for ${e}:`,
5656
+ r2
5657
+ ), r2;
3997
5658
  }
3998
- return globalWindow.__principlemd_theme_context__;
3999
- } else {
4000
- if (!ThemeContext$1) {
4001
- ThemeContext$1 = createContext(void 0);
5659
+ }
5660
+ /**
5661
+ * Load all repository states
5662
+ */
5663
+ async loadAllRepositoryStates() {
5664
+ try {
5665
+ const e = {};
5666
+ for (let t = 0; t < localStorage.length; t++) {
5667
+ const r2 = localStorage.key(t);
5668
+ if (r2 && r2.startsWith(this.REPO_STATE_PREFIX)) {
5669
+ const s2 = r2.substring(this.REPO_STATE_PREFIX.length), i = localStorage.getItem(r2);
5670
+ if (i)
5671
+ try {
5672
+ e[s2] = JSON.parse(i);
5673
+ } catch (l) {
5674
+ console.error(
5675
+ `Failed to parse repository state for ${s2}:`,
5676
+ l
5677
+ );
5678
+ }
5679
+ }
5680
+ }
5681
+ return e;
5682
+ } catch (e) {
5683
+ return console.error("Failed to load all repository states:", e), {};
4002
5684
  }
4003
- return ThemeContext$1;
4004
5685
  }
4005
- };
4006
- var ThemeContextSingleton = getThemeContext$1();
4007
- var useTheme = () => {
4008
- const context = useContext(ThemeContextSingleton);
4009
- if (!context) {
4010
- throw new Error("useTheme must be used within a ThemeProvider");
5686
+ }
5687
+ class O {
5688
+ /**
5689
+ * Configure a custom storage adapter (for Electron IPC or remote storage)
5690
+ */
5691
+ static setAdapter(e) {
5692
+ this.adapter = e;
4011
5693
  }
4012
- return context;
4013
- };
5694
+ /**
5695
+ * Get all workspace layouts (including built-in)
5696
+ */
5697
+ static async getWorkspaceLayouts() {
5698
+ const e = this.getBuiltInWorkspaceLayouts();
5699
+ return {
5700
+ ...await this.adapter.loadWorkspacePresets(),
5701
+ ...e
5702
+ };
5703
+ }
5704
+ /**
5705
+ * Get a specific workspace layout by ID
5706
+ */
5707
+ static async getWorkspaceLayout(e) {
5708
+ return (await this.getWorkspaceLayouts())[e] || null;
5709
+ }
5710
+ /**
5711
+ * Create a new workspace layout
5712
+ */
5713
+ static async createWorkspaceLayout(e) {
5714
+ const t = await this.adapter.loadWorkspacePresets(), r2 = this.generateWorkspaceId(e.name), s2 = {
5715
+ id: r2,
5716
+ name: e.name,
5717
+ description: e.description,
5718
+ layout: e.layout,
5719
+ defaultSizes: e.defaultSizes,
5720
+ defaultCollapsed: e.defaultCollapsed,
5721
+ createdAt: Date.now(),
5722
+ updatedAt: Date.now(),
5723
+ isBuiltIn: false
5724
+ }, i = {
5725
+ ...t,
5726
+ [r2]: s2
5727
+ };
5728
+ return await this.adapter.saveWorkspacePresets(i), s2;
5729
+ }
5730
+ /**
5731
+ * Update an existing workspace layout
5732
+ */
5733
+ static async updateWorkspaceLayout(e, t) {
5734
+ const r2 = await this.adapter.loadWorkspacePresets(), s2 = r2[e];
5735
+ if (!s2)
5736
+ return console.error(`Workspace layout ${e} not found`), null;
5737
+ if (s2.isBuiltIn)
5738
+ return console.error(`Cannot update built-in workspace layout ${e}`), null;
5739
+ const i = {
5740
+ ...s2,
5741
+ ...t,
5742
+ id: e,
5743
+ // Preserve ID
5744
+ createdAt: s2.createdAt,
5745
+ // Preserve creation time
5746
+ updatedAt: Date.now()
5747
+ }, l = {
5748
+ ...r2,
5749
+ [e]: i
5750
+ };
5751
+ return await this.adapter.saveWorkspacePresets(l), i;
5752
+ }
5753
+ /**
5754
+ * Delete a workspace layout
5755
+ */
5756
+ static async deleteWorkspaceLayout(e) {
5757
+ const t = await this.adapter.loadWorkspacePresets(), r2 = t[e];
5758
+ if (!r2)
5759
+ return console.error(`Workspace layout ${e} not found`), false;
5760
+ if (r2.isBuiltIn)
5761
+ return console.error(`Cannot delete built-in workspace layout ${e}`), false;
5762
+ const s2 = { ...t };
5763
+ return delete s2[e], await this.adapter.saveWorkspacePresets(s2), true;
5764
+ }
5765
+ /**
5766
+ * Get repository state (which workspace + current sizes/collapsed)
5767
+ */
5768
+ static async getRepositoryState(e) {
5769
+ return await this.adapter.loadRepositoryState(e);
5770
+ }
5771
+ /**
5772
+ * Set repository state (which workspace + current sizes/collapsed/layout)
5773
+ */
5774
+ static async setRepositoryState(e, t) {
5775
+ await this.adapter.saveRepositoryState(e, t);
5776
+ }
5777
+ /**
5778
+ * Update only sizes in repository state
5779
+ */
5780
+ static async updateRepositorySizes(e, t) {
5781
+ const r2 = await this.getRepositoryState(e);
5782
+ r2 && await this.setRepositoryState(e, {
5783
+ ...r2,
5784
+ sizes: t
5785
+ });
5786
+ }
5787
+ /**
5788
+ * Update only collapsed state in repository state
5789
+ */
5790
+ static async updateRepositoryCollapsed(e, t) {
5791
+ const r2 = await this.getRepositoryState(e);
5792
+ r2 && await this.setRepositoryState(e, {
5793
+ ...r2,
5794
+ collapsed: t
5795
+ });
5796
+ }
5797
+ /**
5798
+ * Check if repository state differs from workspace defaults
5799
+ */
5800
+ static hasStateDeviation(e, t) {
5801
+ const r2 = t.defaultSizes ? JSON.stringify(e.sizes) !== JSON.stringify(t.defaultSizes) : false, s2 = t.defaultCollapsed ? JSON.stringify(e.collapsed) !== JSON.stringify(t.defaultCollapsed) : false;
5802
+ return { hasSizeDeviation: r2, hasCollapsedDeviation: s2 };
5803
+ }
5804
+ /**
5805
+ * Update workspace defaults from repository state
5806
+ */
5807
+ static async updateWorkspaceFromRepositoryState(e, t) {
5808
+ const r2 = await this.getWorkspaceLayout(e), s2 = await this.getRepositoryState(t);
5809
+ if (!r2 || !s2 || r2.isBuiltIn) {
5810
+ console.error(
5811
+ "Cannot update built-in workspace or workspace/state not found"
5812
+ );
5813
+ return;
5814
+ }
5815
+ await this.updateWorkspaceLayout(e, {
5816
+ defaultSizes: s2.sizes,
5817
+ defaultCollapsed: s2.collapsed
5818
+ });
5819
+ }
5820
+ /**
5821
+ * Reset repository state to workspace defaults
5822
+ */
5823
+ static async resetRepositoryToWorkspaceDefaults(e, t) {
5824
+ const r2 = await this.getWorkspaceLayout(t);
5825
+ if (!r2) {
5826
+ console.error(`Workspace ${t} not found`);
5827
+ return;
5828
+ }
5829
+ const s2 = await this.getRepositoryState(e);
5830
+ s2 && await this.setRepositoryState(e, {
5831
+ ...s2,
5832
+ sizes: r2.defaultSizes || { left: 20, middle: 45, right: 35 },
5833
+ collapsed: r2.defaultCollapsed || { left: false, right: false }
5834
+ });
5835
+ }
5836
+ /**
5837
+ * Check if a layout matches a workspace layout
5838
+ */
5839
+ static isLayoutMatchingWorkspace(e, t) {
5840
+ return this.areLayoutsEqual(e, t.layout);
5841
+ }
5842
+ /**
5843
+ * Find workspace ID that matches the given layout
5844
+ */
5845
+ static async findMatchingWorkspace(e) {
5846
+ const t = await this.getWorkspaceLayouts();
5847
+ for (const [r2, s2] of Object.entries(t))
5848
+ if (this.isLayoutMatchingWorkspace(e, s2))
5849
+ return r2;
5850
+ return null;
5851
+ }
5852
+ /**
5853
+ * Deep comparison of two panel layouts
5854
+ */
5855
+ static areLayoutsEqual(e, t) {
5856
+ return JSON.stringify(e) === JSON.stringify(t);
5857
+ }
5858
+ /**
5859
+ * Generate a unique ID from a workspace name
5860
+ */
5861
+ static generateWorkspaceId(e) {
5862
+ return `${e.toLowerCase().replace(/[^a-z0-9]+/g, "-")}-${Date.now()}`;
5863
+ }
5864
+ /**
5865
+ * Get built-in workspace layouts
5866
+ */
5867
+ static getBuiltInWorkspaceLayouts() {
5868
+ const e = Date.now();
5869
+ return {
5870
+ "project-management": {
5871
+ id: "project-management",
5872
+ name: "Project Management",
5873
+ description: "Tasks, dependencies, issues, file tree, docs, drawings, multi terminal, city visualization, code viewer, markdown slides, and excalidraw",
5874
+ layout: {
5875
+ left: {
5876
+ type: "tabs",
5877
+ panels: [
5878
+ "tasks",
5879
+ "dependencies",
5880
+ "gitIssues",
5881
+ "fileTree",
5882
+ "docs",
5883
+ "drawings"
5884
+ ],
5885
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5886
+ },
5887
+ middle: "multiTerminal",
5888
+ right: {
5889
+ type: "tabs",
5890
+ panels: [
5891
+ "cityVisualization",
5892
+ "codeViewer",
5893
+ "markdownViewer",
5894
+ "excalidrawDiagram"
5895
+ ],
5896
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5897
+ }
5898
+ },
5899
+ defaultSizes: { left: 20, middle: 45, right: 35 },
5900
+ defaultCollapsed: { left: false, right: false },
5901
+ createdAt: e,
5902
+ updatedAt: e,
5903
+ isBuiltIn: true
5904
+ },
5905
+ "code-review": {
5906
+ id: "code-review",
5907
+ name: "Code Review",
5908
+ description: "Git changes, pull requests, and file tree on left, git diff and code viewer in middle, city map on right",
5909
+ layout: {
5910
+ left: {
5911
+ type: "tabs",
5912
+ panels: ["gitChanges", "gitPullRequests", "fileTree"],
5913
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5914
+ },
5915
+ middle: {
5916
+ type: "tabs",
5917
+ panels: ["gitDiff", "codeViewer"],
5918
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5919
+ },
5920
+ right: "cityVisualization"
5921
+ },
5922
+ defaultSizes: { left: 20, middle: 50, right: 30 },
5923
+ defaultCollapsed: { left: false, right: false },
5924
+ createdAt: e,
5925
+ updatedAt: e,
5926
+ isBuiltIn: true
5927
+ },
5928
+ documentation: {
5929
+ id: "documentation",
5930
+ name: "Documentation",
5931
+ description: "Docs, markdown viewer, and code viewer",
5932
+ layout: {
5933
+ left: "docs",
5934
+ middle: "markdownViewer",
5935
+ right: "codeViewer"
5936
+ },
5937
+ defaultSizes: { left: 20, middle: 50, right: 30 },
5938
+ defaultCollapsed: { left: false, right: true },
5939
+ createdAt: e,
5940
+ updatedAt: e,
5941
+ isBuiltIn: true
5942
+ },
5943
+ "agent-work": {
5944
+ id: "agent-work",
5945
+ name: "Agent Work",
5946
+ description: "Tasks, agent sessions, file tree, agent context, git changes, docs, multi terminal, city map, agent events, code viewer, and markdown slides",
5947
+ layout: {
5948
+ left: {
5949
+ type: "tabs",
5950
+ panels: [
5951
+ "tasks",
5952
+ "agentSessions",
5953
+ "fileTree",
5954
+ "agentContext",
5955
+ "gitChanges",
5956
+ "docs"
5957
+ ],
5958
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5959
+ },
5960
+ middle: "multiTerminal",
5961
+ right: {
5962
+ type: "tabs",
5963
+ panels: [
5964
+ "cityVisualization",
5965
+ "agentEvents",
5966
+ "codeViewer",
5967
+ "markdownViewer"
5968
+ ],
5969
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5970
+ }
5971
+ },
5972
+ defaultSizes: { left: 20, middle: 45, right: 35 },
5973
+ defaultCollapsed: { left: false, right: false },
5974
+ createdAt: e,
5975
+ updatedAt: e,
5976
+ isBuiltIn: true
5977
+ },
5978
+ "quality-check": {
5979
+ id: "quality-check",
5980
+ name: "Quality Check",
5981
+ description: "Package information, tools, and dependencies on left; city visualization map in middle; multi terminal and code viewer on right (collapsed)",
5982
+ layout: {
5983
+ left: {
5984
+ type: "tabs",
5985
+ panels: ["packageInfo", "tools", "dependencies"],
5986
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5987
+ },
5988
+ middle: "cityVisualization",
5989
+ right: {
5990
+ type: "tabs",
5991
+ panels: ["multiTerminal", "codeViewer"],
5992
+ config: { defaultActiveTab: 0, tabPosition: "top" }
5993
+ }
5994
+ },
5995
+ defaultSizes: { left: 20, middle: 45, right: 35 },
5996
+ defaultCollapsed: { left: false, right: true },
5997
+ createdAt: e,
5998
+ updatedAt: e,
5999
+ isBuiltIn: true
6000
+ },
6001
+ drawing: {
6002
+ id: "drawing",
6003
+ name: "Drawing",
6004
+ description: "Drawings and docs, excalidraw diagram, multi terminal and markdown viewer",
6005
+ layout: {
6006
+ left: {
6007
+ type: "tabs",
6008
+ panels: ["drawings", "docs"],
6009
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6010
+ },
6011
+ middle: "excalidrawDiagram",
6012
+ right: {
6013
+ type: "tabs",
6014
+ panels: ["multiTerminal", "markdownViewer"],
6015
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6016
+ }
6017
+ },
6018
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6019
+ defaultCollapsed: { left: false, right: true },
6020
+ createdAt: e,
6021
+ updatedAt: e,
6022
+ isBuiltIn: true
6023
+ },
6024
+ "old-school": {
6025
+ id: "old-school",
6026
+ name: "Old School",
6027
+ description: "File tree, search, git changes, and docs on left; code viewer and markdown viewer in middle; multi terminal and city map on right (collapsed)",
6028
+ layout: {
6029
+ left: {
6030
+ type: "tabs",
6031
+ panels: ["fileTree", "search", "gitChanges", "docs"],
6032
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6033
+ },
6034
+ middle: {
6035
+ type: "tabs",
6036
+ panels: ["codeViewer", "markdownViewer"],
6037
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6038
+ },
6039
+ right: {
6040
+ type: "tabs",
6041
+ panels: ["multiTerminal", "cityVisualization"],
6042
+ config: { defaultActiveTab: 0, tabPosition: "top" }
6043
+ }
6044
+ },
6045
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6046
+ defaultCollapsed: { left: false, right: true },
6047
+ createdAt: e,
6048
+ updatedAt: e,
6049
+ isBuiltIn: true
6050
+ },
6051
+ "principal-office": {
6052
+ id: "principal-office",
6053
+ name: "Principal Office",
6054
+ description: "Alexandria docs on left, MDX editor in middle, multi terminal on right",
6055
+ layout: {
6056
+ left: "docs",
6057
+ middle: "mdxEditor",
6058
+ right: "multiTerminal"
6059
+ },
6060
+ defaultSizes: { left: 20, middle: 50, right: 30 },
6061
+ defaultCollapsed: { left: false, right: false },
6062
+ createdAt: e,
6063
+ updatedAt: e,
6064
+ isBuiltIn: true
6065
+ }
6066
+ };
6067
+ }
6068
+ /**
6069
+ * Initialize workspace layouts with built-in defaults if none exist
6070
+ */
6071
+ static async initializeWorkspaceLayouts() {
6072
+ const e = await this.adapter.loadWorkspacePresets();
6073
+ Object.keys(e).length;
6074
+ }
6075
+ }
6076
+ le(O, "adapter", new De());
6077
+ function gt(o, e, t, r2) {
6078
+ useEffect(() => {
6079
+ const s2 = e.on(
6080
+ "panel:focus",
6081
+ (l) => {
6082
+ l.payload.panelId === o && t();
6083
+ }
6084
+ );
6085
+ return () => {
6086
+ s2();
6087
+ };
6088
+ }, [o, e, t, r2]);
6089
+ }
4014
6090
  function parseTaskMarkdown(content2, filePath) {
4015
6091
  const { frontmatter, title, rawContent, acceptanceCriteria, description } = parseMarkdownContent(content2);
4016
6092
  const id = extractIdFromPath(filePath);
@@ -7812,7 +9888,7 @@ const KanbanPanel = ({
7812
9888
  const [selectedTaskId, setSelectedTaskId] = useState(null);
7813
9889
  const [selectedTab, setSelectedTab] = useState("todo");
7814
9890
  const [isNarrowView, setIsNarrowView] = useState(false);
7815
- const containerRef = useRef(null);
9891
+ const kanbanPanelRef = useRef(null);
7816
9892
  const [viewMode, setViewMode] = useState("board");
7817
9893
  const [activeTask, setActiveTask] = useState(null);
7818
9894
  const [isTaskModalOpen, setIsTaskModalOpen] = useState(false);
@@ -7837,7 +9913,7 @@ const KanbanPanel = ({
7837
9913
  }
7838
9914
  };
7839
9915
  useLayoutEffect(() => {
7840
- const container = containerRef.current;
9916
+ const container = kanbanPanelRef.current;
7841
9917
  if (!container) return;
7842
9918
  const observer = new ResizeObserver((entries) => {
7843
9919
  for (const entry of entries) {
@@ -7847,6 +9923,14 @@ const KanbanPanel = ({
7847
9923
  observer.observe(container);
7848
9924
  return () => observer.disconnect();
7849
9925
  }, []);
9926
+ gt(
9927
+ "backlog-kanban",
9928
+ events2,
9929
+ () => {
9930
+ var _a2;
9931
+ return (_a2 = kanbanPanelRef.current) == null ? void 0 : _a2.focus();
9932
+ }
9933
+ );
7850
9934
  useEffect(() => {
7851
9935
  if (!events2) return;
7852
9936
  const unsubscribe = events2.on("task:selected", (event) => {
@@ -8068,7 +10152,8 @@ const KanbanPanel = ({
8068
10152
  return /* @__PURE__ */ jsxs(
8069
10153
  "div",
8070
10154
  {
8071
- ref: containerRef,
10155
+ ref: kanbanPanelRef,
10156
+ tabIndex: -1,
8072
10157
  style: {
8073
10158
  padding: "clamp(12px, 3vw, 20px)",
8074
10159
  // Responsive padding for mobile
@@ -8082,7 +10167,9 @@ const KanbanPanel = ({
8082
10167
  overflow: "hidden",
8083
10168
  // Prevent outer scrolling
8084
10169
  backgroundColor: theme2.colors.background,
8085
- color: theme2.colors.text
10170
+ color: theme2.colors.text,
10171
+ outline: "none"
10172
+ // Remove default focus outline
8086
10173
  },
8087
10174
  children: [
8088
10175
  /* @__PURE__ */ jsxs(
@@ -45777,20 +47864,20 @@ class EditMap {
45777
47864
  this.map.length = 0;
45778
47865
  }
45779
47866
  }
45780
- function addImplementation(editMap, at, remove, add2) {
47867
+ function addImplementation(editMap, at2, remove, add2) {
45781
47868
  let index2 = 0;
45782
47869
  if (remove === 0 && add2.length === 0) {
45783
47870
  return;
45784
47871
  }
45785
47872
  while (index2 < editMap.map.length) {
45786
- if (editMap.map[index2][0] === at) {
47873
+ if (editMap.map[index2][0] === at2) {
45787
47874
  editMap.map[index2][1] += remove;
45788
47875
  editMap.map[index2][2].push(...add2);
45789
47876
  return;
45790
47877
  }
45791
47878
  index2 += 1;
45792
47879
  }
45793
- editMap.map.push([at, remove, add2]);
47880
+ editMap.map.push([at2, remove, add2]);
45794
47881
  }
45795
47882
  function gfmTableAlign(events2, index2) {
45796
47883
  let inDelimiterRow = false;
@@ -47947,7 +50034,7 @@ var css_248z = ".transform-component-module_wrapper__SPB86 {\n position: relati
47947
50034
  var styles = { "wrapper": "transform-component-module_wrapper__SPB86", "content": "transform-component-module_content__FBWxo" };
47948
50035
  styleInject(css_248z);
47949
50036
  var TransformComponent = function(_a) {
47950
- var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e = _a.contentProps, contentProps = _e === void 0 ? {} : _e;
50037
+ var children2 = _a.children, _b = _a.wrapperClass, wrapperClass = _b === void 0 ? "" : _b, _c = _a.contentClass, contentClass = _c === void 0 ? "" : _c, wrapperStyle = _a.wrapperStyle, contentStyle = _a.contentStyle, _d = _a.wrapperProps, wrapperProps = _d === void 0 ? {} : _d, _e2 = _a.contentProps, contentProps = _e2 === void 0 ? {} : _e2;
47951
50038
  var _f = useContext(Context), init = _f.init, cleanupWindowEvents = _f.cleanupWindowEvents;
47952
50039
  var wrapperRef = useRef(null);
47953
50040
  var contentRef = useRef(null);
@@ -49443,7 +51530,7 @@ var createIndustryMarkdownComponents = ({
49443
51530
  ...props
49444
51531
  }, children2),
49445
51532
  li: ({ children: children2, ...props }) => {
49446
- var _a, _b, _c, _d, _e, _f, _g, _h;
51533
+ var _a, _b, _c, _d, _e2, _f, _g, _h;
49447
51534
  const isTaskListItem = Array.isArray(children2) && children2.length > 0 && React2__default.isValidElement(children2[0]) && ((_b = (_a = children2[0]) == null ? void 0 : _a.props) == null ? void 0 : _b.type) === "checkbox";
49448
51535
  if (isTaskListItem) {
49449
51536
  const checkbox = children2[0];
@@ -49458,7 +51545,7 @@ var createIndustryMarkdownComponents = ({
49458
51545
  }
49459
51546
  });
49460
51547
  const checked = ((_c = checkbox == null ? void 0 : checkbox.props) == null ? void 0 : _c.checked) || false;
49461
- const lineNumber = ((_e = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
51548
+ const lineNumber = ((_e2 = (_d = props.sourcePosition) == null ? void 0 : _d.start) == null ? void 0 : _e2.line) || ((_h = (_g = (_f = props.node) == null ? void 0 : _f.position) == null ? void 0 : _g.start) == null ? void 0 : _h.line) || 1;
49462
51549
  const id = `${slideIdPrefix}-checkbox-${lineNumber}`;
49463
51550
  const isChecked = checkedItems[id] ?? checked;
49464
51551
  const handleChange = (e) => {
@@ -49603,7 +51690,7 @@ var createIndustryMarkdownComponents = ({
49603
51690
  });
49604
51691
  },
49605
51692
  code: ({ node: node2, className, children: children2, ...props }) => {
49606
- var _a, _b, _c, _d, _e, _f;
51693
+ var _a, _b, _c, _d, _e2, _f;
49607
51694
  const hasLanguageClass = className && (className.includes("language-") || className.includes("hljs"));
49608
51695
  const codeString = extractTextFromChildren(children2);
49609
51696
  const matchLang = /language-(\w+)/.exec(className || "");
@@ -49815,7 +51902,7 @@ var createIndustryMarkdownComponents = ({
49815
51902
  ...props
49816
51903
  }, children2)));
49817
51904
  }
49818
- const cleanClassName = (_f = (_e = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
51905
+ const cleanClassName = (_f = (_e2 = (_d = className == null ? void 0 : className.replace(/hljs(-\w+)?/g, "")) == null ? void 0 : _d.replace(/language-\w+/g, "")) == null ? void 0 : _e2.replace(/\s+/g, " ")) == null ? void 0 : _f.trim();
49819
51906
  return /* @__PURE__ */ React2__default.createElement("code", {
49820
51907
  style: {
49821
51908
  color: theme2.colors.accent,
@@ -50854,7 +52941,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
50854
52941
  }
50855
52942
  }, [slideIndex]);
50856
52943
  const sanitizeSchema = useMemo(() => {
50857
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
52944
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
50858
52945
  return {
50859
52946
  ...defaultSchema,
50860
52947
  tagNames: [...defaultSchema.tagNames || [], "picture", "source", "mark"],
@@ -50865,7 +52952,7 @@ var IndustryMarkdownSlide = React2__default.memo(function IndustryMarkdownSlide2
50865
52952
  span: [...((_b = defaultSchema.attributes) == null ? void 0 : _b.span) || [], "className", "style"],
50866
52953
  pre: [...((_c = defaultSchema.attributes) == null ? void 0 : _c.pre) || [], "className", "style"],
50867
52954
  div: [...((_d = defaultSchema.attributes) == null ? void 0 : _d.div) || [], "style", "className", "id"],
50868
- p: [...((_e = defaultSchema.attributes) == null ? void 0 : _e.p) || [], "style", "className", "id"],
52955
+ p: [...((_e2 = defaultSchema.attributes) == null ? void 0 : _e2.p) || [], "style", "className", "id"],
50869
52956
  h1: [...((_f = defaultSchema.attributes) == null ? void 0 : _f.h1) || [], "style", "className", "id"],
50870
52957
  h2: [...((_g = defaultSchema.attributes) == null ? void 0 : _g.h2) || [], "style", "className", "id"],
50871
52958
  h3: [...((_h = defaultSchema.attributes) == null ? void 0 : _h.h3) || [], "style", "className", "id"],
@@ -52680,14 +54767,14 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
52680
54767
  const y2 = o2.length, w2 = 2 * u2;
52681
54768
  let x2;
52682
54769
  x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
52683
- const C = React2__default.useId().replace(/:/g, "_");
54770
+ const C2 = React2__default.useId().replace(/:/g, "_");
52684
54771
  return jsxs(Fragment, { children: [
52685
54772
  y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
52686
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
54773
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
52687
54774
  width: 100%;
52688
54775
  }
52689
54776
  @container (min-width: ${w2}px) {
52690
- .snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
54777
+ .snap-carousel-container[data-carousel-id="${C2}"][data-panel-count="2"] .snap-carousel-panel {
52691
54778
  width: 50%;
52692
54779
  }
52693
54780
  }
@@ -52702,7 +54789,7 @@ var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minP
52702
54789
  a3 < o3 && (o3 = a3, r2 = i2);
52703
54790
  }
52704
54791
  m2(r2);
52705
- }, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
54792
+ }, "data-panel-count": y2, "data-carousel-id": C2, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
52706
54793
  ] });
52707
54794
  });
52708
54795
  M.displayName = "SnapCarousel";
@@ -52889,7 +54976,18 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52889
54976
  const { theme: theme2 } = useTheme();
52890
54977
  const [selectedTask, setSelectedTask] = useState(null);
52891
54978
  const [claudeAssignment, setClaudeAssignment] = useState({ status: "idle" });
54979
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
54980
+ const [deleteState, setDeleteState] = useState({ status: "idle" });
54981
+ const panelRef = useRef(null);
52892
54982
  const { editable = false } = config ?? {};
54983
+ gt(
54984
+ "task-detail",
54985
+ events2,
54986
+ () => {
54987
+ var _a2;
54988
+ return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
54989
+ }
54990
+ );
52893
54991
  const repoCapabilities = context.getRepositorySlice("repoCapabilities");
52894
54992
  const hasClaudeWorkflow = ((_a = repoCapabilities == null ? void 0 : repoCapabilities.data) == null ? void 0 : _a.hasClaudeWorkflow) ?? false;
52895
54993
  const handleAssignToClaude = useCallback(() => {
@@ -52918,6 +55016,19 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52918
55016
  }
52919
55017
  });
52920
55018
  }, [events2, selectedTask]);
55019
+ const handleDeleteConfirm = useCallback(() => {
55020
+ if (!events2 || !selectedTask) return;
55021
+ setDeleteState({ status: "loading" });
55022
+ events2.emit({
55023
+ type: "task:delete-requested",
55024
+ source: "task-detail-panel",
55025
+ timestamp: Date.now(),
55026
+ payload: {
55027
+ taskId: selectedTask.id,
55028
+ task: selectedTask
55029
+ }
55030
+ });
55031
+ }, [events2, selectedTask]);
52921
55032
  useEffect(() => {
52922
55033
  if (!events2) return;
52923
55034
  const handleTaskSelected = (event) => {
@@ -52960,8 +55071,46 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
52960
55071
  });
52961
55072
  };
52962
55073
  }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
55074
+ useEffect(() => {
55075
+ if (!events2) return;
55076
+ const unsubscribers = [
55077
+ events2.on("task:deleted:success", (event) => {
55078
+ const payload = event.payload;
55079
+ if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
55080
+ setDeleteState({ status: "success" });
55081
+ setIsDeleteModalOpen(false);
55082
+ setTimeout(() => {
55083
+ events2.emit({
55084
+ type: "task:deleted",
55085
+ source: "task-detail-panel",
55086
+ timestamp: Date.now(),
55087
+ payload: { taskId: payload.taskId }
55088
+ });
55089
+ setSelectedTask(null);
55090
+ setDeleteState({ status: "idle" });
55091
+ }, 2e3);
55092
+ }
55093
+ }),
55094
+ events2.on("task:deleted:error", (event) => {
55095
+ const payload = event.payload;
55096
+ if (payload.taskId === (selectedTask == null ? void 0 : selectedTask.id)) {
55097
+ setDeleteState({
55098
+ status: "error",
55099
+ error: payload.error
55100
+ });
55101
+ }
55102
+ })
55103
+ ];
55104
+ return () => {
55105
+ unsubscribers.forEach((unsub) => {
55106
+ if (typeof unsub === "function") unsub();
55107
+ });
55108
+ };
55109
+ }, [events2, selectedTask == null ? void 0 : selectedTask.id]);
52963
55110
  const handleBack = () => {
52964
55111
  setSelectedTask(null);
55112
+ setDeleteState({ status: "idle" });
55113
+ setIsDeleteModalOpen(false);
52965
55114
  if (events2) {
52966
55115
  events2.emit({
52967
55116
  type: "task:deselected",
@@ -53021,13 +55170,16 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53021
55170
  return /* @__PURE__ */ jsxs(
53022
55171
  "div",
53023
55172
  {
55173
+ ref: panelRef,
55174
+ tabIndex: -1,
53024
55175
  style: {
53025
55176
  height: "100%",
53026
55177
  display: "flex",
53027
55178
  flexDirection: "column",
53028
55179
  backgroundColor: theme2.colors.background,
53029
55180
  color: theme2.colors.text,
53030
- overflow: "hidden"
55181
+ overflow: "hidden",
55182
+ outline: "none"
53031
55183
  },
53032
55184
  children: [
53033
55185
  /* @__PURE__ */ jsxs(
@@ -53220,6 +55372,60 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53220
55372
  ]
53221
55373
  }
53222
55374
  ),
55375
+ deleteState.status === "idle" && /* @__PURE__ */ jsxs(
55376
+ "button",
55377
+ {
55378
+ onClick: () => setIsDeleteModalOpen(true),
55379
+ style: {
55380
+ display: "flex",
55381
+ alignItems: "center",
55382
+ gap: "6px",
55383
+ padding: "6px 12px",
55384
+ border: `1px solid ${theme2.colors.error}`,
55385
+ borderRadius: theme2.radii[1],
55386
+ background: "transparent",
55387
+ cursor: "pointer",
55388
+ color: theme2.colors.error,
55389
+ fontSize: theme2.fontSizes[1],
55390
+ fontWeight: theme2.fontWeights.medium,
55391
+ transition: "all 0.2s ease"
55392
+ },
55393
+ onMouseEnter: (e) => {
55394
+ e.currentTarget.style.background = theme2.colors.error;
55395
+ e.currentTarget.style.color = theme2.colors.background;
55396
+ },
55397
+ onMouseLeave: (e) => {
55398
+ e.currentTarget.style.background = "transparent";
55399
+ e.currentTarget.style.color = theme2.colors.error;
55400
+ },
55401
+ title: "Delete task",
55402
+ children: [
55403
+ /* @__PURE__ */ jsx(Trash2, { size: 14 }),
55404
+ "Delete"
55405
+ ]
55406
+ }
55407
+ ),
55408
+ deleteState.status === "success" && /* @__PURE__ */ jsxs(
55409
+ "div",
55410
+ {
55411
+ style: {
55412
+ display: "flex",
55413
+ alignItems: "center",
55414
+ gap: "6px",
55415
+ padding: "6px 12px",
55416
+ border: `1px solid ${theme2.colors.success}`,
55417
+ borderRadius: theme2.radii[1],
55418
+ background: `${theme2.colors.success}15`,
55419
+ color: theme2.colors.success,
55420
+ fontSize: theme2.fontSizes[1],
55421
+ fontWeight: theme2.fontWeights.medium
55422
+ },
55423
+ children: [
55424
+ /* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
55425
+ "Task deleted"
55426
+ ]
55427
+ }
55428
+ ),
53223
55429
  /* @__PURE__ */ jsx(
53224
55430
  "button",
53225
55431
  {
@@ -53308,6 +55514,193 @@ const TaskDetailPanel = ({ context, actions, events: events2, config }) => {
53308
55514
  }
53309
55515
  )
53310
55516
  }
55517
+ ),
55518
+ isDeleteModalOpen && createPortal(
55519
+ /* @__PURE__ */ jsxs(
55520
+ "div",
55521
+ {
55522
+ style: {
55523
+ position: "fixed",
55524
+ inset: 0,
55525
+ zIndex: 9999,
55526
+ display: "flex",
55527
+ alignItems: "center",
55528
+ justifyContent: "center",
55529
+ padding: "16px"
55530
+ },
55531
+ children: [
55532
+ /* @__PURE__ */ jsx(
55533
+ "div",
55534
+ {
55535
+ onClick: () => setIsDeleteModalOpen(false),
55536
+ style: {
55537
+ position: "absolute",
55538
+ inset: 0,
55539
+ backgroundColor: "rgba(0, 0, 0, 0.5)"
55540
+ }
55541
+ }
55542
+ ),
55543
+ /* @__PURE__ */ jsxs(
55544
+ "div",
55545
+ {
55546
+ style: {
55547
+ position: "relative",
55548
+ width: "100%",
55549
+ maxWidth: "400px",
55550
+ backgroundColor: theme2.colors.background,
55551
+ borderRadius: theme2.radii[3],
55552
+ boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
55553
+ border: `1px solid ${theme2.colors.border}`
55554
+ },
55555
+ children: [
55556
+ /* @__PURE__ */ jsxs(
55557
+ "div",
55558
+ {
55559
+ style: {
55560
+ display: "flex",
55561
+ alignItems: "center",
55562
+ justifyContent: "space-between",
55563
+ padding: "16px 20px",
55564
+ borderBottom: `1px solid ${theme2.colors.border}`
55565
+ },
55566
+ children: [
55567
+ /* @__PURE__ */ jsx(
55568
+ "h2",
55569
+ {
55570
+ style: {
55571
+ margin: 0,
55572
+ fontSize: theme2.fontSizes[4],
55573
+ fontWeight: 600,
55574
+ color: theme2.colors.text
55575
+ },
55576
+ children: "Delete Task?"
55577
+ }
55578
+ ),
55579
+ /* @__PURE__ */ jsx(
55580
+ "button",
55581
+ {
55582
+ onClick: () => setIsDeleteModalOpen(false),
55583
+ style: {
55584
+ background: "none",
55585
+ border: "none",
55586
+ cursor: "pointer",
55587
+ padding: "4px",
55588
+ display: "flex",
55589
+ alignItems: "center",
55590
+ justifyContent: "center",
55591
+ borderRadius: theme2.radii[1],
55592
+ color: theme2.colors.textMuted
55593
+ },
55594
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
55595
+ }
55596
+ )
55597
+ ]
55598
+ }
55599
+ ),
55600
+ /* @__PURE__ */ jsxs("div", { style: { padding: "20px" }, children: [
55601
+ /* @__PURE__ */ jsxs(
55602
+ "p",
55603
+ {
55604
+ style: {
55605
+ margin: 0,
55606
+ fontSize: theme2.fontSizes[2],
55607
+ color: theme2.colors.text,
55608
+ lineHeight: 1.5
55609
+ },
55610
+ children: [
55611
+ "Are you sure you want to delete ",
55612
+ /* @__PURE__ */ jsxs("strong", { children: [
55613
+ '"',
55614
+ selectedTask.title,
55615
+ '"'
55616
+ ] }),
55617
+ "? This action cannot be undone."
55618
+ ]
55619
+ }
55620
+ ),
55621
+ deleteState.status === "error" && /* @__PURE__ */ jsx(
55622
+ "div",
55623
+ {
55624
+ style: {
55625
+ marginTop: "16px",
55626
+ padding: "10px 12px",
55627
+ backgroundColor: `${theme2.colors.error}15`,
55628
+ border: `1px solid ${theme2.colors.error}`,
55629
+ borderRadius: theme2.radii[2],
55630
+ color: theme2.colors.error,
55631
+ fontSize: theme2.fontSizes[1]
55632
+ },
55633
+ children: deleteState.error || "Failed to delete task"
55634
+ }
55635
+ )
55636
+ ] }),
55637
+ /* @__PURE__ */ jsxs(
55638
+ "div",
55639
+ {
55640
+ style: {
55641
+ display: "flex",
55642
+ justifyContent: "flex-end",
55643
+ gap: "12px",
55644
+ padding: "16px 20px",
55645
+ borderTop: `1px solid ${theme2.colors.border}`
55646
+ },
55647
+ children: [
55648
+ /* @__PURE__ */ jsx(
55649
+ "button",
55650
+ {
55651
+ type: "button",
55652
+ onClick: () => setIsDeleteModalOpen(false),
55653
+ disabled: deleteState.status === "loading",
55654
+ style: {
55655
+ padding: "10px 20px",
55656
+ fontSize: theme2.fontSizes[2],
55657
+ fontWeight: 500,
55658
+ border: `1px solid ${theme2.colors.border}`,
55659
+ borderRadius: theme2.radii[2],
55660
+ backgroundColor: "transparent",
55661
+ color: theme2.colors.text,
55662
+ cursor: deleteState.status === "loading" ? "not-allowed" : "pointer",
55663
+ opacity: deleteState.status === "loading" ? 0.5 : 1
55664
+ },
55665
+ children: "Cancel"
55666
+ }
55667
+ ),
55668
+ /* @__PURE__ */ jsxs(
55669
+ "button",
55670
+ {
55671
+ type: "button",
55672
+ onClick: handleDeleteConfirm,
55673
+ disabled: deleteState.status === "loading",
55674
+ style: {
55675
+ display: "flex",
55676
+ alignItems: "center",
55677
+ gap: "8px",
55678
+ padding: "10px 20px",
55679
+ fontSize: theme2.fontSizes[2],
55680
+ fontWeight: 500,
55681
+ border: "none",
55682
+ borderRadius: theme2.radii[2],
55683
+ backgroundColor: theme2.colors.error,
55684
+ color: theme2.colors.background,
55685
+ cursor: deleteState.status === "loading" ? "wait" : "pointer",
55686
+ opacity: deleteState.status === "loading" ? 0.7 : 1
55687
+ },
55688
+ children: [
55689
+ deleteState.status === "loading" && /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
55690
+ "Delete"
55691
+ ]
55692
+ }
55693
+ )
55694
+ ]
55695
+ }
55696
+ )
55697
+ ]
55698
+ }
55699
+ )
55700
+ ]
55701
+ }
55702
+ ),
55703
+ document.body
53311
55704
  )
53312
55705
  ]
53313
55706
  }