@luzmo/lucero 1.0.1-alpha.4 → 1.0.1-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.cjs +6 -6
- package/components/accordion/index.js +14 -13
- package/components/action-bar/index.cjs +4 -4
- package/components/action-bar/index.js +20 -18
- package/components/action-button/index.cjs +3 -3
- package/components/action-button/index.js +7 -6
- package/components/action-group/index.cjs +1 -1
- package/components/action-group/index.js +2 -2
- package/components/{action-group-DBImibFn.js → action-group-Bwt9w8Vh.js} +10 -9
- package/components/action-group-D917z7XF.cjs +20 -0
- package/components/action-menu/index.cjs +9 -9
- package/components/action-menu/index.js +10 -10
- package/components/avatar/index.cjs +3 -3
- package/components/avatar/index.js +7 -7
- package/components/base-5nDSSNeT.cjs +18 -0
- package/components/base-CdYjmV_8.js +96 -0
- package/components/button/button-base.d.ts +16 -0
- package/components/button/button.d.ts +38 -2
- package/components/button/index.cjs +2 -2
- package/components/button/index.js +84 -50
- package/components/{button-base-DbkDzb71.js → button-base-B_SkfcFn.js} +54 -39
- package/components/button-base-BdzHcHRs.cjs +25 -0
- package/components/button-group/index.cjs +1 -1
- package/components/button-group/index.js +11 -9
- package/components/calendar/index.cjs +96 -1
- package/components/calendar/index.js +538 -6
- package/components/chat-message/chat-message.d.ts +127 -0
- package/components/chat-message/index.cjs +80 -0
- package/components/chat-message/index.d.ts +8 -0
- package/components/chat-message/index.js +254 -0
- package/components/chat-message-group/chat-message-group.d.ts +50 -0
- package/components/chat-message-group/index.cjs +24 -0
- package/components/chat-message-group/index.d.ts +7 -0
- package/components/chat-message-group/index.js +144 -0
- package/components/checkbox/index.cjs +4 -4
- package/components/checkbox/index.js +12 -10
- package/components/{checkbox-mixin-Do7EgtpQ.js → checkbox-mixin-DUbGDm7f.js} +9 -9
- package/components/{checkbox-mixin-BDN0dBtS.cjs → checkbox-mixin-DhN8CIXY.cjs} +3 -3
- package/components/close-button-CGZxCNlI.js +52 -0
- package/components/close-button-Decm0Qbb.cjs +18 -0
- package/components/color-area/index.cjs +5 -5
- package/components/color-area/index.js +12 -11
- package/components/color-controller-7sNUf7SP.js +386 -0
- package/components/color-controller-ChN-A9Ft.cjs +18 -0
- package/components/color-field/color-field.d.ts +8 -0
- package/components/color-field/index.cjs +4 -4
- package/components/color-field/index.js +38 -25
- package/components/color-handle/index.cjs +2 -2
- package/components/color-handle/index.js +8 -6
- package/components/color-loupe/index.cjs +1 -1
- package/components/color-loupe/index.js +2 -2
- package/components/color-loupe-CIEFp7ln.cjs +56 -0
- package/components/{color-loupe-CmMsXbjT.js → color-loupe-CLPX6xVb.js} +6 -4
- package/components/color-menu/index.cjs +8 -8
- package/components/color-menu/index.js +46 -46
- package/components/color-palette/color-palette.d.ts +6 -2
- package/components/color-palette/index.cjs +1 -1
- package/components/color-palette/index.js +35 -34
- package/components/color-palette-group/color-palette-group.d.ts +79 -0
- package/components/color-palette-group/index.cjs +28 -0
- package/components/color-palette-group/index.d.ts +7 -0
- package/components/color-palette-group/index.js +206 -0
- package/components/color-picker/color-picker.d.ts +31 -2
- package/components/color-picker/index.cjs +6 -5
- package/components/color-picker/index.js +16 -12
- package/components/color-slider/index.cjs +40 -1
- package/components/color-slider/index.js +452 -6
- package/components/date-time-picker/index.cjs +16 -16
- package/components/date-time-picker/index.js +105 -106
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-CO-VPlqq.js} +4 -4
- package/components/{dependency-manger-C5HCkMMB.cjs → dependency-manger-uthev62E.cjs} +1 -1
- package/components/divider/index.cjs +1 -1
- package/components/divider/index.js +11 -9
- package/components/field-group/index.cjs +1 -1
- package/components/field-group/index.js +2 -2
- package/components/field-group-BYHNJmv0.cjs +23 -0
- package/components/{field-group-DXfBWrkO.js → field-group-CHmw159R.js} +7 -5
- package/components/field-label/index.cjs +1 -1
- package/components/field-label/index.js +2 -2
- package/components/{field-label-CZ2zzChK.js → field-label-Cy3xMWZ-.js} +9 -8
- package/components/field-label-DZoeqJJX.cjs +25 -0
- package/components/{focus-visible-DBlJGoEW.js → focus-visible-BvScGDCE.js} +20 -20
- package/components/focus-visible-D4BXb5RB.cjs +18 -0
- package/components/{focusable-BxtpnzWp.js → focusable-BjvsvVam.js} +3 -2
- package/components/focusable-CbVKgGfS.cjs +18 -0
- package/components/icon/index.cjs +1 -1
- package/components/icon/index.js +22 -20
- package/components/index.cjs +205 -1
- package/components/index.js +972 -167
- package/components/infield-button/index.cjs +2 -2
- package/components/infield-button/index.js +6 -5
- package/components/label/index.cjs +1 -1
- package/components/label/index.js +7 -5
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-B-wjV5bb.js} +9 -8
- package/components/{directive-C7oCP5Bh.cjs → language-resolution-EUER43cg.cjs} +1 -5
- package/components/like-anchor-B2EqJPdw.cjs +32 -0
- package/components/{like-anchor-Bvn_vLQ8.js → like-anchor-CgqCU210.js} +23 -22
- package/components/{manage-help-text-DhgARkZX.cjs → manage-help-text-Bat9yGvF.cjs} +3 -3
- package/components/{manage-help-text-syYnjKGL.js → manage-help-text-C9sCHK3R.js} +8 -8
- package/components/menu/index.cjs +38 -13
- package/components/menu/index.js +138 -105
- package/components/menu/menu-item.d.ts +8 -1
- package/components/multi-language-field/index.cjs +2 -2
- package/components/multi-language-field/index.js +9 -7
- package/components/number-field/index.cjs +5 -5
- package/components/number-field/index.js +122 -85
- package/components/number-field/number-field.d.ts +145 -0
- package/components/observe-slot-presence-CNltc0C0.cjs +18 -0
- package/components/{observe-slot-presence-CmVi0zTc.js → observe-slot-presence-DFi6GE3H.js} +1 -1
- package/components/observe-slot-text-CBMHpuIK.cjs +18 -0
- package/components/{observe-slot-text-BPfIQQtz.js → observe-slot-text-DorVpCL4.js} +14 -15
- package/components/options/index.cjs +26 -58
- package/components/options/index.js +205 -849
- package/components/overlay/index.cjs +6 -6
- package/components/overlay/index.js +31 -32
- package/components/overlay-BhrVS5h7.cjs +47 -0
- package/components/overlay-C-No3oJQ.js +1736 -0
- package/components/{pending-state-CaH1si5b.cjs → pending-state-DQctFHI8.cjs} +2 -2
- package/components/{pending-state-DTX7ggyF.js → pending-state-Dx1u3EXA.js} +2 -2
- package/components/picker/index.cjs +1 -1
- package/components/picker/index.js +3 -3
- package/components/picker-DxYgh4LR.cjs +123 -0
- package/components/{picker-BmoXv1jt.js → picker-GyeSAxxY.js} +45 -45
- package/components/picker-button/index.cjs +4 -4
- package/components/picker-button/index.js +9 -8
- package/components/{platform-BiXhwqk3.cjs → platform-BJnOJJag.cjs} +1 -1
- package/components/{platform-BM-uMWpX.js → platform-CqwNrovd.js} +12 -12
- package/components/popover/index.cjs +1 -1
- package/components/popover/index.js +2 -2
- package/components/popover-lcZnODPK.cjs +30 -0
- package/components/{popover-DjX0aAnY.js → popover-ucIgjbQs.js} +8 -7
- package/components/progress-circle/index.cjs +1 -1
- package/components/progress-circle/index.js +2 -2
- package/components/{progress-circle-DXH9z8-6.js → progress-circle-D5J0ZwY0.js} +8 -7
- package/components/progress-circle-DgMbqrzG.cjs +33 -0
- package/components/prompt-box/index.d.ts +8 -0
- package/components/prompt-box/prompt-box.d.ts +326 -0
- package/components/radio/index.cjs +2 -2
- package/components/radio/index.js +12 -11
- package/components/search/index.cjs +6 -6
- package/components/search/index.js +6 -6
- package/components/select/index.cjs +43 -42
- package/components/select/index.js +142 -126
- package/components/select/select.d.ts +1 -1
- package/components/{base-BjTwmyRF.cjs → sized-mixin-DcvJLFeo.cjs} +1 -5
- package/components/{sized-mixin-D4ACoVUr.js → sized-mixin-cJbo3PKR.js} +5 -5
- package/components/slider/index.cjs +1 -1
- package/components/slider/index.js +48 -1101
- package/components/{strategies-9indNIEb.js → strategies-Bk97oVn1.js} +15 -50
- package/components/strategies-CNgBb6dM.cjs +18 -0
- package/components/{streaming-listener-CP-JE6Fa.js → streaming-listener-BlWm-XZU.js} +5 -6
- package/components/streaming-listener-D9Wc7skA.cjs +18 -0
- package/components/swatch/index.cjs +7 -7
- package/components/swatch/index.js +18 -17
- package/components/switch/index.cjs +2 -2
- package/components/switch/index.js +6 -5
- package/components/tabs/index.cjs +16 -24
- package/components/tabs/index.js +94 -162
- package/components/tags/index.cjs +5 -5
- package/components/tags/index.js +39 -25
- package/components/tags/tag.d.ts +2 -0
- package/components/tags/tags.d.ts +3 -1
- package/components/text-field/index.cjs +3 -3
- package/components/text-field/index.js +13 -11
- package/components/text-field/text-field.d.ts +1 -0
- package/components/{text-field-BIADXoLC.js → text-field-BHaLKkf1.js} +73 -99
- package/components/text-field-DFP7p8Rv.cjs +81 -0
- package/components/text-field.module-Bp4Mwuvj.js +21 -0
- package/components/text-field.module-eAEqjvZu.cjs +18 -0
- package/components/toast/index.cjs +11 -11
- package/components/toast/index.js +12 -10
- package/components/tooltip/index.cjs +4 -4
- package/components/tooltip/index.js +60 -36
- package/components/tooltip/tooltip.d.ts +12 -1
- package/components/utils.cjs +1 -1
- package/components/utils.js +14 -12
- package/components/voice-recorder-BRq_gEkz.js +210 -0
- package/components/voice-recorder-CAm5iDre.cjs +18 -0
- package/custom-elements.json +1 -1
- package/index.d.ts +4 -1
- package/package.json +84 -6
- package/utils/index.d.ts +1 -0
- package/utils/voice-recorder.d.ts +121 -0
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-DoeRUWQ3.js +0 -53
- package/components/clear-button-Qi1pMA5S.cjs +0 -18
- package/components/close-button-BFMBEw3q.cjs +0 -18
- package/components/close-button-BWXdHSx3.js +0 -51
- package/components/color-controller-DTp1juRz.js +0 -3198
- package/components/color-controller-_ZwyhvaU.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/directive-oAbCiebi.js +0 -44
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-A-yOTB_d.js +0 -1490
- package/components/index-BLWuwZXx.cjs +0 -113
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-HjQa8tew.js +0 -1174
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-DbwDQtuO.js +0 -229
- package/components/luzmo-icons-DletXGWU.cjs +0 -29
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/picker-DWsBWdPN.cjs +0 -123
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-D5d_Gt0t.cjs +0 -85
- package/components/text-field.module-ColtFhf_.js +0 -21
- package/components/text-field.module-p_VF2tC_.cjs +0 -18
- package/components/unit-input/index.cjs +0 -43
- package/components/unit-input/index.d.ts +0 -7
- package/components/unit-input/index.js +0 -183
- package/components/unit-input/unit-input.d.ts +0 -33
- package/components/when-CDK1Tt5Y.js +0 -28
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -1,2747 +0,0 @@
|
|
|
1
|
-
/*! * Lucero - The design system for Luzmo.
|
|
2
|
-
*
|
|
3
|
-
* Copyright © 2025 Luzmo
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
-
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
-
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
-
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
-
*
|
|
10
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
-
* SOFTWARE.
|
|
17
|
-
* */
|
|
18
|
-
import { a as me, r as ge, x as dt, n as z } from "./base-WsynuqaS.js";
|
|
19
|
-
import { r as ve } from "./state-Deh-vKYE.js";
|
|
20
|
-
import { e as ne } from "./query-D_KR_GUc.js";
|
|
21
|
-
import { o as ye } from "./query-assigned-elements-DjfhL1cl.js";
|
|
22
|
-
import { o as Pt } from "./if-defined-DOaE2coe.js";
|
|
23
|
-
import { o as Kt } from "./style-map-IgqIKvlE.js";
|
|
24
|
-
import { r as Ft } from "./random-id-ByCz1xaq.js";
|
|
25
|
-
import { E as we, e as be } from "./element-resolution-FCUT-wql.js";
|
|
26
|
-
import { u as ct } from "./focusable-selectors-B4YgbghQ.js";
|
|
27
|
-
import { S as Ee, r as xe } from "./slottable-request-event-DggLA4Rx.js";
|
|
28
|
-
import { c as At } from "./condition-attribute-with-id-Dv4lSRbe.js";
|
|
29
|
-
import { f as Yt, c as Ce, j as Pe } from "./platform-BM-uMWpX.js";
|
|
30
|
-
function Oe(e, t, i = []) {
|
|
31
|
-
for (const [n, o] of t.entries()) {
|
|
32
|
-
const s = e[n], r = s.parentElement || s.getRootNode();
|
|
33
|
-
i[n] && i[n](o), r && r !== s && s.replaceWith(o), delete e[n];
|
|
34
|
-
}
|
|
35
|
-
return t;
|
|
36
|
-
}
|
|
37
|
-
const Te = (e, t, {
|
|
38
|
-
position: i,
|
|
39
|
-
prepareCallback: n
|
|
40
|
-
} = { position: "beforeend" }) => {
|
|
41
|
-
let { length: o } = e;
|
|
42
|
-
if (o === 0)
|
|
43
|
-
return () => e;
|
|
44
|
-
let s = 1, r = 0;
|
|
45
|
-
(i === "afterbegin" || i === "afterend") && (s = -1, r = o - 1);
|
|
46
|
-
const a = new Array(o), l = new Array(o), h = document.createComment(
|
|
47
|
-
"placeholder for reparented element"
|
|
48
|
-
);
|
|
49
|
-
do {
|
|
50
|
-
const c = e[r];
|
|
51
|
-
n && (l[r] = n(c)), a[r] = h.cloneNode();
|
|
52
|
-
const d = c.parentElement || c.getRootNode();
|
|
53
|
-
d && d !== c && d.replaceChild(a[r], c), t.insertAdjacentElement(i, c), r += s;
|
|
54
|
-
} while (--o > 0);
|
|
55
|
-
return function() {
|
|
56
|
-
return Oe(a, e, l);
|
|
57
|
-
};
|
|
58
|
-
}, Ae = 1e3, Re = 1e3;
|
|
59
|
-
class De {
|
|
60
|
-
constructor(t = {}) {
|
|
61
|
-
this.warmUpDelay = Ae, this.coolDownDelay = Re, this.isWarm = !1, this.timeout = 0, Object.assign(this, t);
|
|
62
|
-
}
|
|
63
|
-
openTimer(t) {
|
|
64
|
-
if (this.cancelCooldownTimer(), !this.component || t !== this.component)
|
|
65
|
-
return this.component && (this.close(this.component), this.cancelCooldownTimer()), this.component = t, this.isWarm ? Promise.resolve(!1) : (this.promise = new Promise((i) => {
|
|
66
|
-
this.resolve = i, this.timeout = window.setTimeout(() => {
|
|
67
|
-
this.resolve && (this.resolve(!1), this.isWarm = !0);
|
|
68
|
-
}, this.warmUpDelay);
|
|
69
|
-
}), this.promise);
|
|
70
|
-
if (this.promise)
|
|
71
|
-
return this.promise;
|
|
72
|
-
throw new Error("Inconsistent state");
|
|
73
|
-
}
|
|
74
|
-
close(t) {
|
|
75
|
-
this.component && this.component === t && (this.resetCooldownTimer(), this.timeout > 0 && (clearTimeout(this.timeout), this.timeout = 0), this.resolve && (this.resolve(!0), delete this.resolve), delete this.promise, delete this.component);
|
|
76
|
-
}
|
|
77
|
-
resetCooldownTimer() {
|
|
78
|
-
this.isWarm && (this.cooldownTimeout && window.clearTimeout(this.cooldownTimeout), this.cooldownTimeout = window.setTimeout(() => {
|
|
79
|
-
this.isWarm = !1, delete this.cooldownTimeout;
|
|
80
|
-
}, this.coolDownDelay));
|
|
81
|
-
}
|
|
82
|
-
cancelCooldownTimer() {
|
|
83
|
-
this.cooldownTimeout && window.clearTimeout(this.cooldownTimeout), delete this.cooldownTimeout;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
const gt = new De(), J = () => {
|
|
87
|
-
}, zt = (e, t, i) => {
|
|
88
|
-
const n = new AbortController(), o = /* @__PURE__ */ new Map(), s = () => {
|
|
89
|
-
n.abort(), i();
|
|
90
|
-
};
|
|
91
|
-
let r, a;
|
|
92
|
-
const l = requestAnimationFrame(() => {
|
|
93
|
-
r = requestAnimationFrame(() => {
|
|
94
|
-
a = requestAnimationFrame(() => {
|
|
95
|
-
s();
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}), h = (d) => {
|
|
99
|
-
d.target === e && (o.set(
|
|
100
|
-
d.propertyName,
|
|
101
|
-
o.get(d.propertyName) - 1
|
|
102
|
-
), o.get(d.propertyName) || o.delete(d.propertyName), o.size === 0 && s());
|
|
103
|
-
}, c = (d) => {
|
|
104
|
-
d.target === e && (o.has(d.propertyName) || o.set(d.propertyName, 0), o.set(
|
|
105
|
-
d.propertyName,
|
|
106
|
-
o.get(d.propertyName) + 1
|
|
107
|
-
), cancelAnimationFrame(l), cancelAnimationFrame(r), cancelAnimationFrame(a));
|
|
108
|
-
};
|
|
109
|
-
e.addEventListener("transitionrun", c, {
|
|
110
|
-
signal: n.signal
|
|
111
|
-
}), e.addEventListener("transitionend", h, {
|
|
112
|
-
signal: n.signal
|
|
113
|
-
}), e.addEventListener("transitioncancel", h, {
|
|
114
|
-
signal: n.signal
|
|
115
|
-
}), t();
|
|
116
|
-
};
|
|
117
|
-
function R() {
|
|
118
|
-
return new Promise((e) => requestAnimationFrame(() => e()));
|
|
119
|
-
}
|
|
120
|
-
class rt extends me {
|
|
121
|
-
constructor() {
|
|
122
|
-
super(...arguments), this.dispose = J, this.offset = 0, this.willPreventClose = !1;
|
|
123
|
-
}
|
|
124
|
-
applyFocus(t, i) {
|
|
125
|
-
}
|
|
126
|
-
/* c8 ignore next 6 */
|
|
127
|
-
get delayed() {
|
|
128
|
-
return !1;
|
|
129
|
-
}
|
|
130
|
-
set delayed(t) {
|
|
131
|
-
}
|
|
132
|
-
/* c8 ignore next 6 */
|
|
133
|
-
get disabled() {
|
|
134
|
-
return !1;
|
|
135
|
-
}
|
|
136
|
-
set disabled(t) {
|
|
137
|
-
}
|
|
138
|
-
get elementResolver() {
|
|
139
|
-
return this._elementResolver;
|
|
140
|
-
}
|
|
141
|
-
set elementResolver(t) {
|
|
142
|
-
this._elementResolver = t;
|
|
143
|
-
}
|
|
144
|
-
/* c8 ignore next 3 */
|
|
145
|
-
ensureOnDOM(t) {
|
|
146
|
-
}
|
|
147
|
-
/* c8 ignore next 5 */
|
|
148
|
-
makeTransition(t) {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
manageDelay(t) {
|
|
152
|
-
}
|
|
153
|
-
/* c8 ignore next 3 */
|
|
154
|
-
manageDialogOpen() {
|
|
155
|
-
}
|
|
156
|
-
/* c8 ignore next 3 */
|
|
157
|
-
managePopoverOpen() {
|
|
158
|
-
}
|
|
159
|
-
/* c8 ignore next 3 */
|
|
160
|
-
managePosition() {
|
|
161
|
-
}
|
|
162
|
-
/* c8 ignore next 6 */
|
|
163
|
-
get open() {
|
|
164
|
-
return !1;
|
|
165
|
-
}
|
|
166
|
-
set open(t) {
|
|
167
|
-
}
|
|
168
|
-
get placementController() {
|
|
169
|
-
return this._placementController;
|
|
170
|
-
}
|
|
171
|
-
set placementController(t) {
|
|
172
|
-
this._placementController = t;
|
|
173
|
-
}
|
|
174
|
-
requestSlottable() {
|
|
175
|
-
}
|
|
176
|
-
returnFocus() {
|
|
177
|
-
}
|
|
178
|
-
/* c8 ignore next 6 */
|
|
179
|
-
get state() {
|
|
180
|
-
return "closed";
|
|
181
|
-
}
|
|
182
|
-
set state(t) {
|
|
183
|
-
}
|
|
184
|
-
/* c8 ignore next 3 */
|
|
185
|
-
manuallyKeepOpen() {
|
|
186
|
-
}
|
|
187
|
-
static update() {
|
|
188
|
-
const t = new CustomEvent("luzmo-update-overlays", {
|
|
189
|
-
bubbles: !0,
|
|
190
|
-
composed: !0,
|
|
191
|
-
cancelable: !0
|
|
192
|
-
});
|
|
193
|
-
document.dispatchEvent(t);
|
|
194
|
-
}
|
|
195
|
-
static async open(t, i, n, o) {
|
|
196
|
-
await Promise.resolve().then(() => kt);
|
|
197
|
-
const s = arguments.length === 2, r = n || t, a = new this();
|
|
198
|
-
let l = !1;
|
|
199
|
-
const h = Te([r], a, {
|
|
200
|
-
position: "beforeend",
|
|
201
|
-
prepareCallback: (f) => {
|
|
202
|
-
const u = f.slot;
|
|
203
|
-
return f.removeAttribute("slot"), () => {
|
|
204
|
-
f.slot = u;
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
if (a.dispose = () => {
|
|
209
|
-
a.addEventListener("luzmo-closed", () => {
|
|
210
|
-
l || (h(), l = !0), requestAnimationFrame(() => {
|
|
211
|
-
a.remove();
|
|
212
|
-
});
|
|
213
|
-
}), a.open = !1, a.dispose = J;
|
|
214
|
-
}, !s && r && o) {
|
|
215
|
-
const f = t, u = i, p = o;
|
|
216
|
-
return rt.applyOptions(a, {
|
|
217
|
-
...p,
|
|
218
|
-
delayed: p.delayed || r.hasAttribute("delayed"),
|
|
219
|
-
trigger: p.virtualTrigger || f,
|
|
220
|
-
type: u === "modal" ? "modal" : u === "hover" ? "hint" : "auto"
|
|
221
|
-
}), f.after(a), await a.updateComplete, a.open = !0, a.dispose;
|
|
222
|
-
}
|
|
223
|
-
const d = i;
|
|
224
|
-
return a.append(r), rt.applyOptions(a, {
|
|
225
|
-
...d,
|
|
226
|
-
delayed: d.delayed || r.hasAttribute("delayed")
|
|
227
|
-
}), a.updateComplete.then(() => {
|
|
228
|
-
a.open = !0;
|
|
229
|
-
}), a;
|
|
230
|
-
}
|
|
231
|
-
static applyOptions(t, i) {
|
|
232
|
-
t.delayed = !!i.delayed, t.receivesFocus = i.receivesFocus ?? "auto", t.triggerElement = i.trigger || null, t.type = i.type || "modal", t.offset = i.offset ?? 0, t.placement = i.placement, t.willPreventClose = !!i.notImmediatelyClosable;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
const Nt = (e) => e.querySelector(
|
|
236
|
-
ct
|
|
237
|
-
), _t = (e) => e.assignedElements().find((i) => i.matches(ct));
|
|
238
|
-
class $t extends Event {
|
|
239
|
-
constructor() {
|
|
240
|
-
super("beforetoggle", {
|
|
241
|
-
bubbles: !1,
|
|
242
|
-
composed: !1
|
|
243
|
-
}), this.currentState = "open", this.newState = "closed";
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
class Mt extends Event {
|
|
247
|
-
constructor() {
|
|
248
|
-
super("beforetoggle", {
|
|
249
|
-
bubbles: !1,
|
|
250
|
-
composed: !1
|
|
251
|
-
}), this.currentState = "closed", this.newState = "open";
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
class S extends Event {
|
|
255
|
-
constructor(t, i, {
|
|
256
|
-
publish: n,
|
|
257
|
-
interaction: o,
|
|
258
|
-
reason: s
|
|
259
|
-
}) {
|
|
260
|
-
super(t, {
|
|
261
|
-
bubbles: n,
|
|
262
|
-
composed: n
|
|
263
|
-
}), this.overlay = i, this.detail = {
|
|
264
|
-
interaction: o,
|
|
265
|
-
reason: s
|
|
266
|
-
};
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
class bt {
|
|
270
|
-
constructor(t, i) {
|
|
271
|
-
this.x = 0, this.y = 0, this.x = t, this.y = i;
|
|
272
|
-
}
|
|
273
|
-
updateBoundingClientRect(t, i) {
|
|
274
|
-
this.x = t, this.y = i, rt.update();
|
|
275
|
-
}
|
|
276
|
-
getBoundingClientRect() {
|
|
277
|
-
return {
|
|
278
|
-
width: 0,
|
|
279
|
-
height: 0,
|
|
280
|
-
top: this.y,
|
|
281
|
-
right: this.x,
|
|
282
|
-
y: this.y,
|
|
283
|
-
x: this.x,
|
|
284
|
-
bottom: this.y,
|
|
285
|
-
left: this.x,
|
|
286
|
-
/* c8 ignore next 3 */
|
|
287
|
-
toJSON() {
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function Le(e) {
|
|
293
|
-
class t extends e {
|
|
294
|
-
async manageDialogOpen() {
|
|
295
|
-
const n = this.open;
|
|
296
|
-
if (await R(), await this.managePosition(), this.open !== n)
|
|
297
|
-
return;
|
|
298
|
-
const o = await this.dialogMakeTransition(n);
|
|
299
|
-
this.open === n && await this.dialogApplyFocus(n, o);
|
|
300
|
-
}
|
|
301
|
-
dialogMakeTransition(n) {
|
|
302
|
-
let o = null;
|
|
303
|
-
const s = (a, l) => () => {
|
|
304
|
-
if (a.open = n, !n) {
|
|
305
|
-
const c = () => {
|
|
306
|
-
a.removeEventListener("close", c);
|
|
307
|
-
};
|
|
308
|
-
a.addEventListener("close", c);
|
|
309
|
-
}
|
|
310
|
-
if (l > 0)
|
|
311
|
-
return;
|
|
312
|
-
const h = n ? Mt : $t;
|
|
313
|
-
this.dispatchEvent(new h()), n && (a.matches(ct) && (o = a), o = o || Nt(a), o || a.querySelectorAll("slot").forEach((d) => {
|
|
314
|
-
o || (o = _t(d));
|
|
315
|
-
}), !(!this.isConnected || this.dialogEl.open) && this.dialogEl.showModal());
|
|
316
|
-
}, r = (a, l) => () => {
|
|
317
|
-
if (this.open !== n)
|
|
318
|
-
return;
|
|
319
|
-
const h = n ? "luzmo-opened" : "luzmo-closed";
|
|
320
|
-
if (l > 0) {
|
|
321
|
-
a.dispatchEvent(
|
|
322
|
-
new S(h, this, {
|
|
323
|
-
interaction: this.type,
|
|
324
|
-
publish: !1
|
|
325
|
-
})
|
|
326
|
-
);
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (!this.isConnected || n !== this.open)
|
|
330
|
-
return;
|
|
331
|
-
const c = async () => {
|
|
332
|
-
const d = this.triggerElement instanceof bt;
|
|
333
|
-
this.dispatchEvent(
|
|
334
|
-
new S(h, this, {
|
|
335
|
-
interaction: this.type,
|
|
336
|
-
publish: d
|
|
337
|
-
})
|
|
338
|
-
), a.dispatchEvent(
|
|
339
|
-
new S(h, this, {
|
|
340
|
-
interaction: this.type,
|
|
341
|
-
publish: !1
|
|
342
|
-
})
|
|
343
|
-
), this.triggerElement && !d && this.triggerElement.dispatchEvent(
|
|
344
|
-
new S(h, this, {
|
|
345
|
-
interaction: this.type,
|
|
346
|
-
publish: !0
|
|
347
|
-
})
|
|
348
|
-
), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
|
|
349
|
-
};
|
|
350
|
-
!n && this.dialogEl.open ? (this.dialogEl.addEventListener(
|
|
351
|
-
"close",
|
|
352
|
-
() => {
|
|
353
|
-
c();
|
|
354
|
-
},
|
|
355
|
-
{ once: !0 }
|
|
356
|
-
), this.dialogEl.close()) : c();
|
|
357
|
-
};
|
|
358
|
-
return this.elements.forEach((a, l) => {
|
|
359
|
-
zt(a, s(a, l), r(a, l));
|
|
360
|
-
}), o;
|
|
361
|
-
}
|
|
362
|
-
dialogApplyFocus(n, o) {
|
|
363
|
-
this.applyFocus(n, o);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
return t;
|
|
367
|
-
}
|
|
368
|
-
function Se(e) {
|
|
369
|
-
class t extends e {
|
|
370
|
-
async managePopoverOpen() {
|
|
371
|
-
await this.managePosition();
|
|
372
|
-
}
|
|
373
|
-
async manageDelay(n) {
|
|
374
|
-
if (n === !1 || n !== this.open) {
|
|
375
|
-
gt.close(this);
|
|
376
|
-
return;
|
|
377
|
-
}
|
|
378
|
-
this.delayed && await gt.openTimer(this) && (this.open = !n);
|
|
379
|
-
}
|
|
380
|
-
ensureOnDOM(n) {
|
|
381
|
-
document.body.offsetHeight;
|
|
382
|
-
}
|
|
383
|
-
makeTransition(n) {
|
|
384
|
-
if (this.open !== n)
|
|
385
|
-
return null;
|
|
386
|
-
let o = null;
|
|
387
|
-
const s = (a, l) => () => {
|
|
388
|
-
if (n !== this.open)
|
|
389
|
-
return;
|
|
390
|
-
if (a.open = n, l === 0) {
|
|
391
|
-
const c = n ? Mt : $t;
|
|
392
|
-
this.dispatchEvent(new c());
|
|
393
|
-
}
|
|
394
|
-
if (n !== !0 || (a.matches(ct) && (o = a), o = o || Nt(a), o))
|
|
395
|
-
return;
|
|
396
|
-
a.querySelectorAll("slot").forEach((c) => {
|
|
397
|
-
o || (o = _t(c));
|
|
398
|
-
});
|
|
399
|
-
}, r = (a, l) => async () => {
|
|
400
|
-
if (this.open !== n)
|
|
401
|
-
return;
|
|
402
|
-
const h = n ? "luzmo-opened" : "luzmo-closed";
|
|
403
|
-
if (a.dispatchEvent(
|
|
404
|
-
new S(h, this, {
|
|
405
|
-
interaction: this.type
|
|
406
|
-
})
|
|
407
|
-
), l > 0)
|
|
408
|
-
return;
|
|
409
|
-
const c = this.triggerElement instanceof bt;
|
|
410
|
-
this.dispatchEvent(
|
|
411
|
-
new S(h, this, {
|
|
412
|
-
interaction: this.type,
|
|
413
|
-
publish: c
|
|
414
|
-
})
|
|
415
|
-
), this.triggerElement && !c && this.triggerElement.dispatchEvent(
|
|
416
|
-
new S(h, this, {
|
|
417
|
-
interaction: this.type,
|
|
418
|
-
publish: !0
|
|
419
|
-
})
|
|
420
|
-
), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
|
|
421
|
-
};
|
|
422
|
-
return this.elements.forEach((a, l) => {
|
|
423
|
-
zt(a, s(a, l), r(a, l));
|
|
424
|
-
}), o;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
return t;
|
|
428
|
-
}
|
|
429
|
-
const ke = CSS.supports("(overlay: auto)");
|
|
430
|
-
function Gt(e) {
|
|
431
|
-
let t = !1;
|
|
432
|
-
try {
|
|
433
|
-
t = e.matches(":popover-open");
|
|
434
|
-
} catch {
|
|
435
|
-
}
|
|
436
|
-
let i = !1;
|
|
437
|
-
try {
|
|
438
|
-
i = e.matches(":open");
|
|
439
|
-
} catch {
|
|
440
|
-
}
|
|
441
|
-
return t || i;
|
|
442
|
-
}
|
|
443
|
-
function Fe(e) {
|
|
444
|
-
class t extends e {
|
|
445
|
-
async manageDelay(n) {
|
|
446
|
-
if (n === !1 || n !== this.open) {
|
|
447
|
-
gt.close(this);
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
this.delayed && await gt.openTimer(this) && (this.open = !n);
|
|
451
|
-
}
|
|
452
|
-
/**
|
|
453
|
-
* A popover should be hidden _after_ it is no longer on top-layer because
|
|
454
|
-
* the position metrics will have changed from when it was originally positioned.
|
|
455
|
-
*/
|
|
456
|
-
shouldHidePopover(n) {
|
|
457
|
-
if (n && this.open !== n)
|
|
458
|
-
return;
|
|
459
|
-
const o = async ({
|
|
460
|
-
newState: s
|
|
461
|
-
} = {}) => {
|
|
462
|
-
s !== "open" && await this.placementController.resetOverlayPosition();
|
|
463
|
-
};
|
|
464
|
-
if (!Gt(this.dialogEl)) {
|
|
465
|
-
o();
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
this.dialogEl.addEventListener("toggle", o, {
|
|
469
|
-
once: !0
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
shouldShowPopover(n) {
|
|
473
|
-
let o = !1;
|
|
474
|
-
try {
|
|
475
|
-
o = this.dialogEl.matches(":popover-open");
|
|
476
|
-
} catch {
|
|
477
|
-
}
|
|
478
|
-
let s = !1;
|
|
479
|
-
try {
|
|
480
|
-
s = this.dialogEl.matches(":open");
|
|
481
|
-
} catch {
|
|
482
|
-
}
|
|
483
|
-
n && this.open === n && !o && !s && this.isConnected && (this.dialogEl.showPopover(), this.managePosition());
|
|
484
|
-
}
|
|
485
|
-
async ensureOnDOM(n) {
|
|
486
|
-
ke || await this.shouldHidePopover(n), this.shouldShowPopover(n), await R();
|
|
487
|
-
}
|
|
488
|
-
makeTransition(n) {
|
|
489
|
-
if (this.open !== n)
|
|
490
|
-
return null;
|
|
491
|
-
let o = null;
|
|
492
|
-
const s = (a, l) => () => {
|
|
493
|
-
if (a.open = n, l === 0) {
|
|
494
|
-
const c = n ? Mt : $t;
|
|
495
|
-
this.dispatchEvent(new c());
|
|
496
|
-
}
|
|
497
|
-
if (!n || (a.matches(ct) && (o = a), o = o || Nt(a), o))
|
|
498
|
-
return;
|
|
499
|
-
a.querySelectorAll("slot").forEach((c) => {
|
|
500
|
-
o || (o = _t(c));
|
|
501
|
-
});
|
|
502
|
-
}, r = (a, l) => () => {
|
|
503
|
-
if (this.open !== n)
|
|
504
|
-
return;
|
|
505
|
-
const h = n ? "luzmo-opened" : "luzmo-closed";
|
|
506
|
-
if (l > 0) {
|
|
507
|
-
a.dispatchEvent(
|
|
508
|
-
new S(h, this, {
|
|
509
|
-
interaction: this.type,
|
|
510
|
-
publish: !1
|
|
511
|
-
})
|
|
512
|
-
);
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
const c = async () => {
|
|
516
|
-
if (this.open !== n)
|
|
517
|
-
return;
|
|
518
|
-
await R();
|
|
519
|
-
const f = this.triggerElement instanceof bt;
|
|
520
|
-
this.dispatchEvent(
|
|
521
|
-
new S(h, this, {
|
|
522
|
-
interaction: this.type,
|
|
523
|
-
publish: f
|
|
524
|
-
})
|
|
525
|
-
), a.dispatchEvent(
|
|
526
|
-
new S(h, this, {
|
|
527
|
-
interaction: this.type,
|
|
528
|
-
publish: !1
|
|
529
|
-
})
|
|
530
|
-
), this.triggerElement && !f && this.triggerElement.dispatchEvent(
|
|
531
|
-
new S(h, this, {
|
|
532
|
-
interaction: this.type,
|
|
533
|
-
publish: !0
|
|
534
|
-
})
|
|
535
|
-
), this.state = n ? "opened" : "closed", this.returnFocus(), await R(), await R(), n === this.open && n === !1 && this.requestSlottable();
|
|
536
|
-
};
|
|
537
|
-
if (this.open !== n)
|
|
538
|
-
return;
|
|
539
|
-
const d = Gt(this.dialogEl);
|
|
540
|
-
n !== !0 && d && this.isConnected ? (this.dialogEl.addEventListener(
|
|
541
|
-
"beforetoggle",
|
|
542
|
-
() => {
|
|
543
|
-
c();
|
|
544
|
-
},
|
|
545
|
-
{ once: !0 }
|
|
546
|
-
), this.dialogEl.hidePopover()) : c();
|
|
547
|
-
};
|
|
548
|
-
return this.elements.forEach((a, l) => {
|
|
549
|
-
zt(a, s(a, l), r(a, l));
|
|
550
|
-
}), o;
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return t;
|
|
554
|
-
}
|
|
555
|
-
const ze = "showPopover" in document.createElement("div");
|
|
556
|
-
class Ne {
|
|
557
|
-
constructor() {
|
|
558
|
-
this.root = document.body, this.stack = [], this.handleScroll = (t) => {
|
|
559
|
-
t.target !== document && t.target !== document.documentElement && t.target !== document.body || this.stack.forEach((i) => {
|
|
560
|
-
i.open && (i.type === "auto" && i.triggerElement instanceof HTMLElement && i.triggerElement.closest(
|
|
561
|
-
"luzmo-picker, luzmo-select, luzmo-action-menu"
|
|
562
|
-
) && t.stopPropagation(), document.dispatchEvent(
|
|
563
|
-
new CustomEvent("luzmo-update-overlays", {
|
|
564
|
-
bubbles: !0,
|
|
565
|
-
composed: !0,
|
|
566
|
-
cancelable: !0
|
|
567
|
-
})
|
|
568
|
-
));
|
|
569
|
-
});
|
|
570
|
-
}, this.handlePointerdown = (t) => {
|
|
571
|
-
this.pointerdownPath = t.composedPath(), this.lastOverlay = this.stack.at(-1);
|
|
572
|
-
}, this.handlePointerup = () => {
|
|
573
|
-
const t = this.pointerdownPath;
|
|
574
|
-
if (this.pointerdownPath = void 0, this.stack.length === 0 || !(t != null && t.length))
|
|
575
|
-
return;
|
|
576
|
-
const i = this.lastOverlay;
|
|
577
|
-
this.lastOverlay = void 0;
|
|
578
|
-
const n = this.stack.length - 1, o = this.stack.filter((s, r) => !t.find(
|
|
579
|
-
(l) => (
|
|
580
|
-
// The Overlay is in the stack
|
|
581
|
-
l === s || // The Overlay trigger is in the stack and the Overlay is a "hint"
|
|
582
|
-
l === (s == null ? void 0 : s.triggerElement) && (s == null ? void 0 : s.type) === "hint" || // The last Overlay in the stack is not the last Overlay at `pointerdown` time and has a
|
|
583
|
-
// `triggerInteraction` of "longpress", meaning it was opened by this poitner interaction
|
|
584
|
-
r === n && s !== i && s.triggerInteraction === "longpress"
|
|
585
|
-
)
|
|
586
|
-
) && !s.shouldPreventClose() && s.type !== "manual" && // Don't close if this overlay is modal and not on top of the overlay stack.
|
|
587
|
-
!(s.type === "modal" && i !== s));
|
|
588
|
-
o.reverse(), o.forEach((s) => {
|
|
589
|
-
this.closeOverlay(s);
|
|
590
|
-
let r = s.parentOverlayToForceClose;
|
|
591
|
-
for (; r; )
|
|
592
|
-
this.closeOverlay(r), r = r.parentOverlayToForceClose;
|
|
593
|
-
});
|
|
594
|
-
}, this.handleBeforetoggle = (t) => {
|
|
595
|
-
const { target: i, newState: n } = t;
|
|
596
|
-
n !== "open" && this.closeOverlay(i);
|
|
597
|
-
}, this.handleKeydown = (t) => {
|
|
598
|
-
if (t.code !== "Escape" || this.stack.length === 0)
|
|
599
|
-
return;
|
|
600
|
-
const i = this.stack.at(-1);
|
|
601
|
-
if ((i == null ? void 0 : i.type) === "page") {
|
|
602
|
-
t.preventDefault();
|
|
603
|
-
return;
|
|
604
|
-
}
|
|
605
|
-
if ((i == null ? void 0 : i.type) === "manual") {
|
|
606
|
-
this.closeOverlay(i);
|
|
607
|
-
return;
|
|
608
|
-
}
|
|
609
|
-
ze || i && this.closeOverlay(i);
|
|
610
|
-
}, this.bindEvents();
|
|
611
|
-
}
|
|
612
|
-
get document() {
|
|
613
|
-
return this.root.ownerDocument || document;
|
|
614
|
-
}
|
|
615
|
-
bindEvents() {
|
|
616
|
-
this.document.addEventListener("pointerdown", this.handlePointerdown), this.document.addEventListener("pointerup", this.handlePointerup), this.document.addEventListener("keydown", this.handleKeydown), this.document.addEventListener("scroll", this.handleScroll, {
|
|
617
|
-
capture: !0
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
closeOverlay(t) {
|
|
621
|
-
const i = this.stack.indexOf(t);
|
|
622
|
-
i !== -1 && this.stack.splice(i, 1), t.open = !1;
|
|
623
|
-
}
|
|
624
|
-
/**
|
|
625
|
-
* Get an array of Overlays that all share the same trigger element.
|
|
626
|
-
*
|
|
627
|
-
* @param triggerElement {HTMLELement}
|
|
628
|
-
* @returns
|
|
629
|
-
*/
|
|
630
|
-
overlaysByTriggerElement(t) {
|
|
631
|
-
return this.stack.filter(
|
|
632
|
-
(i) => i.triggerElement === t
|
|
633
|
-
);
|
|
634
|
-
}
|
|
635
|
-
/**
|
|
636
|
-
* When overlays are added manage the open state of exisiting overlays appropriately:
|
|
637
|
-
* - 'modal': should close other non-'modal' and non-'manual' overlays
|
|
638
|
-
* - 'page': should close other non-'modal' and non-'manual' overlays
|
|
639
|
-
* - 'auto': should close other 'auto' overlays and other 'hint' overlays, but not 'manual' overlays
|
|
640
|
-
* - 'manual': shouldn't close other overlays
|
|
641
|
-
* - 'hint': shouldn't close other overlays and give way to all other overlays on a trigger
|
|
642
|
-
*/
|
|
643
|
-
add(t) {
|
|
644
|
-
if (this.stack.includes(t)) {
|
|
645
|
-
const i = this.stack.indexOf(t);
|
|
646
|
-
i !== -1 && (this.stack.splice(i, 1), this.stack.push(t));
|
|
647
|
-
return;
|
|
648
|
-
}
|
|
649
|
-
if (t.type === "auto" || t.type === "modal" || t.type === "page") {
|
|
650
|
-
const i = "luzmo-overlay-query-path", n = new Event(i, {
|
|
651
|
-
composed: !0,
|
|
652
|
-
bubbles: !0
|
|
653
|
-
});
|
|
654
|
-
t.addEventListener(
|
|
655
|
-
i,
|
|
656
|
-
(o) => {
|
|
657
|
-
const s = o.composedPath();
|
|
658
|
-
this.stack.forEach((r) => {
|
|
659
|
-
!s.find((l) => l === r) && r.type !== "manual" && r.type !== "modal" && this.closeOverlay(r);
|
|
660
|
-
});
|
|
661
|
-
},
|
|
662
|
-
{ once: !0 }
|
|
663
|
-
), t.dispatchEvent(n);
|
|
664
|
-
} else if (t.type === "hint") {
|
|
665
|
-
if (this.stack.some(
|
|
666
|
-
(n) => n.type !== "manual" && n.triggerElement && n.triggerElement === t.triggerElement
|
|
667
|
-
)) {
|
|
668
|
-
t.open = !1;
|
|
669
|
-
return;
|
|
670
|
-
}
|
|
671
|
-
this.stack.forEach((n) => {
|
|
672
|
-
n.type === "hint" && this.closeOverlay(n);
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
requestAnimationFrame(() => {
|
|
676
|
-
this.stack.push(t), t.addEventListener("beforetoggle", this.handleBeforetoggle, {
|
|
677
|
-
once: !0
|
|
678
|
-
});
|
|
679
|
-
});
|
|
680
|
-
}
|
|
681
|
-
remove(t) {
|
|
682
|
-
this.closeOverlay(t);
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
const Xt = new Ne(), _e = ':host{display:contents;pointer-events:none;--luzmo-overlay-animation-distance: .5rem}:host(:has(> luzmo-tooltip)){--luzmo-overlay-animation-distance: var( --luzmo-tooltip-animation-distance, 4px )}.dialog{margin:0;border:0;background:none;padding:0;position:fixed;overflow:visible;opacity:1!important;box-sizing:border-box;max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px);height:auto;inset:auto;top:0;left:0;display:flex;--luzmo-overlay-open: true}.dialog:not([is-visible]){display:none}.dialog:focus{outline:none}dialog:modal{--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}:host(:not([open])) .dialog{--luzmo-overlay-open: false}.dialog::backdrop{display:none}.dialog:before{position:absolute;top:-999em;right:-999em;bottom:-999em;left:-999em;content:"";pointer-events:auto!important}.dialog:not(.not-immediately-closable):before{display:none}.dialog>div{width:100%}::slotted(*){pointer-events:auto;visibility:visible!important}::slotted(luzmo-popover){position:static}.dialog:not([actual-placement])[placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog:not([actual-placement])[placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog:not([actual-placement])[placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=top]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:var(--luzmo-overlay-animation-distance)}.dialog[actual-placement*=right]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=bottom]{padding-block:var(--luzmo-overlay-animation-distance);margin-top:calc(-1 * var(--luzmo-overlay-animation-distance))}.dialog[actual-placement*=left]{padding-inline:var(--luzmo-overlay-animation-distance);margin-left:var(--luzmo-overlay-animation-distance)}slot[name=longpress-describedby-descriptor]{display:none}@supports selector(:open){.dialog{opacity:0}.dialog:open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports selector(:popover-open){.dialog{opacity:0}.dialog:popover-open{opacity:1;--luzmo-popover-filter: drop-shadow(0px 2px 6px rgba(0, 0, 0, .15))}}@supports (overlay: auto){.dialog{display:none;transition:all var(--luzmo-overlay-animation-duration, .13s),translate 0s,display var(--luzmo-overlay-animation-duration, .13s);transition-behavior:allow-discrete}.dialog:popover-open,.dialog:modal{display:flex}}@supports (not selector(:open)) and (not selector(:popover-open)){:host:not([open]) .dialog{pointer-events:none}.dialog[actual-placement]{z-index:calc(var(--luzmo-overlay-z-index-base, 1000) + var(--luzmo-overlay-open-count))}}', Y = Math.min, T = Math.max, vt = Math.round, ut = Math.floor, M = (e) => ({
|
|
686
|
-
x: e,
|
|
687
|
-
y: e
|
|
688
|
-
}), $e = {
|
|
689
|
-
left: "right",
|
|
690
|
-
right: "left",
|
|
691
|
-
bottom: "top",
|
|
692
|
-
top: "bottom"
|
|
693
|
-
}, Me = {
|
|
694
|
-
start: "end",
|
|
695
|
-
end: "start"
|
|
696
|
-
};
|
|
697
|
-
function Rt(e, t, i) {
|
|
698
|
-
return T(e, Y(t, i));
|
|
699
|
-
}
|
|
700
|
-
function nt(e, t) {
|
|
701
|
-
return typeof e == "function" ? e(t) : e;
|
|
702
|
-
}
|
|
703
|
-
function G(e) {
|
|
704
|
-
return e.split("-")[0];
|
|
705
|
-
}
|
|
706
|
-
function ot(e) {
|
|
707
|
-
return e.split("-")[1];
|
|
708
|
-
}
|
|
709
|
-
function oe(e) {
|
|
710
|
-
return e === "x" ? "y" : "x";
|
|
711
|
-
}
|
|
712
|
-
function Ht(e) {
|
|
713
|
-
return e === "y" ? "height" : "width";
|
|
714
|
-
}
|
|
715
|
-
function Q(e) {
|
|
716
|
-
return ["top", "bottom"].includes(G(e)) ? "y" : "x";
|
|
717
|
-
}
|
|
718
|
-
function Wt(e) {
|
|
719
|
-
return oe(Q(e));
|
|
720
|
-
}
|
|
721
|
-
function He(e, t, i) {
|
|
722
|
-
i === void 0 && (i = !1);
|
|
723
|
-
const n = ot(e), o = Wt(e), s = Ht(o);
|
|
724
|
-
let r = o === "x" ? n === (i ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
725
|
-
return t.reference[s] > t.floating[s] && (r = yt(r)), [r, yt(r)];
|
|
726
|
-
}
|
|
727
|
-
function We(e) {
|
|
728
|
-
const t = yt(e);
|
|
729
|
-
return [Dt(e), t, Dt(t)];
|
|
730
|
-
}
|
|
731
|
-
function Dt(e) {
|
|
732
|
-
return e.replace(/start|end/g, (t) => Me[t]);
|
|
733
|
-
}
|
|
734
|
-
function Ie(e, t, i) {
|
|
735
|
-
const n = ["left", "right"], o = ["right", "left"], s = ["top", "bottom"], r = ["bottom", "top"];
|
|
736
|
-
switch (e) {
|
|
737
|
-
case "top":
|
|
738
|
-
case "bottom":
|
|
739
|
-
return i ? t ? o : n : t ? n : o;
|
|
740
|
-
case "left":
|
|
741
|
-
case "right":
|
|
742
|
-
return t ? s : r;
|
|
743
|
-
default:
|
|
744
|
-
return [];
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
function Be(e, t, i, n) {
|
|
748
|
-
const o = ot(e);
|
|
749
|
-
let s = Ie(G(e), i === "start", n);
|
|
750
|
-
return o && (s = s.map((r) => r + "-" + o), t && (s = s.concat(s.map(Dt)))), s;
|
|
751
|
-
}
|
|
752
|
-
function yt(e) {
|
|
753
|
-
return e.replace(/left|right|bottom|top/g, (t) => $e[t]);
|
|
754
|
-
}
|
|
755
|
-
function qe(e) {
|
|
756
|
-
return {
|
|
757
|
-
top: 0,
|
|
758
|
-
right: 0,
|
|
759
|
-
bottom: 0,
|
|
760
|
-
left: 0,
|
|
761
|
-
...e
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
function se(e) {
|
|
765
|
-
return typeof e != "number" ? qe(e) : {
|
|
766
|
-
top: e,
|
|
767
|
-
right: e,
|
|
768
|
-
bottom: e,
|
|
769
|
-
left: e
|
|
770
|
-
};
|
|
771
|
-
}
|
|
772
|
-
function wt(e) {
|
|
773
|
-
const {
|
|
774
|
-
x: t,
|
|
775
|
-
y: i,
|
|
776
|
-
width: n,
|
|
777
|
-
height: o
|
|
778
|
-
} = e;
|
|
779
|
-
return {
|
|
780
|
-
width: n,
|
|
781
|
-
height: o,
|
|
782
|
-
top: i,
|
|
783
|
-
left: t,
|
|
784
|
-
right: t + n,
|
|
785
|
-
bottom: i + o,
|
|
786
|
-
x: t,
|
|
787
|
-
y: i
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
function Jt(e, t, i) {
|
|
791
|
-
let {
|
|
792
|
-
reference: n,
|
|
793
|
-
floating: o
|
|
794
|
-
} = e;
|
|
795
|
-
const s = Q(t), r = Wt(t), a = Ht(r), l = G(t), h = s === "y", c = n.x + n.width / 2 - o.width / 2, d = n.y + n.height / 2 - o.height / 2, f = n[a] / 2 - o[a] / 2;
|
|
796
|
-
let u;
|
|
797
|
-
switch (l) {
|
|
798
|
-
case "top":
|
|
799
|
-
u = {
|
|
800
|
-
x: c,
|
|
801
|
-
y: n.y - o.height
|
|
802
|
-
};
|
|
803
|
-
break;
|
|
804
|
-
case "bottom":
|
|
805
|
-
u = {
|
|
806
|
-
x: c,
|
|
807
|
-
y: n.y + n.height
|
|
808
|
-
};
|
|
809
|
-
break;
|
|
810
|
-
case "right":
|
|
811
|
-
u = {
|
|
812
|
-
x: n.x + n.width,
|
|
813
|
-
y: d
|
|
814
|
-
};
|
|
815
|
-
break;
|
|
816
|
-
case "left":
|
|
817
|
-
u = {
|
|
818
|
-
x: n.x - o.width,
|
|
819
|
-
y: d
|
|
820
|
-
};
|
|
821
|
-
break;
|
|
822
|
-
default:
|
|
823
|
-
u = {
|
|
824
|
-
x: n.x,
|
|
825
|
-
y: n.y
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
switch (ot(t)) {
|
|
829
|
-
case "start":
|
|
830
|
-
u[r] -= f * (i && h ? -1 : 1);
|
|
831
|
-
break;
|
|
832
|
-
case "end":
|
|
833
|
-
u[r] += f * (i && h ? -1 : 1);
|
|
834
|
-
break;
|
|
835
|
-
}
|
|
836
|
-
return u;
|
|
837
|
-
}
|
|
838
|
-
const Ve = async (e, t, i) => {
|
|
839
|
-
const {
|
|
840
|
-
placement: n = "bottom",
|
|
841
|
-
strategy: o = "absolute",
|
|
842
|
-
middleware: s = [],
|
|
843
|
-
platform: r
|
|
844
|
-
} = i, a = s.filter(Boolean), l = await (r.isRTL == null ? void 0 : r.isRTL(t));
|
|
845
|
-
let h = await r.getElementRects({
|
|
846
|
-
reference: e,
|
|
847
|
-
floating: t,
|
|
848
|
-
strategy: o
|
|
849
|
-
}), {
|
|
850
|
-
x: c,
|
|
851
|
-
y: d
|
|
852
|
-
} = Jt(h, n, l), f = n, u = {}, p = 0;
|
|
853
|
-
for (let m = 0; m < a.length; m++) {
|
|
854
|
-
const {
|
|
855
|
-
name: v,
|
|
856
|
-
fn: g
|
|
857
|
-
} = a[m], {
|
|
858
|
-
x: y,
|
|
859
|
-
y: w,
|
|
860
|
-
data: E,
|
|
861
|
-
reset: b
|
|
862
|
-
} = await g({
|
|
863
|
-
x: c,
|
|
864
|
-
y: d,
|
|
865
|
-
initialPlacement: n,
|
|
866
|
-
placement: f,
|
|
867
|
-
strategy: o,
|
|
868
|
-
middlewareData: u,
|
|
869
|
-
rects: h,
|
|
870
|
-
platform: r,
|
|
871
|
-
elements: {
|
|
872
|
-
reference: e,
|
|
873
|
-
floating: t
|
|
874
|
-
}
|
|
875
|
-
});
|
|
876
|
-
c = y ?? c, d = w ?? d, u = {
|
|
877
|
-
...u,
|
|
878
|
-
[v]: {
|
|
879
|
-
...u[v],
|
|
880
|
-
...E
|
|
881
|
-
}
|
|
882
|
-
}, b && p <= 50 && (p++, typeof b == "object" && (b.placement && (f = b.placement), b.rects && (h = b.rects === !0 ? await r.getElementRects({
|
|
883
|
-
reference: e,
|
|
884
|
-
floating: t,
|
|
885
|
-
strategy: o
|
|
886
|
-
}) : b.rects), {
|
|
887
|
-
x: c,
|
|
888
|
-
y: d
|
|
889
|
-
} = Jt(h, f, l)), m = -1);
|
|
890
|
-
}
|
|
891
|
-
return {
|
|
892
|
-
x: c,
|
|
893
|
-
y: d,
|
|
894
|
-
placement: f,
|
|
895
|
-
strategy: o,
|
|
896
|
-
middlewareData: u
|
|
897
|
-
};
|
|
898
|
-
};
|
|
899
|
-
async function It(e, t) {
|
|
900
|
-
var i;
|
|
901
|
-
t === void 0 && (t = {});
|
|
902
|
-
const {
|
|
903
|
-
x: n,
|
|
904
|
-
y: o,
|
|
905
|
-
platform: s,
|
|
906
|
-
rects: r,
|
|
907
|
-
elements: a,
|
|
908
|
-
strategy: l
|
|
909
|
-
} = e, {
|
|
910
|
-
boundary: h = "clippingAncestors",
|
|
911
|
-
rootBoundary: c = "viewport",
|
|
912
|
-
elementContext: d = "floating",
|
|
913
|
-
altBoundary: f = !1,
|
|
914
|
-
padding: u = 0
|
|
915
|
-
} = nt(t, e), p = se(u), v = a[f ? d === "floating" ? "reference" : "floating" : d], g = wt(await s.getClippingRect({
|
|
916
|
-
element: (i = await (s.isElement == null ? void 0 : s.isElement(v))) == null || i ? v : v.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(a.floating)),
|
|
917
|
-
boundary: h,
|
|
918
|
-
rootBoundary: c,
|
|
919
|
-
strategy: l
|
|
920
|
-
})), y = d === "floating" ? {
|
|
921
|
-
x: n,
|
|
922
|
-
y: o,
|
|
923
|
-
width: r.floating.width,
|
|
924
|
-
height: r.floating.height
|
|
925
|
-
} : r.reference, w = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(a.floating)), E = await (s.isElement == null ? void 0 : s.isElement(w)) ? await (s.getScale == null ? void 0 : s.getScale(w)) || {
|
|
926
|
-
x: 1,
|
|
927
|
-
y: 1
|
|
928
|
-
} : {
|
|
929
|
-
x: 1,
|
|
930
|
-
y: 1
|
|
931
|
-
}, b = wt(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
932
|
-
elements: a,
|
|
933
|
-
rect: y,
|
|
934
|
-
offsetParent: w,
|
|
935
|
-
strategy: l
|
|
936
|
-
}) : y);
|
|
937
|
-
return {
|
|
938
|
-
top: (g.top - b.top + p.top) / E.y,
|
|
939
|
-
bottom: (b.bottom - g.bottom + p.bottom) / E.y,
|
|
940
|
-
left: (g.left - b.left + p.left) / E.x,
|
|
941
|
-
right: (b.right - g.right + p.right) / E.x
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
const Ue = (e) => ({
|
|
945
|
-
name: "arrow",
|
|
946
|
-
options: e,
|
|
947
|
-
async fn(t) {
|
|
948
|
-
const {
|
|
949
|
-
x: i,
|
|
950
|
-
y: n,
|
|
951
|
-
placement: o,
|
|
952
|
-
rects: s,
|
|
953
|
-
platform: r,
|
|
954
|
-
elements: a,
|
|
955
|
-
middlewareData: l
|
|
956
|
-
} = t, {
|
|
957
|
-
element: h,
|
|
958
|
-
padding: c = 0
|
|
959
|
-
} = nt(e, t) || {};
|
|
960
|
-
if (h == null)
|
|
961
|
-
return {};
|
|
962
|
-
const d = se(c), f = {
|
|
963
|
-
x: i,
|
|
964
|
-
y: n
|
|
965
|
-
}, u = Wt(o), p = Ht(u), m = await r.getDimensions(h), v = u === "y", g = v ? "top" : "left", y = v ? "bottom" : "right", w = v ? "clientHeight" : "clientWidth", E = s.reference[p] + s.reference[u] - f[u] - s.floating[p], b = f[u] - s.reference[u], D = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(h));
|
|
966
|
-
let x = D ? D[w] : 0;
|
|
967
|
-
(!x || !await (r.isElement == null ? void 0 : r.isElement(D))) && (x = a.floating[w] || s.floating[p]);
|
|
968
|
-
const I = E / 2 - b / 2, N = x / 2 - m[p] / 2 - 1, L = Y(d[g], N), V = Y(d[y], N), _ = L, U = x - m[p] - V, P = x / 2 - m[p] / 2 + I, tt = Rt(_, P, U), B = !l.arrow && ot(o) != null && P !== tt && s.reference[p] / 2 - (P < _ ? L : V) - m[p] / 2 < 0, $ = B ? P < _ ? P - _ : P - U : 0;
|
|
969
|
-
return {
|
|
970
|
-
[u]: f[u] + $,
|
|
971
|
-
data: {
|
|
972
|
-
[u]: tt,
|
|
973
|
-
centerOffset: P - tt - $,
|
|
974
|
-
...B && {
|
|
975
|
-
alignmentOffset: $
|
|
976
|
-
}
|
|
977
|
-
},
|
|
978
|
-
reset: B
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
}), je = function(e) {
|
|
982
|
-
return e === void 0 && (e = {}), {
|
|
983
|
-
name: "flip",
|
|
984
|
-
options: e,
|
|
985
|
-
async fn(t) {
|
|
986
|
-
var i, n;
|
|
987
|
-
const {
|
|
988
|
-
placement: o,
|
|
989
|
-
middlewareData: s,
|
|
990
|
-
rects: r,
|
|
991
|
-
initialPlacement: a,
|
|
992
|
-
platform: l,
|
|
993
|
-
elements: h
|
|
994
|
-
} = t, {
|
|
995
|
-
mainAxis: c = !0,
|
|
996
|
-
crossAxis: d = !0,
|
|
997
|
-
fallbackPlacements: f,
|
|
998
|
-
fallbackStrategy: u = "bestFit",
|
|
999
|
-
fallbackAxisSideDirection: p = "none",
|
|
1000
|
-
flipAlignment: m = !0,
|
|
1001
|
-
...v
|
|
1002
|
-
} = nt(e, t);
|
|
1003
|
-
if ((i = s.arrow) != null && i.alignmentOffset)
|
|
1004
|
-
return {};
|
|
1005
|
-
const g = G(o), y = Q(a), w = G(a) === a, E = await (l.isRTL == null ? void 0 : l.isRTL(h.floating)), b = f || (w || !m ? [yt(a)] : We(a)), D = p !== "none";
|
|
1006
|
-
!f && D && b.push(...Be(a, m, p, E));
|
|
1007
|
-
const x = [a, ...b], I = await It(t, v), N = [];
|
|
1008
|
-
let L = ((n = s.flip) == null ? void 0 : n.overflows) || [];
|
|
1009
|
-
if (c && N.push(I[g]), d) {
|
|
1010
|
-
const P = He(o, r, E);
|
|
1011
|
-
N.push(I[P[0]], I[P[1]]);
|
|
1012
|
-
}
|
|
1013
|
-
if (L = [...L, {
|
|
1014
|
-
placement: o,
|
|
1015
|
-
overflows: N
|
|
1016
|
-
}], !N.every((P) => P <= 0)) {
|
|
1017
|
-
var V, _;
|
|
1018
|
-
const P = (((V = s.flip) == null ? void 0 : V.index) || 0) + 1, tt = x[P];
|
|
1019
|
-
if (tt)
|
|
1020
|
-
return {
|
|
1021
|
-
data: {
|
|
1022
|
-
index: P,
|
|
1023
|
-
overflows: L
|
|
1024
|
-
},
|
|
1025
|
-
reset: {
|
|
1026
|
-
placement: tt
|
|
1027
|
-
}
|
|
1028
|
-
};
|
|
1029
|
-
let B = (_ = L.filter(($) => $.overflows[0] <= 0).sort(($, j) => $.overflows[1] - j.overflows[1])[0]) == null ? void 0 : _.placement;
|
|
1030
|
-
if (!B)
|
|
1031
|
-
switch (u) {
|
|
1032
|
-
case "bestFit": {
|
|
1033
|
-
var U;
|
|
1034
|
-
const $ = (U = L.filter((j) => {
|
|
1035
|
-
if (D) {
|
|
1036
|
-
const K = Q(j.placement);
|
|
1037
|
-
return K === y || // Create a bias to the `y` side axis due to horizontal
|
|
1038
|
-
// reading directions favoring greater width.
|
|
1039
|
-
K === "y";
|
|
1040
|
-
}
|
|
1041
|
-
return !0;
|
|
1042
|
-
}).map((j) => [j.placement, j.overflows.filter((K) => K > 0).reduce((K, fe) => K + fe, 0)]).sort((j, K) => j[1] - K[1])[0]) == null ? void 0 : U[0];
|
|
1043
|
-
$ && (B = $);
|
|
1044
|
-
break;
|
|
1045
|
-
}
|
|
1046
|
-
case "initialPlacement":
|
|
1047
|
-
B = a;
|
|
1048
|
-
break;
|
|
1049
|
-
}
|
|
1050
|
-
if (o !== B)
|
|
1051
|
-
return {
|
|
1052
|
-
reset: {
|
|
1053
|
-
placement: B
|
|
1054
|
-
}
|
|
1055
|
-
};
|
|
1056
|
-
}
|
|
1057
|
-
return {};
|
|
1058
|
-
}
|
|
1059
|
-
};
|
|
1060
|
-
};
|
|
1061
|
-
async function Ke(e, t) {
|
|
1062
|
-
const {
|
|
1063
|
-
placement: i,
|
|
1064
|
-
platform: n,
|
|
1065
|
-
elements: o
|
|
1066
|
-
} = e, s = await (n.isRTL == null ? void 0 : n.isRTL(o.floating)), r = G(i), a = ot(i), l = Q(i) === "y", h = ["left", "top"].includes(r) ? -1 : 1, c = s && l ? -1 : 1, d = nt(t, e);
|
|
1067
|
-
let {
|
|
1068
|
-
mainAxis: f,
|
|
1069
|
-
crossAxis: u,
|
|
1070
|
-
alignmentAxis: p
|
|
1071
|
-
} = typeof d == "number" ? {
|
|
1072
|
-
mainAxis: d,
|
|
1073
|
-
crossAxis: 0,
|
|
1074
|
-
alignmentAxis: null
|
|
1075
|
-
} : {
|
|
1076
|
-
mainAxis: d.mainAxis || 0,
|
|
1077
|
-
crossAxis: d.crossAxis || 0,
|
|
1078
|
-
alignmentAxis: d.alignmentAxis
|
|
1079
|
-
};
|
|
1080
|
-
return a && typeof p == "number" && (u = a === "end" ? p * -1 : p), l ? {
|
|
1081
|
-
x: u * c,
|
|
1082
|
-
y: f * h
|
|
1083
|
-
} : {
|
|
1084
|
-
x: f * h,
|
|
1085
|
-
y: u * c
|
|
1086
|
-
};
|
|
1087
|
-
}
|
|
1088
|
-
const Ye = function(e) {
|
|
1089
|
-
return e === void 0 && (e = 0), {
|
|
1090
|
-
name: "offset",
|
|
1091
|
-
options: e,
|
|
1092
|
-
async fn(t) {
|
|
1093
|
-
var i, n;
|
|
1094
|
-
const {
|
|
1095
|
-
x: o,
|
|
1096
|
-
y: s,
|
|
1097
|
-
placement: r,
|
|
1098
|
-
middlewareData: a
|
|
1099
|
-
} = t, l = await Ke(t, e);
|
|
1100
|
-
return r === ((i = a.offset) == null ? void 0 : i.placement) && (n = a.arrow) != null && n.alignmentOffset ? {} : {
|
|
1101
|
-
x: o + l.x,
|
|
1102
|
-
y: s + l.y,
|
|
1103
|
-
data: {
|
|
1104
|
-
...l,
|
|
1105
|
-
placement: r
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
};
|
|
1110
|
-
}, Ge = function(e) {
|
|
1111
|
-
return e === void 0 && (e = {}), {
|
|
1112
|
-
name: "shift",
|
|
1113
|
-
options: e,
|
|
1114
|
-
async fn(t) {
|
|
1115
|
-
const {
|
|
1116
|
-
x: i,
|
|
1117
|
-
y: n,
|
|
1118
|
-
placement: o
|
|
1119
|
-
} = t, {
|
|
1120
|
-
mainAxis: s = !0,
|
|
1121
|
-
crossAxis: r = !1,
|
|
1122
|
-
limiter: a = {
|
|
1123
|
-
fn: (v) => {
|
|
1124
|
-
let {
|
|
1125
|
-
x: g,
|
|
1126
|
-
y
|
|
1127
|
-
} = v;
|
|
1128
|
-
return {
|
|
1129
|
-
x: g,
|
|
1130
|
-
y
|
|
1131
|
-
};
|
|
1132
|
-
}
|
|
1133
|
-
},
|
|
1134
|
-
...l
|
|
1135
|
-
} = nt(e, t), h = {
|
|
1136
|
-
x: i,
|
|
1137
|
-
y: n
|
|
1138
|
-
}, c = await It(t, l), d = Q(G(o)), f = oe(d);
|
|
1139
|
-
let u = h[f], p = h[d];
|
|
1140
|
-
if (s) {
|
|
1141
|
-
const v = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", y = u + c[v], w = u - c[g];
|
|
1142
|
-
u = Rt(y, u, w);
|
|
1143
|
-
}
|
|
1144
|
-
if (r) {
|
|
1145
|
-
const v = d === "y" ? "top" : "left", g = d === "y" ? "bottom" : "right", y = p + c[v], w = p - c[g];
|
|
1146
|
-
p = Rt(y, p, w);
|
|
1147
|
-
}
|
|
1148
|
-
const m = a.fn({
|
|
1149
|
-
...t,
|
|
1150
|
-
[f]: u,
|
|
1151
|
-
[d]: p
|
|
1152
|
-
});
|
|
1153
|
-
return {
|
|
1154
|
-
...m,
|
|
1155
|
-
data: {
|
|
1156
|
-
x: m.x - i,
|
|
1157
|
-
y: m.y - n,
|
|
1158
|
-
enabled: {
|
|
1159
|
-
[f]: s,
|
|
1160
|
-
[d]: r
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
};
|
|
1164
|
-
}
|
|
1165
|
-
};
|
|
1166
|
-
}, Xe = function(e) {
|
|
1167
|
-
return e === void 0 && (e = {}), {
|
|
1168
|
-
name: "size",
|
|
1169
|
-
options: e,
|
|
1170
|
-
async fn(t) {
|
|
1171
|
-
var i, n;
|
|
1172
|
-
const {
|
|
1173
|
-
placement: o,
|
|
1174
|
-
rects: s,
|
|
1175
|
-
platform: r,
|
|
1176
|
-
elements: a
|
|
1177
|
-
} = t, {
|
|
1178
|
-
apply: l = () => {
|
|
1179
|
-
},
|
|
1180
|
-
...h
|
|
1181
|
-
} = nt(e, t), c = await It(t, h), d = G(o), f = ot(o), u = Q(o) === "y", {
|
|
1182
|
-
width: p,
|
|
1183
|
-
height: m
|
|
1184
|
-
} = s.floating;
|
|
1185
|
-
let v, g;
|
|
1186
|
-
d === "top" || d === "bottom" ? (v = d, g = f === (await (r.isRTL == null ? void 0 : r.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (g = d, v = f === "end" ? "top" : "bottom");
|
|
1187
|
-
const y = m - c.top - c.bottom, w = p - c.left - c.right, E = Y(m - c[v], y), b = Y(p - c[g], w), D = !t.middlewareData.shift;
|
|
1188
|
-
let x = E, I = b;
|
|
1189
|
-
if ((i = t.middlewareData.shift) != null && i.enabled.x && (I = w), (n = t.middlewareData.shift) != null && n.enabled.y && (x = y), D && !f) {
|
|
1190
|
-
const L = T(c.left, 0), V = T(c.right, 0), _ = T(c.top, 0), U = T(c.bottom, 0);
|
|
1191
|
-
u ? I = p - 2 * (L !== 0 || V !== 0 ? L + V : T(c.left, c.right)) : x = m - 2 * (_ !== 0 || U !== 0 ? _ + U : T(c.top, c.bottom));
|
|
1192
|
-
}
|
|
1193
|
-
await l({
|
|
1194
|
-
...t,
|
|
1195
|
-
availableWidth: I,
|
|
1196
|
-
availableHeight: x
|
|
1197
|
-
});
|
|
1198
|
-
const N = await r.getDimensions(a.floating);
|
|
1199
|
-
return p !== N.width || m !== N.height ? {
|
|
1200
|
-
reset: {
|
|
1201
|
-
rects: !0
|
|
1202
|
-
}
|
|
1203
|
-
} : {};
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
};
|
|
1207
|
-
function Et() {
|
|
1208
|
-
return typeof window < "u";
|
|
1209
|
-
}
|
|
1210
|
-
function st(e) {
|
|
1211
|
-
return re(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
1212
|
-
}
|
|
1213
|
-
function A(e) {
|
|
1214
|
-
var t;
|
|
1215
|
-
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
1216
|
-
}
|
|
1217
|
-
function W(e) {
|
|
1218
|
-
var t;
|
|
1219
|
-
return (t = (re(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
|
|
1220
|
-
}
|
|
1221
|
-
function re(e) {
|
|
1222
|
-
return Et() ? e instanceof Node || e instanceof A(e).Node : !1;
|
|
1223
|
-
}
|
|
1224
|
-
function k(e) {
|
|
1225
|
-
return Et() ? e instanceof Element || e instanceof A(e).Element : !1;
|
|
1226
|
-
}
|
|
1227
|
-
function H(e) {
|
|
1228
|
-
return Et() ? e instanceof HTMLElement || e instanceof A(e).HTMLElement : !1;
|
|
1229
|
-
}
|
|
1230
|
-
function Qt(e) {
|
|
1231
|
-
return !Et() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof A(e).ShadowRoot;
|
|
1232
|
-
}
|
|
1233
|
-
function ht(e) {
|
|
1234
|
-
const {
|
|
1235
|
-
overflow: t,
|
|
1236
|
-
overflowX: i,
|
|
1237
|
-
overflowY: n,
|
|
1238
|
-
display: o
|
|
1239
|
-
} = F(e);
|
|
1240
|
-
return /auto|scroll|overlay|hidden|clip/.test(t + n + i) && !["inline", "contents"].includes(o);
|
|
1241
|
-
}
|
|
1242
|
-
function Je(e) {
|
|
1243
|
-
return ["table", "td", "th"].includes(st(e));
|
|
1244
|
-
}
|
|
1245
|
-
function xt(e) {
|
|
1246
|
-
return [":popover-open", ":modal"].some((t) => {
|
|
1247
|
-
try {
|
|
1248
|
-
return e.matches(t);
|
|
1249
|
-
} catch {
|
|
1250
|
-
return !1;
|
|
1251
|
-
}
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
function Bt(e) {
|
|
1255
|
-
const t = qt(), i = k(e) ? F(e) : e;
|
|
1256
|
-
return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => i[n] ? i[n] !== "none" : !1) || (i.containerType ? i.containerType !== "normal" : !1) || !t && (i.backdropFilter ? i.backdropFilter !== "none" : !1) || !t && (i.filter ? i.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (i.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (i.contain || "").includes(n));
|
|
1257
|
-
}
|
|
1258
|
-
function Qe(e) {
|
|
1259
|
-
let t = X(e);
|
|
1260
|
-
for (; H(t) && !it(t); ) {
|
|
1261
|
-
if (Bt(t))
|
|
1262
|
-
return t;
|
|
1263
|
-
if (xt(t))
|
|
1264
|
-
return null;
|
|
1265
|
-
t = X(t);
|
|
1266
|
-
}
|
|
1267
|
-
return null;
|
|
1268
|
-
}
|
|
1269
|
-
function qt() {
|
|
1270
|
-
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
1271
|
-
}
|
|
1272
|
-
function it(e) {
|
|
1273
|
-
return ["html", "body", "#document"].includes(st(e));
|
|
1274
|
-
}
|
|
1275
|
-
function F(e) {
|
|
1276
|
-
return A(e).getComputedStyle(e);
|
|
1277
|
-
}
|
|
1278
|
-
function Ct(e) {
|
|
1279
|
-
return k(e) ? {
|
|
1280
|
-
scrollLeft: e.scrollLeft,
|
|
1281
|
-
scrollTop: e.scrollTop
|
|
1282
|
-
} : {
|
|
1283
|
-
scrollLeft: e.scrollX,
|
|
1284
|
-
scrollTop: e.scrollY
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
function X(e) {
|
|
1288
|
-
if (st(e) === "html")
|
|
1289
|
-
return e;
|
|
1290
|
-
const t = (
|
|
1291
|
-
// Step into the shadow DOM of the parent of a slotted node.
|
|
1292
|
-
e.assignedSlot || // DOM Element detected.
|
|
1293
|
-
e.parentNode || // ShadowRoot detected.
|
|
1294
|
-
Qt(e) && e.host || // Fallback.
|
|
1295
|
-
W(e)
|
|
1296
|
-
);
|
|
1297
|
-
return Qt(t) ? t.host : t;
|
|
1298
|
-
}
|
|
1299
|
-
function ae(e) {
|
|
1300
|
-
const t = X(e);
|
|
1301
|
-
return it(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : H(t) && ht(t) ? t : ae(t);
|
|
1302
|
-
}
|
|
1303
|
-
function at(e, t, i) {
|
|
1304
|
-
var n;
|
|
1305
|
-
t === void 0 && (t = []), i === void 0 && (i = !0);
|
|
1306
|
-
const o = ae(e), s = o === ((n = e.ownerDocument) == null ? void 0 : n.body), r = A(o);
|
|
1307
|
-
if (s) {
|
|
1308
|
-
const a = Lt(r);
|
|
1309
|
-
return t.concat(r, r.visualViewport || [], ht(o) ? o : [], a && i ? at(a) : []);
|
|
1310
|
-
}
|
|
1311
|
-
return t.concat(o, at(o, [], i));
|
|
1312
|
-
}
|
|
1313
|
-
function Lt(e) {
|
|
1314
|
-
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
1315
|
-
}
|
|
1316
|
-
function le(e) {
|
|
1317
|
-
const t = F(e);
|
|
1318
|
-
let i = parseFloat(t.width) || 0, n = parseFloat(t.height) || 0;
|
|
1319
|
-
const o = H(e), s = o ? e.offsetWidth : i, r = o ? e.offsetHeight : n, a = vt(i) !== s || vt(n) !== r;
|
|
1320
|
-
return a && (i = s, n = r), {
|
|
1321
|
-
width: i,
|
|
1322
|
-
height: n,
|
|
1323
|
-
$: a
|
|
1324
|
-
};
|
|
1325
|
-
}
|
|
1326
|
-
function Vt(e) {
|
|
1327
|
-
return k(e) ? e : e.contextElement;
|
|
1328
|
-
}
|
|
1329
|
-
function et(e) {
|
|
1330
|
-
const t = Vt(e);
|
|
1331
|
-
if (!H(t))
|
|
1332
|
-
return M(1);
|
|
1333
|
-
const i = t.getBoundingClientRect(), {
|
|
1334
|
-
width: n,
|
|
1335
|
-
height: o,
|
|
1336
|
-
$: s
|
|
1337
|
-
} = le(t);
|
|
1338
|
-
let r = (s ? vt(i.width) : i.width) / n, a = (s ? vt(i.height) : i.height) / o;
|
|
1339
|
-
return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
|
|
1340
|
-
x: r,
|
|
1341
|
-
y: a
|
|
1342
|
-
};
|
|
1343
|
-
}
|
|
1344
|
-
const Ze = /* @__PURE__ */ M(0);
|
|
1345
|
-
function ce(e) {
|
|
1346
|
-
const t = A(e);
|
|
1347
|
-
return !qt() || !t.visualViewport ? Ze : {
|
|
1348
|
-
x: t.visualViewport.offsetLeft,
|
|
1349
|
-
y: t.visualViewport.offsetTop
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
function ti(e, t, i) {
|
|
1353
|
-
return t === void 0 && (t = !1), !i || t && i !== A(e) ? !1 : t;
|
|
1354
|
-
}
|
|
1355
|
-
function Z(e, t, i, n) {
|
|
1356
|
-
t === void 0 && (t = !1), i === void 0 && (i = !1);
|
|
1357
|
-
const o = e.getBoundingClientRect(), s = Vt(e);
|
|
1358
|
-
let r = M(1);
|
|
1359
|
-
t && (n ? k(n) && (r = et(n)) : r = et(e));
|
|
1360
|
-
const a = ti(s, i, n) ? ce(s) : M(0);
|
|
1361
|
-
let l = (o.left + a.x) / r.x, h = (o.top + a.y) / r.y, c = o.width / r.x, d = o.height / r.y;
|
|
1362
|
-
if (s) {
|
|
1363
|
-
const f = A(s), u = n && k(n) ? A(n) : n;
|
|
1364
|
-
let p = f, m = Lt(p);
|
|
1365
|
-
for (; m && n && u !== p; ) {
|
|
1366
|
-
const v = et(m), g = m.getBoundingClientRect(), y = F(m), w = g.left + (m.clientLeft + parseFloat(y.paddingLeft)) * v.x, E = g.top + (m.clientTop + parseFloat(y.paddingTop)) * v.y;
|
|
1367
|
-
l *= v.x, h *= v.y, c *= v.x, d *= v.y, l += w, h += E, p = A(m), m = Lt(p);
|
|
1368
|
-
}
|
|
1369
|
-
}
|
|
1370
|
-
return wt({
|
|
1371
|
-
width: c,
|
|
1372
|
-
height: d,
|
|
1373
|
-
x: l,
|
|
1374
|
-
y: h
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
function Ut(e, t) {
|
|
1378
|
-
const i = Ct(e).scrollLeft;
|
|
1379
|
-
return t ? t.left + i : Z(W(e)).left + i;
|
|
1380
|
-
}
|
|
1381
|
-
function he(e, t, i) {
|
|
1382
|
-
i === void 0 && (i = !1);
|
|
1383
|
-
const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - (i ? 0 : (
|
|
1384
|
-
// RTL <body> scrollbar.
|
|
1385
|
-
Ut(e, n)
|
|
1386
|
-
)), s = n.top + t.scrollTop;
|
|
1387
|
-
return {
|
|
1388
|
-
x: o,
|
|
1389
|
-
y: s
|
|
1390
|
-
};
|
|
1391
|
-
}
|
|
1392
|
-
function ei(e) {
|
|
1393
|
-
let {
|
|
1394
|
-
elements: t,
|
|
1395
|
-
rect: i,
|
|
1396
|
-
offsetParent: n,
|
|
1397
|
-
strategy: o
|
|
1398
|
-
} = e;
|
|
1399
|
-
const s = o === "fixed", r = W(n), a = t ? xt(t.floating) : !1;
|
|
1400
|
-
if (n === r || a && s)
|
|
1401
|
-
return i;
|
|
1402
|
-
let l = {
|
|
1403
|
-
scrollLeft: 0,
|
|
1404
|
-
scrollTop: 0
|
|
1405
|
-
}, h = M(1);
|
|
1406
|
-
const c = M(0), d = H(n);
|
|
1407
|
-
if ((d || !d && !s) && ((st(n) !== "body" || ht(r)) && (l = Ct(n)), H(n))) {
|
|
1408
|
-
const u = Z(n);
|
|
1409
|
-
h = et(n), c.x = u.x + n.clientLeft, c.y = u.y + n.clientTop;
|
|
1410
|
-
}
|
|
1411
|
-
const f = r && !d && !s ? he(r, l, !0) : M(0);
|
|
1412
|
-
return {
|
|
1413
|
-
width: i.width * h.x,
|
|
1414
|
-
height: i.height * h.y,
|
|
1415
|
-
x: i.x * h.x - l.scrollLeft * h.x + c.x + f.x,
|
|
1416
|
-
y: i.y * h.y - l.scrollTop * h.y + c.y + f.y
|
|
1417
|
-
};
|
|
1418
|
-
}
|
|
1419
|
-
function ii(e) {
|
|
1420
|
-
return Array.from(e.getClientRects());
|
|
1421
|
-
}
|
|
1422
|
-
function ni(e) {
|
|
1423
|
-
const t = W(e), i = Ct(e), n = e.ownerDocument.body, o = T(t.scrollWidth, t.clientWidth, n.scrollWidth, n.clientWidth), s = T(t.scrollHeight, t.clientHeight, n.scrollHeight, n.clientHeight);
|
|
1424
|
-
let r = -i.scrollLeft + Ut(e);
|
|
1425
|
-
const a = -i.scrollTop;
|
|
1426
|
-
return F(n).direction === "rtl" && (r += T(t.clientWidth, n.clientWidth) - o), {
|
|
1427
|
-
width: o,
|
|
1428
|
-
height: s,
|
|
1429
|
-
x: r,
|
|
1430
|
-
y: a
|
|
1431
|
-
};
|
|
1432
|
-
}
|
|
1433
|
-
function oi(e, t) {
|
|
1434
|
-
const i = A(e), n = W(e), o = i.visualViewport;
|
|
1435
|
-
let s = n.clientWidth, r = n.clientHeight, a = 0, l = 0;
|
|
1436
|
-
if (o) {
|
|
1437
|
-
s = o.width, r = o.height;
|
|
1438
|
-
const h = qt();
|
|
1439
|
-
(!h || h && t === "fixed") && (a = o.offsetLeft, l = o.offsetTop);
|
|
1440
|
-
}
|
|
1441
|
-
return {
|
|
1442
|
-
width: s,
|
|
1443
|
-
height: r,
|
|
1444
|
-
x: a,
|
|
1445
|
-
y: l
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
function si(e, t) {
|
|
1449
|
-
const i = Z(e, !0, t === "fixed"), n = i.top + e.clientTop, o = i.left + e.clientLeft, s = H(e) ? et(e) : M(1), r = e.clientWidth * s.x, a = e.clientHeight * s.y, l = o * s.x, h = n * s.y;
|
|
1450
|
-
return {
|
|
1451
|
-
width: r,
|
|
1452
|
-
height: a,
|
|
1453
|
-
x: l,
|
|
1454
|
-
y: h
|
|
1455
|
-
};
|
|
1456
|
-
}
|
|
1457
|
-
function Zt(e, t, i) {
|
|
1458
|
-
let n;
|
|
1459
|
-
if (t === "viewport")
|
|
1460
|
-
n = oi(e, i);
|
|
1461
|
-
else if (t === "document")
|
|
1462
|
-
n = ni(W(e));
|
|
1463
|
-
else if (k(t))
|
|
1464
|
-
n = si(t, i);
|
|
1465
|
-
else {
|
|
1466
|
-
const o = ce(e);
|
|
1467
|
-
n = {
|
|
1468
|
-
x: t.x - o.x,
|
|
1469
|
-
y: t.y - o.y,
|
|
1470
|
-
width: t.width,
|
|
1471
|
-
height: t.height
|
|
1472
|
-
};
|
|
1473
|
-
}
|
|
1474
|
-
return wt(n);
|
|
1475
|
-
}
|
|
1476
|
-
function de(e, t) {
|
|
1477
|
-
const i = X(e);
|
|
1478
|
-
return i === t || !k(i) || it(i) ? !1 : F(i).position === "fixed" || de(i, t);
|
|
1479
|
-
}
|
|
1480
|
-
function ri(e, t) {
|
|
1481
|
-
const i = t.get(e);
|
|
1482
|
-
if (i)
|
|
1483
|
-
return i;
|
|
1484
|
-
let n = at(e, [], !1).filter((a) => k(a) && st(a) !== "body"), o = null;
|
|
1485
|
-
const s = F(e).position === "fixed";
|
|
1486
|
-
let r = s ? X(e) : e;
|
|
1487
|
-
for (; k(r) && !it(r); ) {
|
|
1488
|
-
const a = F(r), l = Bt(r);
|
|
1489
|
-
!l && a.position === "fixed" && (o = null), (s ? !l && !o : !l && a.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || ht(r) && !l && de(e, r)) ? n = n.filter((c) => c !== r) : o = a, r = X(r);
|
|
1490
|
-
}
|
|
1491
|
-
return t.set(e, n), n;
|
|
1492
|
-
}
|
|
1493
|
-
function ai(e) {
|
|
1494
|
-
let {
|
|
1495
|
-
element: t,
|
|
1496
|
-
boundary: i,
|
|
1497
|
-
rootBoundary: n,
|
|
1498
|
-
strategy: o
|
|
1499
|
-
} = e;
|
|
1500
|
-
const r = [...i === "clippingAncestors" ? xt(t) ? [] : ri(t, this._c) : [].concat(i), n], a = r[0], l = r.reduce((h, c) => {
|
|
1501
|
-
const d = Zt(t, c, o);
|
|
1502
|
-
return h.top = T(d.top, h.top), h.right = Y(d.right, h.right), h.bottom = Y(d.bottom, h.bottom), h.left = T(d.left, h.left), h;
|
|
1503
|
-
}, Zt(t, a, o));
|
|
1504
|
-
return {
|
|
1505
|
-
width: l.right - l.left,
|
|
1506
|
-
height: l.bottom - l.top,
|
|
1507
|
-
x: l.left,
|
|
1508
|
-
y: l.top
|
|
1509
|
-
};
|
|
1510
|
-
}
|
|
1511
|
-
function li(e) {
|
|
1512
|
-
const {
|
|
1513
|
-
width: t,
|
|
1514
|
-
height: i
|
|
1515
|
-
} = le(e);
|
|
1516
|
-
return {
|
|
1517
|
-
width: t,
|
|
1518
|
-
height: i
|
|
1519
|
-
};
|
|
1520
|
-
}
|
|
1521
|
-
function ci(e, t, i) {
|
|
1522
|
-
const n = H(t), o = W(t), s = i === "fixed", r = Z(e, !0, s, t);
|
|
1523
|
-
let a = {
|
|
1524
|
-
scrollLeft: 0,
|
|
1525
|
-
scrollTop: 0
|
|
1526
|
-
};
|
|
1527
|
-
const l = M(0);
|
|
1528
|
-
if (n || !n && !s)
|
|
1529
|
-
if ((st(t) !== "body" || ht(o)) && (a = Ct(t)), n) {
|
|
1530
|
-
const f = Z(t, !0, s, t);
|
|
1531
|
-
l.x = f.x + t.clientLeft, l.y = f.y + t.clientTop;
|
|
1532
|
-
} else o && (l.x = Ut(o));
|
|
1533
|
-
const h = o && !n && !s ? he(o, a) : M(0), c = r.left + a.scrollLeft - l.x - h.x, d = r.top + a.scrollTop - l.y - h.y;
|
|
1534
|
-
return {
|
|
1535
|
-
x: c,
|
|
1536
|
-
y: d,
|
|
1537
|
-
width: r.width,
|
|
1538
|
-
height: r.height
|
|
1539
|
-
};
|
|
1540
|
-
}
|
|
1541
|
-
function Ot(e) {
|
|
1542
|
-
return F(e).position === "static";
|
|
1543
|
-
}
|
|
1544
|
-
function te(e, t) {
|
|
1545
|
-
if (!H(e) || F(e).position === "fixed")
|
|
1546
|
-
return null;
|
|
1547
|
-
if (t)
|
|
1548
|
-
return t(e);
|
|
1549
|
-
let i = e.offsetParent;
|
|
1550
|
-
return W(e) === i && (i = i.ownerDocument.body), i;
|
|
1551
|
-
}
|
|
1552
|
-
function ue(e, t) {
|
|
1553
|
-
const i = A(e);
|
|
1554
|
-
if (xt(e))
|
|
1555
|
-
return i;
|
|
1556
|
-
if (!H(e)) {
|
|
1557
|
-
let o = X(e);
|
|
1558
|
-
for (; o && !it(o); ) {
|
|
1559
|
-
if (k(o) && !Ot(o))
|
|
1560
|
-
return o;
|
|
1561
|
-
o = X(o);
|
|
1562
|
-
}
|
|
1563
|
-
return i;
|
|
1564
|
-
}
|
|
1565
|
-
let n = te(e, t);
|
|
1566
|
-
for (; n && Je(n) && Ot(n); )
|
|
1567
|
-
n = te(n, t);
|
|
1568
|
-
return n && it(n) && Ot(n) && !Bt(n) ? i : n || Qe(e) || i;
|
|
1569
|
-
}
|
|
1570
|
-
const hi = async function(e) {
|
|
1571
|
-
const t = this.getOffsetParent || ue, i = this.getDimensions, n = await i(e.floating);
|
|
1572
|
-
return {
|
|
1573
|
-
reference: ci(e.reference, await t(e.floating), e.strategy),
|
|
1574
|
-
floating: {
|
|
1575
|
-
x: 0,
|
|
1576
|
-
y: 0,
|
|
1577
|
-
width: n.width,
|
|
1578
|
-
height: n.height
|
|
1579
|
-
}
|
|
1580
|
-
};
|
|
1581
|
-
};
|
|
1582
|
-
function di(e) {
|
|
1583
|
-
return F(e).direction === "rtl";
|
|
1584
|
-
}
|
|
1585
|
-
const ui = {
|
|
1586
|
-
convertOffsetParentRelativeRectToViewportRelativeRect: ei,
|
|
1587
|
-
getDocumentElement: W,
|
|
1588
|
-
getClippingRect: ai,
|
|
1589
|
-
getOffsetParent: ue,
|
|
1590
|
-
getElementRects: hi,
|
|
1591
|
-
getClientRects: ii,
|
|
1592
|
-
getDimensions: li,
|
|
1593
|
-
getScale: et,
|
|
1594
|
-
isElement: k,
|
|
1595
|
-
isRTL: di
|
|
1596
|
-
};
|
|
1597
|
-
function pe(e, t) {
|
|
1598
|
-
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1599
|
-
}
|
|
1600
|
-
function pi(e, t) {
|
|
1601
|
-
let i = null, n;
|
|
1602
|
-
const o = W(e);
|
|
1603
|
-
function s() {
|
|
1604
|
-
var a;
|
|
1605
|
-
clearTimeout(n), (a = i) == null || a.disconnect(), i = null;
|
|
1606
|
-
}
|
|
1607
|
-
function r(a, l) {
|
|
1608
|
-
a === void 0 && (a = !1), l === void 0 && (l = 1), s();
|
|
1609
|
-
const h = e.getBoundingClientRect(), {
|
|
1610
|
-
left: c,
|
|
1611
|
-
top: d,
|
|
1612
|
-
width: f,
|
|
1613
|
-
height: u
|
|
1614
|
-
} = h;
|
|
1615
|
-
if (a || t(), !f || !u)
|
|
1616
|
-
return;
|
|
1617
|
-
const p = ut(d), m = ut(o.clientWidth - (c + f)), v = ut(o.clientHeight - (d + u)), g = ut(c), w = {
|
|
1618
|
-
rootMargin: -p + "px " + -m + "px " + -v + "px " + -g + "px",
|
|
1619
|
-
threshold: T(0, Y(1, l)) || 1
|
|
1620
|
-
};
|
|
1621
|
-
let E = !0;
|
|
1622
|
-
function b(D) {
|
|
1623
|
-
const x = D[0].intersectionRatio;
|
|
1624
|
-
if (x !== l) {
|
|
1625
|
-
if (!E)
|
|
1626
|
-
return r();
|
|
1627
|
-
x ? r(!1, x) : n = setTimeout(() => {
|
|
1628
|
-
r(!1, 1e-7);
|
|
1629
|
-
}, 1e3);
|
|
1630
|
-
}
|
|
1631
|
-
x === 1 && !pe(h, e.getBoundingClientRect()) && r(), E = !1;
|
|
1632
|
-
}
|
|
1633
|
-
try {
|
|
1634
|
-
i = new IntersectionObserver(b, {
|
|
1635
|
-
...w,
|
|
1636
|
-
// Handle <iframe>s
|
|
1637
|
-
root: o.ownerDocument
|
|
1638
|
-
});
|
|
1639
|
-
} catch {
|
|
1640
|
-
i = new IntersectionObserver(b, w);
|
|
1641
|
-
}
|
|
1642
|
-
i.observe(e);
|
|
1643
|
-
}
|
|
1644
|
-
return r(!0), s;
|
|
1645
|
-
}
|
|
1646
|
-
function ee(e, t, i, n) {
|
|
1647
|
-
n === void 0 && (n = {});
|
|
1648
|
-
const {
|
|
1649
|
-
ancestorScroll: o = !0,
|
|
1650
|
-
ancestorResize: s = !0,
|
|
1651
|
-
elementResize: r = typeof ResizeObserver == "function",
|
|
1652
|
-
layoutShift: a = typeof IntersectionObserver == "function",
|
|
1653
|
-
animationFrame: l = !1
|
|
1654
|
-
} = n, h = Vt(e), c = o || s ? [...h ? at(h) : [], ...at(t)] : [];
|
|
1655
|
-
c.forEach((g) => {
|
|
1656
|
-
o && g.addEventListener("scroll", i, {
|
|
1657
|
-
passive: !0
|
|
1658
|
-
}), s && g.addEventListener("resize", i);
|
|
1659
|
-
});
|
|
1660
|
-
const d = h && a ? pi(h, i) : null;
|
|
1661
|
-
let f = -1, u = null;
|
|
1662
|
-
r && (u = new ResizeObserver((g) => {
|
|
1663
|
-
let [y] = g;
|
|
1664
|
-
y && y.target === h && u && (u.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
1665
|
-
var w;
|
|
1666
|
-
(w = u) == null || w.observe(t);
|
|
1667
|
-
})), i();
|
|
1668
|
-
}), h && !l && u.observe(h), u.observe(t));
|
|
1669
|
-
let p, m = l ? Z(e) : null;
|
|
1670
|
-
l && v();
|
|
1671
|
-
function v() {
|
|
1672
|
-
const g = Z(e);
|
|
1673
|
-
m && !pe(m, g) && i(), m = g, p = requestAnimationFrame(v);
|
|
1674
|
-
}
|
|
1675
|
-
return i(), () => {
|
|
1676
|
-
var g;
|
|
1677
|
-
c.forEach((y) => {
|
|
1678
|
-
o && y.removeEventListener("scroll", i), s && y.removeEventListener("resize", i);
|
|
1679
|
-
}), d == null || d(), (g = u) == null || g.disconnect(), u = null, l && cancelAnimationFrame(p);
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
const fi = Ye, mi = Ge, ie = je, gi = Xe, vi = Ue, yi = (e, t, i) => {
|
|
1683
|
-
const n = /* @__PURE__ */ new Map(), o = {
|
|
1684
|
-
platform: ui,
|
|
1685
|
-
...i
|
|
1686
|
-
}, s = {
|
|
1687
|
-
...o.platform,
|
|
1688
|
-
_c: n
|
|
1689
|
-
};
|
|
1690
|
-
return Ve(e, t, {
|
|
1691
|
-
...o,
|
|
1692
|
-
platform: s
|
|
1693
|
-
});
|
|
1694
|
-
};
|
|
1695
|
-
function pt(e) {
|
|
1696
|
-
if (e === void 0)
|
|
1697
|
-
return 0;
|
|
1698
|
-
const t = window.devicePixelRatio || 1;
|
|
1699
|
-
return Math.round(e * t) / t;
|
|
1700
|
-
}
|
|
1701
|
-
const ft = 8, wi = 100, bi = (e) => ({
|
|
1702
|
-
left: ["right", "bottom", "top"],
|
|
1703
|
-
"left-start": ["right-start", "bottom", "top"],
|
|
1704
|
-
"left-end": ["right-end", "bottom", "top"],
|
|
1705
|
-
right: ["left", "bottom", "top"],
|
|
1706
|
-
"right-start": ["left-start", "bottom", "top"],
|
|
1707
|
-
"right-end": ["left-end", "bottom", "top"],
|
|
1708
|
-
top: ["bottom", "left", "right"],
|
|
1709
|
-
"top-start": ["bottom-start", "left", "right"],
|
|
1710
|
-
"top-end": ["bottom-end", "left", "right"],
|
|
1711
|
-
bottom: ["top", "left", "right"],
|
|
1712
|
-
"bottom-start": ["top-start", "left", "right"],
|
|
1713
|
-
"bottom-end": ["top-end", "left", "right"]
|
|
1714
|
-
})[e] ?? [e], Ui = Symbol("placement updated");
|
|
1715
|
-
class Ei {
|
|
1716
|
-
/**
|
|
1717
|
-
* Creates an instance of the PlacementController.
|
|
1718
|
-
*
|
|
1719
|
-
* @param host - The host element that uses this controller.
|
|
1720
|
-
*/
|
|
1721
|
-
constructor(t) {
|
|
1722
|
-
this.originalPlacements = /* @__PURE__ */ new WeakMap(), this.allowPlacementUpdate = !1, this.closeForAncestorUpdate = () => {
|
|
1723
|
-
!this.allowPlacementUpdate && this.options.type !== "modal" && this.cleanup && this.target.dispatchEvent(new Event("close", { bubbles: !0 })), this.allowPlacementUpdate = !1;
|
|
1724
|
-
}, this.updatePlacement = () => {
|
|
1725
|
-
this.computePlacement();
|
|
1726
|
-
}, this.resetOverlayPosition = () => {
|
|
1727
|
-
!this.target || !this.options || (this.clearOverlayPosition(), this.host.offsetHeight, this.computePlacement());
|
|
1728
|
-
}, this.host = t, this.host.addController(this);
|
|
1729
|
-
}
|
|
1730
|
-
/**
|
|
1731
|
-
* Places the overlay relative to the target element.
|
|
1732
|
-
*
|
|
1733
|
-
* This method sets up the necessary configurations and event listeners to manage the
|
|
1734
|
-
* positioning and constraints of the overlay element.
|
|
1735
|
-
*
|
|
1736
|
-
* @param [target=this.target] - The target element for the overlay.
|
|
1737
|
-
* @param [options=this.options] - The options for configuring the overlay placement.
|
|
1738
|
-
* @returns A promise that resolves when the overlay has been placed.
|
|
1739
|
-
*/
|
|
1740
|
-
placeOverlay(t = this.target, i = this.options) {
|
|
1741
|
-
if (this.target = t, this.options = i, !t || !i)
|
|
1742
|
-
return;
|
|
1743
|
-
const n = ee(
|
|
1744
|
-
i.trigger,
|
|
1745
|
-
t,
|
|
1746
|
-
this.closeForAncestorUpdate,
|
|
1747
|
-
{
|
|
1748
|
-
ancestorResize: !1,
|
|
1749
|
-
elementResize: !1,
|
|
1750
|
-
layoutShift: !1
|
|
1751
|
-
}
|
|
1752
|
-
), o = ee(
|
|
1753
|
-
i.trigger,
|
|
1754
|
-
t,
|
|
1755
|
-
this.updatePlacement,
|
|
1756
|
-
{
|
|
1757
|
-
ancestorScroll: !1
|
|
1758
|
-
}
|
|
1759
|
-
);
|
|
1760
|
-
this.cleanup = () => {
|
|
1761
|
-
var s;
|
|
1762
|
-
(s = this.host.elements) == null || s.forEach((r) => {
|
|
1763
|
-
r.addEventListener(
|
|
1764
|
-
"luzmo-closed",
|
|
1765
|
-
() => {
|
|
1766
|
-
const a = this.originalPlacements.get(r);
|
|
1767
|
-
a && r.setAttribute("placement", a), this.originalPlacements.delete(r);
|
|
1768
|
-
},
|
|
1769
|
-
{ once: !0 }
|
|
1770
|
-
);
|
|
1771
|
-
}), n(), o();
|
|
1772
|
-
};
|
|
1773
|
-
}
|
|
1774
|
-
/**
|
|
1775
|
-
* Computes the placement of the overlay relative to the target element.
|
|
1776
|
-
*
|
|
1777
|
-
* This method calculates the necessary positioning and constraints for the overlay element
|
|
1778
|
-
* using various middleware functions. It updates the overlay's style and attributes based
|
|
1779
|
-
* on the computed position.
|
|
1780
|
-
*
|
|
1781
|
-
* @returns A promise that resolves when the placement has been computed.
|
|
1782
|
-
*/
|
|
1783
|
-
async computePlacement() {
|
|
1784
|
-
var f, u;
|
|
1785
|
-
const { options: t, target: i } = this;
|
|
1786
|
-
await (document.fonts ? document.fonts.ready : Promise.resolve());
|
|
1787
|
-
const n = t.trigger instanceof HTMLElement ? ie() : ie({
|
|
1788
|
-
padding: ft,
|
|
1789
|
-
fallbackPlacements: bi(t.placement)
|
|
1790
|
-
}), [o = 0, s = 0] = Array.isArray(t == null ? void 0 : t.offset) ? t.offset : [t.offset, 0], r = (f = this.host.elements.find(
|
|
1791
|
-
(p) => p.tipElement
|
|
1792
|
-
)) == null ? void 0 : f.tipElement, a = [
|
|
1793
|
-
fi({
|
|
1794
|
-
mainAxis: o,
|
|
1795
|
-
crossAxis: s
|
|
1796
|
-
}),
|
|
1797
|
-
mi({ padding: ft }),
|
|
1798
|
-
n,
|
|
1799
|
-
gi({
|
|
1800
|
-
padding: ft,
|
|
1801
|
-
apply: ({ availableWidth: p, availableHeight: m, rects: { floating: v } }) => {
|
|
1802
|
-
const g = Math.max(
|
|
1803
|
-
wi,
|
|
1804
|
-
Math.floor(m)
|
|
1805
|
-
), y = v.height;
|
|
1806
|
-
this.initialHeight = this.isConstrained && this.initialHeight || y, this.isConstrained = y < this.initialHeight || g <= y;
|
|
1807
|
-
const w = this.isConstrained ? `${g}px` : "";
|
|
1808
|
-
Object.assign(i.style, {
|
|
1809
|
-
maxWidth: `${Math.floor(p)}px`,
|
|
1810
|
-
maxHeight: w
|
|
1811
|
-
});
|
|
1812
|
-
}
|
|
1813
|
-
}),
|
|
1814
|
-
...r ? [
|
|
1815
|
-
vi({
|
|
1816
|
-
element: r,
|
|
1817
|
-
padding: t.tipPadding || ft
|
|
1818
|
-
})
|
|
1819
|
-
] : []
|
|
1820
|
-
], { x: l, y: h, placement: c, middlewareData: d } = await yi(
|
|
1821
|
-
t.trigger,
|
|
1822
|
-
i,
|
|
1823
|
-
{
|
|
1824
|
-
placement: t.placement,
|
|
1825
|
-
middleware: a,
|
|
1826
|
-
strategy: "fixed"
|
|
1827
|
-
}
|
|
1828
|
-
);
|
|
1829
|
-
if (Object.assign(i.style, {
|
|
1830
|
-
top: "0px",
|
|
1831
|
-
left: "0px",
|
|
1832
|
-
translate: `${pt(l)}px ${pt(h)}px`
|
|
1833
|
-
}), i.setAttribute("actual-placement", c), (u = this.host.elements) == null || u.forEach((p) => {
|
|
1834
|
-
this.originalPlacements.has(p) || this.originalPlacements.set(
|
|
1835
|
-
p,
|
|
1836
|
-
p.getAttribute("placement")
|
|
1837
|
-
), p.setAttribute("placement", c);
|
|
1838
|
-
}), r && d.arrow) {
|
|
1839
|
-
const { x: p, y: m } = d.arrow;
|
|
1840
|
-
Object.assign(r.style, {
|
|
1841
|
-
top: c.startsWith("right") || c.startsWith("left") ? "0px" : "",
|
|
1842
|
-
left: c.startsWith("bottom") || c.startsWith("top") ? "0px" : "",
|
|
1843
|
-
translate: `${pt(p)}px ${pt(m)}px`
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
/**
|
|
1848
|
-
* Clears the overlay's position styles.
|
|
1849
|
-
*
|
|
1850
|
-
* This method removes the max-height and max-width styles from the target element,
|
|
1851
|
-
* and resets the initial height and constrained state of the overlay.
|
|
1852
|
-
*/
|
|
1853
|
-
clearOverlayPosition() {
|
|
1854
|
-
this.target && (this.target.style.removeProperty("max-height"), this.target.style.removeProperty("max-width"), this.initialHeight = void 0, this.isConstrained = !1);
|
|
1855
|
-
}
|
|
1856
|
-
/**
|
|
1857
|
-
* Lifecycle method called when the host element is connected to the DOM.
|
|
1858
|
-
*
|
|
1859
|
-
* This method sets up an event listener to reset the overlay's position when the 'luzmo-update-overlays' event is dispatched.
|
|
1860
|
-
*/
|
|
1861
|
-
hostConnected() {
|
|
1862
|
-
document.addEventListener(
|
|
1863
|
-
"luzmo-update-overlays",
|
|
1864
|
-
this.resetOverlayPosition
|
|
1865
|
-
);
|
|
1866
|
-
}
|
|
1867
|
-
/**
|
|
1868
|
-
* Lifecycle method called when the host element is updated.
|
|
1869
|
-
*
|
|
1870
|
-
* This method cleans up resources if the overlay is not open.
|
|
1871
|
-
*/
|
|
1872
|
-
hostUpdated() {
|
|
1873
|
-
var t;
|
|
1874
|
-
this.host.open || ((t = this.cleanup) == null || t.call(this), this.cleanup = void 0);
|
|
1875
|
-
}
|
|
1876
|
-
/**
|
|
1877
|
-
* Lifecycle method called when the host element is disconnected from the DOM.
|
|
1878
|
-
*
|
|
1879
|
-
* This method removes the event listener and cleans up resources.
|
|
1880
|
-
*/
|
|
1881
|
-
hostDisconnected() {
|
|
1882
|
-
var t;
|
|
1883
|
-
(t = this.cleanup) == null || t.call(this), this.cleanup = void 0, document.removeEventListener(
|
|
1884
|
-
"luzmo-update-overlays",
|
|
1885
|
-
this.resetOverlayPosition
|
|
1886
|
-
);
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
var lt = /* @__PURE__ */ ((e) => (e.click = "click", e.hover = "hover", e.longpress = "longpress", e))(lt || {});
|
|
1890
|
-
const St = Symbol("lastInteractionType"), Tt = "remove-focus-ring-safari-hack";
|
|
1891
|
-
class jt {
|
|
1892
|
-
constructor(t, { overlay: i, isPersistent: n, handleOverlayReady: o }) {
|
|
1893
|
-
this.target = t, this.isLazilyOpen = !1, this.isPersistent = !1, this.isPersistent = !!n, this.handleOverlayReady = o, this.isPersistent && this.init(), this.overlay = i;
|
|
1894
|
-
}
|
|
1895
|
-
get activelyOpening() {
|
|
1896
|
-
return !1;
|
|
1897
|
-
}
|
|
1898
|
-
get open() {
|
|
1899
|
-
var t;
|
|
1900
|
-
return ((t = this.overlay) == null ? void 0 : t.open) ?? this.isLazilyOpen;
|
|
1901
|
-
}
|
|
1902
|
-
/**
|
|
1903
|
-
* Set `open` against the associated Overlay lazily.
|
|
1904
|
-
*/
|
|
1905
|
-
set open(t) {
|
|
1906
|
-
if (t !== this.open) {
|
|
1907
|
-
if (this.isLazilyOpen = t, this.overlay) {
|
|
1908
|
-
this.overlay.open = t, this.target[St] = this.type;
|
|
1909
|
-
return;
|
|
1910
|
-
}
|
|
1911
|
-
t && (customElements.whenDefined("luzmo-overlay").then(async () => {
|
|
1912
|
-
const { LuzmoOverlay: i } = await Promise.resolve().then(() => kt);
|
|
1913
|
-
this.overlay = new i(), this.overlay.open = !0, this.target[St] = this.type;
|
|
1914
|
-
}), Promise.resolve().then(() => kt));
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
get overlay() {
|
|
1918
|
-
return this._overlay;
|
|
1919
|
-
}
|
|
1920
|
-
set overlay(t) {
|
|
1921
|
-
var i;
|
|
1922
|
-
t && this.overlay !== t && (this.overlay && this.overlay.removeController(this), this._overlay = t, this.overlay.addController(this), this.initOverlay(), this.prepareDescription(this.target), (i = this.handleOverlayReady) == null || i.call(this, this.overlay));
|
|
1923
|
-
}
|
|
1924
|
-
prepareDescription(t) {
|
|
1925
|
-
}
|
|
1926
|
-
releaseDescription() {
|
|
1927
|
-
}
|
|
1928
|
-
shouldCompleteOpen() {
|
|
1929
|
-
}
|
|
1930
|
-
/* c8 ignore next 3 */
|
|
1931
|
-
init() {
|
|
1932
|
-
}
|
|
1933
|
-
/* c8 ignore next 3 */
|
|
1934
|
-
initOverlay() {
|
|
1935
|
-
}
|
|
1936
|
-
abort() {
|
|
1937
|
-
var t;
|
|
1938
|
-
this.releaseDescription(), (t = this.abortController) == null || t.abort();
|
|
1939
|
-
}
|
|
1940
|
-
hostConnected() {
|
|
1941
|
-
this.init();
|
|
1942
|
-
}
|
|
1943
|
-
hostDisconnected() {
|
|
1944
|
-
this.isPersistent || this.abort();
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
class xi extends jt {
|
|
1948
|
-
constructor() {
|
|
1949
|
-
super(...arguments), this.type = lt.click, this.preventNextToggle = !1;
|
|
1950
|
-
}
|
|
1951
|
-
handleClick() {
|
|
1952
|
-
this.preventNextToggle || (this.open = !this.open), this.preventNextToggle = !1;
|
|
1953
|
-
}
|
|
1954
|
-
handlePointerdown() {
|
|
1955
|
-
this.preventNextToggle = this.open;
|
|
1956
|
-
}
|
|
1957
|
-
init() {
|
|
1958
|
-
var i;
|
|
1959
|
-
(i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
|
|
1960
|
-
const { signal: t } = this.abortController;
|
|
1961
|
-
this.target.addEventListener("click", () => this.handleClick(), {
|
|
1962
|
-
signal: t
|
|
1963
|
-
}), this.target.addEventListener(
|
|
1964
|
-
"pointerdown",
|
|
1965
|
-
() => this.handlePointerdown(),
|
|
1966
|
-
{ signal: t }
|
|
1967
|
-
);
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
const Ci = 300;
|
|
1971
|
-
class Pi extends jt {
|
|
1972
|
-
constructor() {
|
|
1973
|
-
super(...arguments), this.type = lt.hover, this.elementIds = [], this.focusedin = !1, this.pointerentered = !1;
|
|
1974
|
-
}
|
|
1975
|
-
handleKeyup(t) {
|
|
1976
|
-
(t.code === "Tab" || t.code === "Escape") && (this.open = !0, this.removeSafariFocusRingClass());
|
|
1977
|
-
}
|
|
1978
|
-
handleTargetFocusin() {
|
|
1979
|
-
if (this.target.matches(":focus-visible")) {
|
|
1980
|
-
if (Yt() && this.target[St] === lt.click) {
|
|
1981
|
-
this.target.classList.add(Tt);
|
|
1982
|
-
return;
|
|
1983
|
-
}
|
|
1984
|
-
this.open = !0, this.focusedin = !0, this.removeSafariFocusRingClass();
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
handleTargetFocusout() {
|
|
1988
|
-
this.removeSafariFocusRingClass(), this.focusedin = !1, !this.pointerentered && (this.open = !1);
|
|
1989
|
-
}
|
|
1990
|
-
handleTargetPointerenter() {
|
|
1991
|
-
var t;
|
|
1992
|
-
this.hoverTimeout && (clearTimeout(this.hoverTimeout), this.hoverTimeout = void 0), !((t = this.overlay) != null && t.disabled) && (this.open = !0, this.pointerentered = !0);
|
|
1993
|
-
}
|
|
1994
|
-
handleTargetPointerleave() {
|
|
1995
|
-
this.doPointerleave();
|
|
1996
|
-
}
|
|
1997
|
-
// set a timeout once the pointer enters and the overlay is shown
|
|
1998
|
-
// give the user time to enter the overlay
|
|
1999
|
-
handleHostPointerenter() {
|
|
2000
|
-
this.hoverTimeout && (clearTimeout(this.hoverTimeout), this.hoverTimeout = void 0);
|
|
2001
|
-
}
|
|
2002
|
-
handleHostPointerleave() {
|
|
2003
|
-
this.doPointerleave();
|
|
2004
|
-
}
|
|
2005
|
-
prepareDescription() {
|
|
2006
|
-
if (this.overlay.elements.length === 0)
|
|
2007
|
-
return;
|
|
2008
|
-
const t = this.target.getRootNode(), i = this.overlay.elements[0].getRootNode(), n = this.overlay.getRootNode();
|
|
2009
|
-
t === n ? this.prepareOverlayRelativeDescription() : t === i && this.prepareContentRelativeDescription();
|
|
2010
|
-
}
|
|
2011
|
-
prepareOverlayRelativeDescription() {
|
|
2012
|
-
const t = At(
|
|
2013
|
-
this.target,
|
|
2014
|
-
"aria-describedby",
|
|
2015
|
-
[this.overlay.id]
|
|
2016
|
-
);
|
|
2017
|
-
this.releaseDescription = () => {
|
|
2018
|
-
t(), this.releaseDescription = J;
|
|
2019
|
-
};
|
|
2020
|
-
}
|
|
2021
|
-
prepareContentRelativeDescription() {
|
|
2022
|
-
const t = [], i = this.overlay.elements.map((o) => (t.push(o.id), o.id || (o.id = `${this.overlay.tagName.toLowerCase()}-helper-${Ft()}`), o.id));
|
|
2023
|
-
this.elementIds = t;
|
|
2024
|
-
const n = At(
|
|
2025
|
-
this.target,
|
|
2026
|
-
"aria-describedby",
|
|
2027
|
-
i
|
|
2028
|
-
);
|
|
2029
|
-
this.releaseDescription = () => {
|
|
2030
|
-
n(), this.overlay.elements.map((o, s) => {
|
|
2031
|
-
o.id = this.elementIds[s];
|
|
2032
|
-
}), this.releaseDescription = J;
|
|
2033
|
-
};
|
|
2034
|
-
}
|
|
2035
|
-
doPointerleave() {
|
|
2036
|
-
this.pointerentered = !1;
|
|
2037
|
-
const t = this.target;
|
|
2038
|
-
this.focusedin && t.matches(":focus-visible") || (this.hoverTimeout = setTimeout(() => {
|
|
2039
|
-
this.open = !1;
|
|
2040
|
-
}, Ci));
|
|
2041
|
-
}
|
|
2042
|
-
init() {
|
|
2043
|
-
var i;
|
|
2044
|
-
(i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
|
|
2045
|
-
const { signal: t } = this.abortController;
|
|
2046
|
-
this.target.addEventListener("keyup", (n) => this.handleKeyup(n), {
|
|
2047
|
-
signal: t
|
|
2048
|
-
}), this.target.addEventListener("focusin", () => this.handleTargetFocusin(), {
|
|
2049
|
-
signal: t
|
|
2050
|
-
}), this.target.addEventListener(
|
|
2051
|
-
"focusout",
|
|
2052
|
-
() => this.handleTargetFocusout(),
|
|
2053
|
-
{ signal: t }
|
|
2054
|
-
), this.target.addEventListener(
|
|
2055
|
-
"pointerenter",
|
|
2056
|
-
() => this.handleTargetPointerenter(),
|
|
2057
|
-
{ signal: t }
|
|
2058
|
-
), this.target.addEventListener(
|
|
2059
|
-
"pointerleave",
|
|
2060
|
-
() => this.handleTargetPointerleave(),
|
|
2061
|
-
{ signal: t }
|
|
2062
|
-
), this.overlay && this.initOverlay();
|
|
2063
|
-
}
|
|
2064
|
-
initOverlay() {
|
|
2065
|
-
if (!this.abortController)
|
|
2066
|
-
return;
|
|
2067
|
-
const { signal: t } = this.abortController;
|
|
2068
|
-
this.overlay.addEventListener(
|
|
2069
|
-
"pointerenter",
|
|
2070
|
-
() => this.handleHostPointerenter(),
|
|
2071
|
-
{ signal: t }
|
|
2072
|
-
), this.overlay.addEventListener(
|
|
2073
|
-
"pointerleave",
|
|
2074
|
-
() => this.handleHostPointerleave(),
|
|
2075
|
-
{ signal: t }
|
|
2076
|
-
);
|
|
2077
|
-
}
|
|
2078
|
-
removeSafariFocusRingClass() {
|
|
2079
|
-
Yt() && this.target.classList.contains(Tt) && this.target.classList.remove(Tt);
|
|
2080
|
-
}
|
|
2081
|
-
}
|
|
2082
|
-
const Oi = 300, Ti = {
|
|
2083
|
-
touch: "Double tap and long press for additional options",
|
|
2084
|
-
keyboard: "Press Space or Alt+Down Arrow for additional options",
|
|
2085
|
-
mouse: "Click and hold for additional options"
|
|
2086
|
-
};
|
|
2087
|
-
class Ai extends jt {
|
|
2088
|
-
constructor() {
|
|
2089
|
-
super(...arguments), this.type = lt.longpress, this.longpressState = null, this.releaseDescription = J, this.handlePointerup = () => {
|
|
2090
|
-
var t;
|
|
2091
|
-
clearTimeout(this.timeout), this.target && (this.longpressState = ((t = this.overlay) == null ? void 0 : t.state) === "opening" ? "pressed" : null, document.removeEventListener("pointerup", this.handlePointerup), document.removeEventListener("pointercancel", this.handlePointerup));
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
get activelyOpening() {
|
|
2095
|
-
return this.longpressState === "opening" || this.longpressState === "pressed";
|
|
2096
|
-
}
|
|
2097
|
-
handleLongpress() {
|
|
2098
|
-
this.open = !0, this.longpressState = this.longpressState === "potential" ? "opening" : "pressed";
|
|
2099
|
-
}
|
|
2100
|
-
handlePointerdown(t) {
|
|
2101
|
-
!this.target || t.button !== 0 || (this.longpressState = "potential", document.addEventListener("pointerup", this.handlePointerup), document.addEventListener("pointercancel", this.handlePointerup), "holdAffordance" in this.target) || (this.timeout = setTimeout(() => {
|
|
2102
|
-
this.target && this.target.dispatchEvent(
|
|
2103
|
-
new CustomEvent("longpress", {
|
|
2104
|
-
bubbles: !0,
|
|
2105
|
-
composed: !0,
|
|
2106
|
-
detail: {
|
|
2107
|
-
source: "pointer"
|
|
2108
|
-
}
|
|
2109
|
-
})
|
|
2110
|
-
);
|
|
2111
|
-
}, Oi));
|
|
2112
|
-
}
|
|
2113
|
-
handleKeydown(t) {
|
|
2114
|
-
const { code: i, altKey: n } = t;
|
|
2115
|
-
n && i === "ArrowDown" && (t.stopPropagation(), t.stopImmediatePropagation());
|
|
2116
|
-
}
|
|
2117
|
-
handleKeyup(t) {
|
|
2118
|
-
const { code: i, altKey: n } = t;
|
|
2119
|
-
if (i === "Space" || n && i === "ArrowDown") {
|
|
2120
|
-
if (!this.target)
|
|
2121
|
-
return;
|
|
2122
|
-
t.stopPropagation(), this.target.dispatchEvent(
|
|
2123
|
-
new CustomEvent("longpress", {
|
|
2124
|
-
bubbles: !0,
|
|
2125
|
-
composed: !0,
|
|
2126
|
-
detail: {
|
|
2127
|
-
source: "keyboard"
|
|
2128
|
-
}
|
|
2129
|
-
})
|
|
2130
|
-
), setTimeout(() => {
|
|
2131
|
-
this.longpressState = null;
|
|
2132
|
-
});
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
prepareDescription(t) {
|
|
2136
|
-
if (
|
|
2137
|
-
// do not reapply until target is recycled
|
|
2138
|
-
this.releaseDescription !== J || // require "longpress content" to apply relationship
|
|
2139
|
-
this.overlay.elements.length === 0
|
|
2140
|
-
)
|
|
2141
|
-
return;
|
|
2142
|
-
const i = document.createElement("div");
|
|
2143
|
-
i.id = `longpress-describedby-descriptor-${Ft()}`;
|
|
2144
|
-
const n = Ce() || Pe() ? "touch" : "keyboard";
|
|
2145
|
-
i.textContent = Ti[n], i.slot = "longpress-describedby-descriptor";
|
|
2146
|
-
const o = t.getRootNode(), s = this.overlay.getRootNode();
|
|
2147
|
-
o === s ? this.overlay.append(i) : (i.hidden = !("host" in o), t.after(i));
|
|
2148
|
-
const r = At(
|
|
2149
|
-
t,
|
|
2150
|
-
"aria-describedby",
|
|
2151
|
-
[i.id]
|
|
2152
|
-
);
|
|
2153
|
-
this.releaseDescription = () => {
|
|
2154
|
-
r(), i.remove(), this.releaseDescription = J;
|
|
2155
|
-
};
|
|
2156
|
-
}
|
|
2157
|
-
shouldCompleteOpen() {
|
|
2158
|
-
this.longpressState = this.longpressState === "pressed" ? null : this.longpressState;
|
|
2159
|
-
}
|
|
2160
|
-
init() {
|
|
2161
|
-
var i;
|
|
2162
|
-
(i = this.abortController) == null || i.abort(), this.abortController = new AbortController();
|
|
2163
|
-
const { signal: t } = this.abortController;
|
|
2164
|
-
this.target.addEventListener("longpress", () => this.handleLongpress(), {
|
|
2165
|
-
signal: t
|
|
2166
|
-
}), this.target.addEventListener(
|
|
2167
|
-
"pointerdown",
|
|
2168
|
-
(n) => this.handlePointerdown(n),
|
|
2169
|
-
{ signal: t }
|
|
2170
|
-
), this.prepareDescription(this.target), !this.target.holdAffordance && (this.target.addEventListener(
|
|
2171
|
-
"keydown",
|
|
2172
|
-
(n) => this.handleKeydown(n),
|
|
2173
|
-
{ signal: t }
|
|
2174
|
-
), this.target.addEventListener(
|
|
2175
|
-
"keyup",
|
|
2176
|
-
(n) => this.handleKeyup(n),
|
|
2177
|
-
{ signal: t }
|
|
2178
|
-
));
|
|
2179
|
-
}
|
|
2180
|
-
}
|
|
2181
|
-
const Ri = {
|
|
2182
|
-
click: xi,
|
|
2183
|
-
longpress: Ai,
|
|
2184
|
-
hover: Pi
|
|
2185
|
-
};
|
|
2186
|
-
var Di = Object.defineProperty, Li = Object.getOwnPropertyDescriptor, O = (e, t, i, n) => {
|
|
2187
|
-
for (var o = n > 1 ? void 0 : n ? Li(t, i) : t, s = e.length - 1, r; s >= 0; s--)
|
|
2188
|
-
(r = e[s]) && (o = (n ? r(t, i, o) : r(o)) || o);
|
|
2189
|
-
return n && o && Di(t, i, o), o;
|
|
2190
|
-
};
|
|
2191
|
-
const Si = "showPopover" in document.createElement("div");
|
|
2192
|
-
let mt = Le(rt);
|
|
2193
|
-
mt = Si ? Fe(mt) : Se(mt);
|
|
2194
|
-
var q;
|
|
2195
|
-
const C = (q = class extends mt {
|
|
2196
|
-
constructor() {
|
|
2197
|
-
super(...arguments), this._delayed = !1, this._disabled = !1, this.offset = 0, this._open = !1, this.lastRequestSlottableState = !1, this.receivesFocus = "auto", this._state = "closed", this.triggerElement = null, this.type = "auto", this.wasOpen = !1, this.closeOnFocusOut = (t) => {
|
|
2198
|
-
if (!t.relatedTarget)
|
|
2199
|
-
return;
|
|
2200
|
-
const i = new Event("overlay-relation-query", {
|
|
2201
|
-
bubbles: !0,
|
|
2202
|
-
composed: !0
|
|
2203
|
-
});
|
|
2204
|
-
t.relatedTarget.addEventListener(i.type, (n) => {
|
|
2205
|
-
n.composedPath().includes(this) || (this.open = !1);
|
|
2206
|
-
}), t.relatedTarget.dispatchEvent(i);
|
|
2207
|
-
};
|
|
2208
|
-
}
|
|
2209
|
-
get delayed() {
|
|
2210
|
-
var t;
|
|
2211
|
-
return ((t = this.elements.at(-1)) == null ? void 0 : t.hasAttribute("delayed")) || this._delayed;
|
|
2212
|
-
}
|
|
2213
|
-
set delayed(t) {
|
|
2214
|
-
this._delayed = t;
|
|
2215
|
-
}
|
|
2216
|
-
get disabled() {
|
|
2217
|
-
return this._disabled;
|
|
2218
|
-
}
|
|
2219
|
-
set disabled(t) {
|
|
2220
|
-
var i;
|
|
2221
|
-
this._disabled = t, t ? ((i = this.strategy) == null || i.abort(), this.wasOpen = this.open, this.open = !1) : (this.bindEvents(), this.open = this.open || this.wasOpen, this.wasOpen = !1);
|
|
2222
|
-
}
|
|
2223
|
-
/**
|
|
2224
|
-
* Determines if the overlay has a non-virtual trigger element.
|
|
2225
|
-
*
|
|
2226
|
-
* @returns `true` if the trigger element is not a virtual trigger, otherwise `false`.
|
|
2227
|
-
*/
|
|
2228
|
-
get hasNonVirtualTrigger() {
|
|
2229
|
-
return !!this.triggerElement && !(this.triggerElement instanceof bt);
|
|
2230
|
-
}
|
|
2231
|
-
/**
|
|
2232
|
-
* Provides an instance of the `PlacementController` for managing the positioning
|
|
2233
|
-
* of the overlay relative to its trigger element.
|
|
2234
|
-
*
|
|
2235
|
-
* If the `PlacementController` instance does not already exist, it is created and
|
|
2236
|
-
* assigned to the `_placementController` property.
|
|
2237
|
-
*
|
|
2238
|
-
* @protected
|
|
2239
|
-
* @returns The `PlacementController` instance.
|
|
2240
|
-
*/
|
|
2241
|
-
get placementController() {
|
|
2242
|
-
return this._placementController || (this._placementController = new Ei(this)), this._placementController;
|
|
2243
|
-
}
|
|
2244
|
-
get open() {
|
|
2245
|
-
return this._open;
|
|
2246
|
-
}
|
|
2247
|
-
set open(t) {
|
|
2248
|
-
var i;
|
|
2249
|
-
t && this.disabled || t !== this.open && ((i = this.strategy) != null && i.activelyOpening && !t || (this._open = t, this.open && (q.openCount += 1), this.requestUpdate("open", !this.open), this.open && this.requestSlottable()));
|
|
2250
|
-
}
|
|
2251
|
-
get state() {
|
|
2252
|
-
return this._state;
|
|
2253
|
-
}
|
|
2254
|
-
set state(t) {
|
|
2255
|
-
var n;
|
|
2256
|
-
if (t === this.state)
|
|
2257
|
-
return;
|
|
2258
|
-
const i = this.state;
|
|
2259
|
-
this._state = t, (this.state === "opened" || this.state === "closed") && ((n = this.strategy) == null || n.shouldCompleteOpen()), this.requestUpdate("state", i);
|
|
2260
|
-
}
|
|
2261
|
-
/**
|
|
2262
|
-
* Provides an instance of the `ElementResolutionController` for managing the element
|
|
2263
|
-
* that the overlay should be associated with. If the instance does not already exist,
|
|
2264
|
-
* it is created and assigned to the `_elementResolver` property.
|
|
2265
|
-
*
|
|
2266
|
-
* @protected
|
|
2267
|
-
* @returns The `ElementResolutionController` instance.
|
|
2268
|
-
*/
|
|
2269
|
-
get elementResolver() {
|
|
2270
|
-
return this._elementResolver || (this._elementResolver = new we(this)), this._elementResolver;
|
|
2271
|
-
}
|
|
2272
|
-
/**
|
|
2273
|
-
* Determines if the overlay uses a dialog.
|
|
2274
|
-
* Returns `true` if the overlay type is "modal" or "page".
|
|
2275
|
-
*
|
|
2276
|
-
* @private
|
|
2277
|
-
* @returns `true` if the overlay uses a dialog, otherwise `false`.
|
|
2278
|
-
*/
|
|
2279
|
-
get usesDialog() {
|
|
2280
|
-
return this.type === "modal" || this.type === "page";
|
|
2281
|
-
}
|
|
2282
|
-
/**
|
|
2283
|
-
* Determines the value for the popover attribute based on the overlay type.
|
|
2284
|
-
*
|
|
2285
|
-
* @private
|
|
2286
|
-
* @returns The popover value or undefined if not applicable.
|
|
2287
|
-
*/
|
|
2288
|
-
get popoverValue() {
|
|
2289
|
-
if ("popover" in this)
|
|
2290
|
-
switch (this.type) {
|
|
2291
|
-
case "modal":
|
|
2292
|
-
case "page":
|
|
2293
|
-
return;
|
|
2294
|
-
case "hint":
|
|
2295
|
-
return "manual";
|
|
2296
|
-
default:
|
|
2297
|
-
return this.type;
|
|
2298
|
-
}
|
|
2299
|
-
}
|
|
2300
|
-
/**
|
|
2301
|
-
* Determines if the overlay requires positioning based on its type and state.
|
|
2302
|
-
*
|
|
2303
|
-
* @protected
|
|
2304
|
-
* @returns True if the overlay requires positioning, otherwise false.
|
|
2305
|
-
*/
|
|
2306
|
-
get requiresPositioning() {
|
|
2307
|
-
return !(this.type === "page" || !this.open || !this.triggerElement || !this.placement && this.type !== "hint");
|
|
2308
|
-
}
|
|
2309
|
-
/**
|
|
2310
|
-
* Manages the positioning of the overlay relative to its trigger element.
|
|
2311
|
-
*
|
|
2312
|
-
* This method calculates the necessary parameters for positioning the overlay,
|
|
2313
|
-
* such as offset, placement, and tip padding, and then delegates the actual
|
|
2314
|
-
* positioning to the `PlacementController`.
|
|
2315
|
-
*
|
|
2316
|
-
* @protected
|
|
2317
|
-
* @override
|
|
2318
|
-
*/
|
|
2319
|
-
managePosition() {
|
|
2320
|
-
if (!this.requiresPositioning || !this.open)
|
|
2321
|
-
return;
|
|
2322
|
-
const t = this.offset || 0, i = this.triggerElement, n = this.placement || "right", o = this.tipPadding;
|
|
2323
|
-
this.placementController.placeOverlay(this.dialogEl, {
|
|
2324
|
-
offset: t,
|
|
2325
|
-
placement: n,
|
|
2326
|
-
tipPadding: o,
|
|
2327
|
-
trigger: i,
|
|
2328
|
-
type: this.type
|
|
2329
|
-
});
|
|
2330
|
-
}
|
|
2331
|
-
/**
|
|
2332
|
-
* Manages the process of opening the popover.
|
|
2333
|
-
*
|
|
2334
|
-
* This method handles the necessary steps to open the popover, including managing delays,
|
|
2335
|
-
* ensuring the popover is in the DOM, making transitions, and applying focus.
|
|
2336
|
-
*
|
|
2337
|
-
* @protected
|
|
2338
|
-
* @override
|
|
2339
|
-
* @returns A promise that resolves when the popover has been fully opened.
|
|
2340
|
-
*/
|
|
2341
|
-
async managePopoverOpen() {
|
|
2342
|
-
super.managePopoverOpen();
|
|
2343
|
-
const t = this.open;
|
|
2344
|
-
if (this.open !== t || (await this.manageDelay(t), this.open !== t) || (this.triggerInteraction === "longpress" && await R(), await this.ensureOnDOM(t), this.open !== t))
|
|
2345
|
-
return;
|
|
2346
|
-
const i = await this.makeTransition(t);
|
|
2347
|
-
this.open === t && await this.applyFocus(t, i);
|
|
2348
|
-
}
|
|
2349
|
-
/**
|
|
2350
|
-
* Applies focus to the appropriate element after the popover has been opened.
|
|
2351
|
-
*
|
|
2352
|
-
* This method handles the focus management for the overlay, ensuring that the correct
|
|
2353
|
-
* element receives focus based on the overlay's type and state.
|
|
2354
|
-
*
|
|
2355
|
-
* @protected
|
|
2356
|
-
* @override
|
|
2357
|
-
* @param targetOpenState - The target open state of the overlay.
|
|
2358
|
-
* @param focusEl - The element to focus after opening the popover.
|
|
2359
|
-
* @returns A promise that resolves when the focus has been applied.
|
|
2360
|
-
*/
|
|
2361
|
-
async applyFocus(t, i) {
|
|
2362
|
-
if (!(this.receivesFocus === "false" || this.type === "hint")) {
|
|
2363
|
-
if (await R(), await R(), t === this.open && !this.open) {
|
|
2364
|
-
this.hasNonVirtualTrigger && this.contains(this.getRootNode().activeElement) && this.triggerElement.focus();
|
|
2365
|
-
return;
|
|
2366
|
-
}
|
|
2367
|
-
i == null || i.focus();
|
|
2368
|
-
}
|
|
2369
|
-
}
|
|
2370
|
-
/**
|
|
2371
|
-
* Returns focus to the trigger element if the overlay is closed.
|
|
2372
|
-
*
|
|
2373
|
-
* This method ensures that focus is returned to the trigger element when the overlay is closed,
|
|
2374
|
-
* unless the overlay is of type "hint" or the focus is already outside the overlay.
|
|
2375
|
-
*
|
|
2376
|
-
* @protected
|
|
2377
|
-
* @override
|
|
2378
|
-
*/
|
|
2379
|
-
returnFocus() {
|
|
2380
|
-
var i;
|
|
2381
|
-
if (this.open || this.type === "hint")
|
|
2382
|
-
return;
|
|
2383
|
-
const t = () => {
|
|
2384
|
-
var s, r;
|
|
2385
|
-
const n = [];
|
|
2386
|
-
let o = document.activeElement;
|
|
2387
|
-
for (; (s = o == null ? void 0 : o.shadowRoot) != null && s.activeElement; )
|
|
2388
|
-
o = o.shadowRoot.activeElement;
|
|
2389
|
-
for (; o; ) {
|
|
2390
|
-
const a = o.assignedSlot || o.parentElement || ((r = o.getRootNode()) == null ? void 0 : r.host);
|
|
2391
|
-
a && n.push(a), o = a;
|
|
2392
|
-
}
|
|
2393
|
-
return n;
|
|
2394
|
-
};
|
|
2395
|
-
this.receivesFocus !== "false" && ((i = this.triggerElement) != null && i.focus) && (this.contains(this.getRootNode().activeElement) || t().includes(this) || document.activeElement === document.body) && this.triggerElement.focus();
|
|
2396
|
-
}
|
|
2397
|
-
/**
|
|
2398
|
-
* Manages the process of opening or closing the overlay.
|
|
2399
|
-
*
|
|
2400
|
-
* This method handles the necessary steps to open or close the overlay, including updating the state,
|
|
2401
|
-
* managing the overlay stack, and handling focus events.
|
|
2402
|
-
*
|
|
2403
|
-
* @protected
|
|
2404
|
-
* @param oldOpen - The previous open state of the overlay.
|
|
2405
|
-
* @returns A promise that resolves when the overlay has been fully managed.
|
|
2406
|
-
*/
|
|
2407
|
-
async manageOpen(t) {
|
|
2408
|
-
if (!(!this.isConnected && this.open) && (this.hasUpdated || await this.updateComplete, this.open ? (Xt.add(this), this.willPreventClose && (document.addEventListener(
|
|
2409
|
-
"pointerup",
|
|
2410
|
-
() => {
|
|
2411
|
-
this.dialogEl.classList.toggle("not-immediately-closable", !1), this.willPreventClose = !1;
|
|
2412
|
-
},
|
|
2413
|
-
{ once: !0 }
|
|
2414
|
-
), this.dialogEl.classList.toggle("not-immediately-closable", !0))) : (t && this.dispose(), Xt.remove(this)), this.open && this.state !== "opened" ? this.state = "opening" : !this.open && this.state !== "closed" && (this.state = "closing"), this.usesDialog ? this.manageDialogOpen() : this.managePopoverOpen(), this.type === "auto")) {
|
|
2415
|
-
const i = this.getRootNode();
|
|
2416
|
-
this.open ? i.addEventListener("focusout", this.closeOnFocusOut, {
|
|
2417
|
-
capture: !0
|
|
2418
|
-
}) : i.removeEventListener("focusout", this.closeOnFocusOut, {
|
|
2419
|
-
capture: !0
|
|
2420
|
-
});
|
|
2421
|
-
}
|
|
2422
|
-
}
|
|
2423
|
-
/**
|
|
2424
|
-
* Binds event handling strategies to the overlay based on the specified trigger interaction.
|
|
2425
|
-
*
|
|
2426
|
-
* This method sets up the appropriate event handling strategy for the overlay, ensuring that
|
|
2427
|
-
* it responds correctly to user interactions such as clicks, hovers, or long presses.
|
|
2428
|
-
*
|
|
2429
|
-
* @protected
|
|
2430
|
-
*/
|
|
2431
|
-
bindEvents() {
|
|
2432
|
-
var t;
|
|
2433
|
-
(t = this.strategy) == null || t.abort(), this.strategy = void 0, this.hasNonVirtualTrigger && this.triggerInteraction && (this.strategy = new Ri[this.triggerInteraction](
|
|
2434
|
-
this.triggerElement,
|
|
2435
|
-
{
|
|
2436
|
-
overlay: this
|
|
2437
|
-
}
|
|
2438
|
-
));
|
|
2439
|
-
}
|
|
2440
|
-
/**
|
|
2441
|
-
* Handles the `beforetoggle` event to manage the overlay's state.
|
|
2442
|
-
*
|
|
2443
|
-
* This method checks the new state of the event and calls `handleBrowserClose`
|
|
2444
|
-
* if the new state is not 'open'.
|
|
2445
|
-
*
|
|
2446
|
-
* @protected
|
|
2447
|
-
* @param event - The `beforetoggle` event with the new state.
|
|
2448
|
-
*/
|
|
2449
|
-
handleBeforetoggle(t) {
|
|
2450
|
-
t.newState !== "open" && this.handleBrowserClose(t);
|
|
2451
|
-
}
|
|
2452
|
-
/**
|
|
2453
|
-
* Handles the browser's close event to manage the overlay's state.
|
|
2454
|
-
*
|
|
2455
|
-
* This method stops the propagation of the event and closes the overlay if it is not
|
|
2456
|
-
* actively opening. If the overlay is actively opening, it calls `manuallyKeepOpen`.
|
|
2457
|
-
*
|
|
2458
|
-
* @protected
|
|
2459
|
-
* @param event - The browser's close event.
|
|
2460
|
-
*/
|
|
2461
|
-
handleBrowserClose(t) {
|
|
2462
|
-
var i;
|
|
2463
|
-
if (t.stopPropagation(), !((i = this.strategy) != null && i.activelyOpening)) {
|
|
2464
|
-
this.open = !1;
|
|
2465
|
-
return;
|
|
2466
|
-
}
|
|
2467
|
-
this.manuallyKeepOpen();
|
|
2468
|
-
}
|
|
2469
|
-
/**
|
|
2470
|
-
* Manually keeps the overlay open.
|
|
2471
|
-
*
|
|
2472
|
-
* This method sets the overlay to open, allows placement updates, and manages the open state.
|
|
2473
|
-
*
|
|
2474
|
-
* @public
|
|
2475
|
-
* @override
|
|
2476
|
-
*/
|
|
2477
|
-
manuallyKeepOpen() {
|
|
2478
|
-
this.open = !0, this.placementController.allowPlacementUpdate = !0, this.manageOpen(!1);
|
|
2479
|
-
}
|
|
2480
|
-
/**
|
|
2481
|
-
* Handles the `slotchange` event to manage the overlay's state.
|
|
2482
|
-
*
|
|
2483
|
-
* This method checks if there are any elements in the slot. If there are no elements,
|
|
2484
|
-
* it releases the description from the strategy. If there are elements and the trigger
|
|
2485
|
-
* is non-virtual, it prepares the description for the trigger element.
|
|
2486
|
-
*
|
|
2487
|
-
* @protected
|
|
2488
|
-
*/
|
|
2489
|
-
handleSlotchange() {
|
|
2490
|
-
var t, i;
|
|
2491
|
-
this.elements.length === 0 ? (t = this.strategy) == null || t.releaseDescription() : this.hasNonVirtualTrigger && ((i = this.strategy) == null || i.prepareDescription(this.triggerElement));
|
|
2492
|
-
}
|
|
2493
|
-
/**
|
|
2494
|
-
* Determines whether the overlay should prevent closing.
|
|
2495
|
-
*
|
|
2496
|
-
* This method checks the `willPreventClose` flag and resets it to `false`.
|
|
2497
|
-
* It returns the value of the `willPreventClose` flag.
|
|
2498
|
-
*
|
|
2499
|
-
* @public
|
|
2500
|
-
* @returns `true` if the overlay should prevent closing, otherwise `false`.
|
|
2501
|
-
*/
|
|
2502
|
-
shouldPreventClose() {
|
|
2503
|
-
const t = this.willPreventClose;
|
|
2504
|
-
return this.willPreventClose = !1, t;
|
|
2505
|
-
}
|
|
2506
|
-
/**
|
|
2507
|
-
* Requests slottable content for the overlay.
|
|
2508
|
-
*
|
|
2509
|
-
* This method dispatches a `SlottableRequestEvent` to request or remove slottable content
|
|
2510
|
-
* based on the current open state of the overlay. It ensures that the same state is not
|
|
2511
|
-
* dispatched twice in a row.
|
|
2512
|
-
*
|
|
2513
|
-
* @protected
|
|
2514
|
-
* @override
|
|
2515
|
-
*/
|
|
2516
|
-
requestSlottable() {
|
|
2517
|
-
this.lastRequestSlottableState !== this.open && (this.open || document.body.offsetHeight, this.dispatchEvent(
|
|
2518
|
-
new Ee(
|
|
2519
|
-
"overlay-content",
|
|
2520
|
-
this.open ? {} : xe
|
|
2521
|
-
)
|
|
2522
|
-
), this.lastRequestSlottableState = this.open);
|
|
2523
|
-
}
|
|
2524
|
-
/**
|
|
2525
|
-
* Lifecycle method called before the component updates.
|
|
2526
|
-
*
|
|
2527
|
-
* This method handles various tasks before the component updates, such as setting an ID,
|
|
2528
|
-
* managing the open state, resolving the trigger element, and binding events.
|
|
2529
|
-
*
|
|
2530
|
-
* @override
|
|
2531
|
-
* @param changes - The properties that have changed.
|
|
2532
|
-
*/
|
|
2533
|
-
willUpdate(t) {
|
|
2534
|
-
var n;
|
|
2535
|
-
if (this.hasAttribute("id") || this.setAttribute("id", `${this.tagName.toLowerCase()}-${Ft()}`), t.has("open") && (this.hasUpdated || this.open) && this.manageOpen(t.get("open")), t.has("trigger")) {
|
|
2536
|
-
const [o, s] = ((n = this.trigger) == null ? void 0 : n.split("@")) || [];
|
|
2537
|
-
this.elementResolver.selector = o ? `#${o}` : "", this.triggerInteraction = s;
|
|
2538
|
-
}
|
|
2539
|
-
let i = !1;
|
|
2540
|
-
t.has(be) && (i = this.triggerElement, this.triggerElement = this.elementResolver.element), t.has("triggerElement") && (i = t.get("triggerElement")), i !== !1 && this.bindEvents();
|
|
2541
|
-
}
|
|
2542
|
-
/**
|
|
2543
|
-
* Lifecycle method called after the component updates.
|
|
2544
|
-
*
|
|
2545
|
-
* This method handles various tasks after the component updates, such as updating the placement
|
|
2546
|
-
* attribute, resetting the overlay position, and clearing the overlay position based on the state.
|
|
2547
|
-
*
|
|
2548
|
-
* @override
|
|
2549
|
-
* @param changes - The properties that have changed.
|
|
2550
|
-
*/
|
|
2551
|
-
updated(t) {
|
|
2552
|
-
super.updated(t), t.has("placement") && (this.placement ? this.dialogEl.setAttribute("actual-placement", this.placement) : this.dialogEl.removeAttribute("actual-placement"), this.open && t.get("placement") !== void 0 && this.placementController.resetOverlayPosition()), t.has("state") && this.state === "closed" && t.get("state") !== void 0 && this.placementController.clearOverlayPosition();
|
|
2553
|
-
}
|
|
2554
|
-
/**
|
|
2555
|
-
* Renders the content of the overlay.
|
|
2556
|
-
*
|
|
2557
|
-
* This method returns a template result containing a slot element. The slot element
|
|
2558
|
-
* listens for the `slotchange` event to manage the overlay's state.
|
|
2559
|
-
*
|
|
2560
|
-
* @protected
|
|
2561
|
-
* @returns The template result containing the slot element.
|
|
2562
|
-
*/
|
|
2563
|
-
renderContent() {
|
|
2564
|
-
return dt` <slot @slotchange=${this.handleSlotchange}></slot> `;
|
|
2565
|
-
}
|
|
2566
|
-
/**
|
|
2567
|
-
* Generates a style map for the dialog element.
|
|
2568
|
-
*
|
|
2569
|
-
* This method returns an object containing CSS custom properties for the dialog element.
|
|
2570
|
-
* The `--luzmo-overlay-open-count` custom property is set to the current open count of overlays.
|
|
2571
|
-
*
|
|
2572
|
-
* @private
|
|
2573
|
-
* @returns The style map for the dialog element.
|
|
2574
|
-
*/
|
|
2575
|
-
get dialogStyleMap() {
|
|
2576
|
-
return {
|
|
2577
|
-
"--luzmo-overlay-open-count": q.openCount.toString()
|
|
2578
|
-
};
|
|
2579
|
-
}
|
|
2580
|
-
/**
|
|
2581
|
-
* Renders the dialog element for the overlay.
|
|
2582
|
-
*
|
|
2583
|
-
* This method returns a template result containing a dialog element. The dialog element
|
|
2584
|
-
* includes various attributes and event listeners to manage the overlay's state and behavior.
|
|
2585
|
-
*
|
|
2586
|
-
* @protected
|
|
2587
|
-
* @returns The template result containing the dialog element.
|
|
2588
|
-
*/
|
|
2589
|
-
renderDialog() {
|
|
2590
|
-
return dt`
|
|
2591
|
-
<dialog
|
|
2592
|
-
class="dialog"
|
|
2593
|
-
part="dialog"
|
|
2594
|
-
placement=${Pt(
|
|
2595
|
-
this.requiresPositioning ? this.placement || "right" : void 0
|
|
2596
|
-
)}
|
|
2597
|
-
style=${Kt(this.dialogStyleMap)}
|
|
2598
|
-
@close=${this.handleBrowserClose}
|
|
2599
|
-
@cancel=${this.handleBrowserClose}
|
|
2600
|
-
@beforetoggle=${this.handleBeforetoggle}
|
|
2601
|
-
?is-visible=${this.state !== "closed"}
|
|
2602
|
-
>
|
|
2603
|
-
${this.renderContent()}
|
|
2604
|
-
</dialog>
|
|
2605
|
-
`;
|
|
2606
|
-
}
|
|
2607
|
-
/**
|
|
2608
|
-
* Renders the popover element for the overlay.
|
|
2609
|
-
*
|
|
2610
|
-
* This method returns a template result containing a div element styled as a popover.
|
|
2611
|
-
* The popover element includes various attributes and event listeners to manage the overlay's state and behavior.
|
|
2612
|
-
*
|
|
2613
|
-
* @protected
|
|
2614
|
-
* @returns The template result containing the popover element.
|
|
2615
|
-
*/
|
|
2616
|
-
renderPopover() {
|
|
2617
|
-
return dt`
|
|
2618
|
-
<div
|
|
2619
|
-
class="dialog"
|
|
2620
|
-
part="dialog"
|
|
2621
|
-
placement=${Pt(
|
|
2622
|
-
this.requiresPositioning ? this.placement || "right" : void 0
|
|
2623
|
-
)}
|
|
2624
|
-
popover=${Pt(this.popoverValue)}
|
|
2625
|
-
style=${Kt(this.dialogStyleMap)}
|
|
2626
|
-
@beforetoggle=${this.handleBeforetoggle}
|
|
2627
|
-
@close=${this.handleBrowserClose}
|
|
2628
|
-
?is-visible=${this.state !== "closed"}
|
|
2629
|
-
>
|
|
2630
|
-
${this.renderContent()}
|
|
2631
|
-
</div>
|
|
2632
|
-
`;
|
|
2633
|
-
}
|
|
2634
|
-
/**
|
|
2635
|
-
* Renders the overlay component.
|
|
2636
|
-
*
|
|
2637
|
-
* This method returns a template result containing either a dialog or popover element
|
|
2638
|
-
* based on the overlay type. It also includes a slot for longpress descriptors.
|
|
2639
|
-
*
|
|
2640
|
-
* @override
|
|
2641
|
-
* @returns The template result containing the overlay content.
|
|
2642
|
-
*/
|
|
2643
|
-
render() {
|
|
2644
|
-
const t = this.type === "modal" || this.type === "page";
|
|
2645
|
-
return dt`
|
|
2646
|
-
${t ? this.renderDialog() : this.renderPopover()}
|
|
2647
|
-
<slot name="longpress-describedby-descriptor"></slot>
|
|
2648
|
-
`;
|
|
2649
|
-
}
|
|
2650
|
-
/**
|
|
2651
|
-
* Lifecycle method called when the component is added to the DOM.
|
|
2652
|
-
*
|
|
2653
|
-
* This method sets up event listeners and binds events if the component has already updated.
|
|
2654
|
-
*
|
|
2655
|
-
* @override
|
|
2656
|
-
*/
|
|
2657
|
-
connectedCallback() {
|
|
2658
|
-
super.connectedCallback(), this.addEventListener("close", () => {
|
|
2659
|
-
this.open = !1;
|
|
2660
|
-
}), this.hasUpdated && this.bindEvents();
|
|
2661
|
-
}
|
|
2662
|
-
/**
|
|
2663
|
-
* Lifecycle method called when the component is removed from the DOM.
|
|
2664
|
-
*
|
|
2665
|
-
* This method releases the description from the strategy and updates the 'open' property.
|
|
2666
|
-
*
|
|
2667
|
-
* @override
|
|
2668
|
-
*/
|
|
2669
|
-
disconnectedCallback() {
|
|
2670
|
-
var t;
|
|
2671
|
-
(t = this.strategy) == null || t.releaseDescription(), this.open = !1, super.disconnectedCallback();
|
|
2672
|
-
}
|
|
2673
|
-
}, q.styles = [ge(_e)], q.openCount = 1, q);
|
|
2674
|
-
O([
|
|
2675
|
-
z({ type: Boolean })
|
|
2676
|
-
], C.prototype, "delayed", 1);
|
|
2677
|
-
O([
|
|
2678
|
-
ne(".dialog")
|
|
2679
|
-
], C.prototype, "dialogEl", 2);
|
|
2680
|
-
O([
|
|
2681
|
-
z({ type: Boolean })
|
|
2682
|
-
], C.prototype, "disabled", 1);
|
|
2683
|
-
O([
|
|
2684
|
-
ye({
|
|
2685
|
-
flatten: !0,
|
|
2686
|
-
selector: ':not([slot="longpress-describedby-descriptor"], slot)'
|
|
2687
|
-
})
|
|
2688
|
-
], C.prototype, "elements", 2);
|
|
2689
|
-
O([
|
|
2690
|
-
z({ type: Number })
|
|
2691
|
-
], C.prototype, "offset", 2);
|
|
2692
|
-
O([
|
|
2693
|
-
z({ type: Boolean, reflect: !0 })
|
|
2694
|
-
], C.prototype, "open", 1);
|
|
2695
|
-
O([
|
|
2696
|
-
z()
|
|
2697
|
-
], C.prototype, "placement", 2);
|
|
2698
|
-
O([
|
|
2699
|
-
z({ attribute: "receives-focus" })
|
|
2700
|
-
], C.prototype, "receivesFocus", 2);
|
|
2701
|
-
O([
|
|
2702
|
-
ne("slot")
|
|
2703
|
-
], C.prototype, "slotEl", 2);
|
|
2704
|
-
O([
|
|
2705
|
-
ve()
|
|
2706
|
-
], C.prototype, "state", 1);
|
|
2707
|
-
O([
|
|
2708
|
-
z({ type: Number, attribute: "tip-padding" })
|
|
2709
|
-
], C.prototype, "tipPadding", 2);
|
|
2710
|
-
O([
|
|
2711
|
-
z()
|
|
2712
|
-
], C.prototype, "trigger", 2);
|
|
2713
|
-
O([
|
|
2714
|
-
z({ attribute: !1 })
|
|
2715
|
-
], C.prototype, "triggerElement", 2);
|
|
2716
|
-
O([
|
|
2717
|
-
z({ attribute: !1 })
|
|
2718
|
-
], C.prototype, "triggerInteraction", 2);
|
|
2719
|
-
O([
|
|
2720
|
-
z()
|
|
2721
|
-
], C.prototype, "type", 2);
|
|
2722
|
-
let ki = C;
|
|
2723
|
-
const kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2724
|
-
__proto__: null,
|
|
2725
|
-
LuzmoOverlay: ki
|
|
2726
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
2727
|
-
export {
|
|
2728
|
-
xi as C,
|
|
2729
|
-
Pi as H,
|
|
2730
|
-
lt as I,
|
|
2731
|
-
rt as L,
|
|
2732
|
-
Ei as P,
|
|
2733
|
-
Tt as S,
|
|
2734
|
-
bt as V,
|
|
2735
|
-
R as a,
|
|
2736
|
-
jt as b,
|
|
2737
|
-
Ti as c,
|
|
2738
|
-
Ai as d,
|
|
2739
|
-
ki as e,
|
|
2740
|
-
kt as f,
|
|
2741
|
-
zt as g,
|
|
2742
|
-
St as l,
|
|
2743
|
-
J as n,
|
|
2744
|
-
gt as o,
|
|
2745
|
-
Ui as p,
|
|
2746
|
-
Ri as s
|
|
2747
|
-
};
|