@pubinfo/module-rbac 2.1.10-beta.2 → 2.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ComponentSelect-A7uGTuHW.js +3498 -0
- package/dist/{DynamicRoutesForm-DP_sq_Uu.js → DynamicRoutesForm-DSzy_bh5.js} +43 -42
- package/dist/HCheckList-ODQHidN8.js +37 -0
- package/dist/HoverCard-CmJCoa2b.js +44 -0
- package/dist/{IconSelect-CiLpc63Z.js → IconSelect-DouEg3xY.js} +89 -88
- package/dist/ImportExport-DisdLoY8.js +342 -0
- package/dist/{LayoutForm-Cp4bBrYl.js → LayoutForm-Bdfs5WeK.js} +35 -34
- package/dist/{MetaForm-CVSgktB_.js → MetaForm-CcDwS8vh.js} +6128 -6143
- package/dist/{OrgAndPosition-ClASobEv.js → OrgAndPosition-jDX7m0HD.js} +61 -60
- package/dist/{ResourceEdit-w8qh1MFO.js → ResourceEdit-0BYZRye_.js} +128 -127
- package/dist/{ResourceRelation-ChEwIbWM.js → ResourceRelation-CU-QpUhP.js} +25 -25
- package/dist/{ResourceRelation-D_j898zp.js → ResourceRelation-roz0a8Td.js} +35 -34
- package/dist/{RoleRelation-DzyVn5dk.js → RoleRelation-BQQFaum0.js} +28 -27
- package/dist/{RoleSelector-Cd6_RUsc.js → RoleSelector-gkar_UGG.js} +89 -89
- package/dist/{TenantEdit-BOvXk7BZ.js → TenantEdit-BsahDUlf.js} +94 -93
- package/dist/{UserAuthorization-DLeivbs7.js → UserAuthorization-2Fl4IGw7.js} +81 -80
- package/dist/{UserEdit-YKS1FVW_.js → UserEdit-CX3Qau8T.js} +102 -101
- package/dist/{animation_item-BU-LInxP.js → animation_item-DBOz2rcX.js} +20 -22
- package/dist/{blackWhiteList-CNQltBqC.js → blackWhiteList-DbG7JH8n.js} +69 -69
- package/dist/blackWhiteList.css +1 -1
- package/dist/breadcrumb_setting-DTR6CPZQ.js +108 -0
- package/dist/{browserType-Dn_hQtAN.js → browserType-B8A1Osvk.js} +11 -10
- package/dist/chunk-DiMWNkAf.js +18 -0
- package/dist/cloneDeep-CSOSavu3.js +6 -0
- package/dist/components/GroupSelector/index.vue.d.ts +7 -1
- package/dist/components/ResourceIcones/Select.vue.d.ts +2 -1
- package/dist/components/ResourceSelector/index.vue.d.ts +7 -1
- package/dist/components/RoleSelector/RoleSearch.vue.d.ts +9 -1
- package/dist/components/RoleSelector/RoleSelector.vue.d.ts +7 -1
- package/dist/{createAndEditDataPermission-CaOBJgoV.js → createAndEditDataPermission-8_KNLzJT.js} +49 -48
- package/dist/createAndEditDataPermission.css +1 -1
- package/dist/{data-permission-ZRQ-Aoib.js → data-permission-LpuDLDm0.js} +41 -41
- package/dist/{dayjs.min-sGDSMYRj.js → dayjs.min-Cb7gQFd4.js} +1 -1
- package/dist/{dictionary-CtGgtPfc.js → dictionary-CEaxjqZe.js} +46 -46
- package/dist/drawerBlackWhiteList-DXLdWurZ.js +120 -0
- package/dist/drawerDictionary-DYJTAZr6.js +126 -0
- package/dist/drawerDictionaryItem-BChXD2-q.js +138 -0
- package/dist/{drawerGroup-DEuiiDPP.js → drawerGroup-CdnZkZxi.js} +67 -66
- package/dist/drawerOrganization-CwtSFUj0.js +247 -0
- package/dist/drawerPosition-CfyfeQCN.js +166 -0
- package/dist/drawerRegion-DAwY_29K.js +183 -0
- package/dist/drawerRole-B7uCfHk-.js +154 -0
- package/dist/{drawerRole-Dv61PBZR.js → drawerRole-DK6DrinO.js} +77 -76
- package/dist/{drawerRole-DNDyOvXw.js → drawerRole-DrzMHL0O.js} +69 -68
- package/dist/{group-BbkZjv5e.js → group-CaOhkh72.js} +48 -48
- package/dist/group.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +613 -689
- package/dist/isEmpty-BjEzPyCa.js +12 -0
- package/dist/{itemlist-By-FV6pN.js → itemlist-CFwRUV2Y.js} +44 -44
- package/dist/json-asset-03f0a035.json +1 -0
- package/dist/json-asset-0ee63e7f.json +1 -0
- package/dist/json-asset-10eef4fe.json +1 -0
- package/dist/json-asset-13f452f1.json +1 -0
- package/dist/json-asset-14b7b290.json +1 -0
- package/dist/json-asset-15b8cef1.json +1 -0
- package/dist/json-asset-15f77960.json +1 -0
- package/dist/json-asset-1ae9b726.json +1 -0
- package/dist/json-asset-1b02359f.json +1 -0
- package/dist/json-asset-1ef286cd.json +1 -0
- package/dist/json-asset-23cfd18c.json +1 -0
- package/dist/json-asset-265a0a5d.json +1 -0
- package/dist/json-asset-28d57c49.json +1 -0
- package/dist/json-asset-2b54ed10.json +1 -0
- package/dist/json-asset-2bb6f642.json +1 -0
- package/dist/json-asset-2cdc07bd.json +1 -0
- package/dist/json-asset-31c58607.json +1 -0
- package/dist/json-asset-32884f23.json +1 -0
- package/dist/json-asset-32fca43a.json +1 -0
- package/dist/json-asset-3a75445b.json +1 -0
- package/dist/json-asset-3f27d67c.json +1 -0
- package/dist/json-asset-4189453f.json +1 -0
- package/dist/json-asset-4702b37c.json +1 -0
- package/dist/json-asset-520a5c68.json +1 -0
- package/dist/json-asset-56bea508.json +1 -0
- package/dist/json-asset-57c732a3.json +1 -0
- package/dist/json-asset-5be4a28f.json +1 -0
- package/dist/json-asset-5e6d7cfa.json +1 -0
- package/dist/json-asset-64e176c9.json +1 -0
- package/dist/json-asset-6583dca6.json +1 -0
- package/dist/json-asset-66c640c6.json +1 -0
- package/dist/json-asset-68393156.json +1 -0
- package/dist/json-asset-688465aa.json +1 -0
- package/dist/json-asset-6bf334f4.json +1 -0
- package/dist/json-asset-7b4f72ce.json +1 -0
- package/dist/json-asset-837ec087.json +1 -0
- package/dist/json-asset-838ac1ba.json +1 -0
- package/dist/json-asset-8465c2cf.json +1 -0
- package/dist/json-asset-9e9f04a4.json +1 -0
- package/dist/json-asset-a13964cb.json +1 -0
- package/dist/json-asset-ab93a057.json +1 -0
- package/dist/json-asset-abe308fc.json +1 -0
- package/dist/json-asset-b24f2cd3.json +1 -0
- package/dist/json-asset-bf00eaed.json +1 -0
- package/dist/json-asset-cb22efd7.json +1 -0
- package/dist/json-asset-cb953f20.json +1 -0
- package/dist/json-asset-cc209e34.json +1 -0
- package/dist/json-asset-cfdffceb.json +1 -0
- package/dist/json-asset-d33c0299.json +1 -0
- package/dist/json-asset-d430c8ca.json +1 -0
- package/dist/json-asset-d8cfa560.json +1 -0
- package/dist/json-asset-da91beb6.json +1 -0
- package/dist/json-asset-e2bdf85c.json +1 -0
- package/dist/json-asset-e34ad826.json +1 -0
- package/dist/json-asset-e80720aa.json +1 -0
- package/dist/json-asset-e894bc92.json +1 -0
- package/dist/json-asset-f28020f2.json +1 -0
- package/dist/json-asset-f71ebbf4.json +1 -0
- package/dist/json-asset-fb1f4917.json +1 -0
- package/dist/json-asset-ff2e97c4.json +1 -0
- package/dist/{layout_setting-BUAgQ1Bk.js → layout_setting-79srmFgJ.js} +11 -11
- package/dist/layout_setting.css +1 -1
- package/dist/{log-vjU7aBPR.js → log-BYris9iT.js} +6 -6
- package/dist/{loginHistoryDetail-C7GT2yME.js → loginHistoryDetail-CZnfmbbM.js} +24 -23
- package/dist/{login_history-D08W00Qu.js → login_history-BiwaLpxA.js} +33 -33
- package/dist/login_history.css +1 -1
- package/dist/menu_setting-C2GciMXz.js +155 -0
- package/dist/not-data-Bml86wdH.js +3 -0
- package/dist/{operateHistoryDetail-BaNJRfwy.js → operateHistoryDetail-HId-EZzy.js} +27 -26
- package/dist/{operate_history-kJwIuPg2.js → operate_history-sPd9IHMV.js} +33 -33
- package/dist/operate_history.css +1 -1
- package/dist/{organization-Cmj3DUXl.js → organization-Dv3FbKke.js} +1438 -1444
- package/dist/organization.css +1 -1
- package/dist/other_setting-oVuhA70c.js +213 -0
- package/dist/other_setting.css +1 -1
- package/dist/page_animation_setting-D0CtzyOZ.js +108 -0
- package/dist/page_animation_setting.css +1 -1
- package/dist/{page_w_setting-CD_HtSUv.js → page_w_setting-Q--ct16C.js} +11 -11
- package/dist/page_w_setting.css +1 -1
- package/dist/{position-CLpbgKGj.js → position-CCZ2MSMP.js} +41 -41
- package/dist/{region-Dd9pt_Si.js → region-D3mjqB8H.js} +62 -62
- package/dist/{resource-C7dXB0EE.js → resource-DaQ7CvM_.js} +69 -69
- package/dist/{role-JGtvRObt.js → role-4UgEw3nH.js} +49 -49
- package/dist/{role_group-CKOb_m63.js → role_group-hkRlCnyl.js} +41 -41
- package/dist/{safe_setting-G_ZP-jWQ.js → safe_setting-4fv3qNRZ.js} +85 -85
- package/dist/{setItem-yKhjmUh0.js → setItem-Vkcwkj-O.js} +33 -32
- package/dist/setItem.css +1 -1
- package/dist/tabbar_setting-DhrW4Jj5.js +139 -0
- package/dist/{tenant-BBiCJkU_.js → tenant-lWfGw2u1.js} +48 -48
- package/dist/{theme_setting-vhNDLlkc.js → theme_setting-CEb7UYQO.js} +47 -47
- package/dist/theme_setting.css +1 -1
- package/dist/toolbar_setting-znESrYgi.js +140 -0
- package/dist/useAppAndResource-B7FmNfKG.js +52 -0
- package/dist/{user-DvCyUhZW.js → user-BkUpcQC8.js} +96 -96
- package/dist/{vanilla-picker-DcG96G63.js → vanilla-picker-Byb6q187.js} +239 -239
- package/dist/views/blackWhiteList/components/drawerBlackWhiteList.vue.d.ts +5 -1
- package/dist/views/components/setItem.vue.d.ts +5 -1
- package/dist/views/data-permission/components/createAndEditDataPermission.vue.d.ts +5 -1
- package/dist/views/dictionary/components/drawerDictionary.vue.d.ts +5 -1
- package/dist/views/dictionary/components/drawerDictionaryItem.vue.d.ts +5 -1
- package/dist/views/group/components/drawerGroup.vue.d.ts +5 -1
- package/dist/views/log_center/components/loginHistoryDetail.vue.d.ts +8 -1
- package/dist/views/log_center/components/operateHistoryDetail.vue.d.ts +8 -1
- package/dist/views/organization/components/drawerOrganization.vue.d.ts +5 -1
- package/dist/views/organization/components/drawerRole.vue.d.ts +5 -1
- package/dist/views/other_setting/interface.d.ts +1 -2
- package/dist/views/position/components/drawerPosition.vue.d.ts +5 -1
- package/dist/views/region/components/drawerRegion.vue.d.ts +5 -1
- package/dist/views/resource/components/ImportExport.vue.d.ts +5 -1
- package/dist/views/resource/components/ResourceEdit.vue.d.ts +5 -1
- package/dist/views/role/components/drawerRole.vue.d.ts +5 -1
- package/dist/views/role_group/components/drawerRole.vue.d.ts +5 -1
- package/dist/views/tenant/components/TenantEdit.vue.d.ts +5 -1
- package/dist/views/user/components/UserAuthorization.vue.d.ts +5 -1
- package/dist/views/user/components/UserEdit.vue.d.ts +5 -1
- package/dist/watermark_setting-DYirSIAn.js +191 -0
- package/dist/watermark_setting.css +1 -1
- package/package.json +13 -13
- package/src/views/other_setting/index.vue +2 -2
- package/src/views/other_setting/interface.ts +1 -1
- package/dist/ComponentSelect-D0OCk6H1.js +0 -3572
- package/dist/ComponentSelect-WO-3S5rH.js +0 -2
- package/dist/DynamicRoutesForm-DjZ3eVLW.js +0 -4
- package/dist/HCheckList-B5Qk_HBI.js +0 -2
- package/dist/HCheckList-DLBewmPw.js +0 -36
- package/dist/HoverCard-69ZIOivd.js +0 -2
- package/dist/HoverCard-BDFcxxvk.js +0 -43
- package/dist/IconSelect-C_Gj5G4I.js +0 -3
- package/dist/ImportExport-CL5uPlby.js +0 -342
- package/dist/ImportExport-CPy2rvv7.js +0 -4
- package/dist/LayoutForm-QFjwakyQ.js +0 -4
- package/dist/MetaForm-Bb-um1Zo.js +0 -4
- package/dist/OrgAndPosition-DoiGY5xb.js +0 -2
- package/dist/ResourceEdit-BTaNdwC_.js +0 -10
- package/dist/ResourceRelation-BIOzTOKA.js +0 -2
- package/dist/RoleRelation-CyTcqRfZ.js +0 -2
- package/dist/TenantEdit-BlMmL6q5.js +0 -2
- package/dist/UserAuthorization-qGr1Sdat.js +0 -3
- package/dist/UserEdit-CwfyqNWf.js +0 -3
- package/dist/animation_item-GzGItm3s.js +0 -2
- package/dist/breadcrumb_setting-Ds-XJRR1.js +0 -108
- package/dist/browserType-BXTT4j6i.js +0 -2
- package/dist/chunk-Cpsc_9al.js +0 -18
- package/dist/cloneDeep-DDAtsK42.js +0 -7
- package/dist/createAndEditDataPermission-CChlLDUm.js +0 -5
- package/dist/drawerBlackWhiteList-BqIDyn2Q.js +0 -2
- package/dist/drawerBlackWhiteList-CkbZ_9PZ.js +0 -119
- package/dist/drawerDictionary-D911w7pC.js +0 -2
- package/dist/drawerDictionary-dMHs-6Cw.js +0 -125
- package/dist/drawerDictionaryItem-CbTa_qL-.js +0 -137
- package/dist/drawerDictionaryItem-DLUI5Yuc.js +0 -2
- package/dist/drawerGroup-CEEDMBg9.js +0 -3
- package/dist/drawerOrganization-CqEMD3gE.js +0 -246
- package/dist/drawerOrganization-mks5NMd9.js +0 -2
- package/dist/drawerPosition-Bd0s7qze.js +0 -165
- package/dist/drawerPosition-DwlTrlGA.js +0 -2
- package/dist/drawerRegion-DUbQAZuV.js +0 -182
- package/dist/drawerRegion-DwVzsZfT.js +0 -2
- package/dist/drawerRole-BNrbcSmr.js +0 -3
- package/dist/drawerRole-BxUIekjh.js +0 -3
- package/dist/drawerRole-CyA2oFht.js +0 -4
- package/dist/drawerRole-D5X7oHB_.js +0 -153
- package/dist/isEmpty-BvRqbmpu.js +0 -13
- package/dist/loginHistoryDetail-CkH5UUGU.js +0 -3
- package/dist/menu_setting-5Jet091Q.js +0 -155
- package/dist/not-data-Cx--tk_h.js +0 -2
- package/dist/not-data-tyTawN37.js +0 -2
- package/dist/operateHistoryDetail-CeVPJzD6.js +0 -3
- package/dist/other_setting-DQ70WnZK.js +0 -213
- package/dist/page_animation_setting-Lp6cMuFM.js +0 -108
- package/dist/routeSystem-DXMoWhFo.js +0 -2
- package/dist/setItem-Qa7UapHO.js +0 -4
- package/dist/tabbar_setting-B3kMhRNm.js +0 -139
- package/dist/toolbar_setting-DNBdxeGP.js +0 -140
- package/dist/useAppAndResource-CPL2VpOJ.js +0 -52
- package/dist/watermark_setting-CXp4Og0Y.js +0 -191
|
@@ -1,3572 +0,0 @@
|
|
|
1
|
-
import { useViewStore } from "./index.js";
|
|
2
|
-
import { Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, isRef, mergeProps, normalizeClass, normalizeProps, onBeforeUnmount, onMounted, onUnmounted, openBlock, ref, resolveComponent, shallowRef, unref, useId, useModel, useTemplateRef, watch, watchEffect, withCtx } from "vue";
|
|
3
|
-
import { CaretDownOutlined } from "@ant-design/icons-vue";
|
|
4
|
-
import { Empty } from "ant-design-vue";
|
|
5
|
-
import { DirectoryTree, Empty as Empty$1, FormItemRest, Input as Input$1 } from "ant-design-vue/es";
|
|
6
|
-
import './ComponentSelect.css';var sides = [
|
|
7
|
-
"top",
|
|
8
|
-
"right",
|
|
9
|
-
"bottom",
|
|
10
|
-
"left"
|
|
11
|
-
], min$1 = Math.min, max$1 = Math.max, round$1 = Math.round, floor$1 = Math.floor, createCoords = (i) => ({
|
|
12
|
-
x: i,
|
|
13
|
-
y: i
|
|
14
|
-
}), oppositeSideMap = {
|
|
15
|
-
left: "right",
|
|
16
|
-
right: "left",
|
|
17
|
-
bottom: "top",
|
|
18
|
-
top: "bottom"
|
|
19
|
-
}, oppositeAlignmentMap = {
|
|
20
|
-
start: "end",
|
|
21
|
-
end: "start"
|
|
22
|
-
};
|
|
23
|
-
function clamp(i, s, c) {
|
|
24
|
-
return max$1(i, min$1(s, c));
|
|
25
|
-
}
|
|
26
|
-
function evaluate(i, s) {
|
|
27
|
-
return typeof i == "function" ? i(s) : i;
|
|
28
|
-
}
|
|
29
|
-
function getSide(i) {
|
|
30
|
-
return i.split("-")[0];
|
|
31
|
-
}
|
|
32
|
-
function getAlignment(i) {
|
|
33
|
-
return i.split("-")[1];
|
|
34
|
-
}
|
|
35
|
-
function getOppositeAxis(i) {
|
|
36
|
-
return i === "x" ? "y" : "x";
|
|
37
|
-
}
|
|
38
|
-
function getAxisLength(i) {
|
|
39
|
-
return i === "y" ? "height" : "width";
|
|
40
|
-
}
|
|
41
|
-
var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
|
|
42
|
-
function getSideAxis(i) {
|
|
43
|
-
return yAxisSides.has(getSide(i)) ? "y" : "x";
|
|
44
|
-
}
|
|
45
|
-
function getAlignmentAxis(i) {
|
|
46
|
-
return getOppositeAxis(getSideAxis(i));
|
|
47
|
-
}
|
|
48
|
-
function getAlignmentSides(i, s, c) {
|
|
49
|
-
c === void 0 && (c = !1);
|
|
50
|
-
let l = getAlignment(i), u = getAlignmentAxis(i), d = getAxisLength(u), f = u === "x" ? l === (c ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
|
|
51
|
-
return s.reference[d] > s.floating[d] && (f = getOppositePlacement(f)), [f, getOppositePlacement(f)];
|
|
52
|
-
}
|
|
53
|
-
function getExpandedPlacements(i) {
|
|
54
|
-
let s = getOppositePlacement(i);
|
|
55
|
-
return [
|
|
56
|
-
getOppositeAlignmentPlacement(i),
|
|
57
|
-
s,
|
|
58
|
-
getOppositeAlignmentPlacement(s)
|
|
59
|
-
];
|
|
60
|
-
}
|
|
61
|
-
function getOppositeAlignmentPlacement(i) {
|
|
62
|
-
return i.replace(/start|end/g, (i) => oppositeAlignmentMap[i]);
|
|
63
|
-
}
|
|
64
|
-
var lrPlacement = ["left", "right"], rlPlacement = ["right", "left"], tbPlacement = ["top", "bottom"], btPlacement = ["bottom", "top"];
|
|
65
|
-
function getSideList(i, s, c) {
|
|
66
|
-
switch (i) {
|
|
67
|
-
case "top":
|
|
68
|
-
case "bottom": return c ? s ? rlPlacement : lrPlacement : s ? lrPlacement : rlPlacement;
|
|
69
|
-
case "left":
|
|
70
|
-
case "right": return s ? tbPlacement : btPlacement;
|
|
71
|
-
default: return [];
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function getOppositeAxisPlacements(i, s, c, l) {
|
|
75
|
-
let u = getAlignment(i), d = getSideList(getSide(i), c === "start", l);
|
|
76
|
-
return u && (d = d.map((i) => i + "-" + u), s && (d = d.concat(d.map(getOppositeAlignmentPlacement)))), d;
|
|
77
|
-
}
|
|
78
|
-
function getOppositePlacement(i) {
|
|
79
|
-
return i.replace(/left|right|bottom|top/g, (i) => oppositeSideMap[i]);
|
|
80
|
-
}
|
|
81
|
-
function expandPaddingObject(i) {
|
|
82
|
-
return {
|
|
83
|
-
top: 0,
|
|
84
|
-
right: 0,
|
|
85
|
-
bottom: 0,
|
|
86
|
-
left: 0,
|
|
87
|
-
...i
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
function getPaddingObject(i) {
|
|
91
|
-
return typeof i == "number" ? {
|
|
92
|
-
top: i,
|
|
93
|
-
right: i,
|
|
94
|
-
bottom: i,
|
|
95
|
-
left: i
|
|
96
|
-
} : expandPaddingObject(i);
|
|
97
|
-
}
|
|
98
|
-
function rectToClientRect(i) {
|
|
99
|
-
let { x: s, y: c, width: l, height: u } = i;
|
|
100
|
-
return {
|
|
101
|
-
width: l,
|
|
102
|
-
height: u,
|
|
103
|
-
top: c,
|
|
104
|
-
left: s,
|
|
105
|
-
right: s + l,
|
|
106
|
-
bottom: c + u,
|
|
107
|
-
x: s,
|
|
108
|
-
y: c
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function computeCoordsFromPlacement(i, s, c) {
|
|
112
|
-
let { reference: l, floating: u } = i, d = getSideAxis(s), f = getAlignmentAxis(s), p = getAxisLength(f), m = getSide(s), h = d === "y", g = l.x + l.width / 2 - u.width / 2, _ = l.y + l.height / 2 - u.height / 2, v = l[p] / 2 - u[p] / 2, y;
|
|
113
|
-
switch (m) {
|
|
114
|
-
case "top":
|
|
115
|
-
y = {
|
|
116
|
-
x: g,
|
|
117
|
-
y: l.y - u.height
|
|
118
|
-
};
|
|
119
|
-
break;
|
|
120
|
-
case "bottom":
|
|
121
|
-
y = {
|
|
122
|
-
x: g,
|
|
123
|
-
y: l.y + l.height
|
|
124
|
-
};
|
|
125
|
-
break;
|
|
126
|
-
case "right":
|
|
127
|
-
y = {
|
|
128
|
-
x: l.x + l.width,
|
|
129
|
-
y: _
|
|
130
|
-
};
|
|
131
|
-
break;
|
|
132
|
-
case "left":
|
|
133
|
-
y = {
|
|
134
|
-
x: l.x - u.width,
|
|
135
|
-
y: _
|
|
136
|
-
};
|
|
137
|
-
break;
|
|
138
|
-
default: y = {
|
|
139
|
-
x: l.x,
|
|
140
|
-
y: l.y
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
switch (getAlignment(s)) {
|
|
144
|
-
case "start":
|
|
145
|
-
y[f] -= v * (c && h ? -1 : 1);
|
|
146
|
-
break;
|
|
147
|
-
case "end":
|
|
148
|
-
y[f] += v * (c && h ? -1 : 1);
|
|
149
|
-
break;
|
|
150
|
-
}
|
|
151
|
-
return y;
|
|
152
|
-
}
|
|
153
|
-
var computePosition$1 = async (i, s, c) => {
|
|
154
|
-
let { placement: l = "bottom", strategy: u = "absolute", middleware: d = [], platform: f } = c, p = d.filter(Boolean), m = await (f.isRTL == null ? void 0 : f.isRTL(s)), h = await f.getElementRects({
|
|
155
|
-
reference: i,
|
|
156
|
-
floating: s,
|
|
157
|
-
strategy: u
|
|
158
|
-
}), { x: g, y: _ } = computeCoordsFromPlacement(h, l, m), v = l, y = {}, b = 0;
|
|
159
|
-
for (let c = 0; c < p.length; c++) {
|
|
160
|
-
let { name: d, fn: x } = p[c], { x: S, y: C, data: w, reset: T } = await x({
|
|
161
|
-
x: g,
|
|
162
|
-
y: _,
|
|
163
|
-
initialPlacement: l,
|
|
164
|
-
placement: v,
|
|
165
|
-
strategy: u,
|
|
166
|
-
middlewareData: y,
|
|
167
|
-
rects: h,
|
|
168
|
-
platform: f,
|
|
169
|
-
elements: {
|
|
170
|
-
reference: i,
|
|
171
|
-
floating: s
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
g = S ?? g, _ = C ?? _, y = {
|
|
175
|
-
...y,
|
|
176
|
-
[d]: {
|
|
177
|
-
...y[d],
|
|
178
|
-
...w
|
|
179
|
-
}
|
|
180
|
-
}, T && b <= 50 && (b++, typeof T == "object" && (T.placement && (v = T.placement), T.rects && (h = T.rects === !0 ? await f.getElementRects({
|
|
181
|
-
reference: i,
|
|
182
|
-
floating: s,
|
|
183
|
-
strategy: u
|
|
184
|
-
}) : T.rects), {x: g, y: _} = computeCoordsFromPlacement(h, v, m)), c = -1);
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
x: g,
|
|
188
|
-
y: _,
|
|
189
|
-
placement: v,
|
|
190
|
-
strategy: u,
|
|
191
|
-
middlewareData: y
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
async function detectOverflow(i, s) {
|
|
195
|
-
s === void 0 && (s = {});
|
|
196
|
-
let { x: c, y: l, platform: u, rects: d, elements: f, strategy: p } = i, { boundary: m = "clippingAncestors", rootBoundary: h = "viewport", elementContext: g = "floating", altBoundary: _ = !1, padding: v = 0 } = evaluate(s, i), y = getPaddingObject(v), b = f[_ ? g === "floating" ? "reference" : "floating" : g], x = rectToClientRect(await u.getClippingRect({
|
|
197
|
-
element: await (u.isElement == null ? void 0 : u.isElement(b)) ?? !0 ? b : b.contextElement || await (u.getDocumentElement == null ? void 0 : u.getDocumentElement(f.floating)),
|
|
198
|
-
boundary: m,
|
|
199
|
-
rootBoundary: h,
|
|
200
|
-
strategy: p
|
|
201
|
-
})), S = g === "floating" ? {
|
|
202
|
-
x: c,
|
|
203
|
-
y: l,
|
|
204
|
-
width: d.floating.width,
|
|
205
|
-
height: d.floating.height
|
|
206
|
-
} : d.reference, C = await (u.getOffsetParent == null ? void 0 : u.getOffsetParent(f.floating)), w = await (u.isElement == null ? void 0 : u.isElement(C)) && await (u.getScale == null ? void 0 : u.getScale(C)) || {
|
|
207
|
-
x: 1,
|
|
208
|
-
y: 1
|
|
209
|
-
}, T = rectToClientRect(u.convertOffsetParentRelativeRectToViewportRelativeRect ? await u.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
210
|
-
elements: f,
|
|
211
|
-
rect: S,
|
|
212
|
-
offsetParent: C,
|
|
213
|
-
strategy: p
|
|
214
|
-
}) : S);
|
|
215
|
-
return {
|
|
216
|
-
top: (x.top - T.top + y.top) / w.y,
|
|
217
|
-
bottom: (T.bottom - x.bottom + y.bottom) / w.y,
|
|
218
|
-
left: (x.left - T.left + y.left) / w.x,
|
|
219
|
-
right: (T.right - x.right + y.right) / w.x
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
var arrow$1 = (i) => ({
|
|
223
|
-
name: "arrow",
|
|
224
|
-
options: i,
|
|
225
|
-
async fn(s) {
|
|
226
|
-
let { x: c, y: l, placement: u, rects: d, platform: f, elements: p, middlewareData: m } = s, { element: h, padding: g = 0 } = evaluate(i, s) || {};
|
|
227
|
-
if (h == null) return {};
|
|
228
|
-
let _ = getPaddingObject(g), v = {
|
|
229
|
-
x: c,
|
|
230
|
-
y: l
|
|
231
|
-
}, y = getAlignmentAxis(u), b = getAxisLength(y), x = await f.getDimensions(h), S = y === "y", C = S ? "top" : "left", w = S ? "bottom" : "right", T = S ? "clientHeight" : "clientWidth", E = d.reference[b] + d.reference[y] - v[y] - d.floating[b], D = v[y] - d.reference[y], O = await (f.getOffsetParent == null ? void 0 : f.getOffsetParent(h)), k = O ? O[T] : 0;
|
|
232
|
-
(!k || !await (f.isElement == null ? void 0 : f.isElement(O))) && (k = p.floating[T] || d.floating[b]);
|
|
233
|
-
let A = E / 2 - D / 2, j = k / 2 - x[b] / 2 - 1, M = min$1(_[C], j), N = min$1(_[w], j), P = M, F = k - x[b] - N, I = k / 2 - x[b] / 2 + A, L = clamp(P, I, F), R = !m.arrow && getAlignment(u) != null && I !== L && d.reference[b] / 2 - (I < P ? M : N) - x[b] / 2 < 0, z = R ? I < P ? I - P : I - F : 0;
|
|
234
|
-
return {
|
|
235
|
-
[y]: v[y] + z,
|
|
236
|
-
data: {
|
|
237
|
-
[y]: L,
|
|
238
|
-
centerOffset: I - L - z,
|
|
239
|
-
...R && { alignmentOffset: z }
|
|
240
|
-
},
|
|
241
|
-
reset: R
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
}), flip$1 = function(i) {
|
|
245
|
-
return i === void 0 && (i = {}), {
|
|
246
|
-
name: "flip",
|
|
247
|
-
options: i,
|
|
248
|
-
async fn(s) {
|
|
249
|
-
var c;
|
|
250
|
-
let { placement: l, middlewareData: u, rects: d, initialPlacement: f, platform: p, elements: m } = s, { mainAxis: h = !0, crossAxis: g = !0, fallbackPlacements: _, fallbackStrategy: v = "bestFit", fallbackAxisSideDirection: y = "none", flipAlignment: b = !0, ...x } = evaluate(i, s);
|
|
251
|
-
if ((c = u.arrow) != null && c.alignmentOffset) return {};
|
|
252
|
-
let S = getSide(l), C = getSideAxis(f), w = getSide(f) === f, T = await (p.isRTL == null ? void 0 : p.isRTL(m.floating)), E = _ || (w || !b ? [getOppositePlacement(f)] : getExpandedPlacements(f)), D = y !== "none";
|
|
253
|
-
!_ && D && E.push(...getOppositeAxisPlacements(f, b, y, T));
|
|
254
|
-
let O = [f, ...E], k = await detectOverflow(s, x), A = [], j = u.flip?.overflows || [];
|
|
255
|
-
if (h && A.push(k[S]), g) {
|
|
256
|
-
let i = getAlignmentSides(l, d, T);
|
|
257
|
-
A.push(k[i[0]], k[i[1]]);
|
|
258
|
-
}
|
|
259
|
-
if (j = [...j, {
|
|
260
|
-
placement: l,
|
|
261
|
-
overflows: A
|
|
262
|
-
}], !A.every((i) => i <= 0)) {
|
|
263
|
-
let i = (u.flip?.index || 0) + 1, s = O[i];
|
|
264
|
-
if (s && (!(g === "alignment" && C !== getSideAxis(s)) || j.every((i) => i.overflows[0] > 0 && getSideAxis(i.placement) === C))) return {
|
|
265
|
-
data: {
|
|
266
|
-
index: i,
|
|
267
|
-
overflows: j
|
|
268
|
-
},
|
|
269
|
-
reset: { placement: s }
|
|
270
|
-
};
|
|
271
|
-
let c = j.filter((i) => i.overflows[0] <= 0).sort((i, s) => i.overflows[1] - s.overflows[1])[0]?.placement;
|
|
272
|
-
if (!c) switch (v) {
|
|
273
|
-
case "bestFit": {
|
|
274
|
-
let i = j.filter((i) => {
|
|
275
|
-
if (D) {
|
|
276
|
-
let s = getSideAxis(i.placement);
|
|
277
|
-
return s === C || s === "y";
|
|
278
|
-
}
|
|
279
|
-
return !0;
|
|
280
|
-
}).map((i) => [i.placement, i.overflows.filter((i) => i > 0).reduce((i, s) => i + s, 0)]).sort((i, s) => i[1] - s[1])[0]?.[0];
|
|
281
|
-
i && (c = i);
|
|
282
|
-
break;
|
|
283
|
-
}
|
|
284
|
-
case "initialPlacement":
|
|
285
|
-
c = f;
|
|
286
|
-
break;
|
|
287
|
-
}
|
|
288
|
-
if (l !== c) return { reset: { placement: c } };
|
|
289
|
-
}
|
|
290
|
-
return {};
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
};
|
|
294
|
-
function getSideOffsets(i, s) {
|
|
295
|
-
return {
|
|
296
|
-
top: i.top - s.height,
|
|
297
|
-
right: i.right - s.width,
|
|
298
|
-
bottom: i.bottom - s.height,
|
|
299
|
-
left: i.left - s.width
|
|
300
|
-
};
|
|
301
|
-
}
|
|
302
|
-
function isAnySideFullyClipped(i) {
|
|
303
|
-
return sides.some((s) => i[s] >= 0);
|
|
304
|
-
}
|
|
305
|
-
var hide$1 = function(i) {
|
|
306
|
-
return i === void 0 && (i = {}), {
|
|
307
|
-
name: "hide",
|
|
308
|
-
options: i,
|
|
309
|
-
async fn(s) {
|
|
310
|
-
let { rects: c } = s, { strategy: l = "referenceHidden", ...u } = evaluate(i, s);
|
|
311
|
-
switch (l) {
|
|
312
|
-
case "referenceHidden": {
|
|
313
|
-
let i = getSideOffsets(await detectOverflow(s, {
|
|
314
|
-
...u,
|
|
315
|
-
elementContext: "reference"
|
|
316
|
-
}), c.reference);
|
|
317
|
-
return { data: {
|
|
318
|
-
referenceHiddenOffsets: i,
|
|
319
|
-
referenceHidden: isAnySideFullyClipped(i)
|
|
320
|
-
} };
|
|
321
|
-
}
|
|
322
|
-
case "escaped": {
|
|
323
|
-
let i = getSideOffsets(await detectOverflow(s, {
|
|
324
|
-
...u,
|
|
325
|
-
altBoundary: !0
|
|
326
|
-
}), c.floating);
|
|
327
|
-
return { data: {
|
|
328
|
-
escapedOffsets: i,
|
|
329
|
-
escaped: isAnySideFullyClipped(i)
|
|
330
|
-
} };
|
|
331
|
-
}
|
|
332
|
-
default: return {};
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
}, originSides = /* @__PURE__ */ new Set(["left", "top"]);
|
|
337
|
-
async function convertValueToCoords(i, s) {
|
|
338
|
-
let { placement: c, platform: l, elements: u } = i, d = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), f = getSide(c), p = getAlignment(c), m = getSideAxis(c) === "y", h = originSides.has(f) ? -1 : 1, g = d && m ? -1 : 1, _ = evaluate(s, i), { mainAxis: v, crossAxis: y, alignmentAxis: b } = typeof _ == "number" ? {
|
|
339
|
-
mainAxis: _,
|
|
340
|
-
crossAxis: 0,
|
|
341
|
-
alignmentAxis: null
|
|
342
|
-
} : {
|
|
343
|
-
mainAxis: _.mainAxis || 0,
|
|
344
|
-
crossAxis: _.crossAxis || 0,
|
|
345
|
-
alignmentAxis: _.alignmentAxis
|
|
346
|
-
};
|
|
347
|
-
return p && typeof b == "number" && (y = p === "end" ? b * -1 : b), m ? {
|
|
348
|
-
x: y * g,
|
|
349
|
-
y: v * h
|
|
350
|
-
} : {
|
|
351
|
-
x: v * h,
|
|
352
|
-
y: y * g
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
var offset$1 = function(i) {
|
|
356
|
-
return i === void 0 && (i = 0), {
|
|
357
|
-
name: "offset",
|
|
358
|
-
options: i,
|
|
359
|
-
async fn(s) {
|
|
360
|
-
var c;
|
|
361
|
-
let { x: l, y: u, placement: d, middlewareData: f } = s, p = await convertValueToCoords(s, i);
|
|
362
|
-
return d === f.offset?.placement && (c = f.arrow) != null && c.alignmentOffset ? {} : {
|
|
363
|
-
x: l + p.x,
|
|
364
|
-
y: u + p.y,
|
|
365
|
-
data: {
|
|
366
|
-
...p,
|
|
367
|
-
placement: d
|
|
368
|
-
}
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
}, shift$1 = function(i) {
|
|
373
|
-
return i === void 0 && (i = {}), {
|
|
374
|
-
name: "shift",
|
|
375
|
-
options: i,
|
|
376
|
-
async fn(s) {
|
|
377
|
-
let { x: c, y: l, placement: u } = s, { mainAxis: d = !0, crossAxis: f = !1, limiter: p = { fn: (i) => {
|
|
378
|
-
let { x: s, y: c } = i;
|
|
379
|
-
return {
|
|
380
|
-
x: s,
|
|
381
|
-
y: c
|
|
382
|
-
};
|
|
383
|
-
} }, ...m } = evaluate(i, s), h = {
|
|
384
|
-
x: c,
|
|
385
|
-
y: l
|
|
386
|
-
}, g = await detectOverflow(s, m), _ = getSideAxis(getSide(u)), v = getOppositeAxis(_), y = h[v], b = h[_];
|
|
387
|
-
if (d) {
|
|
388
|
-
let i = v === "y" ? "top" : "left", s = v === "y" ? "bottom" : "right", c = y + g[i], l = y - g[s];
|
|
389
|
-
y = clamp(c, y, l);
|
|
390
|
-
}
|
|
391
|
-
if (f) {
|
|
392
|
-
let i = _ === "y" ? "top" : "left", s = _ === "y" ? "bottom" : "right", c = b + g[i], l = b - g[s];
|
|
393
|
-
b = clamp(c, b, l);
|
|
394
|
-
}
|
|
395
|
-
let x = p.fn({
|
|
396
|
-
...s,
|
|
397
|
-
[v]: y,
|
|
398
|
-
[_]: b
|
|
399
|
-
});
|
|
400
|
-
return {
|
|
401
|
-
...x,
|
|
402
|
-
data: {
|
|
403
|
-
x: x.x - c,
|
|
404
|
-
y: x.y - l,
|
|
405
|
-
enabled: {
|
|
406
|
-
[v]: d,
|
|
407
|
-
[_]: f
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
};
|
|
413
|
-
}, limitShift$1 = function(i) {
|
|
414
|
-
return i === void 0 && (i = {}), {
|
|
415
|
-
options: i,
|
|
416
|
-
fn(s) {
|
|
417
|
-
let { x: c, y: l, placement: u, rects: d, middlewareData: f } = s, { offset: p = 0, mainAxis: m = !0, crossAxis: h = !0 } = evaluate(i, s), g = {
|
|
418
|
-
x: c,
|
|
419
|
-
y: l
|
|
420
|
-
}, _ = getSideAxis(u), v = getOppositeAxis(_), y = g[v], b = g[_], x = evaluate(p, s), S = typeof x == "number" ? {
|
|
421
|
-
mainAxis: x,
|
|
422
|
-
crossAxis: 0
|
|
423
|
-
} : {
|
|
424
|
-
mainAxis: 0,
|
|
425
|
-
crossAxis: 0,
|
|
426
|
-
...x
|
|
427
|
-
};
|
|
428
|
-
if (m) {
|
|
429
|
-
let i = v === "y" ? "height" : "width", s = d.reference[v] - d.floating[i] + S.mainAxis, c = d.reference[v] + d.reference[i] - S.mainAxis;
|
|
430
|
-
y < s ? y = s : y > c && (y = c);
|
|
431
|
-
}
|
|
432
|
-
if (h) {
|
|
433
|
-
let i = v === "y" ? "width" : "height", s = originSides.has(getSide(u)), c = d.reference[_] - d.floating[i] + (s && f.offset?.[_] || 0) + (s ? 0 : S.crossAxis), l = d.reference[_] + d.reference[i] + (s ? 0 : f.offset?.[_] || 0) - (s ? S.crossAxis : 0);
|
|
434
|
-
b < c ? b = c : b > l && (b = l);
|
|
435
|
-
}
|
|
436
|
-
return {
|
|
437
|
-
[v]: y,
|
|
438
|
-
[_]: b
|
|
439
|
-
};
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
}, size$1 = function(i) {
|
|
443
|
-
return i === void 0 && (i = {}), {
|
|
444
|
-
name: "size",
|
|
445
|
-
options: i,
|
|
446
|
-
async fn(s) {
|
|
447
|
-
var c, l;
|
|
448
|
-
let { placement: u, rects: d, platform: f, elements: p } = s, { apply: m = () => {}, ...h } = evaluate(i, s), g = await detectOverflow(s, h), _ = getSide(u), v = getAlignment(u), y = getSideAxis(u) === "y", { width: b, height: x } = d.floating, S, C;
|
|
449
|
-
_ === "top" || _ === "bottom" ? (S = _, C = v === (await (f.isRTL == null ? void 0 : f.isRTL(p.floating)) ? "start" : "end") ? "left" : "right") : (C = _, S = v === "end" ? "top" : "bottom");
|
|
450
|
-
let w = x - g.top - g.bottom, T = b - g.left - g.right, E = min$1(x - g[S], w), D = min$1(b - g[C], T), O = !s.middlewareData.shift, k = E, A = D;
|
|
451
|
-
if ((c = s.middlewareData.shift) != null && c.enabled.x && (A = T), (l = s.middlewareData.shift) != null && l.enabled.y && (k = w), O && !v) {
|
|
452
|
-
let i = max$1(g.left, 0), s = max$1(g.right, 0), c = max$1(g.top, 0), l = max$1(g.bottom, 0);
|
|
453
|
-
y ? A = b - 2 * (i !== 0 || s !== 0 ? i + s : max$1(g.left, g.right)) : k = x - 2 * (c !== 0 || l !== 0 ? c + l : max$1(g.top, g.bottom));
|
|
454
|
-
}
|
|
455
|
-
await m({
|
|
456
|
-
...s,
|
|
457
|
-
availableWidth: A,
|
|
458
|
-
availableHeight: k
|
|
459
|
-
});
|
|
460
|
-
let j = await f.getDimensions(p.floating);
|
|
461
|
-
return b !== j.width || x !== j.height ? { reset: { rects: !0 } } : {};
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
};
|
|
465
|
-
function hasWindow() {
|
|
466
|
-
return typeof window < "u";
|
|
467
|
-
}
|
|
468
|
-
function getNodeName$1(i) {
|
|
469
|
-
return isNode$1(i) ? (i.nodeName || "").toLowerCase() : "#document";
|
|
470
|
-
}
|
|
471
|
-
function getWindow$1(i) {
|
|
472
|
-
var s;
|
|
473
|
-
return (i == null || (s = i.ownerDocument) == null ? void 0 : s.defaultView) || window;
|
|
474
|
-
}
|
|
475
|
-
function getDocumentElement$1(i) {
|
|
476
|
-
return ((isNode$1(i) ? i.ownerDocument : i.document) || window.document)?.documentElement;
|
|
477
|
-
}
|
|
478
|
-
function isNode$1(i) {
|
|
479
|
-
return hasWindow() ? i instanceof Node || i instanceof getWindow$1(i).Node : !1;
|
|
480
|
-
}
|
|
481
|
-
function isElement$1(i) {
|
|
482
|
-
return hasWindow() ? i instanceof Element || i instanceof getWindow$1(i).Element : !1;
|
|
483
|
-
}
|
|
484
|
-
function isHTMLElement$1(i) {
|
|
485
|
-
return hasWindow() ? i instanceof HTMLElement || i instanceof getWindow$1(i).HTMLElement : !1;
|
|
486
|
-
}
|
|
487
|
-
function isShadowRoot$1(i) {
|
|
488
|
-
return !hasWindow() || typeof ShadowRoot > "u" ? !1 : i instanceof ShadowRoot || i instanceof getWindow$1(i).ShadowRoot;
|
|
489
|
-
}
|
|
490
|
-
var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
|
|
491
|
-
function isOverflowElement$1(i) {
|
|
492
|
-
let { overflow: s, overflowX: c, overflowY: l, display: u } = getComputedStyle$1(i);
|
|
493
|
-
return /auto|scroll|overlay|hidden|clip/.test(s + l + c) && !invalidOverflowDisplayValues.has(u);
|
|
494
|
-
}
|
|
495
|
-
var tableElements = /* @__PURE__ */ new Set([
|
|
496
|
-
"table",
|
|
497
|
-
"td",
|
|
498
|
-
"th"
|
|
499
|
-
]);
|
|
500
|
-
function isTableElement(i) {
|
|
501
|
-
return tableElements.has(getNodeName$1(i));
|
|
502
|
-
}
|
|
503
|
-
var topLayerSelectors = [":popover-open", ":modal"];
|
|
504
|
-
function isTopLayer(i) {
|
|
505
|
-
return topLayerSelectors.some((s) => {
|
|
506
|
-
try {
|
|
507
|
-
return i.matches(s);
|
|
508
|
-
} catch {
|
|
509
|
-
return !1;
|
|
510
|
-
}
|
|
511
|
-
});
|
|
512
|
-
}
|
|
513
|
-
var transformProperties = [
|
|
514
|
-
"transform",
|
|
515
|
-
"translate",
|
|
516
|
-
"scale",
|
|
517
|
-
"rotate",
|
|
518
|
-
"perspective"
|
|
519
|
-
], willChangeValues = [
|
|
520
|
-
"transform",
|
|
521
|
-
"translate",
|
|
522
|
-
"scale",
|
|
523
|
-
"rotate",
|
|
524
|
-
"perspective",
|
|
525
|
-
"filter"
|
|
526
|
-
], containValues = [
|
|
527
|
-
"paint",
|
|
528
|
-
"layout",
|
|
529
|
-
"strict",
|
|
530
|
-
"content"
|
|
531
|
-
];
|
|
532
|
-
function isContainingBlock(i) {
|
|
533
|
-
let s = isWebKit(), c = isElement$1(i) ? getComputedStyle$1(i) : i;
|
|
534
|
-
return transformProperties.some((i) => c[i] ? c[i] !== "none" : !1) || (c.containerType ? c.containerType !== "normal" : !1) || !s && (c.backdropFilter ? c.backdropFilter !== "none" : !1) || !s && (c.filter ? c.filter !== "none" : !1) || willChangeValues.some((i) => (c.willChange || "").includes(i)) || containValues.some((i) => (c.contain || "").includes(i));
|
|
535
|
-
}
|
|
536
|
-
function getContainingBlock(i) {
|
|
537
|
-
let s = getParentNode$2(i);
|
|
538
|
-
for (; isHTMLElement$1(s) && !isLastTraversableNode(s);) {
|
|
539
|
-
if (isContainingBlock(s)) return s;
|
|
540
|
-
if (isTopLayer(s)) return null;
|
|
541
|
-
s = getParentNode$2(s);
|
|
542
|
-
}
|
|
543
|
-
return null;
|
|
544
|
-
}
|
|
545
|
-
function isWebKit() {
|
|
546
|
-
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
547
|
-
}
|
|
548
|
-
var lastTraversableNodeNames = /* @__PURE__ */ new Set([
|
|
549
|
-
"html",
|
|
550
|
-
"body",
|
|
551
|
-
"#document"
|
|
552
|
-
]);
|
|
553
|
-
function isLastTraversableNode(i) {
|
|
554
|
-
return lastTraversableNodeNames.has(getNodeName$1(i));
|
|
555
|
-
}
|
|
556
|
-
function getComputedStyle$1(i) {
|
|
557
|
-
return getWindow$1(i).getComputedStyle(i);
|
|
558
|
-
}
|
|
559
|
-
function getNodeScroll(i) {
|
|
560
|
-
return isElement$1(i) ? {
|
|
561
|
-
scrollLeft: i.scrollLeft,
|
|
562
|
-
scrollTop: i.scrollTop
|
|
563
|
-
} : {
|
|
564
|
-
scrollLeft: i.scrollX,
|
|
565
|
-
scrollTop: i.scrollY
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
function getParentNode$2(i) {
|
|
569
|
-
if (getNodeName$1(i) === "html") return i;
|
|
570
|
-
let s = i.assignedSlot || i.parentNode || isShadowRoot$1(i) && i.host || getDocumentElement$1(i);
|
|
571
|
-
return isShadowRoot$1(s) ? s.host : s;
|
|
572
|
-
}
|
|
573
|
-
function getNearestOverflowAncestor$1(i) {
|
|
574
|
-
let s = getParentNode$2(i);
|
|
575
|
-
return isLastTraversableNode(s) ? i.ownerDocument ? i.ownerDocument.body : i.body : isHTMLElement$1(s) && isOverflowElement$1(s) ? s : getNearestOverflowAncestor$1(s);
|
|
576
|
-
}
|
|
577
|
-
function getOverflowAncestors(i, s, c) {
|
|
578
|
-
s === void 0 && (s = []), c === void 0 && (c = !0);
|
|
579
|
-
let l = getNearestOverflowAncestor$1(i), u = l === i.ownerDocument?.body, d = getWindow$1(l);
|
|
580
|
-
if (u) {
|
|
581
|
-
let i = getFrameElement(d);
|
|
582
|
-
return s.concat(d, d.visualViewport || [], isOverflowElement$1(l) ? l : [], i && c ? getOverflowAncestors(i) : []);
|
|
583
|
-
}
|
|
584
|
-
return s.concat(l, getOverflowAncestors(l, [], c));
|
|
585
|
-
}
|
|
586
|
-
function getFrameElement(i) {
|
|
587
|
-
return i.parent && Object.getPrototypeOf(i.parent) ? i.frameElement : null;
|
|
588
|
-
}
|
|
589
|
-
var isEmpty = (i) => i.length === 0;
|
|
590
|
-
function toKebabCase(i) {
|
|
591
|
-
return i.replace(/([a-z\d])([A-Z])/g, "$1-$2").replace(/([A-Z])([A-Z][a-z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
592
|
-
}
|
|
593
|
-
function createAnatomy(i, s = []) {
|
|
594
|
-
return {
|
|
595
|
-
parts: (...c) => {
|
|
596
|
-
if (isEmpty(s)) return createAnatomy(i, c);
|
|
597
|
-
throw Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?");
|
|
598
|
-
},
|
|
599
|
-
extendWith: (...c) => createAnatomy(i, [...s, ...c]),
|
|
600
|
-
rename: (i) => createAnatomy(i, s),
|
|
601
|
-
keys: () => s,
|
|
602
|
-
build: () => [...new Set(s)].reduce((s, c) => Object.assign(s, { [c]: {
|
|
603
|
-
selector: [`&[data-scope="${toKebabCase(i)}"][data-part="${toKebabCase(c)}"]`, `& [data-scope="${toKebabCase(i)}"][data-part="${toKebabCase(c)}"]`].join(", "),
|
|
604
|
-
attrs: {
|
|
605
|
-
"data-scope": toKebabCase(i),
|
|
606
|
-
"data-part": toKebabCase(c)
|
|
607
|
-
}
|
|
608
|
-
} }), {})
|
|
609
|
-
};
|
|
610
|
-
}
|
|
611
|
-
var isObject$2 = (i) => typeof i == "object" && !!i, dataAttr = (i) => i ? "" : void 0, ELEMENT_NODE = 1, DOCUMENT_NODE = 9, DOCUMENT_FRAGMENT_NODE = 11;
|
|
612
|
-
function isHTMLElement(i) {
|
|
613
|
-
return isObject$2(i) && i.nodeType === ELEMENT_NODE && typeof i.nodeName == "string";
|
|
614
|
-
}
|
|
615
|
-
var isDocument = (i) => isObject$2(i) && i.nodeType === DOCUMENT_NODE, isWindow = (i) => isObject$2(i) && i === i.window;
|
|
616
|
-
function getNodeName(i) {
|
|
617
|
-
return isHTMLElement(i) ? i.localName || "" : "#document";
|
|
618
|
-
}
|
|
619
|
-
function isRootElement(i) {
|
|
620
|
-
return [
|
|
621
|
-
"html",
|
|
622
|
-
"body",
|
|
623
|
-
"#document"
|
|
624
|
-
].includes(getNodeName(i));
|
|
625
|
-
}
|
|
626
|
-
var isNode = (i) => isObject$2(i) && i.nodeType !== void 0;
|
|
627
|
-
function isShadowRoot(i) {
|
|
628
|
-
return isNode(i) && i.nodeType === DOCUMENT_FRAGMENT_NODE && "host" in i;
|
|
629
|
-
}
|
|
630
|
-
var isInputElement = (i) => isHTMLElement(i) && i.localName === "input";
|
|
631
|
-
function isElementVisible(i) {
|
|
632
|
-
return isHTMLElement(i) ? i.offsetWidth > 0 || i.offsetHeight > 0 || i.getClientRects().length > 0 : !1;
|
|
633
|
-
}
|
|
634
|
-
var TEXTAREA_SELECT_REGEX = /(textarea|select)/;
|
|
635
|
-
function isEditableElement(i) {
|
|
636
|
-
if (i == null || !isHTMLElement(i)) return !1;
|
|
637
|
-
try {
|
|
638
|
-
return isInputElement(i) && i.selectionStart != null || TEXTAREA_SELECT_REGEX.test(i.localName) || i.isContentEditable || i.getAttribute("contenteditable") === "true" || i.getAttribute("contenteditable") === "";
|
|
639
|
-
} catch {
|
|
640
|
-
return !1;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
function contains(i, s) {
|
|
644
|
-
if (!i || !s || !isHTMLElement(i) || !isHTMLElement(s)) return !1;
|
|
645
|
-
let c = s.getRootNode?.();
|
|
646
|
-
if (i === s || i.contains(s)) return !0;
|
|
647
|
-
if (c && isShadowRoot(c)) {
|
|
648
|
-
let c = s;
|
|
649
|
-
for (; c;) {
|
|
650
|
-
if (i === c) return !0;
|
|
651
|
-
c = c.parentNode || c.host;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
return !1;
|
|
655
|
-
}
|
|
656
|
-
function getDocument(i) {
|
|
657
|
-
return isDocument(i) ? i : isWindow(i) ? i.document : i?.ownerDocument ?? document;
|
|
658
|
-
}
|
|
659
|
-
function getDocumentElement(i) {
|
|
660
|
-
return getDocument(i).documentElement;
|
|
661
|
-
}
|
|
662
|
-
function getWindow(i) {
|
|
663
|
-
return isShadowRoot(i) ? getWindow(i.host) : isDocument(i) ? i.defaultView ?? window : isHTMLElement(i) ? i.ownerDocument?.defaultView ?? window : window;
|
|
664
|
-
}
|
|
665
|
-
function getActiveElement(i) {
|
|
666
|
-
let s = i.activeElement;
|
|
667
|
-
for (; s?.shadowRoot;) {
|
|
668
|
-
let i = s.shadowRoot.activeElement;
|
|
669
|
-
if (i === s) break;
|
|
670
|
-
s = i;
|
|
671
|
-
}
|
|
672
|
-
return s;
|
|
673
|
-
}
|
|
674
|
-
function getParentNode$1(i) {
|
|
675
|
-
if (getNodeName(i) === "html") return i;
|
|
676
|
-
let s = i.assignedSlot || i.parentNode || isShadowRoot(i) && i.host || getDocumentElement(i);
|
|
677
|
-
return isShadowRoot(s) ? s.host : s;
|
|
678
|
-
}
|
|
679
|
-
var styleCache = /* @__PURE__ */ new WeakMap();
|
|
680
|
-
function getComputedStyle(i) {
|
|
681
|
-
return styleCache.has(i) || styleCache.set(i, getWindow(i).getComputedStyle(i)), styleCache.get(i);
|
|
682
|
-
}
|
|
683
|
-
var isDom = () => typeof document < "u";
|
|
684
|
-
function getPlatform() {
|
|
685
|
-
return navigator.userAgentData?.platform ?? navigator.platform;
|
|
686
|
-
}
|
|
687
|
-
var pt = (i) => isDom() && i.test(getPlatform()), vn = (i) => isDom() && i.test(navigator.vendor), isMac = () => pt(/^Mac/), isApple = () => pt(/mac|iphone|ipad|ipod/i), isSafari = () => isApple() && vn(/apple/i), isIos = () => pt(/iP(hone|ad|od)|iOS/);
|
|
688
|
-
function getComposedPath(i) {
|
|
689
|
-
return i.composedPath?.() ?? i.nativeEvent?.composedPath?.();
|
|
690
|
-
}
|
|
691
|
-
function getEventTarget(i) {
|
|
692
|
-
return getComposedPath(i)?.[0] ?? i.target;
|
|
693
|
-
}
|
|
694
|
-
function isContextMenuEvent(i) {
|
|
695
|
-
return i.button === 2 || isMac() && i.ctrlKey && i.button === 0;
|
|
696
|
-
}
|
|
697
|
-
function addDomEvent(i, s, c, l) {
|
|
698
|
-
let u = typeof i == "function" ? i() : i;
|
|
699
|
-
return u?.addEventListener(s, c, l), () => {
|
|
700
|
-
u?.removeEventListener(s, c, l);
|
|
701
|
-
};
|
|
702
|
-
}
|
|
703
|
-
function getDescriptor(i, s) {
|
|
704
|
-
let { type: c = "HTMLInputElement", property: l = "value" } = s, u = getWindow(i)[c].prototype;
|
|
705
|
-
return Object.getOwnPropertyDescriptor(u, l) ?? {};
|
|
706
|
-
}
|
|
707
|
-
function getElementType(i) {
|
|
708
|
-
if (i.localName === "input") return "HTMLInputElement";
|
|
709
|
-
if (i.localName === "textarea") return "HTMLTextAreaElement";
|
|
710
|
-
if (i.localName === "select") return "HTMLSelectElement";
|
|
711
|
-
}
|
|
712
|
-
function setElementValue(i, s, c = "value") {
|
|
713
|
-
let l = getElementType(i);
|
|
714
|
-
l && getDescriptor(i, {
|
|
715
|
-
type: l,
|
|
716
|
-
property: c
|
|
717
|
-
}).set?.call(i, s), i.setAttribute(c, s);
|
|
718
|
-
}
|
|
719
|
-
var isFrame = (i) => isHTMLElement(i) && i.tagName === "IFRAME", hasTabIndex = (i) => !Number.isNaN(Number.parseInt(i.getAttribute("tabindex") || "0", 10)), hasNegativeTabIndex = (i) => Number.parseInt(i.getAttribute("tabindex") || "0", 10) < 0, focusableSelector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";
|
|
720
|
-
function getFocusables(i, s = !1) {
|
|
721
|
-
if (!i) return [];
|
|
722
|
-
let c = Array.from(i.querySelectorAll(focusableSelector));
|
|
723
|
-
(s === !0 || s === "if-empty" && c.length === 0) && isHTMLElement(i) && isFocusable(i) && c.unshift(i);
|
|
724
|
-
let l = c.filter(isFocusable);
|
|
725
|
-
return l.forEach((i, s) => {
|
|
726
|
-
if (isFrame(i) && i.contentDocument) {
|
|
727
|
-
let c = i.contentDocument.body;
|
|
728
|
-
l.splice(s, 1, ...getFocusables(c));
|
|
729
|
-
}
|
|
730
|
-
}), l;
|
|
731
|
-
}
|
|
732
|
-
function isFocusable(i) {
|
|
733
|
-
return !i || i.closest("[inert]") ? !1 : i.matches(focusableSelector) && isElementVisible(i);
|
|
734
|
-
}
|
|
735
|
-
function getTabbables(i, s) {
|
|
736
|
-
if (!i) return [];
|
|
737
|
-
let c = Array.from(i.querySelectorAll(focusableSelector)), l = c.filter(isTabbable);
|
|
738
|
-
return s && isTabbable(i) && l.unshift(i), l.forEach((i, s) => {
|
|
739
|
-
if (isFrame(i) && i.contentDocument) {
|
|
740
|
-
let c = i.contentDocument.body, u = getTabbables(c);
|
|
741
|
-
l.splice(s, 1, ...u);
|
|
742
|
-
}
|
|
743
|
-
}), !l.length && s ? c : l;
|
|
744
|
-
}
|
|
745
|
-
function isTabbable(i) {
|
|
746
|
-
return i != null && i.tabIndex > 0 ? !0 : isFocusable(i) && !hasNegativeTabIndex(i);
|
|
747
|
-
}
|
|
748
|
-
function getTabbableEdges(i, s) {
|
|
749
|
-
let c = getTabbables(i, s);
|
|
750
|
-
return [c[0] || null, c[c.length - 1] || null];
|
|
751
|
-
}
|
|
752
|
-
function getNextTabbable(i, s) {
|
|
753
|
-
let c = getTabbables(i), l = i?.ownerDocument || document, u = s ?? l.activeElement;
|
|
754
|
-
return u && c[c.indexOf(u) + 1] || null;
|
|
755
|
-
}
|
|
756
|
-
function getTabIndex(i) {
|
|
757
|
-
return i.tabIndex < 0 && (/^(audio|video|details)$/.test(i.localName) || isEditableElement(i)) && !hasTabIndex(i) ? 0 : i.tabIndex;
|
|
758
|
-
}
|
|
759
|
-
function getInitialFocus(i) {
|
|
760
|
-
let { root: s, getInitialEl: c, filter: l, enabled: u = !0 } = i;
|
|
761
|
-
if (!u) return;
|
|
762
|
-
let d = null;
|
|
763
|
-
if (d ||= typeof c == "function" ? c() : c, d ||= s?.querySelector("[data-autofocus],[autofocus]"), !d) {
|
|
764
|
-
let i = getTabbables(s);
|
|
765
|
-
d = l ? i.filter(l)[0] : i[0];
|
|
766
|
-
}
|
|
767
|
-
return d || s || void 0;
|
|
768
|
-
}
|
|
769
|
-
function raf$1(i) {
|
|
770
|
-
let s = globalThis.requestAnimationFrame(i);
|
|
771
|
-
return () => {
|
|
772
|
-
globalThis.cancelAnimationFrame(s);
|
|
773
|
-
};
|
|
774
|
-
}
|
|
775
|
-
function getNearestOverflowAncestor(i) {
|
|
776
|
-
let s = getParentNode$1(i);
|
|
777
|
-
return isRootElement(s) ? getDocument(s).body : isHTMLElement(s) && isOverflowElement(s) ? s : getNearestOverflowAncestor(s);
|
|
778
|
-
}
|
|
779
|
-
var OVERFLOW_RE = /auto|scroll|overlay|hidden|clip/;
|
|
780
|
-
function isOverflowElement(i) {
|
|
781
|
-
let { overflow: s, overflowX: c, overflowY: l, display: u } = getWindow(i).getComputedStyle(i);
|
|
782
|
-
return OVERFLOW_RE.test(s + l + c) && !["inline", "contents"].includes(u);
|
|
783
|
-
}
|
|
784
|
-
function proxyTabFocusImpl(i, s = {}) {
|
|
785
|
-
let { triggerElement: c, onFocus: l } = s, u = i?.ownerDocument || document, d = u.body;
|
|
786
|
-
function f(s) {
|
|
787
|
-
if (s.key !== "Tab") return;
|
|
788
|
-
let f = null, [p, m] = getTabbableEdges(i, !0), h = !p && !m;
|
|
789
|
-
s.shiftKey && (u.activeElement === p || h) ? f = c : !s.shiftKey && u.activeElement === c ? f = p : !s.shiftKey && (u.activeElement === m || h) && (f = getNextTabbable(d, c)), f && (s.preventDefault(), typeof l == "function" ? l(f) : f.focus());
|
|
790
|
-
}
|
|
791
|
-
return addDomEvent(u, "keydown", f, !0);
|
|
792
|
-
}
|
|
793
|
-
function proxyTabFocus(i, s) {
|
|
794
|
-
let { defer: c, triggerElement: l, ...u } = s, d = c ? raf$1 : (i) => i(), f = [];
|
|
795
|
-
return f.push(d(() => {
|
|
796
|
-
let s = typeof i == "function" ? i() : i, c = typeof l == "function" ? l() : l;
|
|
797
|
-
f.push(proxyTabFocusImpl(s, {
|
|
798
|
-
triggerElement: c,
|
|
799
|
-
...u
|
|
800
|
-
}));
|
|
801
|
-
})), () => {
|
|
802
|
-
f.forEach((i) => i?.());
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
function createScope(i) {
|
|
806
|
-
let s = {
|
|
807
|
-
getRootNode: (i) => i.getRootNode?.() ?? document,
|
|
808
|
-
getDoc: (i) => getDocument(s.getRootNode(i)),
|
|
809
|
-
getWin: (i) => s.getDoc(i).defaultView ?? window,
|
|
810
|
-
getActiveElement: (i) => getActiveElement(s.getRootNode(i)),
|
|
811
|
-
isActiveElement: (i, c) => c === s.getActiveElement(i),
|
|
812
|
-
getById: (i, c) => s.getRootNode(i).getElementById(c),
|
|
813
|
-
setValue: (i, s) => {
|
|
814
|
-
i == null || s == null || setElementValue(i, s.toString());
|
|
815
|
-
}
|
|
816
|
-
};
|
|
817
|
-
return {
|
|
818
|
-
...s,
|
|
819
|
-
...i
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
var cleanups = /* @__PURE__ */ new WeakMap();
|
|
823
|
-
function set$1(i, s, c) {
|
|
824
|
-
cleanups.has(i) || cleanups.set(i, /* @__PURE__ */ new Map());
|
|
825
|
-
let l = cleanups.get(i), u = l.get(s);
|
|
826
|
-
if (!u) return l.set(s, c()), () => {
|
|
827
|
-
l.get(s)?.(), l.delete(s);
|
|
828
|
-
};
|
|
829
|
-
let d = c(), f = () => {
|
|
830
|
-
d(), u(), l.delete(s);
|
|
831
|
-
};
|
|
832
|
-
return l.set(s, f), () => {
|
|
833
|
-
l.get(s) === f && (d(), l.set(s, u));
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
function setStyle(i, s) {
|
|
837
|
-
return i ? set$1(i, "style", () => {
|
|
838
|
-
let c = i.style.cssText;
|
|
839
|
-
return Object.assign(i.style, s), () => {
|
|
840
|
-
i.style.cssText = c;
|
|
841
|
-
};
|
|
842
|
-
}) : () => {};
|
|
843
|
-
}
|
|
844
|
-
var fps = 1e3 / 60;
|
|
845
|
-
function waitForElement(i, s) {
|
|
846
|
-
let c = i();
|
|
847
|
-
if (isHTMLElement(c) && c.isConnected) return s(c), () => void 0;
|
|
848
|
-
{
|
|
849
|
-
let c = setInterval(() => {
|
|
850
|
-
let l = i();
|
|
851
|
-
isHTMLElement(l) && l.isConnected && (s(l), clearInterval(c));
|
|
852
|
-
}, fps);
|
|
853
|
-
return () => clearInterval(c);
|
|
854
|
-
}
|
|
855
|
-
}
|
|
856
|
-
function waitForElements(i, s) {
|
|
857
|
-
let c = [];
|
|
858
|
-
return i?.forEach((i) => {
|
|
859
|
-
let l = waitForElement(i, s);
|
|
860
|
-
c.push(l);
|
|
861
|
-
}), () => {
|
|
862
|
-
c.forEach((i) => i());
|
|
863
|
-
};
|
|
864
|
-
}
|
|
865
|
-
function clear(i) {
|
|
866
|
-
for (; i.length > 0;) i.pop();
|
|
867
|
-
return i;
|
|
868
|
-
}
|
|
869
|
-
function runIfFn(i, ...s) {
|
|
870
|
-
return (typeof i == "function" ? i(...s) : i) ?? void 0;
|
|
871
|
-
}
|
|
872
|
-
var cast = (i) => i;
|
|
873
|
-
function noop() {}
|
|
874
|
-
function callAll(...i) {
|
|
875
|
-
return (...s) => {
|
|
876
|
-
i.forEach((i) => {
|
|
877
|
-
i?.(...s);
|
|
878
|
-
});
|
|
879
|
-
};
|
|
880
|
-
}
|
|
881
|
-
var uuid = /* @__PURE__ */ (() => {
|
|
882
|
-
let i = 0;
|
|
883
|
-
return () => (i++, i.toString(36));
|
|
884
|
-
})(), isArray = (i) => Array.isArray(i), isObjectLike = (i) => typeof i == "object" && !!i, isObject$1 = (i) => isObjectLike(i) && !isArray(i), isNumber = (i) => typeof i == "number" && !Number.isNaN(i), isString = (i) => typeof i == "string", isFunction = (i) => typeof i == "function", isNull = (i) => i == null;
|
|
885
|
-
function hasProp(i, s) {
|
|
886
|
-
return Object.prototype.hasOwnProperty.call(i, s);
|
|
887
|
-
}
|
|
888
|
-
var baseGetTag = (i) => Object.prototype.toString.call(i), fnToString = Function.prototype.toString, objectCtorString = fnToString.call(Object);
|
|
889
|
-
function isPlainObject(i) {
|
|
890
|
-
if (!isObjectLike(i) || baseGetTag(i) !== "[object Object]") return !1;
|
|
891
|
-
let s = Object.getPrototypeOf(i);
|
|
892
|
-
if (s === null) return !0;
|
|
893
|
-
let c = hasProp(s, "constructor") && s.constructor;
|
|
894
|
-
return typeof c == "function" && c instanceof c && fnToString.call(c) === objectCtorString;
|
|
895
|
-
}
|
|
896
|
-
var { floor, abs, round, min, max, sign } = Math;
|
|
897
|
-
function compact(i) {
|
|
898
|
-
if (!isPlainObject$1(i) || i === void 0) return i;
|
|
899
|
-
let s = Reflect.ownKeys(i).filter((i) => typeof i == "string"), c = {};
|
|
900
|
-
for (let l of s) {
|
|
901
|
-
let s = i[l];
|
|
902
|
-
s !== void 0 && (c[l] = compact(s));
|
|
903
|
-
}
|
|
904
|
-
return c;
|
|
905
|
-
}
|
|
906
|
-
function isPlainObject$1(i) {
|
|
907
|
-
return i && typeof i == "object" && i.constructor === Object;
|
|
908
|
-
}
|
|
909
|
-
function getCssDimensions(i) {
|
|
910
|
-
let s = getComputedStyle$1(i), c = parseFloat(s.width) || 0, l = parseFloat(s.height) || 0, u = isHTMLElement$1(i), d = u ? i.offsetWidth : c, f = u ? i.offsetHeight : l, p = round$1(c) !== d || round$1(l) !== f;
|
|
911
|
-
return p && (c = d, l = f), {
|
|
912
|
-
width: c,
|
|
913
|
-
height: l,
|
|
914
|
-
$: p
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
function unwrapElement(i) {
|
|
918
|
-
return isElement$1(i) ? i : i.contextElement;
|
|
919
|
-
}
|
|
920
|
-
function getScale(i) {
|
|
921
|
-
let s = unwrapElement(i);
|
|
922
|
-
if (!isHTMLElement$1(s)) return createCoords(1);
|
|
923
|
-
let c = s.getBoundingClientRect(), { width: l, height: u, $: d } = getCssDimensions(s), f = (d ? round$1(c.width) : c.width) / l, p = (d ? round$1(c.height) : c.height) / u;
|
|
924
|
-
return (!f || !Number.isFinite(f)) && (f = 1), (!p || !Number.isFinite(p)) && (p = 1), {
|
|
925
|
-
x: f,
|
|
926
|
-
y: p
|
|
927
|
-
};
|
|
928
|
-
}
|
|
929
|
-
var noOffsets = /* @__PURE__ */ createCoords(0);
|
|
930
|
-
function getVisualOffsets(i) {
|
|
931
|
-
let s = getWindow$1(i);
|
|
932
|
-
return !isWebKit() || !s.visualViewport ? noOffsets : {
|
|
933
|
-
x: s.visualViewport.offsetLeft,
|
|
934
|
-
y: s.visualViewport.offsetTop
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
function shouldAddVisualOffsets(i, s, c) {
|
|
938
|
-
return s === void 0 && (s = !1), !c || s && c !== getWindow$1(i) ? !1 : s;
|
|
939
|
-
}
|
|
940
|
-
function getBoundingClientRect(i, s, c, l) {
|
|
941
|
-
s === void 0 && (s = !1), c === void 0 && (c = !1);
|
|
942
|
-
let u = i.getBoundingClientRect(), d = unwrapElement(i), f = createCoords(1);
|
|
943
|
-
s && (l ? isElement$1(l) && (f = getScale(l)) : f = getScale(i));
|
|
944
|
-
let p = shouldAddVisualOffsets(d, c, l) ? getVisualOffsets(d) : createCoords(0), m = (u.left + p.x) / f.x, h = (u.top + p.y) / f.y, g = u.width / f.x, _ = u.height / f.y;
|
|
945
|
-
if (d) {
|
|
946
|
-
let i = getWindow$1(d), s = l && isElement$1(l) ? getWindow$1(l) : l, c = i, u = getFrameElement(c);
|
|
947
|
-
for (; u && l && s !== c;) {
|
|
948
|
-
let i = getScale(u), s = u.getBoundingClientRect(), l = getComputedStyle$1(u), d = s.left + (u.clientLeft + parseFloat(l.paddingLeft)) * i.x, f = s.top + (u.clientTop + parseFloat(l.paddingTop)) * i.y;
|
|
949
|
-
m *= i.x, h *= i.y, g *= i.x, _ *= i.y, m += d, h += f, c = getWindow$1(u), u = getFrameElement(c);
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
return rectToClientRect({
|
|
953
|
-
width: g,
|
|
954
|
-
height: _,
|
|
955
|
-
x: m,
|
|
956
|
-
y: h
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
function getWindowScrollBarX(i, s) {
|
|
960
|
-
let c = getNodeScroll(i).scrollLeft;
|
|
961
|
-
return s ? s.left + c : getBoundingClientRect(getDocumentElement$1(i)).left + c;
|
|
962
|
-
}
|
|
963
|
-
function getHTMLOffset(i, s, c) {
|
|
964
|
-
c === void 0 && (c = !1);
|
|
965
|
-
let l = i.getBoundingClientRect();
|
|
966
|
-
return {
|
|
967
|
-
x: l.left + s.scrollLeft - (c ? 0 : getWindowScrollBarX(i, l)),
|
|
968
|
-
y: l.top + s.scrollTop
|
|
969
|
-
};
|
|
970
|
-
}
|
|
971
|
-
function convertOffsetParentRelativeRectToViewportRelativeRect(i) {
|
|
972
|
-
let { elements: s, rect: c, offsetParent: l, strategy: u } = i, d = u === "fixed", f = getDocumentElement$1(l), p = s ? isTopLayer(s.floating) : !1;
|
|
973
|
-
if (l === f || p && d) return c;
|
|
974
|
-
let m = {
|
|
975
|
-
scrollLeft: 0,
|
|
976
|
-
scrollTop: 0
|
|
977
|
-
}, h = createCoords(1), g = createCoords(0), _ = isHTMLElement$1(l);
|
|
978
|
-
if ((_ || !_ && !d) && ((getNodeName$1(l) !== "body" || isOverflowElement$1(f)) && (m = getNodeScroll(l)), isHTMLElement$1(l))) {
|
|
979
|
-
let i = getBoundingClientRect(l);
|
|
980
|
-
h = getScale(l), g.x = i.x + l.clientLeft, g.y = i.y + l.clientTop;
|
|
981
|
-
}
|
|
982
|
-
let v = f && !_ && !d ? getHTMLOffset(f, m, !0) : createCoords(0);
|
|
983
|
-
return {
|
|
984
|
-
width: c.width * h.x,
|
|
985
|
-
height: c.height * h.y,
|
|
986
|
-
x: c.x * h.x - m.scrollLeft * h.x + g.x + v.x,
|
|
987
|
-
y: c.y * h.y - m.scrollTop * h.y + g.y + v.y
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
function getClientRects(i) {
|
|
991
|
-
return Array.from(i.getClientRects());
|
|
992
|
-
}
|
|
993
|
-
function getDocumentRect(i) {
|
|
994
|
-
let s = getDocumentElement$1(i), c = getNodeScroll(i), l = i.ownerDocument.body, u = max$1(s.scrollWidth, s.clientWidth, l.scrollWidth, l.clientWidth), d = max$1(s.scrollHeight, s.clientHeight, l.scrollHeight, l.clientHeight), f = -c.scrollLeft + getWindowScrollBarX(i), p = -c.scrollTop;
|
|
995
|
-
return getComputedStyle$1(l).direction === "rtl" && (f += max$1(s.clientWidth, l.clientWidth) - u), {
|
|
996
|
-
width: u,
|
|
997
|
-
height: d,
|
|
998
|
-
x: f,
|
|
999
|
-
y: p
|
|
1000
|
-
};
|
|
1001
|
-
}
|
|
1002
|
-
function getViewportRect(i, s) {
|
|
1003
|
-
let c = getWindow$1(i), l = getDocumentElement$1(i), u = c.visualViewport, d = l.clientWidth, f = l.clientHeight, p = 0, m = 0;
|
|
1004
|
-
if (u) {
|
|
1005
|
-
d = u.width, f = u.height;
|
|
1006
|
-
let i = isWebKit();
|
|
1007
|
-
(!i || i && s === "fixed") && (p = u.offsetLeft, m = u.offsetTop);
|
|
1008
|
-
}
|
|
1009
|
-
return {
|
|
1010
|
-
width: d,
|
|
1011
|
-
height: f,
|
|
1012
|
-
x: p,
|
|
1013
|
-
y: m
|
|
1014
|
-
};
|
|
1015
|
-
}
|
|
1016
|
-
function getInnerBoundingClientRect(i, s) {
|
|
1017
|
-
let c = getBoundingClientRect(i, !0, s === "fixed"), l = c.top + i.clientTop, u = c.left + i.clientLeft, d = isHTMLElement$1(i) ? getScale(i) : createCoords(1);
|
|
1018
|
-
return {
|
|
1019
|
-
width: i.clientWidth * d.x,
|
|
1020
|
-
height: i.clientHeight * d.y,
|
|
1021
|
-
x: u * d.x,
|
|
1022
|
-
y: l * d.y
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
function getClientRectFromClippingAncestor(i, s, c) {
|
|
1026
|
-
let l;
|
|
1027
|
-
if (s === "viewport") l = getViewportRect(i, c);
|
|
1028
|
-
else if (s === "document") l = getDocumentRect(getDocumentElement$1(i));
|
|
1029
|
-
else if (isElement$1(s)) l = getInnerBoundingClientRect(s, c);
|
|
1030
|
-
else {
|
|
1031
|
-
let c = getVisualOffsets(i);
|
|
1032
|
-
l = {
|
|
1033
|
-
x: s.x - c.x,
|
|
1034
|
-
y: s.y - c.y,
|
|
1035
|
-
width: s.width,
|
|
1036
|
-
height: s.height
|
|
1037
|
-
};
|
|
1038
|
-
}
|
|
1039
|
-
return rectToClientRect(l);
|
|
1040
|
-
}
|
|
1041
|
-
function hasFixedPositionAncestor(i, s) {
|
|
1042
|
-
let c = getParentNode$2(i);
|
|
1043
|
-
return c === s || !isElement$1(c) || isLastTraversableNode(c) ? !1 : getComputedStyle$1(c).position === "fixed" || hasFixedPositionAncestor(c, s);
|
|
1044
|
-
}
|
|
1045
|
-
function getClippingElementAncestors(i, s) {
|
|
1046
|
-
let c = s.get(i);
|
|
1047
|
-
if (c) return c;
|
|
1048
|
-
let l = getOverflowAncestors(i, [], !1).filter((i) => isElement$1(i) && getNodeName$1(i) !== "body"), u = null, d = getComputedStyle$1(i).position === "fixed", f = d ? getParentNode$2(i) : i;
|
|
1049
|
-
for (; isElement$1(f) && !isLastTraversableNode(f);) {
|
|
1050
|
-
let s = getComputedStyle$1(f), c = isContainingBlock(f);
|
|
1051
|
-
!c && s.position === "fixed" && (u = null), (d ? !c && !u : !c && s.position === "static" && u && ["absolute", "fixed"].includes(u.position) || isOverflowElement$1(f) && !c && hasFixedPositionAncestor(i, f)) ? l = l.filter((i) => i !== f) : u = s, f = getParentNode$2(f);
|
|
1052
|
-
}
|
|
1053
|
-
return s.set(i, l), l;
|
|
1054
|
-
}
|
|
1055
|
-
function getClippingRect(i) {
|
|
1056
|
-
let { element: s, boundary: c, rootBoundary: l, strategy: u } = i, d = [...c === "clippingAncestors" ? isTopLayer(s) ? [] : getClippingElementAncestors(s, this._c) : [].concat(c), l], f = d[0], p = d.reduce((i, c) => {
|
|
1057
|
-
let l = getClientRectFromClippingAncestor(s, c, u);
|
|
1058
|
-
return i.top = max$1(l.top, i.top), i.right = min$1(l.right, i.right), i.bottom = min$1(l.bottom, i.bottom), i.left = max$1(l.left, i.left), i;
|
|
1059
|
-
}, getClientRectFromClippingAncestor(s, f, u));
|
|
1060
|
-
return {
|
|
1061
|
-
width: p.right - p.left,
|
|
1062
|
-
height: p.bottom - p.top,
|
|
1063
|
-
x: p.left,
|
|
1064
|
-
y: p.top
|
|
1065
|
-
};
|
|
1066
|
-
}
|
|
1067
|
-
function getDimensions(i) {
|
|
1068
|
-
let { width: s, height: c } = getCssDimensions(i);
|
|
1069
|
-
return {
|
|
1070
|
-
width: s,
|
|
1071
|
-
height: c
|
|
1072
|
-
};
|
|
1073
|
-
}
|
|
1074
|
-
function getRectRelativeToOffsetParent(i, s, c) {
|
|
1075
|
-
let l = isHTMLElement$1(s), u = getDocumentElement$1(s), d = c === "fixed", f = getBoundingClientRect(i, !0, d, s), p = {
|
|
1076
|
-
scrollLeft: 0,
|
|
1077
|
-
scrollTop: 0
|
|
1078
|
-
}, m = createCoords(0);
|
|
1079
|
-
function h() {
|
|
1080
|
-
m.x = getWindowScrollBarX(u);
|
|
1081
|
-
}
|
|
1082
|
-
if (l || !l && !d) if ((getNodeName$1(s) !== "body" || isOverflowElement$1(u)) && (p = getNodeScroll(s)), l) {
|
|
1083
|
-
let i = getBoundingClientRect(s, !0, d, s);
|
|
1084
|
-
m.x = i.x + s.clientLeft, m.y = i.y + s.clientTop;
|
|
1085
|
-
} else u && h();
|
|
1086
|
-
d && !l && u && h();
|
|
1087
|
-
let g = u && !l && !d ? getHTMLOffset(u, p) : createCoords(0);
|
|
1088
|
-
return {
|
|
1089
|
-
x: f.left + p.scrollLeft - m.x - g.x,
|
|
1090
|
-
y: f.top + p.scrollTop - m.y - g.y,
|
|
1091
|
-
width: f.width,
|
|
1092
|
-
height: f.height
|
|
1093
|
-
};
|
|
1094
|
-
}
|
|
1095
|
-
function isStaticPositioned(i) {
|
|
1096
|
-
return getComputedStyle$1(i).position === "static";
|
|
1097
|
-
}
|
|
1098
|
-
function getTrueOffsetParent(i, s) {
|
|
1099
|
-
if (!isHTMLElement$1(i) || getComputedStyle$1(i).position === "fixed") return null;
|
|
1100
|
-
if (s) return s(i);
|
|
1101
|
-
let c = i.offsetParent;
|
|
1102
|
-
return getDocumentElement$1(i) === c && (c = c.ownerDocument.body), c;
|
|
1103
|
-
}
|
|
1104
|
-
function getOffsetParent(i, s) {
|
|
1105
|
-
let c = getWindow$1(i);
|
|
1106
|
-
if (isTopLayer(i)) return c;
|
|
1107
|
-
if (!isHTMLElement$1(i)) {
|
|
1108
|
-
let s = getParentNode$2(i);
|
|
1109
|
-
for (; s && !isLastTraversableNode(s);) {
|
|
1110
|
-
if (isElement$1(s) && !isStaticPositioned(s)) return s;
|
|
1111
|
-
s = getParentNode$2(s);
|
|
1112
|
-
}
|
|
1113
|
-
return c;
|
|
1114
|
-
}
|
|
1115
|
-
let l = getTrueOffsetParent(i, s);
|
|
1116
|
-
for (; l && isTableElement(l) && isStaticPositioned(l);) l = getTrueOffsetParent(l, s);
|
|
1117
|
-
return l && isLastTraversableNode(l) && isStaticPositioned(l) && !isContainingBlock(l) ? c : l || getContainingBlock(i) || c;
|
|
1118
|
-
}
|
|
1119
|
-
var getElementRects = async function(i) {
|
|
1120
|
-
let s = this.getOffsetParent || getOffsetParent, c = this.getDimensions, l = await c(i.floating);
|
|
1121
|
-
return {
|
|
1122
|
-
reference: getRectRelativeToOffsetParent(i.reference, await s(i.floating), i.strategy),
|
|
1123
|
-
floating: {
|
|
1124
|
-
x: 0,
|
|
1125
|
-
y: 0,
|
|
1126
|
-
width: l.width,
|
|
1127
|
-
height: l.height
|
|
1128
|
-
}
|
|
1129
|
-
};
|
|
1130
|
-
};
|
|
1131
|
-
function isRTL(i) {
|
|
1132
|
-
return getComputedStyle$1(i).direction === "rtl";
|
|
1133
|
-
}
|
|
1134
|
-
var platform = {
|
|
1135
|
-
convertOffsetParentRelativeRectToViewportRelativeRect,
|
|
1136
|
-
getDocumentElement: getDocumentElement$1,
|
|
1137
|
-
getClippingRect,
|
|
1138
|
-
getOffsetParent,
|
|
1139
|
-
getElementRects,
|
|
1140
|
-
getClientRects,
|
|
1141
|
-
getDimensions,
|
|
1142
|
-
getScale,
|
|
1143
|
-
isElement: isElement$1,
|
|
1144
|
-
isRTL
|
|
1145
|
-
};
|
|
1146
|
-
function rectsAreEqual(i, s) {
|
|
1147
|
-
return i.x === s.x && i.y === s.y && i.width === s.width && i.height === s.height;
|
|
1148
|
-
}
|
|
1149
|
-
function observeMove(i, s) {
|
|
1150
|
-
let c = null, l, u = getDocumentElement$1(i);
|
|
1151
|
-
function d() {
|
|
1152
|
-
var i;
|
|
1153
|
-
clearTimeout(l), (i = c) == null || i.disconnect(), c = null;
|
|
1154
|
-
}
|
|
1155
|
-
function f(p, m) {
|
|
1156
|
-
p === void 0 && (p = !1), m === void 0 && (m = 1), d();
|
|
1157
|
-
let h = i.getBoundingClientRect(), { left: g, top: _, width: v, height: y } = h;
|
|
1158
|
-
if (p || s(), !v || !y) return;
|
|
1159
|
-
let b = floor$1(_), x = floor$1(u.clientWidth - (g + v)), S = floor$1(u.clientHeight - (_ + y)), C = floor$1(g), w = {
|
|
1160
|
-
rootMargin: -b + "px " + -x + "px " + -S + "px " + -C + "px",
|
|
1161
|
-
threshold: max$1(0, min$1(1, m)) || 1
|
|
1162
|
-
}, T = !0;
|
|
1163
|
-
function E(s) {
|
|
1164
|
-
let c = s[0].intersectionRatio;
|
|
1165
|
-
if (c !== m) {
|
|
1166
|
-
if (!T) return f();
|
|
1167
|
-
c ? f(!1, c) : l = setTimeout(() => {
|
|
1168
|
-
f(!1, 1e-7);
|
|
1169
|
-
}, 1e3);
|
|
1170
|
-
}
|
|
1171
|
-
c === 1 && !rectsAreEqual(h, i.getBoundingClientRect()) && f(), T = !1;
|
|
1172
|
-
}
|
|
1173
|
-
try {
|
|
1174
|
-
c = new IntersectionObserver(E, {
|
|
1175
|
-
...w,
|
|
1176
|
-
root: u.ownerDocument
|
|
1177
|
-
});
|
|
1178
|
-
} catch {
|
|
1179
|
-
c = new IntersectionObserver(E, w);
|
|
1180
|
-
}
|
|
1181
|
-
c.observe(i);
|
|
1182
|
-
}
|
|
1183
|
-
return f(!0), d;
|
|
1184
|
-
}
|
|
1185
|
-
function autoUpdate(i, s, c, l) {
|
|
1186
|
-
l === void 0 && (l = {});
|
|
1187
|
-
let { ancestorScroll: u = !0, ancestorResize: d = !0, elementResize: f = typeof ResizeObserver == "function", layoutShift: p = typeof IntersectionObserver == "function", animationFrame: m = !1 } = l, h = unwrapElement(i), g = u || d ? [...h ? getOverflowAncestors(h) : [], ...getOverflowAncestors(s)] : [];
|
|
1188
|
-
g.forEach((i) => {
|
|
1189
|
-
u && i.addEventListener("scroll", c, { passive: !0 }), d && i.addEventListener("resize", c);
|
|
1190
|
-
});
|
|
1191
|
-
let _ = h && p ? observeMove(h, c) : null, v = -1, y = null;
|
|
1192
|
-
f && (y = new ResizeObserver((i) => {
|
|
1193
|
-
let [l] = i;
|
|
1194
|
-
l && l.target === h && y && (y.unobserve(s), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
1195
|
-
var i;
|
|
1196
|
-
(i = y) == null || i.observe(s);
|
|
1197
|
-
})), c();
|
|
1198
|
-
}), h && !m && y.observe(h), y.observe(s));
|
|
1199
|
-
let b, x = m ? getBoundingClientRect(i) : null;
|
|
1200
|
-
m && S();
|
|
1201
|
-
function S() {
|
|
1202
|
-
let s = getBoundingClientRect(i);
|
|
1203
|
-
x && !rectsAreEqual(x, s) && c(), x = s, b = requestAnimationFrame(S);
|
|
1204
|
-
}
|
|
1205
|
-
return c(), () => {
|
|
1206
|
-
var i;
|
|
1207
|
-
g.forEach((i) => {
|
|
1208
|
-
u && i.removeEventListener("scroll", c), d && i.removeEventListener("resize", c);
|
|
1209
|
-
}), _?.(), (i = y) == null || i.disconnect(), y = null, m && cancelAnimationFrame(b);
|
|
1210
|
-
};
|
|
1211
|
-
}
|
|
1212
|
-
var offset = offset$1, shift = shift$1, flip = flip$1, size = size$1, hide = hide$1, arrow = arrow$1, limitShift = limitShift$1, computePosition = (i, s, c) => {
|
|
1213
|
-
let l = /* @__PURE__ */ new Map(), u = {
|
|
1214
|
-
platform,
|
|
1215
|
-
...c
|
|
1216
|
-
}, d = {
|
|
1217
|
-
...u.platform,
|
|
1218
|
-
_c: l
|
|
1219
|
-
};
|
|
1220
|
-
return computePosition$1(i, s, {
|
|
1221
|
-
...u,
|
|
1222
|
-
platform: d
|
|
1223
|
-
});
|
|
1224
|
-
};
|
|
1225
|
-
function createDOMRect(i = 0, s = 0, c = 0, l = 0) {
|
|
1226
|
-
if (typeof DOMRect == "function") return new DOMRect(i, s, c, l);
|
|
1227
|
-
let u = {
|
|
1228
|
-
x: i,
|
|
1229
|
-
y: s,
|
|
1230
|
-
width: c,
|
|
1231
|
-
height: l,
|
|
1232
|
-
top: s,
|
|
1233
|
-
right: i + c,
|
|
1234
|
-
bottom: s + l,
|
|
1235
|
-
left: i
|
|
1236
|
-
};
|
|
1237
|
-
return {
|
|
1238
|
-
...u,
|
|
1239
|
-
toJSON: () => u
|
|
1240
|
-
};
|
|
1241
|
-
}
|
|
1242
|
-
function getDOMRect(i) {
|
|
1243
|
-
if (!i) return createDOMRect();
|
|
1244
|
-
let { x: s, y: c, width: l, height: u } = i;
|
|
1245
|
-
return createDOMRect(s, c, l, u);
|
|
1246
|
-
}
|
|
1247
|
-
function getAnchorElement(i, s) {
|
|
1248
|
-
return {
|
|
1249
|
-
contextElement: isHTMLElement(i) ? i : void 0,
|
|
1250
|
-
getBoundingClientRect: () => {
|
|
1251
|
-
let c = i, l = s?.(c);
|
|
1252
|
-
return l || !c ? getDOMRect(l) : c.getBoundingClientRect();
|
|
1253
|
-
}
|
|
1254
|
-
};
|
|
1255
|
-
}
|
|
1256
|
-
var toVar = (i) => ({
|
|
1257
|
-
variable: i,
|
|
1258
|
-
reference: `var(${i})`
|
|
1259
|
-
}), cssVars = {
|
|
1260
|
-
arrowSize: toVar("--arrow-size"),
|
|
1261
|
-
arrowSizeHalf: toVar("--arrow-size-half"),
|
|
1262
|
-
arrowBg: toVar("--arrow-background"),
|
|
1263
|
-
transformOrigin: toVar("--transform-origin"),
|
|
1264
|
-
arrowOffset: toVar("--arrow-offset")
|
|
1265
|
-
};
|
|
1266
|
-
function getTransformOrigin(i) {
|
|
1267
|
-
return {
|
|
1268
|
-
top: "bottom center",
|
|
1269
|
-
"top-start": i ? `${i.x}px bottom` : "left bottom",
|
|
1270
|
-
"top-end": i ? `${i.x}px bottom` : "right bottom",
|
|
1271
|
-
bottom: "top center",
|
|
1272
|
-
"bottom-start": i ? `${i.x}px top` : "top left",
|
|
1273
|
-
"bottom-end": i ? `${i.x}px top` : "top right",
|
|
1274
|
-
left: "right center",
|
|
1275
|
-
"left-start": i ? `right ${i.y}px` : "right top",
|
|
1276
|
-
"left-end": i ? `right ${i.y}px` : "right bottom",
|
|
1277
|
-
right: "left center",
|
|
1278
|
-
"right-start": i ? `left ${i.y}px` : "left top",
|
|
1279
|
-
"right-end": i ? `left ${i.y}px` : "left bottom"
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
var transformOriginMiddleware = {
|
|
1283
|
-
name: "transformOrigin",
|
|
1284
|
-
fn({ placement: i, elements: s, middlewareData: c }) {
|
|
1285
|
-
let { arrow: l } = c, u = getTransformOrigin(l)[i], { floating: d } = s;
|
|
1286
|
-
return d.style.setProperty(cssVars.transformOrigin.variable, u), { data: { transformOrigin: u } };
|
|
1287
|
-
}
|
|
1288
|
-
}, rectMiddleware = {
|
|
1289
|
-
name: "rects",
|
|
1290
|
-
fn({ rects: i }) {
|
|
1291
|
-
return { data: i };
|
|
1292
|
-
}
|
|
1293
|
-
};
|
|
1294
|
-
function shiftArrowMiddleware(i) {
|
|
1295
|
-
if (i) return {
|
|
1296
|
-
name: "shiftArrow",
|
|
1297
|
-
fn({ placement: s, middlewareData: c }) {
|
|
1298
|
-
if (!c.arrow) return {};
|
|
1299
|
-
let { x: l, y: u } = c.arrow, d = s.split("-")[0];
|
|
1300
|
-
return Object.assign(i.style, {
|
|
1301
|
-
left: l == null ? "" : `${l}px`,
|
|
1302
|
-
top: u == null ? "" : `${u}px`,
|
|
1303
|
-
[d]: `calc(100% + ${cssVars.arrowOffset.reference})`
|
|
1304
|
-
}), {};
|
|
1305
|
-
}
|
|
1306
|
-
};
|
|
1307
|
-
}
|
|
1308
|
-
function getPlacementDetails(i) {
|
|
1309
|
-
let [s, c] = i.split("-");
|
|
1310
|
-
return {
|
|
1311
|
-
side: s,
|
|
1312
|
-
align: c,
|
|
1313
|
-
hasAlign: c != null
|
|
1314
|
-
};
|
|
1315
|
-
}
|
|
1316
|
-
var defaultOptions = {
|
|
1317
|
-
strategy: "absolute",
|
|
1318
|
-
placement: "bottom",
|
|
1319
|
-
listeners: !0,
|
|
1320
|
-
gutter: 8,
|
|
1321
|
-
flip: !0,
|
|
1322
|
-
slide: !0,
|
|
1323
|
-
overlap: !1,
|
|
1324
|
-
sameWidth: !1,
|
|
1325
|
-
fitViewport: !1,
|
|
1326
|
-
overflowPadding: 8,
|
|
1327
|
-
arrowPadding: 4
|
|
1328
|
-
};
|
|
1329
|
-
function roundByDpr(i, s) {
|
|
1330
|
-
let c = i.devicePixelRatio || 1;
|
|
1331
|
-
return Math.round(s * c) / c;
|
|
1332
|
-
}
|
|
1333
|
-
function getBoundaryMiddleware(i) {
|
|
1334
|
-
return runIfFn(i.boundary);
|
|
1335
|
-
}
|
|
1336
|
-
function getArrowMiddleware(i, s) {
|
|
1337
|
-
if (i) return arrow({
|
|
1338
|
-
element: i,
|
|
1339
|
-
padding: s.arrowPadding
|
|
1340
|
-
});
|
|
1341
|
-
}
|
|
1342
|
-
function getOffsetMiddleware(i, s) {
|
|
1343
|
-
if (!isNull(s.offset ?? s.gutter)) return offset(({ placement: c }) => {
|
|
1344
|
-
let l = (i?.clientHeight || 0) / 2, u = s.offset?.mainAxis ?? s.gutter, d = typeof u == "number" ? u + l : u ?? l, { hasAlign: f } = getPlacementDetails(c), p = f ? void 0 : s.shift;
|
|
1345
|
-
return compact({
|
|
1346
|
-
crossAxis: s.offset?.crossAxis ?? p,
|
|
1347
|
-
mainAxis: d,
|
|
1348
|
-
alignmentAxis: s.shift
|
|
1349
|
-
});
|
|
1350
|
-
});
|
|
1351
|
-
}
|
|
1352
|
-
function getFlipMiddleware(i) {
|
|
1353
|
-
if (i.flip) return flip({
|
|
1354
|
-
boundary: getBoundaryMiddleware(i),
|
|
1355
|
-
padding: i.overflowPadding,
|
|
1356
|
-
fallbackPlacements: i.flip === !0 ? void 0 : i.flip
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
function getShiftMiddleware(i) {
|
|
1360
|
-
if (!(!i.slide && !i.overlap)) return shift({
|
|
1361
|
-
boundary: getBoundaryMiddleware(i),
|
|
1362
|
-
mainAxis: i.slide,
|
|
1363
|
-
crossAxis: i.overlap,
|
|
1364
|
-
padding: i.overflowPadding,
|
|
1365
|
-
limiter: limitShift()
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
function getSizeMiddleware(i) {
|
|
1369
|
-
return size({
|
|
1370
|
-
padding: i.overflowPadding,
|
|
1371
|
-
apply({ elements: i, rects: s, availableHeight: c, availableWidth: l }) {
|
|
1372
|
-
let u = i.floating, d = Math.round(s.reference.width);
|
|
1373
|
-
l = Math.floor(l), c = Math.floor(c), u.style.setProperty("--reference-width", `${d}px`), u.style.setProperty("--available-width", `${l}px`), u.style.setProperty("--available-height", `${c}px`);
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
}
|
|
1377
|
-
function hideWhenDetachedMiddleware(i) {
|
|
1378
|
-
if (i.hideWhenDetached) return hide({
|
|
1379
|
-
strategy: "referenceHidden",
|
|
1380
|
-
boundary: i.boundary?.() ?? "clippingAncestors"
|
|
1381
|
-
});
|
|
1382
|
-
}
|
|
1383
|
-
function getAutoUpdateOptions(i) {
|
|
1384
|
-
return i ? i === !0 ? {
|
|
1385
|
-
ancestorResize: !0,
|
|
1386
|
-
ancestorScroll: !0,
|
|
1387
|
-
elementResize: !0,
|
|
1388
|
-
layoutShift: !0
|
|
1389
|
-
} : i : {};
|
|
1390
|
-
}
|
|
1391
|
-
function getPlacementImpl(i, s, c = {}) {
|
|
1392
|
-
let l = getAnchorElement(i, c.getAnchorRect);
|
|
1393
|
-
if (!s || !l) return;
|
|
1394
|
-
let u = Object.assign({}, defaultOptions, c), d = s.querySelector("[data-part=arrow]"), f = [
|
|
1395
|
-
getOffsetMiddleware(d, u),
|
|
1396
|
-
getFlipMiddleware(u),
|
|
1397
|
-
getShiftMiddleware(u),
|
|
1398
|
-
getArrowMiddleware(d, u),
|
|
1399
|
-
shiftArrowMiddleware(d),
|
|
1400
|
-
transformOriginMiddleware,
|
|
1401
|
-
getSizeMiddleware(u),
|
|
1402
|
-
hideWhenDetachedMiddleware(u),
|
|
1403
|
-
rectMiddleware
|
|
1404
|
-
], { placement: p, strategy: m, onComplete: h, onPositioned: g } = u, _ = async () => {
|
|
1405
|
-
if (!l || !s) return;
|
|
1406
|
-
let i = await computePosition(l, s, {
|
|
1407
|
-
placement: p,
|
|
1408
|
-
middleware: f,
|
|
1409
|
-
strategy: m
|
|
1410
|
-
});
|
|
1411
|
-
h?.(i), g?.({ placed: !0 });
|
|
1412
|
-
let c = getWindow(s), d = roundByDpr(c, i.x), _ = roundByDpr(c, i.y);
|
|
1413
|
-
s.style.setProperty("--x", `${d}px`), s.style.setProperty("--y", `${_}px`), u.hideWhenDetached && (i.middlewareData.hide?.referenceHidden ? (s.style.setProperty("visibility", "hidden"), s.style.setProperty("pointer-events", "none")) : (s.style.removeProperty("visibility"), s.style.removeProperty("pointer-events")));
|
|
1414
|
-
let v = s.firstElementChild;
|
|
1415
|
-
if (v) {
|
|
1416
|
-
let i = getComputedStyle(v);
|
|
1417
|
-
s.style.setProperty("--z-index", i.zIndex);
|
|
1418
|
-
}
|
|
1419
|
-
}, v = async () => {
|
|
1420
|
-
c.updatePosition ? (await c.updatePosition({ updatePosition: _ }), g?.({ placed: !0 })) : await _();
|
|
1421
|
-
}, y = getAutoUpdateOptions(u.listeners), b = u.listeners ? autoUpdate(l, s, v, y) : noop;
|
|
1422
|
-
return v(), () => {
|
|
1423
|
-
b?.(), g?.({ placed: !1 });
|
|
1424
|
-
};
|
|
1425
|
-
}
|
|
1426
|
-
function getPlacement(i, s, c = {}) {
|
|
1427
|
-
let { defer: l, ...u } = c, d = l ? raf$1 : (i) => i(), f = [];
|
|
1428
|
-
return f.push(d(() => {
|
|
1429
|
-
let c = typeof i == "function" ? i() : i, l = typeof s == "function" ? s() : s;
|
|
1430
|
-
f.push(getPlacementImpl(c, l, u));
|
|
1431
|
-
})), () => {
|
|
1432
|
-
f.forEach((i) => i?.());
|
|
1433
|
-
};
|
|
1434
|
-
}
|
|
1435
|
-
var ARROW_FLOATING_STYLE = {
|
|
1436
|
-
bottom: "rotate(45deg)",
|
|
1437
|
-
left: "rotate(135deg)",
|
|
1438
|
-
top: "rotate(225deg)",
|
|
1439
|
-
right: "rotate(315deg)"
|
|
1440
|
-
};
|
|
1441
|
-
function getPlacementStyles(i = {}) {
|
|
1442
|
-
let { placement: s, sameWidth: c, fitViewport: l, strategy: u = "absolute" } = i;
|
|
1443
|
-
return {
|
|
1444
|
-
arrow: {
|
|
1445
|
-
position: "absolute",
|
|
1446
|
-
width: cssVars.arrowSize.reference,
|
|
1447
|
-
height: cssVars.arrowSize.reference,
|
|
1448
|
-
[cssVars.arrowSizeHalf.variable]: `calc(${cssVars.arrowSize.reference} / 2)`,
|
|
1449
|
-
[cssVars.arrowOffset.variable]: `calc(${cssVars.arrowSizeHalf.reference} * -1)`
|
|
1450
|
-
},
|
|
1451
|
-
arrowTip: {
|
|
1452
|
-
transform: s ? ARROW_FLOATING_STYLE[s.split("-")[0]] : void 0,
|
|
1453
|
-
background: cssVars.arrowBg.reference,
|
|
1454
|
-
top: "0",
|
|
1455
|
-
left: "0",
|
|
1456
|
-
width: "100%",
|
|
1457
|
-
height: "100%",
|
|
1458
|
-
position: "absolute",
|
|
1459
|
-
zIndex: "inherit"
|
|
1460
|
-
},
|
|
1461
|
-
floating: {
|
|
1462
|
-
position: u,
|
|
1463
|
-
isolation: "isolate",
|
|
1464
|
-
minWidth: c ? void 0 : "max-content",
|
|
1465
|
-
width: c ? "var(--reference-width)" : void 0,
|
|
1466
|
-
maxWidth: l ? "var(--available-width)" : void 0,
|
|
1467
|
-
maxHeight: l ? "var(--available-height)" : void 0,
|
|
1468
|
-
top: "0px",
|
|
1469
|
-
left: "0px",
|
|
1470
|
-
transform: s ? "translate3d(var(--x), var(--y), 0)" : "translate3d(0, -100vh, 0)",
|
|
1471
|
-
zIndex: "var(--z-index)"
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
}
|
|
1475
|
-
var counterMap = /* @__PURE__ */ new WeakMap(), uncontrolledNodes = /* @__PURE__ */ new WeakMap(), markerMap = {}, lockCount = 0;
|
|
1476
|
-
function unwrapHost(i) {
|
|
1477
|
-
return i && (i.host || unwrapHost(i.parentNode));
|
|
1478
|
-
}
|
|
1479
|
-
function correctTargets(i, s) {
|
|
1480
|
-
return s.map((s) => {
|
|
1481
|
-
if (i.contains(s)) return s;
|
|
1482
|
-
let c = unwrapHost(s);
|
|
1483
|
-
return c && i.contains(c) ? c : (console.error("[@destyler/aria-hidden] target", s, "in not contained inside", i, ". Doing nothing"), null);
|
|
1484
|
-
}).filter((i) => !!i);
|
|
1485
|
-
}
|
|
1486
|
-
function isIgnoredNode(i) {
|
|
1487
|
-
return i.localName === "next-route-announcer" || i.localName === "script" || i.hasAttribute("aria-live") ? !0 : i.matches("[data-live-announcer]");
|
|
1488
|
-
}
|
|
1489
|
-
function walkTreeOutside(i, s) {
|
|
1490
|
-
let { parentNode: c, markerName: l, controlAttribute: u, explicitBooleanValue: d } = s, f = correctTargets(c, Array.isArray(i) ? i : [i]);
|
|
1491
|
-
markerMap[l] ||= /* @__PURE__ */ new WeakMap();
|
|
1492
|
-
let p = markerMap[l], m = [], h = /* @__PURE__ */ new Set(), g = new Set(f), _ = (i) => {
|
|
1493
|
-
!i || h.has(i) || (h.add(i), _(i.parentNode));
|
|
1494
|
-
};
|
|
1495
|
-
f.forEach(_);
|
|
1496
|
-
let v = (i) => {
|
|
1497
|
-
!i || g.has(i) || Array.prototype.forEach.call(i.children, (i) => {
|
|
1498
|
-
if (h.has(i)) v(i);
|
|
1499
|
-
else try {
|
|
1500
|
-
if (isIgnoredNode(i)) return;
|
|
1501
|
-
let s = i.getAttribute(u), c = d ? s === "true" : s !== null && s !== "false", f = (counterMap.get(i) || 0) + 1, h = (p.get(i) || 0) + 1;
|
|
1502
|
-
counterMap.set(i, f), p.set(i, h), m.push(i), f === 1 && c && uncontrolledNodes.set(i, !0), h === 1 && i.setAttribute(l, ""), c || i.setAttribute(u, d ? "true" : "");
|
|
1503
|
-
} catch (s) {
|
|
1504
|
-
console.error("[@destyler/aria-hidden] cannot operate on ", i, s);
|
|
1505
|
-
}
|
|
1506
|
-
});
|
|
1507
|
-
};
|
|
1508
|
-
return v(c), h.clear(), lockCount++, () => {
|
|
1509
|
-
m.forEach((i) => {
|
|
1510
|
-
let s = counterMap.get(i) - 1, c = p.get(i) - 1;
|
|
1511
|
-
counterMap.set(i, s), p.set(i, c), s || (uncontrolledNodes.has(i) || i.removeAttribute(u), uncontrolledNodes.delete(i)), c || i.removeAttribute(l);
|
|
1512
|
-
}), lockCount--, lockCount || (counterMap = /* @__PURE__ */ new WeakMap(), counterMap = /* @__PURE__ */ new WeakMap(), uncontrolledNodes = /* @__PURE__ */ new WeakMap(), markerMap = {});
|
|
1513
|
-
};
|
|
1514
|
-
}
|
|
1515
|
-
function getParentNode(i) {
|
|
1516
|
-
return (Array.isArray(i) ? i[0] : i).ownerDocument.body;
|
|
1517
|
-
}
|
|
1518
|
-
function hideOthers(i, s = getParentNode(i), c = "data-aria-hidden") {
|
|
1519
|
-
if (s) return walkTreeOutside(i, {
|
|
1520
|
-
parentNode: s,
|
|
1521
|
-
markerName: c,
|
|
1522
|
-
controlAttribute: "aria-hidden",
|
|
1523
|
-
explicitBooleanValue: !0
|
|
1524
|
-
});
|
|
1525
|
-
}
|
|
1526
|
-
function raf(i) {
|
|
1527
|
-
let s = requestAnimationFrame(() => i());
|
|
1528
|
-
return () => cancelAnimationFrame(s);
|
|
1529
|
-
}
|
|
1530
|
-
function ariaHidden(i, s = {}) {
|
|
1531
|
-
let { defer: c = !0 } = s, l = c ? raf : (i) => i(), u = [];
|
|
1532
|
-
return u.push(l(() => {
|
|
1533
|
-
let s = (typeof i == "function" ? i() : i).filter(Boolean);
|
|
1534
|
-
s.length !== 0 && u.push(hideOthers(s));
|
|
1535
|
-
})), () => {
|
|
1536
|
-
u.forEach((i) => i?.());
|
|
1537
|
-
};
|
|
1538
|
-
}
|
|
1539
|
-
function getWindowFrames(i) {
|
|
1540
|
-
let s = {
|
|
1541
|
-
each(s) {
|
|
1542
|
-
for (let c = 0; c < i.frames?.length; c += 1) {
|
|
1543
|
-
let l = i.frames[c];
|
|
1544
|
-
l && s(l);
|
|
1545
|
-
}
|
|
1546
|
-
},
|
|
1547
|
-
addEventListener(i, c, l) {
|
|
1548
|
-
return s.each((s) => {
|
|
1549
|
-
try {
|
|
1550
|
-
s.document.addEventListener(i, c, l);
|
|
1551
|
-
} catch {}
|
|
1552
|
-
}), () => {
|
|
1553
|
-
try {
|
|
1554
|
-
s.removeEventListener(i, c, l);
|
|
1555
|
-
} catch {}
|
|
1556
|
-
};
|
|
1557
|
-
},
|
|
1558
|
-
removeEventListener(i, c, l) {
|
|
1559
|
-
s.each((s) => {
|
|
1560
|
-
try {
|
|
1561
|
-
s.document.removeEventListener(i, c, l);
|
|
1562
|
-
} catch {}
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
return s;
|
|
1567
|
-
}
|
|
1568
|
-
function getParentWindow(i) {
|
|
1569
|
-
let s = i.frameElement == null ? null : i.parent;
|
|
1570
|
-
return {
|
|
1571
|
-
addEventListener: (i, c, l) => {
|
|
1572
|
-
try {
|
|
1573
|
-
s?.addEventListener(i, c, l);
|
|
1574
|
-
} catch {}
|
|
1575
|
-
return () => {
|
|
1576
|
-
try {
|
|
1577
|
-
s?.removeEventListener(i, c, l);
|
|
1578
|
-
} catch {}
|
|
1579
|
-
};
|
|
1580
|
-
},
|
|
1581
|
-
removeEventListener: (i, c, l) => {
|
|
1582
|
-
try {
|
|
1583
|
-
s?.removeEventListener(i, c, l);
|
|
1584
|
-
} catch {}
|
|
1585
|
-
}
|
|
1586
|
-
};
|
|
1587
|
-
}
|
|
1588
|
-
var POINTER_OUTSIDE_EVENT = "pointerdown.outside", FOCUS_OUTSIDE_EVENT = "focus.outside";
|
|
1589
|
-
function isComposedPathFocusable(i) {
|
|
1590
|
-
for (let s of i) if (isHTMLElement(s) && isFocusable(s)) return !0;
|
|
1591
|
-
return !1;
|
|
1592
|
-
}
|
|
1593
|
-
var isPointerEvent = (i) => "clientY" in i;
|
|
1594
|
-
function isEventPointWithin(i, s) {
|
|
1595
|
-
if (!isPointerEvent(s) || !i) return !1;
|
|
1596
|
-
let c = i.getBoundingClientRect();
|
|
1597
|
-
return c.width === 0 || c.height === 0 ? !1 : c.top <= s.clientY && s.clientY <= c.top + c.height && c.left <= s.clientX && s.clientX <= c.left + c.width;
|
|
1598
|
-
}
|
|
1599
|
-
function isPointInRect(i, s) {
|
|
1600
|
-
return i.y <= s.y && s.y <= i.y + i.height && i.x <= s.x && s.x <= i.x + i.width;
|
|
1601
|
-
}
|
|
1602
|
-
function isEventWithinScrollbar(i, s) {
|
|
1603
|
-
if (!s || !isPointerEvent(i)) return !1;
|
|
1604
|
-
let c = s.scrollHeight > s.clientHeight, l = c && i.clientX > s.offsetLeft + s.clientWidth, u = s.scrollWidth > s.clientWidth, d = u && i.clientY > s.offsetTop + s.clientHeight;
|
|
1605
|
-
return isPointInRect({
|
|
1606
|
-
x: s.offsetLeft,
|
|
1607
|
-
y: s.offsetTop,
|
|
1608
|
-
width: s.clientWidth + (c ? 16 : 0),
|
|
1609
|
-
height: s.clientHeight + (u ? 16 : 0)
|
|
1610
|
-
}, {
|
|
1611
|
-
x: i.clientX,
|
|
1612
|
-
y: i.clientY
|
|
1613
|
-
}) ? l || d : !1;
|
|
1614
|
-
}
|
|
1615
|
-
function trackInteractOutsideImpl(i, s) {
|
|
1616
|
-
let { exclude: c, onFocusOutside: l, onPointerDownOutside: u, onInteractOutside: d, defer: f } = s;
|
|
1617
|
-
if (!i) return;
|
|
1618
|
-
let p = getDocument(i), m = getWindow(i), h = getWindowFrames(m), g = getParentWindow(m);
|
|
1619
|
-
function _(s) {
|
|
1620
|
-
let l = getEventTarget(s);
|
|
1621
|
-
if (!isHTMLElement(l) || !l.isConnected || contains(i, l) || isEventPointWithin(i, s)) return !1;
|
|
1622
|
-
let u = p.querySelector(`[aria-controls="${i.id}"]`);
|
|
1623
|
-
return u && isEventWithinScrollbar(s, getNearestOverflowAncestor(u)) || isEventWithinScrollbar(s, getNearestOverflowAncestor(i)) ? !1 : !c?.(l);
|
|
1624
|
-
}
|
|
1625
|
-
let v = /* @__PURE__ */ new Set();
|
|
1626
|
-
function y(s) {
|
|
1627
|
-
function c() {
|
|
1628
|
-
let c = f ? raf$1 : (i) => i(), l = s.composedPath?.() ?? [s.target];
|
|
1629
|
-
c(() => {
|
|
1630
|
-
if (!(!i || !_(s))) {
|
|
1631
|
-
if (u || d) {
|
|
1632
|
-
let s = callAll(u, d);
|
|
1633
|
-
i.addEventListener(POINTER_OUTSIDE_EVENT, s, { once: !0 });
|
|
1634
|
-
}
|
|
1635
|
-
fireCustomEvent(i, POINTER_OUTSIDE_EVENT, {
|
|
1636
|
-
bubbles: !1,
|
|
1637
|
-
cancelable: !0,
|
|
1638
|
-
detail: {
|
|
1639
|
-
originalEvent: s,
|
|
1640
|
-
contextmenu: isContextMenuEvent(s),
|
|
1641
|
-
focusable: isComposedPathFocusable(l)
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
}
|
|
1645
|
-
});
|
|
1646
|
-
}
|
|
1647
|
-
s.pointerType === "touch" ? (v.forEach((i) => i()), v.add(addDomEvent(p, "click", c, { once: !0 })), v.add(g.addEventListener("click", c, { once: !0 })), v.add(h.addEventListener("click", c, { once: !0 }))) : c();
|
|
1648
|
-
}
|
|
1649
|
-
let b = /* @__PURE__ */ new Set(), x = setTimeout(() => {
|
|
1650
|
-
b.add(addDomEvent(p, "pointerdown", y, !0)), b.add(g.addEventListener("pointerdown", y, !0)), b.add(h.addEventListener("pointerdown", y, !0));
|
|
1651
|
-
}, 0);
|
|
1652
|
-
function S(s) {
|
|
1653
|
-
(f ? raf$1 : (i) => i())(() => {
|
|
1654
|
-
if (!(!i || !_(s))) {
|
|
1655
|
-
if (l || d) {
|
|
1656
|
-
let s = callAll(l, d);
|
|
1657
|
-
i.addEventListener(FOCUS_OUTSIDE_EVENT, s, { once: !0 });
|
|
1658
|
-
}
|
|
1659
|
-
fireCustomEvent(i, FOCUS_OUTSIDE_EVENT, {
|
|
1660
|
-
bubbles: !1,
|
|
1661
|
-
cancelable: !0,
|
|
1662
|
-
detail: {
|
|
1663
|
-
originalEvent: s,
|
|
1664
|
-
contextmenu: !1,
|
|
1665
|
-
focusable: isFocusable(getEventTarget(s))
|
|
1666
|
-
}
|
|
1667
|
-
});
|
|
1668
|
-
}
|
|
1669
|
-
});
|
|
1670
|
-
}
|
|
1671
|
-
return b.add(addDomEvent(p, "focusin", S, !0)), b.add(g.addEventListener("focusin", S, !0)), b.add(h.addEventListener("focusin", S, !0)), () => {
|
|
1672
|
-
clearTimeout(x), v.forEach((i) => i()), b.forEach((i) => i());
|
|
1673
|
-
};
|
|
1674
|
-
}
|
|
1675
|
-
function trackInteractOutside(i, s) {
|
|
1676
|
-
let { defer: c } = s, l = c ? raf$1 : (i) => i(), u = [];
|
|
1677
|
-
return u.push(l(() => {
|
|
1678
|
-
let c = typeof i == "function" ? i() : i;
|
|
1679
|
-
u.push(trackInteractOutsideImpl(c, s));
|
|
1680
|
-
})), () => {
|
|
1681
|
-
u.forEach((i) => i?.());
|
|
1682
|
-
};
|
|
1683
|
-
}
|
|
1684
|
-
function fireCustomEvent(i, s, c) {
|
|
1685
|
-
let l = new (i.ownerDocument.defaultView || window).CustomEvent(s, c);
|
|
1686
|
-
return i.dispatchEvent(l);
|
|
1687
|
-
}
|
|
1688
|
-
function trackEscapeKeydown(i, s) {
|
|
1689
|
-
return addDomEvent(getDocument(i), "keydown", (i) => {
|
|
1690
|
-
i.key === "Escape" && (i.isComposing || s?.(i));
|
|
1691
|
-
}, { capture: !0 });
|
|
1692
|
-
}
|
|
1693
|
-
var layerStack = {
|
|
1694
|
-
layers: [],
|
|
1695
|
-
branches: [],
|
|
1696
|
-
count() {
|
|
1697
|
-
return this.layers.length;
|
|
1698
|
-
},
|
|
1699
|
-
pointerBlockingLayers() {
|
|
1700
|
-
return this.layers.filter((i) => i.pointerBlocking);
|
|
1701
|
-
},
|
|
1702
|
-
topMostPointerBlockingLayer() {
|
|
1703
|
-
return [...this.pointerBlockingLayers()].slice(-1)[0];
|
|
1704
|
-
},
|
|
1705
|
-
hasPointerBlockingLayer() {
|
|
1706
|
-
return this.pointerBlockingLayers().length > 0;
|
|
1707
|
-
},
|
|
1708
|
-
isBelowPointerBlockingLayer(i) {
|
|
1709
|
-
return this.indexOf(i) < (this.topMostPointerBlockingLayer() ? this.indexOf(this.topMostPointerBlockingLayer()?.node) : -1);
|
|
1710
|
-
},
|
|
1711
|
-
isTopMost(i) {
|
|
1712
|
-
return this.layers[this.count() - 1]?.node === i;
|
|
1713
|
-
},
|
|
1714
|
-
getNestedLayers(i) {
|
|
1715
|
-
return Array.from(this.layers).slice(this.indexOf(i) + 1);
|
|
1716
|
-
},
|
|
1717
|
-
isInNestedLayer(i, s) {
|
|
1718
|
-
return this.getNestedLayers(i).some((i) => contains(i.node, s));
|
|
1719
|
-
},
|
|
1720
|
-
isInBranch(i) {
|
|
1721
|
-
return Array.from(this.branches).some((s) => contains(s, i));
|
|
1722
|
-
},
|
|
1723
|
-
add(i) {
|
|
1724
|
-
let s = this.layers.push(i);
|
|
1725
|
-
i.node.style.setProperty("--layer-index", `${s}`);
|
|
1726
|
-
},
|
|
1727
|
-
addBranch(i) {
|
|
1728
|
-
this.branches.push(i);
|
|
1729
|
-
},
|
|
1730
|
-
remove(i) {
|
|
1731
|
-
let s = this.indexOf(i);
|
|
1732
|
-
s < 0 || (s < this.count() - 1 && this.getNestedLayers(i).forEach((i) => i.dismiss()), this.layers.splice(s, 1), i.style.removeProperty("--layer-index"));
|
|
1733
|
-
},
|
|
1734
|
-
removeBranch(i) {
|
|
1735
|
-
let s = this.branches.indexOf(i);
|
|
1736
|
-
s >= 0 && this.branches.splice(s, 1);
|
|
1737
|
-
},
|
|
1738
|
-
indexOf(i) {
|
|
1739
|
-
return this.layers.findIndex((s) => s.node === i);
|
|
1740
|
-
},
|
|
1741
|
-
dismiss(i) {
|
|
1742
|
-
this.layers[this.indexOf(i)]?.dismiss();
|
|
1743
|
-
},
|
|
1744
|
-
clear() {
|
|
1745
|
-
this.remove(this.layers[0].node);
|
|
1746
|
-
}
|
|
1747
|
-
}, originalBodyPointerEvents;
|
|
1748
|
-
function assignPointerEventToLayers() {
|
|
1749
|
-
layerStack.layers.forEach(({ node: i }) => {
|
|
1750
|
-
i.style.pointerEvents = layerStack.isBelowPointerBlockingLayer(i) ? "none" : "auto";
|
|
1751
|
-
});
|
|
1752
|
-
}
|
|
1753
|
-
function clearPointerEvent(i) {
|
|
1754
|
-
i.style.pointerEvents = "";
|
|
1755
|
-
}
|
|
1756
|
-
function disablePointerEventsOutside(i, s) {
|
|
1757
|
-
let c = getDocument(i), l = [];
|
|
1758
|
-
if (layerStack.hasPointerBlockingLayer() && !c.body.hasAttribute("data-inert") && (originalBodyPointerEvents = document.body.style.pointerEvents, queueMicrotask(() => {
|
|
1759
|
-
c.body.style.pointerEvents = "none", c.body.setAttribute("data-inert", "");
|
|
1760
|
-
})), s) {
|
|
1761
|
-
let i = waitForElements(s, (i) => {
|
|
1762
|
-
l.push(setStyle(i, { pointerEvents: "auto" }));
|
|
1763
|
-
});
|
|
1764
|
-
l.push(i);
|
|
1765
|
-
}
|
|
1766
|
-
return () => {
|
|
1767
|
-
layerStack.hasPointerBlockingLayer() || (queueMicrotask(() => {
|
|
1768
|
-
c.body.style.pointerEvents = originalBodyPointerEvents, c.body.removeAttribute("data-inert"), c.body.style.length === 0 && c.body.removeAttribute("style");
|
|
1769
|
-
}), l.forEach((i) => i()));
|
|
1770
|
-
};
|
|
1771
|
-
}
|
|
1772
|
-
function trackDismissableElementImpl(i, s) {
|
|
1773
|
-
if (!i) throw Error("[@destyler/dismissable] node is `null` or `undefined`");
|
|
1774
|
-
let { onDismiss: c, pointerBlocking: l, exclude: u, debug: d } = s, f = {
|
|
1775
|
-
dismiss: c,
|
|
1776
|
-
node: i,
|
|
1777
|
-
pointerBlocking: l
|
|
1778
|
-
};
|
|
1779
|
-
layerStack.add(f), assignPointerEventToLayers();
|
|
1780
|
-
function p(l) {
|
|
1781
|
-
let u = getEventTarget(l.detail.originalEvent);
|
|
1782
|
-
layerStack.isBelowPointerBlockingLayer(i) || layerStack.isInBranch(u) || (s.onPointerDownOutside?.(l), s.onInteractOutside?.(l), !l.defaultPrevented && (d && console.log("onPointerDownOutside:", l.detail.originalEvent), c?.()));
|
|
1783
|
-
}
|
|
1784
|
-
function m(i) {
|
|
1785
|
-
let l = getEventTarget(i.detail.originalEvent);
|
|
1786
|
-
layerStack.isInBranch(l) || (s.onFocusOutside?.(i), s.onInteractOutside?.(i), !i.defaultPrevented && (d && console.log("onFocusOutside:", i.detail.originalEvent), c?.()));
|
|
1787
|
-
}
|
|
1788
|
-
function h(l) {
|
|
1789
|
-
layerStack.isTopMost(i) && (s.onEscapeKeyDown?.(l), !l.defaultPrevented && c && (l.preventDefault(), c()));
|
|
1790
|
-
}
|
|
1791
|
-
function g(c) {
|
|
1792
|
-
if (!i) return !1;
|
|
1793
|
-
let l = typeof u == "function" ? u() : u, d = Array.isArray(l) ? l : [l], f = s.persistentElements?.map((i) => i()).filter(isHTMLElement);
|
|
1794
|
-
return f && d.push(...f), d.some((i) => contains(i, c)) || layerStack.isInNestedLayer(i, c);
|
|
1795
|
-
}
|
|
1796
|
-
let _ = [
|
|
1797
|
-
l ? disablePointerEventsOutside(i, s.persistentElements) : void 0,
|
|
1798
|
-
trackEscapeKeydown(i, h),
|
|
1799
|
-
trackInteractOutside(i, {
|
|
1800
|
-
exclude: g,
|
|
1801
|
-
onFocusOutside: m,
|
|
1802
|
-
onPointerDownOutside: p,
|
|
1803
|
-
defer: s.defer
|
|
1804
|
-
})
|
|
1805
|
-
];
|
|
1806
|
-
return () => {
|
|
1807
|
-
layerStack.remove(i), assignPointerEventToLayers(), clearPointerEvent(i), _.forEach((i) => i?.());
|
|
1808
|
-
};
|
|
1809
|
-
}
|
|
1810
|
-
function trackDismissableElement(i, s) {
|
|
1811
|
-
let { defer: c } = s, l = c ? raf$1 : (i) => i(), u = [];
|
|
1812
|
-
return u.push(l(() => {
|
|
1813
|
-
let c = isFunction(i) ? i() : i;
|
|
1814
|
-
u.push(trackDismissableElementImpl(c, s));
|
|
1815
|
-
})), () => {
|
|
1816
|
-
u.forEach((i) => i?.());
|
|
1817
|
-
};
|
|
1818
|
-
}
|
|
1819
|
-
var isTabEvent = (i) => i.key === "Tab", valueOrHandler = (i, ...s) => typeof i == "function" ? i(...s) : i, isEscapeEvent = (i) => !i.isComposing && i.key === "Escape", delay = (i) => setTimeout(i, 0);
|
|
1820
|
-
function isSelectableInput(i) {
|
|
1821
|
-
return i.localName === "input" && "select" in i && typeof i.select == "function";
|
|
1822
|
-
}
|
|
1823
|
-
var activeFocusTraps = {
|
|
1824
|
-
activateTrap(i, s) {
|
|
1825
|
-
if (i.length > 0) {
|
|
1826
|
-
let c = i[i.length - 1];
|
|
1827
|
-
c !== s && c.pause();
|
|
1828
|
-
}
|
|
1829
|
-
let c = i.indexOf(s);
|
|
1830
|
-
c === -1 || i.splice(c, 1), i.push(s);
|
|
1831
|
-
},
|
|
1832
|
-
deactivateTrap(i, s) {
|
|
1833
|
-
let c = i.indexOf(s);
|
|
1834
|
-
c !== -1 && i.splice(c, 1), i.length > 0 && i[i.length - 1].unpause();
|
|
1835
|
-
}
|
|
1836
|
-
}, sharedTrapStack = [], FocusTrap = class {
|
|
1837
|
-
trapStack;
|
|
1838
|
-
config;
|
|
1839
|
-
doc;
|
|
1840
|
-
state = {
|
|
1841
|
-
containers: [],
|
|
1842
|
-
containerGroups: [],
|
|
1843
|
-
tabbableGroups: [],
|
|
1844
|
-
nodeFocusedBeforeActivation: null,
|
|
1845
|
-
mostRecentlyFocusedNode: null,
|
|
1846
|
-
active: !1,
|
|
1847
|
-
paused: !1,
|
|
1848
|
-
delayInitialFocusTimer: void 0,
|
|
1849
|
-
recentNavEvent: void 0
|
|
1850
|
-
};
|
|
1851
|
-
get active() {
|
|
1852
|
-
return this.state.active;
|
|
1853
|
-
}
|
|
1854
|
-
get paused() {
|
|
1855
|
-
return this.state.paused;
|
|
1856
|
-
}
|
|
1857
|
-
constructor(i, s) {
|
|
1858
|
-
this.trapStack = s.trapStack || sharedTrapStack;
|
|
1859
|
-
let c = {
|
|
1860
|
-
returnFocusOnDeactivate: !0,
|
|
1861
|
-
escapeDeactivates: !0,
|
|
1862
|
-
delayInitialFocus: !0,
|
|
1863
|
-
isKeyForward(i) {
|
|
1864
|
-
return isTabEvent(i) && !i.shiftKey;
|
|
1865
|
-
},
|
|
1866
|
-
isKeyBackward(i) {
|
|
1867
|
-
return isTabEvent(i) && i.shiftKey;
|
|
1868
|
-
},
|
|
1869
|
-
...s
|
|
1870
|
-
};
|
|
1871
|
-
this.doc = c.document || getDocument(Array.isArray(i) ? i[0] : i), this.config = c, this.updateContainerElements(i), this.setupMutationObserver();
|
|
1872
|
-
}
|
|
1873
|
-
findContainerIndex(i, s) {
|
|
1874
|
-
let c = typeof s?.composedPath == "function" ? s.composedPath() : void 0;
|
|
1875
|
-
return this.state.containerGroups.findIndex(({ container: s, tabbableNodes: l }) => s.contains(i) || c?.includes(s) || l.find((s) => s === i));
|
|
1876
|
-
}
|
|
1877
|
-
updateTabbableNodes() {
|
|
1878
|
-
if (this.state.containerGroups = this.state.containers.map((i) => {
|
|
1879
|
-
let s = getTabbables(i), c = getFocusables(i), l = s.length > 0 ? s[0] : void 0, u = s.length > 0 ? s[s.length - 1] : void 0, d = c.find((i) => isTabbable(i)), f = c.slice().reverse().find((i) => isTabbable(i)), p = !!s.find((i) => getTabIndex(i) > 0);
|
|
1880
|
-
function m(i, l = !0) {
|
|
1881
|
-
let u = s.indexOf(i);
|
|
1882
|
-
return u < 0 ? l ? c.slice(c.indexOf(i) + 1).find((i) => isTabbable(i)) : c.slice(0, c.indexOf(i)).reverse().find((i) => isTabbable(i)) : s[u + (l ? 1 : -1)];
|
|
1883
|
-
}
|
|
1884
|
-
return {
|
|
1885
|
-
container: i,
|
|
1886
|
-
tabbableNodes: s,
|
|
1887
|
-
focusableNodes: c,
|
|
1888
|
-
posTabIndexesFound: p,
|
|
1889
|
-
firstTabbableNode: l,
|
|
1890
|
-
lastTabbableNode: u,
|
|
1891
|
-
firstDomTabbableNode: d,
|
|
1892
|
-
lastDomTabbableNode: f,
|
|
1893
|
-
nextTabbableNode: m
|
|
1894
|
-
};
|
|
1895
|
-
}), this.state.tabbableGroups = this.state.containerGroups.filter((i) => i.tabbableNodes.length > 0), this.state.tabbableGroups.length <= 0 && !this.getNodeForOption("fallbackFocus")) throw Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");
|
|
1896
|
-
if (this.state.containerGroups.find((i) => i.posTabIndexesFound) && this.state.containerGroups.length > 1) throw Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.");
|
|
1897
|
-
}
|
|
1898
|
-
listenerCleanups = [];
|
|
1899
|
-
addListeners() {
|
|
1900
|
-
if (this.state.active) return activeFocusTraps.activateTrap(this.trapStack, this), this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? delay(() => {
|
|
1901
|
-
this.tryFocus(this.getInitialFocusNode());
|
|
1902
|
-
}) : this.tryFocus(this.getInitialFocusNode()), this.listenerCleanups.push(addDomEvent(this.doc, "focusin", this.handleFocus, !0), addDomEvent(this.doc, "mousedown", this.handlePointerDown, {
|
|
1903
|
-
capture: !0,
|
|
1904
|
-
passive: !1
|
|
1905
|
-
}), addDomEvent(this.doc, "touchstart", this.handlePointerDown, {
|
|
1906
|
-
capture: !0,
|
|
1907
|
-
passive: !1
|
|
1908
|
-
}), addDomEvent(this.doc, "click", this.handleClick, {
|
|
1909
|
-
capture: !0,
|
|
1910
|
-
passive: !1
|
|
1911
|
-
}), addDomEvent(this.doc, "keydown", this.handleTabKey, {
|
|
1912
|
-
capture: !0,
|
|
1913
|
-
passive: !1
|
|
1914
|
-
}), addDomEvent(this.doc, "keydown", this.handleEscapeKey)), this;
|
|
1915
|
-
}
|
|
1916
|
-
removeListeners() {
|
|
1917
|
-
if (this.state.active) return this.listenerCleanups.forEach((i) => i()), this.listenerCleanups = [], this;
|
|
1918
|
-
}
|
|
1919
|
-
handleFocus = (i) => {
|
|
1920
|
-
let s = getEventTarget(i), c = this.findContainerIndex(s, i) >= 0;
|
|
1921
|
-
if (c || isDocument(s)) c && (this.state.mostRecentlyFocusedNode = s);
|
|
1922
|
-
else {
|
|
1923
|
-
i.stopImmediatePropagation();
|
|
1924
|
-
let s, c = !0;
|
|
1925
|
-
if (this.state.mostRecentlyFocusedNode) if (getTabIndex(this.state.mostRecentlyFocusedNode) > 0) {
|
|
1926
|
-
let i = this.findContainerIndex(this.state.mostRecentlyFocusedNode), { tabbableNodes: l } = this.state.containerGroups[i];
|
|
1927
|
-
if (l.length > 0) {
|
|
1928
|
-
let i = l.findIndex((i) => i === this.state.mostRecentlyFocusedNode);
|
|
1929
|
-
i >= 0 && (this.config.isKeyForward(this.state.recentNavEvent) ? i + 1 < l.length && (s = l[i + 1], c = !1) : i - 1 >= 0 && (s = l[i - 1], c = !1));
|
|
1930
|
-
}
|
|
1931
|
-
} else this.state.containerGroups.some((i) => i.tabbableNodes.some((i) => getTabIndex(i) > 0)) || (c = !1);
|
|
1932
|
-
else c = !1;
|
|
1933
|
-
c && (s = this.findNextNavNode({
|
|
1934
|
-
target: this.state.mostRecentlyFocusedNode,
|
|
1935
|
-
isBackward: this.config.isKeyBackward(this.state.recentNavEvent)
|
|
1936
|
-
})), s ? this.tryFocus(s) : this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());
|
|
1937
|
-
}
|
|
1938
|
-
this.state.recentNavEvent = void 0;
|
|
1939
|
-
};
|
|
1940
|
-
handlePointerDown = (i) => {
|
|
1941
|
-
let s = getEventTarget(i);
|
|
1942
|
-
if (!(this.findContainerIndex(s, i) >= 0)) {
|
|
1943
|
-
if (valueOrHandler(this.config.clickOutsideDeactivates, i)) {
|
|
1944
|
-
this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });
|
|
1945
|
-
return;
|
|
1946
|
-
}
|
|
1947
|
-
valueOrHandler(this.config.allowOutsideClick, i) || i.preventDefault();
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
handleClick = (i) => {
|
|
1951
|
-
let s = getEventTarget(i);
|
|
1952
|
-
this.findContainerIndex(s, i) >= 0 || valueOrHandler(this.config.clickOutsideDeactivates, i) || valueOrHandler(this.config.allowOutsideClick, i) || (i.preventDefault(), i.stopImmediatePropagation());
|
|
1953
|
-
};
|
|
1954
|
-
handleTabKey = (i) => {
|
|
1955
|
-
if (this.config.isKeyForward(i) || this.config.isKeyBackward(i)) {
|
|
1956
|
-
this.state.recentNavEvent = i;
|
|
1957
|
-
let s = this.config.isKeyBackward(i), c = this.findNextNavNode({
|
|
1958
|
-
event: i,
|
|
1959
|
-
isBackward: s
|
|
1960
|
-
});
|
|
1961
|
-
if (!c) return;
|
|
1962
|
-
isTabEvent(i) && i.preventDefault(), this.tryFocus(c);
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
handleEscapeKey = (i) => {
|
|
1966
|
-
isEscapeEvent(i) && valueOrHandler(this.config.escapeDeactivates, i) !== !1 && (i.preventDefault(), this.deactivate());
|
|
1967
|
-
};
|
|
1968
|
-
_mutationObserver;
|
|
1969
|
-
setupMutationObserver = () => {
|
|
1970
|
-
this._mutationObserver = new (this.doc.defaultView || window).MutationObserver((i) => {
|
|
1971
|
-
i.some((i) => Array.from(i.removedNodes).includes(this.state.mostRecentlyFocusedNode)) && this.tryFocus(this.getInitialFocusNode());
|
|
1972
|
-
});
|
|
1973
|
-
};
|
|
1974
|
-
updateObservedNodes = () => {
|
|
1975
|
-
this._mutationObserver?.disconnect(), this.state.active && !this.state.paused && this.state.containers.forEach((i) => {
|
|
1976
|
-
this._mutationObserver?.observe(i, {
|
|
1977
|
-
subtree: !0,
|
|
1978
|
-
childList: !0
|
|
1979
|
-
});
|
|
1980
|
-
});
|
|
1981
|
-
};
|
|
1982
|
-
getInitialFocusNode = () => {
|
|
1983
|
-
let i = this.getNodeForOption("initialFocus", { hasFallback: !0 });
|
|
1984
|
-
if (i === !1) return !1;
|
|
1985
|
-
if (i === void 0 || i && !isFocusable(i)) if (this.findContainerIndex(this.doc.activeElement) >= 0) i = this.doc.activeElement;
|
|
1986
|
-
else {
|
|
1987
|
-
let s = this.state.tabbableGroups[0];
|
|
1988
|
-
i = s && s.firstTabbableNode || this.getNodeForOption("fallbackFocus");
|
|
1989
|
-
}
|
|
1990
|
-
else i === null && (i = this.getNodeForOption("fallbackFocus"));
|
|
1991
|
-
if (!i) throw Error("Your focus-trap needs to have at least one focusable element");
|
|
1992
|
-
return i.isConnected || (i = this.getNodeForOption("fallbackFocus")), i;
|
|
1993
|
-
};
|
|
1994
|
-
tryFocus = (i) => {
|
|
1995
|
-
if (i !== !1 && i !== getActiveElement(this.doc)) {
|
|
1996
|
-
if (!i || !i.focus) {
|
|
1997
|
-
this.tryFocus(this.getInitialFocusNode());
|
|
1998
|
-
return;
|
|
1999
|
-
}
|
|
2000
|
-
i.focus({ preventScroll: !!this.config.preventScroll }), this.state.mostRecentlyFocusedNode = i, isSelectableInput(i) && i.select();
|
|
2001
|
-
}
|
|
2002
|
-
};
|
|
2003
|
-
activate(i) {
|
|
2004
|
-
if (this.state.active) return this;
|
|
2005
|
-
let s = this.getOption(i, "onActivate"), c = this.getOption(i, "onPostActivate"), l = this.getOption(i, "checkCanFocusTrap");
|
|
2006
|
-
l || this.updateTabbableNodes(), this.state.active = !0, this.state.paused = !1, this.state.nodeFocusedBeforeActivation = this.doc.activeElement || null, s?.();
|
|
2007
|
-
let u = () => {
|
|
2008
|
-
l && this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), c?.();
|
|
2009
|
-
};
|
|
2010
|
-
return l ? (l(this.state.containers.concat()).then(u, u), this) : (u(), this);
|
|
2011
|
-
}
|
|
2012
|
-
deactivate = (i) => {
|
|
2013
|
-
if (!this.state.active) return this;
|
|
2014
|
-
let s = {
|
|
2015
|
-
onDeactivate: this.config.onDeactivate,
|
|
2016
|
-
onPostDeactivate: this.config.onPostDeactivate,
|
|
2017
|
-
checkCanReturnFocus: this.config.checkCanReturnFocus,
|
|
2018
|
-
...i
|
|
2019
|
-
};
|
|
2020
|
-
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), activeFocusTraps.deactivateTrap(this.trapStack, this);
|
|
2021
|
-
let c = this.getOption(s, "onDeactivate"), l = this.getOption(s, "onPostDeactivate"), u = this.getOption(s, "checkCanReturnFocus"), d = this.getOption(s, "returnFocus", "returnFocusOnDeactivate");
|
|
2022
|
-
c?.();
|
|
2023
|
-
let f = () => {
|
|
2024
|
-
delay(() => {
|
|
2025
|
-
if (d) {
|
|
2026
|
-
let i = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
|
|
2027
|
-
this.tryFocus(i);
|
|
2028
|
-
}
|
|
2029
|
-
l?.();
|
|
2030
|
-
});
|
|
2031
|
-
};
|
|
2032
|
-
return d && u ? (u(this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation)).then(f, f), this) : (f(), this);
|
|
2033
|
-
};
|
|
2034
|
-
pause = (i) => {
|
|
2035
|
-
if (this.state.paused || !this.state.active) return this;
|
|
2036
|
-
let s = this.getOption(i, "onPause"), c = this.getOption(i, "onPostPause");
|
|
2037
|
-
return this.state.paused = !0, s?.(), this.removeListeners(), this.updateObservedNodes(), c?.(), this;
|
|
2038
|
-
};
|
|
2039
|
-
unpause = (i) => {
|
|
2040
|
-
if (!this.state.paused || !this.state.active) return this;
|
|
2041
|
-
let s = this.getOption(i, "onUnpause"), c = this.getOption(i, "onPostUnpause");
|
|
2042
|
-
return this.state.paused = !1, s?.(), this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), c?.(), this;
|
|
2043
|
-
};
|
|
2044
|
-
updateContainerElements = (i) => (this.state.containers = Array.isArray(i) ? i.filter(Boolean) : [i].filter(Boolean), this.state.active && this.updateTabbableNodes(), this.updateObservedNodes(), this);
|
|
2045
|
-
getReturnFocusNode = (i) => {
|
|
2046
|
-
let s = this.getNodeForOption("setReturnFocus", { params: [i] });
|
|
2047
|
-
return s || (s === !1 ? !1 : i);
|
|
2048
|
-
};
|
|
2049
|
-
getOption = (i, s, c) => i && i[s] !== void 0 ? i[s] : this.config[c || s];
|
|
2050
|
-
getNodeForOption = (i, { hasFallback: s = !1, params: c = [] } = {}) => {
|
|
2051
|
-
let l = this.config[i];
|
|
2052
|
-
if (typeof l == "function" && (l = l(...c)), l === !0 && (l = void 0), !l) {
|
|
2053
|
-
if (l === void 0 || l === !1) return l;
|
|
2054
|
-
throw Error(`\`${i}\` was specified but was not a node, or did not return a node`);
|
|
2055
|
-
}
|
|
2056
|
-
let u = l;
|
|
2057
|
-
if (typeof l == "string") {
|
|
2058
|
-
try {
|
|
2059
|
-
u = this.doc.querySelector(l);
|
|
2060
|
-
} catch (s) {
|
|
2061
|
-
throw Error(`\`${i}\` appears to be an invalid selector; error="${s.message}"`);
|
|
2062
|
-
}
|
|
2063
|
-
if (!u && !s) throw Error(`\`${i}\` as selector refers to no known node`);
|
|
2064
|
-
}
|
|
2065
|
-
return u;
|
|
2066
|
-
};
|
|
2067
|
-
findNextNavNode = (i) => {
|
|
2068
|
-
let { event: s, isBackward: c = !1 } = i, l = i.target || getEventTarget(s);
|
|
2069
|
-
this.updateTabbableNodes();
|
|
2070
|
-
let u = null;
|
|
2071
|
-
if (this.state.tabbableGroups.length > 0) {
|
|
2072
|
-
let i = this.findContainerIndex(l, s), d = i >= 0 ? this.state.containerGroups[i] : void 0;
|
|
2073
|
-
if (i < 0) u = c ? this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode : this.state.tabbableGroups[0].firstTabbableNode;
|
|
2074
|
-
else if (c) {
|
|
2075
|
-
let c = this.state.tabbableGroups.findIndex(({ firstTabbableNode: i }) => l === i);
|
|
2076
|
-
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l, !1)) && (c = i), c >= 0) {
|
|
2077
|
-
let i = c === 0 ? this.state.tabbableGroups.length - 1 : c - 1, s = this.state.tabbableGroups[i];
|
|
2078
|
-
u = getTabIndex(l) >= 0 ? s.lastTabbableNode : s.lastDomTabbableNode;
|
|
2079
|
-
} else isTabEvent(s) || (u = d?.nextTabbableNode(l, !1));
|
|
2080
|
-
} else {
|
|
2081
|
-
let c = this.state.tabbableGroups.findIndex(({ lastTabbableNode: i }) => l === i);
|
|
2082
|
-
if (c < 0 && (d?.container === l || isFocusable(l) && !isTabbable(l) && !d?.nextTabbableNode(l)) && (c = i), c >= 0) {
|
|
2083
|
-
let i = c === this.state.tabbableGroups.length - 1 ? 0 : c + 1, s = this.state.tabbableGroups[i];
|
|
2084
|
-
u = getTabIndex(l) >= 0 ? s.firstTabbableNode : s.firstDomTabbableNode;
|
|
2085
|
-
} else isTabEvent(s) || (u = d?.nextTabbableNode(l));
|
|
2086
|
-
}
|
|
2087
|
-
} else u = this.getNodeForOption("fallbackFocus");
|
|
2088
|
-
return u;
|
|
2089
|
-
};
|
|
2090
|
-
};
|
|
2091
|
-
function trapFocus(i, s = {}) {
|
|
2092
|
-
let c, l = raf$1(() => {
|
|
2093
|
-
let l = typeof i == "function" ? i() : i;
|
|
2094
|
-
if (l) {
|
|
2095
|
-
c = new FocusTrap(l, {
|
|
2096
|
-
escapeDeactivates: !1,
|
|
2097
|
-
allowOutsideClick: !0,
|
|
2098
|
-
preventScroll: !0,
|
|
2099
|
-
returnFocusOnDeactivate: !0,
|
|
2100
|
-
delayInitialFocus: !1,
|
|
2101
|
-
fallbackFocus: l,
|
|
2102
|
-
...s,
|
|
2103
|
-
document: getDocument(l)
|
|
2104
|
-
});
|
|
2105
|
-
try {
|
|
2106
|
-
c.activate();
|
|
2107
|
-
} catch {}
|
|
2108
|
-
}
|
|
2109
|
-
});
|
|
2110
|
-
return function() {
|
|
2111
|
-
c?.deactivate(), l();
|
|
2112
|
-
};
|
|
2113
|
-
}
|
|
2114
|
-
var LOCK_CLASSNAME = "data-scroll-lock";
|
|
2115
|
-
function assignStyle(i, s) {
|
|
2116
|
-
if (!i) return;
|
|
2117
|
-
let c = Object.keys(s).reduce((s, c) => (s[c] = i.style.getPropertyValue(c), s), {});
|
|
2118
|
-
return Object.assign(i.style, s), () => {
|
|
2119
|
-
Object.assign(i.style, c);
|
|
2120
|
-
};
|
|
2121
|
-
}
|
|
2122
|
-
function setCSSProperty(i, s, c) {
|
|
2123
|
-
if (!i) return;
|
|
2124
|
-
let l = i.style.getPropertyValue(s);
|
|
2125
|
-
return i.style.setProperty(s, c), () => {
|
|
2126
|
-
l ? i.style.setProperty(s, l) : i.style.removeProperty(s);
|
|
2127
|
-
};
|
|
2128
|
-
}
|
|
2129
|
-
function getPaddingProperty(i) {
|
|
2130
|
-
let s = i.getBoundingClientRect().left;
|
|
2131
|
-
return Math.round(s) + i.scrollLeft ? "paddingLeft" : "paddingRight";
|
|
2132
|
-
}
|
|
2133
|
-
function preventBodyScroll(i) {
|
|
2134
|
-
let s = i ?? document, c = s.defaultView ?? window, { documentElement: l, body: u } = s;
|
|
2135
|
-
if (u.hasAttribute(LOCK_CLASSNAME)) return;
|
|
2136
|
-
u.setAttribute(LOCK_CLASSNAME, "");
|
|
2137
|
-
let d = c.innerWidth - l.clientWidth, f = () => setCSSProperty(l, "--scrollbar-width", `${d}px`), p = getPaddingProperty(l), m = [f(), isIos() ? (() => {
|
|
2138
|
-
let { scrollX: i, scrollY: s, visualViewport: l } = c, f = l?.offsetLeft ?? 0, m = l?.offsetTop ?? 0, h = assignStyle(u, {
|
|
2139
|
-
position: "fixed",
|
|
2140
|
-
overflow: "hidden",
|
|
2141
|
-
top: `${-(s - Math.floor(m))}px`,
|
|
2142
|
-
left: `${-(i - Math.floor(f))}px`,
|
|
2143
|
-
right: "0",
|
|
2144
|
-
[p]: `${d}px`
|
|
2145
|
-
});
|
|
2146
|
-
return () => {
|
|
2147
|
-
h?.(), c.scrollTo({
|
|
2148
|
-
left: i,
|
|
2149
|
-
top: s,
|
|
2150
|
-
behavior: "instant"
|
|
2151
|
-
});
|
|
2152
|
-
};
|
|
2153
|
-
})() : (() => assignStyle(u, {
|
|
2154
|
-
overflow: "hidden",
|
|
2155
|
-
[p]: `${d}px`
|
|
2156
|
-
}))()];
|
|
2157
|
-
return () => {
|
|
2158
|
-
m.forEach((i) => i?.()), u.removeAttribute(LOCK_CLASSNAME);
|
|
2159
|
-
};
|
|
2160
|
-
}
|
|
2161
|
-
var GET_ORIGINAL_SYMBOL = Symbol(), getProto = Object.getPrototypeOf, objectsToTrack = /* @__PURE__ */ new WeakMap(), isObjectToTrack = (i) => i && (objectsToTrack.has(i) ? objectsToTrack.get(i) : getProto(i) === Object.prototype || getProto(i) === Array.prototype);
|
|
2162
|
-
const getUntracked = (i) => isObjectToTrack(i) && i[GET_ORIGINAL_SYMBOL] || null, markToTrack = (i, s = !0) => {
|
|
2163
|
-
objectsToTrack.set(i, s);
|
|
2164
|
-
};
|
|
2165
|
-
function glob() {
|
|
2166
|
-
if (typeof globalThis < "u" || typeof globalThis < "u") return globalThis;
|
|
2167
|
-
if (typeof window < "u") return window;
|
|
2168
|
-
}
|
|
2169
|
-
function globalRef(i, s) {
|
|
2170
|
-
let c = glob();
|
|
2171
|
-
return c ? (c[i] ||= s(), c[i]) : s();
|
|
2172
|
-
}
|
|
2173
|
-
var refSet = globalRef("__destyler__refSet", () => /* @__PURE__ */ new WeakSet()), isReactElement = (i) => typeof i == "object" && !!i && "$$typeof" in i && "props" in i, isVueElement = (i) => typeof i == "object" && !!i && "__v_isVNode" in i;
|
|
2174
|
-
function isDOMElement(i) {
|
|
2175
|
-
return typeof i == "object" && !!i && "nodeType" in i && typeof i.nodeName == "string";
|
|
2176
|
-
}
|
|
2177
|
-
var isElement = (i) => isReactElement(i) || isVueElement(i) || isDOMElement(i), isObject = (i) => typeof i == "object" && !!i;
|
|
2178
|
-
function canProxy(i) {
|
|
2179
|
-
return isObject(i) && !refSet.has(i) && (Array.isArray(i) || !(Symbol.iterator in i)) && !isElement(i) && !(i instanceof WeakMap) && !(i instanceof WeakSet) && !(i instanceof Error) && typeof i != "number" && !(i instanceof Date) && typeof i != "string" && !(i instanceof RegExp) && !(i instanceof ArrayBuffer) && !(i instanceof Promise);
|
|
2180
|
-
}
|
|
2181
|
-
function set(i, s, c) {
|
|
2182
|
-
typeof c.value == "object" && !canProxy(c.value) && (c.value = clone(c.value)), !c.enumerable || c.get || c.set || !c.configurable || !c.writable || s === "__proto__" ? Object.defineProperty(i, s, c) : i[s] = c.value;
|
|
2183
|
-
}
|
|
2184
|
-
function clone(i) {
|
|
2185
|
-
if (typeof i != "object") return i;
|
|
2186
|
-
let s = 0, c, l, u, d = Object.prototype.toString.call(i);
|
|
2187
|
-
if (d === "[object Object]" ? u = Object.create(Object.getPrototypeOf(i) || null) : d === "[object Array]" ? u = Array.from({ length: i.length }) : d === "[object Set]" ? (u = /* @__PURE__ */ new Set(), i.forEach((i) => {
|
|
2188
|
-
u.add(clone(i));
|
|
2189
|
-
})) : d === "[object Map]" ? (u = /* @__PURE__ */ new Map(), i.forEach((i, s) => {
|
|
2190
|
-
u.set(clone(s), clone(i));
|
|
2191
|
-
})) : d === "[object Date]" ? u = /* @__PURE__ */ new Date(+i) : d === "[object RegExp]" ? u = new RegExp(i.source, i.flags) : d === "[object DataView]" ? u = new i.constructor(clone(i.buffer)) : d === "[object ArrayBuffer]" ? u = i.slice(0) : d === "[object Blob]" ? u = i.slice() : d.slice(-6) === "Array]" && (u = new i.constructor(i)), u) {
|
|
2192
|
-
for (l = Object.getOwnPropertySymbols(i); s < l.length; s++) set(u, l[s], Object.getOwnPropertyDescriptor(i, l[s]));
|
|
2193
|
-
for (s = 0, l = Object.getOwnPropertyNames(i); s < l.length; s++) Object.hasOwnProperty.call(u, c = l[s]) && u[c] === i[c] || set(u, c, Object.getOwnPropertyDescriptor(i, c));
|
|
2194
|
-
}
|
|
2195
|
-
return u || i;
|
|
2196
|
-
}
|
|
2197
|
-
var proxyStateMap = globalRef("__destyler__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
2198
|
-
function buildProxyFunction(i = Object.is, s = (i, s) => new Proxy(i, s), c = /* @__PURE__ */ new WeakMap(), l = (i, s) => {
|
|
2199
|
-
let l = c.get(i);
|
|
2200
|
-
if (l?.[0] === s) return l[1];
|
|
2201
|
-
let u = Array.isArray(i) ? [] : Object.create(Object.getPrototypeOf(i));
|
|
2202
|
-
return markToTrack(u, !0), c.set(i, [s, u]), Reflect.ownKeys(i).forEach((s) => {
|
|
2203
|
-
let c = Reflect.get(i, s);
|
|
2204
|
-
refSet.has(c) ? (markToTrack(c, !1), u[s] = c) : proxyStateMap.has(c) ? u[s] = snapshot(c) : u[s] = c;
|
|
2205
|
-
}), Object.freeze(u);
|
|
2206
|
-
}, u = /* @__PURE__ */ new WeakMap(), d = [1, 1], f = (c) => {
|
|
2207
|
-
if (!isObject(c)) throw Error("object required");
|
|
2208
|
-
let f = u.get(c);
|
|
2209
|
-
if (f) return f;
|
|
2210
|
-
let p = d[0], m = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map(), g = (i, s = ++d[0]) => {
|
|
2211
|
-
p !== s && (p = s, m.forEach((c) => c(i, s)));
|
|
2212
|
-
}, _ = d[1], v = (i = ++d[1]) => (_ !== i && !m.size && (_ = i, h.forEach(([s]) => {
|
|
2213
|
-
let c = s[1](i);
|
|
2214
|
-
c > p && (p = c);
|
|
2215
|
-
})), p), y = (i) => (s, c) => {
|
|
2216
|
-
let l = [...s];
|
|
2217
|
-
l[1] = [i, ...l[1]], g(l, c);
|
|
2218
|
-
}, b = (i, s) => {
|
|
2219
|
-
if (m.size) {
|
|
2220
|
-
let c = s[3](y(i));
|
|
2221
|
-
h.set(i, [s, c]);
|
|
2222
|
-
} else h.set(i, [s]);
|
|
2223
|
-
}, x = (i) => {
|
|
2224
|
-
let s = h.get(i);
|
|
2225
|
-
s && (h.delete(i), s[1]?.());
|
|
2226
|
-
}, S = (i) => (m.add(i), m.size === 1 && h.forEach(([i], s) => {
|
|
2227
|
-
let c = i[3](y(s));
|
|
2228
|
-
h.set(s, [i, c]);
|
|
2229
|
-
}), () => {
|
|
2230
|
-
m.delete(i), m.size === 0 && h.forEach(([i, s], c) => {
|
|
2231
|
-
s && (s(), h.set(c, [i]));
|
|
2232
|
-
});
|
|
2233
|
-
}), C = Array.isArray(c) ? [] : Object.create(Object.getPrototypeOf(c)), w = s(C, {
|
|
2234
|
-
deleteProperty(i, s) {
|
|
2235
|
-
let c = Reflect.get(i, s);
|
|
2236
|
-
x(s);
|
|
2237
|
-
let l = Reflect.deleteProperty(i, s);
|
|
2238
|
-
return l && g([
|
|
2239
|
-
"delete",
|
|
2240
|
-
[s],
|
|
2241
|
-
c
|
|
2242
|
-
]), l;
|
|
2243
|
-
},
|
|
2244
|
-
set(s, c, l, d) {
|
|
2245
|
-
let f = Reflect.has(s, c), p = Reflect.get(s, c, d);
|
|
2246
|
-
if (f && (i(p, l) || u.has(l) && i(p, u.get(l)))) return !0;
|
|
2247
|
-
x(c), isObject(l) && (l = getUntracked(l) || l);
|
|
2248
|
-
let m = l;
|
|
2249
|
-
if (!Object.getOwnPropertyDescriptor(s, c)?.set) {
|
|
2250
|
-
!proxyStateMap.has(l) && canProxy(l) && (m = proxy(l));
|
|
2251
|
-
let i = !refSet.has(m) && proxyStateMap.get(m);
|
|
2252
|
-
i && b(c, i);
|
|
2253
|
-
}
|
|
2254
|
-
return Reflect.set(s, c, m, d), g([
|
|
2255
|
-
"set",
|
|
2256
|
-
[c],
|
|
2257
|
-
l,
|
|
2258
|
-
p
|
|
2259
|
-
]), !0;
|
|
2260
|
-
}
|
|
2261
|
-
});
|
|
2262
|
-
u.set(c, w);
|
|
2263
|
-
let T = [
|
|
2264
|
-
C,
|
|
2265
|
-
v,
|
|
2266
|
-
l,
|
|
2267
|
-
S
|
|
2268
|
-
];
|
|
2269
|
-
return proxyStateMap.set(w, T), Reflect.ownKeys(c).forEach((i) => {
|
|
2270
|
-
let s = Object.getOwnPropertyDescriptor(c, i);
|
|
2271
|
-
s.get || s.set ? Object.defineProperty(C, i, s) : w[i] = c[i];
|
|
2272
|
-
}), w;
|
|
2273
|
-
}) {
|
|
2274
|
-
return [
|
|
2275
|
-
f,
|
|
2276
|
-
proxyStateMap,
|
|
2277
|
-
refSet,
|
|
2278
|
-
i,
|
|
2279
|
-
s,
|
|
2280
|
-
canProxy,
|
|
2281
|
-
c,
|
|
2282
|
-
l,
|
|
2283
|
-
u,
|
|
2284
|
-
d
|
|
2285
|
-
];
|
|
2286
|
-
}
|
|
2287
|
-
var [proxyFunction] = buildProxyFunction();
|
|
2288
|
-
function proxy(i = {}) {
|
|
2289
|
-
return proxyFunction(i);
|
|
2290
|
-
}
|
|
2291
|
-
function subscribe(i, s, c) {
|
|
2292
|
-
let l = proxyStateMap.get(i), u, d = [], f = l[3], p = !1, m = f((i) => {
|
|
2293
|
-
if (d.push(i), c) {
|
|
2294
|
-
s(d.splice(0));
|
|
2295
|
-
return;
|
|
2296
|
-
}
|
|
2297
|
-
u ||= Promise.resolve().then(() => {
|
|
2298
|
-
u = void 0, p && s(d.splice(0));
|
|
2299
|
-
});
|
|
2300
|
-
});
|
|
2301
|
-
return p = !0, () => {
|
|
2302
|
-
p = !1, m();
|
|
2303
|
-
};
|
|
2304
|
-
}
|
|
2305
|
-
function snapshot(i) {
|
|
2306
|
-
let [s, c, l] = proxyStateMap.get(i);
|
|
2307
|
-
return l(s, c());
|
|
2308
|
-
}
|
|
2309
|
-
function ref$1(i) {
|
|
2310
|
-
return refSet.add(i), i;
|
|
2311
|
-
}
|
|
2312
|
-
function proxyWithComputed(i, s) {
|
|
2313
|
-
let c = Object.keys(s);
|
|
2314
|
-
c.forEach((s) => {
|
|
2315
|
-
if (Object.getOwnPropertyDescriptor(i, s)) throw Error("object property already defined");
|
|
2316
|
-
});
|
|
2317
|
-
let l = proxy(i);
|
|
2318
|
-
return c.forEach((i) => {
|
|
2319
|
-
let c = s[i], { get: u, set: d } = typeof c == "function" ? { get: c } : c, f = {};
|
|
2320
|
-
f.get = () => u(snapshot(l)), d && (f.set = (i) => d(l, i)), Object.defineProperty(l, i, f);
|
|
2321
|
-
}), l;
|
|
2322
|
-
}
|
|
2323
|
-
function deepMerge(i, ...s) {
|
|
2324
|
-
if (!isPlainObject(i)) throw TypeError("Source argument must be a plain object");
|
|
2325
|
-
let c = i;
|
|
2326
|
-
for (let i of s) {
|
|
2327
|
-
if (!isPlainObject(i)) continue;
|
|
2328
|
-
let s = compact(i);
|
|
2329
|
-
for (let l in s) {
|
|
2330
|
-
if (!Object.prototype.hasOwnProperty.call(s, l) || l === "__proto__" || l === "constructor" || l === "prototype") continue;
|
|
2331
|
-
let u = c[l], d = i[l];
|
|
2332
|
-
isPlainObject(d) ? c[l] = isPlainObject(u) ? deepMerge(u, d) : { ...d } : c[l] = d;
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
return c;
|
|
2336
|
-
}
|
|
2337
|
-
function toEvent(i) {
|
|
2338
|
-
return isString(i) ? { type: i } : i;
|
|
2339
|
-
}
|
|
2340
|
-
function toArray(i) {
|
|
2341
|
-
return i ? isArray(i) ? i.slice() : [i] : [];
|
|
2342
|
-
}
|
|
2343
|
-
function isGuardHelper(i) {
|
|
2344
|
-
return isObject$1(i) && i.predicate != null;
|
|
2345
|
-
}
|
|
2346
|
-
var Truthy = () => !0;
|
|
2347
|
-
function determineGuardFn(i, s) {
|
|
2348
|
-
return i ??= Truthy, (c, l, u) => {
|
|
2349
|
-
if (isString(i)) {
|
|
2350
|
-
let d = s[i];
|
|
2351
|
-
return isFunction(d) ? d(c, l, u) : d;
|
|
2352
|
-
}
|
|
2353
|
-
return isGuardHelper(i) ? i.predicate(s)(c, l, u) : i?.(c, l, u);
|
|
2354
|
-
};
|
|
2355
|
-
}
|
|
2356
|
-
function determineActionsFn(i, s) {
|
|
2357
|
-
return (c, l, u) => isGuardHelper(i) ? i.predicate(s)(c, l, u) : i;
|
|
2358
|
-
}
|
|
2359
|
-
var MachineStatus = /* @__PURE__ */ function(i) {
|
|
2360
|
-
return i.NotStarted = "Not Started", i.Running = "Running", i.Stopped = "Stopped", i;
|
|
2361
|
-
}({}), ActionTypes = /* @__PURE__ */ function(i) {
|
|
2362
|
-
return i.Start = "machine.start", i.Stop = "machine.stop", i.Created = "machine.created", i.Init = "machine.init", i;
|
|
2363
|
-
}({}), MachineType = /* @__PURE__ */ function(i) {
|
|
2364
|
-
return i.Machine = "machine", i.Actor = "machine.actor", i;
|
|
2365
|
-
}({});
|
|
2366
|
-
function createProxy(i) {
|
|
2367
|
-
let s = i.computed ?? cast({}), c = i.context ?? cast({}), l = i.initial ? i.states?.[i.initial]?.tags : [];
|
|
2368
|
-
return cast(proxy({
|
|
2369
|
-
value: i.initial ?? "",
|
|
2370
|
-
previousValue: "",
|
|
2371
|
-
event: cast({}),
|
|
2372
|
-
previousEvent: cast({}),
|
|
2373
|
-
context: proxyWithComputed(c, s),
|
|
2374
|
-
done: !1,
|
|
2375
|
-
tags: l ?? [],
|
|
2376
|
-
hasTag(i) {
|
|
2377
|
-
return this.tags.includes(i);
|
|
2378
|
-
},
|
|
2379
|
-
matches(...i) {
|
|
2380
|
-
return i.includes(this.value);
|
|
2381
|
-
},
|
|
2382
|
-
can(i) {
|
|
2383
|
-
return cast(this).nextEvents.includes(i);
|
|
2384
|
-
},
|
|
2385
|
-
get nextEvents() {
|
|
2386
|
-
let s = i.states?.[this.value]?.on ?? {}, c = i?.on ?? {};
|
|
2387
|
-
return Object.keys({
|
|
2388
|
-
...s,
|
|
2389
|
-
...c
|
|
2390
|
-
});
|
|
2391
|
-
},
|
|
2392
|
-
get changed() {
|
|
2393
|
-
return this.event.value === ActionTypes.Init || !this.previousValue ? !1 : this.value !== this.previousValue;
|
|
2394
|
-
}
|
|
2395
|
-
}));
|
|
2396
|
-
}
|
|
2397
|
-
function determineDelayFn(i, s) {
|
|
2398
|
-
return (c, l) => {
|
|
2399
|
-
if (isNumber(i)) return i;
|
|
2400
|
-
if (isFunction(i)) return i(c, l);
|
|
2401
|
-
if (isString(i)) {
|
|
2402
|
-
let u = Number.parseFloat(i);
|
|
2403
|
-
if (!Number.isNaN(u)) return u;
|
|
2404
|
-
if (s) {
|
|
2405
|
-
let u = s?.[i];
|
|
2406
|
-
if (u === null) throw Error(`[@destyler/xstate > determine-delay] Cannot determine delay for \`${i}\`. It is set to null in \`options.delays\``);
|
|
2407
|
-
return isFunction(u) ? u(c, l) : u;
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
};
|
|
2411
|
-
}
|
|
2412
|
-
function toTarget(i) {
|
|
2413
|
-
return isString(i) ? { target: i } : i;
|
|
2414
|
-
}
|
|
2415
|
-
function determineTransitionFn(i, s) {
|
|
2416
|
-
return (c, l, u) => toArray(i).map(toTarget).find((i) => determineGuardFn(i.guard, s)(c, l, u) ?? i.target ?? i.actions);
|
|
2417
|
-
}
|
|
2418
|
-
var Machine = class {
|
|
2419
|
-
status = MachineStatus.NotStarted;
|
|
2420
|
-
state;
|
|
2421
|
-
initialState;
|
|
2422
|
-
initialContext;
|
|
2423
|
-
id;
|
|
2424
|
-
type = MachineType.Machine;
|
|
2425
|
-
activityEvents = /* @__PURE__ */ new Map();
|
|
2426
|
-
delayedEvents = /* @__PURE__ */ new Map();
|
|
2427
|
-
stateListeners = /* @__PURE__ */ new Set();
|
|
2428
|
-
doneListeners = /* @__PURE__ */ new Set();
|
|
2429
|
-
contextWatchers = /* @__PURE__ */ new Set();
|
|
2430
|
-
removeStateListener = noop;
|
|
2431
|
-
parent;
|
|
2432
|
-
children = /* @__PURE__ */ new Map();
|
|
2433
|
-
guardMap;
|
|
2434
|
-
actionMap;
|
|
2435
|
-
delayMap;
|
|
2436
|
-
activityMap;
|
|
2437
|
-
sync;
|
|
2438
|
-
options;
|
|
2439
|
-
config;
|
|
2440
|
-
constructor(i, s) {
|
|
2441
|
-
this.config = clone(i), this.options = clone(s ?? {}), this.id = this.config.id ?? `machine-${uuid()}`, this.guardMap = this.options?.guards ?? {}, this.actionMap = this.options?.actions ?? {}, this.delayMap = this.options?.delays ?? {}, this.activityMap = this.options?.activities ?? {}, this.sync = this.options?.sync ?? !1, this.state = createProxy(this.config), this.initialContext = snapshot(this.state.context);
|
|
2442
|
-
}
|
|
2443
|
-
get stateSnapshot() {
|
|
2444
|
-
return cast(snapshot(this.state));
|
|
2445
|
-
}
|
|
2446
|
-
getState() {
|
|
2447
|
-
return this.stateSnapshot;
|
|
2448
|
-
}
|
|
2449
|
-
get contextSnapshot() {
|
|
2450
|
-
return this.stateSnapshot.context;
|
|
2451
|
-
}
|
|
2452
|
-
_created = () => {
|
|
2453
|
-
if (!this.config.created) return;
|
|
2454
|
-
let i = toEvent(ActionTypes.Created);
|
|
2455
|
-
this.executeActions(this.config.created, i);
|
|
2456
|
-
};
|
|
2457
|
-
start = (i) => {
|
|
2458
|
-
if (this.state.value = "", this.state.tags = [], this.status === MachineStatus.Running) return this;
|
|
2459
|
-
this.status = MachineStatus.Running, this.removeStateListener = subscribe(this.state, () => {
|
|
2460
|
-
this.stateListeners.forEach((i) => {
|
|
2461
|
-
i(this.stateSnapshot);
|
|
2462
|
-
});
|
|
2463
|
-
}, this.sync), this.setupContextWatchers(), this.executeActivities(toEvent(ActionTypes.Start), toArray(this.config.activities), ActionTypes.Start), this.executeActions(this.config.entry, toEvent(ActionTypes.Start));
|
|
2464
|
-
let s = toEvent(ActionTypes.Init), c = isObject$1(i) ? i.value : i, l = isObject$1(i) ? i.context : void 0;
|
|
2465
|
-
l && this.setContext(l);
|
|
2466
|
-
let u = { target: c ?? this.config.initial }, d = this.getNextStateInfo(u, s);
|
|
2467
|
-
return this.initialState = d, this.performStateChangeEffects(this.state.value, d, s), this;
|
|
2468
|
-
};
|
|
2469
|
-
setupContextWatchers = () => {
|
|
2470
|
-
let { watch: i } = this.config;
|
|
2471
|
-
if (!i) return;
|
|
2472
|
-
let s = snapshot(this.state.context), c = subscribe(this.state.context, () => {
|
|
2473
|
-
let c = snapshot(this.state.context);
|
|
2474
|
-
for (let [l, u] of Object.entries(i)) (this.options.compareFns?.[l] ?? Object.is)(s[l], c[l]) || this.executeActions(u, this.state.event);
|
|
2475
|
-
s = c;
|
|
2476
|
-
});
|
|
2477
|
-
this.contextWatchers.add(c);
|
|
2478
|
-
};
|
|
2479
|
-
stop = () => {
|
|
2480
|
-
if (this.status !== MachineStatus.Stopped) return this.performExitEffects(this.state.value, toEvent(ActionTypes.Stop)), this.executeActions(this.config.exit, toEvent(ActionTypes.Stop)), this.setState(""), this.setEvent(ActionTypes.Stop), this.stopStateListeners(), this.stopChildren(), this.stopActivities(), this.stopDelayedEvents(), this.stopContextWatchers(), this.status = MachineStatus.Stopped, this;
|
|
2481
|
-
};
|
|
2482
|
-
stopStateListeners = () => {
|
|
2483
|
-
this.removeStateListener(), this.stateListeners.clear();
|
|
2484
|
-
};
|
|
2485
|
-
stopContextWatchers = () => {
|
|
2486
|
-
this.contextWatchers.forEach((i) => i()), this.contextWatchers.clear();
|
|
2487
|
-
};
|
|
2488
|
-
stopDelayedEvents = () => {
|
|
2489
|
-
this.delayedEvents.forEach((i) => {
|
|
2490
|
-
i.forEach((i) => i());
|
|
2491
|
-
}), this.delayedEvents.clear();
|
|
2492
|
-
};
|
|
2493
|
-
stopActivities = (i) => {
|
|
2494
|
-
i ? (this.activityEvents.get(i)?.forEach((i) => i()), this.activityEvents.get(i)?.clear(), this.activityEvents.delete(i)) : (this.activityEvents.forEach((i) => {
|
|
2495
|
-
i.forEach((i) => i()), i.clear();
|
|
2496
|
-
}), this.activityEvents.clear());
|
|
2497
|
-
};
|
|
2498
|
-
sendChild = (i, s) => {
|
|
2499
|
-
let c = toEvent(i), l = runIfFn(s, this.contextSnapshot), u = this.children.get(l);
|
|
2500
|
-
if (!u) throw Error(`[@destyler/xstate] Cannot send '${c.type}' event to unknown child`);
|
|
2501
|
-
u.send(c);
|
|
2502
|
-
};
|
|
2503
|
-
stopChild = (i) => {
|
|
2504
|
-
if (!this.children.has(i)) throw Error(`[@destyler.xstate > stop-child] Cannot stop unknown child ${i}`);
|
|
2505
|
-
this.children.get(i).stop(), this.children.delete(i);
|
|
2506
|
-
};
|
|
2507
|
-
removeChild = (i) => {
|
|
2508
|
-
this.children.delete(i);
|
|
2509
|
-
};
|
|
2510
|
-
stopChildren = () => {
|
|
2511
|
-
this.children.forEach((i) => i.stop()), this.children.clear();
|
|
2512
|
-
};
|
|
2513
|
-
setParent = (i) => {
|
|
2514
|
-
this.parent = i;
|
|
2515
|
-
};
|
|
2516
|
-
spawn = (i, s) => {
|
|
2517
|
-
let c = runIfFn(i);
|
|
2518
|
-
return s && (c.id = s), c.type = MachineType.Actor, c.setParent(this), this.children.set(c.id, cast(c)), c.onDone(() => {
|
|
2519
|
-
this.removeChild(c.id);
|
|
2520
|
-
}).start(), cast(ref$1(c));
|
|
2521
|
-
};
|
|
2522
|
-
stopActivity = (i) => {
|
|
2523
|
-
if (!this.state.value) return;
|
|
2524
|
-
let s = this.activityEvents.get(this.state.value);
|
|
2525
|
-
s?.get(i)?.(), s?.delete(i);
|
|
2526
|
-
};
|
|
2527
|
-
addActivityCleanup = (i, s, c) => {
|
|
2528
|
-
i && (this.activityEvents.has(i) ? this.activityEvents.get(i)?.set(s, c) : this.activityEvents.set(i, new Map([[s, c]])));
|
|
2529
|
-
};
|
|
2530
|
-
setState = (i) => {
|
|
2531
|
-
this.state.previousValue = this.state.value, this.state.value = i;
|
|
2532
|
-
let s = this.getStateNode(i);
|
|
2533
|
-
i == null ? clear(this.state.tags) : this.state.tags = toArray(s?.tags);
|
|
2534
|
-
};
|
|
2535
|
-
setContext = (i) => {
|
|
2536
|
-
i && deepMerge(this.state.context, i);
|
|
2537
|
-
};
|
|
2538
|
-
setOptions = (i) => {
|
|
2539
|
-
let s = compact(i);
|
|
2540
|
-
this.actionMap = {
|
|
2541
|
-
...this.actionMap,
|
|
2542
|
-
...s.actions
|
|
2543
|
-
}, this.delayMap = {
|
|
2544
|
-
...this.delayMap,
|
|
2545
|
-
...s.delays
|
|
2546
|
-
}, this.activityMap = {
|
|
2547
|
-
...this.activityMap,
|
|
2548
|
-
...s.activities
|
|
2549
|
-
}, this.guardMap = {
|
|
2550
|
-
...this.guardMap,
|
|
2551
|
-
...s.guards
|
|
2552
|
-
};
|
|
2553
|
-
};
|
|
2554
|
-
getStateNode = (i) => {
|
|
2555
|
-
if (i) return this.config.states?.[i];
|
|
2556
|
-
};
|
|
2557
|
-
getNextStateInfo = (i, s) => {
|
|
2558
|
-
let c = this.determineTransition(i, s), l = !c?.target, u = c?.target ?? this.state.value, d = this.state.value !== u, f = this.getStateNode(u), p = {
|
|
2559
|
-
reenter: !l && !d && !c?.internal,
|
|
2560
|
-
transition: c,
|
|
2561
|
-
stateNode: f,
|
|
2562
|
-
target: u,
|
|
2563
|
-
changed: d
|
|
2564
|
-
};
|
|
2565
|
-
return this.log("NextState:", `[${s.type}]`, this.state.value, "---->", p.target), p;
|
|
2566
|
-
};
|
|
2567
|
-
getAfterActions = (i, s) => {
|
|
2568
|
-
let c, l = this.state.value;
|
|
2569
|
-
return {
|
|
2570
|
-
entry: () => {
|
|
2571
|
-
c = globalThis.setTimeout(() => {
|
|
2572
|
-
let s = this.getNextStateInfo(i, this.state.event);
|
|
2573
|
-
this.performStateChangeEffects(l, s, this.state.event);
|
|
2574
|
-
}, s);
|
|
2575
|
-
},
|
|
2576
|
-
exit: () => {
|
|
2577
|
-
globalThis.clearTimeout(c);
|
|
2578
|
-
}
|
|
2579
|
-
};
|
|
2580
|
-
};
|
|
2581
|
-
getDelayedEventActions = (i) => {
|
|
2582
|
-
let s = this.getStateNode(i), c = this.state.event;
|
|
2583
|
-
if (!s || !s.after) return;
|
|
2584
|
-
let l = [], u = [];
|
|
2585
|
-
if (isArray(s.after)) {
|
|
2586
|
-
let i = this.determineTransition(s.after, c);
|
|
2587
|
-
if (!i) return;
|
|
2588
|
-
if (!hasProp(i, "delay")) throw Error(`[@destyler/xstate > after] Delay is required for after transition: ${JSON.stringify(i)}`);
|
|
2589
|
-
let d = determineDelayFn(i.delay, this.delayMap)(this.contextSnapshot, c), f = this.getAfterActions(i, d);
|
|
2590
|
-
return l.push(f.entry), u.push(f.exit), {
|
|
2591
|
-
entries: l,
|
|
2592
|
-
exits: u
|
|
2593
|
-
};
|
|
2594
|
-
}
|
|
2595
|
-
if (isObject$1(s.after)) for (let i in s.after) {
|
|
2596
|
-
let d = s.after[i], f = determineDelayFn(i, this.delayMap)(this.contextSnapshot, c), p = this.getAfterActions(d, f);
|
|
2597
|
-
l.push(p.entry), u.push(p.exit);
|
|
2598
|
-
}
|
|
2599
|
-
return {
|
|
2600
|
-
entries: l,
|
|
2601
|
-
exits: u
|
|
2602
|
-
};
|
|
2603
|
-
};
|
|
2604
|
-
get self() {
|
|
2605
|
-
let i = this;
|
|
2606
|
-
return {
|
|
2607
|
-
id: this.id,
|
|
2608
|
-
send: this.send.bind(this),
|
|
2609
|
-
sendParent: this.sendParent.bind(this),
|
|
2610
|
-
sendChild: this.sendChild.bind(this),
|
|
2611
|
-
stop: this.stop.bind(this),
|
|
2612
|
-
stopChild: this.stopChild.bind(this),
|
|
2613
|
-
spawn: this.spawn.bind(this),
|
|
2614
|
-
stopActivity: this.stopActivity.bind(this),
|
|
2615
|
-
get state() {
|
|
2616
|
-
return i.stateSnapshot;
|
|
2617
|
-
},
|
|
2618
|
-
get initialContext() {
|
|
2619
|
-
return i.initialContext;
|
|
2620
|
-
},
|
|
2621
|
-
get initialState() {
|
|
2622
|
-
return i.initialState?.target ?? "";
|
|
2623
|
-
}
|
|
2624
|
-
};
|
|
2625
|
-
}
|
|
2626
|
-
get meta() {
|
|
2627
|
-
return {
|
|
2628
|
-
state: this.stateSnapshot,
|
|
2629
|
-
guards: this.guardMap,
|
|
2630
|
-
send: this.send.bind(this),
|
|
2631
|
-
self: this.self,
|
|
2632
|
-
initialContext: this.initialContext,
|
|
2633
|
-
initialState: this.initialState?.target ?? "",
|
|
2634
|
-
getState: () => this.stateSnapshot,
|
|
2635
|
-
getAction: (i) => this.actionMap[i],
|
|
2636
|
-
getGuard: (i) => this.guardMap[i]
|
|
2637
|
-
};
|
|
2638
|
-
}
|
|
2639
|
-
get guardMeta() {
|
|
2640
|
-
return { state: this.stateSnapshot };
|
|
2641
|
-
}
|
|
2642
|
-
executeActions = (i, s) => {
|
|
2643
|
-
let c = determineActionsFn(i, this.guardMap)(this.contextSnapshot, s, this.guardMeta);
|
|
2644
|
-
for (let i of toArray(c)) {
|
|
2645
|
-
let c = isString(i) ? this.actionMap?.[i] : i;
|
|
2646
|
-
isString(i) && !c && console.warn(`[@destyler/xstate > execute-actions] No implementation found for action: \`${i}\``), c?.(this.state.context, s, this.meta);
|
|
2647
|
-
}
|
|
2648
|
-
};
|
|
2649
|
-
executeActivities = (i, s, c) => {
|
|
2650
|
-
for (let l of s) {
|
|
2651
|
-
let s = isString(l) ? this.activityMap?.[l] : l;
|
|
2652
|
-
if (!s) {
|
|
2653
|
-
console.warn(`[@destyler/xstate > execute-activity] No implementation found for activity: \`${l}\``);
|
|
2654
|
-
continue;
|
|
2655
|
-
}
|
|
2656
|
-
let u = s(this.state.context, i, this.meta);
|
|
2657
|
-
if (u) {
|
|
2658
|
-
let i = isString(l) ? l : l.name || uuid();
|
|
2659
|
-
this.addActivityCleanup(c ?? this.state.value, i, u);
|
|
2660
|
-
}
|
|
2661
|
-
}
|
|
2662
|
-
};
|
|
2663
|
-
createEveryActivities = (i, s) => {
|
|
2664
|
-
if (i) if (isArray(i)) {
|
|
2665
|
-
let c = toArray(i).find((i) => {
|
|
2666
|
-
let s = i.delay, c = determineDelayFn(s, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2667
|
-
return determineGuardFn(i.guard, this.guardMap)(this.contextSnapshot, this.state.event, this.guardMeta) ?? c != null;
|
|
2668
|
-
});
|
|
2669
|
-
if (!c) return;
|
|
2670
|
-
let l = determineDelayFn(c.delay, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2671
|
-
s(() => {
|
|
2672
|
-
let i = globalThis.setInterval(() => {
|
|
2673
|
-
this.executeActions(c.actions, this.state.event);
|
|
2674
|
-
}, l);
|
|
2675
|
-
return () => {
|
|
2676
|
-
globalThis.clearInterval(i);
|
|
2677
|
-
};
|
|
2678
|
-
});
|
|
2679
|
-
} else for (let c in i) {
|
|
2680
|
-
let l = i?.[c], u = determineDelayFn(c, this.delayMap)(this.contextSnapshot, this.state.event);
|
|
2681
|
-
s(() => {
|
|
2682
|
-
let i = globalThis.setInterval(() => {
|
|
2683
|
-
this.executeActions(l, this.state.event);
|
|
2684
|
-
}, u);
|
|
2685
|
-
return () => {
|
|
2686
|
-
globalThis.clearInterval(i);
|
|
2687
|
-
};
|
|
2688
|
-
});
|
|
2689
|
-
}
|
|
2690
|
-
};
|
|
2691
|
-
setEvent = (i) => {
|
|
2692
|
-
this.state.previousEvent = this.state.event, this.state.event = ref$1(toEvent(i));
|
|
2693
|
-
};
|
|
2694
|
-
performExitEffects = (i, s) => {
|
|
2695
|
-
let c = this.state.value;
|
|
2696
|
-
if (c === "") return;
|
|
2697
|
-
let l = i ? this.getStateNode(i) : void 0;
|
|
2698
|
-
this.stopActivities(c);
|
|
2699
|
-
let u = toArray(determineActionsFn(l?.exit, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.delayedEvents.get(c);
|
|
2700
|
-
d && u.push(...d), this.executeActions(u, s), this.delayedEvents.delete(c);
|
|
2701
|
-
};
|
|
2702
|
-
performEntryEffects = (i, s) => {
|
|
2703
|
-
let c = this.getStateNode(i), l = toArray(c?.activities);
|
|
2704
|
-
this.createEveryActivities(c?.every, (i) => {
|
|
2705
|
-
l.unshift(i);
|
|
2706
|
-
}), l.length > 0 && this.executeActivities(s, l);
|
|
2707
|
-
let u = toArray(determineActionsFn(c?.entry, this.guardMap)(this.contextSnapshot, s, this.guardMeta)), d = this.getDelayedEventActions(i);
|
|
2708
|
-
c?.after && d && (this.delayedEvents.set(i, d?.exits), u.push(...d.entries)), this.executeActions(u, s), c?.type === "final" && (this.state.done = !0, this.doneListeners.forEach((i) => {
|
|
2709
|
-
i(this.stateSnapshot);
|
|
2710
|
-
}), this.stop());
|
|
2711
|
-
};
|
|
2712
|
-
performTransitionEffects = (i, s) => {
|
|
2713
|
-
let c = this.determineTransition(i, s);
|
|
2714
|
-
this.executeActions(c?.actions, s);
|
|
2715
|
-
};
|
|
2716
|
-
performStateChangeEffects = (i, s, c) => {
|
|
2717
|
-
this.setEvent(c);
|
|
2718
|
-
let l = s.changed || s.reenter;
|
|
2719
|
-
l && this.performExitEffects(i, c), this.performTransitionEffects(s.transition, c), this.setState(s.target), l && this.performEntryEffects(s.target, c);
|
|
2720
|
-
};
|
|
2721
|
-
determineTransition = (i, s) => determineTransitionFn(i, this.guardMap)?.(this.contextSnapshot, s, this.guardMeta);
|
|
2722
|
-
sendParent = (i) => {
|
|
2723
|
-
if (!this.parent) throw Error("[@destyler/xstate > send-parent] Cannot send event to parent machine, no parent is set. Use `machine.spawn()` to spawn a child machine.");
|
|
2724
|
-
let s = toEvent(i);
|
|
2725
|
-
this.parent?.send(s);
|
|
2726
|
-
};
|
|
2727
|
-
log = (...i) => {
|
|
2728
|
-
this.options.debug && console.log(...i);
|
|
2729
|
-
};
|
|
2730
|
-
send = (i) => {
|
|
2731
|
-
let s = toEvent(i);
|
|
2732
|
-
this.transition(this.state.value, s);
|
|
2733
|
-
};
|
|
2734
|
-
transition = (i, s) => {
|
|
2735
|
-
let c = isString(i) ? this.getStateNode(i) : i?.stateNode, l = toEvent(s);
|
|
2736
|
-
if (!c && !this.config.on) {
|
|
2737
|
-
let s = this.status === MachineStatus.Stopped ? "[@destyler/xstate > transition] Cannot transition a stopped machine" : `[destyler/xstate > transition] State does not have a definition for \`state\`: ${i}, \`event\`: ${l.type}`;
|
|
2738
|
-
console.warn(s);
|
|
2739
|
-
return;
|
|
2740
|
-
}
|
|
2741
|
-
let u = c?.on?.[l.type] ?? this.config.on?.[l.type], d = this.getNextStateInfo(u, l);
|
|
2742
|
-
return this.performStateChangeEffects(this.state.value, d, l), d.stateNode;
|
|
2743
|
-
};
|
|
2744
|
-
subscribe = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), () => {
|
|
2745
|
-
this.stateListeners.delete(i);
|
|
2746
|
-
});
|
|
2747
|
-
onDone = (i) => (this.doneListeners.add(i), this);
|
|
2748
|
-
onTransition = (i) => (this.stateListeners.add(i), this.status === MachineStatus.Running && i(this.stateSnapshot), this);
|
|
2749
|
-
get [Symbol.toStringTag]() {
|
|
2750
|
-
return "Machine";
|
|
2751
|
-
}
|
|
2752
|
-
getHydrationState() {
|
|
2753
|
-
let i = this.getState();
|
|
2754
|
-
return {
|
|
2755
|
-
value: i.value,
|
|
2756
|
-
tags: i.tags
|
|
2757
|
-
};
|
|
2758
|
-
}
|
|
2759
|
-
};
|
|
2760
|
-
function createMachine(i, s) {
|
|
2761
|
-
return new Machine(i, s);
|
|
2762
|
-
}
|
|
2763
|
-
function createProps() {
|
|
2764
|
-
return (i) => Array.from(new Set(i));
|
|
2765
|
-
}
|
|
2766
|
-
function createNormalizer(i) {
|
|
2767
|
-
return new Proxy({}, { get() {
|
|
2768
|
-
return i;
|
|
2769
|
-
} });
|
|
2770
|
-
}
|
|
2771
|
-
var parts = createAnatomy("popover").parts("arrow", "arrowTip", "anchor", "trigger", "indicator", "positioner", "content", "title", "description", "closeTrigger").build(), dom = createScope({
|
|
2772
|
-
getAnchorId: (i) => i.ids?.anchor ?? `popover:${i.id}:anchor`,
|
|
2773
|
-
getTriggerId: (i) => i.ids?.trigger ?? `popover:${i.id}:trigger`,
|
|
2774
|
-
getContentId: (i) => i.ids?.content ?? `popover:${i.id}:content`,
|
|
2775
|
-
getPositionerId: (i) => i.ids?.positioner ?? `popover:${i.id}:popper`,
|
|
2776
|
-
getArrowId: (i) => i.ids?.arrow ?? `popover:${i.id}:arrow`,
|
|
2777
|
-
getTitleId: (i) => i.ids?.title ?? `popover:${i.id}:title`,
|
|
2778
|
-
getDescriptionId: (i) => i.ids?.description ?? `popover:${i.id}:desc`,
|
|
2779
|
-
getCloseTriggerId: (i) => i.ids?.closeTrigger ?? `popover:${i.id}:close`,
|
|
2780
|
-
getAnchorEl: (i) => dom.getById(i, dom.getAnchorId(i)),
|
|
2781
|
-
getTriggerEl: (i) => dom.getById(i, dom.getTriggerId(i)),
|
|
2782
|
-
getContentEl: (i) => dom.getById(i, dom.getContentId(i)),
|
|
2783
|
-
getPositionerEl: (i) => dom.getById(i, dom.getPositionerId(i)),
|
|
2784
|
-
getTitleEl: (i) => dom.getById(i, dom.getTitleId(i)),
|
|
2785
|
-
getDescriptionEl: (i) => dom.getById(i, dom.getDescriptionId(i)),
|
|
2786
|
-
getFocusableEls: (i) => getFocusables(dom.getContentEl(i)),
|
|
2787
|
-
getFirstFocusableEl: (i) => dom.getFocusableEls(i)[0]
|
|
2788
|
-
});
|
|
2789
|
-
function connect(i, s, c) {
|
|
2790
|
-
let l = i.matches("open"), u = i.context.currentPlacement, d = i.context.currentPortalled, f = i.context.renderedElements, p = getPlacementStyles({
|
|
2791
|
-
...i.context.positioning,
|
|
2792
|
-
placement: u
|
|
2793
|
-
});
|
|
2794
|
-
return {
|
|
2795
|
-
portalled: d,
|
|
2796
|
-
open: l,
|
|
2797
|
-
setOpen(i) {
|
|
2798
|
-
i !== l && s(i ? "OPEN" : "CLOSE");
|
|
2799
|
-
},
|
|
2800
|
-
reposition(i = {}) {
|
|
2801
|
-
s({
|
|
2802
|
-
type: "POSITIONING.SET",
|
|
2803
|
-
options: i
|
|
2804
|
-
});
|
|
2805
|
-
},
|
|
2806
|
-
getArrowProps() {
|
|
2807
|
-
return c.element({
|
|
2808
|
-
id: dom.getArrowId(i.context),
|
|
2809
|
-
...parts.arrow.attrs,
|
|
2810
|
-
dir: i.context.dir,
|
|
2811
|
-
style: p.arrow
|
|
2812
|
-
});
|
|
2813
|
-
},
|
|
2814
|
-
getArrowTipProps() {
|
|
2815
|
-
return c.element({
|
|
2816
|
-
...parts.arrowTip.attrs,
|
|
2817
|
-
dir: i.context.dir,
|
|
2818
|
-
style: p.arrowTip
|
|
2819
|
-
});
|
|
2820
|
-
},
|
|
2821
|
-
getAnchorProps() {
|
|
2822
|
-
return c.element({
|
|
2823
|
-
...parts.anchor.attrs,
|
|
2824
|
-
dir: i.context.dir,
|
|
2825
|
-
id: dom.getAnchorId(i.context)
|
|
2826
|
-
});
|
|
2827
|
-
},
|
|
2828
|
-
getTriggerProps() {
|
|
2829
|
-
return c.button({
|
|
2830
|
-
...parts.trigger.attrs,
|
|
2831
|
-
dir: i.context.dir,
|
|
2832
|
-
type: "button",
|
|
2833
|
-
"data-placement": u,
|
|
2834
|
-
id: dom.getTriggerId(i.context),
|
|
2835
|
-
"aria-haspopup": "dialog",
|
|
2836
|
-
"aria-expanded": l,
|
|
2837
|
-
"data-state": l ? "open" : "closed",
|
|
2838
|
-
"aria-controls": dom.getContentId(i.context),
|
|
2839
|
-
onPointerDown(i) {
|
|
2840
|
-
isSafari() && i.currentTarget.focus();
|
|
2841
|
-
},
|
|
2842
|
-
onClick(i) {
|
|
2843
|
-
i.defaultPrevented || s("TOGGLE");
|
|
2844
|
-
},
|
|
2845
|
-
onBlur(i) {
|
|
2846
|
-
s({
|
|
2847
|
-
type: "TRIGGER_BLUR",
|
|
2848
|
-
target: i.relatedTarget
|
|
2849
|
-
});
|
|
2850
|
-
}
|
|
2851
|
-
});
|
|
2852
|
-
},
|
|
2853
|
-
getIndicatorProps() {
|
|
2854
|
-
return c.element({
|
|
2855
|
-
...parts.indicator.attrs,
|
|
2856
|
-
dir: i.context.dir,
|
|
2857
|
-
"data-state": l ? "open" : "closed"
|
|
2858
|
-
});
|
|
2859
|
-
},
|
|
2860
|
-
getPositionerProps() {
|
|
2861
|
-
return c.element({
|
|
2862
|
-
id: dom.getPositionerId(i.context),
|
|
2863
|
-
...parts.positioner.attrs,
|
|
2864
|
-
dir: i.context.dir,
|
|
2865
|
-
style: p.floating
|
|
2866
|
-
});
|
|
2867
|
-
},
|
|
2868
|
-
getContentProps() {
|
|
2869
|
-
return c.element({
|
|
2870
|
-
...parts.content.attrs,
|
|
2871
|
-
dir: i.context.dir,
|
|
2872
|
-
id: dom.getContentId(i.context),
|
|
2873
|
-
tabIndex: -1,
|
|
2874
|
-
role: "dialog",
|
|
2875
|
-
hidden: !l,
|
|
2876
|
-
"data-state": l ? "open" : "closed",
|
|
2877
|
-
"data-expanded": dataAttr(l),
|
|
2878
|
-
"aria-labelledby": f.title ? dom.getTitleId(i.context) : void 0,
|
|
2879
|
-
"aria-describedby": f.description ? dom.getDescriptionId(i.context) : void 0,
|
|
2880
|
-
"data-placement": u
|
|
2881
|
-
});
|
|
2882
|
-
},
|
|
2883
|
-
getTitleProps() {
|
|
2884
|
-
return c.element({
|
|
2885
|
-
...parts.title.attrs,
|
|
2886
|
-
id: dom.getTitleId(i.context),
|
|
2887
|
-
dir: i.context.dir
|
|
2888
|
-
});
|
|
2889
|
-
},
|
|
2890
|
-
getDescriptionProps() {
|
|
2891
|
-
return c.element({
|
|
2892
|
-
...parts.description.attrs,
|
|
2893
|
-
id: dom.getDescriptionId(i.context),
|
|
2894
|
-
dir: i.context.dir
|
|
2895
|
-
});
|
|
2896
|
-
},
|
|
2897
|
-
getCloseTriggerProps() {
|
|
2898
|
-
return c.button({
|
|
2899
|
-
...parts.closeTrigger.attrs,
|
|
2900
|
-
dir: i.context.dir,
|
|
2901
|
-
id: dom.getCloseTriggerId(i.context),
|
|
2902
|
-
type: "button",
|
|
2903
|
-
"aria-label": "close",
|
|
2904
|
-
onClick(i) {
|
|
2905
|
-
i.defaultPrevented || s("CLOSE");
|
|
2906
|
-
}
|
|
2907
|
-
});
|
|
2908
|
-
}
|
|
2909
|
-
};
|
|
2910
|
-
}
|
|
2911
|
-
function machine(i) {
|
|
2912
|
-
let s = compact(i);
|
|
2913
|
-
return createMachine({
|
|
2914
|
-
id: "popover",
|
|
2915
|
-
initial: s.open ? "open" : "closed",
|
|
2916
|
-
context: {
|
|
2917
|
-
closeOnInteractOutside: !0,
|
|
2918
|
-
closeOnEscape: !0,
|
|
2919
|
-
autoFocus: !0,
|
|
2920
|
-
modal: !1,
|
|
2921
|
-
portalled: !0,
|
|
2922
|
-
positioning: {
|
|
2923
|
-
placement: "bottom",
|
|
2924
|
-
...s.positioning
|
|
2925
|
-
},
|
|
2926
|
-
currentPlacement: void 0,
|
|
2927
|
-
...s,
|
|
2928
|
-
renderedElements: {
|
|
2929
|
-
title: !0,
|
|
2930
|
-
description: !0
|
|
2931
|
-
}
|
|
2932
|
-
},
|
|
2933
|
-
computed: { currentPortalled: (i) => !!i.modal || !!i.portalled },
|
|
2934
|
-
watch: { open: ["toggleVisibility"] },
|
|
2935
|
-
entry: ["checkRenderedElements"],
|
|
2936
|
-
states: {
|
|
2937
|
-
closed: { on: {
|
|
2938
|
-
"CONTROLLED.OPEN": {
|
|
2939
|
-
target: "open",
|
|
2940
|
-
actions: ["setInitialFocus"]
|
|
2941
|
-
},
|
|
2942
|
-
TOGGLE: [{
|
|
2943
|
-
guard: "isOpenControlled",
|
|
2944
|
-
actions: ["invokeOnOpen"]
|
|
2945
|
-
}, {
|
|
2946
|
-
target: "open",
|
|
2947
|
-
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
2948
|
-
}],
|
|
2949
|
-
OPEN: [{
|
|
2950
|
-
guard: "isOpenControlled",
|
|
2951
|
-
actions: ["invokeOnOpen"]
|
|
2952
|
-
}, {
|
|
2953
|
-
target: "open",
|
|
2954
|
-
actions: ["invokeOnOpen", "setInitialFocus"]
|
|
2955
|
-
}]
|
|
2956
|
-
} },
|
|
2957
|
-
open: {
|
|
2958
|
-
activities: [
|
|
2959
|
-
"trapFocus",
|
|
2960
|
-
"preventScroll",
|
|
2961
|
-
"hideContentBelow",
|
|
2962
|
-
"trackPositioning",
|
|
2963
|
-
"trackDismissableElement",
|
|
2964
|
-
"proxyTabFocus"
|
|
2965
|
-
],
|
|
2966
|
-
on: {
|
|
2967
|
-
"CONTROLLED.CLOSE": {
|
|
2968
|
-
target: "closed",
|
|
2969
|
-
actions: ["setFinalFocus"]
|
|
2970
|
-
},
|
|
2971
|
-
CLOSE: [{
|
|
2972
|
-
guard: "isOpenControlled",
|
|
2973
|
-
actions: ["invokeOnClose"]
|
|
2974
|
-
}, {
|
|
2975
|
-
target: "closed",
|
|
2976
|
-
actions: ["invokeOnClose", "setFinalFocus"]
|
|
2977
|
-
}],
|
|
2978
|
-
TOGGLE: [{
|
|
2979
|
-
guard: "isOpenControlled",
|
|
2980
|
-
actions: ["invokeOnClose"]
|
|
2981
|
-
}, {
|
|
2982
|
-
target: "closed",
|
|
2983
|
-
actions: ["invokeOnClose"]
|
|
2984
|
-
}],
|
|
2985
|
-
"POSITIONING.SET": { actions: "reposition" }
|
|
2986
|
-
}
|
|
2987
|
-
}
|
|
2988
|
-
}
|
|
2989
|
-
}, {
|
|
2990
|
-
guards: { isOpenControlled: (i) => !!i["open.controlled"] },
|
|
2991
|
-
activities: {
|
|
2992
|
-
trackPositioning(i) {
|
|
2993
|
-
return i.currentPlacement = i.positioning.placement, getPlacement(dom.getAnchorEl(i) ?? dom.getTriggerEl(i), () => dom.getPositionerEl(i), {
|
|
2994
|
-
...i.positioning,
|
|
2995
|
-
defer: !0,
|
|
2996
|
-
onComplete(s) {
|
|
2997
|
-
i.currentPlacement = s.placement;
|
|
2998
|
-
}
|
|
2999
|
-
});
|
|
3000
|
-
},
|
|
3001
|
-
trackDismissableElement(i, s, { send: c }) {
|
|
3002
|
-
let l = () => dom.getContentEl(i), u = !0;
|
|
3003
|
-
return trackDismissableElement(l, {
|
|
3004
|
-
pointerBlocking: i.modal,
|
|
3005
|
-
exclude: dom.getTriggerEl(i),
|
|
3006
|
-
defer: !0,
|
|
3007
|
-
onEscapeKeyDown(s) {
|
|
3008
|
-
i.onEscapeKeyDown?.(s), !i.closeOnEscape && s.preventDefault();
|
|
3009
|
-
},
|
|
3010
|
-
onInteractOutside(s) {
|
|
3011
|
-
i.onInteractOutside?.(s), !s.defaultPrevented && (u = !(s.detail.focusable || s.detail.contextmenu), i.closeOnInteractOutside || s.preventDefault());
|
|
3012
|
-
},
|
|
3013
|
-
onPointerDownOutside: i.onPointerDownOutside,
|
|
3014
|
-
onFocusOutside: i.onFocusOutside,
|
|
3015
|
-
persistentElements: i.persistentElements,
|
|
3016
|
-
onDismiss() {
|
|
3017
|
-
c({
|
|
3018
|
-
type: "CLOSE",
|
|
3019
|
-
src: "interact-outside",
|
|
3020
|
-
restoreFocus: u
|
|
3021
|
-
});
|
|
3022
|
-
}
|
|
3023
|
-
});
|
|
3024
|
-
},
|
|
3025
|
-
proxyTabFocus(i) {
|
|
3026
|
-
return i.modal || !i.portalled ? void 0 : proxyTabFocus(() => dom.getContentEl(i), {
|
|
3027
|
-
triggerElement: dom.getTriggerEl(i),
|
|
3028
|
-
defer: !0,
|
|
3029
|
-
onFocus(i) {
|
|
3030
|
-
i.focus({ preventScroll: !0 });
|
|
3031
|
-
}
|
|
3032
|
-
});
|
|
3033
|
-
},
|
|
3034
|
-
hideContentBelow(i) {
|
|
3035
|
-
return i.modal ? ariaHidden(() => [dom.getContentEl(i), dom.getTriggerEl(i)], { defer: !0 }) : void 0;
|
|
3036
|
-
},
|
|
3037
|
-
preventScroll(i) {
|
|
3038
|
-
if (i.modal) return preventBodyScroll(dom.getDoc(i));
|
|
3039
|
-
},
|
|
3040
|
-
trapFocus(i) {
|
|
3041
|
-
return i.modal ? trapFocus(() => dom.getContentEl(i), { initialFocus: () => getInitialFocus({
|
|
3042
|
-
root: dom.getContentEl(i),
|
|
3043
|
-
getInitialEl: i.initialFocusEl,
|
|
3044
|
-
enabled: i.autoFocus
|
|
3045
|
-
}) }) : void 0;
|
|
3046
|
-
}
|
|
3047
|
-
},
|
|
3048
|
-
actions: {
|
|
3049
|
-
reposition(i, s) {
|
|
3050
|
-
getPlacement(dom.getAnchorEl(i) ?? dom.getTriggerEl(i), () => dom.getPositionerEl(i), {
|
|
3051
|
-
...i.positioning,
|
|
3052
|
-
...s.options,
|
|
3053
|
-
defer: !0,
|
|
3054
|
-
listeners: !1,
|
|
3055
|
-
onComplete(s) {
|
|
3056
|
-
i.currentPlacement = s.placement;
|
|
3057
|
-
}
|
|
3058
|
-
});
|
|
3059
|
-
},
|
|
3060
|
-
checkRenderedElements(i) {
|
|
3061
|
-
raf$1(() => {
|
|
3062
|
-
Object.assign(i.renderedElements, {
|
|
3063
|
-
title: !!dom.getTitleEl(i),
|
|
3064
|
-
description: !!dom.getDescriptionEl(i)
|
|
3065
|
-
});
|
|
3066
|
-
});
|
|
3067
|
-
},
|
|
3068
|
-
setInitialFocus(i) {
|
|
3069
|
-
i.modal || raf$1(() => {
|
|
3070
|
-
getInitialFocus({
|
|
3071
|
-
root: dom.getContentEl(i),
|
|
3072
|
-
getInitialEl: i.initialFocusEl,
|
|
3073
|
-
enabled: i.autoFocus
|
|
3074
|
-
})?.focus({ preventScroll: !0 });
|
|
3075
|
-
});
|
|
3076
|
-
},
|
|
3077
|
-
setFinalFocus(i, s) {
|
|
3078
|
-
let c = s.restoreFocus ?? s.previousEvent?.restoreFocus;
|
|
3079
|
-
c != null && !c || raf$1(() => {
|
|
3080
|
-
dom.getTriggerEl(i)?.focus({ preventScroll: !0 });
|
|
3081
|
-
});
|
|
3082
|
-
},
|
|
3083
|
-
invokeOnOpen(i) {
|
|
3084
|
-
i.onOpenChange?.({ open: !0 });
|
|
3085
|
-
},
|
|
3086
|
-
invokeOnClose(i) {
|
|
3087
|
-
i.onOpenChange?.({ open: !1 });
|
|
3088
|
-
},
|
|
3089
|
-
toggleVisibility(i, s, { send: c }) {
|
|
3090
|
-
c({
|
|
3091
|
-
type: i.open ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE",
|
|
3092
|
-
previousEvent: s
|
|
3093
|
-
});
|
|
3094
|
-
}
|
|
3095
|
-
}
|
|
3096
|
-
});
|
|
3097
|
-
}
|
|
3098
|
-
createProps()([
|
|
3099
|
-
"autoFocus",
|
|
3100
|
-
"closeOnEscape",
|
|
3101
|
-
"closeOnInteractOutside",
|
|
3102
|
-
"dir",
|
|
3103
|
-
"getRootNode",
|
|
3104
|
-
"id",
|
|
3105
|
-
"ids",
|
|
3106
|
-
"initialFocusEl",
|
|
3107
|
-
"modal",
|
|
3108
|
-
"onEscapeKeyDown",
|
|
3109
|
-
"onFocusOutside",
|
|
3110
|
-
"onInteractOutside",
|
|
3111
|
-
"onOpenChange",
|
|
3112
|
-
"onPointerDownOutside",
|
|
3113
|
-
"open.controlled",
|
|
3114
|
-
"open",
|
|
3115
|
-
"persistentElements",
|
|
3116
|
-
"portalled",
|
|
3117
|
-
"positioning"
|
|
3118
|
-
]);
|
|
3119
|
-
function useSnapshot(i, s) {
|
|
3120
|
-
let { actions: c, context: l } = s ?? {}, u = shallowRef(i.state), d = subscribe(i.state, () => {
|
|
3121
|
-
u.value = snapshot(i.state);
|
|
3122
|
-
});
|
|
3123
|
-
return onUnmounted(() => {
|
|
3124
|
-
d?.();
|
|
3125
|
-
}), watchEffect(() => {
|
|
3126
|
-
i.setOptions({ actions: c });
|
|
3127
|
-
}), l && watch(l, (s) => {
|
|
3128
|
-
i.setContext(unref(s));
|
|
3129
|
-
}, { deep: !0 }), u;
|
|
3130
|
-
}
|
|
3131
|
-
function useService(i, s) {
|
|
3132
|
-
let { state: c, context: l } = s ?? {}, u = typeof i == "function" ? i() : i;
|
|
3133
|
-
return l && u.setContext(unref(l)), u._created(), onMounted(() => {
|
|
3134
|
-
u.start(c), onBeforeUnmount(() => {
|
|
3135
|
-
u.stop();
|
|
3136
|
-
});
|
|
3137
|
-
}), u;
|
|
3138
|
-
}
|
|
3139
|
-
function useMachine(i, s) {
|
|
3140
|
-
let c = useService(i, s);
|
|
3141
|
-
return [
|
|
3142
|
-
useSnapshot(c, s),
|
|
3143
|
-
c.send,
|
|
3144
|
-
c
|
|
3145
|
-
];
|
|
3146
|
-
}
|
|
3147
|
-
function toCase(i) {
|
|
3148
|
-
return i.charAt(0).toUpperCase() + i.substr(1).toLowerCase();
|
|
3149
|
-
}
|
|
3150
|
-
var propMap = {
|
|
3151
|
-
htmlFor: "for",
|
|
3152
|
-
className: "class",
|
|
3153
|
-
onDoubleClick: "onDblclick",
|
|
3154
|
-
onChange: "onInput",
|
|
3155
|
-
onFocus: "onFocusin",
|
|
3156
|
-
onBlur: "onFocusout",
|
|
3157
|
-
defaultValue: "value",
|
|
3158
|
-
defaultChecked: "checked"
|
|
3159
|
-
};
|
|
3160
|
-
function toVueProp(i) {
|
|
3161
|
-
return i in propMap ? propMap[i] : i.startsWith("on") ? `on${toCase(i.substr(2))}` : i.toLowerCase();
|
|
3162
|
-
}
|
|
3163
|
-
var normalizeProps$1 = createNormalizer((i) => {
|
|
3164
|
-
let s = {};
|
|
3165
|
-
for (let c in i) {
|
|
3166
|
-
let l = i[c];
|
|
3167
|
-
c === "children" ? typeof l == "string" && (s.innerHTML = l) : s[toVueProp(c)] = i[c];
|
|
3168
|
-
}
|
|
3169
|
-
return s;
|
|
3170
|
-
}), _hoisted_1$7 = {
|
|
3171
|
-
key: 0,
|
|
3172
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3173
|
-
width: "1em",
|
|
3174
|
-
height: "1em",
|
|
3175
|
-
viewBox: "0 0 16 16"
|
|
3176
|
-
}, _hoisted_2$6 = {
|
|
3177
|
-
key: 1,
|
|
3178
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3179
|
-
width: "1em",
|
|
3180
|
-
height: "1em",
|
|
3181
|
-
viewBox: "0 0 16 16"
|
|
3182
|
-
}, ComponentsIcones_default = /* @__PURE__ */ defineComponent({
|
|
3183
|
-
name: "ComponentIcones",
|
|
3184
|
-
__name: "ComponentsIcones",
|
|
3185
|
-
props: { expanded: {
|
|
3186
|
-
type: Boolean,
|
|
3187
|
-
default: !1
|
|
3188
|
-
} },
|
|
3189
|
-
setup(i) {
|
|
3190
|
-
let s = i;
|
|
3191
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$7, [...c[0] ||= [createElementVNode("g", {
|
|
3192
|
-
fill: "none",
|
|
3193
|
-
"stroke-linecap": "round",
|
|
3194
|
-
"stroke-linejoin": "round"
|
|
3195
|
-
}, [createElementVNode("path", {
|
|
3196
|
-
class: "stroke-dark dark:stroke-light",
|
|
3197
|
-
d: "m1.87 8l.7-2.74a1 1 0 0 1 .96-.76h10.94a1 1 0 0 1 .97 1.24l-.219.875M6 13.5H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3198
|
-
}), createElementVNode("path", {
|
|
3199
|
-
stroke: "#67B686",
|
|
3200
|
-
d: "m9.485 9.516l3.968 3.968m-3.968 0l3.968-3.968m-1.634-1.874l3.507 3.507a.496.496 0 0 1 0 .702l-3.507 3.507a.496.496 0 0 1-.701 0L7.61 11.85a.496.496 0 0 1 0-.702l3.507-3.507a.496.496 0 0 1 .701 0z"
|
|
3201
|
-
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$6, [...c[1] ||= [createElementVNode("g", {
|
|
3202
|
-
fill: "none",
|
|
3203
|
-
"stroke-linecap": "round",
|
|
3204
|
-
"stroke-linejoin": "round"
|
|
3205
|
-
}, [createElementVNode("path", {
|
|
3206
|
-
class: "stroke-dark dark:stroke-light",
|
|
3207
|
-
d: "M4.5 4.5H12c.83 0 1.5.67 1.5 1.5v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3208
|
-
}), createElementVNode("path", {
|
|
3209
|
-
stroke: "#67B686",
|
|
3210
|
-
d: "m9.485 9.516l3.968 3.968m-3.968 0l3.968-3.968m-1.634-1.874l3.507 3.507a.496.496 0 0 1 0 .702l-3.507 3.507a.496.496 0 0 1-.701 0L7.61 11.85a.496.496 0 0 1 0-.702l3.507-3.507a.496.496 0 0 1 .701 0z"
|
|
3211
|
-
})], -1)]]));
|
|
3212
|
-
}
|
|
3213
|
-
}), _hoisted_1$6 = {
|
|
3214
|
-
key: 0,
|
|
3215
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3216
|
-
width: "1em",
|
|
3217
|
-
height: "1em",
|
|
3218
|
-
viewBox: "0 0 16 16"
|
|
3219
|
-
}, _hoisted_2$5 = {
|
|
3220
|
-
key: 1,
|
|
3221
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3222
|
-
width: "1em",
|
|
3223
|
-
height: "1em",
|
|
3224
|
-
viewBox: "0 0 16 16"
|
|
3225
|
-
}, FolderIcones_default = /* @__PURE__ */ defineComponent({
|
|
3226
|
-
name: "FolderIcones",
|
|
3227
|
-
__name: "FolderIcones",
|
|
3228
|
-
props: { expanded: {
|
|
3229
|
-
type: Boolean,
|
|
3230
|
-
default: !1
|
|
3231
|
-
} },
|
|
3232
|
-
setup(i) {
|
|
3233
|
-
let s = i;
|
|
3234
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$6, [...c[0] ||= [createElementVNode("path", {
|
|
3235
|
-
fill: "none",
|
|
3236
|
-
class: "stroke-dark dark:stroke-light",
|
|
3237
|
-
"stroke-linecap": "round",
|
|
3238
|
-
"stroke-linejoin": "round",
|
|
3239
|
-
d: "m1.87 8l.7-2.74a1 1 0 0 1 .96-.76h10.94a1 1 0 0 1 .97 1.24l-1.75 7a1 1 0 0 1-.97.76H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3240
|
-
}, null, -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$5, [...c[1] ||= [createElementVNode("path", {
|
|
3241
|
-
fill: "none",
|
|
3242
|
-
class: "stroke-dark dark:stroke-light",
|
|
3243
|
-
"stroke-linecap": "round",
|
|
3244
|
-
"stroke-linejoin": "round",
|
|
3245
|
-
d: "M4.5 4.5H12c.83 0 1.5.67 1.5 1.5v6c0 .83-.67 1.5-1.5 1.5H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3246
|
-
}, null, -1)]]));
|
|
3247
|
-
}
|
|
3248
|
-
}), _hoisted_1$5 = {
|
|
3249
|
-
key: 0,
|
|
3250
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3251
|
-
width: "1em",
|
|
3252
|
-
height: "1em",
|
|
3253
|
-
viewBox: "0 0 16 16"
|
|
3254
|
-
}, _hoisted_2$4 = {
|
|
3255
|
-
key: 1,
|
|
3256
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3257
|
-
width: "1em",
|
|
3258
|
-
height: "1em",
|
|
3259
|
-
viewBox: "0 0 16 16"
|
|
3260
|
-
}, ModuleIcones_default = /* @__PURE__ */ defineComponent({
|
|
3261
|
-
name: "ModleIcones",
|
|
3262
|
-
__name: "ModuleIcones",
|
|
3263
|
-
props: { expanded: {
|
|
3264
|
-
type: Boolean,
|
|
3265
|
-
default: !1
|
|
3266
|
-
} },
|
|
3267
|
-
setup(i) {
|
|
3268
|
-
let s = i;
|
|
3269
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$5, [...c[0] ||= [createElementVNode("g", {
|
|
3270
|
-
fill: "none",
|
|
3271
|
-
"stroke-linecap": "round",
|
|
3272
|
-
"stroke-linejoin": "round"
|
|
3273
|
-
}, [createElementVNode("path", {
|
|
3274
|
-
class: "stroke-dark dark:stroke-light",
|
|
3275
|
-
d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3276
|
-
}), createElementVNode("path", {
|
|
3277
|
-
stroke: "#65bb87",
|
|
3278
|
-
d: "M15.5 13.5v1.2a.8.8 0 0 1-.8.8h-4.4a.8.8 0 0 1-.8-.8v-1.2H9a1 1 0 0 1 0-2h.5v-1.2a.8.8 0 0 1 .8-.8h1.2V9a1 1 0 0 1 2 0v.5h1.2a.8.8 0 0 1 .8.8v1.2H15a1 1 0 0 0 0 2z"
|
|
3279
|
-
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$4, [...c[1] ||= [createElementVNode("g", {
|
|
3280
|
-
fill: "none",
|
|
3281
|
-
"stroke-linecap": "round",
|
|
3282
|
-
"stroke-linejoin": "round"
|
|
3283
|
-
}, [createElementVNode("path", {
|
|
3284
|
-
class: "stroke-dark dark:stroke-light",
|
|
3285
|
-
d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3286
|
-
}), createElementVNode("path", {
|
|
3287
|
-
stroke: "#65bb87",
|
|
3288
|
-
d: "M15.5 13.5v1.2a.8.8 0 0 1-.8.8h-4.4a.8.8 0 0 1-.8-.8v-1.2H9a1 1 0 0 1 0-2h.5v-1.2a.8.8 0 0 1 .8-.8h1.2V9a1 1 0 0 1 2 0v.5h1.2a.8.8 0 0 1 .8.8v1.2H15a1 1 0 0 0 0 2z"
|
|
3289
|
-
})], -1)]]));
|
|
3290
|
-
}
|
|
3291
|
-
}), _hoisted_1$4 = {
|
|
3292
|
-
key: 0,
|
|
3293
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3294
|
-
width: "1em",
|
|
3295
|
-
height: "1em",
|
|
3296
|
-
viewBox: "0 0 16 16"
|
|
3297
|
-
}, _hoisted_2$3 = {
|
|
3298
|
-
key: 1,
|
|
3299
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3300
|
-
width: "1em",
|
|
3301
|
-
height: "1em",
|
|
3302
|
-
viewBox: "0 0 16 16"
|
|
3303
|
-
}, PackagesIcones_default = /* @__PURE__ */ defineComponent({
|
|
3304
|
-
name: "PackagesIcones",
|
|
3305
|
-
__name: "PackagesIcones",
|
|
3306
|
-
props: { expanded: {
|
|
3307
|
-
type: Boolean,
|
|
3308
|
-
default: !1
|
|
3309
|
-
} },
|
|
3310
|
-
setup(i) {
|
|
3311
|
-
let s = i;
|
|
3312
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$4, [...c[0] ||= [createElementVNode("g", {
|
|
3313
|
-
fill: "none",
|
|
3314
|
-
"stroke-linecap": "round",
|
|
3315
|
-
"stroke-linejoin": "round"
|
|
3316
|
-
}, [createElementVNode("path", {
|
|
3317
|
-
class: "stroke-dark dark:stroke-light",
|
|
3318
|
-
d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3319
|
-
}), createElementVNode("path", {
|
|
3320
|
-
stroke: "#E23730",
|
|
3321
|
-
d: "M12 15.337v-3.919L8.5 9.214m3.5 2.204l3.5-2.204M12 7.5l3.5 1.714v4.408L12 15.5l-3.5-1.878V9.214Z"
|
|
3322
|
-
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$3, [...c[1] ||= [createElementVNode("g", {
|
|
3323
|
-
fill: "none",
|
|
3324
|
-
"stroke-linecap": "round",
|
|
3325
|
-
"stroke-linejoin": "round"
|
|
3326
|
-
}, [createElementVNode("path", {
|
|
3327
|
-
class: "stroke-dark dark:stroke-light",
|
|
3328
|
-
d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3329
|
-
}), createElementVNode("path", {
|
|
3330
|
-
stroke: "#E23730",
|
|
3331
|
-
d: "M12 15.337v-3.919L8.5 9.214m3.5 2.204l3.5-2.204M12 7.5l3.5 1.714v4.408L12 15.5l-3.5-1.878V9.214Z"
|
|
3332
|
-
})], -1)]]));
|
|
3333
|
-
}
|
|
3334
|
-
}), _hoisted_1$3 = {
|
|
3335
|
-
key: 0,
|
|
3336
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3337
|
-
width: "1em",
|
|
3338
|
-
height: "1em",
|
|
3339
|
-
viewBox: "0 0 16 16"
|
|
3340
|
-
}, _hoisted_2$2 = {
|
|
3341
|
-
key: 1,
|
|
3342
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3343
|
-
width: "1em",
|
|
3344
|
-
height: "1em",
|
|
3345
|
-
viewBox: "0 0 16 16"
|
|
3346
|
-
}, SrcIcones_default = /* @__PURE__ */ defineComponent({
|
|
3347
|
-
name: "SrcIcones",
|
|
3348
|
-
__name: "SrcIcones",
|
|
3349
|
-
props: { expanded: {
|
|
3350
|
-
type: Boolean,
|
|
3351
|
-
default: !1
|
|
3352
|
-
} },
|
|
3353
|
-
setup(i) {
|
|
3354
|
-
let s = i;
|
|
3355
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$3, [...c[0] ||= [createElementVNode("g", {
|
|
3356
|
-
fill: "none",
|
|
3357
|
-
"stroke-linecap": "round",
|
|
3358
|
-
"stroke-linejoin": "round"
|
|
3359
|
-
}, [createElementVNode("path", {
|
|
3360
|
-
class: "stroke-dark dark:stroke-light",
|
|
3361
|
-
d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3362
|
-
}), createElementVNode("path", {
|
|
3363
|
-
stroke: "#65bb87",
|
|
3364
|
-
d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
|
|
3365
|
-
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$2, [...c[1] ||= [createElementVNode("g", {
|
|
3366
|
-
fill: "none",
|
|
3367
|
-
"stroke-linecap": "round",
|
|
3368
|
-
"stroke-linejoin": "round"
|
|
3369
|
-
}, [createElementVNode("path", {
|
|
3370
|
-
class: "stroke-dark dark:stroke-light",
|
|
3371
|
-
d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3372
|
-
}), createElementVNode("path", {
|
|
3373
|
-
stroke: "#65bb87",
|
|
3374
|
-
d: "m10.5 8.5l-3 3.5l3 3.5m2-7l3 3.5l-3 3.5"
|
|
3375
|
-
})], -1)]]));
|
|
3376
|
-
}
|
|
3377
|
-
}), _hoisted_1$2 = {
|
|
3378
|
-
key: 0,
|
|
3379
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3380
|
-
width: "1em",
|
|
3381
|
-
height: "1em",
|
|
3382
|
-
viewBox: "0 0 16 16"
|
|
3383
|
-
}, _hoisted_2$1 = {
|
|
3384
|
-
key: 1,
|
|
3385
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3386
|
-
width: "1em",
|
|
3387
|
-
height: "1em",
|
|
3388
|
-
viewBox: "0 0 16 16"
|
|
3389
|
-
}, ViewIcones_default = /* @__PURE__ */ defineComponent({
|
|
3390
|
-
name: "ViewIcones",
|
|
3391
|
-
__name: "ViewIcones",
|
|
3392
|
-
props: { expanded: {
|
|
3393
|
-
type: Boolean,
|
|
3394
|
-
default: !1
|
|
3395
|
-
} },
|
|
3396
|
-
setup(i) {
|
|
3397
|
-
let s = i;
|
|
3398
|
-
return (i, c) => s.expanded ? (openBlock(), createElementBlock("svg", _hoisted_1$2, [...c[0] ||= [createElementVNode("g", {
|
|
3399
|
-
fill: "none",
|
|
3400
|
-
"stroke-linecap": "round",
|
|
3401
|
-
"stroke-linejoin": "round"
|
|
3402
|
-
}, [createElementVNode("path", {
|
|
3403
|
-
class: "stroke-dark dark:stroke-light",
|
|
3404
|
-
d: "m1.875 8l.686-2.743a1 1 0 0 1 .97-.757h10.938a1 1 0 0 1 .97 1.243l-.315 1.26M6 13.5H2.004A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3405
|
-
}), createElementVNode("path", {
|
|
3406
|
-
stroke: "#E23730",
|
|
3407
|
-
d: "M14.692 8.5H9.308a.31.31 0 0 0-.307.336l.47 5.241c.01.128.1.235.223.27l2.303 1.153l2.308-1.153a.31.31 0 0 0 .225-.27L15 8.836a.31.31 0 0 0-.307-.336"
|
|
3408
|
-
})], -1)]])) : (openBlock(), createElementBlock("svg", _hoisted_2$1, [...c[1] ||= [createElementVNode("g", {
|
|
3409
|
-
fill: "none",
|
|
3410
|
-
"stroke-linecap": "round",
|
|
3411
|
-
"stroke-linejoin": "round"
|
|
3412
|
-
}, [createElementVNode("path", {
|
|
3413
|
-
class: "stroke-dark dark:stroke-light",
|
|
3414
|
-
d: "M4.5 4.5H12A1.5 1.5 0 0 1 13.5 6v.5m-7.5 7H2A1.5 1.5 0 0 1 .5 12V3.5a1 1 0 0 1 1-1h5a1 1 0 0 1 1 1v1"
|
|
3415
|
-
}), createElementVNode("path", {
|
|
3416
|
-
stroke: "#E23730",
|
|
3417
|
-
d: "M14.692 8.5H9.308a.31.31 0 0 0-.307.336l.47 5.241c.01.128.1.235.223.27l2.303 1.153l2.308-1.153a.31.31 0 0 0 .225-.27L15 8.836a.31.31 0 0 0-.307-.336"
|
|
3418
|
-
})], -1)]]));
|
|
3419
|
-
}
|
|
3420
|
-
}), _hoisted_1$1 = {
|
|
3421
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
3422
|
-
width: "1em",
|
|
3423
|
-
height: "1em",
|
|
3424
|
-
viewBox: "0 0 16 16"
|
|
3425
|
-
}, VueIcones_default = /* @__PURE__ */ defineComponent({
|
|
3426
|
-
name: "VueIcones",
|
|
3427
|
-
__name: "VueIcones",
|
|
3428
|
-
setup(i) {
|
|
3429
|
-
return (i, s) => (openBlock(), createElementBlock("svg", _hoisted_1$1, [...s[0] ||= [createElementVNode("g", {
|
|
3430
|
-
fill: "none",
|
|
3431
|
-
stroke: "#65bb87",
|
|
3432
|
-
"stroke-linecap": "round",
|
|
3433
|
-
"stroke-linejoin": "round"
|
|
3434
|
-
}, [createElementVNode("path", { d: "M1 1.5h5.44L8 4.56L9.56 1.5H15l-6.99 13z" }), createElementVNode("path", { d: "M12.05 1.73L8 9.28L3.95 1.73" })], -1)]]));
|
|
3435
|
-
}
|
|
3436
|
-
}), _hoisted_1 = { class: "mt-0" }, _hoisted_2 = { class: "w-152 mb-2" }, _hoisted_3 = { class: "inline-flex items-center text-inherit not-italic leading-[0] text-center normal-case [vertical-align:-0.125em] [text-rendering:optimizeLegibility] svg:size-4" }, _hoisted_4 = {
|
|
3437
|
-
key: 1,
|
|
3438
|
-
class: "flex items-center justify-center h-[220px]"
|
|
3439
|
-
}, ComponentSelect_default = /* @__PURE__ */ defineComponent({
|
|
3440
|
-
name: "ComponentSelect",
|
|
3441
|
-
__name: "ComponentSelect",
|
|
3442
|
-
props: {
|
|
3443
|
-
modelValue: { default: "" },
|
|
3444
|
-
modelModifiers: {},
|
|
3445
|
-
scope: { default: "" },
|
|
3446
|
-
scopeModifiers: {}
|
|
3447
|
-
},
|
|
3448
|
-
emits: ["update:modelValue", "update:scope"],
|
|
3449
|
-
setup(m) {
|
|
3450
|
-
let b = Empty.PRESENTED_IMAGE_SIMPLE, x = useViewStore(), S = useModel(m, "modelValue"), T = useModel(m, "scope"), E = useTemplateRef("searchInputRef"), [M, B] = useMachine(machine({
|
|
3451
|
-
id: useId(),
|
|
3452
|
-
initialFocusEl: () => E.value
|
|
3453
|
-
})), V = computed(() => connect(M.value, B, normalizeProps$1)), H = ref(!1), U = ref(""), W = computed(() => S.value ? [`${T.value ? `module:${T.value}` : "local"}/${S.value}`] : []), G = ref([]);
|
|
3454
|
-
function K(i) {
|
|
3455
|
-
return !i.includes("/");
|
|
3456
|
-
}
|
|
3457
|
-
function q(i) {
|
|
3458
|
-
let s = i.indexOf("/");
|
|
3459
|
-
return s === -1 ? i : i.slice(0, s);
|
|
3460
|
-
}
|
|
3461
|
-
function J(i) {
|
|
3462
|
-
let s = i.split("/"), c = [], l = "";
|
|
3463
|
-
for (let i = 0; i < Math.max(0, s.length - 1); i++) {
|
|
3464
|
-
let u = s[i];
|
|
3465
|
-
l = i === 0 ? u : `${l}/${u}`, c.push(l);
|
|
3466
|
-
}
|
|
3467
|
-
return c;
|
|
3468
|
-
}
|
|
3469
|
-
function Y(i, s) {
|
|
3470
|
-
let c = i || [], l = s?.node?.key, u = !!s?.expanded, d;
|
|
3471
|
-
d = l && K(l) ? u ? l : void 0 : l ? q(l) : c.find(K), G.value = c.filter((i) => !K(String(i)) || String(i) === d);
|
|
3472
|
-
}
|
|
3473
|
-
function X() {
|
|
3474
|
-
let i = W.value[0];
|
|
3475
|
-
i && (G.value = J(i));
|
|
3476
|
-
}
|
|
3477
|
-
watch(W, () => {
|
|
3478
|
-
X();
|
|
3479
|
-
}, { immediate: !0 }), watch(H, (i) => {
|
|
3480
|
-
i && X();
|
|
3481
|
-
}), watch(H, (i) => {
|
|
3482
|
-
i && X();
|
|
3483
|
-
});
|
|
3484
|
-
let Z = computed(() => {
|
|
3485
|
-
let i = U.value.trim();
|
|
3486
|
-
return i ? x.filterRouteTree(i) : x.getRouteTreeData();
|
|
3487
|
-
});
|
|
3488
|
-
function Q(i) {
|
|
3489
|
-
let s = [], c = (i) => {
|
|
3490
|
-
for (let l of i || []) Array.isArray(l?.children) && l.children.length > 0 && (s.push(String(l.key)), c(l.children));
|
|
3491
|
-
};
|
|
3492
|
-
return c(i), s;
|
|
3493
|
-
}
|
|
3494
|
-
watch(U, (i) => {
|
|
3495
|
-
if (String(i || "").trim().length > 0) {
|
|
3496
|
-
let i = Z.value;
|
|
3497
|
-
G.value = Q(i);
|
|
3498
|
-
} else X();
|
|
3499
|
-
});
|
|
3500
|
-
function $(i, s) {
|
|
3501
|
-
let c = s?.node, l = c?.dataRef ?? c;
|
|
3502
|
-
l?.isLeaf && (S.value = l.value || "", T.value = l.scope || "", U.value = "", H.value = !1);
|
|
3503
|
-
}
|
|
3504
|
-
return (i, c) => {
|
|
3505
|
-
let m = Input$1, x = FormItemRest, w = DirectoryTree, E = Empty$1;
|
|
3506
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", normalizeProps(guardReactiveProps(unref(V).getTriggerProps())), [createVNode(m, {
|
|
3507
|
-
value: S.value,
|
|
3508
|
-
"onUpdate:value": c[0] ||= (i) => S.value = i,
|
|
3509
|
-
"addon-before": T.value || "本地",
|
|
3510
|
-
placeholder: "请输入或选择组件路径(views下的路径)"
|
|
3511
|
-
}, null, 8, ["value", "addon-before"])], 16), (openBlock(), createBlock(Teleport, { to: "body" }, [unref(V).open ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, unref(V).getPositionerProps(), { class: "z-1050" }), [createElementVNode("div", mergeProps(unref(V).getContentProps(), { class: "z-1050 w-162 rounded-md border border-solid p-4 border-[--g-border-color] shadow-md outline-none bg-#ffffff dark:bg-#141414 text-dark dark:text-light data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95" }), [createElementVNode("div", _hoisted_2, [createVNode(x, null, {
|
|
3512
|
-
default: withCtx(() => [createVNode(m, {
|
|
3513
|
-
ref: "searchInputRef",
|
|
3514
|
-
value: unref(U),
|
|
3515
|
-
"onUpdate:value": c[1] ||= (i) => isRef(U) ? U.value = i : null,
|
|
3516
|
-
"allow-clear": "",
|
|
3517
|
-
size: "small",
|
|
3518
|
-
placeholder: "搜索组件或路径"
|
|
3519
|
-
}, null, 8, ["value"])]),
|
|
3520
|
-
_: 1
|
|
3521
|
-
})]), unref(Z) && unref(Z).length ? (openBlock(), createBlock(w, {
|
|
3522
|
-
key: 0,
|
|
3523
|
-
"expanded-keys": unref(G),
|
|
3524
|
-
"onUpdate:expandedKeys": c[2] ||= (i) => isRef(G) ? G.value = i : null,
|
|
3525
|
-
class: "w-152 h-100 overflow-y-auto directory-tree-root",
|
|
3526
|
-
"selected-keys": unref(W),
|
|
3527
|
-
"tree-data": unref(Z),
|
|
3528
|
-
"show-icon": !0,
|
|
3529
|
-
"show-line": !0,
|
|
3530
|
-
virtual: !0,
|
|
3531
|
-
"expand-action": "click",
|
|
3532
|
-
onExpand: Y,
|
|
3533
|
-
onSelect: $
|
|
3534
|
-
}, {
|
|
3535
|
-
switcherIcon: withCtx(({ switcherCls: i }) => [createVNode(unref(CaretDownOutlined), { class: normalizeClass(i) }, null, 8, ["class"])]),
|
|
3536
|
-
icon: withCtx(({ expanded: i, dataRef: s }) => [createElementVNode("span", _hoisted_3, [s?.root && !s?.module ? (openBlock(), createBlock(PackagesIcones_default, {
|
|
3537
|
-
key: 0,
|
|
3538
|
-
expanded: i
|
|
3539
|
-
}, null, 8, ["expanded"])) : s?.root && s?.module ? (openBlock(), createBlock(ModuleIcones_default, {
|
|
3540
|
-
key: 1,
|
|
3541
|
-
expanded: i
|
|
3542
|
-
}, null, 8, ["expanded"])) : s?.isLeaf ? (openBlock(), createBlock(VueIcones_default, { key: 2 })) : ["components", "component"].includes(String(s?.title).toLowerCase()) ? (openBlock(), createBlock(ComponentsIcones_default, {
|
|
3543
|
-
key: 3,
|
|
3544
|
-
expanded: i
|
|
3545
|
-
}, null, 8, ["expanded"])) : [
|
|
3546
|
-
"views",
|
|
3547
|
-
"view",
|
|
3548
|
-
"pages",
|
|
3549
|
-
"page"
|
|
3550
|
-
].includes(String(s?.title).toLowerCase()) ? (openBlock(), createBlock(ViewIcones_default, {
|
|
3551
|
-
key: 4,
|
|
3552
|
-
expanded: i
|
|
3553
|
-
}, null, 8, ["expanded"])) : ["src"].includes(String(s?.title).toLowerCase()) ? (openBlock(), createBlock(SrcIcones_default, {
|
|
3554
|
-
key: 5,
|
|
3555
|
-
expanded: i
|
|
3556
|
-
}, null, 8, ["expanded"])) : (openBlock(), createBlock(FolderIcones_default, {
|
|
3557
|
-
key: 6,
|
|
3558
|
-
expanded: i
|
|
3559
|
-
}, null, 8, ["expanded"]))])]),
|
|
3560
|
-
_: 1
|
|
3561
|
-
}, 8, [
|
|
3562
|
-
"expanded-keys",
|
|
3563
|
-
"selected-keys",
|
|
3564
|
-
"tree-data"
|
|
3565
|
-
])) : (openBlock(), createElementBlock("div", _hoisted_4, [createVNode(E, {
|
|
3566
|
-
image: unref(b),
|
|
3567
|
-
description: "没有找到匹配的组件"
|
|
3568
|
-
}, null, 8, ["image"])]))], 16)], 16)) : createCommentVNode("", !0)]))]);
|
|
3569
|
-
};
|
|
3570
|
-
}
|
|
3571
|
-
});
|
|
3572
|
-
export { ComponentSelect_default as t };
|