@knime/scripting-editor 0.0.127 → 0.0.129

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.
Files changed (140) hide show
  1. package/dist/{AnyOfTwinlist-C0gjxeQW-C5wsbDLK.js → AnyOfTwinlist-Chx0nmt3-DPMbiVZd.js} +5 -4
  2. package/dist/{ArrayLayout-U4hs5LA_.js → ArrayLayout-C2-4wxkT.js} +39 -39
  3. package/dist/{ButtonControl-B8WGWs_m.js → ButtonControl-Dga3IomB.js} +26 -26
  4. package/dist/CheckboxControl-B8b1Di4k-CEkOsWEu.js +40 -0
  5. package/dist/CheckboxesControl-DWUnPGdN-BOSX_stf.js +42 -0
  6. package/dist/CodeEditorControl-CN4ltMvy.js +133 -0
  7. package/dist/{ColorControl-DeSwgyjS-BW1FBjqa.js → ColorControl-ByE5ku7u-C12pZ0rg.js} +10 -8
  8. package/dist/ColorPreviewControl-XiKZ4jfn-CLIjX6M_.js +89 -0
  9. package/dist/ComboBoxControl-zSceYlyZ-BgpAi7q9.js +42 -0
  10. package/dist/{ConfigurationNodeNotSupported-Bg2W0ik5.js → ConfigurationNodeNotSupported-B27grebd.js} +3 -3
  11. package/dist/ControlWithSubParameters-ROJGaqDF.js +63 -0
  12. package/dist/CredentialsControl-B6jczlBv.js +33 -0
  13. package/dist/CredentialsControlBase-CdNdAngd.js +96 -0
  14. package/dist/DateControl-BBGpEVpr-yZP_TZnE.js +44 -0
  15. package/dist/DateTimeControl-CymOURq5-Ca0mT1HW.js +89 -0
  16. package/dist/DateTimeFormatPickerControl-Bx19jwpr-Bd0xBs4D.js +37 -0
  17. package/dist/DateTimeFormatPickerWithTypeControl-Byo_0cTq-C0ZfMqtp.js +598 -0
  18. package/dist/{DialogFileExplorer-Bi0DVFut.js → DialogFileExplorer-BmT2YlVn.js} +2 -2
  19. package/dist/{DirtyTrackerRenderer-CDcL-lwX.js → DirtyTrackerRenderer-BG451zZD.js} +10 -10
  20. package/dist/DropdownControl-C6ffVYyf-hy0i8nDV.js +32 -0
  21. package/dist/DynamicInputControl-W23Zexge.js +6 -0
  22. package/dist/ExecutorCoresControl-D9FZ-g9O-Dws9IhAs.js +51 -0
  23. package/dist/ExecutorMemoryControl-__P80Lkb-DxQZ2IuA.js +44 -0
  24. package/dist/{FileChooserControl-BR84kEXy.js → FileChooserControl-BBbay7zU.js} +4 -3
  25. package/dist/{FileChooserControlBase-1oayQJzv.js → FileChooserControlBase-DpYYK3eE.js} +147 -143
  26. package/dist/{FileChooserControlForMultiFile-ChQtkmps.js → FileChooserControlForMultiFile-6NLYZKbt.js} +5 -4
  27. package/dist/FileUploadControl-DWs4PhOj-BvByW-Tq.js +545 -0
  28. package/dist/GridSelectionControl-WcJ4y6Fs-BoxSk0VG.js +117 -0
  29. package/dist/{HorizontalLayout-DwdPdBTW-w5bjgNga.js → HorizontalLayout-ByB5A7X3-BURAMMFG.js} +5 -5
  30. package/dist/{IntegerControl-D8OzxbRA-D9mR5ahj.js → IntegerControl-aveswmbr-50_b6vGY.js} +5 -4
  31. package/dist/IntervalControl-B4Eqs1Jf-CiB2D52B.js +51 -0
  32. package/dist/{LabeledGroup-BzXUTco4.js → LabeledGroup-BONZ_GLo.js} +3 -3
  33. package/dist/LegacyCredentialsControl-DaIrvNBd.js +88 -0
  34. package/dist/{LinkControl-BvBBTFCs-DojlONSA.js → LinkControl-DD56lOiw-CDy6OBu8.js} +10 -10
  35. package/dist/{LoadingDropdown.vue_vue_type_script_setup_true_lang-BLSG6Lpo-CtYj2B6v.js → LoadingDropdown.vue_vue_type_script_setup_true_lang-CscatDmg-BaroyBA0.js} +1 -1
  36. package/dist/ManualTwinlistControl-DBZ5RZgW-BV5qOGau.js +77 -0
  37. package/dist/MultiFileChooserControl-cyndOpF7.js +341 -0
  38. package/dist/{MultiRuleWrapper-TvQw5Kaj.js → MultiRuleWrapper-Db-W_o1f.js} +1 -1
  39. package/dist/{MultiSelectListBoxControl-nmvLP18g-feO16jJ4.js → MultiSelectListBoxControl-BMsPvxGQ-5ua-fVR8.js} +10 -9
  40. package/dist/{MultimodeTwinlistControl-yCdeWH2E-DG6GXu0l.js → MultimodeTwinlistControl-thO1be1r-8kc-JSH1.js} +64 -62
  41. package/dist/{NameFilter-D1TMJydD-Db00pnR3.js → NameFilter-DBMVmZmk-DnB-5f39.js} +7 -6
  42. package/dist/{NumberControl-uLMOLEbg-B_H33dGY.js → NumberControl-BPVO5l6t--nrQcx4m.js} +8 -7
  43. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-CR61f6d6-Df5EPyns.js +54 -0
  44. package/dist/OneOfDropdown-DBG8ZcpV-cZs_ptrT.js +36 -0
  45. package/dist/{RadioButtonsWithDescriptionControl-5M_6G7Qk-BHHWv0Y0.js → RadioButtonsWithDescriptionControl-BsqMTEB5-COGPhNPs.js} +17 -17
  46. package/dist/RadioControl-ClJmr0EQ-BzjoXaZ3.js +21 -0
  47. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-Bm4EUEvw-Cabfycg_.js +64 -0
  48. package/dist/ResourceControlBase-CeXYJeR1-DSmxhV0s.js +113 -0
  49. package/dist/{RichTextControl-D9QD2_uO-OY669heQ.js → RichTextControl-DvYkBpzH-CtMZq2re.js} +7876 -6699
  50. package/dist/{SectionLayout-DY27pAtG-BIZg0kiA.js → SectionLayout-CwRO3UXc-d5rFpCRN.js} +5 -5
  51. package/dist/SettingsSubPanelLayout-CV6y2bcX-OzpF07vB.js +64 -0
  52. package/dist/{SimpleTwinlistControl-P4KEYOq0-97VRLEr4.js → SimpleTwinlistControl-BSON5VYy-BaAaU86G.js} +7 -6
  53. package/dist/SingleSelectControl-BSqORMYm-CBP_mVGB.js +58 -0
  54. package/dist/{SingleSelectListBoxControl-oMWH0vEE-Ewf1HUGa.js → SingleSelectListBoxControl-CFdKzbOK-CruT9yt-.js} +14 -13
  55. package/dist/{SortListControl-4v3T2j_9-BkTlN-H5.js → SortListControl-DZIHeQmn-CKRyT1hN.js} +41 -39
  56. package/dist/{StringFileChooserControl-BVH5iHNM.js → StringFileChooserControl-Br8gZTku.js} +33 -30
  57. package/dist/{StyledListItem-D3LSfgGV-B9rTS8WT.js → StyledListItem--sgmJ3W_-Bo6f-_9B.js} +1 -1
  58. package/dist/{TeamAndSpacesControl-CH5ImByy-aTqgKpBn.js → TeamAndSpacesControl-DiMyDT-5-Br-Lq0ki.js} +21 -20
  59. package/dist/TeamResourceControl-Bag_dwA1-PdtnhxEi.js +44 -0
  60. package/dist/{TextAreaControl-CrsZSU_f-CNj59YPm.js → TextAreaControl-B52P0DAa-McfOgZWn.js} +10 -8
  61. package/dist/TextControl-52n-sttB-DssWw4KP.js +50962 -0
  62. package/dist/TimeControl-Cu12_qpz-CK1bxhya.js +71 -0
  63. package/dist/TimeframesControl-DhdC8OS1-DYseJbBV.js +352 -0
  64. package/dist/TwinlistControlBase.vue_vue_type_script_setup_true_lang-t1I2qxJz-DU6yd1RM.js +45 -0
  65. package/dist/{TypedStringFilter-ry7fTUTx-CCJRabai.js → TypedStringFilter-zJOICQei-B-5z8atp.js} +7 -6
  66. package/dist/{ValueSwitchControl-aVx7pUi9-7kuEbp3H.js → ValueSwitchControl-CEVWJH7z-DzuxqLvy.js} +7 -6
  67. package/dist/{VennDiagramLayout-D8s5yYbT.js → VennDiagramLayout-DyTZ5EJ9.js} +24 -24
  68. package/dist/{VerticalLayout-Bv-LJOZ0-BTrnMnQu.js → VerticalLayout-D_13xb_m-BfU1M3IE.js} +7 -7
  69. package/dist/ZonedDateTimeControl-C-vO6fC1-XngmuFqW.js +82 -0
  70. package/dist/{ai-bar-DLr5A9ZW.js → ai-bar-DDtzX23v.js} +775 -732
  71. package/dist/classApi-CHpAZrj3-BptMrhKH.js +3328 -0
  72. package/dist/collection-BBXRVj4b-DhO8c3tP.js +22 -0
  73. package/dist/collection-BBXRVj4b-DzRZ2FYd-COyFmQqa.js +22 -0
  74. package/dist/collection-BBXRVj4b-grENCIdl.js +22 -0
  75. package/dist/main.js +9977 -13304
  76. package/dist/parameters.js +1 -1
  77. package/dist/plainDateTimeUtils-CR0UhpkD-DU-LM4_V.js +52 -0
  78. package/dist/src/components/ScriptingEditor.vue.d.ts +6 -4
  79. package/dist/src/components/SettingsPage.vue.d.ts +5 -4
  80. package/dist/src/scripting-service.d.ts +1 -1
  81. package/dist/useDropdownNavigation-CdrbT-CQ-Dxb_y1Fq.js +2003 -0
  82. package/dist/{useFileChooserBackend-Bs7hx7xH.js → useFileChooserBackend-CLdJ1RU1.js} +6 -6
  83. package/dist/usePlainDateTimeBatch-Bd2G-GY9-DO2Zu0Mj.js +34 -0
  84. package/dist/{usePossibleValues-B-W6u-1T-DcglK6MY.js → usePossibleValues-DiYOmnZW-CaSLjdK-.js} +4 -4
  85. package/package.json +3 -3
  86. package/dist/CheckboxControl-CS6iXHnF-DLCN_obF.js +0 -38
  87. package/dist/CheckboxesControl-CPKIkyWt-BgPFZcJW.js +0 -40
  88. package/dist/CodeEditorControl-DM7k0B2q.js +0 -103
  89. package/dist/ColorPreviewControl-CntI0nTL-qVTX4e1m.js +0 -89
  90. package/dist/ComboBoxControl-DBYnBkC4-1oOLCCms.js +0 -40
  91. package/dist/ControlWithSubParameters-DgJhqCMe.js +0 -80
  92. package/dist/CredentialsControl-CuHgBJQY.js +0 -32
  93. package/dist/CredentialsControlBase-14mA9Xg5.js +0 -96
  94. package/dist/DateControl-Cx_CwvNB-Cnu4FwAv.js +0 -35
  95. package/dist/DateTimeControl-BJsDzufC-BLhNM1JR.js +0 -56
  96. package/dist/DateTimeFormatPickerControl-C80v1qfK-0bjg1c9X.js +0 -35
  97. package/dist/DateTimeFormatPickerWithTypeControl-Dt-FKtYV-x-IJKc_b.js +0 -475
  98. package/dist/DropdownControl-D_BnA4-1-BWnnlfiI.js +0 -30
  99. package/dist/DynamicInputControl-u5VOv3zx.js +0 -6
  100. package/dist/ExecutorCoresControl-BnglyGMR-CagN3N5j.js +0 -56
  101. package/dist/ExecutorMemoryControl-CRATGs9C-Dsj7vG41.js +0 -50
  102. package/dist/FileUploadControl-D42rjpJg-DIoT6HeI.js +0 -221
  103. package/dist/GridSelectionControl-BJk8-yiM-CvDVlby0.js +0 -116
  104. package/dist/IntervalControl-Drljrv-b-WpTsaCtp.js +0 -751
  105. package/dist/LegacyCredentialsControl-C5OmuHPe.js +0 -87
  106. package/dist/ManualTwinlistControl-By0Hur_m-zZbz98JO.js +0 -75
  107. package/dist/MultiFileChooserControl-BDBYwcSY.js +0 -401
  108. package/dist/NumberControlBase.vue_vue_type_script_setup_true_lang-VVQDBYw7-FEqHVnFo.js +0 -52
  109. package/dist/OneOfDropdown-CDwwxb3h-DAK0CMDe.js +0 -34
  110. package/dist/RadioControl-C73s-icb-DSF6WESw.js +0 -24
  111. package/dist/RadioControlBase.vue_vue_type_script_setup_true_lang-BScekfhl-oNoT_40f.js +0 -60
  112. package/dist/ResourceControlBase-Bqq1PAX_-5gNwtS9Y.js +0 -183
  113. package/dist/SettingsSubPanelLayout-82gMWhpv-DwWBU76p.js +0 -70
  114. package/dist/SingleSelectControl-C_ZKkV5m-nfkmmDbp.js +0 -56
  115. package/dist/TeamResourceControl-BFMuyWnk-DvcyxCqW.js +0 -47
  116. package/dist/TextControl-B0ag-3Pv-nwKlVRtp.js +0 -54671
  117. package/dist/TimeControl-Bt5OcjBc-KiaYQH-m.js +0 -41
  118. package/dist/TimePartInput-CvwAzDuY-CuNpUUqj.js +0 -253
  119. package/dist/TimeframesControl-BE3LFgyl-hQJ_5QVJ.js +0 -94
  120. package/dist/Tooltip-UlemzxdS-Dfhzj7no.js +0 -24
  121. package/dist/TwinlistControlBase.vue_vue_type_script_setup_true_lang-B5lCsIOD-KqyVUaZj.js +0 -42
  122. package/dist/ValueSwitch-BXaDBm2C-Ba93O_aZ.js +0 -130
  123. package/dist/ZonedDateTimeControl-6MUvXzd3-B1B9FPa7.js +0 -72
  124. package/dist/_Uint8Array-C_ozLuQF-DBc0hZkr.js +0 -349
  125. package/dist/arrow-dropdown-DMFBPPcK-uCJYJfqE.js +0 -17
  126. package/dist/arrow-next-BQULX8HT-DDsCfA5A.js +0 -17
  127. package/dist/floating-ui.vue-Fx4CxKut-DAsMxBCU.js +0 -1057
  128. package/dist/isArray-WzO_os3q-ClnPWjBY.js +0 -4
  129. package/dist/localTimeUtils-DBMwKtLh-CTshgG3l.js +0 -12470
  130. package/dist/src/lsp/completion.d.ts +0 -7
  131. package/dist/src/lsp/connection.d.ts +0 -56
  132. package/dist/src/lsp/diagnostics.d.ts +0 -4
  133. package/dist/src/lsp/doc-sync.d.ts +0 -5
  134. package/dist/src/lsp/hover.d.ts +0 -5
  135. package/dist/src/lsp/knime-io.d.ts +0 -22
  136. package/dist/src/lsp/mapping-utils.d.ts +0 -8
  137. package/dist/src/lsp/signature-help.d.ts +0 -5
  138. package/dist/toString-C-CNeuJl-jseUiiTM.js +0 -949
  139. package/dist/useDropdownNavigation-2Yhk7zes-75raAHpT.js +0 -821
  140. /package/dist/{useUnknownValuesInTwinlist-BbwGcno5-D2ve7iXH.js → useUnknownValuesInTwinlist-BhhirtmX-D2ve7iXH.js} +0 -0
@@ -1,821 +0,0 @@
1
- import { defineComponent as me, ref as ie, readonly as he, computed as ye, onMounted as ge, watch as we, onUnmounted as Ne, Comment as Ee, cloneVNode as Oe } from "vue";
2
- var ue = ["input:not([inert]):not([inert] *)", "select:not([inert]):not([inert] *)", "textarea:not([inert]):not([inert] *)", "a[href]:not([inert]):not([inert] *)", "button:not([inert]):not([inert] *)", "[tabindex]:not(slot):not([inert]):not([inert] *)", "audio[controls]:not([inert]):not([inert] *)", "video[controls]:not([inert]):not([inert] *)", '[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)', "details>summary:first-of-type:not([inert]):not([inert] *)", "details:not([inert]):not([inert] *)"], L = /* @__PURE__ */ ue.join(","), ce = typeof Element > "u", k = ce ? function() {
3
- } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector, B = !ce && Element.prototype.getRootNode ? function(e) {
4
- var t;
5
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
6
- } : function(e) {
7
- return e == null ? void 0 : e.ownerDocument;
8
- }, M = function(e, t) {
9
- var n;
10
- t === void 0 && (t = !0);
11
- var r = e == null || (n = e.getAttribute) === null || n === void 0 ? void 0 : n.call(e, "inert"), u = r === "" || r === "true", a = u || t && e && // closest does not exist on shadow roots, so we fall back to a manual
12
- // lookup upward, in case it is not defined.
13
- (typeof e.closest == "function" ? e.closest("[inert]") : M(e.parentNode));
14
- return a;
15
- }, Fe = function(e) {
16
- var t, n = e == null || (t = e.getAttribute) === null || t === void 0 ? void 0 : t.call(e, "contenteditable");
17
- return n === "" || n === "true";
18
- }, se = function(e, t, n) {
19
- if (M(e))
20
- return [];
21
- var r = Array.prototype.slice.apply(e.querySelectorAll(L));
22
- return t && k.call(e, L) && r.unshift(e), r = r.filter(n), r;
23
- }, K = function(e, t, n) {
24
- for (var r = [], u = Array.from(e); u.length; ) {
25
- var a = u.shift();
26
- if (!M(a, !1))
27
- if (a.tagName === "SLOT") {
28
- var l = a.assignedElements(), s = l.length ? l : a.children, p = K(s, !0, n);
29
- n.flatten ? r.push.apply(r, p) : r.push({
30
- scopeParent: a,
31
- candidates: p
32
- });
33
- } else {
34
- var g = k.call(a, L);
35
- g && n.filter(a) && (t || !e.includes(a)) && r.push(a);
36
- var y = a.shadowRoot || // check for an undisclosed shadow
37
- typeof n.getShadowRoot == "function" && n.getShadowRoot(a), N = !M(y, !1) && (!n.shadowRootFilter || n.shadowRootFilter(a));
38
- if (y && N) {
39
- var E = K(y === !0 ? a.children : y.children, !0, n);
40
- n.flatten ? r.push.apply(r, E) : r.push({
41
- scopeParent: a,
42
- candidates: E
43
- });
44
- } else
45
- u.unshift.apply(u, a.children);
46
- }
47
- }
48
- return r;
49
- }, le = function(e) {
50
- return !isNaN(parseInt(e.getAttribute("tabindex"), 10));
51
- }, F = function(e) {
52
- if (!e)
53
- throw new Error("No node provided");
54
- return e.tabIndex < 0 && (/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName) || Fe(e)) && !le(e) ? 0 : e.tabIndex;
55
- }, ke = function(e, t) {
56
- var n = F(e);
57
- return n < 0 && t && !le(e) ? 0 : n;
58
- }, Se = function(e, t) {
59
- return e.tabIndex === t.tabIndex ? e.documentOrder - t.documentOrder : e.tabIndex - t.tabIndex;
60
- }, de = function(e) {
61
- return e.tagName === "INPUT";
62
- }, De = function(e) {
63
- return de(e) && e.type === "hidden";
64
- }, Pe = function(e) {
65
- var t = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(n) {
66
- return n.tagName === "SUMMARY";
67
- });
68
- return t;
69
- }, Te = function(e, t) {
70
- for (var n = 0; n < e.length; n++)
71
- if (e[n].checked && e[n].form === t)
72
- return e[n];
73
- }, Ie = function(e) {
74
- if (!e.name)
75
- return !0;
76
- var t = e.form || B(e), n = function(a) {
77
- return t.querySelectorAll('input[type="radio"][name="' + a + '"]');
78
- }, r;
79
- if (typeof window < "u" && typeof window.CSS < "u" && typeof window.CSS.escape == "function")
80
- r = n(window.CSS.escape(e.name));
81
- else
82
- try {
83
- r = n(e.name);
84
- } catch (a) {
85
- 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", a.message), !1;
86
- }
87
- var u = Te(r, e.form);
88
- return !u || u === e;
89
- }, Re = function(e) {
90
- return de(e) && e.type === "radio";
91
- }, Ae = function(e) {
92
- return Re(e) && !Ie(e);
93
- }, Ce = function(e) {
94
- var t, n = e && B(e), r = (t = n) === null || t === void 0 ? void 0 : t.host, u = !1;
95
- if (n && n !== e) {
96
- var a, l, s;
97
- for (u = !!((a = r) !== null && a !== void 0 && (l = a.ownerDocument) !== null && l !== void 0 && l.contains(r) || e != null && (s = e.ownerDocument) !== null && s !== void 0 && s.contains(e)); !u && r; ) {
98
- var p, g, y;
99
- n = B(r), r = (p = n) === null || p === void 0 ? void 0 : p.host, u = !!((g = r) !== null && g !== void 0 && (y = g.ownerDocument) !== null && y !== void 0 && y.contains(r));
100
- }
101
- }
102
- return u;
103
- }, te = function(e) {
104
- var t = e.getBoundingClientRect(), n = t.width, r = t.height;
105
- return n === 0 && r === 0;
106
- }, xe = function(e, t) {
107
- var n = t.displayCheck, r = t.getShadowRoot;
108
- if (n === "full-native" && "checkVisibility" in e) {
109
- var u = e.checkVisibility({
110
- // Checking opacity might be desirable for some use cases, but natively,
111
- // opacity zero elements _are_ focusable and tabbable.
112
- checkOpacity: !1,
113
- opacityProperty: !1,
114
- contentVisibilityAuto: !0,
115
- visibilityProperty: !0,
116
- // This is an alias for `visibilityProperty`. Contemporary browsers
117
- // support both. However, this alias has wider browser support (Chrome
118
- // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so
119
- // we include it anyway.
120
- checkVisibilityCSS: !0
121
- });
122
- return !u;
123
- }
124
- if (getComputedStyle(e).visibility === "hidden")
125
- return !0;
126
- var a = k.call(e, "details>summary:first-of-type"), l = a ? e.parentElement : e;
127
- if (k.call(l, "details:not([open]) *"))
128
- return !0;
129
- if (!n || n === "full" || // full-native can run this branch when it falls through in case
130
- // Element#checkVisibility is unsupported
131
- n === "full-native" || n === "legacy-full") {
132
- if (typeof r == "function") {
133
- for (var s = e; e; ) {
134
- var p = e.parentElement, g = B(e);
135
- if (p && !p.shadowRoot && r(p) === !0)
136
- return te(e);
137
- e.assignedSlot ? e = e.assignedSlot : !p && g !== e.ownerDocument ? e = g.host : e = p;
138
- }
139
- e = s;
140
- }
141
- if (Ce(e))
142
- return !e.getClientRects().length;
143
- if (n !== "legacy-full")
144
- return !0;
145
- } else if (n === "non-zero-area")
146
- return te(e);
147
- return !1;
148
- }, je = function(e) {
149
- if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))
150
- for (var t = e.parentElement; t; ) {
151
- if (t.tagName === "FIELDSET" && t.disabled) {
152
- for (var n = 0; n < t.children.length; n++) {
153
- var r = t.children.item(n);
154
- if (r.tagName === "LEGEND")
155
- return k.call(t, "fieldset[disabled] *") ? !0 : !r.contains(e);
156
- }
157
- return !0;
158
- }
159
- t = t.parentElement;
160
- }
161
- return !1;
162
- }, U = function(e, t) {
163
- return !(t.disabled || De(t) || xe(t, e) || // For a details element with a summary, the summary element gets the focus
164
- Pe(t) || je(t));
165
- }, $ = function(e, t) {
166
- return !(Ae(t) || F(t) < 0 || !U(e, t));
167
- }, Ge = function(e) {
168
- var t = parseInt(e.getAttribute("tabindex"), 10);
169
- return !!(isNaN(t) || t >= 0);
170
- }, fe = function(e) {
171
- var t = [], n = [];
172
- return e.forEach(function(r, u) {
173
- var a = !!r.scopeParent, l = a ? r.scopeParent : r, s = ke(l, a), p = a ? fe(r.candidates) : l;
174
- s === 0 ? a ? t.push.apply(t, p) : t.push(l) : n.push({
175
- documentOrder: u,
176
- tabIndex: s,
177
- item: r,
178
- isScope: a,
179
- content: p
180
- });
181
- }), n.sort(Se).reduce(function(r, u) {
182
- return u.isScope ? r.push.apply(r, u.content) : r.push(u.content), r;
183
- }, []).concat(t);
184
- }, Le = function(e, t) {
185
- t = t || {};
186
- var n;
187
- return t.getShadowRoot ? n = K([e], t.includeContainer, {
188
- filter: $.bind(null, t),
189
- flatten: !1,
190
- getShadowRoot: t.getShadowRoot,
191
- shadowRootFilter: Ge
192
- }) : n = se(e, t.includeContainer, $.bind(null, t)), fe(n);
193
- }, Be = function(e, t) {
194
- t = t || {};
195
- var n;
196
- return t.getShadowRoot ? n = K([e], t.includeContainer, {
197
- filter: U.bind(null, t),
198
- flatten: !0,
199
- getShadowRoot: t.getShadowRoot
200
- }) : n = se(e, t.includeContainer, U.bind(null, t)), n;
201
- }, D = function(e, t) {
202
- if (t = t || {}, !e)
203
- throw new Error("No node provided");
204
- return k.call(e, L) === !1 ? !1 : $(t, e);
205
- }, Me = /* @__PURE__ */ ue.concat("iframe:not([inert]):not([inert] *)").join(","), Y = function(e, t) {
206
- if (t = t || {}, !e)
207
- throw new Error("No node provided");
208
- return k.call(e, Me) === !1 ? !1 : U(t, e);
209
- };
210
- function H(e, t) {
211
- (t == null || t > e.length) && (t = e.length);
212
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
213
- return r;
214
- }
215
- function Ke(e) {
216
- if (Array.isArray(e)) return H(e);
217
- }
218
- function Ue(e, t, n) {
219
- return (t = $e(t)) in e ? Object.defineProperty(e, t, {
220
- value: n,
221
- enumerable: !0,
222
- configurable: !0,
223
- writable: !0
224
- }) : e[t] = n, e;
225
- }
226
- function _e(e) {
227
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
228
- }
229
- function Ve() {
230
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
231
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
232
- }
233
- function ne(e, t) {
234
- var n = Object.keys(e);
235
- if (Object.getOwnPropertySymbols) {
236
- var r = Object.getOwnPropertySymbols(e);
237
- t && (r = r.filter(function(u) {
238
- return Object.getOwnPropertyDescriptor(e, u).enumerable;
239
- })), n.push.apply(n, r);
240
- }
241
- return n;
242
- }
243
- function ae(e) {
244
- for (var t = 1; t < arguments.length; t++) {
245
- var n = arguments[t] != null ? arguments[t] : {};
246
- t % 2 ? ne(Object(n), !0).forEach(function(r) {
247
- Ue(e, r, n[r]);
248
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ne(Object(n)).forEach(function(r) {
249
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
250
- });
251
- }
252
- return e;
253
- }
254
- function qe(e) {
255
- return Ke(e) || _e(e) || He(e) || Ve();
256
- }
257
- function Ye(e, t) {
258
- if (typeof e != "object" || !e) return e;
259
- var n = e[Symbol.toPrimitive];
260
- if (n !== void 0) {
261
- var r = n.call(e, t);
262
- if (typeof r != "object") return r;
263
- throw new TypeError("@@toPrimitive must return a primitive value.");
264
- }
265
- return (t === "string" ? String : Number)(e);
266
- }
267
- function $e(e) {
268
- var t = Ye(e, "string");
269
- return typeof t == "symbol" ? t : t + "";
270
- }
271
- function He(e, t) {
272
- if (e) {
273
- if (typeof e == "string") return H(e, t);
274
- var n = {}.toString.call(e).slice(8, -1);
275
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? H(e, t) : void 0;
276
- }
277
- }
278
- var oe = {
279
- activateTrap: function(e, t) {
280
- if (e.length > 0) {
281
- var n = e[e.length - 1];
282
- n !== t && n._setPausedState(!0);
283
- }
284
- var r = e.indexOf(t);
285
- r === -1 || e.splice(r, 1), e.push(t);
286
- },
287
- deactivateTrap: function(e, t) {
288
- var n = e.indexOf(t);
289
- n !== -1 && e.splice(n, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
290
- }
291
- }, ze = function(e) {
292
- return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
293
- }, Xe = function(e) {
294
- return (e == null ? void 0 : e.key) === "Escape" || (e == null ? void 0 : e.key) === "Esc" || (e == null ? void 0 : e.keyCode) === 27;
295
- }, R = function(e) {
296
- return (e == null ? void 0 : e.key) === "Tab" || (e == null ? void 0 : e.keyCode) === 9;
297
- }, Je = function(e) {
298
- return R(e) && !e.shiftKey;
299
- }, Qe = function(e) {
300
- return R(e) && e.shiftKey;
301
- }, re = function(e) {
302
- return setTimeout(e, 0);
303
- }, I = function(e) {
304
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)
305
- n[r - 1] = arguments[r];
306
- return typeof e == "function" ? e.apply(void 0, n) : e;
307
- }, j = function(e) {
308
- return e.target.shadowRoot && typeof e.composedPath == "function" ? e.composedPath()[0] : e.target;
309
- }, Ze = [], We = function(e, t) {
310
- var n = (t == null ? void 0 : t.document) || document, r = (t == null ? void 0 : t.trapStack) || Ze, u = ae({
311
- returnFocusOnDeactivate: !0,
312
- escapeDeactivates: !0,
313
- delayInitialFocus: !0,
314
- isKeyForward: Je,
315
- isKeyBackward: Qe
316
- }, t), a = {
317
- // containers given to createFocusTrap()
318
- // @type {Array<HTMLElement>}
319
- containers: [],
320
- // list of objects identifying tabbable nodes in `containers` in the trap
321
- // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap
322
- // is active, but the trap should never get to a state where there isn't at least one group
323
- // with at least one tabbable node in it (that would lead to an error condition that would
324
- // result in an error being thrown)
325
- // @type {Array<{
326
- // container: HTMLElement,
327
- // tabbableNodes: Array<HTMLElement>, // empty if none
328
- // focusableNodes: Array<HTMLElement>, // empty if none
329
- // posTabIndexesFound: boolean,
330
- // firstTabbableNode: HTMLElement|undefined,
331
- // lastTabbableNode: HTMLElement|undefined,
332
- // firstDomTabbableNode: HTMLElement|undefined,
333
- // lastDomTabbableNode: HTMLElement|undefined,
334
- // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined
335
- // }>}
336
- containerGroups: [],
337
- // same order/length as `containers` list
338
- // references to objects in `containerGroups`, but only those that actually have
339
- // tabbable nodes in them
340
- // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__
341
- // the same length
342
- tabbableGroups: [],
343
- nodeFocusedBeforeActivation: null,
344
- mostRecentlyFocusedNode: null,
345
- active: !1,
346
- paused: !1,
347
- manuallyPaused: !1,
348
- // timer ID for when delayInitialFocus is true and initial focus in this trap
349
- // has been delayed during activation
350
- delayInitialFocusTimer: void 0,
351
- // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
352
- recentNavEvent: void 0
353
- }, l, s = function(o, i, c) {
354
- return o && o[i] !== void 0 ? o[i] : u[c || i];
355
- }, p = function(o, i) {
356
- var c = typeof (i == null ? void 0 : i.composedPath) == "function" ? i.composedPath() : void 0;
357
- return a.containerGroups.findIndex(function(f) {
358
- var v = f.container, b = f.tabbableNodes;
359
- return v.contains(o) || (c == null ? void 0 : c.includes(v)) || b.find(function(d) {
360
- return d === o;
361
- });
362
- });
363
- }, g = function(o) {
364
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, c = i.hasFallback, f = c === void 0 ? !1 : c, v = i.params, b = v === void 0 ? [] : v, d = u[o];
365
- if (typeof d == "function" && (d = d.apply(void 0, qe(b))), d === !0 && (d = void 0), !d) {
366
- if (d === void 0 || d === !1)
367
- return d;
368
- throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
369
- }
370
- var w = d;
371
- if (typeof d == "string") {
372
- try {
373
- w = n.querySelector(d);
374
- } catch (m) {
375
- throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(m.message, '"'));
376
- }
377
- if (!w && !f)
378
- throw new Error("`".concat(o, "` as selector refers to no known node"));
379
- }
380
- return w;
381
- }, y = function() {
382
- var o = g("initialFocus", {
383
- hasFallback: !0
384
- });
385
- if (o === !1)
386
- return !1;
387
- if (o === void 0 || o && !Y(o, u.tabbableOptions))
388
- if (p(n.activeElement) >= 0)
389
- o = n.activeElement;
390
- else {
391
- var i = a.tabbableGroups[0], c = i && i.firstTabbableNode;
392
- o = c || g("fallbackFocus");
393
- }
394
- else o === null && (o = g("fallbackFocus"));
395
- if (!o)
396
- throw new Error("Your focus-trap needs to have at least one focusable element");
397
- return o;
398
- }, N = function() {
399
- if (a.containerGroups = a.containers.map(function(o) {
400
- var i = Le(o, u.tabbableOptions), c = Be(o, u.tabbableOptions), f = i.length > 0 ? i[0] : void 0, v = i.length > 0 ? i[i.length - 1] : void 0, b = c.find(function(m) {
401
- return D(m);
402
- }), d = c.slice().reverse().find(function(m) {
403
- return D(m);
404
- }), w = !!i.find(function(m) {
405
- return F(m) > 0;
406
- });
407
- return {
408
- container: o,
409
- tabbableNodes: i,
410
- focusableNodes: c,
411
- /** True if at least one node with positive `tabindex` was found in this container. */
412
- posTabIndexesFound: w,
413
- /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
414
- firstTabbableNode: f,
415
- /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
416
- lastTabbableNode: v,
417
- // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
418
- // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
419
- // because that API doesn't work with Shadow DOM as well as it should (@see
420
- // https://github.com/whatwg/dom/issues/320) and since this first/last is only needed, so far,
421
- // to address an edge case related to positive tabindex support, this seems like a much easier,
422
- // "close enough most of the time" alternative for positive tabindexes which should generally
423
- // be avoided anyway...
424
- /** First tabbable node in container, __DOM__ order; `undefined` if none. */
425
- firstDomTabbableNode: b,
426
- /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
427
- lastDomTabbableNode: d,
428
- /**
429
- * Finds the __tabbable__ node that follows the given node in the specified direction,
430
- * in this container, if any.
431
- * @param {HTMLElement} node
432
- * @param {boolean} [forward] True if going in forward tab order; false if going
433
- * in reverse.
434
- * @returns {HTMLElement|undefined} The next tabbable node, if any.
435
- */
436
- nextTabbableNode: function(m) {
437
- var S = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, T = i.indexOf(m);
438
- return T < 0 ? S ? c.slice(c.indexOf(m) + 1).find(function(O) {
439
- return D(O);
440
- }) : c.slice(0, c.indexOf(m)).reverse().find(function(O) {
441
- return D(O);
442
- }) : i[T + (S ? 1 : -1)];
443
- }
444
- };
445
- }), a.tabbableGroups = a.containerGroups.filter(function(o) {
446
- return o.tabbableNodes.length > 0;
447
- }), a.tabbableGroups.length <= 0 && !g("fallbackFocus"))
448
- throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
449
- if (a.containerGroups.find(function(o) {
450
- return o.posTabIndexesFound;
451
- }) && a.containerGroups.length > 1)
452
- throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
453
- }, E = function(o) {
454
- var i = o.activeElement;
455
- if (i)
456
- return i.shadowRoot && i.shadowRoot.activeElement !== null ? E(i.shadowRoot) : i;
457
- }, h = function(o) {
458
- if (o !== !1 && o !== E(document)) {
459
- if (!o || !o.focus) {
460
- h(y());
461
- return;
462
- }
463
- o.focus({
464
- preventScroll: !!u.preventScroll
465
- }), a.mostRecentlyFocusedNode = o, ze(o) && o.select();
466
- }
467
- }, A = function(o) {
468
- var i = g("setReturnFocus", {
469
- params: [o]
470
- });
471
- return i || (i === !1 ? !1 : o);
472
- }, C = function(o) {
473
- var i = o.target, c = o.event, f = o.isBackward, v = f === void 0 ? !1 : f;
474
- i = i || j(c), N();
475
- var b = null;
476
- if (a.tabbableGroups.length > 0) {
477
- var d = p(i, c), w = d >= 0 ? a.containerGroups[d] : void 0;
478
- if (d < 0)
479
- v ? b = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : b = a.tabbableGroups[0].firstTabbableNode;
480
- else if (v) {
481
- var m = a.tabbableGroups.findIndex(function(V) {
482
- var q = V.firstTabbableNode;
483
- return i === q;
484
- });
485
- if (m < 0 && (w.container === i || Y(i, u.tabbableOptions) && !D(i, u.tabbableOptions) && !w.nextTabbableNode(i, !1)) && (m = d), m >= 0) {
486
- var S = m === 0 ? a.tabbableGroups.length - 1 : m - 1, T = a.tabbableGroups[S];
487
- b = F(i) >= 0 ? T.lastTabbableNode : T.lastDomTabbableNode;
488
- } else R(c) || (b = w.nextTabbableNode(i, !1));
489
- } else {
490
- var O = a.tabbableGroups.findIndex(function(V) {
491
- var q = V.lastTabbableNode;
492
- return i === q;
493
- });
494
- if (O < 0 && (w.container === i || Y(i, u.tabbableOptions) && !D(i, u.tabbableOptions) && !w.nextTabbableNode(i)) && (O = d), O >= 0) {
495
- var be = O === a.tabbableGroups.length - 1 ? 0 : O + 1, ee = a.tabbableGroups[be];
496
- b = F(i) >= 0 ? ee.firstTabbableNode : ee.firstDomTabbableNode;
497
- } else R(c) || (b = w.nextTabbableNode(i));
498
- }
499
- } else
500
- b = g("fallbackFocus");
501
- return b;
502
- }, x = function(o) {
503
- var i = j(o);
504
- if (!(p(i, o) >= 0)) {
505
- if (I(u.clickOutsideDeactivates, o)) {
506
- l.deactivate({
507
- // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
508
- // which will result in the outside click setting focus to the node
509
- // that was clicked (and if not focusable, to "nothing"); by setting
510
- // `returnFocus: true`, we'll attempt to re-focus the node originally-focused
511
- // on activation (or the configured `setReturnFocus` node), whether the
512
- // outside click was on a focusable node or not
513
- returnFocus: u.returnFocusOnDeactivate
514
- });
515
- return;
516
- }
517
- I(u.allowOutsideClick, o) || o.preventDefault();
518
- }
519
- }, z = function(o) {
520
- var i = j(o), c = p(i, o) >= 0;
521
- if (c || i instanceof Document)
522
- c && (a.mostRecentlyFocusedNode = i);
523
- else {
524
- o.stopImmediatePropagation();
525
- var f, v = !0;
526
- if (a.mostRecentlyFocusedNode)
527
- if (F(a.mostRecentlyFocusedNode) > 0) {
528
- var b = p(a.mostRecentlyFocusedNode), d = a.containerGroups[b].tabbableNodes;
529
- if (d.length > 0) {
530
- var w = d.findIndex(function(m) {
531
- return m === a.mostRecentlyFocusedNode;
532
- });
533
- w >= 0 && (u.isKeyForward(a.recentNavEvent) ? w + 1 < d.length && (f = d[w + 1], v = !1) : w - 1 >= 0 && (f = d[w - 1], v = !1));
534
- }
535
- } else
536
- a.containerGroups.some(function(m) {
537
- return m.tabbableNodes.some(function(S) {
538
- return F(S) > 0;
539
- });
540
- }) || (v = !1);
541
- else
542
- v = !1;
543
- v && (f = C({
544
- // move FROM the MRU node, not event-related node (which will be the node that is
545
- // outside the trap causing the focus escape we're trying to fix)
546
- target: a.mostRecentlyFocusedNode,
547
- isBackward: u.isKeyBackward(a.recentNavEvent)
548
- })), h(f || a.mostRecentlyFocusedNode || y());
549
- }
550
- a.recentNavEvent = void 0;
551
- }, ve = function(o) {
552
- var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
553
- a.recentNavEvent = o;
554
- var c = C({
555
- event: o,
556
- isBackward: i
557
- });
558
- c && (R(o) && o.preventDefault(), h(c));
559
- }, X = function(o) {
560
- (u.isKeyForward(o) || u.isKeyBackward(o)) && ve(o, u.isKeyBackward(o));
561
- }, J = function(o) {
562
- Xe(o) && I(u.escapeDeactivates, o) !== !1 && (o.preventDefault(), l.deactivate());
563
- }, Q = function(o) {
564
- var i = j(o);
565
- p(i, o) >= 0 || I(u.clickOutsideDeactivates, o) || I(u.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
566
- }, Z = function() {
567
- if (a.active)
568
- return oe.activateTrap(r, l), a.delayInitialFocusTimer = u.delayInitialFocus ? re(function() {
569
- h(y());
570
- }) : h(y()), n.addEventListener("focusin", z, !0), n.addEventListener("mousedown", x, {
571
- capture: !0,
572
- passive: !1
573
- }), n.addEventListener("touchstart", x, {
574
- capture: !0,
575
- passive: !1
576
- }), n.addEventListener("click", Q, {
577
- capture: !0,
578
- passive: !1
579
- }), n.addEventListener("keydown", X, {
580
- capture: !0,
581
- passive: !1
582
- }), n.addEventListener("keydown", J), l;
583
- }, W = function() {
584
- if (a.active)
585
- return n.removeEventListener("focusin", z, !0), n.removeEventListener("mousedown", x, !0), n.removeEventListener("touchstart", x, !0), n.removeEventListener("click", Q, !0), n.removeEventListener("keydown", X, !0), n.removeEventListener("keydown", J), l;
586
- }, pe = function(o) {
587
- var i = o.some(function(c) {
588
- var f = Array.from(c.removedNodes);
589
- return f.some(function(v) {
590
- return v === a.mostRecentlyFocusedNode;
591
- });
592
- });
593
- i && h(y());
594
- }, _ = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(pe) : void 0, P = function() {
595
- _ && (_.disconnect(), a.active && !a.paused && a.containers.map(function(o) {
596
- _.observe(o, {
597
- subtree: !0,
598
- childList: !0
599
- });
600
- }));
601
- };
602
- return l = {
603
- get active() {
604
- return a.active;
605
- },
606
- get paused() {
607
- return a.paused;
608
- },
609
- activate: function(o) {
610
- if (a.active)
611
- return this;
612
- var i = s(o, "onActivate"), c = s(o, "onPostActivate"), f = s(o, "checkCanFocusTrap");
613
- f || N(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = E(n), i == null || i();
614
- var v = function() {
615
- f && N(), Z(), P(), c == null || c();
616
- };
617
- return f ? (f(a.containers.concat()).then(v, v), this) : (v(), this);
618
- },
619
- deactivate: function(o) {
620
- if (!a.active)
621
- return this;
622
- var i = ae({
623
- onDeactivate: u.onDeactivate,
624
- onPostDeactivate: u.onPostDeactivate,
625
- checkCanReturnFocus: u.checkCanReturnFocus
626
- }, o);
627
- clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, W(), a.active = !1, a.paused = !1, P(), oe.deactivateTrap(r, l);
628
- var c = s(i, "onDeactivate"), f = s(i, "onPostDeactivate"), v = s(i, "checkCanReturnFocus"), b = s(i, "returnFocus", "returnFocusOnDeactivate");
629
- c == null || c();
630
- var d = function() {
631
- re(function() {
632
- b && h(A(a.nodeFocusedBeforeActivation)), f == null || f();
633
- });
634
- };
635
- return b && v ? (v(A(a.nodeFocusedBeforeActivation)).then(d, d), this) : (d(), this);
636
- },
637
- pause: function(o) {
638
- return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
639
- },
640
- unpause: function(o) {
641
- return a.active ? (a.manuallyPaused = !1, r[r.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
642
- },
643
- updateContainerElements: function(o) {
644
- var i = [].concat(o).filter(Boolean);
645
- return a.containers = i.map(function(c) {
646
- return typeof c == "string" ? n.querySelector(c) : c;
647
- }), a.active && N(), P(), this;
648
- }
649
- }, Object.defineProperties(l, {
650
- _isManuallyPaused: {
651
- value: function() {
652
- return a.manuallyPaused;
653
- }
654
- },
655
- _setPausedState: {
656
- value: function(o, i) {
657
- if (a.paused === o)
658
- return this;
659
- if (a.paused = o, o) {
660
- var c = s(i, "onPause"), f = s(i, "onPostPause");
661
- c == null || c(), W(), P(), f == null || f();
662
- } else {
663
- var v = s(i, "onUnpause"), b = s(i, "onPostUnpause");
664
- v == null || v(), N(), Z(), P(), b == null || b();
665
- }
666
- return this;
667
- }
668
- }
669
- }), l.updateContainerElements(e), l;
670
- };
671
- const et = {
672
- escapeDeactivates: {
673
- type: Boolean,
674
- default: !0
675
- },
676
- returnFocusOnDeactivate: {
677
- type: Boolean,
678
- default: !0
679
- },
680
- allowOutsideClick: {
681
- type: [Boolean, Function],
682
- default: !0
683
- },
684
- clickOutsideDeactivates: [Boolean, Function],
685
- initialFocus: [String, Function, Boolean],
686
- fallbackFocus: [String, Function],
687
- checkCanFocusTrap: Function,
688
- checkCanReturnFocus: Function,
689
- delayInitialFocus: {
690
- type: Boolean,
691
- default: !0
692
- },
693
- document: Object,
694
- preventScroll: Boolean,
695
- setReturnFocus: [Object, String, Boolean, Function],
696
- tabbableOptions: Object
697
- }, nt = me({
698
- props: Object.assign({
699
- active: {
700
- // TODO: could be options for activate but what about the options for deactivating?
701
- type: Boolean,
702
- default: !0
703
- }
704
- }, et),
705
- emits: [
706
- "update:active",
707
- "activate",
708
- "postActivate",
709
- "deactivate",
710
- "postDeactivate"
711
- ],
712
- render() {
713
- return this.renderImpl();
714
- },
715
- setup(e, { slots: t, emit: n }) {
716
- let r;
717
- const u = ie(null), a = ye(() => {
718
- const s = u.value;
719
- return s && (s instanceof HTMLElement ? s : s.$el);
720
- });
721
- function l() {
722
- return r || (r = We(a.value, {
723
- escapeDeactivates: e.escapeDeactivates,
724
- allowOutsideClick: e.allowOutsideClick,
725
- returnFocusOnDeactivate: e.returnFocusOnDeactivate,
726
- clickOutsideDeactivates: e.clickOutsideDeactivates,
727
- onActivate: () => {
728
- n("update:active", !0), n("activate");
729
- },
730
- onDeactivate: () => {
731
- n("update:active", !1), n("deactivate");
732
- },
733
- onPostActivate: () => n("postActivate"),
734
- onPostDeactivate: () => n("postDeactivate"),
735
- initialFocus: e.initialFocus,
736
- fallbackFocus: e.fallbackFocus,
737
- tabbableOptions: e.tabbableOptions,
738
- delayInitialFocus: e.delayInitialFocus
739
- }));
740
- }
741
- return ge(() => {
742
- we(() => e.active, (s) => {
743
- s && a.value ? l().activate() : r && (r.deactivate(), (!a.value || a.value.nodeType === Node.COMMENT_NODE) && (r = null));
744
- }, { immediate: !0, flush: "post" });
745
- }), Ne(() => {
746
- r && r.deactivate(), r = null;
747
- }), {
748
- activate() {
749
- l().activate();
750
- },
751
- deactivate() {
752
- r && r.deactivate();
753
- },
754
- renderImpl() {
755
- if (!t.default)
756
- return null;
757
- const s = t.default().filter((p) => p.type !== Ee);
758
- return !s || !s.length || s.length > 1 ? (console.error("[focus-trap-vue]: FocusTrap requires exactly one child."), s) : Oe(s[0], { ref: u });
759
- }
760
- };
761
- }
762
- }), G = (e) => {
763
- e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
764
- }, at = ({
765
- getNextElement: e,
766
- getFirstElement: t,
767
- getLastElement: n,
768
- close: r,
769
- disableSpaceToClick: u,
770
- keepOpenedOnTab: a
771
- }) => {
772
- const l = ie(null), s = () => {
773
- };
774
- let p = s;
775
- const g = () => {
776
- l.value = null, p = s;
777
- }, y = (h) => {
778
- l.value = h.index, p = h.onClick;
779
- }, N = (h) => {
780
- y(e(l.value, h));
781
- }, E = () => {
782
- g(), r();
783
- };
784
- return {
785
- onKeydown: (h) => {
786
- switch (h.code) {
787
- case "ArrowDown":
788
- G(h), N(1);
789
- break;
790
- case "ArrowUp":
791
- G(h), N(-1);
792
- break;
793
- case "Enter":
794
- case "Space": {
795
- const A = h.code === "Enter", C = h.code === "Space";
796
- l.value !== null && (A || C && !u) && (G(h), p());
797
- break;
798
- }
799
- case "Home":
800
- t && y(t());
801
- break;
802
- case "End":
803
- n && y(n());
804
- break;
805
- case "Escape":
806
- G(h), E();
807
- break;
808
- case "Tab":
809
- a || E();
810
- break;
811
- }
812
- },
813
- currentIndex: he(l),
814
- resetNavigation: g,
815
- setElement: y
816
- };
817
- };
818
- export {
819
- at as i,
820
- nt as n
821
- };