1// @tailwindplus/[email protected] downloaded from https://ga.jspm.io/npm:@tailwindplus/[email protected]/dist/index.js 2 3var e = Object.defineProperty; 4var t = (e) => { 5 throw TypeError(e); 6}; 7var n = (t, n, o) => 8 n in t 9 ? e(t, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) 10 : (t[n] = o); 11var o = (e, t, o) => n(e, typeof t != "symbol" ? t + "" : t, o), 12 a = (e, n, o) => n.has(e) || t("Cannot " + o); 13var l = (e, t, n) => ( 14 a(e, t, "read from private field"), 15 n ? n.call(e) : t.get(e) 16 ), 17 s = (e, n, o) => 18 n.has(e) 19 ? t("Cannot add the same private member more than once") 20 : n instanceof WeakSet 21 ? n.add(e) 22 : n.set(e, o), 23 u = (e, t, n, o) => ( 24 a(e, t, "write to private field"), 25 o ? o.call(e, n) : t.set(e, n), 26 n 27 ), 28 c = (e, t, n) => (a(e, t, "access private method"), n); 29if (typeof globalThis.window < "u") { 30 let e = !1; 31 document.addEventListener( 32 "submit", 33 (t) => { 34 if (e) { 35 e = !1; 36 return; 37 } 38 let n = t.target; 39 if (n && n.method === "dialog") { 40 let o = n.closest("el-dialog"); 41 if (!o || !("beforeClose" in o)) return; 42 let a = o.beforeClose(); 43 if ( 44 a === !0 || 45 (t.preventDefault(), t.stopImmediatePropagation(), a === !1) 46 ) 47 return; 48 a.then((o) => { 49 o && ((e = !0), n.dispatchEvent(t)); 50 }).catch(console.error); 51 } 52 }, 53 !0, 54 ); 55} 56var d = class extends Event { 57 constructor(e, { oldState: t = "", newState: n = "", ...a } = {}) { 58 super(e, a); 59 o(this, "oldState"); 60 o(this, "newState"); 61 ((this.oldState = String(t || "")), (this.newState = String(n || ""))); 62 } 63 }, 64 h = new WeakMap(); 65function p(e, t, n) { 66 h.set( 67 e, 68 setTimeout(() => { 69 h.has(e) && 70 e.dispatchEvent( 71 new d("toggle", { cancelable: !1, oldState: t, newState: n }), 72 ); 73 }, 0), 74 ); 75} 76var f = globalThis.ShadowRoot || function () {}, 77 m = globalThis.HTMLDialogElement || function () {}, 78 g = new WeakMap(), 79 b = new WeakMap(), 80 v = new WeakMap(), 81 w = new WeakMap(); 82function y(e) { 83 return w.get(e) || "hidden"; 84} 85var A = new WeakMap(); 86function E(e) { 87 return [...e].pop(); 88} 89function x(e) { 90 let t = e.popoverTargetElement; 91 if (!(t instanceof HTMLElement)) return; 92 let n = y(t); 93 (e.popoverTargetAction === "show" && n === "showing") || 94 (e.popoverTargetAction === "hide" && n === "hidden") || 95 (n === "showing" ? F(t, !0, !0) : T(t, !1) && (A.set(t, e), W(t))); 96} 97function T(e, t) { 98 return !( 99 (e.popover !== "auto" && e.popover !== "manual" && e.popover !== "hint") || 100 !e.isConnected || 101 (t && y(e) !== "showing") || 102 (!t && y(e) !== "hidden") || 103 (e instanceof m && e.hasAttribute("open")) || 104 document.fullscreenElement === e 105 ); 106} 107function S(e) { 108 if (!e) return 0; 109 let t = b.get(document) || new Set(), 110 n = v.get(document) || new Set(); 111 return n.has(e) 112 ? [...n].indexOf(e) + t.size + 1 113 : t.has(e) 114 ? [...t].indexOf(e) + 1 115 : 0; 116} 117function k(e) { 118 let t = P(e), 119 n = C(e); 120 return S(t) > S(n) ? t : n; 121} 122function I(e) { 123 let t, 124 n = v.get(e) || new Set(), 125 o = b.get(e) || new Set(), 126 a = n.size > 0 ? n : o.size > 0 ? o : null; 127 return a ? ((t = E(a)), t.isConnected ? t : (a.delete(t), I(e))) : null; 128} 129function L(e) { 130 for (let t of e || []) { 131 if (t.isConnected) return t; 132 e.delete(t); 133 } 134 return null; 135} 136function D(e) { 137 return typeof e.getRootNode == "function" 138 ? e.getRootNode() 139 : e.parentNode 140 ? D(e.parentNode) 141 : e; 142} 143function P(e) { 144 for (; e; ) { 145 if ( 146 e instanceof HTMLElement && 147 e.popover === "auto" && 148 w.get(e) === "showing" 149 ) 150 return e; 151 if ( 152 ((e = 153 (e instanceof Element && e.assignedSlot) || e.parentElement || D(e)), 154 e instanceof f && (e = e.host), 155 e instanceof Document) 156 ) 157 return; 158 } 159} 160function C(e) { 161 for (; e; ) { 162 let t = e.popoverTargetElement; 163 if (t instanceof HTMLElement) return t; 164 if ( 165 ((e = e.parentElement || D(e)), 166 e instanceof f && (e = e.host), 167 e instanceof Document) 168 ) 169 return; 170 } 171} 172function M(e, t) { 173 let n = new Map(), 174 o = 0; 175 for (let e of t || []) (n.set(e, o), (o += 1)); 176 (n.set(e, o), (o += 1)); 177 let a = null; 178 function l(t) { 179 if (!t) return; 180 let o = !1, 181 l = null, 182 s = null; 183 for (; !o; ) { 184 if (((l = P(t) || null), l === null || !n.has(l))) return; 185 ((e.popover === "hint" || l.popover === "auto") && (o = !0), 186 o || (t = l.parentElement)); 187 } 188 ((s = n.get(l)), (a === null || n.get(a) < s) && (a = l)); 189 } 190 return (l(e.parentElement || D(e)), a); 191} 192function O(e) { 193 return ( 194 !( 195 e.hidden || 196 e instanceof f || 197 ((e instanceof HTMLButtonElement || 198 e instanceof HTMLInputElement || 199 e instanceof HTMLSelectElement || 200 e instanceof HTMLTextAreaElement || 201 e instanceof HTMLOptGroupElement || 202 e instanceof HTMLOptionElement || 203 e instanceof HTMLFieldSetElement) && 204 e.disabled) || 205 (e instanceof HTMLInputElement && e.type === "hidden") || 206 (e instanceof HTMLAnchorElement && e.href === "") 207 ) && 208 typeof e.tabIndex == "number" && 209 e.tabIndex !== -1 210 ); 211} 212function B(e) { 213 if (e.shadowRoot && e.shadowRoot.delegatesFocus !== !0) return null; 214 let t = e; 215 t.shadowRoot && (t = t.shadowRoot); 216 let n = t.querySelector("[autofocus]"); 217 if (n) return n; 218 { 219 let e = t.querySelectorAll("slot"); 220 for (let t of e) { 221 let e = t.assignedElements({ flatten: !0 }); 222 for (let t of e) { 223 if (t.hasAttribute("autofocus")) return t; 224 if (((n = t.querySelector("[autofocus]")), n)) return n; 225 } 226 } 227 } 228 let o = e.ownerDocument.createTreeWalker(t, NodeFilter.SHOW_ELEMENT), 229 a = o.currentNode; 230 for (; a; ) { 231 if (O(a)) return a; 232 a = o.nextNode(); 233 } 234} 235function R(e) { 236 var t; 237 (t = B(e)) == null || t.focus(); 238} 239var q = new WeakMap(); 240function W(e) { 241 if (!T(e, !1)) return; 242 let t = e.ownerDocument; 243 if (
244 !e.dispatchEvent( 245 new d("beforetoggle", { 246 cancelable: !0, 247 oldState: "closed", 248 newState: "open", 249 }), 250 ) || 251 !T(e, !1) 252 ) 253 return; 254 let n = !1, 255 o = e.popover, 256 a = null, 257 l = M(e, b.get(t) || new Set()), 258 s = M(e, v.get(t) || new Set()); 259 if ( 260 (o === "auto" && 261 (N(v.get(t) || new Set(), n, !0), K(l || t, n, !0), (a = "auto")), 262 o === "hint" && 263 (s 264 ? (K(s, n, !0), (a = "hint")) 265 : (N(v.get(t) || new Set(), n, !0), 266 l ? (K(l, n, !0), (a = "auto")) : (a = "hint"))), 267 o === "auto" || o === "hint") 268 ) { 269 if (o !== e.popover || !T(e, !1)) return; 270 (I(t) || (n = !0), 271 a === "auto" 272 ? (b.has(t) || b.set(t, new Set()), b.get(t).add(e)) 273 : a === "hint" && (v.has(t) || v.set(t, new Set()), v.get(t).add(e))); 274 } 275 q.delete(e); 276 let u = t.activeElement; 277 (e.classList.add(":popover-open"), 278 w.set(e, "showing"), 279 g.has(t) || g.set(t, new Set()), 280 g.get(t).add(e), 281 U(A.get(e), !0), 282 R(e), 283 n && u && e.popover === "auto" && q.set(e, u), 284 p(e, "closed", "open")); 285} 286function F(e, t = !1, n = !1) { 287 var o, a; 288 if (!T(e, !0)) return; 289 let l = e.ownerDocument; 290 if (["auto", "hint"].includes(e.popover) && (K(e, t, n), !T(e, !0))) return; 291 let s = b.get(l) || new Set(), 292 u = s.has(e) && E(s) === e; 293 if ( 294 (U(A.get(e), !1), 295 A.delete(e), 296 n && 297 (e.dispatchEvent( 298 new d("beforetoggle", { oldState: "open", newState: "closed" }), 299 ), 300 u && E(s) !== e && K(e, t, n), 301 !T(e, !0))) 302 ) 303 return; 304 ((o = g.get(l)) == null || o.delete(e), 305 s.delete(e), 306 (a = v.get(l)) == null || a.delete(e), 307 e.classList.remove(":popover-open"), 308 w.set(e, "hidden"), 309 n && p(e, "open", "closed")); 310 let c = q.get(e); 311 c && (q.delete(e), t && c.focus()); 312} 313function H(e, t = !1, n = !1) { 314 let o = I(e); 315 for (; o; ) (F(o, t, n), (o = I(e))); 316} 317function N(e, t = !1, n = !1) { 318 let o = L(e); 319 for (; o; ) (F(o, t, n), (o = L(e))); 320} 321function $(e, t, n, o) { 322 let a = !1, 323 l = !1; 324 for (; a || !l; ) { 325 l = !0; 326 let s = null, 327 u = !1; 328 for (let n of t) 329 if (n === e) u = !0; 330 else if (u) { 331 s = n; 332 break; 333 } 334 if (!s) return; 335 for (; y(s) === "showing" && t.size; ) F(E(t), n, o); 336 (t.has(e) && E(t) !== e && (a = !0), a && (o = !1)); 337 } 338} 339function K(e, t, n) { 340 var o, a; 341 let l = e.ownerDocument || e; 342 if (e instanceof Document) return H(l, t, n); 343 (o = v.get(l)) != null && o.has(e) 344 ? $(e, v.get(l), t, n) 345 : (N(v.get(l) || new Set(), t, n), 346 (a = b.get(l)) != null && a.has(e) && $(e, b.get(l), t, n)); 347} 348var j = new WeakMap(); 349function V(e) { 350 if (!e.isTrusted) return; 351 let t = e.composedPath()[0]; 352 if (!t) return; 353 let n = t.ownerDocument; 354 if (!I(n)) return; 355 let o = k(t); 356 if (o && e.type === "pointerdown") j.set(n, o); 357 else if (e.type === "pointerup") { 358 let e = j.get(n) === o; 359 (j.delete(n), e && K(o || n, !1, !0)); 360 } 361} 362var z = new WeakMap(); 363function U(e, t = !1) { 364 if (!e) return; 365 z.has(e) || z.set(e, e.getAttribute("aria-expanded")); 366 let n = e.popoverTargetElement; 367 if (n instanceof HTMLElement && n.popover === "auto") 368 e.setAttribute("aria-expanded", String(t)); 369 else { 370 let t = z.get(e); 371 t ? e.setAttribute("aria-expanded", t) : e.removeAttribute("aria-expanded"); 372 } 373} 374var G = globalThis.ShadowRoot || function () {}; 375function Y() { 376 return ( 377 typeof HTMLElement < "u" && 378 typeof HTMLElement.prototype == "object" && 379 "popover" in HTMLElement.prototype 380 ); 381} 382function Q(e, t, n) { 383 let o = e[t]; 384 Object.defineProperty(e, t, { 385 value(e) { 386 return o.call(this, n(e)); 387 }, 388 }); 389} 390var X = /(^|[^\\]):popover-open\b/g; 391function _() { 392 return typeof globalThis.CSSLayerBlockRule == "function"; 393} 394function J() { 395 let e = _(); 396 return `\n${e ? "@layer popover-polyfill {" : ""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\
396n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${e ? "}" : ""}\n`; 397} 398var Z = null; 399function ee(e) { 400 let t = J(); 401 if (Z === null) 402 try { 403 ((Z = new CSSStyleSheet()), Z.replaceSync(t)); 404 } catch { 405 Z = !1; 406 } 407 if (Z === !1) { 408 let n = document.createElement("style"); 409 ((n.textContent = t), 410 e instanceof Document ? e.head.prepend(n) : e.prepend(n)); 411 } else e.adoptedStyleSheets = [Z, ...e.adoptedStyleSheets]; 412} 413function te() { 414 if (typeof window > "u") return; 415 window.ToggleEvent = window.ToggleEvent || d; 416 function e(e) { 417 return ( 418 e?.includes(":popover-open") && (e = e.replace(X, "$1.\\:popover-open")), 419 e 420 ); 421 } 422 (Q(Document.prototype, "querySelector", e), 423 Q(Document.prototype, "querySelectorAll", e), 424 Q(Element.prototype, "querySelector", e), 425 Q(Element.prototype, "querySelectorAll", e), 426 Q(Element.prototype, "matches", e), 427 Q(Element.prototype, "closest", e), 428 Q(DocumentFragment.prototype, "querySelectorAll", e), 429 Object.defineProperties(HTMLElement.prototype, { 430 popover: { 431 enumerable: !0, 432 configurable: !0, 433 get() { 434 if (!this.hasAttribute("popover")) return null; 435 let e = (this.getAttribute("popover") || "").toLowerCase(); 436 return e === "" || e == "auto" 437 ? "auto" 438 : e == "hint" 439 ? "hint" 440 : "manual"; 441 }, 442 set(e) { 443 e === null 444 ? this.removeAttribute("popover") 445 : this.setAttribute("popover", e); 446 }, 447 }, 448 showPopover: { 449 enumerable: !0, 450 configurable: !0, 451 value(e = {}) { 452 W(this); 453 }, 454 }, 455 hidePopover: { 456 enumerable: !0, 457 configurable: !0, 458 value() { 459 F(this, !0, !0); 460 }, 461 }, 462 togglePopover: { 463 enumerable: !0, 464 configurable: !0, 465 value(e = {}) { 466 return ( 467 typeof e == "boolean" && (e = { force: e }), 468 (w.get(this) === "showing" && e.force === void 0) || e.force === !1 469 ? F(this, !0, !0) 470 : (e.force === void 0 || e.force === !0) && W(this), 471 w.get(this) === "showing" 472 ); 473 }, 474 }, 475 })); 476 let t = Element.prototype.attachShadow; 477 t && 478 Object.defineProperties(Element.prototype, { 479 attachShadow: { 480 enumerable: !0, 481 configurable: !0, 482 writable: !0, 483 value(e) { 484 let n = t.call(this, e); 485 return (ee(n), n); 486 }, 487 }, 488 }); 489 let n = HTMLElement.prototype.attachInternals; 490 n && 491 Object.defineProperties(HTMLElement.prototype, { 492 attachInternals: { 493 enumerable: !0, 494 configurable: !0, 495 writable: !0, 496 value() { 497 let e = n.call(this); 498 return (e.shadowRoot && ee(e.shadowRoot), e); 499 }, 500 }, 501 }); 502 let o = new WeakMap(); 503 function a(e) { 504 Object.defineProperties(e.prototype, { 505 popoverTargetElement: { 506 enumerable: !0, 507 configurable: !0, 508 set(e) { 509 if (e === null) 510 (this.removeAttribute("popovertarget"), o.delete(this)); 511 else { 512 if (!(e instanceof Element)) 513 throw new TypeError( 514 "popoverTargetElement must be an element or null", 515 ); 516 (this.setAttribute("popovertarget", ""), o.set(this, e)); 517 } 518 }, 519 get() { 520 if ( 521 (this.localName !== "button" && this.localName !== "input") || 522 (this.localName === "input" && 523 this.type !== "reset" && 524 this.type !== "image" && 525 this.type !== "button") || 526 this.disabled || 527 (this.form && this.type === "submit") 528 ) 529 return null; 530 let e = o.get(this); 531 if (e && e.isConnected) return e; 532 if (e && !e.isConnected) return (o.delete(this), null); 533 let t = D(this), 534 n = this.getAttribute("popovertarget"); 535 return ( 536 ((t instanceof Document || t instanceof G) && 537 n && 538 t.getElementById(n)) || 539 null 540 ); 541 }, 542 }, 543 popoverTargetAction: { 544 enumerable: !0, 545 configurable: !0, 546 get() { 547 let e = ( 548 this.getAttribute("popovertargetaction") || "" 549 ).toLowerCase(); 550 return e === "show" || e === "hide" ? e : "toggle"; 551 }, 552 set(e) { 553 this.setAttribute("popovertargetaction", e); 554 }, 555 }, 556 }); 557 } 558 (a(HTMLButtonElement), a(HTMLInputElement)); 559 let l = (e) => { 560 if (e.defaultPrevented) return; 561 let t = e.composedPath(), 562 n = t[0]; 563 if (!(n instanceof Element) || n?.shadowRoot) return; 564 let o = D(n); 565 if (!(o instanceof G || o instanceof Document)) return; 566 let a = t.find((e) => { 567 var t; 568 return (t = e.matches) == null 569 ? void 0 570 : t.call(e, "[popovertargetaction],[popovertarget]"); 571 }); 572 a && (x(a), e.preventDefault()); 573 }, 574 s = (e) => { 575 let t = e.key, 576 n = e.target; 577 !e.defaultPrevented && 578 n && 579 (t === "Escape" || t === "Esc") && 580 K(n.ownerDocument, !0, !0); 581 }; 582 (((e) => { 583 (e.addEventListener("click", l), 584 e.addEventListener("keydown", s), 585 e.addEventListener("pointerdown", V), 586 e.addEventListener("pointerup", V)); 587 })(document), 588 ee(document)); 589} 590function ne() { 591 return ( 592 typeof HTMLButtonElement < "u" && 593 "command" in HTMLButtonElement.prototype && 594 "source" in ((globalThis.CommandEvent || {}).prototype || {}) 595 ); 596} 597function oe() { 598 (document.addEventListener( 599 "invoke", 600 (e) => { 601 e.type == "invoke" && 602 e.isTrusted && 603 (e.stopImmediatePropagation(), e.preventDefault()); 604 }, 605 !0, 606 ), 607 document.addEventListener( 608 "command", 609 (e) => { 610 e.type == "command" && 611 e.isTrusted && 612 (e.stopImmediatePropagation(), e.preventDefault()); 613 }, 614 !0, 615 )); 616 function e(e, t, n = !0) { 617 Object.defineProperty(e, t, { 618 ...Object.getOwnPropertyDescriptor(e, t), 619 enumerable: n, 620 }); 621 } 622 function t(e) { 623 return e && typeof e.getRootNode == "function" 624 ? e.getRootNode() 625 : e && e.parentNode 626 ? t(e.parentNode) 627 : e; 628 } 629 let n = new WeakMap(), 630 o = new WeakMap();
631 class r extends Event { 632 constructor(e, t = {}) { 633 super(e, t); 634 let { source: a, command: l } = t; 635 if (a != null && !(a instanceof Element)) 636 throw new TypeError("source must be an element"); 637 (n.set(this, a || null), o.set(this, l !== void 0 ? String(l) : "")); 638 } 639 get [Symbol.toStringTag]() { 640 return "CommandEvent"; 641 } 642 get source() { 643 if (!n.has(this)) throw new TypeError("illegal invocation"); 644 let e = n.get(this); 645 if (!(e instanceof Element)) return null; 646 let o = t(e); 647 return o !== t(this.target || document) ? o.host : e; 648 } 649 get command() { 650 if (!o.has(this)) throw new TypeError("illegal invocation"); 651 return o.get(this); 652 } 653 get action() { 654 throw new Error( 655 "CommandEvent#action was renamed to CommandEvent#command", 656 ); 657 } 658 get invoker() { 659 throw new Error( 660 "CommandEvent#invoker was renamed to CommandEvent#source", 661 ); 662 } 663 } 664 (e(r.prototype, "source"), e(r.prototype, "command")); 665 class i extends Event { 666 constructor(e, t = {}) { 667 throw ( 668 super(e, t), 669 new Error( 670 "InvokeEvent has been deprecated, it has been renamed to `CommandEvent`", 671 ) 672 ); 673 } 674 } 675 let a = new WeakMap(); 676 function l(e) { 677 Object.defineProperties(e.prototype, { 678 commandForElement: { 679 enumerable: !0, 680 configurable: !0, 681 set(e) { 682 if (this.hasAttribute("invokeaction")) 683 throw new TypeError( 684 "Element has deprecated `invokeaction` attribute, replace with `command`", 685 ); 686 if (this.hasAttribute("invoketarget")) 687 throw new TypeError( 688 "Element has deprecated `invoketarget` attribute, replace with `commandfor`", 689 ); 690 if (e === null) (this.removeAttribute("commandfor"), a.delete(this)); 691 else { 692 if (!(e instanceof Element)) 693 throw new TypeError( 694 "commandForElement must be an element or null", 695 ); 696 { 697 this.setAttribute("commandfor", ""); 698 let n = t(e); 699 t(this) === n || n === this.ownerDocument 700 ? a.set(this, e) 701 : a.delete(this); 702 } 703 } 704 }, 705 get() { 706 if (this.localName !== "button") return null; 707 if ( 708 this.hasAttribute("invokeaction") || 709 this.hasAttribute("invoketarget") 710 ) 711 return ( 712 console.warn( 713 "Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead", 714 ), 715 null 716 ); 717 if (this.disabled) return null; 718 if (this.form && this.getAttribute("type") !== "button") 719 return ( 720 console.warn( 721 "Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work", 722 ), 723 null 724 ); 725 let e = a.get(this); 726 if (e) return e.isConnected ? e : (a.delete(this), null); 727 let n = t(this), 728 o = this.getAttribute("commandfor"); 729 return ( 730 ((n instanceof Document || n instanceof ShadowRoot) && 731 o && 732 n.getElementById(o)) || 733 null 734 ); 735 }, 736 }, 737 command: { 738 enumerable: !0, 739 configurable: !0, 740 get() { 741 let e = this.getAttribute("command") || ""; 742 if (e.startsWith("--")) return e; 743 let t = e.toLowerCase(); 744 switch (t) { 745 case "show-modal": 746 case "close": 747 case "toggle-popover": 748 case "hide-popover": 749 case "show-popover": 750 return t; 751 } 752 return ""; 753 }, 754 set(e) { 755 this.setAttribute("command", e); 756 }, 757 }, 758 invokeAction: { 759 enumerable: !1, 760 configurable: !0, 761 get() { 762 throw new Error( 763 "invokeAction is deprecated. It has been renamed to command", 764 ); 765 }, 766 set(e) { 767 throw new Error( 768 "invokeAction is deprecated. It has been renamed to command", 769 ); 770 }, 771 }, 772 invokeTargetElement: { 773 enumerable: !1, 774 configurable: !0, 775 get() { 776 throw new Error( 777 "invokeTargetElement is deprecated. It has been renamed to command", 778 ); 779 }, 780 set(e) { 781 throw new Error( 782 "invokeTargetElement is deprecated. It has been renamed to command", 783 ); 784 }, 785 }, 786 }); 787 } 788 let s = new WeakMap(); 789 Object.defineProperties(HTMLElement.prototype, { 790 oncommand: { 791 enumerable: !0, 792 configurable: !0, 793 get() { 794 return (c.takeRecords(), s.get(this) || null); 795 }, 796 set(e) { 797 let t = s.get(this) || null; 798 (t && this.removeEventListener("command", t), 799 s.set( 800 this, 801 typeof e == "object" || typeof e == "function" ? e : null, 802 ), 803 typeof e == "function" && this.addEventListener("command", e)); 804 }, 805 }, 806 }); 807 function u(e) { 808 for (let t of e) 809 t.oncommand = new Function("event", t.getAttribute("oncommand")); 810 } 811 let c = new MutationObserver((e) => { 812 for (let t of e) { 813 let { target: e } = t; 814 t.type === "childList" ? u(e.querySelectorAll("[oncommand]")) : u([e]); 815 } 816 }); 817 (c.observe(document, { 818 subtree: !0, 819 childList: !0, 820 attributeFilter: ["oncommand"], 821 }), 822 u(document.querySelectorAll("[oncommand]"))); 823 function d(e) { 824 if (e.defaultPrevented || e.type !== "click") return; 825 let t = e.target.closest( 826 "button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]", 827 ); 828 if ( 829 t && 830 (console.warn( 831 "Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively", 832 ), 833 t.matches("input")) 834 ) 835 throw new Error("Input elements no longer support `commandfor`"); 836 let n = e.target.closest("button[commandfor], button[command]"); 837 if (!n) return; 838 if (n.form && n.getAttribute("type") !== "button") 839 throw ( 840 e.preventDefault(), 841 new Error( 842 "Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes", 843 ) 844 ); 845 if (n.hasAttribute("command") !== n.hasAttribute("commandfor")) { 846 let e = n.hasAttribute("command") ? "command" : "commandfor", 847 t = n.hasAttribute("command") ? "commandfor" : "command"; 848 throw new Error( 849 `Element with ${e} attribute must also have a ${t} attribute to function.`, 850 ); 851 } 852 if ( 853 n.command !== "show-popover" && 854 n.command !== "hide-popover" && 855 n.command !== "toggle-popover" && 856 n.command !== "show-modal" && 857 n.command !== "close" && 858 !n.command.startsWith("--") 859 ) { 860 console.warn( 861 `"${n.command}" is not a valid command value. Custom commands must begin with --`, 862 ); 863 return; 864 } 865 let o = n.commandForElement; 866 if (!o) return; 867 let a = new r("command", { command: n.command, source: n, cancelable: !0 }); 868 if ((o.dispatchEvent(a), a.defaultPrevented)) return; 869 let l = a.command.toLowerCase(); 870 if (o.popover) { 871 let e = !o.matches(":popover-open"); 872 !e || (l !== "toggle-popover" && l !== "show-popover") 873 ? !e && l === "hide-popover" && o.hidePopover() 874 : o.showPopover({ source: n }); 875 } else if (o.localName === "dialog") { 876 let e = !o.hasAttribute("open"); 877 e && l === "show-modal" 878 ? o.showModal() 879 : !e && l === "close" && o.close(); 880 } 881 } 882 function h(e) { 883 e.addEventListener("click", d, !0); 884 } 885 function p(e, t) { 886 let n = e.prototype.attachShadow; 887 e.prototype.attachShadow = function (e) { 888 let o = n.call(this, e); 889 return (t(o), o); 890 }; 891 let o = e.prototype.attachInternals; 892 e.prototype.attachInternals = function () { 893 let e = o.call(this); 894 return (e.shadowRoot && t(e.shadowRoot), e); 895 }; 896 } 897 (l(HTMLButtonElement), 898 p(HTMLElement, (e) => { 899 (h(e), 900 c.observe(e, { attributeFilter: ["oncommand"] }), 901 u(e.querySelectorAll("[oncommand]"))); 902 }), 903 h(document), 904 Object.assign(globalThis, { CommandEvent: r, InvokeEvent: i })); 905} 906function re() { 907 if (typeof HTMLDialogElement != "function") return !1; 908 let e = !1, 909 t = document.createElement("dialog"); 910 return ( 911 t.addEventListener("beforetoggle", (t) => { 912 ((e = !0), t.preventDefault()); 913 }), 914 t.show(), 915 e 916 ); 917} 918function ie() { 919 let e = new WeakMap(); 920 function t(t) { 921 let n = t.open ? "closed" : "open", 922 o = t.open ? "open" : "closed"; 923 if (e.has(t)) { 924 let n = e.get(t); 925 ((o = n.oldState), clearTimeout(n.id)); 926 } 927 e.set(t, { 928 oldState: o, 929 id: setTimeout(() => { 930 t.dispatchEvent( 931 new ToggleEvent("toggle", { newState: n, oldState: o }), 932 ); 933 }), 934 }); 935 } 936 let n = HTMLDialogElement.prototype.show, 937 o = HTMLDialogElement.prototype.showModal, 938 a = HTMLDialogElement.prototype.close; 939 function l(e) { 940 let n = new ToggleEvent("beforetoggle", { 941 newState: "closed", 942 oldState: "open", 943 cancelable: !1, 944 });
945 (e.dispatchEvent(n), e.open && t(e)); 946 } 947 (document.addEventListener( 948 "submit", 949 (e) => { 950 let t = e.target; 951 if (t.method === "dialog") { 952 let e = t.closest("dialog"); 953 e instanceof HTMLDialogElement && l(e); 954 } 955 }, 956 !0, 957 ), 958 Object.defineProperties(HTMLDialogElement.prototype, { 959 show: { 960 value() { 961 if ( 962 this.open || 963 this.matches(":popover-open, :modal") || 964 !this.ownerDocument 965 ) 966 return n.apply(this, arguments); 967 let e = new ToggleEvent("beforetoggle", { 968 newState: "open", 969 oldState: "closed", 970 cancelable: !0, 971 }); 972 this.dispatchEvent(e) && (t(this), n.apply(this, arguments)); 973 }, 974 }, 975 showModal: { 976 value() { 977 if ( 978 this.open || 979 this.matches(":popover-open, :modal") || 980 !this.isConnected || 981 !this.ownerDocument 982 ) 983 return o.apply(this, arguments); 984 let e = new ToggleEvent("beforetoggle", { 985 newState: "open", 986 oldState: "closed", 987 cancelable: !0, 988 }); 989 return this.dispatchEvent(e) 990 ? (t(this), o.apply(this, arguments)) 991 : void 0; 992 }, 993 }, 994 close: { 995 value() { 996 return this.open || this.matches(":popover-open, :modal") 997 ? (l(this), a.apply(this, arguments)) 998 : a.apply(this, arguments); 999 }, 1000 }, 1001 })); 1002} 1003function ae(e) { 1004 function t() { 1005 document.readyState !== "loading" && 1006 (e(), document.removeEventListener("DOMContentLoaded", t)); 1007 } 1008 typeof window < "u" && 1009 typeof document < "u" && 1010 (document.addEventListener("DOMContentLoaded", t), t()); 1011} 1012typeof globalThis.window < "u" && 1013 (Y() || 1014 (te(), 1015 ae(async () => { 1016 if (await le("popover-polyfill")) return; 1017 let e = document.createElement("style"); 1018 ((e.textContent = "@layer popover-polyfill;"), 1019 e.setAttribute("suppressHydrationWarning", ""), 1020 e.addEventListener("securitypolicyviolation", () => { 1021 console.log( 1022 "CSP rules on this website prevented @tailwindplus/elements from defining `popover-polyfill` as the first CSS layer. This is necessary to ensure the popover polyfill behaves correctly with CSS layers. To fix this, please manually add the following CSS to the top of your first stylesheet:\n\n```\n@layer popover-polyfill;\n```", 1023 ); 1024 }), 1025 document.documentElement.prepend(e)); 1026 })), 1027 ne() || oe(), 1028 re() || ie()); 1029async function le(e) { 1030 await se(); 1031 for (let t of document.styleSheets) 1032 try { 1033 for (let n of t.rules) 1034 if ( 1035 n.constructor.name === "CSSLayerStatementRule" && 1036 "nameList" in n && 1037 n.nameList.includes(e) 1038 ) 1039 return !0; 1040 } catch {} 1041 return !1; 1042} 1043async function se() { 1044 await Promise.all( 1045 Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map((e) => 1046 e.sheet 1047 ? Promise.resolve() 1048 : new Promise((t) => { 1049 (e.addEventListener("load", () => t(), { once: !0 }), 1050 e.addEventListener("error", () => t(), { once: !0 })); 1051 }), 1052 ), 1053 ); 1054} 1055function ue(e) {
1056 "focus" in e && e.focus({ focusVisible: ce }); 1057} 1058var ce = !1; 1059if (typeof globalThis.window < "u") { 1060 let e; 1061 (((e) => ((e[(e.Keyboard = 0)] = "Keyboard"), (e[(e.Mouse = 1)] = "Mouse")))( 1062 e || (e = {}), 1063 ), 1064 document.addEventListener( 1065 "keydown", 1066 (e) => { 1067 e.metaKey || 1068 e.altKey || 1069 e.ctrlKey || 1070 ((ce = !0), (document.documentElement.dataset.focusVisible = "")); 1071 }, 1072 !0, 1073 ), 1074 document.addEventListener( 1075 "click", 1076 (e) => { 1077 e.detail === 1 1078 ? ((ce = !1), delete document.documentElement.dataset.focusVisible) 1079 : e.detail === 0 && 1080 ((ce = !0), (document.documentElement.dataset.focusVisible = "")); 1081 }, 1082 !0, 1083 )); 1084} 1085typeof globalThis.HTMLElement > "u" && (globalThis.HTMLElement = class {}); 1086var de, 1087 he, 1088 pe, 1089 fe = class extends HTMLElement { 1090 constructor() { 1091 super(...arguments); 1092 s(this, de, new AbortController()); 1093 s(this, he, !1); 1094 s(this, pe, !1); 1095 } 1096 connectedCallback() { 1097 if ( 1098 "observedAttributes" in this.constructor && 1099 typeof this.constructor.observedAttributes == "object" && 1100 Array.isArray(this.constructor.observedAttributes) 1101 ) 1102 for (let e of this.constructor.observedAttributes) 1103 typeof e == "string" && 1104 (e in this || 1105 Object.defineProperty(this, e, { 1106 get() { 1107 return this.getAttribute(e); 1108 }, 1109 set(t) { 1110 t != null && t !== !1 1111 ? this.setAttribute(e, t.toString()) 1112 : this.removeAttribute(e); 1113 }, 1114 })); 1115 (u(this, he, !0), 1116 queueMicrotask(() => { 1117 if (!l(this, de).signal.aborted) 1118 try { 1119 this.mount?.(l(this, de).signal); 1120 } catch (e) { 1121 console.error(e); 1122 } 1123 })); 1124 } 1125 disconnectedCallback() { 1126 (l(this, de).abort(), u(this, de, new AbortController())); 1127 } 1128 setAttributeNoCallbacks(e, t) { 1129 try { 1130 (u(this, pe, !0), this.setAttribute(e, t)); 1131 } finally { 1132 u(this, pe, !1); 1133 } 1134 } 1135 removeAttributeNoCallbacks(e) { 1136 try { 1137 (u(this, pe, !0), this.removeAttribute(e)); 1138 } finally { 1139 u(this, pe, !1); 1140 } 1141 } 1142 attributeChangedCallback(e, t, n) { 1143 l(this, he) && 1144 (l(this, pe) || (t !== n && this.onAttributeChange?.(e, t, n))); 1145 } 1146 }; 1147((de = new WeakMap()), (he = new WeakMap()), (pe = new WeakMap())); 1148function me(e, t) { 1149 typeof globalThis.customElements > "u" || 1150 customElements.get(e) === t || 1151 customElements.define(e, t); 1152} 1153function ge() { 1154 let e = [], 1155 t = { 1156 addEventListener(e, n, o, a) { 1157 return ( 1158 e.addEventListener(n, o, a), 1159 t.add(() => e.removeEventListener(n, o, a)) 1160 ); 1161 }, 1162 requestAnimationFrame(...e) { 1163 let n = requestAnimationFrame(...e); 1164 return t.add(() => cancelAnimationFrame(n)); 1165 }, 1166 nextFrame(...e) { 1167 return t.requestAnimationFrame(() => t.requestAnimationFrame(...e)); 1168 }, 1169 setTimeout(...e) { 1170 let n = setTimeout(...e); 1171 return t.add(() => clearTimeout(n)); 1172 }, 1173 microTask(...e) { 1174 let n = { current: !0 }; 1175 return ( 1176 queueMicrotask(() => { 1177 n.current && e[0](); 1178 }), 1179 t.add(() => { 1180 n.current = !1; 1181 }) 1182 ); 1183 }, 1184 style(e, t, n) { 1185 let o = e.style.getPropertyValue(t); 1186 return ( 1187 t.startsWith("--") 1188 ? e.style.setProperty(t, n) 1189 : Object.assign(e.style, { [t]: n }), 1190 this.add(() => { 1191 t.startsWith("--") 1192 ? e.style.setProperty(t, o) 1193 : Object.assign(e.style, { [t]: o }); 1194 }) 1195 ); 1196 }, 1197 add(t) { 1198 return ( 1199 e.includes(t) || e.push(t), 1200 () => { 1201 let n = e.indexOf(t); 1202 if (n >= 0) for (let t of e.splice(n, 1)) t(); 1203 } 1204 ); 1205 }, 1206 dispose() { 1207 for (let t of e.splice(0)) t(); 1208 }, 1209 }; 1210 return t; 1211} 1212function be(e, t = () => []) { 1213 let n = !1, 1214 o = null, 1215 a = ge(); 1216 return { 1217 start(l, s) { 1218 let u = [e, ...t()]; 1219 ((n = !n && o !== null && o !== l), (o = l)); 1220 for (let e of u) 1221 ve( 1222 e, 1223 () => { 1224 n || 1225 (l === "in" 1226 ? ((e.dataset.transition = ""), 1227 (e.dataset.enter = ""), 1228 (e.dataset.closed = ""), 1229 delete e.dataset.leave) 1230 : l === "out" && 1231 ((e.dataset.transition = ""), 1232 (e.dataset.leave = ""), 1233 delete e.dataset.enter)); 1234 }, 1235 o !== null, 1236 ); 1237 a.nextFrame(() => { 1238 for (let e of u) 1239 n 1240 ? l === "in" 1241 ? (delete e.dataset.enter, 1242 delete e.dataset.closed, 1243 (e.dataset.leave = "")) 1244 : l === "out" && 1245 (delete e.dataset.leave, 1246 (e.dataset.enter = ""), 1247 (e.dataset.closed = "")) 1248 : l === "in" 1249 ? delete e.dataset.closed 1250 : l === "out" && (e.dataset.closed = ""); 1251 a.requestAnimationFrame(() => { 1252 a.add( 1253 we(e, () => { 1254 if ( 1255 !( 1256 n && 1257 typeof e.getAnimations == "function" && 1258 e.getAnimations({ subtree: !0 }).length > 0 1259 ) 1260 ) { 1261 for (let e of u) 1262 (delete e.dataset.transition, 1263 delete e.dataset.enter, 1264 delete e.dataset.closed, 1265 delete e.dataset.leave); 1266 ((o = null), s?.()); 1267 } 1268 }), 1269 ); 1270 }); 1271 }); 1272 }, 1273 abort() { 1274 (a.dispose(), (n = !1), (o = null)); 1275 }, 1276 }; 1277} 1278function ve(e, t, n = !1) { 1279 if (n) { 1280 t(); 1281 return; 1282 } 1283 let o = e.style.transition; 1284 ((e.style.transition = "none"), 1285 t(), 1286 e.offsetHeight, 1287 (e.style.transition = o)); 1288} 1289function we(e, t) { 1290 let n = ge(); 1291 if (!e) return n.dispose; 1292 let o = !1; 1293 n.add(() => { 1294 o = !0; 1295 }); 1296 let a = 1297 e 1298 .getAnimations?.({ subtree: !0 }) 1299 .filter((e) => e instanceof CSSTransition) ?? []; 1300 return a.length === 0 1301 ? (t(), n.dispose) 1302 : (Promise.allSettled(a.map((e) => e.finished)).then(() => { 1303 o || t(); 1304 }), 1305 n.dispose); 1306} 1307var ye = Math.min, 1308 Ae = Math.max, 1309 Ee = Math.round, 1310 xe = Math.floor, 1311 Te = (e) => ({ x: e, y: e }), 1312 Se = { left: "right", right: "left", bottom: "top", top: "bottom" }, 1313 ke = { start: "end", end: "start" }; 1314function Ie(e, t, n) { 1315 return Ae(e, ye(t, n)); 1316} 1317function Le(e, t) { 1318 return typeof e == "function" ? e(t) : e; 1319} 1320function De(e) { 1321 return e.split("-")[0]; 1322} 1323function Pe(e) { 1324 return e.split("-")[1]; 1325} 1326function Ce(e) { 1327 return e === "x" ? "y" : "x"; 1328} 1329function Me(e) { 1330 return e === "y" ? "height" : "width"; 1331} 1332var Oe = new Set(["top", "bottom"]); 1333function Be(e) { 1334 return Oe.has(De(e)) ? "y" : "x"; 1335} 1336function Re(e) { 1337 return Ce(Be(e)); 1338} 1339function qe(e, t, n) { 1340 n === void 0 && (n = !1);
1341 let o = Pe(e), 1342 a = Re(e), 1343 l = Me(a), 1344 s = 1345 a === "x" 1346 ? o === (n ? "end" : "start") 1347 ? "right" 1348 : "left" 1349 : o === "start" 1350 ? "bottom" 1351 : "top"; 1352 return (t.reference[l] > t.floating[l] && (s = ze(s)), [s, ze(s)]); 1353} 1354function We(e) { 1355 let t = ze(e); 1356 return [Fe(e), t, Fe(t)]; 1357} 1358function Fe(e) { 1359 return e.replace(/start|end/g, (e) => ke[e]); 1360} 1361var He = ["left", "right"], 1362 Ne = ["right", "left"], 1363 $e = ["top", "bottom"], 1364 Ke = ["bottom", "top"]; 1365function je(e, t, n) { 1366 switch (e) { 1367 case "top": 1368 case "bottom": 1369 return n ? (t ? Ne : He) : t ? He : Ne; 1370 case "left": 1371 case "right": 1372 return t ? $e : Ke; 1373 default: 1374 return []; 1375 } 1376} 1377function Ve(e, t, n, o) { 1378 let a = Pe(e), 1379 l = je(De(e), n === "start", o); 1380 return ( 1381 a && ((l = l.map((e) => e + "-" + a)), t && (l = l.concat(l.map(Fe)))), 1382 l 1383 ); 1384} 1385function ze(e) { 1386 return e.replace(/left|right|bottom|top/g, (e) => Se[e]); 1387} 1388function Ue(e) { 1389 return { top: 0, right: 0, bottom: 0, left: 0, ...e }; 1390} 1391function Ge(e) { 1392 return typeof e != "number" 1393 ? Ue(e) 1394 : { top: e, right: e, bottom: e, left: e }; 1395} 1396function Ye(e) { 1397 let { x: t, y: n, width: o, height: a } = e; 1398 return { 1399 width: o, 1400 height: a, 1401 top: n, 1402 left: t, 1403 right: t + o, 1404 bottom: n + a, 1405 x: t, 1406 y: n, 1407 }; 1408} 1409function Qe(e, t, n) { 1410 let o, 1411 { reference: a, floating: l } = e, 1412 s = Be(t), 1413 u = Re(t), 1414 c = Me(u), 1415 d = De(t), 1416 h = s === "y", 1417 p = a.x + a.width / 2 - l.width / 2, 1418 f = a.y + a.height / 2 - l.height / 2, 1419 m = a[c] / 2 - l[c] / 2; 1420 switch (d) { 1421 case "top": 1422 o = { x: p, y: a.y - l.height }; 1423 break; 1424 case "bottom": 1425 o = { x: p, y: a.y + a.height }; 1426 break; 1427 case "right": 1428 o = { x: a.x + a.width, y: f }; 1429 break; 1430 case "left": 1431 o = { x: a.x - l.width, y: f }; 1432 break; 1433 default: 1434 o = { x: a.x, y: a.y }; 1435 } 1436 switch (Pe(t)) { 1437 case "start": 1438 o[u] -= m * (n && h ? -1 : 1); 1439 break; 1440 case "end": 1441 o[u] += m * (n && h ? -1 : 1); 1442 break; 1443 } 1444 return o; 1445} 1446var Xe = async (e, t, n) => { 1447 let { 1448 placement: o = "bottom", 1449 strategy: a = "absolute", 1450 middleware: l = [], 1451 platform: s, 1452 } = n, 1453 u = l.filter(Boolean), 1454 c = await (s.isRTL == null ? void 0 : s.isRTL(t)), 1455 d = await s.getElementRects({ reference: e, floating: t, strategy: a }), 1456 { x: h, y: p } = Qe(d, o, c), 1457 f = o, 1458 m = {}, 1459 g = 0; 1460 for (let n = 0; n < u.length; n++) { 1461 let { name: l, fn: b } = u[n], 1462 { 1463 x: v, 1464 y: w, 1465 data: y, 1466 reset: A, 1467 } = await b({ 1468 x: h, 1469 y: p, 1470 initialPlacement: o, 1471 placement: f, 1472 strategy: a, 1473 middlewareData: m, 1474 rects: d, 1475 platform: s, 1476 elements: { reference: e, floating: t }, 1477 }); 1478 ((h = v ?? h), 1479 (p = w ?? p), 1480 (m = { ...m, [l]: { ...m[l], ...y } }), 1481 A && 1482 g <= 50 && 1483 (g++, 1484 typeof A == "object" && 1485 (A.placement && (f = A.placement), 1486 A.rects && 1487 (d = 1488 A.rects === !0 1489 ? await s.getElementRects({ 1490 reference: e, 1491 floating: t, 1492 strategy: a, 1493 }) 1494 : A.rects), 1495 ({ x: h, y: p } = Qe(d, f, c))), 1496 (n = -1))); 1497 } 1498 return { x: h, y: p, placement: f, strategy: a, middlewareData: m }; 1499}; 1500async function _e(e, t) { 1501 var n; 1502 t === void 0 && (t = {}); 1503 let { x: o, y: a, platform: l, rects: s, elements: u, strategy: c } = e, 1504 { 1505 boundary: d = "clippingAncestors", 1506 rootBoundary: h = "viewport", 1507 elementContext: p = "floating", 1508 altBoundary: f = !1, 1509 padding: m = 0, 1510 } = Le(t, e), 1511 g = Ge(m), 1512 b = u[f ? (p === "floating" ? "reference" : "floating") : p], 1513 v = Ye( 1514 await l.getClippingRect({ 1515 element: 1516 (n = await (l.isElement == null ? void 0 : l.isElement(b))) == null || 1517 n 1518 ? b 1519 : b.contextElement || 1520 (await (l.getDocumentElement == null 1521 ? void 0 1522 : l.getDocumentElement(u.floating))), 1523 boundary: d, 1524 rootBoundary: h, 1525 strategy: c, 1526 }), 1527 ), 1528 w = 1529 p === "floating" 1530 ? { x: o, y: a, width: s.floating.width, height: s.floating.height } 1531 : s.reference, 1532 y = await (l.getOffsetParent == null 1533 ? void 0 1534 : l.getOffsetParent(u.floating)), 1535 A = ((await (l.isElement == null ? void 0 : l.isElement(y))) && 1536 (await (l.getScale == null ? void 0 : l.getScale(y)))) || { x: 1, y: 1 }, 1537 E = Ye( 1538 l.convertOffsetParentRelativeRectToViewportRelativeRect 1539 ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({ 1540 elements: u, 1541 rect: w, 1542 offsetParent: y, 1543 strategy: c, 1544 }) 1545 : w, 1546 ); 1547 return { 1548 top: (v.top - E.top + g.top) / A.y, 1549 bottom: (E.bottom - v.bottom + g.bottom) / A.y, 1550 left: (v.left - E.left + g.left) / A.x, 1551 right: (E.right - v.right + g.right) / A.x, 1552 }; 1553} 1554var Je = function (e) { 1555 return ( 1556 e === void 0 && (e = {}), 1557 { 1558 name: "flip", 1559 options: e, 1560 async fn(t) { 1561 var n, o; 1562 let { 1563 placement: a, 1564 middlewareData: l, 1565 rects: s, 1566 initialPlacement: u, 1567 platform: c, 1568 elements: d, 1569 } = t, 1570 { 1571 mainAxis: h = !0, 1572 crossAxis: p = !0, 1573 fallbackPlacements: f, 1574 fallbackStrategy: m = "bestFit", 1575 fallbackAxisSideDirection: g = "none", 1576 flipAlignment: b = !0, 1577 ...v 1578 } = Le(e, t); 1579 if ((n = l.arrow) != null && n.alignmentOffset) return {}; 1580 let w = De(a), 1581 y = Be(u), 1582 A = De(u) === u, 1583 E = await (c.isRTL == null ? void 0 : c.isRTL(d.floating)), 1584 x = f || (A || !b ? [ze(u)] : We(u)), 1585 T = g !== "none"; 1586 !f && T && x.push(...Ve(u, b, g, E)); 1587 let S = [u, ...x], 1588 k = await _e(t, v), 1589 I = [], 1590 L = ((o = l.flip) == null ? void 0 : o.overflows) || []; 1591 if ((h && I.push(k[w]), p)) { 1592 let e = qe(a, s, E); 1593 I.push(k[e[0]], k[e[1]]); 1594 } 1595 if ( 1596 ((L = [...L, { placement: a, overflows: I }]), 1597 !I.every((e) => e <= 0)) 1598 ) { 1599 var D, P; 1600 let e = (((D = l.flip) == null ? void 0 : D.index) || 0) + 1, 1601 t = S[e]; 1602 if ( 1603 t && 1604 (!(p === "alignment" && y !== Be(t)) || 1605 L.every((e) => Be(e.placement) !== y || e.overflows[0] > 0)) 1606 ) 1607 return { 1608 data: { index: e, overflows: L }, 1609 reset: { placement: t }, 1610 }; 1611 let n = 1612 (P = L.filter((e) => e.overflows[0] <= 0).sort( 1613 (e, t) => e.overflows[1] - t.overflows[1], 1614 )[0]) == null 1615 ? void 0 1616 : P.placement; 1617 if (!n) 1618 switch (m) { 1619 case "bestFit": { 1620 var C; 1621 let e = 1622 (C = L.filter((e) => { 1623 if (T) { 1624 let t = Be(e.placement); 1625 return t === y || t === "y"; 1626 } 1627 return !0; 1628 }) 1629 .map((e) => [ 1630 e.placement, 1631 e.overflows 1632 .filter((e) => e > 0) 1633 .reduce((e, t) => e + t, 0), 1634 ]) 1635 .sort((e, t) => e[1] - t[1])[0]) == null 1636 ? void 0 1637 : C[0]; 1638 e && (n = e); 1639 break; 1640 } 1641 case "initialPlacement": 1642 n = u; 1643 break; 1644 } 1645 if (a !== n) return { reset: { placement: n } }; 1646 } 1647 return {}; 1648 }, 1649 } 1650 ); 1651}; 1652var Ze = function (e) { 1653 return ( 1654 e === void 0 && (e = {}), 1655 { 1656 name: "shift", 1657 options: e, 1658 async fn(t) { 1659 let { x: n, y: o, placement: a } = t, 1660 { 1661 mainAxis: l = !0, 1662 crossAxis: s = !1, 1663 limiter: u = { 1664 fn: (e) => { 1665 let { x: t, y: n } = e; 1666 return { x: t, y: n }; 1667 }, 1668 }, 1669 ...c 1670 } = Le(e, t), 1671 d = { x: n, y: o }, 1672 h = await _e(t, c), 1673 p = Be(De(a)), 1674 f = Ce(p), 1675 m = d[f], 1676 g = d[p]; 1677 if (l) { 1678 let e = f === "y" ? "top" : "left", 1679 t = f === "y" ? "bottom" : "right", 1680 n = m + h[e], 1681 o = m - h[t]; 1682 m = Ie(n, m, o); 1683 } 1684 if (s) { 1685 let e = p === "y" ? "top" : "left", 1686 t = p === "y" ? "bottom" : "right", 1687 n = g + h[e], 1688 o = g - h[t]; 1689 g = Ie(n, g, o); 1690 } 1691 let b = u.fn({ ...t, [f]: m, [p]: g }); 1692 return { 1693 ...b, 1694 data: { x: b.x - n, y: b.y - o, enabled: { [f]: l, [p]: s } }, 1695 }; 1696 }, 1697 } 1698 ); 1699}; 1700function et() { 1701 return typeof window < "u"; 1702} 1703function tt(e) { 1704 return rt(e) ? (e.nodeName || "").toLowerCase() : "#document"; 1705} 1706function nt(e) { 1707 var t; 1708 return ( 1709 (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || 1710 window 1711 ); 1712} 1713function ot(e) { 1714 var t; 1715 return (t = (rt(e) ? e.ownerDocument : e.document) || window.document) == null 1716 ? void 0 1717 : t.documentElement; 1718} 1719function rt(e) { 1720 return !!et() && (e instanceof Node || e instanceof nt(e).Node); 1721} 1722function it(e) { 1723 return !!et() && (e instanceof Element || e instanceof nt(e).Element); 1724} 1725function at(e) { 1726 return !!et() && (e instanceof HTMLElement || e instanceof nt(e).HTMLElement); 1727} 1728function lt(e) { 1729 return ( 1730 !(!et() || typeof ShadowRoot > "u") && 1731 (e instanceof ShadowRoot || e instanceof nt(e).ShadowRoot) 1732 ); 1733} 1734var st = new Set(["inline", "contents"]); 1735function ut(e) { 1736 let { overflow: t, overflowX: n, overflowY: o, display: a } = Et(e); 1737 return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !st.has(a); 1738} 1739var ct = new Set(["table", "td", "th"]); 1740function dt(e) { 1741 return ct.has(tt(e)); 1742} 1743var ht = [":popover-open", ":modal"]; 1744function pt(e) { 1745 return ht.some((t) => { 1746 try { 1747 return e.matches(t); 1748 } catch { 1749 return !1; 1750 } 1751 }); 1752} 1753var ft = ["transform", "translate", "scale", "rotate", "perspective"], 1754 mt = ["transform", "translate", "scale", "rotate", "perspective", "filter"], 1755 gt = ["paint", "layout", "strict", "content"]; 1756function bt(e) { 1757 let t = wt(), 1758 n = it(e) ? Et(e) : e; 1759 return (
1760 ft.some((e) => !!n[e] && n[e] !== "none") || 1761 (!!n.containerType && n.containerType !== "normal") || 1762 (!t && !!n.backdropFilter && n.backdropFilter !== "none") || 1763 (!t && !!n.filter && n.filter !== "none") || 1764 mt.some((e) => (n.willChange || "").includes(e)) || 1765 gt.some((e) => (n.contain || "").includes(e)) 1766 ); 1767} 1768function vt(e) { 1769 let t = Tt(e); 1770 for (; at(t) && !At(t); ) { 1771 if (bt(t)) return t; 1772 if (pt(t)) return null; 1773 t = Tt(t); 1774 } 1775 return null; 1776} 1777function wt() { 1778 return ( 1779 !(typeof CSS > "u" || !CSS.supports) && 1780 CSS.supports("-webkit-backdrop-filter", "none") 1781 ); 1782} 1783var yt = new Set(["html", "body", "#document"]); 1784function At(e) { 1785 return yt.has(tt(e)); 1786} 1787function Et(e) { 1788 return nt(e).getComputedStyle(e); 1789} 1790function xt(e) { 1791 return it(e) 1792 ? { scrollLeft: e.scrollLeft, scrollTop: e.scrollTop } 1793 : { scrollLeft: e.scrollX, scrollTop: e.scrollY }; 1794} 1795function Tt(e) { 1796 if (tt(e) === "html") return e; 1797 let t = e.assignedSlot || e.parentNode || (lt(e) && e.host) || ot(e); 1798 return lt(t) ? t.host : t; 1799} 1800function St(e) { 1801 let t = Tt(e); 1802 return At(t) 1803 ? e.ownerDocument 1804 ? e.ownerDocument.body 1805 : e.body 1806 : at(t) && ut(t) 1807 ? t 1808 : St(t); 1809} 1810function kt(e, t, n) { 1811 var o; 1812 (t === void 0 && (t = []), n === void 0 && (n = !0)); 1813 let a = St(e), 1814 l = a === ((o = e.ownerDocument) == null ? void 0 : o.body), 1815 s = nt(a); 1816 if (l) { 1817 let e = It(s); 1818 return t.concat( 1819 s, 1820 s.visualViewport || [], 1821 ut(a) ? a : [], 1822 e && n ? kt(e) : [], 1823 ); 1824 } 1825 return t.concat(a, kt(a, [], n)); 1826} 1827function It(e) {
1828 return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null; 1829} 1830function Lt(e) { 1831 let t = Et(e), 1832 n = parseFloat(t.width) || 0, 1833 o = parseFloat(t.height) || 0, 1834 a = at(e), 1835 l = a ? e.offsetWidth : n, 1836 s = a ? e.offsetHeight : o, 1837 u = Ee(n) !== l || Ee(o) !== s; 1838 return (u && ((n = l), (o = s)), { width: n, height: o, $: u }); 1839} 1840function Dt(e) { 1841 return it(e) ? e : e.contextElement; 1842} 1843function Pt(e) { 1844 let t = Dt(e); 1845 if (!at(t)) return Te(1); 1846 let n = t.getBoundingClientRect(), 1847 { width: o, height: a, $: l } = Lt(t), 1848 s = (l ? Ee(n.width) : n.width) / o, 1849 u = (l ? Ee(n.height) : n.height) / a; 1850 return ( 1851 (!s || !Number.isFinite(s)) && (s = 1), 1852 (!u || !Number.isFinite(u)) && (u = 1), 1853 { x: s, y: u } 1854 ); 1855} 1856var Ct = Te(0); 1857function Mt(e) { 1858 let t = nt(e); 1859 return wt() && t.visualViewport 1860 ? { x: t.visualViewport.offsetLeft, y: t.visualViewport.offsetTop } 1861 : Ct; 1862} 1863function Ot(e, t, n) { 1864 return (t === void 0 && (t = !1), !(!n || (t && n !== nt(e))) && t); 1865} 1866function Bt(e, t, n, o) { 1867 (t === void 0 && (t = !1), n === void 0 && (n = !1)); 1868 let a = e.getBoundingClientRect(), 1869 l = Dt(e), 1870 s = Te(1); 1871 t && (o ? it(o) && (s = Pt(o)) : (s = Pt(e))); 1872 let u = Ot(l, n, o) ? Mt(l) : Te(0), 1873 c = (a.left + u.x) / s.x, 1874 d = (a.top + u.y) / s.y, 1875 h = a.width / s.x, 1876 p = a.height / s.y; 1877 if (l) { 1878 let e = nt(l), 1879 t = o && it(o) ? nt(o) : o, 1880 n = e, 1881 a = It(n); 1882 for (; a && o && t !== n; ) { 1883 let e = Pt(a), 1884 t = a.getBoundingClientRect(), 1885 o = Et(a), 1886 l = t.left + (a.clientLeft + parseFloat(o.paddingLeft)) * e.x, 1887 s = t.top + (a.clientTop + parseFloat(o.paddingTop)) * e.y; 1888 ((c *= e.x), 1889 (d *= e.y), 1890 (h *= e.x), 1891 (p *= e.y), 1892 (c += l), 1893 (d += s), 1894 (n = nt(a)), 1895 (a = It(n))); 1896 } 1897 } 1898 return Ye({ width: h, height: p, x: c, y: d }); 1899} 1900function Rt(e, t) { 1901 let n = xt(e).scrollLeft; 1902 return t ? t.left + n : Bt(ot(e)).left + n; 1903} 1904function qt(e, t, n) { 1905 n === void 0 && (n = !1); 1906 let o = e.getBoundingClientRect(), 1907 a = o.left + t.scrollLeft - (n ? 0 : Rt(e, o)), 1908 l = o.top + t.scrollTop; 1909 return { x: a, y: l }; 1910} 1911function Wt(e) { 1912 let { elements: t, rect: n, offsetParent: o, strategy: a } = e, 1913 l = a === "fixed", 1914 s = ot(o), 1915 u = !!t && pt(t.floating); 1916 if (o === s || (u && l)) return n; 1917 let c = { scrollLeft: 0, scrollTop: 0 }, 1918 d = Te(1), 1919 h = Te(0), 1920 p = at(o); 1921 if ( 1922 (p || (!p && !l)) && 1923 ((tt(o) !== "body" || ut(s)) && (c = xt(o)), at(o)) 1924 ) { 1925 let e = Bt(o); 1926 ((d = Pt(o)), (h.x = e.x + o.clientLeft), (h.y = e.y + o.clientTop)); 1927 } 1928 let f = !s || p || l ? Te(0) : qt(s, c, !0); 1929 return { 1930 width: n.width * d.x, 1931 height: n.height * d.y, 1932 x: n.x * d.x - c.scrollLeft * d.x + h.x + f.x, 1933 y: n.y * d.y - c.scrollTop * d.y + h.y + f.y, 1934 }; 1935} 1936function Ft(e) { 1937 return Array.from(e.getClientRects()); 1938} 1939function Ht(e) { 1940 let t = ot(e), 1941 n = xt(e), 1942 o = e.ownerDocument.body, 1943 a = Ae(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), 1944 l = Ae(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight), 1945 s = -n.scrollLeft + Rt(e), 1946 u = -n.scrollTop; 1947 return ( 1948 Et(o).direction === "rtl" && (s += Ae(t.clientWidth, o.clientWidth) - a), 1949 { width: a, height: l, x: s, y: u } 1950 ); 1951} 1952function Nt(e, t) { 1953 let n = nt(e), 1954 o = ot(e), 1955 a = n.visualViewport, 1956 l = o.clientWidth, 1957 s = o.clientHeight, 1958 u = 0, 1959 c = 0; 1960 if (a) { 1961 ((l = a.width), (s = a.height)); 1962 let e = wt(); 1963 (!e || (e && t === "fixed")) && ((u = a.offsetLeft), (c = a.offsetTop)); 1964 } 1965 return { width: l, height: s, x: u, y: c }; 1966} 1967var $t = new Set(["absolute", "fixed"]); 1968function Kt(e, t) { 1969 let n = Bt(e, !0, t === "fixed"), 1970 o = n.top + e.clientTop, 1971 a = n.left + e.clientLeft, 1972 l = at(e) ? Pt(e) : Te(1), 1973 s = e.clientWidth * l.x, 1974 u = e.clientHeight * l.y, 1975 c = a * l.x, 1976 d = o * l.y; 1977 return { width: s, height: u, x: c, y: d }; 1978} 1979function jt(e, t, n) { 1980 let o; 1981 if (t === "viewport") o = Nt(e, n); 1982 else if (t === "document") o = Ht(ot(e)); 1983 else if (it(t)) o = Kt(t, n); 1984 else { 1985 let n = Mt(e); 1986 o = { x: t.x - n.x, y: t.y - n.y, width: t.width, height: t.height }; 1987 } 1988 return Ye(o); 1989} 1990function Vt(e, t) { 1991 let n = Tt(e); 1992 return ( 1993 !(n === t || !it(n) || At(n)) && (Et(n).position === "fixed" || Vt(n, t)) 1994 ); 1995} 1996function zt(e, t) { 1997 let n = t.get(e); 1998 if (n) return n; 1999 let o = kt(e, [], !1).filter((e) => it(e) && tt(e) !== "body"), 2000 a = null, 2001 l = Et(e).position === "fixed", 2002 s = l ? Tt(e) : e; 2003 for (; it(s) && !At(s); ) { 2004 let t = Et(s), 2005 n = bt(s); 2006 (!n && t.position === "fixed" && (a = null),
2007 ( 2008 l 2009 ? !n && !a 2010 : (!n && t.position === "static" && !!a && $t.has(a.position)) || 2011 (ut(s) && !n && Vt(e, s)) 2012 ) 2013 ? (o = o.filter((e) => e !== s)) 2014 : (a = t), 2015 (s = Tt(s))); 2016 } 2017 return (t.set(e, o), o); 2018} 2019function Ut(e) { 2020 let { element: t, boundary: n, rootBoundary: o, strategy: a } = e, 2021 l = [ 2022 ...(n === "clippingAncestors" 2023 ? pt(t) 2024 ? [] 2025 : zt(t, this._c) 2026 : [].concat(n)), 2027 o, 2028 ], 2029 s = l[0], 2030 u = l.reduce( 2031 (e, n) => { 2032 let o = jt(t, n, a); 2033 return ( 2034 (e.top = Ae(o.top, e.top)), 2035 (e.right = ye(o.right, e.right)), 2036 (e.bottom = ye(o.bottom, e.bottom)), 2037 (e.left = Ae(o.left, e.left)), 2038 e 2039 ); 2040 }, 2041 jt(t, s, a), 2042 ); 2043 return { 2044 width: u.right - u.left, 2045 height: u.bottom - u.top, 2046 x: u.left, 2047 y: u.top, 2048 }; 2049} 2050function Gt(e) { 2051 let { width: t, height: n } = Lt(e); 2052 return { width: t, height: n }; 2053} 2054function Yt(e, t, n) { 2055 let o = at(t), 2056 a = ot(t), 2057 l = n === "fixed", 2058 s = Bt(e, !0, l, t), 2059 u = { scrollLeft: 0, scrollTop: 0 }, 2060 c = Te(0); 2061 function d() { 2062 c.x = Rt(a); 2063 } 2064 if (o || (!o && !l)) 2065 if (((tt(t) !== "body" || ut(a)) && (u = xt(t)), o)) { 2066 let e = Bt(t, !0, l, t); 2067 ((c.x = e.x + t.clientLeft), (c.y = e.y + t.clientTop)); 2068 } else a && d(); 2069 l && !o && a && d(); 2070 let h = !a || o || l ? Te(0) : qt(a, u), 2071 p = s.left + u.scrollLeft - c.x - h.x, 2072 f = s.top + u.scrollTop - c.y - h.y; 2073 return { x: p, y: f, width: s.width, height: s.height }; 2074} 2075function Qt(e) { 2076 return Et(e).position === "static"; 2077} 2078function Xt(e, t) { 2079 if (!at(e) || Et(e).position === "fixed") return null; 2080 if (t) return t(e); 2081 let n = e.offsetParent; 2082 return (ot(e) === n && (n = n.ownerDocument.body), n); 2083} 2084function _t(e, t) { 2085 let n = nt(e); 2086 if (pt(e)) return n; 2087 if (!at(e)) { 2088 let t = Tt(e); 2089 for (; t && !At(t); ) { 2090 if (it(t) && !Qt(t)) return t; 2091 t = Tt(t); 2092 } 2093 return n; 2094 } 2095 let o = Xt(e, t); 2096 for (; o && dt(o) && Qt(o); ) o = Xt(o, t); 2097 return o && At(o) && Qt(o) && !bt(o) ? n : o || vt(e) || n; 2098} 2099var Jt = async function (e) { 2100 let t = this.getOffsetParent || _t, 2101 n = this.getDimensions, 2102 o = await n(e.floating); 2103 return { 2104 reference: Yt(e.reference, await t(e.floating), e.strategy), 2105 floating: { x: 0, y: 0, width: o.width, height: o.height }, 2106 }; 2107}; 2108function Zt(e) { 2109 return Et(e).direction === "rtl"; 2110} 2111var en = { 2112 convertOffsetParentRelativeRectToViewportRelativeRect: Wt, 2113 getDocumentElement: ot, 2114 getClippingRect: Ut, 2115 getOffsetParent: _t, 2116 getElementRects: Jt, 2117 getClientRects: Ft, 2118 getDimensions: Gt, 2119 getScale: Pt, 2120 isElement: it, 2121 isRTL: Zt, 2122}; 2123function tn(e, t) { 2124 return ( 2125 e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height 2126 ); 2127} 2128function nn(e, t) { 2129 let n, 2130 o = null, 2131 a = ot(e); 2132 function l() { 2133 var e; 2134 (clearTimeout(n), (e = o) == null || e.disconnect(), (o = null)); 2135 } 2136 function s(u, c) { 2137 (u === void 0 && (u = !1), c === void 0 && (c = 1), l()); 2138 let d = e.getBoundingClientRect(), 2139 { left: h, top: p, width: f, height: m } = d; 2140 if ((u || t(), !f || !m)) return; 2141 let g = xe(p), 2142 b = xe(a.clientWidth - (h + f)), 2143 v = xe(a.clientHeight - (p + m)), 2144 w = xe(h), 2145 y = { 2146 rootMargin: -g + "px " + -b + "px " + -v + "px " + -w + "px", 2147 threshold: Ae(0, ye(1, c)) || 1, 2148 }, 2149 A = !0; 2150 function E(t) { 2151 let o = t[0].intersectionRatio; 2152 if (o !== c) { 2153 if (!A) return s(); 2154 o 2155 ? s(!1, o) 2156 : (n = setTimeout(() => { 2157 s(!1, 1e-7); 2158 }, 1e3)); 2159 } 2160 (o === 1 && !tn(d, e.getBoundingClientRect()) && s(), (A = !1)); 2161 } 2162 try { 2163 o = new IntersectionObserver(E, { ...y, root: a.ownerDocument }); 2164 } catch { 2165 o = new IntersectionObserver(E, y); 2166 } 2167 o.observe(e); 2168 } 2169 return (s(!0), l); 2170} 2171function on(e, t, n, o) { 2172 o === void 0 && (o = {}); 2173 let { 2174 ancestorScroll: a = !0, 2175 ancestorResize: l = !0, 2176 elementResize: s = typeof ResizeObserver == "function", 2177 layoutShift: u = typeof IntersectionObserver == "function", 2178 animationFrame: c = !1, 2179 } = o, 2180 d = Dt(e),
2181 h = a || l ? [...(d ? kt(d) : []), ...kt(t)] : []; 2182 h.forEach((e) => { 2183 (a && e.addEventListener("scroll", n, { passive: !0 }), 2184 l && e.addEventListener("resize", n)); 2185 }); 2186 let p = d && u ? nn(d, n) : null, 2187 f = -1, 2188 m = null; 2189 s && 2190 ((m = new ResizeObserver((e) => { 2191 let [o] = e; 2192 (o && 2193 o.target === d && 2194 m && 2195 (m.unobserve(t), 2196 cancelAnimationFrame(f), 2197 (f = requestAnimationFrame(() => { 2198 var e; 2199 (e = m) == null || e.observe(t); 2200 }))), 2201 n()); 2202 })), 2203 d && !c && m.observe(d), 2204 m.observe(t)); 2205 let g, 2206 b = c ? Bt(e) : null; 2207 c && v(); 2208 function v() { 2209 let t = Bt(e); 2210 (b && !tn(b, t) && n(), (b = t), (g = requestAnimationFrame(v))); 2211 } 2212 return ( 2213 n(), 2214 () => { 2215 var e; 2216 (h.forEach((e) => { 2217 (a && e.removeEventListener("scroll", n), 2218 l && e.removeEventListener("resize", n)); 2219 }), 2220 p?.(), 2221 (e = m) == null || e.disconnect(), 2222 (m = null), 2223 c && cancelAnimationFrame(g)); 2224 } 2225 ); 2226} 2227var rn = Ze, 2228 an = Je; 2229var ln = (e, t, n) => { 2230 let o = new Map(), 2231 a = { platform: en, ...n }, 2232 l = { ...a.platform, _c: o }; 2233 return Xe(e, t, { ...a, platform: l }); 2234}; 2235function sn(e, t) { 2236 let n = () => {}; 2237 return function (o) { 2238 if ((n(), !o)) { 2239 e.style.removeProperty("position"); 2240 return; 2241 } 2242 let a = t(); 2243 if (!a || !e.hasAttribute("anchor")) return; 2244 let l = e.getAttribute("anchor"), 2245 s = e.getAttribute("anchor-strategy") || "absolute"; 2246 (s !== "absolute" && 2247 s !== "fixed" && 2248 (console.warn( 2249 `[createAnchorUpdater] Invalid anchor strategy "${s}" for element:`, 2250 e, 2251 ), 2252 (s = "absolute")), 2253 (n = on(a, e, () => { 2254 let t = cn( 2255 window.getComputedStyle(e).getPropertyValue("--anchor-gap"), 2256 e, 2257 ), 2258 n = cn( 2259 window.getComputedStyle(e).getPropertyValue("--anchor-offset"), 2260 e, 2261 ), 2262 o = l.split(" ")[0], 2263 u = {}; 2264 switch (o) { 2265 case "top": 2266 case "bottom": 2267 u = { top: t, left: -1 * n, right: n, bottom: t }; 2268 break; 2269 case "left": 2270 case "right": 2271 u = { top: -1 * n, bottom: n, left: t, right: t }; 2272 break; 2273 } 2274 ln(a, e, { 2275 strategy: s, 2276 placement: l.replace(" ", "-"), 2277 middleware: [an({ padding: u }), rn({ padding: u })], 2278 }).then(async ({ x: t, y: n, placement: o }) => { 2279 if (!un() && s === "absolute") { 2280 let o = null; 2281 for (let t = e.parentElement; t; t = t.parentElement) { 2282 let e = getComputedStyle(t).position; 2283 if ( 2284 e === "relative" || 2285 e === "absolute" || 2286 e === "fixed" || 2287 e === "sticky" 2288 ) { 2289 o = t; 2290 break; 2291 } 2292 } 2293 if (o) { 2294 let e = o.getBoundingClientRect(); 2295 ((t -= e.left + window.scrollX), (n -= e.top + window.scrollY)); 2296 } 2297 } 2298 let a = `${t}px`, 2299 l = `${n}px`; 2300 switch (o.split("-")[0]) { 2301 case "top": 2302 ((l = `calc(${n}px - var(--anchor-gap, 0px))`), 2303 (a = `calc(${t}px + var(--anchor-offset, 0px))`)); 2304 break; 2305 case "right": 2306 ((a = `calc(${t}px + var(--anchor-gap, 0px))`), 2307 (l = `calc(${n}px + var(--anchor-offset, 0px))`)); 2308 break; 2309 case "bottom": 2310 ((l = `calc(${n}px + var(--anchor-gap, 0px))`), 2311 (a = `calc(${t}px + var(--anchor-offset, 0px))`)); 2312 break; 2313 case "left": 2314 ((a = `calc(${t}px - var(--anchor-gap, 0px))`), 2315 (l = `calc(${n}px + var(--anchor-offset, 0px))`)); 2316 break; 2317 } 2318 (Object.assign(e.style, { left: a, top: l, position: s }), 2319 (await en.isRTL?.(e)) && 2320 Object.assign(e.style, { right: "unset", bottom: "unset" })); 2321 }); 2322 }))); 2323 }; 2324} 2325function un() { 2326 return ( 2327 "showPopover" in HTMLElement.prototype && 2328 HTMLElement.prototype.showPopover.toString().includes("[native code]") 2329 ); 2330} 2331function cn(e, t) { 2332 let n = document.createElement("div"); 2333 (t.appendChild(n), 2334 n.style.setProperty("margin-top", "0px", "important"), 2335 n.style.setProperty("margin-top", e, "important")); 2336 let o = parseFloat(window.getComputedStyle(n).marginTop) || 0; 2337 return (t.removeChild(n), o); 2338} 2339function dn(e) { 2340 return hn(e) && "tabIndex" in e; 2341} 2342function hn(e) { 2343 return fn(e) && "tagName" in e; 2344} 2345function pn(e) { 2346 return hn(e) && "accessKey" in e; 2347} 2348function fn(e) { 2349 return typeof e == "object" && e !== null && "nodeType" in e; 2350} 2351function mn(e) { 2352 return hn(e) && "style" in e; 2353} 2354function gn(e) { 2355 return pn(e) && e.nodeName === "INPUT"; 2356} 2357function bn(e) { 2358 let t = e.getBoundingClientRect(); 2359 return !( 2360 !(t.x !== 0 || t.y !== 0 || t.width !== 0 || t.height !== 0) || 2361 (e.ownerDocument.defaultView || window).getComputedStyle(e).visibility === 2362 "hidden" 2363 ); 2364} 2365var vn = { 2366 get selectRequired() { 2367 let e = document.createElement("select"); 2368 e.setAttribute("required", "true"); 2369 let t = e.validationMessage; 2370 return (Object.defineProperty(this, "selectRequired", { value: t }), t); 2371 }, 2372}; 2373function wn(e, t, n) { 2374 function o() { 2375 if (!bn(e)) { 2376 for (let t of e.children) if (bn(t)) return; 2377 n(); 2378 } 2379 } 2380 if (typeof ResizeObserver < "u") { 2381 let n = new ResizeObserver(o); 2382 (n.observe(e), t.addEventListener("abort", () => n.disconnect())); 2383 } 2384 if (typeof IntersectionObserver < "u") { 2385 let n = new IntersectionObserver(o); 2386 (n.observe(e), t.addEventListener("abort", () => n.disconnect())); 2387 } 2388} 2389var yn = !1, 2390 An = !1; 2391typeof navigator < "u" && 2392 ((yn = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)),
2393 (An = navigator.userAgent.toLowerCase().includes("firefox"))); 2394var En = !1; 2395function xn(e, t, n, o, a, l) { 2396 Sn(e.ownerDocument); 2397 let s = be(e), 2398 u = sn(e, n), 2399 c = ge(); 2400 e.setAttribute("popover", ""); 2401 let d = t(); 2402 (d && 2403 (d.setAttribute("type", "button"), 2404 d.setAttribute("aria-haspopup", "true"), 2405 d.setAttribute("aria-controls", e.id), 2406 d.setAttribute("aria-expanded", "false"), 2407 d.id && e.setAttribute("aria-labelledby", d.id)), 2408 e.hasAttribute("open") && queueMicrotask(() => e.showPopover()), 2409 e.addEventListener( 2410 "beforetoggle", 2411 (t) => { 2412 let n = t; 2413 u(n.newState === "open"); 2414 let o = e.hasAttribute("open"); 2415 (n.newState !== "open" || o 2416 ? n.newState === "closed" && o && e.removeAttributeNoCallbacks("open") 2417 : e.setAttributeNoCallbacks("open", ""), 2418 n.newState === "open" 2419 ? (d?.setAttribute("aria-expanded", "true"), 2420 a?.(), 2421 (En = e.getAttribute("popover") === "")) 2422 : (d?.setAttribute("aria-expanded", "false"), l?.(), (En = !1)), 2423 n.oldState === "closed" && n.newState === "open" 2424 ? (yn && (c.dispose(), (c = ge())), s.start("in")) 2425 : n.oldState === "open" && 2426 n.newState === "closed" && 2427 (yn && c.style(e, "transition-property", "none"), 2428 s.start("out"))); 2429 }, 2430 { signal: o }, 2431 )); 2432 function h() { 2433 e.hasAttribute("open") && e.hidePopover(); 2434 } 2435 (wn(e, o, h), d && wn(d, o, h), o.addEventListener("abort", () => s.abort())); 2436} 2437var Tn = new WeakSet(); 2438function Sn(e) { 2439 if (Tn.has(e)) return; 2440 Tn.add(e); 2441 let t = null; 2442 e.addEventListener( 2443 "mousedown", 2444 () => { 2445 An || 2446 yn || 2447 !En || 2448 (e.body.setAttribute("tabindex", "-1"), 2449 t && clearTimeout(t), 2450 (t = setTimeout(() => e.body.removeAttribute("tabindex")))); 2451 }, 2452 { capture: !0 },
2453 ); 2454} 2455function kn(e, t, n, o) { 2456 function a() { 2457 let n = e.getBoundingClientRect(); 2458 o.style.setProperty(t, n.width + "px"); 2459 } 2460 let l = e.ownerDocument, 2461 s = new ResizeObserver(a); 2462 (s.observe(e), 2463 l.addEventListener("transitionend", a, { signal: n }), 2464 n.addEventListener("abort", () => s.disconnect())); 2465} 2466var In = 0; 2467function Ln(e) { 2468 return `${e}-${In++}`; 2469} 2470var Dn = 200; 2471function Pn(e, t, n, o) { 2472 (On(), 2473 e.addEventListener( 2474 t, 2475 (e) => { 2476 (Cn !== null && Date.now() - Cn < Dn) || o(e); 2477 }, 2478 { passive: !0, signal: n }, 2479 )); 2480} 2481var Cn = null, 2482 Mn = !1; 2483function On() { 2484 Mn || 2485 ((Mn = !0), 2486 document.addEventListener( 2487 "keydown", 2488 () => { 2489 Cn = Date.now(); 2490 }, 2491 { capture: !0 }, 2492 )); 2493} 2494var Bn = class extends Map { 2495 constructor(e) { 2496 super(); 2497 this.factory = e; 2498 } 2499 get(e) { 2500 let t = super.get(e); 2501 return (t === void 0 && ((t = this.factory(e, this)), this.set(e, t)), t); 2502 } 2503}; 2504var Rn = new Bn(() => ({ referenceCounter: 0, d: ge() })); 2505function qn(e) { 2506 let t = Rn.get(e); 2507 if ((t.referenceCounter++, t.referenceCounter === 1)) { 2508 let n = [Nn(), Fn(), Wn()]; 2509 (n.forEach(({ before: n }) => n({ doc: e, d: t.d })), 2510 n.forEach(({ after: n }) => n({ doc: e, d: t.d }))); 2511 } 2512 let n = !1; 2513 return () => { 2514 n || 2515 ((n = !0), 2516 t.referenceCounter--, 2517 !(t.referenceCounter > 0) && (t.d.dispose(), Rn.delete(e))); 2518 }; 2519} 2520function Wn() { 2521 return { 2522 before({ doc: e, d: t }) { 2523 t.style(e.documentElement, "overflow", "hidden"); 2524 }, 2525 after() {}, 2526 }; 2527} 2528function Fn() { 2529 let e; 2530 return { 2531 before({ doc: t }) { 2532 let n = t.documentElement, 2533 o = t.defaultView ?? window; 2534 ((e = Math.max(0, o.innerWidth - n.clientWidth)), 2535 n.style.setProperty("--el-top-layer-scrollbar-offset", "0px")); 2536 }, 2537 after({ doc: t, d: n }) { 2538 let o = t.documentElement, 2539 a = Math.max(0, o.clientWidth - o.offsetWidth), 2540 l = Math.max(0, e - a); 2541 (n.style(o, "paddingRight", `${l}px`), 2542 n.add(() => { 2543 o.style.setProperty("--el-top-layer-scrollbar-offset", `-${l}px`); 2544 })); 2545 }, 2546 }; 2547} 2548function Hn() { 2549 return ( 2550 /iPhone/gi.test(window.navigator.platform) || 2551 (/Mac/gi.test(window.navigator.platform) && 2552 window.navigator.maxTouchPoints > 0) 2553 ); 2554} 2555function Nn() { 2556 return Hn() 2557 ? { 2558 before({ doc: e, d: t }) { 2559 function n(e) { 2560 return !!e.closest("[popover], dialog > *"); 2561 } 2562 t.microTask(() => { 2563 if ( 2564 window.getComputedStyle(e.documentElement).scrollBehavior !== 2565 "auto" 2566 ) { 2567 let n = ge(); 2568 (n.style(e.documentElement, "scrollBehavior", "auto"), 2569 t.add(() => t.microTask(() => n.dispose()))); 2570 } 2571 let o = window.scrollY ?? window.pageYOffset, 2572 a = null; 2573 (t.addEventListener( 2574 e, 2575 "click", 2576 (t) => { 2577 if (dn(t.target)) 2578 try { 2579 let o = t.target.closest("a"); 2580 if (!o) return; 2581 let { hash: l } = new URL(o.href), 2582 s = e.querySelector(l); 2583 dn(s) && !n(s) && (a = s); 2584 } catch {} 2585 }, 2586 !0, 2587 ), 2588 t.addEventListener(e, "touchstart", (e) => { 2589 if (dn(e.target) && mn(e.target)) 2590 if (n(e.target)) { 2591 let o = e.target; 2592 for (; o.parentElement && n(o.parentElement); ) 2593 o = o.parentElement; 2594 t.style(o, "overscrollBehavior", "contain"); 2595 } else t.style(e.target, "touchAction", "none"); 2596 }), 2597 t.addEventListener( 2598 e, 2599 "touchmove", 2600 (e) => { 2601 if (dn(e.target)) { 2602 if (gn(e.target)) return; 2603 if (n(e.target)) { 2604 let t = e.target; 2605 for ( 2606 ; 2607 t.parentElement && 2608 t.dataset.tailwindplusPortal !== "" && 2609 !( 2610 t.scrollHeight > t.clientHeight || 2611 t.scrollWidth > t.clientWidth 2612 ); 2613 2614 ) 2615 t = t.parentElement; 2616 t.dataset.tailwindplusPortal === "" && e.preventDefault(); 2617 } else e.preventDefault(); 2618 } 2619 }, 2620 { passive: !1 }, 2621 ), 2622 t.add(() => { 2623 let e = window.scrollY ?? window.pageYOffset; 2624 (o !== e && window.scrollTo(0, o), 2625 a && 2626 a.isConnected && 2627 (a.scrollIntoView({ block: "nearest" }), (a = null))); 2628 })); 2629 }); 2630 }, 2631 after() {}, 2632 } 2633 : { before() {}, after() {} }; 2634} 2635function $n(e, t) { 2636 let n = null; 2637 (e.addEventListener( 2638 "toggle", 2639 (t) => { 2640 t.newState === "open" 2641 ? n || (n = qn(e.ownerDocument)) 2642 : n && (n(), (n = null)); 2643 }, 2644 { signal: t }, 2645 ), 2646 t.addEventListener("abort", () => { 2647 n && (n(), (n = null)); 2648 })); 2649} 2650var Kn = [ 2651 "[contentEditable=true]", 2652 "[tabindex]", 2653 "a[href]", 2654 "area[href]", 2655 "button:not([disabled])", 2656 "iframe", 2657 "input:not([disabled])", 2658 "select:not([disabled])", 2659 "textarea:not([disabled])", 2660] 2661 .map((e) => `${e}:not([tabindex='-1'])`) 2662 .join(","); 2663function jn(e, t, n) { 2664 let o = t ? e.indexOf(t) : null; 2665 switch ((o === -1 && (o = null), n)) { 2666 case 0: 2667 for (let t = 0; t < e.length; t++) if (bn(e[t])) return e[t]; 2668 return null; 2669 case 1: 2670 for (let t = e.length - 1; t >= 0; t--) if (bn(e[t])) return e[t]; 2671 return null; 2672 case 2: 2673 if (o === null) return jn(e, t, 1); 2674 for (let t = o - 1; t >= 0; t--) if (bn(e[t])) return e[t]; 2675 return null; 2676 case 3: 2677 if (o === null) return jn(e, t, 0); 2678 for (let t = o + 1; t < e.length; t++) if (bn(e[t])) return e[t]; 2679 return null; 2680 case 4: 2681 return null; 2682 } 2683} 2684var Vn = 2685 /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g; 2686function zn(e) { 2687 let t = e.innerText ?? "", 2688 n = e.cloneNode(!0); 2689 if (!pn(n)) return t; 2690 let o = !1; 2691 for (let e of n.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) 2692 (e.remove(), (o = !0)); 2693 let a = o ? (n.innerText ?? "") : t; 2694 return (Vn.test(a) && (a = a.replace(Vn, "")), a); 2695} 2696function Un(e) { 2697 let t = e.getAttribute("aria-label"); 2698 if (typeof t == "string") return t.trim(); 2699 let n = e.getAttribute("aria-labelledby"); 2700 if (n) { 2701 let e = n 2702 .split(" ") 2703 .map((e) => { 2704 let t = document.getElementById(e); 2705 if (t) { 2706 let e = t.getAttribute("aria-label"); 2707 return typeof e == "string" ? e.trim() : zn(t).trim(); 2708 } 2709 return null; 2710 }) 2711 .filter(Boolean); 2712 if (e.length > 0) return e.join(", "); 2713 } 2714 return zn(e).trim(); 2715} 2716var Gn, 2717 Yn, 2718 Qn = class extends fe { 2719 constructor() { 2720 super(...arguments); 2721 s(this, Gn, []); 2722 s(this, Yn, null); 2723 } 2724 mount(e) { 2725 let t = this.getInput(), 2726 n = this.getButton(), 2727 o = this.getOptions(); 2728 (t.id || (t.id = Ln("autocomplete-input")), 2729 n && (n.id || (n.id = Ln("autocomplete-button"))), 2730 o.id || (o.id = Ln("autocomplete-listbox")), 2731 xn( 2732 o, 2733 () => this.getButton(), 2734 () => this.getInput(), 2735 e, 2736 () => this.onBeforeOpen(), 2737 () => this.onBeforeClose(), 2738 ), 2739 $n(o, e), 2740 t.setAttribute("role", "combobox"), 2741 t.setAttribute("aria-autocomplete", "list"), 2742 t.setAttribute("aria-expanded", "false"), 2743 t.setAttribute("aria-controls", o.id), 2744 t.setAttribute("aria-activedescendant", ""), 2745 t.setAttribute("autocomplete", "off"), 2746 n && 2747 (n.setAttribute("type", "button"), 2748 n.setAttribute("tabindex", "-1"), 2749 n.setAttribute("aria-expanded", "false"), 2750 n.setAttribute("aria-haspopup", "listbox"), 2751 n.setAttribute("popovertarget", o.id)), 2752 o.setAttribute("role", "listbox"), 2753 o.setAttribute("popover", "manual")); 2754 let a = this; 2755 function s() { 2756 for (let t of o.getItems()) 2757 t.getAttribute("role") !== "option" && 2758 (t.id || (t.id = Ln("option")), 2759 t.setAttribute("role", "option"), 2760 t.setAttribute("aria-selected", "false"), 2761 t.setAttribute("tabIndex", "-1"), 2762 t.addEventListener( 2763 "mousedown", 2764 (e) => { 2765 e.button === 0 && (e.preventDefault(), a.selectOption(t)); 2766 }, 2767 { signal: e }, 2768 ), 2769 Pn(t, "mouseover", e, () => a.setActiveItem(t, !1)), 2770 Pn(t, "mouseout", e, () => a.clearActiveItem())); 2771 a.filterOptions(); 2772 } 2773 s(); 2774 let u = new MutationObserver(s); 2775 (u.observe(this, { attributes: !1, childList: !0, subtree: !0 }), 2776 n && kn(n, "--button-width", e, this), 2777 kn(t, "--input-width", e, this), 2778 t.addEventListener( 2779 "input", 2780 () => { 2781 t.matches(":disabled") || 2782 (this.filterOptions(), 2783 l(this, Gn).length > 0 2784 ? o.hasAttribute("open") || o.showPopover() 2785 : o.hidePopover()); 2786 }, 2787 { signal: e }, 2788 )); 2789 let c = () => { 2790 t.matches(":disabled") || 2791 (t.focus(), 2792 o.hasAttribute("open") 2793 ? o.hidePopover() 2794 : (this.filterOptions(), 2795 l(this, Gn).length > 0 && o.showPopover())); 2796 }; 2797 (t.addEventListener("pointerdown", c, { signal: e }), 2798 n && 2799 (n.addEventListener( 2800 "pointerdown", 2801 (e) => { 2802 (e.preventDefault(), c()); 2803 }, 2804 { signal: e }, 2805 ), 2806 n.addEventListener( 2807 "click", 2808 (e) => { 2809 (e.preventDefault(), e.stopImmediatePropagation()); 2810 }, 2811 { signal: e }, 2812 )), 2813 t.addEventListener( 2814 "blur", 2815 ({ relatedTarget: e }) => { 2816 (e && this.contains(e)) || o.hidePopover(); 2817 }, 2818 { signal: e }, 2819 ), 2820 t.addEventListener( 2821 "keydown", 2822 (e) => { 2823 if (!t.matches(":disabled")) 2824 switch (e.key) { 2825 case "ArrowDown": 2826 (e.preventDefault(), 2827 o.hasAttribute("open") || 2828 (l(this, Gn).length === 0 && this.filterOptions(), 2829 l(this, Gn).length > 0 && o.showPopover()), 2830 this.goToItem(3)); 2831 break; 2832 case "ArrowUp": 2833 (e.preventDefault(), 2834 o.hasAttribute("open") || 2835 (l(this, Gn).length === 0 && this.filterOptions(), 2836 l(this, Gn).length > 0 && o.showPopover()), 2837 this.goToItem(2)); 2838 break; 2839 case "Home": 2840 case "PageUp": 2841 return o.hasAttribute("open") 2842 ? (e.preventDefault(), 2843 e.stopPropagation(), 2844 this.goToItem(0)) 2845 : void 0; 2846 case "End": 2847 case "PageDown": 2848 return o.hasAttribute("open") 2849 ? (e.preventDefault(), 2850 e.stopPropagation(), 2851 this.goToItem(1)) 2852 : void 0; 2853 case "Enter": { 2854 let t = this.getActiveItem(); 2855 (t && (e.preventDefault(), this.selectOption(t)), 2856 o.hasAttribute("open") && 2857 (e.preventDefault(), o.hidePopover())); 2858 break; 2859 } 2860 case "Escape": 2861 if (!o.hasAttribute("open")) return; 2862 (e.preventDefault(), o.hidePopover()); 2863 break; 2864 case "Tab": 2865 o.hidePopover(); 2866 break; 2867 } 2868 }, 2869 { signal: e }, 2870 )); 2871 let d = Array.from(o.querySelectorAll("el-option[disabled]")); 2872 for (let e of d) 2873 (e.setAttribute("aria-disabled", "true"), 2874 e.setAttribute("aria-selected", "false")); 2875 e.addEventListener("abort", () => { 2876 u.disconnect(); 2877 }); 2878 } 2879 getInput() { 2880 let e = this.querySelector("input"); 2881 if (!e) 2882 throw new Error("`<el-autocomplete>` must contain an input element."); 2883 return e; 2884 } 2885 getButton() { 2886 return this.querySelector("button"); 2887 } 2888 getOptions() { 2889 let e = this.querySelector("el-options"); 2890 if (!e) 2891 throw new Error(
2892 "`<el-autocomplete>` must contain a `<el-options>` element.", 2893 ); 2894 return e; 2895 } 2896 filterOptions() { 2897 let e = this.getInput().value.toLowerCase(); 2898 (l(this, Yn) !== e && (this.clearActiveItem(), u(this, Yn, e)), 2899 u(this, Gn, [])); 2900 for (let t of this.getOptions().getItems()) { 2901 let n = t.getAttribute("value")?.toLowerCase() || "", 2902 o = zn(t)?.trim().toLowerCase() ?? ""; 2903 e === "" || n.includes(e) || o.includes(e) 2904 ? (l(this, Gn).push(t), 2905 t.removeAttribute("hidden"), 2906 t.removeAttribute("aria-hidden")) 2907 : (t.setAttribute("hidden", ""), 2908 t.setAttribute("aria-hidden", "true")); 2909 } 2910 } 2911 getActiveItem() { 2912 let e = this.getInput().getAttribute("aria-activedescendant"); 2913 return e ? document.getElementById(e) : null; 2914 } 2915 goToItem(e) { 2916 if (l(this, Gn).length === 0) return; 2917 let t = this.getActiveItem(), 2918 n = jn(l(this, Gn), t, e); 2919 n && this.setActiveItem(n); 2920 } 2921 setActiveItem(e, t = !0) { 2922 let n = this.getInput(), 2923 o = this.getActiveItem(); 2924 (o !== null && o.setAttribute("aria-selected", "false"), 2925 e.setAttribute("aria-selected", "true"), 2926 n.setAttribute("aria-activedescendant", e.id), 2927 t && e.scrollIntoView({ block: "nearest" })); 2928 } 2929 clearActiveItem() { 2930 let e = this.getInput(), 2931 t = this.getActiveItem(); 2932 (t !== null && t.setAttribute("aria-selected", "false"), 2933 e.setAttribute("aria-activedescendant", "")); 2934 } 2935 selectOption(e) { 2936 let t = this.getInput(), 2937 n = e.getAttribute("value"); 2938 n && 2939 ((t.value = n), 2940 t.dispatchEvent(new Event("input", { bubbles: !0, cancelable: !0 })), 2941 t.dispatchEvent(new Event("change", { bubbles: !0, cancelable: !0 })), 2942 this.getOptions().hidePopover()); 2943 } 2944 onBeforeOpen() { 2945 let e = this.getInput(), 2946 t = this.getButton(); 2947 (e.setAttribute("aria-expanded", "true"), 2948 t?.setAttribute("aria-expanded", "true")); 2949 } 2950 onBeforeClose() { 2951 let e = this.getInput(), 2952 t = this.getButton(); 2953 (e.setAttribute("aria-expanded", "false"), 2954 t?.setAttribute("aria-expanded", "false"), 2955 this.clearActiveItem()); 2956 } 2957 }; 2958((Gn = new WeakMap()), (Yn = new WeakMap())); 2959me("el-autocomplete", Qn); 2960var Xn, 2961 _n, 2962 Jn, 2963 Zn, 2964 eo, 2965 to, 2966 no = class extends fe { 2967 constructor() { 2968 super(...arguments); 2969 s(this, Zn); 2970 s(this, Xn, []); 2971 s(this, _n, null); 2972 s(this, Jn, ({ query: e, content: t }) => 2973 t.toLocaleLowerCase().includes(e.toLocaleLowerCase().trim()), 2974 ); 2975 } 2976 mount(e) { 2977 let t = this.getInput(), 2978 n = this.getItems(); 2979 (t.id || (t.id = Ln("command-input")), 2980 n.id || (n.id = Ln("command-items")), 2981 t.setAttribute("role", "combobox"), 2982 t.setAttribute("aria-autocomplete", "list"), 2983 t.setAttribute("autocomplete", "off"), 2984 t.setAttribute("aria-controls", n.id), 2985 n.setAttribute("role", "listbox")); 2986 let o = this; 2987 function a(t = !1) { 2988 var a; 2989 for (let t of n.getItems()) 2990 t.getAttribute("role") !== "option" && 2991 (t.id || (t.id = Ln("item")), 2992 t.setAttribute("role", "option"), 2993 t.setAttribute("tabIndex", "-1"), 2994 t.setAttribute("aria-selected", "false"), 2995 t.hasAttribute("disabled") && 2996 t.setAttribute("aria-disabled", "true"), 2997 Pn(t, "mouseover", e, () => { 2998 var e; 2999 return c((e = o), Zn, to).call(e, t, !1); 3000 })); 3001 (c((a = o), Zn, eo).call(a, t), t || o.goToItem(0)); 3002 } 3003 a(!0); 3004 let l = new MutationObserver(() => a(!1)); 3005 (l.observe(this, { attributes: !1, childList: !0, subtree: !0 }), 3006 kn(t, "--input-width", e, this), 3007 t.addEventListener("input", () => c(this, Zn, eo).call(this), { 3008 signal: e, 3009 }), 3010 t.addEventListener( 3011 "keydown", 3012 (e) => { 3013 switch (e.key) { 3014 case "ArrowDown": 3015 (e.preventDefault(), this.goToItem(3)); 3016 break; 3017 case "ArrowUp": 3018 (e.preventDefault(), this.goToItem(2)); 3019 break; 3020 case "Home": 3021 case "PageUp": 3022 return ( 3023 e.preventDefault(), 3024 e.stopPropagation(), 3025 this.goToItem(0) 3026 ); 3027 case "End": 3028 case "PageDown": 3029 return ( 3030 e.preventDefault(), 3031 e.stopPropagation(), 3032 this.goToItem(1) 3033 ); 3034 case "Enter": { 3035 let t = this.getActiveItem(); 3036 t && (e.preventDefault(), t.click()); 3037 break; 3038 } 3039 case "Tab": 3040 break; 3041 } 3042 }, 3043 { signal: e }, 3044 ), 3045 e.addEventListener("abort", () => { 3046 l.disconnect(); 3047 })); 3048 } 3049 getInput() { 3050 let e = this.querySelector("input"); 3051 if (!e) 3052 throw new Error(
3053 "`<el-command-palette>` must contain an input element.", 3054 ); 3055 return e; 3056 } 3057 getItems() { 3058 let e = this.querySelector("el-command-list"); 3059 if (!e) 3060 throw new Error( 3061 "`<el-command-palette>` must contain a `<el-command-list>` element.", 3062 ); 3063 return e; 3064 } 3065 getGroups() { 3066 return this.getItems().querySelectorAll("el-command-group"); 3067 } 3068 getSuggestions() { 3069 return this.querySelector("el-defaults"); 3070 } 3071 getActiveItem() { 3072 let e = this.getInput().getAttribute("aria-activedescendant"); 3073 return e ? document.getElementById(e) : null; 3074 } 3075 goToItem(e) { 3076 if (l(this, Xn).length === 0) return; 3077 let t = this.getActiveItem(), 3078 n = jn(l(this, Xn), t, e); 3079 n && c(this, Zn, to).call(this, n); 3080 } 3081 clearActiveItem() { 3082 let e = this.getInput(), 3083 t = this.getActiveItem(); 3084 if (t !== null) { 3085 t.setAttribute("aria-selected", "false"); 3086 let e = this.querySelector(`el-command-preview[for="${t.id}"]`); 3087 e && e.setAttribute("hidden", ""); 3088 } 3089 (e.removeAttribute("aria-activedescendant"), 3090 this.dispatchEvent( 3091 new CustomEvent("change", { 3092 detail: { relatedTarget: null }, 3093 bubbles: !1, 3094 cancelable: !1, 3095 }), 3096 )); 3097 } 3098 reset() { 3099 let e = this.getInput(); 3100 ((e.value = ""), 3101 e.dispatchEvent(new Event("input", { bubbles: !0, cancelable: !0 })), 3102 e.dispatchEvent(new Event("change", { bubbles: !0, cancelable: !0 })), 3103 c(this, Zn, eo).call(this, !0), 3104 this.clearActiveItem()); 3105 } 3106 setFilterCallback(e) { 3107 u(this, Jn, e); 3108 } 3109 }; 3110((Xn = new WeakMap()), 3111 (_n = new WeakMap()), 3112 (Jn = new WeakMap()), 3113 (Zn = new WeakSet()), 3114 (eo = function (e = !1) { 3115 let t = this.getItems(), 3116 n = this.getInput().value ?? ""; 3117 u(this, Xn, []); 3118 for (let e of t.getItems()) { 3119 if (e.closest("el-defaults")) continue; 3120 let t = Un(e) ?? ""; 3121 n !== "" && l(this, Jn).call(this, { query: n, node: e, content: t }) 3122 ? (l(this, Xn).push(e), 3123 e.removeAttribute("hidden"), 3124 e.removeAttribute("aria-hidden")) 3125 : (e.setAttribute("hidden", ""), e.setAttribute("aria-hidden", "true")); 3126 } 3127 for (let e of this.getGroups()) 3128 e.getItems().some((e) => !e.hasAttribute("hidden")) 3129 ? e.removeAttribute("hidden") 3130 : e.setAttribute("hidden", ""); 3131 let o = this.getSuggestions(); 3132 o && 3133 (n === "" 3134 ? (o.removeAttribute("hidden"), u(this, Xn, o.getItems())) 3135 : o.setAttribute("hidden", "")); 3136 let a = this.querySelector("el-no-results"); 3137 (a && 3138 (n === "" || l(this, Xn).length > 0 3139 ? a.setAttribute("hidden", "") 3140 : a.removeAttribute("hidden")), 3141 l(this, Xn).length === 0 3142 ? t.setAttribute("hidden", "") 3143 : t.removeAttribute("hidden"), 3144 !(e && n === "") && 3145 (l(this, Xn).length === 0 3146 ? this.clearActiveItem() 3147 : l(this, _n) !== n && this.goToItem(0), 3148 u(this, _n, n))); 3149 }), 3150 (to = function (e, t = !0) { 3151 let n = this.getInput(), 3152 o = this.getActiveItem(); 3153 if (e === o) return; 3154 if (o !== null) { 3155 o.setAttribute("aria-selected", "false"); 3156 let e = this.querySelector(`el-command-preview[for="${o.id}"]`); 3157 e && e.setAttribute("hidden", ""); 3158 } 3159 (e.setAttribute("aria-selected", "true"), 3160 n.setAttribute("aria-activedescendant", e.id)); 3161 let a = this.querySelector(`el-command-preview[for="${e.id}"]`); 3162 (a && a.removeAttribute("hidden"), 3163 t && e.scrollIntoView({ block: "nearest" }), 3164 this.dispatchEvent( 3165 new CustomEvent("change", { 3166 detail: { relatedTarget: e }, 3167 bubbles: !1, 3168 cancelable: !1, 3169 }), 3170 )); 3171 })); 3172var oo = class extends fe { 3173 getItems() { 3174 return Array.from(this.querySelectorAll(`${Kn},[role="option"]`)); 3175 } 3176 }, 3177 ro = class extends fe { 3178 getItems() { 3179 return Array.from(this.querySelectorAll(`${Kn},[role="option"]`)); 3180 } 3181 }, 3182 io = class extends fe {}, 3183 ao = class extends fe {}, 3184 lo = class extends fe { 3185 getItems() { 3186 return Array.from(this.querySelectorAll(`${Kn},[role="option"]`)); 3187 } 3188 }; 3189me("el-command-palette", no); 3190me("el-command-list", oo); 3191me("el-defaults", ro); 3192me("el-no-results", io); 3193me("el-command-group", lo); 3194me("el-command-preview", ao); 3195var so = []; 3196ae(() => { 3197 function e(e) { 3198 if (e.target === document.body || so[0] === e.target) return; 3199 let t = e.target; 3200 t && 3201 "closest" in t && 3202 ((t = t.closest(Kn)), 3203 so.unshift(t ?? e.target), 3204 (so = so.filter((e) => e != null && e.isConnected)), 3205 so.splice(10)); 3206 } 3207 (window.addEventListener("click", e, { capture: !0 }), 3208 window.addEventListener("pointerdown", e, { capture: !0 }), 3209 window.addEventListener("focus", e, { capture: !0 }), 3210 document.body.addEventListener("click", e, { capture: !0 }), 3211 document.body.addEventListener("pointerdown", e, { capture: !0 }), 3212 document.body.addEventListener("focus", e, { capture: !0 })); 3213}); 3214var uo = null; 3215typeof globalThis.window < "u" && 3216 ((uo = HTMLDialogElement.prototype.close), 3217 Object.defineProperties(HTMLDialogElement.prototype, { 3218 close: {
3219 value() { 3220 let e = this.closest("el-dialog"); 3221 if (!(e instanceof bo)) return uo?.apply(this, arguments); 3222 let t = e.beforeClose(); 3223 if (t === !0) return uo?.apply(this, arguments); 3224 t !== !1 && 3225 t 3226 .then((e) => (e ? uo?.apply(this, arguments) : null)) 3227 .catch(console.error); 3228 }, 3229 }, 3230 }), 3231 document.addEventListener( 3232 "command", 3233 (e) => { 3234 let t = e.target; 3235 if ( 3236 !(t instanceof HTMLDialogElement) || 3237 !("command" in e) || 3238 e.command !== "close" 3239 ) 3240 return; 3241 let n = t.closest("el-dialog"); 3242 if (!(n instanceof bo)) return; 3243 let o = n.beforeClose(); 3244 o !== !0 && 3245 (e.stopImmediatePropagation(), 3246 e.preventDefault(), 3247 o !== !1 && 3248 o.then((e) => (e ? uo?.apply(t) : null)).catch(console.error)); 3249 }, 3250 !0, 3251 )); 3252var co, 3253 ho, 3254 po, 3255 fo, 3256 mo, 3257 go, 3258 bo = class extends fe { 3259 constructor() { 3260 super(...arguments); 3261 s(this, mo); 3262 s(this, co, null); 3263 s(this, ho, null); 3264 s(this, po, !0); 3265 s( 3266 this, 3267 fo, 3268 be(this, () => 3269 Array.from( 3270 this.querySelectorAll("el-dialog-panel,el-dialog-backdrop"), 3271 ), 3272 ), 3273 ); 3274 } 3275 mount(e) { 3276 let t = this.getNativeDialog(); 3277 (t.removeAttribute("open"), 3278 t.style.setProperty( 3279 "right", 3280 "var(--el-top-layer-scrollbar-offset, 0px)", 3281 )); 3282 let n = this.hasAttribute("open"); 3283 for (let e of c(this, mo, go).call(this)) 3284 e.setAttribute("aria-expanded", n.toString()); 3285 Ao(t, e, (e) => { 3286 e.preventDefault(); 3287 let n = new Event("cancel", { bubbles: !1, cancelable: !0 }); 3288 !this.dispatchEvent(n) || t.close(); 3289 }); 3290 let o = this.querySelector("el-dialog-panel"); 3291 wn(o ?? t, e, () => { 3292 this.hasAttribute("open") && t.close(); 3293 }); 3294 let a = null; 3295 (t.addEventListener( 3296 "beforetoggle", 3297 (e) => { 3298 let t = e; 3299 t.newState === "open" && t.oldState === "closed" && this.beforeOpen(); 3300 let n = this.hasAttribute("open"); 3301 if ( 3302 (t.newState !== "open" || n 3303 ? t.newState === "closed" && 3304 n && 3305 (this.dispatchEvent( 3306 new CustomEvent("close", { bubbles: !1, cancelable: !1 }), 3307 ), 3308 this.removeAttribute("open")) 3309 : (this.dispatchEvent( 3310 new CustomEvent("open", { bubbles: !1, cancelable: !1 }), 3311 ), 3312 this.setAttribute("open", "")), 3313 t.newState === "open" && t.oldState === "closed") 3314 ) 3315 so.length > 0 && !a && (a = so[0]); 3316 else if (t.newState === "closed" && t.oldState === "open") { 3317 let e = l(this, po); 3318 setTimeout(() => { 3319 e 3320 ? (a && a !== document.activeElement && a.isConnected && ue(a), 3321 (a = null)) 3322 : a && 3323 a === document.activeElement && 3324 a.isConnected && 3325 "blur" in a && 3326 typeof a.blur == "function" && 3327 a.blur(); 3328 }); 3329 } 3330 }, 3331 { signal: e }, 3332 ), 3333 e.addEventListener("abort", () => { 3334 var e; 3335 (l(this, fo).abort(), (e = l(this, ho)) == null || e.call(this)); 3336 }), 3337 this.hasAttribute("open") && t.showModal()); 3338 } 3339 onAttributeChange(e, t, n) { 3340 switch (e) { 3341 case "open": { 3342 let e = this.getNativeDialog(); 3343 for (let e of c(this, mo, go).call(this)) 3344 e.setAttribute("aria-expanded", n !== null ? "true" : "false"); 3345 n === null ? e.close() : e.showModal(); 3346 break; 3347 } 3348 } 3349 } 3350 getNativeDialog() { 3351 let e = this.querySelector("dialog"); 3352 if (!e) throw new Error("[ElDialog] No `<dialog>` element found"); 3353 return e; 3354 } 3355 beforeOpen() { 3356 (u(this, po, !0), 3357 l(this, co) && (l(this, co).abort(), u(this, co, null)), 3358 l(this, ho) || u(this, ho, qn(this.ownerDocument)), 3359 l(this, fo) && l(this, fo).start("in")); 3360 } 3361 beforeClose() { 3362 if ( 3363 (l(this, ho) && (l(this, ho).call(this), u(this, ho, null)), 3364 l(this, co)) 3365 ) 3366 return !1; 3367 u(this, co, new AbortController()); 3368 let e = l(this, co).signal; 3369 return new Promise((t) => { 3370 l(this, fo)?.start("out", () => { 3371 e.aborted || 3372 (u(this, co, null), 3373 requestAnimationFrame(() => { 3374 let e = this.getNativeDialog(), 3375 t = e.style.cssText; 3376 ((e.style.cssText = t + "transition-duration: 0 !important;"), 3377 uo?.apply(e), 3378 requestAnimationFrame(() => { 3379 e.style.cssText = t; 3380 })); 3381 }), 3382 t(!0)); 3383 }); 3384 }); 3385 } 3386 show() { 3387 this.getNativeDialog().showModal(); 3388 } 3389 hide({ restoreFocus: e = !0 } = {}) { 3390 (u(this, po, e), this.getNativeDialog().close()); 3391 } 3392 }; 3393((co = new WeakMap()), 3394 (ho = new WeakMap()), 3395 (po = new WeakMap()), 3396 (fo = new WeakMap()), 3397 (mo = new WeakSet()), 3398 (go = function () { 3399 return document.querySelectorAll( 3400 `[commandfor="${this.getNativeDialog().id}"]`, 3401 ); 3402 }), 3403 o(bo, "observedAttributes", ["open"])); 3404var vo = class extends fe { 3405 mount(e) { 3406 yo(this, e, () => { 3407 let e = this.getDialog(), 3408 t = e.getNativeDialog(); 3409 if (!t.hasAttribute("open")) return; 3410 let n = new Event("cancel", { bubbles: !1, cancelable: !0 });
3411 !e.dispatchEvent(n) || t.close(); 3412 }); 3413 } 3414 getDialog() { 3415 let e = this.closest("el-dialog"); 3416 if (!e) throw new Error("[ElDialogPanel] No `<el-dialog>` parent found"); 3417 return e; 3418 } 3419 }, 3420 wo = class extends fe { 3421 mount() { 3422 this.setAttribute("inert", ""); 3423 } 3424 }; 3425me("el-dialog", bo); 3426me("el-dialog-panel", vo); 3427me("el-dialog-backdrop", wo); 3428function yo(e, t, n) { 3429 document.addEventListener( 3430 "click", 3431 (t) => { 3432 if (t.target === e) { 3433 let { clientX: o, clientY: a } = t, 3434 l = e.getBoundingClientRect(); 3435 if (o >= l.left && o <= l.right && a >= l.top && a <= l.bottom) return; 3436 n(t); 3437 return; 3438 } 3439 let o = e.closest("dialog"); 3440 o && o.contains(t.target) && !e.contains(t.target) 3441 ? n(t) 3442 : t.target !== t.target.ownerDocument.documentElement || n(t); 3443 }, 3444 { signal: t, capture: !0 }, 3445 ); 3446} 3447function Ao(e, t, n) { 3448 e.addEventListener( 3449 "keydown", 3450 (e) => { 3451 e.key === "Escape" && (e.defaultPrevented || n(e)); 3452 }, 3453 { signal: t }, 3454 ); 3455} 3456var Eo, 3457 xo, 3458 To, 3459 So = class extends fe { 3460 constructor() { 3461 super(...arguments); 3462 s(this, xo); 3463 s(this, Eo, be(this)); 3464 } 3465 mount(e) { 3466 (this.id || (this.id = Ln("disclosure")), 3467 this.hasAttribute("hidden") 3468 ? this.removeAttributeNoCallbacks("open") 3469 : this.setAttributeNoCallbacks("open", "")); 3470 let t = () => { 3471 this.hasAttribute("open") && this.hide(); 3472 }, 3473 n = !this.hasAttribute("hidden"); 3474 for (let o of c(this, xo, To).call(this)) 3475 (wn(o, e, t), 3476 o.setAttribute("aria-expanded", n.toString()), 3477 o.setAttribute("aria-controls", this.id)); 3478 (this.addEventListener( 3479 "command", 3480 (e) => { 3481 if (e.target instanceof HTMLElement && "command" in e) 3482 switch (e.command) { 3483 case "--show": 3484 (this.show(), e.preventDefault()); 3485 break; 3486 case "--hide": 3487 (this.hide(), e.preventDefault()); 3488 break; 3489 case "--toggle": 3490 (this.toggle(), e.preventDefault()); 3491 break; 3492 } 3493 }, 3494 { signal: e }, 3495 ), 3496 wn(this, e, t), 3497 e.addEventListener("abort", () => l(this, Eo).abort())); 3498 } 3499 onAttributeChange(e, t, n) { 3500 switch (e) { 3501 case "hidden": 3502 n === null 3503 ? this.setAttributeNoCallbacks("open", "") 3504 : this.removeAttributeNoCallbacks("open"); 3505 for (let e of c(this, xo, To).call(this)) 3506 e.setAttribute("aria-expanded", n === null ? "true" : "false"); 3507 n === null ? l(this, Eo).start("in") : l(this, Eo).start("out"); 3508 break; 3509 case "open": 3510 n === null ? this.hide() : this.show(); 3511 break; 3512 } 3513 } 3514 show() { 3515 this.removeAttribute("hidden"); 3516 } 3517 hide() { 3518 this.setAttribute("hidden", ""); 3519 } 3520 toggle() { 3521 this.hasAttribute("hidden") ? this.show() : this.hide(); 3522 } 3523 }; 3524((Eo = new WeakMap()), 3525 (xo = new WeakSet()), 3526 (To = function () { 3527 return document.querySelectorAll(`[commandfor="${this.id}"]`); 3528 }), 3529 o(So, "observedAttributes", ["hidden", "open"])); 3530me("el-disclosure", So); 3531function ko(e, t, n, o, a) { 3532 let l = null; 3533 for (let n of t) 3534 n.addEventListener( 3535 "pointerdown", 3536 (t) => { 3537 t.button === 0 && 3538 e.classList.contains(":popover-open") && 3539 (l = Date.now() + 100); 3540 }, 3541 { signal: o, capture: !0 },
3542 ); 3543 e.ownerDocument.addEventListener( 3544 "focusin", 3545 (o) => { 3546 if (!n.hasAttribute("open")) return; 3547 let s = o.target, 3548 u = o.relatedTarget; 3549 s !== null && 3550 ((l && Date.now() < l) || 3551 e.contains(s) || 3552 t.some((e) => e.contains(s)) || 3553 a(u)); 3554 }, 3555 { signal: o }, 3556 ); 3557} 3558var Io = 200; 3559function Lo(e, t, n) { 3560 let o = null, 3561 a = "", 3562 l = null, 3563 s = null; 3564 e.id || (e.id = Ln(t.role)); 3565 let u = t.getButton(); 3566 (u.id || (u.id = Ln(`${t.role}-button`)), 3567 xn( 3568 e, 3569 () => t.getButton(), 3570 () => t.getButton(), 3571 n, 3572 () => t.onBeforeOpen(), 3573 () => { 3574 (t.onBeforeClose(), g(), (a = ""), l && (clearTimeout(l), (l = null))); 3575 }, 3576 ), 3577 $n(e, n), 3578 e.setAttribute("popover", "manual"), 3579 e.setAttribute("role", t.role), 3580 u.setAttribute("popovertarget", e.id), 3581 u.setAttribute("aria-haspopup", t.role)); 3582 function c() { 3583 let e = t.getItems(), 3584 o = { passive: !0, signal: n }, 3585 a = t.role === "menu" ? "menuitem" : "option"; 3586 for (let l of e) 3587 l.getAttribute("role") !== a && 3588 (l.id || (l.id = Ln("item")), 3589 l.setAttribute("role", a), 3590 l.setAttribute("tabIndex", "-1"), 3591 l.addEventListener("click", () => t.onItemClick(l), o), 3592 Pn(l, "mouseover", n, () => m(l, !1)), 3593 Pn(l, "mouseout", n, () => g())); 3594 } 3595 c(); 3596 let d = new MutationObserver(c); 3597 (d.observe(e, { attributes: !1, childList: !0, subtree: !0 }), 3598 ko(e, [u], e, n, (t) => { 3599 (t === null && (s = Date.now() + 100), e.hidePopover()); 3600 })); 3601 let h = null, 3602 p = !1; 3603 (u.addEventListener( 3604 "pointerdown", 3605 (t) => { 3606 if (t.button === 0 && !u.matches(":disabled")) { 3607 if (t.pointerType === "touch") { 3608 p = !0; 3609 return; 3610 } 3611 (e.togglePopover(), (h = Date.now())); 3612 } 3613 }, 3614 { signal: n }, 3615 ), 3616 document.addEventListener( 3617 "pointerup", 3618 (t) => { 3619 if ( 3620 t.button === 0 && 3621 !u.matches(":disabled") && 3622 e.hasAttribute("open") 3623 ) { 3624 if (Date.now() - (h ?? 0) > Io) { 3625 let n = t.composedPath(); 3626 if (n.includes(e)) { 3627 if (h !== null) { 3628 let e = b(); 3629 e && e.click(); 3630 } 3631 return; 3632 } 3633 for (let t of n) 3634 if ( 3635 t instanceof Element && 3636 (t.getAttribute("commandfor") || 3637 t.getAttribute("popovertarget")) === e.id 3638 ) 3639 return; 3640 e.hidePopover(); 3641 } 3642 h = null; 3643 } 3644 }, 3645 { signal: n, capture: !0 },
3646 ), 3647 u.addEventListener( 3648 "click", 3649 (e) => { 3650 p ? (p = !1) : (e.preventDefault(), e.stopPropagation()); 3651 }, 3652 { signal: n }, 3653 )); 3654 let f = null; 3655 (e.addEventListener( 3656 "beforetoggle", 3657 (e) => { 3658 let t = e; 3659 t.newState === "open" && 3660 t.oldState === "closed" && 3661 so.length > 0 && 3662 !f && 3663 (f = so[0]); 3664 }, 3665 { signal: n }, 3666 ), 3667 e.addEventListener( 3668 "toggle", 3669 (t) => { 3670 let n = t; 3671 n.newState === "closed" && 3672 n.oldState === "open" && 3673 setTimeout(() => { 3674 (!e.contains(document.activeElement) && 3675 document.activeElement !== document.body) || 3676 (s && Date.now() < s) || 3677 (f && f !== document.activeElement && f.isConnected && ue(f), 3678 (f = null)); 3679 }); 3680 }, 3681 { signal: n }, 3682 ), 3683 n.addEventListener("abort", () => { 3684 (l && (clearTimeout(l), (l = null)), d.disconnect()); 3685 })); 3686 function m(t, n = !0) { 3687 let a = b(); 3688 (a !== null && a.setAttribute("tabIndex", "-1"), 3689 e.removeAttribute("tabIndex"), 3690 t.setAttribute("tabIndex", "0"), 3691 t.focus({ preventScroll: !0 }), 3692 (o = t), 3693 n && t.scrollIntoView({ block: "nearest" })); 3694 } 3695 function g() { 3696 let t = b(); 3697 (t !== null && t.setAttribute("tabIndex", "-1"), 3698 (o = null), 3699 e.hasAttribute("open") && (e.setAttribute("tabIndex", "0"), e.focus())); 3700 } 3701 function b() { 3702 return o; 3703 } 3704 function v(e, n = !1) { 3705 if (e === "") return null; 3706 let o = t.getItems(), 3707 a = e.toLowerCase(), 3708 l = b(), 3709 s = l ? o.indexOf(l) : -1; 3710 if ( 3711 !n && 3712 l && 3713 s !== -1 && 3714 bn(l) && 3715 (l.textContent?.trim().toLowerCase() || "").startsWith(a) 3716 ) 3717 return l; 3718 for (let e = s + 1; e < o.length; e++) 3719 if ( 3720 (o[e].textContent?.trim().toLowerCase() || "").startsWith(a) && 3721 bn(o[e]) 3722 ) 3723 return o[e]; 3724 for (let e = 0; e <= s; e++) 3725 if ( 3726 (o[e].textContent?.trim().toLowerCase() || "").startsWith(a) && 3727 bn(o[e]) 3728 ) 3729 return o[e]; 3730 return null; 3731 } 3732 function w(e) { 3733 let t = a === ""; 3734 (l && (clearTimeout(l), (l = null)), (a += e.toLowerCase())); 3735 let n = v(a, t); 3736 (n && m(n, !0), 3737 (l = setTimeout(() => { 3738 ((a = ""), (l = null)); 3739 }, 350))); 3740 } 3741 function y() { 3742 return a !== ""; 3743 } 3744 return { 3745 ignoreNextFocusRestoration: () => (s = Date.now() + 100), 3746 setActiveItem: m, 3747 clearActiveItem: g, 3748 getActiveItem: b, 3749 findItemBySearchQuery: v, 3750 handleSearchKey: w, 3751 hasActiveSearchQuery: y, 3752 }; 3753} 3754var Do, 3755 Po, 3756 Co, 3757 Mo, 3758 Oo, 3759 Bo = class extends fe { 3760 constructor() { 3761 super(...arguments); 3762 s(this, Mo); 3763 s(this, Do, this.attachInternals()); 3764 s(this, Po, ""); 3765 s(this, Co, null); 3766 } 3767 mount(e) { 3768 let t = this.getOptions(); 3769 this.value = this.getAttribute("value") ?? this.value ?? ""; 3770 let n = this.getButton(); 3771 (n.id || (n.id = Ln("select-button")), 3772 kn(n, "--button-width", e, this), 3773 n.addEventListener( 3774 "keydown", 3775 (e) => { 3776 if (!n.matches(":disabled")) 3777 switch (e.key) { 3778 case "ArrowUp": 3779 (t.showPopover(), 3780 this.goToItem("selected"), 3781 e.preventDefault()); 3782 break; 3783 case "ArrowDown": 3784 (t.showPopover(), 3785 this.goToItem("selected"), 3786 e.preventDefault()); 3787 break; 3788 case "Enter": 3789 (e.preventDefault(), 3790 l(this, Do).form && l(this, Do).form.requestSubmit()); 3791 break; 3792 case " ": 3793 if ( 3794 t.hasAttribute("open") && 3795 l(this, Co) && 3796 l(this, Co).hasActiveSearchQuery() 3797 ) { 3798 (e.preventDefault(), 3799 e.stopPropagation(), 3800 l(this, Co).handleSearchKey(e.key)); 3801 break; 3802 } 3803 (e.preventDefault(), 3804 t.hasAttribute("open") 3805 ? t.hidePopover() 3806 : (t.showPopover(), this.goToItem("selected"))); 3807 break; 3808 default: 3809 t.hasAttribute("open") && 3810 e.key.length === 1 && 3811 !e.ctrlKey && 3812 !e.altKey && 3813 !e.metaKey && 3814 (e.preventDefault(), 3815 e.stopPropagation(), 3816 this.handleSearchKey(e.key)); 3817 break; 3818 } 3819 }, 3820 { signal: e }, 3821 )); 3822 for (let e of l(this, Do).labels) e.setAttribute("for", n.id); 3823 (u( 3824 this, 3825 Co, 3826 Lo( 3827 t, 3828 { 3829 role: "listbox", 3830 getItems: () => this.getItems(), 3831 onItemClick: (e) => this.setSelectedOption(e), 3832 getButton: () => this.getButton(), 3833 onBeforeOpen: () => this.onBeforeOpen(), 3834 onBeforeClose: () => this.onBeforeClose(), 3835 }, 3836 e, 3837 ), 3838 ), 3839 t.addEventListener( 3840 "keydown", 3841 (e) => { 3842 switch (e.key) { 3843 case "ArrowDown": 3844 return ( 3845 e.preventDefault(), 3846 e.stopPropagation(), 3847 this.goToItem(3) 3848 ); 3849 case "ArrowUp": 3850 return ( 3851 e.preventDefault(), 3852 e.stopPropagation(), 3853 this.goToItem(2) 3854 ); 3855 case "Home": 3856 case "PageUp": 3857 return ( 3858 e.preventDefault(), 3859 e.stopPropagation(), 3860 this.goToItem(0) 3861 ); 3862 case "End": 3863 case "PageDown": 3864 return ( 3865 e.preventDefault(), 3866 e.stopPropagation(), 3867 this.goToItem(1) 3868 ); 3869 case " ": 3870 if (l(this, Co) && l(this, Co).hasActiveSearchQuery()) { 3871 (e.preventDefault(), 3872 e.stopPropagation(), 3873 l(this, Co).handleSearchKey(e.key)); 3874 return; 3875 } 3876 case "Enter": { 3877 (e.preventDefault(), e.stopPropagation()); 3878 let n = this.getActiveItem(); 3879 n ? n.click() : t.hidePopover(); 3880 return; 3881 } 3882 case "Tab": 3883 l(this, Co) && l(this, Co).ignoreNextFocusRestoration(); 3884 break; 3885 case "Escape": 3886 (e.preventDefault(), 3887 e.stopPropagation(), 3888 t.hidePopover(), 3889 n.focus()); 3890 break; 3891 default: 3892 e.key.length === 1 && 3893 !e.ctrlKey && 3894 !e.altKey && 3895 !e.metaKey && 3896 (e.preventDefault(), 3897 e.stopPropagation(), 3898 l(this, Co) && l(this, Co).handleSearchKey(e.key)); 3899 break; 3900 } 3901 }, 3902 { signal: e }, 3903 ), 3904 t.addEventListener( 3905 "toggle", 3906 (e) => { 3907 e.newState === "open" && this.onOpen(); 3908 }, 3909 { signal: e }, 3910 )); 3911 let o = Array.from(t.querySelectorAll("el-option[disabled]")); 3912 for (let e of o) 3913 (e.setAttribute("aria-disabled", "true"), 3914 e.setAttribute("aria-selected", "false")); 3915 } 3916 onAttributeChange(e, t, n) { 3917 switch (e) { 3918 case "value": 3919 n !== null && (this.value = n); 3920 break; 3921 case "required": 3922 c(this, Mo, Oo).call(this); 3923 break; 3924 } 3925 } 3926 getButton() { 3927 let e = this.querySelector("button"); 3928 if (!e) throw new Error("`<el-select>` must contain a button element."); 3929 return e; 3930 } 3931 getOptions() { 3932 let e = this.querySelector("el-options"); 3933 if (!e) 3934 throw new Error("`<el-select>` must contain a `<el-options>` element."); 3935 return e; 3936 } 3937 setSelectedOption(e) { 3938 ((this.value = e.getAttribute("value")), 3939 this.dispatchEvent(new Event("input", { bubbles: !0, cancelable: !0 })), 3940 this.dispatchEvent( 3941 new Event("change", { bubbles: !0, cancelable: !0 }), 3942 ), 3943 this.getOptions().hidePopover()); 3944 } 3945 getOptionByName(e) { 3946 return this.getOptions().getOptionByName(e); 3947 } 3948 getItems() { 3949 return this.getOptions().getItems(); 3950 } 3951 getActiveItem() { 3952 return l(this, Co)?.getActiveItem(); 3953 } 3954 getSelectedOption() { 3955 return this.getOptionByName(l(this, Po)); 3956 } 3957 goToItem(e = 4) { 3958 let t = this.getItems(); 3959 if (t.length === 0) return; 3960 let n = this.getActiveItem(); 3961 if (n === null && (e === 2 || e === 3)) { 3962 this.goToItem("selected"); 3963 return; 3964 } 3965 if (e === "selected") {
3966 let e = this.getSelectedOption(); 3967 e && bn(e) ? this.setActiveItem(e) : this.goToItem(0); 3968 return; 3969 } 3970 let o = jn(t, n, e); 3971 o && this.setActiveItem(o); 3972 } 3973 setActiveItem(e) { 3974 l(this, Co) && l(this, Co).setActiveItem(e); 3975 } 3976 clearActiveItem() { 3977 l(this, Co) && l(this, Co).clearActiveItem(); 3978 } 3979 onBeforeOpen() { 3980 let e = this.getButton(), 3981 t = e.dataset.originalTabIndex; 3982 (t && (e.dataset.originalTabIndex = t), e.setAttribute("tabIndex", "-1")); 3983 } 3984 onOpen() { 3985 this.getActiveItem() === null && this.goToItem("selected"); 3986 } 3987 onBeforeClose() { 3988 let e = this.getButton(), 3989 t = e.dataset.originalTabIndex; 3990 (delete e.dataset.originalTabIndex, 3991 t !== void 0 3992 ? e.setAttribute("tabIndex", t) 3993 : e.removeAttribute("tabIndex")); 3994 let n = this.getActiveItem(); 3995 n !== null && n.setAttribute("tabIndex", "-1"); 3996 } 3997 handleSearchKey(e) { 3998 l(this, Co) && l(this, Co).handleSearchKey(e); 3999 } 4000 set value(e) { 4001 (u(this, Po, e), l(this, Do).setFormValue(e), c(this, Mo, Oo).call(this)); 4002 let t = this.getSelectedOption(); 4003 if (t) { 4004 for (let e of this.getItems()) e.setAttribute("aria-selected", "false"); 4005 t.setAttribute("aria-selected", "true"); 4006 try { 4007 this.querySelectorAll("el-selectedcontent").forEach((e) => 4008 e.update(), 4009 ); 4010 } catch {} 4011 } 4012 } 4013 get value() { 4014 return l(this, Po); 4015 } 4016 }; 4017((Do = new WeakMap()), 4018 (Po = new WeakMap()), 4019 (Co = new WeakMap()), 4020 (Mo = new WeakSet()), 4021 (Oo = function () { 4022 this.hasAttribute("required") && !l(this, Po) 4023 ? l(this, Do).setValidity( 4024 { valueMissing: !0 }, 4025 vn.selectRequired, 4026 this.getButton(), 4027 ) 4028 : l(this, Do).setValidity({}); 4029 }), 4030 o(Bo, "formAssociated", !0), 4031 o(Bo, "observedAttributes", ["required"])); 4032var Ro = class extends fe { 4033 mount() { 4034 this.update(); 4035 } 4036 update() { 4037 let e = this.getSelect().getSelectedOption(); 4038 if (!e) return; 4039 let t = document.createDocumentFragment(); 4040 for (let n of e.childNodes) t.append(n.cloneNode(!0)); 4041 this.replaceChildren(t); 4042 } 4043 getSelect() { 4044 let e = this.closest("el-select"); 4045 if (!e) 4046 throw new Error( 4047 "`<el-selectedcontent>` must be inside of a `<el-select>` element.", 4048 ); 4049 return e; 4050 } 4051}; 4052me("el-select", Bo); 4053me("el-selectedcontent", Ro); 4054var qo, 4055 Wo = class extends fe { 4056 getButton() { 4057 let e = this.querySelector("button"); 4058 if (!e) throw new Error("[ElDropdown] No `<button>` element found"); 4059 return e; 4060 } 4061 mount(e) { 4062 let t = this.getButton(); 4063 (t.id || (t.id = Ln("dropdown-button")), 4064 kn(t, "--button-width", e, this)); 4065 let n = this.querySelectorAll("label"); 4066 for (let e of n) e.setAttribute("for", t.id); 4067 } 4068 }, 4069 Fo = class extends fe { 4070 constructor() { 4071 super(...arguments); 4072 s(this, qo, null); 4073 } 4074 mount(e) { 4075 u( 4076 this, 4077 qo, 4078 Lo( 4079 this, 4080 { 4081 role: "menu", 4082 getItems: () => this.getItems(), 4083 onItemClick: () => this.hidePopover(), 4084 getButton: () => this.getDropdown().getButton(), 4085 onBeforeOpen: () => this.onBeforeOpen(), 4086 onBeforeClose: () => this.onBeforeClose(), 4087 }, 4088 e, 4089 ), 4090 ); 4091 let t = this.getDropdown().getButton(); 4092 (t.addEventListener( 4093 "keydown", 4094 (e) => { 4095 if (!t.disabled) 4096 switch (e.key) { 4097 case "ArrowDown": 4098 (this.showPopover(), this.goToItem(0), e.preventDefault()); 4099 break; 4100 case "ArrowUp": 4101 (this.showPopover(), this.goToItem(1), e.preventDefault()); 4102 break; 4103 case " ": 4104 if ( 4105 this.hasAttribute("open") && 4106 l(this, qo) && 4107 l(this, qo).hasActiveSearchQuery() 4108 ) { 4109 (e.preventDefault(), 4110 e.stopPropagation(), 4111 l(this, qo).handleSearchKey(e.key)); 4112 break; 4113 } 4114 case "Enter": 4115 (e.preventDefault(), 4116 this.hasAttribute("open") 4117 ? this.hidePopover() 4118 : (this.showPopover(), this.goToItem(0))); 4119 break; 4120 default: 4121 this.hasAttribute("open") && 4122 e.key.length === 1 && 4123 !e.ctrlKey && 4124 !e.altKey && 4125 !e.metaKey && 4126 (e.preventDefault(), 4127 e.stopPropagation(), 4128 l(this, qo) && l(this, qo).handleSearchKey(e.key)); 4129 break; 4130 } 4131 }, 4132 { signal: e }, 4133 ), 4134 this.addEventListener( 4135 "keydown", 4136 (e) => { 4137 switch (e.key) { 4138 case "ArrowDown": 4139 return ( 4140 e.preventDefault(), 4141 e.stopPropagation(), 4142 this.goToItem(3) 4143 ); 4144 case "ArrowUp": 4145 return ( 4146 e.preventDefault(), 4147 e.stopPropagation(), 4148 this.goToItem(2) 4149 ); 4150 case "Home": 4151 case "PageUp": 4152 return ( 4153 e.preventDefault(), 4154 e.stopPropagation(), 4155 this.goToItem(0) 4156 ); 4157 case "End": 4158 case "PageDown": 4159 return ( 4160 e.preventDefault(), 4161 e.stopPropagation(), 4162 this.goToItem(1) 4163 ); 4164 case " ": 4165 if (l(this, qo) && l(this, qo).hasActiveSearchQuery()) { 4166 (e.preventDefault(), 4167 e.stopPropagation(), 4168 l(this, qo).handleSearchKey(e.key)); 4169 return; 4170 } 4171 case "Enter": { 4172 (e.preventDefault(), e.stopPropagation()); 4173 let t = this.getActiveItem(); 4174 t ? t.click() : this.hidePopover(); 4175 return; 4176 } 4177 case "Tab": 4178 l(this, qo) && l(this, qo).ignoreNextFocusRestoration(); 4179 break; 4180 case "Escape": 4181 (e.preventDefault(), 4182 e.stopPropagation(), 4183 this.hidePopover(), 4184 t.focus()); 4185 break; 4186 default: 4187 e.key.length === 1 && 4188 !e.ctrlKey && 4189 !e.altKey && 4190 !e.metaKey && 4191 (e.preventDefault(), 4192 e.stopPropagation(), 4193 l(this, qo) && l(this, qo).handleSearchKey(e.key)); 4194 break; 4195 } 4196 }, 4197 { signal: e }, 4198 )); 4199 } 4200 onBeforeOpen() { 4201 let e = this.getDropdown().getButton(), 4202 t = e.dataset.originalTabIndex; 4203 (t && (e.dataset.originalTabIndex = t), 4204 e.setAttribute("tabIndex", "-1"), 4205 this.getActiveItem() === null && 4206 (this.setAttribute("tabIndex", "0"), 4207 setTimeout(() => this.focus({ preventScroll: !0 })))); 4208 } 4209 onBeforeClose() { 4210 let e = this.getDropdown().getButton(), 4211 t = e.dataset.originalTabIndex; 4212 (delete e.dataset.originalTabIndex, 4213 t !== void 0 4214 ? e.setAttribute("tabIndex", t) 4215 : e.removeAttribute("tabIndex")); 4216 let n = this.getActiveItem(); 4217 n !== null && n.setAttribute("tabIndex", "-1"); 4218 } 4219 goToItem(e = 4) { 4220 let t = this.getItems(); 4221 if (t.length === 0) return; 4222 let n = this.getActiveItem(), 4223 o = jn(t, n, e); 4224 o && this.setActiveItem(o); 4225 } 4226 setActiveItem(e) { 4227 l(this, qo) && l(this, qo).setActiveItem(e); 4228 } 4229 clearActiveItem() { 4230 l(this, qo) && l(this, qo).clearActiveItem(); 4231 } 4232 getDropdown() { 4233 let e = this.closest("el-dropdown"); 4234 if (!e) throw new Error("[ElMenu] No `<el-dropdown>` element found"); 4235 return e; 4236 } 4237 getItems() { 4238 return Array.from(this.querySelectorAll(`${Kn},[role="menuitem"]`)); 4239 } 4240 getActiveItem() { 4241 return l(this, qo)?.getActiveItem() || null; 4242 } 4243 onAttributeChange(e, t, n) { 4244 switch (e) { 4245 case "open": 4246 n === null ? this.hidePopover() : this.showPopover(); 4247 break; 4248 } 4249 } 4250 }; 4251((qo = new WeakMap()), o(Fo, "observedAttributes", ["anchor", "open"])); 4252me("el-menu", Fo); 4253me("el-dropdown", Wo); 4254var Ho = class extends fe { 4255 onAttributeChange(e, t, n) { 4256 switch (e) { 4257 case "open": 4258 n === null ? this.hidePopover() : this.showPopover(); 4259 break; 4260 } 4261 } 4262 getOptionByName(e) { 4263 let t = this.querySelector(`el-option[value="${e}"]`); 4264 return t || null; 4265 } 4266 getItems() { 4267 return Array.from(this.querySelectorAll("el-option:not([disabled])")); 4268 } 4269}; 4270o(Ho, "observedAttributes", ["anchor", "open"]); 4271var No = class extends fe {}; 4272me("el-options", Ho); 4273me("el-option", No); 4274var $o = class extends fe { 4275 getPopovers() { 4276 return Array.from(this.querySelectorAll("* > el-popover")); 4277 } 4278 }, 4279 Ko = class extends fe { 4280 mount(e) { 4281 if (!this.id) 4282 throw new Error( 4283 "[ElPopover] No id found for popover (ensure `id` is set)", 4284 ); 4285 let t = this.getButton(); 4286 (t.id || (t.id = Ln("popover-button")), 4287 xn( 4288 this, 4289 () => this.getButton(), 4290 () => this.getButton(), 4291 e, 4292 ), 4293 kn(t, "--button-width", e, this), 4294 this.setAttribute("tabindex", "-1"), 4295 t.addEventListener( 4296 "keydown", 4297 (e) => { 4298 (e.key === "Enter" || e.key === " ") && 4299 (e.preventDefault(), this.togglePopover()); 4300 }, 4301 { signal: e }, 4302 )); 4303 let n = this, 4304 o = this.closest("el-popover-group"); 4305 (o && o.getPopovers().includes(this) && (n = o), 4306 ko(n, [t], this, e, () => this.hidePopover()), 4307 this.addEventListener( 4308 "toggle", 4309 (e) => { 4310 let n = e; 4311 n.newState === "closed" && 4312 n.oldState === "open" && 4313 setTimeout(() => { 4314 (!this.contains(document.activeElement) && 4315 document.activeElement !== document.body) || 4316 (t && t !== document.activeElement && t.isConnected && ue(t)); 4317 }); 4318 }, 4319 { signal: e }, 4320 )); 4321 } 4322 getButton() { 4323 let e = this.id, 4324 t = document.querySelector(`[popovertarget="${e}"]`); 4325 if (!t) 4326 throw new Error( 4327 '[ElPopover] No button found for popover (ensure you add a `<button popovertarget="${id}">` on the page)', 4328 ); 4329 return t; 4330 } 4331 onAttributeChange(e, t, n) { 4332 switch (e) { 4333 case "open": 4334 n === null ? this.hidePopover() : this.showPopover(); 4335 break; 4336 } 4337 } 4338 }; 4339o(Ko, "observedAttributes", ["anchor", "open"]); 4340me("el-popover", Ko); 4341me("el-popover-group", $o); 4342var jo = class extends fe { 4343 mount(e) { 4344 let t = this.getList(), 4345 n = this.getPanels(), 4346 o = t.getTabButtons(), 4347 a = n.getPanels(); 4348 if (o.length !== a.length) { 4349 console.warn("[ElTabGroup] Mismatch between number of tabs and panels"); 4350 return; 4351 } 4352 for (let e = 0; e < a.length; e++) { 4353 let t = a[e], 4354 n = o[e]; 4355 (n.id || (n.id = Ln("tailwindplus-tab")), 4356 t.id || (t.id = Ln("tailwindplus-tab-panel")), 4357 t.setAttribute("aria-labelledby", n.id), 4358 n.setAttribute("aria-controls", t.id), 4359 n.setAttribute("role", "tab")); 4360 } 4361 let l = this.getActiveTab(); 4362 (l === -1 && (l = 0), 4363 t.setActiveTab(l), 4364 n.setActivePanel(l), 4365 t.addEventListener( 4366 "keydown", 4367 (e) => { 4368 switch (e.key) { 4369 case "ArrowLeft": { 4370 e.preventDefault(); 4371 let t = this.getActiveTab() - 1; 4372 (t < 0 && (t = o.length - 1), 4373 this.setActiveTab(t), 4374 o[t].focus()); 4375 break; 4376 } 4377 case "ArrowRight": { 4378 e.preventDefault(); 4379 let t = this.getActiveTab() + 1; 4380 (t >= o.length && (t = 0), this.setActiveTab(t), o[t].focus()); 4381 break; 4382 } 4383 case "Home": 4384 case "PageUp": 4385 (e.preventDefault(), this.setActiveTab(0), o[0].focus()); 4386 break; 4387 case "End": 4388 case "PageDown": 4389 (e.preventDefault(), 4390 this.setActiveTab(o.length - 1), 4391 o[o.length - 1].focus()); 4392 break; 4393 } 4394 }, 4395 { signal: e }, 4396 )); 4397 for (let t = 0; t < o.length; t++) 4398 o[t].addEventListener( 4399 "click", 4400 (e) => { 4401 (e.preventDefault(), this.setActiveTab(t)); 4402 }, 4403 { signal: e }, 4404 ); 4405 } 4406 getActiveTab() { 4407 let e = this.querySelector("el-tab-panels"), 4408 t = e.getPanels().find((e) => !e.hasAttribute("hidden")); 4409 return t ? e.getPanels().indexOf(t) : -1; 4410 } 4411 getList() { 4412 let e = this.querySelector("el-tab-list"); 4413 if (!e) throw new Error("[ElTabGroup] No `<el-tab-list>` element found"); 4414 return e; 4415 } 4416 getPanels() { 4417 let e = this.querySelector("el-tab-panels"); 4418 if (!e) 4419 throw new Error("[ElTabGroup] No `<el-tab-panels>` element found"); 4420 return e; 4421 } 4422 setActiveTab(e) { 4423 if (this.getActiveTab() === e) return; 4424 let t = this.getList(), 4425 n = this.getPanels(), 4426 o = t.getTabButtons(); 4427 e < 0 || e >= o.length || (t.setActiveTab(e), n.setActivePanel(e)); 4428 } 4429 }, 4430 Vo = class extends fe { 4431 mount() { 4432 (this.setAttribute("role", "tablist"), 4433 this.setAttribute("aria-orientation", "horizontal")); 4434 } 4435 getTabButtons() { 4436 let e = this.querySelectorAll("button"); 4437 return Array.from(e); 4438 } 4439 setActiveTab(e) {
4440 this.getTabButtons().forEach((t, n) => { 4441 let o = n === e; 4442 (t.setAttribute("tabindex", o ? "0" : "-1"), 4443 t.setAttribute("aria-selected", o ? "true" : "false")); 4444 }); 4445 } 4446 }, 4447 zo = class extends fe { 4448 mount() { 4449 let e = this.getTabGroup().getList(), 4450 t = this.getPanels(), 4451 n = new MutationObserver((n) => { 4452 for (let o of n) { 4453 let n = o.target; 4454 switch (o.attributeName) { 4455 case "hidden": 4456 if (!n.hasAttribute(o.attributeName)) { 4457 let o = t.indexOf(n); 4458 (e.setActiveTab(o), this.setActivePanel(o)); 4459 } 4460 } 4461 } 4462 }); 4463 for (let e of t) 4464 (e.setAttribute("role", "tabpanel"), 4465 e.setAttribute("tabindex", "0"), 4466 n.observe(e, { attributeFilter: ["hidden"], attributes: !0 })); 4467 } 4468 getTabGroup() { 4469 let e = this.closest("el-tab-group"); 4470 if (!e) 4471 throw new Error( 4472 "`<el-tab-panels>` must be inside of a `<el-tab-group>` element.", 4473 ); 4474 return e; 4475 } 4476 getPanels() { 4477 return Array.from(this.children); 4478 } 4479 setActivePanel(e) { 4480 this.getPanels().forEach((t, n) => { 4481 t.toggleAttribute("hidden", n !== e); 4482 }); 4483 } 4484 }; 4485me("el-tab-list", Vo); 4486me("el-tab-panels", zo); 4487me("el-tab-group", jo); 4488typeof globalThis.window < "u" && 4489 setTimeout(() => window.dispatchEvent(new Event("elements:ready")));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.