@interopio/groups-ui-react 3.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,6 +1,9 @@
1
- import React, { useRef, useEffect as useEffect$1, useLayoutEffect as useLayoutEffect$1, useState as useState$1, useContext } from 'react';
2
- import ReactDOM from 'react-dom';
1
+ import * as React from 'react';
2
+ import React__default, { useRef, useEffect as useEffect$1, useLayoutEffect as useLayoutEffect$1, useState as useState$1, useContext, forwardRef, useCallback, createContext, useMemo, useImperativeHandle, memo, useId } from 'react';
3
+ import * as ReactDOM from 'react-dom';
4
+ import ReactDOM__default, { createPortal } from 'react-dom';
3
5
  import { IOConnectContext } from '@interopio/react-hooks';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
7
 
5
8
  /******************************************************************************
6
9
  Copyright (c) Microsoft Corporation.
@@ -56,6 +59,44 @@ function __rest(s, e) {
56
59
  return t;
57
60
  }
58
61
 
62
+ function __awaiter(thisArg, _arguments, P, generator) {
63
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
64
+ return new (P || (P = Promise))(function (resolve, reject) {
65
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
66
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
67
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
68
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
69
+ });
70
+ }
71
+
72
+ function __generator(thisArg, body) {
73
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
74
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
75
+ function verb(n) { return function (v) { return step([n, v]); }; }
76
+ function step(op) {
77
+ if (f) throw new TypeError("Generator is already executing.");
78
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
79
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
80
+ if (y = 0, t) op = [op[0] & 2, t.value];
81
+ switch (op[0]) {
82
+ case 0: case 1: t = op; break;
83
+ case 4: _.label++; return { value: op[1], done: false };
84
+ case 5: _.label++; y = op[1]; op = [0]; continue;
85
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
86
+ default:
87
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
88
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
89
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
90
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
91
+ if (t[2]) _.ops.pop();
92
+ _.trys.pop(); continue;
93
+ }
94
+ op = body.call(thisArg, _);
95
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
96
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
97
+ }
98
+ }
99
+
59
100
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
60
101
  var e = new Error(message);
61
102
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
@@ -378,14 +419,21 @@ var WebGroupsManagerDecorator = /** @class */ (function () {
378
419
  }
379
420
  window.webGroupsManager.externalLibraryFactory.openTabOverflowPopup(frameId, location);
380
421
  };
422
+ WebGroupsManagerDecorator.prototype.resizeTabOverflowPopup = function (frameId, size) {
423
+ if (typeof window.webGroupsManager.externalLibraryFactory.resizeTabOverflowPopup !== "function") {
424
+ console.warn("The method resizeTabOverflowPopup is not supported by the current version of the library");
425
+ return;
426
+ }
427
+ window.webGroupsManager.externalLibraryFactory.resizeTabOverflowPopup(frameId, size);
428
+ };
381
429
  return WebGroupsManagerDecorator;
382
430
  }());
383
431
  var webGroupsManager = new WebGroupsManagerDecorator();
384
432
 
385
433
  var BaseButton = function (_a) {
386
434
  var outerElement = _a.outerElement, innerElement = _a.innerElement;
387
- return React.createElement("li", __assign({}, outerElement, { "data-testid": "outer-element", className: webGroupsManager.skipFocusStyle + " " + outerElement.className }),
388
- React.createElement("div", __assign({}, innerElement)));
435
+ return React__default.createElement("li", __assign({}, outerElement, { "data-testid": "outer-element", className: webGroupsManager.skipFocusStyle + " " + outerElement.className }),
436
+ React__default.createElement("div", __assign({}, innerElement)));
389
437
  };
390
438
 
391
439
  function getStandardButtonInnerClassName(buttonId, target) {
@@ -408,11 +456,11 @@ function getStandardButtonOuterClassName(buttonId, target, isPressed) {
408
456
 
409
457
  var StandardButton = function (_a) {
410
458
  var buttonId = _a.buttonId, target = _a.target, isPressed = _a.isPressed, tooltip = _a.tooltip, onClick = _a.onClick;
411
- return React.createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(buttonId, target) }, outerElement: { className: getStandardButtonOuterClassName(buttonId, target, isPressed), title: tooltip, onClick: onClick } });
459
+ return React__default.createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(buttonId, target) }, outerElement: { className: getStandardButtonOuterClassName(buttonId, target, isPressed), title: tooltip, onClick: onClick } });
412
460
  };
413
461
 
414
462
  var CloseButton = function (props) {
415
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Close }, props));
463
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Close }, props));
416
464
  };
417
465
 
418
466
  /**
@@ -651,75 +699,75 @@ var BaseChannelSelector = function (_a) {
651
699
  var style = {
652
700
  background: selectedChannelColor
653
701
  };
654
- return React.createElement("div", { title: selectedChannel !== null && selectedChannel !== void 0 ? selectedChannel : "", ref: ref, style: style, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass }, channelLabel ?
655
- React.createElement("div", { className: className + " " + (direction ? "icon" : "") },
702
+ return React__default.createElement("div", { title: selectedChannel !== null && selectedChannel !== void 0 ? selectedChannel : "", ref: ref, style: style, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass }, channelLabel ?
703
+ React__default.createElement("div", { className: className + " " + (direction ? "icon" : "") },
656
704
  channelLabel,
657
- direction && React.createElement("i", { className: "icon-" + direction })) : React.createElement("div", { className: className }));
705
+ direction && React__default.createElement("i", { className: "icon-" + direction })) : React__default.createElement("div", { className: className }));
658
706
  };
659
707
 
660
708
  var FlatChannelSelector = function (_a) {
661
709
  var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
662
- return React.createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
710
+ return React__default.createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
663
711
  };
664
712
 
665
713
  var ExtractButton = function (props) {
666
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Extract }, props));
714
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Extract }, props));
667
715
  };
668
716
 
669
717
  var FeedbackButton = function (props) {
670
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Feedback }, props));
718
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Feedback }, props));
671
719
  };
672
720
 
673
721
  var CloneButton = function (props) {
674
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Clone }, props));
722
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Clone }, props));
675
723
  };
676
724
 
677
725
  var StickyButton = function (props) {
678
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Sticky }, props));
726
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Sticky }, props));
679
727
  };
680
728
 
681
729
  var LockButton = function (props) {
682
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Lock }, props));
730
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Lock }, props));
683
731
  };
684
732
 
685
733
  var MaximizeButton = function (props) {
686
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Maximize }, props));
734
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Maximize }, props));
687
735
  };
688
736
 
689
737
  var MinimizeButton = function (props) {
690
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Minimize }, props));
738
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Minimize }, props));
691
739
  };
692
740
 
693
741
  var RestoreButton = function (props) {
694
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Restore }, props));
742
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Restore }, props));
695
743
  };
696
744
 
697
745
  var UnlockButton = function (props) {
698
- return React.createElement(StandardButton, __assign({ buttonId: StandardButtons.Unlock }, props));
746
+ return React__default.createElement(StandardButton, __assign({ buttonId: StandardButtons.Unlock }, props));
699
747
  };
700
748
 
701
749
  var CustomButton = function (_a) {
702
750
  var onClick = _a.onClick, tooltip = _a.tooltip, imageData = _a.imageData;
703
- return React.createElement(BaseButton, { innerElement: { className: "t42-custom-button", style: { backgroundImage: "url(\"" + imageData + "\")" } }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button", title: tooltip, onClick: onClick } });
751
+ return React__default.createElement(BaseButton, { innerElement: { className: "t42-custom-button", style: { backgroundImage: "url(\"" + imageData + "\")" } }, outerElement: { className: "t42-button t42-caption-bar-button t42-tab-bar-button", title: tooltip, onClick: onClick } });
704
752
  };
705
753
 
706
754
  var FlatButtons = function (_a) {
707
755
  var extract = _a.extract, minimize = _a.minimize, maximize = _a.maximize, restore = _a.restore, close = _a.close, lock = _a.lock, unlock = _a.unlock, feedback = _a.feedback, clone = _a.clone, sticky = _a.sticky, customButtons = _a.customButtons;
708
- return React.createElement("div", { className: "t42-buttons-container t42-frame-caption-bar-element" },
709
- React.createElement("ul", { className: "t42-buttons t42-tab-bar-element" }, customButtons.map(function (customButton) {
710
- return customButton.visible && React.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
756
+ return React__default.createElement("div", { className: "t42-buttons-container t42-frame-caption-bar-element" },
757
+ React__default.createElement("ul", { className: "t42-buttons t42-tab-bar-element" }, customButtons.map(function (customButton) {
758
+ return customButton.visible && React__default.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
711
759
  })),
712
- React.createElement("ul", { className: "t42-buttons t42-frame-caption-bar-element" },
713
- (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React.createElement(FeedbackButton, __assign({}, feedback)),
714
- (clone === null || clone === void 0 ? void 0 : clone.visible) && React.createElement(CloneButton, __assign({}, clone)),
715
- (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React.createElement(StickyButton, __assign({}, sticky)),
716
- (extract === null || extract === void 0 ? void 0 : extract.visible) && React.createElement(ExtractButton, __assign({}, extract)),
717
- (lock === null || lock === void 0 ? void 0 : lock.visible) && React.createElement(LockButton, __assign({}, lock)),
718
- (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React.createElement(UnlockButton, __assign({}, unlock)),
719
- (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React.createElement(MinimizeButton, __assign({}, minimize)),
720
- (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React.createElement(MaximizeButton, __assign({}, maximize)),
721
- (restore === null || restore === void 0 ? void 0 : restore.visible) && React.createElement(RestoreButton, __assign({}, restore)),
722
- (close === null || close === void 0 ? void 0 : close.visible) && React.createElement(CloseButton, __assign({}, close))));
760
+ React__default.createElement("ul", { className: "t42-buttons t42-frame-caption-bar-element" },
761
+ (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React__default.createElement(FeedbackButton, __assign({}, feedback)),
762
+ (clone === null || clone === void 0 ? void 0 : clone.visible) && React__default.createElement(CloneButton, __assign({}, clone)),
763
+ (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React__default.createElement(StickyButton, __assign({}, sticky)),
764
+ (extract === null || extract === void 0 ? void 0 : extract.visible) && React__default.createElement(ExtractButton, __assign({}, extract)),
765
+ (lock === null || lock === void 0 ? void 0 : lock.visible) && React__default.createElement(LockButton, __assign({}, lock)),
766
+ (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React__default.createElement(UnlockButton, __assign({}, unlock)),
767
+ (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React__default.createElement(MinimizeButton, __assign({}, minimize)),
768
+ (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React__default.createElement(MaximizeButton, __assign({}, maximize)),
769
+ (restore === null || restore === void 0 ? void 0 : restore.visible) && React__default.createElement(RestoreButton, __assign({}, restore)),
770
+ (close === null || close === void 0 ? void 0 : close.visible) && React__default.createElement(CloseButton, __assign({}, close))));
723
771
  };
724
772
 
725
773
  var waitForWindow = function (io, windowId) {
@@ -1634,7 +1682,7 @@ var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
1634
1682
  * ResizeObserver API. Encapsulates the ResizeObserver SPI implementation
1635
1683
  * exposing only those methods and properties that are defined in the spec.
1636
1684
  */
1637
- var ResizeObserver = /** @class */ (function () {
1685
+ var ResizeObserver$1 = /** @class */ (function () {
1638
1686
  /**
1639
1687
  * Creates a new instance of ResizeObserver.
1640
1688
  *
@@ -1660,7 +1708,7 @@ var ResizeObserver = /** @class */ (function () {
1660
1708
  'unobserve',
1661
1709
  'disconnect'
1662
1710
  ].forEach(function (method) {
1663
- ResizeObserver.prototype[method] = function () {
1711
+ ResizeObserver$1.prototype[method] = function () {
1664
1712
  var _a;
1665
1713
  return (_a = observers.get(this))[method].apply(_a, arguments);
1666
1714
  };
@@ -1671,7 +1719,7 @@ var index = (function () {
1671
1719
  if (typeof global$1.ResizeObserver !== 'undefined') {
1672
1720
  return global$1.ResizeObserver;
1673
1721
  }
1674
- return ResizeObserver;
1722
+ return ResizeObserver$1;
1675
1723
  })();
1676
1724
 
1677
1725
  function useEditableCaption(ref, options) {
@@ -1763,7 +1811,7 @@ var FlatCaption = function (_a) {
1763
1811
  showCaptionEditor(caption);
1764
1812
  e.stopPropagation();
1765
1813
  };
1766
- return (React.createElement("div", { ref: ref, className: "t42-caption t42-title t42-frame-caption-bar-element", onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick }, caption));
1814
+ return (React__default.createElement("div", { ref: ref, className: "t42-caption t42-title t42-frame-caption-bar-element", onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick }, caption));
1767
1815
  };
1768
1816
 
1769
1817
  function useCaptionEditor(ref, options) {
@@ -1853,20 +1901,20 @@ var CaptionEditor = function (_a) {
1853
1901
  }
1854
1902
  setInputWidth(measurementRef.current.scrollWidth);
1855
1903
  }, [measurementRef, captionInEditor]);
1856
- return React.createElement(React.Fragment, null,
1857
- React.createElement("input", { ref: ref, style: {
1904
+ return React__default.createElement(React__default.Fragment, null,
1905
+ React__default.createElement("input", { ref: ref, style: {
1858
1906
  width: inputWidth + "px"
1859
1907
  }, onKeyDown: onKeyDown, onKeyUp: onKeyUp, onChange: onChange, onBlur: onBlur, value: captionInEditor, className: className }),
1860
- React.createElement("span", { ref: measurementRef, style: { visibility: "hidden", position: "absolute", top: -30000, left: -30000 } }, captionInEditor));
1908
+ React__default.createElement("span", { ref: measurementRef, style: { visibility: "hidden", position: "absolute", top: -30000, left: -30000 } }, captionInEditor));
1861
1909
  };
1862
1910
 
1863
1911
  var FlatCaptionEditor = function (props) {
1864
- return React.createElement(CaptionEditor, __assign({}, props, { targetId: props.frameId, targetType: TargetType.Frame, className: "t42-caption-editor t42-frame-caption-bar-element" }));
1912
+ return React__default.createElement(CaptionEditor, __assign({}, props, { targetId: props.frameId, targetType: TargetType.Frame, className: "t42-caption-editor t42-frame-caption-bar-element" }));
1865
1913
  };
1866
1914
 
1867
1915
  var FlatMoveArea = function (_a) {
1868
1916
  var children = _a.children, moveAreaId = _a.moveAreaId;
1869
- return React.createElement("div", { id: moveAreaId, className: "t42-move-area t42-frame-caption-bar-element" }, children);
1917
+ return React__default.createElement("div", { id: moveAreaId, className: "t42-move-area t42-frame-caption-bar-element" }, children);
1870
1918
  };
1871
1919
 
1872
1920
  var BaseMultiChannelSelector = function (_a) {
@@ -1902,7 +1950,7 @@ var BaseMultiChannelSelector = function (_a) {
1902
1950
  };
1903
1951
  }, [ref, showBaseChannelSelector]);
1904
1952
  if (showBaseChannelSelector) {
1905
- return React.createElement(BaseChannelSelector, { showSelector: showSelector, selectedChannel: (_b = selectedChannels[0]) === null || _b === void 0 ? void 0 : _b.name, selectedChannelColor: (_c = selectedChannels[0]) === null || _c === void 0 ? void 0 : _c.color, outsideClass: outsideClass, contentClass: contentClass, channelLabel: channelLabel, direction: getChannelDirection(channelRestrictions) });
1953
+ return React__default.createElement(BaseChannelSelector, { showSelector: showSelector, selectedChannel: (_b = selectedChannels[0]) === null || _b === void 0 ? void 0 : _b.name, selectedChannelColor: (_c = selectedChannels[0]) === null || _c === void 0 ? void 0 : _c.color, outsideClass: outsideClass, contentClass: contentClass, channelLabel: channelLabel, direction: getChannelDirection(channelRestrictions) });
1906
1954
  }
1907
1955
  var colors = (_d = selectedChannels.map(function (channel) { return channel.color; })) !== null && _d !== void 0 ? _d : [];
1908
1956
  var title = colors.join(", ");
@@ -1913,37 +1961,37 @@ var BaseMultiChannelSelector = function (_a) {
1913
1961
  var colorVarName = "--t42-multi-channel-selector-" + lenMax4 + "-color-" + (index + 1);
1914
1962
  style[colorVarName] = color;
1915
1963
  });
1916
- return (React.createElement("div", { id: "basem", title: title, ref: ref, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass },
1917
- React.createElement("div", { className: cssClass, style: style })));
1964
+ return (React__default.createElement("div", { id: "basem", title: title, ref: ref, onClick: wrappedOnClick, className: "t42-buttons " + outsideClass },
1965
+ React__default.createElement("div", { className: cssClass, style: style })));
1918
1966
  };
1919
1967
 
1920
1968
  var FlatMultiChannelSelector = function (_a) {
1921
1969
  var showSelector = _a.showSelector, selectedChannels = _a.selectedChannels, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
1922
- return React.createElement(BaseMultiChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannels: selectedChannels, channelRestrictions: channelRestrictions, channelLabel: channelLabel });
1970
+ return React__default.createElement(BaseMultiChannelSelector, { outsideClass: channelLabel ? "t42-frame-caption-bar-element t42-frame-channel-selector t42-channel-selector-direction" : "t42-frame-caption-bar-element t42-frame-channel-selector", contentClass: !channelLabel ? "t42-frame-channel-selector-content" : "", showSelector: showSelector, selectedChannels: selectedChannels, channelRestrictions: channelRestrictions, channelLabel: channelLabel });
1923
1971
  };
1924
1972
 
1925
1973
  var FlatCaptionBar = function (_a) {
1926
1974
  var moveAreaId = _a.moveAreaId, caption = _a.caption, showCaptionEditor = _a.showCaptionEditor, channels = _a.channels, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "caption", "showCaptionEditor", "channels", "captionEditor", "notifyCaptionBoundsChanged"]);
1927
- return (React.createElement("div", { className: "t42-react-caption-bar" },
1928
- (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode !== "multi" && React.createElement(FlatChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannel: channels === null || channels === void 0 ? void 0 : channels.selectedChannel, selectedChannelColor: channels === null || channels === void 0 ? void 0 : channels.selectedChannelColor, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1929
- (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode === "multi" && React.createElement(FlatMultiChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannels: channels === null || channels === void 0 ? void 0 : channels.selectedChannels, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1930
- React.createElement(FlatMoveArea, { moveAreaId: moveAreaId }, captionEditor.show ? React.createElement(FlatCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, frameId: rest.frameId })) : React.createElement(FlatCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
1931
- React.createElement(FlatButtons, __assign({}, rest))));
1975
+ return (React__default.createElement("div", { className: "t42-react-caption-bar" },
1976
+ (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode !== "multi" && React__default.createElement(FlatChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannel: channels === null || channels === void 0 ? void 0 : channels.selectedChannel, selectedChannelColor: channels === null || channels === void 0 ? void 0 : channels.selectedChannelColor, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1977
+ (channels === null || channels === void 0 ? void 0 : channels.visible) && channels.channelsMode === "multi" && React__default.createElement(FlatMultiChannelSelector, { showSelector: channels === null || channels === void 0 ? void 0 : channels.showSelector, selectedChannels: channels === null || channels === void 0 ? void 0 : channels.selectedChannels, channelRestrictions: channels === null || channels === void 0 ? void 0 : channels.channelRestrictions, channelLabel: channels === null || channels === void 0 ? void 0 : channels.channelLabel }),
1978
+ React__default.createElement(FlatMoveArea, { moveAreaId: moveAreaId }, captionEditor.show ? React__default.createElement(FlatCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, frameId: rest.frameId })) : React__default.createElement(FlatCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
1979
+ React__default.createElement(FlatButtons, __assign({}, rest))));
1932
1980
  };
1933
1981
 
1934
1982
  var GroupMoveArea = function (_a) {
1935
1983
  var children = _a.children, moveAreaId = _a.moveAreaId;
1936
- return React.createElement("div", { id: moveAreaId, className: "t42-move-area t42-group-caption-bar-element" }, children);
1984
+ return React__default.createElement("div", { id: moveAreaId, className: "t42-move-area t42-group-caption-bar-element" }, children);
1937
1985
  };
1938
1986
 
1939
1987
  var GroupButtons = function (_a) {
1940
1988
  var minimize = _a.minimize, restore = _a.restore, maximize = _a.maximize, close = _a.close;
1941
- return React.createElement("div", { className: "t42-buttons-container t42-group-caption-bar-element" },
1942
- React.createElement("ul", { className: "t42-buttons t42-group-caption-bar-element" },
1943
- (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React.createElement(MinimizeButton, __assign({}, minimize)),
1944
- (restore === null || restore === void 0 ? void 0 : restore.visible) && React.createElement(RestoreButton, __assign({}, restore)),
1945
- (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React.createElement(MaximizeButton, __assign({}, maximize)),
1946
- (close === null || close === void 0 ? void 0 : close.visible) && React.createElement(CloseButton, __assign({}, close))));
1989
+ return React__default.createElement("div", { className: "t42-buttons-container t42-group-caption-bar-element" },
1990
+ React__default.createElement("ul", { className: "t42-buttons t42-group-caption-bar-element" },
1991
+ (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React__default.createElement(MinimizeButton, __assign({}, minimize)),
1992
+ (restore === null || restore === void 0 ? void 0 : restore.visible) && React__default.createElement(RestoreButton, __assign({}, restore)),
1993
+ (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React__default.createElement(MaximizeButton, __assign({}, maximize)),
1994
+ (close === null || close === void 0 ? void 0 : close.visible) && React__default.createElement(CloseButton, __assign({}, close))));
1947
1995
  };
1948
1996
 
1949
1997
  var GroupCaption = function (_a) {
@@ -1960,30 +2008,30 @@ var GroupCaption = function (_a) {
1960
2008
  showCaptionEditor(caption);
1961
2009
  e.stopPropagation();
1962
2010
  };
1963
- return (React.createElement("div", { ref: ref, onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick, className: "t42-caption t42-title t42-group-caption-bar-element" }, caption));
2011
+ return (React__default.createElement("div", { ref: ref, onMouseDown: handleMouseDown, onDoubleClick: handleDoubleClick, className: "t42-caption t42-title t42-group-caption-bar-element" }, caption));
1964
2012
  };
1965
2013
 
1966
2014
  var GroupCaptionEditor = function (props) {
1967
- return React.createElement(CaptionEditor, __assign({}, props, { targetId: props.groupId, targetType: TargetType.Group, className: "t42-caption-editor t42-group-caption-bar-element" }));
2015
+ return React__default.createElement(CaptionEditor, __assign({}, props, { targetId: props.groupId, targetType: TargetType.Group, className: "t42-caption-editor t42-group-caption-bar-element" }));
1968
2016
  };
1969
2017
 
1970
2018
  var GroupCaptionBar = function (_a) {
1971
2019
  var moveAreaId = _a.moveAreaId, showCaptionEditor = _a.showCaptionEditor; _a.targetType; var targetId = _a.targetId, caption = _a.caption, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, rest = __rest(_a, ["moveAreaId", "showCaptionEditor", "targetType", "targetId", "caption", "captionEditor", "notifyCaptionBoundsChanged"]);
1972
- return React.createElement("div", { className: "t42-react-caption-bar" },
1973
- React.createElement(GroupMoveArea, { moveAreaId: moveAreaId }, (captionEditor === null || captionEditor === void 0 ? void 0 : captionEditor.show) ?
1974
- React.createElement(GroupCaptionEditor, __assign({}, captionEditor, { groupId: targetId, caption: captionEditor.text })) :
1975
- React.createElement(GroupCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
1976
- React.createElement(GroupButtons, __assign({}, rest)));
2020
+ return React__default.createElement("div", { className: "t42-react-caption-bar" },
2021
+ React__default.createElement(GroupMoveArea, { moveAreaId: moveAreaId }, (captionEditor === null || captionEditor === void 0 ? void 0 : captionEditor.show) ?
2022
+ React__default.createElement(GroupCaptionEditor, __assign({}, captionEditor, { groupId: targetId, caption: captionEditor.text })) :
2023
+ React__default.createElement(GroupCaption, { showCaptionEditor: showCaptionEditor, notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption })),
2024
+ React__default.createElement(GroupButtons, __assign({}, rest)));
1977
2025
  };
1978
2026
 
1979
2027
  var TabChannelSelector = function (_a) {
1980
2028
  var showSelector = _a.showSelector, selectedChannel = _a.selectedChannel, selectedChannelColor = _a.selectedChannelColor, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
1981
- return React.createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-tab-bar-element t42-tab-channel-selector t42-channel-selector-direction" : "t42-tab-bar-element t42-tab-channel-selector", contentClass: !channelLabel ? "t42-tab-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
2029
+ return React__default.createElement(BaseChannelSelector, { outsideClass: channelLabel ? "t42-tab-bar-element t42-tab-channel-selector t42-channel-selector-direction" : "t42-tab-bar-element t42-tab-channel-selector", contentClass: !channelLabel ? "t42-tab-channel-selector-content" : "", showSelector: showSelector, selectedChannel: selectedChannel, selectedChannelColor: selectedChannelColor, direction: getChannelDirection(channelRestrictions), channelLabel: channelLabel });
1982
2030
  };
1983
2031
 
1984
2032
  var TabMultiChannelSelector = function (_a) {
1985
2033
  var showSelector = _a.showSelector, selectedChannels = _a.selectedChannels, channelRestrictions = _a.channelRestrictions, channelLabel = _a.channelLabel;
1986
- return React.createElement(BaseMultiChannelSelector, { outsideClass: channelLabel ? "t42-tab-bar-element t42-tab-channel-selector t42-channel-selector-direction" : "t42-tab-bar-element t42-tab-channel-selector", contentClass: !channelLabel ? "t42-tab-channel-selector-content" : "", showSelector: showSelector, selectedChannels: selectedChannels, channelRestrictions: channelRestrictions, channelLabel: channelLabel });
2034
+ return React__default.createElement(BaseMultiChannelSelector, { outsideClass: channelLabel ? "t42-tab-bar-element t42-tab-channel-selector t42-channel-selector-direction" : "t42-tab-bar-element t42-tab-channel-selector", contentClass: !channelLabel ? "t42-tab-channel-selector-content" : "", showSelector: showSelector, selectedChannels: selectedChannels, channelRestrictions: channelRestrictions, channelLabel: channelLabel });
1987
2035
  };
1988
2036
 
1989
2037
  var TabCaption = function (_a) {
@@ -1992,13 +2040,13 @@ var TabCaption = function (_a) {
1992
2040
  var selectedClassName = "t42-caption t42-tab-caption t42-selected-tab-caption";
1993
2041
  var ref = useRef(null);
1994
2042
  useEditableCaption(ref, { notifyBoundsChanged: notifyBoundsChanged });
1995
- return React.createElement("div", { ref: ref, className: selected ? selectedClassName : normalClassName }, caption);
2043
+ return React__default.createElement("div", { ref: ref, className: selected ? selectedClassName : normalClassName }, caption);
1996
2044
  };
1997
2045
 
1998
2046
  var TabCaptionEditor = function (props) {
1999
2047
  var normalClassName = "t42-caption-editor t42-tab-caption-editor t42-caption t42-tab-caption";
2000
2048
  var selectedClassName = "t42-caption-editor t42-tab-caption-editor t42-caption t42-tab-caption t42-selected-tab-caption t42-selected-tab-element";
2001
- return React.createElement(CaptionEditor, __assign({}, props, { targetType: TargetType.Tab, targetId: props.windowId, className: props.selected ? selectedClassName : normalClassName }));
2049
+ return React__default.createElement(CaptionEditor, __assign({}, props, { targetType: TargetType.Tab, targetId: props.windowId, className: props.selected ? selectedClassName : normalClassName }));
2002
2050
  };
2003
2051
 
2004
2052
  var TabCloseButton = function (_a) {
@@ -2014,24 +2062,24 @@ var TabCloseButton = function (_a) {
2014
2062
  e.stopPropagation();
2015
2063
  });
2016
2064
  }, [ref]);
2017
- return React.createElement("div", { ref: ref, onClick: close, className: selected ? selectedClassName : normalClassName, title: "close" },
2018
- React.createElement("div", { className: selected ? selectedContentClassName : normalContentClassName }));
2065
+ return React__default.createElement("div", { ref: ref, onClick: close, className: selected ? selectedClassName : normalClassName, title: "close" },
2066
+ React__default.createElement("div", { className: selected ? selectedContentClassName : normalContentClassName }));
2019
2067
  };
2020
2068
 
2021
2069
  var Tab = function (_a) {
2022
2070
  var caption = _a.caption, selected = _a.selected, close = _a.close, channels = _a.channels, captionEditor = _a.captionEditor, notifyCaptionBoundsChanged = _a.notifyCaptionBoundsChanged, windowId = _a.windowId, pinned = _a.pinned;
2023
- return React.createElement("div", { className: "t42-react-tab" },
2024
- channels.visible && channels.channelsMode !== "multi" && React.createElement(TabChannelSelector, __assign({}, channels)),
2025
- channels.visible && channels.channelsMode === "multi" && React.createElement(TabMultiChannelSelector, __assign({}, channels)),
2071
+ return React__default.createElement("div", { className: "t42-react-tab" },
2072
+ channels.visible && channels.channelsMode !== "multi" && React__default.createElement(TabChannelSelector, __assign({}, channels)),
2073
+ channels.visible && channels.channelsMode === "multi" && React__default.createElement(TabMultiChannelSelector, __assign({}, channels)),
2026
2074
  captionEditor.show ?
2027
- React.createElement(TabCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, selected: selected, windowId: windowId })) :
2028
- React.createElement(TabCaption, { notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption, selected: selected }),
2029
- pinned ? React.createElement(React.Fragment, null) : React.createElement(TabCloseButton, { selected: selected, close: close }));
2075
+ React__default.createElement(TabCaptionEditor, __assign({}, captionEditor, { caption: captionEditor.text, selected: selected, windowId: windowId })) :
2076
+ React__default.createElement(TabCaption, { notifyBoundsChanged: notifyCaptionBoundsChanged, caption: caption, selected: selected }),
2077
+ pinned ? React__default.createElement(React__default.Fragment, null) : React__default.createElement(TabCloseButton, { selected: selected, close: close }));
2030
2078
  };
2031
2079
 
2032
2080
  var OverflowButton = function (_a) {
2033
2081
  var onClick = _a.onClick, tooltip = _a.tooltip;
2034
- return React.createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(StandardButtons.Overflow) }, outerElement: {
2082
+ return React__default.createElement(BaseButton, { innerElement: { className: getStandardButtonInnerClassName(StandardButtons.Overflow) }, outerElement: {
2035
2083
  onMouseDown: function (e) { return e.stopPropagation(); },
2036
2084
  onPointerDown: function (e) { return e.stopPropagation(); },
2037
2085
  className: getStandardButtonOuterClassName(StandardButtons.Overflow), title: tooltip,
@@ -2041,22 +2089,22 @@ var OverflowButton = function (_a) {
2041
2089
 
2042
2090
  var TabHeaderButtons = function (_a) {
2043
2091
  var overflow = _a.overflow, extract = _a.extract, minimize = _a.minimize, maximize = _a.maximize, restore = _a.restore, close = _a.close, lock = _a.lock, unlock = _a.unlock, feedback = _a.feedback, clone = _a.clone, sticky = _a.sticky, customButtons = _a.customButtons;
2044
- return React.createElement("div", { className: "t42-buttons-container t42-tab-bar-element" },
2045
- React.createElement("ul", { className: "t42-buttons t42-tab-bar-element" }, customButtons.map(function (customButton) {
2046
- return customButton.visible && React.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
2092
+ return React__default.createElement("div", { className: "t42-buttons-container t42-tab-bar-element" },
2093
+ React__default.createElement("ul", { className: "t42-buttons t42-tab-bar-element" }, customButtons.map(function (customButton) {
2094
+ return customButton.visible && React__default.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
2047
2095
  })),
2048
- React.createElement("ul", { className: "t42-buttons t42-tab-bar-element" },
2049
- (overflow === null || overflow === void 0 ? void 0 : overflow.visible) && React.createElement(OverflowButton, __assign({}, overflow)),
2050
- (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React.createElement(FeedbackButton, __assign({}, feedback)),
2051
- (clone === null || clone === void 0 ? void 0 : clone.visible) && React.createElement(CloneButton, __assign({}, clone)),
2052
- (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React.createElement(StickyButton, __assign({}, sticky)),
2053
- (extract === null || extract === void 0 ? void 0 : extract.visible) && React.createElement(ExtractButton, __assign({}, extract)),
2054
- (lock === null || lock === void 0 ? void 0 : lock.visible) && React.createElement(LockButton, __assign({}, lock)),
2055
- (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React.createElement(UnlockButton, __assign({}, unlock)),
2056
- (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React.createElement(MinimizeButton, __assign({}, minimize)),
2057
- (restore === null || restore === void 0 ? void 0 : restore.visible) && React.createElement(RestoreButton, __assign({}, restore)),
2058
- (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React.createElement(MaximizeButton, __assign({}, maximize)),
2059
- (close === null || close === void 0 ? void 0 : close.visible) && React.createElement(CloseButton, __assign({}, close))));
2096
+ React__default.createElement("ul", { className: "t42-buttons t42-tab-bar-element" },
2097
+ (overflow === null || overflow === void 0 ? void 0 : overflow.visible) && React__default.createElement(OverflowButton, __assign({}, overflow)),
2098
+ (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React__default.createElement(FeedbackButton, __assign({}, feedback)),
2099
+ (clone === null || clone === void 0 ? void 0 : clone.visible) && React__default.createElement(CloneButton, __assign({}, clone)),
2100
+ (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React__default.createElement(StickyButton, __assign({}, sticky)),
2101
+ (extract === null || extract === void 0 ? void 0 : extract.visible) && React__default.createElement(ExtractButton, __assign({}, extract)),
2102
+ (lock === null || lock === void 0 ? void 0 : lock.visible) && React__default.createElement(LockButton, __assign({}, lock)),
2103
+ (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React__default.createElement(UnlockButton, __assign({}, unlock)),
2104
+ (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React__default.createElement(MinimizeButton, __assign({}, minimize)),
2105
+ (restore === null || restore === void 0 ? void 0 : restore.visible) && React__default.createElement(RestoreButton, __assign({}, restore)),
2106
+ (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React__default.createElement(MaximizeButton, __assign({}, maximize)),
2107
+ (close === null || close === void 0 ? void 0 : close.visible) && React__default.createElement(CloseButton, __assign({}, close))));
2060
2108
  };
2061
2109
 
2062
2110
  function createCommonjsModule(fn, basedir, module) {
@@ -2073,14 +2121,14 @@ function commonjsRequire () {
2073
2121
  throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
2074
2122
  }
2075
2123
 
2076
- function is(x, y) {
2124
+ function is$1(x, y) {
2077
2125
  return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
2078
2126
  }
2079
- var objectIs = "function" === typeof Object.is ? Object.is : is,
2080
- useState = React.useState,
2081
- useEffect = React.useEffect,
2082
- useLayoutEffect = React.useLayoutEffect,
2083
- useDebugValue = React.useDebugValue;
2127
+ var objectIs = "function" === typeof Object.is ? Object.is : is$1,
2128
+ useState = React__default.useState,
2129
+ useEffect = React__default.useEffect,
2130
+ useLayoutEffect = React__default.useLayoutEffect,
2131
+ useDebugValue = React__default.useDebugValue;
2084
2132
  function useSyncExternalStore$2(subscribe, getSnapshot) {
2085
2133
  var value = getSnapshot(),
2086
2134
  _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
@@ -2126,7 +2174,7 @@ var shim$1 =
2126
2174
  ? useSyncExternalStore$1
2127
2175
  : useSyncExternalStore$2;
2128
2176
  var useSyncExternalStore =
2129
- void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim$1;
2177
+ void 0 !== React__default.useSyncExternalStore ? React__default.useSyncExternalStore : shim$1;
2130
2178
 
2131
2179
  var useSyncExternalStoreShim_production = {
2132
2180
  useSyncExternalStore: useSyncExternalStore
@@ -2140,7 +2188,7 @@ var useSyncExternalStoreShim_development = createCommonjsModule(function (module
2140
2188
  }
2141
2189
  function useSyncExternalStore$2(subscribe, getSnapshot) {
2142
2190
  didWarnOld18Alpha ||
2143
- void 0 === React$1.startTransition ||
2191
+ void 0 === React.startTransition ||
2144
2192
  ((didWarnOld18Alpha = !0),
2145
2193
  console.error(
2146
2194
  "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
@@ -2196,12 +2244,12 @@ var useSyncExternalStoreShim_development = createCommonjsModule(function (module
2196
2244
  "function" ===
2197
2245
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
2198
2246
  __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
2199
- var React$1 = React,
2247
+ var React = React__default,
2200
2248
  objectIs = "function" === typeof Object.is ? Object.is : is,
2201
- useState = React$1.useState,
2202
- useEffect = React$1.useEffect,
2203
- useLayoutEffect = React$1.useLayoutEffect,
2204
- useDebugValue = React$1.useDebugValue,
2249
+ useState = React.useState,
2250
+ useEffect = React.useEffect,
2251
+ useLayoutEffect = React.useLayoutEffect,
2252
+ useDebugValue = React.useDebugValue,
2205
2253
  didWarnOld18Alpha = !1,
2206
2254
  didWarnUncachedGetSnapshot = !1,
2207
2255
  shim =
@@ -2211,7 +2259,7 @@ var useSyncExternalStoreShim_development = createCommonjsModule(function (module
2211
2259
  ? useSyncExternalStore$1
2212
2260
  : useSyncExternalStore$2;
2213
2261
  exports.useSyncExternalStore =
2214
- void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
2262
+ void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim;
2215
2263
  "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2216
2264
  "function" ===
2217
2265
  typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -2305,11 +2353,11 @@ var GroupWrapper = /** @class */ (function (_super) {
2305
2353
  };
2306
2354
  GroupWrapper.prototype.render = function () {
2307
2355
  var _this = this;
2308
- return (React.createElement("div", { id: "t42-group-container", ref: function (r) { return _this.containerRef = r; } },
2309
- React.createElement("div", { id: "t42-frames-container" })));
2356
+ return (React__default.createElement("div", { id: "t42-group-container", ref: function (r) { return _this.containerRef = r; } },
2357
+ React__default.createElement("div", { id: "t42-frames-container" })));
2310
2358
  };
2311
2359
  return GroupWrapper;
2312
- }(React.Component));
2360
+ }(React__default.Component));
2313
2361
 
2314
2362
  var Portal = /** @class */ (function (_super) {
2315
2363
  __extends(Portal, _super);
@@ -2317,10 +2365,10 @@ var Portal = /** @class */ (function (_super) {
2317
2365
  return _super !== null && _super.apply(this, arguments) || this;
2318
2366
  }
2319
2367
  Portal.prototype.render = function () {
2320
- return ReactDOM.createPortal(this.props.children, this.props.parentElement);
2368
+ return ReactDOM__default.createPortal(this.props.children, this.props.parentElement);
2321
2369
  };
2322
2370
  return Portal;
2323
- }(React.Component));
2371
+ }(React__default.Component));
2324
2372
 
2325
2373
  var WebGroupsStore = /** @class */ (function () {
2326
2374
  function WebGroupsStore() {
@@ -2370,144 +2418,49 @@ var WebGroupsStore = /** @class */ (function () {
2370
2418
  });
2371
2419
  };
2372
2420
  this.onCreateFrameCaptionBarRequested = function (options) {
2373
- if (options === _this.state.frameCaptionBars[options.targetId] || !options) {
2374
- return;
2375
- }
2376
- _this.setState(function (s) {
2377
- var _a;
2378
- return __assign(__assign({}, s), { frameCaptionBars: __assign(__assign({}, s.frameCaptionBars), (_a = {}, _a[options.targetId] = options, _a)) });
2379
- });
2421
+ _this.onCreateElementRequested("frameCaptionBars", options);
2380
2422
  };
2381
2423
  this.onCreateFrameWindowOverlayRequested = function (options) {
2382
- if (options === _this.state.frameWindowOverlays[options.targetId] || !options) {
2383
- return;
2384
- }
2385
- _this.setState(function (s) {
2386
- var _a;
2387
- return __assign(__assign({}, s), { frameWindowOverlays: __assign(__assign({}, s.frameWindowOverlays), (_a = {}, _a[options.targetId] = options, _a)) });
2388
- });
2424
+ _this.onCreateElementRequested("frameWindowOverlays", options);
2389
2425
  };
2390
2426
  this.onCreateAboveWindowRequested = function (options) {
2391
- if (options === _this.state.aboveWindowZones[options.targetId] || !options) {
2392
- return;
2393
- }
2394
- _this.setState(function (s) {
2395
- var _a;
2396
- return __assign(__assign({}, s), { aboveWindowZones: __assign(__assign({}, s.aboveWindowZones), (_a = {}, _a[options.targetId] = options, _a)) });
2397
- });
2427
+ _this.onCreateElementRequested("aboveWindowZones", options);
2398
2428
  };
2399
2429
  this.onCreateWindowContentOverlayRequested = function (options) {
2400
- if (options === _this.state.windowContentOverlays[options.targetId] || !options) {
2401
- return;
2402
- }
2403
- _this.setState(function (s) {
2404
- var _a;
2405
- return __assign(__assign({}, s), { windowContentOverlays: __assign(__assign({}, s.windowContentOverlays), (_a = {}, _a[options.targetId] = options, _a)) });
2406
- });
2430
+ _this.onCreateElementRequested("windowContentOverlays", options);
2407
2431
  };
2408
2432
  this.onCreateFrameLoadingAnimationRequested = function (options) {
2409
- if (options === _this.state.frameLoadingAnimations[options.targetId] || !options) {
2410
- return;
2411
- }
2412
- _this.setState(function (s) {
2413
- var _a;
2414
- return __assign(__assign({}, s), { frameLoadingAnimations: __assign(__assign({}, s.frameLoadingAnimations), (_a = {}, _a[options.targetId] = options, _a)) });
2415
- });
2433
+ _this.onCreateElementRequested("frameLoadingAnimations", options);
2416
2434
  };
2417
2435
  this.onCreateBelowWindowRequested = function (options) {
2418
- if (options === _this.state.belowWindowZones[options.targetId] || !options) {
2419
- return;
2420
- }
2421
- _this.setState(function (s) {
2422
- var _a;
2423
- return __assign(__assign({}, s), { belowWindowZones: __assign(__assign({}, s.belowWindowZones), (_a = {}, _a[options.targetId] = options, _a)) });
2424
- });
2436
+ _this.onCreateElementRequested("belowWindowZones", options);
2425
2437
  };
2426
2438
  this.onCreateAboveTabsComponentRequested = function (options) {
2427
- if (options === _this.state.aboveTabsZones[options.targetId] || !options) {
2428
- return;
2429
- }
2430
- _this.setState(function (s) {
2431
- var _a;
2432
- return __assign(__assign({}, s), { aboveTabsZones: __assign(__assign({}, s.aboveTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2433
- });
2439
+ _this.onCreateElementRequested("aboveTabsZones", options);
2434
2440
  };
2435
2441
  this.onCreateBeforeTabsComponentRequested = function (options) {
2436
- if (options === _this.state.beforeTabsZones[options.targetId] || !options) {
2437
- return;
2438
- }
2439
- _this.setState(function (s) {
2440
- var _a;
2441
- return __assign(__assign({}, s), { beforeTabsZones: __assign(__assign({}, s.beforeTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2442
- });
2442
+ _this.onCreateElementRequested("beforeTabsZones", options);
2443
2443
  };
2444
2444
  this.onCreateTabElementRequested = function (options) {
2445
- if (options === _this.state.tabElements[options.targetId] || !options) {
2446
- return;
2447
- }
2448
- _this.setState(function (s) {
2449
- var _a;
2450
- var newTabElementsObj = Object.keys(s.tabElements).reduce(function (acc, targetId) {
2451
- acc[targetId] = s.tabElements[targetId];
2452
- return acc;
2453
- }, {});
2454
- newTabElementsObj[options.targetId] = options;
2455
- return __assign(__assign({}, s), { tabElements: __assign(__assign({}, s.tabElements), (_a = {}, _a[options.targetId] = options, _a)) });
2456
- });
2445
+ _this.onCreateElementRequested("tabElements", options);
2457
2446
  };
2458
2447
  this.onCreateAfterTabsComponentRequested = function (options) {
2459
- if (options === _this.state.afterTabsZones[options.targetId] || !options) {
2460
- return;
2461
- }
2462
- _this.setState(function (s) {
2463
- var _a;
2464
- return __assign(__assign({}, s), { afterTabsZones: __assign(__assign({}, s.afterTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2465
- });
2448
+ _this.onCreateElementRequested("afterTabsZones", options);
2466
2449
  };
2467
2450
  this.onCreateTabHeaderButtonsRequested = function (options) {
2468
- if (options === _this.state.tabHeaderButtons[options.targetId] || !options) {
2469
- return;
2470
- }
2471
- _this.setState(function (s) {
2472
- var _a;
2473
- return __assign(__assign({}, s), { tabHeaderButtons: __assign(__assign({}, s.tabHeaderButtons), (_a = {}, _a[options.targetId] = options, _a)) });
2474
- });
2451
+ _this.onCreateElementRequested("tabHeaderButtons", options);
2475
2452
  };
2476
2453
  this.onCreateBelowTabsComponentRequested = function (options) {
2477
- if (options === _this.state.belowTabsZones[options.targetId] || !options) {
2478
- return;
2479
- }
2480
- _this.setState(function (s) {
2481
- var _a;
2482
- return __assign(__assign({}, s), { belowTabsZones: __assign(__assign({}, s.belowTabsZones), (_a = {}, _a[options.targetId] = options, _a)) });
2483
- });
2454
+ _this.onCreateElementRequested("belowTabsZones", options);
2484
2455
  };
2485
2456
  this.onCreateHtmlButtonsRequested = function (options) {
2486
- if (options === _this.state.htmlButtons[options.targetId] || !options) {
2487
- return;
2488
- }
2489
- _this.setState(function (s) {
2490
- var _a;
2491
- return __assign(__assign({}, s), { htmlButtons: __assign(__assign({}, s.htmlButtons), (_a = {}, _a[options.targetId] = options, _a)) });
2492
- });
2457
+ _this.onCreateElementRequested("htmlButtons", options);
2493
2458
  };
2494
2459
  this.onCreateTabOverflowPopupRequested = function (options) {
2495
- if (options === _this.state.tabOverflowPopups[options.targetId] || !options) {
2496
- return;
2497
- }
2498
- _this.setState(function (s) {
2499
- var _a;
2500
- return __assign(__assign({}, s), { tabOverflowPopups: __assign(__assign({}, s.tabOverflowPopups), (_a = {}, _a[options.targetId] = options, _a)) });
2501
- });
2460
+ _this.onCreateElementRequested("tabOverflowPopups", options);
2502
2461
  };
2503
2462
  this.onUpdateHtmlButtonsRequested = function (options) {
2504
- if (options === _this.state.htmlButtons[options.targetId] || !options) {
2505
- return;
2506
- }
2507
- _this.setState(function (s) {
2508
- var _a;
2509
- return __assign(__assign({}, s), { htmlButtons: __assign(__assign({}, s.htmlButtons), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.htmlButtons[options.targetId]), options), _a)) });
2510
- });
2463
+ _this.onUpdateElementRequested("htmlButtons", options);
2511
2464
  };
2512
2465
  this.onUpdateGroupCaptionBarRequested = function (options) {
2513
2466
  if (options === _this.state.groupCaptionBar) {
@@ -2518,95 +2471,47 @@ var WebGroupsStore = /** @class */ (function () {
2518
2471
  });
2519
2472
  };
2520
2473
  this.onUpdateFrameCaptionBarRequested = function (options) {
2521
- if (options === _this.state.frameCaptionBars[options.targetId] || !options) {
2522
- return;
2523
- }
2524
- _this.setState(function (s) {
2525
- var _a;
2526
- return __assign(__assign({}, s), { frameCaptionBars: __assign(__assign({}, s.frameCaptionBars), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.frameCaptionBars[options.targetId]), options), _a)) });
2527
- });
2474
+ _this.onUpdateElementRequested("frameCaptionBars", options);
2528
2475
  };
2529
2476
  this.onUpdateFrameWindowOverlayRequested = function (options) {
2530
- if (options === _this.state.frameWindowOverlays[options.targetId] || !options) {
2531
- return;
2532
- }
2533
- _this.setState(function (s) {
2534
- var _a;
2535
- return __assign(__assign({}, s), { frameWindowOverlays: __assign(__assign({}, s.frameWindowOverlays), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.frameWindowOverlays[options.targetId]), options), _a)) });
2536
- });
2477
+ _this.onUpdateElementRequested("frameWindowOverlays", options);
2537
2478
  };
2538
2479
  this.onUpdateAboveTabsRequested = function (options) {
2539
- if (options === _this.state.aboveTabsZones[options.targetId] || !options) {
2540
- return;
2541
- }
2542
- _this.setState(function (s) {
2543
- var _a;
2544
- return __assign(__assign({}, s), { aboveTabsZones: __assign(__assign({}, s.aboveTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.aboveTabsZones[options.targetId]), options), _a)) });
2545
- });
2480
+ _this.onUpdateElementRequested("aboveTabsZones", options);
2546
2481
  };
2547
2482
  this.onUpdateBeforeTabsRequested = function (options) {
2548
- if (options === _this.state.beforeTabsZones[options.targetId] || !options) {
2549
- return;
2550
- }
2551
- _this.setState(function (s) {
2552
- var _a;
2553
- return __assign(__assign({}, s), { beforeTabsZones: __assign(__assign({}, s.beforeTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.beforeTabsZones[options.targetId]), options), _a)) });
2554
- });
2483
+ _this.onUpdateElementRequested("beforeTabsZones", options);
2555
2484
  };
2556
2485
  this.onUpdateTabElementRequested = function (options) {
2557
- if (options === _this.state.tabElements[options.targetId] || !options) {
2558
- return;
2559
- }
2560
- _this.setState(function (s) {
2561
- var _a;
2562
- return __assign(__assign({}, s), { tabElements: __assign(__assign({}, s.tabElements), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.tabElements[options.targetId]), options), _a)) });
2563
- });
2486
+ _this.onUpdateElementRequested("tabElements", options);
2564
2487
  };
2565
2488
  this.onUpdateAfterTabsRequested = function (options) {
2566
- if (options === _this.state.afterTabsZones[options.targetId] || !options) {
2567
- return;
2568
- }
2569
- _this.setState(function (s) {
2570
- var _a;
2571
- return __assign(__assign({}, s), { afterTabsZones: __assign(__assign({}, s.afterTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.afterTabsZones[options.targetId]), options), _a)) });
2572
- });
2489
+ _this.onUpdateElementRequested("afterTabsZones", options);
2573
2490
  };
2574
2491
  this.onUpdateTabHeaderButtonsRequested = function (options) {
2575
- if (options === _this.state.tabHeaderButtons[options.targetId] || !options) {
2576
- return;
2577
- }
2578
- _this.setState(function (s) {
2579
- var _a;
2580
- return __assign(__assign({}, s), { tabHeaderButtons: __assign(__assign({}, s.tabHeaderButtons), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.tabHeaderButtons[options.targetId]), options), _a)) });
2581
- });
2492
+ _this.onUpdateElementRequested("tabHeaderButtons", options);
2582
2493
  };
2583
2494
  this.onUpdateBelowTabsRequested = function (options) {
2584
- if (options === _this.state.belowTabsZones[options.targetId] || !options) {
2585
- return;
2586
- }
2587
- _this.setState(function (s) {
2588
- var _a;
2589
- return __assign(__assign({}, s), { belowTabsZones: __assign(__assign({}, s.belowTabsZones), (_a = {}, _a[options.targetId] = __assign(__assign({}, s.belowTabsZones[options.targetId]), options), _a)) });
2590
- });
2495
+ _this.onUpdateElementRequested("belowTabsZones", options);
2591
2496
  };
2592
2497
  this.onUpdateFrame = function (options) {
2593
2498
  _this.setState(function (s) {
2594
2499
  var newState = __assign({}, s);
2595
2500
  var updateSelectionWindow = function (stateProp, targetId, selectedWindow) {
2596
2501
  var _a;
2597
- var _b;
2598
- if (stateProp === "groupOverlay" || stateProp === "groupCaptionBar" || stateProp === "tabElements") {
2502
+ if (stateProp === "tabElements") {
2599
2503
  return;
2600
2504
  }
2601
- if (newState[stateProp][targetId] && ((_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.selectedWindow) !== selectedWindow) {
2505
+ var newStateRecord = newState[stateProp][targetId];
2506
+ if (newStateRecord && (newStateRecord === null || newStateRecord === void 0 ? void 0 : newStateRecord.selectedWindow) !== selectedWindow) {
2602
2507
  newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { selectedWindow: selectedWindow }), _a));
2603
2508
  }
2604
2509
  };
2605
2510
  var updateHiddenTabs = function (stateProp, targetId, hiddenTabsToTheLeft, hiddenTabsToTheRight) {
2606
2511
  var _a;
2607
- var _b, _c;
2608
- var oldHiddenToTheLeft = (_b = newState[stateProp][targetId]) === null || _b === void 0 ? void 0 : _b.hiddenTabsToTheLeft;
2609
- var oldHiddenToTheRight = (_c = newState[stateProp][targetId]) === null || _c === void 0 ? void 0 : _c.hiddenTabsToTheRight;
2512
+ var oldState = newState[stateProp][targetId];
2513
+ var oldHiddenToTheLeft = oldState === null || oldState === void 0 ? void 0 : oldState.hiddenTabsToTheLeft;
2514
+ var oldHiddenToTheRight = oldState === null || oldState === void 0 ? void 0 : oldState.hiddenTabsToTheRight;
2610
2515
  newState[stateProp] = __assign(__assign({}, newState[stateProp]), (_a = {}, _a[targetId] = __assign(__assign({}, newState[stateProp][targetId]), { hiddenTabsToTheLeft: hiddenTabsToTheLeft || oldHiddenToTheLeft, hiddenTabsToTheRight: hiddenTabsToTheRight || oldHiddenToTheRight }), _a));
2611
2516
  };
2612
2517
  updateSelectionWindow("frameCaptionBars", options.targetId, options.selectedWindow);
@@ -2671,200 +2576,46 @@ var WebGroupsStore = /** @class */ (function () {
2671
2576
  }
2672
2577
  };
2673
2578
  this.onRemoveFrameCaptionBarRequested = function (options) {
2674
- if (!_this.state.frameCaptionBars[options.targetId]) {
2675
- return;
2676
- }
2677
- _this.setState(function (s) {
2678
- var newCaptionBarsObj = Object.keys(s.frameCaptionBars).reduce(function (acc, targetId) {
2679
- if (targetId !== options.targetId) {
2680
- acc[targetId] = s.frameCaptionBars[targetId];
2681
- }
2682
- return acc;
2683
- }, {});
2684
- return __assign(__assign({}, s), { frameCaptionBars: newCaptionBarsObj });
2685
- });
2579
+ _this.onRemoveElementRequested("frameCaptionBars", options);
2686
2580
  };
2687
2581
  this.onRemoveFrameWindowOverlayRequested = function (options) {
2688
- if (!_this.state.frameWindowOverlays[options.targetId]) {
2689
- return;
2690
- }
2691
- _this.setState(function (s) {
2692
- var newCaptionBarsObj = Object.keys(s.frameWindowOverlays).reduce(function (acc, targetId) {
2693
- if (targetId !== options.targetId) {
2694
- acc[targetId] = s.frameWindowOverlays[targetId];
2695
- }
2696
- return acc;
2697
- }, {});
2698
- return __assign(__assign({}, s), { frameWindowOverlays: newCaptionBarsObj });
2699
- });
2582
+ _this.onRemoveElementRequested("frameWindowOverlays", options);
2700
2583
  };
2701
2584
  this.onRemoveAboveWindowRequested = function (options) {
2702
- if (!_this.state.aboveWindowZones[options.targetId]) {
2703
- return;
2704
- }
2705
- _this.setState(function (s) {
2706
- var newCaptionBarsObj = Object.keys(s.aboveWindowZones).reduce(function (acc, targetId) {
2707
- if (targetId !== options.targetId) {
2708
- acc[targetId] = s.aboveWindowZones[targetId];
2709
- }
2710
- return acc;
2711
- }, {});
2712
- return __assign(__assign({}, s), { aboveWindowZones: newCaptionBarsObj });
2713
- });
2585
+ _this.onRemoveElementRequested("aboveWindowZones", options);
2714
2586
  };
2715
2587
  this.onRemoveWindowContentOverlayRequested = function (options) {
2716
- if (!_this.state.windowContentOverlays[options.targetId]) {
2717
- return;
2718
- }
2719
- _this.setState(function (s) {
2720
- var newOverlaysObj = Object.keys(s.windowContentOverlays).reduce(function (acc, targetId) {
2721
- if (targetId !== options.targetId) {
2722
- acc[targetId] = s.windowContentOverlays[targetId];
2723
- }
2724
- return acc;
2725
- }, {});
2726
- return __assign(__assign({}, s), { windowContentOverlays: newOverlaysObj });
2727
- });
2588
+ _this.onRemoveElementRequested("windowContentOverlays", options);
2728
2589
  };
2729
2590
  this.onRemoveFrameLoadingAnimationRequested = function (options) {
2730
- if (!_this.state.frameLoadingAnimations[options.targetId]) {
2731
- return;
2732
- }
2733
- _this.setState(function (s) {
2734
- var newLoadingAnimationObj = Object.keys(s.frameLoadingAnimations).reduce(function (acc, targetId) {
2735
- if (targetId !== options.targetId) {
2736
- acc[targetId] = s.frameLoadingAnimations[targetId];
2737
- }
2738
- return acc;
2739
- }, {});
2740
- return __assign(__assign({}, s), { frameLoadingAnimation: newLoadingAnimationObj });
2741
- });
2591
+ _this.onRemoveElementRequested("frameLoadingAnimations", options);
2742
2592
  };
2743
2593
  this.onRemoveBelowWindowRequested = function (options) {
2744
- if (!_this.state.belowWindowZones[options.targetId]) {
2745
- return;
2746
- }
2747
- _this.setState(function (s) {
2748
- var newCaptionBarsObj = Object.keys(s.belowWindowZones).reduce(function (acc, targetId) {
2749
- if (targetId !== options.targetId) {
2750
- acc[targetId] = s.belowWindowZones[targetId];
2751
- }
2752
- return acc;
2753
- }, {});
2754
- return __assign(__assign({}, s), { belowWindowZones: newCaptionBarsObj });
2755
- });
2594
+ _this.onRemoveElementRequested("belowWindowZones", options);
2756
2595
  };
2757
2596
  this.onRemoveAboveTabsRequested = function (options) {
2758
- if (!_this.state.aboveTabsZones[options.targetId]) {
2759
- return;
2760
- }
2761
- _this.setState(function (s) {
2762
- var newTabElementsObj = Object.keys(s.aboveTabsZones).reduce(function (acc, targetId) {
2763
- if (targetId != options.targetId) {
2764
- acc[targetId] = s.aboveTabsZones[targetId];
2765
- }
2766
- return acc;
2767
- }, {});
2768
- return __assign(__assign({}, s), { aboveTabsZones: newTabElementsObj });
2769
- });
2597
+ _this.onRemoveElementRequested("aboveTabsZones", options);
2770
2598
  };
2771
2599
  this.onRemoveBeforeTabsComponentRequested = function (options) {
2772
- if (!_this.state.beforeTabsZones[options.targetId]) {
2773
- return;
2774
- }
2775
- _this.setState(function (s) {
2776
- var newTabElementsObj = Object.keys(s.beforeTabsZones).reduce(function (acc, targetId) {
2777
- if (targetId != options.targetId) {
2778
- acc[targetId] = s.beforeTabsZones[targetId];
2779
- }
2780
- return acc;
2781
- }, {});
2782
- return __assign(__assign({}, s), { beforeTabsZones: newTabElementsObj });
2783
- });
2600
+ _this.onRemoveElementRequested("beforeTabsZones", options);
2784
2601
  };
2785
2602
  this.onRemoveTabElementRequested = function (options) {
2786
- if (!_this.state.tabElements[options.targetId]) {
2787
- return;
2788
- }
2789
- _this.setState(function (s) {
2790
- var newTabElementsObj = Object.keys(s.tabElements).reduce(function (acc, targetId) {
2791
- if (targetId != options.targetId) {
2792
- acc[targetId] = s.tabElements[targetId];
2793
- }
2794
- return acc;
2795
- }, {});
2796
- return __assign(__assign({}, s), { tabElements: newTabElementsObj });
2797
- });
2603
+ _this.onRemoveElementRequested("tabElements", options);
2798
2604
  };
2799
2605
  this.onRemoveAfterTabsComponentRequested = function (options) {
2800
- if (!_this.state.afterTabsZones[options.targetId]) {
2801
- return;
2802
- }
2803
- _this.setState(function (s) {
2804
- var newTabElementsObj = Object.keys(s.afterTabsZones).reduce(function (acc, targetId) {
2805
- if (targetId != options.targetId) {
2806
- acc[targetId] = s.afterTabsZones[targetId];
2807
- }
2808
- return acc;
2809
- }, {});
2810
- return __assign(__assign({}, s), { afterTabsZones: newTabElementsObj });
2811
- });
2606
+ _this.onRemoveElementRequested("afterTabsZones", options);
2812
2607
  };
2813
2608
  this.onRemoveTabHeaderButtonsRequested = function (options) {
2814
- if (!_this.state.tabHeaderButtons[options.targetId]) {
2815
- return;
2816
- }
2817
- _this.setState(function (s) {
2818
- var newTabElementsObj = Object.keys(s.tabHeaderButtons).reduce(function (acc, targetId) {
2819
- if (targetId != options.targetId) {
2820
- acc[targetId] = s.tabHeaderButtons[targetId];
2821
- }
2822
- return acc;
2823
- }, {});
2824
- return __assign(__assign({}, s), { tabHeaderButtons: newTabElementsObj });
2825
- });
2609
+ _this.onRemoveElementRequested("tabHeaderButtons", options);
2826
2610
  };
2827
2611
  this.onRemoveBelowTabsRequested = function (options) {
2828
- if (!_this.state.belowTabsZones[options.targetId]) {
2829
- return;
2830
- }
2831
- _this.setState(function (s) {
2832
- var newTabElementsObj = Object.keys(s.belowTabsZones).reduce(function (acc, targetId) {
2833
- if (targetId != options.targetId) {
2834
- acc[targetId] = s.belowTabsZones[targetId];
2835
- }
2836
- return acc;
2837
- }, {});
2838
- return __assign(__assign({}, s), { belowTabsZones: newTabElementsObj });
2839
- });
2612
+ _this.onRemoveElementRequested("belowTabsZones", options);
2840
2613
  };
2841
2614
  this.onRemoveHtmlButtonsRequested = function (options) {
2842
- if (!_this.state.htmlButtons[options.targetId]) {
2843
- return;
2844
- }
2845
- _this.setState(function (s) {
2846
- var newHtmlObj = Object.keys(s.htmlButtons).reduce(function (acc, targetId) {
2847
- if (targetId != options.targetId) {
2848
- acc[targetId] = s.htmlButtons[targetId];
2849
- }
2850
- return acc;
2851
- }, {});
2852
- return __assign(__assign({}, s), { htmlButtons: newHtmlObj });
2853
- });
2615
+ _this.onRemoveElementRequested("htmlButtons", options);
2854
2616
  };
2855
2617
  this.onRemoveTabOverflowPopupRequested = function (options) {
2856
- if (!_this.state.tabOverflowPopups[options.targetId]) {
2857
- return;
2858
- }
2859
- _this.setState(function (s) {
2860
- var newTabOverflowPopupsObj = Object.keys(s.tabOverflowPopups).reduce(function (acc, targetId) {
2861
- if (targetId != options.targetId) {
2862
- acc[targetId] = s.tabOverflowPopups[targetId];
2863
- }
2864
- return acc;
2865
- }, {});
2866
- return __assign(__assign({}, s), { tabOverflowPopups: newTabOverflowPopupsObj });
2867
- });
2618
+ _this.onRemoveElementRequested("tabOverflowPopups", options);
2868
2619
  };
2869
2620
  this.onShowCaptionEditorRequested = function (targetType, targetId, text) {
2870
2621
  if (targetType === TargetType.Group) {
@@ -2997,6 +2748,40 @@ var WebGroupsStore = /** @class */ (function () {
2997
2748
  return newState;
2998
2749
  });
2999
2750
  };
2751
+ this.onCreateElementRequested = function (key, options) {
2752
+ if (options === _this.state[key][options.targetId] || !options) {
2753
+ return;
2754
+ }
2755
+ _this.setState(function (s) {
2756
+ var _a, _b;
2757
+ return __assign(__assign({}, s), (_a = {}, _a[key] = __assign(__assign({}, s[key]), (_b = {}, _b[options.targetId] = options, _b)), _a));
2758
+ });
2759
+ };
2760
+ this.onUpdateElementRequested = function (key, options) {
2761
+ if (options === _this.state[key][options.targetId] || !options) {
2762
+ return;
2763
+ }
2764
+ _this.setState(function (s) {
2765
+ var _a, _b;
2766
+ return __assign(__assign({}, s), (_a = {}, _a[key] = __assign(__assign({}, s[key]), (_b = {}, _b[options.targetId] = __assign(__assign({}, s[key][options.targetId]), options), _b)), _a));
2767
+ });
2768
+ };
2769
+ this.onRemoveElementRequested = function (key, options) {
2770
+ var stateValue = _this.state[key];
2771
+ if (!stateValue || !stateValue[options.targetId]) {
2772
+ return;
2773
+ }
2774
+ _this.setState(function (s) {
2775
+ var _a;
2776
+ var newRecordObj = Object.keys(s[key]).reduce(function (acc, targetId) {
2777
+ if (targetId != options.targetId) {
2778
+ acc[targetId] = s[key][targetId];
2779
+ }
2780
+ return acc;
2781
+ }, {});
2782
+ return __assign(__assign({}, s), (_a = {}, _a[key] = newRecordObj, _a));
2783
+ });
2784
+ };
3000
2785
  this.setState = function (cb) {
3001
2786
  _this.state = cb(_this.state);
3002
2787
  _this.listeners.forEach(function (l) { return l(); });
@@ -3009,9 +2794,9 @@ var webGroupsStore = new WebGroupsStore();
3009
2794
  var FrameLoadingAnimation = function (_a) {
3010
2795
  var show = _a.show;
3011
2796
  return (show ?
3012
- (React.createElement("div", { className: "loader-wrapper active" },
3013
- React.createElement("div", { className: "loader" }),
3014
- React.createElement("div", { className: "loader-text" }, "Loading..."))) : React.createElement(React.Fragment, null));
2797
+ (React__default.createElement("div", { className: "loader-wrapper active" },
2798
+ React__default.createElement("div", { className: "loader" }),
2799
+ React__default.createElement("div", { className: "loader-text" }, "Loading..."))) : React__default.createElement(React__default.Fragment, null));
3015
2800
  };
3016
2801
 
3017
2802
  var GroupElementCreationWrapper = function (_a) {
@@ -3051,8 +2836,8 @@ var GroupElementCreationWrapper = function (_a) {
3051
2836
  webGroupsManager.onCaptionEditorVisibleChanged(TargetType.Group, options.targetId, visible);
3052
2837
  } });
3053
2838
  var notifyCaptionBoundsChanged = function (bounds) { return webGroupsManager.onCaptionTextBoundsChanged(TargetType.Group, options.targetId, bounds); };
3054
- return (React.createElement(Portal, { parentElement: parentElement },
3055
- React.createElement(GroupCaptionBarCustomElement, __assign({}, options, { minimize: minimize, maximize: maximize, restore: restore, close: close, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged }))));
2839
+ return (React__default.createElement(Portal, { parentElement: parentElement },
2840
+ React__default.createElement(GroupCaptionBarCustomElement, __assign({}, options, { minimize: minimize, maximize: maximize, restore: restore, close: close, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged }))));
3056
2841
  };
3057
2842
  var renderGroupOverlay = function () {
3058
2843
  var _a;
@@ -3061,8 +2846,8 @@ var GroupElementCreationWrapper = function (_a) {
3061
2846
  return;
3062
2847
  }
3063
2848
  var _b = state.groupOverlay, parentElement = _b.parentElement, options = __rest(_b, ["parentElement"]);
3064
- return React.createElement(Portal, { parentElement: parentElement },
3065
- React.createElement(GroupOverlayCustomElement, __assign({}, options)));
2849
+ return React__default.createElement(Portal, { parentElement: parentElement },
2850
+ React__default.createElement(GroupOverlayCustomElement, __assign({}, options)));
3066
2851
  };
3067
2852
  var renderFrameCaptionBar = function () {
3068
2853
  var _a;
@@ -3143,8 +2928,8 @@ var GroupElementCreationWrapper = function (_a) {
3143
2928
  webGroupsManager.onCaptionEditorVisibleChanged(TargetType.Frame, options.targetId, visible);
3144
2929
  } });
3145
2930
  var notifyCaptionBoundsChanged = function (bounds) { return webGroupsManager.onCaptionTextBoundsChanged(TargetType.Frame, options.targetId, bounds); };
3146
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3147
- React.createElement(FrameCaptionBarCustomElement, __assign({}, options, { feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, channels: channels, customButtons: customButtonsProps, frameId: options.targetId, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged })));
2931
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2932
+ React__default.createElement(FrameCaptionBarCustomElement, __assign({}, options, { feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, channels: channels, customButtons: customButtonsProps, frameId: options.targetId, captionEditor: captionEditor, showCaptionEditor: showCaptionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged })));
3148
2933
  });
3149
2934
  };
3150
2935
  var renderFrameWindowOverlay = function () {
@@ -3155,8 +2940,8 @@ var GroupElementCreationWrapper = function (_a) {
3155
2940
  return;
3156
2941
  }
3157
2942
  var parentElement = fcb.parentElement, options = __rest(fcb, ["parentElement"]);
3158
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3159
- React.createElement(FrameWindowOverlayCustomElement, __assign({}, options, { frameId: options.targetId })));
2943
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2944
+ React__default.createElement(FrameWindowOverlayCustomElement, __assign({}, options, { frameId: options.targetId })));
3160
2945
  });
3161
2946
  };
3162
2947
  var renderAboveWindow = function () {
@@ -3167,8 +2952,8 @@ var GroupElementCreationWrapper = function (_a) {
3167
2952
  return;
3168
2953
  }
3169
2954
  var parentElement = awz.parentElement, options = __rest(awz, ["parentElement"]);
3170
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3171
- React.createElement(AboveWindowCustomElement, __assign({}, options, { frameId: options.targetId })));
2955
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2956
+ React__default.createElement(AboveWindowCustomElement, __assign({}, options, { frameId: options.targetId })));
3172
2957
  });
3173
2958
  };
3174
2959
  var renderWindowContentOverlays = function () {
@@ -3179,8 +2964,8 @@ var GroupElementCreationWrapper = function (_a) {
3179
2964
  return;
3180
2965
  }
3181
2966
  var parentElement = wco.parentElement, options = __rest(wco, ["parentElement"]);
3182
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3183
- React.createElement(WindowContentCustomElement, __assign({}, options, { frameId: options.targetId })));
2967
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2968
+ React__default.createElement(WindowContentCustomElement, __assign({}, options, { frameId: options.targetId })));
3184
2969
  });
3185
2970
  };
3186
2971
  var renderFrameLoadingAnimations = function () {
@@ -3190,8 +2975,8 @@ var GroupElementCreationWrapper = function (_a) {
3190
2975
  return;
3191
2976
  }
3192
2977
  var parentElement = wla.parentElement, options = __rest(wla, ["parentElement"]);
3193
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3194
- React.createElement(LoadingAnimationCustomElement, __assign({}, options, { frameId: options.targetId })));
2978
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2979
+ React__default.createElement(LoadingAnimationCustomElement, __assign({}, options, { frameId: options.targetId })));
3195
2980
  });
3196
2981
  };
3197
2982
  var renderBelowWindow = function () {
@@ -3202,8 +2987,8 @@ var GroupElementCreationWrapper = function (_a) {
3202
2987
  return;
3203
2988
  }
3204
2989
  var parentElement = bwz.parentElement, options = __rest(bwz, ["parentElement"]);
3205
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3206
- React.createElement(BelowWindowCustomElement, __assign({}, options, { frameId: options.targetId })));
2990
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
2991
+ React__default.createElement(BelowWindowCustomElement, __assign({}, options, { frameId: options.targetId })));
3207
2992
  });
3208
2993
  };
3209
2994
  var renderAboveTabs = function () {
@@ -3214,8 +2999,8 @@ var GroupElementCreationWrapper = function (_a) {
3214
2999
  return;
3215
3000
  }
3216
3001
  var parentElement = te.parentElement, options = __rest(te, ["parentElement"]);
3217
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3218
- React.createElement(AboveTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3002
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3003
+ React__default.createElement(AboveTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3219
3004
  });
3220
3005
  };
3221
3006
  var renderBeforeTabsZones = function () {
@@ -3226,8 +3011,8 @@ var GroupElementCreationWrapper = function (_a) {
3226
3011
  return;
3227
3012
  }
3228
3013
  var parentElement = te.parentElement, options = __rest(te, ["parentElement"]);
3229
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3230
- React.createElement(BeforeTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3014
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3015
+ React__default.createElement(BeforeTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3231
3016
  });
3232
3017
  };
3233
3018
  var renderTabElements = function () {
@@ -3271,8 +3056,8 @@ var GroupElementCreationWrapper = function (_a) {
3271
3056
  var removeContainerClass = function (className) {
3272
3057
  webGroupsManager.removeTabContainerClass(options.targetId, className);
3273
3058
  };
3274
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3275
- React.createElement(TabCustomElement, __assign({}, options, { close: onCloseClick, channels: channels, windowId: options.targetId, captionEditor: captionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged, addContainerClass: addContainerClass, removeContainerClass: removeContainerClass })));
3059
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3060
+ React__default.createElement(TabCustomElement, __assign({}, options, { close: onCloseClick, channels: channels, windowId: options.targetId, captionEditor: captionEditor, notifyCaptionBoundsChanged: notifyCaptionBoundsChanged, addContainerClass: addContainerClass, removeContainerClass: removeContainerClass })));
3276
3061
  });
3277
3062
  };
3278
3063
  var renderAfterTabsZones = function () {
@@ -3283,8 +3068,8 @@ var GroupElementCreationWrapper = function (_a) {
3283
3068
  return;
3284
3069
  }
3285
3070
  var parentElement = te.parentElement, options = __rest(te, ["parentElement"]);
3286
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3287
- React.createElement(AfterTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3071
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3072
+ React__default.createElement(AfterTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3288
3073
  });
3289
3074
  };
3290
3075
  var renderTabHeaderButtons = function () {
@@ -3342,8 +3127,8 @@ var GroupElementCreationWrapper = function (_a) {
3342
3127
  };
3343
3128
  });
3344
3129
  }
3345
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3346
- React.createElement(TabButtonsCustomElement, __assign({}, options, { overflow: overflow, feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, customButtons: customButtonsProps, frameId: options.targetId })));
3130
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3131
+ React__default.createElement(TabButtonsCustomElement, __assign({}, options, { overflow: overflow, feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, customButtons: customButtonsProps, frameId: options.targetId })));
3347
3132
  });
3348
3133
  };
3349
3134
  var renderTabOverflowPopups = function () {
@@ -3357,11 +3142,14 @@ var GroupElementCreationWrapper = function (_a) {
3357
3142
  var select = function (windowId) {
3358
3143
  webGroupsManager.selectTab(windowId);
3359
3144
  };
3145
+ var resize = function (bounds) {
3146
+ webGroupsManager.resizeTabOverflowPopup(options.targetId, bounds);
3147
+ };
3360
3148
  var close = function (windowId) {
3361
3149
  webGroupsManager.closeTab(windowId);
3362
3150
  };
3363
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3364
- React.createElement(TabOverflowCustomElement, __assign({}, options, { select: select, close: close, frameId: options.targetId })));
3151
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3152
+ React__default.createElement(TabOverflowCustomElement, __assign({}, options, { resize: resize, select: select, close: close, frameId: options.targetId })));
3365
3153
  });
3366
3154
  };
3367
3155
  var renderBelowTabs = function () {
@@ -3372,8 +3160,8 @@ var GroupElementCreationWrapper = function (_a) {
3372
3160
  return;
3373
3161
  }
3374
3162
  var parentElement = te.parentElement, options = __rest(te, ["parentElement"]);
3375
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3376
- React.createElement(BelowTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3163
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3164
+ React__default.createElement(BelowTabsCustomElement, __assign({}, options, { frameId: options.targetId })));
3377
3165
  });
3378
3166
  };
3379
3167
  var renderHtmlButtons = function () {
@@ -3431,11 +3219,11 @@ var GroupElementCreationWrapper = function (_a) {
3431
3219
  };
3432
3220
  });
3433
3221
  }
3434
- return React.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3435
- React.createElement(HtmlButtonsCustomElement, __assign({}, options, { overflow: overflow, feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, customButtons: customButtonsProps, frameId: options.targetId })));
3222
+ return React__default.createElement(Portal, { key: options.targetId, parentElement: parentElement },
3223
+ React__default.createElement(HtmlButtonsCustomElement, __assign({}, options, { overflow: overflow, feedback: feedback, clone: clone, sticky: sticky, extract: extract, lock: lock, unlock: unlock, minimize: minimize, maximize: maximize, restore: restore, close: close, customButtons: customButtonsProps, frameId: options.targetId })));
3436
3224
  });
3437
3225
  };
3438
- return React.createElement(React.Fragment, null,
3226
+ return React__default.createElement(React__default.Fragment, null,
3439
3227
  renderGroupCaptionBar(),
3440
3228
  renderGroupOverlay(),
3441
3229
  renderFrameCaptionBar(),
@@ -3452,7 +3240,7 @@ var GroupElementCreationWrapper = function (_a) {
3452
3240
  renderTabOverflowPopups(),
3453
3241
  renderBelowTabs(),
3454
3242
  renderHtmlButtons(),
3455
- React.createElement(GroupWrapper, { onCreateGroupCaptionBarRequested: ((_d = components === null || components === void 0 ? void 0 : components.group) === null || _d === void 0 ? void 0 : _d.CaptionBar) ? webGroupsStore.onCreateGroupCaptionBarRequested : undefined, onCreateGroupOverlayRequested: ((_e = components === null || components === void 0 ? void 0 : components.group) === null || _e === void 0 ? void 0 : _e.Overlay) ? webGroupsStore.onCreateGroupOverlayRequested : undefined, onCreateFrameCaptionBarRequested: ((_f = components === null || components === void 0 ? void 0 : components.flat) === null || _f === void 0 ? void 0 : _f.CaptionBar) ? webGroupsStore.onCreateFrameCaptionBarRequested : undefined, onCreateFrameWindowOverlayRequested: ((_g = components === null || components === void 0 ? void 0 : components.frame) === null || _g === void 0 ? void 0 : _g.Overlay) ? webGroupsStore.onCreateFrameWindowOverlayRequested : undefined, onCreateAboveWindowRequested: ((_h = components === null || components === void 0 ? void 0 : components.frame) === null || _h === void 0 ? void 0 : _h.AboveWindow) ? webGroupsStore.onCreateAboveWindowRequested : undefined, onCreateWindowContentOverlayRequested: ((_j = components === null || components === void 0 ? void 0 : components.frame) === null || _j === void 0 ? void 0 : _j.WindowContentOverlay) ? webGroupsStore.onCreateWindowContentOverlayRequested : undefined, onCreateFrameLoadingAnimationRequested: LoadingAnimation ? webGroupsStore.onCreateFrameLoadingAnimationRequested : undefined, onCreateBelowWindowRequested: ((_k = components === null || components === void 0 ? void 0 : components.frame) === null || _k === void 0 ? void 0 : _k.BelowWindow) ? webGroupsStore.onCreateBelowWindowRequested : undefined, onCreateAboveTabsRequested: ((_l = components === null || components === void 0 ? void 0 : components.tabs) === null || _l === void 0 ? void 0 : _l.Above) ? webGroupsStore.onCreateAboveTabsComponentRequested : undefined, onCreateBeforeTabsComponentRequested: ((_m = components === null || components === void 0 ? void 0 : components.tabs) === null || _m === void 0 ? void 0 : _m.Before) ? webGroupsStore.onCreateBeforeTabsComponentRequested : undefined, onCreateTabRequested: ((_o = components === null || components === void 0 ? void 0 : components.tabs) === null || _o === void 0 ? void 0 : _o.Element) ? webGroupsStore.onCreateTabElementRequested : undefined, onCreateAfterTabsComponentRequested: ((_p = components === null || components === void 0 ? void 0 : components.tabs) === null || _p === void 0 ? void 0 : _p.After) ? webGroupsStore.onCreateAfterTabsComponentRequested : undefined, onCreateTabHeaderButtonsRequested: ((_q = components === null || components === void 0 ? void 0 : components.tabs) === null || _q === void 0 ? void 0 : _q.Buttons) ? webGroupsStore.onCreateTabHeaderButtonsRequested : undefined, onCreateBelowTabsRequested: ((_r = components === null || components === void 0 ? void 0 : components.tabs) === null || _r === void 0 ? void 0 : _r.Below) ? webGroupsStore.onCreateBelowTabsComponentRequested : undefined, onCreateHtmlButtonsRequested: ((_s = components === null || components === void 0 ? void 0 : components.html) === null || _s === void 0 ? void 0 : _s.Buttons) ? webGroupsStore.onCreateHtmlButtonsRequested : undefined, onCreateTabOverflowPopupRequested: ((_t = components === null || components === void 0 ? void 0 : components.tabs) === null || _t === void 0 ? void 0 : _t.OverflowPopup) ? webGroupsStore.onCreateTabOverflowPopupRequested : undefined, onUpdateGroupCaptionBarRequested: ((_u = components === null || components === void 0 ? void 0 : components.group) === null || _u === void 0 ? void 0 : _u.CaptionBar) ? webGroupsStore.onUpdateGroupCaptionBarRequested : undefined, onUpdateFrameWindowOverlayRequested: ((_v = components === null || components === void 0 ? void 0 : components.group) === null || _v === void 0 ? void 0 : _v.Overlay) ? webGroupsStore.onUpdateFrameWindowOverlayRequested : undefined, onUpdateFrameCaptionBarRequested: ((_w = components === null || components === void 0 ? void 0 : components.flat) === null || _w === void 0 ? void 0 : _w.CaptionBar) ? webGroupsStore.onUpdateFrameCaptionBarRequested : undefined, onUpdateFrameRequested: webGroupsStore.onUpdateFrame, onUpdateStandardButtonRequested: webGroupsStore.onUpdateStandardButton, onUpdateCustomButtonsRequested: webGroupsStore.onUpdateCustomButtons, onUpdateAboveTabsRequested: ((_x = components === null || components === void 0 ? void 0 : components.tabs) === null || _x === void 0 ? void 0 : _x.Above) ? webGroupsStore.onUpdateAboveTabsRequested : undefined, onUpdateBeforeTabsComponentRequested: ((_y = components === null || components === void 0 ? void 0 : components.tabs) === null || _y === void 0 ? void 0 : _y.Before) ? webGroupsStore.onUpdateBeforeTabsRequested : undefined, onUpdateTabRequested: ((_z = components === null || components === void 0 ? void 0 : components.tabs) === null || _z === void 0 ? void 0 : _z.Element) ? webGroupsStore.onUpdateTabElementRequested : undefined, onUpdateAfterTabsComponentRequested: ((_0 = components === null || components === void 0 ? void 0 : components.tabs) === null || _0 === void 0 ? void 0 : _0.After) ? webGroupsStore.onUpdateAfterTabsRequested : undefined, onUpdateBelowTabsRequested: ((_1 = components === null || components === void 0 ? void 0 : components.tabs) === null || _1 === void 0 ? void 0 : _1.Below) ? webGroupsStore.onUpdateBelowTabsRequested : undefined, onRemoveFrameCaptionBarRequested: webGroupsStore.onRemoveFrameCaptionBarRequested, onRemoveFrameWindowOverlayRequested: webGroupsStore.onRemoveFrameWindowOverlayRequested, onRemoveAboveWindowRequested: webGroupsStore.onRemoveAboveWindowRequested, onRemoveWindowContentOverlayRequested: webGroupsStore.onRemoveWindowContentOverlayRequested, onRemoveFrameLoadingAnimationRequested: webGroupsStore.onRemoveFrameLoadingAnimationRequested, onRemoveBelowWindowRequested: webGroupsStore.onRemoveBelowWindowRequested, onRemoveAboveTabsRequested: webGroupsStore.onRemoveAboveTabsRequested, onRemoveBeforeTabsComponentRequested: webGroupsStore.onRemoveBeforeTabsComponentRequested, onRemoveTabRequested: webGroupsStore.onRemoveTabElementRequested, onRemoveAfterTabsComponentRequested: webGroupsStore.onRemoveAfterTabsComponentRequested, onRemoveTabHeaderButtonsRequested: webGroupsStore.onRemoveTabHeaderButtonsRequested, onRemoveBelowTabsRequested: webGroupsStore.onRemoveBelowTabsRequested, onRemoveHtmlButtonsRequested: webGroupsStore.onRemoveHtmlButtonsRequested, onRemoveTabOverflowPopupRequested: webGroupsStore.onRemoveTabOverflowPopupRequested, onShowCaptionEditorRequested: webGroupsStore.onShowCaptionEditorRequested, onCommitCaptionEditingRequested: webGroupsStore.onCommitCaptionEditingRequested, onHideCaptionEditorRequested: webGroupsStore.onHideCaptionEditorRequested, onShowLoadingAnimationRequested: webGroupsStore.onShowLoadingAnimationRequested, onHideLoadingAnimationRequested: webGroupsStore.onHideLoadingAnimationRequested, styles: styles }));
3243
+ React__default.createElement(GroupWrapper, { onCreateGroupCaptionBarRequested: ((_d = components === null || components === void 0 ? void 0 : components.group) === null || _d === void 0 ? void 0 : _d.CaptionBar) ? webGroupsStore.onCreateGroupCaptionBarRequested : undefined, onCreateGroupOverlayRequested: ((_e = components === null || components === void 0 ? void 0 : components.group) === null || _e === void 0 ? void 0 : _e.Overlay) ? webGroupsStore.onCreateGroupOverlayRequested : undefined, onCreateFrameCaptionBarRequested: ((_f = components === null || components === void 0 ? void 0 : components.flat) === null || _f === void 0 ? void 0 : _f.CaptionBar) ? webGroupsStore.onCreateFrameCaptionBarRequested : undefined, onCreateFrameWindowOverlayRequested: ((_g = components === null || components === void 0 ? void 0 : components.frame) === null || _g === void 0 ? void 0 : _g.Overlay) ? webGroupsStore.onCreateFrameWindowOverlayRequested : undefined, onCreateAboveWindowRequested: ((_h = components === null || components === void 0 ? void 0 : components.frame) === null || _h === void 0 ? void 0 : _h.AboveWindow) ? webGroupsStore.onCreateAboveWindowRequested : undefined, onCreateWindowContentOverlayRequested: ((_j = components === null || components === void 0 ? void 0 : components.frame) === null || _j === void 0 ? void 0 : _j.WindowContentOverlay) ? webGroupsStore.onCreateWindowContentOverlayRequested : undefined, onCreateFrameLoadingAnimationRequested: LoadingAnimation ? webGroupsStore.onCreateFrameLoadingAnimationRequested : undefined, onCreateBelowWindowRequested: ((_k = components === null || components === void 0 ? void 0 : components.frame) === null || _k === void 0 ? void 0 : _k.BelowWindow) ? webGroupsStore.onCreateBelowWindowRequested : undefined, onCreateAboveTabsRequested: ((_l = components === null || components === void 0 ? void 0 : components.tabs) === null || _l === void 0 ? void 0 : _l.Above) ? webGroupsStore.onCreateAboveTabsComponentRequested : undefined, onCreateBeforeTabsComponentRequested: ((_m = components === null || components === void 0 ? void 0 : components.tabs) === null || _m === void 0 ? void 0 : _m.Before) ? webGroupsStore.onCreateBeforeTabsComponentRequested : undefined, onCreateTabRequested: ((_o = components === null || components === void 0 ? void 0 : components.tabs) === null || _o === void 0 ? void 0 : _o.Element) ? webGroupsStore.onCreateTabElementRequested : undefined, onCreateAfterTabsComponentRequested: ((_p = components === null || components === void 0 ? void 0 : components.tabs) === null || _p === void 0 ? void 0 : _p.After) ? webGroupsStore.onCreateAfterTabsComponentRequested : undefined, onCreateTabHeaderButtonsRequested: ((_q = components === null || components === void 0 ? void 0 : components.tabs) === null || _q === void 0 ? void 0 : _q.Buttons) ? webGroupsStore.onCreateTabHeaderButtonsRequested : undefined, onCreateBelowTabsRequested: ((_r = components === null || components === void 0 ? void 0 : components.tabs) === null || _r === void 0 ? void 0 : _r.Below) ? webGroupsStore.onCreateBelowTabsComponentRequested : undefined, onCreateHtmlButtonsRequested: ((_s = components === null || components === void 0 ? void 0 : components.html) === null || _s === void 0 ? void 0 : _s.Buttons) ? webGroupsStore.onCreateHtmlButtonsRequested : undefined, onCreateTabOverflowPopupRequested: ((_t = components === null || components === void 0 ? void 0 : components.tabs) === null || _t === void 0 ? void 0 : _t.OverflowPopup) ? webGroupsStore.onCreateTabOverflowPopupRequested : undefined, onUpdateGroupCaptionBarRequested: ((_u = components === null || components === void 0 ? void 0 : components.group) === null || _u === void 0 ? void 0 : _u.CaptionBar) ? webGroupsStore.onUpdateGroupCaptionBarRequested : undefined, onUpdateFrameWindowOverlayRequested: ((_v = components === null || components === void 0 ? void 0 : components.group) === null || _v === void 0 ? void 0 : _v.Overlay) ? webGroupsStore.onUpdateFrameWindowOverlayRequested : undefined, onUpdateFrameCaptionBarRequested: ((_w = components === null || components === void 0 ? void 0 : components.flat) === null || _w === void 0 ? void 0 : _w.CaptionBar) ? webGroupsStore.onUpdateFrameCaptionBarRequested : undefined, onUpdateFrameRequested: webGroupsStore.onUpdateFrame, onUpdateStandardButtonRequested: webGroupsStore.onUpdateStandardButton, onUpdateCustomButtonsRequested: webGroupsStore.onUpdateCustomButtons, onUpdateAboveTabsRequested: ((_x = components === null || components === void 0 ? void 0 : components.tabs) === null || _x === void 0 ? void 0 : _x.Above) ? webGroupsStore.onUpdateAboveTabsRequested : undefined, onUpdateBeforeTabsComponentRequested: ((_y = components === null || components === void 0 ? void 0 : components.tabs) === null || _y === void 0 ? void 0 : _y.Before) ? webGroupsStore.onUpdateBeforeTabsRequested : undefined, onUpdateTabRequested: ((_z = components === null || components === void 0 ? void 0 : components.tabs) === null || _z === void 0 ? void 0 : _z.Element) ? webGroupsStore.onUpdateTabElementRequested : undefined, onUpdateAfterTabsComponentRequested: ((_0 = components === null || components === void 0 ? void 0 : components.tabs) === null || _0 === void 0 ? void 0 : _0.After) ? webGroupsStore.onUpdateAfterTabsRequested : undefined, onUpdateBelowTabsRequested: ((_1 = components === null || components === void 0 ? void 0 : components.tabs) === null || _1 === void 0 ? void 0 : _1.Below) ? webGroupsStore.onUpdateBelowTabsRequested : undefined, onRemoveFrameCaptionBarRequested: webGroupsStore.onRemoveFrameCaptionBarRequested, onRemoveFrameWindowOverlayRequested: webGroupsStore.onRemoveFrameWindowOverlayRequested, onRemoveAboveWindowRequested: webGroupsStore.onRemoveAboveWindowRequested, onRemoveWindowContentOverlayRequested: webGroupsStore.onRemoveWindowContentOverlayRequested, onRemoveFrameLoadingAnimationRequested: webGroupsStore.onRemoveFrameLoadingAnimationRequested, onRemoveBelowWindowRequested: webGroupsStore.onRemoveBelowWindowRequested, onRemoveAboveTabsRequested: webGroupsStore.onRemoveAboveTabsRequested, onRemoveBeforeTabsComponentRequested: webGroupsStore.onRemoveBeforeTabsComponentRequested, onRemoveTabRequested: webGroupsStore.onRemoveTabElementRequested, onRemoveAfterTabsComponentRequested: webGroupsStore.onRemoveAfterTabsComponentRequested, onRemoveTabHeaderButtonsRequested: webGroupsStore.onRemoveTabHeaderButtonsRequested, onRemoveBelowTabsRequested: webGroupsStore.onRemoveBelowTabsRequested, onRemoveHtmlButtonsRequested: webGroupsStore.onRemoveHtmlButtonsRequested, onRemoveTabOverflowPopupRequested: webGroupsStore.onRemoveTabOverflowPopupRequested, onShowCaptionEditorRequested: webGroupsStore.onShowCaptionEditorRequested, onCommitCaptionEditingRequested: webGroupsStore.onCommitCaptionEditingRequested, onHideCaptionEditorRequested: webGroupsStore.onHideCaptionEditorRequested, onShowLoadingAnimationRequested: webGroupsStore.onShowLoadingAnimationRequested, onHideLoadingAnimationRequested: webGroupsStore.onHideLoadingAnimationRequested, styles: styles }));
3456
3244
  };
3457
3245
 
3458
3246
  function useIOConnectWindow(windowId) {
@@ -3497,31 +3285,40 @@ function useCommitFlatCaptionEditingRequested(targetId, text) {
3497
3285
 
3498
3286
  var HtmlButtons = function (_a) {
3499
3287
  var extract = _a.extract, minimize = _a.minimize, maximize = _a.maximize, restore = _a.restore, close = _a.close, lock = _a.lock, unlock = _a.unlock, feedback = _a.feedback, clone = _a.clone, sticky = _a.sticky, customButtons = _a.customButtons;
3500
- return React.createElement("div", { className: "t42-buttons-container t42-html-buttons-bar-element" },
3501
- React.createElement("ul", { className: "t42-buttons t42-html-buttons-bar-element" }, customButtons.map(function (customButton) {
3502
- return customButton.visible && React.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
3288
+ return React__default.createElement("div", { className: "t42-buttons-container t42-html-buttons-bar-element" },
3289
+ React__default.createElement("ul", { className: "t42-buttons t42-html-buttons-bar-element" }, customButtons.map(function (customButton) {
3290
+ return customButton.visible && React__default.createElement(CustomButton, __assign({ key: customButton.buttonId }, customButton));
3503
3291
  })),
3504
- React.createElement("ul", { className: "t42-buttons t42-html-buttons-bar-element" },
3505
- (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React.createElement(FeedbackButton, __assign({}, feedback)),
3506
- (clone === null || clone === void 0 ? void 0 : clone.visible) && React.createElement(CloneButton, __assign({}, clone)),
3507
- (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React.createElement(StickyButton, __assign({}, sticky)),
3508
- (extract === null || extract === void 0 ? void 0 : extract.visible) && React.createElement(ExtractButton, __assign({}, extract)),
3509
- (lock === null || lock === void 0 ? void 0 : lock.visible) && React.createElement(LockButton, __assign({}, lock)),
3510
- (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React.createElement(UnlockButton, __assign({}, unlock)),
3511
- (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React.createElement(MinimizeButton, __assign({}, minimize)),
3512
- (restore === null || restore === void 0 ? void 0 : restore.visible) && React.createElement(RestoreButton, __assign({}, restore)),
3513
- (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React.createElement(MaximizeButton, __assign({}, maximize)),
3514
- (close === null || close === void 0 ? void 0 : close.visible) && React.createElement(CloseButton, __assign({}, close))));
3292
+ React__default.createElement("ul", { className: "t42-buttons t42-html-buttons-bar-element" },
3293
+ (feedback === null || feedback === void 0 ? void 0 : feedback.visible) && React__default.createElement(FeedbackButton, __assign({}, feedback)),
3294
+ (clone === null || clone === void 0 ? void 0 : clone.visible) && React__default.createElement(CloneButton, __assign({}, clone)),
3295
+ (sticky === null || sticky === void 0 ? void 0 : sticky.visible) && React__default.createElement(StickyButton, __assign({}, sticky)),
3296
+ (extract === null || extract === void 0 ? void 0 : extract.visible) && React__default.createElement(ExtractButton, __assign({}, extract)),
3297
+ (lock === null || lock === void 0 ? void 0 : lock.visible) && React__default.createElement(LockButton, __assign({}, lock)),
3298
+ (unlock === null || unlock === void 0 ? void 0 : unlock.visible) && React__default.createElement(UnlockButton, __assign({}, unlock)),
3299
+ (minimize === null || minimize === void 0 ? void 0 : minimize.visible) && React__default.createElement(MinimizeButton, __assign({}, minimize)),
3300
+ (restore === null || restore === void 0 ? void 0 : restore.visible) && React__default.createElement(RestoreButton, __assign({}, restore)),
3301
+ (maximize === null || maximize === void 0 ? void 0 : maximize.visible) && React__default.createElement(MaximizeButton, __assign({}, maximize)),
3302
+ (close === null || close === void 0 ? void 0 : close.visible) && React__default.createElement(CloseButton, __assign({}, close))));
3515
3303
  };
3516
3304
 
3517
3305
  var TabOverflowPopup = function (_a) {
3518
- var hiddenTabsToTheLeft = _a.hiddenTabsToTheLeft, hiddenTabsToTheRight = _a.hiddenTabsToTheRight, close = _a.close, select = _a.select;
3306
+ var hiddenTabsToTheLeft = _a.hiddenTabsToTheLeft, hiddenTabsToTheRight = _a.hiddenTabsToTheRight, close = _a.close, resize = _a.resize, select = _a.select;
3307
+ var ref = React__default.useRef(null);
3308
+ useEffect$1(function () {
3309
+ if (!ref.current)
3310
+ return;
3311
+ if (typeof resize !== "function")
3312
+ return;
3313
+ var bounds = getElementBounds(ref.current);
3314
+ resize(bounds);
3315
+ }, [ref]);
3519
3316
  var createSection = function (tabs, title) {
3520
- return (React.createElement("ul", null,
3521
- React.createElement("li", { className: "title" }, title),
3522
- tabs.map(function (tab) { return (React.createElement("li", { key: tab.windowId, onClick: function () { return handleTabClick(tab.windowId); } },
3523
- React.createElement("span", null, tab.title),
3524
- React.createElement("div", { className: "t42-tab-close-button-content", onClick: function (e) {
3317
+ return (React__default.createElement("ul", null,
3318
+ React__default.createElement("li", { className: "title" }, title),
3319
+ tabs.map(function (tab) { return (React__default.createElement("li", { key: tab.windowId, onClick: function () { return handleTabClick(tab.windowId); } },
3320
+ React__default.createElement("span", null, tab.title),
3321
+ React__default.createElement("div", { className: "t42-tab-close-button-content", onClick: function (e) {
3525
3322
  e.stopPropagation();
3526
3323
  handleTabClose(tab.windowId);
3527
3324
  } }))); })));
@@ -3532,12 +3329,49 @@ var TabOverflowPopup = function (_a) {
3532
3329
  var handleTabClose = function (windowId) {
3533
3330
  close(windowId);
3534
3331
  };
3535
- return (React.createElement("div", { className: "t42-wg-tab-overflow-popup" },
3332
+ return (React__default.createElement("div", { ref: ref, className: "t42-wg-tab-overflow-popup" },
3536
3333
  hiddenTabsToTheLeft.length > 0 && createSection(hiddenTabsToTheLeft, "Open left"),
3537
- hiddenTabsToTheLeft.length > 0 && hiddenTabsToTheRight.length > 0 && React.createElement("hr", null),
3334
+ hiddenTabsToTheLeft.length > 0 && hiddenTabsToTheRight.length > 0 && React__default.createElement("hr", null),
3538
3335
  hiddenTabsToTheRight.length > 0 && createSection(hiddenTabsToTheRight, "Open right")));
3539
3336
  };
3540
3337
 
3338
+ function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C,k={exports:{}};
3339
+ /*!
3340
+ Copyright (c) 2018 Jed Watson.
3341
+ Licensed under the MIT License (MIT), see
3342
+ http://jedwatson.github.io/classnames
3343
+ */C=k,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)));}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return "";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var r in n)e.call(n,r)&&n[r]&&(i=o(i,r));return i}function o(e,t){return t?e?e+" "+t:e+t:e}C.exports?(t.default=t,C.exports=t):window.classNames=t;}();var N=b(k.exports);function S({className:t,size:n="16",variant:o="workspace",...i}){const r=N("icon",n&&[`icon-size-${n}`],t);return jsx("span",{className:r,"aria-label":`icon-${o}`,role:"presentation",...i,children:jsx("i",{className:`icon-${o}`})})}const D=forwardRef(({className:t,variant:n="default",icon:o="workspace",size:i="16",tooltip:r,iconSize:s="16",onClick:l,disabled:c,children:u,...d},f)=>{const m=N("io-btn-icon","default"!==n&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${i}`],t),p=useCallback(e=>{if(!c)return l?l(e):void 0;e.preventDefault();},[l,c]);return jsx("button",{className:m,type:"button",ref:f,"aria-label":"icon button","aria-disabled":c,title:r,onClick:p,disabled:c,...d,children:u??(o&&jsx(S,{variant:o,size:s}))})});D.displayName="ButtonIcon";function I({className:t,variant:n="default",children:o,...i}){const r=N("io-badge","default"!==n&&[`io-badge-${n}`],t);return jsx("div",{className:r,...i,children:o})}function M({className:t,tag:n="h2",size:o="normal",text:i="Title",...r}){const a=n,s=N("small"===o&&"io-title-semibold","normal"===o&&"io-title","large"===o&&"io-title-large",t);return jsx(a,{className:s,...r,children:i})}function P({className:n,title:o,titleSize:i="normal",tag:r,hint:a,children:s,...l}){const c=N("io-block",n),u=o?"block-title":void 0;return jsxs("section",{className:c,"aria-label":o?void 0:"Block","aria-labelledby":u,...l,children:[o&&jsx(M,{id:u,tag:r,text:o,size:i}),s,a&&jsx("p",{className:"io-text-smaller",children:a})]})}const A=e=>"Enter"===e.key||" "===e.key,T=forwardRef(({className:n,variant:o="default",size:i="normal",icon:r,iconSize:s="12",iconRight:l=!1,text:c,onClick:u,disabled:d,children:f,...m},p)=>{const h=N("io-btn",("primary"===o||"critical"===o||"outline"===o||"link"===o)&&[`io-btn-${o}`],"large"===i&&"io-btn-lg",n),g=useCallback(e=>{if(!d)return u?u(e):void 0;e.preventDefault();},[u,d]),v=useCallback(e=>{d||A(e)&&(e.preventDefault(),g(e));},[g,d]);return jsxs("button",{className:h,ref:p,type:"button","aria-disabled":d,onClick:g,onKeyDown:v,disabled:d,tabIndex:0,...m,children:[r&&!l&&jsx(S,{variant:r,size:s}),f??c,r&&l&&jsx(S,{variant:r,size:s})]})});T.displayName="Button";const O=createContext({}),F=forwardRef(({icon:t="chevron-down",onClick:n,onKeyDown:o,...i},r)=>{const{handleToggle:s,disabled:c,setTriggerRef:u}=useContext(O),d=useCallback(e=>{u?.(e),r&&("function"==typeof r?r(e):r.current=e);},[r,u]),f=useCallback(e=>{e.stopPropagation(),n?.(e),e.defaultPrevented||s?.();},[n,s]),m=useCallback(e=>{o?.(e),e.defaultPrevented||A(e)&&(e.preventDefault(),e.stopPropagation(),s?.());},[o,s]);return jsx(T,{icon:t,iconRight:!0,onClick:f,onKeyDown:m,disabled:c,ref:d,...i})});F.displayName="DropdownButton";const L=forwardRef(({size:t="32",onClick:n,onKeyDown:o,...i},r)=>{const{handleToggle:s,disabled:c,setTriggerRef:u}=useContext(O),d=useCallback(e=>{u?.(e),r&&("function"==typeof r?r(e):r.current=e);},[r,u]),f=useCallback(e=>{e.stopPropagation(),n?.(e),e.defaultPrevented||s?.();},[n,s]),m=useCallback(e=>{o?.(e),e.defaultPrevented||A(e)&&(e.preventDefault(),e.stopPropagation(),s?.());},[o,s]);return jsx(D,{size:t,onClick:f,onKeyDown:m,disabled:c,ref:d,...i})});function B({className:t,...n}){const o=N("io-dropdown-content",t);return jsx("div",{className:o,...n})}L.displayName="DropdownButtonIcon";const R=createContext({}),_=forwardRef((n,o)=>{const{className:i,prepend:r,append:a,isSelected:s,onClick:c,description:u,disabled:d=!1,children:f,tooltip:m,...p}=n,{variant:h="default",selected:g,checkIcon:v,handleItemClick:y}=useContext(R),w=s??g?.some(e=>e.children===f),b="default"!==h&&!!v,C=b||r,k=N("io-list-item",C&&"io-list-item-left",a&&"io-list-item-right","default"!==h&&w&&"selected",u&&"io-list-item-description",d&&"io-list-item-disabled",i);return jsxs("li",{className:k,ref:o,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:e=>{d?e.preventDefault():(y?.(e,{children:f}),c?.(e));},...p,children:[C&&jsxs("div",{className:"io-list-left-column",children:[b&&jsx(S,{variant:v.variant,title:w?v.tooltip:void 0,"data-testid":"list-item-check-icon"}),r]}),jsx("span",{className:"io-list-text",title:m,"data-testid":"list-item-title",children:f}),a&&jsx("div",{className:"io-list-right-column",children:a}),u&&jsx("div",{className:"io-list-text-description",children:u})]})});_.displayName="ListItem";const H=forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item",o&&"io-list-item-left",i&&"io-list-item-right","io-list-item-title",n);return jsxs("li",{className:c,ref:l,...s,children:[o&&jsx("div",{className:"io-list-left-column",children:o}),jsx("span",{className:"io-list-text",title:a,"data-testid":"list-item-title",children:r}),i&&jsx("div",{className:"io-list-right-column",children:i})]})});H.displayName="ListItemTitle";const j=forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item",o&&"io-list-item-left",i&&"io-list-item-right","io-list-item-section",n);return jsxs("li",{className:c,ref:l,...s,children:[o&&jsx("div",{className:"io-list-left-column",children:o}),jsx("span",{className:"io-list-text",title:a,children:r}),i&&jsx("div",{className:"io-list-right-column",children:i})]})});j.displayName="ListItemSection";const $=forwardRef(({className:n,prepend:o,append:i,children:r,tooltip:a,...s},l)=>{const c=N("io-list-item-header",n);return jsxs("div",{className:c,ref:l,...s,children:[o&&jsx("div",{className:"io-list-left-column",children:o}),jsx("span",{className:"io-list-text",title:a,children:r}),i&&jsx("div",{className:"io-list-right-column",children:i})]})});$.displayName="ListItemHeader";const z=forwardRef(({className:t,children:n,...o},i)=>{const r=N("io-list-item","io-list-with-sub-items",t);return jsx("li",{className:r,ref:i,...o,children:n})});z.displayName="ListItemWithSubItems";const W=forwardRef((t,n)=>{const{className:o,variant:i="default",checkIcon:r,children:s,...l}=t,[d,f]=useState$1([]),m=N("io-list","default"!==i&&"io-list-selectable",o),p=useMemo(()=>{if(r)return "object"==typeof r?r:{variant:r}},[r]),h=useCallback((e,t)=>{if("default"===i)return;const n=d.some(e=>e.children?.toString()===t.children?.toString());"single"===i?f([t]):(()=>{const e=n?d.filter(e=>e.children!==t.children):[...d,t];f(e);})();},[d,i]),g=useMemo(()=>({variant:i,selected:d,checkIcon:p,handleItemClick:h}),[i,d,p,h]);return jsx(R.Provider,{value:g,children:jsx("ul",{className:m,ref:n,...l,children:s})})});W.displayName="List";const V=W;V.Item=_,V.ItemTitle=H,V.ItemSection=j,V.ItemHeader=$,V.ItemWithSubItems=z;const Y=forwardRef((t,n)=>jsx(V,{...t,ref:n}));Y.displayName="DropdownList";const U=forwardRef((t,n)=>{const{handleClose:o}=useContext(O),{onClick:i,onKeyDown:r,...s}=t,c=useRef(null),u=useCallback(e=>{c.current=e,"function"==typeof n?n(e):n&&(n.current=e);},[n]);return jsx(_,{...s,ref:u,onClick:e=>{i?.(e),o?.();},onKeyDown:e=>{if(r?.(e),e.defaultPrevented||!A(e))return;e.preventDefault(),e.stopPropagation();const t=("function"==typeof n?null:n?.current)||c.current;t?.click();}})});U.displayName="DropdownItem";const K=forwardRef((t,n)=>jsx(H,{...t,ref:n}));K.displayName="DropdownItemTitle";const J=forwardRef((t,n)=>jsx(j,{...t,ref:n}));function q({className:t,...n}){const o=N("io-separator",t);return jsx("hr",{className:o,...n})}J.displayName="DropdownItemSection";const G=forwardRef((t,n)=>jsx(q,{...t}));G.displayName="DropdownSeparator";function Q(e,t,n){const o=useCallback(n=>{const o=t.some(e=>n.key===e);o&&(n.preventDefault(),e());},[e,t]);useEffect$1(()=>{const e=n?.current||document;return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o);}},[o,n]);}const X=forwardRef(({className:t,variant:n="outline",align:o="down",disabled:i,isOpen:r,onOpenChange:s,children:l,...p},h)=>{const g=useRef(null),v=useRef(null);useImperativeHandle(h,()=>v.current,[]);const{isOpen:y,handleOpen:w,handleClose:b}=((e,t)=>{const[n,o]=useState$1(!1),i=void 0!==e,r=i?e:n,s=useCallback(e=>{i||o(e),t?.(e);},[i,t]),l=useCallback(()=>s(!0),[s]),u=useCallback(()=>s(!1),[s]);return {isOpen:r,setOpen:s,handleOpen:l,handleClose:u}})(r,s);((e,t,n=!0)=>{useEffect$1(()=>{if(!n)return;const o=n=>{const o=n.target;o&&e.current&&!e.current.contains(o)&&(n.composedPath&&n.composedPath().some(t=>t===e.current||e.current&&t.nodeType===Node.ELEMENT_NODE&&e.current.contains(t))||t());},i=requestAnimationFrame(()=>{document.addEventListener("mousedown",o,!0);});return ()=>{cancelAnimationFrame(i),document.removeEventListener("mousedown",o,!0);}},[e,t,n]);})(v,b,y),Q(()=>{y&&b();},["Escape"],v),Q(()=>{y||i||g.current!==document.activeElement||w();},["ArrowDown","ArrowUp"],v);const C=useMemo(()=>({variant:n,align:o,disabled:i,isOpen:y,handleOpen:w,handleClose:b,handleToggle:y?b:w,setTriggerRef:e=>g.current=e}),[n,o,i,y,w,b]),k=N("io-dropdown",y&&"io-dropdown-open","default"!==n&&`io-dropdown-${n}`,t);return jsx(O.Provider,{value:C,children:jsx("div",{className:k,ref:v,...p,children:l})})});function Z({className:t,variant:n="default",align:o="left",children:i,...r}){const a=N("io-btn-group","default"!==n&&`io-btn-group-${n}`,"right"===o&&"io-btn-group-right",t);return jsx("div",{className:a,"data-testid":"button-group",...r,children:i})}function ee({className:t,draggable:n=!1,children:o,...i}){const r=N("io-header",n&&["draggable"],t);return jsx("header",{className:r,...i,children:o})}function te({className:t,children:n,...o}){const i=N("io-dialog-header",t);return jsx(ee,{"data-testid":"io-dialog-header",className:i,...o,children:n})}function ne({className:t,children:n,...o}){const i=N("io-dialog-body",t);return jsx("div",{"data-testid":"io-dialog-body",className:i,...o,children:n})}function oe({className:t,children:n,...o}){const i=N("io-footer",t);return jsx("footer",{className:i,...o,children:n})}function ie({className:t,...n}){const o=N("io-dialog-footer",t);return jsx(oe,{"data-testid":"io-dialog-footer",className:o,...n})}function re({className:n,variant:o="default",title:i="Dialog Title",isOpen:r=!1,draggable:a=!1,closeFn:s,children:l,...c}){const u=useRef(null),f=N("io-dialog","centered"===o&&"io-dialog-center",n);return useLayoutEffect$1(()=>{const e=u?.current;e&&(r?e.showModal():"function"==typeof e.close&&e.close());},[r]),jsxs("dialog",{"data-testid":"io-dialog",className:f,ref:u,"data-modal":!0,onClose:()=>{r&&s&&s();},onClick:e=>{r&&s&&"DIALOG"===e.target.nodeName&&s();},onKeyDown:e=>{const t=e.target instanceof HTMLDialogElement&&"DIALOG"===e.target.nodeName;r&&s&&" "===e.key&&t&&s();},...c,children:[jsxs(te,{draggable:a,children:[jsx("h3",{"data-testid":"io-dialog-title",children:i}),jsx(Z,{children:jsx(D,{className:"non-draggable","data-testid":"io-dialog-close-button",size:"24",icon:"close",iconSize:"12",onClick:s,tabIndex:-1})})]}),l]})}function ae(){return "undefined"!=typeof window}function se(e){return ue(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return (null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ce(e){var t;return null==(t=(ue(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ue(e){return !!ae()&&(e instanceof Node||e instanceof le(e).Node)}function de(e){return !!ae()&&(e instanceof Element||e instanceof le(e).Element)}function fe(e){return !!ae()&&(e instanceof HTMLElement||e instanceof le(e).HTMLElement)}function me(e){return !(!ae()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof le(e).ShadowRoot)}X.Button=F,X.ButtonIcon=L,X.Content=B,X.List=Y,X.Item=U,X.ItemTitle=K,X.ItemSection=J,X.Separator=G,Z.Button=T,Z.ButtonIcon=D,Z.Dropdown=X,ee.Title=M,ee.ButtonGroup=Z,ee.Button=T,ee.ButtonIcon=D,ee.Dropdown=X,te.Title=M,te.ButtonGroup=Z,te.Button=T,te.ButtonIcon=D,te.Dropdown=X,ne.Content=function({className:t,children:n,...o}){const i=N("io-dialog-content",t);return jsx("div",{className:i,...o,children:n})},oe.ButtonGroup=Z,oe.Button=T,oe.ButtonIcon=D,oe.Dropdown=X,ie.ButtonGroup=Z,ie.Button=T,ie.ButtonIcon=D,ie.Dropdown=X,re.Header=te,re.Body=ne,re.Footer=ie;const pe=new Set(["inline","contents"]);function he(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=Ee(e);return /auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!pe.has(i)}const ge=new Set(["table","td","th"]);function ve(e){return ge.has(se(e))}const ye=[":popover-open",":modal"];function we(e){return ye.some(t=>{try{return e.matches(t)}catch(e){return !1}})}const be=["transform","translate","scale","rotate","perspective"],Ce=["transform","translate","scale","rotate","perspective","filter"],ke=["paint","layout","strict","content"];function Ne(e){const t=Se(),n=de(e)?Ee(e):e;return be.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ce.some(e=>(n.willChange||"").includes(e))||ke.some(e=>(n.contain||"").includes(e))}function Se(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const De=new Set(["html","body","#document"]);function xe(e){return De.has(se(e))}function Ee(e){return le(e).getComputedStyle(e)}function Ie(e){return de(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Me(e){if("html"===se(e))return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||ce(e);return me(t)?t.host:t}function Pe(e){const t=Me(e);return xe(t)?e.ownerDocument?e.ownerDocument.body:e.body:fe(t)&&he(t)?t:Pe(t)}function Ae(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=Pe(e),r=i===(null==(o=e.ownerDocument)?void 0:o.body),a=le(i);if(r){const e=Te(a);return t.concat(a,a.visualViewport||[],he(i)?i:[],e&&n?Ae(e):[])}return t.concat(i,Ae(i,[],n))}function Te(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Oe(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement;}return t}function Fe(e,t){if(!e||!t)return !1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return !0;if(n&&me(n)){let n=t;for(;n;){if(e===n)return !0;n=n.parentNode||n.host;}}return !1}function Le(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Be(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function Re(e){return !(0!==e.mozInputSource||!e.isTrusted)||(je()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function _e(e){return !Be().includes("jsdom/")&&(!je()&&0===e.width&&0===e.height||je()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function He(){return /apple/i.test(navigator.vendor)}function je(){const e=/android/i;return e.test(Le())||e.test(Be())}function $e(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function ze(e){return (null==e?void 0:e.ownerDocument)||document}function We(e,t){if(null==t)return !1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ve(e){return "composedPath"in e?e.composedPath()[0]:e.target}function Ye(e){return fe(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ue(e){e.preventDefault(),e.stopPropagation();}function Ke(e){return !!e&&("combobox"===e.getAttribute("role")&&Ye(e))}const Je=Math.min,qe=Math.max,Ge=Math.round,Qe=Math.floor,Xe=e=>({x:e,y:e}),Ze={left:"right",right:"left",bottom:"top",top:"bottom"},et={start:"end",end:"start"};function tt(e,t,n){return qe(e,Je(t,n))}function nt(e,t){return "function"==typeof e?e(t):e}function ot(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return "x"===e?"y":"x"}function at(e){return "y"===e?"height":"width"}const st=new Set(["top","bottom"]);function lt(e){return st.has(ot(e))?"y":"x"}function ct(e){return rt(lt(e))}function ut(e){return e.replace(/start|end/g,e=>et[e])}const dt=["left","right"],ft=["right","left"],mt=["top","bottom"],pt=["bottom","top"];function ht(e,t,n,o){const i=it(e);let r=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ft:dt:t?dt:ft;case"left":case"right":return t?mt:pt;default:return []}}(ot(e),"start"===n,o);return i&&(r=r.map(e=>e+"-"+i),t&&(r=r.concat(r.map(ut)))),r}function gt(e){return e.replace(/left|right|bottom|top/g,e=>Ze[e])}function vt(e){const{x:t,y:n,width:o,height:i}=e;return {width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}
3344
+ /*!
3345
+ * tabbable 6.2.0
3346
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
3347
+ */var yt=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),wt="undefined"==typeof Element,bt=wt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ct=!wt&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},kt=function e(t,n){var o;void 0===n&&(n=!0);var i=null==t||null===(o=t.getAttribute)||void 0===o?void 0:o.call(t,"inert");return ""===i||"true"===i||n&&t&&e(t.parentNode)},Nt=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var a=r.shift();if(!kt(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,o);o.flatten?i.push.apply(i,l):i.push({scopeParent:a,candidates:l});}else {bt.call(a,yt)&&o.filter(a)&&(n||!t.includes(a))&&i.push(a);var c=a.shadowRoot||"function"==typeof o.getShadowRoot&&o.getShadowRoot(a),u=!kt(c,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(c&&u){var d=e(!0===c?a.children:c.children,!0,o);o.flatten?i.push.apply(i,d):i.push({scopeParent:a,candidates:d});}else r.unshift.apply(r,a.children);}}return i},St=function(e){return !isNaN(parseInt(e.getAttribute("tabindex"),10))},Dt=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return ""===n||"true"===n}(e))&&!St(e)?0:e.tabIndex},xt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Et=function(e){return "INPUT"===e.tagName},It=function(e){return function(e){return Et(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return !0;var t,n=e.form||Ct(e),o=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=o(window.CSS.escape(e.name));else try{t=o(e.name);}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return !i||i===e}(e)},Mt=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return 0===n&&0===o},Pt=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return !0;var i=bt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(bt.call(i,"details:not([open]) *"))return !0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Mt(e)}else {if("function"==typeof o){for(var r=e;e;){var a=e.parentElement,s=Ct(e);if(a&&!a.shadowRoot&&!0===o(a))return Mt(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host;}e=r;}if(function(e){var t,n,o,i,r=e&&Ct(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(o=n.ownerDocument)&&void 0!==o&&o.contains(a)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!s&&a;){var l,c,u;s=!(null===(c=a=null===(l=r=Ct(a))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(a));}return s}(e))return !e.getClientRects().length;if("legacy-full"!==n)return !0}return !1},At=function(e,t){return !(t.disabled||kt(t)||function(e){return Et(e)&&"hidden"===e.type}(t)||Pt(t,e)||function(e){return "DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return "SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var o=t.children.item(n);if("LEGEND"===o.tagName)return !!bt.call(t,"fieldset[disabled] *")||!o.contains(e)}return !0}t=t.parentElement;}return !1}(t))},Tt=function(e,t){return !(It(t)||Dt(t)<0||!At(e,t))},Ot=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return !!(isNaN(t)||t>=0)},Ft=function e(t){var n=[],o=[];return t.forEach(function(t,i){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var n=Dt(e);return n<0&&t&&!St(e)?0:n}(a,r),l=r?e(t.candidates):a;0===s?r?n.push.apply(n,l):n.push(a):o.push({documentOrder:i,tabIndex:s,item:t,isScope:r,content:l});}),o.sort(xt).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Lt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Nt([e],t.includeContainer,{filter:Tt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ot}):function(e,t,n){if(kt(e))return [];var o=Array.prototype.slice.apply(e.querySelectorAll(yt));return t&&bt.call(e,yt)&&o.unshift(e),o.filter(n)}(e,t.includeContainer,Tt.bind(null,t)),Ft(n)};function Bt(e,t,n){let{reference:o,floating:i}=e;const r=lt(t),a=ct(t),s=at(a),l=ot(t),c="y"===r,u=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,f=o[s]/2-i[s]/2;let m;switch(l){case"top":m={x:u,y:o.y-i.height};break;case"bottom":m={x:u,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:d};break;case"left":m={x:o.x-i.width,y:d};break;default:m={x:o.x,y:o.y};}switch(it(t)){case"start":m[a]-=f*(n&&c?-1:1);break;case"end":m[a]+=f*(n&&c?-1:1);}return m}async function Rt(e,t){var n;void 0===t&&(t={});const{x:o,y:i,platform:r,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=nt(t,e),p=function(e){return "number"!=typeof e?function(e){return {top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(m),h=s[f?"floating"===d?"reference":"floating":d],g=vt(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(h)))||n?h:h.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),w=await(null==r.isElement?void 0:r.isElement(y))&&await(null==r.getScale?void 0:r.getScale(y))||{x:1,y:1},b=vt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:l}):v);return {top:(g.top-b.top+p.top)/w.y,bottom:(b.bottom-g.bottom+p.bottom)/w.y,left:(g.left-b.left+p.left)/w.x,right:(b.right-g.right+p.right)/w.x}}const _t=new Set(["left","top"]);function Ht(e){const t=Ee(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=fe(e),r=i?e.offsetWidth:n,a=i?e.offsetHeight:o,s=Ge(n)!==r||Ge(o)!==a;return s&&(n=r,o=a),{width:n,height:o,$:s}}function jt(e){return de(e)?e:e.contextElement}function $t(e){const t=jt(e);if(!fe(t))return Xe(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Ht(t);let a=(r?Ge(n.width):n.width)/o,s=(r?Ge(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const zt=Xe(0);function Wt(e){const t=le(e);return Se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zt}function Vt(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),r=jt(e);let a=Xe(1);t&&(o?de(o)&&(a=$t(o)):a=$t(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==le(e))&&t}(r,n,o)?Wt(r):Xe(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,u=i.width/a.x,d=i.height/a.y;if(r){const e=le(r),t=o&&de(o)?le(o):o;let n=e,i=Te(n);for(;i&&o&&t!==n;){const e=$t(i),t=i.getBoundingClientRect(),o=Ee(i),r=t.left+(i.clientLeft+parseFloat(o.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=r,c+=a,n=le(i),i=Te(n);}}return vt({width:u,height:d,x:l,y:c})}function Yt(e,t){const n=Ie(e).scrollLeft;return t?t.left+n:Vt(ce(e)).left+n}function Ut(e,t,n){void 0===n&&(n=!1);const o=e.getBoundingClientRect();return {x:o.left+t.scrollLeft-(n?0:Yt(e,o)),y:o.top+t.scrollTop}}const Kt=new Set(["absolute","fixed"]);function Jt(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=le(e),o=ce(e),i=n.visualViewport;let r=o.clientWidth,a=o.clientHeight,s=0,l=0;if(i){r=i.width,a=i.height;const e=Se();(!e||e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop);}return {width:r,height:a,x:s,y:l}}(e,n);else if("document"===t)o=function(e){const t=ce(e),n=Ie(e),o=e.ownerDocument.body,i=qe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=qe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let a=-n.scrollLeft+Yt(e);const s=-n.scrollTop;return "rtl"===Ee(o).direction&&(a+=qe(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:a,y:s}}(ce(e));else if(de(t))o=function(e,t){const n=Vt(e,!0,"fixed"===t),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=fe(e)?$t(e):Xe(1);return {width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:i*r.x,y:o*r.y}}(t,n);else {const n=Wt(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height};}return vt(o)}function qt(e,t){const n=Me(e);return !(n===t||!de(n)||xe(n))&&("fixed"===Ee(n).position||qt(n,t))}function Gt(e,t,n){const o=fe(t),i=ce(t),r="fixed"===n,a=Vt(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const l=Xe(0);function c(){l.x=Yt(i);}if(o||!o&&!r)if(("body"!==se(t)||he(i))&&(s=Ie(t)),o){const e=Vt(t,!0,r,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop;}else i&&c();r&&!o&&i&&c();const u=!i||o||r?Xe(0):Ut(i,s);return {x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function Qt(e){return "static"===Ee(e).position}function Xt(e,t){if(!fe(e)||"fixed"===Ee(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ce(e)===n&&(n=n.ownerDocument.body),n}function Zt(e,t){const n=le(e);if(we(e))return n;if(!fe(e)){let t=Me(e);for(;t&&!xe(t);){if(de(t)&&!Qt(t))return t;t=Me(t);}return n}let o=Xt(e,t);for(;o&&ve(o)&&Qt(o);)o=Xt(o,t);return o&&xe(o)&&Qt(o)&&!Ne(o)?n:o||function(e){let t=Me(e);for(;fe(t)&&!xe(t);){if(Ne(t))return t;if(we(t))return null;t=Me(t);}return null}(e)||n}const en={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r="fixed"===i,a=ce(o),s=!!t&&we(t.floating);if(o===a||s&&r)return n;let l={scrollLeft:0,scrollTop:0},c=Xe(1);const u=Xe(0),d=fe(o);if((d||!d&&!r)&&(("body"!==se(o)||he(a))&&(l=Ie(o)),fe(o))){const e=Vt(o);c=$t(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop;}const f=!a||d||r?Xe(0):Ut(a,l,!0);return {width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:ce,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[..."clippingAncestors"===n?we(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Ae(e,[],!1).filter(e=>de(e)&&"body"!==se(e)),i=null;const r="fixed"===Ee(e).position;let a=r?Me(e):e;for(;de(a)&&!xe(a);){const t=Ee(a),n=Ne(a);n||"fixed"!==t.position||(i=null),(r?!n&&!i:!n&&"static"===t.position&&i&&Kt.has(i.position)||he(a)&&!n&&qt(e,a))?o=o.filter(e=>e!==a):i=t,a=Me(a);}return t.set(e,o),o}(t,this._c):[].concat(n),o],a=r[0],s=r.reduce((e,n)=>{const o=Jt(t,n,i);return e.top=qe(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=qe(o.left,e.left),e},Jt(t,a,i));return {width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Zt,getElementRects:async function(e){const t=this.getOffsetParent||Zt,n=this.getDimensions,o=await n(e.floating);return {reference:Gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Ht(e);return {width:t,height:n}},getScale:$t,isElement:de,isRTL:function(e){return "rtl"===Ee(e).direction}};function tn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nn(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=o,c=jt(e),u=i||r?[...c?Ae(c):[],...Ae(t)]:[];u.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n);});const d=c&&s?function(e,t){let n,o=null;const i=ce(e);function r(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null;}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),r();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const p={rootMargin:-Qe(d)+"px "+-Qe(i.clientWidth-(u+f))+"px "+-Qe(i.clientHeight-(d+m))+"px "+-Qe(u)+"px",threshold:qe(0,Je(1,l))||1};let h=!0;function g(t){const o=t[0].intersectionRatio;if(o!==l){if(!h)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7);},1e3);}1!==o||tn(c,e.getBoundingClientRect())||a(),h=!1;}try{o=new IntersectionObserver(g,{...p,root:i.ownerDocument});}catch(e){o=new IntersectionObserver(g,p);}o.observe(e);}(!0),r}(c,n):null;let f,m=-1,p=null;a&&(p=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t);})),n();}),c&&!l&&p.observe(c),p.observe(t));let h=l?Vt(e):null;return l&&function t(){const o=Vt(e);h&&!tn(h,o)&&n();h=o,f=requestAnimationFrame(t);}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n);}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f);}}const on=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:o,elements:i}=e,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),a=ot(n),s=it(n),l="y"===lt(n),c=_t.has(a)?-1:1,u=r&&l?-1:1,d=nt(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:a}}}}},rn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return {x:t,y:n}}},...l}=nt(e,t),c={x:n,y:o},u=await Rt(t,l),d=lt(ot(i)),f=rt(d);let m=c[f],p=c[d];if(r){const e="y"===f?"bottom":"right";m=tt(m+u["y"===f?"top":"left"],m,m-u[e]);}if(a){const e="y"===d?"bottom":"right";p=tt(p+u["y"===d?"top":"left"],p,p-u[e]);}const h=s.fn({...t,[f]:m,[d]:p});return {...h,data:{x:h.x-n,y:h.y-o,enabled:{[f]:r,[d]:a}}}}}},an=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=nt(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=ot(i),y=lt(s),w=ot(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),C=f||(w||!h?[gt(s)]:function(e){const t=gt(e);return [ut(e),t,ut(t)]}(s)),k="none"!==p;!f&&k&&C.push(...ht(s,h,p,b));const N=[s,...C],S=await Rt(t,g),D=[];let x=(null==(o=r.flip)?void 0:o.overflows)||[];if(u&&D.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const o=it(e),i=ct(e),r=at(i);let a="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=gt(a)),[a,gt(a)]}(i,a,b);D.push(S[e[0]],S[e[1]]);}if(x=[...x,{placement:i,overflows:D}],!D.every(e=>e<=0)){var E,I;const e=((null==(E=r.flip)?void 0:E.index)||0)+1,t=N[e];if(t){if(!("alignment"===d&&y!==lt(t))||x.every(e=>lt(e.placement)!==y||e.overflows[0]>0))return {data:{index:e,overflows:x},reset:{placement:t}}}let n=null==(I=x.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(m){case"bestFit":{var M;const e=null==(M=x.filter(e=>{if(k){const t=lt(e.placement);return t===y||"y"===t}return !0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:M[0];e&&(n=e);break}case"initialPlacement":n=s;}if(i!==n)return {reset:{placement:n}}}return {}}}},sn=(e,t,n)=>{const o=new Map,i={platform:en,...n},r={...i.platform,_c:o};return (async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Bt(c,o,l),f=o,m={},p=0;for(let n=0;n<s.length;n++){const{name:r,fn:h}=s[n],{x:g,y:v,data:y,reset:w}=await h({x:u,y:d,initialPlacement:o,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,m={...m,[r]:{...m[r],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),({x:u,y:d}=Bt(c,f,l))),n=-1);}return {x:u,y:d,placement:f,strategy:i,middlewareData:m}})(e,t,{...i,platform:r})};var ln="undefined"!=typeof document?useLayoutEffect$1:function(){};function cn(e,t){if(e===t)return !0;if(typeof e!=typeof t)return !1;if("function"==typeof e&&e.toString()===t.toString())return !0;let n,o,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return !1;for(o=n;0!==o--;)if(!cn(e[o],t[o]))return !1;return !0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return !1;for(o=n;0!==o--;)if(!{}.hasOwnProperty.call(t,i[o]))return !1;for(o=n;0!==o--;){const n=i[o];if(("_owner"!==n||!e.$$typeof)&&!cn(e[n],t[n]))return !1}return !0}return e!=e&&t!=t}function un(e){if("undefined"==typeof window)return 1;return (e.ownerDocument.defaultView||window).devicePixelRatio||1}function dn(e,t){const n=un(e);return Math.round(t*n)/n}function fn(e){const t=React.useRef(e);return ln(()=>{t.current=e;}),t}const mn=(e,t)=>({...rn(e),options:[e,t]}),pn=(e,t)=>({...an(e),options:[e,t]});function hn(e){return React.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t);});},e)}const gn={...React},vn=gn.useInsertionEffect||(e=>e());function yn(e){const t=React.useRef(()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")});return vn(()=>{t.current=e;}),React.useCallback(function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return null==t.current?void 0:t.current(...n)},[])}const wn="ArrowUp",bn="ArrowDown",Cn="ArrowLeft",kn="ArrowRight";function Nn(e,t,n){return Math.floor(e/t)!==n}function Sn(e,t){return t<0||t>=e.current.length}function Dn(e,t){return En(e,{disabledIndices:t})}function xn(e,t){return En(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function En(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:i,amount:r=1}=void 0===t?{}:t;const a=e.current;let s=n;do{s+=o?-r:r;}while(s>=0&&s<=a.length-1&&Pn(a,s,i));return s}function In(e,t,n,o,i){if(-1===e)return -1;const r=n.indexOf(e),a=t[e];switch(i){case"tl":return r;case"tr":return a?r+a.width-1:r;case"bl":return a?r+(a.height-1)*o:r;case"br":return n.lastIndexOf(e)}}function Mn(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function Pn(e,t,n){if(n)return n.includes(t);const o=e[t];return null==o||o.hasAttribute("disabled")||"true"===o.getAttribute("aria-disabled")}var An="undefined"!=typeof document?useLayoutEffect$1:useEffect$1;function Tn(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const On=React.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Fn(e){const{children:t,elementsRef:n,labelsRef:i}=e,[r,a]=React.useState(()=>new Map),s=React.useCallback(e=>{a(t=>new Map(t).set(e,null));},[]),l=React.useCallback(e=>{a(t=>{const n=new Map(t);return n.delete(e),n});},[]);return An(()=>{const e=new Map(r);Array.from(e.keys()).sort(Tn).forEach((t,n)=>{e.set(t,n);}),function(e,t){if(e.size!==t.size)return !1;for(const[n,o]of e.entries())if(o!==t.get(n))return !1;return !0}(r,e)||a(e);},[r]),React.createElement(On.Provider,{value:React.useMemo(()=>({register:s,unregister:l,map:r,elementsRef:n,labelsRef:i}),[s,l,r,n,i])},t)}function Ln(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:i,map:r,elementsRef:a,labelsRef:s}=React.useContext(On),[l,c]=React.useState(null),u=React.useRef(null),d=React.useCallback(e=>{if(u.current=e,null!==l&&(a.current[l]=e,s)){var n;const o=void 0!==t;s.current[l]=o?t:null!=(n=null==e?void 0:e.textContent)?n:null;}},[l,a,s,t]);return An(()=>{const e=u.current;if(e)return n(e),()=>{i(e);}},[n,i]),An(()=>{const e=u.current?r.get(u.current):null;null!=e&&c(e);},[r]),React.useMemo(()=>({ref:d,index:null==l?-1:l}),[l,d])}function Bn(){return Bn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);}return e},Bn.apply(this,arguments)}let Rn=!1,_n=0;const Hn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_n++;const jn=gn.useId||function(){const[e,t]=React.useState(()=>Rn?Hn():void 0);return An(()=>{null==e&&t(Hn());},[]),React.useEffect(()=>{Rn=!0;},[]),e};let $n;function zn(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const i="Floating UI: "+n.join(" ");var r;null!=(e=$n)&&e.has(i)||(null==(r=$n)||r.add(i),console.warn(i));}function Wn(){const e=new Map;return {emit(t,n){var o;null==(o=e.get(t))||o.forEach(e=>e(n));},on(t,n){e.set(t,[...e.get(t)||[],n]);},off(t,n){var o;e.set(t,(null==(o=e.get(t))?void 0:o.filter(e=>e!==n))||[]);}}}"production"!==process.env.NODE_ENV&&($n=new Set);const Vn=React.createContext(null),Yn=React.createContext(null),Un=()=>{var e;return (null==(e=React.useContext(Vn))?void 0:e.id)||null},Kn=()=>React.useContext(Yn);function Jn(e){const{children:t,id:n}=e,i=Un();return React.createElement(Vn.Provider,{value:React.useMemo(()=>({id:n,parentId:i}),[n,i])},t)}function qn(e){const{children:t}=e,n=React.useRef([]),i=React.useCallback(e=>{n.current=[...n.current,e];},[]),r=React.useCallback(e=>{n.current=n.current.filter(t=>t!==e);},[]),a=React.useState(()=>Wn())[0];return React.createElement(Yn.Provider,{value:React.useMemo(()=>({nodesRef:n,addNode:i,removeNode:r,events:a}),[i,r,a])},t)}function Gn(e){return "data-floating-ui-"+e}function Qn(e){const t=useRef(e);return An(()=>{t.current=e;}),t}const Xn=Gn("safe-polygon");function Zn(e,t,n){return n&&!$e(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let eo=0;function to(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(eo);const r=()=>null==e?void 0:e.focus({preventScroll:n});i?r():eo=requestAnimationFrame(r);}function no(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),o=n;for(;o.length;)o=e.filter(e=>{var t;return null==(t=o)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(o);return n}let oo=new WeakMap,io=new WeakSet,ro={},ao=0;const so=e=>e&&(e.host||so(e.parentNode));function lo(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,a=(s=t,e.map(e=>{if(s.contains(e))return e;const t=so(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const l=new Set,c=new Set(a),u=[];ro[i]||(ro[i]=new WeakMap);const d=ro[i];return a.forEach(function e(t){if(!t||l.has(t))return;l.add(t),t.parentNode&&e(t.parentNode);}),function e(t){if(!t||c.has(t))return;[].forEach.call(t.children,t=>{if("script"!==se(t))if(l.has(t))e(t);else {const e=r?t.getAttribute(r):null,n=null!==e&&"false"!==e,o=(oo.get(t)||0)+1,a=(d.get(t)||0)+1;oo.set(t,o),d.set(t,a),u.push(t),1===o&&n&&io.add(t),1===a&&t.setAttribute(i,""),!n&&r&&t.setAttribute(r,"true");}});}(t),l.clear(),ao++,()=>{u.forEach(e=>{const t=(oo.get(e)||0)-1,n=(d.get(e)||0)-1;oo.set(e,t),d.set(e,n),t||(!io.has(e)&&r&&e.removeAttribute(r),io.delete(e)),n||e.removeAttribute(i);}),ao--,ao||(oo=new WeakMap,oo=new WeakMap,io=new WeakSet,ro={});}}function co(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=ze(e[0]).body;return lo(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const uo=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function fo(e,t){const n=Lt(e,uo());"prev"===t&&n.reverse();const o=n.indexOf(Oe(ze(e)));return n.slice(o+1)[0]}function mo(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return !o||!Fe(n,o)}const po={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function ho(e){"Tab"===e.key&&(e.target,clearTimeout(undefined));}const go=React.forwardRef(function(e,t){const[n,i]=React.useState();An(()=>(He()&&i("button"),document.addEventListener("keydown",ho),()=>{document.removeEventListener("keydown",ho);}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Gn("focus-guard")]:"",style:po};return React.createElement("span",Bn({},e,r))}),vo=React.createContext(null),yo="data-floating-ui-focusable";function wo(e){return e?e.hasAttribute(yo)?e:e.querySelector("["+yo+"]")||e:null}let bo=[];function Co(e){bo=bo.filter(e=>e.isConnected);let t=e;if(t&&"body"!==se(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return !1!==bt.call(e,yt)&&Tt(t,e)}(t,uo())){const e=Lt(t,uo())[0];e&&(t=e);}bo.push(t),bo.length>20&&(bo=bo.slice(-20));}}function ko(){return bo.slice().reverse().find(e=>e.isConnected)}const No=React.forwardRef(function(e,t){return React.createElement("button",Bn({},e,{type:"button",ref:t,tabIndex:-1,style:po}))});function So(e){const{context:t,children:n,disabled:i=!1,order:r=["content"],guards:a=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:m,refs:p,nodeId:h,onOpenChange:g,events:v,dataRef:y,floatingId:w,elements:{domReference:b,floating:C}}=t,k="number"==typeof s&&s<0,N=Ke(b)&&k,S="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,D=Qn(r),x=Qn(s),E=Qn(l),I=Kn(),M=React.useContext(vo),P=React.useRef(null),A=React.useRef(null),T=React.useRef(!1),O=React.useRef(!1),F=React.useRef(-1),L=null!=M,B=wo(C),R=yn(function(e){return void 0===e&&(e=B),e?Lt(e,uo()):[]}),_=yn(e=>{const t=R(e);return D.current.map(e=>b&&"reference"===e?b:B&&"floating"===e?B:t).filter(Boolean).flat()});function H(e){return !i&&d&&u?React.createElement(No,{ref:"start"===e?P:A,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}React.useEffect(()=>{if(i)return;if(!u)return;function e(e){if("Tab"===e.key){Fe(B,Oe(ze(B)))&&0===R().length&&!N&&Ue(e);const t=_(),n=Ve(e);"reference"===D.current[0]&&n===b&&(Ue(e),e.shiftKey?to(t[t.length-1]):to(t[1])),"floating"===D.current[1]&&n===B&&e.shiftKey&&(Ue(e),to(t[0]));}}const t=ze(B);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e);}},[i,b,B,u,D,N,R,_]),React.useEffect(()=>{if(!i&&C)return C.addEventListener("focusin",e),()=>{C.removeEventListener("focusin",e);};function e(e){const t=Ve(e),n=R().indexOf(t);-1!==n&&(F.current=n);}},[i,C,R]),React.useEffect(()=>{if(!i&&f)return C&&fe(b)?(b.addEventListener("focusout",t),b.addEventListener("pointerdown",e),C.addEventListener("focusout",t),()=>{b.removeEventListener("focusout",t),b.removeEventListener("pointerdown",e),C.removeEventListener("focusout",t);}):void 0;function e(){O.current=!0,setTimeout(()=>{O.current=!1;});}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(Fe(b,t)||Fe(C,t)||Fe(t,C)||Fe(null==M?void 0:M.portalNode,t)||null!=t&&t.hasAttribute(Gn("focus-guard"))||I&&(no(I.nodesRef.current,h).find(e=>{var n,o;return Fe(null==(n=e.context)?void 0:n.elements.floating,t)||Fe(null==(o=e.context)?void 0:o.elements.domReference,t)})||function(e,t){var n;let o=[],i=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;i;){const t=e.find(e=>e.id===i);i=null==t?void 0:t.parentId,t&&(o=o.concat(t));}return o}(I.nodesRef.current,h).find(e=>{var n,o;return (null==(n=e.context)?void 0:n.elements.floating)===t||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(c&&n&&Oe(ze(B))===ze(B).body){fe(B)&&B.focus();const e=F.current,t=R(),n=t[e]||t[t.length-1]||B;fe(n)&&n.focus();}!N&&u||!t||!n||O.current||t===ko()||(T.current=!0,g(!1,e,"focus-out"));});}},[i,b,C,B,u,h,I,M,g,f,c,R,N]),React.useEffect(()=>{var e;if(i)return;const t=Array.from((null==M||null==(e=M.portalNode)?void 0:e.querySelectorAll("["+Gn("portal")+"]"))||[]);if(C){const e=[C,...t,P.current,A.current,D.current.includes("reference")||N?b:null].filter(e=>null!=e),n=u||N?co(e,S,!S):co(e);return ()=>{n();}}},[i,b,C,u,D,M,N,S]),An(()=>{if(i||!fe(B))return;const e=Oe(ze(B));queueMicrotask(()=>{const t=_(B),n=x.current,o=("number"==typeof n?t[n]:n.current)||B,i=Fe(B,e);k||i||!m||to(o,{preventScroll:o===B});});},[i,m,B,k,_,x]),An(()=>{if(i||!B)return;let e=!1;const t=ze(B),n=Oe(t);let o=y.current.openEvent;function r(t){let{open:n,reason:i,event:r,nested:a}=t;n&&(o=r),"escape-key"===i&&p.domReference.current&&Co(p.domReference.current),"hover"===i&&"mouseleave"===r.type&&(T.current=!0),"outside-press"===i&&(a?(T.current=!1,e=!0):T.current=!(Re(r)||_e(r)));}Co(n),v.on("openchange",r);const a=t.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,po),L&&b&&b.insertAdjacentElement("afterend",a),()=>{v.off("openchange",r);const n=Oe(t),i=Fe(C,n)||I&&no(I.nodesRef.current,h).some(e=>{var t;return Fe(null==(t=e.context)?void 0:t.elements.floating,n)});(i||o&&["click","mousedown"].includes(o.type))&&p.domReference.current&&Co(p.domReference.current);const s="boolean"==typeof E.current?ko()||a:E.current.current||a;queueMicrotask(()=>{E.current&&!T.current&&fe(s)&&(s===n||n===t.body||i)&&s.focus({preventScroll:e}),a.remove();});}},[i,C,B,E,y,p,v,I,h,L,b]),React.useEffect(()=>{queueMicrotask(()=>{T.current=!1;});},[i]),An(()=>{if(!i&&M)return M.setFocusManagerState({modal:u,closeOnFocusOut:f,open:m,onOpenChange:g,refs:p}),()=>{M.setFocusManagerState(null);}},[i,M,u,m,g,p,f]),An(()=>{if(i)return;if(!B)return;if("function"!=typeof MutationObserver)return;if(k)return;const e=()=>{const e=B.getAttribute("tabindex"),t=R(),n=Oe(ze(C)),o=t.indexOf(n);-1!==o&&(F.current=o),D.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&B.setAttribute("tabindex","0"):"-1"!==e&&B.setAttribute("tabindex","-1");};e();const t=new MutationObserver(e);return t.observe(B,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect();}},[i,C,B,p,D,R,k]);const j=!i&&S&&(!u||!N)&&(L||u);return React.createElement(React.Fragment,null,j&&React.createElement(go,{"data-type":"inside",ref:null==M?void 0:M.beforeInsideRef,onFocus:e=>{if(u){const e=_();to("reference"===r[0]?e[0]:e[e.length-1]);}else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(T.current=!1,mo(e,M.portalNode)){const e=fo(document.body,"next")||b;null==e||e.focus();}else {var t;null==(t=M.beforeOutsideRef.current)||t.focus();}}}),!N&&H("start"),n,H("end"),j&&React.createElement(go,{"data-type":"inside",ref:null==M?void 0:M.afterInsideRef,onFocus:e=>{if(u)to(_()[0]);else if(null!=M&&M.preserveTabOrder&&M.portalNode)if(f&&(T.current=!0),mo(e,M.portalNode)){const e=fo(document.body,"prev")||b;null==e||e.focus();}else {var t;null==(t=M.afterOutsideRef.current)||t.focus();}}}))}function Do(e){return fe(e.target)&&"BUTTON"===e.target.tagName}function xo(e){return Ye(e)}const Eo={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Io={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Mo=e=>{var t,n;return {escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Po(e){const{open:t=!1,onOpenChange:n,elements:i}=e,r=jn(),a=React.useRef({}),[s]=React.useState(()=>Wn()),l=null!=Un();if("production"!==process.env.NODE_ENV){const e=i.reference;e&&!de(e)&&function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const i="Floating UI: "+n.join(" ");var r;null!=(e=$n)&&e.has(i)||(null==(r=$n)||r.add(i),console.error(i));}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.");}const[c,u]=React.useState(i.reference),d=yn((e,t,o)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:o,nested:l}),null==n||n(e,t,o);}),f=React.useMemo(()=>({setPositionReference:u}),[]),m=React.useMemo(()=>({reference:c||i.reference||null,floating:i.floating||null,domReference:i.reference}),[c,i.reference,i.floating]);return React.useMemo(()=>({dataRef:a,open:t,onOpenChange:d,elements:m,events:s,floatingId:r,refs:f}),[t,d,m,s,r,f])}function Ao(e){void 0===e&&(e={});const{nodeId:t}=e,n=Po({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||n,r=i.elements,[a,s]=React.useState(null),[l,c]=React.useState(null),u=(null==r?void 0:r.domReference)||a,d=React.useRef(null),f=Kn();An(()=>{u&&(d.current=u);},[u]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=React.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=React.useState(i);cn(m,i)||p(i);const[h,g]=React.useState(null),[y,w]=React.useState(null),b=React.useCallback(e=>{e!==S.current&&(S.current=e,g(e));},[]),C=React.useCallback(e=>{e!==D.current&&(D.current=e,w(e));},[]),k=a||h,N=s||y,S=React.useRef(null),D=React.useRef(null),x=React.useRef(d),E=null!=c,I=fn(c),M=fn(r),P=fn(u),A=React.useCallback(()=>{if(!S.current||!D.current)return;const e={placement:t,strategy:n,middleware:m};M.current&&(e.platform=M.current),sn(S.current,D.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};T.current&&!cn(x.current,t)&&(x.current=t,ReactDOM.flushSync(()=>{f(t);}));});},[m,t,n,M,P]);ln(()=>{!1===u&&x.current.isPositioned&&(x.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})));},[u]);const T=React.useRef(!1);ln(()=>(T.current=!0,()=>{T.current=!1;}),[]),ln(()=>{if(k&&(S.current=k),N&&(D.current=N),k&&N){if(I.current)return I.current(k,N,A);A();}},[k,N,A,I,E]);const O=React.useMemo(()=>({reference:S,floating:D,setReference:b,setFloating:C}),[b,C]),F=React.useMemo(()=>({reference:k,floating:N}),[k,N]),L=React.useMemo(()=>{const e={position:n,left:0,top:0};if(!F.floating)return e;const t=dn(F.floating,d.x),o=dn(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+o+"px)",...un(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:o}},[n,l,F.floating,d.x,d.y]);return React.useMemo(()=>({...d,update:A,refs:O,elements:F,floatingStyles:L}),[d,A,O,F,L])}({...e,elements:{...r,...l&&{reference:l}}}),p=React.useCallback(e=>{const t=de(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),m.refs.setReference(t);},[m.refs]),h=React.useCallback(e=>{(de(e)||null===e)&&(d.current=e,s(e)),(de(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!de(e))&&m.refs.setReference(e);},[m.refs]),g=React.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),y=React.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),w=React.useMemo(()=>({...m,...i,refs:g,elements:y,nodeId:t}),[m,g,y,t,i]);return An(()=>{i.dataRef.current.floatingContext=w;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=w);}),React.useMemo(()=>({...m,context:w,refs:g,elements:y}),[m,g,y,w])}const To="active",Oo="selected";function Fo(e,t,n){const o=new Map,i="item"===n;let r=e;if(i&&e){const{[To]:t,[Oo]:n,...o}=e;r=o;}return {..."floating"===n&&{tabIndex:-1,[yo]:""},...r,...t.map(t=>{const o=t?t[n]:null;return "function"==typeof o?e?o(e):null:o}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,r]=t;var a;i&&[To,Oo].includes(n)||(0===n.indexOf("on")?(o.has(n)||o.set(n,[]),"function"==typeof r&&(null==(a=o.get(n))||a.push(r),e[n]=function(){for(var e,t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return null==(e=o.get(n))?void 0:e.map(e=>e(...i)).find(e=>void 0!==e)})):e[n]=r);}),e):e,{})}}let Lo=!1;function Bo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ro(e,t){return Bo(t,e===wn||e===bn,e===Cn||e===kn)}function _o(e,t,n){return Bo(t,e===bn,n?e===Cn:e===kn)||"Enter"===e||" "===e||""===e}function Ho(e,t,n){return Bo(t,n?e===kn:e===Cn,e===wn)}function jo(e,t){const{open:n,onOpenChange:i,elements:r}=e,{listRef:a,activeIndex:s,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:m=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:y=!0,disabledIndices:w,orientation:b="vertical",cols:C=1,scrollItemIntoView:k=!0,virtualItemRef:N,itemSizes:S,dense:D=!1}=t;"production"!==process.env.NODE_ENV&&(d&&(f||zn("`useListNavigation` looping must be enabled to allow escaping."),h||zn("`useListNavigation` must be virtual to allow escaping.")),"vertical"===b&&C>1&&zn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const x=Qn(wo(r.floating)),E=Un(),I=Kn(),M=yn(l),P=Ke(r.domReference),A=React.useRef(g),T=React.useRef(null!=u?u:-1),O=React.useRef(null),F=React.useRef(!0),L=React.useRef(M),B=React.useRef(!!r.floating),R=React.useRef(n),_=React.useRef(!1),H=React.useRef(!1),j=Qn(w),$=Qn(n),z=Qn(k),W=Qn(u),[V,Y]=React.useState(),[U,K]=React.useState(),J=yn(function(e,t,n){function o(e){h?(Y(e.id),null==I||I.events.emit("virtualfocus",e),N&&(N.current=e)):to(e,{preventScroll:!0,sync:!(!Le().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!He())&&(Lo||_.current)});}void 0===n&&(n=!1);const i=e.current[t.current];i&&o(i),requestAnimationFrame(()=>{const r=e.current[t.current]||i;if(!r)return;i||o(r);const a=z.current;a&&G&&(n||!F.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof a?{block:"nearest",inline:"nearest"}:a));});});An(()=>{document.createElement("div").focus({get preventScroll(){return Lo=!0,!1}});},[]),An(()=>{c&&(n&&r.floating?A.current&&null!=u&&(H.current=!0,T.current=u,M(u)):B.current&&(T.current=-1,L.current(null)));},[c,n,r.floating,u,M]),An(()=>{if(c&&n&&r.floating)if(null==s){if(_.current=!1,null!=W.current)return;if(B.current&&(T.current=-1,J(a,T)),(!R.current||!B.current)&&A.current&&(null!=O.current||!0===A.current&&null==O.current)){let e=0;const t=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t);}e++;}else T.current=null==O.current||_o(O.current,b,p)||m?Dn(a,j.current):xn(a,j.current),O.current=null,M(T.current);};t();}}else Sn(a,s)||(T.current=s,J(a,T,H.current),H.current=!1);},[c,n,r.floating,s,W,m,a,b,p,M,J,j]),An(()=>{var e;if(!c||r.floating||!I||h||!B.current)return;const t=I.nodesRef.current,n=null==(e=t.find(e=>e.id===E))||null==(e=e.context)?void 0:e.elements.floating,o=Oe(ze(r.floating)),i=t.some(e=>e.context&&Fe(e.context.elements.floating,o));n&&!i&&F.current&&n.focus({preventScroll:!0});},[c,r.floating,I,E,h]),An(()=>{if(c&&I&&h&&!E)return I.events.on("virtualfocus",e),()=>{I.events.off("virtualfocus",e);};function e(e){K(e.id),N&&(N.current=e);}},[c,I,h,E,N]),An(()=>{L.current=M,B.current=!!r.floating;}),An(()=>{n||(O.current=null);},[n]),An(()=>{R.current=n;},[n]);const q=null!=s,G=React.useMemo(()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&M(t);}return {onFocus(t){let{currentTarget:n}=t;e(n);},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n);},onPointerLeave(e){let{pointerType:t}=e;F.current&&"touch"!==t&&(T.current=-1,J(a,T),M(null),h||to(x.current,{preventScroll:!0}));}}}},[n,x,J,v,a,M,h]),Q=yn(e=>{if(F.current=!1,_.current=!0,229===e.which)return;if(!$.current&&e.currentTarget===x.current)return;if(m&&Ho(e.key,b,p))return Ue(e),i(!1,e.nativeEvent,"list-navigation"),void(fe(r.domReference)&&(h?null==I||I.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const t=T.current,o=Dn(a,w),s=xn(a,w);if(P||("Home"===e.key&&(Ue(e),T.current=o,M(T.current)),"End"===e.key&&(Ue(e),T.current=s,M(T.current))),C>1){const t=S||Array.from({length:a.current.length},()=>({width:1,height:1})),n=function(e,t,n){const o=[];let i=0;return e.forEach((e,r)=>{let{width:a,height:s}=e;if(a>t&&"production"!==process.env.NODE_ENV)throw new Error("[Floating UI]: Invalid grid - item width at index "+r+" is greater than grid columns");let l=!1;for(n&&(i=0);!l;){const e=[];for(let n=0;n<a;n++)for(let o=0;o<s;o++)e.push(i+n+o*t);i%t+a<=t&&e.every(e=>null==o[e])?(e.forEach(e=>{o[e]=r;}),l=!0):i++;}}),[...o]}(t,C,D),i=n.findIndex(e=>null!=e&&!Pn(a.current,e,w)),r=n.reduce((e,t,n)=>null==t||Pn(a.current,t,w)?e:n,-1),l=n[function(e,t){let{event:n,orientation:o,loop:i,rtl:r,cols:a,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===wn){if(d&&Ue(n),-1===u)f=c;else if(f=En(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:s}),i&&(u-a<l||f<0)){const e=u%a,t=c%a,n=c-(t-e);f=t===e?c:t>e?n:n-a;}Sn(e,f)&&(f=u);}if(n.key===bn&&(d&&Ue(n),-1===u?f=l:(f=En(e,{startingIndex:u,amount:a,disabledIndices:s}),i&&u+a>c&&(f=En(e,{startingIndex:u%a-a,amount:a,disabledIndices:s}))),Sn(e,f)&&(f=u)),"both"===o){const t=Qe(u/a);n.key===(r?Cn:kn)&&(d&&Ue(n),u%a!==a-1?(f=En(e,{startingIndex:u,disabledIndices:s}),i&&Nn(f,a,t)&&(f=En(e,{startingIndex:u-u%a-1,disabledIndices:s}))):i&&(f=En(e,{startingIndex:u-u%a-1,disabledIndices:s})),Nn(f,a,t)&&(f=u)),n.key===(r?kn:Cn)&&(d&&Ue(n),u%a!==0?(f=En(e,{startingIndex:u,decrement:!0,disabledIndices:s}),i&&Nn(f,a,t)&&(f=En(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s}))):i&&(f=En(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s})),Nn(f,a,t)&&(f=u));const o=Qe(c/a)===t;Sn(e,f)&&(f=i&&o?n.key===(r?kn:Cn)?c:En(e,{startingIndex:u-u%a-1,disabledIndices:s}):u);}return f}({current:n.map(e=>null!=e?a.current[e]:null)},{event:e,orientation:b,loop:f,rtl:p,cols:C,disabledIndices:Mn([...w||a.current.map((e,t)=>Pn(a.current,t)?t:void 0),void 0],n),minIndex:i,maxIndex:r,prevIndex:In(T.current>s?o:T.current,t,n,C,e.key===bn?"bl":e.key===(p?Cn:kn)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(T.current=l,M(T.current)),"both"===b)return}if(Ro(e.key,b)){if(Ue(e),n&&!h&&Oe(e.currentTarget.ownerDocument)===e.currentTarget)return T.current=_o(e.key,b,p)?o:s,void M(T.current);_o(e.key,b,p)?T.current=f?t>=s?d&&t!==a.current.length?-1:o:En(a,{startingIndex:t,disabledIndices:w}):Math.min(s,En(a,{startingIndex:t,disabledIndices:w})):T.current=f?t<=o?d&&-1!==t?a.current.length:s:En(a,{startingIndex:t,decrement:!0,disabledIndices:w}):Math.max(o,En(a,{startingIndex:t,decrement:!0,disabledIndices:w})),Sn(a,T.current)?M(null):M(T.current);}}),X=React.useMemo(()=>h&&n&&q&&{"aria-activedescendant":U||V},[h,n,q,U,V]),Z=React.useMemo(()=>({"aria-orientation":"both"===b?void 0:b,...!Ke(r.domReference)&&X,onKeyDown:Q,onPointerMove(){F.current=!0;}}),[X,Q,r.domReference,b]),ee=React.useMemo(()=>{function e(e){"auto"===g&&Re(e.nativeEvent)&&(A.current=!0);}return {...X,onKeyDown(e){F.current=!1;const t=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),r=t||o,s=function(e,t,n){return Bo(t,n?e===Cn:e===kn,e===bn)}(e.key,b,p),l=Ho(e.key,b,p),c=Ro(e.key,b),d=(m?s:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==I?void 0:I.nodesRef.current.find(e=>null==e.parentId),n=I&&t?function(e,t){let n,o=-1;return function t(i,r){r>o&&(n=i,o=r),no(e,i).forEach(e=>{t(e.id,r+1);});}(t,0),e.find(e=>e.id===n)}(I.nodesRef.current,t.id):null;if(r&&n&&N){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var f,g;const o=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,i=l&&!o?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find(e=>(null==e?void 0:e.id)===V):null;i&&(Ue(e),i.dispatchEvent(t),K(void 0));}var v;if((c||o)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Ue(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return Q(e)}(n||y||!t)&&(d&&(O.current=m&&c?null:e.key),m?s&&(Ue(e),n?(T.current=Dn(a,j.current),M(T.current)):i(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(T.current=u),Ue(e),!n&&y?i(!0,e.nativeEvent,"list-navigation"):Q(e),n&&M(T.current)));},onFocus(){n&&!h&&M(null);},onPointerDown:function(e){A.current=g,"auto"===g&&_e(e.nativeEvent)&&(A.current=!0);},onMouseDown:e,onClick:e}},[V,X,Q,j,g,a,m,M,i,n,y,b,p,u,I,h,N]);return React.useMemo(()=>c?{reference:ee,floating:Z,item:G}:{},[c,ee,Z,G])}const $o=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zo(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let e=0,a=r-1;e<r;a=e++){const[r,s]=t[e]||[0,0],[l,c]=t[a]||[0,0];s>=o!=c>=o&&n<=(l-r)*(o-s)/(c-s)+r&&(i=!i);}return i}function Wo(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let i,r=!1,a=null,s=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:m,tree:p}=e;return function(e){function h(){clearTimeout(i),f();}if(clearTimeout(i),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:v}=e,y=[g,v],w=Ve(e),b="mouseleave"===e.type,C=Fe(d.floating,w),k=Fe(d.domReference,w),N=d.domReference.getBoundingClientRect(),S=d.floating.getBoundingClientRect(),D=u.split("-")[0],x=n>S.right-S.width/2,E=c>S.bottom-S.height/2,I=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,N),M=S.width>N.width,P=S.height>N.height,A=(M?N:S).left,T=(M?N:S).right,O=(P?N:S).top,F=(P?N:S).bottom;if(C&&(r=!0,!b))return;if(k&&(r=!1),k&&!b)return void(r=!0);if(b&&de(e.relatedTarget)&&Fe(d.floating,e.relatedTarget))return;if(p&&no(p.nodesRef.current,m).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===D&&c>=N.bottom-1||"bottom"===D&&c<=N.top+1||"left"===D&&n>=N.right-1||"right"===D&&n<=N.left+1)return h();let L=[];switch(D){case"top":L=[[A,N.top+1],[A,S.bottom-1],[T,S.bottom-1],[T,N.top+1]];break;case"bottom":L=[[A,S.top+1],[A,N.bottom-1],[T,N.bottom-1],[T,S.top+1]];break;case"left":L=[[S.right-1,F],[S.right-1,O],[N.left+1,O],[N.left+1,F]];break;case"right":L=[[N.right-1,F],[N.right-1,O],[S.left+1,O],[S.left+1,F]];}if(!zo([g,v],L)){if(r&&!I)return h();if(!b&&o){const t=function(e,t){const n=performance.now(),o=n-l;if(null===a||null===s||0===o)return a=e,s=t,l=n,null;const i=e-a,r=t-s,c=Math.sqrt(i*i+r*r);return a=e,s=t,l=n,c/o}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}zo([g,v],function(e){let[n,o]=e;switch(D){case"top":return [[M?n+t/2:x?n+4*t:n-4*t,o+t+1],[M?n-t/2:x?n+4*t:n-4*t,o+t+1],...[[S.left,x||M?S.bottom-t:S.top],[S.right,x?M?S.bottom-t:S.top:S.bottom-t]]];case"bottom":return [[M?n+t/2:x?n+4*t:n-4*t,o-t],[M?n-t/2:x?n+4*t:n-4*t,o-t],...[[S.left,x||M?S.top+t:S.bottom],[S.right,x?M?S.top+t:S.bottom:S.top+t]]];case"left":{const e=[n+t+1,P?o+t/2:E?o+4*t:o-4*t],i=[n+t+1,P?o-t/2:E?o+4*t:o-4*t];return [...[[E||P?S.right-t:S.left,S.top],[E?P?S.right-t:S.left:S.right-t,S.bottom]],e,i]}case"right":return [[n-t,P?o+t/2:E?o+4*t:o-4*t],[n-t,P?o-t/2:E?o+4*t:o-4*t],...[[E||P?S.left+t:S.right,S.top],[E?P?S.left+t:S.right:S.left+t,S.bottom]]]}}([n,c]))?!r&&o&&(i=window.setTimeout(h,40)):h();}}};return c.__options={blockPointerEvents:n},c}const Vo=createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Yo=forwardRef(({className:t,disabled:n,children:o,...i},r)=>{const a=useContext(Vo),s=Ln(),c=Kn(),u=s.index===a.activeIndex,d=N("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return jsx("div",{ref:hn([s.ref,r]),role:"menuitem",className:d,tabIndex:u?0:-1,"aria-disabled":n,...i,...a.getItemProps({onClick(e){if(n)return e.preventDefault(),void e.stopPropagation();i.onClick?.(e),a.setIsOpen(!1),c?.events.emit("click");},onFocus(e){n||(i.onFocus?.(e),a.setHasFocusInside(!0));}}),children:o})});Yo.displayName="DropdownMenuItem";const Uo=forwardRef(({className:n,variant:i="default",icon:r,iconRight:a,text:s="",disabled:m,children:p,...h},g)=>{const[v,y]=useState$1(!1),[w,b]=useState$1(!1),[C,k]=useState$1(null),S=useRef([]),D=useRef([]),x=useContext(Vo),E=Kn(),I=function(){const e=jn(),t=Kn(),n=Un();return An(()=>{const o={id:e,parentId:n};return null==t||t.addNode(o),()=>{null==t||t.removeNode(o);}},[t,e,n]),e}(),M=Un(),P=Ln(),A=null!=M,{floatingStyles:O,refs:F,context:L}=Ao({nodeId:I,open:v,onOpenChange:y,placement:A?"right-start":"bottom-start",middleware:[(B={mainAxis:A?0:4,alignmentAxis:A?-4:0},{...on(B),options:[B,R]}),pn(),mn()],whileElementsMounted:nn});var B,R;const _=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,dataRef:r,events:a,elements:s}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:m=!0}=t,p=Kn(),h=Un(),g=Qn(u),v=Qn(c),y=Qn(n),w=React.useRef(),b=React.useRef(-1),C=React.useRef(),k=React.useRef(-1),N=React.useRef(!0),S=React.useRef(!1),D=React.useRef(()=>{}),x=React.useRef(!1),E=React.useCallback(()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return (null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[r]);React.useEffect(()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e);};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(k.current),N.current=!0,x.current=!1);}},[l,a]),React.useEffect(()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){E()&&i(!1,e,"hover");}const t=ze(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e);}},[s.floating,n,i,l,g,E]);const I=React.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Zn(v.current,"close",w.current);o&&!C.current?(clearTimeout(b.current),b.current=window.setTimeout(()=>i(!1,e,n),o)):t&&(clearTimeout(b.current),i(!1,e,n));},[v,i]),M=yn(()=>{D.current(),C.current=void 0;}),P=yn(()=>{if(S.current){const e=ze(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Xn),S.current=!1;}}),A=yn(()=>!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type));React.useEffect(()=>{if(l&&de(s.domReference)){var e;const i=s.domReference;return n&&i.addEventListener("mouseleave",a),null==(e=s.floating)||e.addEventListener("mouseleave",a),m&&i.addEventListener("mousemove",t,{once:!0}),i.addEventListener("mouseenter",t),i.addEventListener("mouseleave",o),()=>{var e;n&&i.removeEventListener("mouseleave",a),null==(e=s.floating)||e.removeEventListener("mouseleave",a),m&&i.removeEventListener("mousemove",t),i.removeEventListener("mouseenter",t),i.removeEventListener("mouseleave",o);}}function t(e){if(clearTimeout(b.current),N.current=!1,d&&!$e(w.current)||f>0&&!Zn(v.current,"open"))return;const t=Zn(v.current,"open",w.current);t?b.current=window.setTimeout(()=>{y.current||i(!0,e,"hover");},t):n||i(!0,e,"hover");}function o(e){if(A())return;D.current();const t=ze(s.floating);if(clearTimeout(k.current),x.current=!1,g.current&&r.current.floatingContext){n||clearTimeout(b.current),C.current=g.current({...r.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),M(),A()||I(e,!0,"safe-polygon");}});const o=C.current;return t.addEventListener("mousemove",o),void(D.current=()=>{t.removeEventListener("mousemove",o);})}("touch"!==w.current||!Fe(s.floating,e.relatedTarget))&&I(e);}function a(e){A()||r.current.floatingContext&&(null==g.current||g.current({...r.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){P(),M(),A()||I(e);}})(e));}},[s,l,e,d,f,m,I,M,P,i,n,y,p,v,g,r,A]),An(()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&E()){S.current=!0;const e=s.floating;if(de(s.domReference)&&e){var t;const n=ze(s.floating).body;n.setAttribute(Xn,"");const o=s.domReference,i=null==p||null==(t=p.nodesRef.current.find(e=>e.id===h))||null==(t=t.context)?void 0:t.elements.floating;return i&&(i.style.pointerEvents=""),n.style.pointerEvents="none",o.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",o.style.pointerEvents="",e.style.pointerEvents="";}}}},[l,n,h,s,p,g,E]),An(()=>{n||(w.current=void 0,x.current=!1,M(),P());},[n,M,P]),React.useEffect(()=>()=>{M(),clearTimeout(b.current),clearTimeout(k.current),P();},[l,s.domReference,M,P]);const T=React.useMemo(()=>{function e(e){w.current=e.pointerType;}return {onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){N.current||y.current||i(!0,t,"hover");}d&&!$e(w.current)||n||0===f||x.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(k.current),"touch"===w.current?o():(x.current=!0,k.current=window.setTimeout(o,f)));}}},[d,i,n,y,f]),O=React.useMemo(()=>({onMouseEnter(){clearTimeout(b.current);},onMouseLeave(e){A()||I(e.nativeEvent,!1);}}),[I,A]);return React.useMemo(()=>l?{reference:T,floating:O}:{},[l,T,O])}(L,{enabled:A,delay:{open:75},handleClose:Wo({blockPointerEvents:!0})}),H=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,dataRef:r,elements:{domReference:a}}=e,{enabled:s=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,m=React.useRef(),p=React.useRef(!1),h=React.useMemo(()=>({onPointerDown(e){m.current=e.pointerType;},onMouseDown(e){const t=m.current;0===e.button&&"click"!==l&&($e(t,!0)&&u||(!n||!c||r.current.openEvent&&f&&"mousedown"!==r.current.openEvent.type?(e.preventDefault(),i(!0,e.nativeEvent,"click")):i(!1,e.nativeEvent,"click")));},onClick(e){const t=m.current;"mousedown"===l&&m.current?m.current=void 0:$e(t,!0)&&u||(!n||!c||r.current.openEvent&&f&&"click"!==r.current.openEvent.type?i(!0,e.nativeEvent,"click"):i(!1,e.nativeEvent,"click"));},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||Do(e)||(" "!==e.key||xo(a)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&i(!n||!c,e.nativeEvent,"click"));},onKeyUp(e){e.defaultPrevented||!d||Do(e)||xo(a)||" "===e.key&&p.current&&(p.current=!1,i(!n||!c,e.nativeEvent,"click"));}}),[r,a,l,u,d,i,n,f,c]);return React.useMemo(()=>s?{reference:h}:{},[s,h])}(L,{event:"mousedown",toggle:!A,ignoreMouse:A}),j=function(e,t){var n;void 0===t&&(t={});const{open:i,floatingId:r}=e,{enabled:a=!0,role:s="dialog"}=t,l=null!=(n=$o.get(s))?n:s,c=jn(),u=null!=Un(),d=React.useMemo(()=>"tooltip"===l||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?r:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":i?r:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[l,r,u,i,c,s]),f=React.useMemo(()=>{const e={id:r,...l&&{role:l}};return "tooltip"===l||"label"===s?e:{...e,..."menu"===l&&{"aria-labelledby":c}}},[l,r,c,s]),m=React.useCallback(e=>{let{active:t,selected:n}=e;const o={role:"option",...t&&{id:r+"-option"}};switch(s){case"select":return {...o,"aria-selected":t&&n};case"combobox":return {...o,...t&&{"aria-selected":!0}}}return {}},[r,s]);return React.useMemo(()=>a?{reference:d,floating:f,item:m}:{},[a,d,f,m])}(L,{role:"menu"}),$=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:i,elements:r,dataRef:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:h}=t,g=Kn(),v=yn("function"==typeof c?c:()=>!1),y="function"==typeof c?v:c,w=React.useRef(!1),b=React.useRef(!1),{escapeKey:C,outsidePress:k}=Mo(p),{escapeKey:N,outsidePress:S}=Mo(h),D=React.useRef(!1),x=yn(e=>{var t;if(!n||!s||!l||"Escape"!==e.key)return;if(D.current)return;const o=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=g?no(g.nodesRef.current,o):[];if(!C&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1);}),!e)return}i(!1,function(e){return "nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key");}),E=yn(e=>{var t;const n=()=>{var t;x(e),null==(t=Ve(e))||t.removeEventListener("keydown",n);};null==(t=Ve(e))||t.addEventListener("keydown",n);}),I=yn(e=>{var t;const n=w.current;w.current=!1;const o=b.current;if(b.current=!1,"click"===u&&o)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=Ve(e),l="["+Gn("inert")+"]",c=ze(r.floating).querySelectorAll(l);let d=de(s)?s:null;for(;d&&!xe(d);){const e=Me(d);if(xe(e)||!de(e))break;d=e;}if(c.length&&de(s)&&!s.matches("html,body")&&!Fe(s,r.floating)&&Array.from(c).every(e=>!Fe(d,e)))return;if(fe(s)&&A){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let o=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===Ee(s).direction&&(o=e.offsetX<=s.offsetWidth-s.clientWidth),o||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,m=g&&no(g.nodesRef.current,f).some(t=>{var n;return We(e,null==(n=t.context)?void 0:n.elements.floating)});if(We(e,r.floating)||We(e,r.domReference)||m)return;const p=g?no(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1);}),!e)return}i(!1,e,"outside-press");}),M=yn(e=>{var t;const n=()=>{var t;I(e),null==(t=Ve(e))||t.removeEventListener(u,n);};null==(t=Ve(e))||t.addEventListener(u,n);});React.useEffect(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=k;let e=-1;function t(e){i(!1,e,"ancestor-scroll");}function o(){window.clearTimeout(e),D.current=!0;}function c(){e=window.setTimeout(()=>{D.current=!1;},Se()?5:0);}const d=ze(r.floating);l&&(d.addEventListener("keydown",N?E:x,N),d.addEventListener("compositionstart",o),d.addEventListener("compositionend",c)),y&&d.addEventListener(u,S?M:I,S);let f=[];return m&&(de(r.domReference)&&(f=Ae(r.domReference)),de(r.floating)&&(f=f.concat(Ae(r.floating))),!de(r.reference)&&r.reference&&r.reference.contextElement&&(f=f.concat(Ae(r.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0});}),()=>{l&&(d.removeEventListener("keydown",N?E:x,N),d.removeEventListener("compositionstart",o),d.removeEventListener("compositionend",c)),y&&d.removeEventListener(u,S?M:I,S),f.forEach(e=>{e.removeEventListener("scroll",t);}),window.clearTimeout(e);}},[a,r,l,y,u,n,i,m,s,C,k,x,N,E,I,S,M]),React.useEffect(()=>{w.current=!1;},[y,u]);const P=React.useMemo(()=>({onKeyDown:x,[Eo[f]]:e=>{d&&i(!1,e.nativeEvent,"reference-press");}}),[x,i,d,f]),A=React.useMemo(()=>({onKeyDown:x,onMouseDown(){b.current=!0;},onMouseUp(){b.current=!0;},[Io[u]]:()=>{w.current=!0;}}),[x,u]);return React.useMemo(()=>s?{reference:P,floating:A}:{},[s,P,A])}(L,{bubbles:!0}),z=jo(L,{listRef:S,activeIndex:C,nested:A,onNavigate:k}),{getReferenceProps:W,getFloatingProps:V,getItemProps:Y}=function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),i=e.map(e=>null==e?void 0:e.item),r=React.useCallback(t=>Fo(t,e,"reference"),t),a=React.useCallback(t=>Fo(t,e,"floating"),n),s=React.useCallback(t=>Fo(t,e,"item"),i);return React.useMemo(()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s}),[r,a,s])}([_,H,j,$,z]);useEffect$1(()=>{if(E)return E.events.on("click",e),E.events.on("menuopen",t),()=>{E.events.off("click",e),E.events.off("menuopen",t);};function e(){y(!1);}function t(e){e.nodeId!==I&&e.parentId===M&&y(!1);}},[E,I,M]),useEffect$1(()=>{v&&E&&E.events.emit("menuopen",{parentId:M,nodeId:I});},[E,v,I,M]);const U={activeIndex:C,setActiveIndex:k,getItemProps:Y,setHasFocusInside:b,isOpen:v,setIsOpen:y},K=useMemo(()=>U,[C,k,Y,b,v]),J=N("io-dropdown-menu-button",A&&"io-dropdown-menu-item",v&&!A&&"active",n),q=hn([F.setReference,P.ref,g]),G=x.activeIndex===P.index?0:-1;return jsxs(Jn,{id:I,children:[jsx(T,{className:J,ref:q,variant:A?"link":i,tabIndex:A?G:void 0,role:A?"menuitem":void 0,"data-open":v?"":void 0,"data-nested":A?"":void 0,"data-focus-inside":w?"":void 0,text:s,icon:A?"chevron-right":r,iconSize:"10",iconRight:!!A||a,disabled:m,...W(x.getItemProps({onFocus(e){h.onFocus?.(e),b(!1),x.setHasFocusInside(!0);},...h}))}),jsx(Vo.Provider,{value:K,children:jsx(Fn,{elementsRef:S,labelsRef:D,children:v&&jsx(So,{context:L,modal:!1,initialFocus:A?-1:0,returnFocus:!A,children:jsx("div",{ref:F.setFloating,className:"io-dropdown-menu",style:O,...V(),children:p})})})})]})});Uo.displayName="DropdownMenu";const Ko=forwardRef(({...t},n)=>null===Un()?jsx(qn,{children:jsx(Uo,{ref:n,...t})}):jsx(Uo,{ref:n,...t}));function qo({className:n,size:o="large",variant:i="default",align:r="up",text:a,...s}){const l=N("io-loader",{[`io-loader-${i}`]:"default"!==i},"normal"===o&&"io-loader-md","small"===o&&"io-loader-sm",r&&[`direction-${r}`],n);return jsxs("div",{className:l,role:"status","aria-live":"polite",...s,children:[jsx("div",{className:"io-loader-icon"}),a&&jsx("div",{className:"io-loader-text",children:a})]})}function Go({className:t,children:n,...o}){const i=N("io-panel-header",t);return jsx(ee,{className:i,...o,children:n})}Ko.displayName="DropdownMenu",Ko.Item=Yo,Ko.Separator=q,Go.Title=M,Go.ButtonGroup=Z,Go.Button=T,Go.ButtonIcon=D,Go.Dropdown=X;const Qo=forwardRef(({className:t,children:n,...o},i)=>{const r=N("io-panel-body",t);return jsx("div",{className:r,ref:i,"data-testid":"panel-body",...o,children:n})});function Xo({className:t,...n}){const o=N("io-panel-footer",t);return jsx(oe,{className:o,...n})}function Zo({className:t,children:n,...o}){const i=N("io-panel",t);return jsx("div",{className:i,"data-testid":"panel",...o,children:n})}function ei({className:t,variant:n="default",children:o,...i}){const r=N("io-pill","default"!==n&&[`io-pill-${n}`],t);return jsx("div",{className:r,role:"status",...i,children:o})}function ti({className:t,variant:n="active",value:o=0,...i}){const r=N("io-progress",n,t);let a;return a=o<0?0:o>100?100:o,jsx("div",{className:r,role:"progressbar","aria-valuenow":a,"aria-valuemin":0,"aria-valuemax":100,...i,children:jsx("div",{className:"io-progress-bar",style:{width:`${a}%`}})})}function ni({text:t="Label",...n}){return jsx("label",{...n,children:t})}Qo.displayName="PanelBody",Xo.ButtonGroup=Z,Xo.Button=T,Xo.ButtonIcon=D,Xo.Dropdown=X,Zo.Header=Go,Zo.Body=Qo,Zo.Footer=Xo,ei.Icon=S;const oi=forwardRef(({id:n="input",className:o,type:i="text",name:r="input",align:s="up",label:l,iconPrepend:c,iconPrependOnClick:u,iconAppend:d,iconAppendOnClick:f,placeholder:m,disabled:p,readOnly:h,errorMessage:g,errorDataTestId:v,...y},w)=>{const b=N("io-control-input",c&&"io-control-leading-icon",d&&"io-control-trailing-icon",p&&"io-control-disabled",h&&"io-control-readonly",g&&"io-control-error",s&&[`direction-${s}`],o),C=useCallback(e=>{p?e.preventDefault():u&&u(e);},[u,p]),k=useCallback(e=>{p?e.preventDefault():f&&f(e);},[f,p]);return jsxs("div",{className:b,children:[l&&jsx(ni,{htmlFor:n,text:l}),c&&jsx(S,{variant:c,onClick:e=>C(e)}),jsx("input",{id:n,className:"io-input",ref:w,type:i,name:r,tabIndex:0,placeholder:m??(()=>{switch(i){case"email":return "Enter your email here...";case"number":return "Enter number here...";case"password":return "Enter your password here...";case"tel":return "Enter your phone number here...";case"file":return "Select a file...";default:return "Enter text here..."}})(),"aria-label":l,disabled:p,readOnly:h,...g?{"aria-invalid":!0,"aria-describedby":`${n}-error`}:{},...y}),d&&jsx(S,{variant:d,onClick:e=>k(e)}),g&&jsxs("div",{"data-testid":v,id:`${n}-error`,className:"io-input-error",children:[jsx(S,{variant:"close"}),g]})]})});oi.displayName="Input";const ii=forwardRef(({id:n="textarea",className:o,name:i="textarea",align:r="up",label:a,rows:s=4,placeholder:l="Enter text here...",disabled:c,readOnly:u,...d},f)=>{const m=N("io-control-textarea",c&&"io-control-disabled",u&&"io-control-readonly",r&&[`direction-${r}`],o);return jsxs("div",{className:m,children:[a&&jsx(ni,{htmlFor:n,text:a}),jsx("textarea",{id:n,className:"io-textarea",ref:f,name:i,tabIndex:0,placeholder:l,"aria-label":a,disabled:c,readOnly:u,rows:s,...d})]})});ii.displayName="Textarea";const ri=forwardRef(({id:n="checkbox",className:o,name:i="checkbox",align:r="left",label:a,checked:s,disabled:l,...c},u)=>{const d=N("io-control-checkbox",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsxs("div",{className:d,children:[jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:i,tabIndex:l?-1:0,checked:s,disabled:l,"aria-checked":s,...c}),a&&jsx(ni,{htmlFor:n,text:a,"data-testid":c["data-testid"]?`${c["data-testid"]}-label`:void 0})]})});ri.displayName="Checkbox";const ai=forwardRef(({id:n="radio",className:o,name:i="radio",align:r="left",label:a,checked:s,disabled:l,...c},u)=>{const d=N("io-control-radio",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsxs("div",{className:d,children:[jsx("input",{type:"radio",id:n,className:"io-radio",ref:u,name:i,tabIndex:l?-1:0,checked:s,disabled:l,"aria-checked":s,...c}),a&&jsx(ni,{htmlFor:n,text:a})]})});ai.displayName="Radio";var si=React__default["undefined"!=typeof document&&void 0!==document.createElement?"useLayoutEffect":"useEffect"],li=0,ci=()=>li++,ui=0;const di="function"==typeof useId?useId:function(e,t){void 0===t&&(t="🅰");var[n,o]=useState$1(ui?ci:void 0);return si(()=>{void 0===n&&o(li++),ui=1;},[]),e||(void 0===n?n:t+n)},fi=forwardRef(({id:n,className:o,name:i="toggle",align:r="left",label:a,checked:s,disabled:l,onKeyDown:c,"data-testid":u="toggle",...d},f)=>{const m=di(),p=n||`toggle-${m}`,h=N("io-control-toggle",s&&"io-control-checked",l&&"io-control-disabled",r&&[`direction-${r}`],o);return jsx("div",{className:h,children:jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:l?-1:0,onKeyDown:c,"data-testid":`${u}-label`,children:[jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:f,name:i,checked:s,disabled:l,"aria-checked":s,tabIndex:-1,"data-testid":u,...d}),jsx("span",{className:"slider","data-testid":`${u}-slider`}),a]})})});function pi(e){const[t,n]=useState$1(!1);function o({key:t}){t===e&&n(!0);}const i=({key:t})=>{t===e&&n(!1);};return useEffect$1(()=>(window.addEventListener("keydown",o),window.addEventListener("keyup",i),()=>{window.removeEventListener("keydown",o),window.removeEventListener("keyup",i);}),[]),t}function hi(e,t=500){const[n,o]=useState$1(e);return useEffect$1(()=>{const n=setTimeout(()=>{o(e);},t);return ()=>clearTimeout(n)},[e,t]),n}function vi(e,t){useEffect$1(()=>{const n=n=>{n.code===e&&t();};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t]);}fi.displayName="Toggle";const wi=()=>void 0!==window.glue42gd||void 0!==window.iodesktop;function bi(){return useMemo(()=>"object"==typeof window&&wi(),[])}const Ci=()=>{const e=useContext(IOConnectContext),[t,n]=useState$1(null),o=useCallback(t=>e?.themes?.select(t),[e]);return useEffect$1(()=>{if(!e)return;let t=!1;const o=e=>{t||n(e);};return e.themes?.onChanged(o),e.themes?.getCurrent().then(o).catch(console.warn),()=>{t=!0;}},[e]),{currentTheme:t,selectTheme:o}};const ki=()=>{const e=useContext(IOConnectContext),t=e?.windows,n=e?.workspaces,o=useRef(null),[i,r]=useState$1(null),[s,u]=useState$1(null),[m,p]=useState$1(!1),[h,g]=useState$1(!1),[v,y]=useState$1(null),b=useRef(void 0),C=function(){const e=useRef(!1);return useEffect$1(()=>(e.current=!0,()=>{e.current=!1;}),[]),useCallback(()=>e.current,[])}(),{currentTheme:k}=Ci();useEffect$1(()=>{o.current=i;const e=i?.ioConnectWindow.onVisibilityChanged(()=>{i?.ioConnectWindow.isVisible||p(!1);});return ()=>{e?.();}},[i]);const N=useCallback(async(e,o)=>{const i={windowId:e?.ioConnectWindow.id,...o},r=window.glue42gd.windowId;if((()=>{const e=wi()&&!!window.workspacesManager,t=!wi()&&!!window.ioworkspaces;return e||t})()){if(!n)return;const e=(await(n?.getAllFrames())).find(e=>e.id===r);await(e?.showPopup(i));}else if(wi()&&window.webGroupsManager){const e=t.groups.list().find(e=>e.id===r);await(e?.showPopup(i));}else {const e=t.my();if(!e)return void console.warn("Cannot access my window to show popup");await e.showPopup({...i});}},[t,n]),S=useCallback(e=>{try{const t=e.document;k?.name&&(t.documentElement.className=k.name);const n=t.createElement("div");return n.id="io-popup-window-container",t.body.innerHTML="",t.body.appendChild(n),t}catch(e){const t=`Failed to setup popup document: ${String(e)}`;return console.error("usePopupWindow:",t,e),C()&&y(t),null}},[k,C]),D=useCallback(async e=>{if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),C()&&y(e),null}C()&&(g(!0),y(null));try{const n=new Promise((e,t)=>{setTimeout(()=>t(new Error("Popup creation timeout after 5 seconds")),5e3);}),o=t.createPopup({...e}),i=await Promise.race([o,n]);if(!C())return await i.ioConnectWindow.close().catch(()=>{}),console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup"),null;r(i);const a=i.browserWindow;if(a?.document){const e=S(a);C()&&e&&u(e);}return i}catch(e){const t=`Failed to create popup: ${String(e)}`;return console.error("usePopupWindow:",t,e),C()&&(y(t),r(null),u(null)),null}finally{C()&&g(!1);}},[t,S,C]),x=useCallback(()=>{if(!i||!t)return !1;try{return t.list().some(e=>e.id===i.ioConnectWindow.id)}catch(e){return console.warn("usePopupWindow: Failed to verify popup existence",e),!1}},[i,t]),E=useCallback(async()=>{if(!i)return null;if(x())return i;console.warn("usePopupWindow: Popup window was destroyed, recreating...");const e=i.ioConnectWindow.bounds,t=await D({left:e.left,top:e.top,width:e.width,height:e.height});if(!t){const e="Failed to recreate destroyed popup window";console.error("usePopupWindow:",e),C()&&y(e);}return t},[i,x,D,C]),I=useCallback(async e=>{if(i)return await E();const t=await D(e);return t?C()?t:(await t.ioConnectWindow.close().catch(()=>{}),console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup"),null):(console.warn("usePopupWindow: Failed to create popup, operation aborted"),null)},[i,E,D,C]);useEffect$1(()=>{if(i?.browserWindow&&s)try{k?.name&&(s.documentElement.className=k.name);}catch(e){console.warn("usePopupWindow: Failed to update popup theme",e);}},[i,s,k]);const M=useCallback(()=>{y(null);},[]),P=useCallback(async e=>{if(i){if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),void(C()&&y(e))}try{const t=e||b.current;if(!t)return void console.warn("usePopupWindow: No show options available");const n=await E();if(!n||!C())return;await N(n,t),C()&&p(!0);}catch(e){const t=`Failed to show popup: ${JSON.stringify(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}}else console.warn("usePopupWindow: Cannot show popup - popup not created yet");},[i,t,N,C,E]),A=useCallback(async e=>{await(i?.ioConnectWindow.moveResize({...e}));},[i]),T=useCallback(async()=>{if(C()&&(p(!1),o.current))try{await o.current.ioConnectWindow.hide();}catch(e){console.error("usePopupWindow: Failed to hide popup",e);}},[o,C]);Q(()=>{m&&T().catch(e=>{console.error("Failed to hide popup on Escape key press in parent window",e);});},["Escape"]),useEffect$1(()=>{if(!i?.browserWindow||!m)return;const e=e=>{"Escape"===e.key&&(e.preventDefault(),T().catch(e=>{console.error("Failed to hide popup on Escape key press in popup window",e);}));};return i.browserWindow.document.addEventListener("keydown",e),()=>{i.browserWindow.document.removeEventListener("keydown",e);}},[i,m,T]);const O=useCallback(async()=>{if(o.current)try{await o.current.ioConnectWindow.close(),o.current=null;}catch(e){const t=`Failed to close popup: ${String(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}finally{C()&&(r(null),u(null),p(!1),b.current=void 0);}},[o,C]),F=useCallback(async(e,n,o)=>{if(!t){const e="io.Connect API not available";return console.error("usePopupWindow:",e),void(C()&&y(e))}C()&&(g(!0),y(null));try{let e=await I(n);if(!e){const t=await D(n);if(!t)return void console.warn("usePopupWindow: Failed to create popup, operation aborted");if(!C())return await t.ioConnectWindow.close().catch(()=>{}),void console.warn("usePopupWindow: Component unmounted during popup creation, cleaned up popup");e=t;}o&&(b.current=o),await N(e,o),C()&&p(!0);}catch(e){const t=`Failed to create and show popup: ${String(e)}`;console.error("usePopupWindow:",t,e),C()&&y(t);}finally{C()&&g(!1);}},[D,t,N,C,I]);return {popup:i,loading:h,error:v,clearError:M,isOpen:!!i,isVisible:m,createPopup:D,showPopup:P,createAndShowPopup:F,hidePopup:T,closePopup:O,getContainer:()=>s?.getElementById("io-popup-window-container")||null,resizePopup:A}};createContext({theme:"dark"});const xi="___platform_prefs___",Ti="_launchpad_pinnedPosition",Oi="_launchpad_allowDocking",Fi="_launchpad_minimizeToTray",Li="_launchpad_autoCloseStartingAppsAndWorkspaces",Bi="_launchpad_showTutorialOnStartup",Ri="_layouts_restoreLastSaved",_i="_layouts_saveCurrentOnExit",Hi="_layouts_showUnsavedChangesPrompt",ji="_layouts_showDeletePrompt",$i="_downloads_askForEachDownload",Xi=e=>"string"==typeof e?e:e?.message?"string"==typeof e.message?e.message:JSON.stringify(e.message):JSON.stringify(e),Zi="warning",er={success:5e3,warning:1e4};var tr=function(e){return {ok:!0,result:e}},nr=function(e){return {ok:!1,error:e}},or=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:tr(e(t.result,n.result))},ir=function(e,t){return !0===t.ok?t:nr(e(t.error))},rr=function(){return rr=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rr.apply(this,arguments)};function ar(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!ar(e[n],t[n]))return !1;return !0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return !1;for(n=0;n<o.length;n++){if(!t.hasOwnProperty(o[n]))return !1;if(!ar(e[o[n]],t[o[n]]))return !1}return !0}}var sr=function(e){return Array.isArray(e)},lr=function(e){return "object"==typeof e&&null!==e&&!sr(e)},cr=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},ur=function(e){return e.map(function(e){return "string"==typeof e?"."+e:"["+e+"]"}).join("")},dr=function(e,t){var n=t.at,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]]);}return n}(t,["at"]);return rr({at:e+(n||"")},o)},fr=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return ir(function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}},n.decode(e))},this.runPromise=function(e){return !0===(t=n.run(e)).ok?Promise.resolve(t.result):Promise.reject(t.error);var t;},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e(function(e){return function(e,t){return !0===t.ok?tr(e(t.result)):t}(t,n.decode(e))})},this.andThen=function(t){return new e(function(e){return function(e,t){return !0===t.ok?e(t.result):t}(function(n){return t(n).decode(e)},n.decode(e))})},this.where=function(t,o){return n.andThen(function(n){return t(n)?e.succeed(n):e.fail(o)})};}return e.string=function(){return new e(function(e){return "string"==typeof e?tr(e):nr({message:cr("a string",e)})})},e.number=function(){return new e(function(e){return "number"==typeof e?tr(e):nr({message:cr("a number",e)})})},e.boolean=function(){return new e(function(e){return "boolean"==typeof e?tr(e):nr({message:cr("a boolean",e)})})},e.constant=function(t){return new e(function(e){return ar(e,t)?tr(t):nr({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})})},e.object=function(t){return new e(function(e){if(lr(e)&&t){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o].decode(e[o]);if(!0!==i.ok)return void 0===e[o]?nr({message:"the key '"+o+"' is required but was not present"}):nr(dr("."+o,i.error));void 0!==i.result&&(n[o]=i.result);}return tr(n)}return lr(e)?tr(e):nr({message:cr("an object",e)})})},e.array=function(t){return new e(function(e){if(sr(e)&&t){return e.reduce(function(e,n,o){return or(function(e,t){return e.concat([t])},e,function(e,n){return ir(function(e){return dr("["+n+"]",e)},t.decode(e))}(n,o))},tr([]))}return sr(e)?tr(e):nr({message:cr("an array",e)})})},e.tuple=function(t){return new e(function(e){if(sr(e)){if(e.length!==t.length)return nr({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e[o]);if(!i.ok)return nr(dr("["+o+"]",i.error));n[o]=i.result;}return tr(n)}return nr({message:cr("a tuple of length "+t.length,e)})})},e.union=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return new e(function(e){return [t,n].concat(o).reduce(function(t,n){return or(Object.assign,t,n.decode(e))},tr({}))})},e.anyJson=function(){return new e(function(e){return tr(e)})},e.unknownJson=function(){return new e(function(e){return tr(e)})},e.dict=function(t){return new e(function(e){if(lr(e)){var n={};for(var o in e)if(e.hasOwnProperty(o)){var i=t.decode(e[o]);if(!0!==i.ok)return nr(dr("."+o,i.error));n[o]=i.result;}return tr(n)}return nr({message:cr("an object",e)})})},e.optional=function(t){return new e(function(e){return null==e?tr(void 0):t.decode(e)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(e){for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e);if(!0===i.ok)return i;n[o]=i.error;}var r=n.map(function(e){return "at error"+(e.at||"")+": "+e.message}).join('", "');return nr({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})})},e.withDefault=function(t,n){return new e(function(e){return tr(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))})},e.valueAt=function(t,n){return new e(function(e){for(var o=e,i=0;i<t.length;i++){if(void 0===o)return nr({at:ur(t.slice(0,i+1)),message:"path does not exist"});if("string"==typeof t[i]&&!lr(o))return nr({at:ur(t.slice(0,i+1)),message:cr("an object",o)});if("number"==typeof t[i]&&!sr(o))return nr({at:ur(t.slice(0,i+1)),message:cr("an array",o)});o=o[t[i]];}return ir(function(e){return void 0===o?{at:ur(t),message:"path does not exist"}:dr(ur(t),e)},n.decode(o))})},e.succeed=function(t){return new e(function(e){return tr(t)})},e.fail=function(t){return new e(function(e){return nr({message:t})})},e.lazy=function(t){return new e(function(e){return t().decode(e)})},e}(),mr=fr.string;fr.number;var pr=fr.boolean,hr=fr.anyJson;fr.unknownJson;var gr=fr.constant,vr=fr.object,yr=fr.array;fr.tuple,fr.dict;var wr=fr.optional,br=fr.oneOf;fr.union,fr.intersection,fr.withDefault,fr.valueAt,fr.succeed,fr.fail,fr.lazy;const Cr=["name","title","version","customProperties","icon","caption","type"],kr=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var Nr=function(e){return {ok:!0,result:e}},Sr=function(e){return {ok:!1,error:e}},Dr=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:Nr(e(t.result,n.result))},xr=function(e,t){return !0===t.ok?t:Sr(e(t.error))},Er=function(){return Er=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Er.apply(this,arguments)};function Ir(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!Ir(e[n],t[n]))return !1;return !0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return !1;for(n=0;n<o.length;n++){if(!t.hasOwnProperty(o[n]))return !1;if(!Ir(e[o[n]],t[o[n]]))return !1}return !0}}var Mr=function(e){return Array.isArray(e)},Pr=function(e){return "object"==typeof e&&null!==e&&!Mr(e)},Ar=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},Tr=function(e){return e.map(function(e){return "string"==typeof e?"."+e:"["+e+"]"}).join("")},Or=function(e,t){var n=t.at,o=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]]);}return n}(t,["at"]);return Er({at:e+(n||"")},o)},Fr=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return xr(function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}},n.decode(e))},this.runPromise=function(e){return !0===(t=n.run(e)).ok?Promise.resolve(t.result):Promise.reject(t.error);var t;},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e(function(e){return function(e,t){return !0===t.ok?Nr(e(t.result)):t}(t,n.decode(e))})},this.andThen=function(t){return new e(function(e){return function(e,t){return !0===t.ok?e(t.result):t}(function(n){return t(n).decode(e)},n.decode(e))})},this.where=function(t,o){return n.andThen(function(n){return t(n)?e.succeed(n):e.fail(o)})};}return e.string=function(){return new e(function(e){return "string"==typeof e?Nr(e):Sr({message:Ar("a string",e)})})},e.number=function(){return new e(function(e){return "number"==typeof e?Nr(e):Sr({message:Ar("a number",e)})})},e.boolean=function(){return new e(function(e){return "boolean"==typeof e?Nr(e):Sr({message:Ar("a boolean",e)})})},e.constant=function(t){return new e(function(e){return Ir(e,t)?Nr(t):Sr({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})})},e.object=function(t){return new e(function(e){if(Pr(e)&&t){var n={};for(var o in t)if(t.hasOwnProperty(o)){var i=t[o].decode(e[o]);if(!0!==i.ok)return void 0===e[o]?Sr({message:"the key '"+o+"' is required but was not present"}):Sr(Or("."+o,i.error));void 0!==i.result&&(n[o]=i.result);}return Nr(n)}return Pr(e)?Nr(e):Sr({message:Ar("an object",e)})})},e.array=function(t){return new e(function(e){if(Mr(e)&&t){return e.reduce(function(e,n,o){return Dr(function(e,t){return e.concat([t])},e,function(e,n){return xr(function(e){return Or("["+n+"]",e)},t.decode(e))}(n,o))},Nr([]))}return Mr(e)?Nr(e):Sr({message:Ar("an array",e)})})},e.tuple=function(t){return new e(function(e){if(Mr(e)){if(e.length!==t.length)return Sr({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e[o]);if(!i.ok)return Sr(Or("["+o+"]",i.error));n[o]=i.result;}return Nr(n)}return Sr({message:Ar("a tuple of length "+t.length,e)})})},e.union=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return new e(function(e){return [t,n].concat(o).reduce(function(t,n){return Dr(Object.assign,t,n.decode(e))},Nr({}))})},e.anyJson=function(){return new e(function(e){return Nr(e)})},e.unknownJson=function(){return new e(function(e){return Nr(e)})},e.dict=function(t){return new e(function(e){if(Pr(e)){var n={};for(var o in e)if(e.hasOwnProperty(o)){var i=t.decode(e[o]);if(!0!==i.ok)return Sr(Or("."+o,i.error));n[o]=i.result;}return Nr(n)}return Sr({message:Ar("an object",e)})})},e.optional=function(t){return new e(function(e){return null==e?Nr(void 0):t.decode(e)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(e){for(var n=[],o=0;o<t.length;o++){var i=t[o].decode(e);if(!0===i.ok)return i;n[o]=i.error;}var r=n.map(function(e){return "at error"+(e.at||"")+": "+e.message}).join('", "');return Sr({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})})},e.withDefault=function(t,n){return new e(function(e){return Nr(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))})},e.valueAt=function(t,n){return new e(function(e){for(var o=e,i=0;i<t.length;i++){if(void 0===o)return Sr({at:Tr(t.slice(0,i+1)),message:"path does not exist"});if("string"==typeof t[i]&&!Pr(o))return Sr({at:Tr(t.slice(0,i+1)),message:Ar("an object",o)});if("number"==typeof t[i]&&!Mr(o))return Sr({at:Tr(t.slice(0,i+1)),message:Ar("an array",o)});o=o[t[i]];}return xr(function(e){return void 0===o?{at:Tr(t),message:"path does not exist"}:Or(Tr(t),e)},n.decode(o))})},e.succeed=function(t){return new e(function(e){return Nr(t)})},e.fail=function(t){return new e(function(e){return Sr({message:t})})},e.lazy=function(t){return new e(function(e){return t().decode(e)})},e}(),Lr=Fr.string,Br=Fr.number,Rr=Fr.boolean,_r=Fr.anyJson;Fr.unknownJson;var Hr=Fr.constant,jr=Fr.object,$r=Fr.array;Fr.tuple;var zr=Fr.dict,Wr=Fr.optional,Vr=Fr.oneOf;Fr.union,Fr.intersection,Fr.withDefault,Fr.valueAt,Fr.succeed,Fr.fail,Fr.lazy;const Yr=Lr().where(e=>e.length>0,"Expected a non-empty string"),Ur=Br().where(e=>e>=0,"Expected a non-negative number"),Kr=jr({name:Yr,displayName:Wr(Lr()),contexts:Wr($r(Lr())),customConfig:Wr(jr())}),Jr=Vr(Hr("web"),Hr("native"),Hr("citrix"),Hr("onlineNative"),Hr("other")),qr=jr({url:Yr}),Gr=jr({src:Yr,size:Wr(Yr),type:Wr(Yr)}),Qr=jr({src:Yr,size:Wr(Yr),type:Wr(Yr),label:Wr(Yr)}),Xr=jr({contexts:$r(Yr),displayName:Wr(Yr),resultType:Wr(Yr),customConfig:Wr(_r())}),Zr=jr({listensFor:Wr(zr(Xr)),raises:Wr(zr($r(Yr)))}),ea=jr({broadcasts:Wr($r(Yr)),listensFor:Wr($r(Yr))}),ta=jr({name:Yr,description:Wr(Yr),broadcasts:Wr($r(Yr)),listensFor:Wr($r(Yr))}),na=jr({intents:Wr(Zr),userChannels:Wr(ea),appChannels:Wr($r(ta))}),oa=jr({url:Wr(Yr),top:Wr(Br()),left:Wr(Br()),width:Wr(Ur),height:Wr(Ur)}),ia=jr({name:Wr(Yr),type:Wr(Yr.where(e=>"window"===e,"Expected a value of window")),title:Wr(Yr),version:Wr(Yr),customProperties:Wr(_r()),icon:Wr(Lr()),caption:Wr(Lr()),details:Wr(oa),intents:Wr($r(Kr)),hidden:Wr(Rr())}),ra=jr({name:Yr,appId:Yr,title:Wr(Yr),version:Wr(Yr),manifest:Yr,manifestType:Yr,tooltip:Wr(Yr),description:Wr(Yr),contactEmail:Wr(Yr),supportEmail:Wr(Yr),publisher:Wr(Yr),images:Wr($r(jr({url:Wr(Yr)}))),icons:Wr($r(jr({icon:Wr(Yr)}))),customConfig:_r(),intents:Wr($r(Kr))}),aa=jr({appId:Wr(Yr),name:Wr(Yr),details:Wr(qr),version:Wr(Yr),title:Wr(Yr),tooltip:Wr(Yr),lang:Wr(Yr),description:Wr(Yr),categories:Wr($r(Yr)),icons:Wr($r(Gr)),screenshots:Wr($r(Qr)),contactEmail:Wr(Yr),supportEmail:Wr(Yr),moreInfo:Wr(Yr),publisher:Wr(Yr),customConfig:Wr($r(_r())),hostManifests:Wr(_r()),interop:Wr(na)}),sa=jr({appId:Yr,name:Wr(Yr),type:Jr,details:qr,version:Wr(Yr),title:Wr(Yr),tooltip:Wr(Yr),lang:Wr(Yr),description:Wr(Yr),categories:Wr($r(Yr)),icons:Wr($r(Gr)),screenshots:Wr($r(Qr)),contactEmail:Wr(Yr),supportEmail:Wr(Yr),moreInfo:Wr(Yr),publisher:Wr(Yr),customConfig:Wr($r(_r())),hostManifests:Wr(_r()),interop:Wr(na),localizedVersions:Wr(zr(aa))}),la=Vr(ra,sa),ca=e=>`${e.kind} at ${e.at}: ${JSON.stringify(e.input)}. Reason - ${e.message}`;class ua{fdc3ToDesktopDefinitionType={web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"};toApi(){return {isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(e){const t=la.run(e);return t.ok?e.appId&&e.details?{isFdc3:!0,version:"2.0"}:e.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:ca(t.error)}}parseToBrowserBaseAppData(e){const{isFdc3:t,version:n}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const o=la.run(e);if(!o.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(o.error)}`);const i=this.getUserPropertiesFromDefinition(e,n),r={url:this.getUrl(e,n)},a={name:e.appId,type:"window",createOptions:r,userProperties:{...i,intents:"1.2"===n?i.intents:this.getIntentsFromV2AppDefinition(e),details:r},title:e.title,version:e.version,icon:this.getIconFromDefinition(e,n),caption:e.description,fdc3:"2.0"===n?{...e,definitionVersion:"2.0"}:void 0},s=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!s)return a;const l=ia.run(s);if(!l.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(l.error)}`);return Object.keys(l.result).length?this.mergeBaseAppDataWithGlueManifest(a,l.result):a}parseToDesktopAppConfig(e){const{isFdc3:t,version:n}=this.isFdc3Definition(e);if(!t)throw new Error("The passed definition is not FDC3");const o=la.run(e);if(!o.ok)throw new Error(`Invalid FDC3 ${n} definition. Error: ${ca(o.error)}`);if("1.2"===n){const t=e;return {name:t.appId,type:"window",details:{url:this.getUrl(e,n)},version:t.version,title:t.title,tooltip:t.tooltip,caption:t.description,icon:t.icons?.[0].icon,intents:t.intents,customProperties:{manifestType:t.manifestType,images:t.images,contactEmail:t.contactEmail,supportEmail:t.supportEmail,publisher:t.publisher,icons:t.icons,customConfig:t.customConfig}}}const i=e,r={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},a=e.hostManifests?.ioConnect||e.hostManifests?.Glue42;if(!a)return r;if("object"!=typeof a||Array.isArray(a))throw new Error(`Invalid '${e.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(r,a)}getUserPropertiesFromDefinition(e,t){return "1.2"===t?Object.fromEntries(Object.entries(e).filter(([e])=>!Cr.includes(e))):Object.fromEntries(Object.entries(e).filter(([e])=>!Cr.includes(e)&&!kr.includes(e)))}getUrl(e,t){let n;if("1.2"===t){const t=JSON.parse(e.manifest);n=t.details?.url||t.url;}else n=e.details?.url;if(!n||"string"!=typeof n)throw new Error(`Invalid FDC3 ${t} definition. Provide valid 'url' under '${"1.2"===t?"manifest":"details"}' key`);return n}getIntentsFromV2AppDefinition(e){const t=e.interop?.intents?.listensFor;if(!t)return;return Object.entries(t).map(e=>{const[t,n]=e;return {name:t,...n}})}getIconFromDefinition(e,t){return "1.2"===t?e.icons?.find(e=>e.icon)?.icon||void 0:e.icons?.find(e=>e.src)?.src||void 0}mergeBaseAppDataWithGlueManifest(e,t){let n=e;if(t.customProperties&&(n.userProperties={...e.userProperties,...t.customProperties}),t.details){const o={...e.createOptions,...t.details};n.createOptions=o,n.userProperties.details=o;}return Array.isArray(t.intents)&&(n.userProperties.intents=(n.userProperties.intents||[]).concat(t.intents)),n={...n,...t},delete n.details,delete n.intents,n}mergeDesktopConfigWithGlueManifest(e,t){const n=Object.assign({},e,t,{details:{...e.details,...t.details}});return Array.isArray(t.intents)&&(n.intents=(e.intents||[]).concat(t.intents)),n}}const da={common:{nonEmptyStringDecoder:Yr,nonNegativeNumberDecoder:Ur},fdc3:{allDefinitionsDecoder:la,v1DefinitionDecoder:ra,v2DefinitionDecoder:sa}};var fa;!function(e){e.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",e.CALLER_NOT_DEFINED="Caller Id is not defined",e.TIMEOUT_HIT="Timeout hit",e.INTENT_NOT_FOUND="Cannot find Intent",e.HANDLER_NOT_FOUND="Cannot find Intent Handler",e.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",e.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",e.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",e.RESOLVER_TIMEOUT="User did not choose a handler",e.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",e.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned";}(fa||(fa={}));const ma=new class{_fdc3;_decoders=da;_errors={intents:fa};get fdc3(){return this._fdc3||(this._fdc3=(new ua).toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};ma.fdc3;const pa=ma.decoders;ma.errors;const ha=pa.common.nonEmptyStringDecoder,ga=br(gr("add"),gr("align-bottom"),gr("align-bottom-solid"),gr("align-left"),gr("align-left-bottom"),gr("align-left-bottom-solid"),gr("align-left-solid"),gr("align-left-top"),gr("align-left-top-solid"),gr("align-right"),gr("align-right-bottom"),gr("align-right-bottom-solid"),gr("align-right-solid"),gr("align-right-top"),gr("align-right-top-solid"),gr("align-top"),gr("align-top-solid"),gr("always-on-top"),gr("always-on-top-on"),gr("application"),gr("arrow-down-long"),gr("arrow-down-to-bracket"),gr("arrow-left-long"),gr("arrow-right-from-bracket"),gr("arrow-right-long"),gr("arrow-right"),gr("arrow-up"),gr("arrow-up-long"),gr("ban"),gr("bell"),gr("bell-solid"),gr("bookmark"),gr("bullseye-pointer"),gr("certificate"),gr("check"),gr("check-light"),gr("check-solid"),gr("chevron-down"),gr("chevron-left"),gr("chevron-right"),gr("chevron-up"),gr("circle-info"),gr("circle-xmark"),gr("circle-xmark-full"),gr("clock"),gr("clock-rotate-left"),gr("clone"),gr("close"),gr("cog"),gr("cog-solid"),gr("collapse"),gr("copy"),gr("download"),gr("delete-left"),gr("dev-tools"),gr("ellipsis"),gr("ellipsis-vertical"),gr("expand"),gr("envelope"),gr("envelope-open"),gr("exclamation-mark"),gr("expand"),gr("feedback"),gr("filter"),gr("floppy"),gr("floppy-disk-pen"),gr("folder"),gr("folder-open"),gr("globe"),gr("group"),gr("hidden"),gr("home"),gr("house"),gr("info"),gr("keyboard"),gr("layout"),gr("link"),gr("list-ul"),gr("lock"),gr("logo"),gr("minimize"),gr("minimize-down"),gr("paper-plane-top"),gr("paperclip"),gr("pause"),gr("pen-line"),gr("pen-to-square"),gr("pin"),gr("play"),gr("pop-in"),gr("pop-in-widget"),gr("pop-out"),gr("power-off"),gr("publish"),gr("refresh"),gr("resize"),gr("restore"),gr("rotate-right"),gr("search"),gr("search-filled"),gr("sleep"),gr("sliders"),gr("snooze"),gr("spinner"),gr("square"),gr("square-arrow-down"),gr("square-arrow-up"),gr("star"),gr("star-full"),gr("sticky-off"),gr("sticky-off-hover"),gr("sticky-on"),gr("sticky-on-hover"),gr("subscribe"),gr("system-close"),gr("system-maximize"),gr("system-minimize"),gr("thumbs-down"),gr("thumbs-up"),gr("trash"),gr("trash-can"),gr("triangle-exclamation"),gr("unlock"),gr("unpin"),gr("up-to-line"),gr("user"),gr("user-gear"),gr("visible"),gr("workspace")),va=vr({id:ha,title:ha,description:wr(mr()),icon:wr(ga),iconSrc:wr(ha),contextMenuActions:wr(yr(hr())),type:ha}),ya=br(gr("Left"),gr("Right")),wa=br(gr("daily"),gr("weekly")),ba=br(gr("Sunday"),gr("Monday"),gr("Tuesday"),gr("Wednesday"),gr("Thursday"),gr("Friday"),gr("Saturday")),Ca=vr({customPrefs:wr(hr()),_launchpad_collapsedSections:wr(yr(ha)),_launchpad_favorites:wr(yr(va)),_launchpad_isLayoutsPanelOpen:wr(pr()),_launchpad_isCollapsed:wr(pr()),_launchpad_isPinned:wr(pr()),_launchpad_pinnedPosition:wr(ya),_launchpad_allowDocking:wr(pr()),_launchpad_minimizeToTray:wr(pr()),_launchpad_autoCloseStartingAppsAndWorkspaces:wr(pr()),_launchpad_showTutorialOnStartup:wr(pr()),_layouts_restoreLastSaved:wr(pr()),_layouts_saveCurrentOnExit:wr(pr()),_layouts_showUnsavedChangesPrompt:wr(pr()),_layouts_showDeletePrompt:wr(pr()),_downloads_askForEachDownload:wr(pr()),_downloads_location:wr(mr()),_system_scheduleRestart:wr(pr()),_system_scheduleRestartTime:wr(ha),_system_scheduleRestartFrequency:wr(wa),_system_scheduleRestartDay:wr(ba),_system_scheduleShutdown:wr(pr()),_system_scheduleShutdownTime:wr(ha),_system_scheduleShutdownFrequency:wr(wa),_system_scheduleShutdownDay:wr(ba)}),ka=async e=>{const{io:t,variant:n,text:o,error:i}=e,r=Xi(i);try{if(n===Zi&&t.logger.warn(r?`${o} ${r}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const e={text:o,variant:n,ttl:er[n]};await t.modals.alerts.request(e);}catch(e){console.warn("Failed to request alert. ",{error:e});}},Na=createContext(void 0);function xa({prefKey:e}){const t=useContext(IOConnectContext),n=useContext(Na),o=n?.prefs?.[e],i=n?.isInitialSetupCompleted??!1,[r,s]=useState$1(!i),[u,m]=useState$1(),p=useRef(0);useEffect$1(()=>{i&&0===p.current&&s(!1);},[i]);const h=useCallback(async n=>{if(!t)return;const o=++p.current;s(!0),m(void 0);const i=async n=>{n&&await ka({io:t,variant:Zi,text:`Failed to update prefKey "${e}".`,error:n}),o===p.current&&(s(!1),n&&m({message:Xi(n)}));};let r;if(n instanceof Function)try{r=n((await t.contexts.get(xi))[e]);}catch(e){return i(e)}else r=n;try{const n=Ca.runWithException({[e]:r});await t.contexts.update(xi,n);}catch(e){return i(e)}await i();},[t,e]);if(void 0===n)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return {error:u,isLoading:r,update:h,value:o}}const Ea="var(--io-neutrals-0)",Ia="var(--io-neutrals-900)";function Ma(e){let t,n,o;if(e.startsWith("#")){let i=e.slice(1);3===i.length&&(i=i.split("").map(e=>e+e).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16);}else {if(!e.startsWith("rgb")){const t=document.createElement("canvas").getContext("2d");if(!t)return Ia;t.fillStyle=e;return Ma(t.fillStyle)}{const i=e.match(/\d+/g)?.map(Number);if(!i||i.length<3)return Ia;[t,n,o]=i;}}return (.2126*t+.7152*n+.0722*o)/255>.5?Ia:Ea}function Pa({className:t,channel:n,...o}){const i=N("io-channel-selector-badge",t),r=useMemo(()=>Ma(n.color),[n.color]);return jsx("div",{className:i,style:{color:r,backgroundColor:n.color},"data-testid":`channel-selector-badge-${n.color}`,...o,children:jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:n.label})})}function Aa(){return jsx(S,{variant:"check","data-testid":"channel-selector-channel-selected"})}function Ta({channel:o,handleChannelRestricted:i,lockedChannelRestriction:r}){const a=(e,t)=>n=>{n.stopPropagation(),A(n)&&(n.preventDefault(),t||i({...o,[e]:!o[e]}));};return jsxs(Fragment,{children:[jsx("div",{children:o.isSelected&&jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),jsx("div",{role:"button",onClick:e=>e.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:jsx(fi,{label:"Publish",checked:o.write,onChange:()=>{i({...o,write:!o.write});},onKeyDown:a("write",!o.isSelected||r?.write),onClick:e=>e.stopPropagation(),disabled:!o.isSelected||r?.write})}),jsx("div",{role:"button",onClick:e=>e.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:jsx(fi,{label:"Subscribe",checked:o.read,onChange:()=>{i({...o,read:!o.read});},onKeyDown:a("read",!o.isSelected||r?.read),disabled:!o.isSelected||r?.read})})]})}const Oa=createContext({});function Fa({channel:t,isSelected:n,onChannelSelect:o,onChannelRestrict:i,...r}){const{variant:s,selectedChannels:c,lockedChannelRestrictions:u}=useContext(Oa),d=n||t.isSelected||c?.includes(t),f=u?.find(e=>e.name===t.name),m=useCallback(()=>o?.({...t,isSelected:!d}),[t,o,d]),p=useCallback(e=>{const n=e.target;n.closest(".io-toggle")||n.classList.contains("io-toggle")||A(e)&&(e.preventDefault(),o?.({...t,isSelected:!d}));},[t,o,d]),h=useCallback(e=>{i?.(e);},[i]);return jsx(_,{prepend:jsx(Pa,{channel:t}),append:"single"===s||"multi"===s?d&&jsx(Aa,{}):jsx(Ta,{channel:t,handleChannelRestricted:h,lockedChannelRestriction:f}),isSelected:d,onClick:m,onKeyDown:p,...r,children:t.name},t.name)}function La({variant:t,onVariantChange:n,disabled:o=!1}){const i="directionalSingle"===t||"directionalMulti"===t,r=useCallback(()=>{n?.(!i);},[i,n]),s=useCallback(e=>{e.stopPropagation();},[]),l=useCallback(e=>{e.stopPropagation(),A(e)&&(e.preventDefault(),o||r());},[o,r]);return jsx(fi,{label:"Directional",align:"right",checked:i,onChange:r,onClick:s,onKeyDown:l,disabled:o,"data-testid":`channel-selector-toggle-${t}`})}const Ba=forwardRef(({className:n,variant:o="single",variantToggle:i=!1,channels:r=[],lockedChannelRestrictions:a=[],onVariantChange:s,onChannelSelect:l,onChannelRestrict:c,...d},f)=>{const m=N("io-channel-selector-panel",("directionalSingle"===o||"directionalMulti"===o)&&"io-channel-selector-panel-directional",n),p=useMemo(()=>({variant:o,selectedChannels:r.filter(e=>e.isSelected),lockedChannelRestrictions:a,onVariantChange:s,onChannelSelect:l,onChannelRestrict:c}),[r,o,a,s,l,c]);return jsx(Oa.Provider,{value:p,children:jsx("div",{className:m,ref:f,children:jsxs(V,{...d,children:[jsx(V.ItemTitle,{"data-testid":"channel-selector-title",append:i&&jsx(La,{variant:o,onVariantChange:s}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[o]}),r?.map(t=>jsx(Fa,{channel:t,isSelected:t.isSelected,onChannelSelect:l,onChannelRestrict:c,"data-testid":`channel-selector-channel-${t.name}`},t.name))]})})})});Ba.displayName="ChannelSelector";const Ra=forwardRef(({className:t,title:n,ariaLabel:o,onClick:i,onKeyDown:r,children:a,disabled:s=!1,...l},c)=>jsx("div",{ref:c,className:N(t,{disabled:s}),title:n,role:"button",tabIndex:s?-1:0,"aria-label":o,"aria-disabled":s,onClick:e=>{!s&&i&&i(e);},onKeyDown:e=>{!s&&r&&r(e);},...l,children:a}));Ra.displayName="ChannelSelectorButtonWrapper";function _a(e,t){const n=useContext(IOConnectContext),o=n.windows,i=n.channels,[r,s]=useState$1({channels:[]});useEffect$1(()=>{if(!e)return;(async()=>{try{const t=await i.getRestrictions(e);s(t);}catch(e){console.error("Failed to fetch channel restrictions:",e);}})().catch(console.error);const t=o.findById(e);if(!t||"function"!=typeof t.onChannelRestrictionsChanged)return;return t.onChannelRestrictionsChanged(s)},[e,i,o]);const u=useCallback(({name:n,read:o,write:r})=>{e&&!["single","multi"].includes(t)&&void 0!==o&&void 0!==r&&i.restrict({name:n,read:o,write:r,windowId:e}).catch(console.error);},[e,t,i]),d=useCallback(e=>e.map(e=>{const t=r.channels.find(t=>t.name===e.name);return {...e,read:t?.read??!0,write:t?.write??!0}}),[r.channels]);return {channelRestrictions:r,onChannelRestricted:u,applyChannelRestrictions:d}}function Ha(e){const t=useContext(IOConnectContext).windows,[n,o]=useState$1([]);return useEffect$1(()=>{if(!e)return;(async()=>{try{const n=t.findById(e);if(!n)return void o([]);const i=await(n.application?.getConfiguration()),r=i?.details?.channelSelector?.preventModifyingRestrictionsFor;if(!r)return void o([]);o(r);}catch(e){console.error("Failed to fetch locked channel restrictions:",e);}})().catch(console.error);},[e,t]),{lockedChannelRestrictions:n}}Object.freeze({__proto__:null,Channel:Fa,ChannelBadge:Pa,ChannelDirectionalAppend:Ta,ChannelSelector:Ba,ChannelSelectorButton:function({channels:n,variant:o,className:i,onClick:r,onKeyDown:a,...s}){const c=useRef(null),u=useContext(Oa),f=n||u.selectedChannels||[],m=o||u.variant||"single",p=f.filter(e=>e.isSelected);if(("multi"===m||"directionalMulti"===m)&&p.length>1){const t=`io-channel-selector-button io-channel-selector-multi-${Math.min(p.length,4)}`,n=p.map(e=>e.name).join(", "),o=function(e){const t={},n=Math.min(e.length,4);return e.slice(0,n).forEach((e,o)=>{t[`--io-channel-selector-multi-${n}-color-${o+1}`]=e.color;}),t}(p);return jsx(Ra,{ref:c,className:i,title:n,ariaLabel:`Selected channels - ${n}`,onClick:r,onKeyDown:a,...s,children:jsx("div",{className:t,style:o})})}const h=p[0];if(!h)return jsx(Ra,{ref:c,className:i,title:"No channel selected",ariaLabel:"No channel selected",onClick:r,onKeyDown:a,...s,children:jsx(S,{variant:"link"})});const g="directionalSingle"===m||"directionalMulti"===m,v=g?(y=h).isSelected?y.read&&y.write?"readwrite":y.read?"read":y.write?"write":null:null:null;var y;return jsxs(Ra,{ref:c,className:N(g?"io-channel-selector-button io-channel-selector-button-directional":"io-channel-selector-button",i),title:h.name,ariaLabel:`Selected channel - ${h.name}`,onClick:r,onKeyDown:a,style:{color:Ma(h.color),backgroundColor:h.color},...s,children:[jsx("span",{children:h.label}),v&&"readwrite"!==v&&jsx(S,{variant:"read"===v?"subscribe":"publish"})]})},ChannelSingleAppend:Aa,useChannelRestrictionLocks:Ha,useChannelRestrictions:_a,useIOCDChannels:function(e){const t="T42.ChannelSelector.Execute",n=useContext(IOConnectContext),o=n?.windows,i=n?.channels,r=n?.interop,s=bi(),u=o?.my(),m=useRef(),[h,g]=useState$1(""),[v,y]=useState$1("single"),[b,C]=useState$1(null),[k,N]=useState$1(!1),[S,D]=useState$1(),{channelRestrictions:x,onChannelRestricted:E,applyChannelRestrictions:I}=_a(h,v),{lockedChannelRestrictions:M}=Ha(h),P=useCallback(async(e,t,n)=>{if("will-show"===e.command)try{N(!0),m.current=n;const{windowId:t,channels:i,variant:r}=e;y(r),g(t);const a=await(o?.findById(t)?.getChannel())??"",s=I(function(e,t){return e.map((e,n)=>{const o=!!t&&t.split("+++").includes(e.name);return {...e,color:e.meta?.color,label:e.meta?.label??String.fromCharCode(n+65),isSelected:o,read:e.read??!0,write:e.write??!0}})}(i,a));C(s);}catch(e){console.error("Error in channel selector handler:",e),D(e);}finally{N(!1);}},[o,I]),A=useCallback(async({name:e,isSelected:t})=>{if(i){C(n=>n?n.map(n=>"single"===v||"directionalSingle"===v?{...n,isSelected:n.name===e&&t}:n.name===e?{...n,isSelected:t}:n):[]);try{t?await i.join(e,h):await i.leave({windowId:h,channel:e});}catch(e){D(e),console.error("Error selecting channel:",e);}"single"===v&&s&&u&&u?.hide().catch(console.error);}},[i,v,u,h,s]);return Q(()=>{s&&u&&u?.hide().catch(console.error);},["Escape"]),useEffect$1(()=>{if(null===s||!s)return;const e=u?.onClosing(async e=>(e({showDialog:!1}),Promise.resolve()));return e},[u,s]),useEffect$1(()=>{if(!r)return;return r.registerAsync(t,(e,t,n)=>{P(e,t,n).catch(e=>{console.error("Error in channel selector handler:",e),D(e);});}).catch(console.error),()=>{r.unregister(t);}},[r,P]),useEffect$1(()=>{C(e=>e?I(e):null);},[x,I]),useLayoutEffect$1(()=>{if(e?.current&&b?.length){const{height:t,width:n,x:o,y:i}=e.current.getBoundingClientRect();m.current&&t>0&&m.current({height:t,width:n,x:o,y:i});}},[b,e]),{windowId:h,error:S,variant:v,channels:b,channelRestrictions:x,lockedChannelRestrictions:M,onChannelSelected:A,onChannelRestricted:E,isLoading:k}}});function $a({className:n,draggable:o,title:i,children:r,...a}){const s=N("io-dialog-header",o&&"draggable",n);return jsxs(te,{className:s,...a,children:[jsx("h3",{children:i}),r]})}function za({children:t,...n}){return jsx(ne,{...n,children:jsx(ne.Content,{children:t})})}function Wa({children:t,...n}){return jsx(ie,{...n,children:t})}const Va=createContext({config:{message:""},theme:"dark",setResult:()=>{}}),Ya=()=>useContext(Va),Ua=t=>{const{id:n,onButtonFocused:o,...i}=t,{config:r}=Ya();return jsx(T,{variant:"outline",onFocus:()=>o&&o(n),autoFocus:(a=n,a===r.defaultAction),...i});var a;},Ka=({timerDuration:t,callback:n})=>{const[o,i]=useState$1(t);useEffect$1(()=>{if(o<=0)return n();{const e=setInterval(()=>{i(e=>e-1);},1e3);return ()=>{clearInterval(e);}}},[o,n]);return jsx("p",{children:`This dialog will close in: ${o} seconds`})};function Ja({children:t}){return jsx("div",{className:"io-dialog",role:"dialog",children:t})}function qa({className:n,placeHolder:o,maxInputLength:i,errorMessage:r,onInput:a,onEnterKeyDown:s}){const[l,u]=useState$1(""),m=useRef(null),p=N("io-control-input",n);useEffect$1(()=>{m.current&&m.current.focus();},[]);return jsxs("div",{className:p,children:[jsx("input",{className:"io-input",ref:m,type:"text",maxLength:i,placeholder:o,tabIndex:0,value:l,onChange:e=>{const t=e.target.value,n=e.target.parentElement;u(t);const o=a(t);n&&(0===t.length?n.className="":(n.className="was-validated",o?e.target.setCustomValidity(""):e.target.setCustomValidity("Invalid input pattern")));},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),s());}}),r&&l.length>0?jsx("small",{children:jsx("strong",{children:r})}):null]})}function Ga({children:t}){return jsx("div",{className:"io-dialog",role:"dialog",children:t})}Object.freeze({__proto__:null,Dialog:function({config:n,setResult:o,header:i,body:r,footer:s}){if(!n)throw new Error("Please provide a config prop to Dialog Component");if(!o)throw new Error("Please provide a setResult prop to Dialog Component");const[l,u]=useState$1(!1),d=pi("Escape"),m=pi("Enter"),[p,h]=useState$1(n.defaultAction),{theme:g}=Ya();useEffect$1(()=>{u("SingleInputDialog"===n?.type);},[n]);const v=useCallback(()=>{o({action:"expired"});},[o]);useEffect$1(()=>{document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(g);},[g]),useEffect$1(()=>{d&&o({action:"closed"});},[d,o]),useEffect$1(()=>{m&&!p&&o({action:"clicked",button:n.defaultAction});},[m,p,n.defaultAction,o]);const y=e=>{e.preventDefault(),o({action:"clicked",button:p});},w=()=>{b("");},b=e=>{h(e);};return n.timerDuration&&!1===n.showTimer&&setTimeout(()=>{o({action:"expired"});},1e3*n.timerDuration),jsxs(Ja,{children:[i??jsx($a,{title:n?.title,draggable:!0,children:jsx("div",{className:"non-draggable",children:jsx(Z,{children:jsx(D,{id:"close",icon:"close",iconSize:"12",size:"24",onClick:()=>o({action:"closed"}),onBlur:w,tabIndex:-1})})})}),r??jsx(za,{children:jsxs("div",{children:[n?.messageTitle&&jsx("h1",{children:n?.messageTitle}),jsx("p",{children:n.message}),n?.showTimer&&n?.timerDuration&&jsx(Ka,{timerDuration:n.timerDuration,callback:v})]})}),s??jsx(Wa,{children:jsxs(Z,{align:"right",children:[n.showAffirmativeButton&&jsx(Ua,{id:"affirmative",variant:"primary",onClick:y,onButtonFocused:b,onBlur:w,disabled:l,children:n.affirmativeButtonName}),n.showNegativeButton&&jsx(Ua,{id:"negative",onClick:y,onButtonFocused:b,onBlur:w,children:n.negativeButtonName}),n.showCancelButton&&jsx(Ua,{id:"cancel",onClick:y,onButtonFocused:b,onBlur:w,children:n.cancelButtonName})]})})]})},DialogBody:za,DialogButton:Ua,DialogFooter:Wa,DialogHeader:$a,DialogsProvider:({children:t})=>{const[n,o]=useState$1({message:"",messageTitle:"",operation:"systemShutdown",type:""}),[i,r]=useState$1("dark");useEffect$1(()=>{(async()=>{const e=await a();o(e);})();},[]);const a=()=>window.glue42dialog.getConfig(),s=e=>{window.glue42dialog.setResult(e);};useEffect$1(()=>{window.glue42dialog.onThemeChanged(e=>{r(e);}),r(window.glue42dialog.getTheme());},[]);const l=useMemo(()=>({theme:i,config:n,setResult:s}),[n,i]);return jsx(Va.Provider,{value:l,children:t})},SingleInputDialog:({config:n,setResult:o,header:i,body:r,footer:s})=>{if(!n)throw new Error("Please provide a config prop to Dialog Component");if(!o)throw new Error("Please provide a setResult prop to Dialog Component");const l=pi("Escape"),u=pi("Enter"),[d,m]=useState$1(n.defaultAction),{theme:p}=Ya(),[h,g]=useState$1(""),[v,y]=useState$1(""),[w,b]=useState$1(!1),C=useCallback(()=>{o({action:"expired"});},[o]),k=useCallback(()=>{"affirmative"===n?.defaultAction?w&&h.length>0&&o({action:"clicked",button:n.defaultAction,value:h}):o({action:"clicked",button:n.defaultAction});},[n.defaultAction,h,o,w]);useEffect$1(()=>{document.documentElement.classList.remove("dark","light"),document.documentElement.classList.add(p);},[p]),useEffect$1(()=>{l&&o({action:"closed"});},[l,o]),useEffect$1(()=>{u&&!d&&k();},[u,k,d]);const N=e=>{e.preventDefault(),o("affirmative"===d&&h?{action:"clicked",button:d,value:h}:{action:"clicked",button:d});},S=()=>{x("");},x=e=>{m(e);};n.timerDuration&&!1===n.showTimer&&setTimeout(()=>{o({action:"expired"});},1e3*n.timerDuration);return jsxs(Ga,{children:[i??jsx($a,{title:n?.title,draggable:!0,children:jsx("div",{className:"non-draggable",children:jsx(Z,{children:jsx(D,{id:"close",icon:"close",size:"24",onClick:()=>o({action:"closed"}),onBlur:S})})})}),r??jsx(za,{children:jsxs("div",{style:{width:"100%"},children:[n.message&&jsx("p",{children:n.message}),jsx(qa,{onInput:e=>{let t=!0;try{t=!!e.match(n.inputPattern??""),b(t);}catch(e){console.log(`Failed to validate regular expression pattern: ${n.inputPattern??""}`);}return t?(g(e),y("")):y(n.inputPatternErrorMessage??"Invalid input pattern"),t},errorMessage:v,onEnterKeyDown:k,maxInputLength:n.inputMaxLength,placeHolder:n.inputPlaceholder}),n?.showTimer&&n?.timerDuration&&jsx(Ka,{timerDuration:n.timerDuration,callback:C})]})}),s??jsx(Wa,{children:jsxs(Z,{align:"right",children:[n.showAffirmativeButton&&jsx(Ua,{id:"affirmative",variant:"primary",onClick:N,onButtonFocused:x,onBlur:S,disabled:!w,children:n.affirmativeButtonName}),n.showNegativeButton&&jsx(Ua,{id:"negative",onClick:N,onButtonFocused:x,onBlur:S,children:n.negativeButtonName}),n.showCancelButton&&jsx(Ua,{id:"cancel",onClick:N,onButtonFocused:x,onBlur:S,children:n.cancelButtonName})]})})]})},useDialogsContext:Ya});function Xa({title:n="Downloads"}){const{ItemSearch:o,HeaderButtons:i}=Ns();return jsxs("div",{className:"io-dm-header",children:[jsxs(ee,{draggable:!0,children:[jsx(ee.Title,{tag:"h1",text:n,size:"large"}),jsx(i,{className:"non-draggable"})]}),jsx(o,{})]})}const Za=window.glue42gd;const es=createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),ts=()=>useContext(es);function ns({className:n,placeholder:o="Search",iconPrepend:i="search",iconAppend:r="close",...s}){const l=N("io-header-search",n),c=useRef(null),{searchQuery:u,setSearch:f,itemsCount:m}=ts(),p=u.length>0,h=useCallback(()=>{f(""),c.current&&c.current.focus();},[f]);return jsxs("div",{className:l,children:[jsx(oi,{ref:c,value:u,iconPrepend:i,iconAppend:p?r:void 0,iconAppendOnClick:p?h:void 0,placeholder:o,onChange:e=>f(e.target.value),...s}),p&&jsx("p",{className:"io-header-search-count",children:`${m} results`})]})}function os({className:n,...o}){const{MoreButton:i,CloseButton:r}=Ns();return jsxs(Z,{className:n,align:"right",...o,children:[jsx(i,{}),jsx(r,{})]})}function is({icon:n="ellipsis-vertical",...o}){const{items:i,clearItems:r,showSettings:a}=ts(),s=0===i.length;return jsxs(X,{variant:"light",...o,children:[jsx(X.ButtonIcon,{icon:n,variant:"circle",size:"32"}),jsx(X.Content,{children:jsxs(X.List,{children:[jsx(X.Item,{onClick:e=>(e=>{s?e.stopPropagation():r();})(e),disabled:s,children:"Clear All"}),jsx(X.Item,{onClick:a,children:"Settings"})]})})]})}const rs={minimizeWindow:async function(e){if(e)try{const t=e.windows?.my();await(t?.minimize());}catch(e){console.error("Failed to minimize window",e);}},closeWindow:async function(e,t){if(e)try{const n=e.windows?.my();await(n?.close(t));}catch(e){console.error("Failed to close window",e);}},restartPlatform:async function(e,t=!0){if(e)try{await e.appManager.restart({autoSave:t,showDialog:!0});}catch(e){console.error("Failed to restart io.Connect Desktop",e);}},shutdownPlatform:async function(e,t=!0){if(e)try{await e.appManager.exit({autoSave:t,showDialog:!0});}catch(e){console.error("Failed to shutdown io.Connect Desktop",e);}}};function as({icon:t="close",size:n="32",variant:o="circle",onClick:i,...r}){const a=useContext(IOConnectContext);return jsx(D,{icon:t,size:n,variant:o,onClick:e=>{i?i(e):rs.closeWindow(a).catch(e=>{console.error("Failed to close window:",e);});},...r})}function ss(e,t=!1,n=!1,o=!1){const i=e.getDate(),r=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),l=e.getMinutes();let c="";return c=l<10?`0${l}`:`${l}`,t?"Today"===t?n?"Today":`Today at ${s}:${c}`:"Yesterday"===t?n?"Yesterday":`Yesterday at ${s}:${c}`:`${s}:${c}`:o?n?`${r} ${i}`:`${r} ${i} at ${s}:${c}`:n?`${r} ${i}, ${a}`:`${r} ${i}, ${a} at ${s}:${c}`}function ls(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,i=Math.round((o-n)/1e3),r=Math.round(i/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),l=o.getFullYear()===n.getFullYear();return t.showTime?i<5?"Just Now":i<60?`${i} seconds ago`:i<90?"about a minute ago":r<60?`${r} minutes ago`:a?ss(n,"Today",!1,!0):s?ss(n,"Yesterday",!1,!0):l?ss(n,!1,!1,!0):ss(n):a?"Today":s?"Yesterday":l?ss(n,!1,!0,!0):ss(n,!1,!0)}function cs({className:t,...n}){const o=N("io-dm-body",t),{DownloadListEmpty:i,ItemGroup:r,Item:a}=Ns(),{items:s,searchQuery:l,setCount:c,sortItems:d}=ts(),m=d(s),p=hi(l),h=useMemo(()=>m.filter(e=>e.displayInfo.filename.toLowerCase().includes(p.toLowerCase())||e.displayInfo.url.toLowerCase().includes(p.toLowerCase())),[m,p]),g=useMemo(()=>h.map(e=>({...e,displayInfo:{...e.displayInfo,startTime:ls(e.displayInfo.startTime,{showTime:!1})}})),[h]),v=useMemo(()=>Object.values(g.reduce((e={},t)=>(e[t.displayInfo.startTime]=e[t.displayInfo.startTime]?.concat([])??[],e[t.displayInfo.startTime].push(t),e),{})),[g]);return useEffect$1(()=>{c(h.length);},[h,c]),jsx("div",{className:o,...n,children:v&&0!==v.length?v.map(t=>jsx(r,{title:String(t[0].displayInfo.startTime)??null,children:t.map(t=>jsx(a,{item:t},t.id))},t[0].id??"")):jsx(i,{})})}function us({className:n,icon:o="download",text:i="No downloads to display.",...r}){const a=N("io-dm-no-items",n);return jsxs("div",{className:a,...r,children:[jsx(S,{variant:o}),jsx("p",{children:i})]})}function ds({className:n,title:o,children:i,...r}){const a=N("io-dm-item-group",n);return jsxs("div",{className:a,...r,children:[o&&jsx("p",{children:o}),i]})}function fs({className:o,item:i,...r}){const{ItemHeader:a,ItemBody:s,ItemFooter:l}=Ns(),{state:c,url:u,filename:d,receivedBytes:f,totalBytes:m,speed:p,timeRemaining:h}=i.displayInfo;if(!i)return jsx(Fragment,{});const g=N("io-dm-item",i.displayInfo.state&&[c],o);return jsxs("div",{className:g,...r,children:[jsx(a,{itemID:i.id,filename:d,state:c}),jsx(s,{state:c,url:u,bytesReceived:f,bytesTotal:m,speed:p,timeRemaining:h}),jsx(l,{itemID:i.id,state:c})]})}function ms({bytesReceived:t=0,bytesTotal:n=0,...o}){const i=useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return jsx(ti,{value:i(),...o})}function ps({className:n,itemID:o,filename:i,state:r,cancel:s,remove:l,...c}){const u=N("io-dm-item-header",n),{cancelItem:d,removeItem:f}=ts(),m=useCallback(e=>{s?s(e):d(e);},[s,d]),p=useCallback(e=>{l?l(e):f(e);},[l,f]);return jsxs("div",{className:u,...c,children:[jsx(M,{text:i,style:{textDecoration:"interrupted"===r||"cancelled"===r?"line-through":"none"}}),jsx(D,{icon:"close",iconSize:"12",onClick:()=>{"progressing"===r||"paused"===r?m(o):p(o);}})]})}function hs({className:n,state:o,url:i,bytesReceived:r=0,bytesTotal:a=0,speed:s=0,timeRemaining:l=0,...c}){const u=N("io-dm-item-body",n),d=e=>{const t=["Bytes","KB","MB","GB","TB"];if(0===e)return "0";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e}${t[n]}`:`${(e/1024**n).toFixed(1)}${t[n]}`};return jsxs("div",{className:u,...c,children:[jsx("p",{className:"io-text-small",children:i}),(m=o,"cancelled"===m||"interrupted"===m||"completed"===m?null:jsx(ms,{variant:"paused"===m?"paused":"active",bytesReceived:r,bytesTotal:a})),jsx("p",{className:"io-text-default-lh16",children:"completed"===o?`${d(r??0)} - Done`:"cancelled"===o||"interrupted"===o?`${d(r??0)}/${d(a??0)} - Failed`:`${d(r??0)}/${d(a??0)} (${f=s,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60);let o="";return t>0&&(o+=`${t} hour${t>1?"s":""}, `),n>0&&(o+=`${n} min${n>1?"s":""}, `),((e=Math.floor(e%60))>0||""===o)&&(o+=`${e} sec${1!==e?"s":""}`),`${o.trim()} left`})(l)??0}`})]});var f,m;}const gs={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function vs({className:n,variant:o,text:i}){const r=N("io-dm-item-status",`io-dm-item-status-${o}`,n);return jsxs("div",{className:r,children:[o&&jsx(S,{variant:gs[o],className:"icon-severity",size:"10"}),i&&jsx("p",{className:"io-text-smaller",children:i})]})}function ys({className:o,itemID:i,state:r,pauseResume:s,showInFolder:l,cancel:c,...u}){const d=N("io-dm-item-footer",o),{pauseResumeItem:f,showItemInFolder:m,cancelItem:p}=ts(),h=useCallback(e=>{s?s(e):f(e);},[s,f]),g=useCallback(e=>{l?l(e):m(e);},[l,m]),v=useCallback(e=>{c?c(e):p(e);},[c,p]);return jsx("div",{className:d,...u,children:(()=>{switch(r){case"progressing":return jsxs(Z,{align:"right",children:[jsx(Z.Button,{variant:"primary",text:"Pause",onClick:()=>h(i)}),jsx(Z.Button,{variant:"link",text:"Cancel",onClick:()=>v(i)})]});case"paused":return jsx(Z,{align:"right",children:jsx(Z.Button,{variant:"primary",text:"Resume",onClick:()=>h(i)})});case"completed":return jsxs(Fragment,{children:[jsx(vs,{variant:"success",text:"Complete"}),jsx(Z,{align:"right",children:jsx(Z.Button,{variant:"primary",text:"Show in Folder",onClick:()=>g(i)})})]});case"cancelled":return jsx(vs,{variant:"warning",text:"Cancelled"});case"interrupted":return jsxs(Fragment,{children:[jsx(vs,{variant:"critical",text:"Failed"}),jsx(Z,{align:"right",children:jsx(Z.Button,{variant:"primary",text:"Retry",onClick:()=>h(i)})})]});default:return null}})()})}function ws({className:n,title:o="Download Settings",...i}){const r=N("io-dm-settings-panel",n),{configuration:{downloadFolder:a},hideSettings:s,setDownloadLocation:l,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:u,downloadLocationList:d}=ts();return jsxs(Zo,{className:r,...i,children:[jsxs(Zo.Header,{children:[jsx(Zo.Header.Title,{size:"large",text:o,tag:"h1"}),jsx(Zo.Header.ButtonGroup,{children:jsx(D,{variant:"circle",icon:"close",size:"32",onClick:()=>{s();},disabled:u})})]}),jsx(Zo.Body,{children:jsxs(Z,{children:[jsxs(X,{variant:"light",disabled:u,children:[jsx(X.Button,{children:jsx("span",{className:"io-dm-settings-panel-download-location",children:a??d[0]})}),d.length>1&&jsx(X.Content,{children:jsx(X.List,{children:d.map((t,n)=>!t||0===n||n>3?null:jsx(X.Item,{onClick:()=>{l(t);},children:t},t))})})]}),jsx(T,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c();},disabled:u})]})})]})}const bs={Header:Xa,ItemSearch:ns,HeaderButtons:os,MoreButton:is,CloseButton:as,Body:cs,DownloadListEmpty:us,ItemGroup:ds,Item:fs,ItemProgress:ms,ItemHeader:ps,ItemBody:hs,ItemFooter:ys,Settings:ws},Cs=createContext(bs),ks=memo(({children:t,components:n})=>{const o=useMemo(()=>({...bs,...n}),[n]);return jsx(Cs.Provider,{value:o,children:t})});ks.displayName="ComponentsStore";const Ns=()=>useContext(Cs);function Ss({className:n,...o}){const i=N("io-dm",n),{Header:r,Body:a,Settings:s}=Ns(),{isSettingsVisible:l}=ts();return jsxs(Zo,{className:i,...o,children:[jsx(r,{}),jsx(a,{}),l&&jsx(s,{})]})}Object.freeze({__proto__:null,Body:cs,CloseButton:as,DownloadListEmpty:us,DownloadManager:function({components:t,...n}){return jsx(ks,{components:t,children:jsx(Ss,{...n})})},DownloadManagerProvider:({children:t})=>{const{configuration:n,items:o,removeItem:i,pauseResumeItem:r,cancelItem:a,clearItems:s,showItemInFolder:l,isSettingsVisible:d,showSettings:m,hideSettings:p,searchQuery:h,setSearch:g,itemsCount:v,setCount:y,setDownloadLocation:w,setDownloadLocationWithDialog:b,sortItems:C,isDownloadLocationDialogVisible:k,downloadLocationList:N}=function(){const[e,t]=useState$1({}),[n,o]=useState$1([]),[i,r]=useState$1(0),[a,s]=useState$1([]),[l,u]=useState$1(""),[d,m]=useState$1(!1),[p,h]=useState$1(!1),[g,v]=useState$1({filePaths:[],canceled:!1});useEffect$1(()=>{if(!Za)return;const e=Za.downloads.onUpdate(e=>o(t=>y(t,e))),n=Za.downloads.onConfigurationChanged(e=>{t(e);});return Za.downloads.list().then(o).catch(console.error),Za.downloads.getSavePathList().then(e=>{e.pathList&&s(e.pathList);}).catch(console.error),()=>{e(),n();}},[]),useEffect$1(()=>{h(!1);},[g]);const y=(e,t)=>{const n=e.findIndex(e=>e.id===t.id);if(-1===n)return [t,...e];const o=[...e];return o[n]=t,o};return {items:n,setCount:e=>{r(e);},sortItems:(e,t=!0)=>e.sort((e,n)=>t?e.displayInfo.startTime<n.displayInfo.startTime?1:-1:e.displayInfo.startTime>n.displayInfo.startTime?1:-1),setSearch:e=>{u(e);},cancelItem:async e=>{try{await Za.downloads.cancel(e);}catch(e){console.error(e);}},removeItem:async e=>{try{o(t=>t.filter(t=>t.id!==e)),await Za.downloads.removeItem(e);}catch(e){console.error(e);}},clearItems:async()=>{try{o([]),await Za.downloads.clearDownloadList();}catch(e){console.error(e);}},itemsCount:i,searchQuery:l,showSettings:()=>{m(!0);},hideSettings:()=>{m(!1);},configuration:e,isSettingsVisible:d,pauseResumeItem:async e=>{try{await Za.downloads.pauseResume(e);}catch(e){console.error(e);}},showItemInFolder:async e=>{try{await Za.downloads.showInFolder(e);}catch(e){console.error(e);}},setDownloadLocation:async e=>{try{await Za.downloads.setSavePath(e),s(t=>{if(t.includes(e)){const n=t.filter(t=>t!==e);return [e,...n]}return [e,...t]});}catch(e){console.error(e);}},downloadLocationList:a,isDownloadLocationDialogVisible:p,setDownloadLocationWithDialog:async()=>{h(!0);try{const e=await Za.downloads.showOpenDialog();if(v(e),!e?.filePaths||0===e.filePaths.length)return;await Za.downloads.setSavePath(e.filePaths[0]),s(t=>{if(t.includes(e.filePaths[0])){const n=t.filter(t=>t!==e.filePaths[0]);return [e.filePaths[0],...n]}return [e.filePaths[0],...t]});}catch(e){console.error(e);}}}}(),S=useMemo(()=>({configuration:n,items:o,removeItem:i,pauseResumeItem:r,cancelItem:a,clearItems:s,showItemInFolder:l,isSettingsVisible:d,showSettings:m,hideSettings:p,searchQuery:h,setSearch:g,itemsCount:v,setCount:y,setDownloadLocation:w,setDownloadLocationWithDialog:b,sortItems:C,isDownloadLocationDialogVisible:k,downloadLocationList:N}),[n,o,i,r,a,l,s,d,m,p,h,g,v,y,w,b,C,k,N]);return jsx(es.Provider,{value:S,children:t})},Header:Xa,HeaderButtons:os,Item:fs,ItemBody:hs,ItemFooter:ys,ItemGroup:ds,ItemHeader:ps,ItemProgress:ms,ItemSearch:ns,MoreButton:is,Settings:ws,useDownloadManagerContext:ts});function xs(e){if(e&&e.errorHandling&&"function"!=typeof e.errorHandling&&"log"!==e.errorHandling&&"silent"!==e.errorHandling&&"throw"!==e.errorHandling)throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&"function"==typeof e.errorHandling&&e.errorHandling,n={};function o(n,o){var i=n instanceof Error?n:new Error(n);if(t)t(i);else {var r='[ERROR] callback-registry: User callback for key "'+o+'" failed: '+i.stack;if(e)switch(e.errorHandling){case"log":return console.error(r);case"silent":return;case"throw":throw new Error(r)}console.error(r);}}return {add:function(e,t,i){var r=n[e];return r||(r=[],n[e]=r),r.push(t),i&&setTimeout(function(){i.forEach(function(i){var r;if(null===(r=n[e])||void 0===r?void 0:r.includes(t))try{Array.isArray(i)?t.apply(void 0,i):t.apply(void 0,[i]);}catch(t){o(t,e);}});},0),function(){var o=n[e];o&&(o=o.reduce(function(e,n,o){return n===t&&e.length===o||e.push(n),e},[]),0===o.length?delete n[e]:n[e]=o);}},execute:function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];var r=n[e];if(!r||0===r.length)return [];var a=[];return r.forEach(function(n){try{var i=n.apply(void 0,t);a.push(i);}catch(t){a.push(void 0),o(t,e);}}),a},clear:function(){n={};},clearKey:function(e){n[e]&&delete n[e];}}}xs.default=xs;var Es=b(xs);var Is=new class{feedback=window.issueReporting;registry=Es();config;subscribed=!1;init(){this.subscribed||(this.subscribed=!0,window.onerror=(e,t,n,o,i)=>{this.feedback.send("error",e,t,n,o,i);},this.feedback.on("setTheme",e=>{const t=e.newTheme;this.registry.execute("on-theme-changed",t);}),this.feedback.on("submitEnded",e=>{const t=this.convertSubmitResultToPublic(e);this.registry.execute("on-submit-finished",t);}));}async getConfig(){return this.config=await this.feedback.invoke("config"),this.convertConfigToPublic(this.config)}onThemeChanged(e){return this.registry.add("on-theme-changed",e)}onSubmitFinished(e){return this.registry.add("on-submit-finished",e)}submitReport(e){return new Promise(t=>{const n=this.convertFeedbackToInternal(e),o=this.onSubmitFinished(e=>{o(),t(e);});this.feedback.send("submit",n);})}closeReport(e){return this.feedback.send("cancel",e)}setBounds(e,t,n,o){return this.feedback.send("setBounds",e,t,n,o)}openUrl(e){return this.feedback.send("openUrl",e)}convertConfigToPublic(e){return {version:e.version,buildVersion:e.buildVersion,region:e.region,env:e.env,theme:e.theme,isError:e.isError,errorMessage:e.errorMessage,mailingList:e.mailList,createJiraTicket:e.jiraEnabled,sendEmail:e.mailEnabled,attachments:e.attachments,applicationTitle:e.applicationTitle,allowEditRecipients:e.allowEditRecipients,attachmentsViewMode:e.attachmentsViewMode,selectedCategories:e.selectedCategories,technicalInfo:e.technicalInfo,environmentInfo:e.environmentDetails,showEnvironmentInfo:e.showEnvironmentInfo,context:e.context,sendEmailClient:e.mailClientConfig?.type??"Outlook"}}convertSubmitResultToPublic(e){return {description:e.description,jiraProcessed:e.jiraProcessed,jiraSucceeded:e.jiraSucceeded,jiraDetails:e.jiraDetails,jiraTicketUrl:e.jiraTicketUrl,emailProcessed:e.mailProcessed,emailSucceeded:e.mailSucceeded,emailDetails:e.mailDetails}}convertFeedbackToInternal(e){return {createTicket:e?.createJiraTicket,description:e?.description,summary:e?.summary,sendMail:e?.sendEmail,appendEnvironmentInfo:e?.appendEnvironmentInfo,appendTechnicalInfo:e?.appendTechnicalInfo,mailingList:e?.mailingList,attachments:e?.attachments,attachmentsMode:e?.attachmentsViewMode}}};const Ms=createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:e=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:e=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Ps=()=>useContext(Ms);function As({...n}){const{config:o,close:i}=Ps(),{applicationTitle:r}=o;return jsxs(ee,{draggable:!0,...n,children:[jsx(ee.Title,{tag:"h1",text:r?`Feedback Form - ${r}`:"Feedback Form",size:"large"}),jsx(ee.ButtonGroup,{className:"non-draggable",children:jsx(ee.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>i()})})]})}function Ts({className:n,handleSubmit:o,...i}){const r=N("io-panel-body",n),{config:a,submitFeedback:s}=Ps(),{IntroField:l,DescriptionField:c,TechInfoField:u,EnvInfoField:d,FileAttachmentsField:f,CategoryAttachmentsField:m,SettingsField:p,MailListField:h}=Gs(),g=o??s,v=`Your feedback will be submitted to the ${a.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return jsxs("form",{className:r,id:"feedback",onSubmit:e=>g(e),...i,children:[jsx(l,{children:jsx("p",{children:v})}),jsx(p,{}),jsx(h,{}),jsx(c,{}),jsx(u,{readOnly:!0}),jsx(d,{readOnly:!0}),"file"===a.attachmentsViewMode?jsx(f,{}):jsx(m,{})]})}function Os({...n}){const{FooterButtons:o}=Gs(),{openUrl:i,submitInProgress:r,submitStatus:a,jiraTicketURL:s}=Ps();return jsx(oe,{...n,children:jsxs("div",r?{className:"flex ai-center jc-between",children:[jsx(P,{children:jsx("p",{children:a.title})}),jsx(qo,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[jsxs(P,{children:[jsx("p",{className:"error"===a.type?"io-text-error":"",children:a.title}),s&&jsx("a",{href:s,onClick:e=>{e.preventDefault(),i(s);},children:s})]}),jsx(o,{})]})})}function Fs({className:t,...n}){const{CloseButton:o}=Gs(),{close:i}=Ps();return jsx(Z,{className:t,...n,children:jsx(o,{onClick:()=>i()})})}function Ls({className:n,...o}){const{SubmitButton:i,CancelButton:r,CloseButton:a}=Gs(),{close:s,submitCompleted:l}=Ps();return l?jsx(Z,{className:n,...o,children:jsx(a,{text:"Close",onClick:()=>s()})}):jsxs(Z,{className:n,...o,children:[jsx(i,{}),jsx(r,{onClick:()=>s()})]})}function Bs({text:t="Submit",...n}){return jsx(T,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function Rs({text:t="Cancel",...n}){return jsx(T,{variant:"link",text:t,...n})}function _s({...t}){return jsx(T,{variant:"primary",...t})}function Hs({showField:t=!0,className:n,title:o,hint:i,children:r,...a}){return t?jsx(P,{className:n,title:o,hint:i,...a,children:r}):null}function js({showField:t=!0,className:n,title:o="Description",hint:i,readOnly:r=!1,disabled:a,...s}){return t?jsx(P,{className:n,hint:i,title:"",...s,children:jsx(ii,{id:"description",name:"description",label:o,readOnly:r,disabled:a})}):null}function $s({showField:t,className:n,title:o="Technical Information",hint:i,fieldValue:r,readOnly:a=!1,disabled:s,...l}){const{config:c}=Ps(),u=t??c.errorMessage,d=r??c.errorMessage;return u&&d?jsx(P,{className:n,hint:i,...l,children:jsx(ii,{id:"errorMessage",name:"errorMessage",label:o,value:d,readOnly:a,disabled:s})}):null}function zs({showField:t,className:n,title:o="Environment Information",hint:i,fieldValue:r,readOnly:a=!1,disabled:s,...l}){const{config:c}=Ps(),u=t??c.showEnvironmentInfo,d=r??c.environmentInfo;return u&&d?jsx(P,{className:n,hint:i,...l,children:jsx(ii,{id:"environmentInfo",name:"environmentInfo",label:o,value:d,readOnly:a,disabled:s})}):null}function Ws({showField:t=!0,className:n,title:o="Attachments",hint:i,readOnly:r=!1,disabled:s,attachments:l,selectedCategories:c,...u}){const d=N("io-block-list-gap",n),{config:f}=Ps(),m=l??f.attachments,p=c??f.selectedCategories,h=useCallback(e=>!!p&&-1!==p.indexOf(e),[p]);return t?!m||m.length<=0?jsx(P,{title:"Attachments",children:jsx("p",{children:"No Attachments"})}):jsx(P,{className:d,title:o,hint:i,...u,children:jsx("div",{className:"file-attachments",children:m.map(t=>jsx(ri,{id:t.id,name:t.id,label:t.name,readOnly:r,disabled:s,defaultChecked:h(t.category)},t.id))})}):null}function Vs({showField:t=!0,className:n,title:o="Attachments",hint:i,readOnly:r=!1,disabled:s,categories:l,selectedCategories:c,...u}){const{config:d,attachmentCategories:f}=Ps(),m=l??f,p=c??d.selectedCategories,h=useCallback(e=>!!p&&-1!==p.indexOf(e),[p]);return t?!m||m.length<=0?jsx("p",{children:"No Attachments"}):jsx(P,{className:n,title:o,hint:i,...u,children:jsx("div",{className:"category-attachments",children:m.map(t=>jsx(fi,{id:t,name:t,align:"right",label:t,readOnly:r,disabled:s,defaultChecked:h(t)},t))})}):null}function Ys({className:n,title:o,hint:i,showField:r=!0,showJiraTicketField:a,jiraTicketLabel:s="Create Jira Ticket",showSendEmailField:l,sendEmailLabel:c="Send Email",readOnly:u=!1,disabled:d,...f}){const m=N("io-block-list-gap",n),{config:p,showMailingList:h,setShowMailingList:g}=Ps();if(!r)return null;const v=a??p.createJiraTicket,y=l??p.sendEmail;return jsxs(P,{className:m,hint:i,title:o,...f,children:[v&&jsx(fi,{id:"createJiraTicket",name:"createJiraTicket",label:s,align:"right",readOnly:u,disabled:d,defaultChecked:v}),y&&jsx(fi,{onChange:()=>{g(!h);},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:u,disabled:d,defaultChecked:y})]})}function Us({showField:t=!0,className:n,title:o="Email List",hint:i="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:a,disabled:s,...l}){const{config:c,showMailingList:u}=Ps(),d=t??c.sendEmail,f=a??!1===c.allowEditRecipients;return d&&u?jsx(P,{className:n,hint:i,...l,children:jsx(oi,{id:"mailingList",name:"mailingList",label:o,placeholder:r,readOnly:f,disabled:s,defaultValue:c.mailingList??""})}):null}const Ks={Header:As,Body:Ts,Footer:Os,HeaderButtons:Fs,FooterButtons:Ls,SubmitButton:Bs,CancelButton:Rs,CloseButton:_s,IntroField:Hs,DescriptionField:js,TechInfoField:$s,EnvInfoField:zs,FileAttachmentsField:Ws,CategoryAttachmentsField:Vs,SettingsField:Ys,MailListField:Us},Js=createContext(Ks),qs=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Ks,...n}),[n]);return jsx(Js.Provider,{value:o,children:t})});function Gs(e){return {...useContext(Js),...e}}function Qs({className:n,...o}){const i=N("io-feedback",n),{Header:r,Body:a,Footer:s}=Gs();return jsxs(Zo,{className:i,...o,children:[jsx(r,{}),jsx(a,{}),jsx(s,{})]})}qs.displayName="ComponentsStore";Object.freeze({__proto__:null,Body:Ts,CancelButton:Rs,CategoryAttachmentsField:Vs,CloseButton:_s,DescriptionField:js,EnvInfoField:zs,Feedback:function({components:t,...n}){return jsx(qs,{components:t,children:jsx(Qs,{...n})})},FeedbackProvider:({children:t})=>{const{config:n,onThemeChanged:o,openUrl:i,submit:r,setBounds:s,close:l,showMailingList:m,setShowMailingList:p,attachmentCategories:h,submitInProgress:g,setSubmitInProgress:v,submitStatus:y,setSubmitStatus:w,submitCompleted:b,setSubmitCompleted:C,jiraTicketURL:k,setJiraTicketURL:N,submitFeedback:S}=function(){const[e,t]=useState$1({env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"}),[n,o]=useState$1(!1),[i,r]=useState$1(!1),[s,l]=useState$1(!1),[u,m]=useState$1(""),[p,h]=useState$1([]),[g,v]=useState$1({type:"primary",title:"",text:""}),y=useRef();Is.init();const w=useCallback(e=>{const t=document.documentElement;return t.className="",t.classList.add(e),()=>{t.classList.remove(e);}},[]),b=useCallback(e=>{const t=new Set;e.filter(e=>{const n=t.has(e.category);return t.add(e.category),!n}),h(Array.from(t));},[]);useEffect$1(()=>{Is.getConfig().then(e=>{t(e),b(e.attachments),e.theme?w(e.theme):w("dark");}).catch(e=>{throw new Error("Failed to get Feedback Config:",e)}),Is.onThemeChanged(e=>{w(e);});},[b,w]),useEffect$1(()=>{o(e.sendEmail);},[e.sendEmail]),useEffect$1(()=>(i&&"Outlook"===e.sendEmailClient&&(y.current=setTimeout(()=>{v({title:"Sending an email. Go to Outlook to allow access.",type:"primary"});},100)),()=>clearTimeout(y.current)),[i,e.sendEmailClient]);const C=useCallback(e=>Is.onThemeChanged(e),[]),k=useCallback(e=>{e.jiraProcessed&&(v({title:e.jiraDetails,type:"success"}),m(e.jiraTicketUrl)),e.emailProcessed&&v({title:e.emailDetails,type:"success"});},[]),N=useCallback(async t=>{const n={createJiraTicket:e.createJiraTicket,sendEmail:e.sendEmail,mailingList:e.mailingList,attachments:e.attachments,attachmentsViewMode:e.attachmentsViewMode,...t};if(!n.createJiraTicket&&!n.sendEmail){const e="Can't send feedback. Feedback via Jira and email has been disabled.";throw v({title:e,type:"error"}),new Error(e)}if(n.sendEmail&&!n.mailingList){const e="No email recipient. Provide at least one valid email address in the Email List field.";throw v({title:e,type:"error"}),new Error(e)}n.createJiraTicket&&n.sendEmail&&(v({title:"Submitting an issue to Jira and sending an email...",type:"primary"}),r(!0)),n.createJiraTicket?(v({title:"Submitting an issue to Jira...",type:"primary"}),r(!0)):(v({title:"Sending an email...",type:"primary"}),r(!0));try{const e=await Is.submitReport(t);return k(e),r(!1),l(!0),clearTimeout(y.current),e}catch(e){throw console.log("An error occurred while submitting your feedback:",e),e}},[e.attachments,e.attachmentsViewMode,e.createJiraTicket,e.mailingList,e.sendEmail,k]),S=useCallback(e=>{Is.openUrl(e);},[]),D=useCallback(e=>{Is.closeReport(e);},[]),x=useCallback((e,t,n,o)=>{Is.setBounds(e,t,n,o);},[]),E=useCallback(t=>{t.preventDefault();const n=new FormData(t.currentTarget),o=[],i=[...e.attachments];if("file"===e.attachmentsViewMode)i.filter(e=>"on"===n.get(e.id)).map(e=>o.push(e.id));else {const e=p?.filter(e=>"on"===n.get(e)),t=i.reduce((t,n)=>(-1!==e.indexOf(n.category)&&t.push(n.id),t),[]);o.push(...t);}const r={createJiraTicket:"on"===n.get("createJiraTicket"),sendEmail:"on"===n.get("sendEmail"),description:n.get("description"),mailingList:n.get("mailingList"),attachments:o,attachmentsViewMode:e.attachmentsViewMode};return N(r)},[p,e.attachments,e.attachmentsViewMode,N]);return {config:e,onThemeChanged:C,openUrl:S,submit:N,setBounds:x,close:D,showMailingList:n,setShowMailingList:o,attachmentCategories:p,submitInProgress:i,setSubmitInProgress:r,submitStatus:g,setSubmitStatus:v,submitCompleted:s,setSubmitCompleted:l,jiraTicketURL:u,setJiraTicketURL:m,submitFeedback:E}}(),D=useMemo(()=>({config:n,onThemeChanged:o,openUrl:i,submit:r,setBounds:s,close:l,showMailingList:m,setShowMailingList:p,attachmentCategories:h,submitInProgress:g,setSubmitInProgress:v,submitStatus:y,setSubmitStatus:w,submitCompleted:b,setSubmitCompleted:C,jiraTicketURL:k,setJiraTicketURL:N,submitFeedback:S}),[n,o,i,r,s,l,m,h,g,y,b,k,S,N,v,w,C,p]);return jsx(Ms.Provider,{value:D,children:t})},FileAttachmentsField:Ws,Footer:Os,FooterButtons:Ls,Header:As,HeaderButtons:Fs,IntroField:Hs,MailListField:Us,SettingsField:Ys,SubmitButton:Bs,TechInfoField:$s,useFeedbackContext:Ps});function Zs({className:n,title:o="General",...i}){const r=N("io-notifications-settings-panel-general",n),{AllowNotifications:a,AllowNotificationToasts:s,ShowNotificationBadge:l,CloseNotificationOnClick:c,PanelAutoHide:u,HideToastsAfter:d}=Bl(),f=bi();return jsx("div",{className:r,...i,children:jsxs(P,{title:o,children:[f&&jsx(a,{}),f&&jsx(s,{}),jsx(l,{}),f&&jsx(u,{}),f&&jsx(c,{}),f&&jsx(d,{})]})})}var el=new class{subscribed=!1;io=void 0;registry=Es();logger=void 0;isPanelVisible=void 0;notifications=[];bulkActionsSupported=!1;init(e){if(this.subscribed)return;this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");const t=this.io.appManager.myApplication,n=t?.userProperties?.logger?.publishLevel??"error",o=t?.userProperties?.logger?.consoleLevel??"info";this.logger.publishLevel(n),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.8.2 ====="),this.getBulkActionsSupport(),this.subscribe();}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){const e=await(this.io?.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){if(this.isDesktopEnvironment())return this.io?.notifications.panel.show()}hidePanel(){if(this.isDesktopEnvironment())return this.io?.notifications.panel.hide()}clearAll(){return this.logger?.trace("clearing all notifications"),this.io?.notifications.clearAll()}clearAllOld(){return this.logger?.trace("clearing all old notifications"),this.io?.notifications.clearOld()}clearMany(e){return "function"==typeof(this.io?.notifications).clearMany?e.length<1?(this.logger?.trace("no ids provided to clear notifications"),Promise.resolve()):(this.logger?.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),(this.io?.notifications).clearMany(e)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){return this.logger?.trace(`closing notification with id ${e}`),this.io?.notifications.clear(e)}snooze(e,t){return this.logger?.trace(`snoozing notification with id ${e} for ${t}ms`),this.io?.notifications.snooze(e,t)}snoozeMany(e,t){return "function"==typeof(this.io?.notifications).snoozeMany?e.length<1?(this.logger?.trace("no ids provided to snooze notifications"),Promise.resolve()):(this.logger?.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),(this.io?.notifications).snoozeMany(e,t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){return this.logger?.trace(`setting state of ${e} to ${t}`),this.io?.notifications.setState(e,t)}setStates(e,t){return "function"==typeof(this.io?.notifications).setStates?e.length<1?(this.logger?.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):(this.logger?.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),(this.io?.notifications).setStates(e,t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){const e="function"==typeof(this.io?.notifications).clearMany&&"function"==typeof(this.io?.notifications).setStates&&"function"==typeof(this.io?.notifications).snoozeMany;this.bulkActionsSupported=e;}setFilter(e){return this.logger?.trace(`setting filter to ${JSON.stringify(e)}`),this.io?.notifications.setFilter(e)}configure(e){return this.io?.notifications.configure(e)}subscribe(){this.io?.notifications.onRaised(e=>{this.logger?.trace(`received event indicating notification raise: ${JSON.stringify(e)}`),this.attachHandlers(e),this.notifications.unshift(e),this.registry.execute("on-notifications-changed",[...this.notifications]);}),this.io?.notifications.onStateChanged(({id:e},t)=>{this.logger?.trace(`received event for notification state is changed - "${e}" - "${t?.toString()}"`),this.notifications=this.notifications.map(n=>n.id===e?(this.logger?.trace(`${n.id} - the state is changed from "${n.state}" to "${t?.toString()}"`),Object.assign(n,{state:t})):n),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications&&"onDataChanged"in this.io.notifications&&"function"==typeof this.io.notifications.onDataChanged&&this.io?.notifications.onDataChanged((e,t)=>{const n=e.id;this.logger?.trace(`received event for notification data is changed - "${n}" - "${JSON.stringify(t)}"`),this.notifications=this.notifications.map(e=>e.id===n?(this.logger?.trace(`${e.id} - the data is changed from "${JSON.stringify(e.data)}" to "${JSON.stringify(t)}"`),Object.assign(e,{data:t})):e),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications.onClosed(({id:e})=>{this.logger?.trace(`received event for notification is closed - "${e}".`),this.notifications=this.notifications.filter(t=>t.id!==e),this.registry.execute("on-notifications-changed",this.notifications);}),this.io?.notifications.onConfigurationChanged(e=>{this.logger?.trace(`received event for configuration changed - ${JSON.stringify(e)}.`),this.registry.execute("on-configuration-changed",e);}),this.isDesktopEnvironment()&&this.io?.notifications.panel.onVisibilityChanged(e=>{this.logger?.trace(`received event for panel visibility changed to "${e}".`),this.isPanelVisible=e,this.registry.execute("on-panel-visibility-changed",e);});}isDesktopEnvironment(){return "object"==typeof window&&(Boolean(window.iodesktop)||Boolean(window.glue42gd))}attachHandlers(e){e.actions?.forEach(t=>{Object.assign(t,{onClick:async n=>{try{this.logger?.info(`${e.id}/${t.action} - was clicked.`),await(this.io?.notifications.click(e.id,t.action,n));}catch(e){this.logger?.error("Error while clicking on action:",e);}}});});const t={snooze:async(t=1e4)=>{this.logger?.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${t}ms`),await(this.io?.notifications.snooze(e.id,t));},updateState:async t=>(this.logger?.trace(`${e.id} - request to change the state from ${e.state} to ${t}`),this.io?.notifications.setState(e.id,t)),updateData:async t=>{this.logger?.trace(`${e.id} - request to change the data to ${JSON.stringify(t)}`),this.io?.notifications&&"updateData"in this.io.notifications&&"function"==typeof this.io.notifications.updateData?await this.io.notifications.updateData(e.id,t):console.log("'updateData' method is not supported");},onClick:async t=>{try{this.logger?.info(`${e.id} - was clicked.`),await(this.io?.notifications.click(e.id,void 0,t));}catch(t){this.logger?.error(`Error while clicking on Notification: ${e.id}`,t);}},onShow:()=>{},close:async()=>(this.logger?.info(`${e.id} - was closed.`),this.close(e.id))};return Object.assign(e,t)}};function tl(e){const t=useContext(IOConnectContext),n=t?.appManager,o=bi(),[i,r]=useState$1([]),[s,d]=useState$1(0),m="Platform",p=useCallback((e="asc")=>{if(null===o)return [];const t=[...i].sort((t,n)=>{const o=(t.title??t.name).toLowerCase(),i=(n.title??n.name).toLowerCase();return "asc"===e?o.localeCompare(i):i.localeCompare(o)});if(!o){const e=t.findIndex(e=>e.name===m);if(-1!==e){const[n]=t.splice(e,1);t.unshift(n);}}return t},[i,o]),h=useMemo(()=>p("asc"),[p]),g=useMemo(()=>p("desc"),[p]);useEffect$1(()=>{if(null===o||o)return;const e={title:"System",name:m,hidden:!1,userProperties:{hidden:!1}};r(t=>t.some(t=>t.name===e.name)?t:[...t,e]);},[o]),useEffect$1(()=>{if(!n)return;const e=n.onAppAdded(e=>{r(t=>[...t,{title:e.title,name:e.name,hidden:e.hidden,userProperties:e.userProperties}]);}),t=n.onAppRemoved(e=>{r(t=>t.filter(t=>t.name!==e.name));}),o=n.onAppChanged(e=>{r(t=>{const n=t.find(t=>t.name===e.name);return [...t.filter(t=>t.name!==e.name),{title:e.title,name:n?.name,hidden:n?.hidden,allowed:n?.allowed,userProperties:n?.userProperties}]});});return ()=>{e(),t(),o();}},[n]);return {apps:useMemo(()=>{if(!e?.sourceFilter||!Array.isArray(i))return i;const{allowed:t=[],blocked:n=[]}=e.sourceFilter,o=t.includes("*"),r=n.includes("*");let a=0;const s=i.map(e=>{const n=o||t.includes(e.name),i=!r&&n;return i&&a++,{...e,allowed:i}});return d(a),s},[e,i]),allowedApps:s,sortedAppsAsc:h,sortedAppsDesc:g,sortAppsAlphabetically:p}}function nl(e,t,n){const o=useMemo(()=>{if(!t.toastStacking)return [];const o="application"===(i=t.stackBy)?"source":"severity"===i?"severity":"source";var i;const r=e.filter(e=>"Active"===e.state),a=new Map;for(const e of r){const t=e[o]??"";if(e.source&&n?.sourceFilter?.muted?.includes(e.source)||n?.sourceFilter?.muted?.includes("*"))continue;a.has(t)||a.set(t,{key:t,items:[]});const i=a.get(t);i&&i.items.unshift(e);}return Array.from(a.values()).filter(e=>e.items.some(e=>"Active"===e.state||"Stale"===e.state))},[e,t.toastStacking,t.stackBy,n?.sourceFilter?.muted]);return {notificationStacks:o}}function ol(e){const[t,n]=useState$1([]);return {selectedNotifications:t,selectNotification:(e,o)=>{const i=t;n(o?[...i,e]:i.filter(t=>t!==e));},selectAllNotifications:(t,o)=>{if(o){let o=[];switch(t){case"read":o=e.filter(e=>"Acknowledged"===e.state||"Seen"===e.state).map(e=>e.id);break;case"unread":o=e.filter(e=>"Active"===e.state||"Stale"===e.state).map(e=>e.id);break;case"snoozed":o=e.filter(e=>"Snoozed"===e.state).map(e=>e.id);break;default:o=e.map(e=>e.id);}n(o);}else n([]);}}}const il=e=>({enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:"stacked"===e.toasts?.mode,stackBy:e.toasts?.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}),rl=e=>Array.from(e.reduce((e,t)=>e.set(t.id,t),new Map).values());function al(){const e=useContext(IOConnectContext),[t,n]=useState$1({}),[o,i]=useState$1({}),[r,a]=useState$1([]),[s,u]=useState$1(0),[d,m]=useState$1(!0),{apps:p,allowedApps:h}=tl(t),{notificationStacks:g}=nl(r,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:v,selectNotification:y,selectAllNotifications:b}=ol(r);el.init(e),useEffect$1(()=>{(async()=>{await(async()=>{try{const e=await el.getConfiguration();n(e),i(t=>({...t,...il(e)}));}catch(e){console.error("Error fetching configuration:",e);}})(),await(async()=>{try{const e=await el.getNotificationsList();a(rl(e));}catch(e){console.error("Error fetching notifications:",e);}})();})().catch(e=>{console.error("Error in useNotifications fetch:",e);}),C();},[]),useEffect$1(()=>{const e=el.onNotificationsChanged(e=>{a(rl(e));}),t=el.onConfigurationChanged(e=>{const t=il(e);n(t=>({...t,...e})),i(e=>({...e,...t}));}),o=el.onCounterChanged(e=>{u(e);});return ()=>{e(),t(),o();}},[]);const C=()=>{m(el.bulkActionsSupported);},k=async e=>{await el.setFilter(e);};return {close:e=>el.close(e),clearAll:()=>el.clearAll(),settings:o,hidePanel:async()=>{await el.hidePanel();},showPanel:async()=>{await el.showPanel();},saveFilter:k,clearAllOld:()=>el.clearAllOld(),saveSetting:async e=>{const n=((e,t)=>{const n=(e=>({enabledNotifications:e=>({enable:e}),enabledToasts:e=>({enableToasts:e}),toastStacking:t=>({toasts:{mode:t?"stacked":"single",stackBy:e.toasts?.stackBy}}),stackBy:t=>({toasts:{mode:e.toasts?.mode,stackBy:t}}),showNotificationBadge:e=>({showNotificationBadge:e}),toastExpiry:e=>({toastExpiry:e}),placement:e=>({placement:e}),snooze:e=>({snooze:e}),closeNotificationOnClick:e=>({closeNotificationOnClick:e}),autoHidePanel:e=>({autoHidePanel:e})}))(t),o=Object.keys(e)[0],i=e[o];return o&&void 0!==i&&n[o]?n[o](i):{}})(e,t);n&&await el.configure(n);},allApps:p,saveAllFilter:async e=>{"subscribe"in e?await k({allowed:e.subscribe?["*"]:[],blocked:e.subscribe?[]:["*"]}):"mute"in e&&await k({muted:e.mute?["*"]:[]});},configuration:t,notifications:r,notificationStacks:g,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:h,isBulkActionsSupported:d,selectedNotifications:v,selectNotification:y,selectAllNotifications:b,clearMany:async e=>{await el.clearMany(e);},snooze:async(e,t)=>{await el.snooze(e,t);},snoozeMany:async(e,t)=>{await el.snoozeMany(e,t);},setState:async(e,t)=>{await el.setState(e,t);},setStates:async(e,t)=>{await el.setStates(e,t);},setCount:e=>{u(e);},getNotificationsList:async()=>await el.getNotificationsList()}}const sl=createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),ll=()=>useContext(sl);function cl({label:t="Allow notifications",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=useCallback(e=>{r({enabledNotifications:e.target.checked});},[r]);return s?jsx(fi,{label:t,align:n,onChange:l,checked:i.enabledNotifications??!1,...o}):null}function ul({label:t="Allow notification toasts",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=useCallback(e=>{r({enabledToasts:e.target.checked});},[r]);return s?jsx(fi,{label:t,align:n,onChange:c,checked:i.enabledToasts??!1,disabled:l,...o}):null}function dl({label:t="Show notification badge",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi()&&!i.enabledNotifications,l=useCallback(e=>{r({showNotificationBadge:e.target.checked});},[r]);return jsx(fi,{label:t,align:n,onChange:l,checked:i.showNotificationBadge??!1,disabled:s,...o})}function fl({label:t="Close notification on click",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=useCallback(e=>{r({closeNotificationOnClick:e.target.checked});},[r]);return s?jsx(fi,{label:t,align:n,onChange:c,checked:i.closeNotificationOnClick??!1,disabled:l,...o}):null}function ml({label:t="Auto hide panel",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=useCallback(e=>{r({autoHidePanel:e.target.checked});},[r]);return s?jsx(fi,{label:t,align:n,onChange:l,checked:i.autoHidePanel??!1,...o}):null}const pl=(e,t)=>e?`${e} ${t}${1!==e?"s":""}`:"",hl=e=>{const t=Math.floor(e/60),n=e%60,o=pl(t,"minute"),i=pl(n,"second");return o+(o&&i?" ":"")+i};function gl({className:n,title:o="Hide toasts after",items:i=[15,30,45,60],...r}){const s=N("flex","jc-between","ai-center",n),{settings:l,saveSetting:c}=ll(),u=bi(),d=u&&!l.enabledNotifications,f=useCallback((e=15e3)=>{l.toastExpiry!==e&&c({toastExpiry:1e3*e});},[l.toastExpiry,c]);return u?jsxs("div",{className:s,...r,children:[jsx("div",{className:"io-text-clipper "+(d?"io-text-disabled":""),children:jsx("span",{children:o})}),jsxs(X,{variant:"light",disabled:d,children:[jsx(X.Button,{text:hl((l.toastExpiry??0)/1e3)}),jsx(X.Content,{children:jsx(X.List,{variant:"single",children:i.map(t=>jsx(X.Item,{onClick:()=>{f(t);},children:hl(t)},t))})})]})]}):null}function vl({className:n,title:o="Stacking",...i}){const r=N("io-notifications-settings-panel-stacking",n),{ToastStacking:a,ToastStackBy:s}=Bl();return bi()?jsx("div",{className:r,...i,children:jsxs(P,{title:o,children:[jsx(a,{}),jsx(s,{})]})}):null}function yl({label:t="Allow toast stacking",align:n="right",...o}){const{settings:i,saveSetting:r}=ll(),s=bi(),l=s&&!i.enabledNotifications,c=useCallback(e=>{r({toastStacking:e.target.checked});},[r]);return s?jsx(fi,{label:t,align:n,onChange:c,checked:i.toastStacking??!1,disabled:l,...o}):null}const wl={application:"Application",severity:"Priority"},bl=Object.fromEntries(Object.entries(wl).map(([e,t])=>[t,e]));function Cl({className:n,title:o="Group by",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=c&&!s.enabledNotifications,d=useCallback((e="severity")=>{s.stackBy!==e&&l({stackBy:e.toLowerCase()});},[s.stackBy,l]);if(!c)return null;const f=Object.values(wl);return jsxs("div",{className:r,...i,children:[jsx("div",{className:N("io-text-clipper",{"io-text-disabled":u}),children:jsx("span",{children:o})}),jsxs(X,{variant:"light",disabled:u,children:[jsx(X.Button,{text:wl[s.stackBy??"severity"]}),jsx(X.Content,{children:jsx(X.List,{variant:"single",children:f.map(t=>jsx(X.Item,{onClick:()=>{const e=bl[t];d(e);},children:t},t))})})]})]})}function kl({className:n,title:o="Placement",...i}){const r=N("io-notifications-settings-panel-placement",n),{PlacementPanel:a,PlacementToasts:s}=Bl();return bi()?jsx("div",{className:r,...i,children:jsxs(P,{title:o,children:[jsx(a,{}),jsx(s,{})]})}):null}const Nl=e=>e.replace(/(^|-)\w/g,e=>e.toUpperCase().replace("-"," "));function Sl({className:n,title:o="Panel position",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=useCallback(e=>{e||(e="right"),s.placement?.panel!==e&&l({placement:{...s.placement,panel:e.toLowerCase()}});},[s.placement,l]);if(!c)return null;return jsxs("div",{className:r,...i,children:[jsx("div",{className:"io-text-clipper",children:jsx("span",{children:o})}),jsxs(X,{variant:"light",children:[jsx(X.Button,{text:s.placement?.panel?Nl(s.placement?.panel):"Right"}),jsx(X.Content,{children:jsx(X.List,{variant:"single",children:["Right","Left"].map(t=>jsx(X.Item,{onClick:()=>{u(t);},children:t},t))})})]})]})}function Dl({className:n,title:o="Toasts position",...i}){const r=N("flex","jc-between","ai-center",n),{settings:s,saveSetting:l}=ll(),c=bi(),u=useCallback(e=>{if(e||(e="bottom-right"),s.placement?.toasts===e)return;const t=e.replace(/\s+/g,"-").toLowerCase();l({placement:{...s.placement,toasts:t}});},[s.placement,l]);if(!c)return null;return jsxs("div",{className:r,...i,children:[jsx("div",{className:"io-text-clipper",children:jsx("span",{children:o})}),jsxs(X,{variant:"light",children:[jsx(X.Button,{text:s.placement?.toasts?Nl(s.placement?.toasts):"Bottom Right"}),jsx(X.Content,{children:jsx(X.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(t=>jsx(X.Item,{onClick:()=>{u(t);},children:t},t))})})]})]})}function xl({className:t,title:n="Snooze",...o}){const i=N("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=Bl(),{settings:a}=ll();return bi()&&a.snooze?.enabled?jsx("div",{className:i,...o,children:jsx(P,{title:n,children:jsx(r,{})})}):null}function El({className:n,title:o="Default duration",items:i=[60,120,180,300],...r}){const s=N("flex","jc-between","ai-center",n),{settings:l,saveSetting:c}=ll(),u=bi(),d=u&&!l.enabledNotifications,f=useCallback((e=6e4)=>{l.snooze&&l.snooze?.duration!==e&&c({snooze:{...l.snooze,duration:1e3*e}});},[l.snooze,c]);return u&&l.snooze?.enabled?jsxs("div",{className:s,...r,children:[jsx("div",{className:N("io-text-clipper",{"io-text-disabled":d}),children:jsx("span",{children:o})}),jsxs(X,{variant:"light",disabled:d,children:[jsx(X.Button,{text:hl((l.snooze?.duration??0)/1e3)}),jsx(X.Content,{children:jsx(X.List,{variant:"single",children:i.map(t=>jsx(X.Item,{onClick:()=>{f(t);},children:hl(t)},t))})})]})]}):null}function Il({className:n,title:o,...i}){const r=N("io-notifications-settings-panel-subscriptions",n),{SubscribeAll:a,SubscribeApp:s,SubscribeMuteAll:l,SubscribeMuteApp:c}=Bl(),{sortAppsAlphabetically:u}=tl(),d=bi(),f=u(),m="io-notifications-subscriptions-grid "+(d?"with-three-columns":"with-two-columns");return jsx("div",{className:r,...i,children:jsxs(P,{title:o??(d?"Subscribe & Mute":"Subscribe"),children:[jsxs("div",{className:m,children:[jsx("p",{className:"io-text-section",children:"Sources"}),jsx("p",{className:"io-text-section",children:"Subscribe"}),d&&jsx("p",{className:"io-text-section",children:"Mute"})]}),jsxs("div",{className:m,children:[jsx("p",{children:"All Sources"}),jsx(a,{label:""}),d&&jsx(l,{label:""})]}),f.map(n=>!n||n.hidden||n?.userProperties?.hidden?null:jsxs("div",{className:m,children:[jsx("p",{children:n.title??n.name}),jsx(s,{app:n,label:""}),d&&jsx(c,{app:n,label:""})]},n.name))]})})}function Ml({label:t="All apps",align:n="right",...o}){const{settings:i,configuration:r,saveAllFilter:s}=ll(),l=bi()&&!i.enabledNotifications,c=useCallback(e=>{s({subscribe:e.target.checked});},[s]);return jsx(fi,{align:n,label:t,onChange:c,checked:(r.sourceFilter?.allowed?.includes("*")&&0===r.sourceFilter?.blocked?.length)??!1,disabled:l,...o})}function Pl({label:t="App",align:n="right",app:o,...i}){const{allApps:r,settings:s,configuration:l,saveFilter:c}=ll(),u=bi()&&!s.enabledNotifications,d=useCallback((e,t)=>{const n={...l.sourceFilter},o=n.allowed?.indexOf("*");"number"==typeof o&&o>-1&&(n.allowed?.splice(o,1),r.forEach(e=>{e.name!==t.name&&n.allowed?.push(e.name);})),e?(n.allowed=[...new Set([...n.allowed??[],t.name])],n.blocked=n.blocked?.filter(e=>e!==t.name)):(n.allowed=n.allowed?.filter(e=>e!==t.name),n.blocked=[...new Set([...n.blocked??[],t.name])]),n.allowed?.length&&n.blocked?.includes("*")&&n.blocked.splice(n.blocked.indexOf("*"),1),c(n);},[r,l.sourceFilter,c]);return jsx(fi,{id:o.name,label:t,align:n,onChange:e=>d(e.target.checked,o),checked:(l.sourceFilter?.allowed?.includes("*")&&!l.sourceFilter?.blocked?.includes(o.name)||l.sourceFilter?.allowed?.includes(o.name))??!1,disabled:u,...i})}function Al({label:t="Mute all",align:n="right",...o}){const{settings:i,configuration:r,saveAllFilter:s}=ll(),l=bi(),c=l&&(!i.enabledNotifications||-1===r.sourceFilter?.allowed?.indexOf("*")),u=useCallback(e=>{s({mute:e.target.checked});},[s]);return l?jsx(fi,{align:n,label:t,onChange:u,checked:r.sourceFilter?.muted?.includes("*")??!1,disabled:c??!1,...o}):null}function Tl({label:t="App",align:n="right",app:o,...i}){const{allApps:r,settings:s,configuration:l,saveFilter:c}=ll(),u=bi(),d=u&&(!s.enabledNotifications||l.sourceFilter?.blocked?.includes("*")||l.sourceFilter?.blocked?.includes(o.name)||0===l.sourceFilter?.allowed?.length||-1===l.sourceFilter?.allowed?.indexOf(o.name)&&-1===l.sourceFilter?.allowed?.indexOf("*")&&0===l.sourceFilter?.blocked?.length),f=useCallback((e,t)=>{const n={...l.sourceFilter},o=n?.muted?.indexOf("*");"number"==typeof o&&o>-1&&(n.muted?.splice(o,1),r.forEach(e=>{e.name===t.name||e.hidden||n.muted?.push(e.name);})),e?n.muted?.push(t.name):n.muted=n.muted?.filter(e=>e!==t.name),c(n);},[r,l.sourceFilter,c]);return !u||o.hidden?null:jsx(fi,{id:o.name,label:t,align:n,onChange:e=>f(e.target.checked,o),checked:(l.sourceFilter?.muted?.includes("*")||l.sourceFilter?.muted?.includes(o.name))??!1,disabled:d??!1,...i})}const Ol={Body:n=>{const{General:o,Placement:i,Stacking:r,Snooze:a,Subscriptions:s}=Bl();return jsxs(Qo,{...n,children:[jsx(o,{}),jsx(r,{}),jsx(i,{}),jsx(a,{}),jsx(s,{})]})},General:Zs,AllowNotifications:cl,AllowNotificationToasts:ul,ShowNotificationBadge:dl,CloseNotificationOnClick:fl,PanelAutoHide:ml,HideToastsAfter:gl,Stacking:vl,ToastStacking:yl,ToastStackBy:Cl,Placement:kl,PlacementPanel:Sl,PlacementToasts:Dl,Snooze:xl,SnoozeDuration:El,Subscriptions:Il,SubscribeAll:Ml,SubscribeApp:Pl,SubscribeMuteAll:Al,SubscribeMuteApp:Tl},Fl=createContext(Ol),Ll=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Ol,...n}),[n]);return jsx(Fl.Provider,{value:o,children:t})});Ll.displayName="NotificationsSettingsPanelComponentsStoreProvider";const Bl=()=>useContext(Fl),Rl=({className:n,onClose:o,title:i="Notification Settings",...r})=>{const{Body:a}=Bl();return jsxs(Zo,{className:N("io-notifications-settings-panel",n),"data-testid":"notifications-settings-panel",...r,children:[jsxs(Zo.Header,{children:[jsx(Zo.Header.Title,{size:"large",text:i,tag:"h1"}),jsx(Zo.Header.ButtonGroup,{children:jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o})})]}),jsx(a,{})]})},_l=({components:t,...n})=>jsx(Ll,{components:t,children:jsx(Rl,{...n})});function Hl({isOpen:t,onClose:n,container:o}){return t?createPortal(jsx(_l,{onClose:n}),o??document.querySelector("#root")??document.body):null}const jl=createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),$l=()=>useContext(jl);function zl({title:n,onClose:o,onOpenSettings:i,...r}){const{HeaderCaptionTitle:a,HeaderCaptionCount:s,HeaderCaptionButtonSettings:l,HeaderCaptionButtonClose:c,HeaderActions:u,HeaderBulkActions:d,HeaderSearch:f}=Oc(),{isBulkActionsSupported:m,notificationsCount:p}=ll(),{isBulkActionsVisible:h}=$l(),g=bi();return jsxs(Go,{...r,children:[jsxs("div",{className:"io-panel-header-caption",children:[jsx(a,{title:n}),jsx(s,{}),jsxs(Go.ButtonGroup,{children:[g&&jsx(l,{onClick:i}),jsx(c,{onClick:o})]})]}),jsx(f,{}),m?jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[jsx(u,{}),jsx(d,{})]}):jsx(u,{})]})}function Wl({text:n="Notifications",counter:o,...i}){const{notificationsCount:r}=ll();return jsx(M,{text:n,size:"large",...i,children:(o??!0)&&jsxs("span",{children:["(",r,")"]})})}const Vl="newest",Yl="oldest",Ul="severity",Kl=["None","Low","Medium","High","Critical"],Jl={key:Vl,descending:!0},ql=e=>[...e].sort((e,t)=>(t.timestamp||0)-(e.timestamp||0)),Gl=e=>[...e].sort((e,t)=>(e.timestamp||0)-(t.timestamp||0)),Ql=(e,t)=>{const n=Kl[0];return [...e].sort((e,o)=>{const i=Kl.indexOf(e.severity||n),r=Kl.indexOf(o.severity||n);return (t?-1:1)*(i-r)})},Xl={[Vl]:ql,[Yl]:Gl,[Ul]:Ql},Zl={severity:"Priority",newest:"Newest",oldest:"Oldest"};function ec({...t}){const[n,o]=useState$1([]),{NotificationsList:i,Notification:r}=Oc(),{notifications:a,setCount:s,notificationsCount:l}=ll(),{sortNotificationsBy:m,viewNotificationsBy:p,searchQuery:h}=$l(),g=useRef(null),v=hi(h),y=useMemo(()=>{const e=((e,t)=>{if(!e)return [];switch(t){case"all":default:return e;case"unread":return e.filter(e=>"Active"===e.state||"Stale"===e.state);case"read":return e.filter(e=>"Acknowledged"===e.state||"Seen"===e.state);case"snoozed":return e.filter(e=>"Snoozed"===e.state)}})(a,p);return e.filter(e=>e.title.toLowerCase().includes(v.toLowerCase())||e.source?.toLowerCase().includes(v.toLowerCase())||e.body?.toLowerCase().includes(v.toLowerCase()))},[v,a,p]);return useEffect$1(()=>{switch(m){case"newest":o(ql(y));break;case"oldest":o(Gl(y));break;case"severity":o(Ql(y,!0));break;default:o(y);}s(y.length);},[y,m,s]),useEffect$1(()=>{g.current&&g.current?.scrollTo({top:0,behavior:"smooth"});},[v,l,m,p]),jsx(Qo,{ref:g,...t,children:jsx(i,{notifications:n,Notification:r})})}function tc({...t}){const{FooterButtons:n}=Oc();return jsx(Xo,{...t,children:jsx(n,{})})}function nc({className:n,...o}){const{FooterButtonClearAll:i,FooterButtonClearAllOld:r}=Oc(),{notifications:a}=ll(),[s,l]=useState$1(!1);return useEffect$1(()=>{a.filter(e=>"Stale"===e.state||"Acknowledged"===e.state).length>0?l(!0):l(!1);},[a]),jsxs(Z,{className:n,align:"right",...o,children:[jsx(r,{disabled:!s}),jsx(i,{disabled:a.length<=0})]})}function oc({text:t="Clear All",...n}){const{clearAll:o}=ll();return jsx(T,{text:t,onClick:()=>{o();},...n})}function ic({text:t="Clear Old",...n}){const{clearAllOld:o}=ll();return jsx(T,{text:t,onClick:()=>{o();},...n})}function rc(e){const t=bi(),{onClose:n,settings:o}=ll(),{isPanelVisible:i}=$l(),{id:r,onClick:s,updateState:l}=e,c=useCallback(async()=>{if(!s)return;if(!t){try{await s({close:!0});}catch(e){console.error(e);}return void n(r)}const e=o?.toastStacking??!1;let a;a=i?o?.closeNotificationOnClick??!0:!e&&null;try{null!==a?await s({close:a}):(await s({close:!1}),await l("Acknowledged"));}catch(e){console.error(e);}},[t,r,i,s,n,l,o?.closeNotificationOnClick,o?.toastStacking]),u=useCallback(async e=>{const t=e.target;t.closest("button")||t.closest("[role='button']")||t.closest("a")||t.closest(".io-dropdown-menu")||await c();},[c]);return {handleClick:c,handleWrapperClick:u}}function ac({className:n,notification:o,onClick:i,...r}){const a=N("io-notification-header",n),{HeaderCount:s,HeaderBadge:l,HeaderTitle:c,HeaderTimestamp:u,HeaderButtonSnooze:d,HeaderButtonClose:f}=Nc(),{handleWrapperClick:m}=rc(o);return jsxs("div",{className:a,onClick:async e=>{await m(e),i?.(e);},...r,children:[jsx(l,{notification:o}),jsx(s,{notification:o}),jsx(c,{notification:o}),jsx(u,{notification:o}),jsxs(Z,{children:[jsx(d,{notification:o}),jsx(f,{notification:o})]})]})}function sc({notification:t,...n}){const{settings:o,notificationStacks:i}=ll(),{isPanelVisible:r}=$l(),{toastStacking:a,stackBy:s}=o,l="application"===s?"source":s??"source";let c=0;if(a){const e=i.find(e=>e.key===t[l]);c=e?.items.length??0;}return r||!a||c<=1?null:jsx(ei,{...n,children:c>9?"9+":c})}function lc({className:t,notification:n,...o}){if(!n?.severity||"None"===n.severity)return null;const i=N("io-notification-header-badge",t);return jsx(ei,{className:i,...o,children:n.severity})}function cc({className:n,state:o,severity:i="None",icon:r,...a}){const s=N("io-notification-header-icon",n),{isPanelVisible:l}=$l();return jsxs("div",{className:s,...a,children:[r&&jsx("span",{className:"io-notification-header-icon-image",children:jsx("img",{src:r,alt:`io-notification-header-icon-${r}`})}),jsx("span",{className:`io-notification-header-icon-badge color-${i.toLowerCase()}`,children:l&&"Acknowledged"!==o&&"New"})]})}function uc({className:t,notification:{appTitle:n},...o}){const i=N("io-notification-header-title",t);return jsx("div",{className:i,...o,children:n})}function dc({className:t,notification:{timestamp:n,state:o,snooze:i},...r}){const a=N("io-notification-timestamp",t);return jsx("small",i&&"Snoozed"===o?{className:a,...r,children:"Snoozed"}:{className:a,...r,children:ls(n??0)??"Just Now"})}function fc({notification:{id:t,state:n},...o}){const{settings:i,snooze:r}=ll(),s=useCallback(e=>{e.stopPropagation(),r&&r(t,i.snooze?.duration??0);},[t,r,i.snooze?.duration]);return r&&"Snoozed"!==n&&i.snooze?.enabled?jsx(T,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:s,...o}):null}function mc({notification:{id:t,updateState:n},...o}){const i=bi(),{onClose:r}=ll(),{isPanelVisible:s}=$l(),l=useCallback(e=>{e.stopPropagation(),!i||s?r(t):n("Acknowledged").catch(console.error);},[i,t,r,s,n]);return jsx(D,{icon:"close",iconSize:"10",tabIndex:-1,onClick:l,...o})}function pc({className:n,notification:o,...i}){const r=N("io-notification-body",n),{BodyIcon:a,BodyTitle:s,BodyDescription:l}=Nc(),{icon:c,title:u,body:d}=o,{handleClick:f}=rc(o);return jsxs("div",{className:r,role:"button",tabIndex:0,onKeyDown:async e=>{A(e)&&await f();},onClick:f,...i,children:[jsx(a,{icon:c}),jsxs("div",{className:"io-notification-body-content",children:[jsx(s,{text:u}),jsx(l,{text:d})]})]})}function hc({className:t,icon:n,altText:o="notification icon",...i}){if(!n)return null;const r=N("io-notification-body-icon",t);return jsx("div",{className:r,...i,children:jsx("img",{src:n,alt:o})})}function gc({text:t,...n}){return jsx(M,{text:t,...n})}function vc({className:t,text:n,...o}){const i=N("io-notification-body-description",t);return jsx("p",{className:i,...o,children:n})}function yc({className:n,notification:o}){const i=N("io-notification-footer",n),{FooterButton:r}=Nc(),{handleWrapperClick:a}=rc(o),s=useMemo(()=>function(e){const t=[],n={};if(!e)return;e.forEach(e=>{const{displayId:o,displayPath:i}=e,r={...e,children:[]};if(i&&i.length>0){let e;i.forEach((t,o)=>{0===o?e=n[t]:e&&(e=e.children?.find(e=>e.displayId===t));}),e&&e.children?.push(r);}else o?(t.push(r),n[o]=r):t.push(r);o&&(n[o]=r);});const o=e=>{e.forEach(e=>{0===e.children?.length?delete e.children:e.children&&o(e.children);});};return o(t),t}(o.actions),[o.actions]),l=(t,n)=>t.children?jsx(Ko,{text:t.title,children:t.children.map(l)},`${t.title}-${n}`):((t,n)=>jsx(Ko.Item,{children:jsx(r,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:t})},`${t.title}-${n}`))(t,n);return jsx("div",{className:i,onClick:a,children:jsx(Z,{align:"right",children:s?.map((n,o)=>n.children?jsxs(Z,{variant:"append",children:[jsx(r,{notificationAction:n,variant:0===o?"primary":"default"}),jsx(Ko,{variant:0===o?"primary":"default",icon:"ellipsis",children:n.children.map(l)})]},`${n.title}-${o}`):jsx(r,{notificationAction:n,variant:0===o?"primary":"link"},`${n.title}-${o}`))})})}function wc({notificationAction:t,...n}){const o=useCallback(e=>{e.stopPropagation(),t.onClick({close:!0});},[t]);return jsx(T,{text:t.title,onClick:o,...n})}const bc={Header:ac,HeaderCount:sc,HeaderBadge:lc,HeaderIcon:cc,HeaderTitle:uc,HeaderTimestamp:dc,HeaderButtonSnooze:fc,HeaderButtonClose:mc,Body:pc,BodyIcon:hc,BodyTitle:gc,BodyDescription:vc,Footer:yc,FooterButton:wc},Cc=createContext(bc),kc=memo(({children:t,components:n})=>{const o=useMemo(()=>({...bc,...n}),[n]);return jsx(Cc.Provider,{value:o,children:t})});function Nc(e){return {...useContext(Cc),...e}}function Sc({className:n,notification:o,...i}){const{Header:r,Body:a,Footer:s}=Nc(),{severity:l}=o,c=N("io-notification",`severity-${l?.toLowerCase()??"none"}`,"Acknowledged"!==o.state&&"state-new",n);return jsxs("div",{className:c,...i,children:[jsx(r,{notification:o}),jsx(a,{notification:o}),jsx(s,{notification:o})]})}function Dc({components:t,notification:n,...o}){return jsx(kc,{components:t,children:jsx(Sc,{notification:n,...o})})}function xc({className:n,notifications:o,...i}){const[r,s]=useState$1(!1),l=o.length>=3?"large":"normal",u=2===o.length?"small":l,d=o[0].severity,f=N("io-notification-stack",r&&"io-notification-stack-open","normal"!==u&&[`io-notification-stack-${u}`],d&&"None"!==d&&[`io-notification-stack-${d.toLowerCase()}`],n),m=useCallback(()=>{s(!0);},[]),p=useCallback(e=>{e.stopPropagation(),o.forEach(e=>{e.close();});},[o]);return jsxs("div",{className:f,onClick:m,...i,children:[r&&"normal"!==u&&jsx("div",{className:"io-notification-stack-btn",children:jsx(T,{icon:"close",onClick:e=>p(e),children:jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),o.map(t=>jsx(Dc,{notification:t},t.id))]})}function Ec({...t}){const{notificationStacks:o}=ll();return jsx(Fragment,{children:o.map(n=>jsx(xc,{notifications:n.items,...t},n.key))})}kc.displayName="ComponentsStoreProvider";const Ic=({notification:n,Notification:o,...i})=>{const{configuration:r,isBulkActionsSupported:a,selectedNotifications:s,selectNotification:l}=ll(),{isPanelVisible:c,isBulkActionsVisible:u}=$l(),d=r.sourceFilter?.muted??[],f=n.source&&d.includes(n.source)||d.includes("*");if(!c&&f)return null;const m=c&&a&&u,p=s.includes(n.id);return m?jsxs("div",{className:N("io-notification-list-bulk-action-item",{selected:p}),children:[jsx(ri,{checked:p,onChange:e=>l(n.id,e.target.checked)}),jsx(o,{notification:n,...i})]}):jsx(o,{notification:n,...i})};function Mc({className:n,Notification:o,notifications:i=[],noNotificationText:r="No notifications to display",...a}){const s=N("io-notification-list",n),{settings:l}=ll(),{isPanelVisible:c}=$l(),{toastStacking:u}=l,d=u&&!c,f=i.length>0;return jsxs("div",{className:s,...a,children:[d&&jsx(Ec,{}),!d&&(f?i.map(t=>jsx(Ic,{notification:t,Notification:o,...a},t.id)):jsx("div",{className:"flex jc-center mt-8",children:r}))]})}const Pc={Header:zl,HeaderCaptionTitle:Wl,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:o=0}=ll();return 0===o?null:jsx(I,{variant:t,...n,children:o>99?"99+":o})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:o="circle",...i}){return bi()?jsx(D,{icon:t,size:n,variant:o,...i}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:o="circle",onClick:i,...r}){const{hidePanel:a}=ll(),s=bi();return jsx(D,{icon:t,size:n,variant:o,onClick:e=>{i?i(e):s&&a();},...r})},HeaderActions:function({className:n,...o}){const i=N("io-panel-header-actions",n),{HeaderActionSort:r,HeaderActionView:a,HeaderActionClear:s,HeaderActionEdit:l}=Oc();return jsxs("div",{className:i,...o,children:[jsxs(Z,{children:[jsx(r,{}),jsx(a,{})]}),jsxs(Z,{children:[jsx(s,{}),jsx(l,{})]})]})},HeaderActionSort:function({text:n="Sort by",...o}){const{sortNotificationsBy:i,setSortBy:r}=$l(),{onNotificationsSort:s}=(()=>{const{notifications:e}=ll(),[t,n]=useState$1(Jl),{key:o,descending:i}=t,r=useMemo(()=>Xl[o](e,i),[e,o,i]),s=useCallback(e=>{n(t=>({key:e,descending:t.key!==e?Jl.descending:!t.descending}));},[]);return {onNotificationsSort:s,sortedNotifications:r}})();return jsxs(X,{variant:"light",...o,children:[jsxs(X.Button,{variant:"link",children:[n," ",jsx("strong",{children:Zl[i].toLowerCase()})]}),jsx(X.Content,{children:jsx(X.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(t=>{const n="Priority"===t?"severity":t.toLowerCase();return jsx(X.Item,{isSelected:i===n,onClick:()=>{r(n),s(n);},children:t},t)})})})]})},HeaderActionView:function({text:n="View",...o}){const{settings:i}=ll(),{viewNotificationsBy:r,setViewBy:a}=$l(),s=i.snooze?.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return jsxs(X,{variant:"light",...o,children:[jsxs(X.Button,{variant:"link",children:[n," ",jsx("strong",{children:r})]}),jsx(X.Content,{children:jsx(X.List,{variant:"single",checkIcon:"check",children:s.map(t=>jsx(X.Item,{isSelected:r===t.toLowerCase(),onClick:()=>a(t.toLowerCase()),children:t},t))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:o,notificationsCount:i}=ll();return jsx(T,{variant:"link",text:t,onClick:o,disabled:0===i,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:o,notificationsCount:i}=ll(),{showBulkActions:r}=$l();return o?jsx(D,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:0===i,...n}):null},HeaderBulkActions:function({className:n,...o}){const i=N("io-panel-header-bulk-actions",n),{HeaderBulkActionSelect:r,HeaderBulkActionSelectDropdown:a,HeaderBulkActionMarkAsRead:s,HeaderBulkActionMarkAsUnread:l,HeaderBulkActionSnooze:c,HeaderBulkActionClear:u,HeaderBulkActionClose:d}=Oc(),{isBulkActionsSupported:f}=ll();return f?jsx("div",{className:i,...o,children:jsxs(Z,{children:[jsx(r,{}),jsx(a,{}),jsx(s,{}),jsx(l,{}),jsx(c,{}),jsx(u,{}),jsx(d,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:o,selectAllNotifications:i,notificationsCount:r}=ll();return n?jsx(ri,{checked:r===o.length&&r>0,onChange:e=>i("all",e.target.checked),disabled:0===r,...t}):null},HeaderBulkActionSelectDropdown:function({...n}){const{isBulkActionsSupported:o,selectAllNotifications:i,notificationsCount:r}=ll();return o?jsxs(X,{variant:"light",...n,children:[jsx(X.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:0===r}),jsx(B,{children:jsxs(X.List,{variant:"single",checkIcon:"check",children:[jsx(X.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(t=>jsx(X.Item,{onClick:()=>i(t.toLowerCase(),!0),children:t},t))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:o="circle",tooltip:i="Mark as read",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,setStates:c,notificationsCount:u}=ll(),d=useCallback(()=>{c(l,"Seen");},[l,c]);return s?jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:o="circle",tooltip:i="Mark as unread",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,setStates:c,notificationsCount:u}=ll(),d=useCallback(()=>{c(l,"Active");},[l,c]);return s?jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:o="circle",tooltip:i="Snooze",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,snoozeMany:c,settings:u,notificationsCount:d}=ll(),f=useCallback(()=>{c(l,u.snooze?.duration??0);},[l,c,u.snooze?.duration]);return s&&u.snooze?.enabled?jsx(D,{icon:t,size:n,variant:o,title:i,onClick:f,disabled:0===d,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:o="circle",tooltip:i="Clear",...r}){const{isBulkActionsSupported:s,selectedNotifications:l,clearMany:c,notificationsCount:u}=ll(),d=useCallback(()=>{c(l);},[l,c]);return s?jsx(D,{icon:t,size:n,variant:o,title:i,onClick:d,disabled:0===u,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...o}){const{isBulkActionsSupported:i,notificationsCount:r}=ll(),{hideBulkActions:a}=$l();return i?jsx(T,{variant:n,text:t,onClick:a,disabled:0===r,...o}):null},HeaderSearch:function({className:n,placeholder:o="Search",iconPrepend:i="search",iconAppend:r="close",...s}){const l=N("io-panel-header-search",n),c=useRef(null),{notificationsCount:u}=ll(),{searchQuery:f,setSearch:m}=$l(),p=f.length>0,h=useCallback(()=>{m(""),c.current&&c.current.focus();},[m]);return jsxs("div",{className:l,children:[jsx(oi,{ref:c,value:f,iconPrepend:i,iconAppend:p?r:void 0,iconAppendOnClick:p?h:void 0,placeholder:o,onChange:e=>m(e.target.value),...s}),p&&jsx("p",{className:"io-panel-header-search-count",children:`${u} results`})]})},Body:ec,Footer:tc,FooterButtons:nc,FooterButtonClearAll:oc,FooterButtonClearAllOld:ic,Notification:Dc,NotificationsList:Mc},Ac=createContext(Pc),Tc=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Pc,...n}),[n]);return jsx(Ac.Provider,{value:o,children:t})});function Oc(e){return {...useContext(Ac),...e}}function Fc(){const e=useContext(IOConnectContext),{settings:t}=ll(),n=bi(),o=useCallback(async()=>{const o=e.windows.my();if(!e||!o||!n)return;const i=o.placementSettings;await o.place({...i,horizontalAlignment:t.placement?.panel});},[e,n,t.placement?.panel]);useEffect$1(()=>{e&&t.placement?.panel&&n&&o().catch(console.error);},[e,n,o,t.placement?.panel]);}function Lc({className:o,onClose:i,title:r="Notifications",...a}){const{Header:s,Body:l}=Oc(),{settings:u}=ll(),{isPanelVisible:d}=$l(),[m,p]=useState$1(!1),h=bi(),g=N("io-notifications-panel","left"===u.placement?.panel&&"io-panel-left","right"===u.placement?.panel&&"io-panel-right",o);return Fc(),useEffect$1(()=>{d||p(!1);},[d]),jsxs(Fragment,{children:[jsxs(Zo,{className:g,...a,children:[jsx(s,{title:r,onClose:i,onOpenSettings:()=>p(!0)}),jsx(l,{})]}),h&&d&&jsx(Hl,{isOpen:m,onClose:()=>p(!1)})]})}Tc.displayName="ComponentsStoreProvider";const Bc={Body:function({className:t,notifications:n,maxToasts:o=1,...i}){const r=N("io-toasts-body",t),{NotificationsList:a,Notification:s}=Hc(),[l,u]=useState$1([]);return useEffect$1(()=>{const e=o<0?n.length:o,t=n.filter(e=>"Active"===e.state).slice(0,e);for(const e of t)e.onShow();u(t);},[n,o]),jsx("div",{className:r,...i,children:jsx(a,{Notification:s,notifications:l,noNotificationText:""})})},Notification:Dc,NotificationsList:Mc},Rc=createContext(Bc),_c=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Bc,...n}),[n]);return jsx(Rc.Provider,{value:o,children:t})});function Hc(e){return {...useContext(Rc),...e}}function jc(){const e=useContext(IOConnectContext),{settings:t}=ll(),n=useCallback(async()=>{const n=e.windows.my();if(!e||!n)return;const o=n.placementSettings;await n.place({...o,horizontalAlignment:"top-right"===t.placement?.toasts||"bottom-right"===t.placement?.toasts?"right":"left"});},[e,t.placement?.toasts]);useEffect$1(()=>{e&&t.placement?.toasts&&n().catch(console.error);},[e,n,t.placement?.toasts]);}function $c({className:n,maxToasts:o=10,...i}){const{Header:r,Body:a,Footer:s}=Hc(),{notifications:l,settings:c}=ll(),u=N("io-toasts",("top-left"===c.placement?.toasts||"top-right"===c.placement?.toasts)&&"io-toasts-top",("top-right"===c.placement?.toasts||"bottom-right"===c.placement?.toasts)&&"io-toasts-right",("bottom-left"===c.placement?.toasts||"bottom-right"===c.placement?.toasts)&&"io-toasts-bottom",("top-left"===c.placement?.toasts||"bottom-left"===c.placement?.toasts)&&"io-toasts-left",n);return jc(),jsxs("div",{className:u,...i,children:[r&&jsx(r,{}),jsx(a,{notifications:l,maxToasts:o}),s&&jsx(s,{})]})}_c.displayName="ComponentsStoreProvider";Object.freeze({__proto__:null,Notification:Dc,NotificationBody:pc,NotificationBodyDescription:vc,NotificationBodyIcon:hc,NotificationBodyTitle:gc,NotificationFooter:yc,NotificationFooterButton:wc,NotificationHeader:ac,NotificationHeaderBadge:lc,NotificationHeaderButtonClose:mc,NotificationHeaderButtonSnooze:fc,NotificationHeaderCount:sc,NotificationHeaderIcon:cc,NotificationHeaderTimestamp:dc,NotificationHeaderTitle:uc,NotificationStack:xc,NotificationsList:Mc,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:o,isPanelVisible:i,sortNotificationsBy:r,setSortBy:a,viewNotificationsBy:s,setViewBy:d,isBulkActionsVisible:m,showBulkActions:p,hideBulkActions:h}=function(){const e=useContext(IOConnectContext),[t,n]=useState$1(!1),[o,i]=useState$1("newest"),[r,a]=useState$1("all"),[s,u]=useState$1(""),[d,m]=useState$1(!1),p=bi(),{isBulkActionsSupported:h}=ll();return useEffect$1(()=>{const e=el.onPanelVisibilityChanged(e=>n(e));return ()=>{e();}},[]),useEffect$1(()=>{null!==p&&p&&(async()=>{const t=await e.notifications.panel.isVisible();n(t);})();},[e.notifications.panel,p]),useEffect$1(()=>{t||(m(!1),a("all"));},[t]),{isPanelVisible:t,sortNotificationsBy:o,setSortBy:e=>{i(e);},viewNotificationsBy:r,setViewBy:e=>{a(e);},searchQuery:s,setSearch:e=>{u(e);},isBulkActionsVisible:d,showBulkActions:()=>{h&&m(!0);},hideBulkActions:()=>{h&&m(!1);}}}(),g=useMemo(()=>({searchQuery:n,setSearch:o,isPanelVisible:i,sortNotificationsBy:r,setSortBy:a,viewNotificationsBy:s,setViewBy:d,isBulkActionsVisible:m,showBulkActions:p,hideBulkActions:h}),[n,o,i,r,a,s,d,m,p,h]);return jsx(jl.Provider,{value:g,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:o,notificationsCount:i,configuration:r,settings:a,allApplications:s,allApps:l,allowedApplications:c,clearAll:d,clearAllOld:f,close:m,hidePanel:p,showPanel:h,saveSetting:g,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:b,selectNotification:C,selectAllNotifications:k,clearMany:N,snooze:S,snoozeMany:D,setState:x,setStates:E,setCount:I}=al(),M=useMemo(()=>({notifications:n,notificationStacks:o,notificationsCount:i,configuration:r,settings:a,allApplications:s,allApps:l,allowedApplications:c,clearAll:d,clearAllOld:f,onClose:m,hidePanel:p,showPanel:h,saveSetting:g,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:b,selectNotification:C,selectAllNotifications:k,clearMany:N,snooze:S,snoozeMany:D,setState:x,setStates:E,setCount:I}),[n,o,i,r,a,s,l,c,d,f,m,p,h,g,v,y,w,b,C,k,N,S,D,x,E,I]);return jsx(sl.Provider,{value:M,children:t})},Panel:function({components:t,settings:n,...o}){return jsx(Ll,{components:n,children:jsx(Tc,{components:t,children:jsx(Lc,{...o})})})},PanelBody:ec,PanelFooter:tc,PanelFooterButtonClearAll:oc,PanelFooterButtonClearAllOld:ic,PanelFooterButtons:nc,PanelHeader:zl,PanelHeaderCaptionTitle:Wl,SettingsAllowNotificationToasts:ul,SettingsAllowNotifications:cl,SettingsCloseNotificationOnClick:fl,SettingsGeneral:Zs,SettingsHideToastsAfter:gl,SettingsPanel:_l,SettingsPanelAutoHide:ml,SettingsPlacement:kl,SettingsPlacementPanel:Sl,SettingsPlacementToasts:Dl,SettingsShowNotificationBadge:dl,SettingsSnooze:xl,SettingsSnoozeDuration:El,SettingsStacking:vl,SettingsSubscribeAll:Ml,SettingsSubscribeApp:Pl,SettingsSubscribeMuteAll:Al,SettingsSubscribeMuteApp:Tl,SettingsSubscriptions:Il,SettingsToastStackBy:Cl,SettingsToastStacking:yl,Toasts:function({components:t,...n}){return jsx(_c,{components:t,children:jsx($c,{...n})})},useAddRemoveApps:tl,useHidePanelOnFocusLost:function(e=!0){const t=useContext(IOConnectContext),n=bi();return useEffect$1(()=>{if(!t||!e||null===n||!n)return;const o=t.windows.my()?.onFocusChanged(e=>{e.isFocused||t.notifications.panel.hide().catch(e=>{console.error("Error hiding panel:",e);});});return ()=>o?.()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=ll();vi(e,t);},useNotificationStacking:nl,useNotificationsContext:ll,useNotificationsPanelContext:$l,usePanelWindowPlacement:Fc,useSelectNotifications:ol,useShowHidePanelWindow:function(e=!0){const t=useContext(IOConnectContext),n=t?.windows.my(),o=bi(),{isPanelVisible:i}=$l();return useEffect$1(()=>{t&&n&&o&&(i?n.show().then(()=>{e&&n.focus().catch(e=>{console.error("Error focusing window:",e);});}).catch(e=>console.error("Error showing window:",e)):n.hide().catch(e=>console.error("Error hiding window:",e)));},[t,n,o,i,e]),{myWindow:n}},useToastsWindowPlacement:jc});const Wc=n=>{const{General:o,Layouts:i,Downloads:r,System:a}=Zu();return jsxs(Qo,{...n,children:[jsx(o,{}),jsx(i,{}),jsx(r,{}),jsx(a,{})]})},Vc=({title:n="General",...o})=>{const{Theme:i,PinnedPosition:r,MinimizeToTray:a,ShowTutorialOnStartup:s}=Zu();return jsxs(P,{title:n,...o,children:[jsx(i,{}),jsx(r,{}),jsx(a,{}),jsx(s,{})]})},Yc=(e="dark")=>{switch(e){case"dark":return "Dark";case"light":return "Light";default:return e}},Uc=({className:n,title:o="Theme",...i})=>{const{currentTheme:r,selectTheme:a}=Ci(),s=(()=>{const e=useContext(IOConnectContext),[t,n]=useState$1([]);return useEffect$1(()=>{e&&e.themes?.list().then(n).catch(console.warn);},[e]),t})();return jsxs("div",{className:N("flex jc-between ai-center",n),"data-testid":"theme-container",...i,children:[jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:o}),jsxs(X,{variant:"light","data-testid":"theme-dropdown",children:[jsx(X.Button,{text:Yc(r?.name),"data-testid":"theme-dropdown-button"}),jsx(X.Content,{"data-testid":"theme-dropdown-content",children:jsx(X.List,{children:s.map(({name:t})=>jsx(X.Item,{onClick:()=>a(t),"data-testid":`theme-dropdown-item-${t}`,children:Yc(t)},t))})})]})]})},Kc=({prefKey:n,options:o,disabled:i,...r})=>{const{isLoading:a,value:s="Select option",update:l}=xa({prefKey:n});return jsxs(X,{variant:"light",disabled:a||i,...r,children:[jsx(X.Button,{children:s}),jsx(X.Content,{children:jsx(X.List,{children:o.map(t=>jsx(X.Item,{onClick:()=>(async e=>{if(e!==s)try{await l(e);}catch(e){console.error("Failed to update platform preference:",e);}})(t),children:t},t))})})]})},Jc=({className:n,label:o="Pinned position",...i})=>jsx(P,{className:N("io-block-list-gap",n),...i,children:jsxs("div",{className:"flex jc-between ai-center",children:[jsx("label",{className:"io-text-clipper",children:o}),jsx(Kc,{className:n,prefKey:Ti,options:["Left","Right"],...i})]})}),qc=({prefKey:t,...n})=>{const{isLoading:o,value:i=!1,update:r}=xa({prefKey:t});return jsx(fi,{checked:i,disabled:o,onChange:e=>r(e.target.checked),...n})},Gc=({align:t="right",label:n="Allow docking",...o})=>jsx(qc,{align:t,label:n,prefKey:Oi,...o}),Qc=({align:t="right",label:n="Minimize to tray",...o})=>jsx(qc,{align:t,label:n,prefKey:Fi,...o}),Xc=({align:t="right",label:n="Auto-close on starting apps and workspaces",...o})=>jsx(qc,{align:t,label:n,prefKey:Li,disabled:!0,...o}),Zc=({align:t="right",label:n="Show tutorial on startup",...o})=>jsx(qc,{align:t,label:n,prefKey:Bi,...o}),eu=({title:n="Layouts",...o})=>{const{LayoutsSaveCurrentOnExit:i,LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:a}=Zu();return jsxs(P,{title:n,...o,children:[jsx(i,{}),jsx(a,{}),jsx(r,{})]})},tu=({align:t="right",label:n="Restore last saved on startup",...o})=>jsx(qc,{align:t,label:n,prefKey:Ri,...o}),nu=({align:t="right",label:n="Save current on exit",...o})=>jsx(qc,{align:t,label:n,prefKey:_i,...o}),ou=({align:t="right",label:n="Show prompt for unsaved changes",...o})=>jsx(qc,{align:t,label:n,prefKey:Hi,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...o}),iu=({align:t="right",label:n="Show prompt for deleting",...o})=>jsx(qc,{align:t,label:n,prefKey:ji,"data-testid":"layouts-show-delete-prompt-toggle",...o}),ru=({className:t,title:n="Downloads",...o})=>{const{DownloadsLocation:i}=Zu();return jsx(P,{className:N("io-block-list-gap",t),title:n,...o,children:jsx(i,{})})},au=({align:t="right",label:n="Ask where to save each file before downloading",...o})=>jsx(qc,{align:t,label:n,prefKey:$i,...o}),su=({className:n,label:o="Location",...i})=>{const{configuration:{downloadFolder:r},setDownloadLocationWithDialog:a,isDownloadLocationDialogVisible:s,downloadLocationList:l}=ts();return jsxs(P,{className:N("io-preferences-download-section",n),...i,children:[jsxs("div",{className:"flex jc-between ai-center",children:[jsx("label",{className:"io-text-clipper",children:o}),jsx(T,{text:"Change",onClick:a,disabled:s})]}),jsx("p",{children:r??l?.[0]??"Not set"})]})},lu=({className:n,title:o="System",...i})=>{const{SystemRestartSection:r,SystemShutdownSection:a}=Zu();return jsxs(P,{className:N("io-block-list-gap",n),title:o,...i,children:[jsx(r,{}),jsx(a,{})]})};var cu=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],uu={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return "undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},du={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return "th";switch(t%10){case 1:return "st";case 2:return "nd";case 3:return "rd";default:return "th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},fu=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},mu=function(e){return !0===e?1:0};function pu(e,t){var n;return function(){var o=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(o,i)},t);}}var hu=function(e){return e instanceof Array?e:[e]};function gu(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t);}function vu(e,t,n){var o=window.document.createElement(e);return t=t||"",n=n||"",o.className=t,void 0!==n&&(o.textContent=n),o}function yu(e){for(;e.firstChild;)e.removeChild(e.firstChild);}function wu(e,t){return t(e)?e:e.parentNode?wu(e.parentNode,t):void 0}function bu(e,t){var n=vu("div","numInputWrapper"),o=vu("input","numInput "+e),i=vu("span","arrowUp"),r=vu("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?o.type="number":(o.type="text",o.pattern="\\d*"),void 0!==t)for(var a in t)o.setAttribute(a,t[a]);return n.appendChild(o),n.appendChild(i),n.appendChild(r),n}function Cu(e){try{return "function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var ku=function(){},Nu=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},Su={D:ku,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t));},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t));},H:function(e,t){e.setHours(parseFloat(t));},J:function(e,t){e.setDate(parseFloat(t));},K:function(e,t,n){e.setHours(e.getHours()%12+12*mu(new RegExp(n.amPM[1],"i").test(t)));},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t));},S:function(e,t){e.setSeconds(parseFloat(t));},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var o=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(o-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t));},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t));},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t));},i:function(e,t){e.setMinutes(parseFloat(t));},j:function(e,t){e.setDate(parseFloat(t));},l:ku,m:function(e,t){e.setMonth(parseFloat(t)-1);},n:function(e,t){e.setMonth(parseFloat(t)-1);},s:function(e,t){e.setSeconds(parseFloat(t));},u:function(e,t){return new Date(parseFloat(t))},w:ku,y:function(e,t){e.setFullYear(2e3+parseFloat(t));}},Du={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},xu={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[xu.w(e,t,n)]},F:function(e,t,n){return Nu(xu.n(e,t,n)-1,!1,t)},G:function(e,t,n){return fu(xu.h(e,t,n))},H:function(e){return fu(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[mu(e.getHours()>11)]},M:function(e,t){return Nu(e.getMonth(),!0,t)},S:function(e){return fu(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return fu(e.getFullYear(),4)},d:function(e){return fu(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return fu(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return fu(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},Eu=function(e){var t=e.config,n=void 0===t?uu:t,o=e.l10n,i=void 0===o?du:o,r=e.isMobile,a=void 0!==r&&r;return function(e,t,o){var r=o||i;return void 0===n.formatDate||a?t.split("").map(function(t,o,i){return xu[t]&&"\\"!==i[o-1]?xu[t](e,r,n):"\\"!==t?t:""}).join(""):n.formatDate(e,t,r)}},Iu=function(e){var t=e.config,n=void 0===t?uu:t,o=e.l10n,i=void 0===o?du:o;return function(e,t,o,r){if(0===e||e){var a,s=r||i,l=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var c=t||(n||uu).dateFormat,u=String(e).trim();if("today"===u)a=new Date,o=!0;else if(n&&n.parseDate)a=n.parseDate(e,c);else if(/Z$/.test(u)||/GMT$/.test(u))a=new Date(e);else {for(var d=void 0,f=[],m=0,p=0,h="";m<c.length;m++){var g=c[m],v="\\"===g,y="\\"===c[m-1]||v;if(Du[g]&&!y){h+=Du[g];var w=new RegExp(h).exec(e);w&&(d=!0)&&f["Y"!==g?"push":"unshift"]({fn:Su[g],val:w[++p]});}else v||(h+=".");}a=n&&n.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),f.forEach(function(e){var t=e.fn,n=e.val;return a=t(a,n,s)||a}),a=d?a:void 0;}}if(a instanceof Date&&!isNaN(a.getTime()))return !0===o&&a.setHours(0,0,0,0),a;n.errorHandler(new Error("Invalid date provided: "+l));}}};function Mu(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var Pu=function(e,t,n){return 3600*e+60*t+n},Au=864e5;function Tu(e){var t=e.defaultHour,n=e.defaultMinute,o=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),r=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<r&&(n=r),t===i&&n===r&&o<a&&(o=e.minDate.getSeconds());}if(void 0!==e.maxDate){var s=e.maxDate.getHours(),l=e.maxDate.getMinutes();(t=Math.min(t,s))===s&&(n=Math.min(l,n)),t===s&&n===l&&(o=e.maxDate.getSeconds());}return {hours:t,minutes:n,seconds:o}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var o=function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]});},i=0,r=t;i<r.length;i++){o(r[i]);}return e});var Ou=function(){return Ou=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ou.apply(this,arguments)},Fu=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),i=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,i++)o[i]=r[a];return o};function Lu(e,t){var n={config:Ou(Ou({},uu),Ru.defaultConfig),l10n:du};function o(){var e;return (null===(e=n.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function i(e){return e.bind(n)}function r(){var e=n.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==n.calendarContainer&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),void 0!==n.daysContainer){var t=(n.days.offsetWidth+1)*e.showMonths;n.daysContainer.style.width=t+"px",n.calendarContainer.style.width=t+(void 0!==n.weekWrapper?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display");}});}function a(e){if(0===n.selectedDates.length){var t=void 0===n.config.minDate||Mu(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),o=Tu(n.config);t.setHours(o.hours,o.minutes,o.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t;}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,o=Cu(e),i=o;void 0!==n.amPM&&o===n.amPM&&(n.amPM.textContent=n.l10n.amPM[mu(n.amPM.textContent===n.l10n.amPM[0])]);var r=parseFloat(i.getAttribute("min")),a=parseFloat(i.getAttribute("max")),s=parseFloat(i.getAttribute("step")),l=parseInt(i.value,10),c=e.delta||(t?38===e.which?1:-1:0),u=l+s*c;if(void 0!==i.value&&2===i.value.length){var d=i===n.hourElement,f=i===n.minuteElement;u<r?(u=a+u+mu(!d)+(mu(d)&&mu(!n.amPM)),f&&h(void 0,-1,n.hourElement)):u>a&&(u=i===n.hourElement?u-a-mu(!n.amPM):r,f&&h(void 0,1,n.hourElement)),n.amPM&&d&&(1===s?u+l===23:Math.abs(u-l)>s)&&(n.amPM.textContent=n.l10n.amPM[mu(n.amPM.textContent===n.l10n.amPM[0])]),i.value=fu(u);}}(e);var i=n._input.value;s(),Z(),n._input.value!==i&&n._debouncedChange();}function s(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,o=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,r=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=o,t=n.amPM.textContent,o=e%12+12*mu(t===n.l10n.amPM[1]));var a=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===Mu(n.latestSelectedDateObj,n.config.minDate,!0),s=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===Mu(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var l=Pu(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),u=Pu(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=Pu(o,i,r);if(d>u&&d<l){var f=function(e){var t=Math.floor(e/3600),n=(e-3600*t)/60;return [t,n,e-3600*t-60*n]}(l);o=f[0],i=f[1],r=f[2];}}else {if(s){var m=void 0!==n.config.maxTime?n.config.maxTime:n.config.maxDate;(o=Math.min(o,m.getHours()))===m.getHours()&&(i=Math.min(i,m.getMinutes())),i===m.getMinutes()&&(r=Math.min(r,m.getSeconds()));}if(a){var p=void 0!==n.config.minTime?n.config.minTime:n.config.minDate;(o=Math.max(o,p.getHours()))===p.getHours()&&i<p.getMinutes()&&(i=p.getMinutes()),i===p.getMinutes()&&(r=Math.max(r,p.getSeconds()));}}c(o,i,r);}}function l(e){var t=e||n.latestSelectedDateObj;t&&t instanceof Date&&c(t.getHours(),t.getMinutes(),t.getSeconds());}function c(e,t,o){void 0!==n.latestSelectedDateObj&&n.latestSelectedDateObj.setHours(e%24,t,o||0,0),n.hourElement&&n.minuteElement&&!n.isMobile&&(n.hourElement.value=fu(n.config.time_24hr?e:(12+e)%12+12*mu(e%12==0)),n.minuteElement.value=fu(t),void 0!==n.amPM&&(n.amPM.textContent=n.l10n.amPM[mu(e>=12)]),void 0!==n.secondElement&&(n.secondElement.value=fu(o)));}function u(e){var t=Cu(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&P(n);}function d(e,t,o,i){return t instanceof Array?t.forEach(function(t){return d(e,t,o,i)}):e instanceof Array?e.forEach(function(e){return d(e,t,o,i)}):(e.addEventListener(t,o,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,o,i)}}))}function f(){J("onChange");}function m(e,t){var o=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),i=n.currentYear,r=n.currentMonth;try{void 0!==o&&(n.currentYear=o.getFullYear(),n.currentMonth=o.getMonth());}catch(e){e.message="Invalid date supplied: "+o,n.config.errorHandler(e);}t&&n.currentYear!==i&&(J("onYearChange"),k()),!t||n.currentYear===i&&n.currentMonth===r||J("onMonthChange"),n.redraw();}function p(e){var t=Cu(e);~t.className.indexOf("arrow")&&h(e,t.classList.contains("arrowUp")?1:-1);}function h(e,t,n){var o=e&&Cu(e),i=n||o&&o.parentNode&&o.parentNode.firstChild,r=q("increment");r.delta=t,i&&i.dispatchEvent(r);}function g(e,t,o,i){var r=A(t,!0),a=vu("span",e,t.getDate().toString());return a.dateObj=t,a.$i=i,a.setAttribute("aria-label",n.formatDate(t,n.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===Mu(t,n.now)&&(n.todayDateElem=a,a.classList.add("today"),a.setAttribute("aria-current","date")),r?(a.tabIndex=-1,G(t)&&(a.classList.add("selected"),n.selectedDateElem=a,"range"===n.config.mode&&(gu(a,"startRange",n.selectedDates[0]&&0===Mu(t,n.selectedDates[0],!0)),gu(a,"endRange",n.selectedDates[1]&&0===Mu(t,n.selectedDates[1],!0)),"nextMonthDay"===e&&a.classList.add("inRange")))):a.classList.add("flatpickr-disabled"),"range"===n.config.mode&&function(e){return !("range"!==n.config.mode||n.selectedDates.length<2)&&(Mu(e,n.selectedDates[0])>=0&&Mu(e,n.selectedDates[1])<=0)}(t)&&!G(t)&&a.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(t)+"</span>"),J("onDayCreate",a),a}function v(e){e.focus(),"range"===n.config.mode&&L(e);}function y(e){for(var t=e>0?0:n.config.showMonths-1,o=e>0?n.config.showMonths:-1,i=t;i!=o;i+=e)for(var r=n.daysContainer.children[i],a=e>0?0:r.children.length-1,s=e>0?r.children.length:-1,l=a;l!=s;l+=e){var c=r.children[l];if(-1===c.className.indexOf("hidden")&&A(c.dateObj))return c}}function w(e,t){var i=o(),r=T(i||document.body),a=void 0!==e?e:r?i:void 0!==n.selectedDateElem&&T(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&T(n.todayDateElem)?n.todayDateElem:y(t>0?1:-1);void 0===a?n._input.focus():r?function(e,t){for(var o=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,r=t>0?1:-1,a=o-n.currentMonth;a!=i;a+=r)for(var s=n.daysContainer.children[a],l=o-n.currentMonth===a?e.$i+t:t<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u<c&&u!=(t>0?c:-1);u+=r){var d=s.children[u];if(-1===d.className.indexOf("hidden")&&A(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return v(d)}n.changeMonth(r),w(y(r),0);}(a,t):v(a);}function b(e,t){for(var o=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),r=n.utils.getDaysInMonth(t,e),a=window.document.createDocumentFragment(),s=n.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-o,d=0;u<=i;u++,d++)a.appendChild(g("flatpickr-day "+l,new Date(e,t-1,u),0,d));for(u=1;u<=r;u++,d++)a.appendChild(g("flatpickr-day",new Date(e,t,u),0,d));for(var f=r+1;f<=42-o&&(1===n.config.showMonths||d%7!=0);f++,d++)a.appendChild(g("flatpickr-day "+c,new Date(e,t+1,f%r),0,d));var m=vu("div","dayContainer");return m.appendChild(a),m}function C(){if(void 0!==n.daysContainer){yu(n.daysContainer),n.weekNumbers&&yu(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<n.config.showMonths;t++){var o=new Date(n.currentYear,n.currentMonth,1);o.setMonth(n.currentMonth+t),e.appendChild(b(o.getFullYear(),o.getMonth()));}n.daysContainer.appendChild(e),n.days=n.daysContainer.firstChild,"range"===n.config.mode&&1===n.selectedDates.length&&L();}}function k(){if(!(n.config.showMonths>1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return !(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&e<n.config.minDate.getMonth())&&!(void 0!==n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()&&e>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var o=vu("option","flatpickr-monthDropdown-month");o.value=new Date(n.currentYear,t).getMonth().toString(),o.textContent=Nu(t,n.config.shorthandCurrentMonth,n.l10n),o.tabIndex=-1,n.currentMonth===t&&(o.selected=!0),n.monthsDropdownContainer.appendChild(o);}}}function N(){var e,t=vu("div","flatpickr-month"),o=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=vu("span","cur-month"):(n.monthsDropdownContainer=vu("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),d(n.monthsDropdownContainer,"change",function(e){var t=Cu(e),o=parseInt(t.value,10);n.changeMonth(o-n.currentMonth),J("onMonthChange");}),k(),e=n.monthsDropdownContainer);var i=bu("cur-year",{tabindex:"-1"}),r=i.getElementsByTagName("input")[0];r.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&r.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(r.setAttribute("max",n.config.maxDate.getFullYear().toString()),r.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var a=vu("div","flatpickr-current-month");return a.appendChild(e),a.appendChild(i),o.appendChild(a),t.appendChild(o),{container:t,yearElement:r,monthElement:e}}function S(){yu(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=N();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container);}n.monthNav.appendChild(n.nextMonthNav);}function D(){n.weekdayContainer?yu(n.weekdayContainer):n.weekdayContainer=vu("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=vu("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t);}return x(),n.weekdayContainer}function x(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=Fu(n.l10n.weekdays.shorthand);e>0&&e<t.length&&(t=Fu(t.splice(e,t.length),t.splice(0,e)));for(var o=n.config.showMonths;o--;)n.weekdayContainer.children[o].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n ";}}function E(e,t){void 0===t&&(t=!0);var o=t?e:e-n.currentMonth;o<0&&!0===n._hidePrevMonthArrow||o>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=o,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,J("onYearChange"),k()),C(),J("onMonthChange"),Q());}function I(e){return n.calendarContainer.contains(e)}function M(e){if(n.isOpen&&!n.config.inline){var t=Cu(e),o=I(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput)))&&!o&&!I(e.relatedTarget),r=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&r&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&a(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1));}}function P(e){if(!(!e||n.config.minDate&&e<n.config.minDate.getFullYear()||n.config.maxDate&&e>n.config.maxDate.getFullYear())){var t=e,o=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),o&&(n.redraw(),J("onYearChange"),k());}}function A(e,t){var o;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&Mu(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&Mu(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return !1;if(!n.config.enable&&0===n.config.disable.length)return !0;if(void 0===i)return !1;for(var r=!!n.config.enable,a=null!==(o=n.config.enable)&&void 0!==o?o:n.config.disable,s=0,l=void 0;s<a.length;s++){if("function"==typeof(l=a[s])&&l(i))return r;if(l instanceof Date&&void 0!==i&&l.getTime()===i.getTime())return r;if("string"==typeof l){var c=n.parseDate(l,void 0,!0);return c&&c.getTime()===i.getTime()?r:!r}if("object"==typeof l&&void 0!==i&&l.from&&l.to&&i.getTime()>=l.from.getTime()&&i.getTime()<=l.to.getTime())return r}return !r}function T(e){return void 0!==n.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e))}function O(e){var t=e.target===n._input,o=n._input.value.trimEnd()!==X();!t||!o||e.relatedTarget&&I(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat);}function F(t){var i=Cu(t),r=n.config.wrap?e.contains(i):i===n._input,l=n.config.allowInput,c=n.isOpen&&(!l||!r),u=n.config.inline&&r&&!l;if(13===t.keyCode&&r){if(l)return n.setDate(n._input.value,!0,i===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),i.blur();n.open();}else if(I(i)||c||u){var d=!!n.timeContainer&&n.timeContainer.contains(i);switch(t.keyCode){case 13:d?(t.preventDefault(),a(),z()):W(t);break;case 27:t.preventDefault(),z();break;case 8:case 46:r&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(d||r)n.hourElement&&n.hourElement.focus();else {t.preventDefault();var f=o();if(void 0!==n.daysContainer&&(!1===l||f&&T(f))){var m=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),E(m),w(y(1),0)):w(void 0,m);}}break;case 38:case 40:t.preventDefault();var p=40===t.keyCode?1:-1;n.daysContainer&&void 0!==i.$i||i===n.input||i===n.altInput?t.ctrlKey?(t.stopPropagation(),P(n.currentYear-p),w(y(1),0)):d||w(void 0,7*p):i===n.currentYearElement?P(n.currentYear-p):n.config.enableTime&&(!d&&n.hourElement&&n.hourElement.focus(),a(t),n._debouncedChange());break;case 9:if(d){var h=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),g=h.indexOf(i);if(-1!==g){var v=h[g+(t.shiftKey?-1:1)];t.preventDefault(),(v||n._input).focus();}}else !n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(i)&&t.shiftKey&&(t.preventDefault(),n._input.focus());}}if(void 0!==n.amPM&&i===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],s(),Z();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],s(),Z();}(r||I(i))&&J("onKeyDown",t);}function L(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var o=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),r=Math.min(o,n.selectedDates[0].getTime()),a=Math.max(o,n.selectedDates[0].getTime()),s=!1,l=0,c=0,u=r;u<a;u+=Au)A(new Date(u),!0)||(s=s||u>r&&u<a,u<i&&(!l||u>l)?l=u:u>i&&(!c||u<c)&&(c=u));Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+t)).forEach(function(t){var r,a,u,d=t.dateObj.getTime(),f=l>0&&d<l||c>0&&d>c;if(f)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e);});s&&!f||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e);}),void 0!==e&&(e.classList.add(o<=n.selectedDates[0].getTime()?"startRange":"endRange"),i<o&&d===i?t.classList.add("startRange"):i>o&&d===i&&t.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(a=i,u=o,(r=d)>Math.min(a,u)&&r<Math.max(a,u))&&t.classList.add("inRange")));});}}function B(){!n.isOpen||n.config.static||n.config.inline||j();}function R(e){return function(t){var o=n.config["_"+e+"Date"]=n.parseDate(t,n.config.dateFormat),i=n.config["_"+("min"===e?"max":"min")+"Date"];void 0!==o&&(n["min"===e?"minDateHasTime":"maxDateHasTime"]=o.getHours()>0||o.getMinutes()>0||o.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return A(e)}),n.selectedDates.length||"min"!==e||l(o),Z()),n.daysContainer&&($(),void 0!==o?n.currentYearElement[e]=o.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==o&&i.getFullYear()===o.getFullYear());}}function _(){return n.config.wrap?e.querySelector("[data-input]"):e}function H(){"object"!=typeof n.config.locale&&void 0===Ru.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=Ou(Ou({},Ru.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?Ru.l10ns[n.config.locale]:void 0),Du.D="("+n.l10n.weekdays.shorthand.join("|")+")",Du.l="("+n.l10n.weekdays.longhand.join("|")+")",Du.M="("+n.l10n.months.shorthand.join("|")+")",Du.F="("+n.l10n.months.longhand.join("|")+")",Du.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===Ou(Ou({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===Ru.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=Eu(n),n.parseDate=Iu({config:n.config,l10n:n.l10n});}function j(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){J("onPreCalendarPosition");var t=e||n._positionElement,o=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=n.calendarContainer.offsetWidth,r=n.config.position.split(" "),a=r[0],s=r.length>1?r[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===a||"below"!==a&&c<o&&l.top>o,d=window.pageYOffset+l.top+(u?-o-2:t.offsetHeight+2);if(gu(n.calendarContainer,"arrowTop",!u),gu(n.calendarContainer,"arrowBottom",u),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,p=!1;"center"===s?(f-=(i-l.width)/2,m=!0):"right"===s&&(f-=i-l.width,p=!0),gu(n.calendarContainer,"arrowLeft",!m&&!p),gu(n.calendarContainer,"arrowCenter",m),gu(n.calendarContainer,"arrowRight",p);var h=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+i>window.document.body.offsetWidth,v=h+i>window.document.body.offsetWidth;if(gu(n.calendarContainer,"rightMost",g),!n.config.static)if(n.calendarContainer.style.top=d+"px",g)if(v){var y=function(){for(var e=null,t=0;t<document.styleSheets.length;t++){var n=document.styleSheets[t];if(n.cssRules){try{n.cssRules;}catch(e){continue}e=n;break}}return null!=e?e:(o=document.createElement("style"),document.head.appendChild(o),o.sheet);var o;}();if(void 0===y)return;var w=window.document.body.offsetWidth,b=Math.max(0,w/2-i/2),C=y.cssRules.length,k="{left:"+l.left+"px;right:auto;}";gu(n.calendarContainer,"rightMost",!1),gu(n.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+k,C),n.calendarContainer.style.left=b+"px",n.calendarContainer.style.right="auto";}else n.calendarContainer.style.left="auto",n.calendarContainer.style.right=h+"px";else n.calendarContainer.style.left=f+"px",n.calendarContainer.style.right="auto";}}}else n.config.position(n,e);}function $(){n.config.noCalendar||n.isMobile||(k(),Q(),C());}function z(){n._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(n.close,0):n.close();}function W(e){e.preventDefault(),e.stopPropagation();var t=wu(Cu(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var o=t,i=n.latestSelectedDateObj=new Date(o.dateObj.getTime()),r=(i.getMonth()<n.currentMonth||i.getMonth()>n.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=o,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var a=G(i);a?n.selectedDates.splice(parseInt(a),1):n.selectedDates.push(i);}else "range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==Mu(i,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(s(),r){var l=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),l&&(J("onYearChange"),k()),J("onMonthChange");}if(Q(),C(),Z(),r||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():v(o),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var c="single"===n.config.mode&&!n.config.enableTime,u="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(c||u)&&z();}f();}}n.parseDate=Iu({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=d,n._setHoursFromDate=l,n._positionCalendar=j,n.changeMonth=E,n.changeYear=P,n.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);n.input.value="",void 0!==n.altInput&&(n.altInput.value="");void 0!==n.mobileInput&&(n.mobileInput.value="");n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth());if(!0===n.config.enableTime){var o=Tu(n.config);c(o.hours,o.minutes,o.seconds);}n.redraw(),e&&J("onChange");},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active"));J("onClose");},n.onMouseOver=L,n._createElement=vu,n.createDay=g,n.destroy=function(){void 0!==n.config&&J("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t);}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput);n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete n[e];}catch(e){}});},n.isEnabled=A,n.jumpToDate=m,n.updateValue=Z,n.open=function(e,t){void 0===t&&(t=n._positionElement);if(!0===n.isMobile){if(e){e.preventDefault();var o=Cu(e);o&&o.blur();}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void J("onOpen")}if(n._input.disabled||n.config.inline)return;var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),J("onOpen"),j(t));!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50));},n.redraw=$,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var o in Object.assign(n.config,e),e)void 0!==V[o]&&V[o].forEach(function(e){return e()});else n.config[e]=t,void 0!==V[e]?V[e].forEach(function(e){return e()}):cu.indexOf(e)>-1&&(n.config[e]=hu(t));n.redraw(),Z(!0);},n.setDate=function(e,t,o){void 0===t&&(t=!1);void 0===o&&(o=n.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);Y(e,o),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),m(void 0,t),l(),0===n.selectedDates.length&&n.clear(!1);Z(t),t&&J("onChange");},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e);};var V={locale:[H,x],showMonths:[S,r,D],minDate:[m],maxDate:[m],positionElement:[K],clickOpens:[function(){!0===n.config.clickOpens?(d(n._input,"focus",n.open),d(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open));}]};function Y(e,t){var o=[];if(e instanceof Array)o=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)o=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":o=[n.parseDate(e,t)];break;case"multiple":o=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":o=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)});}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?o:o.filter(function(e){return e instanceof Date&&A(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()});}function U(e){return e.slice().map(function(e){return "string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function K(){n._positionElement=n.config.positionElement||n._input;}function J(e,t){if(void 0!==n.config){var o=n.config[e];if(void 0!==o&&o.length>0)for(var i=0;o[i]&&i<o.length;i++)o[i](n.selectedDates,n.input.value,n,t);"onChange"===e&&(n.input.dispatchEvent(q("change")),n.input.dispatchEvent(q("input")));}}function q(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function G(e){for(var t=0;t<n.selectedDates.length;t++){var o=n.selectedDates[t];if(o instanceof Date&&0===Mu(o,e))return ""+t}return !1}function Q(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(e,t){var o=new Date(n.currentYear,n.currentMonth,1);o.setMonth(n.currentMonth+t),n.config.showMonths>1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=Nu(o.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=o.getMonth().toString(),e.value=o.getFullYear().toString();}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=void 0!==n.config.maxDate&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()));}function X(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,o){return "range"!==n.config.mode||n.config.enableTime||o.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function Z(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=X(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=X(n.config.altFormat)),!1!==e&&J("onValueUpdate");}function ee(e){var t=Cu(e),o=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);o||i?E(o?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1);}return function(){n.element=n.input=e,n.isOpen=!1,function(){var o=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],r=Ou(Ou({},JSON.parse(JSON.stringify(e.dataset||{}))),t),a={};n.config.parseDate=r.parseDate,n.config.formatDate=r.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=U(e);}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=U(e);}});var s="time"===r.mode;if(!r.dateFormat&&(r.enableTime||s)){var l=Ru.defaultConfig.dateFormat||uu.dateFormat;a.dateFormat=r.noCalendar||s?"H:i"+(r.enableSeconds?":S":""):l+" H:i"+(r.enableSeconds?":S":"");}if(r.altInput&&(r.enableTime||s)&&!r.altFormat){var c=Ru.defaultConfig.altFormat||uu.altFormat;a.altFormat=r.noCalendar||s?"h:i"+(r.enableSeconds?":S K":" K"):c+" h:i"+(r.enableSeconds?":S":"")+" K";}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:R("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:R("max")});var u=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S");}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:u("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:u("max")}),"time"===r.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0);Object.assign(n.config,a,r);for(var d=0;d<o.length;d++)n.config[o[d]]=!0===n.config[o[d]]||"true"===n.config[o[d]];cu.filter(function(e){return void 0!==n.config[e]}).forEach(function(e){n.config[e]=hu(n.config[e]||[]).map(i);}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&"single"===n.config.mode&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<n.config.plugins.length;d++){var f=n.config.plugins[d](n)||{};for(var m in f)cu.indexOf(m)>-1?n.config[m]=hu(f[m]).map(i).concat(n.config[m]):void 0===r[m]&&(n.config[m]=f[m]);}r.altInputClass||(n.config.altInputClass=_().className+" "+n.config.altInputClass);J("onParseConfig");}(),H(),function(){if(n.input=_(),!n.input)return void n.config.errorHandler(new Error("Invalid input element specified"));n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=vu(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling));n.config.allowInput||n._input.setAttribute("readonly","readonly");K();}(),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&Y(e,n.config.dateFormat);n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]);void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i"));void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i"));n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0);}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=vu("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=vu("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=vu("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=vu("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,S(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(gu(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e);}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(gu(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e);}}),n.currentYearElement=n.yearElements[0],Q(),n.monthNav)),n.innerContainer=vu("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=vu("div","flatpickr-weekwrapper");e.appendChild(vu("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=vu("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),o=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(o),n.weekNumbers=i,n.weekWrapper=o;}n.rContainer=vu("div","flatpickr-rContainer"),n.rContainer.appendChild(D()),n.daysContainer||(n.daysContainer=vu("div","flatpickr-days"),n.daysContainer.tabIndex=-1),C(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer);}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=Tu(n.config);n.timeContainer=vu("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=vu("span","flatpickr-time-separator",":"),o=bu("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=o.getElementsByTagName("input")[0];var i=bu("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(o),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr");if(n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var r=bu("flatpickr-second");n.secondElement=r.getElementsByTagName("input")[0],n.secondElement.value=fu(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(vu("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(r);}n.config.time_24hr||(n.amPM=vu("span","flatpickr-am-pm",n.l10n.amPM[mu((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM));return n.timeContainer}());gu(n.calendarContainer,"rangeMode","range"===n.config.mode),gu(n.calendarContainer,"animate",!0===n.config.animate),gu(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var r=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!r&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var a=vu("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(a,n.element),a.appendChild(n.element),n.altInput&&a.appendChild(n.altInput),a.appendChild(n.calendarContainer);}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer);}(),function(){n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return d(t,"click",n[e])});});if(n.isMobile)return void function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=vu("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr));n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d"));n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d"));n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step")));n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling);}catch(e){}d(n.mobileInput,"change",function(e){n.setDate(Cu(e).value,!1,n.mobileFormatStr),J("onChange"),J("onClose");});}();var e=pu(B,50);n._debouncedChange=pu(f,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&d(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&L(Cu(e));});d(n._input,"keydown",F),void 0!==n.calendarContainer&&d(n.calendarContainer,"keydown",F);n.config.inline||n.config.static||d(window,"resize",e);void 0!==window.ontouchstart?d(window.document,"touchstart",M):d(window.document,"mousedown",M);d(window.document,"focus",M,{capture:!0}),!0===n.config.clickOpens&&(d(n._input,"focus",n.open),d(n._input,"click",n.open));void 0!==n.daysContainer&&(d(n.monthNav,"click",ee),d(n.monthNav,["keyup","increment"],u),d(n.daysContainer,"click",W));if(void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){var t=function(e){return Cu(e).select()};d(n.timeContainer,["increment"],a),d(n.timeContainer,"blur",a,{capture:!0}),d(n.timeContainer,"click",p),d([n.hourElement,n.minuteElement],["focus","click"],t),void 0!==n.secondElement&&d(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&d(n.amPM,"click",function(e){a(e);});}n.config.allowInput&&d(n._input,"blur",O);}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&l(n.config.noCalendar?n.latestSelectedDateObj:void 0),Z(!1)),r();var o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&o&&j(),J("onReady");}(),n}function Bu(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),o=[],i=0;i<n.length;i++){var r=n[i];try{if(null!==r.getAttribute("data-fp-omit"))continue;void 0!==r._flatpickr&&(r._flatpickr.destroy(),r._flatpickr=void 0),r._flatpickr=Lu(r,t||{}),o.push(r._flatpickr);}catch(e){console.error(e);}}return 1===o.length?o[0]:o}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return Bu(this,e)},HTMLElement.prototype.flatpickr=function(e){return Bu([this],e)});var Ru=function(e,t){return "string"==typeof e?Bu(window.document.querySelectorAll(e),t):e instanceof Node?Bu([e],t):Bu(e,t)};Ru.defaultConfig={},Ru.l10ns={en:Ou({},du),default:Ou({},du)},Ru.localize=function(e){Ru.l10ns.default=Ou(Ou({},Ru.l10ns.default),e);},Ru.setDefaults=function(e){Ru.defaultConfig=Ou(Ou({},Ru.defaultConfig),e);},Ru.parseDate=Iu({}),Ru.formatDate=Eu({}),Ru.compareDates=Mu,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return Bu(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=Ru);const _u=["onCreate","onDestroy"],Hu=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],ju=t=>{const n=useMemo(()=>({...t}),[t]),{defaultValue:o,options:i={},value:r,children:s,render:l,onCreate:c,onDestroy:p}=n,h=useMemo(()=>((e,t)=>(Hu.forEach(n=>{const o=t[n],i=e[n];if(o){i&&!Array.isArray(i)?e[n]=[e[n]]:e[n]||(e[n]=[]);const t=Array.isArray(o)?o:[o];0===e[n].length?e[n]=t:e[n].push(...t);}}),Hu.forEach(e=>{delete t[e];}),_u.forEach(e=>{delete t[e];}),e))(i,n),[i,n]),g=useRef(null),v=useRef(void 0);useImperativeHandle(t.ref,()=>({get flatpickr(){return v.current}}),[]),useEffect$1(()=>{return h.onClose=h.onClose||(()=>{var e;null!=(e=g.current)&&e.blur&&g.current.blur();}),v.current=((null==(e=Ru)?void 0:e.default)||Ru)(g.current,h),null==c||c(v.current),()=>{null==p||p(v.current),v.current&&v.current.destroy(),v.current=void 0;};var e;},[h,c,p]),useEffect$1(()=>{var e;if(v.current){const t=Object.getOwnPropertyNames(h);for(let n=t.length-1;n>=0;n--){const o=t[n];let i=h[o];(null==i?void 0:i.toString())!==(null==(e=v.current.config[o])?void 0:e.toString())&&(Hu.includes(o)&&!Array.isArray(i)&&(i=[i]),v.current.set(o,i));}void 0!==r&&r!==v.current.input.value&&v.current.setDate(r,!1);}},[h,r]);const y=useCallback(e=>{g.current=e;},[]);if(l)return l({...n,defaultValue:o,value:r},y);const w=useCallback(e=>{var n,o;t&&t.onChange&&(Array.isArray(null==t?void 0:t.onChange)?null==(n=null==t?void 0:t.onChange)||n.forEach(()=>[new Date(e.target.value)],(null==r?void 0:r.toString())||""):"function"==typeof t.onChange&&(null==(o=null==t?void 0:t.onChange)||o.call(t,[new Date(e.target.value)],(null==r?void 0:r.toString())||"",v.current)));},[t,r]);return i.wrap?jsx("div",{className:"flatpickr",ref:y,children:s}):jsx("input",{onChange:w,...n,value:null==r?void 0:r.toString(),defaultValue:o,ref:y})},$u="T42.GD.Execute",zu=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Wu=(e,t)=>e in t;function Vu({time:e,frequency:t,day:n}){const o=new Date(`01/01/2000 ${e}`),i=o.getMinutes(),r=o.getHours();let a="*";return "weekly"===t&&n&&(a=function(e){const t={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Wu(e,t))throw new Error(`Invalid day: ${e}`);return t[e]}(n).toString()),`${i} ${r} * * ${a}`}function Yu(e){const t=useContext(IOConnectContext),{value:n,update:o}=xa({prefKey:Uu(e)}),{value:i,update:r}=xa({prefKey:Uu(e,"Time")}),{value:s,update:c}=xa({prefKey:Uu(e,"Frequency")}),{value:u,update:d}=xa({prefKey:Uu(e,"Day")}),m=useCallback(async()=>{try{await t.interop.invoke($u,{command:`cancel-${e}`});}catch(e){console.error(e);}},[t,e]),p=useCallback(async()=>{try{const n=Vu({time:i??"12:00 AM",frequency:s??"daily",day:"weekly"===s?u:"*"});await t.interop.invoke($u,{command:`schedule-${e}`,args:{cronTime:n,discardUnsavedLayoutChanges:!1}});}catch(t){console.error(`Failed to update cron job for ${e}:`,t);}},[t,e,i,s,u]);useEffect$1(()=>{t&&n&&p();},[t,n,p]);return {enabled:n??!1,time:i??"12:00 AM",frequency:s??"daily",day:u??"Monday",setEnabled:async e=>{e||await m();try{await o(e);}catch(e){console.error("Failed to update enabled state:",e);}},setTime:async e=>{try{await r(e);}catch(e){console.error("Failed to update time:",e);}},setFrequency:async e=>{try{await c(e),"daily"===e&&await d(void 0);}catch(e){console.error("Failed to update frequency:",e);}},setDay:async e=>{var t;if(t=e,zu.includes(t))try{await d(e);}catch(e){console.error("Failed to update day:",e);}else console.error("Invalid day provided");}}}function Uu(e,t){const n="restart"===e?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function Ku({className:n,variant:o,...i}){const r=N("io-block-list-gap",o,n),{enabled:a,time:s,frequency:l,day:c,setEnabled:u,setTime:d,setFrequency:f,setDay:m}=Yu(o);return jsxs(P,{className:r,...i,children:[jsx(fi,{label:`Schedule ${o}`,align:"right",onChange:e=>u(e.target.checked),checked:a}),jsxs("div",{className:"scheduler-controls",children:[jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[jsx(S,{variant:"clock"}),jsx(ju,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:s,clickOpens:!0},value:s,onClose:async([e])=>{const t=e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await d(t);}})]}),jsxs(Ko,{text:l.charAt(0).toUpperCase()+l.slice(1),icon:"chevron-down",iconRight:!0,children:[jsx(Ko.Item,{onClick:()=>f("daily"),children:"Daily"}),jsx(Ko.Item,{onClick:()=>f("weekly"),children:"Weekly"})]}),"weekly"===l&&jsx(Ko,{text:c,icon:"chevron-down",iconRight:!0,children:zu.map(t=>jsx(Ko.Item,{onClick:()=>m(t),children:t},t))})]})]})}function Ju({className:t,...n}){return jsx(Ku,{...n,className:t,variant:"restart"})}function qu({className:t,...n}){return jsx(Ku,{...n,className:t,variant:"shutdown"})}const Gu={Body:Wc,General:Vc,Theme:Uc,PinnedPosition:Jc,AllowDocking:Gc,MinimizeToTray:Qc,AutoClose:Xc,ShowTutorialOnStartup:Zc,Layouts:eu,LayoutsRestoreLastSaved:tu,LayoutsSaveCurrentOnExit:nu,LayoutsShowUnsavedChangesPrompt:ou,LayoutsShowDeletePrompt:iu,Downloads:ru,DownloadsAskForEachDownload:au,DownloadsLocation:su,System:lu,SystemRestartSection:Ju,SystemShutdownSection:qu},Qu=createContext(Gu),Xu=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Gu,...n}),[n]);return jsx(Qu.Provider,{value:o,children:t})});Xu.displayName="PreferencesPanelComponentsStoreProvider";const Zu=()=>useContext(Qu),ed=({className:n,onClose:o,title:i="Platform Preferences",children:r,...a})=>jsxs(Zo,{className:N("io-preferences-panel",n),"data-testid":"preferences-panel",...a,children:[jsxs(Zo.Header,{"data-testid":"preferences-panel-header",children:[jsx(Zo.Header.Title,{size:"large",text:i,tag:"h1","data-testid":"preferences-panel-title"}),jsx(Zo.Header.ButtonGroup,{children:jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o,"data-testid":"preferences-panel-close-button"})})]}),r]}),td=({onClose:t,title:n="Platform Preferences",...o})=>{const{Body:i}=Zu();return jsx(ed,{title:n,onClose:t,...o,children:jsx(i,{})})},nd=({components:t,...n})=>jsx(Xu,{components:t,children:jsx(td,{...n})});Object.freeze({__proto__:null,AllowDocking:Gc,AutoClose:Xc,Downloads:ru,DownloadsAskForEachDownload:au,DownloadsLocation:su,General:Vc,Layouts:eu,LayoutsRestoreLastSaved:tu,LayoutsSaveCurrentOnExit:nu,LayoutsShowDeletePrompt:iu,LayoutsShowUnsavedChangesPrompt:ou,MinimizeToTray:Qc,Panel:nd,PanelBody:Wc,PinnedPosition:Jc,ShowTutorialOnStartup:Zc,System:lu,SystemRestartSection:Ju,SystemShutdownSection:qu,Theme:Uc});const id=n=>{const{General:o,Layouts:i}=ud();return jsxs(Qo,{...n,children:[jsx(o,{}),jsx(i,{})]})},rd=({title:t="General",...n})=>{const{Theme:o}=ud();return jsx(P,{title:t,"data-testid":"preferences-panel-general-block",...n,children:jsx(o,{})})},ad=({title:t="Layouts",...n})=>{const{LayoutsShowDeletePrompt:o}=ud();return jsx(P,{title:t,"data-testid":"preferences-panel-layouts-block",...n,children:jsx(o,{})})},sd={Body:id,General:rd,Theme:Uc,Layouts:ad,LayoutsShowUnsavedChangesPrompt:ou,LayoutsShowDeletePrompt:iu},ld=createContext(sd),cd=memo(({children:t,components:n})=>{const o=useMemo(()=>({...sd,...n}),[n]);return jsx(ld.Provider,{value:o,children:t})});cd.displayName="PreferencesPanelComponentsStoreProvider";const ud=()=>useContext(ld),dd=({onClose:t,title:n="Platform Preferences",...o})=>{const{Body:i}=ud();return jsx(ed,{title:n,onClose:t,...o,children:jsx(i,{})})};Object.freeze({__proto__:null,General:rd,Layouts:ad,LayoutsShowDeletePrompt:iu,LayoutsShowUnsavedChangesPrompt:ou,Panel:({components:t,...n})=>jsx(cd,{components:t,children:jsx(dd,{...n})}),PanelBody:id,Theme:Uc});const md=({actionButtons:t,actionButtonElementsRefs:n,isAutofocusButton:o,isButtonDisabled:i,onButtonClick:r})=>jsx(Z,{"data-testid":"io-dialog-action-buttons-group",align:"right",children:t.map((t,a)=>{const{id:s,text:l,variant:c}=t,u=o(s);return jsx(T,{"data-testid":`io-dialog-action-button-${s}`,id:s,ref:e=>{0===a&&(n.current=[]),n.current[a]=e;},className:u?"io-focus-button":void 0,disabled:i(s),onClick:()=>r(t),variant:c,children:l},s)})}),pd=({actionButtons:n,children:o,onCompletion:i,size:r,title:a=(wi()?"io.Connect Desktop":"io.Connect Browser"),validationErrors:s=[]})=>{const{actionButtonElementsRefs:l,autofocusButtonId:f,hasAutofocusButtonLostInitialFocus:m}=(e=>{const t=useRef([]),n=useMemo(()=>e.find(e=>e.autofocus)?.id??null,[e]),o=useRef(n),[i,r]=useState$1(!o.current);return useLayoutEffect$1(()=>{if(i)return;if(n!==o.current)return void r(!0);const e=t.current.find(e=>e?.id===n);if(!e)return;e.focus();const a=()=>{r(!0);};return e.addEventListener("blur",a),()=>{e.removeEventListener("blur",a);}},[n,i]),{actionButtonElementsRefs:t,autofocusButtonId:n,hasAutofocusButtonLostInitialFocus:i}})(n),h=()=>{i({isClosed:!0});},g={...r};return jsxs(re,{className:"io-dialog-template",closeFn:h,isOpen:!0,onCancel:e=>{e.preventDefault(),h();},onKeyDown:e=>{!A(e)||s.length||e.target instanceof HTMLButtonElement||" "===e.key&&e.target instanceof HTMLInputElement||i({isEnterPressed:!0});},style:g,title:a,children:[jsx(re.Body,{children:o}),jsx(re.Footer,{children:jsx(md,{actionButtonElementsRefs:l,actionButtons:n,isAutofocusButton:e=>f===e&&!m,isButtonDisabled:e=>s.some(t=>t.disabledButtonIds.some(t=>t===e)),onButtonClick:({id:e,text:t})=>{i({responseButtonClicked:{id:e,text:t}});}})})]})},hd=({children:t})=>jsx("h3",{"data-testid":"io-dialog-heading",className:"io-dialog-template-heading",children:t});Object.freeze({__proto__:null,NoInputsConfirmationDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,heading:a,text:s,title:l}=i;return jsx(pd,{actionButtons:r,onCompletion:n,size:o,title:l,children:jsxs("div",{children:[jsx(hd,{children:a}),jsx("p",{"data-testid":"io-dialog-text",children:s})]})})},SingleCheckboxDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,checkbox:s,heading:l,text:u,title:d}=i,[f,m]=useState$1(s.initialValue),p=useCallback(()=>m(e=>!e),[]),h=[{id:s.id,type:"checkbox",checked:f}];return jsxs(pd,{actionButtons:r,onCompletion:e=>n({...e,inputs:h}),size:o,title:d,children:[jsxs("div",{children:[jsx(hd,{children:l}),jsx("p",{"data-testid":"io-dialog-text",children:u})]}),jsx(ri,{"data-testid":`io-dialog-checkbox-${s.id}`,checked:f,id:s.id,label:s.label,name:s.id,onChange:p})]})},SingleTextInputDialog:({onCompletion:n,size:o,variables:i})=>{const{actionButtons:r,heading:a,input:s,title:l}=i,[u,f]=useState$1(s.initialValue??""),m=useRef(null),h=(g=u,!(v=s.validation)||new RegExp(v.regexPattern).test(g)?null:{disabledButtonIds:v.disabledButtonIds,message:v.errorMessage});var g,v;const y=[{id:s.id,type:"text",value:u}];return useLayoutEffect$1(()=>{m.current?.select();},[]),jsxs(pd,{actionButtons:r,onCompletion:e=>n({...e,inputs:y}),size:o,title:l,validationErrors:h?[h]:[],children:[jsx(hd,{children:a}),jsx(oi,{"data-testid":`io-dialog-input-${s.id}`,ref:m,errorDataTestId:`io-dialog-input-${s.id}-error-message`,errorMessage:h?.message,id:s.id,label:s.label,name:s.id,onChange:e=>f(e.target.value),placeholder:s.placeholder,type:"text",value:u})]})}});const vd=({name:n,value:o})=>jsxs("div",{className:"io-profile-section-item",children:[jsx("div",{className:"io-profile-section-item-name",children:n}),jsx("div",{className:"io-profile-section-item-value",children:o})]}),yd=({className:n,items:o,title:i})=>jsxs("div",{className:N("io-profile-section-body",n),children:[i&&jsx(M,{className:"io-profile-section-title",text:i}),o.map(({name:t,value:n})=>jsx(vd,{name:t,value:n},t))]}),wd=({className:n,items:o,title:i})=>jsxs("section",{className:N("io-profile-section",n),children:[jsx(yd,{items:o,title:i}),jsx(q,{className:"mt-8"})]}),bd=({title:t="License",...n})=>jsx(wd,{title:t,...n}),Cd=({title:t="Version",...n})=>jsx(wd,{title:t,...n}),kd=({title:t="Plugins",...n})=>jsx(wd,{title:t,...n}),Nd=({className:n})=>{const o=wi()?"io.Connect Desktop":"io.Connect Browser";return jsxs("div",{className:N("io-trademark-container",n),children:[jsx("h4",{className:"io-trademark-title",children:o}),jsxs("p",{className:"io-trademark-text",children:[o,"® is a registered trademark of"," ",jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",(new Date).getFullYear(),". All rights reserved."]})]})},Sd=({avatarInitials:n=(wi()?"CD":"CB"),className:o,items:i,onLogout:r,title:a})=>jsxs("section",{className:N("io-profile-section",o),children:[jsxs("div",{className:"io-user-details-container",children:[jsx("div",{className:"io-user-avatar",children:n}),jsx(yd,{className:"mt-12",items:i,title:a})]}),r&&jsx(T,{className:"io-log-out-button",onClick:r,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),jsx(q,{className:"mt-8"})]}),Dd={LicenseSection:bd,ProductsInfoSection:Cd,PluginsSection:kd,Trademark:Nd,UserSection:Sd},xd=createContext(Dd),Ed=memo(({children:t,components:n})=>{const o=useMemo(()=>({...Dd,...n}),[n]);return jsx(xd.Provider,{value:o,children:t})});Ed.displayName="ProfilePanelComponentsStoreProvider";const Id=e=>{const t=new Date(e);return [{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>t.toLocaleDateString("en",e)).join(" ")},Md=e=>{if(!e)return {items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(e=>!!e);return {avatarInitials:n.map(e=>e.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},Pd=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return {items:[{name:"Type",value:e.type},{name:"Expiration Date",value:Id(e.expiration*n)}]}},Ad=e=>({items:e.map(e=>({name:e.name,value:e.version}))}),Td=e=>{const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return {items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...e.workspaces?.container&&Wu(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},Od=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},Fd=e=>{const t=Object.entries(e??{}).map(([e,t])=>({name:e,value:t}));return {items:t}},Ld=e=>{const t=e.map(({product:e,version:t})=>({name:e,value:t}));return {items:t}},Bd=e=>wi()?(async e=>{const{licInfo:t,productInfo:n}=(await e.interop.invoke("T42.GD.GetInfo")).returned;return {user:Od(),license:Fd(t),productsInfo:Ld(n)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const e=await window.iobrowser.system.getProfileData();return {user:Md(e.user),license:Pd(e.license),plugins:Ad(e.plugins),productsInfo:Td(e.productsInfo)}})(),Rd=({className:n,onClose:o,onLogout:i,title:r="Profile",...a})=>{const{LicenseSection:s,ProductsInfoSection:u,PluginsSection:d,Trademark:m,UserSection:p}=useContext(xd),h=useContext(IOConnectContext),[g,v]=useState$1(null);return useEffect$1(()=>{if(!h)return;(async()=>{const e=await Bd(h);v(e);})().catch(console.error);},[h]),jsxs(Zo,{className:N("io-profile-panel",n),"data-testid":"profile-panel",...a,children:[jsxs(Zo.Header,{children:[jsx(Zo.Header.Title,{size:"large",text:r}),jsx(Zo.Header.ButtonGroup,{children:jsx(Zo.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:o})})]}),jsxs(Zo.Body,{children:[g?.user.items.length||g?.user.title?jsx(p,{avatarInitials:g.user.avatarInitials,items:g.user.items,onLogout:i,title:g.user.title}):null,jsxs("div",{className:"io-scrollable-profile-sections-container",children:[g?.license.items.length?jsx(s,{items:g.license.items}):null,g?.productsInfo.items.length?jsx(u,{items:g.productsInfo.items}):null,g?.plugins?.items.length?jsx(d,{items:g.plugins.items}):null]}),jsx(m,{className:"mt-auto"})]})]})},_d=({components:t,...n})=>jsx(Ed,{components:t,children:jsx(Rd,{...n})});Object.freeze({__proto__:null,LicenseSection:bd,Panel:_d,PluginsSection:kd,ProductsInfoSection:Cd,Trademark:Nd,UserSection:Sd});const jd=createContext(void 0),$d=()=>{const e=useContext(jd);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},zd=document.querySelector("#root")??document.body,Wd={preferences:nd,"notification-settings":_l,profile:_d};Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:t,deselectPanel:n}=$d();Q(()=>{t&&n();},["Escape"]);const o=t?Wd[t]:null;return o?createPortal(jsx("div",{className:"io-panel-overlay",children:jsx(o,{onClose:n})}),zd):null},PanelManagerProvider:({children:t})=>{const[n,o]=useState$1(null),i=useCallback(e=>{o(e);},[]),r=useCallback(()=>{o(null);},[]),s=useMemo(()=>({panel:n,selectPanel:i,deselectPanel:r}),[n,i,r]);return jsx(jd.Provider,{value:s,children:t})},usePanelManagerContext:$d});
3348
+
3349
+ function useExternalWindowPopup() {
3350
+ var _this = this;
3351
+ var _a = ki(), getContainer = _a.getContainer, closePopup = _a.closePopup, createPopup = _a.createPopup, hidePopup = _a.hidePopup, showPopup = _a.showPopup, isOpen = _a.isOpen, isVisible = _a.isVisible, popup = _a.popup;
3352
+ var resizePopup = useCallback(function (size) { return __awaiter(_this, void 0, void 0, function () {
3353
+ return __generator(this, function (_a) {
3354
+ switch (_a.label) {
3355
+ case 0: return [4 /*yield*/, (popup === null || popup === void 0 ? void 0 : popup.ioConnectWindow.moveResize(__assign({}, size)))];
3356
+ case 1:
3357
+ _a.sent();
3358
+ return [2 /*return*/];
3359
+ }
3360
+ });
3361
+ }); }, [popup]);
3362
+ return {
3363
+ getContainer: getContainer,
3364
+ closePopup: closePopup,
3365
+ createPopup: createPopup,
3366
+ hidePopup: hidePopup,
3367
+ showPopup: showPopup,
3368
+ isOpen: isOpen,
3369
+ isVisible: isVisible,
3370
+ resizePopup: resizePopup,
3371
+ popup: popup
3372
+ };
3373
+ }
3374
+
3541
3375
  var getGroupId = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.getGroupId(); };
3542
3376
  var requestPageFocus = function () { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestPageFocus(); };
3543
3377
  var requestFrameFocus = function (frameId) { return webGroupsManager === null || webGroupsManager === void 0 ? void 0 : webGroupsManager.requestFrameFocus(frameId); };
@@ -3550,5 +3384,5 @@ var onCommitGroupCaptionEditingRequested = function (targetId, cb) { return webG
3550
3384
  var onCommitFlatCaptionEditingRequested = function (targetId, cb) { return webGroupsManager.onCommitCaptionEditingRequested(TargetType.Frame, targetId, cb); };
3551
3385
  var onCommitTabCaptionEditingRequested = function (targetId, cb) { return webGroupsManager.onCommitCaptionEditingRequested(TargetType.Tab, targetId, cb); };
3552
3386
 
3553
- export { CloneButton, CloseButton, CustomButton, ExtractButton, FeedbackButton, FlatButtons, FlatCaption, FlatCaptionBar, FlatCaptionEditor, FlatChannelSelector, FlatMoveArea, FlatMultiChannelSelector, FrameLoadingAnimation, GroupButtons, GroupCaption, GroupCaptionBar, GroupCaptionEditor, GroupMoveArea, HtmlButtons, LockButton, MaximizeButton, MinimizeButton, OverflowButton, RestoreButton, StickyButton, Tab, TabCaption, TabCaptionEditor, TabChannelSelector, TabCloseButton, TabHeaderButtons, TabMultiChannelSelector, TabOverflowPopup, UnlockButton, GroupElementCreationWrapper as default, getGroupId, onCommitFlatCaptionEditingRequested, onCommitGroupCaptionEditingRequested, onCommitTabCaptionEditingRequested, openTabOverflowPopup, requestFrameFocus, requestGroupFocus, requestPageFocus, useCaptionEditor, useCommitFlatCaptionEditingRequested, useCommitGroupCaptionEditingRequested, useCommitTabCaptionEditingRequested, useDragMove, useEditableCaption, useGroupComponentVisibility, useIOConnectWindow, waitForWindow };
3387
+ export { CloneButton, CloseButton, CustomButton, ExtractButton, FeedbackButton, FlatButtons, FlatCaption, FlatCaptionBar, FlatCaptionEditor, FlatChannelSelector, FlatMoveArea, FlatMultiChannelSelector, FrameLoadingAnimation, GroupButtons, GroupCaption, GroupCaptionBar, GroupCaptionEditor, GroupMoveArea, HtmlButtons, LockButton, MaximizeButton, MinimizeButton, OverflowButton, RestoreButton, StickyButton, Tab, TabCaption, TabCaptionEditor, TabChannelSelector, TabCloseButton, TabHeaderButtons, TabMultiChannelSelector, TabOverflowPopup, UnlockButton, GroupElementCreationWrapper as default, getGroupId, onCommitFlatCaptionEditingRequested, onCommitGroupCaptionEditingRequested, onCommitTabCaptionEditingRequested, openTabOverflowPopup, requestFrameFocus, requestGroupFocus, requestPageFocus, useCaptionEditor, useCommitFlatCaptionEditingRequested, useCommitGroupCaptionEditingRequested, useCommitTabCaptionEditingRequested, useDragMove, useEditableCaption, useExternalWindowPopup, useGroupComponentVisibility, useIOConnectWindow, waitForWindow };
3554
3388
  //# sourceMappingURL=index.js.map