@yoopta/themes-shadcn 6.0.1 → 6.0.3

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 (190) hide show
  1. package/dist/accordion.js +1 -1
  2. package/dist/applyTheme.d.ts.map +1 -1
  3. package/dist/carousel.js +1 -1
  4. package/dist/chunks/button-f335deaa.js +1 -0
  5. package/dist/chunks/{dropdown-menu-eb328f8d.js → dropdown-menu-36750aec.js} +3 -3
  6. package/dist/chunks/{hover-card-d6a71398.js → hover-card-8048e9ce.js} +1 -1
  7. package/dist/chunks/index-371259c9.js +1 -0
  8. package/dist/chunks/{index-f85dae42.js → index-5b487f4e.js} +1 -1
  9. package/dist/chunks/{index-ba3032f8.js → index-a77c7d53.js} +1 -1
  10. package/dist/chunks/{index-23db6fea.js → index-bd6363d4.js} +1 -1
  11. package/dist/chunks/label-35a74462.js +1 -0
  12. package/dist/chunks/{language-select-89735035.js → language-select-ee2698cf.js} +1 -1
  13. package/dist/chunks/pen-d6258303.js +7 -0
  14. package/dist/chunks/popover-dae0ce5f.js +1 -0
  15. package/dist/chunks/{scroll-area-dae47c2c.js → scroll-area-8321348a.js} +1 -1
  16. package/dist/chunks/{select-a8bcd8b5.js → select-a3724728.js} +1 -1
  17. package/dist/chunks/separator-f4e74aca.js +1 -0
  18. package/dist/chunks/{tabs-294764a6.js → tabs-370c3f2c.js} +1 -1
  19. package/dist/chunks/{tooltip-65b9c3a0.js → tooltip-5defff1d.js} +2 -2
  20. package/dist/code-group.js +1 -1
  21. package/dist/code.js +1 -1
  22. package/dist/divider.js +1 -1
  23. package/dist/embed/elements/embed/embed-element.d.ts +1 -1
  24. package/dist/embed/elements/embed/embed-element.d.ts.map +1 -1
  25. package/dist/embed/elements/embed/embed-inline-toolbar.d.ts.map +1 -1
  26. package/dist/embed/elements/embed/embed-render.d.ts.map +1 -1
  27. package/dist/embed/index.d.ts +1 -1
  28. package/dist/embed.js +2 -2
  29. package/dist/emoji.js +1 -1
  30. package/dist/file/elements/file/file-element.d.ts +1 -1
  31. package/dist/file/elements/file/file-element.d.ts.map +1 -1
  32. package/dist/file/elements/file/file-inline-toolbar.d.ts.map +1 -1
  33. package/dist/file/index.d.ts +1 -1
  34. package/dist/file.js +3 -3
  35. package/dist/image/elements/image/image-element.d.ts +1 -1
  36. package/dist/image/elements/image/image-element.d.ts.map +1 -1
  37. package/dist/image/elements/image/image-inline-toolbar.d.ts.map +1 -1
  38. package/dist/image/elements/image/image-render.d.ts.map +1 -1
  39. package/dist/image/index.d.ts +1 -1
  40. package/dist/image.js +2 -2
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/link.js +1 -7
  45. package/dist/math/elements/math/math-edit.d.ts +13 -0
  46. package/dist/math/elements/math/math-edit.d.ts.map +1 -0
  47. package/dist/math/elements/math/math-element.d.ts +3 -0
  48. package/dist/math/elements/math/math-element.d.ts.map +1 -0
  49. package/dist/math/elements/math/math-preview.d.ts +10 -0
  50. package/dist/math/elements/math/math-preview.d.ts.map +1 -0
  51. package/dist/math/elements/math-block/math-block-element.d.ts +3 -0
  52. package/dist/math/elements/math-block/math-block-element.d.ts.map +1 -0
  53. package/dist/math/index.d.ts +15 -0
  54. package/dist/math/index.d.ts.map +1 -0
  55. package/dist/math.js +1 -0
  56. package/dist/mention.js +3 -3
  57. package/dist/steps/elements/steps-list-item.d.ts.map +1 -1
  58. package/dist/steps.js +1 -1
  59. package/dist/table-of-contents/elements/table-of-contents.d.ts.map +1 -1
  60. package/dist/table-of-contents.js +1 -1
  61. package/dist/table.js +3 -3
  62. package/dist/tabs.js +1 -1
  63. package/dist/video/elements/video/video-element.d.ts +1 -1
  64. package/dist/video/elements/video/video-element.d.ts.map +1 -1
  65. package/dist/video/elements/video/video-inline-toolbar.d.ts.map +1 -1
  66. package/dist/video/elements/video/video-render.d.ts.map +1 -1
  67. package/dist/video/index.d.ts +1 -1
  68. package/dist/video.js +2 -2
  69. package/package.json +21 -14
  70. package/dist/accordion.js.map +0 -1
  71. package/dist/blockquote.js.map +0 -1
  72. package/dist/callout.js.map +0 -1
  73. package/dist/carousel.js.map +0 -1
  74. package/dist/chunks/Combination-3c924518.js +0 -1080
  75. package/dist/chunks/Combination-3c924518.js.map +0 -1
  76. package/dist/chunks/_tslib-514d60fe.js +0 -67
  77. package/dist/chunks/_tslib-514d60fe.js.map +0 -1
  78. package/dist/chunks/arrow-right-5ddace59.js +0 -30
  79. package/dist/chunks/arrow-right-5ddace59.js.map +0 -1
  80. package/dist/chunks/button-27a1fbc2.js +0 -76
  81. package/dist/chunks/button-27a1fbc2.js.map +0 -1
  82. package/dist/chunks/button-7aec29d6.js +0 -1
  83. package/dist/chunks/card-12ed876a.js +0 -38
  84. package/dist/chunks/card-12ed876a.js.map +0 -1
  85. package/dist/chunks/check-9acc031a.js +0 -14
  86. package/dist/chunks/check-9acc031a.js.map +0 -1
  87. package/dist/chunks/chevron-down-7424d0c3.js +0 -16
  88. package/dist/chunks/chevron-down-7424d0c3.js.map +0 -1
  89. package/dist/chunks/chevron-up-546faa64.js +0 -14
  90. package/dist/chunks/chevron-up-546faa64.js.map +0 -1
  91. package/dist/chunks/code-5407bf8e.js +0 -17
  92. package/dist/chunks/code-5407bf8e.js.map +0 -1
  93. package/dist/chunks/createLucideIcon-6ba35914.js +0 -56
  94. package/dist/chunks/createLucideIcon-6ba35914.js.map +0 -1
  95. package/dist/chunks/dropdown-menu-9ba446af.js +0 -1250
  96. package/dist/chunks/dropdown-menu-9ba446af.js.map +0 -1
  97. package/dist/chunks/external-link-1bf3c7a2.js +0 -18
  98. package/dist/chunks/external-link-1bf3c7a2.js.map +0 -1
  99. package/dist/chunks/file-text-9e348575.js +0 -23
  100. package/dist/chunks/file-text-9e348575.js.map +0 -1
  101. package/dist/chunks/hover-card-22a4067b.js +0 -258
  102. package/dist/chunks/hover-card-22a4067b.js.map +0 -1
  103. package/dist/chunks/index-0c94b090.js +0 -222
  104. package/dist/chunks/index-0c94b090.js.map +0 -1
  105. package/dist/chunks/index-12e7c5fd.js +0 -155
  106. package/dist/chunks/index-12e7c5fd.js.map +0 -1
  107. package/dist/chunks/index-23c7fb16.js +0 -1
  108. package/dist/chunks/index-26994c9d.js +0 -131
  109. package/dist/chunks/index-26994c9d.js.map +0 -1
  110. package/dist/chunks/index-600be8f8.js +0 -190
  111. package/dist/chunks/index-600be8f8.js.map +0 -1
  112. package/dist/chunks/index-7e966ec9.js +0 -16
  113. package/dist/chunks/index-7e966ec9.js.map +0 -1
  114. package/dist/chunks/index-9ac5afe2.js +0 -201
  115. package/dist/chunks/index-9ac5afe2.js.map +0 -1
  116. package/dist/chunks/index-9bb7ddb4.js +0 -104
  117. package/dist/chunks/index-9bb7ddb4.js.map +0 -1
  118. package/dist/chunks/index-ae9b48d5.js +0 -12
  119. package/dist/chunks/index-ae9b48d5.js.map +0 -1
  120. package/dist/chunks/index-b26053ec.js +0 -3805
  121. package/dist/chunks/index-b26053ec.js.map +0 -1
  122. package/dist/chunks/index-b8f2908d.js +0 -40
  123. package/dist/chunks/index-b8f2908d.js.map +0 -1
  124. package/dist/chunks/index-c655a86f.js +0 -7
  125. package/dist/chunks/index-c655a86f.js.map +0 -1
  126. package/dist/chunks/index-d9171717.js +0 -13
  127. package/dist/chunks/index-d9171717.js.map +0 -1
  128. package/dist/chunks/index-e42d0aaf.js +0 -36
  129. package/dist/chunks/index-e42d0aaf.js.map +0 -1
  130. package/dist/chunks/index-ebc47eac.js +0 -2765
  131. package/dist/chunks/index-ebc47eac.js.map +0 -1
  132. package/dist/chunks/index-ffe23855.js +0 -71
  133. package/dist/chunks/index-ffe23855.js.map +0 -1
  134. package/dist/chunks/input-7c5e4260.js +0 -13
  135. package/dist/chunks/input-7c5e4260.js.map +0 -1
  136. package/dist/chunks/label-21d46c31.js +0 -1
  137. package/dist/chunks/label-2a076b3f.js +0 -70
  138. package/dist/chunks/label-2a076b3f.js.map +0 -1
  139. package/dist/chunks/language-select-b35256ab.js +0 -12
  140. package/dist/chunks/language-select-b35256ab.js.map +0 -1
  141. package/dist/chunks/play-c2a06e4e.js +0 -16
  142. package/dist/chunks/play-c2a06e4e.js.map +0 -1
  143. package/dist/chunks/plus-f36f52e8.js +0 -17
  144. package/dist/chunks/plus-f36f52e8.js.map +0 -1
  145. package/dist/chunks/popover-4b5c0941.js +0 -385
  146. package/dist/chunks/popover-4b5c0941.js.map +0 -1
  147. package/dist/chunks/popover-8e6ee2ab.js +0 -1
  148. package/dist/chunks/scroll-area-8dc03d8f.js +0 -727
  149. package/dist/chunks/scroll-area-8dc03d8f.js.map +0 -1
  150. package/dist/chunks/select-88f1b66c.js +0 -1281
  151. package/dist/chunks/select-88f1b66c.js.map +0 -1
  152. package/dist/chunks/separator-219dc1f7.js +0 -1
  153. package/dist/chunks/separator-a6b3e5d2.js +0 -74
  154. package/dist/chunks/separator-a6b3e5d2.js.map +0 -1
  155. package/dist/chunks/settings-2-8e53118c.js +0 -19
  156. package/dist/chunks/settings-2-8e53118c.js.map +0 -1
  157. package/dist/chunks/sparkles-a0316be3.js +0 -26
  158. package/dist/chunks/sparkles-a0316be3.js.map +0 -1
  159. package/dist/chunks/style-inject.es-746bb8ed.js +0 -29
  160. package/dist/chunks/style-inject.es-746bb8ed.js.map +0 -1
  161. package/dist/chunks/tabs-38ee85c4.js +0 -205
  162. package/dist/chunks/tabs-38ee85c4.js.map +0 -1
  163. package/dist/chunks/tooltip-eb8a0f63.js +0 -1671
  164. package/dist/chunks/tooltip-eb8a0f63.js.map +0 -1
  165. package/dist/chunks/trash-2-41ddec45.js +0 -20
  166. package/dist/chunks/trash-2-41ddec45.js.map +0 -1
  167. package/dist/chunks/upload-b987996c.js +0 -44
  168. package/dist/chunks/upload-b987996c.js.map +0 -1
  169. package/dist/chunks/utils-208f599b.js +0 -2500
  170. package/dist/chunks/utils-208f599b.js.map +0 -1
  171. package/dist/chunks/x-f7edc87d.js +0 -17
  172. package/dist/chunks/x-f7edc87d.js.map +0 -1
  173. package/dist/code-group.js.map +0 -1
  174. package/dist/code.js.map +0 -1
  175. package/dist/divider.js.map +0 -1
  176. package/dist/embed.js.map +0 -1
  177. package/dist/emoji.js.map +0 -1
  178. package/dist/file.js.map +0 -1
  179. package/dist/headings.js.map +0 -1
  180. package/dist/image.js.map +0 -1
  181. package/dist/index.js.map +0 -1
  182. package/dist/link.js.map +0 -1
  183. package/dist/lists.js.map +0 -1
  184. package/dist/mention.js.map +0 -1
  185. package/dist/paragraph.js.map +0 -1
  186. package/dist/steps.js.map +0 -1
  187. package/dist/table-of-contents.js.map +0 -1
  188. package/dist/table.js.map +0 -1
  189. package/dist/tabs.js.map +0 -1
  190. package/dist/video.js.map +0 -1
@@ -1,155 +0,0 @@
1
- import * as React from 'react';
2
- import React__default from 'react';
3
- import { c as createContextScope } from './index-9ac5afe2.js';
4
- import { c as composeRefs, u as useComposedRefs } from './index-b8f2908d.js';
5
- import { jsx } from 'react/jsx-runtime';
6
-
7
- // src/slot.tsx
8
- // @__NO_SIDE_EFFECTS__
9
- function createSlot(ownerName) {
10
- const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
11
- const Slot2 = React.forwardRef((props, forwardedRef) => {
12
- const { children, ...slotProps } = props;
13
- const childrenArray = React.Children.toArray(children);
14
- const slottable = childrenArray.find(isSlottable);
15
- if (slottable) {
16
- const newElement = slottable.props.children;
17
- const newChildren = childrenArray.map((child) => {
18
- if (child === slottable) {
19
- if (React.Children.count(newElement) > 1) return React.Children.only(null);
20
- return React.isValidElement(newElement) ? newElement.props.children : null;
21
- } else {
22
- return child;
23
- }
24
- });
25
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
26
- }
27
- return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
28
- });
29
- Slot2.displayName = `${ownerName}.Slot`;
30
- return Slot2;
31
- }
32
- // @__NO_SIDE_EFFECTS__
33
- function createSlotClone(ownerName) {
34
- const SlotClone = React.forwardRef((props, forwardedRef) => {
35
- const { children, ...slotProps } = props;
36
- if (React.isValidElement(children)) {
37
- const childrenRef = getElementRef(children);
38
- const props2 = mergeProps(slotProps, children.props);
39
- if (children.type !== React.Fragment) {
40
- props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
41
- }
42
- return React.cloneElement(children, props2);
43
- }
44
- return React.Children.count(children) > 1 ? React.Children.only(null) : null;
45
- });
46
- SlotClone.displayName = `${ownerName}.SlotClone`;
47
- return SlotClone;
48
- }
49
- var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
50
- function isSlottable(child) {
51
- return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
52
- }
53
- function mergeProps(slotProps, childProps) {
54
- const overrideProps = { ...childProps };
55
- for (const propName in childProps) {
56
- const slotPropValue = slotProps[propName];
57
- const childPropValue = childProps[propName];
58
- const isHandler = /^on[A-Z]/.test(propName);
59
- if (isHandler) {
60
- if (slotPropValue && childPropValue) {
61
- overrideProps[propName] = (...args) => {
62
- const result = childPropValue(...args);
63
- slotPropValue(...args);
64
- return result;
65
- };
66
- } else if (slotPropValue) {
67
- overrideProps[propName] = slotPropValue;
68
- }
69
- } else if (propName === "style") {
70
- overrideProps[propName] = { ...slotPropValue, ...childPropValue };
71
- } else if (propName === "className") {
72
- overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
73
- }
74
- }
75
- return { ...slotProps, ...overrideProps };
76
- }
77
- function getElementRef(element) {
78
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
79
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
80
- if (mayWarn) {
81
- return element.ref;
82
- }
83
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
84
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
85
- if (mayWarn) {
86
- return element.props.ref;
87
- }
88
- return element.props.ref || element.ref;
89
- }
90
-
91
- function createCollection(name) {
92
- const PROVIDER_NAME = name + "CollectionProvider";
93
- const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);
94
- const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
95
- PROVIDER_NAME,
96
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
97
- );
98
- const CollectionProvider = (props) => {
99
- const { scope, children } = props;
100
- const ref = React__default.useRef(null);
101
- const itemMap = React__default.useRef(/* @__PURE__ */ new Map()).current;
102
- return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
103
- };
104
- CollectionProvider.displayName = PROVIDER_NAME;
105
- const COLLECTION_SLOT_NAME = name + "CollectionSlot";
106
- const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
107
- const CollectionSlot = React__default.forwardRef(
108
- (props, forwardedRef) => {
109
- const { scope, children } = props;
110
- const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
111
- const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
112
- return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
113
- }
114
- );
115
- CollectionSlot.displayName = COLLECTION_SLOT_NAME;
116
- const ITEM_SLOT_NAME = name + "CollectionItemSlot";
117
- const ITEM_DATA_ATTR = "data-radix-collection-item";
118
- const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
119
- const CollectionItemSlot = React__default.forwardRef(
120
- (props, forwardedRef) => {
121
- const { scope, children, ...itemData } = props;
122
- const ref = React__default.useRef(null);
123
- const composedRefs = useComposedRefs(forwardedRef, ref);
124
- const context = useCollectionContext(ITEM_SLOT_NAME, scope);
125
- React__default.useEffect(() => {
126
- context.itemMap.set(ref, { ref, ...itemData });
127
- return () => void context.itemMap.delete(ref);
128
- });
129
- return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: "" }, ref: composedRefs, children });
130
- }
131
- );
132
- CollectionItemSlot.displayName = ITEM_SLOT_NAME;
133
- function useCollection(scope) {
134
- const context = useCollectionContext(name + "CollectionConsumer", scope);
135
- const getItems = React__default.useCallback(() => {
136
- const collectionNode = context.collectionRef.current;
137
- if (!collectionNode) return [];
138
- const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
139
- const items = Array.from(context.itemMap.values());
140
- const orderedItems = items.sort(
141
- (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
142
- );
143
- return orderedItems;
144
- }, [context.collectionRef, context.itemMap]);
145
- return getItems;
146
- }
147
- return [
148
- { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },
149
- useCollection,
150
- createCollectionScope
151
- ];
152
- }
153
-
154
- export { createCollection as c };
155
- //# sourceMappingURL=index-12e7c5fd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-12e7c5fd.js","sources":["../../../../../node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/src/slot.tsx","../../../../../node_modules/@radix-ui/react-collection/src/collection-legacy.tsx"],"sourcesContent":["import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable('Slottable');\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(\n child: React.ReactNode\n): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) &&\n typeof child.type === 'function' &&\n '__radixId' in child.type &&\n child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n // all child props should override\n const overrideProps = { ...childProps };\n\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n }\n // but if it exists only on the slot, we use only this one\n else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n }\n // if it's `style`, we merge them\n else if (propName === 'style') {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === 'className') {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n\n // Not DEV\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n\nexport {\n Slot,\n Slottable,\n //\n Slot as Root,\n};\nexport type { SlotProps };\n","import React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createSlot, type Slot } from '@radix-ui/react-slot';\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\n\nfunction createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionRef: React.RefObject<CollectionElement | null>;\n itemMap: Map<\n React.RefObject<ItemElement | null>,\n { ref: React.RefObject<ItemElement | null> } & ItemData\n >;\n };\n\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: new Map() }\n );\n\n const CollectionProvider: React.FC<{ children?: React.ReactNode; scope: any }> = (props) => {\n const { scope, children } = props;\n const ref = React.useRef<CollectionElement>(null);\n const itemMap = React.useRef<ContextValue['itemMap']>(new Map()).current;\n return (\n <CollectionProviderImpl scope={scope} itemMap={itemMap} collectionRef={ref}>\n {children}\n </CollectionProviderImpl>\n );\n };\n\n CollectionProvider.displayName = PROVIDER_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\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 <CollectionSlotImpl ref={composedRefs}>{children}</CollectionSlotImpl>;\n }\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...(itemData as unknown as ItemData) });\n return () => void context.itemMap.delete(ref);\n });\n\n return (\n <CollectionItemSlotImpl {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs}>\n {children}\n </CollectionItemSlotImpl>\n );\n }\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n\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\n return getItems;\n }\n\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope,\n ] as const;\n}\n\nexport { createCollection };\nexport type { CollectionProps };\n"],"names":["Slot","props","React"],"mappings":";;;;;;;AAoCQ;AAzB0B,SAAS,WAAW,SAAmB,EAAA;AACvE,EAAM,MAAA,SAAA,mCAA4B,SAAS,CAAA,CAAA;AAC3C,EAAA,MAAMA,KAAa,GAAA,KAAA,CAAA,UAAA,CAAmC,CAAC,KAAA,EAAO,YAAiB,KAAA;AAC7E,IAAA,MAAM,EAAE,QAAA,EAAU,GAAG,SAAA,EAAc,GAAA,KAAA,CAAA;AACnC,IAAM,MAAA,aAAA,GAAsB,KAAS,CAAA,QAAA,CAAA,OAAA,CAAQ,QAAQ,CAAA,CAAA;AACrD,IAAM,MAAA,SAAA,GAAY,aAAc,CAAA,IAAA,CAAK,WAAW,CAAA,CAAA;AAEhD,IAAA,IAAI,SAAW,EAAA;AAEb,MAAM,MAAA,UAAA,GAAa,UAAU,KAAM,CAAA,QAAA,CAAA;AAEnC,MAAA,MAAM,WAAc,GAAA,aAAA,CAAc,GAAI,CAAA,CAAC,KAAU,KAAA;AAC/C,QAAA,IAAI,UAAU,SAAW,EAAA;AAGvB,UAAU,IAAA,KAAA,CAAA,QAAA,CAAS,MAAM,UAAU,CAAA,GAAI,GAAgB,OAAA,KAAA,CAAA,QAAA,CAAS,KAAK,IAAI,CAAA,CAAA;AACzE,UAAA,OAAa,KAAe,CAAA,cAAA,CAAA,UAAU,CACjC,GAAA,UAAA,CAAW,MAAwC,QACpD,GAAA,IAAA,CAAA;AAAA,SACC,MAAA;AACL,UAAO,OAAA,KAAA,CAAA;AAAA,SACT;AAAA,OACD,CAAA,CAAA;AAED,MAAA,uBACG,GAAA,CAAA,SAAA,EAAA,EAAW,GAAG,SAAA,EAAW,KAAK,YAC5B,EAAA,QAAA,EAAM,KAAe,CAAA,cAA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,OAAO,EAAC,CAAA;AAC7B,MAAM,MAAA,YAAA,GAAe,MAAM,IAAK,CAAA,cAAA,CAAe,iBAAiB,CAAI,CAAA,EAAA,cAAc,GAAG,CAAC,CAAA,CAAA;AACtF,MAAA,MAAM,QAAQ,KAAM,CAAA,IAAA,CAAK,OAAQ,CAAA,OAAA,CAAQ,QAAQ,CAAA,CAAA;AACjD,MAAA,MAAM,eAAe,KAAM,CAAA,IAAA;AAAA,QACzB,CAAC,CAAA,EAAG,CAAM,KAAA,YAAA,CAAa,OAAQ,CAAA,CAAA,CAAE,GAAI,CAAA,OAAQ,CAAI,GAAA,YAAA,CAAa,OAAQ,CAAA,CAAA,CAAE,IAAI,OAAQ,CAAA;AAAA,OACtF,CAAA;AACA,MAAO,OAAA,YAAA,CAAA;AAAA,OACN,CAAC,OAAA,CAAQ,aAAe,EAAA,OAAA,CAAQ,OAAO,CAAC,CAAA,CAAA;AAE3C,IAAO,OAAA,QAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA;AAAA,IACL,EAAE,QAAU,EAAA,kBAAA,EAAoB,IAAM,EAAA,cAAA,EAAgB,UAAU,kBAAmB,EAAA;AAAA,IACnF,aAAA;AAAA,IACA,qBAAA;AAAA,GACF,CAAA;AACF;;;;","x_google_ignoreList":[0,1]}
@@ -1 +0,0 @@
1
- import*as e from"react";import{useLayoutEffect as t}from"react";import{P as n,a as r,d as o,u as i,c as s}from"./index-17323747.js";import{u as a}from"./index-91a5b8d5.js";import{u as l}from"./index-70f4e709.js";import{jsx as c}from"react/jsx-runtime";import*as f from"react-dom";import u from"react-dom";var d,p="dismissableLayer.update",m="dismissableLayer.pointerDownOutside",h="dismissableLayer.focusOutside",g=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),y=e.forwardRef((t,o)=>{const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:y,onDismiss:x,...b}=t,E=e.useContext(g),[R,P]=e.useState(null),A=R?.ownerDocument??globalThis?.document,[,O]=e.useState({}),S=a(o,e=>P(e)),L=Array.from(E.layers),[C]=[...E.layersWithOutsidePointerEventsDisabled].slice(-1),D=L.indexOf(C),T=R?L.indexOf(R):-1,k=E.layersWithOutsidePointerEventsDisabled.size>0,W=T>=D,F=function(t,n=globalThis?.document){const r=l(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){v(m,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...E.branches].some(e=>e.contains(t));W&&!n&&(f?.(e),y?.(e),e.defaultPrevented||x?.())},A),H=function(t,n=globalThis?.document){const r=l(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){v(h,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...E.branches].some(e=>e.contains(t))||(u?.(e),y?.(e),e.defaultPrevented||x?.())},A);return function(t,n=globalThis?.document){const r=l(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{T===E.layers.size-1&&(s?.(e),!e.defaultPrevented&&x&&(e.preventDefault(),x()))},A),e.useEffect(()=>{if(R)return i&&(0===E.layersWithOutsidePointerEventsDisabled.size&&(d=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),E.layersWithOutsidePointerEventsDisabled.add(R)),E.layers.add(R),w(),()=>{i&&1===E.layersWithOutsidePointerEventsDisabled.size&&(A.body.style.pointerEvents=d)}},[R,A,i,E]),e.useEffect(()=>()=>{R&&(E.layers.delete(R),E.layersWithOutsidePointerEventsDisabled.delete(R),w())},[R,E]),e.useEffect(()=>{const e=()=>O({});return document.addEventListener(p,e),()=>document.removeEventListener(p,e)},[]),c(n.div,{...b,ref:S,style:{pointerEvents:k?W?"auto":"none":void 0,...t.style},onFocusCapture:r(t.onFocusCapture,H.onFocusCapture),onBlurCapture:r(t.onBlurCapture,H.onBlurCapture),onPointerDownCapture:r(t.onPointerDownCapture,F.onPointerDownCapture)})});y.displayName="DismissableLayer";function w(){const e=new CustomEvent(p);document.dispatchEvent(e)}function v(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?o(i,s):i.dispatchEvent(s)}e.forwardRef((t,r)=>{const o=e.useContext(g),i=e.useRef(null),s=a(r,i);return e.useEffect(()=>{const e=i.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),c(n.div,{...t,ref:s})}).displayName="DismissableLayerBranch";const x=["top","right","bottom","left"],b=Math.min,E=Math.max,R=Math.round,P=Math.floor,A=e=>({x:e,y:e}),O={left:"right",right:"left",bottom:"top",top:"bottom"},S={start:"end",end:"start"};function L(e,t,n){return E(e,b(t,n))}function C(e,t){return"function"==typeof e?e(t):e}function D(e){return e.split("-")[0]}function T(e){return e.split("-")[1]}function k(e){return"x"===e?"y":"x"}function W(e){return"y"===e?"height":"width"}const F=new Set(["top","bottom"]);function H(e){return F.has(D(e))?"y":"x"}function B(e){return k(H(e))}function z(e){return e.replace(/start|end/g,e=>S[e])}const M=["left","right"],N=["right","left"],$=["top","bottom"],_=["bottom","top"];function j(e,t,n,r){const o=T(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?N:M:t?M:N;case"left":case"right":return t?$:_;default:return[]}}(D(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(z)))),i}function V(e){return e.replace(/left|right|bottom|top/g,e=>O[e])}function Y(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function I(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function X(e,t,n){let{reference:r,floating:o}=e;const i=H(t),s=B(t),a=W(s),l=D(t),c="y"===i,f=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(T(t)){case"start":p[s]-=d*(n&&c?-1:1);break;case"end":p[s]+=d*(n&&c?-1:1)}return p}async function q(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=C(t,e),m=Y(p),h=a[d?"floating"===u?"reference":"floating":u],g=I(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:l})),y="floating"===u?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},x=I(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(g.top-x.top+m.top)/v.y,bottom:(x.bottom-g.bottom+m.bottom)/v.y,left:(g.left-x.left+m.left)/v.x,right:(x.right-g.right+m.right)/v.x}}function K(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function G(e){return x.some(t=>e[t]>=0)}const J=new Set(["left","top"]);function Q(){return"undefined"!=typeof window}function U(e){return te(e)?(e.nodeName||"").toLowerCase():"#document"}function Z(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ee(e){var t;return null==(t=(te(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function te(e){return!!Q()&&(e instanceof Node||e instanceof Z(e).Node)}function ne(e){return!!Q()&&(e instanceof Element||e instanceof Z(e).Element)}function re(e){return!!Q()&&(e instanceof HTMLElement||e instanceof Z(e).HTMLElement)}function oe(e){return!(!Q()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Z(e).ShadowRoot)}const ie=new Set(["inline","contents"]);function se(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=we(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ie.has(o)}const ae=new Set(["table","td","th"]);function le(e){return ae.has(U(e))}const ce=[":popover-open",":modal"];function fe(e){return ce.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ue=["transform","translate","scale","rotate","perspective"],de=["transform","translate","scale","rotate","perspective","filter"],pe=["paint","layout","strict","content"];function me(e){const t=he(),n=ne(e)?we(e):e;return ue.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||de.some(e=>(n.willChange||"").includes(e))||pe.some(e=>(n.contain||"").includes(e))}function he(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ge=new Set(["html","body","#document"]);function ye(e){return ge.has(U(e))}function we(e){return Z(e).getComputedStyle(e)}function ve(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xe(e){if("html"===U(e))return e;const t=e.assignedSlot||e.parentNode||oe(e)&&e.host||ee(e);return oe(t)?t.host:t}function be(e){const t=xe(e);return ye(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&se(t)?t:be(t)}function Ee(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=be(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Z(o);if(i){const e=Re(s);return t.concat(s,s.visualViewport||[],se(o)?o:[],e&&n?Ee(e):[])}return t.concat(o,Ee(o,[],n))}function Re(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Pe(e){const t=we(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=re(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=R(n)!==i||R(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Ae(e){return ne(e)?e:e.contextElement}function Oe(e){const t=Ae(e);if(!re(t))return A(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pe(t);let s=(i?R(n.width):n.width)/r,a=(i?R(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Se=A(0);function Le(e){const t=Z(e);return he()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Se}function Ce(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ae(e);let s=A(1);t&&(r?ne(r)&&(s=Oe(r)):s=Oe(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Z(e))&&t}(i,n,r)?Le(i):A(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,f=o.width/s.x,u=o.height/s.y;if(i){const e=Z(i),t=r&&ne(r)?Z(r):r;let n=e,o=Re(n);for(;o&&r&&t!==n;){const e=Oe(o),t=o.getBoundingClientRect(),r=we(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,f*=e.x,u*=e.y,l+=i,c+=s,n=Z(o),o=Re(n)}}return I({width:f,height:u,x:l,y:c})}function De(e,t){const n=ve(e).scrollLeft;return t?t.left+n:Ce(ee(e)).left+n}function Te(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-De(e,n),y:n.top+t.scrollTop}}const ke=new Set(["absolute","fixed"]);function We(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Z(e),r=ee(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=he();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}const c=De(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(r.clientWidth-t.clientWidth-o);s<=25&&(i-=s)}else c<=25&&(i+=c);return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=ee(e),n=ve(e),r=e.ownerDocument.body,o=E(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=E(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+De(e);const a=-n.scrollTop;return"rtl"===we(r).direction&&(s+=E(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(ee(e));else if(ne(t))r=function(e,t){const n=Ce(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=re(e)?Oe(e):A(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Le(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return I(r)}function Fe(e,t){const n=xe(e);return!(n===t||!ne(n)||ye(n))&&("fixed"===we(n).position||Fe(n,t))}function He(e,t,n){const r=re(t),o=ee(t),i="fixed"===n,s=Ce(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=A(0);function c(){l.x=De(o)}if(r||!r&&!i)if(("body"!==U(t)||se(o))&&(a=ve(t)),r){const e=Ce(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const f=!o||r||i?A(0):Te(o,a);return{x:s.left+a.scrollLeft-l.x-f.x,y:s.top+a.scrollTop-l.y-f.y,width:s.width,height:s.height}}function Be(e){return"static"===we(e).position}function ze(e,t){if(!re(e)||"fixed"===we(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ee(e)===n&&(n=n.ownerDocument.body),n}function Me(e,t){const n=Z(e);if(fe(e))return n;if(!re(e)){let t=xe(e);for(;t&&!ye(t);){if(ne(t)&&!Be(t))return t;t=xe(t)}return n}let r=ze(e,t);for(;r&&le(r)&&Be(r);)r=ze(r,t);return r&&ye(r)&&Be(r)&&!me(r)?n:r||function(e){let t=xe(e);for(;re(t)&&!ye(t);){if(me(t))return t;if(fe(t))return null;t=xe(t)}return null}(e)||n}const Ne={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=ee(r),a=!!t&&fe(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=A(1);const f=A(0),u=re(r);if((u||!u&&!i)&&(("body"!==U(r)||se(s))&&(l=ve(r)),re(r))){const e=Ce(r);c=Oe(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}const d=!s||u||i?A(0):Te(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-l.scrollTop*c.y+f.y+d.y}},getDocumentElement:ee,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?fe(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Ee(e,[],!1).filter(e=>ne(e)&&"body"!==U(e)),o=null;const i="fixed"===we(e).position;let s=i?xe(e):e;for(;ne(s)&&!ye(s);){const t=we(s),n=me(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&ke.has(o.position)||se(s)&&!n&&Fe(e,s))?r=r.filter(e=>e!==s):o=t,s=xe(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i[0],a=i.reduce((e,n)=>{const r=We(t,n,o);return e.top=E(r.top,e.top),e.right=b(r.right,e.right),e.bottom=b(r.bottom,e.bottom),e.left=E(r.left,e.left),e},We(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Me,getElementRects:async function(e){const t=this.getOffsetParent||Me,n=this.getDimensions,r=await n(e.floating);return{reference:He(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Pe(e);return{width:t,height:n}},getScale:Oe,isElement:ne,isRTL:function(e){return"rtl"===we(e).direction}};function $e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _e(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Ae(e),f=o||i?[...c?Ee(c):[],...Ee(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const u=c&&a?function(e,t){let n,r=null;const o=ee(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:f,top:u,width:d,height:p}=c;if(a||t(),!d||!p)return;const m={rootMargin:-P(u)+"px "+-P(o.clientWidth-(f+d))+"px "+-P(o.clientHeight-(u+p))+"px "+-P(f)+"px",threshold:E(0,b(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return s();r?s(!1,r):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==r||$e(c,e.getBoundingClientRect())||s(),h=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(c,n):null;let d,p=-1,m=null;s&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let h=l?Ce(e):null;return l&&function t(){const r=Ce(e);h&&!$e(h,r)&&n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==u||u(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const je=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=D(n),a=T(n),l="y"===H(n),c=J.has(s)?-1:1,f=i&&l?-1:1,u=C(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),l?{x:p*f,y:d*c}:{x:d*c,y:p*f}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=C(e,t),f={x:n,y:r},u=await i.detectOverflow(t,c),d=H(D(o)),p=k(d);let m=f[p],h=f[d];if(s){const e="y"===p?"bottom":"right";m=L(m+u["y"===p?"top":"left"],m,m-u[e])}if(a){const e="y"===d?"bottom":"right";h=L(h+u["y"===d?"top":"left"],h,h-u[e])}const g=l.fn({...t,[p]:m,[d]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:s,[d]:a}}}}}},Ye=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=C(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=D(o),w=H(a),v=D(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),b=d||(v||!h?[V(a)]:function(e){const t=V(e);return[z(e),t,z(t)]}(a)),E="none"!==m;!d&&E&&b.push(...j(a,h,m,x));const R=[a,...b],P=await l.detectOverflow(t,g),A=[];let O=(null==(r=i.flip)?void 0:r.overflows)||[];if(f&&A.push(P[y]),u){const e=function(e,t,n){void 0===n&&(n=!1);const r=T(e),o=B(e),i=W(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=V(s)),[s,V(s)]}(o,s,x);A.push(P[e[0]],P[e[1]])}if(O=[...O,{placement:o,overflows:A}],!A.every(e=>e<=0)){var S,L;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=R[e];if(t){if(!("alignment"===u&&w!==H(t))||O.every(e=>H(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:O},reset:{placement:t}}}let n=null==(L=O.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:L.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=O.filter(e=>{if(E){const t=H(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ie=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=C(e,t),f=await s.detectOverflow(t,c),u=D(o),d=T(o),p="y"===H(o),{width:m,height:h}=i.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=d===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=u,g="end"===d?"top":"bottom");const w=h-f.top-f.bottom,v=m-f.left-f.right,x=b(h-f[g],w),R=b(m-f[y],v),P=!t.middlewareData.shift;let A=x,O=R;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=v),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(A=w),P&&!d){const e=E(f.left,0),t=E(f.right,0),n=E(f.top,0),r=E(f.bottom,0);p?O=m-2*(0!==e||0!==t?e+t:E(f.left,f.right)):A=h-2*(0!==n||0!==r?n+r:E(f.top,f.bottom))}await l({...t,availableWidth:O,availableHeight:A});const S=await s.getDimensions(a.floating);return m!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}},Xe=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=C(e,t);switch(o){case"referenceHidden":{const e=K(await r.detectOverflow(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:G(e)}}}case"escaped":{const e=K(await r.detectOverflow(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:G(e)}}}default:return{}}}}},qe=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:f=0}=C(e,t)||{};if(null==c)return{};const u=Y(f),d={x:n,y:r},p=B(o),m=W(p),h=await s.getDimensions(c),g="y"===p,y=g?"top":"left",w=g?"bottom":"right",v=g?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-d[p]-i.floating[m],E=d[p]-i.reference[p],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let P=R?R[v]:0;P&&await(null==s.isElement?void 0:s.isElement(R))||(P=a.floating[v]||i.floating[m]);const A=x/2-E/2,O=P/2-h[m]/2-1,S=b(u[y],O),D=b(u[w],O),k=S,F=P-h[m]-D,H=P/2-h[m]/2+A,z=L(k,H,F),M=!l.arrow&&null!=T(o)&&H!==z&&i.reference[m]/2-(H<k?S:D)-h[m]/2<0,N=M?H<k?H-k:H-F:0;return{[p]:d[p]+N,data:{[p]:z,centerOffset:H-z-N,...M&&{alignmentOffset:N}},reset:M}}}),Ke=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=C(e,t),f={x:n,y:r},u=H(o),d=k(u);let p=f[d],m=f[u];const h=C(a,t),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+g.mainAxis,n=i.reference[d]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,w;const e="y"===d?"width":"height",t=J.has(D(o)),n=i.reference[u]-i.floating[e]+(t&&(null==(y=s.offset)?void 0:y[u])||0)+(t?0:g.crossAxis),r=i.reference[u]+i.reference[e]+(t?0:(null==(w=s.offset)?void 0:w[u])||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[d]:p,[u]:m}}}},Ge=(e,t,n)=>{const r=new Map,o={platform:Ne,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:u}=X(c,r,l),d=r,p={},m=0;for(let n=0;n<a.length;n++){var h;const{name:i,fn:g}=a[n],{x:y,y:w,data:v,reset:x}=await g({x:f,y:u,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:c,platform:{...s,detectOverflow:null!=(h=s.detectOverflow)?h:q},elements:{reference:e,floating:t}});f=null!=y?y:f,u=null!=w?w:u,p={...p,[i]:{...p[i],...v}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:f,y:u}=X(c,d,l))),n=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Je="undefined"!=typeof document?t:function(){};function Qe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Qe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Qe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ue(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ze(e,t){const n=Ue(e);return Math.round(t*n)/n}function et(t){const n=e.useRef(t);return Je(()=>{n.current=t}),n}function tt(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Qe(m,o)||h(o);const[g,y]=e.useState(null),[w,v]=e.useState(null),x=e.useCallback(e=>{e!==P.current&&(P.current=e,y(e))},[]),b=e.useCallback(e=>{e!==A.current&&(A.current=e,v(e))},[]),E=s||g,R=a||w,P=e.useRef(null),A=e.useRef(null),O=e.useRef(d),S=null!=c,L=et(c),C=et(i),D=et(u),T=e.useCallback(()=>{if(!P.current||!A.current)return;const e={placement:n,strategy:r,middleware:m};C.current&&(e.platform=C.current),Ge(P.current,A.current,e).then(e=>{const t={...e,isPositioned:!1!==D.current};k.current&&!Qe(O.current,t)&&(O.current=t,f.flushSync(()=>{p(t)}))})},[m,n,r,C,D]);Je(()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);const k=e.useRef(!1);Je(()=>(k.current=!0,()=>{k.current=!1}),[]),Je(()=>{if(E&&(P.current=E),R&&(A.current=R),E&&R){if(L.current)return L.current(E,R,T);T()}},[E,R,T,L,S]);const W=e.useMemo(()=>({reference:P,floating:A,setReference:x,setFloating:b}),[x,b]),F=e.useMemo(()=>({reference:E,floating:R}),[E,R]),H=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!F.floating)return e;const t=Ze(F.floating,d.x),n=Ze(F.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Ue(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,F.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:T,refs:W,elements:F,floatingStyles:H}),[d,T,W,F,H])}const nt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?qe({element:n.current,padding:r}).fn(t):{}:n?qe({element:n,padding:r}).fn(t):{};var o}}),rt=(e,t)=>({...je(e),options:[e,t]}),ot=(e,t)=>({...Ve(e),options:[e,t]}),it=(e,t)=>({...Ye(e),options:[e,t]}),st=(e,t)=>({...Ie(e),options:[e,t]}),at=(e,t)=>({...Xe(e),options:[e,t]}),lt=(e,t)=>({...nt(e),options:[e,t]});var ct=e.forwardRef((e,t)=>{const{children:r,width:o=10,height:i=5,...s}=e;return c(n.svg,{...s,ref:t,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:c("polygon",{points:"0,0 30,0 15,10"})})});ct.displayName="Arrow";var ft=ct;function ut(t){const[n,r]=e.useState(void 0);return i(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var dt="Popper",[pt,mt]=s(dt),[ht,gt]=pt(dt),yt=t=>{const{__scopePopper:n,children:r}=t,[o,i]=e.useState(null);return c(ht,{scope:n,anchor:o,onAnchorChange:i,children:r})};yt.displayName=dt;var wt="PopperAnchor",vt=e.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:i,...s}=t,l=gt(wt,o),f=e.useRef(null),u=a(r,f),d=e.useRef(null);return e.useEffect(()=>{const e=d.current;d.current=i?.current||f.current,e!==d.current&&l.onAnchorChange(d.current)}),i?null:c(n.div,{...s,ref:u})});vt.displayName=wt;var xt="PopperContent",[bt,Et]=pt(xt),Rt=e.forwardRef((t,r)=>{const{__scopePopper:o,side:s="bottom",sideOffset:f=0,align:u="center",alignOffset:d=0,arrowPadding:p=0,avoidCollisions:m=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:w=!1,updatePositionStrategy:v="optimized",onPlaced:x,...b}=t,E=gt(xt,o),[R,P]=e.useState(null),A=a(r,e=>P(e)),[O,S]=e.useState(null),L=ut(O),C=L?.width??0,D=L?.height??0,T=s+("center"!==u?"-"+u:""),k="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},W=Array.isArray(h)?h:[h],F=W.length>0,H={padding:k,boundary:W.filter(St),altBoundary:F},{refs:B,floatingStyles:z,placement:M,isPositioned:N,middlewareData:$}=tt({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>_e(...e,{animationFrame:"always"===v}),elements:{reference:E.anchor},middleware:[rt({mainAxis:f+D,alignmentAxis:d}),m&&ot({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?{...Ke(_),options:[_,j]}:void 0,...H}),m&&it({...H}),st({...H,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),O&&lt({element:O,padding:p}),Lt({arrowWidth:C,arrowHeight:D}),w&&at({strategy:"referenceHidden",...H})]});var _,j;const[V,Y]=Ct(M),I=l(x);i(()=>{N&&I?.()},[N,I]);const X=$.arrow?.x,q=$.arrow?.y,K=0!==$.arrow?.centerOffset,[G,J]=e.useState();return i(()=>{R&&J(window.getComputedStyle(R).zIndex)},[R]),c("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:N?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:c(bt,{scope:o,placedSide:V,onArrowChange:S,arrowX:X,arrowY:q,shouldHideArrow:K,children:c(n.div,{"data-side":V,"data-align":Y,...b,ref:A,style:{...b.style,animation:N?void 0:"none"}})})})});Rt.displayName=xt;var Pt="PopperArrow",At={top:"bottom",right:"left",bottom:"top",left:"right"},Ot=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=Et(Pt,n),i=At[o.placedSide];return c("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c(ft,{...r,ref:t,style:{...r.style,display:"block"}})})});function St(e){return null!==e}Ot.displayName=Pt;var Lt=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=Ct(n),f={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+s/2,d=(o.arrow?.y??0)+a/2;let p="",m="";return"bottom"===l?(p=i?f:`${u}px`,m=-a+"px"):"top"===l?(p=i?f:`${u}px`,m=`${r.floating.height+a}px`):"right"===l?(p=-a+"px",m=i?f:`${d}px`):"left"===l&&(p=`${r.floating.width+a}px`,m=i?f:`${d}px`),{data:{x:p,y:m}}}});function Ct(e){const[t,n="center"]=e.split("-");return[t,n]}var Dt=yt,Tt=vt,kt=Rt,Wt=Ot,Ft=e.forwardRef((t,r)=>{const{container:o,...s}=t,[a,l]=e.useState(!1);i(()=>l(!0),[]);const f=o||a&&globalThis?.document?.body;return f?u.createPortal(c(n.div,{...s,ref:r}),f):null});Ft.displayName="Portal";export{Tt as A,kt as C,y as D,Ft as P,Dt as R,Wt as a,_e as b,mt as c,ne as d,ut as e,it as f,oe as i,rt as o,ot as s,tt as u};
@@ -1,131 +0,0 @@
1
- import * as React from 'react';
2
- import { u as useComposedRefs } from './index-b8f2908d.js';
3
- import { u as useLayoutEffect2 } from './index-9ac5afe2.js';
4
-
5
- function useStateMachine(initialState, machine) {
6
- return React.useReducer((state, event) => {
7
- const nextState = machine[state][event];
8
- return nextState ?? state;
9
- }, initialState);
10
- }
11
-
12
- // src/presence.tsx
13
- var Presence = (props) => {
14
- const { present, children } = props;
15
- const presence = usePresence(present);
16
- const child = typeof children === "function" ? children({ present: presence.isPresent }) : React.Children.only(children);
17
- const ref = useComposedRefs(presence.ref, getElementRef(child));
18
- const forceMount = typeof children === "function";
19
- return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;
20
- };
21
- Presence.displayName = "Presence";
22
- function usePresence(present) {
23
- const [node, setNode] = React.useState();
24
- const stylesRef = React.useRef(null);
25
- const prevPresentRef = React.useRef(present);
26
- const prevAnimationNameRef = React.useRef("none");
27
- const initialState = present ? "mounted" : "unmounted";
28
- const [state, send] = useStateMachine(initialState, {
29
- mounted: {
30
- UNMOUNT: "unmounted",
31
- ANIMATION_OUT: "unmountSuspended"
32
- },
33
- unmountSuspended: {
34
- MOUNT: "mounted",
35
- ANIMATION_END: "unmounted"
36
- },
37
- unmounted: {
38
- MOUNT: "mounted"
39
- }
40
- });
41
- React.useEffect(() => {
42
- const currentAnimationName = getAnimationName(stylesRef.current);
43
- prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
44
- }, [state]);
45
- useLayoutEffect2(() => {
46
- const styles = stylesRef.current;
47
- const wasPresent = prevPresentRef.current;
48
- const hasPresentChanged = wasPresent !== present;
49
- if (hasPresentChanged) {
50
- const prevAnimationName = prevAnimationNameRef.current;
51
- const currentAnimationName = getAnimationName(styles);
52
- if (present) {
53
- send("MOUNT");
54
- } else if (currentAnimationName === "none" || styles?.display === "none") {
55
- send("UNMOUNT");
56
- } else {
57
- const isAnimating = prevAnimationName !== currentAnimationName;
58
- if (wasPresent && isAnimating) {
59
- send("ANIMATION_OUT");
60
- } else {
61
- send("UNMOUNT");
62
- }
63
- }
64
- prevPresentRef.current = present;
65
- }
66
- }, [present, send]);
67
- useLayoutEffect2(() => {
68
- if (node) {
69
- let timeoutId;
70
- const ownerWindow = node.ownerDocument.defaultView ?? window;
71
- const handleAnimationEnd = (event) => {
72
- const currentAnimationName = getAnimationName(stylesRef.current);
73
- const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
74
- if (event.target === node && isCurrentAnimation) {
75
- send("ANIMATION_END");
76
- if (!prevPresentRef.current) {
77
- const currentFillMode = node.style.animationFillMode;
78
- node.style.animationFillMode = "forwards";
79
- timeoutId = ownerWindow.setTimeout(() => {
80
- if (node.style.animationFillMode === "forwards") {
81
- node.style.animationFillMode = currentFillMode;
82
- }
83
- });
84
- }
85
- }
86
- };
87
- const handleAnimationStart = (event) => {
88
- if (event.target === node) {
89
- prevAnimationNameRef.current = getAnimationName(stylesRef.current);
90
- }
91
- };
92
- node.addEventListener("animationstart", handleAnimationStart);
93
- node.addEventListener("animationcancel", handleAnimationEnd);
94
- node.addEventListener("animationend", handleAnimationEnd);
95
- return () => {
96
- ownerWindow.clearTimeout(timeoutId);
97
- node.removeEventListener("animationstart", handleAnimationStart);
98
- node.removeEventListener("animationcancel", handleAnimationEnd);
99
- node.removeEventListener("animationend", handleAnimationEnd);
100
- };
101
- } else {
102
- send("ANIMATION_END");
103
- }
104
- }, [node, send]);
105
- return {
106
- isPresent: ["mounted", "unmountSuspended"].includes(state),
107
- ref: React.useCallback((node2) => {
108
- stylesRef.current = node2 ? getComputedStyle(node2) : null;
109
- setNode(node2);
110
- }, [])
111
- };
112
- }
113
- function getAnimationName(styles) {
114
- return styles?.animationName || "none";
115
- }
116
- function getElementRef(element) {
117
- let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
118
- let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
119
- if (mayWarn) {
120
- return element.ref;
121
- }
122
- getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
123
- mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
124
- if (mayWarn) {
125
- return element.props.ref;
126
- }
127
- return element.props.ref || element.ref;
128
- }
129
-
130
- export { Presence as P };
131
- //# sourceMappingURL=index-26994c9d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-26994c9d.js","sources":["../../../../../node_modules/@radix-ui/react-presence/src/use-state-machine.tsx","../../../../../node_modules/@radix-ui/react-presence/src/presence.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype Machine<S> = { [k: string]: { [k: string]: S } };\ntype MachineState<T> = keyof T;\ntype MachineEvent<T> = keyof UnionToIntersection<T[keyof T]>;\n\n// 🤯 https://fettblog.eu/typescript-union-to-intersection/\ntype UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any\n ? R\n : never;\n\nexport function useStateMachine<M>(\n initialState: MachineState<M>,\n machine: M & Machine<MachineState<M>>\n) {\n return React.useReducer((state: MachineState<M>, event: MachineEvent<M>): MachineState<M> => {\n const nextState = (machine[state] as any)[event];\n return nextState ?? state;\n }, initialState);\n}\n","import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = 'forwards';\n // Reset the style after the node had time to unmount (for cases\n // where the component chooses not to unmount). Doing this any\n // sooner than `setTimeout` (e.g. with `requestAnimationFrame`)\n // still causes a flash.\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === 'forwards') {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event: AnimationEvent) => {\n if (event.target === node) {\n // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener('animationstart', handleAnimationStart);\n node.addEventListener('animationcancel', handleAnimationEnd);\n node.addEventListener('animationend', handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener('animationstart', handleAnimationStart);\n node.removeEventListener('animationcancel', handleAnimationEnd);\n node.removeEventListener('animationend', handleAnimationEnd);\n };\n } else {\n // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }\n }, [node, send]);\n\n return {\n isPresent: ['mounted', 'unmountSuspended'].includes(state),\n ref: React.useCallback((node: HTMLElement) => {\n stylesRef.current = node ? getComputedStyle(node) : null;\n setNode(node);\n }, []),\n };\n}\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getAnimationName(styles: CSSStyleDeclaration | null) {\n return styles?.animationName || 'none';\n}\n\n// Before React 19 accessing `element.props.ref` will throw a warning and suggest using `element.ref`\n// After React 19 accessing `element.ref` does the opposite.\n// https://github.com/facebook/react/pull/28348\n//\n// Access the ref using the method that doesn't yield a warning.\nfunction getElementRef(element: React.ReactElement<{ ref?: React.Ref<unknown> }>) {\n // React <=18 in DEV\n let getter = Object.getOwnPropertyDescriptor(element.props, 'ref')?.get;\n let mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n\n // React 19 in DEV\n getter = Object.getOwnPropertyDescriptor(element, 'ref')?.get;\n mayWarn = getter && 'isReactWarning' in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n\n // Not DEV\n return element.props.ref || (element as any).ref;\n}\n\nconst Root = Presence;\n\nexport {\n Presence,\n //\n Root,\n};\nexport type { PresenceProps };\n"],"names":["React2","useLayoutEffect","node"],"mappings":";;;;AAWO,SAAS,eAAA,CACd,cACA,OACA,EAAA;AACA,EAAa,OAAA,KAAA,CAAA,UAAA,CAAW,CAAC,KAAA,EAAwB,KAA4C,KAAA;AAC3F,IAAA,MAAM,SAAa,GAAA,OAAA,CAAQ,KAAK,CAAA,CAAU,KAAK,CAAA,CAAA;AAC/C,IAAA,OAAO,SAAa,IAAA,KAAA,CAAA;AAAA,KACnB,YAAY,CAAA,CAAA;AACjB,CAAA;;;ACTM,IAAA,QAAA,GAAoC,CAAC,KAAU,KAAA;AACnD,EAAM,MAAA,EAAE,OAAS,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AAC9B,EAAM,MAAA,QAAA,GAAW,YAAY,OAAO,CAAA,CAAA;AAEpC,EAAA,MAAM,KACJ,GAAA,OAAO,QAAa,KAAA,UAAA,GAChB,QAAS,CAAA,EAAE,OAAS,EAAA,QAAA,CAAS,SAAU,EAAC,CAClC,GAAAA,KAAA,CAAA,QAAA,CAAS,KA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AI,OAAS,EAAA;AACX,IAAA,OAAO,QAAQ,KAAM,CAAA,GAAA,CAAA;AAAA,GACvB;AAGA,EAAO,OAAA,OAAA,CAAQ,KAAM,CAAA,GAAA,IAAQ,OAAgB,CAAA,GAAA,CAAA;AAC/C;;;;","x_google_ignoreList":[0,1]}
@@ -1,190 +0,0 @@
1
- import { c as createLucideIcon } from './createLucideIcon-6ba35914.js';
2
-
3
- function _mergeNamespaces(n, m) {
4
- m.forEach(function (e) {
5
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
6
- if (k !== 'default' && !(k in n)) {
7
- var d = Object.getOwnPropertyDescriptor(e, k);
8
- Object.defineProperty(n, k, d.get ? d : {
9
- enumerable: true,
10
- get: function () { return e[k]; }
11
- });
12
- }
13
- });
14
- });
15
- return Object.freeze(n);
16
- }
17
-
18
- /**
19
- * @license lucide-react v0.294.0 - ISC
20
- *
21
- * This source code is licensed under the ISC license.
22
- * See the LICENSE file in the root directory of this source tree.
23
- */
24
-
25
-
26
- const Copy = createLucideIcon("Copy", [
27
- ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
28
- ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
29
- ]);
30
-
31
- var toggleSelection = function () {
32
- var selection = document.getSelection();
33
- if (!selection.rangeCount) {
34
- return function () {};
35
- }
36
- var active = document.activeElement;
37
-
38
- var ranges = [];
39
- for (var i = 0; i < selection.rangeCount; i++) {
40
- ranges.push(selection.getRangeAt(i));
41
- }
42
-
43
- switch (active.tagName.toUpperCase()) { // .toUpperCase handles XHTML
44
- case 'INPUT':
45
- case 'TEXTAREA':
46
- active.blur();
47
- break;
48
-
49
- default:
50
- active = null;
51
- break;
52
- }
53
-
54
- selection.removeAllRanges();
55
- return function () {
56
- selection.type === 'Caret' &&
57
- selection.removeAllRanges();
58
-
59
- if (!selection.rangeCount) {
60
- ranges.forEach(function(range) {
61
- selection.addRange(range);
62
- });
63
- }
64
-
65
- active &&
66
- active.focus();
67
- };
68
- };
69
-
70
- var deselectCurrent = toggleSelection;
71
-
72
- var clipboardToIE11Formatting = {
73
- "text/plain": "Text",
74
- "text/html": "Url",
75
- "default": "Text"
76
- };
77
-
78
- var defaultMessage = "Copy to clipboard: #{key}, Enter";
79
-
80
- function format(message) {
81
- var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
82
- return message.replace(/#{\s*key\s*}/g, copyKey);
83
- }
84
-
85
- function copy(text, options) {
86
- var debug,
87
- message,
88
- reselectPrevious,
89
- range,
90
- selection,
91
- mark,
92
- success = false;
93
- if (!options) {
94
- options = {};
95
- }
96
- debug = options.debug || false;
97
- try {
98
- reselectPrevious = deselectCurrent();
99
-
100
- range = document.createRange();
101
- selection = document.getSelection();
102
-
103
- mark = document.createElement("span");
104
- mark.textContent = text;
105
- // avoid screen readers from reading out loud the text
106
- mark.ariaHidden = "true";
107
- // reset user styles for span element
108
- mark.style.all = "unset";
109
- // prevents scrolling to the end of the page
110
- mark.style.position = "fixed";
111
- mark.style.top = 0;
112
- mark.style.clip = "rect(0, 0, 0, 0)";
113
- // used to preserve spaces and line breaks
114
- mark.style.whiteSpace = "pre";
115
- // do not inherit user-select (it may be `none`)
116
- mark.style.webkitUserSelect = "text";
117
- mark.style.MozUserSelect = "text";
118
- mark.style.msUserSelect = "text";
119
- mark.style.userSelect = "text";
120
- mark.addEventListener("copy", function(e) {
121
- e.stopPropagation();
122
- if (options.format) {
123
- e.preventDefault();
124
- if (typeof e.clipboardData === "undefined") { // IE 11
125
- debug && console.warn("unable to use e.clipboardData");
126
- debug && console.warn("trying IE specific stuff");
127
- window.clipboardData.clearData();
128
- var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
129
- window.clipboardData.setData(format, text);
130
- } else { // all other browsers
131
- e.clipboardData.clearData();
132
- e.clipboardData.setData(options.format, text);
133
- }
134
- }
135
- if (options.onCopy) {
136
- e.preventDefault();
137
- options.onCopy(e.clipboardData);
138
- }
139
- });
140
-
141
- document.body.appendChild(mark);
142
-
143
- range.selectNodeContents(mark);
144
- selection.addRange(range);
145
-
146
- var successful = document.execCommand("copy");
147
- if (!successful) {
148
- throw new Error("copy command was unsuccessful");
149
- }
150
- success = true;
151
- } catch (err) {
152
- debug && console.error("unable to copy using execCommand: ", err);
153
- debug && console.warn("trying IE specific stuff");
154
- try {
155
- window.clipboardData.setData(options.format || "text", text);
156
- options.onCopy && options.onCopy(window.clipboardData);
157
- success = true;
158
- } catch (err) {
159
- debug && console.error("unable to copy using clipboardData: ", err);
160
- debug && console.error("falling back to prompt");
161
- message = format("message" in options ? options.message : defaultMessage);
162
- window.prompt(message, text);
163
- }
164
- } finally {
165
- if (selection) {
166
- if (typeof selection.removeRange == "function") {
167
- selection.removeRange(range);
168
- } else {
169
- selection.removeAllRanges();
170
- }
171
- }
172
-
173
- if (mark) {
174
- document.body.removeChild(mark);
175
- }
176
- reselectPrevious();
177
- }
178
-
179
- return success;
180
- }
181
-
182
- var copyToClipboard = copy;
183
-
184
- var index = /*#__PURE__*/_mergeNamespaces({
185
- __proto__: null,
186
- default: copyToClipboard
187
- }, [copyToClipboard]);
188
-
189
- export { Copy as C, copyToClipboard as c, index as i };
190
- //# sourceMappingURL=index-600be8f8.js.map