digital-rabbit-cl 1.0.34 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Form/Form.d.ts +12 -4
- package/dist/components/Form/Form.d.ts.map +1 -1
- package/dist/components/Form/FormCheckbox.d.ts +8 -0
- package/dist/components/Form/FormCheckbox.d.ts.map +1 -0
- package/dist/components/Form/FormField.d.ts +21 -0
- package/dist/components/Form/FormField.d.ts.map +1 -0
- package/dist/components/Form/FormInput.d.ts +8 -0
- package/dist/components/Form/FormInput.d.ts.map +1 -0
- package/dist/components/Form/FormRadio.d.ts +9 -0
- package/dist/components/Form/FormRadio.d.ts.map +1 -0
- package/dist/components/Form/FormSelect.d.ts +8 -0
- package/dist/components/Form/FormSelect.d.ts.map +1 -0
- package/dist/components/Form/FormTextarea.d.ts +8 -0
- package/dist/components/Form/FormTextarea.d.ts.map +1 -0
- package/dist/components/Form/index.d.ts +15 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/FormError/FormError.d.ts +9 -0
- package/dist/components/FormError/FormError.d.ts.map +1 -0
- package/dist/components/FormError/index.d.ts +3 -0
- package/dist/components/FormError/index.d.ts.map +1 -0
- package/dist/components/FormGroup/FormGroup.d.ts +17 -0
- package/dist/components/FormGroup/FormGroup.d.ts.map +1 -0
- package/dist/components/FormGroup/index.d.ts +3 -0
- package/dist/components/FormGroup/index.d.ts.map +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts +1 -0
- package/dist/components/FormLabel/FormLabel.d.ts.map +1 -1
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +1 -0
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/digital-rabbit-cl.es.js +2270 -601
- package/dist/digital-rabbit-cl.umd.js +11 -11
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/package.json +5 -2
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.Button-module__button___2ZuB7{border-width:.15em;border-style:solid;cursor:pointer;font-weight:700;line-height:1.25;outline:none}.Button-module__button___2ZuB7:disabled{cursor:default}.Button-module__sizeSmall___DRT8P{padding:.1em .5em}.Button-module__sizeDefault___iwWOV{padding:.25em .5em}.Checkbox-module__container___aV9qz{display:flex;align-items:center;line-height:1.2}.Checkbox-module__svg___kkluC{flex-shrink:0}.Checkbox-module__label___cwRtI{font-weight:700;margin-left:.35em;-webkit-user-select:none;user-select:none}:root{--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-size: 16px;--line-height: 1.5;--font-weight-header: 700;--primary-color: #000;--background-color: #fff;--accent-color: #0066cc;--font-size-h1: 2.5rem;--font-size-h2: 1.75rem;--font-size-h3: 1.38316rem;--font-size-h4: 1rem;--font-size-h5: .85028rem;--font-size-h6: .78405rem;--breakpoint-xs: 350px;--breakpoint-sm: 475px;--breakpoint-md: 769px;--breakpoint-lg: 1025px;--layout-max-width: 1280px;--layout-wrapper-padding-sm: .5rem;--layout-wrapper-padding: 1rem}html{line-height:var(--line-height);-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:var(--font-size);font-family:var(--font-family);box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}body{margin:0;font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);color:var(--primary-color);background-color:var(--background-color);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:var(--font-weight-header)}h1{font-size:var(--font-size-h1)}h2{font-size:var(--font-size-h2)}h3{font-size:var(--font-size-h3)}h4{font-size:var(--font-size-h4)}h5{font-size:var(--font-size-h5)}h6{font-size:var(--font-size-h6)}hr{box-sizing:content-box;height:0;overflow:visible;border:0;border-top:1px solid rgba(0,0,0,.1);margin:1em 0}pre{font-family:monospace,monospace;font-size:1em;overflow:auto}a{background-color:transparent;text-decoration:none}a:link{color:var(--accent-color)}a:hover{text-decoration:underline}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none;max-width:100%;height:auto;vertical-align:middle}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--line-height);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;cursor:pointer}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item;cursor:pointer}template,[hidden]{display:none}table{border-collapse:collapse;width:100%}ul,ol{padding-left:1.5em}p{margin-top:0;margin-bottom:1em}.FormLabel-module__label___0M-fo{display:inline-block;font-weight:700;padding-bottom:.25em}.FormLabel-module__label___0M-fo.FormLabel-module__disabled___ktIFp{opacity:.5;cursor:not-allowed}.FormLabel-module__label___0M-fo:not(.FormLabel-module__disabled___ktIFp){cursor:default}.Input-module__input___WjT81{background-color:transparent;border-width:.15em;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Input-module__input___WjT81::placeholder{color:inherit;opacity:var(--placeholder-opacity, .3)}.Input-module__input___WjT81:disabled{opacity:.3}.Input-module__sizeSmall___NFvsi{padding:.1em .25em}.Input-module__sizeDefault___AxPA0{padding:.25em .5em}.
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
button:
|
|
6
|
-
sizeSmall:
|
|
7
|
-
sizeDefault:
|
|
8
|
-
},
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.Button-module__button___2ZuB7{border-width:.15em;border-style:solid;cursor:pointer;font-weight:700;line-height:1.25;outline:none}.Button-module__button___2ZuB7:disabled{cursor:default}.Button-module__sizeSmall___DRT8P{padding:.1em .5em}.Button-module__sizeDefault___iwWOV{padding:.25em .5em}.Checkbox-module__container___aV9qz{display:flex;align-items:center;line-height:1.2}.Checkbox-module__svg___kkluC{flex-shrink:0}.Checkbox-module__label___cwRtI{font-weight:700;margin-left:.35em;-webkit-user-select:none;user-select:none}:root{--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;--font-size: 16px;--line-height: 1.5;--font-weight-header: 700;--primary-color: #000;--background-color: #fff;--accent-color: #0066cc;--font-size-h1: 2.5rem;--font-size-h2: 1.75rem;--font-size-h3: 1.38316rem;--font-size-h4: 1rem;--font-size-h5: .85028rem;--font-size-h6: .78405rem;--breakpoint-xs: 350px;--breakpoint-sm: 475px;--breakpoint-md: 769px;--breakpoint-lg: 1025px;--layout-max-width: 1280px;--layout-wrapper-padding-sm: .5rem;--layout-wrapper-padding: 1rem}html{line-height:var(--line-height);-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:var(--font-size);font-family:var(--font-family);box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}body{margin:0;font-family:var(--font-family);font-size:var(--font-size);line-height:var(--line-height);color:var(--primary-color);background-color:var(--background-color);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}main{display:block}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:var(--font-weight-header)}h1{font-size:var(--font-size-h1)}h2{font-size:var(--font-size-h2)}h3{font-size:var(--font-size-h3)}h4{font-size:var(--font-size-h4)}h5{font-size:var(--font-size-h5)}h6{font-size:var(--font-size-h6)}hr{box-sizing:content-box;height:0;overflow:visible;border:0;border-top:1px solid rgba(0,0,0,.1);margin:1em 0}pre{font-family:monospace,monospace;font-size:1em;overflow:auto}a{background-color:transparent;text-decoration:none}a:link{color:var(--accent-color)}a:hover{text-decoration:underline}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none;max-width:100%;height:auto;vertical-align:middle}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--line-height);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;cursor:pointer}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto;resize:vertical}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item;cursor:pointer}template,[hidden]{display:none}table{border-collapse:collapse;width:100%}ul,ol{padding-left:1.5em}p{margin-top:0;margin-bottom:1em}.FormLabel-module__label___0M-fo{display:inline-block;font-weight:700;padding-bottom:.25em}.FormLabel-module__label___0M-fo.FormLabel-module__disabled___ktIFp{opacity:.5;cursor:not-allowed}.FormLabel-module__label___0M-fo:not(.FormLabel-module__disabled___ktIFp){cursor:default}.FormError-module__formError___kaUBn{font-size:.875em;margin-top:.25rem;font-weight:400}.FormGroup-module__formGroup___aVI-B{display:flex;flex-direction:column;margin-bottom:.5em}.FormGroup-module__inputWrapper___429QE{display:flex;flex-direction:column;gap:.5em}.FormGroup-module__formGroup___aVI-B.FormGroup-module__error___3axpm .FormGroup-module__inputWrapper___429QE input,.FormGroup-module__formGroup___aVI-B.FormGroup-module__error___3axpm .FormGroup-module__inputWrapper___429QE textarea,.FormGroup-module__formGroup___aVI-B.FormGroup-module__error___3axpm .FormGroup-module__inputWrapper___429QE select{border-color:currentColor}.FormGroup-module__formGroup___aVI-B.FormGroup-module__disabled___W-tJ0{opacity:.6;pointer-events:none}.FormGroup-module__required___mO3xA{color:inherit;margin-left:.125em}.FormGroup-module__errorMessage___SHzl3{font-size:.875em;margin-top:.25rem;font-weight:400}.Input-module__input___WjT81{background-color:transparent;border-width:.15em;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Input-module__input___WjT81::placeholder{color:inherit;opacity:var(--placeholder-opacity, .3)}.Input-module__input___WjT81:disabled{opacity:.3}.Input-module__sizeSmall___NFvsi{padding:.1em .25em}.Input-module__sizeDefault___AxPA0{padding:.25em .5em}.Textarea-module__textarea___Z-y6g{background-color:transparent;border-width:.15em;border-style:solid;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Textarea-module__textarea___Z-y6g:disabled{opacity:.3}.Textarea-module__sizeSmall___HHFEM{padding:.1em .25em}.Textarea-module__sizeDefault___LL2Uc{padding:.25em .5em}.Select-module__select___cjdcr{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;background-position:right center;background-repeat:no-repeat;background-size:auto 85%;border-width:.15em;border-style:solid;border-radius:0;box-sizing:border-box;display:block;font-weight:700;line-height:1.25;outline:none;width:100%}.Select-module__select___cjdcr:disabled{cursor:default;opacity:.3}.Select-module__select___cjdcr:not(:disabled){cursor:pointer}.Select-module__sizeSmall___i1quj{padding:.1em 1.75em .1em .25em}.Select-module__sizeDefault___EiWvW{padding:.25em 2em .25em .5em}.Radio-module__container___AQxhk{display:flex;align-items:center;line-height:1.25}.Radio-module__svg___zl5kF{flex-shrink:0}.Radio-module__label___vAFIP{font-weight:700;margin-left:.35em;-webkit-user-select:none;user-select:none}.Hamburger-module__hamburger___Tf4-t{background:transparent;border:none;cursor:pointer;display:none;flex-direction:column;justify-content:space-around;height:2em;outline:none;padding:0;position:fixed;right:1em;width:2em;z-index:11}.Hamburger-module__line___gybZM{background:currentColor;border-radius:var(--hamburger-border-radius, 10px);height:.25em;position:relative;transform-origin:1px;transition:all .3s linear;width:2em}.Hamburger-module__line___gybZM:first-child{transform:rotate(0)}.Hamburger-module__line___gybZM:nth-child(2){opacity:1;transform:translate(0)}.Hamburger-module__line___gybZM:nth-child(3){transform:rotate(0)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:first-child{transform:rotate(45deg)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:nth-child(2){opacity:0;transform:translate(20px)}.Hamburger-module__hamburger___Tf4-t.Hamburger-module__open___gRswh .Hamburger-module__line___gybZM:nth-child(3){transform:rotate(-45deg)}.Header-module__header___RUooH{width:100%}.Header-module__container___t68M9{display:flex;align-items:center;justify-content:space-between;margin:0 auto;font-size:var(--header-font-size);max-width:var(--header-max-width);padding:var(--header-padding)}.ResponsiveNav-module__nav___xOfv5{display:flex}.ResponsiveNav-module__nav___xOfv5>*,.ResponsiveNav-module__nav___xOfv5>a{color:inherit;font-weight:700;text-decoration:none}.ResponsiveNav-module__navMobile___h795P{background:var(--mobile-nav-background, #0066cc);color:var(--mobile-nav-color, #000);flex-direction:column;font-size:2rem;height:100vh;padding-top:4.25rem;position:fixed;top:0;right:0;text-align:left;text-transform:uppercase;transition:transform .3s ease-in-out;width:100%;z-index:10;transform:translate(100%)}.ResponsiveNav-module__navMobile___h795P.ResponsiveNav-module__open___WDCAf{transform:translate(0)}.ResponsiveNav-module__navMobile___h795P>a{padding:.5rem 3rem;text-align:center;width:100%}.ResponsiveNav-module__navMobile___h795P>a.active,.ResponsiveNav-module__navMobile___h795P>a:hover{background:var(--mobile-nav-active-background, #000);color:var(--mobile-nav-active-color, #0066cc)}.ResponsiveNav-module__navMobile___h795P>button{align-self:center;margin:.75rem 2rem}.ResponsiveNav-module__navMobile___h795P>button:hover{color:var(--mobile-nav-button-hover-text-color, #4381c1)!important}.ResponsiveNav-module__navDesktop___9wscZ{align-items:center;flex-direction:row;height:auto}.ResponsiveNav-module__navDesktop___9wscZ>*{margin-left:1.25rem}.ResponsiveNav-module__navDesktop___9wscZ>a.active,.ResponsiveNav-module__navDesktop___9wscZ>a:hover{opacity:.5}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { jsx as k, jsxs as ne, Fragment as Qe } from "react/jsx-runtime";
|
|
3
|
+
import V, { createContext as mr, useContext as hr, useState as Je, useLayoutEffect as gr, useMemo as Mt, useSyncExternalStore as _r, useRef as ht, useEffect as He } from "react";
|
|
4
|
+
const pr = "Button-module__button___2ZuB7", vr = "Button-module__sizeSmall___DRT8P", br = "Button-module__sizeDefault___iwWOV", Ve = {
|
|
5
|
+
button: pr,
|
|
6
|
+
sizeSmall: vr,
|
|
7
|
+
sizeDefault: br
|
|
8
|
+
}, Sr = ({
|
|
9
9
|
isActive: e,
|
|
10
|
-
disabled:
|
|
11
|
-
buttonColor:
|
|
10
|
+
disabled: r,
|
|
11
|
+
buttonColor: t = "#FFF",
|
|
12
12
|
textColor: s = "#000",
|
|
13
|
-
hoverColor:
|
|
14
|
-
hoverTextColor:
|
|
15
|
-
outline:
|
|
13
|
+
hoverColor: n,
|
|
14
|
+
hoverTextColor: o,
|
|
15
|
+
outline: a
|
|
16
16
|
}) => {
|
|
17
|
-
let
|
|
18
|
-
|
|
17
|
+
let l, d, h;
|
|
18
|
+
a ? (l = "transparent", d = t, h = t, e && (l = n || t, d = n || t, h = o || s)) : (l = t, d = t, h = s, e && (l = n || t, d = n || t, h = o || s));
|
|
19
19
|
let f = 1;
|
|
20
|
-
return
|
|
21
|
-
backgroundColor:
|
|
22
|
-
borderColor:
|
|
23
|
-
color:
|
|
20
|
+
return r ? f = 0.3 : e && (f = n || a ? 1 : 0.75), {
|
|
21
|
+
backgroundColor: l,
|
|
22
|
+
borderColor: d,
|
|
23
|
+
color: h,
|
|
24
24
|
opacity: f
|
|
25
25
|
};
|
|
26
|
-
},
|
|
27
|
-
primary: "#
|
|
28
|
-
secondary: "#
|
|
26
|
+
}, gt = {
|
|
27
|
+
primary: "#000",
|
|
28
|
+
secondary: "#FFF",
|
|
29
29
|
accent: "#4381C1",
|
|
30
30
|
error: "#F00",
|
|
31
31
|
success: "#008000",
|
|
32
32
|
warning: "#FFEB3B"
|
|
33
|
-
},
|
|
34
|
-
colors:
|
|
33
|
+
}, ue = {
|
|
34
|
+
colors: gt,
|
|
35
35
|
fonts: {
|
|
36
36
|
color: "#000",
|
|
37
37
|
lineHeight: 1.5,
|
|
@@ -49,7 +49,7 @@ const ne = "Button-module__button___2ZuB7", ae = "Button-module__sizeSmall___DRT
|
|
|
49
49
|
buttons: {
|
|
50
50
|
textColor: "#FFF",
|
|
51
51
|
primary: {
|
|
52
|
-
textColor:
|
|
52
|
+
textColor: gt.secondary
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
borderRadius: "0px",
|
|
@@ -64,185 +64,186 @@ const ne = "Button-module__button___2ZuB7", ae = "Button-module__sizeSmall___DRT
|
|
|
64
64
|
wrapperPaddingSm: "0.5rem",
|
|
65
65
|
wrapperPadding: "1rem"
|
|
66
66
|
}
|
|
67
|
-
},
|
|
67
|
+
}, Tt = mr(ue), io = ({ theme: e = {}, children: r }) => {
|
|
68
68
|
var s;
|
|
69
|
-
const
|
|
70
|
-
...
|
|
69
|
+
const t = {
|
|
70
|
+
...ue,
|
|
71
71
|
...e,
|
|
72
72
|
colors: {
|
|
73
|
-
...
|
|
73
|
+
...ue.colors,
|
|
74
74
|
...e.colors
|
|
75
75
|
},
|
|
76
76
|
fonts: {
|
|
77
|
-
...
|
|
77
|
+
...ue.fonts,
|
|
78
78
|
...e.fonts
|
|
79
79
|
},
|
|
80
80
|
buttons: {
|
|
81
|
-
...
|
|
81
|
+
...ue.buttons,
|
|
82
82
|
...e.buttons,
|
|
83
83
|
primary: {
|
|
84
|
-
...
|
|
84
|
+
...ue.buttons.primary,
|
|
85
85
|
...(s = e.buttons) == null ? void 0 : s.primary
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
breakpoints: {
|
|
89
|
-
...
|
|
89
|
+
...ue.breakpoints,
|
|
90
90
|
...e.breakpoints
|
|
91
91
|
},
|
|
92
92
|
layout: {
|
|
93
|
-
...
|
|
93
|
+
...ue.layout,
|
|
94
94
|
...e.layout
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
},
|
|
97
|
+
return /* @__PURE__ */ k(Tt.Provider, { value: t, children: r });
|
|
98
|
+
}, q = () => hr(Tt), ao = ({
|
|
99
99
|
color: e,
|
|
100
|
-
hoverColor:
|
|
101
|
-
hoverTextColor:
|
|
100
|
+
hoverColor: r,
|
|
101
|
+
hoverTextColor: t,
|
|
102
102
|
textColor: s,
|
|
103
|
-
outline:
|
|
104
|
-
size:
|
|
105
|
-
type:
|
|
106
|
-
buttonProps:
|
|
107
|
-
children:
|
|
108
|
-
disabled:
|
|
103
|
+
outline: n = !1,
|
|
104
|
+
size: o,
|
|
105
|
+
type: a = "button",
|
|
106
|
+
buttonProps: l = {},
|
|
107
|
+
children: d,
|
|
108
|
+
disabled: h = !1,
|
|
109
109
|
onClick: f,
|
|
110
|
-
fontSize:
|
|
110
|
+
fontSize: g
|
|
111
111
|
}) => {
|
|
112
|
-
const
|
|
113
|
-
let
|
|
114
|
-
s ?
|
|
115
|
-
const
|
|
116
|
-
...
|
|
117
|
-
isActive:
|
|
118
|
-
disabled:
|
|
119
|
-
buttonColor: e ||
|
|
120
|
-
textColor:
|
|
121
|
-
hoverColor:
|
|
122
|
-
hoverTextColor:
|
|
123
|
-
outline:
|
|
112
|
+
const y = q(), [x, A] = Je(!1);
|
|
113
|
+
let F;
|
|
114
|
+
s ? F = s : F = e ? y.buttons.textColor : y.buttons.primary.textColor;
|
|
115
|
+
const P = {
|
|
116
|
+
...Sr({
|
|
117
|
+
isActive: x,
|
|
118
|
+
disabled: h,
|
|
119
|
+
buttonColor: e || y.colors.primary,
|
|
120
|
+
textColor: F,
|
|
121
|
+
hoverColor: r,
|
|
122
|
+
hoverTextColor: t,
|
|
123
|
+
outline: n
|
|
124
124
|
}),
|
|
125
|
-
fontSize:
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
125
|
+
fontSize: g || y.fonts.size
|
|
126
|
+
}, b = [
|
|
127
|
+
Ve.button,
|
|
128
|
+
o === "small" ? Ve.sizeSmall : Ve.sizeDefault,
|
|
129
|
+
n ? Ve.outline : ""
|
|
130
130
|
].filter(Boolean).join(" ");
|
|
131
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ k(
|
|
132
132
|
"button",
|
|
133
133
|
{
|
|
134
|
-
className:
|
|
135
|
-
disabled:
|
|
134
|
+
className: b,
|
|
135
|
+
disabled: h,
|
|
136
136
|
onClick: f,
|
|
137
|
-
onMouseEnter: () =>
|
|
138
|
-
onMouseLeave: () =>
|
|
139
|
-
type:
|
|
140
|
-
...
|
|
137
|
+
onMouseEnter: () => A(!0),
|
|
138
|
+
onMouseLeave: () => A(!1),
|
|
139
|
+
type: a,
|
|
140
|
+
...l,
|
|
141
141
|
style: {
|
|
142
|
-
...
|
|
143
|
-
...
|
|
142
|
+
...P,
|
|
143
|
+
...l.style
|
|
144
144
|
},
|
|
145
|
-
children:
|
|
145
|
+
children: d
|
|
146
146
|
}
|
|
147
147
|
);
|
|
148
148
|
};
|
|
149
|
-
var
|
|
150
|
-
function
|
|
151
|
-
if (!
|
|
149
|
+
var _t = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), xr = new Uint8Array(16);
|
|
150
|
+
function Fr() {
|
|
151
|
+
if (!_t)
|
|
152
152
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
153
|
-
return
|
|
154
|
-
}
|
|
155
|
-
var
|
|
156
|
-
for (var
|
|
157
|
-
|
|
158
|
-
function
|
|
159
|
-
var
|
|
160
|
-
return [s[e[
|
|
161
|
-
}
|
|
162
|
-
function
|
|
163
|
-
var s =
|
|
164
|
-
typeof e == "string" && (
|
|
165
|
-
var
|
|
166
|
-
if (
|
|
167
|
-
for (var
|
|
168
|
-
|
|
169
|
-
return
|
|
170
|
-
}
|
|
171
|
-
const
|
|
172
|
-
container:
|
|
173
|
-
svg:
|
|
174
|
-
label:
|
|
175
|
-
},
|
|
153
|
+
return _t(xr);
|
|
154
|
+
}
|
|
155
|
+
var Lt = [];
|
|
156
|
+
for (var we = 0; we < 256; ++we)
|
|
157
|
+
Lt[we] = (we + 256).toString(16).substr(1);
|
|
158
|
+
function Vr(e, r) {
|
|
159
|
+
var t = 0, s = Lt;
|
|
160
|
+
return [s[e[t++]], s[e[t++]], s[e[t++]], s[e[t++]], "-", s[e[t++]], s[e[t++]], "-", s[e[t++]], s[e[t++]], "-", s[e[t++]], s[e[t++]], "-", s[e[t++]], s[e[t++]], s[e[t++]], s[e[t++]], s[e[t++]], s[e[t++]]].join("");
|
|
161
|
+
}
|
|
162
|
+
function It(e, r, t) {
|
|
163
|
+
var s = r && t || 0;
|
|
164
|
+
typeof e == "string" && (r = e === "binary" ? new Array(16) : null, e = null), e = e || {};
|
|
165
|
+
var n = e.random || (e.rng || Fr)();
|
|
166
|
+
if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, r)
|
|
167
|
+
for (var o = 0; o < 16; ++o)
|
|
168
|
+
r[s + o] = n[o];
|
|
169
|
+
return r || Vr(n);
|
|
170
|
+
}
|
|
171
|
+
const wr = "Checkbox-module__container___aV9qz", kr = "Checkbox-module__svg___kkluC", Cr = "Checkbox-module__label___cwRtI", Te = {
|
|
172
|
+
container: wr,
|
|
173
|
+
svg: kr,
|
|
174
|
+
label: Cr
|
|
175
|
+
}, Er = ({
|
|
176
176
|
color: e = "#000",
|
|
177
|
-
checkmarkColor:
|
|
178
|
-
disabled:
|
|
177
|
+
checkmarkColor: r,
|
|
178
|
+
disabled: t = !1,
|
|
179
179
|
inverted: s = !1
|
|
180
180
|
}) => {
|
|
181
|
-
let
|
|
182
|
-
return
|
|
181
|
+
let n = e;
|
|
182
|
+
return r ? n = r : s && (n = "white"), {
|
|
183
183
|
boxColor: e,
|
|
184
|
-
checkmarkColor:
|
|
185
|
-
cursor:
|
|
186
|
-
opacity:
|
|
184
|
+
checkmarkColor: n,
|
|
185
|
+
cursor: t ? "default" : "pointer",
|
|
186
|
+
opacity: t ? 0.3 : 1
|
|
187
187
|
};
|
|
188
|
-
},
|
|
188
|
+
}, Ar = ({
|
|
189
189
|
checked: e = !1,
|
|
190
|
-
checkmarkColor:
|
|
191
|
-
color:
|
|
190
|
+
checkmarkColor: r,
|
|
191
|
+
color: t,
|
|
192
192
|
disabled: s = !1,
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
error: n = !1,
|
|
194
|
+
fontSize: o,
|
|
195
|
+
id: a,
|
|
195
196
|
inverted: l = !1,
|
|
196
|
-
label:
|
|
197
|
-
labelStyle:
|
|
198
|
-
name:
|
|
199
|
-
onChange:
|
|
200
|
-
style:
|
|
201
|
-
...
|
|
197
|
+
label: d,
|
|
198
|
+
labelStyle: h,
|
|
199
|
+
name: f,
|
|
200
|
+
onChange: g,
|
|
201
|
+
style: y,
|
|
202
|
+
...x
|
|
202
203
|
}) => {
|
|
203
|
-
const
|
|
204
|
-
color:
|
|
205
|
-
checkmarkColor:
|
|
204
|
+
const A = q(), F = a || It(), C = A.colors.error, P = n ? C : t || A.colors.primary, b = Er({
|
|
205
|
+
color: P,
|
|
206
|
+
checkmarkColor: r,
|
|
206
207
|
disabled: s,
|
|
207
208
|
inverted: l
|
|
208
|
-
}),
|
|
209
|
-
s ||
|
|
210
|
-
},
|
|
211
|
-
cursor:
|
|
212
|
-
fontSize:
|
|
213
|
-
opacity:
|
|
214
|
-
...
|
|
215
|
-
}, S = {
|
|
216
|
-
width: r || "1rem"
|
|
209
|
+
}), z = (B) => {
|
|
210
|
+
s || g(B);
|
|
211
|
+
}, E = {
|
|
212
|
+
cursor: b.cursor,
|
|
213
|
+
fontSize: o || A.fonts.size,
|
|
214
|
+
opacity: b.opacity,
|
|
215
|
+
...y
|
|
217
216
|
}, w = {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
217
|
+
width: o || "1rem"
|
|
218
|
+
}, I = {
|
|
219
|
+
color: b.boxColor,
|
|
220
|
+
cursor: b.cursor,
|
|
221
|
+
fontSize: o || "1rem",
|
|
222
|
+
...h
|
|
222
223
|
};
|
|
223
|
-
return /* @__PURE__ */
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ ne("div", { className: Te.container, style: E, ...x, children: [
|
|
225
|
+
/* @__PURE__ */ k(
|
|
225
226
|
"input",
|
|
226
227
|
{
|
|
227
|
-
id:
|
|
228
|
+
id: F,
|
|
228
229
|
checked: e,
|
|
229
230
|
disabled: s,
|
|
230
|
-
onChange: (
|
|
231
|
-
name:
|
|
231
|
+
onChange: (B) => z({ target: { checked: B.target.checked, name: f, type: "checkbox" } }),
|
|
232
|
+
name: f,
|
|
232
233
|
style: { display: "none" },
|
|
233
234
|
type: "checkbox"
|
|
234
235
|
}
|
|
235
236
|
),
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
+
/* @__PURE__ */ ne(
|
|
237
238
|
"svg",
|
|
238
239
|
{
|
|
239
240
|
xmlns: "http://www.w3.org/2000/svg",
|
|
240
241
|
viewBox: "0 0 100 100",
|
|
241
|
-
onClick: () =>
|
|
242
|
-
style:
|
|
243
|
-
className:
|
|
242
|
+
onClick: () => z({ target: { checked: !e, name: f, type: "checkbox" } }),
|
|
243
|
+
style: w,
|
|
244
|
+
className: Te.svg,
|
|
244
245
|
children: [
|
|
245
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ k(
|
|
246
247
|
"rect",
|
|
247
248
|
{
|
|
248
249
|
x: "0",
|
|
@@ -250,17 +251,17 @@ const me = "Checkbox-module__container___aV9qz", pe = "Checkbox-module__svg___kk
|
|
|
250
251
|
height: "100",
|
|
251
252
|
width: "100",
|
|
252
253
|
style: {
|
|
253
|
-
fill: l && e ?
|
|
254
|
+
fill: l && e ? b.boxColor : "transparent",
|
|
254
255
|
strokeWidth: "25",
|
|
255
|
-
stroke:
|
|
256
|
+
stroke: b.boxColor
|
|
256
257
|
}
|
|
257
258
|
}
|
|
258
259
|
),
|
|
259
|
-
e && /* @__PURE__ */
|
|
260
|
+
e && /* @__PURE__ */ k(
|
|
260
261
|
"path",
|
|
261
262
|
{
|
|
262
263
|
d: "M 25 45 L 45 65 L 75 30",
|
|
263
|
-
stroke:
|
|
264
|
+
stroke: b.checkmarkColor,
|
|
264
265
|
strokeWidth: "15",
|
|
265
266
|
fill: "transparent"
|
|
266
267
|
}
|
|
@@ -268,572 +269,2229 @@ const me = "Checkbox-module__container___aV9qz", pe = "Checkbox-module__svg___kk
|
|
|
268
269
|
]
|
|
269
270
|
}
|
|
270
271
|
),
|
|
271
|
-
|
|
272
|
+
d && /* @__PURE__ */ k("label", { htmlFor: F, className: Te.label, style: I, children: d })
|
|
272
273
|
] });
|
|
273
|
-
},
|
|
274
|
-
const e =
|
|
275
|
-
return
|
|
276
|
-
const
|
|
277
|
-
e.fonts && (e.fonts.fontFamily &&
|
|
274
|
+
}, lo = () => {
|
|
275
|
+
const e = q();
|
|
276
|
+
return gr(() => {
|
|
277
|
+
const r = document.documentElement;
|
|
278
|
+
e.fonts && (e.fonts.fontFamily && r.style.setProperty("--font-family", e.fonts.fontFamily), e.fonts.size && r.style.setProperty("--font-size", e.fonts.size), e.fonts.lineHeight !== void 0 && r.style.setProperty("--line-height", e.fonts.lineHeight.toString()), e.fonts.fontWeightHeader !== void 0 && r.style.setProperty("--font-weight-header", e.fonts.fontWeightHeader.toString()), e.fonts.fontSizeH1 && r.style.setProperty("--font-size-h1", e.fonts.fontSizeH1), e.fonts.fontSizeH2 && r.style.setProperty("--font-size-h2", e.fonts.fontSizeH2), e.fonts.fontSizeH3 && r.style.setProperty("--font-size-h3", e.fonts.fontSizeH3), e.fonts.fontSizeH4 && r.style.setProperty("--font-size-h4", e.fonts.fontSizeH4), e.fonts.fontSizeH5 && r.style.setProperty("--font-size-h5", e.fonts.fontSizeH5), e.fonts.fontSizeH6 && r.style.setProperty("--font-size-h6", e.fonts.fontSizeH6)), e.colors && (e.colors.primary && r.style.setProperty("--primary-color", e.colors.primary), e.colors.secondary && r.style.setProperty("--background-color", e.colors.secondary), e.colors.accent && r.style.setProperty("--accent-color", e.colors.accent)), e.breakpoints && (e.breakpoints.xs && r.style.setProperty("--breakpoint-xs", e.breakpoints.xs), e.breakpoints.sm && r.style.setProperty("--breakpoint-sm", e.breakpoints.sm), e.breakpoints.md && r.style.setProperty("--breakpoint-md", e.breakpoints.md), e.breakpoints.lg && r.style.setProperty("--breakpoint-lg", e.breakpoints.lg)), e.layout && (e.layout.maxWidth && r.style.setProperty("--layout-max-width", e.layout.maxWidth), e.layout.wrapperPaddingSm && r.style.setProperty("--layout-wrapper-padding-sm", e.layout.wrapperPaddingSm), e.layout.wrapperPadding && r.style.setProperty("--layout-wrapper-padding", e.layout.wrapperPadding));
|
|
278
279
|
}, [e]), null;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
280
|
+
};
|
|
281
|
+
var be = (e) => e.type === "checkbox", ce = (e) => e instanceof Date, Q = (e) => e == null;
|
|
282
|
+
const Bt = (e) => typeof e == "object";
|
|
283
|
+
var U = (e) => !Q(e) && !Array.isArray(e) && Bt(e) && !ce(e), $t = (e) => U(e) && e.target ? be(e.target) ? e.target.checked : e.target.value : e, zr = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ut = (e, r) => e.has(zr(r)), Dr = (e) => {
|
|
284
|
+
const r = e.constructor && e.constructor.prototype;
|
|
285
|
+
return U(r) && r.hasOwnProperty("isPrototypeOf");
|
|
286
|
+
}, Ke = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
|
|
287
|
+
function H(e) {
|
|
288
|
+
let r;
|
|
289
|
+
const t = Array.isArray(e), s = typeof FileList < "u" ? e instanceof FileList : !1;
|
|
290
|
+
if (e instanceof Date)
|
|
291
|
+
r = new Date(e);
|
|
292
|
+
else if (!(Ke && (e instanceof Blob || s)) && (t || U(e)))
|
|
293
|
+
if (r = t ? [] : Object.create(Object.getPrototypeOf(e)), !t && !Dr(e))
|
|
294
|
+
r = e;
|
|
295
|
+
else
|
|
296
|
+
for (const n in e)
|
|
297
|
+
e.hasOwnProperty(n) && (r[n] = H(e[n]));
|
|
298
|
+
else
|
|
299
|
+
return e;
|
|
300
|
+
return r;
|
|
301
|
+
}
|
|
302
|
+
var De = (e) => /^\w*$/.test(e), T = (e) => e === void 0, Ye = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Xe = (e) => Ye(e.replace(/["|']|\]/g, "").split(/\.|\[/)), p = (e, r, t) => {
|
|
303
|
+
if (!r || !U(e))
|
|
304
|
+
return t;
|
|
305
|
+
const s = (De(r) ? [r] : Xe(r)).reduce((n, o) => Q(n) ? n : n[o], e);
|
|
306
|
+
return T(s) || s === e ? T(e[r]) ? t : e[r] : s;
|
|
307
|
+
}, J = (e) => typeof e == "boolean", N = (e, r, t) => {
|
|
308
|
+
let s = -1;
|
|
309
|
+
const n = De(r) ? [r] : Xe(r), o = n.length, a = o - 1;
|
|
310
|
+
for (; ++s < o; ) {
|
|
311
|
+
const l = n[s];
|
|
312
|
+
let d = t;
|
|
313
|
+
if (s !== a) {
|
|
314
|
+
const h = e[l];
|
|
315
|
+
d = U(h) || Array.isArray(h) ? h : isNaN(+n[s + 1]) ? {} : [];
|
|
316
|
+
}
|
|
317
|
+
if (l === "__proto__" || l === "constructor" || l === "prototype")
|
|
318
|
+
return;
|
|
319
|
+
e[l] = d, e = e[l];
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
const Ee = {
|
|
323
|
+
BLUR: "blur",
|
|
324
|
+
FOCUS_OUT: "focusout",
|
|
325
|
+
CHANGE: "change"
|
|
326
|
+
}, X = {
|
|
327
|
+
onBlur: "onBlur",
|
|
328
|
+
onChange: "onChange",
|
|
329
|
+
onSubmit: "onSubmit",
|
|
330
|
+
onTouched: "onTouched",
|
|
331
|
+
all: "all"
|
|
332
|
+
}, ae = {
|
|
333
|
+
max: "max",
|
|
334
|
+
min: "min",
|
|
335
|
+
maxLength: "maxLength",
|
|
336
|
+
minLength: "minLength",
|
|
337
|
+
pattern: "pattern",
|
|
338
|
+
required: "required",
|
|
339
|
+
validate: "validate"
|
|
340
|
+
}, Ht = V.createContext(null);
|
|
341
|
+
Ht.displayName = "HookFormContext";
|
|
342
|
+
const et = () => V.useContext(Ht);
|
|
343
|
+
var jt = (e, r, t, s = !0) => {
|
|
344
|
+
const n = {
|
|
345
|
+
defaultValues: r._defaultValues
|
|
346
|
+
};
|
|
347
|
+
for (const o in e)
|
|
348
|
+
Object.defineProperty(n, o, {
|
|
349
|
+
get: () => {
|
|
350
|
+
const a = o;
|
|
351
|
+
return r._proxyFormState[a] !== X.all && (r._proxyFormState[a] = !s || X.all), t && (t[a] = !0), e[a];
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
return n;
|
|
355
|
+
};
|
|
356
|
+
const tt = typeof window < "u" ? V.useLayoutEffect : V.useEffect;
|
|
357
|
+
function Pr(e) {
|
|
358
|
+
const r = et(), { control: t = r.control, disabled: s, name: n, exact: o } = e || {}, [a, l] = V.useState(t._formState), d = V.useRef({
|
|
359
|
+
isDirty: !1,
|
|
360
|
+
isLoading: !1,
|
|
361
|
+
dirtyFields: !1,
|
|
362
|
+
touchedFields: !1,
|
|
363
|
+
validatingFields: !1,
|
|
364
|
+
isValidating: !1,
|
|
365
|
+
isValid: !1,
|
|
366
|
+
errors: !1
|
|
367
|
+
});
|
|
368
|
+
return tt(() => t._subscribe({
|
|
369
|
+
name: n,
|
|
370
|
+
formState: d.current,
|
|
371
|
+
exact: o,
|
|
372
|
+
callback: (h) => {
|
|
373
|
+
!s && l({
|
|
374
|
+
...t._formState,
|
|
375
|
+
...h
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
}), [n, s, o]), V.useEffect(() => {
|
|
379
|
+
d.current.isValid && t._setValid(!0);
|
|
380
|
+
}, [t]), V.useMemo(() => jt(a, t, d.current, !1), [a, t]);
|
|
381
|
+
}
|
|
382
|
+
var K = (e) => typeof e == "string", je = (e, r, t, s, n) => K(e) ? (s && r.watch.add(e), p(t, e, n)) : Array.isArray(e) ? e.map((o) => (s && r.watch.add(o), p(t, o))) : (s && (r.watchAll = !0), t), We = (e) => Q(e) || !Bt(e);
|
|
383
|
+
function ee(e, r, t = /* @__PURE__ */ new WeakSet()) {
|
|
384
|
+
if (We(e) || We(r))
|
|
385
|
+
return e === r;
|
|
386
|
+
if (ce(e) && ce(r))
|
|
387
|
+
return e.getTime() === r.getTime();
|
|
388
|
+
const s = Object.keys(e), n = Object.keys(r);
|
|
389
|
+
if (s.length !== n.length)
|
|
390
|
+
return !1;
|
|
391
|
+
if (t.has(e) || t.has(r))
|
|
392
|
+
return !0;
|
|
393
|
+
t.add(e), t.add(r);
|
|
394
|
+
for (const o of s) {
|
|
395
|
+
const a = e[o];
|
|
396
|
+
if (!n.includes(o))
|
|
397
|
+
return !1;
|
|
398
|
+
if (o !== "ref") {
|
|
399
|
+
const l = r[o];
|
|
400
|
+
if (ce(a) && ce(l) || U(a) && U(l) || Array.isArray(a) && Array.isArray(l) ? !ee(a, l, t) : a !== l)
|
|
401
|
+
return !1;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
return !0;
|
|
405
|
+
}
|
|
406
|
+
function Rr(e) {
|
|
407
|
+
const r = et(), { control: t = r.control, name: s, defaultValue: n, disabled: o, exact: a, compute: l } = e || {}, d = V.useRef(n), h = V.useRef(l), f = V.useRef(void 0), g = V.useRef(t), y = V.useRef(s);
|
|
408
|
+
h.current = l;
|
|
409
|
+
const [x, A] = V.useState(() => {
|
|
410
|
+
const E = t._getWatch(s, d.current);
|
|
411
|
+
return h.current ? h.current(E) : E;
|
|
412
|
+
}), F = V.useCallback((E) => {
|
|
413
|
+
const w = je(s, t._names, E || t._formValues, !1, d.current);
|
|
414
|
+
return h.current ? h.current(w) : w;
|
|
415
|
+
}, [t._formValues, t._names, s]), C = V.useCallback((E) => {
|
|
416
|
+
if (!o) {
|
|
417
|
+
const w = je(s, t._names, E || t._formValues, !1, d.current);
|
|
418
|
+
if (h.current) {
|
|
419
|
+
const I = h.current(w);
|
|
420
|
+
ee(I, f.current) || (A(I), f.current = I);
|
|
421
|
+
} else
|
|
422
|
+
A(w);
|
|
423
|
+
}
|
|
424
|
+
}, [t._formValues, t._names, o, s]);
|
|
425
|
+
tt(() => ((g.current !== t || !ee(y.current, s)) && (g.current = t, y.current = s, C()), t._subscribe({
|
|
426
|
+
name: s,
|
|
427
|
+
formState: {
|
|
428
|
+
values: !0
|
|
429
|
+
},
|
|
430
|
+
exact: a,
|
|
431
|
+
callback: (E) => {
|
|
432
|
+
C(E.values);
|
|
433
|
+
}
|
|
434
|
+
})), [t, a, s, C]), V.useEffect(() => t._removeUnmounted());
|
|
435
|
+
const P = g.current !== t, b = y.current, z = V.useMemo(() => {
|
|
436
|
+
if (o)
|
|
437
|
+
return null;
|
|
438
|
+
const E = !P && !ee(b, s);
|
|
439
|
+
return P || E ? F() : null;
|
|
440
|
+
}, [o, P, s, b, F]);
|
|
441
|
+
return z !== null ? z : x;
|
|
442
|
+
}
|
|
443
|
+
function Nr(e) {
|
|
444
|
+
const r = et(), { name: t, disabled: s, control: n = r.control, shouldUnregister: o, defaultValue: a } = e, l = Ut(n._names.array, t), d = V.useMemo(() => p(n._formValues, t, p(n._defaultValues, t, a)), [n, t, a]), h = Rr({
|
|
445
|
+
control: n,
|
|
446
|
+
name: t,
|
|
447
|
+
defaultValue: d,
|
|
448
|
+
exact: !0
|
|
449
|
+
}), f = Pr({
|
|
450
|
+
control: n,
|
|
451
|
+
name: t,
|
|
452
|
+
exact: !0
|
|
453
|
+
}), g = V.useRef(e), y = V.useRef(void 0), x = V.useRef(n.register(t, {
|
|
454
|
+
...e.rules,
|
|
455
|
+
value: h,
|
|
456
|
+
...J(e.disabled) ? { disabled: e.disabled } : {}
|
|
457
|
+
}));
|
|
458
|
+
g.current = e;
|
|
459
|
+
const A = V.useMemo(() => Object.defineProperties({}, {
|
|
460
|
+
invalid: {
|
|
461
|
+
enumerable: !0,
|
|
462
|
+
get: () => !!p(f.errors, t)
|
|
463
|
+
},
|
|
464
|
+
isDirty: {
|
|
465
|
+
enumerable: !0,
|
|
466
|
+
get: () => !!p(f.dirtyFields, t)
|
|
467
|
+
},
|
|
468
|
+
isTouched: {
|
|
469
|
+
enumerable: !0,
|
|
470
|
+
get: () => !!p(f.touchedFields, t)
|
|
471
|
+
},
|
|
472
|
+
isValidating: {
|
|
473
|
+
enumerable: !0,
|
|
474
|
+
get: () => !!p(f.validatingFields, t)
|
|
475
|
+
},
|
|
476
|
+
error: {
|
|
477
|
+
enumerable: !0,
|
|
478
|
+
get: () => p(f.errors, t)
|
|
479
|
+
}
|
|
480
|
+
}), [f, t]), F = V.useCallback((z) => x.current.onChange({
|
|
481
|
+
target: {
|
|
482
|
+
value: $t(z),
|
|
483
|
+
name: t
|
|
484
|
+
},
|
|
485
|
+
type: Ee.CHANGE
|
|
486
|
+
}), [t]), C = V.useCallback(() => x.current.onBlur({
|
|
487
|
+
target: {
|
|
488
|
+
value: p(n._formValues, t),
|
|
489
|
+
name: t
|
|
490
|
+
},
|
|
491
|
+
type: Ee.BLUR
|
|
492
|
+
}), [t, n._formValues]), P = V.useCallback((z) => {
|
|
493
|
+
const E = p(n._fields, t);
|
|
494
|
+
E && z && (E._f.ref = {
|
|
495
|
+
focus: () => z.focus && z.focus(),
|
|
496
|
+
select: () => z.select && z.select(),
|
|
497
|
+
setCustomValidity: (w) => z.setCustomValidity(w),
|
|
498
|
+
reportValidity: () => z.reportValidity()
|
|
499
|
+
});
|
|
500
|
+
}, [n._fields, t]), b = V.useMemo(() => ({
|
|
501
|
+
name: t,
|
|
502
|
+
value: h,
|
|
503
|
+
...J(s) || f.disabled ? { disabled: f.disabled || s } : {},
|
|
504
|
+
onChange: F,
|
|
505
|
+
onBlur: C,
|
|
506
|
+
ref: P
|
|
507
|
+
}), [t, s, f.disabled, F, C, P, h]);
|
|
508
|
+
return V.useEffect(() => {
|
|
509
|
+
const z = n._options.shouldUnregister || o, E = y.current;
|
|
510
|
+
E && E !== t && !l && n.unregister(E), n.register(t, {
|
|
511
|
+
...g.current.rules,
|
|
512
|
+
...J(g.current.disabled) ? { disabled: g.current.disabled } : {}
|
|
513
|
+
});
|
|
514
|
+
const w = (I, B) => {
|
|
515
|
+
const ie = p(n._fields, I);
|
|
516
|
+
ie && ie._f && (ie._f.mount = B);
|
|
517
|
+
};
|
|
518
|
+
if (w(t, !0), z) {
|
|
519
|
+
const I = H(p(n._options.defaultValues, t, g.current.defaultValue));
|
|
520
|
+
N(n._defaultValues, t, I), T(p(n._formValues, t)) && N(n._formValues, t, I);
|
|
521
|
+
}
|
|
522
|
+
return !l && n.register(t), y.current = t, () => {
|
|
523
|
+
(l ? z && !n._state.action : z) ? n.unregister(t) : w(t, !1);
|
|
524
|
+
};
|
|
525
|
+
}, [t, n, l, o]), V.useEffect(() => {
|
|
526
|
+
n._setDisabledField({
|
|
527
|
+
disabled: s,
|
|
528
|
+
name: t
|
|
529
|
+
});
|
|
530
|
+
}, [s, t, n]), V.useMemo(() => ({
|
|
531
|
+
field: b,
|
|
532
|
+
formState: f,
|
|
533
|
+
fieldState: A
|
|
534
|
+
}), [b, f, A]);
|
|
535
|
+
}
|
|
536
|
+
var rt = (e, r, t, s, n) => r ? {
|
|
537
|
+
...t[e],
|
|
538
|
+
types: {
|
|
539
|
+
...t[e] && t[e].types ? t[e].types : {},
|
|
540
|
+
[s]: n || !0
|
|
541
|
+
}
|
|
542
|
+
} : {}, pe = (e) => Array.isArray(e) ? e : [e], pt = () => {
|
|
543
|
+
let e = [];
|
|
544
|
+
return {
|
|
545
|
+
get observers() {
|
|
546
|
+
return e;
|
|
547
|
+
},
|
|
548
|
+
next: (n) => {
|
|
549
|
+
for (const o of e)
|
|
550
|
+
o.next && o.next(n);
|
|
551
|
+
},
|
|
552
|
+
subscribe: (n) => (e.push(n), {
|
|
553
|
+
unsubscribe: () => {
|
|
554
|
+
e = e.filter((o) => o !== n);
|
|
555
|
+
}
|
|
556
|
+
}),
|
|
557
|
+
unsubscribe: () => {
|
|
558
|
+
e = [];
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
function Wt(e, r) {
|
|
563
|
+
const t = {};
|
|
564
|
+
for (const s in e)
|
|
565
|
+
if (e.hasOwnProperty(s)) {
|
|
566
|
+
const n = e[s], o = r[s];
|
|
567
|
+
if (n && U(n) && o) {
|
|
568
|
+
const a = Wt(n, o);
|
|
569
|
+
U(a) && (t[s] = a);
|
|
570
|
+
} else e[s] && (t[s] = o);
|
|
571
|
+
}
|
|
572
|
+
return t;
|
|
573
|
+
}
|
|
574
|
+
var W = (e) => U(e) && !Object.keys(e).length, st = (e) => e.type === "file", te = (e) => typeof e == "function", Ae = (e) => {
|
|
575
|
+
if (!Ke)
|
|
576
|
+
return !1;
|
|
577
|
+
const r = e ? e.ownerDocument : 0;
|
|
578
|
+
return e instanceof (r && r.defaultView ? r.defaultView.HTMLElement : HTMLElement);
|
|
579
|
+
}, qt = (e) => e.type === "select-multiple", ot = (e) => e.type === "radio", Or = (e) => ot(e) || be(e), Le = (e) => Ae(e) && e.isConnected;
|
|
580
|
+
function Mr(e, r) {
|
|
581
|
+
const t = r.slice(0, -1).length;
|
|
582
|
+
let s = 0;
|
|
583
|
+
for (; s < t; )
|
|
584
|
+
e = T(e) ? s++ : e[r[s++]];
|
|
585
|
+
return e;
|
|
586
|
+
}
|
|
587
|
+
function Tr(e) {
|
|
588
|
+
for (const r in e)
|
|
589
|
+
if (e.hasOwnProperty(r) && !T(e[r]))
|
|
590
|
+
return !1;
|
|
591
|
+
return !0;
|
|
592
|
+
}
|
|
593
|
+
function $(e, r) {
|
|
594
|
+
const t = Array.isArray(r) ? r : De(r) ? [r] : Xe(r), s = t.length === 1 ? e : Mr(e, t), n = t.length - 1, o = t[n];
|
|
595
|
+
return s && delete s[o], n !== 0 && (U(s) && W(s) || Array.isArray(s) && Tr(s)) && $(e, t.slice(0, -1)), e;
|
|
596
|
+
}
|
|
597
|
+
var Lr = (e) => {
|
|
598
|
+
for (const r in e)
|
|
599
|
+
if (te(e[r]))
|
|
600
|
+
return !0;
|
|
601
|
+
return !1;
|
|
602
|
+
};
|
|
603
|
+
function Gt(e) {
|
|
604
|
+
return Array.isArray(e) || U(e) && !Lr(e);
|
|
605
|
+
}
|
|
606
|
+
function qe(e, r = {}) {
|
|
607
|
+
for (const t in e)
|
|
608
|
+
Gt(e[t]) ? (r[t] = Array.isArray(e[t]) ? [] : {}, qe(e[t], r[t])) : T(e[t]) || (r[t] = !0);
|
|
609
|
+
return r;
|
|
610
|
+
}
|
|
611
|
+
function ye(e, r, t) {
|
|
612
|
+
t || (t = qe(r));
|
|
613
|
+
for (const s in e)
|
|
614
|
+
Gt(e[s]) ? T(r) || We(t[s]) ? t[s] = qe(e[s], Array.isArray(e[s]) ? [] : {}) : ye(e[s], Q(r) ? {} : r[s], t[s]) : t[s] = !ee(e[s], r[s]);
|
|
615
|
+
return t;
|
|
616
|
+
}
|
|
617
|
+
const vt = {
|
|
618
|
+
value: !1,
|
|
619
|
+
isValid: !1
|
|
620
|
+
}, bt = { value: !0, isValid: !0 };
|
|
621
|
+
var Zt = (e) => {
|
|
622
|
+
if (Array.isArray(e)) {
|
|
623
|
+
if (e.length > 1) {
|
|
624
|
+
const r = e.filter((t) => t && t.checked && !t.disabled).map((t) => t.value);
|
|
625
|
+
return { value: r, isValid: !!r.length };
|
|
626
|
+
}
|
|
627
|
+
return e[0].checked && !e[0].disabled ? (
|
|
628
|
+
// @ts-expect-error expected to work in the browser
|
|
629
|
+
e[0].attributes && !T(e[0].attributes.value) ? T(e[0].value) || e[0].value === "" ? bt : { value: e[0].value, isValid: !0 } : bt
|
|
630
|
+
) : vt;
|
|
631
|
+
}
|
|
632
|
+
return vt;
|
|
633
|
+
}, Qt = (e, { valueAsNumber: r, valueAsDate: t, setValueAs: s }) => T(e) ? e : r ? e === "" ? NaN : e && +e : t && K(e) ? new Date(e) : s ? s(e) : e;
|
|
634
|
+
const St = {
|
|
635
|
+
isValid: !1,
|
|
636
|
+
value: null
|
|
637
|
+
};
|
|
638
|
+
var Jt = (e) => Array.isArray(e) ? e.reduce((r, t) => t && t.checked && !t.disabled ? {
|
|
639
|
+
isValid: !0,
|
|
640
|
+
value: t.value
|
|
641
|
+
} : r, St) : St;
|
|
642
|
+
function xt(e) {
|
|
643
|
+
const r = e.ref;
|
|
644
|
+
return st(r) ? r.files : ot(r) ? Jt(e.refs).value : qt(r) ? [...r.selectedOptions].map(({ value: t }) => t) : be(r) ? Zt(e.refs).value : Qt(T(r.value) ? e.ref.value : r.value, e);
|
|
645
|
+
}
|
|
646
|
+
var Ir = (e, r, t, s) => {
|
|
647
|
+
const n = {};
|
|
648
|
+
for (const o of e) {
|
|
649
|
+
const a = p(r, o);
|
|
650
|
+
a && N(n, o, a._f);
|
|
651
|
+
}
|
|
652
|
+
return {
|
|
653
|
+
criteriaMode: t,
|
|
654
|
+
names: [...e],
|
|
655
|
+
fields: n,
|
|
656
|
+
shouldUseNativeValidation: s
|
|
657
|
+
};
|
|
658
|
+
}, ze = (e) => e instanceof RegExp, he = (e) => T(e) ? e : ze(e) ? e.source : U(e) ? ze(e.value) ? e.value.source : e.value : e, Ft = (e) => ({
|
|
659
|
+
isOnSubmit: !e || e === X.onSubmit,
|
|
660
|
+
isOnBlur: e === X.onBlur,
|
|
661
|
+
isOnChange: e === X.onChange,
|
|
662
|
+
isOnAll: e === X.all,
|
|
663
|
+
isOnTouch: e === X.onTouched
|
|
664
|
+
});
|
|
665
|
+
const Vt = "AsyncFunction";
|
|
666
|
+
var Br = (e) => !!e && !!e.validate && !!(te(e.validate) && e.validate.constructor.name === Vt || U(e.validate) && Object.values(e.validate).find((r) => r.constructor.name === Vt)), $r = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), wt = (e, r, t) => !t && (r.watchAll || r.watch.has(e) || [...r.watch].some((s) => e.startsWith(s) && /^\.\w+/.test(e.slice(s.length))));
|
|
667
|
+
const ve = (e, r, t, s) => {
|
|
668
|
+
for (const n of t || Object.keys(e)) {
|
|
669
|
+
const o = p(e, n);
|
|
670
|
+
if (o) {
|
|
671
|
+
const { _f: a, ...l } = o;
|
|
672
|
+
if (a) {
|
|
673
|
+
if (a.refs && a.refs[0] && r(a.refs[0], n) && !s)
|
|
674
|
+
return !0;
|
|
675
|
+
if (a.ref && r(a.ref, a.name) && !s)
|
|
676
|
+
return !0;
|
|
677
|
+
if (ve(l, r))
|
|
678
|
+
break;
|
|
679
|
+
} else if (U(l) && ve(l, r))
|
|
680
|
+
break;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
function kt(e, r, t) {
|
|
685
|
+
const s = p(e, t);
|
|
686
|
+
if (s || De(t))
|
|
687
|
+
return {
|
|
688
|
+
error: s,
|
|
689
|
+
name: t
|
|
690
|
+
};
|
|
691
|
+
const n = t.split(".");
|
|
692
|
+
for (; n.length; ) {
|
|
693
|
+
const o = n.join("."), a = p(r, o), l = p(e, o);
|
|
694
|
+
if (a && !Array.isArray(a) && t !== o)
|
|
695
|
+
return { name: t };
|
|
696
|
+
if (l && l.type)
|
|
697
|
+
return {
|
|
698
|
+
name: o,
|
|
699
|
+
error: l
|
|
700
|
+
};
|
|
701
|
+
if (l && l.root && l.root.type)
|
|
702
|
+
return {
|
|
703
|
+
name: `${o}.root`,
|
|
704
|
+
error: l.root
|
|
705
|
+
};
|
|
706
|
+
n.pop();
|
|
707
|
+
}
|
|
708
|
+
return {
|
|
709
|
+
name: t
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
var Ur = (e, r, t, s) => {
|
|
713
|
+
t(e);
|
|
714
|
+
const { name: n, ...o } = e;
|
|
715
|
+
return W(o) || Object.keys(o).length >= Object.keys(r).length || Object.keys(o).find((a) => r[a] === (!s || X.all));
|
|
716
|
+
}, Hr = (e, r, t) => !e || !r || e === r || pe(e).some((s) => s && (t ? s === r : s.startsWith(r) || r.startsWith(s))), jr = (e, r, t, s, n) => n.isOnAll ? !1 : !t && n.isOnTouch ? !(r || e) : (t ? s.isOnBlur : n.isOnBlur) ? !e : (t ? s.isOnChange : n.isOnChange) ? e : !0, Wr = (e, r) => !Ye(p(e, r)).length && $(e, r), qr = (e, r, t) => {
|
|
717
|
+
const s = pe(p(e, t));
|
|
718
|
+
return N(s, "root", r[t]), N(e, t, s), e;
|
|
719
|
+
};
|
|
720
|
+
function Ct(e, r, t = "validate") {
|
|
721
|
+
if (K(e) || Array.isArray(e) && e.every(K) || J(e) && !e)
|
|
722
|
+
return {
|
|
723
|
+
type: t,
|
|
724
|
+
message: K(e) ? e : "",
|
|
725
|
+
ref: r
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
var fe = (e) => U(e) && !ze(e) ? e : {
|
|
729
|
+
value: e,
|
|
730
|
+
message: ""
|
|
731
|
+
}, Et = async (e, r, t, s, n, o) => {
|
|
732
|
+
const { ref: a, refs: l, required: d, maxLength: h, minLength: f, min: g, max: y, pattern: x, validate: A, name: F, valueAsNumber: C, mount: P } = e._f, b = p(t, F);
|
|
733
|
+
if (!P || r.has(F))
|
|
734
|
+
return {};
|
|
735
|
+
const z = l ? l[0] : a, E = (D) => {
|
|
736
|
+
n && z.reportValidity && (z.setCustomValidity(J(D) ? "" : D || ""), z.reportValidity());
|
|
737
|
+
}, w = {}, I = ot(a), B = be(a), ie = I || B, G = (C || st(a)) && T(a.value) && T(b) || Ae(a) && a.value === "" || b === "" || Array.isArray(b) && !b.length, re = rt.bind(null, F, s, w), se = (D, O, L, j = ae.maxLength, Z = ae.minLength) => {
|
|
738
|
+
const oe = D ? O : L;
|
|
739
|
+
w[F] = {
|
|
740
|
+
type: D ? j : Z,
|
|
741
|
+
message: oe,
|
|
742
|
+
ref: a,
|
|
743
|
+
...re(D ? j : Z, oe)
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
if (o ? !Array.isArray(b) || !b.length : d && (!ie && (G || Q(b)) || J(b) && !b || B && !Zt(l).isValid || I && !Jt(l).isValid)) {
|
|
747
|
+
const { value: D, message: O } = K(d) ? { value: !!d, message: d } : fe(d);
|
|
748
|
+
if (D && (w[F] = {
|
|
749
|
+
type: ae.required,
|
|
750
|
+
message: O,
|
|
751
|
+
ref: z,
|
|
752
|
+
...re(ae.required, O)
|
|
753
|
+
}, !s))
|
|
754
|
+
return E(O), w;
|
|
755
|
+
}
|
|
756
|
+
if (!G && (!Q(g) || !Q(y))) {
|
|
757
|
+
let D, O;
|
|
758
|
+
const L = fe(y), j = fe(g);
|
|
759
|
+
if (!Q(b) && !isNaN(b)) {
|
|
760
|
+
const Z = a.valueAsNumber || b && +b;
|
|
761
|
+
Q(L.value) || (D = Z > L.value), Q(j.value) || (O = Z < j.value);
|
|
762
|
+
} else {
|
|
763
|
+
const Z = a.valueAsDate || new Date(b), oe = (xe) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + xe), me = a.type == "time", de = a.type == "week";
|
|
764
|
+
K(L.value) && b && (D = me ? oe(b) > oe(L.value) : de ? b > L.value : Z > new Date(L.value)), K(j.value) && b && (O = me ? oe(b) < oe(j.value) : de ? b < j.value : Z < new Date(j.value));
|
|
765
|
+
}
|
|
766
|
+
if ((D || O) && (se(!!D, L.message, j.message, ae.max, ae.min), !s))
|
|
767
|
+
return E(w[F].message), w;
|
|
768
|
+
}
|
|
769
|
+
if ((h || f) && !G && (K(b) || o && Array.isArray(b))) {
|
|
770
|
+
const D = fe(h), O = fe(f), L = !Q(D.value) && b.length > +D.value, j = !Q(O.value) && b.length < +O.value;
|
|
771
|
+
if ((L || j) && (se(L, D.message, O.message), !s))
|
|
772
|
+
return E(w[F].message), w;
|
|
773
|
+
}
|
|
774
|
+
if (x && !G && K(b)) {
|
|
775
|
+
const { value: D, message: O } = fe(x);
|
|
776
|
+
if (ze(D) && !b.match(D) && (w[F] = {
|
|
777
|
+
type: ae.pattern,
|
|
778
|
+
message: O,
|
|
779
|
+
ref: a,
|
|
780
|
+
...re(ae.pattern, O)
|
|
781
|
+
}, !s))
|
|
782
|
+
return E(O), w;
|
|
783
|
+
}
|
|
784
|
+
if (A) {
|
|
785
|
+
if (te(A)) {
|
|
786
|
+
const D = await A(b, t), O = Ct(D, z);
|
|
787
|
+
if (O && (w[F] = {
|
|
788
|
+
...O,
|
|
789
|
+
...re(ae.validate, O.message)
|
|
790
|
+
}, !s))
|
|
791
|
+
return E(O.message), w;
|
|
792
|
+
} else if (U(A)) {
|
|
793
|
+
let D = {};
|
|
794
|
+
for (const O in A) {
|
|
795
|
+
if (!W(D) && !s)
|
|
796
|
+
break;
|
|
797
|
+
const L = Ct(await A[O](b, t), z, O);
|
|
798
|
+
L && (D = {
|
|
799
|
+
...L,
|
|
800
|
+
...re(O, L.message)
|
|
801
|
+
}, E(L.message), s && (w[F] = D));
|
|
802
|
+
}
|
|
803
|
+
if (!W(D) && (w[F] = {
|
|
804
|
+
ref: z,
|
|
805
|
+
...D
|
|
806
|
+
}, !s))
|
|
807
|
+
return w;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
return E(!0), w;
|
|
811
|
+
};
|
|
812
|
+
const Gr = {
|
|
813
|
+
mode: X.onSubmit,
|
|
814
|
+
reValidateMode: X.onChange,
|
|
815
|
+
shouldFocusError: !0
|
|
816
|
+
};
|
|
817
|
+
function Zr(e = {}) {
|
|
818
|
+
let r = {
|
|
819
|
+
...Gr,
|
|
820
|
+
...e
|
|
821
|
+
}, t = {
|
|
822
|
+
submitCount: 0,
|
|
823
|
+
isDirty: !1,
|
|
824
|
+
isReady: !1,
|
|
825
|
+
isLoading: te(r.defaultValues),
|
|
826
|
+
isValidating: !1,
|
|
827
|
+
isSubmitted: !1,
|
|
828
|
+
isSubmitting: !1,
|
|
829
|
+
isSubmitSuccessful: !1,
|
|
830
|
+
isValid: !1,
|
|
831
|
+
touchedFields: {},
|
|
832
|
+
dirtyFields: {},
|
|
833
|
+
validatingFields: {},
|
|
834
|
+
errors: r.errors || {},
|
|
835
|
+
disabled: r.disabled || !1
|
|
836
|
+
}, s = {}, n = U(r.defaultValues) || U(r.values) ? H(r.defaultValues || r.values) || {} : {}, o = r.shouldUnregister ? {} : H(n), a = {
|
|
837
|
+
action: !1,
|
|
838
|
+
mount: !1,
|
|
839
|
+
watch: !1
|
|
840
|
+
}, l = {
|
|
841
|
+
mount: /* @__PURE__ */ new Set(),
|
|
842
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
843
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
844
|
+
array: /* @__PURE__ */ new Set(),
|
|
845
|
+
watch: /* @__PURE__ */ new Set()
|
|
846
|
+
}, d, h = 0;
|
|
847
|
+
const f = {
|
|
848
|
+
isDirty: !1,
|
|
849
|
+
dirtyFields: !1,
|
|
850
|
+
validatingFields: !1,
|
|
851
|
+
touchedFields: !1,
|
|
852
|
+
isValidating: !1,
|
|
853
|
+
isValid: !1,
|
|
854
|
+
errors: !1
|
|
855
|
+
};
|
|
856
|
+
let g = {
|
|
857
|
+
...f
|
|
858
|
+
};
|
|
859
|
+
const y = {
|
|
860
|
+
array: pt(),
|
|
861
|
+
state: pt()
|
|
862
|
+
}, x = r.criteriaMode === X.all, A = (i) => (u) => {
|
|
863
|
+
clearTimeout(h), h = setTimeout(i, u);
|
|
864
|
+
}, F = async (i) => {
|
|
865
|
+
if (!r.disabled && (f.isValid || g.isValid || i)) {
|
|
866
|
+
const u = r.resolver ? W((await B()).errors) : await G(s, !0);
|
|
867
|
+
u !== t.isValid && y.state.next({
|
|
868
|
+
isValid: u
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
}, C = (i, u) => {
|
|
872
|
+
!r.disabled && (f.isValidating || f.validatingFields || g.isValidating || g.validatingFields) && ((i || Array.from(l.mount)).forEach((c) => {
|
|
873
|
+
c && (u ? N(t.validatingFields, c, u) : $(t.validatingFields, c));
|
|
874
|
+
}), y.state.next({
|
|
875
|
+
validatingFields: t.validatingFields,
|
|
876
|
+
isValidating: !W(t.validatingFields)
|
|
877
|
+
}));
|
|
878
|
+
}, P = (i, u = [], c, v, _ = !0, m = !0) => {
|
|
879
|
+
if (v && c && !r.disabled) {
|
|
880
|
+
if (a.action = !0, m && Array.isArray(p(s, i))) {
|
|
881
|
+
const S = c(p(s, i), v.argA, v.argB);
|
|
882
|
+
_ && N(s, i, S);
|
|
883
|
+
}
|
|
884
|
+
if (m && Array.isArray(p(t.errors, i))) {
|
|
885
|
+
const S = c(p(t.errors, i), v.argA, v.argB);
|
|
886
|
+
_ && N(t.errors, i, S), Wr(t.errors, i);
|
|
887
|
+
}
|
|
888
|
+
if ((f.touchedFields || g.touchedFields) && m && Array.isArray(p(t.touchedFields, i))) {
|
|
889
|
+
const S = c(p(t.touchedFields, i), v.argA, v.argB);
|
|
890
|
+
_ && N(t.touchedFields, i, S);
|
|
891
|
+
}
|
|
892
|
+
(f.dirtyFields || g.dirtyFields) && (t.dirtyFields = ye(n, o)), y.state.next({
|
|
893
|
+
name: i,
|
|
894
|
+
isDirty: se(i, u),
|
|
895
|
+
dirtyFields: t.dirtyFields,
|
|
896
|
+
errors: t.errors,
|
|
897
|
+
isValid: t.isValid
|
|
898
|
+
});
|
|
899
|
+
} else
|
|
900
|
+
N(o, i, u);
|
|
901
|
+
}, b = (i, u) => {
|
|
902
|
+
N(t.errors, i, u), y.state.next({
|
|
903
|
+
errors: t.errors
|
|
904
|
+
});
|
|
905
|
+
}, z = (i) => {
|
|
906
|
+
t.errors = i, y.state.next({
|
|
907
|
+
errors: t.errors,
|
|
908
|
+
isValid: !1
|
|
909
|
+
});
|
|
910
|
+
}, E = (i, u, c, v) => {
|
|
911
|
+
const _ = p(s, i);
|
|
912
|
+
if (_) {
|
|
913
|
+
const m = p(o, i, T(c) ? p(n, i) : c);
|
|
914
|
+
T(m) || v && v.defaultChecked || u ? N(o, i, u ? m : xt(_._f)) : L(i, m), a.mount && F();
|
|
915
|
+
}
|
|
916
|
+
}, w = (i, u, c, v, _) => {
|
|
917
|
+
let m = !1, S = !1;
|
|
918
|
+
const R = {
|
|
919
|
+
name: i
|
|
920
|
+
};
|
|
921
|
+
if (!r.disabled) {
|
|
922
|
+
if (!c || v) {
|
|
923
|
+
(f.isDirty || g.isDirty) && (S = t.isDirty, t.isDirty = R.isDirty = se(), m = S !== R.isDirty);
|
|
924
|
+
const M = ee(p(n, i), u);
|
|
925
|
+
S = !!p(t.dirtyFields, i), M ? $(t.dirtyFields, i) : N(t.dirtyFields, i, !0), R.dirtyFields = t.dirtyFields, m = m || (f.dirtyFields || g.dirtyFields) && S !== !M;
|
|
926
|
+
}
|
|
927
|
+
if (c) {
|
|
928
|
+
const M = p(t.touchedFields, i);
|
|
929
|
+
M || (N(t.touchedFields, i, c), R.touchedFields = t.touchedFields, m = m || (f.touchedFields || g.touchedFields) && M !== c);
|
|
930
|
+
}
|
|
931
|
+
m && _ && y.state.next(R);
|
|
932
|
+
}
|
|
933
|
+
return m ? R : {};
|
|
934
|
+
}, I = (i, u, c, v) => {
|
|
935
|
+
const _ = p(t.errors, i), m = (f.isValid || g.isValid) && J(u) && t.isValid !== u;
|
|
936
|
+
if (r.delayError && c ? (d = A(() => b(i, c)), d(r.delayError)) : (clearTimeout(h), d = null, c ? N(t.errors, i, c) : $(t.errors, i)), (c ? !ee(_, c) : _) || !W(v) || m) {
|
|
937
|
+
const S = {
|
|
938
|
+
...v,
|
|
939
|
+
...m && J(u) ? { isValid: u } : {},
|
|
940
|
+
errors: t.errors,
|
|
941
|
+
name: i
|
|
942
|
+
};
|
|
943
|
+
t = {
|
|
944
|
+
...t,
|
|
945
|
+
...S
|
|
946
|
+
}, y.state.next(S);
|
|
947
|
+
}
|
|
948
|
+
}, B = async (i) => {
|
|
949
|
+
C(i, !0);
|
|
950
|
+
const u = await r.resolver(o, r.context, Ir(i || l.mount, s, r.criteriaMode, r.shouldUseNativeValidation));
|
|
951
|
+
return C(i), u;
|
|
952
|
+
}, ie = async (i) => {
|
|
953
|
+
const { errors: u } = await B(i);
|
|
954
|
+
if (i)
|
|
955
|
+
for (const c of i) {
|
|
956
|
+
const v = p(u, c);
|
|
957
|
+
v ? N(t.errors, c, v) : $(t.errors, c);
|
|
958
|
+
}
|
|
959
|
+
else
|
|
960
|
+
t.errors = u;
|
|
961
|
+
return u;
|
|
962
|
+
}, G = async (i, u, c = {
|
|
963
|
+
valid: !0
|
|
964
|
+
}) => {
|
|
965
|
+
for (const v in i) {
|
|
966
|
+
const _ = i[v];
|
|
967
|
+
if (_) {
|
|
968
|
+
const { _f: m, ...S } = _;
|
|
969
|
+
if (m) {
|
|
970
|
+
const R = l.array.has(m.name), M = _._f && Br(_._f);
|
|
971
|
+
M && f.validatingFields && C([m.name], !0);
|
|
972
|
+
const Y = await Et(_, l.disabled, o, x, r.shouldUseNativeValidation && !u, R);
|
|
973
|
+
if (M && f.validatingFields && C([m.name]), Y[m.name] && (c.valid = !1, u))
|
|
974
|
+
break;
|
|
975
|
+
!u && (p(Y, m.name) ? R ? qr(t.errors, Y, m.name) : N(t.errors, m.name, Y[m.name]) : $(t.errors, m.name));
|
|
976
|
+
}
|
|
977
|
+
!W(S) && await G(S, u, c);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return c.valid;
|
|
981
|
+
}, re = () => {
|
|
982
|
+
for (const i of l.unMount) {
|
|
983
|
+
const u = p(s, i);
|
|
984
|
+
u && (u._f.refs ? u._f.refs.every((c) => !Le(c)) : !Le(u._f.ref)) && Pe(i);
|
|
985
|
+
}
|
|
986
|
+
l.unMount = /* @__PURE__ */ new Set();
|
|
987
|
+
}, se = (i, u) => !r.disabled && (i && u && N(o, i, u), !ee(xe(), n)), D = (i, u, c) => je(i, l, {
|
|
988
|
+
...a.mount ? o : T(u) ? n : K(i) ? { [i]: u } : u
|
|
989
|
+
}, c, u), O = (i) => Ye(p(a.mount ? o : n, i, r.shouldUnregister ? p(n, i, []) : [])), L = (i, u, c = {}) => {
|
|
990
|
+
const v = p(s, i);
|
|
991
|
+
let _ = u;
|
|
992
|
+
if (v) {
|
|
993
|
+
const m = v._f;
|
|
994
|
+
m && (!m.disabled && N(o, i, Qt(u, m)), _ = Ae(m.ref) && Q(u) ? "" : u, qt(m.ref) ? [...m.ref.options].forEach((S) => S.selected = _.includes(S.value)) : m.refs ? be(m.ref) ? m.refs.forEach((S) => {
|
|
995
|
+
(!S.defaultChecked || !S.disabled) && (Array.isArray(_) ? S.checked = !!_.find((R) => R === S.value) : S.checked = _ === S.value || !!_);
|
|
996
|
+
}) : m.refs.forEach((S) => S.checked = S.value === _) : st(m.ref) ? m.ref.value = "" : (m.ref.value = _, m.ref.type || y.state.next({
|
|
997
|
+
name: i,
|
|
998
|
+
values: H(o)
|
|
999
|
+
})));
|
|
1000
|
+
}
|
|
1001
|
+
(c.shouldDirty || c.shouldTouch) && w(i, _, c.shouldTouch, c.shouldDirty, !0), c.shouldValidate && de(i);
|
|
1002
|
+
}, j = (i, u, c) => {
|
|
1003
|
+
for (const v in u) {
|
|
1004
|
+
if (!u.hasOwnProperty(v))
|
|
1005
|
+
return;
|
|
1006
|
+
const _ = u[v], m = i + "." + v, S = p(s, m);
|
|
1007
|
+
(l.array.has(i) || U(_) || S && !S._f) && !ce(_) ? j(m, _, c) : L(m, _, c);
|
|
1008
|
+
}
|
|
1009
|
+
}, Z = (i, u, c = {}) => {
|
|
1010
|
+
const v = p(s, i), _ = l.array.has(i), m = H(u);
|
|
1011
|
+
N(o, i, m), _ ? (y.array.next({
|
|
1012
|
+
name: i,
|
|
1013
|
+
values: H(o)
|
|
1014
|
+
}), (f.isDirty || f.dirtyFields || g.isDirty || g.dirtyFields) && c.shouldDirty && y.state.next({
|
|
1015
|
+
name: i,
|
|
1016
|
+
dirtyFields: ye(n, o),
|
|
1017
|
+
isDirty: se(i, m)
|
|
1018
|
+
})) : v && !v._f && !Q(m) ? j(i, m, c) : L(i, m, c), wt(i, l) && y.state.next({ ...t, name: i }), y.state.next({
|
|
1019
|
+
name: a.mount ? i : void 0,
|
|
1020
|
+
values: H(o)
|
|
1021
|
+
});
|
|
1022
|
+
}, oe = async (i) => {
|
|
1023
|
+
a.mount = !0;
|
|
1024
|
+
const u = i.target;
|
|
1025
|
+
let c = u.name, v = !0;
|
|
1026
|
+
const _ = p(s, c), m = (M) => {
|
|
1027
|
+
v = Number.isNaN(M) || ce(M) && isNaN(M.getTime()) || ee(M, p(o, c, M));
|
|
1028
|
+
}, S = Ft(r.mode), R = Ft(r.reValidateMode);
|
|
1029
|
+
if (_) {
|
|
1030
|
+
let M, Y;
|
|
1031
|
+
const Fe = u.type ? xt(_._f) : $t(i), le = i.type === Ee.BLUR || i.type === Ee.FOCUS_OUT, dr = !$r(_._f) && !r.resolver && !p(t.errors, c) && !_._f.deps || jr(le, p(t.touchedFields, c), t.isSubmitted, R, S), Oe = wt(c, l, le);
|
|
1032
|
+
N(o, c, Fe), le ? (!u || !u.readOnly) && (_._f.onBlur && _._f.onBlur(i), d && d(0)) : _._f.onChange && _._f.onChange(i);
|
|
1033
|
+
const Me = w(c, Fe, le), fr = !W(Me) || Oe;
|
|
1034
|
+
if (!le && y.state.next({
|
|
1035
|
+
name: c,
|
|
1036
|
+
type: i.type,
|
|
1037
|
+
values: H(o)
|
|
1038
|
+
}), dr)
|
|
1039
|
+
return (f.isValid || g.isValid) && (r.mode === "onBlur" ? le && F() : le || F()), fr && y.state.next({ name: c, ...Oe ? {} : Me });
|
|
1040
|
+
if (!le && Oe && y.state.next({ ...t }), r.resolver) {
|
|
1041
|
+
const { errors: yt } = await B([c]);
|
|
1042
|
+
if (m(Fe), v) {
|
|
1043
|
+
const yr = kt(t.errors, s, c), mt = kt(yt, s, yr.name || c);
|
|
1044
|
+
M = mt.error, c = mt.name, Y = W(yt);
|
|
1045
|
+
}
|
|
1046
|
+
} else
|
|
1047
|
+
C([c], !0), M = (await Et(_, l.disabled, o, x, r.shouldUseNativeValidation))[c], C([c]), m(Fe), v && (M ? Y = !1 : (f.isValid || g.isValid) && (Y = await G(s, !0)));
|
|
1048
|
+
v && (_._f.deps && (!Array.isArray(_._f.deps) || _._f.deps.length > 0) && de(_._f.deps), I(c, Y, M, Me));
|
|
1049
|
+
}
|
|
1050
|
+
}, me = (i, u) => {
|
|
1051
|
+
if (p(t.errors, u) && i.focus)
|
|
1052
|
+
return i.focus(), 1;
|
|
1053
|
+
}, de = async (i, u = {}) => {
|
|
1054
|
+
let c, v;
|
|
1055
|
+
const _ = pe(i);
|
|
1056
|
+
if (r.resolver) {
|
|
1057
|
+
const m = await ie(T(i) ? i : _);
|
|
1058
|
+
c = W(m), v = i ? !_.some((S) => p(m, S)) : c;
|
|
1059
|
+
} else i ? (v = (await Promise.all(_.map(async (m) => {
|
|
1060
|
+
const S = p(s, m);
|
|
1061
|
+
return await G(S && S._f ? { [m]: S } : S);
|
|
1062
|
+
}))).every(Boolean), !(!v && !t.isValid) && F()) : v = c = await G(s);
|
|
1063
|
+
return y.state.next({
|
|
1064
|
+
...!K(i) || (f.isValid || g.isValid) && c !== t.isValid ? {} : { name: i },
|
|
1065
|
+
...r.resolver || !i ? { isValid: c } : {},
|
|
1066
|
+
errors: t.errors
|
|
1067
|
+
}), u.shouldFocus && !v && ve(s, me, i ? _ : l.mount), v;
|
|
1068
|
+
}, xe = (i, u) => {
|
|
1069
|
+
let c = {
|
|
1070
|
+
...a.mount ? o : n
|
|
1071
|
+
};
|
|
1072
|
+
return u && (c = Wt(u.dirtyFields ? t.dirtyFields : t.touchedFields, c)), T(i) ? c : K(i) ? p(c, i) : i.map((v) => p(c, v));
|
|
1073
|
+
}, nt = (i, u) => ({
|
|
1074
|
+
invalid: !!p((u || t).errors, i),
|
|
1075
|
+
isDirty: !!p((u || t).dirtyFields, i),
|
|
1076
|
+
error: p((u || t).errors, i),
|
|
1077
|
+
isValidating: !!p(t.validatingFields, i),
|
|
1078
|
+
isTouched: !!p((u || t).touchedFields, i)
|
|
1079
|
+
}), or = (i) => {
|
|
1080
|
+
i && pe(i).forEach((u) => $(t.errors, u)), y.state.next({
|
|
1081
|
+
errors: i ? t.errors : {}
|
|
1082
|
+
});
|
|
1083
|
+
}, it = (i, u, c) => {
|
|
1084
|
+
const v = (p(s, i, { _f: {} })._f || {}).ref, _ = p(t.errors, i) || {}, { ref: m, message: S, type: R, ...M } = _;
|
|
1085
|
+
N(t.errors, i, {
|
|
1086
|
+
...M,
|
|
1087
|
+
...u,
|
|
1088
|
+
ref: v
|
|
1089
|
+
}), y.state.next({
|
|
1090
|
+
name: i,
|
|
1091
|
+
errors: t.errors,
|
|
1092
|
+
isValid: !1
|
|
1093
|
+
}), c && c.shouldFocus && v && v.focus && v.focus();
|
|
1094
|
+
}, nr = (i, u) => te(i) ? y.state.subscribe({
|
|
1095
|
+
next: (c) => "values" in c && i(D(void 0, u), c)
|
|
1096
|
+
}) : D(i, u, !0), at = (i) => y.state.subscribe({
|
|
1097
|
+
next: (u) => {
|
|
1098
|
+
Hr(i.name, u.name, i.exact) && Ur(u, i.formState || f, cr, i.reRenderRoot) && i.callback({
|
|
1099
|
+
values: { ...o },
|
|
1100
|
+
...t,
|
|
1101
|
+
...u,
|
|
1102
|
+
defaultValues: n
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
}).unsubscribe, ir = (i) => (a.mount = !0, g = {
|
|
1106
|
+
...g,
|
|
1107
|
+
...i.formState
|
|
1108
|
+
}, at({
|
|
1109
|
+
...i,
|
|
1110
|
+
formState: g
|
|
1111
|
+
})), Pe = (i, u = {}) => {
|
|
1112
|
+
for (const c of i ? pe(i) : l.mount)
|
|
1113
|
+
l.mount.delete(c), l.array.delete(c), u.keepValue || ($(s, c), $(o, c)), !u.keepError && $(t.errors, c), !u.keepDirty && $(t.dirtyFields, c), !u.keepTouched && $(t.touchedFields, c), !u.keepIsValidating && $(t.validatingFields, c), !r.shouldUnregister && !u.keepDefaultValue && $(n, c);
|
|
1114
|
+
y.state.next({
|
|
1115
|
+
values: H(o)
|
|
1116
|
+
}), y.state.next({
|
|
1117
|
+
...t,
|
|
1118
|
+
...u.keepDirty ? { isDirty: se() } : {}
|
|
1119
|
+
}), !u.keepIsValid && F();
|
|
1120
|
+
}, lt = ({ disabled: i, name: u }) => {
|
|
1121
|
+
(J(i) && a.mount || i || l.disabled.has(u)) && (i ? l.disabled.add(u) : l.disabled.delete(u));
|
|
1122
|
+
}, Re = (i, u = {}) => {
|
|
1123
|
+
let c = p(s, i);
|
|
1124
|
+
const v = J(u.disabled) || J(r.disabled);
|
|
1125
|
+
return N(s, i, {
|
|
1126
|
+
...c || {},
|
|
1127
|
+
_f: {
|
|
1128
|
+
...c && c._f ? c._f : { ref: { name: i } },
|
|
1129
|
+
name: i,
|
|
1130
|
+
mount: !0,
|
|
1131
|
+
...u
|
|
1132
|
+
}
|
|
1133
|
+
}), l.mount.add(i), c ? lt({
|
|
1134
|
+
disabled: J(u.disabled) ? u.disabled : r.disabled,
|
|
1135
|
+
name: i
|
|
1136
|
+
}) : E(i, !0, u.value), {
|
|
1137
|
+
...v ? { disabled: u.disabled || r.disabled } : {},
|
|
1138
|
+
...r.progressive ? {
|
|
1139
|
+
required: !!u.required,
|
|
1140
|
+
min: he(u.min),
|
|
1141
|
+
max: he(u.max),
|
|
1142
|
+
minLength: he(u.minLength),
|
|
1143
|
+
maxLength: he(u.maxLength),
|
|
1144
|
+
pattern: he(u.pattern)
|
|
1145
|
+
} : {},
|
|
1146
|
+
name: i,
|
|
1147
|
+
onChange: oe,
|
|
1148
|
+
onBlur: oe,
|
|
1149
|
+
ref: (_) => {
|
|
1150
|
+
if (_) {
|
|
1151
|
+
Re(i, u), c = p(s, i);
|
|
1152
|
+
const m = T(_.value) && _.querySelectorAll && _.querySelectorAll("input,select,textarea")[0] || _, S = Or(m), R = c._f.refs || [];
|
|
1153
|
+
if (S ? R.find((M) => M === m) : m === c._f.ref)
|
|
1154
|
+
return;
|
|
1155
|
+
N(s, i, {
|
|
1156
|
+
_f: {
|
|
1157
|
+
...c._f,
|
|
1158
|
+
...S ? {
|
|
1159
|
+
refs: [
|
|
1160
|
+
...R.filter(Le),
|
|
1161
|
+
m,
|
|
1162
|
+
...Array.isArray(p(n, i)) ? [{}] : []
|
|
1163
|
+
],
|
|
1164
|
+
ref: { type: m.type, name: i }
|
|
1165
|
+
} : { ref: m }
|
|
1166
|
+
}
|
|
1167
|
+
}), E(i, !1, void 0, m);
|
|
1168
|
+
} else
|
|
1169
|
+
c = p(s, i, {}), c._f && (c._f.mount = !1), (r.shouldUnregister || u.shouldUnregister) && !(Ut(l.array, i) && a.action) && l.unMount.add(i);
|
|
1170
|
+
}
|
|
1171
|
+
};
|
|
1172
|
+
}, Ne = () => r.shouldFocusError && ve(s, me, l.mount), ar = (i) => {
|
|
1173
|
+
J(i) && (y.state.next({ disabled: i }), ve(s, (u, c) => {
|
|
1174
|
+
const v = p(s, c);
|
|
1175
|
+
v && (u.disabled = v._f.disabled || i, Array.isArray(v._f.refs) && v._f.refs.forEach((_) => {
|
|
1176
|
+
_.disabled = v._f.disabled || i;
|
|
1177
|
+
}));
|
|
1178
|
+
}, 0, !1));
|
|
1179
|
+
}, ut = (i, u) => async (c) => {
|
|
1180
|
+
let v;
|
|
1181
|
+
c && (c.preventDefault && c.preventDefault(), c.persist && c.persist());
|
|
1182
|
+
let _ = H(o);
|
|
1183
|
+
if (y.state.next({
|
|
1184
|
+
isSubmitting: !0
|
|
1185
|
+
}), r.resolver) {
|
|
1186
|
+
const { errors: m, values: S } = await B();
|
|
1187
|
+
t.errors = m, _ = H(S);
|
|
1188
|
+
} else
|
|
1189
|
+
await G(s);
|
|
1190
|
+
if (l.disabled.size)
|
|
1191
|
+
for (const m of l.disabled)
|
|
1192
|
+
$(_, m);
|
|
1193
|
+
if ($(t.errors, "root"), W(t.errors)) {
|
|
1194
|
+
y.state.next({
|
|
1195
|
+
errors: {}
|
|
1196
|
+
});
|
|
1197
|
+
try {
|
|
1198
|
+
await i(_, c);
|
|
1199
|
+
} catch (m) {
|
|
1200
|
+
v = m;
|
|
1201
|
+
}
|
|
1202
|
+
} else
|
|
1203
|
+
u && await u({ ...t.errors }, c), Ne(), setTimeout(Ne);
|
|
1204
|
+
if (y.state.next({
|
|
1205
|
+
isSubmitted: !0,
|
|
1206
|
+
isSubmitting: !1,
|
|
1207
|
+
isSubmitSuccessful: W(t.errors) && !v,
|
|
1208
|
+
submitCount: t.submitCount + 1,
|
|
1209
|
+
errors: t.errors
|
|
1210
|
+
}), v)
|
|
1211
|
+
throw v;
|
|
1212
|
+
}, lr = (i, u = {}) => {
|
|
1213
|
+
p(s, i) && (T(u.defaultValue) ? Z(i, H(p(n, i))) : (Z(i, u.defaultValue), N(n, i, H(u.defaultValue))), u.keepTouched || $(t.touchedFields, i), u.keepDirty || ($(t.dirtyFields, i), t.isDirty = u.defaultValue ? se(i, H(p(n, i))) : se()), u.keepError || ($(t.errors, i), f.isValid && F()), y.state.next({ ...t }));
|
|
1214
|
+
}, ct = (i, u = {}) => {
|
|
1215
|
+
const c = i ? H(i) : n, v = H(c), _ = W(i), m = _ ? n : v;
|
|
1216
|
+
if (u.keepDefaultValues || (n = c), !u.keepValues) {
|
|
1217
|
+
if (u.keepDirtyValues) {
|
|
1218
|
+
const S = /* @__PURE__ */ new Set([
|
|
1219
|
+
...l.mount,
|
|
1220
|
+
...Object.keys(ye(n, o))
|
|
1221
|
+
]);
|
|
1222
|
+
for (const R of Array.from(S))
|
|
1223
|
+
p(t.dirtyFields, R) ? N(m, R, p(o, R)) : Z(R, p(m, R));
|
|
1224
|
+
} else {
|
|
1225
|
+
if (Ke && T(i))
|
|
1226
|
+
for (const S of l.mount) {
|
|
1227
|
+
const R = p(s, S);
|
|
1228
|
+
if (R && R._f) {
|
|
1229
|
+
const M = Array.isArray(R._f.refs) ? R._f.refs[0] : R._f.ref;
|
|
1230
|
+
if (Ae(M)) {
|
|
1231
|
+
const Y = M.closest("form");
|
|
1232
|
+
if (Y) {
|
|
1233
|
+
Y.reset();
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
if (u.keepFieldsRef)
|
|
1240
|
+
for (const S of l.mount)
|
|
1241
|
+
Z(S, p(m, S));
|
|
1242
|
+
else
|
|
1243
|
+
s = {};
|
|
1244
|
+
}
|
|
1245
|
+
o = r.shouldUnregister ? u.keepDefaultValues ? H(n) : {} : H(m), y.array.next({
|
|
1246
|
+
values: { ...m }
|
|
1247
|
+
}), y.state.next({
|
|
1248
|
+
values: { ...m }
|
|
1249
|
+
});
|
|
1250
|
+
}
|
|
1251
|
+
l = {
|
|
1252
|
+
mount: u.keepDirtyValues ? l.mount : /* @__PURE__ */ new Set(),
|
|
1253
|
+
unMount: /* @__PURE__ */ new Set(),
|
|
1254
|
+
array: /* @__PURE__ */ new Set(),
|
|
1255
|
+
disabled: /* @__PURE__ */ new Set(),
|
|
1256
|
+
watch: /* @__PURE__ */ new Set(),
|
|
1257
|
+
watchAll: !1,
|
|
1258
|
+
focus: ""
|
|
1259
|
+
}, a.mount = !f.isValid || !!u.keepIsValid || !!u.keepDirtyValues || !r.shouldUnregister && !W(m), a.watch = !!r.shouldUnregister, y.state.next({
|
|
1260
|
+
submitCount: u.keepSubmitCount ? t.submitCount : 0,
|
|
1261
|
+
isDirty: _ ? !1 : u.keepDirty ? t.isDirty : !!(u.keepDefaultValues && !ee(i, n)),
|
|
1262
|
+
isSubmitted: u.keepIsSubmitted ? t.isSubmitted : !1,
|
|
1263
|
+
dirtyFields: _ ? {} : u.keepDirtyValues ? u.keepDefaultValues && o ? ye(n, o) : t.dirtyFields : u.keepDefaultValues && i ? ye(n, i) : u.keepDirty ? t.dirtyFields : {},
|
|
1264
|
+
touchedFields: u.keepTouched ? t.touchedFields : {},
|
|
1265
|
+
errors: u.keepErrors ? t.errors : {},
|
|
1266
|
+
isSubmitSuccessful: u.keepIsSubmitSuccessful ? t.isSubmitSuccessful : !1,
|
|
1267
|
+
isSubmitting: !1,
|
|
1268
|
+
defaultValues: n
|
|
1269
|
+
});
|
|
1270
|
+
}, dt = (i, u) => ct(te(i) ? i(o) : i, u), ur = (i, u = {}) => {
|
|
1271
|
+
const c = p(s, i), v = c && c._f;
|
|
1272
|
+
if (v) {
|
|
1273
|
+
const _ = v.refs ? v.refs[0] : v.ref;
|
|
1274
|
+
_.focus && (_.focus(), u.shouldSelect && te(_.select) && _.select());
|
|
1275
|
+
}
|
|
1276
|
+
}, cr = (i) => {
|
|
1277
|
+
t = {
|
|
1278
|
+
...t,
|
|
1279
|
+
...i
|
|
1280
|
+
};
|
|
1281
|
+
}, ft = {
|
|
1282
|
+
control: {
|
|
1283
|
+
register: Re,
|
|
1284
|
+
unregister: Pe,
|
|
1285
|
+
getFieldState: nt,
|
|
1286
|
+
handleSubmit: ut,
|
|
1287
|
+
setError: it,
|
|
1288
|
+
_subscribe: at,
|
|
1289
|
+
_runSchema: B,
|
|
1290
|
+
_focusError: Ne,
|
|
1291
|
+
_getWatch: D,
|
|
1292
|
+
_getDirty: se,
|
|
1293
|
+
_setValid: F,
|
|
1294
|
+
_setFieldArray: P,
|
|
1295
|
+
_setDisabledField: lt,
|
|
1296
|
+
_setErrors: z,
|
|
1297
|
+
_getFieldArray: O,
|
|
1298
|
+
_reset: ct,
|
|
1299
|
+
_resetDefaultValues: () => te(r.defaultValues) && r.defaultValues().then((i) => {
|
|
1300
|
+
dt(i, r.resetOptions), y.state.next({
|
|
1301
|
+
isLoading: !1
|
|
1302
|
+
});
|
|
1303
|
+
}),
|
|
1304
|
+
_removeUnmounted: re,
|
|
1305
|
+
_disableForm: ar,
|
|
1306
|
+
_subjects: y,
|
|
1307
|
+
_proxyFormState: f,
|
|
1308
|
+
get _fields() {
|
|
1309
|
+
return s;
|
|
1310
|
+
},
|
|
1311
|
+
get _formValues() {
|
|
1312
|
+
return o;
|
|
1313
|
+
},
|
|
1314
|
+
get _state() {
|
|
1315
|
+
return a;
|
|
1316
|
+
},
|
|
1317
|
+
set _state(i) {
|
|
1318
|
+
a = i;
|
|
1319
|
+
},
|
|
1320
|
+
get _defaultValues() {
|
|
1321
|
+
return n;
|
|
1322
|
+
},
|
|
1323
|
+
get _names() {
|
|
1324
|
+
return l;
|
|
1325
|
+
},
|
|
1326
|
+
set _names(i) {
|
|
1327
|
+
l = i;
|
|
1328
|
+
},
|
|
1329
|
+
get _formState() {
|
|
1330
|
+
return t;
|
|
1331
|
+
},
|
|
1332
|
+
get _options() {
|
|
1333
|
+
return r;
|
|
1334
|
+
},
|
|
1335
|
+
set _options(i) {
|
|
1336
|
+
r = {
|
|
1337
|
+
...r,
|
|
1338
|
+
...i
|
|
1339
|
+
};
|
|
1340
|
+
}
|
|
1341
|
+
},
|
|
1342
|
+
subscribe: ir,
|
|
1343
|
+
trigger: de,
|
|
1344
|
+
register: Re,
|
|
1345
|
+
handleSubmit: ut,
|
|
1346
|
+
watch: nr,
|
|
1347
|
+
setValue: Z,
|
|
1348
|
+
getValues: xe,
|
|
1349
|
+
reset: dt,
|
|
1350
|
+
resetField: lr,
|
|
1351
|
+
clearErrors: or,
|
|
1352
|
+
unregister: Pe,
|
|
1353
|
+
setError: it,
|
|
1354
|
+
setFocus: ur,
|
|
1355
|
+
getFieldState: nt
|
|
1356
|
+
};
|
|
1357
|
+
return {
|
|
1358
|
+
...ft,
|
|
1359
|
+
formControl: ft
|
|
1360
|
+
};
|
|
1361
|
+
}
|
|
1362
|
+
function Qr(e = {}) {
|
|
1363
|
+
const r = V.useRef(void 0), t = V.useRef(void 0), [s, n] = V.useState({
|
|
1364
|
+
isDirty: !1,
|
|
1365
|
+
isValidating: !1,
|
|
1366
|
+
isLoading: te(e.defaultValues),
|
|
1367
|
+
isSubmitted: !1,
|
|
1368
|
+
isSubmitting: !1,
|
|
1369
|
+
isSubmitSuccessful: !1,
|
|
1370
|
+
isValid: !1,
|
|
1371
|
+
submitCount: 0,
|
|
1372
|
+
dirtyFields: {},
|
|
1373
|
+
touchedFields: {},
|
|
1374
|
+
validatingFields: {},
|
|
1375
|
+
errors: e.errors || {},
|
|
1376
|
+
disabled: e.disabled || !1,
|
|
1377
|
+
isReady: !1,
|
|
1378
|
+
defaultValues: te(e.defaultValues) ? void 0 : e.defaultValues
|
|
1379
|
+
});
|
|
1380
|
+
if (!r.current)
|
|
1381
|
+
if (e.formControl)
|
|
1382
|
+
r.current = {
|
|
1383
|
+
...e.formControl,
|
|
1384
|
+
formState: s
|
|
1385
|
+
}, e.defaultValues && !te(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
|
|
1386
|
+
else {
|
|
1387
|
+
const { formControl: a, ...l } = Zr(e);
|
|
1388
|
+
r.current = {
|
|
1389
|
+
...l,
|
|
1390
|
+
formState: s
|
|
1391
|
+
};
|
|
1392
|
+
}
|
|
1393
|
+
const o = r.current.control;
|
|
1394
|
+
return o._options = e, tt(() => {
|
|
1395
|
+
const a = o._subscribe({
|
|
1396
|
+
formState: o._proxyFormState,
|
|
1397
|
+
callback: () => n({ ...o._formState }),
|
|
1398
|
+
reRenderRoot: !0
|
|
1399
|
+
});
|
|
1400
|
+
return n((l) => ({
|
|
1401
|
+
...l,
|
|
1402
|
+
isReady: !0
|
|
1403
|
+
})), o._formState.isReady = !0, a;
|
|
1404
|
+
}, [o]), V.useEffect(() => o._disableForm(e.disabled), [o, e.disabled]), V.useEffect(() => {
|
|
1405
|
+
e.mode && (o._options.mode = e.mode), e.reValidateMode && (o._options.reValidateMode = e.reValidateMode);
|
|
1406
|
+
}, [o, e.mode, e.reValidateMode]), V.useEffect(() => {
|
|
1407
|
+
e.errors && (o._setErrors(e.errors), o._focusError());
|
|
1408
|
+
}, [o, e.errors]), V.useEffect(() => {
|
|
1409
|
+
e.shouldUnregister && o._subjects.state.next({
|
|
1410
|
+
values: o._getWatch()
|
|
1411
|
+
});
|
|
1412
|
+
}, [o, e.shouldUnregister]), V.useEffect(() => {
|
|
1413
|
+
if (o._proxyFormState.isDirty) {
|
|
1414
|
+
const a = o._getDirty();
|
|
1415
|
+
a !== s.isDirty && o._subjects.state.next({
|
|
1416
|
+
isDirty: a
|
|
1417
|
+
});
|
|
1418
|
+
}
|
|
1419
|
+
}, [o, s.isDirty]), V.useEffect(() => {
|
|
1420
|
+
e.values && !ee(e.values, t.current) ? (o._reset(e.values, {
|
|
1421
|
+
keepFieldsRef: !0,
|
|
1422
|
+
...o._options.resetOptions
|
|
1423
|
+
}), t.current = e.values, n((a) => ({ ...a }))) : o._resetDefaultValues();
|
|
1424
|
+
}, [o, e.values]), V.useEffect(() => {
|
|
1425
|
+
o._state.mount || (o._setValid(), o._state.mount = !0), o._state.watch && (o._state.watch = !1, o._subjects.state.next({ ...o._formState })), o._removeUnmounted();
|
|
1426
|
+
}), r.current.formState = jt(s, o), r.current;
|
|
1427
|
+
}
|
|
1428
|
+
const At = (e, r, t) => {
|
|
1429
|
+
if (e && "reportValidity" in e) {
|
|
1430
|
+
const s = p(t, r);
|
|
1431
|
+
e.setCustomValidity(s && s.message || ""), e.reportValidity();
|
|
1432
|
+
}
|
|
1433
|
+
}, Ge = (e, r) => {
|
|
1434
|
+
for (const t in r.fields) {
|
|
1435
|
+
const s = r.fields[t];
|
|
1436
|
+
s && s.ref && "reportValidity" in s.ref ? At(s.ref, t, e) : s && s.refs && s.refs.forEach((n) => At(n, t, e));
|
|
1437
|
+
}
|
|
1438
|
+
}, zt = (e, r) => {
|
|
1439
|
+
r.shouldUseNativeValidation && Ge(e, r);
|
|
1440
|
+
const t = {};
|
|
1441
|
+
for (const s in e) {
|
|
1442
|
+
const n = p(r.fields, s), o = Object.assign(e[s] || {}, { ref: n && n.ref });
|
|
1443
|
+
if (Jr(r.names || Object.keys(e), s)) {
|
|
1444
|
+
const a = Object.assign({}, p(t, s));
|
|
1445
|
+
N(a, "root", o), N(t, s, a);
|
|
1446
|
+
} else N(t, s, o);
|
|
1447
|
+
}
|
|
1448
|
+
return t;
|
|
1449
|
+
}, Jr = (e, r) => {
|
|
1450
|
+
const t = Dt(r);
|
|
1451
|
+
return e.some((s) => Dt(s).match(`^${t}\\.\\d+`));
|
|
1452
|
+
};
|
|
1453
|
+
function Dt(e) {
|
|
1454
|
+
return e.replace(/\]|\[/g, "");
|
|
1455
|
+
}
|
|
1456
|
+
function Kt(e, r, t) {
|
|
1457
|
+
function s(l, d) {
|
|
1458
|
+
var h;
|
|
1459
|
+
Object.defineProperty(l, "_zod", {
|
|
1460
|
+
value: l._zod ?? {},
|
|
1461
|
+
enumerable: !1
|
|
1462
|
+
}), (h = l._zod).traits ?? (h.traits = /* @__PURE__ */ new Set()), l._zod.traits.add(e), r(l, d);
|
|
1463
|
+
for (const f in a.prototype)
|
|
1464
|
+
f in l || Object.defineProperty(l, f, { value: a.prototype[f].bind(l) });
|
|
1465
|
+
l._zod.constr = a, l._zod.def = d;
|
|
1466
|
+
}
|
|
1467
|
+
const n = (t == null ? void 0 : t.Parent) ?? Object;
|
|
1468
|
+
class o extends n {
|
|
1469
|
+
}
|
|
1470
|
+
Object.defineProperty(o, "name", { value: e });
|
|
1471
|
+
function a(l) {
|
|
1472
|
+
var d;
|
|
1473
|
+
const h = t != null && t.Parent ? new o() : this;
|
|
1474
|
+
s(h, l), (d = h._zod).deferred ?? (d.deferred = []);
|
|
1475
|
+
for (const f of h._zod.deferred)
|
|
1476
|
+
f();
|
|
1477
|
+
return h;
|
|
1478
|
+
}
|
|
1479
|
+
return Object.defineProperty(a, "init", { value: s }), Object.defineProperty(a, Symbol.hasInstance, {
|
|
1480
|
+
value: (l) => {
|
|
1481
|
+
var d, h;
|
|
1482
|
+
return t != null && t.Parent && l instanceof t.Parent ? !0 : (h = (d = l == null ? void 0 : l._zod) == null ? void 0 : d.traits) == null ? void 0 : h.has(e);
|
|
1483
|
+
}
|
|
1484
|
+
}), Object.defineProperty(a, "name", { value: e }), a;
|
|
1485
|
+
}
|
|
1486
|
+
class Kr extends Error {
|
|
1487
|
+
constructor() {
|
|
1488
|
+
super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
const Yr = {};
|
|
1492
|
+
function Yt(e) {
|
|
1493
|
+
return Yr;
|
|
1494
|
+
}
|
|
1495
|
+
function Xr(e, r) {
|
|
1496
|
+
return typeof r == "bigint" ? r.toString() : r;
|
|
1497
|
+
}
|
|
1498
|
+
const Xt = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
|
|
1499
|
+
};
|
|
1500
|
+
function ke(e) {
|
|
1501
|
+
return typeof e == "string" ? e : e == null ? void 0 : e.message;
|
|
1502
|
+
}
|
|
1503
|
+
function er(e, r, t) {
|
|
1504
|
+
var n, o, a, l, d, h;
|
|
1505
|
+
const s = { ...e, path: e.path ?? [] };
|
|
1506
|
+
if (!e.message) {
|
|
1507
|
+
const f = ke((a = (o = (n = e.inst) == null ? void 0 : n._zod.def) == null ? void 0 : o.error) == null ? void 0 : a.call(o, e)) ?? ke((l = r == null ? void 0 : r.error) == null ? void 0 : l.call(r, e)) ?? ke((d = t.customError) == null ? void 0 : d.call(t, e)) ?? ke((h = t.localeError) == null ? void 0 : h.call(t, e)) ?? "Invalid input";
|
|
1508
|
+
s.message = f;
|
|
1509
|
+
}
|
|
1510
|
+
return delete s.inst, delete s.continue, r != null && r.reportInput || delete s.input, s;
|
|
1511
|
+
}
|
|
1512
|
+
const tr = (e, r) => {
|
|
1513
|
+
e.name = "$ZodError", Object.defineProperty(e, "_zod", {
|
|
1514
|
+
value: e._zod,
|
|
1515
|
+
enumerable: !1
|
|
1516
|
+
}), Object.defineProperty(e, "issues", {
|
|
1517
|
+
value: r,
|
|
1518
|
+
enumerable: !1
|
|
1519
|
+
}), e.message = JSON.stringify(r, Xr, 2), Object.defineProperty(e, "toString", {
|
|
1520
|
+
value: () => e.message,
|
|
1521
|
+
enumerable: !1
|
|
1522
|
+
});
|
|
1523
|
+
}, es = Kt("$ZodError", tr), rr = Kt("$ZodError", tr, { Parent: Error }), ts = (e) => (r, t, s, n) => {
|
|
1524
|
+
const o = s ? Object.assign(s, { async: !1 }) : { async: !1 }, a = r._zod.run({ value: t, issues: [] }, o);
|
|
1525
|
+
if (a instanceof Promise)
|
|
1526
|
+
throw new Kr();
|
|
1527
|
+
if (a.issues.length) {
|
|
1528
|
+
const l = new ((n == null ? void 0 : n.Err) ?? e)(a.issues.map((d) => er(d, o, Yt())));
|
|
1529
|
+
throw Xt(l, n == null ? void 0 : n.callee), l;
|
|
1530
|
+
}
|
|
1531
|
+
return a.value;
|
|
1532
|
+
}, rs = /* @__PURE__ */ ts(rr), ss = (e) => async (r, t, s, n) => {
|
|
1533
|
+
const o = s ? Object.assign(s, { async: !0 }) : { async: !0 };
|
|
1534
|
+
let a = r._zod.run({ value: t, issues: [] }, o);
|
|
1535
|
+
if (a instanceof Promise && (a = await a), a.issues.length) {
|
|
1536
|
+
const l = new ((n == null ? void 0 : n.Err) ?? e)(a.issues.map((d) => er(d, o, Yt())));
|
|
1537
|
+
throw Xt(l, n == null ? void 0 : n.callee), l;
|
|
1538
|
+
}
|
|
1539
|
+
return a.value;
|
|
1540
|
+
}, os = /* @__PURE__ */ ss(rr);
|
|
1541
|
+
function Pt(e, r) {
|
|
1542
|
+
try {
|
|
1543
|
+
var t = e();
|
|
1544
|
+
} catch (s) {
|
|
1545
|
+
return r(s);
|
|
1546
|
+
}
|
|
1547
|
+
return t && t.then ? t.then(void 0, r) : t;
|
|
1548
|
+
}
|
|
1549
|
+
function ns(e, r) {
|
|
1550
|
+
for (var t = {}; e.length; ) {
|
|
1551
|
+
var s = e[0], n = s.code, o = s.message, a = s.path.join(".");
|
|
1552
|
+
if (!t[a]) if ("unionErrors" in s) {
|
|
1553
|
+
var l = s.unionErrors[0].errors[0];
|
|
1554
|
+
t[a] = { message: l.message, type: l.code };
|
|
1555
|
+
} else t[a] = { message: o, type: n };
|
|
1556
|
+
if ("unionErrors" in s && s.unionErrors.forEach(function(f) {
|
|
1557
|
+
return f.errors.forEach(function(g) {
|
|
1558
|
+
return e.push(g);
|
|
1559
|
+
});
|
|
1560
|
+
}), r) {
|
|
1561
|
+
var d = t[a].types, h = d && d[s.code];
|
|
1562
|
+
t[a] = rt(a, r, t, n, h ? [].concat(h, s.message) : s.message);
|
|
1563
|
+
}
|
|
1564
|
+
e.shift();
|
|
1565
|
+
}
|
|
1566
|
+
return t;
|
|
1567
|
+
}
|
|
1568
|
+
function is(e, r) {
|
|
1569
|
+
for (var t = {}; e.length; ) {
|
|
1570
|
+
var s = e[0], n = s.code, o = s.message, a = s.path.join(".");
|
|
1571
|
+
if (!t[a]) if (s.code === "invalid_union" && s.errors.length > 0) {
|
|
1572
|
+
var l = s.errors[0][0];
|
|
1573
|
+
t[a] = { message: l.message, type: l.code };
|
|
1574
|
+
} else t[a] = { message: o, type: n };
|
|
1575
|
+
if (s.code === "invalid_union" && s.errors.forEach(function(f) {
|
|
1576
|
+
return f.forEach(function(g) {
|
|
1577
|
+
return e.push(g);
|
|
1578
|
+
});
|
|
1579
|
+
}), r) {
|
|
1580
|
+
var d = t[a].types, h = d && d[s.code];
|
|
1581
|
+
t[a] = rt(a, r, t, n, h ? [].concat(h, s.message) : s.message);
|
|
1582
|
+
}
|
|
1583
|
+
e.shift();
|
|
1584
|
+
}
|
|
1585
|
+
return t;
|
|
1586
|
+
}
|
|
1587
|
+
function as(e, r, t) {
|
|
1588
|
+
if (t === void 0 && (t = {}), (function(s) {
|
|
1589
|
+
return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
|
|
1590
|
+
})(e)) return function(s, n, o) {
|
|
1591
|
+
try {
|
|
1592
|
+
return Promise.resolve(Pt(function() {
|
|
1593
|
+
return Promise.resolve(e[t.mode === "sync" ? "parse" : "parseAsync"](s, r)).then(function(a) {
|
|
1594
|
+
return o.shouldUseNativeValidation && Ge({}, o), { errors: {}, values: t.raw ? Object.assign({}, s) : a };
|
|
1595
|
+
});
|
|
1596
|
+
}, function(a) {
|
|
1597
|
+
if ((function(l) {
|
|
1598
|
+
return Array.isArray(l == null ? void 0 : l.issues);
|
|
1599
|
+
})(a)) return { values: {}, errors: zt(ns(a.errors, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
|
|
1600
|
+
throw a;
|
|
1601
|
+
}));
|
|
1602
|
+
} catch (a) {
|
|
1603
|
+
return Promise.reject(a);
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
if ((function(s) {
|
|
1607
|
+
return "_zod" in s && typeof s._zod == "object";
|
|
1608
|
+
})(e)) return function(s, n, o) {
|
|
1609
|
+
try {
|
|
1610
|
+
return Promise.resolve(Pt(function() {
|
|
1611
|
+
return Promise.resolve((t.mode === "sync" ? rs : os)(e, s, r)).then(function(a) {
|
|
1612
|
+
return o.shouldUseNativeValidation && Ge({}, o), { errors: {}, values: t.raw ? Object.assign({}, s) : a };
|
|
1613
|
+
});
|
|
1614
|
+
}, function(a) {
|
|
1615
|
+
if ((function(l) {
|
|
1616
|
+
return l instanceof es;
|
|
1617
|
+
})(a)) return { values: {}, errors: zt(is(a.issues, !o.shouldUseNativeValidation && o.criteriaMode === "all"), o) };
|
|
1618
|
+
throw a;
|
|
1619
|
+
}));
|
|
1620
|
+
} catch (a) {
|
|
1621
|
+
return Promise.reject(a);
|
|
1622
|
+
}
|
|
1623
|
+
};
|
|
1624
|
+
throw new Error("Invalid input: not a Zod schema");
|
|
1625
|
+
}
|
|
1626
|
+
const sr = V.createContext(null);
|
|
1627
|
+
function ls() {
|
|
1628
|
+
const e = V.useContext(sr);
|
|
1629
|
+
if (!e)
|
|
1630
|
+
throw new Error("useFormContext must be used within a Form component");
|
|
1631
|
+
return e;
|
|
1632
|
+
}
|
|
1633
|
+
function us({
|
|
1634
|
+
onSubmit: e,
|
|
1635
|
+
children: r,
|
|
1636
|
+
schema: t,
|
|
1637
|
+
defaultValues: s,
|
|
1638
|
+
mode: n = "onSubmit",
|
|
1639
|
+
reValidateMode: o,
|
|
1640
|
+
...a
|
|
1641
|
+
}) {
|
|
1642
|
+
const l = Qr({
|
|
1643
|
+
resolver: t ? as(t) : void 0,
|
|
1644
|
+
defaultValues: s,
|
|
1645
|
+
mode: n,
|
|
1646
|
+
reValidateMode: o
|
|
1647
|
+
}), d = l.handleSubmit(e);
|
|
1648
|
+
return /* @__PURE__ */ k(sr.Provider, { value: l, children: /* @__PURE__ */ k("form", { onSubmit: d, ...a, children: typeof r == "function" ? r(l) : r }) });
|
|
1649
|
+
}
|
|
1650
|
+
const uo = us, cs = "FormLabel-module__label___0M-fo", ds = "FormLabel-module__disabled___ktIFp", Rt = {
|
|
1651
|
+
label: cs,
|
|
1652
|
+
disabled: ds
|
|
1653
|
+
}, fs = ({
|
|
283
1654
|
color: e = "#000",
|
|
284
|
-
disabled:
|
|
285
|
-
fontSize:
|
|
1655
|
+
disabled: r = !1,
|
|
1656
|
+
fontSize: t = ".85em"
|
|
286
1657
|
}) => ({
|
|
287
1658
|
color: e,
|
|
288
|
-
fontSize:
|
|
289
|
-
opacity:
|
|
290
|
-
cursor:
|
|
291
|
-
}),
|
|
1659
|
+
fontSize: t,
|
|
1660
|
+
opacity: r ? 0.5 : 1,
|
|
1661
|
+
cursor: r ? "not-allowed" : "default"
|
|
1662
|
+
}), ys = ({
|
|
292
1663
|
children: e,
|
|
293
|
-
color:
|
|
294
|
-
disabled:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
1664
|
+
color: r,
|
|
1665
|
+
disabled: t = !1,
|
|
1666
|
+
error: s = !1,
|
|
1667
|
+
fontSize: n,
|
|
1668
|
+
htmlFor: o,
|
|
1669
|
+
style: a,
|
|
298
1670
|
...l
|
|
299
1671
|
}) => {
|
|
300
|
-
const
|
|
301
|
-
color:
|
|
302
|
-
disabled:
|
|
303
|
-
fontSize:
|
|
304
|
-
}),
|
|
305
|
-
color:
|
|
306
|
-
fontSize:
|
|
307
|
-
opacity:
|
|
308
|
-
cursor:
|
|
309
|
-
...
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
|
|
1672
|
+
const d = q(), h = d.colors.error, f = s ? h : r || d.colors.primary, g = fs({
|
|
1673
|
+
color: f,
|
|
1674
|
+
disabled: t,
|
|
1675
|
+
fontSize: n || ".85em"
|
|
1676
|
+
}), y = {
|
|
1677
|
+
color: g.color,
|
|
1678
|
+
fontSize: g.fontSize,
|
|
1679
|
+
opacity: g.opacity,
|
|
1680
|
+
cursor: g.cursor,
|
|
1681
|
+
...a
|
|
1682
|
+
}, x = [
|
|
1683
|
+
Rt.label,
|
|
1684
|
+
t ? Rt.disabled : ""
|
|
313
1685
|
].filter(Boolean).join(" ");
|
|
314
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ k(
|
|
315
1687
|
"label",
|
|
316
1688
|
{
|
|
317
|
-
className:
|
|
318
|
-
htmlFor:
|
|
319
|
-
style:
|
|
1689
|
+
className: x,
|
|
1690
|
+
htmlFor: o,
|
|
1691
|
+
style: y,
|
|
320
1692
|
...l,
|
|
321
1693
|
children: e
|
|
322
1694
|
}
|
|
323
1695
|
);
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
1696
|
+
}, ms = "FormError-module__formError___kaUBn", hs = {
|
|
1697
|
+
formError: ms
|
|
1698
|
+
}, gs = ({
|
|
1699
|
+
children: e,
|
|
1700
|
+
className: r,
|
|
1701
|
+
style: t
|
|
1702
|
+
}) => {
|
|
1703
|
+
const n = {
|
|
1704
|
+
color: q().colors.error,
|
|
1705
|
+
...t
|
|
1706
|
+
};
|
|
1707
|
+
return /* @__PURE__ */ k(
|
|
1708
|
+
"div",
|
|
1709
|
+
{
|
|
1710
|
+
className: `${hs.formError} ${r || ""}`.trim(),
|
|
1711
|
+
style: n,
|
|
1712
|
+
role: "alert",
|
|
1713
|
+
"aria-live": "polite",
|
|
1714
|
+
children: e
|
|
1715
|
+
}
|
|
1716
|
+
);
|
|
1717
|
+
}, _s = "FormGroup-module__formGroup___aVI-B", ps = "FormGroup-module__inputWrapper___429QE", vs = "FormGroup-module__error___3axpm", bs = "FormGroup-module__disabled___W-tJ0", Ss = "FormGroup-module__required___mO3xA", ge = {
|
|
1718
|
+
formGroup: _s,
|
|
1719
|
+
inputWrapper: ps,
|
|
1720
|
+
error: vs,
|
|
1721
|
+
disabled: bs,
|
|
1722
|
+
required: Ss
|
|
1723
|
+
}, xs = ({
|
|
1724
|
+
children: e,
|
|
1725
|
+
label: r,
|
|
1726
|
+
name: t,
|
|
1727
|
+
error: s = !1,
|
|
1728
|
+
errorMessage: n,
|
|
1729
|
+
disabled: o = !1,
|
|
1730
|
+
required: a = !1,
|
|
1731
|
+
className: l,
|
|
1732
|
+
style: d,
|
|
1733
|
+
labelProps: h
|
|
1734
|
+
}) => {
|
|
1735
|
+
const f = [
|
|
1736
|
+
ge.formGroup,
|
|
1737
|
+
s ? ge.error : "",
|
|
1738
|
+
o ? ge.disabled : "",
|
|
1739
|
+
l
|
|
1740
|
+
].filter(Boolean).join(" "), g = V.Children.map(e, (y) => {
|
|
1741
|
+
if (V.isValidElement(y)) {
|
|
1742
|
+
const x = {};
|
|
1743
|
+
if (o && y.props.disabled === void 0 && (x.disabled = !0), s && y.props.error === void 0 && (x.error = !0), t && y.props.id === void 0 && (x.id = t), Object.keys(x).length > 0)
|
|
1744
|
+
return V.cloneElement(y, x);
|
|
1745
|
+
}
|
|
1746
|
+
return y;
|
|
1747
|
+
});
|
|
1748
|
+
return /* @__PURE__ */ ne("div", { className: f, style: d, children: [
|
|
1749
|
+
r && /* @__PURE__ */ ne(
|
|
1750
|
+
ys,
|
|
1751
|
+
{
|
|
1752
|
+
htmlFor: t,
|
|
1753
|
+
disabled: o,
|
|
1754
|
+
error: s,
|
|
1755
|
+
...h,
|
|
1756
|
+
children: [
|
|
1757
|
+
r,
|
|
1758
|
+
a && /* @__PURE__ */ k("span", { className: ge.required, "aria-label": "required", children: " *" })
|
|
1759
|
+
]
|
|
1760
|
+
}
|
|
1761
|
+
),
|
|
1762
|
+
/* @__PURE__ */ k("div", { className: ge.inputWrapper, children: g }),
|
|
1763
|
+
s && n && /* @__PURE__ */ k(gs, { children: n })
|
|
1764
|
+
] });
|
|
1765
|
+
};
|
|
1766
|
+
function Se({
|
|
1767
|
+
name: e,
|
|
1768
|
+
label: r,
|
|
1769
|
+
required: t,
|
|
1770
|
+
children: s,
|
|
1771
|
+
rules: n,
|
|
1772
|
+
disabled: o,
|
|
1773
|
+
className: a,
|
|
1774
|
+
style: l
|
|
1775
|
+
}) {
|
|
1776
|
+
const { control: d, formState: h } = ls(), {
|
|
1777
|
+
field: f,
|
|
1778
|
+
fieldState: { error: g }
|
|
1779
|
+
} = Nr({
|
|
1780
|
+
name: e,
|
|
1781
|
+
control: d,
|
|
1782
|
+
rules: n
|
|
1783
|
+
});
|
|
1784
|
+
return /* @__PURE__ */ k(
|
|
1785
|
+
xs,
|
|
1786
|
+
{
|
|
1787
|
+
label: r,
|
|
1788
|
+
name: e,
|
|
1789
|
+
error: !!g,
|
|
1790
|
+
errorMessage: g == null ? void 0 : g.message,
|
|
1791
|
+
disabled: o,
|
|
1792
|
+
required: t,
|
|
1793
|
+
className: a,
|
|
1794
|
+
style: l,
|
|
1795
|
+
children: s({
|
|
1796
|
+
value: f.value,
|
|
1797
|
+
onChange: f.onChange,
|
|
1798
|
+
onBlur: f.onBlur,
|
|
1799
|
+
name: f.name,
|
|
1800
|
+
error: !!g
|
|
1801
|
+
})
|
|
1802
|
+
}
|
|
1803
|
+
);
|
|
1804
|
+
}
|
|
1805
|
+
const Fs = "Input-module__input___WjT81", Vs = "Input-module__sizeSmall___NFvsi", ws = "Input-module__sizeDefault___AxPA0", Ie = {
|
|
1806
|
+
input: Fs,
|
|
1807
|
+
sizeSmall: Vs,
|
|
1808
|
+
sizeDefault: ws
|
|
1809
|
+
}, ks = ({
|
|
329
1810
|
color: e = "#000",
|
|
330
|
-
disabled:
|
|
331
|
-
fontSize:
|
|
1811
|
+
disabled: r = !1,
|
|
1812
|
+
fontSize: t = "1em",
|
|
332
1813
|
placeholderOpacity: s = 0.3
|
|
333
1814
|
}) => ({
|
|
334
1815
|
borderColor: e,
|
|
335
1816
|
color: e,
|
|
336
|
-
fontSize:
|
|
337
|
-
opacity:
|
|
1817
|
+
fontSize: t,
|
|
1818
|
+
opacity: r ? 0.3 : 1,
|
|
338
1819
|
placeholderOpacity: s
|
|
339
|
-
}),
|
|
1820
|
+
}), Cs = ({
|
|
340
1821
|
color: e,
|
|
341
|
-
disabled:
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
1822
|
+
disabled: r = !1,
|
|
1823
|
+
error: t = !1,
|
|
1824
|
+
fontSize: s,
|
|
1825
|
+
name: n = "",
|
|
1826
|
+
onChange: o,
|
|
1827
|
+
placeholder: a,
|
|
346
1828
|
placeholderOpacity: l = 0.3,
|
|
347
|
-
size:
|
|
348
|
-
style:
|
|
349
|
-
type:
|
|
350
|
-
value:
|
|
351
|
-
...
|
|
1829
|
+
size: d,
|
|
1830
|
+
style: h,
|
|
1831
|
+
type: f = "text",
|
|
1832
|
+
value: g = "",
|
|
1833
|
+
...y
|
|
352
1834
|
}) => {
|
|
353
|
-
const
|
|
354
|
-
color:
|
|
355
|
-
disabled:
|
|
356
|
-
fontSize:
|
|
1835
|
+
const x = q(), A = x.colors.error, F = t ? A : e || x.colors.primary, C = ks({
|
|
1836
|
+
color: F,
|
|
1837
|
+
disabled: r,
|
|
1838
|
+
fontSize: s || x.fonts.size,
|
|
357
1839
|
placeholderOpacity: l
|
|
358
|
-
}),
|
|
359
|
-
"--placeholder-opacity":
|
|
360
|
-
borderColor:
|
|
361
|
-
color:
|
|
362
|
-
fontSize:
|
|
363
|
-
opacity:
|
|
364
|
-
...
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
|
|
1840
|
+
}), P = {
|
|
1841
|
+
"--placeholder-opacity": C.placeholderOpacity,
|
|
1842
|
+
borderColor: C.borderColor,
|
|
1843
|
+
color: C.color,
|
|
1844
|
+
fontSize: C.fontSize,
|
|
1845
|
+
opacity: C.opacity,
|
|
1846
|
+
...h
|
|
1847
|
+
}, b = [
|
|
1848
|
+
Ie.input,
|
|
1849
|
+
d === "small" ? Ie.sizeSmall : Ie.sizeDefault
|
|
368
1850
|
].filter(Boolean).join(" ");
|
|
369
|
-
return /* @__PURE__ */
|
|
1851
|
+
return /* @__PURE__ */ k(
|
|
370
1852
|
"input",
|
|
371
1853
|
{
|
|
372
|
-
className:
|
|
1854
|
+
className: b,
|
|
1855
|
+
disabled: r,
|
|
1856
|
+
name: n,
|
|
1857
|
+
onChange: o,
|
|
1858
|
+
placeholder: a,
|
|
1859
|
+
style: P,
|
|
1860
|
+
type: f,
|
|
1861
|
+
value: g,
|
|
1862
|
+
...y
|
|
1863
|
+
}
|
|
1864
|
+
);
|
|
1865
|
+
};
|
|
1866
|
+
function co({
|
|
1867
|
+
name: e,
|
|
1868
|
+
label: r,
|
|
1869
|
+
required: t,
|
|
1870
|
+
rules: s,
|
|
1871
|
+
disabled: n,
|
|
1872
|
+
className: o,
|
|
1873
|
+
style: a,
|
|
1874
|
+
...l
|
|
1875
|
+
}) {
|
|
1876
|
+
return /* @__PURE__ */ k(
|
|
1877
|
+
Se,
|
|
1878
|
+
{
|
|
1879
|
+
name: e,
|
|
1880
|
+
label: r,
|
|
1881
|
+
required: t,
|
|
1882
|
+
rules: s,
|
|
1883
|
+
disabled: n,
|
|
1884
|
+
className: o,
|
|
1885
|
+
style: a,
|
|
1886
|
+
children: ({ value: d, onChange: h, onBlur: f, name: g, error: y }) => /* @__PURE__ */ k(
|
|
1887
|
+
Cs,
|
|
1888
|
+
{
|
|
1889
|
+
...l,
|
|
1890
|
+
name: g,
|
|
1891
|
+
value: d || "",
|
|
1892
|
+
onChange: (x) => h(x.target.value),
|
|
1893
|
+
onBlur: f,
|
|
1894
|
+
error: y
|
|
1895
|
+
}
|
|
1896
|
+
)
|
|
1897
|
+
}
|
|
1898
|
+
);
|
|
1899
|
+
}
|
|
1900
|
+
const Es = "Textarea-module__textarea___Z-y6g", As = "Textarea-module__sizeSmall___HHFEM", zs = "Textarea-module__sizeDefault___LL2Uc", Be = {
|
|
1901
|
+
textarea: Es,
|
|
1902
|
+
sizeSmall: As,
|
|
1903
|
+
sizeDefault: zs
|
|
1904
|
+
}, Ds = ({
|
|
1905
|
+
color: e = "#000",
|
|
1906
|
+
disabled: r = !1,
|
|
1907
|
+
placeholderOpacity: t = 0.3
|
|
1908
|
+
}) => ({
|
|
1909
|
+
color: e,
|
|
1910
|
+
borderColor: e,
|
|
1911
|
+
opacity: r ? 0.3 : 1,
|
|
1912
|
+
placeholderOpacity: t
|
|
1913
|
+
}), Ps = ({
|
|
1914
|
+
color: e,
|
|
1915
|
+
disabled: r = !1,
|
|
1916
|
+
error: t = !1,
|
|
1917
|
+
fontSize: s,
|
|
1918
|
+
name: n = "",
|
|
1919
|
+
onChange: o,
|
|
1920
|
+
placeholder: a,
|
|
1921
|
+
placeholderOpacity: l = 0.3,
|
|
1922
|
+
rows: d = 3,
|
|
1923
|
+
size: h,
|
|
1924
|
+
style: f,
|
|
1925
|
+
value: g = "",
|
|
1926
|
+
...y
|
|
1927
|
+
}) => {
|
|
1928
|
+
const x = q(), A = x.colors.error, F = t ? A : e || x.colors.primary, C = Ds({
|
|
1929
|
+
color: F,
|
|
1930
|
+
disabled: r,
|
|
1931
|
+
placeholderOpacity: l
|
|
1932
|
+
}), P = `textarea-placeholder-${V.useId ? V.useId() : Math.random().toString(36)}`;
|
|
1933
|
+
V.useEffect(() => {
|
|
1934
|
+
const E = document.createElement("style");
|
|
1935
|
+
return E.id = P, E.textContent = `
|
|
1936
|
+
.${P}::placeholder {
|
|
1937
|
+
color: inherit;
|
|
1938
|
+
opacity: ${C.placeholderOpacity};
|
|
1939
|
+
}
|
|
1940
|
+
`, document.head.appendChild(E), () => {
|
|
1941
|
+
const w = document.getElementById(P);
|
|
1942
|
+
w && w.remove();
|
|
1943
|
+
};
|
|
1944
|
+
}, [P, C.placeholderOpacity]);
|
|
1945
|
+
const b = {
|
|
1946
|
+
borderColor: C.borderColor,
|
|
1947
|
+
color: C.color,
|
|
1948
|
+
fontSize: s || x.fonts.size,
|
|
1949
|
+
opacity: C.opacity,
|
|
1950
|
+
...f
|
|
1951
|
+
}, z = [
|
|
1952
|
+
Be.textarea,
|
|
1953
|
+
h === "small" ? Be.sizeSmall : Be.sizeDefault,
|
|
1954
|
+
P
|
|
1955
|
+
].filter(Boolean).join(" ");
|
|
1956
|
+
return /* @__PURE__ */ k(
|
|
1957
|
+
"textarea",
|
|
1958
|
+
{
|
|
1959
|
+
className: z,
|
|
1960
|
+
disabled: r,
|
|
1961
|
+
name: n,
|
|
1962
|
+
onChange: o,
|
|
1963
|
+
placeholder: a,
|
|
1964
|
+
rows: d,
|
|
1965
|
+
style: b,
|
|
1966
|
+
value: g,
|
|
1967
|
+
...y
|
|
1968
|
+
}
|
|
1969
|
+
);
|
|
1970
|
+
};
|
|
1971
|
+
function fo({
|
|
1972
|
+
name: e,
|
|
1973
|
+
label: r,
|
|
1974
|
+
required: t,
|
|
1975
|
+
rules: s,
|
|
1976
|
+
disabled: n,
|
|
1977
|
+
className: o,
|
|
1978
|
+
style: a,
|
|
1979
|
+
...l
|
|
1980
|
+
}) {
|
|
1981
|
+
return /* @__PURE__ */ k(
|
|
1982
|
+
Se,
|
|
1983
|
+
{
|
|
1984
|
+
name: e,
|
|
1985
|
+
label: r,
|
|
1986
|
+
required: t,
|
|
1987
|
+
rules: s,
|
|
1988
|
+
disabled: n,
|
|
1989
|
+
className: o,
|
|
1990
|
+
style: a,
|
|
1991
|
+
children: ({ value: d, onChange: h, onBlur: f, name: g, error: y }) => /* @__PURE__ */ k(
|
|
1992
|
+
Ps,
|
|
1993
|
+
{
|
|
1994
|
+
...l,
|
|
1995
|
+
name: g,
|
|
1996
|
+
value: d || "",
|
|
1997
|
+
onChange: (x) => h(x.target.value),
|
|
1998
|
+
onBlur: f,
|
|
1999
|
+
error: y
|
|
2000
|
+
}
|
|
2001
|
+
)
|
|
2002
|
+
}
|
|
2003
|
+
);
|
|
2004
|
+
}
|
|
2005
|
+
const Rs = "Select-module__select___cjdcr", Ns = "Select-module__sizeSmall___i1quj", Os = "Select-module__sizeDefault___EiWvW", $e = {
|
|
2006
|
+
select: Rs,
|
|
2007
|
+
sizeSmall: Ns,
|
|
2008
|
+
sizeDefault: Os
|
|
2009
|
+
}, Ms = ({
|
|
2010
|
+
color: e = "#000",
|
|
2011
|
+
disabled: r = !1
|
|
2012
|
+
}) => ({
|
|
2013
|
+
color: e,
|
|
2014
|
+
borderColor: e,
|
|
2015
|
+
cursor: r ? "default" : "pointer",
|
|
2016
|
+
opacity: r ? 0.3 : 1,
|
|
2017
|
+
backgroundImage: ((o) => {
|
|
2018
|
+
const a = `
|
|
2019
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
2020
|
+
<path
|
|
2021
|
+
d="M 30 42.5 L 50 22.5 L 70 42.5"
|
|
2022
|
+
stroke="${o}"
|
|
2023
|
+
stroke-width="11"
|
|
2024
|
+
fill="transparent"
|
|
2025
|
+
/>
|
|
2026
|
+
<path
|
|
2027
|
+
d="M 30 58.5 L 50 78.5 L 70 58.5"
|
|
2028
|
+
stroke="${o}"
|
|
2029
|
+
stroke-width="11"
|
|
2030
|
+
fill="transparent"
|
|
2031
|
+
/>
|
|
2032
|
+
</svg>
|
|
2033
|
+
`.trim();
|
|
2034
|
+
return `url("data:image/svg+xml,${encodeURIComponent(a)}")`;
|
|
2035
|
+
})(e)
|
|
2036
|
+
}), Ts = ({
|
|
2037
|
+
children: e,
|
|
2038
|
+
color: r,
|
|
2039
|
+
disabled: t = !1,
|
|
2040
|
+
error: s = !1,
|
|
2041
|
+
fontSize: n,
|
|
2042
|
+
name: o = "",
|
|
2043
|
+
onChange: a,
|
|
2044
|
+
placeholder: l = "",
|
|
2045
|
+
size: d,
|
|
2046
|
+
style: h,
|
|
2047
|
+
value: f = "",
|
|
2048
|
+
...g
|
|
2049
|
+
}) => {
|
|
2050
|
+
const y = q(), x = y.colors.error, A = s ? x : r || y.colors.primary, F = Ms({
|
|
2051
|
+
color: A,
|
|
2052
|
+
disabled: t
|
|
2053
|
+
}), C = {
|
|
2054
|
+
backgroundImage: F.backgroundImage,
|
|
2055
|
+
backgroundPosition: "right center",
|
|
2056
|
+
backgroundRepeat: "no-repeat",
|
|
2057
|
+
backgroundSize: "auto 85%",
|
|
2058
|
+
backgroundColor: "transparent",
|
|
2059
|
+
borderColor: F.borderColor,
|
|
2060
|
+
color: F.color,
|
|
2061
|
+
cursor: F.cursor,
|
|
2062
|
+
fontSize: n || y.fonts.size,
|
|
2063
|
+
opacity: F.opacity,
|
|
2064
|
+
...h
|
|
2065
|
+
}, P = [
|
|
2066
|
+
$e.select,
|
|
2067
|
+
d === "small" ? $e.sizeSmall : $e.sizeDefault
|
|
2068
|
+
].filter(Boolean).join(" ");
|
|
2069
|
+
return /* @__PURE__ */ ne(
|
|
2070
|
+
"select",
|
|
2071
|
+
{
|
|
2072
|
+
className: P,
|
|
373
2073
|
disabled: t,
|
|
374
|
-
name:
|
|
375
|
-
onChange:
|
|
376
|
-
|
|
377
|
-
style: y,
|
|
378
|
-
type: u,
|
|
2074
|
+
name: o,
|
|
2075
|
+
onChange: a,
|
|
2076
|
+
style: C,
|
|
379
2077
|
value: f,
|
|
380
|
-
...
|
|
2078
|
+
...g,
|
|
2079
|
+
children: [
|
|
2080
|
+
l !== "" && /* @__PURE__ */ k("option", { disabled: !0, value: "", children: l }),
|
|
2081
|
+
e
|
|
2082
|
+
]
|
|
381
2083
|
}
|
|
382
2084
|
);
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
label:
|
|
387
|
-
|
|
2085
|
+
};
|
|
2086
|
+
function yo({
|
|
2087
|
+
name: e,
|
|
2088
|
+
label: r,
|
|
2089
|
+
required: t,
|
|
2090
|
+
rules: s,
|
|
2091
|
+
disabled: n,
|
|
2092
|
+
className: o,
|
|
2093
|
+
style: a,
|
|
2094
|
+
children: l,
|
|
2095
|
+
...d
|
|
2096
|
+
}) {
|
|
2097
|
+
return /* @__PURE__ */ k(
|
|
2098
|
+
Se,
|
|
2099
|
+
{
|
|
2100
|
+
name: e,
|
|
2101
|
+
label: r,
|
|
2102
|
+
required: t,
|
|
2103
|
+
rules: s,
|
|
2104
|
+
disabled: n,
|
|
2105
|
+
className: o,
|
|
2106
|
+
style: a,
|
|
2107
|
+
children: ({ value: h, onChange: f, onBlur: g, name: y, error: x }) => /* @__PURE__ */ k(
|
|
2108
|
+
Ts,
|
|
2109
|
+
{
|
|
2110
|
+
...d,
|
|
2111
|
+
name: y,
|
|
2112
|
+
value: h || "",
|
|
2113
|
+
onChange: (A) => f(A.target.value),
|
|
2114
|
+
onBlur: g,
|
|
2115
|
+
error: x,
|
|
2116
|
+
children: l
|
|
2117
|
+
}
|
|
2118
|
+
)
|
|
2119
|
+
}
|
|
2120
|
+
);
|
|
2121
|
+
}
|
|
2122
|
+
function mo({
|
|
2123
|
+
name: e,
|
|
2124
|
+
required: r,
|
|
2125
|
+
rules: t,
|
|
2126
|
+
disabled: s,
|
|
2127
|
+
className: n,
|
|
2128
|
+
style: o,
|
|
2129
|
+
...a
|
|
2130
|
+
}) {
|
|
2131
|
+
return /* @__PURE__ */ k(
|
|
2132
|
+
Se,
|
|
2133
|
+
{
|
|
2134
|
+
name: e,
|
|
2135
|
+
required: r,
|
|
2136
|
+
rules: t,
|
|
2137
|
+
disabled: s,
|
|
2138
|
+
className: n,
|
|
2139
|
+
style: o,
|
|
2140
|
+
children: ({ value: l, onChange: d, name: h, error: f }) => /* @__PURE__ */ k(
|
|
2141
|
+
Ar,
|
|
2142
|
+
{
|
|
2143
|
+
...a,
|
|
2144
|
+
name: h,
|
|
2145
|
+
checked: !!l,
|
|
2146
|
+
onChange: (g) => d(g.target.checked),
|
|
2147
|
+
error: f
|
|
2148
|
+
}
|
|
2149
|
+
)
|
|
2150
|
+
}
|
|
2151
|
+
);
|
|
2152
|
+
}
|
|
2153
|
+
const Ls = "Radio-module__container___AQxhk", Is = "Radio-module__svg___zl5kF", Bs = "Radio-module__label___vAFIP", Ue = {
|
|
2154
|
+
container: Ls,
|
|
2155
|
+
svg: Is,
|
|
2156
|
+
label: Bs
|
|
2157
|
+
}, $s = ({
|
|
388
2158
|
color: e = "#000",
|
|
389
|
-
disabled:
|
|
2159
|
+
disabled: r = !1
|
|
390
2160
|
}) => ({
|
|
391
2161
|
radioColor: e,
|
|
392
|
-
cursor:
|
|
393
|
-
opacity:
|
|
394
|
-
}),
|
|
2162
|
+
cursor: r ? "default" : "pointer",
|
|
2163
|
+
opacity: r ? 0.3 : 1
|
|
2164
|
+
}), Us = ({
|
|
395
2165
|
checked: e = !1,
|
|
396
|
-
color:
|
|
397
|
-
disabled:
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
2166
|
+
color: r,
|
|
2167
|
+
disabled: t = !1,
|
|
2168
|
+
error: s = !1,
|
|
2169
|
+
fontSize: n,
|
|
2170
|
+
id: o,
|
|
2171
|
+
label: a,
|
|
401
2172
|
labelStyle: l,
|
|
402
|
-
name:
|
|
403
|
-
onChange:
|
|
404
|
-
style:
|
|
405
|
-
...
|
|
2173
|
+
name: d,
|
|
2174
|
+
onChange: h,
|
|
2175
|
+
style: f,
|
|
2176
|
+
...g
|
|
406
2177
|
}) => {
|
|
407
|
-
const
|
|
408
|
-
color:
|
|
409
|
-
disabled:
|
|
410
|
-
}),
|
|
411
|
-
|
|
412
|
-
}, h = {
|
|
413
|
-
cursor: c.cursor,
|
|
414
|
-
fontSize: s || m.fonts.size,
|
|
415
|
-
opacity: c.opacity,
|
|
416
|
-
...u
|
|
2178
|
+
const y = q(), x = o || It(), A = y.colors.error, F = s ? A : r || y.colors.primary, C = $s({
|
|
2179
|
+
color: F,
|
|
2180
|
+
disabled: t
|
|
2181
|
+
}), P = (B) => {
|
|
2182
|
+
t || h(B);
|
|
417
2183
|
}, b = {
|
|
418
|
-
|
|
419
|
-
|
|
2184
|
+
cursor: C.cursor,
|
|
2185
|
+
fontSize: n || y.fonts.size,
|
|
2186
|
+
opacity: C.opacity,
|
|
2187
|
+
...f
|
|
2188
|
+
}, z = {
|
|
2189
|
+
width: n || y.fonts.size
|
|
2190
|
+
}, E = {
|
|
420
2191
|
fill: "transparent",
|
|
421
2192
|
strokeWidth: "12.5",
|
|
422
|
-
stroke:
|
|
423
|
-
}, S = {
|
|
424
|
-
fill: c.radioColor
|
|
2193
|
+
stroke: C.radioColor
|
|
425
2194
|
}, w = {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
2195
|
+
fill: C.radioColor
|
|
2196
|
+
}, I = {
|
|
2197
|
+
color: C.radioColor,
|
|
2198
|
+
cursor: C.cursor,
|
|
2199
|
+
fontSize: n || y.fonts.size,
|
|
429
2200
|
...l
|
|
430
2201
|
};
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ ne("div", { className: Ue.container, style: b, ...g, children: [
|
|
2203
|
+
/* @__PURE__ */ k(
|
|
433
2204
|
"input",
|
|
434
2205
|
{
|
|
435
|
-
id:
|
|
2206
|
+
id: x,
|
|
436
2207
|
checked: e,
|
|
437
|
-
disabled:
|
|
438
|
-
name:
|
|
439
|
-
onChange: (
|
|
2208
|
+
disabled: t,
|
|
2209
|
+
name: d,
|
|
2210
|
+
onChange: (B) => P({ target: { checked: B.target.checked, name: d, type: "radio" } }),
|
|
440
2211
|
style: { display: "none" },
|
|
441
2212
|
type: "radio"
|
|
442
2213
|
}
|
|
443
2214
|
),
|
|
444
|
-
/* @__PURE__ */
|
|
2215
|
+
/* @__PURE__ */ ne(
|
|
445
2216
|
"svg",
|
|
446
2217
|
{
|
|
447
2218
|
xmlns: "http://www.w3.org/2000/svg",
|
|
448
2219
|
viewBox: "0 0 100 100",
|
|
449
|
-
onClick: () =>
|
|
450
|
-
className:
|
|
451
|
-
style:
|
|
2220
|
+
onClick: () => P({ target: { checked: !e, name: d, type: "radio" } }),
|
|
2221
|
+
className: Ue.svg,
|
|
2222
|
+
style: z,
|
|
452
2223
|
children: [
|
|
453
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ k(
|
|
454
2225
|
"circle",
|
|
455
2226
|
{
|
|
456
2227
|
cx: "50",
|
|
457
2228
|
cy: "50",
|
|
458
2229
|
r: "42.5",
|
|
459
2230
|
width: "100%",
|
|
460
|
-
style:
|
|
2231
|
+
style: E
|
|
461
2232
|
}
|
|
462
2233
|
),
|
|
463
|
-
e && /* @__PURE__ */
|
|
2234
|
+
e && /* @__PURE__ */ k(
|
|
464
2235
|
"circle",
|
|
465
2236
|
{
|
|
466
2237
|
cx: "50",
|
|
467
2238
|
cy: "50",
|
|
468
2239
|
r: "25",
|
|
469
|
-
style:
|
|
2240
|
+
style: w
|
|
470
2241
|
}
|
|
471
2242
|
)
|
|
472
2243
|
]
|
|
473
2244
|
}
|
|
474
2245
|
),
|
|
475
|
-
|
|
2246
|
+
a && /* @__PURE__ */ k(
|
|
476
2247
|
"label",
|
|
477
2248
|
{
|
|
478
|
-
htmlFor:
|
|
479
|
-
className:
|
|
480
|
-
style:
|
|
481
|
-
children:
|
|
2249
|
+
htmlFor: x,
|
|
2250
|
+
className: Ue.label,
|
|
2251
|
+
style: I,
|
|
2252
|
+
children: a
|
|
482
2253
|
}
|
|
483
2254
|
)
|
|
484
2255
|
] });
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
disabled:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
|
|
500
|
-
<path
|
|
501
|
-
d="M 30 42.5 L 50 22.5 L 70 42.5"
|
|
502
|
-
stroke="${n}"
|
|
503
|
-
stroke-width="11"
|
|
504
|
-
fill="transparent"
|
|
505
|
-
/>
|
|
506
|
-
<path
|
|
507
|
-
d="M 30 58.5 L 50 78.5 L 70 58.5"
|
|
508
|
-
stroke="${n}"
|
|
509
|
-
stroke-width="11"
|
|
510
|
-
fill="transparent"
|
|
511
|
-
/>
|
|
512
|
-
</svg>
|
|
513
|
-
`.trim();
|
|
514
|
-
return `url("data:image/svg+xml,${encodeURIComponent(l)}")`;
|
|
515
|
-
})(e)
|
|
516
|
-
}), rt = ({
|
|
517
|
-
children: e,
|
|
518
|
-
color: t,
|
|
519
|
-
disabled: o = !1,
|
|
520
|
-
fontSize: s,
|
|
521
|
-
name: r = "",
|
|
522
|
-
onChange: n,
|
|
523
|
-
placeholder: l = "",
|
|
524
|
-
size: a,
|
|
525
|
-
style: i,
|
|
526
|
-
value: u = "",
|
|
527
|
-
...f
|
|
528
|
-
}) => {
|
|
529
|
-
const m = _(), d = Ne({
|
|
530
|
-
color: t || m.colors.primary,
|
|
531
|
-
disabled: o
|
|
532
|
-
}), c = {
|
|
533
|
-
backgroundImage: d.backgroundImage,
|
|
534
|
-
backgroundPosition: "right center",
|
|
535
|
-
backgroundRepeat: "no-repeat",
|
|
536
|
-
backgroundSize: "auto 85%",
|
|
537
|
-
backgroundColor: "transparent",
|
|
538
|
-
borderColor: d.borderColor,
|
|
539
|
-
color: d.color,
|
|
540
|
-
cursor: d.cursor,
|
|
541
|
-
fontSize: s || m.fonts.size,
|
|
542
|
-
opacity: d.opacity,
|
|
543
|
-
...i
|
|
544
|
-
}, y = [
|
|
545
|
-
M.select,
|
|
546
|
-
a === "small" ? M.sizeSmall : M.sizeDefault
|
|
547
|
-
].filter(Boolean).join(" ");
|
|
548
|
-
return /* @__PURE__ */ z(
|
|
549
|
-
"select",
|
|
2256
|
+
};
|
|
2257
|
+
function ho({
|
|
2258
|
+
name: e,
|
|
2259
|
+
label: r,
|
|
2260
|
+
required: t,
|
|
2261
|
+
rules: s,
|
|
2262
|
+
disabled: n,
|
|
2263
|
+
className: o,
|
|
2264
|
+
style: a,
|
|
2265
|
+
value: l,
|
|
2266
|
+
...d
|
|
2267
|
+
}) {
|
|
2268
|
+
return /* @__PURE__ */ k(
|
|
2269
|
+
Se,
|
|
550
2270
|
{
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
2271
|
+
name: e,
|
|
2272
|
+
required: t,
|
|
2273
|
+
rules: s,
|
|
2274
|
+
disabled: n,
|
|
2275
|
+
className: o,
|
|
2276
|
+
style: a,
|
|
2277
|
+
children: ({ value: h, onChange: f, name: g, error: y }) => /* @__PURE__ */ k(
|
|
2278
|
+
Us,
|
|
2279
|
+
{
|
|
2280
|
+
...d,
|
|
2281
|
+
name: g,
|
|
2282
|
+
checked: h === l,
|
|
2283
|
+
onChange: () => f(l),
|
|
2284
|
+
error: y,
|
|
2285
|
+
label: r
|
|
2286
|
+
}
|
|
2287
|
+
)
|
|
562
2288
|
}
|
|
563
2289
|
);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
color: e,
|
|
579
|
-
disabled: t = !1,
|
|
580
|
-
fontSize: o,
|
|
581
|
-
name: s = "",
|
|
582
|
-
onChange: r,
|
|
583
|
-
placeholder: n,
|
|
584
|
-
placeholderOpacity: l = 0.3,
|
|
585
|
-
rows: a = 3,
|
|
586
|
-
size: i,
|
|
587
|
-
style: u,
|
|
588
|
-
value: f = "",
|
|
589
|
-
...m
|
|
590
|
-
}) => {
|
|
591
|
-
const d = _(), c = Me({
|
|
592
|
-
color: e || d.colors.primary,
|
|
593
|
-
disabled: t,
|
|
594
|
-
placeholderOpacity: l
|
|
595
|
-
}), y = `textarea-placeholder-${N.useId ? N.useId() : Math.random().toString(36)}`;
|
|
596
|
-
N.useEffect(() => {
|
|
597
|
-
const g = document.createElement("style");
|
|
598
|
-
return g.id = y, g.textContent = `
|
|
599
|
-
.${y}::placeholder {
|
|
600
|
-
color: inherit;
|
|
601
|
-
opacity: ${c.placeholderOpacity};
|
|
602
|
-
}
|
|
603
|
-
`, document.head.appendChild(g), () => {
|
|
604
|
-
const S = document.getElementById(y);
|
|
605
|
-
S && S.remove();
|
|
2290
|
+
}
|
|
2291
|
+
const Hs = "Hamburger-module__hamburger___Tf4-t", js = "Hamburger-module__line___gybZM", Ws = "Hamburger-module__open___gRswh", _e = {
|
|
2292
|
+
hamburger: Hs,
|
|
2293
|
+
line: js,
|
|
2294
|
+
open: Ws
|
|
2295
|
+
}, qs = ({ compact: e, color: r, visible: t, borderRadius: s }) => {
|
|
2296
|
+
const n = q();
|
|
2297
|
+
return Mt(() => {
|
|
2298
|
+
const o = e ? { right: ".5em" } : {};
|
|
2299
|
+
return {
|
|
2300
|
+
"--hamburger-border-radius": s || n.borderRadius || "10px",
|
|
2301
|
+
color: r || "inherit",
|
|
2302
|
+
display: t ? "flex" : "none",
|
|
2303
|
+
...o
|
|
606
2304
|
};
|
|
607
|
-
}, [
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
2305
|
+
}, [r, t, e, s, n.borderRadius]);
|
|
2306
|
+
}, Gs = ({
|
|
2307
|
+
visible: e,
|
|
2308
|
+
compact: r,
|
|
2309
|
+
color: t,
|
|
2310
|
+
hamburgerRef: s,
|
|
2311
|
+
open: n = !1,
|
|
2312
|
+
setOpen: o,
|
|
2313
|
+
buttonProps: a,
|
|
2314
|
+
borderRadius: l
|
|
2315
|
+
}) => {
|
|
2316
|
+
const d = qs({
|
|
2317
|
+
compact: r,
|
|
2318
|
+
color: t,
|
|
2319
|
+
visible: e,
|
|
2320
|
+
borderRadius: l
|
|
2321
|
+
}), h = [
|
|
2322
|
+
_e.hamburger,
|
|
2323
|
+
n ? _e.open : ""
|
|
618
2324
|
].filter(Boolean).join(" ");
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
"
|
|
2325
|
+
return /* @__PURE__ */ ne(
|
|
2326
|
+
"button",
|
|
621
2327
|
{
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
2328
|
+
ref: s,
|
|
2329
|
+
className: h,
|
|
2330
|
+
onClick: () => o(!n),
|
|
2331
|
+
style: d,
|
|
2332
|
+
"aria-label": "Toggle menu",
|
|
2333
|
+
"aria-expanded": n,
|
|
2334
|
+
...a,
|
|
2335
|
+
children: [
|
|
2336
|
+
/* @__PURE__ */ k("div", { className: _e.line }),
|
|
2337
|
+
/* @__PURE__ */ k("div", { className: _e.line }),
|
|
2338
|
+
/* @__PURE__ */ k("div", { className: _e.line })
|
|
2339
|
+
]
|
|
631
2340
|
}
|
|
632
2341
|
);
|
|
633
|
-
},
|
|
634
|
-
header:
|
|
635
|
-
container:
|
|
636
|
-
},
|
|
2342
|
+
}, Zs = "Header-module__header___RUooH", Qs = "Header-module__container___t68M9", Nt = {
|
|
2343
|
+
header: Zs,
|
|
2344
|
+
container: Qs
|
|
2345
|
+
}, Js = ({
|
|
637
2346
|
isSmallScreen: e = !1,
|
|
638
|
-
maxWidth:
|
|
639
|
-
paddingSm:
|
|
2347
|
+
maxWidth: r,
|
|
2348
|
+
paddingSm: t,
|
|
640
2349
|
padding: s,
|
|
641
|
-
fontSize:
|
|
2350
|
+
fontSize: n
|
|
642
2351
|
} = {}) => {
|
|
643
|
-
const
|
|
2352
|
+
const o = q();
|
|
644
2353
|
return {
|
|
645
|
-
"--header-max-width":
|
|
646
|
-
"--header-padding": e ?
|
|
647
|
-
"--header-font-size": e ? "0.75rem" :
|
|
2354
|
+
"--header-max-width": r || o.layout.maxWidth,
|
|
2355
|
+
"--header-padding": e ? t || o.layout.wrapperPaddingSm : s || o.layout.wrapperPadding,
|
|
2356
|
+
"--header-font-size": e ? "0.75rem" : n || o.fonts.size
|
|
648
2357
|
};
|
|
649
|
-
},
|
|
650
|
-
const
|
|
651
|
-
return
|
|
652
|
-
if (!
|
|
2358
|
+
}, Ze = (e) => {
|
|
2359
|
+
const r = typeof window < "u" && typeof window.matchMedia == "function";
|
|
2360
|
+
return _r((o) => {
|
|
2361
|
+
if (!r) return () => {
|
|
653
2362
|
};
|
|
654
|
-
const
|
|
655
|
-
return
|
|
656
|
-
}, () =>
|
|
657
|
-
},
|
|
2363
|
+
const a = window.matchMedia(e);
|
|
2364
|
+
return a.addEventListener("change", o), () => a.removeEventListener("change", o);
|
|
2365
|
+
}, () => r ? window.matchMedia(e).matches : !1, () => !1);
|
|
2366
|
+
}, go = ({
|
|
658
2367
|
children: e,
|
|
659
|
-
breakPointSm:
|
|
660
|
-
maxWidth:
|
|
2368
|
+
breakPointSm: r,
|
|
2369
|
+
maxWidth: t,
|
|
661
2370
|
paddingSm: s,
|
|
662
|
-
padding:
|
|
663
|
-
fontSize:
|
|
664
|
-
style:
|
|
665
|
-
headerProps:
|
|
666
|
-
headerRef:
|
|
2371
|
+
padding: n,
|
|
2372
|
+
fontSize: o,
|
|
2373
|
+
style: a = {},
|
|
2374
|
+
headerProps: l = {},
|
|
2375
|
+
headerRef: d
|
|
667
2376
|
}) => {
|
|
668
|
-
const
|
|
669
|
-
isSmallScreen:
|
|
670
|
-
maxWidth:
|
|
2377
|
+
const h = q(), g = (r || h.breakpoints.sm).match(/^(\d+(?:\.\d+)?)(px|em|rem)$/), y = g ? parseInt(g[1], 10) - 1 : 474, x = g ? g[2] : "px", A = Ze(`(max-width: ${y}${x})`), F = Js({
|
|
2378
|
+
isSmallScreen: A,
|
|
2379
|
+
maxWidth: t,
|
|
671
2380
|
paddingSm: s,
|
|
672
|
-
padding:
|
|
673
|
-
fontSize:
|
|
2381
|
+
padding: n,
|
|
2382
|
+
fontSize: o
|
|
674
2383
|
});
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
},
|
|
677
|
-
nav:
|
|
678
|
-
navMobile:
|
|
679
|
-
open:
|
|
680
|
-
navDesktop:
|
|
681
|
-
},
|
|
2384
|
+
return /* @__PURE__ */ k("header", { ref: d, className: Nt.header, ...l, children: /* @__PURE__ */ k("div", { className: Nt.container, style: { ...F, ...a }, children: e }) });
|
|
2385
|
+
}, Ks = "ResponsiveNav-module__nav___xOfv5", Ys = "ResponsiveNav-module__navMobile___h795P", Xs = "ResponsiveNav-module__open___WDCAf", eo = "ResponsiveNav-module__navDesktop___9wscZ", Ce = {
|
|
2386
|
+
nav: Ks,
|
|
2387
|
+
navMobile: Ys,
|
|
2388
|
+
open: Xs,
|
|
2389
|
+
navDesktop: eo
|
|
2390
|
+
}, to = ({
|
|
682
2391
|
isMobile: e,
|
|
683
|
-
isCompact:
|
|
684
|
-
mobileBackground:
|
|
2392
|
+
isCompact: r,
|
|
2393
|
+
mobileBackground: t,
|
|
685
2394
|
mobileColor: s,
|
|
686
|
-
mobileActiveBackground:
|
|
687
|
-
mobileActiveColor:
|
|
688
|
-
mobileButtonHoverColor:
|
|
2395
|
+
mobileActiveBackground: n,
|
|
2396
|
+
mobileActiveColor: o,
|
|
2397
|
+
mobileButtonHoverColor: a
|
|
689
2398
|
}) => {
|
|
690
|
-
const
|
|
691
|
-
return
|
|
2399
|
+
const l = q();
|
|
2400
|
+
return Mt(() => ({
|
|
692
2401
|
...e ? {
|
|
693
|
-
"--mobile-nav-background":
|
|
694
|
-
"--mobile-nav-color": s ||
|
|
695
|
-
"--mobile-nav-active-background":
|
|
696
|
-
"--mobile-nav-active-color":
|
|
697
|
-
"--mobile-nav-button-hover-text-color":
|
|
2402
|
+
"--mobile-nav-background": t || l.colors.accent,
|
|
2403
|
+
"--mobile-nav-color": s || l.colors.primary,
|
|
2404
|
+
"--mobile-nav-active-background": n || l.colors.primary,
|
|
2405
|
+
"--mobile-nav-active-color": o || l.colors.accent,
|
|
2406
|
+
"--mobile-nav-button-hover-text-color": a || t || l.colors.accent
|
|
698
2407
|
} : {}
|
|
699
2408
|
}), [
|
|
700
|
-
|
|
2409
|
+
t,
|
|
701
2410
|
s,
|
|
702
|
-
r,
|
|
703
2411
|
n,
|
|
704
|
-
|
|
705
|
-
a
|
|
706
|
-
|
|
2412
|
+
o,
|
|
2413
|
+
a,
|
|
2414
|
+
l.colors.accent,
|
|
2415
|
+
l.colors.primary,
|
|
707
2416
|
e,
|
|
708
|
-
|
|
2417
|
+
r
|
|
709
2418
|
]);
|
|
710
|
-
}, Ae = "Hamburger-module__hamburger___Tf4-t", Oe = "Hamburger-module__line___gybZM", Ue = "Hamburger-module__open___gRswh", C = {
|
|
711
|
-
hamburger: Ae,
|
|
712
|
-
line: Oe,
|
|
713
|
-
open: Ue
|
|
714
|
-
}, qe = ({ compact: e, color: t, visible: o, borderRadius: s }) => {
|
|
715
|
-
const r = _();
|
|
716
|
-
return G(() => {
|
|
717
|
-
const n = e ? { right: ".5em" } : {};
|
|
718
|
-
return {
|
|
719
|
-
"--hamburger-border-radius": s || r.borderRadius || "10px",
|
|
720
|
-
color: t || "inherit",
|
|
721
|
-
display: o ? "flex" : "none",
|
|
722
|
-
...n
|
|
723
|
-
};
|
|
724
|
-
}, [t, o, e, s, r.borderRadius]);
|
|
725
|
-
}, Qe = ({
|
|
726
|
-
visible: e,
|
|
727
|
-
compact: t,
|
|
728
|
-
color: o,
|
|
729
|
-
hamburgerRef: s,
|
|
730
|
-
open: r = !1,
|
|
731
|
-
setOpen: n,
|
|
732
|
-
buttonProps: l,
|
|
733
|
-
borderRadius: a
|
|
734
|
-
}) => {
|
|
735
|
-
const i = qe({
|
|
736
|
-
compact: t,
|
|
737
|
-
color: o,
|
|
738
|
-
visible: e,
|
|
739
|
-
borderRadius: a
|
|
740
|
-
}), u = [
|
|
741
|
-
C.hamburger,
|
|
742
|
-
r ? C.open : ""
|
|
743
|
-
].filter(Boolean).join(" ");
|
|
744
|
-
return /* @__PURE__ */ z(
|
|
745
|
-
"button",
|
|
746
|
-
{
|
|
747
|
-
ref: s,
|
|
748
|
-
className: u,
|
|
749
|
-
onClick: () => n(!r),
|
|
750
|
-
style: i,
|
|
751
|
-
"aria-label": "Toggle menu",
|
|
752
|
-
"aria-expanded": r,
|
|
753
|
-
...l,
|
|
754
|
-
children: [
|
|
755
|
-
/* @__PURE__ */ p("div", { className: C.line }),
|
|
756
|
-
/* @__PURE__ */ p("div", { className: C.line }),
|
|
757
|
-
/* @__PURE__ */ p("div", { className: C.line })
|
|
758
|
-
]
|
|
759
|
-
}
|
|
760
|
-
);
|
|
761
2419
|
};
|
|
762
|
-
function
|
|
763
|
-
const
|
|
764
|
-
return { maxWidth:
|
|
2420
|
+
function Ot(e) {
|
|
2421
|
+
const t = parseInt(e) - 1, s = e.replace(/[0-9]/g, "");
|
|
2422
|
+
return { maxWidth: t, unit: s };
|
|
765
2423
|
}
|
|
766
|
-
const
|
|
2424
|
+
const _o = ({
|
|
767
2425
|
breakPointMd: e,
|
|
768
|
-
breakPointSm:
|
|
769
|
-
children:
|
|
2426
|
+
breakPointSm: r,
|
|
2427
|
+
children: t,
|
|
770
2428
|
mobileBackground: s,
|
|
771
|
-
mobileColor:
|
|
772
|
-
mobileActiveBackground:
|
|
773
|
-
mobileActiveColor:
|
|
774
|
-
mobileButtonHoverColor:
|
|
775
|
-
style:
|
|
776
|
-
navProps:
|
|
2429
|
+
mobileColor: n,
|
|
2430
|
+
mobileActiveBackground: o,
|
|
2431
|
+
mobileActiveColor: a,
|
|
2432
|
+
mobileButtonHoverColor: l,
|
|
2433
|
+
style: d,
|
|
2434
|
+
navProps: h
|
|
777
2435
|
}) => {
|
|
778
|
-
const [f,
|
|
779
|
-
isMobile:
|
|
780
|
-
isCompact:
|
|
2436
|
+
const [f, g] = Je(!1), y = ht(null), x = ht(null), A = q(), F = e || A.breakpoints.md, C = r || A.breakpoints.sm, { maxWidth: P, unit: b } = Ot(F), { maxWidth: z, unit: E } = Ot(C), w = Ze(`(max-width: ${P}${b})`), I = Ze(`(max-width: ${z}${E})`), B = to({
|
|
2437
|
+
isMobile: w,
|
|
2438
|
+
isCompact: I,
|
|
781
2439
|
mobileBackground: s,
|
|
782
|
-
mobileColor:
|
|
783
|
-
mobileActiveBackground:
|
|
784
|
-
mobileActiveColor:
|
|
785
|
-
mobileButtonHoverColor:
|
|
2440
|
+
mobileColor: n,
|
|
2441
|
+
mobileActiveBackground: o,
|
|
2442
|
+
mobileActiveColor: a,
|
|
2443
|
+
mobileButtonHoverColor: l
|
|
786
2444
|
});
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}, [
|
|
790
|
-
const
|
|
791
|
-
!
|
|
2445
|
+
He(() => {
|
|
2446
|
+
w || g(!1);
|
|
2447
|
+
}, [w]), He(() => {
|
|
2448
|
+
const G = (re) => {
|
|
2449
|
+
!x.current || x.current.contains(re.target) || y.current && y.current.contains(re.target) || g(!1);
|
|
792
2450
|
};
|
|
793
|
-
return document.addEventListener("mousedown",
|
|
794
|
-
document.removeEventListener("mousedown",
|
|
2451
|
+
return document.addEventListener("mousedown", G), () => {
|
|
2452
|
+
document.removeEventListener("mousedown", G);
|
|
795
2453
|
};
|
|
796
|
-
}, [
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
2454
|
+
}, [y, x, g]);
|
|
2455
|
+
const ie = [
|
|
2456
|
+
Ce.nav,
|
|
2457
|
+
w ? Ce.navMobile : Ce.navDesktop,
|
|
2458
|
+
w && f ? Ce.open : ""
|
|
801
2459
|
].filter(Boolean).join(" ");
|
|
802
|
-
return /* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
804
|
-
|
|
2460
|
+
return /* @__PURE__ */ ne(Qe, { children: [
|
|
2461
|
+
/* @__PURE__ */ k(
|
|
2462
|
+
Gs,
|
|
805
2463
|
{
|
|
806
|
-
hamburgerRef:
|
|
807
|
-
visible:
|
|
808
|
-
compact:
|
|
2464
|
+
hamburgerRef: y,
|
|
2465
|
+
visible: w,
|
|
2466
|
+
compact: I,
|
|
809
2467
|
open: f,
|
|
810
|
-
setOpen:
|
|
2468
|
+
setOpen: g
|
|
811
2469
|
}
|
|
812
2470
|
),
|
|
813
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ k(
|
|
814
2472
|
"nav",
|
|
815
2473
|
{
|
|
816
|
-
ref:
|
|
817
|
-
className:
|
|
818
|
-
style: { ...
|
|
819
|
-
...
|
|
820
|
-
children: typeof
|
|
2474
|
+
ref: x,
|
|
2475
|
+
className: ie,
|
|
2476
|
+
style: { ...B, ...d },
|
|
2477
|
+
...h,
|
|
2478
|
+
children: typeof t == "function" ? t({ setOpen: g }) : t
|
|
821
2479
|
}
|
|
822
2480
|
)
|
|
823
2481
|
] });
|
|
824
|
-
},
|
|
2482
|
+
}, ro = ({
|
|
825
2483
|
size: e = 2.5,
|
|
826
|
-
color:
|
|
827
|
-
innerColor:
|
|
2484
|
+
color: r,
|
|
2485
|
+
innerColor: t,
|
|
828
2486
|
fullScreen: s = !0
|
|
829
2487
|
}) => {
|
|
830
|
-
const
|
|
831
|
-
/* @__PURE__ */
|
|
2488
|
+
const n = q(), o = r || n.colors.primary, a = t || n.colors.secondary, l = /* @__PURE__ */ ne(Qe, { children: [
|
|
2489
|
+
/* @__PURE__ */ k(
|
|
832
2490
|
"div",
|
|
833
2491
|
{
|
|
834
2492
|
style: {
|
|
835
|
-
border: `0.25em solid ${
|
|
836
|
-
borderTop: `0.25em solid ${
|
|
2493
|
+
border: `0.25em solid ${o}`,
|
|
2494
|
+
borderTop: `0.25em solid ${a}`,
|
|
837
2495
|
borderRadius: "50%",
|
|
838
2496
|
width: `${e}em`,
|
|
839
2497
|
height: `${e}em`,
|
|
@@ -841,14 +2499,14 @@ const lt = ({
|
|
|
841
2499
|
}
|
|
842
2500
|
}
|
|
843
2501
|
),
|
|
844
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ k("style", { children: `
|
|
845
2503
|
@keyframes spin {
|
|
846
2504
|
0% { transform: rotate(0deg); }
|
|
847
2505
|
100% { transform: rotate(360deg); }
|
|
848
2506
|
}
|
|
849
2507
|
` })
|
|
850
2508
|
] });
|
|
851
|
-
return s ? /* @__PURE__ */
|
|
2509
|
+
return s ? /* @__PURE__ */ k(
|
|
852
2510
|
"div",
|
|
853
2511
|
{
|
|
854
2512
|
style: {
|
|
@@ -858,30 +2516,41 @@ const lt = ({
|
|
|
858
2516
|
height: "100vh",
|
|
859
2517
|
width: "100vw"
|
|
860
2518
|
},
|
|
861
|
-
children:
|
|
2519
|
+
children: l
|
|
862
2520
|
}
|
|
863
|
-
) :
|
|
864
|
-
},
|
|
865
|
-
const [
|
|
866
|
-
return
|
|
2521
|
+
) : l;
|
|
2522
|
+
}, po = ({ children: e, loadingComponent: r }) => {
|
|
2523
|
+
const [t, s] = Je(!1);
|
|
2524
|
+
return He(() => {
|
|
867
2525
|
requestAnimationFrame(() => {
|
|
868
2526
|
s(!0);
|
|
869
2527
|
});
|
|
870
|
-
}, []),
|
|
2528
|
+
}, []), t ? /* @__PURE__ */ k(Qe, { children: e }) : r || /* @__PURE__ */ k(ro, {});
|
|
871
2529
|
};
|
|
872
2530
|
export {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
2531
|
+
ao as Button,
|
|
2532
|
+
lo as CSSReset,
|
|
2533
|
+
Ar as Checkbox,
|
|
2534
|
+
uo as Form,
|
|
2535
|
+
mo as FormCheckbox,
|
|
2536
|
+
gs as FormError,
|
|
2537
|
+
Se as FormField,
|
|
2538
|
+
xs as FormGroup,
|
|
2539
|
+
co as FormInput,
|
|
2540
|
+
ys as FormLabel,
|
|
2541
|
+
ho as FormRadio,
|
|
2542
|
+
yo as FormSelect,
|
|
2543
|
+
fo as FormTextarea,
|
|
2544
|
+
Gs as Hamburger,
|
|
2545
|
+
go as Header,
|
|
2546
|
+
Cs as Input,
|
|
2547
|
+
ro as LoadingSpinner,
|
|
2548
|
+
Us as Radio,
|
|
2549
|
+
_o as ResponsiveNav,
|
|
2550
|
+
Ts as Select,
|
|
2551
|
+
po as StyleLoader,
|
|
2552
|
+
Ps as Textarea,
|
|
2553
|
+
io as ThemeProvider,
|
|
2554
|
+
ls as useFormContext,
|
|
2555
|
+
q as useTheme
|
|
887
2556
|
};
|