@deck9/ui 0.17.0-next.0 → 0.17.0-next.1

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/src/ui.mjs CHANGED
@@ -1,163 +1,167 @@
1
- import { defineComponent as T, computed as k, openBlock as C, createBlock as U, unref as _, mergeProps as Ne, createCommentVNode as M, createElementBlock as I, normalizeClass as F, createElementVNode as A, toDisplayString as X, createVNode as j, ref as O, getCurrentInstance as In, onMounted as ee, watch as J, Fragment as be, withDirectives as An, vModelText as $n, normalizeStyle as Nt, cloneVNode as Mn, h as Re, inject as he, provide as ye, watchEffect as we, nextTick as N, onUnmounted as Be, toRaw as G, shallowRef as Fn, getCurrentScope as Vn, onScopeDispose as Nn, shallowReadonly as me, withCtx as z, renderSlot as ht, Teleport as Bn, Transition as Bt, normalizeProps as jn, guardReactiveProps as Hn, resolveDynamicComponent as zn, renderList as jt } from "vue";
2
- import { FontAwesomeIcon as Un } from "@fortawesome/vue-fontawesome";
3
- import { library as lt } from "@fortawesome/fontawesome-svg-core";
4
- import * as f from "@fortawesome/free-solid-svg-icons";
5
- import * as ke from "@fortawesome/free-brands-svg-icons";
6
- var Ht = "fas", zt = "numeric-input", Ut = 512, Wt = 512, Je = [], Kt = "", Gt = "m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";
7
- const yt = {
8
- prefix: Ht,
9
- iconName: zt,
10
- icon: [Ut, Wt, Je, Kt, Gt]
11
- }, Wn = {
12
- definition: yt,
13
- faAlignJustify: yt,
14
- prefix: Ht,
15
- iconName: zt,
16
- width: Ut,
17
- height: Wt,
18
- ligatures: Je,
19
- unicode: Kt,
20
- svgPathData: Gt,
21
- aliases: Je
1
+ import { defineComponent as v, computed as w, openBlock as o, createBlock as k, unref as d, mergeProps as T, createCommentVNode as m, createElementBlock as u, normalizeClass as b, createElementVNode as c, toDisplayString as C, createVNode as y, ref as D, watch as I, Fragment as E, withDirectives as te, vModelText as le, normalizeStyle as G, withCtx as h, renderSlot as U, Teleport as se, Transition as O, normalizeProps as oe, guardReactiveProps as ne, resolveDynamicComponent as re, onMounted as ie, renderList as Z } from "vue";
2
+ import { FontAwesomeIcon as de } from "@fortawesome/vue-fontawesome";
3
+ import { library as F } from "@fortawesome/fontawesome-svg-core";
4
+ import * as e from "@fortawesome/free-solid-svg-icons";
5
+ import * as B from "@fortawesome/free-brands-svg-icons";
6
+ import { v4 as Q } from "uuid";
7
+ import { useEyeDropper as ue } from "@vueuse/core";
8
+ import { Menu as ce, MenuButton as fe, MenuItems as me, MenuItem as pe, Listbox as be, ListboxButton as ge, ListboxOptions as ye, ListboxOption as he, Switch as ke } from "@headlessui/vue";
9
+ import { useFloating as ve, autoUpdate as _e, offset as xe, flip as Ce, shift as we } from "@floating-ui/vue";
10
+ var q = "fas", W = "numeric-input", J = 512, K = 512, A = [], X = "", Y = "m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";
11
+ const j = {
12
+ prefix: q,
13
+ iconName: W,
14
+ icon: [J, K, A, X, Y]
15
+ }, $e = {
16
+ definition: j,
17
+ faAlignJustify: j,
18
+ prefix: q,
19
+ iconName: W,
20
+ width: J,
21
+ height: K,
22
+ ligatures: A,
23
+ unicode: X,
24
+ svgPathData: Y,
25
+ aliases: A
22
26
  };
23
- lt.add(
24
- f.faAlignCenter,
25
- f.faAlignLeft,
26
- f.faAlignRight,
27
- f.faArrowRight,
28
- f.faArrowUp19,
29
- f.faAsterisk,
30
- f.faAt,
31
- f.faBold,
32
- f.faBolt,
33
- f.faCalendar,
34
- f.faChartPie,
35
- f.faCheck,
36
- f.faCheckCircle,
37
- f.faChevronDown,
38
- f.faChevronLeft,
39
- f.faChevronRight,
40
- f.faChevronUp,
41
- f.faCircleCheck,
42
- f.faCircleNodes,
43
- f.faCircleNotch,
44
- f.faClipboard,
45
- f.faCloudDownload,
46
- f.faCloudUpload,
47
- f.faCode,
48
- f.faCodeBranch,
49
- f.faCodeFork,
50
- f.faCog,
51
- f.faCompass,
52
- f.faCrown,
53
- f.faDiagramProject,
54
- f.faDoorOpen,
55
- f.faDotCircle,
56
- f.faEllipsis,
57
- f.faEllipsisVertical,
58
- f.faEnvelope,
59
- f.faExclamationTriangle,
60
- f.faExternalLink,
61
- f.faEye,
62
- f.faEyeDropper,
63
- f.faEyeSlash,
64
- f.faFileLines,
65
- f.faFilePdf,
66
- f.faFileUpload,
67
- f.faFileVideo,
68
- f.faFileWaveform,
69
- f.faFilter,
70
- f.faFilter,
71
- f.faFingerprint,
72
- f.faFont,
73
- f.faGears,
74
- f.faGlobe,
75
- f.faGripHorizontal,
76
- f.faGripVertical,
77
- f.faHandPointRight,
78
- f.faHandPointRight,
79
- f.faHashtag,
80
- f.faHeading,
81
- f.faHeart,
82
- f.faImage,
83
- f.faInfoCircle,
84
- f.faItalic,
85
- f.faLayerGroup,
86
- f.faLink,
87
- f.faLinkSlash,
88
- f.faList,
89
- f.faListOl,
90
- f.faListUl,
91
- f.faLocationArrow,
92
- f.faLocationCrosshairs,
93
- f.faLock,
94
- f.faLockOpen,
95
- f.faMedal,
96
- f.faMessage,
97
- f.faMicrochip,
98
- f.faPencilAlt,
99
- f.faPenToSquare,
100
- f.faPhone,
101
- f.faPlayCircle,
102
- f.faPlus,
103
- f.faPlusCircle,
104
- f.faPoo,
105
- f.faPuzzlePiece,
106
- f.faQuestion,
107
- f.faQuoteLeft,
108
- f.faQuoteRight,
109
- f.faReply,
110
- f.faReplyAll,
111
- f.faRightLong,
112
- f.faRobot,
113
- f.faSave,
114
- f.faShield,
115
- f.faSignal,
116
- f.faSignature,
117
- f.faSignature,
118
- f.faSquareCheck,
119
- f.faStar,
120
- f.faStrikethrough,
121
- f.faTerminal,
122
- f.faTextSlash,
123
- f.faTimes,
124
- f.faTrash,
125
- f.faTree,
126
- f.faTrophy,
127
- f.faTurnDown,
128
- f.faUnderline,
129
- f.faUpload,
130
- f.faUser,
131
- f.faUserShield,
132
- f.faWandMagicSparkles,
27
+ F.add(
28
+ e.faAlignCenter,
29
+ e.faAlignLeft,
30
+ e.faAlignRight,
31
+ e.faArrowRight,
32
+ e.faArrowUp19,
33
+ e.faAsterisk,
34
+ e.faAt,
35
+ e.faBold,
36
+ e.faBolt,
37
+ e.faCalendar,
38
+ e.faChartPie,
39
+ e.faCheck,
40
+ e.faCheckCircle,
41
+ e.faChevronDown,
42
+ e.faChevronLeft,
43
+ e.faChevronRight,
44
+ e.faChevronUp,
45
+ e.faCircleCheck,
46
+ e.faCircleNodes,
47
+ e.faCircleNotch,
48
+ e.faClipboard,
49
+ e.faCloudDownload,
50
+ e.faCloudUpload,
51
+ e.faCode,
52
+ e.faCodeBranch,
53
+ e.faCodeFork,
54
+ e.faCog,
55
+ e.faCompass,
56
+ e.faCrown,
57
+ e.faDiagramProject,
58
+ e.faDoorOpen,
59
+ e.faDotCircle,
60
+ e.faEllipsis,
61
+ e.faEllipsisVertical,
62
+ e.faEnvelope,
63
+ e.faExclamationTriangle,
64
+ e.faExternalLink,
65
+ e.faEye,
66
+ e.faEyeDropper,
67
+ e.faEyeSlash,
68
+ e.faFileLines,
69
+ e.faFilePdf,
70
+ e.faFileUpload,
71
+ e.faFileVideo,
72
+ e.faFileWaveform,
73
+ e.faFilter,
74
+ e.faFilter,
75
+ e.faFingerprint,
76
+ e.faFont,
77
+ e.faGears,
78
+ e.faGlobe,
79
+ e.faGripHorizontal,
80
+ e.faGripVertical,
81
+ e.faHandPointRight,
82
+ e.faHandPointRight,
83
+ e.faHashtag,
84
+ e.faHeading,
85
+ e.faHeart,
86
+ e.faImage,
87
+ e.faInfoCircle,
88
+ e.faItalic,
89
+ e.faLayerGroup,
90
+ e.faLink,
91
+ e.faLinkSlash,
92
+ e.faList,
93
+ e.faListOl,
94
+ e.faListUl,
95
+ e.faLocationArrow,
96
+ e.faLocationCrosshairs,
97
+ e.faLock,
98
+ e.faLockOpen,
99
+ e.faMedal,
100
+ e.faMessage,
101
+ e.faMicrochip,
102
+ e.faPencilAlt,
103
+ e.faPenToSquare,
104
+ e.faPhone,
105
+ e.faPlayCircle,
106
+ e.faPlus,
107
+ e.faPlusCircle,
108
+ e.faPoo,
109
+ e.faPuzzlePiece,
110
+ e.faQuestion,
111
+ e.faQuoteLeft,
112
+ e.faQuoteRight,
113
+ e.faReply,
114
+ e.faReplyAll,
115
+ e.faRightLong,
116
+ e.faRobot,
117
+ e.faSave,
118
+ e.faShield,
119
+ e.faSignal,
120
+ e.faSignature,
121
+ e.faSignature,
122
+ e.faSquareCheck,
123
+ e.faStar,
124
+ e.faStrikethrough,
125
+ e.faTerminal,
126
+ e.faTextSlash,
127
+ e.faTimes,
128
+ e.faTrash,
129
+ e.faTree,
130
+ e.faTrophy,
131
+ e.faTurnDown,
132
+ e.faUnderline,
133
+ e.faUpload,
134
+ e.faUser,
135
+ e.faUserShield,
136
+ e.faWandMagicSparkles,
133
137
  // Brands
134
- ke.faTwitter,
135
- ke.faInstagram,
136
- ke.faGithub,
137
- ke.faLinkedin,
138
- ke.faFacebook,
138
+ B.faTwitter,
139
+ B.faInstagram,
140
+ B.faGithub,
141
+ B.faLinkedin,
142
+ B.faFacebook,
139
143
  // Custom
140
- Wn.definition
144
+ $e.definition
141
145
  );
142
- const Kn = [...Object.keys(lt.definitions.fas)].sort(), wt = [...Object.keys(lt.definitions.fab)].sort(), q = /* @__PURE__ */ T({
146
+ const Le = [...Object.keys(F.definitions.fas)].sort(), N = [...Object.keys(F.definitions.fab)].sort(), x = /* @__PURE__ */ v({
143
147
  __name: "Icon",
144
148
  props: {
145
149
  name: { default: "user" }
146
150
  },
147
- setup(e) {
148
- const t = e, o = k(() => wt.includes(t.name) ? "fab" : "fas"), l = k(() => Kn.includes(t.name) || wt.includes(t.name) ? !0 : (console.warn(
151
+ setup(s) {
152
+ const a = s, r = w(() => N.includes(a.name) ? "fab" : "fas"), l = w(() => Le.includes(a.name) || N.includes(a.name) ? !0 : (console.warn(
149
153
  "could not load icon, because it is not available",
150
- t.name
154
+ a.name
151
155
  ), !1));
152
- return (n, r) => l.value ? (C(), U(_(Un), Ne({
156
+ return (t, i) => l.value ? (o(), k(d(de), T({
153
157
  key: 0,
154
- icon: [o.value, n.name]
155
- }, n.$attrs), null, 16, ["icon"])) : M("", !0);
158
+ icon: [r.value, t.name]
159
+ }, t.$attrs), null, 16, ["icon"])) : m("", !0);
156
160
  }
157
- }), Gn = ["aria-label", "disabled", "aria-busy"], qn = {
161
+ }), De = ["aria-label", "disabled", "aria-busy"], Ve = {
158
162
  key: 0,
159
163
  class: "absolute inset-0 flex items-center justify-center"
160
- }, Rr = /* @__PURE__ */ T({
164
+ }, ya = /* @__PURE__ */ v({
161
165
  __name: "Button",
162
166
  props: {
163
167
  label: {},
@@ -168,298 +172,135 @@ const Kn = [...Object.keys(lt.definitions.fas)].sort(), wt = [...Object.keys(lt.
168
172
  icon: {},
169
173
  iconPosition: { default: "right" }
170
174
  },
171
- setup(e) {
172
- const t = e, o = k(() => {
173
- const n = {
174
- "text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": t.color === "primary",
175
- "text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": t.color === "light",
176
- "text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": t.color === "dark",
177
- "text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": t.color === "danger"
178
- }, r = {
179
- "pointer-events-none opacity-75 cursor-not-allowed": t.isDisabled
175
+ setup(s) {
176
+ const a = s, r = w(() => {
177
+ const t = {
178
+ "text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900": a.color === "primary",
179
+ "text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900": a.color === "light",
180
+ "text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900": a.color === "dark",
181
+ "text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900": a.color === "danger"
180
182
  }, i = {
181
- "px-4 py-1 text-xs leading-5 mono-100 rounded-lg": t.size === "small",
182
- "px-5 py-2 text-sm leading-4 font-medium rounded-lg": t.size === "medium",
183
- "px-8 py-3 text-base leading-6 font-medium rounded-lg": t.size === "large"
183
+ "pointer-events-none opacity-75 cursor-not-allowed": a.isDisabled
184
+ }, f = {
185
+ "px-4 py-1 text-xs leading-5 mono-100 rounded-lg": a.size === "small",
186
+ "px-5 py-2 text-sm leading-4 font-medium rounded-lg": a.size === "medium",
187
+ "px-8 py-3 text-base leading-6 font-medium rounded-lg": a.size === "large"
184
188
  };
185
189
  return {
186
- ...n,
187
- ...r,
188
- ...i
190
+ ...t,
191
+ ...i,
192
+ ...f
189
193
  };
190
- }), l = k(() => {
191
- const n = {
192
- "mr-2 -ml-1": ["small", "medium"].includes(t.size) && t.iconPosition === "left",
193
- "mr-4 -ml-2": ["large"].includes(t.size) && t.iconPosition === "left"
194
- }, r = {
195
- "ml-3 -mr-1": ["small", "medium"].includes(t.size) && t.iconPosition === "right",
196
- "ml-3 -mr-3": ["large"].includes(t.size) && t.iconPosition === "right"
194
+ }), l = w(() => {
195
+ const t = {
196
+ "mr-2 -ml-1": ["small", "medium"].includes(a.size) && a.iconPosition === "left",
197
+ "mr-4 -ml-2": ["large"].includes(a.size) && a.iconPosition === "left"
197
198
  }, i = {
198
- "text-white": t.color === "primary",
199
- "text-blue-600": t.color === "light",
200
- "text-grey-50": t.color === "dark"
199
+ "ml-3 -mr-1": ["small", "medium"].includes(a.size) && a.iconPosition === "right",
200
+ "ml-3 -mr-3": ["large"].includes(a.size) && a.iconPosition === "right"
201
+ }, f = {
202
+ "text-white": a.color === "primary",
203
+ "text-blue-600": a.color === "light",
204
+ "text-grey-50": a.color === "dark"
201
205
  };
202
206
  return {
203
- ...n,
204
- ...r,
205
- ...i
207
+ ...t,
208
+ ...i,
209
+ ...f
206
210
  };
207
211
  });
208
- return (n, r) => (C(), I("button", {
209
- class: F(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", o.value]),
212
+ return (t, i) => (o(), u("button", {
213
+ class: b(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out", r.value]),
210
214
  type: "button",
211
- "aria-label": n.label,
212
- disabled: n.isDisabled || n.isLoading,
213
- "aria-busy": n.isLoading
215
+ "aria-label": t.label,
216
+ disabled: t.isDisabled || t.isLoading,
217
+ "aria-busy": t.isLoading
214
218
  }, [
215
- A("div", {
216
- class: F(!n.isLoading || "invisible")
219
+ c("div", {
220
+ class: b(!t.isLoading || "invisible")
217
221
  }, [
218
- n.icon && n.iconPosition === "left" ? (C(), U(q, {
222
+ t.icon && t.iconPosition === "left" ? (o(), k(x, {
219
223
  key: 0,
220
- name: n.icon,
221
- class: F(l.value)
222
- }, null, 8, ["name", "class"])) : M("", !0),
223
- A("span", null, X(n.label), 1),
224
- n.icon && n.iconPosition === "right" ? (C(), U(q, {
224
+ name: t.icon,
225
+ class: b(l.value)
226
+ }, null, 8, ["name", "class"])) : m("", !0),
227
+ c("span", null, C(t.label), 1),
228
+ t.icon && t.iconPosition === "right" ? (o(), k(x, {
225
229
  key: 1,
226
- name: n.icon,
227
- class: F(l.value)
228
- }, null, 8, ["name", "class"])) : M("", !0)
230
+ name: t.icon,
231
+ class: b(l.value)
232
+ }, null, 8, ["name", "class"])) : m("", !0)
229
233
  ], 2),
230
- n.isLoading ? (C(), I("span", qn, [
231
- j(q, {
234
+ t.isLoading ? (o(), u("span", Ve, [
235
+ y(x, {
232
236
  class: "animate-spin",
233
237
  name: "circle-notch"
234
238
  })
235
- ])) : M("", !0)
236
- ], 10, Gn));
239
+ ])) : m("", !0)
240
+ ], 10, De));
237
241
  }
238
- });
239
- let Le;
240
- const Xn = new Uint8Array(16);
241
- function Yn() {
242
- if (!Le && (Le = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !Le))
243
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
244
- return Le(Xn);
245
- }
246
- const $ = [];
247
- for (let e = 0; e < 256; ++e)
248
- $.push((e + 256).toString(16).slice(1));
249
- function Qn(e, t = 0) {
250
- return $[e[t + 0]] + $[e[t + 1]] + $[e[t + 2]] + $[e[t + 3]] + "-" + $[e[t + 4]] + $[e[t + 5]] + "-" + $[e[t + 6]] + $[e[t + 7]] + "-" + $[e[t + 8]] + $[e[t + 9]] + "-" + $[e[t + 10]] + $[e[t + 11]] + $[e[t + 12]] + $[e[t + 13]] + $[e[t + 14]] + $[e[t + 15]];
251
- }
252
- const Zn = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xt = {
253
- randomUUID: Zn
254
- };
255
- function qt(e, t, o) {
256
- if (xt.randomUUID && !t && !e)
257
- return xt.randomUUID();
258
- e = e || {};
259
- const l = e.random || (e.rng || Yn)();
260
- if (l[6] = l[6] & 15 | 64, l[8] = l[8] & 63 | 128, t) {
261
- o = o || 0;
262
- for (let n = 0; n < 16; ++n)
263
- t[o + n] = l[n];
264
- return t;
265
- }
266
- return Qn(l);
267
- }
268
- const Jn = { class: "relative flex items-start" }, eo = ["checked", "id"], to = { class: "ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed" }, no = ["for"], oo = {
242
+ }), Se = { class: "relative flex items-start" }, ze = ["checked", "id"], Pe = { class: "ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed" }, Be = ["for"], Me = {
269
243
  key: 0,
270
244
  class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
271
- }, lo = {
245
+ }, Ie = {
272
246
  inheritAttrs: !1
273
- }, Er = /* @__PURE__ */ T({
274
- ...lo,
247
+ }, ha = /* @__PURE__ */ v({
248
+ ...Ie,
275
249
  __name: "Checkbox",
276
250
  props: {
277
- id: { default: () => qt() },
251
+ id: { default: () => Q() },
278
252
  label: {},
279
253
  modelValue: { type: Boolean },
280
254
  description: {}
281
255
  },
282
256
  emits: ["update:modelValue"],
283
- setup(e, { emit: t }) {
284
- const o = t, l = (n) => {
285
- o("update:modelValue", n.target.checked);
257
+ setup(s, { emit: a }) {
258
+ const r = a, l = (t) => {
259
+ r("update:modelValue", t.target.checked);
286
260
  };
287
- return (n, r) => (C(), I("div", Jn, [
288
- A("input", Ne({
261
+ return (t, i) => (o(), u("div", Se, [
262
+ c("input", T({
289
263
  class: "peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",
290
264
  type: "checkbox",
291
- checked: n.modelValue,
265
+ checked: t.modelValue,
292
266
  onChange: l,
293
- id: n.id
294
- }, n.$attrs), null, 16, eo),
295
- A("div", to, [
296
- A("label", {
297
- for: n.id,
267
+ id: t.id
268
+ }, t.$attrs), null, 16, ze),
269
+ c("div", Pe, [
270
+ c("label", {
271
+ for: t.id,
298
272
  class: "font-medium text-grey-700 dark:text-grey-200 casual-25"
299
- }, X(n.label), 9, no),
300
- n.description ? (C(), I("p", oo, X(n.description), 1)) : M("", !0)
273
+ }, C(t.label), 9, Be),
274
+ t.description ? (o(), u("p", Me, C(t.description), 1)) : m("", !0)
301
275
  ])
302
276
  ]));
303
277
  }
304
278
  });
305
- function ro() {
306
- const e = O(!1);
307
- return In() && ee(() => {
308
- e.value = !0;
309
- }), e;
310
- }
311
- function io(e) {
312
- const t = ro();
313
- return k(() => (t.value, !!e()));
314
- }
315
- function ao(e = {}) {
316
- const { initialValue: t = "" } = e, o = io(() => typeof window < "u" && "EyeDropper" in window), l = O(t);
317
- async function n(r) {
318
- if (!o.value)
319
- return;
320
- const u = await new window.EyeDropper().open(r);
321
- return l.value = u.sRGBHex, u;
322
- }
323
- return { isSupported: o, sRGBHex: l, open: n };
324
- }
325
- const so = () => {
326
- }, uo = Array.isArray, co = (e) => typeof e == "function", fo = (e) => typeof e == "symbol";
327
- let St;
328
- const kt = () => St || (St = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
329
- let po;
330
- function mo(e, t = po) {
331
- t && t.active && t.effects.push(e);
332
- }
333
- const vo = (e) => {
334
- const t = new Set(e);
335
- return t.w = 0, t.n = 0, t;
336
- }, Xt = (e) => (e.w & ie) > 0, Yt = (e) => (e.n & ie) > 0, go = ({ deps: e }) => {
337
- if (e.length)
338
- for (let t = 0; t < e.length; t++)
339
- e[t].w |= ie;
340
- }, bo = (e) => {
341
- const { deps: t } = e;
342
- if (t.length) {
343
- let o = 0;
344
- for (let l = 0; l < t.length; l++) {
345
- const n = t[l];
346
- Xt(n) && !Yt(n) ? n.delete(e) : t[o++] = n, n.w &= ~ie, n.n &= ~ie;
347
- }
348
- t.length = o;
349
- }
350
- };
351
- let Oe = 0, ie = 1;
352
- const et = 30;
353
- let Y;
354
- class ho {
355
- constructor(t, o = null, l) {
356
- this.fn = t, this.scheduler = o, this.active = !0, this.deps = [], this.parent = void 0, mo(this, l);
357
- }
358
- run() {
359
- if (!this.active)
360
- return this.fn();
361
- let t = Y, o = Ae;
362
- for (; t; ) {
363
- if (t === this)
364
- return;
365
- t = t.parent;
366
- }
367
- try {
368
- return this.parent = Y, Y = this, Ae = !0, ie = 1 << ++Oe, Oe <= et ? go(this) : Ot(this), this.fn();
369
- } finally {
370
- Oe <= et && bo(this), ie = 1 << --Oe, Y = this.parent, Ae = o, this.parent = void 0, this.deferStop && this.stop();
371
- }
372
- }
373
- stop() {
374
- Y === this ? this.deferStop = !0 : this.active && (Ot(this), this.onStop && this.onStop(), this.active = !1);
375
- }
376
- }
377
- function Ot(e) {
378
- const { deps: t } = e;
379
- if (t.length) {
380
- for (let o = 0; o < t.length; o++)
381
- t[o].delete(e);
382
- t.length = 0;
383
- }
384
- }
385
- let Ae = !0;
386
- function yo(e, t) {
387
- let o = !1;
388
- Oe <= et ? Yt(e) || (e.n |= ie, o = !Xt(e)) : o = !e.has(Y), o && (e.add(Y), Y.deps.push(e));
389
- }
390
- function wo(e, t) {
391
- const o = uo(e) ? e : [...e];
392
- for (const l of o)
393
- l.computed && Rt(l);
394
- for (const l of o)
395
- l.computed || Rt(l);
396
- }
397
- function Rt(e, t) {
398
- (e !== Y || e.allowRecurse) && (e.scheduler ? e.scheduler() : e.run());
399
- }
400
- new Set(
401
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(fo)
402
- );
403
- function je(e) {
404
- const t = e && e.__v_raw;
405
- return t ? je(t) : e;
406
- }
407
- function xo(e) {
408
- Ae && Y && (e = je(e), yo(e.dep || (e.dep = vo())));
409
- }
410
- function So(e, t) {
411
- e = je(e);
412
- const o = e.dep;
413
- o && wo(o);
414
- }
415
- class ko {
416
- constructor(t, o, l, n) {
417
- this._setter = o, this.dep = void 0, this.__v_isRef = !0, this.__v_isReadonly = !1, this._dirty = !0, this.effect = new ho(t, () => {
418
- this._dirty || (this._dirty = !0, So(this));
419
- }), this.effect.computed = this, this.effect.active = this._cacheable = !n, this.__v_isReadonly = l;
420
- }
421
- get value() {
422
- const t = je(this);
423
- return xo(t), (t._dirty || !t._cacheable) && (t._dirty = !1, t._value = t.effect.run()), t._value;
424
- }
425
- set value(t) {
426
- this._setter(t);
427
- }
428
- }
429
- function Oo(e, t, o = !1) {
430
- let l, n;
431
- const r = co(e);
432
- return r ? (l = e, n = so) : (l = e.get, n = e.set), new ko(l, n, r || !n, o);
433
- }
434
- let Ye, Et = "__VUE_INSTANCE_SETTERS__";
435
- (Ye = kt()[Et]) || (Ye = kt()[Et] = []), Ye.push((e) => e);
436
- let Ro = !1;
437
- const Qe = (e, t) => Oo(e, t, Ro);
438
- function rt(e) {
439
- const t = Qe(() => ({
440
- "pl-3 pr-10 py-2": !e.icon && e.type !== "color" && e.size === "small",
441
- "pl-4 pr-10 py-3": !e.icon && e.type !== "color" && e.size === "medium",
442
- "pl-6 pr-10 py-3": !e.icon && e.type !== "color" && e.size === "large",
443
- "pl-10 pr-10 py-1": (e.icon || e.type === "color") && e.size === "small",
444
- "pl-12 pr-10 py-3": (e.icon || e.type === "color") && (e.size === "medium" || e.size === "large"),
445
- "w-full block": e.block === !0
446
- })), o = Qe(() => ({
447
- "pointer-events-none opacity-50 cursor-not-allowed": e.isDisabled
448
- })), l = Qe(() => ({
449
- "text-xs leading-4": e.size === "small",
450
- "text-sm leading-4": e.size === "medium",
451
- "text-base leading-5": e.size === "large"
279
+ function H(s) {
280
+ const a = w(() => ({
281
+ "pl-3 pr-10 py-2": !s.icon && s.type !== "color" && s.size === "small",
282
+ "pl-4 pr-10 py-3": !s.icon && s.type !== "color" && s.size === "medium",
283
+ "pl-6 pr-10 py-3": !s.icon && s.type !== "color" && s.size === "large",
284
+ "pl-10 pr-10 py-1": (s.icon || s.type === "color") && s.size === "small",
285
+ "pl-12 pr-10 py-3": (s.icon || s.type === "color") && (s.size === "medium" || s.size === "large"),
286
+ "w-full block": s.block === !0
287
+ })), r = w(() => ({
288
+ "pointer-events-none opacity-50 cursor-not-allowed": s.isDisabled
289
+ })), l = w(() => ({
290
+ "text-xs leading-4": s.size === "small",
291
+ "text-sm leading-4": s.size === "medium",
292
+ "text-base leading-5": s.size === "large"
452
293
  }));
453
294
  return {
454
- inputClasses: t,
455
- disabledClasses: o,
295
+ inputClasses: a,
296
+ disabledClasses: r,
456
297
  textSizeClasses: l
457
298
  };
458
299
  }
459
- const Eo = ["placeholder", "type", "disabled", "value"], Co = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, Do = ["disabled"], Po = ["disabled"], _o = {
300
+ const Te = ["placeholder", "type", "min", "max", "disabled", "value"], Ae = { class: "absolute inset-y-2 left-2 w-8 cursor-pointer" }, Ee = ["disabled"], Fe = ["disabled"], He = {
460
301
  inheritAttrs: !1
461
- }, Cr = /* @__PURE__ */ T({
462
- ..._o,
302
+ }, ka = /* @__PURE__ */ v({
303
+ ...He,
463
304
  __name: "Input",
464
305
  props: {
465
306
  modelValue: {},
@@ -474,2043 +315,138 @@ const Eo = ["placeholder", "type", "disabled", "value"], Co = { class: "absolute
474
315
  showColorPicker: { type: Boolean }
475
316
  },
476
317
  emits: ["update:modelValue"],
477
- setup(e, { expose: t, emit: o }) {
478
- const l = e, n = O(null), r = O(l.modelValue ?? "");
479
- J(
318
+ setup(s, { expose: a, emit: r }) {
319
+ const l = s, t = D(null), i = D(l.modelValue ?? ""), f = (n) => l.type === "number" && n !== "" && n !== null ? Number(n) : n;
320
+ I(
480
321
  () => l.modelValue,
481
- (m) => {
482
- typeof m < "u" && m !== r.value && (r.value = m);
322
+ (n) => {
323
+ typeof n < "u" && n !== f(i.value) && (i.value = n);
483
324
  }
484
325
  );
485
- const i = o, { inputClasses: u, disabledClasses: c, textSizeClasses: a } = rt(l), s = k(() => l.type === "color" ? "text" : l.type), {
486
- isSupported: d,
487
- open: g,
488
- sRGBHex: p
489
- } = ao(), b = () => {
490
- g();
326
+ const $ = r, { inputClasses: V, disabledClasses: L, textSizeClasses: z } = H(l), _ = w(() => l.type === "color" ? "text" : l.type), {
327
+ isSupported: p,
328
+ open: R,
329
+ sRGBHex: g
330
+ } = ue(), M = () => {
331
+ R();
491
332
  };
492
- J(p, (m) => {
493
- r.value = m, i("update:modelValue", m);
333
+ I(g, (n) => {
334
+ i.value = n, $("update:modelValue", n);
494
335
  });
495
- const v = function(m) {
496
- const w = (m == null ? void 0 : m.target).value;
497
- if (l.type === "number" && l.min && parseInt(w) < l.min) {
498
- r.value = l.min, n.value.value = r.value.toString(), i("update:modelValue", l.min);
499
- return;
500
- }
501
- if (l.type === "number" && l.max && parseInt(w) > l.max) {
502
- r.value = l.max, n.value.value = r.value.toString(), i("update:modelValue", l.max);
336
+ const P = function(n) {
337
+ i.value = (n == null ? void 0 : n.target).value, $("update:modelValue", f(i.value));
338
+ }, ee = function() {
339
+ const n = f(i.value);
340
+ if (typeof n != "number")
503
341
  return;
504
- }
505
- r.value = (m == null ? void 0 : m.target).value, i("update:modelValue", r.value);
342
+ const S = Math.min(
343
+ Math.max(n, l.min ?? -1 / 0),
344
+ l.max ?? 1 / 0
345
+ );
346
+ S !== n && (i.value = S, $("update:modelValue", S));
506
347
  };
507
- return t({
348
+ return a({
508
349
  focus: () => {
509
- var m;
510
- l.isDisabled || (m = n.value) == null || m.focus();
350
+ var n;
351
+ l.isDisabled || (n = t.value) == null || n.focus();
511
352
  }
512
- }), (m, w) => (C(), I("div", {
513
- class: F(["relative", [m.block ? "w-full block" : "inline-block"]])
353
+ }), (n, S) => (o(), u("div", {
354
+ class: b(["relative", [n.block ? "w-full block" : "inline-block"]])
514
355
  }, [
515
- A("input", Ne({
516
- class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [_(u), _(a), _(c)]],
517
- placeholder: m.placeholder,
518
- type: s.value,
519
- disabled: m.isDisabled,
520
- value: r.value
521
- }, m.$attrs, {
356
+ c("input", T({
357
+ class: ["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(V), d(z), d(L)]],
358
+ placeholder: n.placeholder,
359
+ type: _.value,
360
+ min: n.min,
361
+ max: n.max,
362
+ disabled: n.isDisabled,
363
+ value: i.value
364
+ }, n.$attrs, {
522
365
  ref_key: "inputElement",
523
- ref: n,
524
- onInput: v
525
- }), null, 16, Eo),
526
- m.type === "color" ? (C(), I(be, { key: 0 }, [
527
- A("label", Co, [
528
- An(A("input", {
366
+ ref: t,
367
+ onInput: P,
368
+ onChange: ee
369
+ }), null, 16, Te),
370
+ n.type === "color" ? (o(), u(E, { key: 0 }, [
371
+ c("label", Ae, [
372
+ te(c("input", {
529
373
  class: "invisible",
530
374
  type: "color",
531
- disabled: m.isDisabled,
532
- "onUpdate:modelValue": w[0] || (w[0] = (y) => r.value = y),
533
- onInput: v
534
- }, null, 40, Do), [
535
- [$n, r.value]
375
+ disabled: n.isDisabled,
376
+ "onUpdate:modelValue": S[0] || (S[0] = (ae) => i.value = ae),
377
+ onInput: P
378
+ }, null, 40, Ee), [
379
+ [le, i.value]
536
380
  ]),
537
- A("span", {
381
+ c("span", {
538
382
  class: "border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",
539
- style: Nt(`background-color: ${r.value}`)
383
+ style: G(`background-color: ${i.value}`)
540
384
  }, null, 4)
541
385
  ]),
542
- _(d) && m.showColorPicker ? (C(), I("button", {
386
+ d(p) && n.showColorPicker ? (o(), u("button", {
543
387
  key: 0,
544
388
  type: "button",
545
389
  class: "absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",
546
- disabled: m.isDisabled,
547
- onClick: b
390
+ disabled: n.isDisabled,
391
+ onClick: M
548
392
  }, [
549
- j(q, {
393
+ y(x, {
550
394
  size: "xs",
551
395
  name: "eyedropper"
552
396
  })
553
- ], 8, Po)) : M("", !0)
554
- ], 64)) : m.icon ? (C(), I("span", {
397
+ ], 8, Fe)) : m("", !0)
398
+ ], 64)) : n.icon ? (o(), u("span", {
555
399
  key: 1,
556
- class: F(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", _(a)])
400
+ class: b(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4", d(z)])
557
401
  }, [
558
- j(q, { name: m.icon }, null, 8, ["name"])
559
- ], 2)) : M("", !0)
402
+ y(x, { name: n.icon }, null, 8, ["name"])
403
+ ], 2)) : m("", !0)
560
404
  ], 2));
561
405
  }
562
- }), Lo = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, To = ["for"], Io = {
406
+ }), Re = { class: "inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20" }, Ue = ["id", "for"], je = {
563
407
  key: 0,
564
408
  class: "block text-xs text-grey-400 font-normal mono-0 casual-60"
565
- }, Dr = /* @__PURE__ */ T({
409
+ }, va = /* @__PURE__ */ v({
566
410
  __name: "Label",
567
411
  props: {
568
412
  id: {},
569
413
  label: {},
570
414
  description: {}
571
415
  },
572
- setup(e) {
573
- return (t, o) => (C(), I("span", Lo, [
574
- A("label", { for: t.id }, X(t.label), 9, To),
575
- t.description ? (C(), I("span", Io, X(t.description), 1)) : M("", !0)
416
+ setup(s) {
417
+ return (a, r) => (o(), u("span", Re, [
418
+ c("label", {
419
+ id: a.id ? `${a.id}-label` : void 0,
420
+ for: a.id
421
+ }, C(a.label), 9, Ue),
422
+ a.description ? (o(), u("span", je, C(a.description), 1)) : m("", !0)
576
423
  ]));
577
424
  }
578
- });
579
- function W(e, t, ...o) {
580
- if (e in t) {
581
- let n = t[e];
582
- return typeof n == "function" ? n(...o) : n;
583
- }
584
- let l = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((n) => `"${n}"`).join(", ")}.`);
585
- throw Error.captureStackTrace && Error.captureStackTrace(l, W), l;
586
- }
587
- var Ee = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(Ee || {}), Ao = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(Ao || {});
588
- function B({ visible: e = !0, features: t = 0, ourProps: o, theirProps: l, ...n }) {
589
- var r;
590
- let i = Zt(l, o), u = Object.assign(n, { props: i });
591
- if (e || t & 2 && i.static)
592
- return Ze(u);
593
- if (t & 1) {
594
- let c = (r = i.unmount) == null || r ? 0 : 1;
595
- return W(c, { 0() {
596
- return null;
597
- }, 1() {
598
- return Ze({ ...n, props: { ...i, hidden: !0, style: { display: "none" } } });
599
- } });
600
- }
601
- return Ze(u);
602
- }
603
- function Ze({ props: e, attrs: t, slots: o, slot: l, name: n }) {
604
- var r, i;
605
- let { as: u, ...c } = it(e, ["unmount", "static"]), a = (r = o.default) == null ? void 0 : r.call(o, l), s = {};
606
- if (l) {
607
- let d = !1, g = [];
608
- for (let [p, b] of Object.entries(l))
609
- typeof b == "boolean" && (d = !0), b === !0 && g.push(p);
610
- d && (s["data-headlessui-state"] = g.join(" "));
611
- }
612
- if (u === "template") {
613
- if (a = Qt(a ?? []), Object.keys(c).length > 0 || Object.keys(t).length > 0) {
614
- let [d, ...g] = a ?? [];
615
- if (!$o(d) || g.length > 0)
616
- throw new Error(['Passing props on "template"!', "", `The current component <${n} /> is rendering a "template".`, "However we need to passthrough the following props:", Object.keys(c).concat(Object.keys(t)).map((v) => v.trim()).filter((v, h, m) => m.indexOf(v) === h).sort((v, h) => v.localeCompare(h)).map((v) => ` - ${v}`).join(`
617
- `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".', "Render a single element as the child so that we can forward the props onto that element."].map((v) => ` - ${v}`).join(`
618
- `)].join(`
619
- `));
620
- let p = Zt((i = d.props) != null ? i : {}, c), b = Mn(d, p);
621
- for (let v in p)
622
- v.startsWith("on") && (b.props || (b.props = {}), b.props[v] = p[v]);
623
- return b;
624
- }
625
- return Array.isArray(a) && a.length === 1 ? a[0] : a;
626
- }
627
- return Re(u, Object.assign({}, c, s), { default: () => a });
628
- }
629
- function Qt(e) {
630
- return e.flatMap((t) => t.type === be ? Qt(t.children) : [t]);
631
- }
632
- function Zt(...e) {
633
- if (e.length === 0)
634
- return {};
635
- if (e.length === 1)
636
- return e[0];
637
- let t = {}, o = {};
638
- for (let l of e)
639
- for (let n in l)
640
- n.startsWith("on") && typeof l[n] == "function" ? (o[n] != null || (o[n] = []), o[n].push(l[n])) : t[n] = l[n];
641
- if (t.disabled || t["aria-disabled"])
642
- return Object.assign(t, Object.fromEntries(Object.keys(o).map((l) => [l, void 0])));
643
- for (let l in o)
644
- Object.assign(t, { [l](n, ...r) {
645
- let i = o[l];
646
- for (let u of i) {
647
- if (n instanceof Event && n.defaultPrevented)
648
- return;
649
- u(n, ...r);
650
- }
651
- } });
652
- return t;
653
- }
654
- function Jt(e) {
655
- let t = Object.assign({}, e);
656
- for (let o in t)
657
- t[o] === void 0 && delete t[o];
658
- return t;
659
- }
660
- function it(e, t = []) {
661
- let o = Object.assign({}, e);
662
- for (let l of t)
663
- l in o && delete o[l];
664
- return o;
665
- }
666
- function $o(e) {
667
- return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
668
- }
669
- let Mo = 0;
670
- function Fo() {
671
- return ++Mo;
672
- }
673
- function Z() {
674
- return Fo();
675
- }
676
- var D = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(D || {});
677
- function Vo(e) {
678
- throw new Error("Unexpected object: " + e);
679
- }
680
- var L = ((e) => (e[e.First = 0] = "First", e[e.Previous = 1] = "Previous", e[e.Next = 2] = "Next", e[e.Last = 3] = "Last", e[e.Specific = 4] = "Specific", e[e.Nothing = 5] = "Nothing", e))(L || {});
681
- function en(e, t) {
682
- let o = t.resolveItems();
683
- if (o.length <= 0)
684
- return null;
685
- let l = t.resolveActiveIndex(), n = l ?? -1, r = (() => {
686
- switch (e.focus) {
687
- case 0:
688
- return o.findIndex((i) => !t.resolveDisabled(i));
689
- case 1: {
690
- let i = o.slice().reverse().findIndex((u, c, a) => n !== -1 && a.length - c - 1 >= n ? !1 : !t.resolveDisabled(u));
691
- return i === -1 ? i : o.length - 1 - i;
692
- }
693
- case 2:
694
- return o.findIndex((i, u) => u <= n ? !1 : !t.resolveDisabled(i));
695
- case 3: {
696
- let i = o.slice().reverse().findIndex((u) => !t.resolveDisabled(u));
697
- return i === -1 ? i : o.length - 1 - i;
698
- }
699
- case 4:
700
- return o.findIndex((i) => t.resolveId(i) === e.id);
701
- case 5:
702
- return null;
703
- default:
704
- Vo(e);
705
- }
706
- })();
707
- return r === -1 ? l : r;
708
- }
709
- function E(e) {
710
- var t;
711
- return e == null || e.value == null ? null : (t = e.value.$el) != null ? t : e.value;
712
- }
713
- let tn = Symbol("Context");
714
- var te = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(te || {});
715
- function nn() {
716
- return he(tn, null);
717
- }
718
- function on(e) {
719
- ye(tn, e);
720
- }
721
- function Ct(e, t) {
722
- if (e)
723
- return e;
724
- let o = t ?? "button";
725
- if (typeof o == "string" && o.toLowerCase() === "button")
726
- return "button";
727
- }
728
- function at(e, t) {
729
- let o = O(Ct(e.value.type, e.value.as));
730
- return ee(() => {
731
- o.value = Ct(e.value.type, e.value.as);
732
- }), we(() => {
733
- var l;
734
- o.value || E(t) && E(t) instanceof HTMLButtonElement && !((l = E(t)) != null && l.hasAttribute("type")) && (o.value = "button");
735
- }), o;
736
- }
737
- var No = Object.defineProperty, Bo = (e, t, o) => t in e ? No(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, Dt = (e, t, o) => (Bo(e, typeof t != "symbol" ? t + "" : t, o), o);
738
- class jo {
739
- constructor() {
740
- Dt(this, "current", this.detect()), Dt(this, "currentId", 0);
741
- }
742
- set(t) {
743
- this.current !== t && (this.currentId = 0, this.current = t);
744
- }
745
- reset() {
746
- this.set(this.detect());
747
- }
748
- nextId() {
749
- return ++this.currentId;
750
- }
751
- get isServer() {
752
- return this.current === "server";
753
- }
754
- get isClient() {
755
- return this.current === "client";
756
- }
757
- detect() {
758
- return typeof window > "u" || typeof document > "u" ? "server" : "client";
759
- }
760
- }
761
- let st = new jo();
762
- function ut(e) {
763
- if (st.isServer)
764
- return null;
765
- if (e instanceof Node)
766
- return e.ownerDocument;
767
- if (e != null && e.hasOwnProperty("value")) {
768
- let t = E(e);
769
- if (t)
770
- return t.ownerDocument;
771
- }
772
- return document;
773
- }
774
- function Ho({ container: e, accept: t, walk: o, enabled: l }) {
775
- we(() => {
776
- let n = e.value;
777
- if (!n || l !== void 0 && !l.value)
778
- return;
779
- let r = ut(e);
780
- if (!r)
781
- return;
782
- let i = Object.assign((c) => t(c), { acceptNode: t }), u = r.createTreeWalker(n, NodeFilter.SHOW_ELEMENT, i, !1);
783
- for (; u.nextNode(); )
784
- o(u.currentNode);
785
- });
786
- }
787
- let tt = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
788
- var nt = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e))(nt || {}), zo = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(zo || {}), Uo = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Uo || {});
789
- function ln(e = document.body) {
790
- return e == null ? [] : Array.from(e.querySelectorAll(tt)).sort((t, o) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (o.tabIndex || Number.MAX_SAFE_INTEGER)));
791
- }
792
- var He = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(He || {});
793
- function ze(e, t = 0) {
794
- var o;
795
- return e === ((o = ut(e)) == null ? void 0 : o.body) ? !1 : W(t, { 0() {
796
- return e.matches(tt);
797
- }, 1() {
798
- let l = e;
799
- for (; l !== null; ) {
800
- if (l.matches(tt))
801
- return !0;
802
- l = l.parentElement;
803
- }
804
- return !1;
805
- } });
806
- }
807
- function rn(e) {
808
- let t = ut(e);
809
- N(() => {
810
- t && !ze(t.activeElement, 0) && Ko(e);
811
- });
812
- }
813
- var Wo = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(Wo || {});
814
- typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
815
- e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
816
- }, !0), document.addEventListener("click", (e) => {
817
- e.detail === 1 ? delete document.documentElement.dataset.headlessuiFocusVisible : e.detail === 0 && (document.documentElement.dataset.headlessuiFocusVisible = "");
818
- }, !0));
819
- function Ko(e) {
820
- e == null || e.focus({ preventScroll: !0 });
821
- }
822
- let Go = ["textarea", "input"].join(",");
823
- function qo(e) {
824
- var t, o;
825
- return (o = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, Go)) != null ? o : !1;
826
- }
827
- function ct(e, t = (o) => o) {
828
- return e.slice().sort((o, l) => {
829
- let n = t(o), r = t(l);
830
- if (n === null || r === null)
831
- return 0;
832
- let i = n.compareDocumentPosition(r);
833
- return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
834
- });
835
- }
836
- function Xo(e, t) {
837
- return Yo(ln(), t, { relativeTo: e });
838
- }
839
- function Yo(e, t, { sorted: o = !0, relativeTo: l = null, skipElements: n = [] } = {}) {
840
- var r;
841
- let i = (r = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e == null ? void 0 : e.ownerDocument) != null ? r : document, u = Array.isArray(e) ? o ? ct(e) : e : ln(e);
842
- n.length > 0 && u.length > 1 && (u = u.filter((b) => !n.includes(b))), l = l ?? i.activeElement;
843
- let c = (() => {
844
- if (t & 5)
845
- return 1;
846
- if (t & 10)
847
- return -1;
848
- throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
849
- })(), a = (() => {
850
- if (t & 1)
851
- return 0;
852
- if (t & 2)
853
- return Math.max(0, u.indexOf(l)) - 1;
854
- if (t & 4)
855
- return Math.max(0, u.indexOf(l)) + 1;
856
- if (t & 8)
857
- return u.length - 1;
858
- throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
859
- })(), s = t & 32 ? { preventScroll: !0 } : {}, d = 0, g = u.length, p;
860
- do {
861
- if (d >= g || d + g <= 0)
862
- return 0;
863
- let b = a + d;
864
- if (t & 16)
865
- b = (b + g) % g;
866
- else {
867
- if (b < 0)
868
- return 3;
869
- if (b >= g)
870
- return 1;
871
- }
872
- p = u[b], p == null || p.focus(s), d += c;
873
- } while (p !== i.activeElement);
874
- return t & 6 && qo(p) && p.select(), 2;
875
- }
876
- function Te(e, t, o) {
877
- st.isServer || we((l) => {
878
- document.addEventListener(e, t, o), l(() => document.removeEventListener(e, t, o));
879
- });
880
- }
881
- function Qo(e, t, o) {
882
- st.isServer || we((l) => {
883
- window.addEventListener(e, t, o), l(() => window.removeEventListener(e, t, o));
884
- });
885
- }
886
- function an(e, t, o = k(() => !0)) {
887
- function l(r, i) {
888
- if (!o.value || r.defaultPrevented)
889
- return;
890
- let u = i(r);
891
- if (u === null || !u.getRootNode().contains(u))
892
- return;
893
- let c = function a(s) {
894
- return typeof s == "function" ? a(s()) : Array.isArray(s) || s instanceof Set ? s : [s];
895
- }(e);
896
- for (let a of c) {
897
- if (a === null)
898
- continue;
899
- let s = a instanceof HTMLElement ? a : E(a);
900
- if (s != null && s.contains(u) || r.composed && r.composedPath().includes(s))
901
- return;
902
- }
903
- return !ze(u, He.Loose) && u.tabIndex !== -1 && r.preventDefault(), t(r, u);
904
- }
905
- let n = O(null);
906
- Te("pointerdown", (r) => {
907
- var i, u;
908
- o.value && (n.value = ((u = (i = r.composedPath) == null ? void 0 : i.call(r)) == null ? void 0 : u[0]) || r.target);
909
- }, !0), Te("mousedown", (r) => {
910
- var i, u;
911
- o.value && (n.value = ((u = (i = r.composedPath) == null ? void 0 : i.call(r)) == null ? void 0 : u[0]) || r.target);
912
- }, !0), Te("click", (r) => {
913
- n.value && (l(r, () => n.value), n.value = null);
914
- }, !0), Te("touchend", (r) => l(r, () => r.target instanceof HTMLElement ? r.target : null), !0), Qo("blur", (r) => l(r, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
915
- }
916
- var dt = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(dt || {});
917
- let sn = T({ name: "Hidden", props: { as: { type: [Object, String], default: "div" }, features: { type: Number, default: 1 } }, setup(e, { slots: t, attrs: o }) {
918
- return () => {
919
- let { features: l, ...n } = e, r = { "aria-hidden": (l & 2) === 2 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(l & 4) === 4 && (l & 2) !== 2 && { display: "none" } } };
920
- return B({ ourProps: r, theirProps: n, slot: {}, attrs: o, slots: t, name: "Hidden" });
921
- };
922
- } });
923
- function un(e = {}, t = null, o = []) {
924
- for (let [l, n] of Object.entries(e))
925
- dn(o, cn(t, l), n);
926
- return o;
927
- }
928
- function cn(e, t) {
929
- return e ? e + "[" + t + "]" : t;
930
- }
931
- function dn(e, t, o) {
932
- if (Array.isArray(o))
933
- for (let [l, n] of o.entries())
934
- dn(e, cn(t, l.toString()), n);
935
- else
936
- o instanceof Date ? e.push([t, o.toISOString()]) : typeof o == "boolean" ? e.push([t, o ? "1" : "0"]) : typeof o == "string" ? e.push([t, o]) : typeof o == "number" ? e.push([t, `${o}`]) : o == null ? e.push([t, ""]) : un(o, t, e);
937
- }
938
- function Zo(e) {
939
- var t, o;
940
- let l = (t = e == null ? void 0 : e.form) != null ? t : e.closest("form");
941
- if (l) {
942
- for (let n of l.elements)
943
- if (n !== e && (n.tagName === "INPUT" && n.type === "submit" || n.tagName === "BUTTON" && n.type === "submit" || n.nodeName === "INPUT" && n.type === "image")) {
944
- n.click();
945
- return;
946
- }
947
- (o = l.requestSubmit) == null || o.call(l);
948
- }
949
- }
950
- function fn(e, t, o) {
951
- let l = O(o == null ? void 0 : o.value), n = k(() => e.value !== void 0);
952
- return [k(() => n.value ? e.value : l.value), function(r) {
953
- return n.value || (l.value = r), t == null ? void 0 : t(r);
954
- }];
955
- }
956
- function Pt(e) {
957
- return [e.screenX, e.screenY];
958
- }
959
- function pn() {
960
- let e = O([-1, -1]);
961
- return { wasMoved(t) {
962
- let o = Pt(t);
963
- return e.value[0] === o[0] && e.value[1] === o[1] ? !1 : (e.value = o, !0);
964
- }, update(t) {
965
- e.value = Pt(t);
966
- } };
967
- }
968
- let mn = Symbol("DescriptionContext");
969
- function Jo() {
970
- let e = he(mn, null);
971
- if (e === null)
972
- throw new Error("Missing parent");
973
- return e;
974
- }
975
- function el({ slot: e = O({}), name: t = "Description", props: o = {} } = {}) {
976
- let l = O([]);
977
- function n(r) {
978
- return l.value.push(r), () => {
979
- let i = l.value.indexOf(r);
980
- i !== -1 && l.value.splice(i, 1);
981
- };
982
- }
983
- return ye(mn, { register: n, slot: e, name: t, props: o }), k(() => l.value.length > 0 ? l.value.join(" ") : void 0);
984
- }
985
- T({ name: "Description", props: { as: { type: [Object, String], default: "p" }, id: { type: String, default: () => `headlessui-description-${Z()}` } }, setup(e, { attrs: t, slots: o }) {
986
- let l = Jo();
987
- return ee(() => Be(l.register(e.id))), () => {
988
- let { name: n = "Description", slot: r = O({}), props: i = {} } = l, { id: u, ...c } = e, a = { ...Object.entries(i).reduce((s, [d, g]) => Object.assign(s, { [d]: _(g) }), {}), id: u };
989
- return B({ ourProps: a, theirProps: c, slot: r.value, attrs: t, slots: o, name: n });
990
- };
991
- } });
992
- let _t = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;
993
- function Lt(e) {
994
- var t, o;
995
- let l = (t = e.innerText) != null ? t : "", n = e.cloneNode(!0);
996
- if (!(n instanceof HTMLElement))
997
- return l;
998
- let r = !1;
999
- for (let u of n.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))
1000
- u.remove(), r = !0;
1001
- let i = r ? (o = n.innerText) != null ? o : "" : l;
1002
- return _t.test(i) && (i = i.replace(_t, "")), i;
1003
- }
1004
- function tl(e) {
1005
- let t = e.getAttribute("aria-label");
1006
- if (typeof t == "string")
1007
- return t.trim();
1008
- let o = e.getAttribute("aria-labelledby");
1009
- if (o) {
1010
- let l = o.split(" ").map((n) => {
1011
- let r = document.getElementById(n);
1012
- if (r) {
1013
- let i = r.getAttribute("aria-label");
1014
- return typeof i == "string" ? i.trim() : Lt(r).trim();
1015
- }
1016
- return null;
1017
- }).filter(Boolean);
1018
- if (l.length > 0)
1019
- return l.join(", ");
1020
- }
1021
- return Lt(e).trim();
1022
- }
1023
- function vn(e) {
1024
- let t = O(""), o = O("");
1025
- return () => {
1026
- let l = E(e);
1027
- if (!l)
1028
- return "";
1029
- let n = l.innerText;
1030
- if (t.value === n)
1031
- return o.value;
1032
- let r = tl(l).trim().toLowerCase();
1033
- return t.value = n, o.value = r, r;
1034
- };
1035
- }
1036
- function nl(e, t) {
1037
- return e === t;
1038
- }
1039
- var ol = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(ol || {}), ll = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(ll || {}), rl = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Other = 1] = "Other", e))(rl || {});
1040
- function il(e) {
1041
- requestAnimationFrame(() => requestAnimationFrame(e));
1042
- }
1043
- let gn = Symbol("ListboxContext");
1044
- function De(e) {
1045
- let t = he(gn, null);
1046
- if (t === null) {
1047
- let o = new Error(`<${e} /> is missing a parent <Listbox /> component.`);
1048
- throw Error.captureStackTrace && Error.captureStackTrace(o, De), o;
1049
- }
1050
- return t;
1051
- }
1052
- let al = T({ name: "Listbox", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "template" }, disabled: { type: [Boolean], default: !1 }, by: { type: [String, Function], default: () => nl }, horizontal: { type: [Boolean], default: !1 }, modelValue: { type: [Object, String, Number, Boolean], default: void 0 }, defaultValue: { type: [Object, String, Number, Boolean], default: void 0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, multiple: { type: [Boolean], default: !1 } }, inheritAttrs: !1, setup(e, { slots: t, attrs: o, emit: l }) {
1053
- let n = O(1), r = O(null), i = O(null), u = O(null), c = O([]), a = O(""), s = O(null), d = O(1);
1054
- function g(y = (x) => x) {
1055
- let x = s.value !== null ? c.value[s.value] : null, S = ct(y(c.value.slice()), (R) => E(R.dataRef.domRef)), P = x ? S.indexOf(x) : null;
1056
- return P === -1 && (P = null), { options: S, activeOptionIndex: P };
1057
- }
1058
- let p = k(() => e.multiple ? 1 : 0), [b, v] = fn(k(() => e.modelValue), (y) => l("update:modelValue", y), k(() => e.defaultValue)), h = k(() => b.value === void 0 ? W(p.value, { 1: [], 0: void 0 }) : b.value), m = { listboxState: n, value: h, mode: p, compare(y, x) {
1059
- if (typeof e.by == "string") {
1060
- let S = e.by;
1061
- return (y == null ? void 0 : y[S]) === (x == null ? void 0 : x[S]);
1062
- }
1063
- return e.by(y, x);
1064
- }, orientation: k(() => e.horizontal ? "horizontal" : "vertical"), labelRef: r, buttonRef: i, optionsRef: u, disabled: k(() => e.disabled), options: c, searchQuery: a, activeOptionIndex: s, activationTrigger: d, closeListbox() {
1065
- e.disabled || n.value !== 1 && (n.value = 1, s.value = null);
1066
- }, openListbox() {
1067
- e.disabled || n.value !== 0 && (n.value = 0);
1068
- }, goToOption(y, x, S) {
1069
- if (e.disabled || n.value === 1)
1070
- return;
1071
- let P = g(), R = en(y === L.Specific ? { focus: L.Specific, id: x } : { focus: y }, { resolveItems: () => P.options, resolveActiveIndex: () => P.activeOptionIndex, resolveId: (V) => V.id, resolveDisabled: (V) => V.dataRef.disabled });
1072
- a.value = "", s.value = R, d.value = S ?? 1, c.value = P.options;
1073
- }, search(y) {
1074
- if (e.disabled || n.value === 1)
1075
- return;
1076
- let x = a.value !== "" ? 0 : 1;
1077
- a.value += y.toLowerCase();
1078
- let S = (s.value !== null ? c.value.slice(s.value + x).concat(c.value.slice(0, s.value + x)) : c.value).find((R) => R.dataRef.textValue.startsWith(a.value) && !R.dataRef.disabled), P = S ? c.value.indexOf(S) : -1;
1079
- P === -1 || P === s.value || (s.value = P, d.value = 1);
1080
- }, clearSearch() {
1081
- e.disabled || n.value !== 1 && a.value !== "" && (a.value = "");
1082
- }, registerOption(y, x) {
1083
- let S = g((P) => [...P, { id: y, dataRef: x }]);
1084
- c.value = S.options, s.value = S.activeOptionIndex;
1085
- }, unregisterOption(y) {
1086
- let x = g((S) => {
1087
- let P = S.findIndex((R) => R.id === y);
1088
- return P !== -1 && S.splice(P, 1), S;
1089
- });
1090
- c.value = x.options, s.value = x.activeOptionIndex, d.value = 1;
1091
- }, theirOnChange(y) {
1092
- e.disabled || v(y);
1093
- }, select(y) {
1094
- e.disabled || v(W(p.value, { 0: () => y, 1: () => {
1095
- let x = G(m.value.value).slice(), S = G(y), P = x.findIndex((R) => m.compare(S, G(R)));
1096
- return P === -1 ? x.push(S) : x.splice(P, 1), x;
1097
- } }));
1098
- } };
1099
- an([i, u], (y, x) => {
1100
- var S;
1101
- m.closeListbox(), ze(x, He.Loose) || (y.preventDefault(), (S = E(i)) == null || S.focus());
1102
- }, k(() => n.value === 0)), ye(gn, m), on(k(() => W(n.value, { 0: te.Open, 1: te.Closed })));
1103
- let w = k(() => {
1104
- var y;
1105
- return (y = E(i)) == null ? void 0 : y.closest("form");
1106
- });
1107
- return ee(() => {
1108
- J([w], () => {
1109
- if (!w.value || e.defaultValue === void 0)
1110
- return;
1111
- function y() {
1112
- m.theirOnChange(e.defaultValue);
1113
- }
1114
- return w.value.addEventListener("reset", y), () => {
1115
- var x;
1116
- (x = w.value) == null || x.removeEventListener("reset", y);
1117
- };
1118
- }, { immediate: !0 });
1119
- }), () => {
1120
- let { name: y, modelValue: x, disabled: S, form: P, ...R } = e, V = { open: n.value === 0, disabled: S, value: h.value };
1121
- return Re(be, [...y != null && h.value != null ? un({ [y]: h.value }).map(([re, _e]) => Re(sn, Jt({ features: dt.Hidden, key: re, as: "input", type: "hidden", hidden: !0, readOnly: !0, form: P, name: re, value: _e }))) : [], B({ ourProps: {}, theirProps: { ...o, ...it(R, ["defaultValue", "onUpdate:modelValue", "horizontal", "multiple", "by"]) }, slot: V, slots: t, attrs: o, name: "Listbox" })]);
1122
- };
1123
- } });
1124
- T({ name: "ListboxLabel", props: { as: { type: [Object, String], default: "label" }, id: { type: String, default: () => `headlessui-listbox-label-${Z()}` } }, setup(e, { attrs: t, slots: o }) {
1125
- let l = De("ListboxLabel");
1126
- function n() {
1127
- var r;
1128
- (r = E(l.buttonRef)) == null || r.focus({ preventScroll: !0 });
1129
- }
1130
- return () => {
1131
- let r = { open: l.listboxState.value === 0, disabled: l.disabled.value }, { id: i, ...u } = e, c = { id: i, ref: l.labelRef, onClick: n };
1132
- return B({ ourProps: c, theirProps: u, slot: r, attrs: t, slots: o, name: "ListboxLabel" });
1133
- };
1134
- } });
1135
- let sl = T({ name: "ListboxButton", props: { as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-listbox-button-${Z()}` } }, setup(e, { attrs: t, slots: o, expose: l }) {
1136
- let n = De("ListboxButton");
1137
- l({ el: n.buttonRef, $el: n.buttonRef });
1138
- function r(a) {
1139
- switch (a.key) {
1140
- case D.Space:
1141
- case D.Enter:
1142
- case D.ArrowDown:
1143
- a.preventDefault(), n.openListbox(), N(() => {
1144
- var s;
1145
- (s = E(n.optionsRef)) == null || s.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.First);
1146
- });
1147
- break;
1148
- case D.ArrowUp:
1149
- a.preventDefault(), n.openListbox(), N(() => {
1150
- var s;
1151
- (s = E(n.optionsRef)) == null || s.focus({ preventScroll: !0 }), n.value.value || n.goToOption(L.Last);
1152
- });
1153
- break;
1154
- }
1155
- }
1156
- function i(a) {
1157
- switch (a.key) {
1158
- case D.Space:
1159
- a.preventDefault();
1160
- break;
1161
- }
1162
- }
1163
- function u(a) {
1164
- n.disabled.value || (n.listboxState.value === 0 ? (n.closeListbox(), N(() => {
1165
- var s;
1166
- return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1167
- })) : (a.preventDefault(), n.openListbox(), il(() => {
1168
- var s;
1169
- return (s = E(n.optionsRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1170
- })));
1171
- }
1172
- let c = at(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
1173
- return () => {
1174
- var a, s;
1175
- let d = { open: n.listboxState.value === 0, disabled: n.disabled.value, value: n.value.value }, { id: g, ...p } = e, b = { ref: n.buttonRef, id: g, type: c.value, "aria-haspopup": "listbox", "aria-controls": (a = E(n.optionsRef)) == null ? void 0 : a.id, "aria-expanded": n.listboxState.value === 0, "aria-labelledby": n.labelRef.value ? [(s = E(n.labelRef)) == null ? void 0 : s.id, g].join(" ") : void 0, disabled: n.disabled.value === !0 ? !0 : void 0, onKeydown: r, onKeyup: i, onClick: u };
1176
- return B({ ourProps: b, theirProps: p, slot: d, attrs: t, slots: o, name: "ListboxButton" });
1177
- };
1178
- } }), ul = T({ name: "ListboxOptions", props: { as: { type: [Object, String], default: "ul" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: () => `headlessui-listbox-options-${Z()}` } }, setup(e, { attrs: t, slots: o, expose: l }) {
1179
- let n = De("ListboxOptions"), r = O(null);
1180
- l({ el: n.optionsRef, $el: n.optionsRef });
1181
- function i(a) {
1182
- switch (r.value && clearTimeout(r.value), a.key) {
1183
- case D.Space:
1184
- if (n.searchQuery.value !== "")
1185
- return a.preventDefault(), a.stopPropagation(), n.search(a.key);
1186
- case D.Enter:
1187
- if (a.preventDefault(), a.stopPropagation(), n.activeOptionIndex.value !== null) {
1188
- let s = n.options.value[n.activeOptionIndex.value];
1189
- n.select(s.dataRef.value);
1190
- }
1191
- n.mode.value === 0 && (n.closeListbox(), N(() => {
1192
- var s;
1193
- return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1194
- }));
1195
- break;
1196
- case W(n.orientation.value, { vertical: D.ArrowDown, horizontal: D.ArrowRight }):
1197
- return a.preventDefault(), a.stopPropagation(), n.goToOption(L.Next);
1198
- case W(n.orientation.value, { vertical: D.ArrowUp, horizontal: D.ArrowLeft }):
1199
- return a.preventDefault(), a.stopPropagation(), n.goToOption(L.Previous);
1200
- case D.Home:
1201
- case D.PageUp:
1202
- return a.preventDefault(), a.stopPropagation(), n.goToOption(L.First);
1203
- case D.End:
1204
- case D.PageDown:
1205
- return a.preventDefault(), a.stopPropagation(), n.goToOption(L.Last);
1206
- case D.Escape:
1207
- a.preventDefault(), a.stopPropagation(), n.closeListbox(), N(() => {
1208
- var s;
1209
- return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1210
- });
1211
- break;
1212
- case D.Tab:
1213
- a.preventDefault(), a.stopPropagation();
1214
- break;
1215
- default:
1216
- a.key.length === 1 && (n.search(a.key), r.value = setTimeout(() => n.clearSearch(), 350));
1217
- break;
1218
- }
1219
- }
1220
- let u = nn(), c = k(() => u !== null ? (u.value & te.Open) === te.Open : n.listboxState.value === 0);
1221
- return () => {
1222
- var a, s, d, g;
1223
- let p = { open: n.listboxState.value === 0 }, { id: b, ...v } = e, h = { "aria-activedescendant": n.activeOptionIndex.value === null || (a = n.options.value[n.activeOptionIndex.value]) == null ? void 0 : a.id, "aria-multiselectable": n.mode.value === 1 ? !0 : void 0, "aria-labelledby": (g = (s = E(n.labelRef)) == null ? void 0 : s.id) != null ? g : (d = E(n.buttonRef)) == null ? void 0 : d.id, "aria-orientation": n.orientation.value, id: b, onKeydown: i, role: "listbox", tabIndex: 0, ref: n.optionsRef };
1224
- return B({ ourProps: h, theirProps: v, slot: p, attrs: t, slots: o, features: Ee.RenderStrategy | Ee.Static, visible: c.value, name: "ListboxOptions" });
1225
- };
1226
- } }), cl = T({ name: "ListboxOption", props: { as: { type: [Object, String], default: "li" }, value: { type: [Object, String, Number, Boolean] }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-listbox.option-${Z()}` } }, setup(e, { slots: t, attrs: o, expose: l }) {
1227
- let n = De("ListboxOption"), r = O(null);
1228
- l({ el: r, $el: r });
1229
- let i = k(() => n.activeOptionIndex.value !== null ? n.options.value[n.activeOptionIndex.value].id === e.id : !1), u = k(() => W(n.mode.value, { 0: () => n.compare(G(n.value.value), G(e.value)), 1: () => G(n.value.value).some((m) => n.compare(G(m), G(e.value))) })), c = k(() => W(n.mode.value, { 1: () => {
1230
- var m;
1231
- let w = G(n.value.value);
1232
- return ((m = n.options.value.find((y) => w.some((x) => n.compare(G(x), G(y.dataRef.value))))) == null ? void 0 : m.id) === e.id;
1233
- }, 0: () => u.value })), a = vn(r), s = k(() => ({ disabled: e.disabled, value: e.value, get textValue() {
1234
- return a();
1235
- }, domRef: r }));
1236
- ee(() => n.registerOption(e.id, s)), Be(() => n.unregisterOption(e.id)), ee(() => {
1237
- J([n.listboxState, u], () => {
1238
- n.listboxState.value === 0 && u.value && W(n.mode.value, { 1: () => {
1239
- c.value && n.goToOption(L.Specific, e.id);
1240
- }, 0: () => {
1241
- n.goToOption(L.Specific, e.id);
1242
- } });
1243
- }, { immediate: !0 });
1244
- }), we(() => {
1245
- n.listboxState.value === 0 && i.value && n.activationTrigger.value !== 0 && N(() => {
1246
- var m, w;
1247
- return (w = (m = E(r)) == null ? void 0 : m.scrollIntoView) == null ? void 0 : w.call(m, { block: "nearest" });
1248
- });
1249
- });
1250
- function d(m) {
1251
- if (e.disabled)
1252
- return m.preventDefault();
1253
- n.select(e.value), n.mode.value === 0 && (n.closeListbox(), N(() => {
1254
- var w;
1255
- return (w = E(n.buttonRef)) == null ? void 0 : w.focus({ preventScroll: !0 });
1256
- }));
1257
- }
1258
- function g() {
1259
- if (e.disabled)
1260
- return n.goToOption(L.Nothing);
1261
- n.goToOption(L.Specific, e.id);
1262
- }
1263
- let p = pn();
1264
- function b(m) {
1265
- p.update(m);
1266
- }
1267
- function v(m) {
1268
- p.wasMoved(m) && (e.disabled || i.value || n.goToOption(L.Specific, e.id, 0));
1269
- }
1270
- function h(m) {
1271
- p.wasMoved(m) && (e.disabled || i.value && n.goToOption(L.Nothing));
1272
- }
1273
- return () => {
1274
- let { disabled: m } = e, w = { active: i.value, selected: u.value, disabled: m }, { id: y, value: x, disabled: S, ...P } = e, R = { id: y, ref: r, role: "option", tabIndex: m === !0 ? void 0 : -1, "aria-disabled": m === !0 ? !0 : void 0, "aria-selected": u.value, disabled: void 0, onClick: d, onFocus: g, onPointerenter: b, onMouseenter: b, onPointermove: v, onMousemove: v, onPointerleave: h, onMouseleave: h };
1275
- return B({ ourProps: R, theirProps: P, slot: w, attrs: o, slots: t, name: "ListboxOption" });
1276
- };
1277
- } });
1278
- var dl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(dl || {}), fl = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Other = 1] = "Other", e))(fl || {});
1279
- function pl(e) {
1280
- requestAnimationFrame(() => requestAnimationFrame(e));
1281
- }
1282
- let bn = Symbol("MenuContext");
1283
- function Ue(e) {
1284
- let t = he(bn, null);
1285
- if (t === null) {
1286
- let o = new Error(`<${e} /> is missing a parent <Menu /> component.`);
1287
- throw Error.captureStackTrace && Error.captureStackTrace(o, Ue), o;
1288
- }
1289
- return t;
1290
- }
1291
- let ml = T({ name: "Menu", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: o }) {
1292
- let l = O(1), n = O(null), r = O(null), i = O([]), u = O(""), c = O(null), a = O(1);
1293
- function s(g = (p) => p) {
1294
- let p = c.value !== null ? i.value[c.value] : null, b = ct(g(i.value.slice()), (h) => E(h.dataRef.domRef)), v = p ? b.indexOf(p) : null;
1295
- return v === -1 && (v = null), { items: b, activeItemIndex: v };
1296
- }
1297
- let d = { menuState: l, buttonRef: n, itemsRef: r, items: i, searchQuery: u, activeItemIndex: c, activationTrigger: a, closeMenu: () => {
1298
- l.value = 1, c.value = null;
1299
- }, openMenu: () => l.value = 0, goToItem(g, p, b) {
1300
- let v = s(), h = en(g === L.Specific ? { focus: L.Specific, id: p } : { focus: g }, { resolveItems: () => v.items, resolveActiveIndex: () => v.activeItemIndex, resolveId: (m) => m.id, resolveDisabled: (m) => m.dataRef.disabled });
1301
- u.value = "", c.value = h, a.value = b ?? 1, i.value = v.items;
1302
- }, search(g) {
1303
- let p = u.value !== "" ? 0 : 1;
1304
- u.value += g.toLowerCase();
1305
- let b = (c.value !== null ? i.value.slice(c.value + p).concat(i.value.slice(0, c.value + p)) : i.value).find((h) => h.dataRef.textValue.startsWith(u.value) && !h.dataRef.disabled), v = b ? i.value.indexOf(b) : -1;
1306
- v === -1 || v === c.value || (c.value = v, a.value = 1);
1307
- }, clearSearch() {
1308
- u.value = "";
1309
- }, registerItem(g, p) {
1310
- let b = s((v) => [...v, { id: g, dataRef: p }]);
1311
- i.value = b.items, c.value = b.activeItemIndex, a.value = 1;
1312
- }, unregisterItem(g) {
1313
- let p = s((b) => {
1314
- let v = b.findIndex((h) => h.id === g);
1315
- return v !== -1 && b.splice(v, 1), b;
1316
- });
1317
- i.value = p.items, c.value = p.activeItemIndex, a.value = 1;
1318
- } };
1319
- return an([n, r], (g, p) => {
1320
- var b;
1321
- d.closeMenu(), ze(p, He.Loose) || (g.preventDefault(), (b = E(n)) == null || b.focus());
1322
- }, k(() => l.value === 0)), ye(bn, d), on(k(() => W(l.value, { 0: te.Open, 1: te.Closed }))), () => {
1323
- let g = { open: l.value === 0, close: d.closeMenu };
1324
- return B({ ourProps: {}, theirProps: e, slot: g, slots: t, attrs: o, name: "Menu" });
1325
- };
1326
- } }), vl = T({ name: "MenuButton", props: { disabled: { type: Boolean, default: !1 }, as: { type: [Object, String], default: "button" }, id: { type: String, default: () => `headlessui-menu-button-${Z()}` } }, setup(e, { attrs: t, slots: o, expose: l }) {
1327
- let n = Ue("MenuButton");
1328
- l({ el: n.buttonRef, $el: n.buttonRef });
1329
- function r(a) {
1330
- switch (a.key) {
1331
- case D.Space:
1332
- case D.Enter:
1333
- case D.ArrowDown:
1334
- a.preventDefault(), a.stopPropagation(), n.openMenu(), N(() => {
1335
- var s;
1336
- (s = E(n.itemsRef)) == null || s.focus({ preventScroll: !0 }), n.goToItem(L.First);
1337
- });
1338
- break;
1339
- case D.ArrowUp:
1340
- a.preventDefault(), a.stopPropagation(), n.openMenu(), N(() => {
1341
- var s;
1342
- (s = E(n.itemsRef)) == null || s.focus({ preventScroll: !0 }), n.goToItem(L.Last);
1343
- });
1344
- break;
1345
- }
1346
- }
1347
- function i(a) {
1348
- switch (a.key) {
1349
- case D.Space:
1350
- a.preventDefault();
1351
- break;
1352
- }
1353
- }
1354
- function u(a) {
1355
- e.disabled || (n.menuState.value === 0 ? (n.closeMenu(), N(() => {
1356
- var s;
1357
- return (s = E(n.buttonRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1358
- })) : (a.preventDefault(), n.openMenu(), pl(() => {
1359
- var s;
1360
- return (s = E(n.itemsRef)) == null ? void 0 : s.focus({ preventScroll: !0 });
1361
- })));
1362
- }
1363
- let c = at(k(() => ({ as: e.as, type: t.type })), n.buttonRef);
1364
- return () => {
1365
- var a;
1366
- let s = { open: n.menuState.value === 0 }, { id: d, ...g } = e, p = { ref: n.buttonRef, id: d, type: c.value, "aria-haspopup": "menu", "aria-controls": (a = E(n.itemsRef)) == null ? void 0 : a.id, "aria-expanded": n.menuState.value === 0, onKeydown: r, onKeyup: i, onClick: u };
1367
- return B({ ourProps: p, theirProps: g, slot: s, attrs: t, slots: o, name: "MenuButton" });
1368
- };
1369
- } }), gl = T({ name: "MenuItems", props: { as: { type: [Object, String], default: "div" }, static: { type: Boolean, default: !1 }, unmount: { type: Boolean, default: !0 }, id: { type: String, default: () => `headlessui-menu-items-${Z()}` } }, setup(e, { attrs: t, slots: o, expose: l }) {
1370
- let n = Ue("MenuItems"), r = O(null);
1371
- l({ el: n.itemsRef, $el: n.itemsRef }), Ho({ container: k(() => E(n.itemsRef)), enabled: k(() => n.menuState.value === 0), accept(s) {
1372
- return s.getAttribute("role") === "menuitem" ? NodeFilter.FILTER_REJECT : s.hasAttribute("role") ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
1373
- }, walk(s) {
1374
- s.setAttribute("role", "none");
1375
- } });
1376
- function i(s) {
1377
- var d;
1378
- switch (r.value && clearTimeout(r.value), s.key) {
1379
- case D.Space:
1380
- if (n.searchQuery.value !== "")
1381
- return s.preventDefault(), s.stopPropagation(), n.search(s.key);
1382
- case D.Enter:
1383
- if (s.preventDefault(), s.stopPropagation(), n.activeItemIndex.value !== null) {
1384
- let g = n.items.value[n.activeItemIndex.value];
1385
- (d = E(g.dataRef.domRef)) == null || d.click();
1386
- }
1387
- n.closeMenu(), rn(E(n.buttonRef));
1388
- break;
1389
- case D.ArrowDown:
1390
- return s.preventDefault(), s.stopPropagation(), n.goToItem(L.Next);
1391
- case D.ArrowUp:
1392
- return s.preventDefault(), s.stopPropagation(), n.goToItem(L.Previous);
1393
- case D.Home:
1394
- case D.PageUp:
1395
- return s.preventDefault(), s.stopPropagation(), n.goToItem(L.First);
1396
- case D.End:
1397
- case D.PageDown:
1398
- return s.preventDefault(), s.stopPropagation(), n.goToItem(L.Last);
1399
- case D.Escape:
1400
- s.preventDefault(), s.stopPropagation(), n.closeMenu(), N(() => {
1401
- var g;
1402
- return (g = E(n.buttonRef)) == null ? void 0 : g.focus({ preventScroll: !0 });
1403
- });
1404
- break;
1405
- case D.Tab:
1406
- s.preventDefault(), s.stopPropagation(), n.closeMenu(), N(() => Xo(E(n.buttonRef), s.shiftKey ? nt.Previous : nt.Next));
1407
- break;
1408
- default:
1409
- s.key.length === 1 && (n.search(s.key), r.value = setTimeout(() => n.clearSearch(), 350));
1410
- break;
1411
- }
1412
- }
1413
- function u(s) {
1414
- switch (s.key) {
1415
- case D.Space:
1416
- s.preventDefault();
1417
- break;
1418
- }
1419
- }
1420
- let c = nn(), a = k(() => c !== null ? (c.value & te.Open) === te.Open : n.menuState.value === 0);
1421
- return () => {
1422
- var s, d;
1423
- let g = { open: n.menuState.value === 0 }, { id: p, ...b } = e, v = { "aria-activedescendant": n.activeItemIndex.value === null || (s = n.items.value[n.activeItemIndex.value]) == null ? void 0 : s.id, "aria-labelledby": (d = E(n.buttonRef)) == null ? void 0 : d.id, id: p, onKeydown: i, onKeyup: u, role: "menu", tabIndex: 0, ref: n.itemsRef };
1424
- return B({ ourProps: v, theirProps: b, slot: g, attrs: t, slots: o, features: Ee.RenderStrategy | Ee.Static, visible: a.value, name: "MenuItems" });
1425
- };
1426
- } }), bl = T({ name: "MenuItem", inheritAttrs: !1, props: { as: { type: [Object, String], default: "template" }, disabled: { type: Boolean, default: !1 }, id: { type: String, default: () => `headlessui-menu-item-${Z()}` } }, setup(e, { slots: t, attrs: o, expose: l }) {
1427
- let n = Ue("MenuItem"), r = O(null);
1428
- l({ el: r, $el: r });
1429
- let i = k(() => n.activeItemIndex.value !== null ? n.items.value[n.activeItemIndex.value].id === e.id : !1), u = vn(r), c = k(() => ({ disabled: e.disabled, get textValue() {
1430
- return u();
1431
- }, domRef: r }));
1432
- ee(() => n.registerItem(e.id, c)), Be(() => n.unregisterItem(e.id)), we(() => {
1433
- n.menuState.value === 0 && i.value && n.activationTrigger.value !== 0 && N(() => {
1434
- var v, h;
1435
- return (h = (v = E(r)) == null ? void 0 : v.scrollIntoView) == null ? void 0 : h.call(v, { block: "nearest" });
1436
- });
1437
- });
1438
- function a(v) {
1439
- if (e.disabled)
1440
- return v.preventDefault();
1441
- n.closeMenu(), rn(E(n.buttonRef));
1442
- }
1443
- function s() {
1444
- if (e.disabled)
1445
- return n.goToItem(L.Nothing);
1446
- n.goToItem(L.Specific, e.id);
1447
- }
1448
- let d = pn();
1449
- function g(v) {
1450
- d.update(v);
1451
- }
1452
- function p(v) {
1453
- d.wasMoved(v) && (e.disabled || i.value || n.goToItem(L.Specific, e.id, 0));
1454
- }
1455
- function b(v) {
1456
- d.wasMoved(v) && (e.disabled || i.value && n.goToItem(L.Nothing));
1457
- }
1458
- return () => {
1459
- let { disabled: v } = e, h = { active: i.value, disabled: v, close: n.closeMenu }, { id: m, ...w } = e;
1460
- return B({ ourProps: { id: m, ref: r, role: "menuitem", tabIndex: v === !0 ? void 0 : -1, "aria-disabled": v === !0 ? !0 : void 0, disabled: void 0, onClick: a, onFocus: s, onPointerenter: g, onMouseenter: g, onPointermove: p, onMousemove: p, onPointerleave: b, onMouseleave: b }, theirProps: { ...o, ...w }, slot: h, attrs: o, slots: t, name: "MenuItem" });
1461
- };
1462
- } }), hn = Symbol("LabelContext");
1463
- function yn() {
1464
- let e = he(hn, null);
1465
- if (e === null) {
1466
- let t = new Error("You used a <Label /> component, but it is not inside a parent.");
1467
- throw Error.captureStackTrace && Error.captureStackTrace(t, yn), t;
1468
- }
1469
- return e;
1470
- }
1471
- function hl({ slot: e = {}, name: t = "Label", props: o = {} } = {}) {
1472
- let l = O([]);
1473
- function n(r) {
1474
- return l.value.push(r), () => {
1475
- let i = l.value.indexOf(r);
1476
- i !== -1 && l.value.splice(i, 1);
1477
- };
1478
- }
1479
- return ye(hn, { register: n, slot: e, name: t, props: o }), k(() => l.value.length > 0 ? l.value.join(" ") : void 0);
1480
- }
1481
- T({ name: "Label", props: { as: { type: [Object, String], default: "label" }, passive: { type: [Boolean], default: !1 }, id: { type: String, default: () => `headlessui-label-${Z()}` } }, setup(e, { slots: t, attrs: o }) {
1482
- let l = yn();
1483
- return ee(() => Be(l.register(e.id))), () => {
1484
- let { name: n = "Label", slot: r = {}, props: i = {} } = l, { id: u, passive: c, ...a } = e, s = { ...Object.entries(i).reduce((d, [g, p]) => Object.assign(d, { [g]: _(p) }), {}), id: u };
1485
- return c && (delete s.onClick, delete s.htmlFor, delete a.onClick), B({ ourProps: s, theirProps: a, slot: r, attrs: o, slots: t, name: n });
1486
- };
1487
- } });
1488
- let wn = Symbol("GroupContext");
1489
- T({ name: "SwitchGroup", props: { as: { type: [Object, String], default: "template" } }, setup(e, { slots: t, attrs: o }) {
1490
- let l = O(null), n = hl({ name: "SwitchLabel", props: { htmlFor: k(() => {
1491
- var i;
1492
- return (i = l.value) == null ? void 0 : i.id;
1493
- }), onClick(i) {
1494
- l.value && (i.currentTarget.tagName === "LABEL" && i.preventDefault(), l.value.click(), l.value.focus({ preventScroll: !0 }));
1495
- } } }), r = el({ name: "SwitchDescription" });
1496
- return ye(wn, { switchRef: l, labelledby: n, describedby: r }), () => B({ theirProps: e, ourProps: {}, slot: {}, slots: t, attrs: o, name: "SwitchGroup" });
1497
- } });
1498
- let yl = T({ name: "Switch", emits: { "update:modelValue": (e) => !0 }, props: { as: { type: [Object, String], default: "button" }, modelValue: { type: Boolean, default: void 0 }, defaultChecked: { type: Boolean, optional: !0 }, form: { type: String, optional: !0 }, name: { type: String, optional: !0 }, value: { type: String, optional: !0 }, id: { type: String, default: () => `headlessui-switch-${Z()}` } }, inheritAttrs: !1, setup(e, { emit: t, attrs: o, slots: l, expose: n }) {
1499
- let r = he(wn, null), [i, u] = fn(k(() => e.modelValue), (h) => t("update:modelValue", h), k(() => e.defaultChecked));
1500
- function c() {
1501
- u(!i.value);
1502
- }
1503
- let a = O(null), s = r === null ? a : r.switchRef, d = at(k(() => ({ as: e.as, type: o.type })), s);
1504
- n({ el: s, $el: s });
1505
- function g(h) {
1506
- h.preventDefault(), c();
1507
- }
1508
- function p(h) {
1509
- h.key === D.Space ? (h.preventDefault(), c()) : h.key === D.Enter && Zo(h.currentTarget);
1510
- }
1511
- function b(h) {
1512
- h.preventDefault();
1513
- }
1514
- let v = k(() => {
1515
- var h, m;
1516
- return (m = (h = E(s)) == null ? void 0 : h.closest) == null ? void 0 : m.call(h, "form");
1517
- });
1518
- return ee(() => {
1519
- J([v], () => {
1520
- if (!v.value || e.defaultChecked === void 0)
1521
- return;
1522
- function h() {
1523
- u(e.defaultChecked);
1524
- }
1525
- return v.value.addEventListener("reset", h), () => {
1526
- var m;
1527
- (m = v.value) == null || m.removeEventListener("reset", h);
1528
- };
1529
- }, { immediate: !0 });
1530
- }), () => {
1531
- let { id: h, name: m, value: w, form: y, ...x } = e, S = { checked: i.value }, P = { id: h, ref: s, role: "switch", type: d.value, tabIndex: 0, "aria-checked": i.value, "aria-labelledby": r == null ? void 0 : r.labelledby.value, "aria-describedby": r == null ? void 0 : r.describedby.value, onClick: g, onKeyup: p, onKeypress: b };
1532
- return Re(be, [m != null && i.value != null ? Re(sn, Jt({ features: dt.Hidden, as: "input", type: "checkbox", hidden: !0, readOnly: !0, checked: i.value, form: y, name: m, value: w })) : null, B({ ourProps: P, theirProps: { ...o, ...it(x, ["modelValue", "defaultChecked"]) }, slot: S, attrs: o, slots: l, name: "Switch" })]);
1533
- };
1534
- } });
1535
- const $e = Math.min, ue = Math.max, Me = Math.round, Ie = Math.floor, ae = (e) => ({
1536
- x: e,
1537
- y: e
1538
- }), wl = {
1539
- left: "right",
1540
- right: "left",
1541
- bottom: "top",
1542
- top: "bottom"
1543
- }, xl = {
1544
- start: "end",
1545
- end: "start"
1546
- };
1547
- function Tt(e, t, o) {
1548
- return ue(e, $e(t, o));
1549
- }
1550
- function We(e, t) {
1551
- return typeof e == "function" ? e(t) : e;
1552
- }
1553
- function ce(e) {
1554
- return e.split("-")[0];
1555
- }
1556
- function Ke(e) {
1557
- return e.split("-")[1];
1558
- }
1559
- function xn(e) {
1560
- return e === "x" ? "y" : "x";
1561
- }
1562
- function Sn(e) {
1563
- return e === "y" ? "height" : "width";
1564
- }
1565
- function Ge(e) {
1566
- return ["top", "bottom"].includes(ce(e)) ? "y" : "x";
1567
- }
1568
- function kn(e) {
1569
- return xn(Ge(e));
1570
- }
1571
- function Sl(e, t, o) {
1572
- o === void 0 && (o = !1);
1573
- const l = Ke(e), n = kn(e), r = Sn(n);
1574
- let i = n === "x" ? l === (o ? "end" : "start") ? "right" : "left" : l === "start" ? "bottom" : "top";
1575
- return t.reference[r] > t.floating[r] && (i = Fe(i)), [i, Fe(i)];
1576
- }
1577
- function kl(e) {
1578
- const t = Fe(e);
1579
- return [ot(e), t, ot(t)];
1580
- }
1581
- function ot(e) {
1582
- return e.replace(/start|end/g, (t) => xl[t]);
1583
- }
1584
- function Ol(e, t, o) {
1585
- const l = ["left", "right"], n = ["right", "left"], r = ["top", "bottom"], i = ["bottom", "top"];
1586
- switch (e) {
1587
- case "top":
1588
- case "bottom":
1589
- return o ? t ? n : l : t ? l : n;
1590
- case "left":
1591
- case "right":
1592
- return t ? r : i;
1593
- default:
1594
- return [];
1595
- }
1596
- }
1597
- function Rl(e, t, o, l) {
1598
- const n = Ke(e);
1599
- let r = Ol(ce(e), o === "start", l);
1600
- return n && (r = r.map((i) => i + "-" + n), t && (r = r.concat(r.map(ot)))), r;
1601
- }
1602
- function Fe(e) {
1603
- return e.replace(/left|right|bottom|top/g, (t) => wl[t]);
1604
- }
1605
- function El(e) {
1606
- return {
1607
- top: 0,
1608
- right: 0,
1609
- bottom: 0,
1610
- left: 0,
1611
- ...e
1612
- };
1613
- }
1614
- function Cl(e) {
1615
- return typeof e != "number" ? El(e) : {
1616
- top: e,
1617
- right: e,
1618
- bottom: e,
1619
- left: e
1620
- };
1621
- }
1622
- function Ve(e) {
1623
- return {
1624
- ...e,
1625
- top: e.y,
1626
- left: e.x,
1627
- right: e.x + e.width,
1628
- bottom: e.y + e.height
1629
- };
1630
- }
1631
- function It(e, t, o) {
1632
- let {
1633
- reference: l,
1634
- floating: n
1635
- } = e;
1636
- const r = Ge(t), i = kn(t), u = Sn(i), c = ce(t), a = r === "y", s = l.x + l.width / 2 - n.width / 2, d = l.y + l.height / 2 - n.height / 2, g = l[u] / 2 - n[u] / 2;
1637
- let p;
1638
- switch (c) {
1639
- case "top":
1640
- p = {
1641
- x: s,
1642
- y: l.y - n.height
1643
- };
1644
- break;
1645
- case "bottom":
1646
- p = {
1647
- x: s,
1648
- y: l.y + l.height
1649
- };
1650
- break;
1651
- case "right":
1652
- p = {
1653
- x: l.x + l.width,
1654
- y: d
1655
- };
1656
- break;
1657
- case "left":
1658
- p = {
1659
- x: l.x - n.width,
1660
- y: d
1661
- };
1662
- break;
1663
- default:
1664
- p = {
1665
- x: l.x,
1666
- y: l.y
1667
- };
1668
- }
1669
- switch (Ke(t)) {
1670
- case "start":
1671
- p[i] -= g * (o && a ? -1 : 1);
1672
- break;
1673
- case "end":
1674
- p[i] += g * (o && a ? -1 : 1);
1675
- break;
1676
- }
1677
- return p;
1678
- }
1679
- const Dl = async (e, t, o) => {
1680
- const {
1681
- placement: l = "bottom",
1682
- strategy: n = "absolute",
1683
- middleware: r = [],
1684
- platform: i
1685
- } = o, u = r.filter(Boolean), c = await (i.isRTL == null ? void 0 : i.isRTL(t));
1686
- let a = await i.getElementRects({
1687
- reference: e,
1688
- floating: t,
1689
- strategy: n
1690
- }), {
1691
- x: s,
1692
- y: d
1693
- } = It(a, l, c), g = l, p = {}, b = 0;
1694
- for (let v = 0; v < u.length; v++) {
1695
- const {
1696
- name: h,
1697
- fn: m
1698
- } = u[v], {
1699
- x: w,
1700
- y,
1701
- data: x,
1702
- reset: S
1703
- } = await m({
1704
- x: s,
1705
- y: d,
1706
- initialPlacement: l,
1707
- placement: g,
1708
- strategy: n,
1709
- middlewareData: p,
1710
- rects: a,
1711
- platform: i,
1712
- elements: {
1713
- reference: e,
1714
- floating: t
1715
- }
1716
- });
1717
- if (s = w ?? s, d = y ?? d, p = {
1718
- ...p,
1719
- [h]: {
1720
- ...p[h],
1721
- ...x
1722
- }
1723
- }, S && b <= 50) {
1724
- b++, typeof S == "object" && (S.placement && (g = S.placement), S.rects && (a = S.rects === !0 ? await i.getElementRects({
1725
- reference: e,
1726
- floating: t,
1727
- strategy: n
1728
- }) : S.rects), {
1729
- x: s,
1730
- y: d
1731
- } = It(a, g, c)), v = -1;
1732
- continue;
1733
- }
1734
- }
1735
- return {
1736
- x: s,
1737
- y: d,
1738
- placement: g,
1739
- strategy: n,
1740
- middlewareData: p
1741
- };
1742
- };
1743
- async function On(e, t) {
1744
- var o;
1745
- t === void 0 && (t = {});
1746
- const {
1747
- x: l,
1748
- y: n,
1749
- platform: r,
1750
- rects: i,
1751
- elements: u,
1752
- strategy: c
1753
- } = e, {
1754
- boundary: a = "clippingAncestors",
1755
- rootBoundary: s = "viewport",
1756
- elementContext: d = "floating",
1757
- altBoundary: g = !1,
1758
- padding: p = 0
1759
- } = We(t, e), b = Cl(p), h = u[g ? d === "floating" ? "reference" : "floating" : d], m = Ve(await r.getClippingRect({
1760
- element: (o = await (r.isElement == null ? void 0 : r.isElement(h))) == null || o ? h : h.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(u.floating)),
1761
- boundary: a,
1762
- rootBoundary: s,
1763
- strategy: c
1764
- })), w = d === "floating" ? {
1765
- ...i.floating,
1766
- x: l,
1767
- y: n
1768
- } : i.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(u.floating)), x = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
1769
- x: 1,
1770
- y: 1
1771
- } : {
1772
- x: 1,
1773
- y: 1
1774
- }, S = Ve(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
1775
- rect: w,
1776
- offsetParent: y,
1777
- strategy: c
1778
- }) : w);
1779
- return {
1780
- top: (m.top - S.top + b.top) / x.y,
1781
- bottom: (S.bottom - m.bottom + b.bottom) / x.y,
1782
- left: (m.left - S.left + b.left) / x.x,
1783
- right: (S.right - m.right + b.right) / x.x
1784
- };
1785
- }
1786
- const Pl = function(e) {
1787
- return e === void 0 && (e = {}), {
1788
- name: "flip",
1789
- options: e,
1790
- async fn(t) {
1791
- var o, l;
1792
- const {
1793
- placement: n,
1794
- middlewareData: r,
1795
- rects: i,
1796
- initialPlacement: u,
1797
- platform: c,
1798
- elements: a
1799
- } = t, {
1800
- mainAxis: s = !0,
1801
- crossAxis: d = !0,
1802
- fallbackPlacements: g,
1803
- fallbackStrategy: p = "bestFit",
1804
- fallbackAxisSideDirection: b = "none",
1805
- flipAlignment: v = !0,
1806
- ...h
1807
- } = We(e, t);
1808
- if ((o = r.arrow) != null && o.alignmentOffset)
1809
- return {};
1810
- const m = ce(n), w = ce(u) === u, y = await (c.isRTL == null ? void 0 : c.isRTL(a.floating)), x = g || (w || !v ? [Fe(u)] : kl(u));
1811
- !g && b !== "none" && x.push(...Rl(u, v, b, y));
1812
- const S = [u, ...x], P = await On(t, h), R = [];
1813
- let V = ((l = r.flip) == null ? void 0 : l.overflows) || [];
1814
- if (s && R.push(P[m]), d) {
1815
- const se = Sl(n, i, y);
1816
- R.push(P[se[0]], P[se[1]]);
1817
- }
1818
- if (V = [...V, {
1819
- placement: n,
1820
- overflows: R
1821
- }], !R.every((se) => se <= 0)) {
1822
- var re, _e;
1823
- const se = (((re = r.flip) == null ? void 0 : re.index) || 0) + 1, bt = S[se];
1824
- if (bt)
1825
- return {
1826
- data: {
1827
- index: se,
1828
- overflows: V
1829
- },
1830
- reset: {
1831
- placement: bt
1832
- }
1833
- };
1834
- let xe = (_e = V.filter((fe) => fe.overflows[0] <= 0).sort((fe, pe) => fe.overflows[1] - pe.overflows[1])[0]) == null ? void 0 : _e.placement;
1835
- if (!xe)
1836
- switch (p) {
1837
- case "bestFit": {
1838
- var gt;
1839
- const fe = (gt = V.map((pe) => [pe.placement, pe.overflows.filter((Se) => Se > 0).reduce((Se, Tn) => Se + Tn, 0)]).sort((pe, Se) => pe[1] - Se[1])[0]) == null ? void 0 : gt[0];
1840
- fe && (xe = fe);
1841
- break;
1842
- }
1843
- case "initialPlacement":
1844
- xe = u;
1845
- break;
1846
- }
1847
- if (n !== xe)
1848
- return {
1849
- reset: {
1850
- placement: xe
1851
- }
1852
- };
1853
- }
1854
- return {};
1855
- }
1856
- };
1857
- };
1858
- async function _l(e, t) {
1859
- const {
1860
- placement: o,
1861
- platform: l,
1862
- elements: n
1863
- } = e, r = await (l.isRTL == null ? void 0 : l.isRTL(n.floating)), i = ce(o), u = Ke(o), c = Ge(o) === "y", a = ["left", "top"].includes(i) ? -1 : 1, s = r && c ? -1 : 1, d = We(t, e);
1864
- let {
1865
- mainAxis: g,
1866
- crossAxis: p,
1867
- alignmentAxis: b
1868
- } = typeof d == "number" ? {
1869
- mainAxis: d,
1870
- crossAxis: 0,
1871
- alignmentAxis: null
1872
- } : {
1873
- mainAxis: 0,
1874
- crossAxis: 0,
1875
- alignmentAxis: null,
1876
- ...d
1877
- };
1878
- return u && typeof b == "number" && (p = u === "end" ? b * -1 : b), c ? {
1879
- x: p * s,
1880
- y: g * a
1881
- } : {
1882
- x: g * a,
1883
- y: p * s
1884
- };
1885
- }
1886
- const Ll = function(e) {
1887
- return e === void 0 && (e = 0), {
1888
- name: "offset",
1889
- options: e,
1890
- async fn(t) {
1891
- var o, l;
1892
- const {
1893
- x: n,
1894
- y: r,
1895
- placement: i,
1896
- middlewareData: u
1897
- } = t, c = await _l(t, e);
1898
- return i === ((o = u.offset) == null ? void 0 : o.placement) && (l = u.arrow) != null && l.alignmentOffset ? {} : {
1899
- x: n + c.x,
1900
- y: r + c.y,
1901
- data: {
1902
- ...c,
1903
- placement: i
1904
- }
1905
- };
1906
- }
1907
- };
1908
- }, Tl = function(e) {
1909
- return e === void 0 && (e = {}), {
1910
- name: "shift",
1911
- options: e,
1912
- async fn(t) {
1913
- const {
1914
- x: o,
1915
- y: l,
1916
- placement: n
1917
- } = t, {
1918
- mainAxis: r = !0,
1919
- crossAxis: i = !1,
1920
- limiter: u = {
1921
- fn: (h) => {
1922
- let {
1923
- x: m,
1924
- y: w
1925
- } = h;
1926
- return {
1927
- x: m,
1928
- y: w
1929
- };
1930
- }
1931
- },
1932
- ...c
1933
- } = We(e, t), a = {
1934
- x: o,
1935
- y: l
1936
- }, s = await On(t, c), d = Ge(ce(n)), g = xn(d);
1937
- let p = a[g], b = a[d];
1938
- if (r) {
1939
- const h = g === "y" ? "top" : "left", m = g === "y" ? "bottom" : "right", w = p + s[h], y = p - s[m];
1940
- p = Tt(w, p, y);
1941
- }
1942
- if (i) {
1943
- const h = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", w = b + s[h], y = b - s[m];
1944
- b = Tt(w, b, y);
1945
- }
1946
- const v = u.fn({
1947
- ...t,
1948
- [g]: p,
1949
- [d]: b
1950
- });
1951
- return {
1952
- ...v,
1953
- data: {
1954
- x: v.x - o,
1955
- y: v.y - l
1956
- }
1957
- };
1958
- }
1959
- };
1960
- };
1961
- function ne(e) {
1962
- return ft(e) ? (e.nodeName || "").toLowerCase() : "#document";
1963
- }
1964
- function H(e) {
1965
- var t;
1966
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1967
- }
1968
- function le(e) {
1969
- var t;
1970
- return (t = (ft(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1971
- }
1972
- function ft(e) {
1973
- return e instanceof Node || e instanceof H(e).Node;
1974
- }
1975
- function oe(e) {
1976
- return e instanceof Element || e instanceof H(e).Element;
1977
- }
1978
- function Q(e) {
1979
- return e instanceof HTMLElement || e instanceof H(e).HTMLElement;
1980
- }
1981
- function At(e) {
1982
- return typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof H(e).ShadowRoot;
1983
- }
1984
- function Pe(e) {
1985
- const {
1986
- overflow: t,
1987
- overflowX: o,
1988
- overflowY: l,
1989
- display: n
1990
- } = K(e);
1991
- return /auto|scroll|overlay|hidden|clip/.test(t + l + o) && !["inline", "contents"].includes(n);
1992
- }
1993
- function Il(e) {
1994
- return ["table", "td", "th"].includes(ne(e));
1995
- }
1996
- function pt(e) {
1997
- const t = mt(), o = K(e);
1998
- return o.transform !== "none" || o.perspective !== "none" || (o.containerType ? o.containerType !== "normal" : !1) || !t && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !t && (o.filter ? o.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((l) => (o.willChange || "").includes(l)) || ["paint", "layout", "strict", "content"].some((l) => (o.contain || "").includes(l));
1999
- }
2000
- function Al(e) {
2001
- let t = ge(e);
2002
- for (; Q(t) && !qe(t); ) {
2003
- if (pt(t))
2004
- return t;
2005
- t = ge(t);
2006
- }
2007
- return null;
2008
- }
2009
- function mt() {
2010
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
2011
- }
2012
- function qe(e) {
2013
- return ["html", "body", "#document"].includes(ne(e));
2014
- }
2015
- function K(e) {
2016
- return H(e).getComputedStyle(e);
2017
- }
2018
- function Xe(e) {
2019
- return oe(e) ? {
2020
- scrollLeft: e.scrollLeft,
2021
- scrollTop: e.scrollTop
2022
- } : {
2023
- scrollLeft: e.pageXOffset,
2024
- scrollTop: e.pageYOffset
2025
- };
2026
- }
2027
- function ge(e) {
2028
- if (ne(e) === "html")
2029
- return e;
2030
- const t = (
2031
- // Step into the shadow DOM of the parent of a slotted node.
2032
- e.assignedSlot || // DOM Element detected.
2033
- e.parentNode || // ShadowRoot detected.
2034
- At(e) && e.host || // Fallback.
2035
- le(e)
2036
- );
2037
- return At(t) ? t.host : t;
2038
- }
2039
- function Rn(e) {
2040
- const t = ge(e);
2041
- return qe(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Q(t) && Pe(t) ? t : Rn(t);
2042
- }
2043
- function Ce(e, t, o) {
2044
- var l;
2045
- t === void 0 && (t = []), o === void 0 && (o = !0);
2046
- const n = Rn(e), r = n === ((l = e.ownerDocument) == null ? void 0 : l.body), i = H(n);
2047
- return r ? t.concat(i, i.visualViewport || [], Pe(n) ? n : [], i.frameElement && o ? Ce(i.frameElement) : []) : t.concat(n, Ce(n, [], o));
2048
- }
2049
- function En(e) {
2050
- const t = K(e);
2051
- let o = parseFloat(t.width) || 0, l = parseFloat(t.height) || 0;
2052
- const n = Q(e), r = n ? e.offsetWidth : o, i = n ? e.offsetHeight : l, u = Me(o) !== r || Me(l) !== i;
2053
- return u && (o = r, l = i), {
2054
- width: o,
2055
- height: l,
2056
- $: u
2057
- };
2058
- }
2059
- function vt(e) {
2060
- return oe(e) ? e : e.contextElement;
2061
- }
2062
- function ve(e) {
2063
- const t = vt(e);
2064
- if (!Q(t))
2065
- return ae(1);
2066
- const o = t.getBoundingClientRect(), {
2067
- width: l,
2068
- height: n,
2069
- $: r
2070
- } = En(t);
2071
- let i = (r ? Me(o.width) : o.width) / l, u = (r ? Me(o.height) : o.height) / n;
2072
- return (!i || !Number.isFinite(i)) && (i = 1), (!u || !Number.isFinite(u)) && (u = 1), {
2073
- x: i,
2074
- y: u
2075
- };
2076
- }
2077
- const $l = /* @__PURE__ */ ae(0);
2078
- function Cn(e) {
2079
- const t = H(e);
2080
- return !mt() || !t.visualViewport ? $l : {
2081
- x: t.visualViewport.offsetLeft,
2082
- y: t.visualViewport.offsetTop
2083
- };
2084
- }
2085
- function Ml(e, t, o) {
2086
- return t === void 0 && (t = !1), !o || t && o !== H(e) ? !1 : t;
2087
- }
2088
- function de(e, t, o, l) {
2089
- t === void 0 && (t = !1), o === void 0 && (o = !1);
2090
- const n = e.getBoundingClientRect(), r = vt(e);
2091
- let i = ae(1);
2092
- t && (l ? oe(l) && (i = ve(l)) : i = ve(e));
2093
- const u = Ml(r, o, l) ? Cn(r) : ae(0);
2094
- let c = (n.left + u.x) / i.x, a = (n.top + u.y) / i.y, s = n.width / i.x, d = n.height / i.y;
2095
- if (r) {
2096
- const g = H(r), p = l && oe(l) ? H(l) : l;
2097
- let b = g.frameElement;
2098
- for (; b && l && p !== g; ) {
2099
- const v = ve(b), h = b.getBoundingClientRect(), m = K(b), w = h.left + (b.clientLeft + parseFloat(m.paddingLeft)) * v.x, y = h.top + (b.clientTop + parseFloat(m.paddingTop)) * v.y;
2100
- c *= v.x, a *= v.y, s *= v.x, d *= v.y, c += w, a += y, b = H(b).frameElement;
2101
- }
2102
- }
2103
- return Ve({
2104
- width: s,
2105
- height: d,
2106
- x: c,
2107
- y: a
2108
- });
2109
- }
2110
- function Fl(e) {
2111
- let {
2112
- rect: t,
2113
- offsetParent: o,
2114
- strategy: l
2115
- } = e;
2116
- const n = Q(o), r = le(o);
2117
- if (o === r)
2118
- return t;
2119
- let i = {
2120
- scrollLeft: 0,
2121
- scrollTop: 0
2122
- }, u = ae(1);
2123
- const c = ae(0);
2124
- if ((n || !n && l !== "fixed") && ((ne(o) !== "body" || Pe(r)) && (i = Xe(o)), Q(o))) {
2125
- const a = de(o);
2126
- u = ve(o), c.x = a.x + o.clientLeft, c.y = a.y + o.clientTop;
2127
- }
2128
- return {
2129
- width: t.width * u.x,
2130
- height: t.height * u.y,
2131
- x: t.x * u.x - i.scrollLeft * u.x + c.x,
2132
- y: t.y * u.y - i.scrollTop * u.y + c.y
2133
- };
2134
- }
2135
- function Vl(e) {
2136
- return Array.from(e.getClientRects());
2137
- }
2138
- function Dn(e) {
2139
- return de(le(e)).left + Xe(e).scrollLeft;
2140
- }
2141
- function Nl(e) {
2142
- const t = le(e), o = Xe(e), l = e.ownerDocument.body, n = ue(t.scrollWidth, t.clientWidth, l.scrollWidth, l.clientWidth), r = ue(t.scrollHeight, t.clientHeight, l.scrollHeight, l.clientHeight);
2143
- let i = -o.scrollLeft + Dn(e);
2144
- const u = -o.scrollTop;
2145
- return K(l).direction === "rtl" && (i += ue(t.clientWidth, l.clientWidth) - n), {
2146
- width: n,
2147
- height: r,
2148
- x: i,
2149
- y: u
2150
- };
2151
- }
2152
- function Bl(e, t) {
2153
- const o = H(e), l = le(e), n = o.visualViewport;
2154
- let r = l.clientWidth, i = l.clientHeight, u = 0, c = 0;
2155
- if (n) {
2156
- r = n.width, i = n.height;
2157
- const a = mt();
2158
- (!a || a && t === "fixed") && (u = n.offsetLeft, c = n.offsetTop);
2159
- }
2160
- return {
2161
- width: r,
2162
- height: i,
2163
- x: u,
2164
- y: c
2165
- };
2166
- }
2167
- function jl(e, t) {
2168
- const o = de(e, !0, t === "fixed"), l = o.top + e.clientTop, n = o.left + e.clientLeft, r = Q(e) ? ve(e) : ae(1), i = e.clientWidth * r.x, u = e.clientHeight * r.y, c = n * r.x, a = l * r.y;
2169
- return {
2170
- width: i,
2171
- height: u,
2172
- x: c,
2173
- y: a
2174
- };
2175
- }
2176
- function $t(e, t, o) {
2177
- let l;
2178
- if (t === "viewport")
2179
- l = Bl(e, o);
2180
- else if (t === "document")
2181
- l = Nl(le(e));
2182
- else if (oe(t))
2183
- l = jl(t, o);
2184
- else {
2185
- const n = Cn(e);
2186
- l = {
2187
- ...t,
2188
- x: t.x - n.x,
2189
- y: t.y - n.y
2190
- };
2191
- }
2192
- return Ve(l);
2193
- }
2194
- function Pn(e, t) {
2195
- const o = ge(e);
2196
- return o === t || !oe(o) || qe(o) ? !1 : K(o).position === "fixed" || Pn(o, t);
2197
- }
2198
- function Hl(e, t) {
2199
- const o = t.get(e);
2200
- if (o)
2201
- return o;
2202
- let l = Ce(e, [], !1).filter((u) => oe(u) && ne(u) !== "body"), n = null;
2203
- const r = K(e).position === "fixed";
2204
- let i = r ? ge(e) : e;
2205
- for (; oe(i) && !qe(i); ) {
2206
- const u = K(i), c = pt(i);
2207
- !c && u.position === "fixed" && (n = null), (r ? !c && !n : !c && u.position === "static" && !!n && ["absolute", "fixed"].includes(n.position) || Pe(i) && !c && Pn(e, i)) ? l = l.filter((s) => s !== i) : n = u, i = ge(i);
2208
- }
2209
- return t.set(e, l), l;
2210
- }
2211
- function zl(e) {
2212
- let {
2213
- element: t,
2214
- boundary: o,
2215
- rootBoundary: l,
2216
- strategy: n
2217
- } = e;
2218
- const i = [...o === "clippingAncestors" ? Hl(t, this._c) : [].concat(o), l], u = i[0], c = i.reduce((a, s) => {
2219
- const d = $t(t, s, n);
2220
- return a.top = ue(d.top, a.top), a.right = $e(d.right, a.right), a.bottom = $e(d.bottom, a.bottom), a.left = ue(d.left, a.left), a;
2221
- }, $t(t, u, n));
2222
- return {
2223
- width: c.right - c.left,
2224
- height: c.bottom - c.top,
2225
- x: c.left,
2226
- y: c.top
2227
- };
2228
- }
2229
- function Ul(e) {
2230
- const {
2231
- width: t,
2232
- height: o
2233
- } = En(e);
2234
- return {
2235
- width: t,
2236
- height: o
2237
- };
2238
- }
2239
- function Wl(e, t, o) {
2240
- const l = Q(t), n = le(t), r = o === "fixed", i = de(e, !0, r, t);
2241
- let u = {
2242
- scrollLeft: 0,
2243
- scrollTop: 0
2244
- };
2245
- const c = ae(0);
2246
- if (l || !l && !r)
2247
- if ((ne(t) !== "body" || Pe(n)) && (u = Xe(t)), l) {
2248
- const a = de(t, !0, r, t);
2249
- c.x = a.x + t.clientLeft, c.y = a.y + t.clientTop;
2250
- } else
2251
- n && (c.x = Dn(n));
2252
- return {
2253
- x: i.left + u.scrollLeft - c.x,
2254
- y: i.top + u.scrollTop - c.y,
2255
- width: i.width,
2256
- height: i.height
2257
- };
2258
- }
2259
- function Mt(e, t) {
2260
- return !Q(e) || K(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
2261
- }
2262
- function _n(e, t) {
2263
- const o = H(e);
2264
- if (!Q(e))
2265
- return o;
2266
- let l = Mt(e, t);
2267
- for (; l && Il(l) && K(l).position === "static"; )
2268
- l = Mt(l, t);
2269
- return l && (ne(l) === "html" || ne(l) === "body" && K(l).position === "static" && !pt(l)) ? o : l || Al(e) || o;
2270
- }
2271
- const Kl = async function(e) {
2272
- let {
2273
- reference: t,
2274
- floating: o,
2275
- strategy: l
2276
- } = e;
2277
- const n = this.getOffsetParent || _n, r = this.getDimensions;
2278
- return {
2279
- reference: Wl(t, await n(o), l),
2280
- floating: {
2281
- x: 0,
2282
- y: 0,
2283
- ...await r(o)
2284
- }
2285
- };
2286
- };
2287
- function Gl(e) {
2288
- return K(e).direction === "rtl";
2289
- }
2290
- const ql = {
2291
- convertOffsetParentRelativeRectToViewportRelativeRect: Fl,
2292
- getDocumentElement: le,
2293
- getClippingRect: zl,
2294
- getOffsetParent: _n,
2295
- getElementRects: Kl,
2296
- getClientRects: Vl,
2297
- getDimensions: Ul,
2298
- getScale: ve,
2299
- isElement: oe,
2300
- isRTL: Gl
2301
- };
2302
- function Xl(e, t) {
2303
- let o = null, l;
2304
- const n = le(e);
2305
- function r() {
2306
- clearTimeout(l), o && o.disconnect(), o = null;
2307
- }
2308
- function i(u, c) {
2309
- u === void 0 && (u = !1), c === void 0 && (c = 1), r();
2310
- const {
2311
- left: a,
2312
- top: s,
2313
- width: d,
2314
- height: g
2315
- } = e.getBoundingClientRect();
2316
- if (u || t(), !d || !g)
2317
- return;
2318
- const p = Ie(s), b = Ie(n.clientWidth - (a + d)), v = Ie(n.clientHeight - (s + g)), h = Ie(a), w = {
2319
- rootMargin: -p + "px " + -b + "px " + -v + "px " + -h + "px",
2320
- threshold: ue(0, $e(1, c)) || 1
2321
- };
2322
- let y = !0;
2323
- function x(S) {
2324
- const P = S[0].intersectionRatio;
2325
- if (P !== c) {
2326
- if (!y)
2327
- return i();
2328
- P ? i(!1, P) : l = setTimeout(() => {
2329
- i(!1, 1e-7);
2330
- }, 100);
2331
- }
2332
- y = !1;
2333
- }
2334
- try {
2335
- o = new IntersectionObserver(x, {
2336
- ...w,
2337
- // Handle <iframe>s
2338
- root: n.ownerDocument
2339
- });
2340
- } catch {
2341
- o = new IntersectionObserver(x, w);
2342
- }
2343
- o.observe(e);
2344
- }
2345
- return i(!0), r;
2346
- }
2347
- function Yl(e, t, o, l) {
2348
- l === void 0 && (l = {});
2349
- const {
2350
- ancestorScroll: n = !0,
2351
- ancestorResize: r = !0,
2352
- elementResize: i = typeof ResizeObserver == "function",
2353
- layoutShift: u = typeof IntersectionObserver == "function",
2354
- animationFrame: c = !1
2355
- } = l, a = vt(e), s = n || r ? [...a ? Ce(a) : [], ...Ce(t)] : [];
2356
- s.forEach((m) => {
2357
- n && m.addEventListener("scroll", o, {
2358
- passive: !0
2359
- }), r && m.addEventListener("resize", o);
2360
- });
2361
- const d = a && u ? Xl(a, o) : null;
2362
- let g = -1, p = null;
2363
- i && (p = new ResizeObserver((m) => {
2364
- let [w] = m;
2365
- w && w.target === a && p && (p.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
2366
- p && p.observe(t);
2367
- })), o();
2368
- }), a && !c && p.observe(a), p.observe(t));
2369
- let b, v = c ? de(e) : null;
2370
- c && h();
2371
- function h() {
2372
- const m = de(e);
2373
- v && (m.x !== v.x || m.y !== v.y || m.width !== v.width || m.height !== v.height) && o(), v = m, b = requestAnimationFrame(h);
2374
- }
2375
- return o(), () => {
2376
- s.forEach((m) => {
2377
- n && m.removeEventListener("scroll", o), r && m.removeEventListener("resize", o);
2378
- }), d && d(), p && p.disconnect(), p = null, c && cancelAnimationFrame(b);
2379
- };
2380
- }
2381
- const Ql = Tl, Zl = Pl, Jl = (e, t, o) => {
2382
- const l = /* @__PURE__ */ new Map(), n = {
2383
- platform: ql,
2384
- ...o
2385
- }, r = {
2386
- ...n.platform,
2387
- _c: l
2388
- };
2389
- return Dl(e, t, {
2390
- ...n,
2391
- platform: r
2392
- });
2393
- };
2394
- function er(e) {
2395
- return e != null && typeof e == "object" && "$el" in e;
2396
- }
2397
- function Ft(e) {
2398
- if (er(e)) {
2399
- const t = e.$el;
2400
- return ft(t) && ne(t) === "#comment" ? null : t;
2401
- }
2402
- return e;
2403
- }
2404
- function Ln(e) {
2405
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
2406
- }
2407
- function Vt(e, t) {
2408
- const o = Ln(e);
2409
- return Math.round(t * o) / o;
2410
- }
2411
- function tr(e, t, o) {
2412
- o === void 0 && (o = {});
2413
- const l = o.whileElementsMounted, n = k(() => {
2414
- var R;
2415
- return (R = _(o.open)) != null ? R : !0;
2416
- }), r = k(() => _(o.middleware)), i = k(() => {
2417
- var R;
2418
- return (R = _(o.placement)) != null ? R : "bottom";
2419
- }), u = k(() => {
2420
- var R;
2421
- return (R = _(o.strategy)) != null ? R : "absolute";
2422
- }), c = k(() => {
2423
- var R;
2424
- return (R = _(o.transform)) != null ? R : !0;
2425
- }), a = k(() => Ft(e.value)), s = k(() => Ft(t.value)), d = O(0), g = O(0), p = O(u.value), b = O(i.value), v = Fn({}), h = O(!1), m = k(() => {
2426
- const R = {
2427
- position: p.value,
2428
- left: "0",
2429
- top: "0"
2430
- };
2431
- if (!s.value)
2432
- return R;
2433
- const V = Vt(s.value, d.value), re = Vt(s.value, g.value);
2434
- return c.value ? {
2435
- ...R,
2436
- transform: "translate(" + V + "px, " + re + "px)",
2437
- ...Ln(s.value) >= 1.5 && {
2438
- willChange: "transform"
2439
- }
2440
- } : {
2441
- position: p.value,
2442
- left: V + "px",
2443
- top: re + "px"
2444
- };
2445
- });
2446
- let w;
2447
- function y() {
2448
- a.value == null || s.value == null || Jl(a.value, s.value, {
2449
- middleware: r.value,
2450
- placement: i.value,
2451
- strategy: u.value
2452
- }).then((R) => {
2453
- d.value = R.x, g.value = R.y, p.value = R.strategy, b.value = R.placement, v.value = R.middlewareData, h.value = !0;
2454
- });
2455
- }
2456
- function x() {
2457
- typeof w == "function" && (w(), w = void 0);
2458
- }
2459
- function S() {
2460
- if (x(), l === void 0) {
2461
- y();
2462
- return;
2463
- }
2464
- if (a.value != null && s.value != null) {
2465
- w = l(a.value, s.value, y);
2466
- return;
2467
- }
2468
- }
2469
- function P() {
2470
- n.value || (h.value = !1);
2471
- }
2472
- return J([r, i, u], y, {
2473
- flush: "sync"
2474
- }), J([a, s], S, {
2475
- flush: "sync"
2476
- }), J(n, P, {
2477
- flush: "sync"
2478
- }), Vn() && Nn(x), {
2479
- x: me(d),
2480
- y: me(g),
2481
- strategy: me(p),
2482
- placement: me(b),
2483
- middlewareData: me(v),
2484
- isPositioned: me(h),
2485
- floatingStyles: m,
2486
- update: y
2487
- };
2488
- }
2489
- const Pr = /* @__PURE__ */ T({
425
+ }), _a = /* @__PURE__ */ v({
2490
426
  __name: "MenuContainer",
2491
427
  props: {
2492
428
  position: { default: "left" },
2493
429
  usePortal: { type: [Boolean, String], default: !1 }
2494
430
  },
2495
- setup(e) {
2496
- const t = e, o = O(null), l = O(null), n = t.position === "left" ? "bottom-end" : "bottom-start", { floatingStyles: r } = tr(o, l, {
2497
- placement: n,
2498
- whileElementsMounted: Yl,
2499
- middleware: [Ll(6), Zl(), Ql({ padding: 6 })]
431
+ setup(s) {
432
+ const a = s, r = D(null), l = D(null), t = a.position === "left" ? "bottom-end" : "bottom-start", { floatingStyles: i } = ve(r, l, {
433
+ placement: t,
434
+ whileElementsMounted: _e,
435
+ middleware: [xe(6), Ce(), we({ padding: 6 })]
2500
436
  });
2501
- return (i, u) => (C(), U(_(ml), {
437
+ return (f, $) => (o(), k(d(ce), {
2502
438
  as: "div",
2503
439
  class: "inline-block text-left"
2504
440
  }, {
2505
- default: z(() => [
2506
- j(_(vl), {
441
+ default: h(() => [
442
+ y(d(fe), {
2507
443
  class: "focus:outline-none",
2508
444
  ref_key: "reference",
2509
- ref: o
445
+ ref: r
2510
446
  }, {
2511
- default: z(() => [
2512
- ht(i.$slots, "button", {}, () => [
2513
- j(_(q), {
447
+ default: h(() => [
448
+ U(f.$slots, "button", {}, () => [
449
+ y(d(x), {
2514
450
  class: "fill-current",
2515
451
  name: "ellipsis-h"
2516
452
  })
@@ -2518,17 +454,17 @@ const Pr = /* @__PURE__ */ T({
2518
454
  ]),
2519
455
  _: 3
2520
456
  }, 512),
2521
- (C(), U(Bn, {
2522
- to: typeof i.usePortal == "string" ? i.usePortal : "body",
2523
- disabled: !i.usePortal
457
+ (o(), k(se, {
458
+ to: typeof f.usePortal == "string" ? f.usePortal : "body",
459
+ disabled: !f.usePortal
2524
460
  }, [
2525
- A("div", {
461
+ c("div", {
2526
462
  class: "w-56 z-20",
2527
- style: Nt(_(r)),
463
+ style: G(d(i)),
2528
464
  ref_key: "floating",
2529
465
  ref: l
2530
466
  }, [
2531
- j(Bt, {
467
+ y(O, {
2532
468
  "enter-active-class": "transition duration-200 ease-in-out",
2533
469
  "enter-from-class": "transform -translate-y-4 opacity-0",
2534
470
  "enter-to-class": "transform opacity-100",
@@ -2536,14 +472,14 @@ const Pr = /* @__PURE__ */ T({
2536
472
  "leave-from-class": "transform opacity-100",
2537
473
  "leave-to-class": "transform -translate-y-2 opacity-0"
2538
474
  }, {
2539
- default: z(() => [
2540
- j(_(gl), {
2541
- class: F([
475
+ default: h(() => [
476
+ y(d(me), {
477
+ class: b([
2542
478
  "z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"
2543
479
  ])
2544
480
  }, {
2545
- default: z(() => [
2546
- ht(i.$slots, "default")
481
+ default: h(() => [
482
+ U(f.$slots, "default")
2547
483
  ]),
2548
484
  _: 3
2549
485
  })
@@ -2556,10 +492,10 @@ const Pr = /* @__PURE__ */ T({
2556
492
  _: 3
2557
493
  }));
2558
494
  }
2559
- }), nr = {
495
+ }), Ne = {
2560
496
  key: 0,
2561
497
  class: "bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"
2562
- }, _r = /* @__PURE__ */ T({
498
+ }, xa = /* @__PURE__ */ v({
2563
499
  __name: "MenuLink",
2564
500
  props: {
2565
501
  label: {},
@@ -2567,18 +503,18 @@ const Pr = /* @__PURE__ */ T({
2567
503
  disabled: { type: Boolean },
2568
504
  as: {}
2569
505
  },
2570
- setup(e) {
2571
- return (t, o) => (C(), U(_(bl), jn(Hn({ disabled: t.disabled })), {
2572
- default: z(({ active: l }) => [
2573
- (C(), U(zn(t.as || "span"), {
2574
- class: F(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
506
+ setup(s) {
507
+ return (a, r) => (o(), k(d(pe), oe(ne({ disabled: a.disabled })), {
508
+ default: h(({ active: l }) => [
509
+ (o(), k(re(a.as || "span"), {
510
+ class: b(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg", [
2575
511
  l ? "bg-grey-200" : "",
2576
- t.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
512
+ a.disabled ? "opacity-50 pointer-events-none" : "hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"
2577
513
  ]])
2578
514
  }, {
2579
- default: z(() => [
2580
- A("span", null, X(t.label), 1),
2581
- t.meta ? (C(), I("span", nr, X(t.meta), 1)) : M("", !0)
515
+ default: h(() => [
516
+ c("span", null, C(a.label), 1),
517
+ a.meta ? (o(), u("span", Ne, C(a.meta), 1)) : m("", !0)
2582
518
  ]),
2583
519
  _: 2
2584
520
  }, 1032, ["class"]))
@@ -2586,19 +522,19 @@ const Pr = /* @__PURE__ */ T({
2586
522
  _: 1
2587
523
  }, 16));
2588
524
  }
2589
- }), or = { class: "relative" }, lr = {
525
+ }), Ge = { class: "relative" }, Oe = {
2590
526
  key: 0,
2591
527
  class: "absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"
2592
- }, rr = {
528
+ }, Ze = {
2593
529
  key: 1,
2594
530
  class: "block truncate"
2595
- }, ir = ["innerHTML"], ar = {
531
+ }, Qe = ["innerHTML"], qe = {
2596
532
  key: 2,
2597
533
  class: "text-grey-500 truncate"
2598
- }, sr = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, ur = { class: "absolute right-2 inset-y-0 flex items-center" }, cr = {
534
+ }, We = { class: "absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none" }, Je = { class: "absolute right-2 inset-y-0 flex items-center" }, Ke = {
2599
535
  key: 0,
2600
536
  class: "bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"
2601
- }, dr = ["innerHTML"], Lr = /* @__PURE__ */ T({
537
+ }, Xe = ["innerHTML"], Ca = /* @__PURE__ */ v({
2602
538
  __name: "Select",
2603
539
  props: {
2604
540
  id: {},
@@ -2611,44 +547,51 @@ const Pr = /* @__PURE__ */ T({
2611
547
  disabledBadge: {}
2612
548
  },
2613
549
  emits: ["update:modelValue"],
2614
- setup(e, { emit: t }) {
2615
- const o = e, l = O(o.modelValue ?? null), n = t, { inputClasses: r, disabledClasses: i, textSizeClasses: u } = rt(o);
2616
- J(
2617
- () => o.modelValue,
2618
- (a) => {
2619
- l.value = a ?? null;
550
+ setup(s, { emit: a }) {
551
+ const r = s, l = D(r.modelValue ?? null), t = a, { inputClasses: i, disabledClasses: f, textSizeClasses: $ } = H(r), V = D(!1), L = () => {
552
+ V.value = !!r.id && !!document.getElementById(`${r.id}-label`);
553
+ };
554
+ ie(L), I(() => r.id, L, { flush: "post" });
555
+ const z = w(
556
+ () => V.value ? `${r.id}-label ${r.id}` : void 0
557
+ );
558
+ I(
559
+ () => r.modelValue,
560
+ (p) => {
561
+ l.value = p ?? null;
2620
562
  }
2621
563
  );
2622
- const c = (a) => {
2623
- l.value = a, n("update:modelValue", a);
564
+ const _ = (p) => {
565
+ l.value = p, t("update:modelValue", p);
2624
566
  };
2625
- return (a, s) => (C(), U(_(al), {
567
+ return (p, R) => (o(), k(d(be), {
2626
568
  as: "div",
2627
569
  "model-value": l.value,
2628
- "onUpdate:modelValue": c,
2629
- disabled: a.isDisabled
570
+ "onUpdate:modelValue": _,
571
+ disabled: p.isDisabled
2630
572
  }, {
2631
- default: z(() => [
2632
- A("div", or, [
2633
- j(_(sl), {
2634
- id: a.id,
2635
- class: F(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [_(r), _(u), _(i)]])
573
+ default: h(() => [
574
+ c("div", Ge, [
575
+ y(d(ge), {
576
+ id: p.id,
577
+ "aria-labelledby": z.value,
578
+ class: b(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left", [d(i), d($), d(f)]])
2636
579
  }, {
2637
- default: z(() => {
2638
- var d;
580
+ default: h(() => {
581
+ var g;
2639
582
  return [
2640
- a.icon ? (C(), I("span", lr, [
2641
- j(q, {
2642
- name: ((d = l.value) == null ? void 0 : d.icon) ?? a.icon
583
+ p.icon ? (o(), u("span", Oe, [
584
+ y(x, {
585
+ name: ((g = l.value) == null ? void 0 : g.icon) ?? p.icon
2643
586
  }, null, 8, ["name"])
2644
- ])) : M("", !0),
2645
- l.value ? (C(), I("span", rr, [
2646
- A("span", {
587
+ ])) : m("", !0),
588
+ l.value ? (o(), u("span", Ze, [
589
+ c("span", {
2647
590
  innerHTML: l.value.label
2648
- }, null, 8, ir)
2649
- ])) : (C(), I("span", ar, X(a.placeholder), 1)),
2650
- A("span", sr, [
2651
- j(q, {
591
+ }, null, 8, Qe)
592
+ ])) : (o(), u("span", qe, C(p.placeholder), 1)),
593
+ c("span", We, [
594
+ y(x, {
2652
595
  class: "text-grey-400",
2653
596
  name: "chevron-down",
2654
597
  "aria-hidden": "true"
@@ -2657,60 +600,60 @@ const Pr = /* @__PURE__ */ T({
2657
600
  ];
2658
601
  }),
2659
602
  _: 1
2660
- }, 8, ["id", "class"]),
2661
- j(Bt, {
603
+ }, 8, ["id", "aria-labelledby", "class"]),
604
+ y(O, {
2662
605
  "leave-active-class": "transition ease-in duration-100",
2663
606
  "leave-from-class": "opacity-100",
2664
607
  "leave-to-class": "opacity-0"
2665
608
  }, {
2666
- default: z(() => [
2667
- j(_(ul), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
2668
- default: z(() => [
2669
- (C(!0), I(be, null, jt(a.options, (d) => (C(), U(_(cl), {
609
+ default: h(() => [
610
+ y(d(ye), { class: "absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm" }, {
611
+ default: h(() => [
612
+ (o(!0), u(E, null, Z(p.options, (g) => (o(), k(d(he), {
2670
613
  as: "template",
2671
- key: d.id,
2672
- value: d,
2673
- disabled: d.disabled
614
+ key: g.id,
615
+ value: g,
616
+ disabled: g.disabled
2674
617
  }, {
2675
- default: z(({ active: g, selected: p }) => [
2676
- A("li", {
2677
- class: F([
2678
- g ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
618
+ default: h(({ active: M, selected: P }) => [
619
+ c("li", {
620
+ class: b([
621
+ M ? "text-white bg-blue-500" : "text-grey-900 dark:text-grey-50",
2679
622
  "cursor-default select-none relative py-2 pl-3 pr-12",
2680
- { "opacity-50 bg-grey-100": d.disabled }
623
+ { "opacity-50 bg-grey-100": g.disabled }
2681
624
  ])
2682
625
  }, [
2683
- A("div", ur, [
2684
- d.disabled && a.disabledBadge ? (C(), I("span", cr, X(a.disabledBadge), 1)) : M("", !0)
626
+ c("div", Je, [
627
+ g.disabled && p.disabledBadge ? (o(), u("span", Ke, C(p.disabledBadge), 1)) : m("", !0)
2685
628
  ]),
2686
- A("span", {
2687
- class: F([
2688
- p ? "font-semibold" : "font-normal",
629
+ c("span", {
630
+ class: b([
631
+ P ? "font-semibold" : "font-normal",
2689
632
  "block truncate"
2690
633
  ])
2691
634
  }, [
2692
- d.icon ? (C(), U(q, {
635
+ g.icon ? (o(), k(x, {
2693
636
  key: 0,
2694
637
  class: "inline-block mr-1",
2695
- name: d.icon
2696
- }, null, 8, ["name"])) : M("", !0),
2697
- A("span", {
2698
- innerHTML: d.label
2699
- }, null, 8, dr)
638
+ name: g.icon
639
+ }, null, 8, ["name"])) : m("", !0),
640
+ c("span", {
641
+ innerHTML: g.label
642
+ }, null, 8, Xe)
2700
643
  ], 2),
2701
- p ? (C(), I("span", {
644
+ P ? (o(), u("span", {
2702
645
  key: 0,
2703
- class: F([
2704
- g ? "text-blue-100" : "text-blue-500",
646
+ class: b([
647
+ M ? "text-blue-100" : "text-blue-500",
2705
648
  "absolute inset-y-0 right-0 flex items-center pr-4"
2706
649
  ])
2707
650
  }, [
2708
- j(q, {
651
+ y(x, {
2709
652
  name: "check",
2710
653
  class: "h-5 w-5",
2711
654
  "aria-hidden": "true"
2712
655
  })
2713
- ], 2)) : M("", !0)
656
+ ], 2)) : m("", !0)
2714
657
  ], 2)
2715
658
  ]),
2716
659
  _: 2
@@ -2726,19 +669,19 @@ const Pr = /* @__PURE__ */ T({
2726
669
  _: 1
2727
670
  }, 8, ["model-value", "disabled"]));
2728
671
  }
2729
- }), fr = { class: "animate-pulse" }, pr = { class: "flex items-center justify-between space-x-4" }, mr = {
672
+ }), Ye = { class: "animate-pulse" }, ea = { class: "flex items-center justify-between space-x-4" }, aa = {
2730
673
  key: 0,
2731
674
  class: "w-12 h-12 bg-current rounded-full shrink-0"
2732
- }, vr = {
675
+ }, ta = {
2733
676
  key: 1,
2734
677
  class: "w-full h-8 bg-current rounded-lg"
2735
- }, gr = {
678
+ }, la = {
2736
679
  key: 0,
2737
680
  class: "mt-6 space-y-2"
2738
- }, br = {
681
+ }, sa = {
2739
682
  key: 1,
2740
683
  class: "w-1/3 h-10 mt-6 bg-current rounded-lg"
2741
- }, Tr = /* @__PURE__ */ T({
684
+ }, wa = /* @__PURE__ */ v({
2742
685
  __name: "Skeleton",
2743
686
  props: {
2744
687
  avatar: { type: Boolean, default: !1 },
@@ -2746,71 +689,71 @@ const Pr = /* @__PURE__ */ T({
2746
689
  lines: { default: 3 },
2747
690
  footer: { type: Boolean, default: !1 }
2748
691
  },
2749
- setup(e) {
2750
- const t = e, o = new Array(t.lines).fill(void 0).map(() => {
692
+ setup(s) {
693
+ const a = s, r = new Array(a.lines).fill(void 0).map(() => {
2751
694
  const l = [4, 5, 6, 8, 10, 16, 24, 32];
2752
695
  return {
2753
696
  margin: `mr-${l[Math.floor(Math.random() * l.length)]}`
2754
697
  };
2755
698
  });
2756
- return (l, n) => (C(), I("div", fr, [
2757
- A("div", pr, [
2758
- l.avatar ? (C(), I("div", mr)) : M("", !0),
2759
- l.title ? (C(), I("div", vr)) : M("", !0)
699
+ return (l, t) => (o(), u("div", Ye, [
700
+ c("div", ea, [
701
+ l.avatar ? (o(), u("div", aa)) : m("", !0),
702
+ l.title ? (o(), u("div", ta)) : m("", !0)
2760
703
  ]),
2761
- l.lines > 0 ? (C(), I("div", gr, [
2762
- (C(!0), I(be, null, jt(_(o), (r, i) => (C(), I("div", {
2763
- class: F(["h-4 bg-current rounded-lg", r.margin]),
2764
- key: i
704
+ l.lines > 0 ? (o(), u("div", la, [
705
+ (o(!0), u(E, null, Z(d(r), (i, f) => (o(), u("div", {
706
+ class: b(["h-4 bg-current rounded-lg", i.margin]),
707
+ key: f
2765
708
  }, null, 2))), 128))
2766
- ])) : M("", !0),
2767
- l.footer ? (C(), I("div", br)) : M("", !0)
709
+ ])) : m("", !0),
710
+ l.footer ? (o(), u("div", sa)) : m("", !0)
2768
711
  ]));
2769
712
  }
2770
- }), Ir = /* @__PURE__ */ T({
713
+ }), $a = /* @__PURE__ */ v({
2771
714
  __name: "Spinner",
2772
- setup(e) {
2773
- return (t, o) => (C(), U(_(q), {
715
+ setup(s) {
716
+ return (a, r) => (o(), k(d(x), {
2774
717
  class: "animate-spin",
2775
718
  name: "circle-notch"
2776
719
  }));
2777
720
  }
2778
- }), hr = { class: "sr-only" }, Ar = /* @__PURE__ */ T({
721
+ }), oa = { class: "sr-only" }, La = /* @__PURE__ */ v({
2779
722
  __name: "Switch",
2780
723
  props: {
2781
- id: { default: () => qt() },
724
+ id: { default: () => Q() },
2782
725
  label: {},
2783
726
  modelValue: { type: Boolean },
2784
727
  onLabel: { default: "on" },
2785
728
  offLabel: { default: "off" }
2786
729
  },
2787
730
  emits: ["update:modelValue", "change"],
2788
- setup(e, { emit: t }) {
2789
- const o = t, l = (n) => {
2790
- o("update:modelValue", n), o("change", n);
731
+ setup(s, { emit: a }) {
732
+ const r = a, l = (t) => {
733
+ r("update:modelValue", t), r("change", t);
2791
734
  };
2792
- return (n, r) => (C(), U(_(yl), {
2793
- id: n.id,
2794
- modelValue: n.modelValue,
2795
- class: F([n.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
735
+ return (t, i) => (o(), k(d(ke), {
736
+ id: t.id,
737
+ modelValue: t.modelValue,
738
+ class: b([t.modelValue ? "bg-blue-700" : "bg-grey-700", "relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),
2796
739
  "onUpdate:modelValue": l
2797
740
  }, {
2798
- default: z(() => [
2799
- A("span", {
2800
- class: F(["absolute text-xs text-center text-white inset-x-2", n.modelValue ? "pr-3" : "pl-3"])
2801
- }, X(n.modelValue === !0 ? n.onLabel : n.offLabel), 3),
2802
- A("span", hr, X(n.label), 1),
2803
- A("span", {
2804
- class: F([n.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
741
+ default: h(() => [
742
+ c("span", {
743
+ class: b(["absolute text-xs text-center text-white inset-x-2", t.modelValue ? "pr-3" : "pl-3"])
744
+ }, C(t.modelValue === !0 ? t.onLabel : t.offLabel), 3),
745
+ c("span", oa, C(t.label), 1),
746
+ c("span", {
747
+ class: b([t.modelValue ? "translate-x-9" : "translate-x-1", "inline-block w-4 h-4 transition bg-white rounded-full"])
2805
748
  }, null, 2)
2806
749
  ]),
2807
750
  _: 1
2808
751
  }, 8, ["id", "modelValue", "class"]));
2809
752
  }
2810
- }), yr = { class: "relative" }, wr = ["disabled", "value"], xr = {
753
+ }), na = { class: "relative" }, ra = ["disabled", "value"], ia = {
2811
754
  inheritAttrs: !1
2812
- }, $r = /* @__PURE__ */ T({
2813
- ...xr,
755
+ }, Da = /* @__PURE__ */ v({
756
+ ...ia,
2814
757
  __name: "Textarea",
2815
758
  props: {
2816
759
  modelValue: {},
@@ -2819,43 +762,43 @@ const Pr = /* @__PURE__ */ T({
2819
762
  block: { type: Boolean }
2820
763
  },
2821
764
  emits: ["update:modelValue"],
2822
- setup(e, { expose: t, emit: o }) {
2823
- const l = e, n = o, { inputClasses: r, disabledClasses: i, textSizeClasses: u } = rt(l), c = function(d) {
2824
- n("update:modelValue", (d == null ? void 0 : d.target).value);
2825
- }, a = O(null);
2826
- return t({
765
+ setup(s, { expose: a, emit: r }) {
766
+ const l = s, t = r, { inputClasses: i, disabledClasses: f, textSizeClasses: $ } = H(l), V = function(_) {
767
+ t("update:modelValue", (_ == null ? void 0 : _.target).value);
768
+ }, L = D(null);
769
+ return a({
2827
770
  focus: () => {
2828
- l.isDisabled || a.value.focus();
771
+ l.isDisabled || L.value.focus();
2829
772
  }
2830
- }), (d, g) => (C(), I("div", yr, [
2831
- A("textarea", Ne({
2832
- class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [_(r), _(u), _(i)]],
2833
- disabled: d.isDisabled,
2834
- value: d.modelValue ?? ""
2835
- }, d.$attrs, {
773
+ }), (_, p) => (o(), u("div", na, [
774
+ c("textarea", T({
775
+ class: ["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded", [d(i), d($), d(f)]],
776
+ disabled: _.isDisabled,
777
+ value: _.modelValue ?? ""
778
+ }, _.$attrs, {
2836
779
  ref_key: "input",
2837
- ref: a,
780
+ ref: L,
2838
781
  cols: "56",
2839
782
  rows: "8",
2840
- onInput: c
783
+ onInput: V
2841
784
  }), `
2842
- `, 16, wr)
785
+ `, 16, ra)
2843
786
  ]));
2844
787
  }
2845
788
  });
2846
789
  export {
2847
- Rr as D9Button,
2848
- Er as D9Checkbox,
2849
- q as D9Icon,
2850
- Cr as D9Input,
2851
- Dr as D9Label,
2852
- Pr as D9Menu,
2853
- _r as D9MenuLink,
2854
- Lr as D9Select,
2855
- Tr as D9Skeleton,
2856
- Ir as D9Spinner,
2857
- Ar as D9Switch,
2858
- $r as D9Textarea,
2859
- wt as brands,
2860
- Kn as icons
790
+ ya as D9Button,
791
+ ha as D9Checkbox,
792
+ x as D9Icon,
793
+ ka as D9Input,
794
+ va as D9Label,
795
+ _a as D9Menu,
796
+ xa as D9MenuLink,
797
+ Ca as D9Select,
798
+ wa as D9Skeleton,
799
+ $a as D9Spinner,
800
+ La as D9Switch,
801
+ Da as D9Textarea,
802
+ N as brands,
803
+ Le as icons
2861
804
  };