@payloadcms/ui 4.0.0-beta.4 → 4.0.0-beta.5
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/elements/Popup/SubmenuScope.d.ts +3 -5
- package/dist/elements/Popup/SubmenuScope.d.ts.map +1 -1
- package/dist/elements/Popup/SubmenuScope.js +10 -54
- package/dist/elements/Popup/SubmenuScope.js.map +1 -1
- package/dist/elements/Popup/index.css +15 -0
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +69 -30
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/Popup/useSubmenuPointerIntent.d.ts +16 -4
- package/dist/elements/Popup/useSubmenuPointerIntent.d.ts.map +1 -1
- package/dist/elements/Popup/useSubmenuPointerIntent.js +68 -27
- package/dist/elements/Popup/useSubmenuPointerIntent.js.map +1 -1
- package/dist/exports/client/index.js +15 -15
- package/dist/exports/client/index.js.map +4 -4
- package/dist/hooks/usePointerSafeArea.d.ts +29 -0
- package/dist/hooks/usePointerSafeArea.d.ts.map +1 -0
- package/dist/hooks/usePointerSafeArea.js +232 -0
- package/dist/hooks/usePointerSafeArea.js.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
export type PointerPosition = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
type UsePointerSafeAreaArgs = {
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
from: RefObject<HTMLElement | null>;
|
|
9
|
+
idleTimeout?: number;
|
|
10
|
+
onChange: (args: {
|
|
11
|
+
polygon: null | string;
|
|
12
|
+
}) => void;
|
|
13
|
+
onRelease: (pointer: PointerPosition) => void;
|
|
14
|
+
to: RefObject<HTMLElement | null>;
|
|
15
|
+
};
|
|
16
|
+
/** Tracks a safe area for pointer travel between two elements in either direction. */
|
|
17
|
+
export declare const usePointerSafeArea: ({ enabled, from, idleTimeout, onChange, onRelease, to, }: UsePointerSafeAreaArgs) => {
|
|
18
|
+
clear: () => void;
|
|
19
|
+
isProtected: () => boolean;
|
|
20
|
+
isTracking: () => boolean;
|
|
21
|
+
protect: ({ pointer }: {
|
|
22
|
+
pointer: PointerPosition;
|
|
23
|
+
}) => boolean;
|
|
24
|
+
refresh: () => boolean;
|
|
25
|
+
trackSource: (pointer: PointerPosition) => void;
|
|
26
|
+
trackTarget: (pointer: PointerPosition) => void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=usePointerSafeArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePointerSafeArea.d.ts","sourceRoot":"","sources":["../../src/hooks/usePointerSafeArea.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEtD,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;IACpD,SAAS,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAA;IAC7C,EAAE,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAClC,CAAA;AAED,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,6DAO5B,sBAAsB;;;;2BAuIE;QAAE,OAAO,EAAE,eAAe,CAAA;KAAE;;2BAzEzC,eAAe;2BASf,eAAe;CAqE5B,CAAA"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
2
|
+
/** Tracks a safe area for pointer travel between two elements in either direction. */
|
|
3
|
+
export const usePointerSafeArea = ({
|
|
4
|
+
enabled,
|
|
5
|
+
from,
|
|
6
|
+
idleTimeout = 300,
|
|
7
|
+
onChange,
|
|
8
|
+
onRelease,
|
|
9
|
+
to
|
|
10
|
+
}) => {
|
|
11
|
+
const origin = useRef(undefined);
|
|
12
|
+
const isReturning = useRef(false);
|
|
13
|
+
const isProtected = useRef(false);
|
|
14
|
+
const idleTimer = useRef(undefined);
|
|
15
|
+
const callbacks = useRef({
|
|
16
|
+
onChange,
|
|
17
|
+
onRelease
|
|
18
|
+
});
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
callbacks.current = {
|
|
21
|
+
onChange,
|
|
22
|
+
onRelease
|
|
23
|
+
};
|
|
24
|
+
}, [onChange, onRelease]);
|
|
25
|
+
const clear = useCallback(() => {
|
|
26
|
+
clearTimeout(idleTimer.current);
|
|
27
|
+
idleTimer.current = undefined;
|
|
28
|
+
if (isProtected.current) {
|
|
29
|
+
isProtected.current = false;
|
|
30
|
+
callbacks.current.onChange({
|
|
31
|
+
polygon: null
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
origin.current = undefined;
|
|
35
|
+
}, []);
|
|
36
|
+
const release = useCallback(pointer => {
|
|
37
|
+
clear();
|
|
38
|
+
callbacks.current.onRelease(pointer);
|
|
39
|
+
}, [clear]);
|
|
40
|
+
const update = useCallback(({
|
|
41
|
+
pointer
|
|
42
|
+
} = {}) => {
|
|
43
|
+
const target = isReturning.current ? from.current : to.current;
|
|
44
|
+
const start = origin.current;
|
|
45
|
+
if (!enabled || !target || !start || !pointer && !isProtected.current) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
const rect = target.getBoundingClientRect();
|
|
49
|
+
if (rect.left <= start.x && rect.right >= start.x) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const points = getSafeAreaPoints({
|
|
53
|
+
rect,
|
|
54
|
+
start
|
|
55
|
+
});
|
|
56
|
+
if (pointer && !isInsideSafeArea({
|
|
57
|
+
pointer,
|
|
58
|
+
points
|
|
59
|
+
})) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
isProtected.current = true;
|
|
63
|
+
callbacks.current.onChange({
|
|
64
|
+
polygon: `polygon(${points.map(({
|
|
65
|
+
x,
|
|
66
|
+
y
|
|
67
|
+
}) => `${x}px ${y}px`).join(', ')})`
|
|
68
|
+
});
|
|
69
|
+
if (pointer) {
|
|
70
|
+
clearTimeout(idleTimer.current);
|
|
71
|
+
idleTimer.current = setTimeout(() => release(pointer), idleTimeout);
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
}, [enabled, from, idleTimeout, release, to]);
|
|
75
|
+
const trackSource = useCallback(pointer => {
|
|
76
|
+
clear();
|
|
77
|
+
origin.current = pointer;
|
|
78
|
+
isReturning.current = false;
|
|
79
|
+
}, [clear]);
|
|
80
|
+
const trackTarget = useCallback(pointer => {
|
|
81
|
+
// A keyboard-opened target does not start pointer tracking on its own.
|
|
82
|
+
if (!origin.current) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
clear();
|
|
86
|
+
origin.current = pointer;
|
|
87
|
+
isReturning.current = true;
|
|
88
|
+
}, [clear]);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (!enabled) {
|
|
91
|
+
clear();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const handleMove = event => {
|
|
95
|
+
if (event.pointerType !== 'mouse' || !origin.current) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const pointer = {
|
|
99
|
+
x: event.clientX,
|
|
100
|
+
y: event.clientY
|
|
101
|
+
};
|
|
102
|
+
const target = event.target;
|
|
103
|
+
if (target && from.current?.contains(target)) {
|
|
104
|
+
trackSource(pointer);
|
|
105
|
+
} else if (target && to.current?.contains(target)) {
|
|
106
|
+
trackTarget(pointer);
|
|
107
|
+
} else if (isProtected.current && !update({
|
|
108
|
+
pointer
|
|
109
|
+
})) {
|
|
110
|
+
release(pointer);
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const handlePress = event => {
|
|
114
|
+
if (event.pointerType === 'mouse') {
|
|
115
|
+
// Preserve tracking after clicks that keep either endpoint open, while
|
|
116
|
+
// letting clicks elsewhere reach their target without sending a replacement event.
|
|
117
|
+
const pointer = {
|
|
118
|
+
x: event.clientX,
|
|
119
|
+
y: event.clientY
|
|
120
|
+
};
|
|
121
|
+
const target = event.target;
|
|
122
|
+
if (target && from.current?.contains(target)) {
|
|
123
|
+
trackSource(pointer);
|
|
124
|
+
} else if (target && to.current?.contains(target)) {
|
|
125
|
+
trackTarget(pointer);
|
|
126
|
+
} else {
|
|
127
|
+
clear();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
const document = from.current?.ownerDocument;
|
|
132
|
+
document?.addEventListener('pointermove', handleMove, {
|
|
133
|
+
capture: true,
|
|
134
|
+
passive: true
|
|
135
|
+
});
|
|
136
|
+
document?.addEventListener('pointerdown', handlePress, {
|
|
137
|
+
capture: true,
|
|
138
|
+
passive: true
|
|
139
|
+
});
|
|
140
|
+
return () => {
|
|
141
|
+
document?.removeEventListener('pointermove', handleMove, {
|
|
142
|
+
capture: true
|
|
143
|
+
});
|
|
144
|
+
document?.removeEventListener('pointerdown', handlePress, {
|
|
145
|
+
capture: true
|
|
146
|
+
});
|
|
147
|
+
clear();
|
|
148
|
+
};
|
|
149
|
+
}, [clear, enabled, from, release, to, trackSource, trackTarget, update]);
|
|
150
|
+
return {
|
|
151
|
+
clear,
|
|
152
|
+
isProtected: useCallback(() => isProtected.current, []),
|
|
153
|
+
isTracking: useCallback(() => origin.current !== undefined, []),
|
|
154
|
+
protect: ({
|
|
155
|
+
pointer
|
|
156
|
+
}) => update({
|
|
157
|
+
pointer
|
|
158
|
+
}),
|
|
159
|
+
refresh: () => update(),
|
|
160
|
+
trackSource,
|
|
161
|
+
trackTarget
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
const isInsideSafeArea = ({
|
|
165
|
+
pointer,
|
|
166
|
+
points
|
|
167
|
+
}) => points.every((edgeStart, index) => isPointerInsideEdge({
|
|
168
|
+
edgeEnd: points[(index + 1) % points.length],
|
|
169
|
+
edgeStart,
|
|
170
|
+
pointer
|
|
171
|
+
}));
|
|
172
|
+
// The convex hull covers the whole destination, allowing return paths to enter
|
|
173
|
+
// through its top or bottom as well as its nearest edge.
|
|
174
|
+
const getSafeAreaPoints = ({
|
|
175
|
+
rect,
|
|
176
|
+
start
|
|
177
|
+
}) => {
|
|
178
|
+
const points = [{
|
|
179
|
+
x: start.x,
|
|
180
|
+
y: start.y - 4
|
|
181
|
+
}, {
|
|
182
|
+
x: start.x,
|
|
183
|
+
y: start.y + 4
|
|
184
|
+
}, {
|
|
185
|
+
x: rect.left,
|
|
186
|
+
y: rect.top
|
|
187
|
+
}, {
|
|
188
|
+
x: rect.right,
|
|
189
|
+
y: rect.top
|
|
190
|
+
}, {
|
|
191
|
+
x: rect.right,
|
|
192
|
+
y: rect.bottom
|
|
193
|
+
}, {
|
|
194
|
+
x: rect.left,
|
|
195
|
+
y: rect.bottom
|
|
196
|
+
}].sort((a, b) => a.x - b.x || a.y - b.y);
|
|
197
|
+
const getOuterEdge = ({
|
|
198
|
+
orderedPoints
|
|
199
|
+
}) => {
|
|
200
|
+
const edge = [];
|
|
201
|
+
for (const point of orderedPoints) {
|
|
202
|
+
while (edge.length > 1) {
|
|
203
|
+
const previous = edge[edge.length - 2];
|
|
204
|
+
const corner = edge[edge.length - 1];
|
|
205
|
+
const edgeX = corner.x - previous.x;
|
|
206
|
+
const edgeY = corner.y - previous.y;
|
|
207
|
+
const pointX = point.x - previous.x;
|
|
208
|
+
const pointY = point.y - previous.y;
|
|
209
|
+
const shouldRemoveCorner = edgeX * pointY - edgeY * pointX <= 0;
|
|
210
|
+
// Remove corners that bend into the area or lie on a straight edge.
|
|
211
|
+
if (!shouldRemoveCorner) {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
edge.pop();
|
|
215
|
+
}
|
|
216
|
+
edge.push(point);
|
|
217
|
+
}
|
|
218
|
+
return edge.slice(0, -1);
|
|
219
|
+
};
|
|
220
|
+
return [...getOuterEdge({
|
|
221
|
+
orderedPoints: points
|
|
222
|
+
}), ...getOuterEdge({
|
|
223
|
+
orderedPoints: [...points].reverse()
|
|
224
|
+
})];
|
|
225
|
+
};
|
|
226
|
+
// Edges follow the safe area's point order. Points on the boundary count as inside.
|
|
227
|
+
const isPointerInsideEdge = ({
|
|
228
|
+
edgeEnd,
|
|
229
|
+
edgeStart,
|
|
230
|
+
pointer
|
|
231
|
+
}) => (edgeEnd.x - edgeStart.x) * (pointer.y - edgeStart.y) - (edgeEnd.y - edgeStart.y) * (pointer.x - edgeStart.x) >= 0;
|
|
232
|
+
//# sourceMappingURL=usePointerSafeArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePointerSafeArea.js","names":["useCallback","useEffect","useRef","usePointerSafeArea","enabled","from","idleTimeout","onChange","onRelease","to","origin","undefined","isReturning","isProtected","idleTimer","callbacks","current","clear","clearTimeout","polygon","release","pointer","update","target","start","rect","getBoundingClientRect","left","x","right","points","getSafeAreaPoints","isInsideSafeArea","map","y","join","setTimeout","trackSource","trackTarget","handleMove","event","pointerType","clientX","clientY","contains","handlePress","document","ownerDocument","addEventListener","capture","passive","removeEventListener","isTracking","protect","refresh","every","edgeStart","index","isPointerInsideEdge","edgeEnd","length","top","bottom","sort","a","b","getOuterEdge","orderedPoints","edge","point","previous","corner","edgeX","edgeY","pointX","pointY","shouldRemoveCorner","pop","push","slice","reverse"],"sources":["../../src/hooks/usePointerSafeArea.ts"],"sourcesContent":["import type { RefObject } from 'react'\n\nimport { useCallback, useEffect, useRef } from 'react'\n\nexport type PointerPosition = { x: number; y: number }\n\ntype UsePointerSafeAreaArgs = {\n enabled: boolean\n from: RefObject<HTMLElement | null>\n idleTimeout?: number\n onChange: (args: { polygon: null | string }) => void\n onRelease: (pointer: PointerPosition) => void\n to: RefObject<HTMLElement | null>\n}\n\n/** Tracks a safe area for pointer travel between two elements in either direction. */\nexport const usePointerSafeArea = ({\n enabled,\n from,\n idleTimeout = 300,\n onChange,\n onRelease,\n to,\n}: UsePointerSafeAreaArgs) => {\n const origin = useRef<PointerPosition | undefined>(undefined)\n const isReturning = useRef(false)\n const isProtected = useRef(false)\n const idleTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const callbacks = useRef({ onChange, onRelease })\n\n useEffect(() => {\n callbacks.current = { onChange, onRelease }\n }, [onChange, onRelease])\n\n const clear = useCallback(() => {\n clearTimeout(idleTimer.current)\n idleTimer.current = undefined\n if (isProtected.current) {\n isProtected.current = false\n callbacks.current.onChange({ polygon: null })\n }\n origin.current = undefined\n }, [])\n\n const release = useCallback(\n (pointer: PointerPosition) => {\n clear()\n callbacks.current.onRelease(pointer)\n },\n [clear],\n )\n\n const update = useCallback(\n ({ pointer }: { pointer?: PointerPosition } = {}) => {\n const target = isReturning.current ? from.current : to.current\n const start = origin.current\n\n if (!enabled || !target || !start || (!pointer && !isProtected.current)) {\n return false\n }\n\n const rect = target.getBoundingClientRect()\n if (rect.left <= start.x && rect.right >= start.x) {\n return false\n }\n const points = getSafeAreaPoints({ rect, start })\n\n if (pointer && !isInsideSafeArea({ pointer, points })) {\n return false\n }\n\n isProtected.current = true\n callbacks.current.onChange({\n polygon: `polygon(${points.map(({ x, y }) => `${x}px ${y}px`).join(', ')})`,\n })\n if (pointer) {\n clearTimeout(idleTimer.current)\n idleTimer.current = setTimeout(() => release(pointer), idleTimeout)\n }\n return true\n },\n [enabled, from, idleTimeout, release, to],\n )\n\n const trackSource = useCallback(\n (pointer: PointerPosition) => {\n clear()\n origin.current = pointer\n isReturning.current = false\n },\n [clear],\n )\n\n const trackTarget = useCallback(\n (pointer: PointerPosition) => {\n // A keyboard-opened target does not start pointer tracking on its own.\n if (!origin.current) {\n return\n }\n clear()\n origin.current = pointer\n isReturning.current = true\n },\n [clear],\n )\n\n useEffect(() => {\n if (!enabled) {\n clear()\n return\n }\n\n const handleMove = (event: PointerEvent) => {\n if (event.pointerType !== 'mouse' || !origin.current) {\n return\n }\n const pointer = { x: event.clientX, y: event.clientY }\n const target = event.target as Node | null\n\n if (target && from.current?.contains(target)) {\n trackSource(pointer)\n } else if (target && to.current?.contains(target)) {\n trackTarget(pointer)\n } else if (isProtected.current && !update({ pointer })) {\n release(pointer)\n }\n }\n const handlePress = (event: PointerEvent) => {\n if (event.pointerType === 'mouse') {\n // Preserve tracking after clicks that keep either endpoint open, while\n // letting clicks elsewhere reach their target without sending a replacement event.\n const pointer = { x: event.clientX, y: event.clientY }\n const target = event.target as Node | null\n\n if (target && from.current?.contains(target)) {\n trackSource(pointer)\n } else if (target && to.current?.contains(target)) {\n trackTarget(pointer)\n } else {\n clear()\n }\n }\n }\n const document = from.current?.ownerDocument\n\n document?.addEventListener('pointermove', handleMove, { capture: true, passive: true })\n document?.addEventListener('pointerdown', handlePress, { capture: true, passive: true })\n return () => {\n document?.removeEventListener('pointermove', handleMove, { capture: true })\n document?.removeEventListener('pointerdown', handlePress, { capture: true })\n clear()\n }\n }, [clear, enabled, from, release, to, trackSource, trackTarget, update])\n\n return {\n clear,\n isProtected: useCallback(() => isProtected.current, []),\n isTracking: useCallback(() => origin.current !== undefined, []),\n protect: ({ pointer }: { pointer: PointerPosition }) => update({ pointer }),\n refresh: () => update(),\n trackSource,\n trackTarget,\n }\n}\n\nconst isInsideSafeArea = ({\n pointer,\n points,\n}: {\n pointer: PointerPosition\n points: PointerPosition[]\n}) =>\n points.every((edgeStart, index) =>\n isPointerInsideEdge({\n edgeEnd: points[(index + 1) % points.length],\n edgeStart,\n pointer,\n }),\n )\n\n// The convex hull covers the whole destination, allowing return paths to enter\n// through its top or bottom as well as its nearest edge.\nconst getSafeAreaPoints = ({ rect, start }: { rect: DOMRect; start: PointerPosition }) => {\n const points = [\n { x: start.x, y: start.y - 4 },\n { x: start.x, y: start.y + 4 },\n { x: rect.left, y: rect.top },\n { x: rect.right, y: rect.top },\n { x: rect.right, y: rect.bottom },\n { x: rect.left, y: rect.bottom },\n ].sort((a, b) => a.x - b.x || a.y - b.y)\n const getOuterEdge = ({ orderedPoints }: { orderedPoints: PointerPosition[] }) => {\n const edge: PointerPosition[] = []\n\n for (const point of orderedPoints) {\n while (edge.length > 1) {\n const previous = edge[edge.length - 2]\n const corner = edge[edge.length - 1]\n const edgeX = corner.x - previous.x\n const edgeY = corner.y - previous.y\n const pointX = point.x - previous.x\n const pointY = point.y - previous.y\n const shouldRemoveCorner = edgeX * pointY - edgeY * pointX <= 0\n\n // Remove corners that bend into the area or lie on a straight edge.\n if (!shouldRemoveCorner) {\n break\n }\n edge.pop()\n }\n edge.push(point)\n }\n return edge.slice(0, -1)\n }\n\n return [\n ...getOuterEdge({ orderedPoints: points }),\n ...getOuterEdge({ orderedPoints: [...points].reverse() }),\n ]\n}\n\n// Edges follow the safe area's point order. Points on the boundary count as inside.\nconst isPointerInsideEdge = ({\n edgeEnd,\n edgeStart,\n pointer,\n}: {\n edgeEnd: PointerPosition\n edgeStart: PointerPosition\n pointer: PointerPosition\n}): boolean =>\n (edgeEnd.x - edgeStart.x) * (pointer.y - edgeStart.y) -\n (edgeEnd.y - edgeStart.y) * (pointer.x - edgeStart.x) >=\n 0\n"],"mappings":"AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ;AAa/C;AACA,OAAO,MAAMC,kBAAA,GAAqBA,CAAC;EACjCC,OAAO;EACPC,IAAI;EACJC,WAAA,GAAc,GAAG;EACjBC,QAAQ;EACRC,SAAS;EACTC;AAAE,CACqB;EACvB,MAAMC,MAAA,GAASR,MAAA,CAAoCS,SAAA;EACnD,MAAMC,WAAA,GAAcV,MAAA,CAAO;EAC3B,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