@soomo/react-text-annotator 3.1.0-staging.7 → 3.1.0-staging.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TextAnnotatorPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/TextAnnotatorPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAC;AAiB3G,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,0BAA0B,CAAC;AAElC,UAAU,wBAAwB;IAEhC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,SAAS,CAAC;CAE1D;AAED,MAAM,WAAW,+BAA+B;IAE9C,UAAU,EAAE,cAAc,CAAC;IAE3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,CAAC;CAEtB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,CAuI3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,WAAW;yBAC5C,YAAY,CAAC,CAAC,CAAC;2BACb,YAAY,CAAC,CAAC,CAAC;yBACjB,UAAU,CAAC,CAAC,CAAC;uBACf,UAAU,CAAC,CAAC,CAAC;CAChC,CAAC"}
1
+ {"version":3,"file":"TextAnnotatorPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotatorPopup/TextAnnotatorPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAA6C,MAAM,OAAO,CAAC;AAiB3G,OAAO,EAIL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,0BAA0B,CAAC;AAElC,UAAU,wBAAwB;IAEhC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,SAAS,CAAC;CAE1D;AAED,MAAM,WAAW,+BAA+B;IAE9C,UAAU,EAAE,cAAc,CAAC;IAE3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,CAAC;CAEtB;AAED,eAAO,MAAM,kBAAkB,EAAE,EAAE,CAAC,wBAAwB,CAkI3D,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,GAAI,CAAC,SAAS,WAAW;yBAC5C,YAAY,CAAC,CAAC,CAAC;2BACb,YAAY,CAAC,CAAC,CAAC;yBACjB,UAAU,CAAC,CAAC,CAAC;uBACf,UAAU,CAAC,CAAC,CAAC;CAChC,CAAC"}
@@ -1,8 +1,8 @@
1
- import defaultBehaviors from "./react-text-annotator.es23.js";
2
- import * as utilities from "./react-text-annotator.es24.js";
3
- import { hideContent, defineCustomElement, tagName } from "./react-text-annotator.es24.js";
4
- import { addBehaviors, addBehavior, removeBehavior } from "./react-text-annotator.es25.js";
5
- import { learnElementNames, learnCustomElementNames } from "./react-text-annotator.es26.js";
1
+ import defaultBehaviors from "./react-text-annotator.es26.js";
2
+ import * as utilities from "./react-text-annotator.es27.js";
3
+ import { hideContent, defineCustomElement, tagName } from "./react-text-annotator.es27.js";
4
+ import { addBehaviors, addBehavior, removeBehavior } from "./react-text-annotator.es28.js";
5
+ import { learnElementNames, learnCustomElementNames } from "./react-text-annotator.es29.js";
6
6
  class CETEI {
7
7
  constructor(options) {
8
8
  this.options = options ? options : {};
@@ -1,8 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { useLayoutEffect, useEffect, useRef } from "react";
3
- import { isTypeableCombobox, getDocument, activeElement, contains, isVirtualClick, isVirtualPointerEvent, isSafari, stopEvent, getTarget, isReactEvent, isRootElement, isEventTargetWithin } from "./react-text-annotator.es27.js";
4
- import { isHTMLElement, isElement, getOverflowAncestors, getNodeName, isLastTraversableNode, getParentNode, getComputedStyle } from "./react-text-annotator.es28.js";
5
- import { isTabbable, tabbable } from "./react-text-annotator.es29.js";
3
+ import { isTypeableCombobox, getDocument, activeElement, contains, isVirtualClick, isVirtualPointerEvent, isSafari, stopEvent, getTarget, isReactEvent, isRootElement, isEventTargetWithin } from "./react-text-annotator.es23.js";
4
+ import { isHTMLElement, isElement, getOverflowAncestors, getNodeName, isLastTraversableNode, getParentNode, getComputedStyle } from "./react-text-annotator.es24.js";
5
+ import { isTabbable, tabbable } from "./react-text-annotator.es25.js";
6
6
  import * as ReactDOM from "react-dom";
7
7
  import { useFloating as useFloating$1 } from "./react-text-annotator.es14.js";
8
8
  import { flip, inline, offset, shift } from "./react-text-annotator.es14.js";
@@ -1,6 +1,6 @@
1
1
  import { offset as offset$1, shift as shift$1, flip as flip$1, inline as inline$1, computePosition as computePosition$1 } from "./react-text-annotator.es31.js";
2
2
  import { createCoords, rectToClientRect, round, floor, max, min } from "./react-text-annotator.es30.js";
3
- import { getOverflowAncestors, isElement, getWindow, getFrameElement, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock } from "./react-text-annotator.es28.js";
3
+ import { getOverflowAncestors, isElement, getWindow, getFrameElement, getComputedStyle, getDocumentElement, isHTMLElement, isWebKit, isTopLayer, getNodeName, isOverflowElement, getNodeScroll, getParentNode, isLastTraversableNode, isTableElement, isContainingBlock, getContainingBlock } from "./react-text-annotator.es24.js";
4
4
  function getCssDimensions(element) {
5
5
  const css = getComputedStyle(element);
6
6
  let width = parseFloat(css.width) || 0;
@@ -1,117 +1,130 @@
1
- const defaultBehaviors = {
2
- "namespaces": {
3
- "tei": "http://www.tei-c.org/ns/1.0",
4
- "teieg": "http://www.tei-c.org/ns/Examples",
5
- "rng": "http://relaxng.org/ns/structure/1.0"
6
- },
7
- "tei": {
8
- "eg": ["<pre>", "</pre>"],
9
- // inserts a link inside <ptr> using the @target; the link in the
10
- // @href is piped through the rw (rewrite) function before insertion
11
- "ptr": ['<a href="$rw@target">$@target</a>'],
12
- // wraps the content of the <ref> in an HTML link with the @target in
13
- // the @href. If there are multiple @targets, only the first is used.
14
- "ref": [
15
- ["[target]", ['<a href="$rw@target">', "</a>"]]
16
- ],
17
- // creates an img tag with the @url as the src attribute
18
- "graphic": function(elt) {
19
- let content = new Image();
20
- content.src = this.rw(elt.getAttribute("url"));
21
- if (elt.hasAttribute("width")) {
22
- content.setAttribute("width", elt.getAttribute("width"));
23
- }
24
- if (elt.hasAttribute("height")) {
25
- content.setAttribute("height", elt.getAttribute("height"));
26
- }
27
- return content;
28
- },
29
- "list": [
30
- // will only run on a list where @type="gloss"
31
- [
32
- "[type=gloss]",
33
- function(elt) {
34
- const doc = elt.ownerDocument;
35
- let dl = doc.createElement("dl");
36
- for (let child of Array.from(elt.children)) {
37
- if (child.nodeType == 1) {
38
- if (child.localName == "tei-label") {
39
- let dt = doc.createElement("dt");
40
- dt.innerHTML = child.innerHTML;
41
- dl.appendChild(dt);
42
- }
43
- if (child.localName == "tei-item") {
44
- let dd = doc.createElement("dd");
45
- dd.innerHTML = child.innerHTML;
46
- dl.appendChild(dd);
47
- }
48
- }
49
- }
50
- return dl;
51
- }
52
- ]
53
- ],
54
- "note": [
55
- // Make endnotes
56
- ["[place=end]", function(elt) {
57
- const doc = elt.ownerDocument;
58
- if (!this.noteIndex) {
59
- this["noteIndex"] = 1;
60
- } else {
61
- this.noteIndex++;
62
- }
63
- let id = "_note_" + this.noteIndex;
64
- let link = doc.createElement("a");
65
- link.setAttribute("id", "src" + id);
66
- link.setAttribute("href", "#" + id);
67
- link.innerHTML = this.noteIndex;
68
- let content = doc.createElement("sup");
69
- content.appendChild(link);
70
- let notes = doc.querySelector("ol.notes");
71
- if (!notes) {
72
- notes = doc.createElement("ol");
73
- notes.setAttribute("class", "notes");
74
- this.dom.appendChild(notes);
75
- }
76
- let note = doc.createElement("li");
77
- note.id = id;
78
- note.innerHTML = elt.innerHTML;
79
- notes.appendChild(note);
80
- return content;
81
- }],
82
- ["_", ["(", ")"]]
83
- ],
84
- // Hide the teiHeader by default
85
- "teiHeader": function(e) {
86
- this.hideContent(e, false);
87
- },
88
- // Make the title element the HTML title
89
- "title": [
90
- ["tei-titlestmt>tei-title", function(elt) {
91
- const doc = elt.ownerDocument;
92
- let title = doc.createElement("title");
93
- title.innerHTML = elt.innerText;
94
- doc.querySelector("head").appendChild(title);
95
- }]
96
- ]
97
- },
98
- "teieg": {
99
- "egXML": function(elt) {
100
- const doc = elt.ownerDocument;
101
- let pre = doc.createElement("pre");
102
- let code = doc.createElement("code");
103
- pre.appendChild(code);
104
- let content = this.serialize(elt, true).replace(/</g, "&lt;");
105
- let ws = content.match(/^[\t ]+/);
106
- if (ws) {
107
- content = content.replace(new RegExp("^" + ws[0], "mg"), "");
1
+ import { isShadowRoot, isHTMLElement } from "./react-text-annotator.es24.js";
2
+ function activeElement(doc) {
3
+ let activeElement2 = doc.activeElement;
4
+ while (((_activeElement = activeElement2) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {
5
+ var _activeElement;
6
+ activeElement2 = activeElement2.shadowRoot.activeElement;
7
+ }
8
+ return activeElement2;
9
+ }
10
+ function contains(parent, child) {
11
+ if (!parent || !child) {
12
+ return false;
13
+ }
14
+ const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
15
+ if (parent.contains(child)) {
16
+ return true;
17
+ }
18
+ if (rootNode && isShadowRoot(rootNode)) {
19
+ let next = child;
20
+ while (next) {
21
+ if (parent === next) {
22
+ return true;
108
23
  }
109
- code.innerHTML = content;
110
- return pre;
24
+ next = next.parentNode || next.host;
111
25
  }
112
26
  }
113
- };
27
+ return false;
28
+ }
29
+ function getPlatform() {
30
+ const uaData = navigator.userAgentData;
31
+ if (uaData != null && uaData.platform) {
32
+ return uaData.platform;
33
+ }
34
+ return navigator.platform;
35
+ }
36
+ function getUserAgent() {
37
+ const uaData = navigator.userAgentData;
38
+ if (uaData && Array.isArray(uaData.brands)) {
39
+ return uaData.brands.map((_ref) => {
40
+ let {
41
+ brand,
42
+ version
43
+ } = _ref;
44
+ return brand + "/" + version;
45
+ }).join(" ");
46
+ }
47
+ return navigator.userAgent;
48
+ }
49
+ function isVirtualClick(event) {
50
+ if (event.mozInputSource === 0 && event.isTrusted) {
51
+ return true;
52
+ }
53
+ if (isAndroid() && event.pointerType) {
54
+ return event.type === "click" && event.buttons === 1;
55
+ }
56
+ return event.detail === 0 && !event.pointerType;
57
+ }
58
+ function isVirtualPointerEvent(event) {
59
+ if (isJSDOM()) return false;
60
+ return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "mouse" || // iOS VoiceOver returns 0.333• for width/height.
61
+ event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === "touch";
62
+ }
63
+ function isSafari() {
64
+ return /apple/i.test(navigator.vendor);
65
+ }
66
+ function isAndroid() {
67
+ const re = /android/i;
68
+ return re.test(getPlatform()) || re.test(getUserAgent());
69
+ }
70
+ function isJSDOM() {
71
+ return getUserAgent().includes("jsdom/");
72
+ }
73
+ function isReactEvent(event) {
74
+ return "nativeEvent" in event;
75
+ }
76
+ function isRootElement(element) {
77
+ return element.matches("html,body");
78
+ }
79
+ function getDocument(node) {
80
+ return (node == null ? void 0 : node.ownerDocument) || document;
81
+ }
82
+ function isEventTargetWithin(event, node) {
83
+ if (node == null) {
84
+ return false;
85
+ }
86
+ if ("composedPath" in event) {
87
+ return event.composedPath().includes(node);
88
+ }
89
+ const e = event;
90
+ return e.target != null && node.contains(e.target);
91
+ }
92
+ function getTarget(event) {
93
+ if ("composedPath" in event) {
94
+ return event.composedPath()[0];
95
+ }
96
+ return event.target;
97
+ }
98
+ const TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
99
+ function isTypeableElement(element) {
100
+ return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
101
+ }
102
+ function stopEvent(event) {
103
+ event.preventDefault();
104
+ event.stopPropagation();
105
+ }
106
+ function isTypeableCombobox(element) {
107
+ if (!element) return false;
108
+ return element.getAttribute("role") === "combobox" && isTypeableElement(element);
109
+ }
114
110
  export {
115
- defaultBehaviors as default
111
+ TYPEABLE_SELECTOR,
112
+ activeElement,
113
+ contains,
114
+ getDocument,
115
+ getPlatform,
116
+ getTarget,
117
+ getUserAgent,
118
+ isAndroid,
119
+ isEventTargetWithin,
120
+ isJSDOM,
121
+ isReactEvent,
122
+ isRootElement,
123
+ isSafari,
124
+ isTypeableCombobox,
125
+ isTypeableElement,
126
+ isVirtualClick,
127
+ isVirtualPointerEvent,
128
+ stopEvent
116
129
  };
117
130
  //# sourceMappingURL=react-text-annotator.es23.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es23.js","sources":["../../../node_modules/CETEIcean/src/defaultBehaviors.js"],"sourcesContent":["export default {\n \"namespaces\": {\n \"tei\": \"http://www.tei-c.org/ns/1.0\",\n \"teieg\": \"http://www.tei-c.org/ns/Examples\",\n \"rng\": \"http://relaxng.org/ns/structure/1.0\" \n },\n \"tei\": {\n \"eg\": [\"<pre>\",\"</pre>\"],\n // inserts a link inside <ptr> using the @target; the link in the\n // @href is piped through the rw (rewrite) function before insertion\n \"ptr\": [\"<a href=\\\"$rw@target\\\">$@target</a>\"],\n // wraps the content of the <ref> in an HTML link with the @target in \n // the @href. If there are multiple @targets, only the first is used.\n \"ref\": [\n [\"[target]\", [\"<a href=\\\"$rw@target\\\">\",\"</a>\"]]\n ],\n // creates an img tag with the @url as the src attribute\n \"graphic\": function(elt) {\n let content = new Image();\n content.src = this.rw(elt.getAttribute(\"url\"));\n if (elt.hasAttribute(\"width\")) {\n content.setAttribute(\"width\",elt.getAttribute(\"width\"));\n }\n if (elt.hasAttribute(\"height\")) {\n content.setAttribute(\"height\",elt.getAttribute(\"height\"));\n }\n return content;\n },\n \"list\": [\n // will only run on a list where @type=\"gloss\"\n [\"[type=gloss]\", function(elt) {\n const doc = elt.ownerDocument;\n let dl = doc.createElement(\"dl\");\n for (let child of Array.from(elt.children)) {\n // nodeType 1 is Node.ELEMENT_NODE\n if (child.nodeType == 1) {\n if (child.localName == \"tei-label\") {\n let dt = doc.createElement(\"dt\");\n dt.innerHTML = child.innerHTML;\n dl.appendChild(dt);\n }\n if (child.localName == \"tei-item\") {\n let dd = doc.createElement(\"dd\");\n dd.innerHTML = child.innerHTML;\n dl.appendChild(dd);\n }\n }\n }\n return dl;\n }\n ]],\n \"note\": [\n // Make endnotes\n [\"[place=end]\", function(elt){\n const doc = elt.ownerDocument;\n if (!this.noteIndex){\n this[\"noteIndex\"] = 1;\n } else {\n this.noteIndex++;\n }\n let id = \"_note_\" + this.noteIndex;\n let link = doc.createElement(\"a\");\n link.setAttribute(\"id\", \"src\" + id);\n link.setAttribute(\"href\", \"#\" + id);\n link.innerHTML = this.noteIndex;\n let content = doc.createElement(\"sup\");\n content.appendChild(link);\n let notes = doc.querySelector(\"ol.notes\");\n if (!notes) {\n notes = doc.createElement(\"ol\");\n notes.setAttribute(\"class\", \"notes\");\n this.dom.appendChild(notes);\n }\n let note = doc.createElement(\"li\");\n note.id = id;\n note.innerHTML = elt.innerHTML;\n notes.appendChild(note);\n return content;\n }],\n [\"_\", [\"(\",\")\"]]\n ],\n // Hide the teiHeader by default\n \"teiHeader\": function(e) {\n this.hideContent(e, false);\n },\n // Make the title element the HTML title\n \"title\": [\n [\"tei-titlestmt>tei-title\", function(elt) {\n const doc = elt.ownerDocument;\n let title = doc.createElement(\"title\");\n title.innerHTML = elt.innerText;\n doc.querySelector(\"head\").appendChild(title);\n }]\n ],\n },\n \"teieg\": {\n \"egXML\": function(elt) {\n const doc = elt.ownerDocument;\n let pre = doc.createElement(\"pre\");\n let code = doc.createElement(\"code\");\n pre.appendChild(code);\n let content = this.serialize(elt, true).replace(/</g, \"&lt;\");\n let ws = content.match(/^[\\t ]+/);\n if (ws) {\n content = content.replace(new RegExp(\"^\" + ws[0], \"mg\"), \"\");\n }\n code.innerHTML = content;\n return pre;\n }\n }\n}\n"],"names":[],"mappings":"AAAA,MAAe,mBAAA;AAAA,EACb,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,EACR;AAAA,EACD,OAAO;AAAA,IACL,MAAM,CAAC,SAAQ,QAAQ;AAAA;AAAA;AAAA,IAGvB,OAAO,CAAC,mCAAqC;AAAA;AAAA;AAAA,IAG7C,OAAO;AAAA,MACL,CAAC,YAAY,CAAC,yBAA0B,MAAM,CAAC;AAAA,IAChD;AAAA;AAAA,IAED,WAAW,SAAS,KAAK;AACvB,UAAI,UAAU,IAAI;AAClB,cAAQ,MAAM,KAAK,GAAG,IAAI,aAAa,KAAK,CAAC;AAC7C,UAAI,IAAI,aAAa,OAAO,GAAG;AAC7B,gBAAQ,aAAa,SAAQ,IAAI,aAAa,OAAO,CAAC;AAAA,MACvD;AACD,UAAI,IAAI,aAAa,QAAQ,GAAG;AAC9B,gBAAQ,aAAa,UAAS,IAAI,aAAa,QAAQ,CAAC;AAAA,MACzD;AACD,aAAO;AAAA,IACR;AAAA,IACD,QAAQ;AAAA;AAAA,MAEN;AAAA,QAAC;AAAA,QAAgB,SAAS,KAAK;AAC7B,gBAAM,MAAM,IAAI;AAChB,cAAI,KAAK,IAAI,cAAc,IAAI;AAC/B,mBAAS,SAAS,MAAM,KAAK,IAAI,QAAQ,GAAG;AAE1C,gBAAI,MAAM,YAAY,GAAG;AACvB,kBAAI,MAAM,aAAa,aAAa;AAClC,oBAAI,KAAK,IAAI,cAAc,IAAI;AAC/B,mBAAG,YAAY,MAAM;AAC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cAAc,MAAM,EAAE,YAAY,KAAK;AAAA,MACnD,CAAO;AAAA,IACF;AAAA,EACF;AAAA,EACD,SAAS;AAAA,IACP,SAAS,SAAS,KAAK;AACrB,YAAM,MAAM,IAAI;AAChB,UAAI,MAAM,IAAI,cAAc,KAAK;AACjC,UAAI,OAAO,IAAI,cAAc,MAAM;AACnC,UAAI,YAAY,IAAI;AACpB,UAAI,UAAU,KAAK,UAAU,KAAK,IAAI,EAAE,QAAQ,MAAM,MAAM;AAC5D,UAAI,KAAK,QAAQ,MAAM,SAAS;AAChC,UAAI,IAAI;AACN,kBAAU,QAAQ,QAAQ,IAAI,OAAO,MAAM,GAAG,CAAC,GAAG,IAAI,GAAG,EAAE;AAAA,MAC5D;AACD,WAAK,YAAY;AACjB,aAAO;AAAA,IACR;AAAA,EACF;AACH;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"react-text-annotator.es23.js","sources":["../../../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs"],"sourcesContent":["import { isShadowRoot, isHTMLElement } from '@floating-ui/utils/dom';\n\nfunction activeElement(doc) {\n let activeElement = doc.activeElement;\n while (((_activeElement = activeElement) == null || (_activeElement = _activeElement.shadowRoot) == null ? void 0 : _activeElement.activeElement) != null) {\n var _activeElement;\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n\n // then fallback to custom implementation with Shadow DOM support\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next) {\n return true;\n }\n // @ts-ignore\n next = next.parentNode || next.host;\n }\n }\n\n // Give up, the result is false\n return false;\n}\n// Avoid Chrome DevTools blue warning.\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n return navigator.userAgent;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/utils/src/isVirtualEvent.ts\nfunction isVirtualClick(event) {\n // FIXME: Firefox is now emitting a deprecation warning for `mozInputSource`.\n // Try to find a workaround for this. `react-aria` source still has the check.\n if (event.mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n if (isAndroid() && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nfunction isVirtualPointerEvent(event) {\n if (isJSDOM()) return false;\n return !isAndroid() && event.width === 0 && event.height === 0 || isAndroid() && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nfunction isSafari() {\n // Chrome DevTools does not complain about navigator.vendor\n return /apple/i.test(navigator.vendor);\n}\nfunction isAndroid() {\n const re = /android/i;\n return re.test(getPlatform()) || re.test(getUserAgent());\n}\nfunction isMac() {\n return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\n}\nfunction isJSDOM() {\n return getUserAgent().includes('jsdom/');\n}\nfunction isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nfunction isReactEvent(event) {\n return 'nativeEvent' in event;\n}\nfunction isRootElement(element) {\n return element.matches('html,body');\n}\nfunction getDocument(node) {\n return (node == null ? void 0 : node.ownerDocument) || document;\n}\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const e = event;\n return e.target != null && node.contains(e.target);\n}\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n return event.target;\n}\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nfunction isTypeableCombobox(element) {\n if (!element) return false;\n return element.getAttribute('role') === 'combobox' && isTypeableElement(element);\n}\n\nexport { TYPEABLE_SELECTOR, activeElement, contains, getDocument, getPlatform, getTarget, getUserAgent, isAndroid, isEventTargetWithin, isJSDOM, isMac, isMouseLikePointerType, isReactEvent, isRootElement, isSafari, isTypeableCombobox, isTypeableElement, isVirtualClick, isVirtualPointerEvent, stopEvent };\n"],"names":["activeElement"],"mappings":";AAEA,SAAS,cAAc,KAAK;AAC1B,MAAIA,iBAAgB,IAAI;AACxB,WAAS,iBAAiBA,mBAAkB,SAAS,iBAAiB,eAAe,eAAe,OAAO,SAAS,eAAe,kBAAkB,MAAM;AACzJ,QAAI;AACJ,IAAAA,iBAAgBA,eAAc,WAAW;AAAA,EAC1C;AACD,SAAOA;AACT;AACA,SAAS,SAAS,QAAQ,OAAO;AAC/B,MAAI,CAAC,UAAU,CAAC,OAAO;AACrB,WAAO;AAAA,EACR;AACD,QAAM,WAAW,MAAM,eAAe,OAAO,SAAS,MAAM;AAG5D,MAAI,OAAO,SAAS,KAAK,GAAG;AAC1B,WAAO;AAAA,EACR;AAGD,MAAI,YAAY,aAAa,QAAQ,GAAG;AACtC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