@zag-js/focus-visible 0.1.0 → 0.1.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/index.d.ts +2 -1
- package/dist/index.js +38 -10
- package/dist/index.mjs +39 -10
- package/package.json +1 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -7
- package/dist/index.mjs.map +0 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
declare type Modality = "keyboard" | "pointer" | "virtual";
|
|
1
2
|
declare type FocusVisibleCallback = (isFocusVisible: boolean) => void;
|
|
2
3
|
export declare function trackFocusVisible(fn: FocusVisibleCallback): () => void;
|
|
4
|
+
export declare function trackInteractionModality(fn: (v: Modality | null) => void): () => void;
|
|
3
5
|
export {};
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -19,20 +20,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
20
|
// src/index.ts
|
|
20
21
|
var src_exports = {};
|
|
21
22
|
__export(src_exports, {
|
|
22
|
-
trackFocusVisible: () => trackFocusVisible
|
|
23
|
+
trackFocusVisible: () => trackFocusVisible,
|
|
24
|
+
trackInteractionModality: () => trackInteractionModality
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(src_exports);
|
|
25
27
|
var hasSetup = false;
|
|
26
28
|
var modality = null;
|
|
27
29
|
var hasEventBeforeFocus = false;
|
|
30
|
+
var hasBlurredWindowRecently = false;
|
|
28
31
|
var handlers = /* @__PURE__ */ new Set();
|
|
29
|
-
var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
|
|
30
|
-
function isValidKey(event) {
|
|
31
|
-
return !(event.metaKey || !isMac && event.altKey || event.ctrlKey);
|
|
32
|
-
}
|
|
33
32
|
function trigger(modality2, event) {
|
|
34
33
|
handlers.forEach((handler) => handler(modality2, event));
|
|
35
34
|
}
|
|
35
|
+
var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
|
|
36
|
+
function isValidKey(e) {
|
|
37
|
+
return !(e.metaKey || !isMac && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
38
|
+
}
|
|
36
39
|
function onKeyboardEvent(event) {
|
|
37
40
|
hasEventBeforeFocus = true;
|
|
38
41
|
if (isValidKey(event)) {
|
|
@@ -44,24 +47,40 @@ function onPointerEvent(event) {
|
|
|
44
47
|
modality = "pointer";
|
|
45
48
|
if (event.type === "mousedown" || event.type === "pointerdown") {
|
|
46
49
|
hasEventBeforeFocus = true;
|
|
50
|
+
const target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
51
|
+
if (target.matches(":focus-visible"))
|
|
52
|
+
return;
|
|
47
53
|
trigger("pointer", event);
|
|
48
54
|
}
|
|
49
55
|
}
|
|
56
|
+
function isVirtualClick(event) {
|
|
57
|
+
if (event.mozInputSource === 0 && event.isTrusted)
|
|
58
|
+
return true;
|
|
59
|
+
return event.detail === 0 && !event.pointerType;
|
|
60
|
+
}
|
|
61
|
+
function onClickEvent(e) {
|
|
62
|
+
if (isVirtualClick(e)) {
|
|
63
|
+
hasEventBeforeFocus = true;
|
|
64
|
+
modality = "virtual";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
50
67
|
function onWindowFocus(event) {
|
|
51
68
|
if (event.target === window || event.target === document) {
|
|
52
69
|
return;
|
|
53
70
|
}
|
|
54
|
-
if (!hasEventBeforeFocus) {
|
|
55
|
-
modality = "
|
|
56
|
-
trigger("
|
|
71
|
+
if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {
|
|
72
|
+
modality = "virtual";
|
|
73
|
+
trigger("virtual", event);
|
|
57
74
|
}
|
|
58
75
|
hasEventBeforeFocus = false;
|
|
76
|
+
hasBlurredWindowRecently = false;
|
|
59
77
|
}
|
|
60
78
|
function onWindowBlur() {
|
|
61
79
|
hasEventBeforeFocus = false;
|
|
80
|
+
hasBlurredWindowRecently = true;
|
|
62
81
|
}
|
|
63
82
|
function isFocusVisible() {
|
|
64
|
-
return modality !== "pointer";
|
|
83
|
+
return modality != null && modality !== "pointer";
|
|
65
84
|
}
|
|
66
85
|
function setupGlobalFocusEvents() {
|
|
67
86
|
if (typeof window === "undefined" || hasSetup) {
|
|
@@ -74,6 +93,7 @@ function setupGlobalFocusEvents() {
|
|
|
74
93
|
};
|
|
75
94
|
document.addEventListener("keydown", onKeyboardEvent, true);
|
|
76
95
|
document.addEventListener("keyup", onKeyboardEvent, true);
|
|
96
|
+
document.addEventListener("click", onClickEvent, true);
|
|
77
97
|
window.addEventListener("focus", onWindowFocus, true);
|
|
78
98
|
window.addEventListener("blur", onWindowBlur, false);
|
|
79
99
|
if (typeof PointerEvent !== "undefined") {
|
|
@@ -96,4 +116,12 @@ function trackFocusVisible(fn) {
|
|
|
96
116
|
handlers.delete(handler);
|
|
97
117
|
};
|
|
98
118
|
}
|
|
99
|
-
|
|
119
|
+
function trackInteractionModality(fn) {
|
|
120
|
+
setupGlobalFocusEvents();
|
|
121
|
+
fn(modality);
|
|
122
|
+
const handler = () => fn(modality);
|
|
123
|
+
handlers.add(handler);
|
|
124
|
+
return () => {
|
|
125
|
+
handlers.delete(handler);
|
|
126
|
+
};
|
|
127
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
// src/index.ts
|
|
2
4
|
var hasSetup = false;
|
|
3
5
|
var modality = null;
|
|
4
6
|
var hasEventBeforeFocus = false;
|
|
7
|
+
var hasBlurredWindowRecently = false;
|
|
5
8
|
var handlers = /* @__PURE__ */ new Set();
|
|
6
|
-
var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
|
|
7
|
-
function isValidKey(event) {
|
|
8
|
-
return !(event.metaKey || !isMac && event.altKey || event.ctrlKey);
|
|
9
|
-
}
|
|
10
9
|
function trigger(modality2, event) {
|
|
11
10
|
handlers.forEach((handler) => handler(modality2, event));
|
|
12
11
|
}
|
|
12
|
+
var isMac = typeof window !== "undefined" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false;
|
|
13
|
+
function isValidKey(e) {
|
|
14
|
+
return !(e.metaKey || !isMac && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
|
|
15
|
+
}
|
|
13
16
|
function onKeyboardEvent(event) {
|
|
14
17
|
hasEventBeforeFocus = true;
|
|
15
18
|
if (isValidKey(event)) {
|
|
@@ -21,24 +24,40 @@ function onPointerEvent(event) {
|
|
|
21
24
|
modality = "pointer";
|
|
22
25
|
if (event.type === "mousedown" || event.type === "pointerdown") {
|
|
23
26
|
hasEventBeforeFocus = true;
|
|
27
|
+
const target = event.composedPath ? event.composedPath()[0] : event.target;
|
|
28
|
+
if (target.matches(":focus-visible"))
|
|
29
|
+
return;
|
|
24
30
|
trigger("pointer", event);
|
|
25
31
|
}
|
|
26
32
|
}
|
|
33
|
+
function isVirtualClick(event) {
|
|
34
|
+
if (event.mozInputSource === 0 && event.isTrusted)
|
|
35
|
+
return true;
|
|
36
|
+
return event.detail === 0 && !event.pointerType;
|
|
37
|
+
}
|
|
38
|
+
function onClickEvent(e) {
|
|
39
|
+
if (isVirtualClick(e)) {
|
|
40
|
+
hasEventBeforeFocus = true;
|
|
41
|
+
modality = "virtual";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
27
44
|
function onWindowFocus(event) {
|
|
28
45
|
if (event.target === window || event.target === document) {
|
|
29
46
|
return;
|
|
30
47
|
}
|
|
31
|
-
if (!hasEventBeforeFocus) {
|
|
32
|
-
modality = "
|
|
33
|
-
trigger("
|
|
48
|
+
if (!hasEventBeforeFocus && !hasBlurredWindowRecently) {
|
|
49
|
+
modality = "virtual";
|
|
50
|
+
trigger("virtual", event);
|
|
34
51
|
}
|
|
35
52
|
hasEventBeforeFocus = false;
|
|
53
|
+
hasBlurredWindowRecently = false;
|
|
36
54
|
}
|
|
37
55
|
function onWindowBlur() {
|
|
38
56
|
hasEventBeforeFocus = false;
|
|
57
|
+
hasBlurredWindowRecently = true;
|
|
39
58
|
}
|
|
40
59
|
function isFocusVisible() {
|
|
41
|
-
return modality !== "pointer";
|
|
60
|
+
return modality != null && modality !== "pointer";
|
|
42
61
|
}
|
|
43
62
|
function setupGlobalFocusEvents() {
|
|
44
63
|
if (typeof window === "undefined" || hasSetup) {
|
|
@@ -51,6 +70,7 @@ function setupGlobalFocusEvents() {
|
|
|
51
70
|
};
|
|
52
71
|
document.addEventListener("keydown", onKeyboardEvent, true);
|
|
53
72
|
document.addEventListener("keyup", onKeyboardEvent, true);
|
|
73
|
+
document.addEventListener("click", onClickEvent, true);
|
|
54
74
|
window.addEventListener("focus", onWindowFocus, true);
|
|
55
75
|
window.addEventListener("blur", onWindowBlur, false);
|
|
56
76
|
if (typeof PointerEvent !== "undefined") {
|
|
@@ -73,7 +93,16 @@ function trackFocusVisible(fn) {
|
|
|
73
93
|
handlers.delete(handler);
|
|
74
94
|
};
|
|
75
95
|
}
|
|
96
|
+
function trackInteractionModality(fn) {
|
|
97
|
+
setupGlobalFocusEvents();
|
|
98
|
+
fn(modality);
|
|
99
|
+
const handler = () => fn(modality);
|
|
100
|
+
handlers.add(handler);
|
|
101
|
+
return () => {
|
|
102
|
+
handlers.delete(handler);
|
|
103
|
+
};
|
|
104
|
+
}
|
|
76
105
|
export {
|
|
77
|
-
trackFocusVisible
|
|
106
|
+
trackFocusVisible,
|
|
107
|
+
trackInteractionModality
|
|
78
108
|
};
|
|
79
|
-
//# sourceMappingURL=index.mjs.map
|
package/package.json
CHANGED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,aAAK,oBAAoB,GAAG,CAAC,cAAc,EAAE,OAAO,KAAK,IAAI,CAAA;AAkG7D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,oBAAoB,cAUzD"}
|
package/dist/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["type Modality = \"keyboard\" | \"pointer\"\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent\ntype Handler = (modality: Modality, e: HandlerEvent) => void\ntype FocusVisibleCallback = (isFocusVisible: boolean) => void\n\nlet hasSetup = false\nlet modality: Modality | null = null\nlet hasEventBeforeFocus = false\n\nconst handlers = new Set<Handler>()\n\nconst isMac = typeof window !== \"undefined\" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false\n\nfunction isValidKey(event: KeyboardEvent) {\n return !(event.metaKey || (!isMac && event.altKey) || event.ctrlKey)\n}\n\nfunction trigger(modality: Modality, event: HandlerEvent) {\n handlers.forEach((handler) => handler(modality, event))\n}\n\nfunction onKeyboardEvent(event: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(event)) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n}\n\nfunction onPointerEvent(event: PointerEvent | MouseEvent) {\n modality = \"pointer\"\n if (event.type === \"mousedown\" || event.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n trigger(\"pointer\", event)\n }\n}\n\nfunction onWindowFocus(event: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n if (event.target === window || event.target === document) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to keyboard modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n\n hasEventBeforeFocus = false\n}\n\nfunction onWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n}\n\nfunction isFocusVisible() {\n return modality !== \"pointer\"\n}\n\nfunction setupGlobalFocusEvents() {\n if (typeof window === \"undefined\" || hasSetup) {\n return\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n const { focus } = HTMLElement.prototype\n HTMLElement.prototype.focus = function focusElement(...args) {\n hasEventBeforeFocus = true\n focus.apply(this, args)\n }\n\n document.addEventListener(\"keydown\", onKeyboardEvent, true)\n document.addEventListener(\"keyup\", onKeyboardEvent, true)\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n window.addEventListener(\"focus\", onWindowFocus, true)\n window.addEventListener(\"blur\", onWindowBlur, false)\n\n if (typeof PointerEvent !== \"undefined\") {\n document.addEventListener(\"pointerdown\", onPointerEvent, true)\n document.addEventListener(\"pointermove\", onPointerEvent, true)\n document.addEventListener(\"pointerup\", onPointerEvent, true)\n } else {\n document.addEventListener(\"mousedown\", onPointerEvent, true)\n document.addEventListener(\"mousemove\", onPointerEvent, true)\n document.addEventListener(\"mouseup\", onPointerEvent, true)\n }\n\n hasSetup = true\n}\n\nexport function trackFocusVisible(fn: FocusVisibleCallback) {\n setupGlobalFocusEvents()\n\n fn(isFocusVisible())\n const handler = () => fn(isFocusVisible())\n\n handlers.add(handler)\n return () => {\n handlers.delete(handler)\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,IAAI,WAAW;AACf,IAAI,W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iBAAiB,aAAa;AACvC,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,eAAe,gBAAgB,IAAI;AAC7D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAAA,EAC7D,OAAO;AACL,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,aAAa,gBAAgB,IAAI;AAC3D,aAAS,iBAAiB,WAAW,gBAAgB,IAAI;AAAA,EAC3D;AAEA,aAAW;AACb;AAEO,2BAA2B,IAA0B;AAC1D,yBAAuB;AAEvB,KAAG,eAAe,CAAC;AACnB,QAAM,UAAU,MAAM,GAAG,eAAe,CAAC;AAEzC,WAAS,IAAI,OAAO;AACpB,SAAO,MAAM;AACX,aAAS,OAAO,OAAO;AAAA,EACzB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/index.mjs.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["type Modality = \"keyboard\" | \"pointer\"\ntype HandlerEvent = PointerEvent | MouseEvent | KeyboardEvent | FocusEvent\ntype Handler = (modality: Modality, e: HandlerEvent) => void\ntype FocusVisibleCallback = (isFocusVisible: boolean) => void\n\nlet hasSetup = false\nlet modality: Modality | null = null\nlet hasEventBeforeFocus = false\n\nconst handlers = new Set<Handler>()\n\nconst isMac = typeof window !== \"undefined\" && window.navigator != null ? /^Mac/.test(window.navigator.platform) : false\n\nfunction isValidKey(event: KeyboardEvent) {\n return !(event.metaKey || (!isMac && event.altKey) || event.ctrlKey)\n}\n\nfunction trigger(modality: Modality, event: HandlerEvent) {\n handlers.forEach((handler) => handler(modality, event))\n}\n\nfunction onKeyboardEvent(event: KeyboardEvent) {\n hasEventBeforeFocus = true\n if (isValidKey(event)) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n}\n\nfunction onPointerEvent(event: PointerEvent | MouseEvent) {\n modality = \"pointer\"\n if (event.type === \"mousedown\" || event.type === \"pointerdown\") {\n hasEventBeforeFocus = true\n trigger(\"pointer\", event)\n }\n}\n\nfunction onWindowFocus(event: FocusEvent) {\n // Firefox fires two extra focus events when the user first clicks into an iframe:\n // first on the window, then on the document. We ignore these events so they don't\n // cause keyboard focus rings to appear.\n if (event.target === window || event.target === document) {\n return\n }\n\n // If a focus event occurs without a preceding keyboard or pointer event, switch to keyboard modality.\n // This occurs, for example, when navigating a form with the next/previous buttons on iOS.\n if (!hasEventBeforeFocus) {\n modality = \"keyboard\"\n trigger(\"keyboard\", event)\n }\n\n hasEventBeforeFocus = false\n}\n\nfunction onWindowBlur() {\n // When the window is blurred, reset state. This is necessary when tabbing out of the window,\n // for example, since a subsequent focus event won't be fired.\n hasEventBeforeFocus = false\n}\n\nfunction isFocusVisible() {\n return modality !== \"pointer\"\n}\n\nfunction setupGlobalFocusEvents() {\n if (typeof window === \"undefined\" || hasSetup) {\n return\n }\n\n // Programmatic focus() calls shouldn't affect the current input modality.\n // However, we need to detect other cases when a focus event occurs without\n // a preceding user event (e.g. screen reader focus). Overriding the focus\n // method on HTMLElement.prototype is a bit hacky, but works.\n const { focus } = HTMLElement.prototype\n HTMLElement.prototype.focus = function focusElement(...args) {\n hasEventBeforeFocus = true\n focus.apply(this, args)\n }\n\n document.addEventListener(\"keydown\", onKeyboardEvent, true)\n document.addEventListener(\"keyup\", onKeyboardEvent, true)\n\n // Register focus events on the window so they are sure to happen\n // before React's event listeners (registered on the document).\n window.addEventListener(\"focus\", onWindowFocus, true)\n window.addEventListener(\"blur\", onWindowBlur, false)\n\n if (typeof PointerEvent !== \"undefined\") {\n document.addEventListener(\"pointerdown\", onPointerEvent, true)\n document.addEventListener(\"pointermove\", onPointerEvent, true)\n document.addEventListener(\"pointerup\", onPointerEvent, true)\n } else {\n document.addEventListener(\"mousedown\", onPointerEvent, true)\n document.addEventListener(\"mousemove\", onPointerEvent, true)\n document.addEventListener(\"mouseup\", onPointerEvent, true)\n }\n\n hasSetup = true\n}\n\nexport function trackFocusVisible(fn: FocusVisibleCallback) {\n setupGlobalFocusEvents()\n\n fn(isFocusVisible())\n const handler = () => fn(isFocusVisible())\n\n handlers.add(handler)\n return () => {\n handlers.delete(handler)\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAKA,IAAI,WAAW;AACf,IAAI,WAA4B;AAChC,IAAI,sBAAsB;AAE1B,IAAM,WAAW,oBAAI,IAAa;AAElC,IAAM,QAAQ,OAAO,WAAW,eAAe,OAAO,aAAa,OAAO,OAAO,KAAK,OAAO,UAAU,QAAQ,IAAI;AAEnH,oBAAoB,OAAsB;AACxC,SAAO,CAAE,OAAM,WAAY,CAAC,SAAS,MAAM,UAAW,MAAM;AAC9D;AAEA,iBAAiB,WAAoB,OAAqB;AACxD,WAAS,QAAQ,CAAC,YAAY,QAAQ,WAAU,KAAK,CAAC;AACxD;AAEA,yBAAyB,OAAsB;AAC7C,wBAAsB;AACtB,MAAI,WAAW,KAAK,GAAG;AACrB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AACF;AAEA,wBAAwB,OAAkC;AACxD,aAAW;AACX,MAAI,MAAM,SAAS,eAAe,MAAM,SAAS,eAAe;AAC9D,0BAAsB;AACtB,YAAQ,WAAW,KAAK;AAAA,EAC1B;AACF;AAEA,uBAAuB,OAAmB;AAIxC,MAAI,MAAM,WAAW,UAAU,MAAM,WAAW,UAAU;AACxD;AAAA,EACF;AAIA,MAAI,CAAC,qBAAqB;AACxB,eAAW;AACX,YAAQ,YAAY,KAAK;AAAA,EAC3B;AAEA,wBAAsB;AACxB;AAEA,wBAAwB;AAGtB,wBAAsB;AACxB;AAEA,0BAA0B;AACxB,SAAO,aAAa;AACtB;AAEA,kCAAkC;AAChC,MAAI,OAAO,WAAW,eAAe,UAAU;AAC7C;AAAA,EACF;AAMA,QAAM,EAAE,UAAU,YAAY;AAC9B,cAAY,UAAU,QAAQ,yBAAyB,MAAM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