@iblai/web-containers 1.57.0 → 1.58.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.
Files changed (130) hide show
  1. package/dist/cjs/_virtual/index2.js +2 -2
  2. package/dist/cjs/_virtual/index3.js +2 -2
  3. package/dist/cjs/components/chat/chat-download-dialog.js.map +1 -1
  4. package/dist/cjs/components/chat/ui/button.js +4 -4
  5. package/dist/cjs/components/chat/ui/button.js.map +1 -1
  6. package/dist/cjs/components/chat-input-form/composer-plus-menu.js +94 -17
  7. package/dist/cjs/components/chat-input-form/composer-plus-menu.js.map +1 -1
  8. package/dist/cjs/components/chat-input-form/mcp-connect-explainer-dialog.js +29 -0
  9. package/dist/cjs/components/chat-input-form/mcp-connect-explainer-dialog.js.map +1 -0
  10. package/dist/cjs/components/chat-input-form/mcp-servers-menu.js +199 -0
  11. package/dist/cjs/components/chat-input-form/mcp-servers-menu.js.map +1 -0
  12. package/dist/cjs/components/chat-input-form/use-mcp-active-count.js +56 -0
  13. package/dist/cjs/components/chat-input-form/use-mcp-active-count.js.map +1 -0
  14. package/dist/cjs/components/chat-input-form.js +17 -4
  15. package/dist/cjs/components/chat-input-form.js.map +1 -1
  16. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js +29 -13
  17. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js.map +1 -1
  18. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab/labels.js +8 -0
  19. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab/labels.js.map +1 -1
  20. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab.js +23 -13
  21. package/dist/cjs/components/modals/edit-mentor-modal/tabs/api-tab.js.map +1 -1
  22. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js +755 -90
  23. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js.map +1 -1
  24. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-management-content.js +386 -984
  25. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-management-content.js.map +1 -1
  26. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js +16 -0
  27. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js.map +1 -0
  28. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/index.js +6 -3
  29. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/index.js.map +1 -1
  30. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/mcp-connector-helpers.js +463 -0
  31. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/mcp-connector-helpers.js.map +1 -0
  32. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js +329 -0
  33. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js.map +1 -0
  34. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/remove-connector-dialog.js +20 -0
  35. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/remove-connector-dialog.js.map +1 -0
  36. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/use-mcp-server-actions.js +744 -0
  37. package/dist/cjs/components/modals/edit-mentor-modal/tabs/mcp-tab/use-mcp-server-actions.js.map +1 -0
  38. package/dist/cjs/components/modals/user-profile-modal.js +2 -0
  39. package/dist/cjs/components/modals/user-profile-modal.js.map +1 -1
  40. package/dist/cjs/components/profile/integration/api-tab/create-api-modal.js +17 -10
  41. package/dist/cjs/components/profile/integration/api-tab/create-api-modal.js.map +1 -1
  42. package/dist/cjs/components/ui/accordion.js +40 -0
  43. package/dist/cjs/components/ui/accordion.js.map +1 -0
  44. package/dist/cjs/i18n/messages/en.json.js +156 -19
  45. package/dist/cjs/i18n/messages/en.json.js.map +1 -1
  46. package/dist/cjs/i18n/messages/es.json.js +156 -19
  47. package/dist/cjs/i18n/messages/es.json.js.map +1 -1
  48. package/dist/cjs/i18n/messages/fr.json.js +156 -19
  49. package/dist/cjs/i18n/messages/fr.json.js.map +1 -1
  50. package/dist/cjs/i18n/messages/zh.json.js +156 -19
  51. package/dist/cjs/i18n/messages/zh.json.js.map +1 -1
  52. package/dist/cjs/index.js +2 -0
  53. package/dist/cjs/index.js.map +1 -1
  54. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-accordion@1.2.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_b91476821b9fe8f172a947f727875267/node_modules/@radix-ui/react-accordion/dist/index.js +317 -0
  55. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-accordion@1.2.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_b91476821b9fe8f172a947f727875267/node_modules/@radix-ui/react-accordion/dist/index.js.map +1 -0
  56. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types__d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.js +173 -0
  57. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types__d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -0
  58. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-collection@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.js +73 -0
  59. package/dist/cjs/node_modules/.pnpm/@radix-ui_react-collection@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
  60. package/dist/cjs/node_modules/.pnpm/css-mediaquery@0.1.2/node_modules/css-mediaquery/index.js +1 -1
  61. package/dist/cjs/node_modules/.pnpm/matchmediaquery@0.4.2/node_modules/matchmediaquery/index.js +1 -1
  62. package/dist/cjs/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  63. package/dist/cjs/web-containers/tsconfig.build.tsbuildinfo +1 -0
  64. package/dist/esm/_virtual/index2.js +2 -2
  65. package/dist/esm/_virtual/index3.js +2 -2
  66. package/dist/esm/components/chat/chat-download-dialog.js.map +1 -1
  67. package/dist/esm/components/chat-input-form/composer-plus-menu.js +94 -17
  68. package/dist/esm/components/chat-input-form/composer-plus-menu.js.map +1 -1
  69. package/dist/esm/components/chat-input-form/mcp-connect-explainer-dialog.js +27 -0
  70. package/dist/esm/components/chat-input-form/mcp-connect-explainer-dialog.js.map +1 -0
  71. package/dist/esm/components/chat-input-form/mcp-servers-menu.js +197 -0
  72. package/dist/esm/components/chat-input-form/mcp-servers-menu.js.map +1 -0
  73. package/dist/esm/components/chat-input-form/use-mcp-active-count.js +54 -0
  74. package/dist/esm/components/chat-input-form/use-mcp-active-count.js.map +1 -0
  75. package/dist/esm/components/chat-input-form.js +17 -4
  76. package/dist/esm/components/chat-input-form.js.map +1 -1
  77. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js +30 -14
  78. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab/create-api-modal.js.map +1 -1
  79. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab/labels.js +8 -0
  80. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab/labels.js.map +1 -1
  81. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab.js +25 -15
  82. package/dist/esm/components/modals/edit-mentor-modal/tabs/api-tab.js.map +1 -1
  83. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js +755 -92
  84. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-dialogs.js.map +1 -1
  85. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-management-content.js +361 -968
  86. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/connector-management-content.js.map +1 -1
  87. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js +14 -0
  88. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/field-info.js.map +1 -0
  89. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/index.js +6 -3
  90. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/index.js.map +1 -1
  91. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/mcp-connector-helpers.js +431 -0
  92. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/mcp-connector-helpers.js.map +1 -0
  93. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js +313 -0
  94. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/oauth-app-fields.js.map +1 -0
  95. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/remove-connector-dialog.js +18 -0
  96. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/remove-connector-dialog.js.map +1 -0
  97. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/use-mcp-server-actions.js +742 -0
  98. package/dist/esm/components/modals/edit-mentor-modal/tabs/mcp-tab/use-mcp-server-actions.js.map +1 -0
  99. package/dist/esm/components/modals/user-profile-modal.js +2 -0
  100. package/dist/esm/components/modals/user-profile-modal.js.map +1 -1
  101. package/dist/esm/components/profile/integration/api-tab/create-api-modal.js +17 -10
  102. package/dist/esm/components/profile/integration/api-tab/create-api-modal.js.map +1 -1
  103. package/dist/esm/components/ui/accordion.js +16 -0
  104. package/dist/esm/components/ui/accordion.js.map +1 -0
  105. package/dist/esm/i18n/messages/en.json.js +154 -20
  106. package/dist/esm/i18n/messages/en.json.js.map +1 -1
  107. package/dist/esm/i18n/messages/es.json.js +154 -20
  108. package/dist/esm/i18n/messages/es.json.js.map +1 -1
  109. package/dist/esm/i18n/messages/fr.json.js +154 -20
  110. package/dist/esm/i18n/messages/fr.json.js.map +1 -1
  111. package/dist/esm/i18n/messages/zh.json.js +154 -20
  112. package/dist/esm/i18n/messages/zh.json.js.map +1 -1
  113. package/dist/esm/index.js +1 -0
  114. package/dist/esm/index.js.map +1 -1
  115. package/dist/esm/node_modules/.pnpm/@radix-ui_react-accordion@1.2.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_b91476821b9fe8f172a947f727875267/node_modules/@radix-ui/react-accordion/dist/index.js +306 -0
  116. package/dist/esm/node_modules/.pnpm/@radix-ui_react-accordion@1.2.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_b91476821b9fe8f172a947f727875267/node_modules/@radix-ui/react-accordion/dist/index.js.map +1 -0
  117. package/dist/esm/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types__d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.js +146 -0
  118. package/dist/esm/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types__d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.js.map +1 -0
  119. package/dist/esm/node_modules/.pnpm/@radix-ui_react-collection@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.js +71 -0
  120. package/dist/esm/node_modules/.pnpm/@radix-ui_react-collection@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.js.map +1 -0
  121. package/dist/esm/node_modules/.pnpm/css-mediaquery@0.1.2/node_modules/css-mediaquery/index.js +1 -1
  122. package/dist/esm/node_modules/.pnpm/matchmediaquery@0.4.2/node_modules/matchmediaquery/index.js +1 -1
  123. package/dist/esm/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js +1 -1
  124. package/dist/esm/web-containers/tsconfig.build.tsbuildinfo +1 -0
  125. package/dist/index.d.ts +31 -2
  126. package/dist/next/index.d.ts +6 -0
  127. package/dist/package.json +1 -1
  128. package/package.json +3 -3
  129. package/dist/cjs/web-containers/tsconfig.tsbuildinfo +0 -1
  130. package/dist/esm/web-containers/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,306 @@
1
+ import React__default from 'react';
2
+ import { createContextScope } from '../../../../../@radix-ui_react-context@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js';
3
+ import { createCollection } from '../../../../../@radix-ui_react-collection@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.js';
4
+ import { useComposedRefs } from '../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js';
5
+ import { composeEventHandlers } from '../../../../../@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js';
6
+ import { useControllableState } from '../../../../../@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js';
7
+ import { Primitive } from '../../../../../@radix-ui_react-primitive@2.1.0_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_f2580de629d71ffa3fb86897883f3213/node_modules/@radix-ui/react-primitive/dist/index.js';
8
+ import { Root, Trigger, Content, createCollapsibleScope } from '../../../../../@radix-ui_react-collapsible@1.1.8_@types_react-dom@19.2.1_@types_react@19.1.17__@types__d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.js';
9
+ import { useId } from '../../../../../@radix-ui_react-id@1.1.1_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js';
10
+ import { useDirection } from '../../../../../@radix-ui_react-direction@1.1.1_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-direction/dist/index.js';
11
+ import { jsx } from 'react/jsx-runtime';
12
+
13
+ var ACCORDION_NAME = "Accordion";
14
+ var ACCORDION_KEYS = ["Home", "End", "ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight"];
15
+ var [Collection, useCollection, createCollectionScope] = createCollection(ACCORDION_NAME);
16
+ var [createAccordionContext] = createContextScope(ACCORDION_NAME, [
17
+ createCollectionScope,
18
+ createCollapsibleScope
19
+ ]);
20
+ var useCollapsibleScope = createCollapsibleScope();
21
+ var Accordion = React__default.forwardRef(
22
+ (props, forwardedRef) => {
23
+ const { type, ...accordionProps } = props;
24
+ const singleProps = accordionProps;
25
+ const multipleProps = accordionProps;
26
+ return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeAccordion, children: type === "multiple" ? /* @__PURE__ */ jsx(AccordionImplMultiple, { ...multipleProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(AccordionImplSingle, { ...singleProps, ref: forwardedRef }) });
27
+ }
28
+ );
29
+ Accordion.displayName = ACCORDION_NAME;
30
+ var [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME);
31
+ var [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(
32
+ ACCORDION_NAME,
33
+ { collapsible: false }
34
+ );
35
+ var AccordionImplSingle = React__default.forwardRef(
36
+ (props, forwardedRef) => {
37
+ const {
38
+ value: valueProp,
39
+ defaultValue,
40
+ onValueChange = () => {
41
+ },
42
+ collapsible = false,
43
+ ...accordionSingleProps
44
+ } = props;
45
+ const [value, setValue] = useControllableState({
46
+ prop: valueProp,
47
+ defaultProp: defaultValue ?? "",
48
+ onChange: onValueChange,
49
+ caller: ACCORDION_NAME
50
+ });
51
+ return /* @__PURE__ */ jsx(
52
+ AccordionValueProvider,
53
+ {
54
+ scope: props.__scopeAccordion,
55
+ value: React__default.useMemo(() => value ? [value] : [], [value]),
56
+ onItemOpen: setValue,
57
+ onItemClose: React__default.useCallback(() => collapsible && setValue(""), [collapsible, setValue]),
58
+ children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })
59
+ }
60
+ );
61
+ }
62
+ );
63
+ var AccordionImplMultiple = React__default.forwardRef((props, forwardedRef) => {
64
+ const {
65
+ value: valueProp,
66
+ defaultValue,
67
+ onValueChange = () => {
68
+ },
69
+ ...accordionMultipleProps
70
+ } = props;
71
+ const [value, setValue] = useControllableState({
72
+ prop: valueProp,
73
+ defaultProp: defaultValue ?? [],
74
+ onChange: onValueChange,
75
+ caller: ACCORDION_NAME
76
+ });
77
+ const handleItemOpen = React__default.useCallback(
78
+ (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),
79
+ [setValue]
80
+ );
81
+ const handleItemClose = React__default.useCallback(
82
+ (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),
83
+ [setValue]
84
+ );
85
+ return /* @__PURE__ */ jsx(
86
+ AccordionValueProvider,
87
+ {
88
+ scope: props.__scopeAccordion,
89
+ value,
90
+ onItemOpen: handleItemOpen,
91
+ onItemClose: handleItemClose,
92
+ children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionMultipleProps, ref: forwardedRef }) })
93
+ }
94
+ );
95
+ });
96
+ var [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);
97
+ var AccordionImpl = React__default.forwardRef(
98
+ (props, forwardedRef) => {
99
+ const { __scopeAccordion, disabled, dir, orientation = "vertical", ...accordionProps } = props;
100
+ const accordionRef = React__default.useRef(null);
101
+ const composedRefs = useComposedRefs(accordionRef, forwardedRef);
102
+ const getItems = useCollection(__scopeAccordion);
103
+ const direction = useDirection(dir);
104
+ const isDirectionLTR = direction === "ltr";
105
+ const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {
106
+ if (!ACCORDION_KEYS.includes(event.key)) return;
107
+ const target = event.target;
108
+ const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);
109
+ const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);
110
+ const triggerCount = triggerCollection.length;
111
+ if (triggerIndex === -1) return;
112
+ event.preventDefault();
113
+ let nextIndex = triggerIndex;
114
+ const homeIndex = 0;
115
+ const endIndex = triggerCount - 1;
116
+ const moveNext = () => {
117
+ nextIndex = triggerIndex + 1;
118
+ if (nextIndex > endIndex) {
119
+ nextIndex = homeIndex;
120
+ }
121
+ };
122
+ const movePrev = () => {
123
+ nextIndex = triggerIndex - 1;
124
+ if (nextIndex < homeIndex) {
125
+ nextIndex = endIndex;
126
+ }
127
+ };
128
+ switch (event.key) {
129
+ case "Home":
130
+ nextIndex = homeIndex;
131
+ break;
132
+ case "End":
133
+ nextIndex = endIndex;
134
+ break;
135
+ case "ArrowRight":
136
+ if (orientation === "horizontal") {
137
+ if (isDirectionLTR) {
138
+ moveNext();
139
+ } else {
140
+ movePrev();
141
+ }
142
+ }
143
+ break;
144
+ case "ArrowDown":
145
+ if (orientation === "vertical") {
146
+ moveNext();
147
+ }
148
+ break;
149
+ case "ArrowLeft":
150
+ if (orientation === "horizontal") {
151
+ if (isDirectionLTR) {
152
+ movePrev();
153
+ } else {
154
+ moveNext();
155
+ }
156
+ }
157
+ break;
158
+ case "ArrowUp":
159
+ if (orientation === "vertical") {
160
+ movePrev();
161
+ }
162
+ break;
163
+ }
164
+ const clampedIndex = nextIndex % triggerCount;
165
+ triggerCollection[clampedIndex].ref.current?.focus();
166
+ });
167
+ return /* @__PURE__ */ jsx(
168
+ AccordionImplProvider,
169
+ {
170
+ scope: __scopeAccordion,
171
+ disabled,
172
+ direction: dir,
173
+ orientation,
174
+ children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx(
175
+ Primitive.div,
176
+ {
177
+ ...accordionProps,
178
+ "data-orientation": orientation,
179
+ ref: composedRefs,
180
+ onKeyDown: disabled ? void 0 : handleKeyDown
181
+ }
182
+ ) })
183
+ }
184
+ );
185
+ }
186
+ );
187
+ var ITEM_NAME = "AccordionItem";
188
+ var [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);
189
+ var AccordionItem = React__default.forwardRef(
190
+ (props, forwardedRef) => {
191
+ const { __scopeAccordion, value, ...accordionItemProps } = props;
192
+ const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);
193
+ const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion);
194
+ const collapsibleScope = useCollapsibleScope(__scopeAccordion);
195
+ const triggerId = useId();
196
+ const open = value && valueContext.value.includes(value) || false;
197
+ const disabled = accordionContext.disabled || props.disabled;
198
+ return /* @__PURE__ */ jsx(
199
+ AccordionItemProvider,
200
+ {
201
+ scope: __scopeAccordion,
202
+ open,
203
+ disabled,
204
+ triggerId,
205
+ children: /* @__PURE__ */ jsx(
206
+ Root,
207
+ {
208
+ "data-orientation": accordionContext.orientation,
209
+ "data-state": getState(open),
210
+ ...collapsibleScope,
211
+ ...accordionItemProps,
212
+ ref: forwardedRef,
213
+ disabled,
214
+ open,
215
+ onOpenChange: (open2) => {
216
+ if (open2) {
217
+ valueContext.onItemOpen(value);
218
+ } else {
219
+ valueContext.onItemClose(value);
220
+ }
221
+ }
222
+ }
223
+ )
224
+ }
225
+ );
226
+ }
227
+ );
228
+ AccordionItem.displayName = ITEM_NAME;
229
+ var HEADER_NAME = "AccordionHeader";
230
+ var AccordionHeader = React__default.forwardRef(
231
+ (props, forwardedRef) => {
232
+ const { __scopeAccordion, ...headerProps } = props;
233
+ const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
234
+ const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);
235
+ return /* @__PURE__ */ jsx(
236
+ Primitive.h3,
237
+ {
238
+ "data-orientation": accordionContext.orientation,
239
+ "data-state": getState(itemContext.open),
240
+ "data-disabled": itemContext.disabled ? "" : void 0,
241
+ ...headerProps,
242
+ ref: forwardedRef
243
+ }
244
+ );
245
+ }
246
+ );
247
+ AccordionHeader.displayName = HEADER_NAME;
248
+ var TRIGGER_NAME = "AccordionTrigger";
249
+ var AccordionTrigger = React__default.forwardRef(
250
+ (props, forwardedRef) => {
251
+ const { __scopeAccordion, ...triggerProps } = props;
252
+ const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
253
+ const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion);
254
+ const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion);
255
+ const collapsibleScope = useCollapsibleScope(__scopeAccordion);
256
+ return /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx(
257
+ Trigger,
258
+ {
259
+ "aria-disabled": itemContext.open && !collapsibleContext.collapsible || void 0,
260
+ "data-orientation": accordionContext.orientation,
261
+ id: itemContext.triggerId,
262
+ ...collapsibleScope,
263
+ ...triggerProps,
264
+ ref: forwardedRef
265
+ }
266
+ ) });
267
+ }
268
+ );
269
+ AccordionTrigger.displayName = TRIGGER_NAME;
270
+ var CONTENT_NAME = "AccordionContent";
271
+ var AccordionContent = React__default.forwardRef(
272
+ (props, forwardedRef) => {
273
+ const { __scopeAccordion, ...contentProps } = props;
274
+ const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);
275
+ const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion);
276
+ const collapsibleScope = useCollapsibleScope(__scopeAccordion);
277
+ return /* @__PURE__ */ jsx(
278
+ Content,
279
+ {
280
+ role: "region",
281
+ "aria-labelledby": itemContext.triggerId,
282
+ "data-orientation": accordionContext.orientation,
283
+ ...collapsibleScope,
284
+ ...contentProps,
285
+ ref: forwardedRef,
286
+ style: {
287
+ ["--radix-accordion-content-height"]: "var(--radix-collapsible-content-height)",
288
+ ["--radix-accordion-content-width"]: "var(--radix-collapsible-content-width)",
289
+ ...props.style
290
+ }
291
+ }
292
+ );
293
+ }
294
+ );
295
+ AccordionContent.displayName = CONTENT_NAME;
296
+ function getState(open) {
297
+ return open ? "open" : "closed";
298
+ }
299
+ var Root2 = Accordion;
300
+ var Item = AccordionItem;
301
+ var Header = AccordionHeader;
302
+ var Trigger2 = AccordionTrigger;
303
+ var Content2 = AccordionContent;
304
+
305
+ export { Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionTrigger, Content2 as Content, Header, Item, Root2 as Root, Trigger2 as Trigger };
306
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../../../node_modules/.pnpm/@radix-ui+react-accordion@1.2.8_@types+react-dom@19.2.1_@types+react@19.1.17__@types+re_b91476821b9fe8f172a947f727875267/node_modules/@radix-ui/react-accordion/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/accordion.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport { createCollapsibleScope } from \"@radix-ui/react-collapsible\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ACCORDION_NAME = \"Accordion\";\nvar ACCORDION_KEYS = [\"Home\", \"End\", \"ArrowDown\", \"ArrowUp\", \"ArrowLeft\", \"ArrowRight\"];\nvar [Collection, useCollection, createCollectionScope] = createCollection(ACCORDION_NAME);\nvar [createAccordionContext, createAccordionScope] = createContextScope(ACCORDION_NAME, [\n createCollectionScope,\n createCollapsibleScope\n]);\nvar useCollapsibleScope = createCollapsibleScope();\nvar Accordion = React.forwardRef(\n (props, forwardedRef) => {\n const { type, ...accordionProps } = props;\n const singleProps = accordionProps;\n const multipleProps = accordionProps;\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeAccordion, children: type === \"multiple\" ? /* @__PURE__ */ jsx(AccordionImplMultiple, { ...multipleProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(AccordionImplSingle, { ...singleProps, ref: forwardedRef }) });\n }\n);\nAccordion.displayName = ACCORDION_NAME;\nvar [AccordionValueProvider, useAccordionValueContext] = createAccordionContext(ACCORDION_NAME);\nvar [AccordionCollapsibleProvider, useAccordionCollapsibleContext] = createAccordionContext(\n ACCORDION_NAME,\n { collapsible: false }\n);\nvar AccordionImplSingle = React.forwardRef(\n (props, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {\n },\n collapsible = false,\n ...accordionSingleProps\n } = props;\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? \"\",\n onChange: onValueChange,\n caller: ACCORDION_NAME\n });\n return /* @__PURE__ */ jsx(\n AccordionValueProvider,\n {\n scope: props.__scopeAccordion,\n value: React.useMemo(() => value ? [value] : [], [value]),\n onItemOpen: setValue,\n onItemClose: React.useCallback(() => collapsible && setValue(\"\"), [collapsible, setValue]),\n children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionSingleProps, ref: forwardedRef }) })\n }\n );\n }\n);\nvar AccordionImplMultiple = React.forwardRef((props, forwardedRef) => {\n const {\n value: valueProp,\n defaultValue,\n onValueChange = () => {\n },\n ...accordionMultipleProps\n } = props;\n const [value, setValue] = useControllableState({\n prop: valueProp,\n defaultProp: defaultValue ?? [],\n onChange: onValueChange,\n caller: ACCORDION_NAME\n });\n const handleItemOpen = React.useCallback(\n (itemValue) => setValue((prevValue = []) => [...prevValue, itemValue]),\n [setValue]\n );\n const handleItemClose = React.useCallback(\n (itemValue) => setValue((prevValue = []) => prevValue.filter((value2) => value2 !== itemValue)),\n [setValue]\n );\n return /* @__PURE__ */ jsx(\n AccordionValueProvider,\n {\n scope: props.__scopeAccordion,\n value,\n onItemOpen: handleItemOpen,\n onItemClose: handleItemClose,\n children: /* @__PURE__ */ jsx(AccordionCollapsibleProvider, { scope: props.__scopeAccordion, collapsible: true, children: /* @__PURE__ */ jsx(AccordionImpl, { ...accordionMultipleProps, ref: forwardedRef }) })\n }\n );\n});\nvar [AccordionImplProvider, useAccordionContext] = createAccordionContext(ACCORDION_NAME);\nvar AccordionImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAccordion, disabled, dir, orientation = \"vertical\", ...accordionProps } = props;\n const accordionRef = React.useRef(null);\n const composedRefs = useComposedRefs(accordionRef, forwardedRef);\n const getItems = useCollection(__scopeAccordion);\n const direction = useDirection(dir);\n const isDirectionLTR = direction === \"ltr\";\n const handleKeyDown = composeEventHandlers(props.onKeyDown, (event) => {\n if (!ACCORDION_KEYS.includes(event.key)) return;\n const target = event.target;\n const triggerCollection = getItems().filter((item) => !item.ref.current?.disabled);\n const triggerIndex = triggerCollection.findIndex((item) => item.ref.current === target);\n const triggerCount = triggerCollection.length;\n if (triggerIndex === -1) return;\n event.preventDefault();\n let nextIndex = triggerIndex;\n const homeIndex = 0;\n const endIndex = triggerCount - 1;\n const moveNext = () => {\n nextIndex = triggerIndex + 1;\n if (nextIndex > endIndex) {\n nextIndex = homeIndex;\n }\n };\n const movePrev = () => {\n nextIndex = triggerIndex - 1;\n if (nextIndex < homeIndex) {\n nextIndex = endIndex;\n }\n };\n switch (event.key) {\n case \"Home\":\n nextIndex = homeIndex;\n break;\n case \"End\":\n nextIndex = endIndex;\n break;\n case \"ArrowRight\":\n if (orientation === \"horizontal\") {\n if (isDirectionLTR) {\n moveNext();\n } else {\n movePrev();\n }\n }\n break;\n case \"ArrowDown\":\n if (orientation === \"vertical\") {\n moveNext();\n }\n break;\n case \"ArrowLeft\":\n if (orientation === \"horizontal\") {\n if (isDirectionLTR) {\n movePrev();\n } else {\n moveNext();\n }\n }\n break;\n case \"ArrowUp\":\n if (orientation === \"vertical\") {\n movePrev();\n }\n break;\n }\n const clampedIndex = nextIndex % triggerCount;\n triggerCollection[clampedIndex].ref.current?.focus();\n });\n return /* @__PURE__ */ jsx(\n AccordionImplProvider,\n {\n scope: __scopeAccordion,\n disabled,\n direction: dir,\n orientation,\n children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...accordionProps,\n \"data-orientation\": orientation,\n ref: composedRefs,\n onKeyDown: disabled ? void 0 : handleKeyDown\n }\n ) })\n }\n );\n }\n);\nvar ITEM_NAME = \"AccordionItem\";\nvar [AccordionItemProvider, useAccordionItemContext] = createAccordionContext(ITEM_NAME);\nvar AccordionItem = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAccordion, value, ...accordionItemProps } = props;\n const accordionContext = useAccordionContext(ITEM_NAME, __scopeAccordion);\n const valueContext = useAccordionValueContext(ITEM_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n const triggerId = useId();\n const open = value && valueContext.value.includes(value) || false;\n const disabled = accordionContext.disabled || props.disabled;\n return /* @__PURE__ */ jsx(\n AccordionItemProvider,\n {\n scope: __scopeAccordion,\n open,\n disabled,\n triggerId,\n children: /* @__PURE__ */ jsx(\n CollapsiblePrimitive.Root,\n {\n \"data-orientation\": accordionContext.orientation,\n \"data-state\": getState(open),\n ...collapsibleScope,\n ...accordionItemProps,\n ref: forwardedRef,\n disabled,\n open,\n onOpenChange: (open2) => {\n if (open2) {\n valueContext.onItemOpen(value);\n } else {\n valueContext.onItemClose(value);\n }\n }\n }\n )\n }\n );\n }\n);\nAccordionItem.displayName = ITEM_NAME;\nvar HEADER_NAME = \"AccordionHeader\";\nvar AccordionHeader = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAccordion, ...headerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(HEADER_NAME, __scopeAccordion);\n return /* @__PURE__ */ jsx(\n Primitive.h3,\n {\n \"data-orientation\": accordionContext.orientation,\n \"data-state\": getState(itemContext.open),\n \"data-disabled\": itemContext.disabled ? \"\" : void 0,\n ...headerProps,\n ref: forwardedRef\n }\n );\n }\n);\nAccordionHeader.displayName = HEADER_NAME;\nvar TRIGGER_NAME = \"AccordionTrigger\";\nvar AccordionTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAccordion, ...triggerProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleContext = useAccordionCollapsibleContext(TRIGGER_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeAccordion, children: /* @__PURE__ */ jsx(\n CollapsiblePrimitive.Trigger,\n {\n \"aria-disabled\": itemContext.open && !collapsibleContext.collapsible || void 0,\n \"data-orientation\": accordionContext.orientation,\n id: itemContext.triggerId,\n ...collapsibleScope,\n ...triggerProps,\n ref: forwardedRef\n }\n ) });\n }\n);\nAccordionTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"AccordionContent\";\nvar AccordionContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAccordion, ...contentProps } = props;\n const accordionContext = useAccordionContext(ACCORDION_NAME, __scopeAccordion);\n const itemContext = useAccordionItemContext(CONTENT_NAME, __scopeAccordion);\n const collapsibleScope = useCollapsibleScope(__scopeAccordion);\n return /* @__PURE__ */ jsx(\n CollapsiblePrimitive.Content,\n {\n role: \"region\",\n \"aria-labelledby\": itemContext.triggerId,\n \"data-orientation\": accordionContext.orientation,\n ...collapsibleScope,\n ...contentProps,\n ref: forwardedRef,\n style: {\n [\"--radix-accordion-content-height\"]: \"var(--radix-collapsible-content-height)\",\n [\"--radix-accordion-content-width\"]: \"var(--radix-collapsible-content-width)\",\n ...props.style\n }\n }\n );\n }\n);\nAccordionContent.displayName = CONTENT_NAME;\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root2 = Accordion;\nvar Item = AccordionItem;\nvar Header = AccordionHeader;\nvar Trigger2 = AccordionTrigger;\nvar Content2 = AccordionContent;\nexport {\n Accordion,\n AccordionContent,\n AccordionHeader,\n AccordionItem,\n AccordionTrigger,\n Content2 as Content,\n Header,\n Item,\n Root2 as Root,\n Trigger2 as Trigger,\n createAccordionScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["React","CollapsiblePrimitive.Root","CollapsiblePrimitive.Trigger","CollapsiblePrimitive.Content"],"mappings":";;;;;;;;;;;;AAeA,IAAI,cAAc,GAAG,WAAW;AAChC,IAAI,cAAc,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,CAAC;AACvF,IAAI,CAAC,UAAU,EAAE,aAAa,EAAE,qBAAqB,CAAC,GAAG,gBAAgB,CAAC,cAAc,CAAC;AACzF,IAAI,CAAC,sBAA4C,CAAC,GAAG,kBAAkB,CAAC,cAAc,EAAE;AACxF,EAAE,qBAAqB;AACvB,EAAE;AACF,CAAC,CAAC;AACF,IAAI,mBAAmB,GAAG,sBAAsB,EAAE;AAC/C,IAAC,SAAS,GAAGA,cAAK,CAAC,UAAU;AAChC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AAC3B,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,EAAE,GAAG,KAAK;AAC7C,IAAI,MAAM,WAAW,GAAG,cAAc;AACtC,IAAI,MAAM,aAAa,GAAG,cAAc;AACxC,IAAI,uBAAuB,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,CAA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,GAAG,gBAAgB;AAC3B,QAAQ,GAAG,YAAY;AACvB,QAAQ,GAAG,EAAE,YAAY;AACzB,QAAQ,KAAK,EAAE;AACf,UAAU,CAAC,kCAAkC,GAAG,yCAAyC;AACzF,UAAU,CAAC,iCAAiC,GAAG,wCAAwC;AACvF,UAAU,GAAG,KAAK,CAAC;AACnB;AACA;AACA,KAAK;AACL,EAAE;AACF;AACA,gBAAgB,CAAC,WAAW,GAAG,YAAY;AAC3C,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAE,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ;AACjC;AACG,IAAC,KAAK,GAAG;AACT,IAAC,IAAI,GAAG;AACR,IAAC,MAAM,GAAG;AACV,IAAC,QAAQ,GAAG;AACZ,IAAC,QAAQ,GAAG;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,146 @@
1
+ import * as React from 'react';
2
+ import { composeEventHandlers } from '../../../../../@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js';
3
+ import { createContextScope } from '../../../../../@radix-ui_react-context@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js';
4
+ import { useControllableState } from '../../../../../@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.js';
5
+ import { useLayoutEffect as useLayoutEffect2 } from '../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.js';
6
+ import { useComposedRefs } from '../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js';
7
+ import { Primitive } from '../../../../../@radix-ui_react-primitive@2.1.0_@types_react-dom@19.2.1_@types_react@19.1.17__@types_re_f2580de629d71ffa3fb86897883f3213/node_modules/@radix-ui/react-primitive/dist/index.js';
8
+ import { Presence } from '../../../../../@radix-ui_react-presence@1.1.4_@types_react-dom@19.2.1_@types_react@19.1.17__@types_rea_67e75fa808cbea3c87d551df82c7ea7b/node_modules/@radix-ui/react-presence/dist/index.js';
9
+ import { useId } from '../../../../../@radix-ui_react-id@1.1.1_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-id/dist/index.js';
10
+ import { jsx } from 'react/jsx-runtime';
11
+
12
+ var COLLAPSIBLE_NAME = "Collapsible";
13
+ var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
14
+ var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
15
+ var Collapsible = React.forwardRef(
16
+ (props, forwardedRef) => {
17
+ const {
18
+ __scopeCollapsible,
19
+ open: openProp,
20
+ defaultOpen,
21
+ disabled,
22
+ onOpenChange,
23
+ ...collapsibleProps
24
+ } = props;
25
+ const [open, setOpen] = useControllableState({
26
+ prop: openProp,
27
+ defaultProp: defaultOpen ?? false,
28
+ onChange: onOpenChange,
29
+ caller: COLLAPSIBLE_NAME
30
+ });
31
+ return /* @__PURE__ */ jsx(
32
+ CollapsibleProvider,
33
+ {
34
+ scope: __scopeCollapsible,
35
+ disabled,
36
+ contentId: useId(),
37
+ open,
38
+ onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
39
+ children: /* @__PURE__ */ jsx(
40
+ Primitive.div,
41
+ {
42
+ "data-state": getState(open),
43
+ "data-disabled": disabled ? "" : void 0,
44
+ ...collapsibleProps,
45
+ ref: forwardedRef
46
+ }
47
+ )
48
+ }
49
+ );
50
+ }
51
+ );
52
+ Collapsible.displayName = COLLAPSIBLE_NAME;
53
+ var TRIGGER_NAME = "CollapsibleTrigger";
54
+ var CollapsibleTrigger = React.forwardRef(
55
+ (props, forwardedRef) => {
56
+ const { __scopeCollapsible, ...triggerProps } = props;
57
+ const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
58
+ return /* @__PURE__ */ jsx(
59
+ Primitive.button,
60
+ {
61
+ type: "button",
62
+ "aria-controls": context.contentId,
63
+ "aria-expanded": context.open || false,
64
+ "data-state": getState(context.open),
65
+ "data-disabled": context.disabled ? "" : void 0,
66
+ disabled: context.disabled,
67
+ ...triggerProps,
68
+ ref: forwardedRef,
69
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
70
+ }
71
+ );
72
+ }
73
+ );
74
+ CollapsibleTrigger.displayName = TRIGGER_NAME;
75
+ var CONTENT_NAME = "CollapsibleContent";
76
+ var CollapsibleContent = React.forwardRef(
77
+ (props, forwardedRef) => {
78
+ const { forceMount, ...contentProps } = props;
79
+ const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
80
+ return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });
81
+ }
82
+ );
83
+ CollapsibleContent.displayName = CONTENT_NAME;
84
+ var CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {
85
+ const { __scopeCollapsible, present, children, ...contentProps } = props;
86
+ const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
87
+ const [isPresent, setIsPresent] = React.useState(present);
88
+ const ref = React.useRef(null);
89
+ const composedRefs = useComposedRefs(forwardedRef, ref);
90
+ const heightRef = React.useRef(0);
91
+ const height = heightRef.current;
92
+ const widthRef = React.useRef(0);
93
+ const width = widthRef.current;
94
+ const isOpen = context.open || isPresent;
95
+ const isMountAnimationPreventedRef = React.useRef(isOpen);
96
+ const originalStylesRef = React.useRef(void 0);
97
+ React.useEffect(() => {
98
+ const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
99
+ return () => cancelAnimationFrame(rAF);
100
+ }, []);
101
+ useLayoutEffect2(() => {
102
+ const node = ref.current;
103
+ if (node) {
104
+ originalStylesRef.current = originalStylesRef.current || {
105
+ transitionDuration: node.style.transitionDuration,
106
+ animationName: node.style.animationName
107
+ };
108
+ node.style.transitionDuration = "0s";
109
+ node.style.animationName = "none";
110
+ const rect = node.getBoundingClientRect();
111
+ heightRef.current = rect.height;
112
+ widthRef.current = rect.width;
113
+ if (!isMountAnimationPreventedRef.current) {
114
+ node.style.transitionDuration = originalStylesRef.current.transitionDuration;
115
+ node.style.animationName = originalStylesRef.current.animationName;
116
+ }
117
+ setIsPresent(present);
118
+ }
119
+ }, [context.open, present]);
120
+ return /* @__PURE__ */ jsx(
121
+ Primitive.div,
122
+ {
123
+ "data-state": getState(context.open),
124
+ "data-disabled": context.disabled ? "" : void 0,
125
+ id: context.contentId,
126
+ hidden: !isOpen,
127
+ ...contentProps,
128
+ ref: composedRefs,
129
+ style: {
130
+ [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,
131
+ [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,
132
+ ...props.style
133
+ },
134
+ children: isOpen && children
135
+ }
136
+ );
137
+ });
138
+ function getState(open) {
139
+ return open ? "open" : "closed";
140
+ }
141
+ var Root = Collapsible;
142
+ var Trigger = CollapsibleTrigger;
143
+ var Content = CollapsibleContent;
144
+
145
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger, Content, Root, Trigger, createCollapsibleScope };
146
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../../../node_modules/.pnpm/@radix-ui+react-collapsible@1.1.8_@types+react-dom@19.2.1_@types+react@19.1.17__@types+_d84e28844e8116e61b459b615fab358a/node_modules/@radix-ui/react-collapsible/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collapsible.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { jsx } from \"react/jsx-runtime\";\nvar COLLAPSIBLE_NAME = \"Collapsible\";\nvar [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);\nvar [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);\nvar Collapsible = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeCollapsible,\n open: openProp,\n defaultOpen,\n disabled,\n onOpenChange,\n ...collapsibleProps\n } = props;\n const [open, setOpen] = useControllableState({\n prop: openProp,\n defaultProp: defaultOpen ?? false,\n onChange: onOpenChange,\n caller: COLLAPSIBLE_NAME\n });\n return /* @__PURE__ */ jsx(\n CollapsibleProvider,\n {\n scope: __scopeCollapsible,\n disabled,\n contentId: useId(),\n open,\n onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(open),\n \"data-disabled\": disabled ? \"\" : void 0,\n ...collapsibleProps,\n ref: forwardedRef\n }\n )\n }\n );\n }\n);\nCollapsible.displayName = COLLAPSIBLE_NAME;\nvar TRIGGER_NAME = \"CollapsibleTrigger\";\nvar CollapsibleTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeCollapsible, ...triggerProps } = props;\n const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);\n return /* @__PURE__ */ jsx(\n Primitive.button,\n {\n type: \"button\",\n \"aria-controls\": context.contentId,\n \"aria-expanded\": context.open || false,\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n disabled: context.disabled,\n ...triggerProps,\n ref: forwardedRef,\n onClick: composeEventHandlers(props.onClick, context.onOpenToggle)\n }\n );\n }\n);\nCollapsibleTrigger.displayName = TRIGGER_NAME;\nvar CONTENT_NAME = \"CollapsibleContent\";\nvar CollapsibleContent = React.forwardRef(\n (props, forwardedRef) => {\n const { forceMount, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);\n return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: ({ present }) => /* @__PURE__ */ jsx(CollapsibleContentImpl, { ...contentProps, ref: forwardedRef, present }) });\n }\n);\nCollapsibleContent.displayName = CONTENT_NAME;\nvar CollapsibleContentImpl = React.forwardRef((props, forwardedRef) => {\n const { __scopeCollapsible, present, children, ...contentProps } = props;\n const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);\n const [isPresent, setIsPresent] = React.useState(present);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const heightRef = React.useRef(0);\n const height = heightRef.current;\n const widthRef = React.useRef(0);\n const width = widthRef.current;\n const isOpen = context.open || isPresent;\n const isMountAnimationPreventedRef = React.useRef(isOpen);\n const originalStylesRef = React.useRef(void 0);\n React.useEffect(() => {\n const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);\n return () => cancelAnimationFrame(rAF);\n }, []);\n useLayoutEffect(() => {\n const node = ref.current;\n if (node) {\n originalStylesRef.current = originalStylesRef.current || {\n transitionDuration: node.style.transitionDuration,\n animationName: node.style.animationName\n };\n node.style.transitionDuration = \"0s\";\n node.style.animationName = \"none\";\n const rect = node.getBoundingClientRect();\n heightRef.current = rect.height;\n widthRef.current = rect.width;\n if (!isMountAnimationPreventedRef.current) {\n node.style.transitionDuration = originalStylesRef.current.transitionDuration;\n node.style.animationName = originalStylesRef.current.animationName;\n }\n setIsPresent(present);\n }\n }, [context.open, present]);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getState(context.open),\n \"data-disabled\": context.disabled ? \"\" : void 0,\n id: context.contentId,\n hidden: !isOpen,\n ...contentProps,\n ref: composedRefs,\n style: {\n [`--radix-collapsible-content-height`]: height ? `${height}px` : void 0,\n [`--radix-collapsible-content-width`]: width ? `${width}px` : void 0,\n ...props.style\n },\n children: isOpen && children\n }\n );\n});\nfunction getState(open) {\n return open ? \"open\" : \"closed\";\n}\nvar Root = Collapsible;\nvar Trigger = CollapsibleTrigger;\nvar Content = CollapsibleContent;\nexport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n Content,\n Root,\n Trigger,\n createCollapsibleScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;;;;;;;;;AAaA,IAAI,gBAAgB,GAAG,aAAa;AACjC,IAAC,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,GAAG,kBAAkB,CAAC,gBAAgB;AAC5F,IAAI,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GAAG,wBAAwB,CAAC,gBAAgB,CAAC;AAC1F,IAAC,WAAW,GAAG,KAAK,CAAC,UAAU;AAClC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK;AAC3B,IAAI,MAAM;AACV,MAAM,kBAAkB;AACxB,MAAM,IAAI,EAAE,QAAQ;AACpB,MAAM,WAAW;AACjB,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAM,GAAG;AACT,KAAK,GAAG,KAAK;AACb,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,oBAAoB,CAAC;AACjD,MAAM,IAAI,EAAE,QAAQ;AACpB,MAAM,WAAW,EAAE,WAAW,IAAI,KAAK;AACvC,MAAM,QAAQ,EAAE,YAAY;AAC5B,MAAM,MAAM,EAAE;AACd,KAAK,CAAC;AACN,IAAI,uBAAuB,GAAG;AAC9B,MAAM,mBAAmB;AACzB,MAAM;AACN,QAAQ,KAAK,EAAE,kBAAkB;AACjC,QAAQ,QAAQ;AAChB,QAAQ,SAAS,EAAE,KAAK,EAAE;AAC1B,QAAQ,IAAI;AACZ,QAAQ,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM,OAAO,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAC1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AC;AAC3B,IAAI;AACJ,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7B,EAAE,uBAAuB,GAAG;AAC5B,IAAI,SAAS,CAAC,GAAG;AACjB,IAAI;AACJ,MAAM,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;AAC1C,MAAM,eAAe,EAAE,OAAO,CAAC,QAAQ,GAAG,EAAE,GAAG,MAAM;AACrD,MAAM,EAAE,EAAE,OAAO,CAAC,SAAS;AAC3B,MAAM,MAAM,EAAE,CAAC,MAAM;AACrB,MAAM,GAAG,YAAY;AACrB,MAAM,GAAG,EAAE,YAAY;AACvB,MAAM,KAAK,EAAE;AACb,QAAQ,CAAC,CAAC,kCAAkC,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM;AAC/E,QAAQ,CAAC,CAAC,iCAAiC,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,MAAM;AAC5E,QAAQ,GAAG,KAAK,CAAC;AACjB,OAAO;AACP,MAAM,QAAQ,EAAE,MAAM,IAAI;AAC1B;AACA,GAAG;AACH,CAAC,CAAC;AACF,SAAS,QAAQ,CAAC,IAAI,EAAE;AACxB,EAAE,OAAO,IAAI,GAAG,MAAM,GAAG,QAAQ;AACjC;AACG,IAAC,IAAI,GAAG;AACR,IAAC,OAAO,GAAG;AACX,IAAC,OAAO,GAAG;;;;","x_google_ignoreList":[0]}
@@ -0,0 +1,71 @@
1
+ import React__default from 'react';
2
+ import { createContextScope } from '../../../../../@radix-ui_react-context@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js';
3
+ import { useComposedRefs } from '../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js';
4
+ import { createSlot } from '../../../../../@radix-ui_react-slot@1.2.0_@types_react@19.1.17_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ function createCollection(name) {
8
+ const PROVIDER_NAME = name + "CollectionProvider";
9
+ const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
10
+ const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
11
+ PROVIDER_NAME,
12
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
13
+ );
14
+ const CollectionProvider = (props) => {
15
+ const { scope, children } = props;
16
+ const ref = React__default.useRef(null);
17
+ const itemMap = React__default.useRef(/* @__PURE__ */ new Map()).current;
18
+ return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
19
+ };
20
+ CollectionProvider.displayName = PROVIDER_NAME;
21
+ const COLLECTION_SLOT_NAME = name + "CollectionSlot";
22
+ const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
23
+ const CollectionSlot = React__default.forwardRef(
24
+ (props, forwardedRef) => {
25
+ const { scope, children } = props;
26
+ const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
27
+ const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
28
+ return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
29
+ }
30
+ );
31
+ CollectionSlot.displayName = COLLECTION_SLOT_NAME;
32
+ const ITEM_SLOT_NAME = name + "CollectionItemSlot";
33
+ const ITEM_DATA_ATTR = "data-radix-collection-item";
34
+ const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
35
+ const CollectionItemSlot = React__default.forwardRef(
36
+ (props, forwardedRef) => {
37
+ const { scope, children, ...itemData } = props;
38
+ const ref = React__default.useRef(null);
39
+ const composedRefs = useComposedRefs(forwardedRef, ref);
40
+ const context = useCollectionContext(ITEM_SLOT_NAME, scope);
41
+ React__default.useEffect(() => {
42
+ context.itemMap.set(ref, { ref, ...itemData });
43
+ return () => void context.itemMap.delete(ref);
44
+ });
45
+ return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
46
+ }
47
+ );
48
+ CollectionItemSlot.displayName = ITEM_SLOT_NAME;
49
+ function useCollection(scope) {
50
+ const context = useCollectionContext(name + "CollectionConsumer", scope);
51
+ const getItems = React__default.useCallback(() => {
52
+ const collectionNode = context.collectionRef.current;
53
+ if (!collectionNode) return [];
54
+ const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
55
+ const items = Array.from(context.itemMap.values());
56
+ const orderedItems = items.sort(
57
+ (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
58
+ );
59
+ return orderedItems;
60
+ }, [context.collectionRef, context.itemMap]);
61
+ return getItems;
62
+ }
63
+ return [
64
+ { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
65
+ useCollection,
66
+ createCollectionScope
67
+ ];
68
+ }
69
+
70
+ export { createCollection };
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../../../../../../../node_modules/.pnpm/@radix-ui+react-collection@1.1.4_@types+react-dom@19.2.1_@types+react@19.1.17__@types+r_7047fbfe61c39c77a2126486502acdb6/node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["React"],"mappings":";;;;;;AAQA,SAAS,gBAAgB,CAAC,IAAI,EAAE;AAChC,EAAE,MAAM,aAAa,GAAG,IAAI,GAAG,oBAAoB;AACnD,EAAE,MAAM,CAAC,uBAAuB,EAAE,qBA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