@thednp/shorty 2.0.6 → 2.0.7

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/shorty.mjs CHANGED
@@ -1,68 +1,68 @@
1
- const he = "aria-checked", ye = "aria-description", we = "aria-describedby", Ae = "aria-expanded", Se = "aria-haspopup", X = "aria-hidden", Ne = "aria-label", Te = "aria-labelledby", Me = "aria-modal", ke = "aria-pressed", De = "aria-selected", Ce = "aria-valuemin", Oe = "aria-valuemax", Le = "aria-valuenow", Ie = "aria-valuetext", Y = "abort", Z = "beforeunload", _ = "blur", $ = "change", tt = "contextmenu", P = "DOMContentLoaded", et = "DOMMouseScroll", nt = "error", ot = "focus", st = "focusin", ct = "focusout", rt = "gesturechange", at = "gestureend", it = "gesturestart", ut = "keydown", lt = "keypress", dt = "keyup", pt = "load", ft = "click", mt = "dblclick", gt = "mousedown", vt = "mouseup", Et = "hover", bt = "mouseenter", ht = "mouseleave", yt = "mousein", wt = "mouseout", At = "mouseover", St = "mousemove", Nt = "mousewheel", Tt = "move", Mt = "orientationchange", kt = "pointercancel", Dt = "pointerdown", Ct = "pointerleave", Ot = "pointermove", Lt = "pointerup", It = "readystatechange", xt = "reset", zt = "resize", Vt = "select", Bt = "selectend", Ft = "selectstart", Ht = "scroll", Pt = "submit", Ut = "touchstart", Wt = "touchmove", Rt = "touchcancel", Qt = "touchend", jt = "unload", xe = {
2
- DOMContentLoaded: P,
3
- DOMMouseScroll: et,
4
- abort: Y,
5
- beforeunload: Z,
6
- blur: _,
7
- change: $,
8
- click: ft,
9
- contextmenu: tt,
10
- dblclick: mt,
11
- error: nt,
12
- focus: ot,
13
- focusin: st,
14
- focusout: ct,
15
- gesturechange: rt,
16
- gestureend: at,
17
- gesturestart: it,
18
- hover: Et,
19
- keydown: ut,
20
- keypress: lt,
21
- keyup: dt,
22
- load: pt,
23
- mousedown: gt,
24
- mousemove: St,
25
- mousein: yt,
26
- mouseout: wt,
27
- mouseenter: bt,
28
- mouseleave: ht,
29
- mouseover: At,
30
- mouseup: vt,
31
- mousewheel: Nt,
32
- move: Tt,
33
- orientationchange: Mt,
34
- pointercancel: kt,
35
- pointerdown: Dt,
36
- pointerleave: Ct,
37
- pointermove: Ot,
38
- pointerup: Lt,
39
- readystatechange: It,
40
- reset: xt,
41
- resize: zt,
42
- scroll: Ht,
43
- select: Vt,
44
- selectend: Bt,
45
- selectstart: Ft,
46
- submit: Pt,
47
- touchcancel: Rt,
48
- touchend: Qt,
49
- touchmove: Wt,
50
- touchstart: Ut,
51
- unload: jt
52
- }, ze = "drag", Ve = "dragstart", Be = "dragenter", Fe = "dragleave", He = "dragover", Pe = "dragend", Ue = "loadstart", We = {
1
+ const ariaChecked = "aria-checked", ariaDescription = "aria-description", ariaDescribedBy = "aria-describedby", ariaExpanded = "aria-expanded", ariaHasPopup = "aria-haspopup", ariaHidden = "aria-hidden", ariaLabel = "aria-label", ariaLabelledBy = "aria-labelledby", ariaModal = "aria-modal", ariaPressed = "aria-pressed", ariaSelected = "aria-selected", ariaValueMin = "aria-valuemin", ariaValueMax = "aria-valuemax", ariaValueNow = "aria-valuenow", ariaValueText = "aria-valuetext", abortEvent = "abort", beforeunloadEvent = "beforeunload", blurEvent = "blur", changeEvent = "change", contextmenuEvent = "contextmenu", DOMContentLoadedEvent = "DOMContentLoaded", DOMMouseScrollEvent = "DOMMouseScroll", errorEvent = "error", focusEvent = "focus", focusinEvent = "focusin", focusoutEvent = "focusout", gesturechangeEvent = "gesturechange", gestureendEvent = "gestureend", gesturestartEvent = "gesturestart", keydownEvent = "keydown", keypressEvent = "keypress", keyupEvent = "keyup", loadEvent = "load", mouseclickEvent = "click", mousedblclickEvent = "dblclick", mousedownEvent = "mousedown", mouseupEvent = "mouseup", mousehoverEvent = "hover", mouseenterEvent = "mouseenter", mouseleaveEvent = "mouseleave", mouseinEvent = "mousein", mouseoutEvent = "mouseout", mouseoverEvent = "mouseover", mousemoveEvent = "mousemove", mousewheelEvent = "mousewheel", moveEvent = "move", orientationchangeEvent = "orientationchange", pointercancelEvent = "pointercancel", pointerdownEvent = "pointerdown", pointerleaveEvent = "pointerleave", pointermoveEvent = "pointermove", pointerupEvent = "pointerup", readystatechangeEvent = "readystatechange", resetEvent = "reset", resizeEvent = "resize", selectEvent = "select", selectendEvent = "selectend", selectstartEvent = "selectstart", scrollEvent = "scroll", submitEvent = "submit", touchstartEvent = "touchstart", touchmoveEvent = "touchmove", touchcancelEvent = "touchcancel", touchendEvent = "touchend", unloadEvent = "unload", nativeEvents = {
2
+ DOMContentLoaded: DOMContentLoadedEvent,
3
+ DOMMouseScroll: DOMMouseScrollEvent,
4
+ abort: abortEvent,
5
+ beforeunload: beforeunloadEvent,
6
+ blur: blurEvent,
7
+ change: changeEvent,
8
+ click: mouseclickEvent,
9
+ contextmenu: contextmenuEvent,
10
+ dblclick: mousedblclickEvent,
11
+ error: errorEvent,
12
+ focus: focusEvent,
13
+ focusin: focusinEvent,
14
+ focusout: focusoutEvent,
15
+ gesturechange: gesturechangeEvent,
16
+ gestureend: gestureendEvent,
17
+ gesturestart: gesturestartEvent,
18
+ hover: mousehoverEvent,
19
+ keydown: keydownEvent,
20
+ keypress: keypressEvent,
21
+ keyup: keyupEvent,
22
+ load: loadEvent,
23
+ mousedown: mousedownEvent,
24
+ mousemove: mousemoveEvent,
25
+ mousein: mouseinEvent,
26
+ mouseout: mouseoutEvent,
27
+ mouseenter: mouseenterEvent,
28
+ mouseleave: mouseleaveEvent,
29
+ mouseover: mouseoverEvent,
30
+ mouseup: mouseupEvent,
31
+ mousewheel: mousewheelEvent,
32
+ move: moveEvent,
33
+ orientationchange: orientationchangeEvent,
34
+ pointercancel: pointercancelEvent,
35
+ pointerdown: pointerdownEvent,
36
+ pointerleave: pointerleaveEvent,
37
+ pointermove: pointermoveEvent,
38
+ pointerup: pointerupEvent,
39
+ readystatechange: readystatechangeEvent,
40
+ reset: resetEvent,
41
+ resize: resizeEvent,
42
+ scroll: scrollEvent,
43
+ select: selectEvent,
44
+ selectend: selectendEvent,
45
+ selectstart: selectstartEvent,
46
+ submit: submitEvent,
47
+ touchcancel: touchcancelEvent,
48
+ touchend: touchendEvent,
49
+ touchmove: touchmoveEvent,
50
+ touchstart: touchstartEvent,
51
+ unload: unloadEvent
52
+ }, dragEvent = "drag", dragstartEvent = "dragstart", dragenterEvent = "dragenter", dragleaveEvent = "dragleave", dragoverEvent = "dragover", dragendEvent = "dragend", loadstartEvent = "loadstart", mouseSwipeEvents = {
53
53
  start: "mousedown",
54
54
  end: "mouseup",
55
55
  move: "mousemove",
56
56
  cancel: "mouseleave"
57
- }, Re = { down: "mousedown", up: "mouseup" }, Qe = "onmouseleave" in document ? ["mouseenter", "mouseleave"] : (
57
+ }, mouseClickEvents = { down: "mousedown", up: "mouseup" }, mouseHoverEvents = "onmouseleave" in document ? ["mouseenter", "mouseleave"] : (
58
58
  /* istanbul ignore next @preserve */
59
59
  ["mouseover", "mouseout"]
60
- ), je = {
60
+ ), touchEvents = {
61
61
  start: "touchstart",
62
62
  end: "touchend",
63
63
  move: "touchmove",
64
64
  cancel: "touchcancel"
65
- }, qe = { in: "focusin", out: "focusout" }, qt = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]', Ge = {
65
+ }, focusEvents = { in: "focusin", out: "focusout" }, focusableSelector = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]', keyboardEventKeys = {
66
66
  Backspace: "Backspace",
67
67
  // 8
68
68
  Tab: "Tab",
@@ -101,7 +101,7 @@ const he = "aria-checked", ye = "aria-description", we = "aria-describedby", Ae
101
101
  // 93
102
102
  ScrollLock: "ScrollLock"
103
103
  // 145
104
- }, Ke = "Alt", Je = "ArrowDown", Xe = "ArrowUp", Ye = "ArrowLeft", Ze = "ArrowRight", _e = "Backspace", $e = "CapsLock", tn = "Control", en = "Delete", nn = "Enter", on = "NumpadEnter", sn = "Escape", cn = "Insert", rn = "Meta", an = "Pause", un = "ScrollLock", ln = "Shift", dn = "Space", pn = "Tab", Gt = "animationDuration", Kt = "animationDelay", U = "animationName", D = "animationend", Jt = "transitionDuration", Xt = "transitionDelay", C = "transitionend", W = "transitionProperty", fn = "addEventListener", mn = "removeEventListener", gn = {
104
+ }, keyAlt = "Alt", keyArrowDown = "ArrowDown", keyArrowUp = "ArrowUp", keyArrowLeft = "ArrowLeft", keyArrowRight = "ArrowRight", keyBackspace = "Backspace", keyCapsLock = "CapsLock", keyControl = "Control", keyDelete = "Delete", keyEnter = "Enter", keyNumpadEnter = "NumpadEnter", keyEscape = "Escape", keyInsert = "Insert", keyMeta = "Meta", keyPause = "Pause", keyScrollLock = "ScrollLock", keyShift = "Shift", keySpace = "Space", keyTab = "Tab", animationDuration = "animationDuration", animationDelay = "animationDelay", animationName = "animationName", animationEndEvent = "animationend", transitionDuration = "transitionDuration", transitionDelay = "transitionDelay", transitionEndEvent = "transitionend", transitionProperty = "transitionProperty", addEventListener = "addEventListener", removeEventListener = "removeEventListener", bezierEasings = {
105
105
  linear: "linear",
106
106
  easingSinusoidalIn: "cubic-bezier(0.47,0,0.745,0.715)",
107
107
  easingSinusoidalOut: "cubic-bezier(0.39,0.575,0.565,1)",
@@ -127,67 +127,59 @@ const he = "aria-checked", ye = "aria-description", we = "aria-describedby", Ae
127
127
  easingBackIn: "cubic-bezier(0.6,-0.28,0.735,0.045)",
128
128
  easingBackOut: "cubic-bezier(0.175,0.885,0.32,1.275)",
129
129
  easingBackInOut: "cubic-bezier(0.68,-0.55,0.265,1.55)"
130
- }, vn = "offsetHeight", En = "offsetWidth", bn = "scrollHeight", hn = "scrollWidth", yn = "tabindex", Yt = navigator.userAgentData, A = Yt, { userAgent: Zt } = navigator, S = Zt, z = /iPhone|iPad|iPod|Android/i;
131
- let O = !1;
132
- // istanbul ignore else @preserve
133
- A ? O = A.brands.some((t) => z.test(t.brand)) : O = z.test(S);
134
- const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
135
- (t) => V.test(t.brand)
136
- ) : (
137
- /* istanbul ignore next @preserve */
138
- V.test(S)
139
- ), Sn = S ? S.includes("Firefox") : (
140
- /* istanbul ignore next @preserve */
141
- !1
142
- ), { head: N } = document, Nn = ["webkitPerspective", "perspective"].some(
143
- (t) => t in N.style
144
- ), R = (t, e, n, o) => {
145
- const s = o || !1;
146
- t.addEventListener(
147
- e,
148
- n,
149
- s
130
+ }, offsetHeight = "offsetHeight", offsetWidth = "offsetWidth", scrollHeight = "scrollHeight", scrollWidth = "scrollWidth", tabindex = "tabindex", userAgentData = navigator.userAgentData, { userAgent: userAgentString } = navigator, userAgent = userAgentString, isMobile = () => {
131
+ const mobileBrands = /iPhone|iPad|iPod|Android/i;
132
+ return navigator?.userAgentData?.brands.some(
133
+ (x) => mobileBrands.test(x.brand)
134
+ ) || mobileBrands.test(navigator?.userAgent) || !1;
135
+ }, isApple = () => {
136
+ const appleBrands = /(iPhone|iPod|iPad)/;
137
+ return navigator?.userAgentData?.brands.some(
138
+ (x) => appleBrands.test(x.brand)
139
+ ) || /* istanbul ignore next @preserve */
140
+ appleBrands.test(
141
+ navigator?.userAgent
142
+ ) || !1;
143
+ }, isFirefox = () => navigator?.userAgent?.includes("Firefox") || /* istanbul ignore next @preserve */
144
+ !1, support3DTransform = () => ["webkitPerspective", "perspective"].some((p) => p in document.head.style), noop = () => {
145
+ }, on = (element, eventName, listener, options) => {
146
+ const ops = options || !1;
147
+ element.addEventListener(
148
+ eventName,
149
+ listener,
150
+ ops
150
151
  );
151
- }, Q = (t, e, n, o) => {
152
- const s = o || !1;
153
- t.removeEventListener(
154
- e,
155
- n,
156
- s
152
+ }, off = (element, eventName, listener, options) => {
153
+ const ops = options || !1;
154
+ element.removeEventListener(
155
+ eventName,
156
+ listener,
157
+ ops
157
158
  );
158
- }, _t = (t, e, n, o) => {
159
- const s = (c) => {
160
- // istanbul ignore else @preserve
161
- (c.target === t || c.currentTarget === t) && (n.apply(t, [c]), Q(t, e, s, o));
159
+ }, one = (element, eventName, listener, options) => {
160
+ const handlerWrapper = (e) => {
161
+ (e.target === element || e.currentTarget === element) && (listener.apply(element, [e]), off(element, eventName, handlerWrapper, options));
162
162
  };
163
- R(t, e, s, o);
164
- }, $t = () => {
165
- }, Tn = (() => {
166
- let t = !1;
163
+ on(element, eventName, handlerWrapper, options);
164
+ }, supportPassive = () => {
165
+ let result = !1;
167
166
  try {
168
- const e = Object.defineProperty({}, "passive", {
169
- get: () => (t = !0, t)
167
+ const opts = Object.defineProperty({}, "passive", {
168
+ get: () => (result = !0, result)
170
169
  });
171
- // istanbul ignore next @preserve
172
- _t(document, P, $t, e);
170
+ one(document, DOMContentLoadedEvent, noop, opts);
173
171
  } catch {
174
172
  }
175
- return t;
176
- })(), Mn = ["webkitTransform", "transform"].some(
177
- (t) => t in N.style
178
- ), kn = "ontouchstart" in window || /* istanbul ignore next @preserve */
179
- "msMaxTouchPoints" in navigator, Dn = ["webkitAnimation", "animation"].some(
180
- (t) => t in N.style
181
- ), Cn = ["webkitTransition", "transition"].some(
182
- (t) => t in N.style
183
- ), j = (t, e) => t.getAttribute(e), On = (t, e, n) => e.getAttributeNS(t, n), te = (t, e) => t.hasAttribute(e), Ln = (t, e, n) => e.hasAttributeNS(t, n), In = (t, e, n) => t.setAttribute(e, n), xn = (t, e, n, o) => e.setAttributeNS(t, n, o), zn = (t, e) => t.removeAttribute(e), Vn = (t, e, n) => e.removeAttributeNS(t, n), Bn = (t, ...e) => {
184
- t.classList.add(...e);
185
- }, Fn = (t, ...e) => {
186
- t.classList.remove(...e);
187
- }, Hn = (t, e) => t.classList.contains(e), { body: Pn } = document, { documentElement: Un } = document, Wn = (t) => Array.from(t), v = (t) => t != null && typeof t == "object" || !1, i = (t) => v(t) && typeof t.nodeType == "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some(
188
- (e) => t.nodeType === e
189
- ) || !1, l = (t) => i(t) && t.nodeType === 1 || !1, E = /* @__PURE__ */ new Map(), L = {
190
- data: E,
173
+ return result;
174
+ }, supportTransform = () => ["webkitTransform", "transform"].some((p) => p in document.head.style), supportTouch = () => "ontouchstart" in window || /* istanbul ignore next @preserve */
175
+ "msMaxTouchPoints" in navigator, supportAnimation = () => ["webkitAnimation", "animation"].some((p) => p in document.head.style), supportTransition = () => ["webkitTransition", "transition"].some((p) => p in document.head.style), getAttribute = (element, att) => element.getAttribute(att), getAttributeNS = (ns, element, att) => element.getAttributeNS(ns, att), hasAttribute = (element, att) => element.hasAttribute(att), hasAttributeNS = (ns, element, att) => element.hasAttributeNS(ns, att), setAttribute = (element, att, value) => element.setAttribute(att, value), setAttributeNS = (ns, element, att, value) => element.setAttributeNS(ns, att, value), removeAttribute = (element, att) => element.removeAttribute(att), removeAttributeNS = (ns, element, att) => element.removeAttributeNS(ns, att), addClass = (element, ...classNAME) => {
176
+ element.classList.add(...classNAME);
177
+ }, removeClass = (element, ...classNAME) => {
178
+ element.classList.remove(...classNAME);
179
+ }, hasClass = (element, classNAME) => element.classList.contains(classNAME), { body: documentBody } = document, { documentElement } = document, { head: documentHead } = document, ArrayFrom = (arr) => Array.from(arr), isObject = (obj) => obj != null && typeof obj == "object" || !1, isNode = (node) => isObject(node) && typeof node.nodeType == "number" && [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].some(
180
+ (x) => node.nodeType === x
181
+ ) || !1, isHTMLElement = (element) => isNode(element) && element.nodeType === 1 || !1, componentData = /* @__PURE__ */ new Map(), Data = {
182
+ data: componentData,
191
183
  /**
192
184
  * Sets web components data.
193
185
  *
@@ -195,10 +187,9 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
195
187
  * @param component the component's name or a unique key
196
188
  * @param instance the component instance
197
189
  */
198
- set: (t, e, n) => {
199
- if (!l(t)) return;
200
- // istanbul ignore else @preserve
201
- E.has(e) || E.set(e, /* @__PURE__ */ new Map()), E.get(e).set(t, n);
190
+ set: (element, component, instance) => {
191
+ if (!isHTMLElement(element)) return;
192
+ componentData.has(component) || componentData.set(component, /* @__PURE__ */ new Map()), componentData.get(component).set(element, instance);
202
193
  },
203
194
  /**
204
195
  * Returns all instances for specified component.
@@ -206,7 +197,7 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
206
197
  * @param component the component's name or a unique key
207
198
  * @returns all the component instances
208
199
  */
209
- getAllFor: (t) => E.get(t) || null,
200
+ getAllFor: (component) => componentData.get(component) || null,
210
201
  /**
211
202
  * Returns the instance associated with the target.
212
203
  *
@@ -214,10 +205,10 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
214
205
  * @param component the component's name or a unique key
215
206
  * @returns the instance
216
207
  */
217
- get: (t, e) => {
218
- if (!l(t) || !e) return null;
219
- const n = L.getAllFor(e);
220
- return t && n && n.get(t) || null;
208
+ get: (element, component) => {
209
+ if (!isHTMLElement(element) || !component) return null;
210
+ const instanceMap = Data.getAllFor(component);
211
+ return element && instanceMap && instanceMap.get(element) || null;
221
212
  },
222
213
  /**
223
214
  * Removes web components data.
@@ -225,138 +216,127 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
225
216
  * @param element target element
226
217
  * @param component the component's name or a unique key
227
218
  */
228
- remove: (t, e) => {
229
- const n = L.getAllFor(e);
230
- if (!n || !l(t)) return;
231
- n.delete(t);
232
- // istanbul ignore else @preserve
233
- n.size === 0 && E.delete(e);
219
+ remove: (element, component) => {
220
+ const instanceMap = Data.getAllFor(component);
221
+ !instanceMap || !isHTMLElement(element) || (instanceMap.delete(element), instanceMap.size === 0 && componentData.delete(component));
234
222
  }
235
- }, Rn = (t, e) => L.get(t, e), T = (t) => typeof t == "string" || !1, q = (t) => v(t) && t.constructor.name === "Window" || !1, G = (t) => i(t) && t.nodeType === 9 || !1, d = (t) => q(t) ? t.document : G(t) ? t : i(t) ? t.ownerDocument : globalThis.document, M = (t, ...e) => Object.assign(t, ...e), ee = (t) => {
236
- if (!t) return;
237
- if (T(t))
238
- return d().createElement(t);
239
- const { tagName: e } = t, n = ee(e);
240
- if (!n) return;
241
- const o = { ...t };
242
- return delete o.tagName, M(n, o);
243
- }, ne = (t, e) => {
244
- if (!t || !e) return;
245
- if (T(e))
246
- return d().createElementNS(t, e);
247
- const { tagName: n } = e, o = ne(t, n);
248
- if (!o) return;
249
- const s = { ...e };
250
- return delete s.tagName, M(o, s);
251
- }, K = (t, e) => t.dispatchEvent(e), Qn = (t, e, n) => n.indexOf(t) === e, g = (t, e) => {
252
- const n = getComputedStyle(t), o = e.replace("webkit", "Webkit").replace(/([A-Z])/g, "-$1").toLowerCase();
253
- return n.getPropertyValue(o);
254
- }, oe = (t) => {
255
- const e = g(t, U), n = g(t, Kt), o = n.includes("ms") ? (
223
+ }, getInstance = (target, component) => Data.get(target, component), isString = (str) => typeof str == "string" || !1, isWindow = (obj) => isObject(obj) && obj.constructor.name === "Window" || !1, isDocument = (obj) => isNode(obj) && obj.nodeType === 9 || !1, getDocument = (node) => isWindow(node) ? node.document : isDocument(node) ? node : isNode(node) ? node.ownerDocument : globalThis.document, ObjectAssign = (obj, ...source) => Object.assign(obj, ...source), createElement = (param) => {
224
+ if (!param) return;
225
+ if (isString(param))
226
+ return getDocument().createElement(param);
227
+ const { tagName } = param, newElement = createElement(tagName);
228
+ if (!newElement) return;
229
+ const attr = { ...param };
230
+ return delete attr.tagName, ObjectAssign(newElement, attr);
231
+ }, createElementNS = (ns, param) => {
232
+ if (!ns || !param) return;
233
+ if (isString(param))
234
+ return getDocument().createElementNS(ns, param);
235
+ const { tagName } = param, newElement = createElementNS(ns, tagName);
236
+ if (!newElement) return;
237
+ const attr = { ...param };
238
+ return delete attr.tagName, ObjectAssign(newElement, attr);
239
+ }, dispatchEvent = (element, event) => element.dispatchEvent(event), distinct = (value, index, arr) => arr.indexOf(value) === index, getElementStyle = (element, property) => {
240
+ const computedStyle = getComputedStyle(element), prop = property.replace("webkit", "Webkit").replace(/([A-Z])/g, "-$1").toLowerCase();
241
+ return computedStyle.getPropertyValue(prop);
242
+ }, getElementAnimationDelay = (element) => {
243
+ const propertyValue = getElementStyle(element, animationName), durationValue = getElementStyle(element, animationDelay), durationScale = durationValue.includes("ms") ? (
256
244
  /* istanbul ignore next */
257
245
  1
258
- ) : 1e3, s = e && e !== "none" ? parseFloat(n) * o : 0;
259
- return Number.isNaN(s) ? (
246
+ ) : 1e3, duration = propertyValue && propertyValue !== "none" ? parseFloat(durationValue) * durationScale : 0;
247
+ return Number.isNaN(duration) ? (
260
248
  /* istanbul ignore next */
261
249
  0
262
- ) : s;
263
- }, se = (t) => {
264
- const e = g(t, U), n = g(t, Gt), o = n.includes("ms") ? (
250
+ ) : duration;
251
+ }, getElementAnimationDuration = (element) => {
252
+ const propertyValue = getElementStyle(element, animationName), durationValue = getElementStyle(element, animationDuration), durationScale = durationValue.includes("ms") ? (
265
253
  /* istanbul ignore next */
266
254
  1
267
- ) : 1e3, s = e && e !== "none" ? parseFloat(n) * o : 0;
268
- return Number.isNaN(s) ? (
255
+ ) : 1e3, duration = propertyValue && propertyValue !== "none" ? parseFloat(durationValue) * durationScale : 0;
256
+ return Number.isNaN(duration) ? (
269
257
  /* istanbul ignore next */
270
258
  0
271
- ) : s;
272
- }, jn = (t, e) => {
273
- let n = 0;
274
- const o = new Event(D), s = se(t), c = oe(t);
275
- if (s) {
276
- const a = (u) => {
277
- // istanbul ignore else @preserve
278
- u.target === t && (e.apply(t, [u]), t.removeEventListener(D, a), n = 1);
259
+ ) : duration;
260
+ }, emulateAnimationEnd = (element, handler) => {
261
+ let called = 0;
262
+ const endEvent = new Event(animationEndEvent), duration = getElementAnimationDuration(element), delay = getElementAnimationDelay(element);
263
+ if (duration) {
264
+ const animationEndWrapper = (e) => {
265
+ e.target === element && (handler.apply(element, [e]), element.removeEventListener(animationEndEvent, animationEndWrapper), called = 1);
279
266
  };
280
- t.addEventListener(D, a), setTimeout(() => {
281
- // istanbul ignore next @preserve
282
- n || K(t, o);
283
- }, s + c + 17);
284
- } else {
285
- // istanbul ignore next @preserve
286
- e.apply(t, [o]);
287
- }
288
- }, ce = (t) => {
289
- const e = g(t, W), n = g(t, Xt), o = n.includes("ms") ? (
267
+ element.addEventListener(animationEndEvent, animationEndWrapper), setTimeout(() => {
268
+ called || dispatchEvent(element, endEvent);
269
+ }, duration + delay + 17);
270
+ } else
271
+ handler.apply(element, [endEvent]);
272
+ }, getElementTransitionDelay = (element) => {
273
+ const propertyValue = getElementStyle(element, transitionProperty), delayValue = getElementStyle(element, transitionDelay), delayScale = delayValue.includes("ms") ? (
290
274
  /* istanbul ignore next */
291
275
  1
292
- ) : 1e3, s = e && e !== "none" ? parseFloat(n) * o : (
276
+ ) : 1e3, duration = propertyValue && propertyValue !== "none" ? parseFloat(delayValue) * delayScale : (
293
277
  /* istanbul ignore next */
294
278
  0
295
279
  );
296
- return Number.isNaN(s) ? (
280
+ return Number.isNaN(duration) ? (
297
281
  /* istanbul ignore next */
298
282
  0
299
- ) : s;
300
- }, re = (t) => {
301
- const e = g(t, W), n = g(t, Jt), o = n.includes("ms") ? (
283
+ ) : duration;
284
+ }, getElementTransitionDuration = (element) => {
285
+ const propertyValue = getElementStyle(element, transitionProperty), durationValue = getElementStyle(element, transitionDuration), durationScale = durationValue.includes("ms") ? (
302
286
  /* istanbul ignore next */
303
287
  1
304
- ) : 1e3, s = e && e !== "none" ? parseFloat(n) * o : (
288
+ ) : 1e3, duration = propertyValue && propertyValue !== "none" ? parseFloat(durationValue) * durationScale : (
305
289
  /* istanbul ignore next */
306
290
  0
307
291
  );
308
- return Number.isNaN(s) ? (
292
+ return Number.isNaN(duration) ? (
309
293
  /* istanbul ignore next */
310
294
  0
311
- ) : s;
312
- }, qn = (t, e) => {
313
- let n = 0;
314
- const o = new Event(C), s = re(t), c = ce(t);
315
- if (s) {
316
- const a = (u) => {
317
- // istanbul ignore else @preserve
318
- u.target === t && (e.apply(t, [u]), t.removeEventListener(C, a), n = 1);
295
+ ) : duration;
296
+ }, emulateTransitionEnd = (element, handler) => {
297
+ let called = 0;
298
+ const endEvent = new Event(transitionEndEvent), duration = getElementTransitionDuration(element), delay = getElementTransitionDelay(element);
299
+ if (duration) {
300
+ const transitionEndWrapper = (e) => {
301
+ e.target === element && (handler.apply(element, [e]), element.removeEventListener(transitionEndEvent, transitionEndWrapper), called = 1);
319
302
  };
320
- t.addEventListener(C, a), setTimeout(() => {
321
- // istanbul ignore next @preserve
322
- n || K(t, o);
323
- }, s + c + 17);
303
+ element.addEventListener(transitionEndEvent, transitionEndWrapper), setTimeout(() => {
304
+ called || dispatchEvent(element, endEvent);
305
+ }, duration + delay + 17);
324
306
  } else
325
- e.apply(t, [o]);
326
- }, Gn = (t) => Float32Array.from(Array.from(t)), Kn = (t) => Float64Array.from(Array.from(t)), Jn = (t, e) => t.focus(e), B = (t) => ["true", !0].includes(t) ? !0 : ["false", !1].includes(t) ? !1 : ["null", "", null, void 0].includes(t) ? null : t !== "" && !Number.isNaN(+t) ? +t : t, w = (t) => Object.entries(t), ae = (t) => t.toLowerCase(), Xn = (t, e, n, o) => {
327
- const s = { ...n }, c = { ...t.dataset }, a = { ...e }, u = {}, p = "title";
328
- return w(c).forEach(([r, f]) => {
329
- const y = o && typeof r == "string" && r.includes(o) ? r.replace(o, "").replace(
307
+ handler.apply(element, [endEvent]);
308
+ }, Float32ArrayFrom = (arr) => Float32Array.from(Array.from(arr)), Float64ArrayFrom = (arr) => Float64Array.from(Array.from(arr)), focus = (element, options) => element.focus(options), normalizeValue = (value) => ["true", !0].includes(value) ? !0 : ["false", !1].includes(value) ? !1 : ["null", "", null, void 0].includes(value) ? null : value !== "" && !Number.isNaN(+value) ? +value : value, ObjectEntries = (obj) => Object.entries(obj), toLowerCase = (source) => source.toLowerCase(), normalizeOptions = (element, defaultOps, inputOps, ns) => {
309
+ const INPUT = { ...inputOps }, data = { ...element.dataset }, normalOps = { ...defaultOps }, dataOps = {}, title = "title";
310
+ return ObjectEntries(data).forEach(([k, v]) => {
311
+ const key = ns && typeof k == "string" && k.includes(ns) ? k.replace(ns, "").replace(
330
312
  /[A-Z]/g,
331
- (J) => ae(J)
313
+ (match) => toLowerCase(match)
332
314
  ) : (
333
315
  /* istanbul ignore next @preserve */
334
- r
316
+ k
335
317
  );
336
- u[y] = B(f);
337
- }), w(s).forEach(([r, f]) => {
338
- s[r] = B(f);
339
- }), w(e).forEach(([r, f]) => {
340
- // istanbul ignore else @preserve
341
- r in s ? a[r] = s[r] : r in u ? a[r] = u[r] : a[r] = r === p ? j(t, p) : f;
342
- }), a;
343
- }, Yn = (t, e) => v(t) && (Object.hasOwn(t, e) || e in t), Zn = (t) => Object.keys(t), _n = (t) => Object.values(t), $n = (t) => Object.fromEntries(t), to = (t, e) => {
344
- const n = new CustomEvent(t, {
318
+ dataOps[key] = normalizeValue(v);
319
+ }), ObjectEntries(INPUT).forEach(([k, v]) => {
320
+ INPUT[k] = normalizeValue(v);
321
+ }), ObjectEntries(defaultOps).forEach(([k, v]) => {
322
+ k in INPUT ? normalOps[k] = INPUT[k] : k in dataOps ? normalOps[k] = dataOps[k] : normalOps[k] = k === title ? getAttribute(element, title) : v;
323
+ }), normalOps;
324
+ }, ObjectHasOwn = (obj, prop) => isObject(obj) && (Object.hasOwn(obj, prop) || prop in obj), ObjectKeys = (obj) => Object.keys(obj), ObjectValues = (obj) => Object.values(obj), ObjectFromEntries = (entries) => Object.fromEntries(entries), createCustomEvent = (eventType, config) => {
325
+ const OriginalCustomEvent = new CustomEvent(eventType, {
345
326
  cancelable: !0,
346
327
  bubbles: !0
347
328
  });
348
- // istanbul ignore else @preserve
349
- return v(e) && M(n, e), n;
350
- }, eo = { passive: !0 }, no = (t) => t.offsetHeight, oo = (t, e) => {
351
- w(e).forEach(([n, o]) => {
352
- if (o && T(n) && n.includes("--"))
353
- t.style.setProperty(n, o);
329
+ return isObject(config) && ObjectAssign(OriginalCustomEvent, config), OriginalCustomEvent;
330
+ }, passiveHandler = { passive: !0 }, reflow = (element) => element.offsetHeight, setElementStyle = (element, styles) => {
331
+ ObjectEntries(styles).forEach(([key, value]) => {
332
+ if (value && isString(key) && key.includes("--"))
333
+ element.style.setProperty(key, value);
354
334
  else {
355
- const s = {};
356
- s[n] = o, M(t.style, s);
335
+ const propObject = {};
336
+ propObject[key] = value, ObjectAssign(element.style, propObject);
357
337
  }
358
338
  });
359
- }, I = (t) => v(t) && t.constructor.name === "Map" || !1, ie = (t) => typeof t == "number" || !1, m = /* @__PURE__ */ new Map(), so = {
339
+ }, isMap = (obj) => isObject(obj) && obj.constructor.name === "Map" || !1, isNumber = (num) => typeof num == "number" || !1, TimeCache = /* @__PURE__ */ new Map(), Timer = {
360
340
  /**
361
341
  * Sets a new timeout timer for an element, or element -> key association.
362
342
  *
@@ -365,14 +345,8 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
365
345
  * @param delay the execution delay
366
346
  * @param key a unique key
367
347
  */
368
- set: (t, e, n, o) => {
369
- if (!l(t)) return;
370
- // istanbul ignore else @preserve
371
- if (o && o.length) {
372
- // istanbul ignore else @preserve
373
- m.has(t) || m.set(t, /* @__PURE__ */ new Map()), m.get(t).set(o, setTimeout(e, n));
374
- } else
375
- m.set(t, setTimeout(e, n));
348
+ set: (element, callback, delay, key) => {
349
+ isHTMLElement(element) && (key && key.length ? (TimeCache.has(element) || TimeCache.set(element, /* @__PURE__ */ new Map()), TimeCache.get(element).set(key, setTimeout(callback, delay))) : TimeCache.set(element, setTimeout(callback, delay)));
376
350
  },
377
351
  /**
378
352
  * Returns the timer associated with the target.
@@ -381,11 +355,11 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
381
355
  * @param key a unique
382
356
  * @returns the timer
383
357
  */
384
- get: (t, e) => {
385
- if (!l(t)) return null;
386
- const n = m.get(t);
387
- return e && n && I(n) ? n.get(e) || /* istanbul ignore next @preserve */
388
- null : ie(n) ? n : null;
358
+ get: (element, key) => {
359
+ if (!isHTMLElement(element)) return null;
360
+ const keyTimers = TimeCache.get(element);
361
+ return key && keyTimers && isMap(keyTimers) ? keyTimers.get(key) || /* istanbul ignore next @preserve */
362
+ null : isNumber(keyTimers) ? keyTimers : null;
389
363
  },
390
364
  /**
391
365
  * Clears the element's timer.
@@ -393,340 +367,333 @@ const wn = O, V = /(iPhone|iPod|iPad)/, An = A ? A.brands.some(
393
367
  * @param element target element
394
368
  * @param key a unique key
395
369
  */
396
- clear: (t, e) => {
397
- if (!l(t)) return;
398
- const n = m.get(t);
399
- if (e && e.length && I(n)) {
400
- clearTimeout(n.get(e)), n.delete(e);
401
- // istanbul ignore else @preserve
402
- n.size === 0 && m.delete(t);
403
- } else
404
- clearTimeout(n), m.delete(t);
370
+ clear: (element, key) => {
371
+ if (!isHTMLElement(element)) return;
372
+ const keyTimers = TimeCache.get(element);
373
+ key && key.length && isMap(keyTimers) ? (clearTimeout(keyTimers.get(key)), keyTimers.delete(key), keyTimers.size === 0 && TimeCache.delete(element)) : (clearTimeout(keyTimers), TimeCache.delete(element));
405
374
  }
406
- }, co = (t) => t.toUpperCase(), ue = (t, e) => (i(e) ? e : d()).querySelectorAll(t), x = /* @__PURE__ */ new Map();
407
- function le(t) {
408
- const { shiftKey: e, code: n } = t, o = d(this), s = [
409
- ...ue(qt, this)
375
+ }, toUpperCase = (source) => source.toUpperCase(), querySelectorAll = (selector, parent) => (isNode(parent) ? parent : getDocument()).querySelectorAll(selector), focusTrapMap = /* @__PURE__ */ new Map();
376
+ function handleKeyboardNavigation(event) {
377
+ const { shiftKey, code } = event, doc = getDocument(this), focusableElements = [
378
+ ...querySelectorAll(focusableSelector, this)
410
379
  ].filter(
411
- (u) => !te(u, "disabled") && !j(u, X)
380
+ (el) => !hasAttribute(el, "disabled") && !getAttribute(el, ariaHidden)
412
381
  );
413
- if (!s.length) return;
414
- const c = s[0], a = s[s.length - 1];
415
- // istanbul ignore else @preserve
416
- n === "Tab" && (e && o.activeElement === c ? (a.focus(), t.preventDefault()) : !e && o.activeElement === a && (c.focus(), t.preventDefault()));
382
+ if (!focusableElements.length) return;
383
+ const firstFocusable = focusableElements[0], lastFocusable = focusableElements[focusableElements.length - 1];
384
+ code === "Tab" && (shiftKey && doc.activeElement === firstFocusable ? (lastFocusable.focus(), event.preventDefault()) : !shiftKey && doc.activeElement === lastFocusable && (firstFocusable.focus(), event.preventDefault()));
417
385
  }
418
- const de = (t) => x.has(t) === !0, ro = (t) => {
419
- const e = de(t);
420
- (e ? Q : R)(t, "keydown", le), e ? x.delete(t) : x.set(t, !0);
421
- }, h = (t, e) => {
422
- const { width: n, height: o, top: s, right: c, bottom: a, left: u } = t.getBoundingClientRect();
423
- let p = 1, r = 1;
424
- if (e && l(t)) {
425
- const { offsetWidth: f, offsetHeight: y } = t;
426
- p = f > 0 ? Math.round(n) / f : (
386
+ const hasFocusTrap = (target) => focusTrapMap.has(target) === !0, toggleFocusTrap = (target) => {
387
+ const isCurrentlyTrapped = hasFocusTrap(target);
388
+ (isCurrentlyTrapped ? off : on)(target, "keydown", handleKeyboardNavigation), isCurrentlyTrapped ? focusTrapMap.delete(target) : focusTrapMap.set(target, !0);
389
+ }, getBoundingClientRect = (element, includeScale) => {
390
+ const { width, height, top, right, bottom, left } = element.getBoundingClientRect();
391
+ let scaleX = 1, scaleY = 1;
392
+ if (includeScale && isHTMLElement(element)) {
393
+ const { offsetWidth: offsetWidth2, offsetHeight: offsetHeight2 } = element;
394
+ scaleX = offsetWidth2 > 0 ? Math.round(width) / offsetWidth2 : (
427
395
  /* istanbul ignore next @preserve */
428
396
  1
429
- ), r = y > 0 ? Math.round(o) / y : (
397
+ ), scaleY = offsetHeight2 > 0 ? Math.round(height) / offsetHeight2 : (
430
398
  /* istanbul ignore next @preserve */
431
399
  1
432
400
  );
433
401
  }
434
402
  return {
435
- width: n / p,
436
- height: o / r,
437
- top: s / r,
438
- right: c / p,
439
- bottom: a / r,
440
- left: u / p,
441
- x: u / p,
442
- y: s / r
403
+ width: width / scaleX,
404
+ height: height / scaleY,
405
+ top: top / scaleY,
406
+ right: right / scaleX,
407
+ bottom: bottom / scaleY,
408
+ left: left / scaleX,
409
+ x: left / scaleX,
410
+ y: top / scaleY
443
411
  };
444
- }, ao = (t) => d(t).body, k = (t) => d(t).documentElement, io = (t) => d(t).head, uo = (t) => {
445
- const e = q(t), n = e ? t.scrollX : t.scrollLeft, o = e ? t.scrollY : t.scrollTop;
446
- return { x: n, y: o };
447
- }, pe = (t) => i(t) && t.constructor.name === "ShadowRoot" || !1, lo = (t) => t.nodeName === "HTML" ? t : l(t) && t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
448
- i(t) && t.parentNode || // DOM Element detected
449
- pe(t) && t.host || // ShadowRoot detected
450
- k(t), fe = (t) => {
451
- if (!l(t)) return !1;
452
- const { width: e, height: n } = h(t), { offsetWidth: o, offsetHeight: s } = t;
453
- return Math.round(e) !== o || Math.round(n) !== s;
454
- }, po = (t, e, n) => {
455
- const o = l(e), s = h(
456
- t,
457
- o && fe(e)
458
- ), c = { x: 0, y: 0 };
459
- // istanbul ignore else @preserve
460
- if (o) {
461
- const a = h(e, !0);
462
- c.x = a.x + e.clientLeft, c.y = a.y + e.clientTop;
412
+ }, getDocumentBody = (node) => getDocument(node).body, getDocumentElement = (node) => getDocument(node).documentElement, getDocumentHead = (node) => getDocument(node).head, getNodeScroll = (element) => {
413
+ const isWin = isWindow(element), x = isWin ? element.scrollX : element.scrollLeft, y = isWin ? element.scrollY : element.scrollTop;
414
+ return { x, y };
415
+ }, isShadowRoot = (element) => isNode(element) && element.constructor.name === "ShadowRoot" || !1, getParentNode = (node) => node.nodeName === "HTML" ? node : isHTMLElement(node) && node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
416
+ isNode(node) && node.parentNode || // DOM Element detected
417
+ isShadowRoot(node) && node.host || // ShadowRoot detected
418
+ getDocumentElement(node), isScaledElement = (element) => {
419
+ if (!isHTMLElement(element)) return !1;
420
+ const { width, height } = getBoundingClientRect(element), { offsetWidth: offsetWidth2, offsetHeight: offsetHeight2 } = element;
421
+ return Math.round(width) !== offsetWidth2 || Math.round(height) !== offsetHeight2;
422
+ }, getRectRelativeToOffsetParent = (element, offsetParent, scroll) => {
423
+ const isParentAnElement = isHTMLElement(offsetParent), rect = getBoundingClientRect(
424
+ element,
425
+ isParentAnElement && isScaledElement(offsetParent)
426
+ ), offsets = { x: 0, y: 0 };
427
+ if (isParentAnElement) {
428
+ const offsetRect = getBoundingClientRect(offsetParent, !0);
429
+ offsets.x = offsetRect.x + offsetParent.clientLeft, offsets.y = offsetRect.y + offsetParent.clientTop;
463
430
  }
464
431
  return {
465
- x: s.left + n.x - c.x,
466
- y: s.top + n.y - c.y,
467
- width: s.width,
468
- height: s.height
432
+ x: rect.left + scroll.x - offsets.x,
433
+ y: rect.top + scroll.y - offsets.y,
434
+ width: rect.width,
435
+ height: rect.height
469
436
  };
470
437
  };
471
- let F = 0, H = 0;
472
- const b = /* @__PURE__ */ new Map(), me = (t, e) => {
473
- let n = e ? F : H;
474
- if (e) {
475
- const o = me(t), s = b.get(o) || /* @__PURE__ */ new Map();
476
- b.has(o) || b.set(o, s), I(s) && !s.has(e) ? (s.set(e, n), F += 1) : n = s.get(e);
438
+ let elementUID = 0, elementMapUID = 0;
439
+ const elementIDMap = /* @__PURE__ */ new Map(), getUID = (element, key) => {
440
+ let result = key ? elementUID : elementMapUID;
441
+ if (key) {
442
+ const elID = getUID(element), elMap = elementIDMap.get(elID) || /* @__PURE__ */ new Map();
443
+ elementIDMap.has(elID) || elementIDMap.set(elID, elMap), isMap(elMap) && !elMap.has(key) ? (elMap.set(key, result), elementUID += 1) : result = elMap.get(key);
477
444
  } else {
478
- const o = t.id || t;
479
- b.has(o) ? n = b.get(o) : (b.set(o, n), H += 1);
445
+ const elkey = element.id || element;
446
+ elementIDMap.has(elkey) ? result = elementIDMap.get(elkey) : (elementIDMap.set(elkey, result), elementMapUID += 1);
480
447
  }
481
- return n;
482
- }, fo = (t) => t ? G(t) ? t.defaultView : i(t) ? t?.ownerDocument?.defaultView : t : window, ge = (t) => Array.isArray(t) || !1, mo = (t) => i(t) && t.nodeName === "CANVAS" || !1, ve = (t) => l(t) && !!t.shadowRoot || !1, go = (t) => i(t) && [1, 2, 3, 4, 5, 6, 7, 8].some((e) => t.nodeType === e) || !1, vo = (t) => {
483
- if (!i(t)) return !1;
484
- const { top: e, bottom: n } = h(t), { clientHeight: o } = k(t);
485
- return e <= o && n >= 0;
486
- }, Eo = (t) => {
487
- if (!i(t)) return !1;
488
- const { clientWidth: e, clientHeight: n } = k(t), { top: o, left: s, bottom: c, right: a } = h(t, !0);
489
- return o >= 0 && s >= 0 && c <= n && a <= e;
490
- }, bo = (t) => ge(t) && t.every(l) || !1, ho = (t) => typeof t == "function" || !1, yo = (t) => v(t) && t.constructor.name === "HTMLCollection" || !1, wo = (t) => l(t) && t.tagName === "IMG" || !1, Ao = (t) => {
491
- if (!T(t)) return !1;
448
+ return result;
449
+ }, getWindow = (node) => node ? isDocument(node) ? node.defaultView : isNode(node) ? node?.ownerDocument?.defaultView : node : window, isArray = (obj) => Array.isArray(obj) || !1, isCanvas = (element) => isNode(element) && element.nodeName === "CANVAS" || !1, isCustomElement = (element) => isHTMLElement(element) && !!element.shadowRoot || !1, isElement = (element) => isNode(element) && [1, 2, 3, 4, 5, 6, 7, 8].some((x) => element.nodeType === x) || !1, isElementInScrollRange = (element) => {
450
+ if (!isNode(element)) return !1;
451
+ const { top, bottom } = getBoundingClientRect(element), { clientHeight } = getDocumentElement(element);
452
+ return top <= clientHeight && bottom >= 0;
453
+ }, isElementInViewport = (element) => {
454
+ if (!isNode(element)) return !1;
455
+ const { clientWidth, clientHeight } = getDocumentElement(element), { top, left, bottom, right } = getBoundingClientRect(element, !0);
456
+ return top >= 0 && left >= 0 && bottom <= clientHeight && right <= clientWidth;
457
+ }, isElementsArray = (obj) => isArray(obj) && obj.every(isHTMLElement) || !1, isFunction = (fn) => typeof fn == "function" || !1, isHTMLCollection = (obj) => isObject(obj) && obj.constructor.name === "HTMLCollection" || !1, isHTMLImageElement = (element) => isHTMLElement(element) && element.tagName === "IMG" || !1, isJSON = (str) => {
458
+ if (!isString(str)) return !1;
492
459
  try {
493
- JSON.parse(t);
460
+ JSON.parse(str);
494
461
  } catch {
495
462
  return !1;
496
463
  }
497
464
  return !0;
498
- }, So = (t) => v(t) && t.constructor.name === "WeakMap" || !1, No = (t) => i(t) && ["SVG", "Image", "Video", "Canvas"].some(
499
- (e) => t.constructor.name.includes(e)
500
- ) || !1, To = (t) => v(t) && t.constructor.name === "NodeList" || !1, Mo = (t) => k(t).dir === "rtl", ko = (t) => i(t) && t.constructor.name.includes("SVG") || !1, Do = (t) => i(t) && ["TABLE", "TD", "TH"].includes(t.nodeName) || !1, Ee = (t, e) => t ? t.closest(e) || // break out of `ShadowRoot`
501
- Ee(t.getRootNode().host, e) : null, Co = (t, e) => l(t) ? t : (i(e) ? e : d()).querySelector(t), be = (t, e) => (i(e) ? e : d()).getElementsByTagName(
502
- t
503
- ), Oo = (t) => [...be("*", t)].filter(ve), Lo = (t, e) => d(e).getElementById(t) || null, Io = (t, e) => (e && i(e) ? e : d()).getElementsByClassName(
504
- t
505
- ), xo = (t, e) => t.matches(e), zo = "2.0.6";
465
+ }, isWeakMap = (obj) => isObject(obj) && obj.constructor.name === "WeakMap" || !1, isMedia = (element) => isNode(element) && ["SVG", "Image", "Video", "Canvas"].some(
466
+ (s) => element.constructor.name.includes(s)
467
+ ) || !1, isNodeList = (obj) => isObject(obj) && obj.constructor.name === "NodeList" || !1, isRTL = (node) => getDocumentElement(node).dir === "rtl", isSVGElement = (element) => isNode(element) && element.constructor.name.includes("SVG") || !1, isTableElement = (element) => isNode(element) && ["TABLE", "TD", "TH"].includes(element.nodeName) || !1, closest = (element, selector) => element ? element.closest(selector) || // break out of `ShadowRoot`
468
+ closest(element.getRootNode().host, selector) : null, querySelector = (selector, parent) => isHTMLElement(selector) ? selector : (isNode(parent) ? parent : getDocument()).querySelector(selector), getElementsByTagName = (selector, parent) => (isNode(parent) ? parent : getDocument()).getElementsByTagName(
469
+ selector
470
+ ), getCustomElements = (parent) => [...getElementsByTagName("*", parent)].filter(isCustomElement), getElementById = (id, context) => getDocument(context).getElementById(id) || null, getElementsByClassName = (selector, parent) => (parent && isNode(parent) ? parent : getDocument()).getElementsByClassName(
471
+ selector
472
+ ), matches = (target, selector) => target.matches(selector), version = "2.0.7";
506
473
  export {
507
- Wn as ArrayFrom,
508
- P as DOMContentLoadedEvent,
509
- et as DOMMouseScrollEvent,
510
- L as Data,
511
- Gn as Float32ArrayFrom,
512
- Kn as Float64ArrayFrom,
513
- M as ObjectAssign,
514
- w as ObjectEntries,
515
- $n as ObjectFromEntries,
516
- Yn as ObjectHasOwn,
517
- Zn as ObjectKeys,
518
- _n as ObjectValues,
519
- so as Timer,
520
- Y as abortEvent,
521
- Bn as addClass,
522
- fn as addEventListener,
523
- Kt as animationDelay,
524
- Gt as animationDuration,
525
- D as animationEndEvent,
526
- U as animationName,
527
- he as ariaChecked,
528
- we as ariaDescribedBy,
529
- ye as ariaDescription,
530
- Ae as ariaExpanded,
531
- Se as ariaHasPopup,
532
- X as ariaHidden,
533
- Ne as ariaLabel,
534
- Te as ariaLabelledBy,
535
- Me as ariaModal,
536
- ke as ariaPressed,
537
- De as ariaSelected,
538
- Oe as ariaValueMax,
539
- Ce as ariaValueMin,
540
- Le as ariaValueNow,
541
- Ie as ariaValueText,
542
- Z as beforeunloadEvent,
543
- gn as bezierEasings,
544
- _ as blurEvent,
545
- $ as changeEvent,
546
- Ee as closest,
547
- tt as contextmenuEvent,
548
- to as createCustomEvent,
549
- ee as createElement,
550
- ne as createElementNS,
551
- K as dispatchEvent,
552
- Qn as distinct,
553
- Pn as documentBody,
554
- Un as documentElement,
555
- N as documentHead,
556
- ze as dragEvent,
557
- Pe as dragendEvent,
558
- Be as dragenterEvent,
559
- Fe as dragleaveEvent,
560
- He as dragoverEvent,
561
- Ve as dragstartEvent,
562
- jn as emulateAnimationEnd,
563
- qn as emulateTransitionEnd,
564
- nt as errorEvent,
565
- Jn as focus,
566
- ot as focusEvent,
567
- qe as focusEvents,
568
- qt as focusableSelector,
569
- st as focusinEvent,
570
- ct as focusoutEvent,
571
- rt as gesturechangeEvent,
572
- at as gestureendEvent,
573
- it as gesturestartEvent,
574
- j as getAttribute,
575
- On as getAttributeNS,
576
- h as getBoundingClientRect,
577
- Oo as getCustomElements,
578
- d as getDocument,
579
- ao as getDocumentBody,
580
- k as getDocumentElement,
581
- io as getDocumentHead,
582
- oe as getElementAnimationDelay,
583
- se as getElementAnimationDuration,
584
- Lo as getElementById,
585
- g as getElementStyle,
586
- ce as getElementTransitionDelay,
587
- re as getElementTransitionDuration,
588
- Io as getElementsByClassName,
589
- be as getElementsByTagName,
590
- Rn as getInstance,
591
- uo as getNodeScroll,
592
- lo as getParentNode,
593
- po as getRectRelativeToOffsetParent,
594
- me as getUID,
595
- fo as getWindow,
596
- te as hasAttribute,
597
- Ln as hasAttributeNS,
598
- Hn as hasClass,
599
- de as hasFocusTrap,
600
- An as isApple,
601
- ge as isArray,
602
- mo as isCanvas,
603
- ve as isCustomElement,
604
- G as isDocument,
605
- go as isElement,
606
- vo as isElementInScrollRange,
607
- Eo as isElementInViewport,
608
- bo as isElementsArray,
609
- Sn as isFirefox,
610
- ho as isFunction,
611
- yo as isHTMLCollection,
612
- l as isHTMLElement,
613
- wo as isHTMLImageElement,
614
- Ao as isJSON,
615
- I as isMap,
616
- No as isMedia,
617
- wn as isMobile,
618
- i as isNode,
619
- To as isNodeList,
620
- ie as isNumber,
621
- v as isObject,
622
- Mo as isRTL,
623
- ko as isSVGElement,
624
- fe as isScaledElement,
625
- pe as isShadowRoot,
626
- T as isString,
627
- Do as isTableElement,
628
- So as isWeakMap,
629
- q as isWindow,
630
- Ke as keyAlt,
631
- Je as keyArrowDown,
632
- Ye as keyArrowLeft,
633
- Ze as keyArrowRight,
634
- Xe as keyArrowUp,
635
- _e as keyBackspace,
636
- $e as keyCapsLock,
637
- tn as keyControl,
638
- en as keyDelete,
639
- nn as keyEnter,
640
- sn as keyEscape,
641
- cn as keyInsert,
642
- rn as keyMeta,
643
- on as keyNumpadEnter,
644
- an as keyPause,
645
- un as keyScrollLock,
646
- ln as keyShift,
647
- dn as keySpace,
648
- pn as keyTab,
649
- Ge as keyboardEventKeys,
650
- ut as keydownEvent,
651
- lt as keypressEvent,
652
- dt as keyupEvent,
653
- pt as loadEvent,
654
- Ue as loadstartEvent,
655
- xo as matches,
656
- Re as mouseClickEvents,
657
- Qe as mouseHoverEvents,
658
- We as mouseSwipeEvents,
659
- ft as mouseclickEvent,
660
- mt as mousedblclickEvent,
661
- gt as mousedownEvent,
662
- bt as mouseenterEvent,
663
- Et as mousehoverEvent,
664
- yt as mouseinEvent,
665
- ht as mouseleaveEvent,
666
- St as mousemoveEvent,
667
- wt as mouseoutEvent,
668
- At as mouseoverEvent,
669
- vt as mouseupEvent,
670
- Nt as mousewheelEvent,
671
- Tt as moveEvent,
672
- xe as nativeEvents,
673
- $t as noop,
674
- Xn as normalizeOptions,
675
- B as normalizeValue,
676
- Q as off,
677
- vn as offsetHeight,
678
- En as offsetWidth,
679
- R as on,
680
- _t as one,
681
- Mt as orientationchangeEvent,
682
- eo as passiveHandler,
683
- kt as pointercancelEvent,
684
- Dt as pointerdownEvent,
685
- Ct as pointerleaveEvent,
686
- Ot as pointermoveEvent,
687
- Lt as pointerupEvent,
688
- Co as querySelector,
689
- ue as querySelectorAll,
690
- It as readystatechangeEvent,
691
- no as reflow,
692
- zn as removeAttribute,
693
- Vn as removeAttributeNS,
694
- Fn as removeClass,
695
- mn as removeEventListener,
696
- xt as resetEvent,
697
- zt as resizeEvent,
698
- Ht as scrollEvent,
699
- bn as scrollHeight,
700
- hn as scrollWidth,
701
- Vt as selectEvent,
702
- Bt as selectendEvent,
703
- Ft as selectstartEvent,
704
- In as setAttribute,
705
- xn as setAttributeNS,
706
- oo as setElementStyle,
707
- Pt as submitEvent,
708
- Nn as support3DTransform,
709
- Dn as supportAnimation,
710
- Tn as supportPassive,
711
- kn as supportTouch,
712
- Mn as supportTransform,
713
- Cn as supportTransition,
714
- yn as tabindex,
715
- ae as toLowerCase,
716
- co as toUpperCase,
717
- ro as toggleFocusTrap,
718
- je as touchEvents,
719
- Rt as touchcancelEvent,
720
- Qt as touchendEvent,
721
- Wt as touchmoveEvent,
722
- Ut as touchstartEvent,
723
- Xt as transitionDelay,
724
- Jt as transitionDuration,
725
- C as transitionEndEvent,
726
- W as transitionProperty,
727
- jt as unloadEvent,
728
- S as userAgent,
729
- A as userAgentData,
730
- zo as version
474
+ ArrayFrom,
475
+ DOMContentLoadedEvent,
476
+ DOMMouseScrollEvent,
477
+ Data,
478
+ Float32ArrayFrom,
479
+ Float64ArrayFrom,
480
+ ObjectAssign,
481
+ ObjectEntries,
482
+ ObjectFromEntries,
483
+ ObjectHasOwn,
484
+ ObjectKeys,
485
+ ObjectValues,
486
+ Timer,
487
+ abortEvent,
488
+ addClass,
489
+ addEventListener,
490
+ animationDelay,
491
+ animationDuration,
492
+ animationEndEvent,
493
+ animationName,
494
+ ariaChecked,
495
+ ariaDescribedBy,
496
+ ariaDescription,
497
+ ariaExpanded,
498
+ ariaHasPopup,
499
+ ariaHidden,
500
+ ariaLabel,
501
+ ariaLabelledBy,
502
+ ariaModal,
503
+ ariaPressed,
504
+ ariaSelected,
505
+ ariaValueMax,
506
+ ariaValueMin,
507
+ ariaValueNow,
508
+ ariaValueText,
509
+ beforeunloadEvent,
510
+ bezierEasings,
511
+ blurEvent,
512
+ changeEvent,
513
+ closest,
514
+ contextmenuEvent,
515
+ createCustomEvent,
516
+ createElement,
517
+ createElementNS,
518
+ dispatchEvent,
519
+ distinct,
520
+ documentBody,
521
+ documentElement,
522
+ documentHead,
523
+ dragEvent,
524
+ dragendEvent,
525
+ dragenterEvent,
526
+ dragleaveEvent,
527
+ dragoverEvent,
528
+ dragstartEvent,
529
+ emulateAnimationEnd,
530
+ emulateTransitionEnd,
531
+ errorEvent,
532
+ focus,
533
+ focusEvent,
534
+ focusEvents,
535
+ focusableSelector,
536
+ focusinEvent,
537
+ focusoutEvent,
538
+ gesturechangeEvent,
539
+ gestureendEvent,
540
+ gesturestartEvent,
541
+ getAttribute,
542
+ getAttributeNS,
543
+ getBoundingClientRect,
544
+ getCustomElements,
545
+ getDocument,
546
+ getDocumentBody,
547
+ getDocumentElement,
548
+ getDocumentHead,
549
+ getElementAnimationDelay,
550
+ getElementAnimationDuration,
551
+ getElementById,
552
+ getElementStyle,
553
+ getElementTransitionDelay,
554
+ getElementTransitionDuration,
555
+ getElementsByClassName,
556
+ getElementsByTagName,
557
+ getInstance,
558
+ getNodeScroll,
559
+ getParentNode,
560
+ getRectRelativeToOffsetParent,
561
+ getUID,
562
+ getWindow,
563
+ hasAttribute,
564
+ hasAttributeNS,
565
+ hasClass,
566
+ hasFocusTrap,
567
+ isApple,
568
+ isArray,
569
+ isCanvas,
570
+ isCustomElement,
571
+ isDocument,
572
+ isElement,
573
+ isElementInScrollRange,
574
+ isElementInViewport,
575
+ isElementsArray,
576
+ isFirefox,
577
+ isFunction,
578
+ isHTMLCollection,
579
+ isHTMLElement,
580
+ isHTMLImageElement,
581
+ isJSON,
582
+ isMap,
583
+ isMedia,
584
+ isMobile,
585
+ isNode,
586
+ isNodeList,
587
+ isNumber,
588
+ isObject,
589
+ isRTL,
590
+ isSVGElement,
591
+ isScaledElement,
592
+ isShadowRoot,
593
+ isString,
594
+ isTableElement,
595
+ isWeakMap,
596
+ isWindow,
597
+ keyAlt,
598
+ keyArrowDown,
599
+ keyArrowLeft,
600
+ keyArrowRight,
601
+ keyArrowUp,
602
+ keyBackspace,
603
+ keyCapsLock,
604
+ keyControl,
605
+ keyDelete,
606
+ keyEnter,
607
+ keyEscape,
608
+ keyInsert,
609
+ keyMeta,
610
+ keyNumpadEnter,
611
+ keyPause,
612
+ keyScrollLock,
613
+ keyShift,
614
+ keySpace,
615
+ keyTab,
616
+ keyboardEventKeys,
617
+ keydownEvent,
618
+ keypressEvent,
619
+ keyupEvent,
620
+ loadEvent,
621
+ loadstartEvent,
622
+ matches,
623
+ mouseClickEvents,
624
+ mouseHoverEvents,
625
+ mouseSwipeEvents,
626
+ mouseclickEvent,
627
+ mousedblclickEvent,
628
+ mousedownEvent,
629
+ mouseenterEvent,
630
+ mousehoverEvent,
631
+ mouseinEvent,
632
+ mouseleaveEvent,
633
+ mousemoveEvent,
634
+ mouseoutEvent,
635
+ mouseoverEvent,
636
+ mouseupEvent,
637
+ mousewheelEvent,
638
+ moveEvent,
639
+ nativeEvents,
640
+ noop,
641
+ normalizeOptions,
642
+ normalizeValue,
643
+ off,
644
+ offsetHeight,
645
+ offsetWidth,
646
+ on,
647
+ one,
648
+ orientationchangeEvent,
649
+ passiveHandler,
650
+ pointercancelEvent,
651
+ pointerdownEvent,
652
+ pointerleaveEvent,
653
+ pointermoveEvent,
654
+ pointerupEvent,
655
+ querySelector,
656
+ querySelectorAll,
657
+ readystatechangeEvent,
658
+ reflow,
659
+ removeAttribute,
660
+ removeAttributeNS,
661
+ removeClass,
662
+ removeEventListener,
663
+ resetEvent,
664
+ resizeEvent,
665
+ scrollEvent,
666
+ scrollHeight,
667
+ scrollWidth,
668
+ selectEvent,
669
+ selectendEvent,
670
+ selectstartEvent,
671
+ setAttribute,
672
+ setAttributeNS,
673
+ setElementStyle,
674
+ submitEvent,
675
+ support3DTransform,
676
+ supportAnimation,
677
+ supportPassive,
678
+ supportTouch,
679
+ supportTransform,
680
+ supportTransition,
681
+ tabindex,
682
+ toLowerCase,
683
+ toUpperCase,
684
+ toggleFocusTrap,
685
+ touchEvents,
686
+ touchcancelEvent,
687
+ touchendEvent,
688
+ touchmoveEvent,
689
+ touchstartEvent,
690
+ transitionDelay,
691
+ transitionDuration,
692
+ transitionEndEvent,
693
+ transitionProperty,
694
+ unloadEvent,
695
+ userAgent,
696
+ userAgentData,
697
+ version
731
698
  };
732
699
  //# sourceMappingURL=shorty.mjs.map