lawgic-dev-kit 0.22.4 → 0.22.8
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/_virtual/index2.js +3 -2
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +2 -5
- package/dist/components/atoms/PasswordInput/PasswordInput.js +12 -12
- package/dist/components/atoms/TextInput/TextInput.js +1 -1
- package/dist/components/atoms/UncontrolledTextInput/UncontrolledTextInput.js +1 -1
- package/dist/components/molecules/AutocompleteInput/AutocompleteInput.js +1 -1
- package/dist/components/molecules/FloatingMenu/FloatingMenu.js +16 -16
- package/dist/lawgic-dev-kit.umd.js +5 -5
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/toposort/index.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const s = /* @__PURE__ */ o(t);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
s as default
|
|
5
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -11,13 +11,13 @@ const V = ({
|
|
|
11
11
|
placeholder: p,
|
|
12
12
|
className: x = "",
|
|
13
13
|
disabled: t = !1,
|
|
14
|
-
size:
|
|
14
|
+
size: m = "md",
|
|
15
15
|
leftSide: a
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
|
-
field: { value: n = "", onChange:
|
|
19
|
-
fieldState: { error:
|
|
20
|
-
} = w({ name: e, control: c }), [s, h] = y(!1), { t: u } = N(),
|
|
18
|
+
field: { value: n = "", onChange: d, ref: f, onBlur: g },
|
|
19
|
+
fieldState: { error: o }
|
|
20
|
+
} = w({ name: e, control: c }), [s, h] = y(!1), { t: u } = N(), l = {
|
|
21
21
|
sm: {
|
|
22
22
|
container: "px-16 py-8",
|
|
23
23
|
text: "text-sm",
|
|
@@ -32,17 +32,17 @@ const V = ({
|
|
|
32
32
|
error: "text-sm",
|
|
33
33
|
gap: "gap-8"
|
|
34
34
|
}
|
|
35
|
-
}[
|
|
35
|
+
}[m];
|
|
36
36
|
return /* @__PURE__ */ r.jsxs(
|
|
37
37
|
"label",
|
|
38
38
|
{
|
|
39
|
-
className: `flex flex-col group select-none ${
|
|
39
|
+
className: `flex flex-col group select-none ${l.gap} ${t && "cursor-not-allowed"} ${x}`,
|
|
40
40
|
htmlFor: e,
|
|
41
41
|
children: [
|
|
42
42
|
/* @__PURE__ */ r.jsx(
|
|
43
43
|
"h6",
|
|
44
44
|
{
|
|
45
|
-
className: `text-gray-600 font-600 group ${
|
|
45
|
+
className: `text-gray-600 font-600 group ${o && "!text-red-500"} ${l.label} ${t && "text-gray-300"}`,
|
|
46
46
|
children: i
|
|
47
47
|
}
|
|
48
48
|
),
|
|
@@ -51,9 +51,9 @@ const V = ({
|
|
|
51
51
|
{
|
|
52
52
|
htmlFor: e,
|
|
53
53
|
className: `
|
|
54
|
-
flex items-center justify-between gap-8 ${
|
|
54
|
+
flex items-center justify-between gap-8 ${l.container}
|
|
55
55
|
|
|
56
|
-
${
|
|
56
|
+
${o && "!border-red-500"}
|
|
57
57
|
|
|
58
58
|
bg-light
|
|
59
59
|
|
|
@@ -80,10 +80,10 @@ const V = ({
|
|
|
80
80
|
disabled: t,
|
|
81
81
|
placeholder: p,
|
|
82
82
|
value: n,
|
|
83
|
-
onChange: (b) =>
|
|
83
|
+
onChange: (b) => d(b.target.value),
|
|
84
84
|
onBlur: g,
|
|
85
85
|
ref: f,
|
|
86
|
-
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${
|
|
86
|
+
className: `group bg-transparent w-full h-full font-600 placeholder:font-600 ${l.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
89
|
/* @__PURE__ */ r.jsx(
|
|
@@ -97,7 +97,7 @@ const V = ({
|
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
/* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${
|
|
100
|
+
(o == null ? void 0 : o.message) && /* @__PURE__ */ r.jsx("h4", { className: `font-500 text-red-500 leading-none ${l.error}`, children: u(o.message, { x: u(e) }) })
|
|
101
101
|
]
|
|
102
102
|
}
|
|
103
103
|
);
|
|
@@ -89,7 +89,7 @@ const S = ({
|
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
/* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children:
|
|
92
|
+
(r == null ? void 0 : r.message) && /* @__PURE__ */ l.jsx("h4", { className: `font-500 text-red-500 leading-none ${o.error}`, children: s(r.message, { x: y || $ }) })
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
);
|
|
@@ -81,7 +81,7 @@ const w = ({
|
|
|
81
81
|
]
|
|
82
82
|
}
|
|
83
83
|
),
|
|
84
|
-
/* @__PURE__ */ o.jsx("h4", { className: `font-500 text-red-500 leading-none ${r.error}`, children:
|
|
84
|
+
l && /* @__PURE__ */ o.jsx("h4", { className: `font-500 text-red-500 leading-none ${r.error}`, children: x(l, { x: x(t) }) })
|
|
85
85
|
]
|
|
86
86
|
}
|
|
87
87
|
);
|
|
@@ -152,7 +152,7 @@ const ge = ({
|
|
|
152
152
|
}
|
|
153
153
|
)
|
|
154
154
|
] }),
|
|
155
|
-
/* @__PURE__ */ t.jsx("h4", { className: "font-500 text-label text-red-500 leading-none", children:
|
|
155
|
+
c && /* @__PURE__ */ t.jsx("h4", { className: "font-500 text-label text-red-500 leading-none", children: x(c, { x: x(p) }) }),
|
|
156
156
|
U && /* @__PURE__ */ t.jsx(
|
|
157
157
|
"div",
|
|
158
158
|
{
|
|
@@ -24,33 +24,33 @@ const ie = ({
|
|
|
24
24
|
strategy: p = "absolute",
|
|
25
25
|
styles: d = {},
|
|
26
26
|
offset: u = 8,
|
|
27
|
-
padding:
|
|
28
|
-
handleClickAway:
|
|
27
|
+
padding: x = 8,
|
|
28
|
+
handleClickAway: g = !0
|
|
29
29
|
}) => {
|
|
30
|
-
const [o,
|
|
30
|
+
const [o, a] = C(t);
|
|
31
31
|
P(() => {
|
|
32
|
-
|
|
32
|
+
a(t);
|
|
33
33
|
}, [t]);
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const n = () => {
|
|
35
|
+
a(!1), s == null || s();
|
|
36
36
|
}, { x: y, y: h, strategy: j, refs: l, context: r } = I({
|
|
37
37
|
strategy: p,
|
|
38
38
|
open: o,
|
|
39
39
|
onOpenChange: (R) => {
|
|
40
|
-
!R && !t &&
|
|
40
|
+
!R && !t && n();
|
|
41
41
|
},
|
|
42
|
-
middleware: [D(u), L(), T({ padding:
|
|
42
|
+
middleware: [D(u), L(), T({ padding: x })],
|
|
43
43
|
whileElementsMounted: B,
|
|
44
44
|
placement: f
|
|
45
45
|
}), b = M(r, {
|
|
46
46
|
enabled: !1
|
|
47
47
|
// Deshabilitamos el click interno ya que está controlado externamente
|
|
48
|
-
}),
|
|
48
|
+
}), w = N(r, {
|
|
49
49
|
enabled: !1
|
|
50
50
|
// Deshabilitamos dismiss cuando está controlado externamente por props
|
|
51
|
-
}), { getReferenceProps:
|
|
51
|
+
}), { getReferenceProps: k, getFloatingProps: v } = O([
|
|
52
52
|
b,
|
|
53
|
-
|
|
53
|
+
w
|
|
54
54
|
]), { isMounted: E, styles: F } = S(r, {
|
|
55
55
|
duration: {
|
|
56
56
|
open: 200,
|
|
@@ -64,16 +64,16 @@ const ie = ({
|
|
|
64
64
|
return /* @__PURE__ */ e.jsx(
|
|
65
65
|
z,
|
|
66
66
|
{
|
|
67
|
-
enabled:
|
|
67
|
+
enabled: g,
|
|
68
68
|
onClickAway: () => {
|
|
69
|
-
o &&
|
|
69
|
+
o && n();
|
|
70
70
|
},
|
|
71
71
|
children: /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
72
72
|
/* @__PURE__ */ e.jsx(
|
|
73
73
|
"div",
|
|
74
74
|
{
|
|
75
75
|
ref: l.setReference,
|
|
76
|
-
...
|
|
76
|
+
...k(),
|
|
77
77
|
className: "reference-element",
|
|
78
78
|
children: m
|
|
79
79
|
}
|
|
@@ -90,8 +90,8 @@ const ie = ({
|
|
|
90
90
|
zIndex: 999,
|
|
91
91
|
...d
|
|
92
92
|
},
|
|
93
|
-
...
|
|
94
|
-
className: "floating-element",
|
|
93
|
+
...v(),
|
|
94
|
+
className: "floating-element w-max",
|
|
95
95
|
children: /* @__PURE__ */ e.jsx(_, { className: c, children: typeof i == "function" ? A.createElement(i) : i })
|
|
96
96
|
}
|
|
97
97
|
)
|
|
@@ -664,7 +664,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
664
664
|
* Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com
|
|
665
665
|
* License - https://fontawesome.com/license (Commercial License)
|
|
666
666
|
* Copyright 2024 Fonticons, Inc.
|
|
667
|
-
*/const zD={prefix:"fas",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]},GD={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},YD={prefix:"fas",iconName:"chevron-down",icon:[512,512,[],"f078","M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},HD={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},qD={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},wb={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]};function Xa(){return typeof window<"u"}function ui(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kn(e){var t;return(t=(Sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sb(e){return Xa()?e instanceof Node||e instanceof zt(e).Node:!1}function it(e){return Xa()?e instanceof Element||e instanceof zt(e).Element:!1}function Gt(e){return Xa()?e instanceof HTMLElement||e instanceof zt(e).HTMLElement:!1}function Ad(e){return!Xa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zt(e).ShadowRoot}function _o(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function KD(e){return["table","td","th"].includes(ui(e))}function Za(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Md(e){const t=Ja(),n=it(e)?on(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function XD(e){let t=Jn(e);for(;Gt(t)&&!Zn(t);){if(Md(t))return t;if(Za(t))return null;t=Jn(t)}return null}function Ja(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(e){return["html","body","#document"].includes(ui(e))}function on(e){return zt(e).getComputedStyle(e)}function Qa(e){return it(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ad(e)&&e.host||kn(e);return Ad(t)?t.host:t}function Tb(e){const t=Jn(e);return Zn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gt(t)&&_o(t)?t:Tb(t)}function kr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Tb(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=zt(s);if(o){const c=Od(a);return t.concat(a,a.visualViewport||[],_o(s)?s:[],c&&n?kr(c):[])}return t.concat(s,kr(s,[],n))}function Od(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cb(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ad(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Eb(e,t){return["mouse","pen"].includes(e)}function ZD(e){return"nativeEvent"in e}function JD(e){return e.matches("html,body")}function Pb(e){return(e==null?void 0:e.ownerDocument)||document}function $d(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Io(e){return"composedPath"in e?e.composedPath()[0]:e.target}const QD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function e6(e){return Gt(e)&&e.matches(QD)}const jr=Math.min,Yt=Math.max,el=Math.round,tl=Math.floor,jn=e=>({x:e,y:e}),t6={left:"right",right:"left",bottom:"top",top:"bottom"},n6={start:"end",end:"start"};function _d(e,t,n){return Yt(e,jr(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function di(e){return e.split("-")[1]}function Ab(e){return e==="x"?"y":"x"}function Id(e){return e==="y"?"height":"width"}function hs(e){return["top","bottom"].includes(Lr(e))?"y":"x"}function Dd(e){return Ab(hs(e))}function r6(e,t,n){n===void 0&&(n=!1);const r=di(e),s=Dd(e),o=Id(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=nl(a)),[a,nl(a)]}function s6(e){const t=nl(e);return[Nd(e),t,Nd(t)]}function Nd(e){return e.replace(/start|end/g,t=>n6[t])}function i6(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function o6(e,t,n,r){const s=di(e);let o=i6(Lr(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Nd)))),o}function nl(e){return e.replace(/left|right|bottom|top/g,t=>t6[t])}function a6(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mb(e){return typeof e!="number"?a6(e):{top:e,right:e,bottom:e,left:e}}function rl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ob(e,t,n){let{reference:r,floating:s}=e;const o=hs(t),a=Dd(t),c=Id(a),u=Lr(t),d=o==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let x;switch(u){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}switch(di(t)){case"start":x[a]-=m*(n&&d?-1:1);break;case"end":x[a]+=m*(n&&d?-1:1);break}return x}const l6=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=Ob(d,r,u),m=r,x={},S=0;for(let b=0;b<c.length;b++){const{name:T,fn:v}=c[b],{x:A,y:C,data:I,reset:P}=await v({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:a,elements:{reference:e,floating:t}});h=A??h,p=C??p,x={...x,[T]:{...x[T],...I}},P&&S<=50&&(S++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):P.rects),{x:h,y:p}=Ob(d,m,u)),b=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}};async function kd(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:x=0}=fi(t,e),S=Mb(x),T=c[m?p==="floating"?"reference":"floating":p],v=rl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(T)))==null||n?T:T.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),A=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},P=rl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:C,strategy:u}):A);return{top:(v.top-P.top+S.top)/I.y,bottom:(P.bottom-v.bottom+S.bottom)/I.y,left:(v.left-P.left+S.left)/I.x,right:(P.right-v.right+S.right)/I.x}}const c6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:d,padding:h=0}=fi(e,t)||{};if(d==null)return{};const p=Mb(h),m={x:n,y:r},x=Dd(s),S=Id(x),b=await a.getDimensions(d),T=x==="y",v=T?"top":"left",A=T?"bottom":"right",C=T?"clientHeight":"clientWidth",I=o.reference[S]+o.reference[x]-m[x]-o.floating[S],P=m[x]-o.reference[x],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let R=D?D[C]:0;(!R||!await(a.isElement==null?void 0:a.isElement(D)))&&(R=c.floating[C]||o.floating[S]);const F=I/2-P/2,W=R/2-b[S]/2-1,Q=jr(p[v],W),ee=jr(p[A],W),ae=Q,ge=R-b[S]-ee,de=R/2-b[S]/2+F,le=_d(ae,de,ge),ue=!u.arrow&&di(s)!=null&&de!==le&&o.reference[S]/2-(de<ae?Q:ee)-b[S]/2<0,Y=ue?de<ae?de-ae:de-ge:0;return{[x]:m[x]+Y,data:{[x]:le,centerOffset:de-le-Y,...ue&&{alignmentOffset:Y}},reset:ue}}}),u6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...T}=fi(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=Lr(s),A=hs(c),C=Lr(c)===c,I=await(u.isRTL==null?void 0:u.isRTL(d.floating)),P=m||(C||!b?[nl(c)]:s6(c)),D=S!=="none";!m&&D&&P.push(...o6(c,b,S,I));const R=[c,...P],F=await kd(t,T),W=[];let Q=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&W.push(F[v]),p){const de=r6(s,a,I);W.push(F[de[0]],F[de[1]])}if(Q=[...Q,{placement:s,overflows:W}],!W.every(de=>de<=0)){var ee,ae;const de=(((ee=o.flip)==null?void 0:ee.index)||0)+1,le=R[de];if(le)return{data:{index:de,overflows:Q},reset:{placement:le}};let ue=(ae=Q.filter(Y=>Y.overflows[0]<=0).sort((Y,z)=>Y.overflows[1]-z.overflows[1])[0])==null?void 0:ae.placement;if(!ue)switch(x){case"bestFit":{var ge;const Y=(ge=Q.filter(z=>{if(D){const K=hs(z.placement);return K===A||K==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(K=>K>0).reduce((K,$)=>K+$,0)]).sort((z,K)=>z[1]-K[1])[0])==null?void 0:ge[0];Y&&(ue=Y);break}case"initialPlacement":ue=c;break}if(s!==ue)return{reset:{placement:ue}}}return{}}}};async function f6(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Lr(n),c=di(n),u=hs(n)==="y",d=["left","top"].includes(a)?-1:1,h=o&&u?-1:1,p=fi(t,e);let{mainAxis:m,crossAxis:x,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof S=="number"&&(x=c==="end"?S*-1:S),u?{x:x*h,y:m*d}:{x:m*d,y:x*h}}const d6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await f6(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},h6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:T=>{let{x:v,y:A}=T;return{x:v,y:A}}},...u}=fi(e,t),d={x:n,y:r},h=await kd(t,u),p=hs(Lr(s)),m=Ab(p);let x=d[m],S=d[p];if(o){const T=m==="y"?"top":"left",v=m==="y"?"bottom":"right",A=x+h[T],C=x-h[v];x=_d(A,x,C)}if(a){const T=p==="y"?"top":"left",v=p==="y"?"bottom":"right",A=S+h[T],C=S-h[v];S=_d(A,S,C)}const b=c.fn({...t,[m]:x,[p]:S});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:o,[p]:a}}}}}},p6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...d}=fi(e,t),h=await kd(t,d),p=Lr(s),m=di(s),x=hs(s)==="y",{width:S,height:b}=o.floating;let T,v;p==="top"||p==="bottom"?(T=p,v=m===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,T=m==="end"?"top":"bottom");const A=b-h.top-h.bottom,C=S-h.left-h.right,I=jr(b-h[T],A),P=jr(S-h[v],C),D=!t.middlewareData.shift;let R=I,F=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=A),D&&!m){const Q=Yt(h.left,0),ee=Yt(h.right,0),ae=Yt(h.top,0),ge=Yt(h.bottom,0);x?F=S-2*(Q!==0||ee!==0?Q+ee:Yt(h.left,h.right)):R=b-2*(ae!==0||ge!==0?ae+ge:Yt(h.top,h.bottom))}await u({...t,availableWidth:F,availableHeight:R});const W=await a.getDimensions(c.floating);return S!==W.width||b!==W.height?{reset:{rects:!0}}:{}}}};function $b(e){const t=on(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Gt(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=el(n)!==o||el(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function jd(e){return it(e)?e:e.contextElement}function hi(e){const t=jd(e);if(!Gt(t))return jn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=$b(t);let a=(o?el(n.width):n.width)/r,c=(o?el(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const m6=jn(0);function _b(e){const t=zt(e);return!Ja()||!t.visualViewport?m6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function g6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zt(e)?!1:t}function ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=jd(e);let a=jn(1);t&&(r?it(r)&&(a=hi(r)):a=hi(e));const c=g6(o,n,r)?_b(o):jn(0);let u=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(o){const m=zt(o),x=r&&it(r)?zt(r):r;let S=m,b=Od(S);for(;b&&r&&x!==S;){const T=hi(b),v=b.getBoundingClientRect(),A=on(b),C=v.left+(b.clientLeft+parseFloat(A.paddingLeft))*T.x,I=v.top+(b.clientTop+parseFloat(A.paddingTop))*T.y;u*=T.x,d*=T.y,h*=T.x,p*=T.y,u+=C,d+=I,S=zt(b),b=Od(S)}}return rl({width:h,height:p,x:u,y:d})}function Ld(e,t){const n=Qa(e).scrollLeft;return t?t.left+n:ps(kn(e)).left+n}function Ib(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:Ld(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function y6(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=kn(r),c=t?Za(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=jn(1);const h=jn(0),p=Gt(r);if((p||!p&&!o)&&((ui(r)!=="body"||_o(a))&&(u=Qa(r)),Gt(r))){const x=ps(r);d=hi(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const m=a&&!p&&!o?Ib(a,u,!0):jn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-u.scrollTop*d.y+h.y+m.y}}function x6(e){return Array.from(e.getClientRects())}function v6(e){const t=kn(e),n=Qa(e),r=e.ownerDocument.body,s=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ld(e);const c=-n.scrollTop;return on(r).direction==="rtl"&&(a+=Yt(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}function b6(e,t){const n=zt(e),r=kn(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const d=Ja();(!d||d&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:c,y:u}}function w6(e,t){const n=ps(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Gt(e)?hi(e):jn(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:a,height:c,x:u,y:d}}function Db(e,t,n){let r;if(t==="viewport")r=b6(e,n);else if(t==="document")r=v6(kn(e));else if(it(t))r=w6(t,n);else{const s=_b(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return rl(r)}function Nb(e,t){const n=Jn(e);return n===t||!it(n)||Zn(n)?!1:on(n).position==="fixed"||Nb(n,t)}function S6(e,t){const n=t.get(e);if(n)return n;let r=kr(e,[],!1).filter(c=>it(c)&&ui(c)!=="body"),s=null;const o=on(e).position==="fixed";let a=o?Jn(e):e;for(;it(a)&&!Zn(a);){const c=on(a),u=Md(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||_o(a)&&!u&&Nb(e,a))?r=r.filter(h=>h!==a):s=c,a=Jn(a)}return t.set(e,r),r}function T6(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Za(t)?[]:S6(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((d,h)=>{const p=Db(t,h,s);return d.top=Yt(p.top,d.top),d.right=jr(p.right,d.right),d.bottom=jr(p.bottom,d.bottom),d.left=Yt(p.left,d.left),d},Db(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function C6(e){const{width:t,height:n}=$b(e);return{width:t,height:n}}function E6(e,t,n){const r=Gt(t),s=kn(t),o=n==="fixed",a=ps(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=jn(0);if(r||!r&&!o)if((ui(t)!=="body"||_o(s))&&(c=Qa(t)),r){const m=ps(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else s&&(u.x=Ld(s));const d=s&&!r&&!o?Ib(s,c):jn(0),h=a.left+c.scrollLeft-u.x-d.x,p=a.top+c.scrollTop-u.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function Rd(e){return on(e).position==="static"}function kb(e,t){if(!Gt(e)||on(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kn(e)===n&&(n=n.ownerDocument.body),n}function jb(e,t){const n=zt(e);if(Za(e))return n;if(!Gt(e)){let s=Jn(e);for(;s&&!Zn(s);){if(it(s)&&!Rd(s))return s;s=Jn(s)}return n}let r=kb(e,t);for(;r&&KD(r)&&Rd(r);)r=kb(r,t);return r&&Zn(r)&&Rd(r)&&!Md(r)?n:r||XD(e)||n}const P6=async function(e){const t=this.getOffsetParent||jb,n=this.getDimensions,r=await n(e.floating);return{reference:E6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A6(e){return on(e).direction==="rtl"}const M6={convertOffsetParentRelativeRectToViewportRelativeRect:y6,getDocumentElement:kn,getClippingRect:T6,getOffsetParent:jb,getElementRects:P6,getClientRects:x6,getDimensions:C6,getScale:hi,isElement:it,isRTL:A6};function Lb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function O6(e,t){let n=null,r;const s=kn(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:h,top:p,width:m,height:x}=d;if(c||t(),!m||!x)return;const S=tl(p),b=tl(s.clientWidth-(h+m)),T=tl(s.clientHeight-(p+x)),v=tl(h),C={rootMargin:-S+"px "+-b+"px "+-T+"px "+-v+"px",threshold:Yt(0,jr(1,u))||1};let I=!0;function P(D){const R=D[0].intersectionRatio;if(R!==u){if(!I)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!Lb(d,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(P,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return a(!0),o}function Qn(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=jd(e),h=s||o?[...d?kr(d):[],...kr(t)]:[];h.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const p=d&&c?O6(d,n):null;let m=-1,x=null;a&&(x=new ResizeObserver(v=>{let[A]=v;A&&A.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),d&&!u&&x.observe(d),x.observe(t));let S,b=u?ps(e):null;u&&T();function T(){const v=ps(e);b&&!Lb(b,v)&&n(),b=v,S=requestAnimationFrame(T)}return n(),()=>{var v;h.forEach(A=>{s&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),p==null||p(),(v=x)==null||v.disconnect(),x=null,u&&cancelAnimationFrame(S)}}const $6=d6,_6=h6,I6=u6,D6=p6,Rb=c6,N6=(e,t,n)=>{const r=new Map,s={platform:M6,...n},o={...s.platform,_c:r};return l6(e,t,{...s,platform:o})};var sl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function il(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!il(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!il(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Fb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vb(e,t){const n=Fb(e);return Math.round(t*n)/n}function Fd(e){const t=he.useRef(e);return sl(()=>{t.current=e}),t}function k6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,p]=he.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,x]=he.useState(r);il(m,r)||x(r);const[S,b]=he.useState(null),[T,v]=he.useState(null),A=he.useCallback(z=>{z!==D.current&&(D.current=z,b(z))},[]),C=he.useCallback(z=>{z!==R.current&&(R.current=z,v(z))},[]),I=o||S,P=a||T,D=he.useRef(null),R=he.useRef(null),F=he.useRef(h),W=u!=null,Q=Fd(u),ee=Fd(s),ae=Fd(d),ge=he.useCallback(()=>{if(!D.current||!R.current)return;const z={placement:t,strategy:n,middleware:m};ee.current&&(z.platform=ee.current),N6(D.current,R.current,z).then(K=>{const $={...K,isPositioned:ae.current!==!1};de.current&&!il(F.current,$)&&(F.current=$,uT.flushSync(()=>{p($)}))})},[m,t,n,ee,ae]);sl(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const de=he.useRef(!1);sl(()=>(de.current=!0,()=>{de.current=!1}),[]),sl(()=>{if(I&&(D.current=I),P&&(R.current=P),I&&P){if(Q.current)return Q.current(I,P,ge);ge()}},[I,P,ge,Q,W]);const le=he.useMemo(()=>({reference:D,floating:R,setReference:A,setFloating:C}),[A,C]),ue=he.useMemo(()=>({reference:I,floating:P}),[I,P]),Y=he.useMemo(()=>{const z={position:n,left:0,top:0};if(!ue.floating)return z;const K=Vb(ue.floating,h.x),$=Vb(ue.floating,h.y);return c?{...z,transform:"translate("+K+"px, "+$+"px)",...Fb(ue.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:$}},[n,c,ue.floating,h.x,h.y]);return he.useMemo(()=>({...h,update:ge,refs:le,elements:ue,floatingStyles:Y}),[h,ge,le,ue,Y])}const j6=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rb({element:r.current,padding:s}).fn(n):{}:r?Rb({element:r,padding:s}).fn(n):{}}}},er=(e,t)=>({...$6(e),options:[e,t]}),tr=(e,t)=>({..._6(e),options:[e,t]}),nr=(e,t)=>({...I6(e),options:[e,t]}),Rr=(e,t)=>({...D6(e),options:[e,t]}),ms=(e,t)=>({...j6(e),options:[e,t]}),Bb={...he},L6=Bb.useInsertionEffect||(e=>e());function pi(e){const t=he.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return L6(()=>{t.current=e}),he.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}var mi=typeof document<"u"?O.useLayoutEffect:O.useEffect;let Wb=!1,R6=0;const Ub=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+R6++;function F6(){const[e,t]=he.useState(()=>Wb?Ub():void 0);return mi(()=>{e==null&&t(Ub())},[]),he.useEffect(()=>{Wb=!0},[]),e}const V6=Bb.useId||F6;let Vd;process.env.NODE_ENV!=="production"&&(Vd=new Set);function B6(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s="Floating UI: "+n.join(" ");if(!((e=Vd)!=null&&e.has(s))){var o;(o=Vd)==null||o.add(s),console.error(s)}}function W6(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(s=>s!==n))||[])}}}const U6=he.createContext(null),z6=he.createContext(null),G6=()=>{var e;return((e=he.useContext(U6))==null?void 0:e.id)||null},zb=()=>he.useContext(z6);function Y6(e){return"data-floating-ui-"+e}function ol(e){const t=O.useRef(e);return mi(()=>{t.current=e}),t}function Bd(e,t){let n=e.filter(s=>{var o;return s.parentId===t&&((o=s.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(s=>{var o;return(o=r)==null?void 0:o.some(a=>{var c;return s.parentId===a.id&&((c=s.context)==null?void 0:c.open)})}),n=n.concat(r);return n}const H6="data-floating-ui-focusable";function Gb(e){return Gt(e.target)&&e.target.tagName==="BUTTON"}function Yb(e){return e6(e)}function rr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:s,elements:{domReference:o}}=e,{enabled:a=!0,event:c="click",toggle:u=!0,ignoreMouse:d=!1,keyboardHandlers:h=!0,stickIfOpen:p=!0}=t,m=he.useRef(),x=he.useRef(!1),S=he.useMemo(()=>({onPointerDown(b){m.current=b.pointerType},onMouseDown(b){const T=m.current;b.button===0&&c!=="click"&&(Eb(T)&&d||(n&&u&&(!(s.current.openEvent&&p)||s.current.openEvent.type==="mousedown")?r(!1,b.nativeEvent,"click"):(b.preventDefault(),r(!0,b.nativeEvent,"click"))))},onClick(b){const T=m.current;if(c==="mousedown"&&m.current){m.current=void 0;return}Eb(T)&&d||(n&&u&&(!(s.current.openEvent&&p)||s.current.openEvent.type==="click")?r(!1,b.nativeEvent,"click"):r(!0,b.nativeEvent,"click"))},onKeyDown(b){m.current=void 0,!(b.defaultPrevented||!h||Gb(b))&&(b.key===" "&&!Yb(o)&&(b.preventDefault(),x.current=!0),b.key==="Enter"&&r(!(n&&u),b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!h||Gb(b)||Yb(o)||b.key===" "&&x.current&&(x.current=!1,r(!(n&&u),b.nativeEvent,"click"))}}),[s,o,c,d,h,r,n,p,u]);return he.useMemo(()=>a?{reference:S}:{},[a,S])}const q6={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},K6={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Hb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function sr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:s,dataRef:o}=e,{enabled:a=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:x,capture:S}=t,b=zb(),T=pi(typeof u=="function"?u:()=>!1),v=typeof u=="function"?T:u,A=he.useRef(!1),C=he.useRef(!1),{escapeKey:I,outsidePress:P}=Hb(x),{escapeKey:D,outsidePress:R}=Hb(S),F=he.useRef(!1),W=pi(le=>{var ue;if(!n||!a||!c||le.key!=="Escape"||F.current)return;const Y=(ue=o.current.floatingContext)==null?void 0:ue.nodeId,z=b?Bd(b.nodesRef.current,Y):[];if(!I&&(le.stopPropagation(),z.length>0)){let K=!0;if(z.forEach($=>{var k;if((k=$.context)!=null&&k.open&&!$.context.dataRef.current.__escapeKeyBubbles){K=!1;return}}),!K)return}r(!1,ZD(le)?le.nativeEvent:le,"escape-key")}),Q=pi(le=>{var ue;const Y=()=>{var z;W(le),(z=Io(le))==null||z.removeEventListener("keydown",Y)};(ue=Io(le))==null||ue.addEventListener("keydown",Y)}),ee=pi(le=>{var ue;const Y=A.current;A.current=!1;const z=C.current;if(C.current=!1,d==="click"&&z||Y||typeof v=="function"&&!v(le))return;const K=Io(le),$="["+Y6("inert")+"]",k=Pb(s.floating).querySelectorAll($);let X=it(K)?K:null;for(;X&&!Zn(X);){const J=Jn(X);if(Zn(J)||!it(J))break;X=J}if(k.length&&it(K)&&!JD(K)&&!Cb(K,s.floating)&&Array.from(k).every(J=>!Cb(X,J)))return;if(Gt(K)&&de){const J=Zn(K),oe=on(K),se=/auto|scroll/,fe=J||se.test(oe.overflowX),Ee=J||se.test(oe.overflowY),Ve=fe&&K.clientWidth>0&&K.scrollWidth>K.clientWidth,ie=Ee&&K.clientHeight>0&&K.scrollHeight>K.clientHeight,me=oe.direction==="rtl",De=ie&&(me?le.offsetX<=K.offsetWidth-K.clientWidth:le.offsetX>K.clientWidth),ft=Ve&&le.offsetY>K.clientHeight;if(De||ft)return}const U=(ue=o.current.floatingContext)==null?void 0:ue.nodeId,re=b&&Bd(b.nodesRef.current,U).some(J=>{var oe;return $d(le,(oe=J.context)==null?void 0:oe.elements.floating)});if($d(le,s.floating)||$d(le,s.domReference)||re)return;const B=b?Bd(b.nodesRef.current,U):[];if(B.length>0){let J=!0;if(B.forEach(oe=>{var se;if((se=oe.context)!=null&&se.open&&!oe.context.dataRef.current.__outsidePressBubbles){J=!1;return}}),!J)return}r(!1,le,"outside-press")}),ae=pi(le=>{var ue;const Y=()=>{var z;ee(le),(z=Io(le))==null||z.removeEventListener(d,Y)};(ue=Io(le))==null||ue.addEventListener(d,Y)});he.useEffect(()=>{if(!n||!a)return;o.current.__escapeKeyBubbles=I,o.current.__outsidePressBubbles=P;let le=-1;function ue(k){r(!1,k,"ancestor-scroll")}function Y(){window.clearTimeout(le),F.current=!0}function z(){le=window.setTimeout(()=>{F.current=!1},Ja()?5:0)}const K=Pb(s.floating);c&&(K.addEventListener("keydown",D?Q:W,D),K.addEventListener("compositionstart",Y),K.addEventListener("compositionend",z)),v&&K.addEventListener(d,R?ae:ee,R);let $=[];return m&&(it(s.domReference)&&($=kr(s.domReference)),it(s.floating)&&($=$.concat(kr(s.floating))),!it(s.reference)&&s.reference&&s.reference.contextElement&&($=$.concat(kr(s.reference.contextElement)))),$=$.filter(k=>{var X;return k!==((X=K.defaultView)==null?void 0:X.visualViewport)}),$.forEach(k=>{k.addEventListener("scroll",ue,{passive:!0})}),()=>{c&&(K.removeEventListener("keydown",D?Q:W,D),K.removeEventListener("compositionstart",Y),K.removeEventListener("compositionend",z)),v&&K.removeEventListener(d,R?ae:ee,R),$.forEach(k=>{k.removeEventListener("scroll",ue)}),window.clearTimeout(le)}},[o,s,c,v,d,n,r,m,a,I,P,W,D,Q,ee,R,ae]),he.useEffect(()=>{A.current=!1},[v,d]);const ge=he.useMemo(()=>({onKeyDown:W,...h&&{[q6[p]]:le=>{r(!1,le.nativeEvent,"reference-press")},...p!=="click"&&{onClick(le){r(!1,le.nativeEvent,"reference-press")}}}}),[W,r,h,p]),de=he.useMemo(()=>({onKeyDown:W,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[K6[d]]:()=>{A.current=!0}}),[W,d]);return he.useMemo(()=>a?{reference:ge,floating:de}:{},[a,ge,de])}function X6(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=V6(),o=he.useRef({}),[a]=he.useState(()=>W6()),c=G6()!=null;if(process.env.NODE_ENV!=="production"){const x=r.reference;x&&!it(x)&&B6("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,d]=he.useState(r.reference),h=pi((x,S,b)=>{o.current.openEvent=x?S:void 0,a.emit("openchange",{open:x,event:S,reason:b,nested:c}),n==null||n(x,S,b)}),p=he.useMemo(()=>({setPositionReference:d}),[]),m=he.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return he.useMemo(()=>({dataRef:o,open:t,onOpenChange:h,elements:m,events:a,floatingId:s,refs:p}),[t,h,m,a,s,p])}function ir(e){e===void 0&&(e={});const{nodeId:t}=e,n=X6({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[o,a]=he.useState(null),[c,u]=he.useState(null),h=(s==null?void 0:s.domReference)||o,p=he.useRef(null),m=zb();mi(()=>{h&&(p.current=h)},[h]);const x=k6({...e,elements:{...s,...c&&{reference:c}}}),S=he.useCallback(C=>{const I=it(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),contextElement:C}:C;u(I),x.refs.setReference(I)},[x.refs]),b=he.useCallback(C=>{(it(C)||C===null)&&(p.current=C,a(C)),(it(x.refs.reference.current)||x.refs.reference.current===null||C!==null&&!it(C))&&x.refs.setReference(C)},[x.refs]),T=he.useMemo(()=>({...x.refs,setReference:b,setPositionReference:S,domReference:p}),[x.refs,b,S]),v=he.useMemo(()=>({...x.elements,domReference:h}),[x.elements,h]),A=he.useMemo(()=>({...x,...r,refs:T,elements:v,nodeId:t}),[x,T,v,t,r]);return mi(()=>{r.dataRef.current.floatingContext=A;const C=m==null?void 0:m.nodesRef.current.find(I=>I.id===t);C&&(C.context=A)}),he.useMemo(()=>({...x,context:A,refs:T,elements:v}),[x,T,v,A])}const qb="active",Kb="selected";function Wd(e,t,n){const r=new Map,s=n==="item";let o=e;if(s&&e){const{[qb]:a,[Kb]:c,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1,[H6]:""},...o,...t.map(a=>{const c=a?a[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((a,c)=>(c&&Object.entries(c).forEach(u=>{let[d,h]=u;if(!(s&&[qb,Kb].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof h=="function"){var p;(p=r.get(d))==null||p.push(h),a[d]=function(){for(var m,x=arguments.length,S=new Array(x),b=0;b<x;b++)S[b]=arguments[b];return(m=r.get(d))==null?void 0:m.map(T=>T(...S)).find(T=>T!==void 0)}}}else a[d]=h}),a),{})}}function or(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),s=he.useCallback(c=>Wd(c,e,"reference"),t),o=he.useCallback(c=>Wd(c,e,"floating"),n),a=he.useCallback(c=>Wd(c,e,"item"),r);return he.useMemo(()=>({getReferenceProps:s,getFloatingProps:o,getItemProps:a}),[s,o,a])}const Xb=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function gi(e,t){return typeof e=="function"?e(t):e}function Z6(e,t){const[n,r]=he.useState(e);return e&&!n&&r(!0),he.useEffect(()=>{if(!e&&n){const s=setTimeout(()=>r(!1),t);return()=>clearTimeout(s)}},[e,n,t]),n}function J6(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:s=250}=t,a=(typeof s=="number"?s:s.close)||0,[c,u]=he.useState("unmounted"),d=Z6(n,a);return!d&&c==="close"&&u("unmounted"),mi(()=>{if(r){if(n){u("initial");const h=requestAnimationFrame(()=>{u("open")});return()=>{cancelAnimationFrame(h)}}u("close")}},[n,r]),{isMounted:d,status:c}}function ar(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:s,common:o,duration:a=250}=t,c=e.placement,u=c.split("-")[0],d=he.useMemo(()=>({side:u,placement:c}),[u,c]),h=typeof a=="number",p=(h?a:a.open)||0,m=(h?a:a.close)||0,[x,S]=he.useState(()=>({...gi(o,d),...gi(n,d)})),{isMounted:b,status:T}=J6(e,{duration:a}),v=ol(n),A=ol(r),C=ol(s),I=ol(o);return mi(()=>{const P=gi(v.current,d),D=gi(C.current,d),R=gi(I.current,d),F=gi(A.current,d)||Object.keys(P).reduce((W,Q)=>(W[Q]="",W),{});if(T==="initial"&&S(W=>({transitionProperty:W.transitionProperty,...R,...P})),T==="open"&&S({transitionProperty:Object.keys(F).map(Xb).join(","),transitionDuration:p+"ms",...R,...F}),T==="close"){const W=D||P;S({transitionProperty:Object.keys(W).map(Xb).join(","),transitionDuration:m+"ms",...R,...W})}},[m,C,v,A,I,p,T,d]),{isMounted:b,styles:x}}const gs=({open:e,onClose:t,component:n,children:r,placement:s="bottom",className:o="",strategy:a="absolute",styles:c={},offset:u=8,padding:d=8,handleClickAway:h=!0})=>{const[p,m]=O.useState(e);O.useEffect(()=>{m(e)},[e]);const x=()=>{m(!1),t==null||t()},{x:S,y:b,strategy:T,refs:v,context:A}=ir({strategy:a,open:p,onOpenChange:W=>{!W&&!e&&x()},middleware:[er(u),nr(),tr({padding:d})],whileElementsMounted:Qn,placement:s}),C=rr(A,{enabled:!1}),I=sr(A,{enabled:!1}),{getReferenceProps:P,getFloatingProps:D}=or([C,I]),{isMounted:R,styles:F}=ar(A,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px) scale(0.95)"}});return g.jsx(D2,{enabled:h,onClickAway:()=>{p&&x()},children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{ref:v.setReference,...P(),className:"reference-element",children:r}),R&&g.jsx("div",{ref:v.setFloating,style:{position:T,top:b??0,left:S??0,...F,zIndex:999,...c},...D(),className:"floating-element",children:g.jsx(yi,{className:o,children:typeof n=="function"?O.createElement(n):n})})]})})},Q6=({selectedPeriod:e,handlePeriodChange:t,colorVariants:n})=>{const r={initial:{backgroundColor:"#ffffff",color:"#57595f"},active:{backgroundColor:(n==null?void 0:n.hoverLight)||"#dee7fc",color:(n==null?void 0:n.text)||"#111827"},exit:{backgroundColor:"#ffffff",color:"#57595f"}};return g.jsxs("div",{className:"flex rounded-xl p-6 gap-2 border",style:{borderColor:(n==null?void 0:n.hoverLight)||"#dbeafe"},children:[g.jsx(st.button,{variants:r,initial:"initial",animate:e==="AM"?"active":"initial",exit:"exit",transition:{duration:.2},onClick:()=>t("AM"),disabled:e==="AM",className:"flex items-center justify-center font-500 px-10 py-2 rounded-lg",children:"AM"}),g.jsx(st.button,{variants:r,initial:"initial",animate:e==="PM"?"active":"initial",exit:"exit",transition:{duration:.2},onClick:()=>t("PM"),disabled:e==="PM",className:"flex items-center justify-center font-500 px-10 py-2 rounded-lg",children:"PM"})]})},eN=({setHourMenuOpen:e,hourMenuOpen:t,selectedHour:n})=>g.jsx("button",{onClick:()=>e(!t),className:"flex justify-center items-center w-72 h-full border py-8 px-14 rounded-xl border-blue-100 text-gray-600 font-500",children:`${String(n).padStart(2,"0")}:00`}),tN={primary:"#375ABC",primaryLight:"#8FA9F3",primaryDark:"#29438D",hover:"#4570EB",hoverLight:"#ECF1FD",text:"#375ABC",textLight:"#FFFFFF"},nN={primary:"#06B6D4",primaryLight:"#67E8F9",primaryDark:"#0891B2",hover:"#0891B2",hoverLight:"#CFFAFE",text:"#06B6D4",textLight:"#FFFFFF"},rN=e=>({blue:tN,aqua:nN})[e],Ud=({date:e,onDateChange:t,showTimeSelector:n=!0,minDate:r,maxDate:s,futureDates:o=!1,pastDates:a=!0,color:c="blue"})=>{const[u,d]=O.useState(e),[h,p]=O.useState(e),[m,x]=O.useState(e.getHours()%12||12),[S,b]=O.useState(e.getHours()>=12?"PM":"AM"),[T,v]=O.useState(0),{t:A}=Ue(),C=rN(c),[I,P]=O.useState(!1),[D,R]=O.useState(!1);O.useEffect(()=>{d(e),p(e),x(e.getHours()%12||12),b(e.getHours()>=12?"PM":"AM")},[e]);const F=()=>{v(-1),setTimeout(()=>{const z=A$(u);(!r||z>=r)&&d(z)},10)},W=()=>{v(1),setTimeout(()=>{d(ix(u,1))},10)},Q=z=>{if(s&&z>s||r&&z<r)return;const K=yx(xx(vx(z,0),0),S==="AM"?m%12:m%12+12);p(K),t(K)},ee=z=>{x(z);const K=yx(xx(vx(h,0),0),S==="AM"?z%12:z%12+12);p(K),t(K),P(!1)},ae=z=>{b(z)},ge=()=>{const z=new Date,K=20,$=5,[k,X]=O.useState(()=>Array.from({length:K+1},(J,oe)=>{const se=new Date(z.getFullYear(),z.getMonth()-oe,1);return{name:_n(se,"MMMM",{locale:Js}).replace(/^./,fe=>fe.toUpperCase()),index:se.getMonth(),year:se.getFullYear(),displayName:`${_n(se,"MMMM",{locale:Js}).replace(/^./,fe=>fe.toUpperCase())} ${se.getFullYear()}`}})),U=O.useRef(null),re=O.useRef(null);O.useEffect(()=>{U.current&&U.current.disconnect(),U.current=new IntersectionObserver(J=>{J[0].isIntersecting&&X(oe=>{const se=oe[oe.length-1],fe=new Date(se.year,se.index-1,1),Ee=Array.from({length:$},(Ve,ie)=>{const me=new Date(fe.getFullYear(),fe.getMonth()-ie,1);return{name:_n(me,"MMMM",{locale:Js}).replace(/^./,De=>De.toUpperCase()),index:me.getMonth(),year:me.getFullYear(),displayName:`${_n(me,"MMMM",{locale:Js}).replace(/^./,De=>De.toUpperCase())} ${me.getFullYear()}`}});return[...oe,...Ee]})}),re.current&&U.current.observe(re.current)},[k]);const B=(J,oe)=>{const se=new Date(u);se.setMonth(J),se.setFullYear(oe),(!r||se>=r)&&d(se),R(!1)};return g.jsx("div",{className:"flex flex-col p-8 max-h-200 overflow-y-auto bg-light gap-4",children:k.map((J,oe)=>{const se=oe===k.length-1;return g.jsx("button",{ref:se?re:null,onClick:()=>B(J.index,J.year),className:"text-start p-6 font-600 transition-all duration-100 rounded-lg",style:{backgroundColor:u.getMonth()===J.index&&u.getFullYear()===J.year?C.hoverLight:"transparent",color:u.getMonth()===J.index&&u.getFullYear()===J.year?C.text:"inherit"},onMouseEnter:fe=>{u.getMonth()===J.index&&u.getFullYear()===J.year||(fe.currentTarget.style.backgroundColor="#F3F4F6")},onMouseLeave:fe=>{u.getMonth()===J.index&&u.getFullYear()===J.year||(fe.currentTarget.style.backgroundColor="transparent")},children:J.displayName},`${J.name}-${J.year}-${oe}`)})})},de=()=>g.jsxs("div",{className:"flex justify-between items-center mb-8",children:[g.jsx(gs,{open:D,onClose:()=>R(!1),component:ge,placement:"bottom",className:"!p-0 overflow-hidden bg-light",strategy:"fixed",children:g.jsxs("button",{onClick:()=>R(!D),className:"transition-colors duration-150 flex gap-6 items-center !text-black",children:[g.jsx("h4",{className:"text-header-4",children:_n(u,"MMMM yyyy",{locale:Js}).replace(/^./,z=>z.toUpperCase())}),g.jsx(Pe,{icon:r0,className:"w-12 h-12"})]})}),g.jsxs("div",{className:"flex items-center gap-8",children:[g.jsx(sh,{variant:"transparent",color:c,icon:qD,onClick:F}),g.jsx(sh,{variant:"transparent",color:c,icon:g4,onClick:W})]})]}),le=()=>{const z=Ks(M4(u)),K=$4(E4(u)),$=A4({start:z,end:K}),k=new Date;return k.setHours(0,0,0,0),g.jsx("div",{className:"grid grid-cols-7 gap-2",children:$.map((X,U)=>{const re=lx(X,h),B=E$(X,u),J=P$(X),oe=X<k,se=X>k,fe=!B||oe&&!a||se&&!o||r&&X<r||s&&X>s;return g.jsx(st.div,{className:`
|
|
667
|
+
*/const zD={prefix:"fas",iconName:"circle",icon:[512,512,[128308,128309,128992,128993,128994,128995,128996,9679,9898,9899,11044,61708,61915],"f111","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"]},GD={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},YD={prefix:"fas",iconName:"chevron-down",icon:[512,512,[],"f078","M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},HD={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},qD={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},wb={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"]};function Xa(){return typeof window<"u"}function ui(e){return Sb(e)?(e.nodeName||"").toLowerCase():"#document"}function zt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function kn(e){var t;return(t=(Sb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sb(e){return Xa()?e instanceof Node||e instanceof zt(e).Node:!1}function it(e){return Xa()?e instanceof Element||e instanceof zt(e).Element:!1}function Gt(e){return Xa()?e instanceof HTMLElement||e instanceof zt(e).HTMLElement:!1}function Ad(e){return!Xa()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof zt(e).ShadowRoot}function _o(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function KD(e){return["table","td","th"].includes(ui(e))}function Za(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Md(e){const t=Ja(),n=it(e)?on(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function XD(e){let t=Jn(e);for(;Gt(t)&&!Zn(t);){if(Md(t))return t;if(Za(t))return null;t=Jn(t)}return null}function Ja(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(e){return["html","body","#document"].includes(ui(e))}function on(e){return zt(e).getComputedStyle(e)}function Qa(e){return it(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jn(e){if(ui(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ad(e)&&e.host||kn(e);return Ad(t)?t.host:t}function Tb(e){const t=Jn(e);return Zn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gt(t)&&_o(t)?t:Tb(t)}function kr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Tb(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),a=zt(s);if(o){const c=Od(a);return t.concat(a,a.visualViewport||[],_o(s)?s:[],c&&n?kr(c):[])}return t.concat(s,kr(s,[],n))}function Od(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Cb(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ad(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Eb(e,t){return["mouse","pen"].includes(e)}function ZD(e){return"nativeEvent"in e}function JD(e){return e.matches("html,body")}function Pb(e){return(e==null?void 0:e.ownerDocument)||document}function $d(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Io(e){return"composedPath"in e?e.composedPath()[0]:e.target}const QD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function e6(e){return Gt(e)&&e.matches(QD)}const jr=Math.min,Yt=Math.max,el=Math.round,tl=Math.floor,jn=e=>({x:e,y:e}),t6={left:"right",right:"left",bottom:"top",top:"bottom"},n6={start:"end",end:"start"};function _d(e,t,n){return Yt(e,jr(t,n))}function fi(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function di(e){return e.split("-")[1]}function Ab(e){return e==="x"?"y":"x"}function Id(e){return e==="y"?"height":"width"}function hs(e){return["top","bottom"].includes(Lr(e))?"y":"x"}function Dd(e){return Ab(hs(e))}function r6(e,t,n){n===void 0&&(n=!1);const r=di(e),s=Dd(e),o=Id(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=nl(a)),[a,nl(a)]}function s6(e){const t=nl(e);return[Nd(e),t,Nd(t)]}function Nd(e){return e.replace(/start|end/g,t=>n6[t])}function i6(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:a;default:return[]}}function o6(e,t,n,r){const s=di(e);let o=i6(Lr(e),n==="start",r);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Nd)))),o}function nl(e){return e.replace(/left|right|bottom|top/g,t=>t6[t])}function a6(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mb(e){return typeof e!="number"?a6(e):{top:e,right:e,bottom:e,left:e}}function rl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Ob(e,t,n){let{reference:r,floating:s}=e;const o=hs(t),a=Dd(t),c=Id(a),u=Lr(t),d=o==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,m=r[c]/2-s[c]/2;let x;switch(u){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}switch(di(t)){case"start":x[a]-=m*(n&&d?-1:1);break;case"end":x[a]+=m*(n&&d?-1:1);break}return x}const l6=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,c=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=Ob(d,r,u),m=r,x={},S=0;for(let b=0;b<c.length;b++){const{name:T,fn:v}=c[b],{x:A,y:C,data:I,reset:P}=await v({x:h,y:p,initialPlacement:r,placement:m,strategy:s,middlewareData:x,rects:d,platform:a,elements:{reference:e,floating:t}});h=A??h,p=C??p,x={...x,[T]:{...x[T],...I}},P&&S<=50&&(S++,typeof P=="object"&&(P.placement&&(m=P.placement),P.rects&&(d=P.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):P.rects),{x:h,y:p}=Ob(d,m,u)),b=-1)}return{x:h,y:p,placement:m,strategy:s,middlewareData:x}};async function kd(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:a,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:x=0}=fi(t,e),S=Mb(x),T=c[m?p==="floating"?"reference":"floating":p],v=rl(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(T)))==null||n?T:T.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),A=p==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(C))?await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1}:{x:1,y:1},P=rl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:A,offsetParent:C,strategy:u}):A);return{top:(v.top-P.top+S.top)/I.y,bottom:(P.bottom-v.bottom+S.bottom)/I.y,left:(v.left-P.left+S.left)/I.x,right:(P.right-v.right+S.right)/I.x}}const c6=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:a,elements:c,middlewareData:u}=t,{element:d,padding:h=0}=fi(e,t)||{};if(d==null)return{};const p=Mb(h),m={x:n,y:r},x=Dd(s),S=Id(x),b=await a.getDimensions(d),T=x==="y",v=T?"top":"left",A=T?"bottom":"right",C=T?"clientHeight":"clientWidth",I=o.reference[S]+o.reference[x]-m[x]-o.floating[S],P=m[x]-o.reference[x],D=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let R=D?D[C]:0;(!R||!await(a.isElement==null?void 0:a.isElement(D)))&&(R=c.floating[C]||o.floating[S]);const F=I/2-P/2,W=R/2-b[S]/2-1,Q=jr(p[v],W),ee=jr(p[A],W),ae=Q,ge=R-b[S]-ee,de=R/2-b[S]/2+F,le=_d(ae,de,ge),ue=!u.arrow&&di(s)!=null&&de!==le&&o.reference[S]/2-(de<ae?Q:ee)-b[S]/2<0,Y=ue?de<ae?de-ae:de-ge:0;return{[x]:m[x]+Y,data:{[x]:le,centerOffset:de-le-Y,...ue&&{alignmentOffset:Y}},reset:ue}}}),u6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:a,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:b=!0,...T}=fi(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=Lr(s),A=hs(c),C=Lr(c)===c,I=await(u.isRTL==null?void 0:u.isRTL(d.floating)),P=m||(C||!b?[nl(c)]:s6(c)),D=S!=="none";!m&&D&&P.push(...o6(c,b,S,I));const R=[c,...P],F=await kd(t,T),W=[];let Q=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&W.push(F[v]),p){const de=r6(s,a,I);W.push(F[de[0]],F[de[1]])}if(Q=[...Q,{placement:s,overflows:W}],!W.every(de=>de<=0)){var ee,ae;const de=(((ee=o.flip)==null?void 0:ee.index)||0)+1,le=R[de];if(le)return{data:{index:de,overflows:Q},reset:{placement:le}};let ue=(ae=Q.filter(Y=>Y.overflows[0]<=0).sort((Y,z)=>Y.overflows[1]-z.overflows[1])[0])==null?void 0:ae.placement;if(!ue)switch(x){case"bestFit":{var ge;const Y=(ge=Q.filter(z=>{if(D){const K=hs(z.placement);return K===A||K==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(K=>K>0).reduce((K,$)=>K+$,0)]).sort((z,K)=>z[1]-K[1])[0])==null?void 0:ge[0];Y&&(ue=Y);break}case"initialPlacement":ue=c;break}if(s!==ue)return{reset:{placement:ue}}}return{}}}};async function f6(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Lr(n),c=di(n),u=hs(n)==="y",d=["left","top"].includes(a)?-1:1,h=o&&u?-1:1,p=fi(t,e);let{mainAxis:m,crossAxis:x,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof S=="number"&&(x=c==="end"?S*-1:S),u?{x:x*h,y:m*d}:{x:m*d,y:x*h}}const d6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:a,middlewareData:c}=t,u=await f6(t,e);return a===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},h6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:c={fn:T=>{let{x:v,y:A}=T;return{x:v,y:A}}},...u}=fi(e,t),d={x:n,y:r},h=await kd(t,u),p=hs(Lr(s)),m=Ab(p);let x=d[m],S=d[p];if(o){const T=m==="y"?"top":"left",v=m==="y"?"bottom":"right",A=x+h[T],C=x-h[v];x=_d(A,x,C)}if(a){const T=p==="y"?"top":"left",v=p==="y"?"bottom":"right",A=S+h[T],C=S-h[v];S=_d(A,S,C)}const b=c.fn({...t,[m]:x,[p]:S});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[m]:o,[p]:a}}}}}},p6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:a,elements:c}=t,{apply:u=()=>{},...d}=fi(e,t),h=await kd(t,d),p=Lr(s),m=di(s),x=hs(s)==="y",{width:S,height:b}=o.floating;let T,v;p==="top"||p==="bottom"?(T=p,v=m===(await(a.isRTL==null?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(v=p,T=m==="end"?"top":"bottom");const A=b-h.top-h.bottom,C=S-h.left-h.right,I=jr(b-h[T],A),P=jr(S-h[v],C),D=!t.middlewareData.shift;let R=I,F=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(F=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=A),D&&!m){const Q=Yt(h.left,0),ee=Yt(h.right,0),ae=Yt(h.top,0),ge=Yt(h.bottom,0);x?F=S-2*(Q!==0||ee!==0?Q+ee:Yt(h.left,h.right)):R=b-2*(ae!==0||ge!==0?ae+ge:Yt(h.top,h.bottom))}await u({...t,availableWidth:F,availableHeight:R});const W=await a.getDimensions(c.floating);return S!==W.width||b!==W.height?{reset:{rects:!0}}:{}}}};function $b(e){const t=on(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Gt(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:r,c=el(n)!==o||el(r)!==a;return c&&(n=o,r=a),{width:n,height:r,$:c}}function jd(e){return it(e)?e:e.contextElement}function hi(e){const t=jd(e);if(!Gt(t))return jn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=$b(t);let a=(o?el(n.width):n.width)/r,c=(o?el(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}const m6=jn(0);function _b(e){const t=zt(e);return!Ja()||!t.visualViewport?m6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function g6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==zt(e)?!1:t}function ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=jd(e);let a=jn(1);t&&(r?it(r)&&(a=hi(r)):a=hi(e));const c=g6(o,n,r)?_b(o):jn(0);let u=(s.left+c.x)/a.x,d=(s.top+c.y)/a.y,h=s.width/a.x,p=s.height/a.y;if(o){const m=zt(o),x=r&&it(r)?zt(r):r;let S=m,b=Od(S);for(;b&&r&&x!==S;){const T=hi(b),v=b.getBoundingClientRect(),A=on(b),C=v.left+(b.clientLeft+parseFloat(A.paddingLeft))*T.x,I=v.top+(b.clientTop+parseFloat(A.paddingTop))*T.y;u*=T.x,d*=T.y,h*=T.x,p*=T.y,u+=C,d+=I,S=zt(b),b=Od(S)}}return rl({width:h,height:p,x:u,y:d})}function Ld(e,t){const n=Qa(e).scrollLeft;return t?t.left+n:ps(kn(e)).left+n}function Ib(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:Ld(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function y6(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",a=kn(r),c=t?Za(t.floating):!1;if(r===a||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=jn(1);const h=jn(0),p=Gt(r);if((p||!p&&!o)&&((ui(r)!=="body"||_o(a))&&(u=Qa(r)),Gt(r))){const x=ps(r);d=hi(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const m=a&&!p&&!o?Ib(a,u,!0):jn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+m.x,y:n.y*d.y-u.scrollTop*d.y+h.y+m.y}}function x6(e){return Array.from(e.getClientRects())}function v6(e){const t=kn(e),n=Qa(e),r=e.ownerDocument.body,s=Yt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Yt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Ld(e);const c=-n.scrollTop;return on(r).direction==="rtl"&&(a+=Yt(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:a,y:c}}function b6(e,t){const n=zt(e),r=kn(e),s=n.visualViewport;let o=r.clientWidth,a=r.clientHeight,c=0,u=0;if(s){o=s.width,a=s.height;const d=Ja();(!d||d&&t==="fixed")&&(c=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:c,y:u}}function w6(e,t){const n=ps(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=Gt(e)?hi(e):jn(1),a=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,d=r*o.y;return{width:a,height:c,x:u,y:d}}function Db(e,t,n){let r;if(t==="viewport")r=b6(e,n);else if(t==="document")r=v6(kn(e));else if(it(t))r=w6(t,n);else{const s=_b(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return rl(r)}function Nb(e,t){const n=Jn(e);return n===t||!it(n)||Zn(n)?!1:on(n).position==="fixed"||Nb(n,t)}function S6(e,t){const n=t.get(e);if(n)return n;let r=kr(e,[],!1).filter(c=>it(c)&&ui(c)!=="body"),s=null;const o=on(e).position==="fixed";let a=o?Jn(e):e;for(;it(a)&&!Zn(a);){const c=on(a),u=Md(a);!u&&c.position==="fixed"&&(s=null),(o?!u&&!s:!u&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||_o(a)&&!u&&Nb(e,a))?r=r.filter(h=>h!==a):s=c,a=Jn(a)}return t.set(e,r),r}function T6(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Za(t)?[]:S6(t,this._c):[].concat(n),r],c=a[0],u=a.reduce((d,h)=>{const p=Db(t,h,s);return d.top=Yt(p.top,d.top),d.right=jr(p.right,d.right),d.bottom=jr(p.bottom,d.bottom),d.left=Yt(p.left,d.left),d},Db(t,c,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function C6(e){const{width:t,height:n}=$b(e);return{width:t,height:n}}function E6(e,t,n){const r=Gt(t),s=kn(t),o=n==="fixed",a=ps(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=jn(0);if(r||!r&&!o)if((ui(t)!=="body"||_o(s))&&(c=Qa(t)),r){const m=ps(t,!0,o,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else s&&(u.x=Ld(s));const d=s&&!r&&!o?Ib(s,c):jn(0),h=a.left+c.scrollLeft-u.x-d.x,p=a.top+c.scrollTop-u.y-d.y;return{x:h,y:p,width:a.width,height:a.height}}function Rd(e){return on(e).position==="static"}function kb(e,t){if(!Gt(e)||on(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return kn(e)===n&&(n=n.ownerDocument.body),n}function jb(e,t){const n=zt(e);if(Za(e))return n;if(!Gt(e)){let s=Jn(e);for(;s&&!Zn(s);){if(it(s)&&!Rd(s))return s;s=Jn(s)}return n}let r=kb(e,t);for(;r&&KD(r)&&Rd(r);)r=kb(r,t);return r&&Zn(r)&&Rd(r)&&!Md(r)?n:r||XD(e)||n}const P6=async function(e){const t=this.getOffsetParent||jb,n=this.getDimensions,r=await n(e.floating);return{reference:E6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function A6(e){return on(e).direction==="rtl"}const M6={convertOffsetParentRelativeRectToViewportRelativeRect:y6,getDocumentElement:kn,getClippingRect:T6,getOffsetParent:jb,getElementRects:P6,getClientRects:x6,getDimensions:C6,getScale:hi,isElement:it,isRTL:A6};function Lb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function O6(e,t){let n=null,r;const s=kn(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function a(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:h,top:p,width:m,height:x}=d;if(c||t(),!m||!x)return;const S=tl(p),b=tl(s.clientWidth-(h+m)),T=tl(s.clientHeight-(p+x)),v=tl(h),C={rootMargin:-S+"px "+-b+"px "+-T+"px "+-v+"px",threshold:Yt(0,jr(1,u))||1};let I=!0;function P(D){const R=D[0].intersectionRatio;if(R!==u){if(!I)return a();R?a(!1,R):r=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!Lb(d,e.getBoundingClientRect())&&a(),I=!1}try{n=new IntersectionObserver(P,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return a(!0),o}function Qn(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=jd(e),h=s||o?[...d?kr(d):[],...kr(t)]:[];h.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const p=d&&c?O6(d,n):null;let m=-1,x=null;a&&(x=new ResizeObserver(v=>{let[A]=v;A&&A.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var C;(C=x)==null||C.observe(t)})),n()}),d&&!u&&x.observe(d),x.observe(t));let S,b=u?ps(e):null;u&&T();function T(){const v=ps(e);b&&!Lb(b,v)&&n(),b=v,S=requestAnimationFrame(T)}return n(),()=>{var v;h.forEach(A=>{s&&A.removeEventListener("scroll",n),o&&A.removeEventListener("resize",n)}),p==null||p(),(v=x)==null||v.disconnect(),x=null,u&&cancelAnimationFrame(S)}}const $6=d6,_6=h6,I6=u6,D6=p6,Rb=c6,N6=(e,t,n)=>{const r=new Map,s={platform:M6,...n},o={...s.platform,_c:r};return l6(e,t,{...s,platform:o})};var sl=typeof document<"u"?O.useLayoutEffect:O.useEffect;function il(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!il(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!il(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Fb(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vb(e,t){const n=Fb(e);return Math.round(t*n)/n}function Fd(e){const t=he.useRef(e);return sl(()=>{t.current=e}),t}function k6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:a}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[h,p]=he.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,x]=he.useState(r);il(m,r)||x(r);const[S,b]=he.useState(null),[T,v]=he.useState(null),A=he.useCallback(z=>{z!==D.current&&(D.current=z,b(z))},[]),C=he.useCallback(z=>{z!==R.current&&(R.current=z,v(z))},[]),I=o||S,P=a||T,D=he.useRef(null),R=he.useRef(null),F=he.useRef(h),W=u!=null,Q=Fd(u),ee=Fd(s),ae=Fd(d),ge=he.useCallback(()=>{if(!D.current||!R.current)return;const z={placement:t,strategy:n,middleware:m};ee.current&&(z.platform=ee.current),N6(D.current,R.current,z).then(K=>{const $={...K,isPositioned:ae.current!==!1};de.current&&!il(F.current,$)&&(F.current=$,uT.flushSync(()=>{p($)}))})},[m,t,n,ee,ae]);sl(()=>{d===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,p(z=>({...z,isPositioned:!1})))},[d]);const de=he.useRef(!1);sl(()=>(de.current=!0,()=>{de.current=!1}),[]),sl(()=>{if(I&&(D.current=I),P&&(R.current=P),I&&P){if(Q.current)return Q.current(I,P,ge);ge()}},[I,P,ge,Q,W]);const le=he.useMemo(()=>({reference:D,floating:R,setReference:A,setFloating:C}),[A,C]),ue=he.useMemo(()=>({reference:I,floating:P}),[I,P]),Y=he.useMemo(()=>{const z={position:n,left:0,top:0};if(!ue.floating)return z;const K=Vb(ue.floating,h.x),$=Vb(ue.floating,h.y);return c?{...z,transform:"translate("+K+"px, "+$+"px)",...Fb(ue.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:$}},[n,c,ue.floating,h.x,h.y]);return he.useMemo(()=>({...h,update:ge,refs:le,elements:ue,floatingStyles:Y}),[h,ge,le,ue,Y])}const j6=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rb({element:r.current,padding:s}).fn(n):{}:r?Rb({element:r,padding:s}).fn(n):{}}}},er=(e,t)=>({...$6(e),options:[e,t]}),tr=(e,t)=>({..._6(e),options:[e,t]}),nr=(e,t)=>({...I6(e),options:[e,t]}),Rr=(e,t)=>({...D6(e),options:[e,t]}),ms=(e,t)=>({...j6(e),options:[e,t]}),Bb={...he},L6=Bb.useInsertionEffect||(e=>e());function pi(e){const t=he.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return L6(()=>{t.current=e}),he.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}var mi=typeof document<"u"?O.useLayoutEffect:O.useEffect;let Wb=!1,R6=0;const Ub=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+R6++;function F6(){const[e,t]=he.useState(()=>Wb?Ub():void 0);return mi(()=>{e==null&&t(Ub())},[]),he.useEffect(()=>{Wb=!0},[]),e}const V6=Bb.useId||F6;let Vd;process.env.NODE_ENV!=="production"&&(Vd=new Set);function B6(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s="Floating UI: "+n.join(" ");if(!((e=Vd)!=null&&e.has(s))){var o;(o=Vd)==null||o.add(s),console.error(s)}}function W6(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(s=>s!==n))||[])}}}const U6=he.createContext(null),z6=he.createContext(null),G6=()=>{var e;return((e=he.useContext(U6))==null?void 0:e.id)||null},zb=()=>he.useContext(z6);function Y6(e){return"data-floating-ui-"+e}function ol(e){const t=O.useRef(e);return mi(()=>{t.current=e}),t}function Bd(e,t){let n=e.filter(s=>{var o;return s.parentId===t&&((o=s.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(s=>{var o;return(o=r)==null?void 0:o.some(a=>{var c;return s.parentId===a.id&&((c=s.context)==null?void 0:c.open)})}),n=n.concat(r);return n}const H6="data-floating-ui-focusable";function Gb(e){return Gt(e.target)&&e.target.tagName==="BUTTON"}function Yb(e){return e6(e)}function rr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:s,elements:{domReference:o}}=e,{enabled:a=!0,event:c="click",toggle:u=!0,ignoreMouse:d=!1,keyboardHandlers:h=!0,stickIfOpen:p=!0}=t,m=he.useRef(),x=he.useRef(!1),S=he.useMemo(()=>({onPointerDown(b){m.current=b.pointerType},onMouseDown(b){const T=m.current;b.button===0&&c!=="click"&&(Eb(T)&&d||(n&&u&&(!(s.current.openEvent&&p)||s.current.openEvent.type==="mousedown")?r(!1,b.nativeEvent,"click"):(b.preventDefault(),r(!0,b.nativeEvent,"click"))))},onClick(b){const T=m.current;if(c==="mousedown"&&m.current){m.current=void 0;return}Eb(T)&&d||(n&&u&&(!(s.current.openEvent&&p)||s.current.openEvent.type==="click")?r(!1,b.nativeEvent,"click"):r(!0,b.nativeEvent,"click"))},onKeyDown(b){m.current=void 0,!(b.defaultPrevented||!h||Gb(b))&&(b.key===" "&&!Yb(o)&&(b.preventDefault(),x.current=!0),b.key==="Enter"&&r(!(n&&u),b.nativeEvent,"click"))},onKeyUp(b){b.defaultPrevented||!h||Gb(b)||Yb(o)||b.key===" "&&x.current&&(x.current=!1,r(!(n&&u),b.nativeEvent,"click"))}}),[s,o,c,d,h,r,n,p,u]);return he.useMemo(()=>a?{reference:S}:{},[a,S])}const q6={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},K6={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Hb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function sr(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:s,dataRef:o}=e,{enabled:a=!0,escapeKey:c=!0,outsidePress:u=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:x,capture:S}=t,b=zb(),T=pi(typeof u=="function"?u:()=>!1),v=typeof u=="function"?T:u,A=he.useRef(!1),C=he.useRef(!1),{escapeKey:I,outsidePress:P}=Hb(x),{escapeKey:D,outsidePress:R}=Hb(S),F=he.useRef(!1),W=pi(le=>{var ue;if(!n||!a||!c||le.key!=="Escape"||F.current)return;const Y=(ue=o.current.floatingContext)==null?void 0:ue.nodeId,z=b?Bd(b.nodesRef.current,Y):[];if(!I&&(le.stopPropagation(),z.length>0)){let K=!0;if(z.forEach($=>{var k;if((k=$.context)!=null&&k.open&&!$.context.dataRef.current.__escapeKeyBubbles){K=!1;return}}),!K)return}r(!1,ZD(le)?le.nativeEvent:le,"escape-key")}),Q=pi(le=>{var ue;const Y=()=>{var z;W(le),(z=Io(le))==null||z.removeEventListener("keydown",Y)};(ue=Io(le))==null||ue.addEventListener("keydown",Y)}),ee=pi(le=>{var ue;const Y=A.current;A.current=!1;const z=C.current;if(C.current=!1,d==="click"&&z||Y||typeof v=="function"&&!v(le))return;const K=Io(le),$="["+Y6("inert")+"]",k=Pb(s.floating).querySelectorAll($);let X=it(K)?K:null;for(;X&&!Zn(X);){const J=Jn(X);if(Zn(J)||!it(J))break;X=J}if(k.length&&it(K)&&!JD(K)&&!Cb(K,s.floating)&&Array.from(k).every(J=>!Cb(X,J)))return;if(Gt(K)&&de){const J=Zn(K),oe=on(K),se=/auto|scroll/,fe=J||se.test(oe.overflowX),Ee=J||se.test(oe.overflowY),Ve=fe&&K.clientWidth>0&&K.scrollWidth>K.clientWidth,ie=Ee&&K.clientHeight>0&&K.scrollHeight>K.clientHeight,me=oe.direction==="rtl",De=ie&&(me?le.offsetX<=K.offsetWidth-K.clientWidth:le.offsetX>K.clientWidth),ft=Ve&&le.offsetY>K.clientHeight;if(De||ft)return}const U=(ue=o.current.floatingContext)==null?void 0:ue.nodeId,re=b&&Bd(b.nodesRef.current,U).some(J=>{var oe;return $d(le,(oe=J.context)==null?void 0:oe.elements.floating)});if($d(le,s.floating)||$d(le,s.domReference)||re)return;const B=b?Bd(b.nodesRef.current,U):[];if(B.length>0){let J=!0;if(B.forEach(oe=>{var se;if((se=oe.context)!=null&&se.open&&!oe.context.dataRef.current.__outsidePressBubbles){J=!1;return}}),!J)return}r(!1,le,"outside-press")}),ae=pi(le=>{var ue;const Y=()=>{var z;ee(le),(z=Io(le))==null||z.removeEventListener(d,Y)};(ue=Io(le))==null||ue.addEventListener(d,Y)});he.useEffect(()=>{if(!n||!a)return;o.current.__escapeKeyBubbles=I,o.current.__outsidePressBubbles=P;let le=-1;function ue(k){r(!1,k,"ancestor-scroll")}function Y(){window.clearTimeout(le),F.current=!0}function z(){le=window.setTimeout(()=>{F.current=!1},Ja()?5:0)}const K=Pb(s.floating);c&&(K.addEventListener("keydown",D?Q:W,D),K.addEventListener("compositionstart",Y),K.addEventListener("compositionend",z)),v&&K.addEventListener(d,R?ae:ee,R);let $=[];return m&&(it(s.domReference)&&($=kr(s.domReference)),it(s.floating)&&($=$.concat(kr(s.floating))),!it(s.reference)&&s.reference&&s.reference.contextElement&&($=$.concat(kr(s.reference.contextElement)))),$=$.filter(k=>{var X;return k!==((X=K.defaultView)==null?void 0:X.visualViewport)}),$.forEach(k=>{k.addEventListener("scroll",ue,{passive:!0})}),()=>{c&&(K.removeEventListener("keydown",D?Q:W,D),K.removeEventListener("compositionstart",Y),K.removeEventListener("compositionend",z)),v&&K.removeEventListener(d,R?ae:ee,R),$.forEach(k=>{k.removeEventListener("scroll",ue)}),window.clearTimeout(le)}},[o,s,c,v,d,n,r,m,a,I,P,W,D,Q,ee,R,ae]),he.useEffect(()=>{A.current=!1},[v,d]);const ge=he.useMemo(()=>({onKeyDown:W,...h&&{[q6[p]]:le=>{r(!1,le.nativeEvent,"reference-press")},...p!=="click"&&{onClick(le){r(!1,le.nativeEvent,"reference-press")}}}}),[W,r,h,p]),de=he.useMemo(()=>({onKeyDown:W,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[K6[d]]:()=>{A.current=!0}}),[W,d]);return he.useMemo(()=>a?{reference:ge,floating:de}:{},[a,ge,de])}function X6(e){const{open:t=!1,onOpenChange:n,elements:r}=e,s=V6(),o=he.useRef({}),[a]=he.useState(()=>W6()),c=G6()!=null;if(process.env.NODE_ENV!=="production"){const x=r.reference;x&&!it(x)&&B6("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,d]=he.useState(r.reference),h=pi((x,S,b)=>{o.current.openEvent=x?S:void 0,a.emit("openchange",{open:x,event:S,reason:b,nested:c}),n==null||n(x,S,b)}),p=he.useMemo(()=>({setPositionReference:d}),[]),m=he.useMemo(()=>({reference:u||r.reference||null,floating:r.floating||null,domReference:r.reference}),[u,r.reference,r.floating]);return he.useMemo(()=>({dataRef:o,open:t,onOpenChange:h,elements:m,events:a,floatingId:s,refs:p}),[t,h,m,a,s,p])}function ir(e){e===void 0&&(e={});const{nodeId:t}=e,n=X6({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,s=r.elements,[o,a]=he.useState(null),[c,u]=he.useState(null),h=(s==null?void 0:s.domReference)||o,p=he.useRef(null),m=zb();mi(()=>{h&&(p.current=h)},[h]);const x=k6({...e,elements:{...s,...c&&{reference:c}}}),S=he.useCallback(C=>{const I=it(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),contextElement:C}:C;u(I),x.refs.setReference(I)},[x.refs]),b=he.useCallback(C=>{(it(C)||C===null)&&(p.current=C,a(C)),(it(x.refs.reference.current)||x.refs.reference.current===null||C!==null&&!it(C))&&x.refs.setReference(C)},[x.refs]),T=he.useMemo(()=>({...x.refs,setReference:b,setPositionReference:S,domReference:p}),[x.refs,b,S]),v=he.useMemo(()=>({...x.elements,domReference:h}),[x.elements,h]),A=he.useMemo(()=>({...x,...r,refs:T,elements:v,nodeId:t}),[x,T,v,t,r]);return mi(()=>{r.dataRef.current.floatingContext=A;const C=m==null?void 0:m.nodesRef.current.find(I=>I.id===t);C&&(C.context=A)}),he.useMemo(()=>({...x,context:A,refs:T,elements:v}),[x,T,v,A])}const qb="active",Kb="selected";function Wd(e,t,n){const r=new Map,s=n==="item";let o=e;if(s&&e){const{[qb]:a,[Kb]:c,...u}=e;o=u}return{...n==="floating"&&{tabIndex:-1,[H6]:""},...o,...t.map(a=>{const c=a?a[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((a,c)=>(c&&Object.entries(c).forEach(u=>{let[d,h]=u;if(!(s&&[qb,Kb].includes(d)))if(d.indexOf("on")===0){if(r.has(d)||r.set(d,[]),typeof h=="function"){var p;(p=r.get(d))==null||p.push(h),a[d]=function(){for(var m,x=arguments.length,S=new Array(x),b=0;b<x;b++)S[b]=arguments[b];return(m=r.get(d))==null?void 0:m.map(T=>T(...S)).find(T=>T!==void 0)}}}else a[d]=h}),a),{})}}function or(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),s=he.useCallback(c=>Wd(c,e,"reference"),t),o=he.useCallback(c=>Wd(c,e,"floating"),n),a=he.useCallback(c=>Wd(c,e,"item"),r);return he.useMemo(()=>({getReferenceProps:s,getFloatingProps:o,getItemProps:a}),[s,o,a])}const Xb=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(t,n)=>(n?"-":"")+t.toLowerCase());function gi(e,t){return typeof e=="function"?e(t):e}function Z6(e,t){const[n,r]=he.useState(e);return e&&!n&&r(!0),he.useEffect(()=>{if(!e&&n){const s=setTimeout(()=>r(!1),t);return()=>clearTimeout(s)}},[e,n,t]),n}function J6(e,t){t===void 0&&(t={});const{open:n,elements:{floating:r}}=e,{duration:s=250}=t,a=(typeof s=="number"?s:s.close)||0,[c,u]=he.useState("unmounted"),d=Z6(n,a);return!d&&c==="close"&&u("unmounted"),mi(()=>{if(r){if(n){u("initial");const h=requestAnimationFrame(()=>{u("open")});return()=>{cancelAnimationFrame(h)}}u("close")}},[n,r]),{isMounted:d,status:c}}function ar(e,t){t===void 0&&(t={});const{initial:n={opacity:0},open:r,close:s,common:o,duration:a=250}=t,c=e.placement,u=c.split("-")[0],d=he.useMemo(()=>({side:u,placement:c}),[u,c]),h=typeof a=="number",p=(h?a:a.open)||0,m=(h?a:a.close)||0,[x,S]=he.useState(()=>({...gi(o,d),...gi(n,d)})),{isMounted:b,status:T}=J6(e,{duration:a}),v=ol(n),A=ol(r),C=ol(s),I=ol(o);return mi(()=>{const P=gi(v.current,d),D=gi(C.current,d),R=gi(I.current,d),F=gi(A.current,d)||Object.keys(P).reduce((W,Q)=>(W[Q]="",W),{});if(T==="initial"&&S(W=>({transitionProperty:W.transitionProperty,...R,...P})),T==="open"&&S({transitionProperty:Object.keys(F).map(Xb).join(","),transitionDuration:p+"ms",...R,...F}),T==="close"){const W=D||P;S({transitionProperty:Object.keys(W).map(Xb).join(","),transitionDuration:m+"ms",...R,...W})}},[m,C,v,A,I,p,T,d]),{isMounted:b,styles:x}}const gs=({open:e,onClose:t,component:n,children:r,placement:s="bottom",className:o="",strategy:a="absolute",styles:c={},offset:u=8,padding:d=8,handleClickAway:h=!0})=>{const[p,m]=O.useState(e);O.useEffect(()=>{m(e)},[e]);const x=()=>{m(!1),t==null||t()},{x:S,y:b,strategy:T,refs:v,context:A}=ir({strategy:a,open:p,onOpenChange:W=>{!W&&!e&&x()},middleware:[er(u),nr(),tr({padding:d})],whileElementsMounted:Qn,placement:s}),C=rr(A,{enabled:!1}),I=sr(A,{enabled:!1}),{getReferenceProps:P,getFloatingProps:D}=or([C,I]),{isMounted:R,styles:F}=ar(A,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px) scale(0.95)"}});return g.jsx(D2,{enabled:h,onClickAway:()=>{p&&x()},children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{ref:v.setReference,...P(),className:"reference-element",children:r}),R&&g.jsx("div",{ref:v.setFloating,style:{position:T,top:b??0,left:S??0,...F,zIndex:999,...c},...D(),className:"floating-element w-max",children:g.jsx(yi,{className:o,children:typeof n=="function"?O.createElement(n):n})})]})})},Q6=({selectedPeriod:e,handlePeriodChange:t,colorVariants:n})=>{const r={initial:{backgroundColor:"#ffffff",color:"#57595f"},active:{backgroundColor:(n==null?void 0:n.hoverLight)||"#dee7fc",color:(n==null?void 0:n.text)||"#111827"},exit:{backgroundColor:"#ffffff",color:"#57595f"}};return g.jsxs("div",{className:"flex rounded-xl p-6 gap-2 border",style:{borderColor:(n==null?void 0:n.hoverLight)||"#dbeafe"},children:[g.jsx(st.button,{variants:r,initial:"initial",animate:e==="AM"?"active":"initial",exit:"exit",transition:{duration:.2},onClick:()=>t("AM"),disabled:e==="AM",className:"flex items-center justify-center font-500 px-10 py-2 rounded-lg",children:"AM"}),g.jsx(st.button,{variants:r,initial:"initial",animate:e==="PM"?"active":"initial",exit:"exit",transition:{duration:.2},onClick:()=>t("PM"),disabled:e==="PM",className:"flex items-center justify-center font-500 px-10 py-2 rounded-lg",children:"PM"})]})},eN=({setHourMenuOpen:e,hourMenuOpen:t,selectedHour:n})=>g.jsx("button",{onClick:()=>e(!t),className:"flex justify-center items-center w-72 h-full border py-8 px-14 rounded-xl border-blue-100 text-gray-600 font-500",children:`${String(n).padStart(2,"0")}:00`}),tN={primary:"#375ABC",primaryLight:"#8FA9F3",primaryDark:"#29438D",hover:"#4570EB",hoverLight:"#ECF1FD",text:"#375ABC",textLight:"#FFFFFF"},nN={primary:"#06B6D4",primaryLight:"#67E8F9",primaryDark:"#0891B2",hover:"#0891B2",hoverLight:"#CFFAFE",text:"#06B6D4",textLight:"#FFFFFF"},rN=e=>({blue:tN,aqua:nN})[e],Ud=({date:e,onDateChange:t,showTimeSelector:n=!0,minDate:r,maxDate:s,futureDates:o=!1,pastDates:a=!0,color:c="blue"})=>{const[u,d]=O.useState(e),[h,p]=O.useState(e),[m,x]=O.useState(e.getHours()%12||12),[S,b]=O.useState(e.getHours()>=12?"PM":"AM"),[T,v]=O.useState(0),{t:A}=Ue(),C=rN(c),[I,P]=O.useState(!1),[D,R]=O.useState(!1);O.useEffect(()=>{d(e),p(e),x(e.getHours()%12||12),b(e.getHours()>=12?"PM":"AM")},[e]);const F=()=>{v(-1),setTimeout(()=>{const z=A$(u);(!r||z>=r)&&d(z)},10)},W=()=>{v(1),setTimeout(()=>{d(ix(u,1))},10)},Q=z=>{if(s&&z>s||r&&z<r)return;const K=yx(xx(vx(z,0),0),S==="AM"?m%12:m%12+12);p(K),t(K)},ee=z=>{x(z);const K=yx(xx(vx(h,0),0),S==="AM"?z%12:z%12+12);p(K),t(K),P(!1)},ae=z=>{b(z)},ge=()=>{const z=new Date,K=20,$=5,[k,X]=O.useState(()=>Array.from({length:K+1},(J,oe)=>{const se=new Date(z.getFullYear(),z.getMonth()-oe,1);return{name:_n(se,"MMMM",{locale:Js}).replace(/^./,fe=>fe.toUpperCase()),index:se.getMonth(),year:se.getFullYear(),displayName:`${_n(se,"MMMM",{locale:Js}).replace(/^./,fe=>fe.toUpperCase())} ${se.getFullYear()}`}})),U=O.useRef(null),re=O.useRef(null);O.useEffect(()=>{U.current&&U.current.disconnect(),U.current=new IntersectionObserver(J=>{J[0].isIntersecting&&X(oe=>{const se=oe[oe.length-1],fe=new Date(se.year,se.index-1,1),Ee=Array.from({length:$},(Ve,ie)=>{const me=new Date(fe.getFullYear(),fe.getMonth()-ie,1);return{name:_n(me,"MMMM",{locale:Js}).replace(/^./,De=>De.toUpperCase()),index:me.getMonth(),year:me.getFullYear(),displayName:`${_n(me,"MMMM",{locale:Js}).replace(/^./,De=>De.toUpperCase())} ${me.getFullYear()}`}});return[...oe,...Ee]})}),re.current&&U.current.observe(re.current)},[k]);const B=(J,oe)=>{const se=new Date(u);se.setMonth(J),se.setFullYear(oe),(!r||se>=r)&&d(se),R(!1)};return g.jsx("div",{className:"flex flex-col p-8 max-h-200 overflow-y-auto bg-light gap-4",children:k.map((J,oe)=>{const se=oe===k.length-1;return g.jsx("button",{ref:se?re:null,onClick:()=>B(J.index,J.year),className:"text-start p-6 font-600 transition-all duration-100 rounded-lg",style:{backgroundColor:u.getMonth()===J.index&&u.getFullYear()===J.year?C.hoverLight:"transparent",color:u.getMonth()===J.index&&u.getFullYear()===J.year?C.text:"inherit"},onMouseEnter:fe=>{u.getMonth()===J.index&&u.getFullYear()===J.year||(fe.currentTarget.style.backgroundColor="#F3F4F6")},onMouseLeave:fe=>{u.getMonth()===J.index&&u.getFullYear()===J.year||(fe.currentTarget.style.backgroundColor="transparent")},children:J.displayName},`${J.name}-${J.year}-${oe}`)})})},de=()=>g.jsxs("div",{className:"flex justify-between items-center mb-8",children:[g.jsx(gs,{open:D,onClose:()=>R(!1),component:ge,placement:"bottom",className:"!p-0 overflow-hidden bg-light",strategy:"fixed",children:g.jsxs("button",{onClick:()=>R(!D),className:"transition-colors duration-150 flex gap-6 items-center !text-black",children:[g.jsx("h4",{className:"text-header-4",children:_n(u,"MMMM yyyy",{locale:Js}).replace(/^./,z=>z.toUpperCase())}),g.jsx(Pe,{icon:r0,className:"w-12 h-12"})]})}),g.jsxs("div",{className:"flex items-center gap-8",children:[g.jsx(sh,{variant:"transparent",color:c,icon:qD,onClick:F}),g.jsx(sh,{variant:"transparent",color:c,icon:g4,onClick:W})]})]}),le=()=>{const z=Ks(M4(u)),K=$4(E4(u)),$=A4({start:z,end:K}),k=new Date;return k.setHours(0,0,0,0),g.jsx("div",{className:"grid grid-cols-7 gap-2",children:$.map((X,U)=>{const re=lx(X,h),B=E$(X,u),J=P$(X),oe=X<k,se=X>k,fe=!B||oe&&!a||se&&!o||r&&X<r||s&&X>s;return g.jsx(st.div,{className:`
|
|
668
668
|
p-2 text-center w-[40px] h-[40px] rounded-full flex items-center justify-center font-600 select-none
|
|
669
669
|
${fe?"text-gray-400 pointer-events-none":"cursor-pointer"}
|
|
670
670
|
`,onClick:()=>!fe&&Q(X),initial:!1,animate:{backgroundColor:re?C.primaryLight:"transparent",color:re?C.textLight:J?C.text:fe?"#9CA3AF":"#000000"},transition:{duration:.2,ease:"easeInOut",backgroundColor:{duration:.2,ease:"easeOut"}},whileHover:!fe&&!re?{backgroundColor:C.hoverLight}:{},whileTap:fe?{}:{backgroundColor:re?C.primaryDark:C.hoverLight},children:_n(X,"d")},U)})})},ue=()=>{const z=Array.from({length:12},($,k)=>k+1),K=()=>g.jsx("div",{className:"bg-white rounded-lg shadow-lg w-80 max-h-[150px] overflow-y-auto p-4 flex flex-col gap-4",children:z.map($=>g.jsxs("button",{onClick:()=>ee($),className:"w-full text-center py-2 transition-all duration-100 rounded-lg",style:{backgroundColor:$===m?C.hoverLight:"transparent",color:$===m?C.text:"inherit",fontWeight:$===m?"500":"normal"},onMouseEnter:k=>{$!==m&&(k.currentTarget.style.backgroundColor="#F3F4F6")},onMouseLeave:k=>{$!==m&&(k.currentTarget.style.backgroundColor="transparent")},children:[String($).padStart(2,"0"),":00"]},$))});return g.jsxs("div",{className:"flex justify-between items-center mt-4 mb-4",children:[g.jsx("h4",{className:"text-body-m font-medium",children:A("time")}),g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsx(gs,{open:I,onClose:()=>P(!1),component:K,placement:"bottom",className:"!p-0 overflow-hidden",strategy:"fixed",children:g.jsx(eN,{setHourMenuOpen:P,hourMenuOpen:I,selectedHour:m})}),g.jsx(Q6,{selectedPeriod:S,handlePeriodChange:ae,colorVariants:C})]})]})},Y={slideNextEnter:{x:300,opacity:0},slidePrevEnter:{x:-300,opacity:0},center:{x:0,opacity:1,transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}}},slideNextExit:{x:-300,opacity:0,transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}}},slidePrevExit:{x:300,opacity:0,transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}}}};return g.jsxs("div",{className:"rounded-3xl max-w-[300px] mx-auto bg-white p-24 relative overflow-hidden",children:[de(),g.jsx(qn,{initial:!1,mode:"popLayout",children:g.jsx(st.div,{variants:Y,initial:T===1?"slideNextEnter":T===-1?"slidePrevEnter":!1,animate:"center",exit:T===1?"slideNextExit":"slidePrevExit",className:"w-full",children:le()},_n(u,"yyyy-MM"))}),n&&ue()]})},al=({label:e,onChange:t,value:n,name:r,error:s,placeholder:o,className:a="",disabled:c=!1,disabledInput:u=!1,size:d="md",leftSide:h,rightSide:p,...m})=>{const{t:x}=Ue(),b={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-14",gap:"gap-8"}}[d];return g.jsxs("label",{className:`flex flex-col group select-none ${b.gap} ${c&&"cursor-not-allowed"} ${a}`,htmlFor:r,children:[g.jsx("h6",{className:`text-gray-600 font-600 group ${s&&"!text-red-500"} ${b.label} ${c&&"text-gray-300"}`,children:e}),g.jsxs("label",{htmlFor:r,className:`
|
|
@@ -677,7 +677,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
677
677
|
group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
678
678
|
${u&&"hover:!cursor-pointer"}
|
|
679
679
|
group-disabled:bg-gray-500
|
|
680
|
-
`,children:[h&&h,g.jsx("input",{...m,id:r,name:r,disabled:c,placeholder:o,value:n,onChange:T=>{t(T.target.value)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${b.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${u&&"pointer-events-none !select-none !caret-transparent"}`}),p&&p]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${b.error}`,children:
|
|
680
|
+
`,children:[h&&h,g.jsx("input",{...m,id:r,name:r,disabled:c,placeholder:o,value:n,onChange:T=>{t(T.target.value)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${b.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${u&&"pointer-events-none !select-none !caret-transparent"}`}),p&&p]}),s&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${b.error}`,children:x(s,{x:x(r)})})]})},Zb=e=>_n(e,"dd/MM/yyyy"),Jb=e=>{const[t,n,r]=e.split("/");if((t==null?void 0:t.length)===2&&(n==null?void 0:n.length)===2&&(r==null?void 0:r.length)===4){const s=new Date(Number(r),Number(n)-1,Number(t));return isNaN(s.getTime())?null:s}return null},sN=({control:e,name:t,showTimeSelector:n=!1,label:r,translateKey:s="",placeholder:o,futureDates:a=!1,pastDates:c=!0,size:u})=>{const{field:{value:d,onChange:h,onBlur:p},fieldState:{error:m}}=vr.useController({name:t,control:e}),{t:x}=Ue(),S=x(t),b=x(s),[T,v]=O.useState(!1),[A,C]=O.useState("");O.useEffect(()=>{d instanceof Date&&!isNaN(d.getTime())?C(Zb(d)):C("")},[d]);const I=Jb(A),P=R=>{const F=R.replace(/\D/g,"").slice(0,8),W=[];F.length>0&&W.push(F.slice(0,2)),F.length>2&&W.push(F.slice(2,4)),F.length>4&&W.push(F.slice(4,8));const Q=W.join("/");if(C(Q),v(!1),Q.length===10){const ee=Jb(Q);h(ee)}},D=()=>{h(null),C("")};return g.jsx(gs,{open:T,strategy:"fixed",padding:0,offset:0,onClose:()=>v(!1),className:"p-0!",component:g.jsx(Ud,{date:I||new Date,onDateChange:R=>{C(Zb(R)),h(R),v(!1)},showTimeSelector:n,futureDates:a,pastDates:c}),children:g.jsx(al,{size:u,onBlur:p,name:b||S,label:r,value:A,onFocus:R=>{R.preventDefault(),v(!0)},disabledInput:!0,onChange:R=>P(R),placeholder:o,error:m==null?void 0:m.message,rightSide:!!I&&g.jsx(Pe,{icon:nx,className:"text-gray-500 cursor-pointer",onClick:D})})})},Qb=({title:e,description:t,open:n,onClose:r,onConfirm:s,onCancel:o,icon:a=wb,showCloseButton:c=!0})=>{const u={hidden:{opacity:0},visible:{opacity:1}},d={hidden:{opacity:0,scale:.8,y:-20},visible:{opacity:1,scale:1,y:0,transition:{type:"spring",stiffness:300,damping:25}},exit:{opacity:0,scale:.8,y:20,transition:{duration:.2}}},h=()=>{s==null||s(),r()},p=()=>{o==null||o(),r()},{t:m}=Ue();return g.jsx(qn,{children:n&&g.jsx(g.Fragment,{children:g.jsx(st.div,{className:"fixed inset-0 bg-black/50 z-9999 flex items-center justify-center",initial:"hidden",animate:"visible",exit:"hidden",variants:u,onClick:r,children:g.jsx(st.div,{className:"w-full max-w-sm mx-16 z-50",variants:d,initial:"hidden",animate:"visible",exit:"exit",onClick:x=>x.stopPropagation(),children:g.jsxs(yi,{className:"flex flex-col gap-20 p-32",children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsx("div",{className:"flex justify-end",children:c&&g.jsx(Pe,{icon:pf,className:"cursor-pointer text-2xl text-gray-500 transition-all duration-300 hover:text-gray-700",onClick:r})}),g.jsx("div",{className:"flex justify-center",children:g.jsx("div",{className:"bg-blue-100 rounded-full w-76 h-76 flex justify-center items-center",children:g.jsx(Pe,{icon:a,className:"w-32 h-36 min-h-36 min-w-36 text-blue-500",onClick:r})})})]}),g.jsxs("div",{className:"flex flex-col gap-20 items-center justify-center",children:[g.jsxs("div",{className:"text-center w-full",children:[g.jsx("h3",{className:"text-black font-700 text-3xl w-full",children:e}),g.jsx("p",{className:"text-gray-500 text-xl font-600 w-full",children:t})]}),g.jsxs("div",{className:"flex justify-center w-full gap-16",children:[!!o&&g.jsx(ys,{size:"lg",onClick:p,variant:"transparent",children:m("cancel")}),!!s&&g.jsx(ys,{size:"lg",onClick:h,children:m("confirm")})]})]})]})})})})})},e2={duration:.3,ease:[.32,.72,0,1]},iN={initial:{opacity:0,height:0,y:-8},animate:{opacity:1,height:"auto",y:0},exit:{opacity:0,height:0,y:-8}},oN=({isOpen:e})=>g.jsx(st.div,{animate:{rotate:e?180:0},transition:{duration:.5,ease:[.16,1,.3,1]},children:g.jsx(Pe,{icon:YD,className:"text-gray-500 w-12 h-12 max-w-12 max-h-12"})}),aN=({label:e,children:t,subtitle:n,open:r,onClick:s,className:o="",labelClassName:a=""})=>{const{t:c}=Ue(),[u,d]=O.useState(!1),h=r!==void 0?r:u,p=s||(()=>d(!u));return g.jsxs(st.div,{className:"relative w-full bg-white border border-blue-100 rounded-2xl overflow-hidden",children:[g.jsxs("button",{onClick:p,className:`py-24 px-32 text-black font-semibold border-b
|
|
681
681
|
${h?"border-blue-100 bg-gray-50/50":"border-transparent"}
|
|
682
682
|
transition-all duration-200 ease-in-out focus:outline-none hover:bg-gray-50/50
|
|
683
683
|
flex items-center gap-2 group w-full justify-between`,children:[g.jsx("span",{className:`text-left text-lg md:text-xl font-700 ${a}`,children:c(e)}),g.jsxs("div",{className:"flex gap-10 items-center",children:[g.jsx("span",{className:"text-gray-500 font-normal text-base md:text-lg",children:n}),g.jsx(oN,{isOpen:h})]})]}),g.jsx(qn,{mode:"wait",children:h&&g.jsx(st.div,{...iN,transition:{height:{duration:e2.duration,ease:e2.ease},opacity:{duration:.15,ease:"easeOut"}},className:`w-full bg-white overflow-hidden ${o}`,children:t})})]})},Ht={LOADING:"loading",COMPLETE:"complete",ERROR:"error"},lN=({file:e,onDelete:t,onRetry:n,uploadDuration:r=4e3})=>{const{t:s}=Ue(),o=()=>e.error?Ht.ERROR:e.loading?Ht.LOADING:Ht.COMPLETE,[a,c]=O.useState(o()),[u,d]=O.useState(0),[h,p]=O.useState(10);O.useEffect(()=>{const b=o();c(b);let T;if(b===Ht.LOADING&&u<100){const C=100/(r/100);T=setInterval(()=>{d(I=>{const P=Math.min(I+C,99),D=Math.max(0,Math.round((100-P)/10));return p(D),P})},100)}else b===Ht.COMPLETE&&u<100&&d(100);return()=>{T&&clearInterval(T)}},[e.loading,e.error,r,o,u]);const m=()=>{switch(a){case Ht.LOADING:return`${Math.round(u)}% (${h} ${s("seconds_left")})`;case Ht.COMPLETE:return s("file_uploaded");case Ht.ERROR:return s("upload_error");default:return""}},x=()=>{switch(a){case Ht.COMPLETE:return"text-green-500 font-600";case Ht.ERROR:return"text-red-500 font-600";default:return"text-gray-300 font-400"}},S=()=>{if(!(e!=null&&e.file_size))return s("unknown");const b=e.file_size/1024;return b<1024?`${b.toFixed(1)} KB`:`${(b/1024).toFixed(1)} MB`};return g.jsxs("div",{className:"border border-gray-100 bg-white rounded-lg p-16 shadow-sm w-full",children:[g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-4",children:[g.jsx(Pe,{icon:d5,className:"w-12 h-12 min-w-12 min-h-12 text-gray-400"}),g.jsx("span",{className:"text-gray-500 text-sm",children:e.user_file_name})]}),a===Ht.COMPLETE&&g.jsx("button",{onClick:t,className:"text-gray-400 transition-all duration-200 hover:text-gray-600 focus:outline-none",children:g.jsx(Pe,{icon:f5})}),a===Ht.ERROR&&g.jsx("button",{onClick:n,className:"text-gray-400 transition-all duration-200 hover:text-gray-600 focus:outline-none",children:g.jsx(Pe,{icon:c5})})]}),g.jsx("div",{className:"flex items-center mt-2",children:e!=null&&e.analyzing?g.jsxs("div",{className:"flex items-center gap-6",children:[g.jsx(st.div,{className:"h-14 w-14 rounded-full border-2 border-t-blue-500 border-r-blue-300 border-b-blue-200 border-l-blue-400",animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"}}),g.jsxs("span",{className:"text-sm text-gray-500",children:[s("analyzing_file_with_ai"),"..."]})]}):g.jsxs("div",{className:"text-sm",children:[g.jsxs("span",{className:"text-gray-500",children:[S()," |"]})," ",g.jsx("span",{className:x(),children:m()})]})}),a===Ht.LOADING&&g.jsx("div",{className:"mt-2 bg-gray-200 rounded-full h-2",children:g.jsx("div",{className:"h-2 rounded-full transition-all duration-100 ease-linear bg-blue-500",style:{width:`${u}%`}})})]})},t2=({index:e,label:t,active:n,completed:r})=>g.jsxs("div",{className:"flex items-center gap-8",children:[g.jsx("div",{className:`
|
|
@@ -708,7 +708,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
708
708
|
focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
709
709
|
${p&&"hover:!cursor-pointer"}
|
|
710
710
|
group-disabled:bg-gray-500
|
|
711
|
-
`,...re,children:[A&&A,g.jsx("input",{ref:R,id:e,name:e,disabled:p,placeholder:d,value:n,onClick:()=>{S&&!P&&!p&&D(!0)},onChange:B=>k(B.target.value),onKeyDown:B=>{o&&o(B),B.key==="Enter"&&(B.preventDefault(),K.length>0&&$(K[0])),B.key==="Escape"&&D(!1)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${p&&"pointer-events-none !select-none !caret-transparent"}`}),C&&!b?C:b&&g.jsx(Pe,{icon:NE,className:`text-xl text-gray-500 cursor-pointer ${P&&"rotate-180"} transition-transform duration-150 ease-in-out`,onClick:X})]}),T&&g.jsx(ys,{variant:"filled",size:"lg",onClick:c,className:"h-[55px]!",children:x})]}),g.jsx("h4",{className:"font-500 text-label text-red-500 leading-none",children:
|
|
711
|
+
`,...re,children:[A&&A,g.jsx("input",{ref:R,id:e,name:e,disabled:p,placeholder:d,value:n,onClick:()=>{S&&!P&&!p&&D(!0)},onChange:B=>k(B.target.value),onKeyDown:B=>{o&&o(B),B.key==="Enter"&&(B.preventDefault(),K.length>0&&$(K[0])),B.key==="Escape"&&D(!1)},className:`group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none ${p&&"pointer-events-none !select-none !caret-transparent"}`}),C&&!b?C:b&&g.jsx(Pe,{icon:NE,className:`text-xl text-gray-500 cursor-pointer ${P&&"rotate-180"} transition-transform duration-150 ease-in-out`,onClick:X})]}),T&&g.jsx(ys,{variant:"filled",size:"lg",onClick:c,className:"h-[55px]!",children:x})]}),t&&g.jsx("h4",{className:"font-500 text-label text-red-500 leading-none",children:I(t,{x:I(e)})}),Y&&g.jsx("div",{ref:ee.setFloating,style:{position:Q,top:W??0,left:F??0,...z,width:ee.reference.current instanceof Element?ee.reference.current.clientWidth:void 0,zIndex:50},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...ue(),children:g.jsx("div",{className:"max-h-[250px] overflow-y-auto",children:K.length>0?g.jsx("ul",{className:"py-4",children:K.map((B,J)=>g.jsx("li",{className:`flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer ${n===B.label?"bg-blue-100/30 text-blue-500 font-medium":""}`,onClick:oe=>{oe.stopPropagation(),$(B)},children:g.jsx("span",{children:I(B.label)})},`${B.label}-${J}`))}):n&&(n==null?void 0:n.length)>0?g.jsxs("div",{className:"px-16 py-16 text-center text-gray-500",children:[g.jsx("svg",{className:"mx-auto h-24 w-24 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),g.jsxs("p",{className:"mt-8 text-body-s",children:['No se encontraron resultados para "',n,'"']})]}):null})})]})},Yd=({label:e,onClick:t,onRemove:n,readOnly:r})=>g.jsxs("div",{className:"flex justify-between items-center gap-10 bg-[#DEE6F7] rounded-[4px] p-8 text-14",onClick:t,children:[g.jsx("span",{className:"text-blue-500 font-semibold text-nowrap text-ellipsis overflow-hidden",children:e}),!r&&n&&g.jsx("button",{onClick:s=>{n(),s.stopPropagation()},className:"flex items-center text-blue-300 hover:text-red-500",children:g.jsx(Pe,{icon:i0})})]}),MN=({values:e,onPillRemove:t})=>{const[n,r]=O.useState(!1),s=e.slice(0,3),o=e.slice(3);return g.jsxs("div",{className:"flex justify-between items-start gap-20",children:[g.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.map(a=>g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)},a.value)),g.jsx(qn,{children:n&&o.map(a=>g.jsx(st.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},children:g.jsx(Yd,{label:a.label,onRemove:()=>t(a.value)})},a.value))})]}),o.length>0&&g.jsx("button",{type:"button",onClick:()=>r(!n),className:"flex items-center gap-8 w-fit text-blue-500 font-semibold text-14 transition hover:text-blue-700 text-nowrap shrink-0",children:n?g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Ocultar"})," ",g.jsx(Pe,{icon:l5})]}):g.jsxs(g.Fragment,{children:[g.jsxs("p",{children:["Ver ",o.length," más"]})," ",g.jsx(Pe,{icon:h5})]})})]})},ON=({open:e,onClose:t,children:n,side:r="right",className:s="",backdropClassName:o="",width:a="650px",zIndex:c=9999,usePortal:u=!0})=>{O.useEffect(()=>{const m=x=>{x.key==="Escape"&&e&&t()};return e&&(document.addEventListener("keydown",m),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",m),document.body.style.overflow="unset"}},[e,t]);const d={initial:{x:r==="right"?"100%":"-100%"},animate:{x:0,transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.2}}},exit:{x:r==="right"?"100%":"-100%",transition:{type:"spring",stiffness:300,damping:30,opacity:{duration:.15}}}},h={initial:{opacity:0},animate:{opacity:1,transition:{duration:.2}},exit:{opacity:0,transition:{duration:.15}}},p=g.jsx(qn,{children:e&&g.jsxs("div",{className:"fixed inset-0 flex",style:{zIndex:c},children:[g.jsx(st.div,{variants:h,initial:"initial",animate:"animate",exit:"exit",className:`absolute inset-0 bg-black/50 backdrop-blur-[0.60px] ${o}`,onClick:m=>{m.preventDefault(),m.stopPropagation(),t()}}),g.jsx("div",{className:`relative flex w-full pointer-events-none ${r==="left"?"justify-start":"justify-end"}`,children:g.jsx(st.div,{variants:d,initial:"initial",animate:"animate",exit:"exit",className:`
|
|
712
712
|
relative bg-white shadow-2xl h-full overflow-hidden flex flex-col pointer-events-auto
|
|
713
713
|
${s}
|
|
714
714
|
`,style:{width:typeof a=="number"?`${a}px`:a},onClick:m=>{m.preventDefault(),m.stopPropagation()},children:n})})]})});return u&&typeof document<"u"&&document.body?Ep.createPortal(p,document.body):p},$N=({filters:e})=>{const[t,n]=O.useState(!1),r=()=>n(!1),s=()=>n(!0);return g.jsx(gs,{open:t,onClose:r,placement:"bottom-start",className:"w-[326px] shadow-md px-0! text-base! py-12!",component:g.jsxs("div",{className:"relative flex flex-col gap-[10px]",children:[g.jsx("h4",{className:"px-24 text-lg font-semibold text-blue-900",children:"Filtros"}),g.jsx("div",{className:"flex flex-col",children:e.map((o,a)=>g.jsxs("div",{className:"group flex gap-[8px] items-center px-[24px] py-[8px] hover:bg-blue-100 cursor-pointer transition ease-in-out",onClick:o.onClick,children:[g.jsx(Pe,{icon:o.icon,className:"text-[14px] text-gray-600 group-hover:text-blue-500"}),g.jsx("p",{className:"text-[12px] text-gray-500 font-semibold group-hover:text-gray-800",children:o.label})]},a))})]}),children:g.jsx(Pe,{icon:LE,onClick:s,className:"transition text-[16px] ease-in-out duration-150 hover:text-gray-600 cursor-pointer"})})},_N=({label:e,options:t,selectedValues:n,onUpdate:r,placeholder:s="Seleccionar opciones",allowSearch:o=!0,className:a="",disabled:c=!1,size:u="md"})=>{var ue;const[d,h]=O.useState(!1),[p,m]=O.useState(""),x=O.useRef(null),S=O.useRef(null),T={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",icon:"w-12 h-12",checkboxSize:16,gap:"gap-8",searchText:"text-sm",searchIcon:"size-12"},md:{container:"p-16",text:"text-14",label:"text-14",icon:"w-16 h-16",checkboxSize:20,gap:"gap-8",searchText:"text-14",searchIcon:"size-16"}}[u],{x:v,y:A,strategy:C,refs:I,context:P}=ir({open:d&&!c,onOpenChange:Y=>!c&&h(Y),middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:Y,elements:z}){Object.assign(z.floating.style,{maxHeight:`${Math.min(Y-10,500)}px`})},padding:8}),ms({element:S})],placement:"bottom-start",whileElementsMounted:Qn}),D=rr(P,{enabled:!c}),R=sr(P),{getReferenceProps:F,getFloatingProps:W}=or([D,R]),{isMounted:Q,styles:ee}=ar(P,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),ae=O.useCallback((Y,z)=>{if(c)return;let K;z?K=n.includes(Y)?n:[...n,Y]:K=n.filter($=>$!==Y),r(K)},[n,r,c]),ge=t.filter(Y=>Y.label.toLowerCase().includes(p.toLowerCase())),de=()=>{if(n.length===0)return s;const Y=t.filter(z=>n.includes(z.value)).map(z=>z.label);return Y.length===1?Y[0]:`${Y.length} seleccionados`},le=F({onClick:()=>!c&&h(!d)});return g.jsxs("div",{className:`flex flex-col select-none ${T.gap} ${c?"cursor-not-allowed":""} ${a}`,children:[e&&g.jsx("h6",{className:`text-gray-600 font-600 ${T.label} ${c?"text-gray-300":""}`,children:e}),g.jsxs("div",{ref:I.setReference,className:`
|
|
@@ -752,7 +752,7 @@ attempted value: ${a}
|
|
|
752
752
|
group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
753
753
|
|
|
754
754
|
group-disabled:bg-gray-500
|
|
755
|
-
`,children:[c&&c,g.jsx("input",{id:n,type:x?"text":"password",autoComplete:"off","aria-autocomplete":"none",name:n,disabled:o,placeholder:r,value:u,onChange:A=>d(A.target.value),onBlur:p,ref:h,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${v.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`}),g.jsx(Pe,{icon:x?u5:a5,className:"min-h-16 max-h-16 text-gray-400 hover:text-gray-500 transition-colors duration-150 cursor-pointer ease-in-out",onClick:()=>S(!x)})]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${v.error}`,children:m&&b(m.message||"",{x:b(n)})})]})},kk=({name:e,control:t,label:n="phone_number",placeholder:r="enter_phone_number",language:s="en",className:o="",translateKey:a,countries:c=M2})=>{var Ts,vl,Br,bl;const{t:u}=Ue(),{field:d,fieldState:h}=vr.useController({name:e,control:t,rules:{validate:{}}}),p=((Ts=d.value)==null?void 0:Ts.split(" "))||[],m=p[0]||null,x=p[1]||"",S=c.find(ve=>m===ve.phone),[b,T]=O.useState(!1),[v,A]=O.useState(""),[C,I]=O.useState(S||null),[P,D]=O.useState(x),[R,F]=O.useState(!1),W=O.useRef(null),Q=O.useRef(null),ee=O.useRef(null),ae=O.useRef(null),{x:ge,y:de,strategy:le,refs:ue,context:Y,placement:z,middlewareData:K}=ir({open:b,onOpenChange:T,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:ve,elements:Ze}){Object.assign(Ze.floating.style,{maxHeight:`${Math.min(ve-10,300)}px`})},padding:8}),ms({element:Q})],placement:"bottom-start",whileElementsMounted:Qn}),$=rr(Y),k=sr(Y),{getReferenceProps:X,getFloatingProps:U}=or([$,k]),{isMounted:re,styles:B}=ar(Y,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),oe=(Array.isArray(c)?c:[]).filter(ve=>{if(!v.trim())return!0;const Ze=s==="es"&&ve.labelES?ve.labelES.toLowerCase():ve.label.toLowerCase(),Pt=ve.code?ve.code.toLowerCase():"",xn=ve.phone?ve.phone.toLowerCase():"";return Ze.includes(v.toLowerCase())||Pt.includes(v.toLowerCase())||xn.includes(v.toLowerCase())}),se=ve=>{I(ve),T(!1),A("");const Ze=`${ve.phone} ${P}`;d.onChange(Ze),setTimeout(()=>{var Pt;(Pt=ee.current)==null||Pt.focus()},100)},fe=ve=>{const Ze=ve.target.value;if(D(Ze),C){const Pt=`${C.phone} ${Ze}`;d.onChange(Pt)}},Ee=()=>{T(!b),!b&&W.current&&setTimeout(()=>{var ve;(ve=W.current)==null||ve.focus()},100)},Ve=()=>{setTimeout(()=>{b||d.onBlur()},200)},ie=()=>{F(!0)},me=()=>{F(!1)};O.useEffect(()=>{if(d.value){const ve=d.value.split(" "),Ze=ve[0]||"",Pt=ve[1]||"",xn=c.find(cr=>cr.phone===Ze);xn&&I(xn),D(Pt)}},[d.value,c]),O.useEffect(()=>{const ve=Ze=>{ae.current&&!ae.current.contains(Ze.target)&&d.onBlur()};return document.addEventListener("mousedown",ve),()=>{document.removeEventListener("mousedown",ve)}},[d]);const De=ve=>{var Ze;return ve?ve.codeISO2?ve.codeISO2.toLowerCase():((Ze=ve.code)==null?void 0:Ze.toLowerCase())||"":""},ft=(vl=K.arrow)==null?void 0:vl.x,ws=(Br=K.arrow)==null?void 0:Br.y,dt={top:"bottom",right:"left",bottom:"top",left:"right"}[z.split("-")[0]],yl=X({onClick:Ee,onBlur:Ve}),xl=()=>h.error?"border-red-500":R||b?"border-blue-400":"border-blue-100",Ss=u(n),qt=u(r),yn=(bl=h.error)==null?void 0:bl.message;return g.jsxs("div",{className:`w-full relative flex flex-col gap-8 ${o}`,children:[g.jsx("label",{className:`text-gray-600 font-600 group ${yn&&"!text-red-500"} text-label`,children:Ss}),g.jsxs("div",{ref:ae,className:"flex items-center w-full",onMouseEnter:ie,onMouseLeave:me,children:[g.jsxs("div",{ref:ue.setReference,className:`flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${yn?"border-red-500":xl()}`,style:{minWidth:"140px"},...yl,tabIndex:0,children:[C!=null&&C.code?g.jsxs("div",{className:"flex items-center truncate",children:[De(C)&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${De(C)}.png`,srcSet:`https://flagcdn.com/w40/${De(C)}.png 2x`,alt:C.label,onError:ve=>{ve.currentTarget.style.display="none"}}),g.jsxs("span",{children:["+",C.phone]})]}):g.jsx("span",{className:"text-gray-400 font-600 text-body-m truncate",children:u("select_country")}),g.jsx(Pe,{icon:r0,className:"w-14 h-14 min-w-14 min-h-14"})]}),g.jsx("input",{ref:ee,type:"tel",className:`placeholder:text-gray-400 flex-grow bg-light rounded-r-full font-600 text-body-m p-16 border transition-all duration-200 ${yn?"border-red-500":xl()}`,placeholder:qt,value:P,onChange:fe,onBlur:Ve})]}),yn&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:u(yn,{x:u(a||"")||e})}),re&&g.jsxs("div",{ref:ue.setFloating,style:{position:le,top:de??0,left:ge??0,...B},className:"z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",...U(),children:[g.jsx("div",{ref:Q,className:"absolute w-4 h-4 bg-white rotate-45 border-blue-400",style:{left:ft!=null?`${ft}px`:"",top:ws!=null?`${ws}px`:"",right:"",bottom:"",[dt]:"-2px",borderRight:dt==="left"?"1px solid":"none",borderBottom:dt==="top"?"1px solid":"none",borderLeft:dt==="right"?"1px solid":"none",borderTop:dt==="bottom"?"1px solid":"none"}}),g.jsx("div",{className:"sticky top-0 bg-white p-2 z-20 w-fit",children:g.jsx("input",{ref:W,type:"text",className:"w-fit p-16",placeholder:u("search")+"...",value:v,onChange:ve=>A(ve.target.value),onClick:ve=>ve.stopPropagation(),onBlur:ve=>{ve.stopPropagation()},autoFocus:!0})}),g.jsx("div",{children:oe.length>0?g.jsx("ul",{className:"flex flex-col",children:oe.map((ve,Ze)=>{var xn;const Pt=ve.codeISO2?ve.codeISO2.toLowerCase():((xn=ve.code)==null?void 0:xn.toLowerCase())||"";return g.jsxs("li",{className:"flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:cr=>{cr.stopPropagation(),se(ve)},children:[Pt&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${Pt}.png`,srcSet:`https://flagcdn.com/w40/${Pt}.png 2x`,alt:ve.label,onError:cr=>{cr.currentTarget.style.display="none"}}),g.jsxs("span",{className:"text-gray-500",children:["+",ve.phone]})]},`${ve.code}-${Ze}`)})}):g.jsx("div",{className:"px-16 py-8 text-gray-500 text-body-s",children:u("no_countries_found")})})]})]})},jk={bgColor:"bg-blue-100",fillColor:"bg-blue-500"},Lk={bgColor:"bg-aqua-100",fillColor:"bg-aqua-500"},Rk=e=>{switch(e){case"aqua":return Lk;case"blue":default:return jk}},Fk=({progress:e,showPercentage:t=!1,color:n,className:r="",...s})=>{const{defaultColorScheme:o}=Ue(),a=n||o,{bgColor:c,fillColor:u}=Rk(a),d=Math.min(Math.max(e,0),100);return g.jsxs("div",{className:`flex items-center gap-12 ${r}`,...s,children:[g.jsx("div",{className:`w-full h-8 ${c} rounded-full`,children:g.jsx("div",{className:`h-full ${u} rounded-full transition-all duration-300 ease-in-out`,style:{width:`${d}%`}})}),t&&g.jsxs("span",{className:"text-sm text-gray-400 font-500",children:[d,"%"]})]})},Vk=()=>{const[e,t]=O.useState(!1),n=O.useRef(null),r=()=>{t(!0),setTimeout(()=>{var o;return(o=n.current)==null?void 0:o.focus()},100)},s=()=>{t(!1)};return g.jsx("div",{className:"relative flex items-center",children:g.jsxs("div",{className:`flex items-center justify-center bg-white shadow-md rounded-full transition-all duration-300 ease-in-out ${e?"w-[200px] h-[40px]":"size-[40px]"}`,children:[g.jsx("button",{onClick:r,className:"size-[40px] flex items-center justify-center rounded-full hover:bg-gray-100 transition-all",children:g.jsx(Pe,{icon:GD})}),g.jsx("input",{ref:n,type:"text",className:`w-full outline-none bg-transparent transition-all ${e?"w-full pr-[10px]":"w-0"}`,placeholder:"Buscar...",onBlur:s,style:{border:"none",outline:"none"}})]})})},Bk="w-fit transition-colors ease-in-out duration-200 flex items-center justify-center gap-12 px-24 py-7 text-base rounded-full font-600 bg-transparent",Wk={true:"bg-blue-100 text-blue-500 hover:bg-blue-100/80 active:bg-blue-100/50 !bg-blue-100",false:"text-gray-800 hover:bg-blue-100/40 hover:text-blue-500 active:bg-blue-100/20 active:text-blue-500"},Uk={true:"bg-aqua-100 text-aqua-500 hover:bg-aqua-100/80 active:bg-aqua-100/50 !bg-aqua-100",false:"text-gray-800 hover:bg-aqua-100/40 hover:text-aqua-500 active:bg-aqua-100/20 active:text-aqua-500"},zk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=Uk[n];break;case"blue":default:r=Wk[n];break}return Ln(Bk,r)},Gk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${zk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]})},Yk="w-fit transition-colors group ease-in-out duration-200 flex flex-col items-center justify-center gap-12 text-base font-600",Hk={true:"text-blue-500 hover:text-blue-500",false:"text-gray-800 hover:text-blue-500"},qk={true:"text-aqua-500 hover:text-aqua-500",false:"text-gray-800 hover:text-aqua-500"},Kk="flex h-32 w-32 items-center justify-center transition-colors ease-in-out duration-200 rounded-full",Xk={true:"text-blue-500 bg-blue-100 rounded-full",false:"text-gray-800 hover:text-blue-500 active:text-blue-500 group-hover:bg-blue-100 group-hover:text-blue-500"},Zk={true:"text-aqua-500 bg-aqua-100 rounded-full",false:"text-gray-800 hover:text-aqua-500 active:text-aqua-500 group-hover:bg-aqua-100 group-hover:text-aqua-500"},O2=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"blue":r=Xk[n];break;case"aqua":default:r=Zk[n];break}return Ln(Kk,r)},Jk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=qk[n];break;case"blue":default:r=Hk[n];break}return Ln(Yk,r)},Qk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${Jk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]})},ej=e=>{const{display:t,...n}=e;return t==="desktop"?g.jsx(Gk,{...n}):t==="mobile"?g.jsx(Qk,{...n}):null},tj=({options:e,name:t,control:n,label:r="",placeholder:s="Type to search...",className:o="",input:a=!0,dropdownStyle:c={},innerClassName:u="",showChevron:d=!0,size:h="md"})=>{const{field:{value:p,onChange:m},fieldState:{error:x}}=vr.useController({name:t,control:n});return g.jsx(nj,{options:e,value:p,onChange:m,label:r,placeholder:s,error:x==null?void 0:x.message,className:o,input:a,dropdownStyle:c,innerClassName:u,showChevron:d,size:h})},nj=({options:e,value:t,onChange:n,label:r="Select an option",placeholder:s="Type to search...",error:o,input:a=!0,className:c="",dropdownStyle:u={},innerClassName:d="",showChevron:h=!0,size:p="md"})=>{var X;const{t:m}=Ue(),[x,S]=O.useState(!1),[b,T]=O.useState(""),[v,A]=O.useState(t||null),C=O.useRef(null),I=O.useRef(null),D={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16"}}[p],{x:R,y:F,strategy:W,refs:Q,context:ee}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:I})],placement:"bottom-start",whileElementsMounted:Qn}),ae=rr(ee),ge=sr(ee),{getReferenceProps:de,getFloatingProps:le}=or([ae,ge]),{isMounted:ue,styles:Y}=ar(ee,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),z=(()=>{const U=Array.isArray(e)?e:[];if(!b.trim())return U;const re=b.toLowerCase();return U.filter(B=>B.label.toLowerCase().includes(re)||B.key.toLowerCase().includes(re))})(),K=U=>{A(U),S(!1),T(""),n(U)},$=()=>{S(!x),!x&&C.current&&setTimeout(()=>{var U;return(U=C.current)==null?void 0:U.focus()},100)};O.useEffect(()=>{A(t)},[t]);const k=de({onClick:$});return g.jsxs("div",{className:`relative flex flex-col ${D.gap} ${c}`,children:[r&&g.jsx("h6",{className:`text-gray-600 font-600 ${o?"!text-red-500":""} ${D.label}`,children:r}),g.jsxs("div",{ref:Q.setReference,className:`${d} flex items-center justify-between bg-light rounded-full border transition-all duration-200
|
|
755
|
+
`,children:[c&&c,g.jsx("input",{id:n,type:x?"text":"password",autoComplete:"off","aria-autocomplete":"none",name:n,disabled:o,placeholder:r,value:u,onChange:A=>d(A.target.value),onBlur:p,ref:h,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${v.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none`}),g.jsx(Pe,{icon:x?u5:a5,className:"min-h-16 max-h-16 text-gray-400 hover:text-gray-500 transition-colors duration-150 cursor-pointer ease-in-out",onClick:()=>S(!x)})]}),(m==null?void 0:m.message)&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${v.error}`,children:b(m.message,{x:b(n)})})]})},kk=({name:e,control:t,label:n="phone_number",placeholder:r="enter_phone_number",language:s="en",className:o="",translateKey:a,countries:c=M2})=>{var Ts,vl,Br,bl;const{t:u}=Ue(),{field:d,fieldState:h}=vr.useController({name:e,control:t,rules:{validate:{}}}),p=((Ts=d.value)==null?void 0:Ts.split(" "))||[],m=p[0]||null,x=p[1]||"",S=c.find(ve=>m===ve.phone),[b,T]=O.useState(!1),[v,A]=O.useState(""),[C,I]=O.useState(S||null),[P,D]=O.useState(x),[R,F]=O.useState(!1),W=O.useRef(null),Q=O.useRef(null),ee=O.useRef(null),ae=O.useRef(null),{x:ge,y:de,strategy:le,refs:ue,context:Y,placement:z,middlewareData:K}=ir({open:b,onOpenChange:T,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:ve,elements:Ze}){Object.assign(Ze.floating.style,{maxHeight:`${Math.min(ve-10,300)}px`})},padding:8}),ms({element:Q})],placement:"bottom-start",whileElementsMounted:Qn}),$=rr(Y),k=sr(Y),{getReferenceProps:X,getFloatingProps:U}=or([$,k]),{isMounted:re,styles:B}=ar(Y,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),oe=(Array.isArray(c)?c:[]).filter(ve=>{if(!v.trim())return!0;const Ze=s==="es"&&ve.labelES?ve.labelES.toLowerCase():ve.label.toLowerCase(),Pt=ve.code?ve.code.toLowerCase():"",xn=ve.phone?ve.phone.toLowerCase():"";return Ze.includes(v.toLowerCase())||Pt.includes(v.toLowerCase())||xn.includes(v.toLowerCase())}),se=ve=>{I(ve),T(!1),A("");const Ze=`${ve.phone} ${P}`;d.onChange(Ze),setTimeout(()=>{var Pt;(Pt=ee.current)==null||Pt.focus()},100)},fe=ve=>{const Ze=ve.target.value;if(D(Ze),C){const Pt=`${C.phone} ${Ze}`;d.onChange(Pt)}},Ee=()=>{T(!b),!b&&W.current&&setTimeout(()=>{var ve;(ve=W.current)==null||ve.focus()},100)},Ve=()=>{setTimeout(()=>{b||d.onBlur()},200)},ie=()=>{F(!0)},me=()=>{F(!1)};O.useEffect(()=>{if(d.value){const ve=d.value.split(" "),Ze=ve[0]||"",Pt=ve[1]||"",xn=c.find(cr=>cr.phone===Ze);xn&&I(xn),D(Pt)}},[d.value,c]),O.useEffect(()=>{const ve=Ze=>{ae.current&&!ae.current.contains(Ze.target)&&d.onBlur()};return document.addEventListener("mousedown",ve),()=>{document.removeEventListener("mousedown",ve)}},[d]);const De=ve=>{var Ze;return ve?ve.codeISO2?ve.codeISO2.toLowerCase():((Ze=ve.code)==null?void 0:Ze.toLowerCase())||"":""},ft=(vl=K.arrow)==null?void 0:vl.x,ws=(Br=K.arrow)==null?void 0:Br.y,dt={top:"bottom",right:"left",bottom:"top",left:"right"}[z.split("-")[0]],yl=X({onClick:Ee,onBlur:Ve}),xl=()=>h.error?"border-red-500":R||b?"border-blue-400":"border-blue-100",Ss=u(n),qt=u(r),yn=(bl=h.error)==null?void 0:bl.message;return g.jsxs("div",{className:`w-full relative flex flex-col gap-8 ${o}`,children:[g.jsx("label",{className:`text-gray-600 font-600 group ${yn&&"!text-red-500"} text-label`,children:Ss}),g.jsxs("div",{ref:ae,className:"flex items-center w-full",onMouseEnter:ie,onMouseLeave:me,children:[g.jsxs("div",{ref:ue.setReference,className:`flex items-center justify-between text-lg max-w-120 font-600 bg-light rounded-l-full p-16 cursor-pointer border border-r-0 transition-all duration-200 ${yn?"border-red-500":xl()}`,style:{minWidth:"140px"},...yl,tabIndex:0,children:[C!=null&&C.code?g.jsxs("div",{className:"flex items-center truncate",children:[De(C)&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${De(C)}.png`,srcSet:`https://flagcdn.com/w40/${De(C)}.png 2x`,alt:C.label,onError:ve=>{ve.currentTarget.style.display="none"}}),g.jsxs("span",{children:["+",C.phone]})]}):g.jsx("span",{className:"text-gray-400 font-600 text-body-m truncate",children:u("select_country")}),g.jsx(Pe,{icon:r0,className:"w-14 h-14 min-w-14 min-h-14"})]}),g.jsx("input",{ref:ee,type:"tel",className:`placeholder:text-gray-400 flex-grow bg-light rounded-r-full font-600 text-body-m p-16 border transition-all duration-200 ${yn?"border-red-500":xl()}`,placeholder:qt,value:P,onChange:fe,onBlur:Ve})]}),yn&&g.jsx("p",{className:"mt-1 text-sm text-red-600",children:u(yn,{x:u(a||"")||e})}),re&&g.jsxs("div",{ref:ue.setFloating,style:{position:le,top:de??0,left:ge??0,...B},className:"z-10 w-fit bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto max-w-120",...U(),children:[g.jsx("div",{ref:Q,className:"absolute w-4 h-4 bg-white rotate-45 border-blue-400",style:{left:ft!=null?`${ft}px`:"",top:ws!=null?`${ws}px`:"",right:"",bottom:"",[dt]:"-2px",borderRight:dt==="left"?"1px solid":"none",borderBottom:dt==="top"?"1px solid":"none",borderLeft:dt==="right"?"1px solid":"none",borderTop:dt==="bottom"?"1px solid":"none"}}),g.jsx("div",{className:"sticky top-0 bg-white p-2 z-20 w-fit",children:g.jsx("input",{ref:W,type:"text",className:"w-fit p-16",placeholder:u("search")+"...",value:v,onChange:ve=>A(ve.target.value),onClick:ve=>ve.stopPropagation(),onBlur:ve=>{ve.stopPropagation()},autoFocus:!0})}),g.jsx("div",{children:oe.length>0?g.jsx("ul",{className:"flex flex-col",children:oe.map((ve,Ze)=>{var xn;const Pt=ve.codeISO2?ve.codeISO2.toLowerCase():((xn=ve.code)==null?void 0:xn.toLowerCase())||"";return g.jsxs("li",{className:"flex items-center justify-between gap-10 px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:cr=>{cr.stopPropagation(),se(ve)},children:[Pt&&g.jsx("img",{loading:"lazy",width:"24",height:"16",className:"mr-2",src:`https://flagcdn.com/w20/${Pt}.png`,srcSet:`https://flagcdn.com/w40/${Pt}.png 2x`,alt:ve.label,onError:cr=>{cr.currentTarget.style.display="none"}}),g.jsxs("span",{className:"text-gray-500",children:["+",ve.phone]})]},`${ve.code}-${Ze}`)})}):g.jsx("div",{className:"px-16 py-8 text-gray-500 text-body-s",children:u("no_countries_found")})})]})]})},jk={bgColor:"bg-blue-100",fillColor:"bg-blue-500"},Lk={bgColor:"bg-aqua-100",fillColor:"bg-aqua-500"},Rk=e=>{switch(e){case"aqua":return Lk;case"blue":default:return jk}},Fk=({progress:e,showPercentage:t=!1,color:n,className:r="",...s})=>{const{defaultColorScheme:o}=Ue(),a=n||o,{bgColor:c,fillColor:u}=Rk(a),d=Math.min(Math.max(e,0),100);return g.jsxs("div",{className:`flex items-center gap-12 ${r}`,...s,children:[g.jsx("div",{className:`w-full h-8 ${c} rounded-full`,children:g.jsx("div",{className:`h-full ${u} rounded-full transition-all duration-300 ease-in-out`,style:{width:`${d}%`}})}),t&&g.jsxs("span",{className:"text-sm text-gray-400 font-500",children:[d,"%"]})]})},Vk=()=>{const[e,t]=O.useState(!1),n=O.useRef(null),r=()=>{t(!0),setTimeout(()=>{var o;return(o=n.current)==null?void 0:o.focus()},100)},s=()=>{t(!1)};return g.jsx("div",{className:"relative flex items-center",children:g.jsxs("div",{className:`flex items-center justify-center bg-white shadow-md rounded-full transition-all duration-300 ease-in-out ${e?"w-[200px] h-[40px]":"size-[40px]"}`,children:[g.jsx("button",{onClick:r,className:"size-[40px] flex items-center justify-center rounded-full hover:bg-gray-100 transition-all",children:g.jsx(Pe,{icon:GD})}),g.jsx("input",{ref:n,type:"text",className:`w-full outline-none bg-transparent transition-all ${e?"w-full pr-[10px]":"w-0"}`,placeholder:"Buscar...",onBlur:s,style:{border:"none",outline:"none"}})]})})},Bk="w-fit transition-colors ease-in-out duration-200 flex items-center justify-center gap-12 px-24 py-7 text-base rounded-full font-600 bg-transparent",Wk={true:"bg-blue-100 text-blue-500 hover:bg-blue-100/80 active:bg-blue-100/50 !bg-blue-100",false:"text-gray-800 hover:bg-blue-100/40 hover:text-blue-500 active:bg-blue-100/20 active:text-blue-500"},Uk={true:"bg-aqua-100 text-aqua-500 hover:bg-aqua-100/80 active:bg-aqua-100/50 !bg-aqua-100",false:"text-gray-800 hover:bg-aqua-100/40 hover:text-aqua-500 active:bg-aqua-100/20 active:text-aqua-500"},zk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=Uk[n];break;case"blue":default:r=Wk[n];break}return Ln(Bk,r)},Gk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${zk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx(Pe,{icon:a,className:Do()}),e]})},Yk="w-fit transition-colors group ease-in-out duration-200 flex flex-col items-center justify-center gap-12 text-base font-600",Hk={true:"text-blue-500 hover:text-blue-500",false:"text-gray-800 hover:text-blue-500"},qk={true:"text-aqua-500 hover:text-aqua-500",false:"text-gray-800 hover:text-aqua-500"},Kk="flex h-32 w-32 items-center justify-center transition-colors ease-in-out duration-200 rounded-full",Xk={true:"text-blue-500 bg-blue-100 rounded-full",false:"text-gray-800 hover:text-blue-500 active:text-blue-500 group-hover:bg-blue-100 group-hover:text-blue-500"},Zk={true:"text-aqua-500 bg-aqua-100 rounded-full",false:"text-gray-800 hover:text-aqua-500 active:text-aqua-500 group-hover:bg-aqua-100 group-hover:text-aqua-500"},O2=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"blue":r=Xk[n];break;case"aqua":default:r=Zk[n];break}return Ln(Kk,r)},Jk=(e=!1,t="blue")=>{const n=String(e);let r;switch(t){case"aqua":r=qk[n];break;case"blue":default:r=Hk[n];break}return Ln(Yk,r)},Qk=({label:e,href:t,onClick:n,active:r=!1,disabled:s=!1,className:o,icon:a,color:c})=>{const{defaultColorScheme:u}=Ue(),d=c||u,h=m=>{if(s){m.preventDefault();return}n==null||n(m)},p=`${Jk(r,d)} ${s?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return t?g.jsxs("a",{href:t,className:`${p} ${o||""}`,onClick:h,"aria-disabled":s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]}):g.jsxs("button",{className:`${p} ${o||""}`,onClick:h,disabled:s,children:[a&&g.jsx("div",{className:O2(r,d),children:g.jsx(Pe,{icon:a,className:"size-16 max-h-16 max-w-16"})}),e]})},ej=e=>{const{display:t,...n}=e;return t==="desktop"?g.jsx(Gk,{...n}):t==="mobile"?g.jsx(Qk,{...n}):null},tj=({options:e,name:t,control:n,label:r="",placeholder:s="Type to search...",className:o="",input:a=!0,dropdownStyle:c={},innerClassName:u="",showChevron:d=!0,size:h="md"})=>{const{field:{value:p,onChange:m},fieldState:{error:x}}=vr.useController({name:t,control:n});return g.jsx(nj,{options:e,value:p,onChange:m,label:r,placeholder:s,error:x==null?void 0:x.message,className:o,input:a,dropdownStyle:c,innerClassName:u,showChevron:d,size:h})},nj=({options:e,value:t,onChange:n,label:r="Select an option",placeholder:s="Type to search...",error:o,input:a=!0,className:c="",dropdownStyle:u={},innerClassName:d="",showChevron:h=!0,size:p="md"})=>{var X;const{t:m}=Ue(),[x,S]=O.useState(!1),[b,T]=O.useState(""),[v,A]=O.useState(t||null),C=O.useRef(null),I=O.useRef(null),D={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16"}}[p],{x:R,y:F,strategy:W,refs:Q,context:ee}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:I})],placement:"bottom-start",whileElementsMounted:Qn}),ae=rr(ee),ge=sr(ee),{getReferenceProps:de,getFloatingProps:le}=or([ae,ge]),{isMounted:ue,styles:Y}=ar(ee,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),z=(()=>{const U=Array.isArray(e)?e:[];if(!b.trim())return U;const re=b.toLowerCase();return U.filter(B=>B.label.toLowerCase().includes(re)||B.key.toLowerCase().includes(re))})(),K=U=>{A(U),S(!1),T(""),n(U)},$=()=>{S(!x),!x&&C.current&&setTimeout(()=>{var U;return(U=C.current)==null?void 0:U.focus()},100)};O.useEffect(()=>{A(t)},[t]);const k=de({onClick:$});return g.jsxs("div",{className:`relative flex flex-col ${D.gap} ${c}`,children:[r&&g.jsx("h6",{className:`text-gray-600 font-600 ${o?"!text-red-500":""} ${D.label}`,children:r}),g.jsxs("div",{ref:Q.setReference,className:`${d} flex items-center justify-between bg-light rounded-full border transition-all duration-200
|
|
756
756
|
${D.container} cursor-pointer hover:border-blue-400
|
|
757
757
|
${o?"border-red-500 hover:border-red-600":""}
|
|
758
758
|
${x?"border-blue-400":"border-blue-100"}`,...k,children:[g.jsx("div",{className:"flex items-center w-full overflow-hidden",children:g.jsx("span",{className:`flex-grow font-600 truncate ${D.text} ${v?"":"text-gray-400"}`,children:m(v?v.label:s)})}),h&&g.jsx("svg",{className:`${D.icon} transition-transform ${x?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),o&&g.jsx("p",{className:`font-500 text-red-500 leading-none ${D.error}`,children:o}),ue&&g.jsxs("div",{ref:Q.setFloating,style:{position:W,top:F??0,left:R??0,...Y,width:(X=Q.reference.current)==null?void 0:X.clientWidth,zIndex:50,...u},className:"bg-white border border-blue-400 rounded-3xl shadow-lg overflow-hidden",...le(),children:[a&&g.jsx("div",{className:"sticky top-0 bg-white p-8 border-b border-gray-100 z-20",children:g.jsxs("div",{className:"relative",children:[g.jsx("div",{className:"absolute inset-y-0 left-0 pl-12 flex items-center pointer-events-none",children:g.jsx("svg",{className:"h-16 w-16 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),g.jsx("input",{ref:C,type:"text",className:"w-full py-8 pl-40 pr-12 rounded-full focus:outline-none text-body-s",placeholder:m("search_options"),value:b,onChange:U=>T(U.target.value),onClick:U=>U.stopPropagation(),autoFocus:!0})]})}),g.jsx("div",{className:"max-h-[250px] overflow-y-auto",children:z.length>0?g.jsx("ul",{className:"py-4",children:z.map((U,re)=>g.jsx("li",{className:`flex items-center px-16 py-10 transition-all duration-200 hover:bg-blue-50 cursor-pointer
|
|
@@ -786,7 +786,7 @@ attempted value: ${a}
|
|
|
786
786
|
group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
787
787
|
|
|
788
788
|
group-disabled:bg-gray-500
|
|
789
|
-
`,children:[a&&a,g.jsx("input",{id:n,name:n,disabled:o,placeholder:r,value:p,onChange:P=>m(P.target.value),onBlur:S,ref:x,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${A.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden`,...h}),c&&c]}),g.jsx("h4",{className:`font-500 text-red-500 leading-none ${A.error}`,children:
|
|
789
|
+
`,children:[a&&a,g.jsx("input",{id:n,name:n,disabled:o,placeholder:r,value:p,onChange:P=>m(P.target.value),onBlur:S,ref:x,className:`group bg-transparent w-full h-full font-600 placeholder:font-600 ${A.text} disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden`,...h}),c&&c]}),(b==null?void 0:b.message)&&g.jsx("h4",{className:`font-500 text-red-500 leading-none ${A.error}`,children:T(b.message,{x:I||C})})]})},mj=({label:e,value:t,className:n})=>g.jsxs("div",{className:`flex flex-col gap-4 ${n||""}`,children:[g.jsx("p",{className:"text-lg font-600 text-gray-800",children:e}),g.jsx("p",{className:"text-base font-400 text-gray-600",children:t})]}),I2=({options:e,onChange:t,value:n,disabled:r,error:s,label:o="",placeholder:a="",allowSearch:c=!1,className:u="",innerClassName:d="",dropdownStyle:h={},showChevron:p=!0,size:m="md"})=>{const[x,S]=O.useState(!1),[b,T]=O.useState(""),v=O.useRef(null),A=O.useRef(null),C=e.find(U=>U.value===n),P={sm:{container:"px-16 py-8",text:"text-sm",label:"text-sm",error:"text-sm",gap:"gap-8",icon:"w-12 h-12",option:"text-sm"},md:{container:"p-16",text:"text-14",label:"text-14",error:"text-sm",gap:"gap-8",icon:"w-16 h-16",option:"text-14"}}[m],D=O.useMemo(()=>e.map(U=>({...U,searchableLabel:typeof U.label=="string"?U.label:O.isValidElement(U.label)?gl(U.label):String(U.label),searchableValue:String(U.value)})),[e]),R=O.useMemo(()=>{const U={keys:[{name:"searchableLabel",weight:2},{name:"searchableValue",weight:1}],threshold:.2,distance:150,includeScore:!0,includeMatches:!0,ignoreLocation:!0,minMatchCharLength:1,shouldSort:!0,findAllMatches:!0};return new cT(D,U)},[D]),{x:F,y:W,strategy:Q,refs:ee,context:ae}=ir({open:x,onOpenChange:S,middleware:[er(8),nr(),tr({padding:8}),Rr({apply({availableHeight:U,elements:re}){Object.assign(re.floating.style,{maxHeight:`${Math.min(U-10,300)}px`})},padding:8}),ms({element:A})],placement:"bottom-start",whileElementsMounted:Qn}),ge=rr(ae),de=sr(ae),{getReferenceProps:le,getFloatingProps:ue}=or([ge,de]),{isMounted:Y,styles:z}=ar(ae,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),K=O.useMemo(()=>b.trim()?R.search(b).map(re=>({...re.item,score:re.score,matches:re.matches})):e,[b,R,e]),$=U=>{t(U.value),S(!1),T("")},X=le({onClick:()=>{r||(S(!x),!x&&v.current&&c&&setTimeout(()=>{var U;return(U=v.current)==null?void 0:U.focus()},100))}});return g.jsxs("div",{className:`relative flex flex-col ${P.gap} ${u}`,children:[o&&g.jsx("h6",{className:`text-gray-600 font-600 group ${s?"!text-red-500":""} ${P.label} ${r?"text-gray-300":""}`,children:o}),g.jsxs("div",{ref:ee.setReference,className:`${d} flex items-center justify-between bg-light rounded-full
|
|
790
790
|
${P.container} cursor-pointer border transition-all duration-200
|
|
791
791
|
${r?"opacity-60 cursor-not-allowed":"hover:border-blue-400"}
|
|
792
792
|
${s?"border-red-500 hover:border-red-600":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../_virtual/
|
|
1
|
+
import { __module as r } from "../../_virtual/index5.js";
|
|
2
2
|
import { __require as s } from "./node_modules/react-is/index.js";
|
|
3
3
|
import { __require as t } from "./factoryWithTypeCheckers.js";
|
|
4
4
|
import { __require as p } from "./factoryWithThrowingShims.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as v } from "../../_virtual/
|
|
2
|
-
import { t as U } from "../../_virtual/
|
|
3
|
-
import oe from "../../_virtual/
|
|
1
|
+
import { p as v } from "../../_virtual/index2.js";
|
|
2
|
+
import { t as U } from "../../_virtual/index3.js";
|
|
3
|
+
import oe from "../../_virtual/index4.js";
|
|
4
4
|
const ce = Object.prototype.toString, he = Error.prototype.toString, fe = RegExp.prototype.toString, de = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", pe = /^Symbol\((.*)\)(.*)$/;
|
|
5
5
|
function me(n) {
|
|
6
6
|
return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
|