@tamagui/popover 3.0.0-beta.924.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Popover.cjs +19 -4
- package/dist/cjs/Popover.native.cjs +21 -4
- package/dist/cjs/Popover.native.js +21 -4
- package/dist/cjs/Popover.native.js.map +1 -1
- package/dist/cjs/useFloatingContext.cjs +17 -5
- package/dist/esm/Popover.mjs +20 -5
- package/dist/esm/Popover.mjs.map +1 -1
- package/dist/esm/Popover.native.js +22 -5
- package/dist/esm/Popover.native.js.map +1 -1
- package/dist/esm/useFloatingContext.mjs +17 -5
- package/dist/esm/useFloatingContext.mjs.map +1 -1
- package/dist/jsx/Popover.mjs +20 -5
- package/dist/jsx/Popover.mjs.map +1 -1
- package/dist/jsx/Popover.native.cjs +21 -4
- package/dist/jsx/Popover.native.js +21 -4
- package/dist/jsx/Popover.native.js.map +1 -1
- package/dist/jsx/useFloatingContext.mjs +17 -5
- package/dist/jsx/useFloatingContext.mjs.map +1 -1
- package/package.json +25 -23
- package/src/Popover.tsx +43 -11
- package/src/useFloatingContext.tsx +15 -7
- package/types/Popover.d.ts +17 -14
- package/types/Popover.d.ts.map +1 -1
- package/types/useFloatingContext.d.ts +5 -2
- package/types/useFloatingContext.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type { Delay, UseFloatingOptions } from '@tamagui/floating'
|
|
2
|
+
import type { Delay, OpenChangeReason, UseFloatingOptions } from '@tamagui/floating'
|
|
3
3
|
import {
|
|
4
4
|
createFloatingEvents,
|
|
5
5
|
safePolygon,
|
|
@@ -45,6 +45,7 @@ export type UseFloatingContextOptions = {
|
|
|
45
45
|
delay?: Delay
|
|
46
46
|
// explicit restMs override
|
|
47
47
|
restMs?: number
|
|
48
|
+
closeReasonRef?: { current?: OpenChangeReason }
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
export const useFloatingContext = ({
|
|
@@ -58,6 +59,7 @@ export const useFloatingContext = ({
|
|
|
58
59
|
groupId,
|
|
59
60
|
delay: delayProp,
|
|
60
61
|
restMs: restMsProp,
|
|
62
|
+
closeReasonRef,
|
|
61
63
|
}: UseFloatingContextOptions) => {
|
|
62
64
|
'use no memo'
|
|
63
65
|
|
|
@@ -84,8 +86,13 @@ export const useFloatingContext = ({
|
|
|
84
86
|
const triggerElements = React.useMemo(() => new PopupTriggerMap(), [])
|
|
85
87
|
|
|
86
88
|
React.useEffect(() => {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
// prevent focus restoration from reopening a deliberately dismissed popup.
|
|
90
|
+
const reason = closeReasonRef?.current
|
|
91
|
+
if (closeReasonRef) {
|
|
92
|
+
closeReasonRef.current = undefined
|
|
93
|
+
}
|
|
94
|
+
events.emit('openchange', { open, reason: open ? undefined : reason })
|
|
95
|
+
}, [open, events, closeReasonRef])
|
|
89
96
|
|
|
90
97
|
return React.useCallback(
|
|
91
98
|
(props?: UseFloatingOptions) => {
|
|
@@ -103,7 +110,7 @@ export const useFloatingContext = ({
|
|
|
103
110
|
}
|
|
104
111
|
}, [])
|
|
105
112
|
|
|
106
|
-
const onOpenChange = (val: boolean, event?: Event) => {
|
|
113
|
+
const onOpenChange = (val: boolean, event?: Event, reason?: OpenChangeReason) => {
|
|
107
114
|
// block useHover's mouseenter opens — we handle open timing via onHoverReference
|
|
108
115
|
if (val && event?.type === 'mouseenter') {
|
|
109
116
|
return
|
|
@@ -123,6 +130,7 @@ export const useFloatingContext = ({
|
|
|
123
130
|
event?.type === 'mouseleave'
|
|
124
131
|
? 'hover'
|
|
125
132
|
: 'press'
|
|
133
|
+
if (closeReasonRef) closeReasonRef.current = reason
|
|
126
134
|
setOpen(val, type)
|
|
127
135
|
}
|
|
128
136
|
|
|
@@ -244,8 +252,8 @@ export const useFloatingContext = ({
|
|
|
244
252
|
//
|
|
245
253
|
// no memoization concern: this entire block runs inside the
|
|
246
254
|
// useCallback factory which already produces fresh closures each
|
|
247
|
-
// call ('use no memo')
|
|
248
|
-
//
|
|
255
|
+
// call ('use no memo'); getFloatingPropsInner is memoized on the
|
|
256
|
+
// interaction hooks' props, and wrapping it here keeps that.
|
|
249
257
|
const getFloatingProps = currentHoverable
|
|
250
258
|
? (userProps?: Record<string, any>) => {
|
|
251
259
|
const merged = getFloatingPropsInner(userProps)
|
|
@@ -341,6 +349,6 @@ export const useFloatingContext = ({
|
|
|
341
349
|
: undefined,
|
|
342
350
|
}
|
|
343
351
|
},
|
|
344
|
-
[setOpen]
|
|
352
|
+
[setOpen, closeReasonRef]
|
|
345
353
|
)
|
|
346
354
|
}
|
package/types/Popover.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@tamagui/polyfill-dev';
|
|
2
|
-
import type { UseHoverProps } from '@tamagui/floating';
|
|
3
|
-
import type {
|
|
2
|
+
import type { OpenChangeReason, UseHoverProps } from '@tamagui/floating';
|
|
3
|
+
import type { TamaguiElement, ViewProps } from '@tamagui/core';
|
|
4
4
|
import { type DismissableProps } from '@tamagui/dismissable';
|
|
5
5
|
import type { FocusScopeProps } from '@tamagui/focus-scope';
|
|
6
6
|
import { type PopperArrowExtraProps, type PopperArrowProps, type PopperContentProps, type PopperProps } from '@tamagui/popper';
|
|
@@ -30,7 +30,8 @@ export type PopoverProps = ScopedPopoverProps<PopperProps> & {
|
|
|
30
30
|
*/
|
|
31
31
|
hoverable?: boolean | UseHoverProps;
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* disable opening when the trigger receives keyboard focus.
|
|
34
|
+
* defaults to true unless hoverable is enabled.
|
|
34
35
|
*/
|
|
35
36
|
disableFocus?: boolean;
|
|
36
37
|
/**
|
|
@@ -63,13 +64,13 @@ type PopoverContextValue = {
|
|
|
63
64
|
hasCustomAnchor: boolean;
|
|
64
65
|
onCustomAnchorAdd(): void;
|
|
65
66
|
onCustomAnchorRemove(): void;
|
|
66
|
-
size?: SizeTokens;
|
|
67
67
|
breakpointActive?: boolean;
|
|
68
68
|
keepChildrenMounted?: boolean | 'lazy';
|
|
69
69
|
disableDismissable?: boolean;
|
|
70
70
|
hoverable?: boolean | object;
|
|
71
71
|
anchorTo?: Rect;
|
|
72
72
|
branches: Set<HTMLElement>;
|
|
73
|
+
closeReasonRef?: React.RefObject<OpenChangeReason | undefined>;
|
|
73
74
|
};
|
|
74
75
|
type PopoverTriggerStateSetter = React.Dispatch<React.SetStateAction<boolean>>;
|
|
75
76
|
type PopoverTriggerContextValue = {
|
|
@@ -118,14 +119,15 @@ export type PopoverContextProviderProps = {
|
|
|
118
119
|
keepChildrenMounted?: boolean | 'lazy';
|
|
119
120
|
disableDismissable?: boolean;
|
|
120
121
|
hoverable?: boolean | object;
|
|
122
|
+
closeReasonRef?: React.RefObject<OpenChangeReason | undefined>;
|
|
121
123
|
};
|
|
122
124
|
/**
|
|
123
125
|
* Provider that sets up both PopoverContext and PopoverTriggerContext.
|
|
124
126
|
* Use this in Tooltip or other components that need popover trigger behavior.
|
|
125
127
|
*/
|
|
126
|
-
export declare const PopoverContextProvider: React.MemoExoticComponent<({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id, contentId, hasCustomAnchor, onCustomAnchorAdd, onCustomAnchorRemove, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, }: PopoverContextProviderProps) => React.JSX.Element>;
|
|
128
|
+
export declare const PopoverContextProvider: React.MemoExoticComponent<({ scope, children, open, onOpenChange, onOpenToggle, triggerRef, id, contentId, hasCustomAnchor, onCustomAnchorAdd, onCustomAnchorRemove, anchorTo, adaptScope, breakpointActive, keepChildrenMounted, disableDismissable, hoverable, closeReasonRef, }: PopoverContextProviderProps) => React.JSX.Element>;
|
|
127
129
|
export type PopoverAnchorProps = ScopedPopoverProps<YStackProps>;
|
|
128
|
-
export declare const PopoverAnchor: React.NamedExoticComponent<Omit<
|
|
130
|
+
export declare const PopoverAnchor: React.NamedExoticComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}>, "scope"> & {
|
|
129
131
|
scope?: PopoverScopes;
|
|
130
132
|
} & import("@tamagui/compose-refs").RefProp<TamaguiElement>>;
|
|
131
133
|
export type PopoverTriggerProps = ScopedPopoverProps<ViewProps & {
|
|
@@ -136,7 +138,7 @@ export type PopoverTriggerProps = ScopedPopoverProps<ViewProps & {
|
|
|
136
138
|
*/
|
|
137
139
|
disablePressTrigger?: boolean;
|
|
138
140
|
}>;
|
|
139
|
-
export declare const PopoverTrigger: React.NamedExoticComponent<Omit<import("@tamagui/core").StackNonStyleProps & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase
|
|
141
|
+
export declare const PopoverTrigger: React.NamedExoticComponent<Omit<import("@tamagui/core").StackNonStyleProps & import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
|
|
140
142
|
/**
|
|
141
143
|
* When true, disables the built-in click-to-toggle behavior on the trigger.
|
|
142
144
|
* Useful for hoverable popovers where you want to control open/close
|
|
@@ -153,7 +155,7 @@ export interface PopoverContentTypeProps extends Omit<PopoverContentImplProps, '
|
|
|
153
155
|
animatePosition?: boolean | 'even-when-repositioning';
|
|
154
156
|
}
|
|
155
157
|
export type PopoverContentProps = PopoverContentTypeProps;
|
|
156
|
-
export declare const PopoverContent: import("@tamagui/core").TamaguiComponent<
|
|
158
|
+
export declare const PopoverContent: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof PopoverContentTypeProps> & PopoverContentTypeProps, import("@tamagui/core").StackStyleBase, Omit<{}, keyof PopoverContentTypeProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
157
159
|
export type PopoverContentImplProps = PopperContentProps & Omit<DismissableProps, 'onDismiss' | 'children' | 'onPointerDownCapture'> & {
|
|
158
160
|
/**
|
|
159
161
|
* Rather than mount the content immediately, mounts it in a useEffect
|
|
@@ -198,7 +200,7 @@ export type PopoverContentImplProps = PopperContentProps & Omit<DismissableProps
|
|
|
198
200
|
export type PopoverCloseProps = ScopedPopoverProps<YStackProps>;
|
|
199
201
|
export declare const PopoverClose: import("@tamagui/compose-refs").RefComponent<TamaguiElement, PopoverCloseProps>;
|
|
200
202
|
export type PopoverArrowProps = PopperArrowProps;
|
|
201
|
-
export declare const PopoverArrow: import("@tamagui/core").TamaguiComponent<
|
|
203
|
+
export declare const PopoverArrow: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof PopperArrowExtraProps> & PopperArrowExtraProps, import("@tamagui/core").StackStyleBase, Omit<{}, keyof PopperArrowExtraProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
202
204
|
type Rect = {
|
|
203
205
|
x: number;
|
|
204
206
|
y: number;
|
|
@@ -233,7 +235,8 @@ export declare const Popover: ((props: Omit<PopperProps, "scope"> & {
|
|
|
233
235
|
*/
|
|
234
236
|
hoverable?: boolean | UseHoverProps;
|
|
235
237
|
/**
|
|
236
|
-
*
|
|
238
|
+
* disable opening when the trigger receives keyboard focus.
|
|
239
|
+
* defaults to true unless hoverable is enabled.
|
|
237
240
|
*/
|
|
238
241
|
disableFocus?: boolean;
|
|
239
242
|
/**
|
|
@@ -256,11 +259,11 @@ export declare const Popover: ((props: Omit<PopperProps, "scope"> & {
|
|
|
256
259
|
displayName?: string;
|
|
257
260
|
propTypes?: any;
|
|
258
261
|
} & {
|
|
259
|
-
Anchor: React.NamedExoticComponent<Omit<
|
|
262
|
+
Anchor: React.NamedExoticComponent<Omit<import("@tamagui/core").GetFinalProps<import("@tamagui/core").RNTamaguiViewNonStyleProps, import("@tamagui/core").StackStyleBase, {}>, "scope"> & {
|
|
260
263
|
scope?: PopoverScopes;
|
|
261
264
|
} & import("@tamagui/compose-refs").RefProp<TamaguiElement>>;
|
|
262
|
-
Arrow: import("@tamagui/core").TamaguiComponent<
|
|
263
|
-
Trigger: React.NamedExoticComponent<Omit<import("@tamagui/core").StackNonStyleProps & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase
|
|
265
|
+
Arrow: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof PopperArrowExtraProps> & PopperArrowExtraProps, import("@tamagui/core").StackStyleBase, Omit<{}, keyof PopperArrowExtraProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
266
|
+
Trigger: React.NamedExoticComponent<Omit<import("@tamagui/core").StackNonStyleProps & import("@tamagui/core").WithThemeValues<Omit<import("@tamagui/core").StackStyleBase, never>> & import("@tamagui/core").WithFlatVariantValues<{}> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStyleBase>> & {
|
|
264
267
|
/**
|
|
265
268
|
* When true, disables the built-in click-to-toggle behavior on the trigger.
|
|
266
269
|
* Useful for hoverable popovers where you want to control open/close
|
|
@@ -270,7 +273,7 @@ export declare const Popover: ((props: Omit<PopperProps, "scope"> & {
|
|
|
270
273
|
}, "scope"> & {
|
|
271
274
|
scope?: PopoverScopes;
|
|
272
275
|
} & import("@tamagui/compose-refs").RefProp<TamaguiElement>>;
|
|
273
|
-
Content: import("@tamagui/core").TamaguiComponent<
|
|
276
|
+
Content: import("@tamagui/core").TamaguiComponent<import("@tamagui/core").TamaDefer, TamaguiElement, Omit<import("@tamagui/core").RNTamaguiViewNonStyleProps, keyof PopoverContentTypeProps> & PopoverContentTypeProps, import("@tamagui/core").StackStyleBase, Omit<{}, keyof PopoverContentTypeProps>, import("@tamagui/core").StaticConfigPublic>;
|
|
274
277
|
Close: import("@tamagui/compose-refs").RefComponent<TamaguiElement, PopoverCloseProps>;
|
|
275
278
|
Adapt: ((props: import("@tamagui/adapt").AdaptProps) => React.JSX.Element) & {
|
|
276
279
|
Contents: typeof import("@tamagui/adapt").AdaptContents;
|
package/types/Popover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../src/Popover.tsx"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAaxE,OAAO,KAAK,EAAU,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAStE,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAG3D,OAAO,EAIL,KAAK,qBAAqB,EAE1B,KAAK,gBAAgB,EAGrB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAIjB,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,KAAK,kBAAkB,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG;IAC9C,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,CAAA;AAMD,eAAO,MAAM,eAAe,eAE3B,CAAA;AAED,eAAO,MAAM,iBAAiB,eAI7B,CAAA;AAED,eAAO,MAAM,sBAAsB,eAQlC,CAAA;AAED,KAAK,UAAU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,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IAC9B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,eAAe,GAAG;IACrD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAsBD,eAAO,MAAM,OAAO;YA96BV,aAAa;;WA8Bd,OAAO;kBACA,OAAO;mBACN,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,UAAU,KAAK,IAAI;IAExD;;;;;OAKG;0BACmB,OAAO,GAAG,MAAM;IAEtC;;OAEG;gBACS,OAAO,GAAG,aAAa;IAEnC;;;OAGG;mBACY,OAAO;IAEtB;;;OAGG;yBACkB,OAAO;IAE5B;;;;;;;;;OASG;aACM,MAAM;;;;;;gBArEP,aAAa;;;;QAoTnB;;;;WAIG;8BACmB,OAAO;;;;;;;;;;;CAurBhC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Delay, UseFloatingOptions } from '@tamagui/floating';
|
|
1
|
+
import type { Delay, OpenChangeReason, UseFloatingOptions } from '@tamagui/floating';
|
|
2
2
|
export type UseFloatingContextOptions = {
|
|
3
3
|
open: boolean;
|
|
4
4
|
setOpen: (val: boolean, type?: string) => void;
|
|
@@ -10,6 +10,9 @@ export type UseFloatingContextOptions = {
|
|
|
10
10
|
groupId?: string;
|
|
11
11
|
delay?: Delay;
|
|
12
12
|
restMs?: number;
|
|
13
|
+
closeReasonRef?: {
|
|
14
|
+
current?: OpenChangeReason;
|
|
15
|
+
};
|
|
13
16
|
};
|
|
14
|
-
export declare const useFloatingContext: ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp, focus: focusProp, groupId, delay: delayProp, restMs: restMsProp, }: UseFloatingContextOptions) => (props?: UseFloatingOptions) => any;
|
|
17
|
+
export declare const useFloatingContext: ({ open, setOpen, disable, disableFocus, hoverable, role: roleProp, focus: focusProp, groupId, delay: delayProp, restMs: restMsProp, closeReasonRef, }: UseFloatingContextOptions) => (props?: UseFloatingOptions) => any;
|
|
15
18
|
//# sourceMappingURL=useFloatingContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingContext.d.ts","sourceRoot":"","sources":["../src/useFloatingContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"useFloatingContext.d.ts","sourceRoot":"","sources":["../src/useFloatingContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AA8BpF,MAAM,MAAM,yBAAyB,GAAG;IACtC,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAEzC,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAE3B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAE3B,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB,KAAK,CAAC,EAAE,KAAK,CAAA;IAEb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAA;CAChD,CAAA;AAED,eAAO,MAAM,kBAAkB,0JAY5B,yBAAyB,cAmCf,kBAAkB,QAgQ9B,CAAA"}
|