@vacano/ui 0.0.1 → 1.2.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/LICENSE.md +1 -1
- package/README.md +67 -124
- package/dist/X-CI1qRJDP.cjs +16 -0
- package/dist/X-CI1qRJDP.cjs.map +1 -0
- package/dist/{Minus-BxmZQPsb.js → X-Cm-i8Bh7.js} +411 -340
- package/dist/X-Cm-i8Bh7.js.map +1 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.cjs.map +1 -1
- package/dist/icons.js +3018 -3097
- package/dist/icons.js.map +1 -1
- package/dist/index.cjs +1761 -569
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +514 -692
- package/dist/index.js +4862 -6180
- package/dist/index.js.map +1 -1
- package/dist/lib.cjs +2 -0
- package/dist/lib.cjs.map +1 -0
- package/dist/lib.d.ts +161 -0
- package/dist/lib.js +20 -0
- package/dist/lib.js.map +1 -0
- package/dist/media-BR6nutcO.js +162 -0
- package/dist/media-BR6nutcO.js.map +1 -0
- package/dist/media-OVL6YjWb.cjs +39 -0
- package/dist/media-OVL6YjWb.cjs.map +1 -0
- package/dist/tooling-Dflq0Y98.cjs +2 -0
- package/dist/tooling-Dflq0Y98.cjs.map +1 -0
- package/dist/tooling-YDHxmiMT.js +18 -0
- package/dist/tooling-YDHxmiMT.js.map +1 -0
- package/package.json +62 -58
- package/dist/Minus-BxmZQPsb.js.map +0 -1
- package/dist/Minus-C6HNRQfO.cjs +0 -16
- package/dist/Minus-C6HNRQfO.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,755 +1,1947 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),ie=require("@emotion/react"),g=require("react"),t=require("./media-OVL6YjWb.cjs"),A=require("./tooling-Dflq0Y98.cjs"),be=require("react-dom");function Go(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(o,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return o.default=e,Object.freeze(o)}const Ce=Go(g);function gt(){return gt=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var r=arguments[o];for(var i in r)({}).hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},gt.apply(null,arguments)}const Wo=ie.css`
|
|
2
|
+
*,
|
|
3
|
+
*::before,
|
|
4
|
+
*::after {
|
|
5
|
+
box-sizing: border-box;
|
|
4
6
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
* {
|
|
9
|
+
margin: 0;
|
|
10
|
+
padding: 0;
|
|
7
11
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
width: ${({$size:e})=>e}px;
|
|
14
|
-
height: ${({$size:e})=>e}px;
|
|
15
|
-
border-radius: 50%;
|
|
16
|
-
background: currentColor;
|
|
17
|
-
animation: ${Sn} 0.8s ease-in-out infinite;
|
|
18
|
-
animation-delay: ${({$delay:e})=>e}s;
|
|
19
|
-
`,In=w.classNameGetter("loader"),yo=({"aria-label":e=xn,className:t,classnames:r,size:o=bn,...n})=>w.jsxs(En,{...n,className:In("container",t,r==null?void 0:r.container),role:"status","aria-label":e,$size:o,children:[w.jsx(Kt,{$size:o,$delay:0}),w.jsx(Kt,{$size:o,$delay:.15}),w.jsx(Kt,{$size:o,$delay:.3})]}),On=24,Tn="Loading",$n=He.keyframes`
|
|
20
|
-
to {
|
|
21
|
-
transform: rotate(1turn);
|
|
12
|
+
|
|
13
|
+
html {
|
|
14
|
+
-webkit-text-size-adjust: 100%;
|
|
15
|
+
-moz-tab-size: 4;
|
|
16
|
+
tab-size: 4;
|
|
22
17
|
}
|
|
23
|
-
`,Ar=e=>Math.max(2,Math.round(e/10)),An=O.span`
|
|
24
|
-
display: inline-block;
|
|
25
|
-
width: ${({$size:e})=>e}px;
|
|
26
|
-
aspect-ratio: 1;
|
|
27
|
-
border-radius: 50%;
|
|
28
|
-
position: relative;
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
opacity: 0.2;
|
|
19
|
+
body {
|
|
20
|
+
min-height: 100vh;
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
line-height: 1.5;
|
|
23
|
+
-webkit-font-smoothing: antialiased;
|
|
24
|
+
-moz-osx-font-smoothing: grayscale;
|
|
25
|
+
text-rendering: optimizeLegibility;
|
|
38
26
|
}
|
|
39
27
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
border-right-color: currentColor;
|
|
48
|
-
animation: ${$n} 0.8s linear infinite;
|
|
28
|
+
img,
|
|
29
|
+
picture,
|
|
30
|
+
video,
|
|
31
|
+
canvas,
|
|
32
|
+
svg {
|
|
33
|
+
display: block;
|
|
34
|
+
max-width: 100%;
|
|
49
35
|
}
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
|
|
37
|
+
input,
|
|
38
|
+
button,
|
|
39
|
+
textarea,
|
|
40
|
+
select {
|
|
41
|
+
font: inherit;
|
|
42
|
+
color: inherit;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
p,
|
|
46
|
+
h1,
|
|
47
|
+
h2,
|
|
48
|
+
h3,
|
|
49
|
+
h4,
|
|
50
|
+
h5,
|
|
51
|
+
h6 {
|
|
52
|
+
overflow-wrap: break-word;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
a {
|
|
56
|
+
color: inherit;
|
|
57
|
+
text-decoration: inherit;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
button {
|
|
61
|
+
background: none;
|
|
62
|
+
border: none;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ul,
|
|
67
|
+
ol {
|
|
68
|
+
list-style: none;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
table {
|
|
72
|
+
border-collapse: collapse;
|
|
73
|
+
border-spacing: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/*
|
|
77
|
+
* Inter Font Configuration
|
|
78
|
+
* Optimized for UI with modern CSS features
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
html {
|
|
82
|
+
font-family:
|
|
83
|
+
'Inter',
|
|
84
|
+
-apple-system,
|
|
85
|
+
BlinkMacSystemFont,
|
|
86
|
+
'Segoe UI',
|
|
87
|
+
Roboto,
|
|
88
|
+
'Helvetica Neue',
|
|
89
|
+
Arial,
|
|
90
|
+
sans-serif;
|
|
91
|
+
|
|
92
|
+
/* Variable font optical sizing */
|
|
93
|
+
font-optical-sizing: auto;
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* OpenType features for Inter:
|
|
97
|
+
* - cv01: alternate 1 (distinguishable from l/I)
|
|
98
|
+
* - cv02: alternate 4 (open top)
|
|
99
|
+
* - cv03: alternate 6 (straight tail)
|
|
100
|
+
* - cv04: alternate 9 (straight tail)
|
|
101
|
+
* - ss01: open digits
|
|
102
|
+
* - ss02: disambiguation (alt a, g)
|
|
103
|
+
* - tnum: tabular numbers (monospaced digits for alignment)
|
|
104
|
+
* - zero: slashed zero
|
|
105
|
+
*/
|
|
106
|
+
font-feature-settings:
|
|
107
|
+
'cv01' 1,
|
|
108
|
+
'cv02' 1,
|
|
109
|
+
'ss01' 1,
|
|
110
|
+
'tnum' 1,
|
|
111
|
+
'zero' 1;
|
|
112
|
+
|
|
113
|
+
/* Improved kerning */
|
|
114
|
+
font-kerning: normal;
|
|
115
|
+
|
|
116
|
+
/* Slight negative tracking for Inter at UI sizes */
|
|
117
|
+
letter-spacing: -0.011em;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* Tabular figures for numbers in data contexts */
|
|
121
|
+
.tabular-nums {
|
|
122
|
+
font-variant-numeric: tabular-nums;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Proportional figures for running text */
|
|
126
|
+
.proportional-nums {
|
|
127
|
+
font-variant-numeric: proportional-nums;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Selection styling */
|
|
131
|
+
::selection {
|
|
132
|
+
background-color: rgba(0, 122, 255, 0.25);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/* Focus visible for accessibility */
|
|
136
|
+
:focus-visible {
|
|
137
|
+
outline: 2px solid rgba(0, 122, 255, 0.5);
|
|
138
|
+
outline-offset: 2px;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:focus:not(:focus-visible) {
|
|
142
|
+
outline: none;
|
|
143
|
+
}
|
|
144
|
+
`,Vo=()=>a.jsx(ie.Global,{styles:Wo});var Uo=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Xo=a.memoize(function(e){return Uo.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),qo=Xo,Ko=function(o){return o!=="theme"},wt=function(o){return typeof o=="string"&&o.charCodeAt(0)>96?qo:Ko},Rt=function(o,r,i){var n;if(r){var l=r.shouldForwardProp;n=o.__emotion_forwardProp&&l?function(c){return o.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=o.__emotion_forwardProp),n},Zo=function(o){var r=o.cache,i=o.serialized,n=o.isStringTag;return a.registerStyles(r,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(r,i,n)}),null},Jo=function e(o,r){var i=o.__emotion_real===o,n=i&&o.__emotion_base||o,l,c;r!==void 0&&(l=r.label,c=r.target);var d=Rt(o,r,i),p=d||wt(n),h=!p("as");return function(){var u=arguments,f=i&&o.__emotion_styles!==void 0?o.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{var x=u[0];f.push(x[0]);for(var k=u.length,S=1;S<k;S++)f.push(u[S],x[S])}var $=ie.withEmotionCache(function(y,O,L){var b=h&&y.as||n,z="",j=[],N=y;if(y.theme==null){N={};for(var X in y)N[X]=y[X];N.theme=Ce.useContext(ie.ThemeContext)}typeof y.className=="string"?z=a.getRegisteredStyles(O.registered,j,y.className):y.className!=null&&(z=y.className+" ");var P=a.serializeStyles(f.concat(j),O.registered,N);z+=O.key+"-"+P.name,c!==void 0&&(z+=" "+c);var B=h&&d===void 0?wt(b):p,T={};for(var C in y)h&&C==="as"||B(C)&&(T[C]=y[C]);return T.className=z,L&&(T.ref=L),Ce.createElement(Ce.Fragment,null,Ce.createElement(Zo,{cache:O,serialized:P,isStringTag:typeof b=="string"}),Ce.createElement(b,T))});return $.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",$.defaultProps=o.defaultProps,$.__emotion_real=$,$.__emotion_base=n,$.__emotion_styles=f,$.__emotion_forwardProp=d,Object.defineProperty($,"toString",{value:function(){return"."+c}}),$.withComponent=function(y,O){var L=e(y,gt({},r,O,{shouldForwardProp:Rt($,O,!0)}));return L.apply(void 0,f)},$}},Qo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],s=Jo.bind(null);Qo.forEach(function(e){s[e]=s(e)});const kt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Lt={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},J=e=>{const o=Lt[e];return o||Lt.normal},oe=e=>{const o=kt[e];return o||kt.default},er=e=>e?"auto":"fit-content",tr=s.button`
|
|
145
|
+
display: flex;
|
|
146
|
+
gap: 6px;
|
|
147
|
+
text-decoration: none;
|
|
52
148
|
align-items: center;
|
|
53
149
|
justify-content: center;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
font-family: inherit;
|
|
62
|
-
line-height: 1.5;
|
|
63
|
-
cursor: pointer;
|
|
64
|
-
user-select: none;
|
|
65
|
-
transition:
|
|
66
|
-
background-color 0.15s ease,
|
|
67
|
-
border-color 0.15s ease;
|
|
68
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
69
|
-
min-width: ${({$iconOnly:e})=>e?"32px":"auto"};
|
|
70
|
-
|
|
71
|
-
color: ${({theme:e,$variant:t})=>ge(e,t).color};
|
|
72
|
-
background-color: ${({theme:e,$variant:t})=>ge(e,t).backgroundColor};
|
|
73
|
-
border-color: ${({theme:e,$variant:t})=>ge(e,t).borderColor};
|
|
150
|
+
width: ${e=>e.$iconOnly?oe(e.$size).height:er(!!e.$fullWidth)};
|
|
151
|
+
color: ${e=>J(e.$variant).color.static};
|
|
152
|
+
background-color: ${e=>J(e.$variant).background.static};
|
|
153
|
+
height: ${e=>oe(e.$size).height};
|
|
154
|
+
padding: ${e=>e.$iconOnly?"0":oe(e.$size).padding};
|
|
155
|
+
border-radius: ${e=>oe(e.$size).radius};
|
|
156
|
+
border: 1px solid ${e=>J(e.$variant).borderColor.static};
|
|
74
157
|
|
|
75
158
|
&:hover:not(:disabled) {
|
|
76
|
-
|
|
77
|
-
|
|
159
|
+
color: ${e=>J(e.$variant).color.hover};
|
|
160
|
+
background-color: ${e=>J(e.$variant).background.hover};
|
|
161
|
+
border-color: ${e=>J(e.$variant).borderColor.hover};
|
|
78
162
|
}
|
|
79
163
|
|
|
80
164
|
&:active:not(:disabled) {
|
|
81
|
-
|
|
82
|
-
|
|
165
|
+
color: ${e=>J(e.$variant).color.active};
|
|
166
|
+
background-color: ${e=>J(e.$variant).background.active};
|
|
167
|
+
border-color: ${e=>J(e.$variant).borderColor.active};
|
|
83
168
|
}
|
|
84
169
|
|
|
85
170
|
&:focus-visible {
|
|
86
|
-
outline:
|
|
87
|
-
${({theme:e,$variant:t})=>ge(e,t).focus.outlineColor};
|
|
88
|
-
outline-offset: 1px;
|
|
171
|
+
outline-color: ${t.alpha(t.COLORS["iron-grey"],30)};
|
|
89
172
|
}
|
|
90
173
|
|
|
91
174
|
&:disabled {
|
|
92
|
-
cursor:
|
|
93
|
-
color: ${
|
|
94
|
-
background-color: ${
|
|
95
|
-
border-color: ${
|
|
175
|
+
cursor: not-allowed;
|
|
176
|
+
color: ${e=>J(e.$variant).color.disabled};
|
|
177
|
+
background-color: ${e=>J(e.$variant).background.disabled};
|
|
178
|
+
border-color: ${e=>J(e.$variant).borderColor.disabled};
|
|
96
179
|
}
|
|
97
|
-
`,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`,Nn=O.span`
|
|
103
|
-
display: inline-flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
flex-shrink: 0;
|
|
107
|
-
visibility: ${({$loading:e})=>e?"hidden":"visible"};
|
|
108
|
-
color: ${({theme:e,$variant:t})=>ge(e,t).icon.color};
|
|
180
|
+
`,or=s.div`
|
|
181
|
+
display: grid;
|
|
182
|
+
place-items: center;
|
|
183
|
+
width: ${e=>oe(e.$size).iconSize};
|
|
184
|
+
height: ${e=>oe(e.$size).iconSize};
|
|
109
185
|
|
|
110
|
-
|
|
111
|
-
|
|
186
|
+
& svg {
|
|
187
|
+
width: ${e=>oe(e.$size).iconSize};
|
|
188
|
+
height: ${e=>oe(e.$size).iconSize};
|
|
112
189
|
}
|
|
113
|
-
`,
|
|
190
|
+
`,rr=s.span`
|
|
191
|
+
font-weight: 600;
|
|
114
192
|
overflow: hidden;
|
|
115
193
|
white-space: nowrap;
|
|
116
194
|
text-overflow: ellipsis;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
195
|
+
`,ir=s(a.LoaderCircle)`
|
|
196
|
+
width: ${e=>oe(e.$size).iconSize};
|
|
197
|
+
height: ${e=>oe(e.$size).iconSize};
|
|
198
|
+
animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
|
|
199
|
+
`,nr=s.div`
|
|
200
|
+
display: flex;
|
|
201
|
+
gap: 3px;
|
|
202
|
+
`,ar=s.span`
|
|
203
|
+
text-align: center;
|
|
204
|
+
display: flex;
|
|
121
205
|
justify-content: center;
|
|
206
|
+
align-items: center;
|
|
207
|
+
font-size: 12px;
|
|
208
|
+
height: 18px;
|
|
209
|
+
min-width: 18px;
|
|
210
|
+
line-height: 1.6;
|
|
122
211
|
padding: 2px 4px;
|
|
123
212
|
border-radius: 4px;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
color: ${({theme:e,$variant:t})=>ge(e,t).disabled.color};
|
|
133
|
-
background-color: transparent;
|
|
134
|
-
}
|
|
135
|
-
`,Mr=O.span`
|
|
136
|
-
position: absolute;
|
|
137
|
-
inset: 0;
|
|
138
|
-
display: inline-flex;
|
|
139
|
-
align-items: center;
|
|
140
|
-
justify-content: center;
|
|
141
|
-
`,jn=(e,t,r,o,n)=>{const s=X.useMemo(()=>!!e&&!t&&!r,[e,t,r]),l=X.useMemo(()=>o&&s,[o,s]),c=X.useMemo(()=>o&&!s,[o,s]),d=X.useCallback(a=>{if(o){a.preventDefault();return}n==null||n(a)},[o,n]);return{iconOnly:s,showSpinner:l,showDots:c,handleClick:d}},ze=w.classNameGetter("button"),zn=18,Bn=({char:e,children:t,className:r,classnames:o,disabled:n,fullWidth:s,icon:l,loading:c,onClick:d,variant:a=Pn,...u})=>{const{iconOnly:g,showSpinner:f,showDots:p,handleClick:x}=jn(l,t,e,c,d),h=()=>l?w.jsx(Nn,{className:ze("icon",o==null?void 0:o.icon),$variant:a,$loading:c,children:l}):null,y=()=>f?w.jsx(Mr,{className:ze("loader",o==null?void 0:o.loader),children:w.jsx(ko,{size:zn})}):p?w.jsx(Mr,{className:ze("loader",o==null?void 0:o.loader),children:w.jsx(yo,{size:4})}):null;return w.jsx(Dn,{...u,className:ze("container",r,o==null?void 0:o.container),disabled:n||c,onClick:x,$variant:a,$fullWidth:s,$loading:c,$iconOnly:g,children:w.jsxs(Ln,{className:ze("content",o==null?void 0:o.content),children:[h(),y(),t&&w.jsx(Fn,{className:ze("text",o==null?void 0:o.text),$loading:c,children:t}),e&&w.jsx(_n,{className:ze("char",o==null?void 0:o.char),$variant:a,$loading:c,children:e})]})})},Wn=(e,t,r,o)=>t||r?o==="warning"?e.checkbox.state.warning.box.checked.borderColor:o==="error"?e.checkbox.state.error.box.checked.borderColor:e.checkbox.box.checked.borderColor:o==="warning"?e.checkbox.state.warning.box.borderColor:o==="error"?e.checkbox.state.error.box.borderColor:e.checkbox.box.borderColor,Vn=(e,t,r,o)=>t||r?o==="warning"?e.checkbox.state.warning.box.checked.backgroundColor:o==="error"?e.checkbox.state.error.box.checked.backgroundColor:e.checkbox.box.checked.backgroundColor:e.checkbox.box.backgroundColor,Hn=(e,t)=>t==="warning"?e.checkbox.state.warning.box.focus.shadowColor:t==="error"?e.checkbox.state.error.box.focus.shadowColor:e.checkbox.box.focus.shadowColor,Un=(e,t)=>t==="warning"?e.checkbox.state.warning.label.color:t==="error"?e.checkbox.state.error.label.color:e.checkbox.label.color,Gn=O.label`
|
|
213
|
+
width: fit-content;
|
|
214
|
+
background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
|
|
215
|
+
`,lr=A.newClassNameGetter("key-symbol"),co=({className:e,ref:o,symbol:r,variant:i="light",...n})=>r?a.jsx(ar,{...n,ref:o,className:lr("container",e),$variant:i,children:r}):null,zt=A.newClassNameGetter("key-bindings"),so=({className:e,classnames:o,keys:r,ref:i,variant:n,...l})=>{const c=g.useMemo(()=>t.getKeySymbols(r),[r]);return c.length===0?null:a.jsx(nr,{...l,ref:i,className:zt("container",e),children:c.map(d=>a.jsx(co,{symbol:d,className:zt("item",o==null?void 0:o.item),variant:n},d))})},Pt=A.newClassNameGetter("button"),Te=({children:e,className:o,classnames:r,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:h=[],size:u="default",type:f="button",variant:x="normal",...k})=>{const S=g.useRef(null);g.useImperativeHandle(p,()=>S.current,[]),t.useKeyBinding(h,()=>{var y;(y=S.current)==null||y.click()});const $=g.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(tr,{...k,onClick:d,ref:S,type:$,disabled:i,className:Pt("container",o),$variant:x,$size:u,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(ir,{$size:u}),l&&!c&&a.jsx(or,{$size:u,children:l}),e&&a.jsx(rr,{className:Pt("label",r==null?void 0:r.label),children:e}),a.jsx(so,{keys:h,variant:x==="system"?"light":"dark"})]})},dr=s.div`
|
|
216
|
+
background-color: ${t.COLORS.white};
|
|
217
|
+
border-radius: 16px;
|
|
218
|
+
border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
|
|
219
|
+
box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
|
|
220
|
+
`,cr=A.newClassNameGetter("card"),sr=({children:e,className:o,ref:r,border:i=!1,shadow:n=!1,...l})=>a.jsx(dr,{...l,ref:r,className:cr("container",o),$border:i,$shadow:n,children:e}),jt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},pe=e=>jt[e]??jt.normal,pr=s.label`
|
|
142
221
|
display: inline-flex;
|
|
143
222
|
align-items: center;
|
|
144
223
|
gap: 8px;
|
|
145
|
-
cursor: pointer;
|
|
224
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
225
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
146
226
|
|
|
147
227
|
&:has(input:focus-visible) > span:first-of-type {
|
|
148
|
-
box-shadow: 0 0 0
|
|
228
|
+
box-shadow: 0 0 0 2px ${e=>pe(e.$variant).box.focusShadow};
|
|
149
229
|
}
|
|
150
|
-
|
|
151
|
-
${({$disabled:e})=>e&&`
|
|
152
|
-
opacity: 0.5;
|
|
153
|
-
cursor: not-allowed;
|
|
154
|
-
`}
|
|
155
|
-
`,Kn=O.input`
|
|
230
|
+
`,ur=s.input`
|
|
156
231
|
position: absolute;
|
|
157
232
|
opacity: 0;
|
|
158
233
|
width: 0;
|
|
159
234
|
height: 0;
|
|
160
235
|
pointer-events: none;
|
|
161
|
-
`,
|
|
236
|
+
`,hr=s.span`
|
|
162
237
|
display: inline-flex;
|
|
163
238
|
align-items: center;
|
|
164
239
|
justify-content: center;
|
|
240
|
+
flex-shrink: 0;
|
|
165
241
|
width: 18px;
|
|
166
242
|
height: 18px;
|
|
167
243
|
border-radius: 6px;
|
|
168
244
|
border: 1.5px solid
|
|
169
|
-
${
|
|
170
|
-
background-color: ${
|
|
245
|
+
${e=>e.$checked||e.$indeterminate?pe(e.$variant).box.borderChecked:pe(e.$variant).box.border};
|
|
246
|
+
background-color: ${e=>e.$checked||e.$indeterminate?pe(e.$variant).box.backgroundChecked:pe(e.$variant).box.background};
|
|
171
247
|
transition:
|
|
172
248
|
border-color 0.15s ease,
|
|
173
249
|
background-color 0.15s ease,
|
|
174
250
|
box-shadow 0.15s ease;
|
|
175
|
-
`,
|
|
251
|
+
`,br=s.span`
|
|
176
252
|
display: inline-flex;
|
|
177
253
|
align-items: center;
|
|
178
254
|
justify-content: center;
|
|
179
|
-
color: ${(
|
|
180
|
-
opacity: ${
|
|
181
|
-
transform: ${
|
|
255
|
+
color: ${e=>pe(e.$variant).icon};
|
|
256
|
+
opacity: ${e=>e.$visible?1:0};
|
|
257
|
+
transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
|
|
182
258
|
transition:
|
|
183
259
|
opacity 0.15s ease,
|
|
184
260
|
transform 0.15s ease;
|
|
185
|
-
|
|
261
|
+
|
|
262
|
+
& svg {
|
|
263
|
+
width: 12px;
|
|
264
|
+
height: 12px;
|
|
265
|
+
}
|
|
266
|
+
`,gr=s.span`
|
|
186
267
|
font-size: 14px;
|
|
187
|
-
line-height: 1.5;
|
|
188
|
-
color: ${({theme:e,$state:t})=>Un(e,t)};
|
|
189
|
-
user-select: none;
|
|
190
268
|
font-weight: 500;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
269
|
+
line-height: 1;
|
|
270
|
+
color: ${e=>pe(e.$variant).label};
|
|
271
|
+
user-select: none;
|
|
272
|
+
`,we=A.newClassNameGetter("checkbox"),Ke=({checked:e,className:o,classnames:r,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(pr,{className:we("container",o),$disabled:!!i,$variant:p,children:[a.jsx(ur,{...h,ref:d,type:"checkbox",className:we("input",r==null?void 0:r.input),checked:e,disabled:i,onChange:c}),a.jsx(hr,{className:we("box",r==null?void 0:r.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(br,{className:we("icon",r==null?void 0:r.icon),$visible:n||e,$variant:p,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(gr,{className:we("label",r==null?void 0:r.label),$variant:p,children:l})]}),Et={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ce=e=>Et[e]??Et.normal,fr=s.label`
|
|
273
|
+
display: grid;
|
|
274
|
+
grid-template-columns: auto 1fr;
|
|
275
|
+
align-items: start;
|
|
276
|
+
gap: 8px;
|
|
277
|
+
padding: 12px;
|
|
278
|
+
background-color: ${e=>{const o=ce(e.$variant);return e.$disabled?o.background.disabled:e.$checked?o.backgroundChecked:o.background.static}};
|
|
279
|
+
border: 1px solid
|
|
280
|
+
${e=>{const o=ce(e.$variant);return e.$disabled?o.border.disabled:e.$checked?o.borderChecked:o.border.static}};
|
|
198
281
|
border-radius: 12px;
|
|
199
|
-
|
|
200
|
-
|
|
282
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
283
|
+
transition:
|
|
284
|
+
border-color 0.15s ease,
|
|
285
|
+
background-color 0.15s ease;
|
|
286
|
+
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
201
287
|
min-width: 0;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
288
|
+
|
|
289
|
+
&:hover:not([data-disabled='true']) {
|
|
290
|
+
border-color: ${e=>{const o=ce(e.$variant);return e.$checked?o.borderChecked:o.border.hover}};
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
&:has(:focus-visible) {
|
|
294
|
+
outline: none;
|
|
295
|
+
box-shadow: 0 0 0 3px ${e=>ce(e.$variant).focusRing};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.vacano_checkbox_container {
|
|
299
|
+
pointer-events: none;
|
|
300
|
+
}
|
|
301
|
+
`,xr=s.input`
|
|
302
|
+
position: absolute;
|
|
303
|
+
width: 1px;
|
|
304
|
+
height: 1px;
|
|
305
|
+
margin: -1px;
|
|
306
|
+
padding: 0;
|
|
206
307
|
overflow: hidden;
|
|
207
|
-
|
|
308
|
+
clip: rect(0, 0, 0, 0);
|
|
208
309
|
white-space: nowrap;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
position: relative;
|
|
212
|
-
min-width: 0;
|
|
213
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
214
|
-
`,li=O.div`
|
|
215
|
-
display: inline-flex;
|
|
216
|
-
min-width: 0;
|
|
217
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
218
|
-
`,si=O.div`
|
|
219
|
-
z-index: 1000;
|
|
220
|
-
width: max-content;
|
|
221
|
-
border-radius: 12px;
|
|
222
|
-
border: 1px solid ${({theme:e})=>oi(e)};
|
|
223
|
-
background-color: ${({theme:e})=>ri(e)};
|
|
224
|
-
box-shadow: ${({theme:e})=>ni(e)};
|
|
225
|
-
visibility: ${({$isOpen:e})=>e?"visible":"hidden"};
|
|
226
|
-
opacity: ${({$isOpen:e})=>e?1:0};
|
|
227
|
-
pointer-events: ${({$isOpen:e})=>e?"auto":"none"};
|
|
228
|
-
transition:
|
|
229
|
-
opacity 0.15s ease,
|
|
230
|
-
visibility 0.15s ease;
|
|
231
|
-
`;function _t(){return typeof window<"u"}function _e(e){return Io(e)?(e.nodeName||"").toLowerCase():"#document"}function Ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(Io(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Io(e){return _t()?e instanceof Node||e instanceof Ce(e).Node:!1}function re(e){return _t()?e instanceof Element||e instanceof Ce(e).Element:!1}function le(e){return _t()?e instanceof HTMLElement||e instanceof Ce(e).HTMLElement:!1}function cr(e){return!_t()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ce(e).ShadowRoot}const ci=new Set(["inline","contents"]);function at(e){const{overflow:t,overflowX:r,overflowY:o,display:n}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!ci.has(n)}const ai=new Set(["table","td","th"]);function ui(e){return ai.has(_e(e))}const di=[":popover-open",":modal"];function jt(e){return di.some(t=>{try{return e.matches(t)}catch{return!1}})}const fi=["transform","translate","scale","rotate","perspective"],gi=["transform","translate","scale","rotate","perspective","filter"],hi=["paint","layout","strict","content"];function xr(e){const t=zt(),r=re(e)?ye(e):e;return fi.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||gi.some(o=>(r.willChange||"").includes(o))||hi.some(o=>(r.contain||"").includes(o))}function pi(e){let t=Ae(e);for(;le(t)&&!$e(t);){if(xr(t))return t;if(jt(t))return null;t=Ae(t)}return null}function zt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bi=new Set(["html","body","#document"]);function $e(e){return bi.has(_e(e))}function ye(e){return Ce(e).getComputedStyle(e)}function Bt(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ae(e){if(_e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||cr(e)&&e.host||Ie(e);return cr(t)?t.host:t}function Oo(e){const t=Ae(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:le(t)&&at(t)?t:Oo(t)}function Ne(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const n=Oo(e),s=n===((o=e.ownerDocument)==null?void 0:o.body),l=Ce(n);if(s){const c=ar(l);return t.concat(l,l.visualViewport||[],at(n)?n:[],c&&r?Ne(c):[])}return t.concat(n,Ne(n,[],r))}function ar(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Je=Math.min,me=Math.max,Et=Math.round,Ye=Math.floor,Ee=e=>({x:e,y:e}),xi={left:"right",right:"left",bottom:"top",top:"bottom"},mi={start:"end",end:"start"};function Dr(e,t,r){return me(e,Je(t,r))}function ut(e,t){return typeof e=="function"?e(t):e}function Fe(e){return e.split("-")[0]}function dt(e){return e.split("-")[1]}function To(e){return e==="x"?"y":"x"}function $o(e){return e==="y"?"height":"width"}const Ci=new Set(["top","bottom"]);function Te(e){return Ci.has(Fe(e))?"y":"x"}function Ao(e){return To(Te(e))}function vi(e,t,r){r===void 0&&(r=!1);const o=dt(e),n=Ao(e),s=$o(n);let l=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=It(l)),[l,It(l)]}function wi(e){const t=It(e);return[ur(e),t,ur(t)]}function ur(e){return e.replace(/start|end/g,t=>mi[t])}const Lr=["left","right"],Nr=["right","left"],yi=["top","bottom"],ki=["bottom","top"];function Ri(e,t,r){switch(e){case"top":case"bottom":return r?t?Nr:Lr:t?Lr:Nr;case"left":case"right":return t?yi:ki;default:return[]}}function Si(e,t,r,o){const n=dt(e);let s=Ri(Fe(e),r==="start",o);return n&&(s=s.map(l=>l+"-"+n),t&&(s=s.concat(s.map(ur)))),s}function It(e){return e.replace(/left|right|bottom|top/g,t=>xi[t])}function Ei(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ii(e){return typeof e!="number"?Ei(e):{top:e,right:e,bottom:e,left:e}}function Ot(e){const{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}/*!
|
|
232
|
-
* tabbable 6.3.0
|
|
233
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
234
|
-
*/var Oi=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Tt=Oi.join(","),Mo=typeof Element>"u",et=Mo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$t=!Mo&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},st=function(t,r){var o;r===void 0&&(r=!0);var n=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=n===""||n==="true",l=s||r&&t&&st(t.parentNode);return l},Ti=function(t){var r,o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"contenteditable");return o===""||o==="true"},Po=function(t,r,o){if(st(t))return[];var n=Array.prototype.slice.apply(t.querySelectorAll(Tt));return r&&et.call(t,Tt)&&n.unshift(t),n=n.filter(o),n},At=function(t,r,o){for(var n=[],s=Array.from(t);s.length;){var l=s.shift();if(!st(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),d=c.length?c:l.children,a=At(d,!0,o);o.flatten?n.push.apply(n,a):n.push({scopeParent:l,candidates:a})}else{var u=et.call(l,Tt);u&&o.filter(l)&&(r||!t.includes(l))&&n.push(l);var g=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),f=!st(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(g&&f){var p=At(g===!0?l.children:g.children,!0,o);o.flatten?n.push.apply(n,p):n.push({scopeParent:l,candidates:p})}else s.unshift.apply(s,l.children)}}return n},Do=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Lo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ti(t))&&!Do(t)?0:t.tabIndex},$i=function(t,r){var o=Lo(t);return o<0&&r&&!Do(t)?0:o},Ai=function(t,r){return t.tabIndex===r.tabIndex?t.documentOrder-r.documentOrder:t.tabIndex-r.tabIndex},No=function(t){return t.tagName==="INPUT"},Mi=function(t){return No(t)&&t.type==="hidden"},Pi=function(t){var r=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return r},Di=function(t,r){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===r)return t[o]},Li=function(t){if(!t.name)return!0;var r=t.form||$t(t),o=function(c){return r.querySelectorAll('input[type="radio"][name="'+c+'"]')},n;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")n=o(window.CSS.escape(t.name));else try{n=o(t.name)}catch(l){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",l.message),!1}var s=Di(n,t.form);return!s||s===t},Ni=function(t){return No(t)&&t.type==="radio"},Fi=function(t){return Ni(t)&&!Li(t)},_i=function(t){var r,o=t&&$t(t),n=(r=o)===null||r===void 0?void 0:r.host,s=!1;if(o&&o!==t){var l,c,d;for(s=!!((l=n)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(n)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!s&&n;){var a,u,g;o=$t(n),n=(a=o)===null||a===void 0?void 0:a.host,s=!!((u=n)!==null&&u!==void 0&&(g=u.ownerDocument)!==null&&g!==void 0&&g.contains(n))}}return s},Fr=function(t){var r=t.getBoundingClientRect(),o=r.width,n=r.height;return o===0&&n===0},ji=function(t,r){var o=r.displayCheck,n=r.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var l=et.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(et.call(c,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof n=="function"){for(var d=t;t;){var a=t.parentElement,u=$t(t);if(a&&!a.shadowRoot&&n(a)===!0)return Fr(t);t.assignedSlot?t=t.assignedSlot:!a&&u!==t.ownerDocument?t=u.host:t=a}t=d}if(_i(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Fr(t);return!1},zi=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var r=t.parentElement;r;){if(r.tagName==="FIELDSET"&&r.disabled){for(var o=0;o<r.children.length;o++){var n=r.children.item(o);if(n.tagName==="LEGEND")return et.call(r,"fieldset[disabled] *")?!0:!n.contains(t)}return!0}r=r.parentElement}return!1},dr=function(t,r){return!(r.disabled||st(r)||Mi(r)||ji(r,t)||Pi(r)||zi(r))},fr=function(t,r){return!(Fi(r)||Lo(r)<0||!dr(t,r))},Bi=function(t){var r=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(r)||r>=0)},Fo=function(t){var r=[],o=[];return t.forEach(function(n,s){var l=!!n.scopeParent,c=l?n.scopeParent:n,d=$i(c,l),a=l?Fo(n.candidates):c;d===0?l?r.push.apply(r,a):r.push(c):o.push({documentOrder:s,tabIndex:d,item:n,isScope:l,content:a})}),o.sort(Ai).reduce(function(n,s){return s.isScope?n.push.apply(n,s.content):n.push(s.content),n},[]).concat(r)},mr=function(t,r){r=r||{};var o;return r.getShadowRoot?o=At([t],r.includeContainer,{filter:fr.bind(null,r),flatten:!1,getShadowRoot:r.getShadowRoot,shadowRootFilter:Bi}):o=Po(t,r.includeContainer,fr.bind(null,r)),Fo(o)},Wi=function(t,r){r=r||{};var o;return r.getShadowRoot?o=At([t],r.includeContainer,{filter:dr.bind(null,r),flatten:!0,getShadowRoot:r.getShadowRoot}):o=Po(t,r.includeContainer,dr.bind(null,r)),o},_o=function(t,r){if(r=r||{},!t)throw new Error("No node provided");return et.call(t,Tt)===!1?!1:fr(r,t)};function Vi(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function jo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:o}=t;return r+"/"+o}).join(" "):navigator.userAgent}function Hi(){return/apple/i.test(navigator.vendor)}function gr(){const e=/android/i;return e.test(Vi())||e.test(jo())}function Ui(){return jo().includes("jsdom/")}const _r="data-floating-ui-focusable",Gi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",qt="ArrowLeft",Xt="ArrowRight",Ki="ArrowUp",qi="ArrowDown";function Pe(e){let t=e.activeElement;for(;((r=t)==null||(r=r.shadowRoot)==null?void 0:r.activeElement)!=null;){var r;t=t.shadowRoot.activeElement}return t}function xe(e,t){if(!e||!t)return!1;const r=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&cr(r)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function De(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Yt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}function Xi(e){return e.matches("html,body")}function we(e){return(e==null?void 0:e.ownerDocument)||document}function zo(e){return le(e)&&e.matches(Gi)}function hr(e){return e?e.getAttribute("role")==="combobox"&&zo(e):!1}function Mt(e){return e?e.hasAttribute(_r)?e:e.querySelector("["+_r+"]")||e:null}function Ve(e,t,r){return r===void 0&&(r=!0),e.filter(n=>{var s;return n.parentId===t&&(!r||((s=n.context)==null?void 0:s.open))}).flatMap(n=>[n,...Ve(e,n.id,r)])}function Yi(e,t){let r,o=-1;function n(s,l){l>o&&(r=s,o=l),Ve(e,s).forEach(d=>{n(d.id,l+1)})}return n(t,0),e.find(s=>s.id===r)}function jr(e,t){var r;let o=[],n=(r=e.find(s=>s.id===t))==null?void 0:r.parentId;for(;n;){const s=e.find(l=>l.id===n);n=s==null?void 0:s.parentId,s&&(o=o.concat(s))}return o}function ae(e){e.preventDefault(),e.stopPropagation()}function Zi(e){return"nativeEvent"in e}function Bo(e){return e.mozInputSource===0&&e.isTrusted?!0:gr()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Wo(e){return Ui()?!1:!gr()&&e.width===0&&e.height===0||gr()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function zr(e,t){return["mouse","pen"].includes(e)}var Qi=typeof document<"u",Ji=function(){},se=Qi?X.useLayoutEffect:Ji;const el={...C};function Se(e){const t=C.useRef(e);return se(()=>{t.current=e}),t}const tl=el.useInsertionEffect,rl=tl||(e=>e());function ue(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return rl(()=>{t.current=e}),C.useCallback(function(){for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t.current==null?void 0:t.current(...o)},[])}function mt(e,t,r){return Math.floor(e/t)!==r}function lt(e,t){return t<0||t>=e.current.length}function Zt(e,t){return he(e,{disabledIndices:t})}function Br(e,t){return he(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function he(e,t){let{startingIndex:r=-1,decrement:o=!1,disabledIndices:n,amount:s=1}=t===void 0?{}:t,l=r;do l+=o?-s:s;while(l>=0&&l<=e.current.length-1&&Rt(e,l,n));return l}function ol(e,t){let{event:r,orientation:o,loop:n,rtl:s,cols:l,disabledIndices:c,minIndex:d,maxIndex:a,prevIndex:u,stopEvent:g=!1}=t,f=u;if(r.key===Ki){if(g&&ae(r),u===-1)f=a;else if(f=he(e,{startingIndex:f,amount:l,decrement:!0,disabledIndices:c}),n&&(u-l<d||f<0)){const p=u%l,x=a%l,h=a-(x-p);x===p?f=a:f=x>p?h:h-l}lt(e,f)&&(f=u)}if(r.key===qi&&(g&&ae(r),u===-1?f=d:(f=he(e,{startingIndex:u,amount:l,disabledIndices:c}),n&&u+l>a&&(f=he(e,{startingIndex:u%l-l,amount:l,disabledIndices:c}))),lt(e,f)&&(f=u)),o==="both"){const p=Ye(u/l);r.key===(s?qt:Xt)&&(g&&ae(r),u%l!==l-1?(f=he(e,{startingIndex:u,disabledIndices:c}),n&&mt(f,l,p)&&(f=he(e,{startingIndex:u-u%l-1,disabledIndices:c}))):n&&(f=he(e,{startingIndex:u-u%l-1,disabledIndices:c})),mt(f,l,p)&&(f=u)),r.key===(s?Xt:qt)&&(g&&ae(r),u%l!==0?(f=he(e,{startingIndex:u,decrement:!0,disabledIndices:c}),n&&mt(f,l,p)&&(f=he(e,{startingIndex:u+(l-u%l),decrement:!0,disabledIndices:c}))):n&&(f=he(e,{startingIndex:u+(l-u%l),decrement:!0,disabledIndices:c})),mt(f,l,p)&&(f=u));const x=Ye(a/l)===p;lt(e,f)&&(n&&x?f=r.key===(s?Xt:qt)?a:he(e,{startingIndex:u-u%l-1,disabledIndices:c}):f=u)}return f}function nl(e,t,r){const o=[];let n=0;return e.forEach((s,l)=>{let{width:c,height:d}=s;if(c>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+l+" is greater than grid columns");let a=!1;for(r&&(n=0);!a;){const u=[];for(let g=0;g<c;g++)for(let f=0;f<d;f++)u.push(n+g+f*t);n%t+c<=t&&u.every(g=>o[g]==null)?(u.forEach(g=>{o[g]=l}),a=!0):n++}}),[...o]}function il(e,t,r,o,n){if(e===-1)return-1;const s=r.indexOf(e),l=t[e];switch(n){case"tl":return s;case"tr":return l?s+l.width-1:s;case"bl":return l?s+(l.height-1)*o:s;case"br":return r.lastIndexOf(e)}}function ll(e,t){return t.flatMap((r,o)=>e.includes(r)?[o]:[])}function Rt(e,t,r){if(typeof r=="function")return r(t);if(r)return r.includes(t);const o=e.current[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}const Wt=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Vo(e,t){const r=mr(e,Wt()),o=r.length;if(o===0)return;const n=Pe(we(e)),s=r.indexOf(n),l=s===-1?t===1?0:o-1:s+t;return r[l]}function sl(e){return Vo(we(e).body,1)||e}function cl(e){return Vo(we(e).body,-1)||e}function Wr(e,t){const r=t||e.currentTarget,o=e.relatedTarget;return!o||!xe(r,o)}function Vr(e,t,r){let{reference:o,floating:n}=e;const s=Te(t),l=Ao(t),c=$o(l),d=Fe(t),a=s==="y",u=o.x+o.width/2-n.width/2,g=o.y+o.height/2-n.height/2,f=o[c]/2-n[c]/2;let p;switch(d){case"top":p={x:u,y:o.y-n.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:g};break;case"left":p={x:o.x-n.width,y:g};break;default:p={x:o.x,y:o.y}}switch(dt(t)){case"start":p[l]-=f*(r&&a?-1:1);break;case"end":p[l]+=f*(r&&a?-1:1);break}return p}const al=async(e,t,r)=>{const{placement:o="bottom",strategy:n="absolute",middleware:s=[],platform:l}=r,c=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:g}=Vr(a,o,d),f=o,p={},x=0;for(let h=0;h<c.length;h++){const{name:y,fn:m}=c[h],{x:v,y:k,data:R,reset:I}=await m({x:u,y:g,initialPlacement:o,placement:f,strategy:n,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});u=v??u,g=k??g,p={...p,[y]:{...p[y],...R}},I&&x<=50&&(x++,typeof I=="object"&&(I.placement&&(f=I.placement),I.rects&&(a=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:u,y:g}=Vr(a,f,d)),h=-1)}return{x:u,y:g,placement:f,strategy:n,middlewareData:p}};async function Cr(e,t){var r;t===void 0&&(t={});const{x:o,y:n,platform:s,rects:l,elements:c,strategy:d}=e,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:g="floating",altBoundary:f=!1,padding:p=0}=ut(t,e),x=Ii(p),y=c[f?g==="floating"?"reference":"floating":g],m=Ot(await s.getClippingRect({element:(r=await(s.isElement==null?void 0:s.isElement(y)))==null||r?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:d})),v=g==="floating"?{x:o,y:n,width:l.floating.width,height:l.floating.height}:l.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),R=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},I=Ot(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:v,offsetParent:k,strategy:d}):v);return{top:(m.top-I.top+x.top)/R.y,bottom:(I.bottom-m.bottom+x.bottom)/R.y,left:(m.left-I.left+x.left)/R.x,right:(I.right-m.right+x.right)/R.x}}const ul=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:n,middlewareData:s,rects:l,initialPlacement:c,platform:d,elements:a}=t,{mainAxis:u=!0,crossAxis:g=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:h=!0,...y}=ut(e,t);if((r=s.arrow)!=null&&r.alignmentOffset)return{};const m=Fe(n),v=Te(c),k=Fe(c)===c,R=await(d.isRTL==null?void 0:d.isRTL(a.floating)),I=f||(k||!h?[It(c)]:wi(c)),P=x!=="none";!f&&P&&I.push(...Si(c,h,x,R));const L=[c,...I],j=await Cr(t,y),Z=[];let $=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&Z.push(j[m]),g){const S=vi(n,l,R);Z.push(j[S[0]],j[S[1]])}if($=[...$,{placement:n,overflows:Z}],!Z.every(S=>S<=0)){var F,Y;const S=(((F=s.flip)==null?void 0:F.index)||0)+1,E=L[S];if(E&&(!(g==="alignment"?v!==Te(E):!1)||$.every(b=>Te(b.placement)===v?b.overflows[0]>0:!0)))return{data:{index:S,overflows:$},reset:{placement:E}};let _=(Y=$.filter(D=>D.overflows[0]<=0).sort((D,b)=>D.overflows[1]-b.overflows[1])[0])==null?void 0:Y.placement;if(!_)switch(p){case"bestFit":{var U;const D=(U=$.filter(b=>{if(P){const T=Te(b.placement);return T===v||T==="y"}return!0}).map(b=>[b.placement,b.overflows.filter(T=>T>0).reduce((T,N)=>T+N,0)]).sort((b,T)=>b[1]-T[1])[0])==null?void 0:U[0];D&&(_=D);break}case"initialPlacement":_=c;break}if(n!==_)return{reset:{placement:_}}}return{}}}},dl=new Set(["left","top"]);async function fl(e,t){const{placement:r,platform:o,elements:n}=e,s=await(o.isRTL==null?void 0:o.isRTL(n.floating)),l=Fe(r),c=dt(r),d=Te(r)==="y",a=dl.has(l)?-1:1,u=s&&d?-1:1,g=ut(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof x=="number"&&(p=c==="end"?x*-1:x),d?{x:p*u,y:f*a}:{x:f*a,y:p*u}}const gl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:n,y:s,placement:l,middlewareData:c}=t,d=await fl(t,e);return l===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:n+d.x,y:s+d.y,data:{...d,placement:l}}}}},hl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:n}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:c={fn:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...d}=ut(e,t),a={x:r,y:o},u=await Cr(t,d),g=Te(Fe(n)),f=To(g);let p=a[f],x=a[g];if(s){const y=f==="y"?"top":"left",m=f==="y"?"bottom":"right",v=p+u[y],k=p-u[m];p=Dr(v,p,k)}if(l){const y=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=x+u[y],k=x-u[m];x=Dr(v,x,k)}const h=c.fn({...t,[f]:p,[g]:x});return{...h,data:{x:h.x-r,y:h.y-o,enabled:{[f]:s,[g]:l}}}}}},pl=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:n,rects:s,platform:l,elements:c}=t,{apply:d=()=>{},...a}=ut(e,t),u=await Cr(t,a),g=Fe(n),f=dt(n),p=Te(n)==="y",{width:x,height:h}=s.floating;let y,m;g==="top"||g==="bottom"?(y=g,m=f===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(m=g,y=f==="end"?"top":"bottom");const v=h-u.top-u.bottom,k=x-u.left-u.right,R=Je(h-u[y],v),I=Je(x-u[m],k),P=!t.middlewareData.shift;let L=R,j=I;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(j=k),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(L=v),P&&!f){const $=me(u.left,0),F=me(u.right,0),Y=me(u.top,0),U=me(u.bottom,0);p?j=x-2*($!==0||F!==0?$+F:me(u.left,u.right)):L=h-2*(Y!==0||U!==0?Y+U:me(u.top,u.bottom))}await d({...t,availableWidth:j,availableHeight:L});const Z=await l.getDimensions(c.floating);return x!==Z.width||h!==Z.height?{reset:{rects:!0}}:{}}}};function Ho(e){const t=ye(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=le(e),s=n?e.offsetWidth:r,l=n?e.offsetHeight:o,c=Et(r)!==s||Et(o)!==l;return c&&(r=s,o=l),{width:r,height:o,$:c}}function vr(e){return re(e)?e:e.contextElement}function Ze(e){const t=vr(e);if(!le(t))return Ee(1);const r=t.getBoundingClientRect(),{width:o,height:n,$:s}=Ho(t);let l=(s?Et(r.width):r.width)/o,c=(s?Et(r.height):r.height)/n;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const bl=Ee(0);function Uo(e){const t=Ce(e);return!zt()||!t.visualViewport?bl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xl(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ce(e)?!1:t}function Ue(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const n=e.getBoundingClientRect(),s=vr(e);let l=Ee(1);t&&(o?re(o)&&(l=Ze(o)):l=Ze(e));const c=xl(s,r,o)?Uo(s):Ee(0);let d=(n.left+c.x)/l.x,a=(n.top+c.y)/l.y,u=n.width/l.x,g=n.height/l.y;if(s){const f=Ce(s),p=o&&re(o)?Ce(o):o;let x=f,h=ar(x);for(;h&&o&&p!==x;){const y=Ze(h),m=h.getBoundingClientRect(),v=ye(h),k=m.left+(h.clientLeft+parseFloat(v.paddingLeft))*y.x,R=m.top+(h.clientTop+parseFloat(v.paddingTop))*y.y;d*=y.x,a*=y.y,u*=y.x,g*=y.y,d+=k,a+=R,x=Ce(h),h=ar(x)}}return Ot({width:u,height:g,x:d,y:a})}function Vt(e,t){const r=Bt(e).scrollLeft;return t?t.left+r:Ue(Ie(e)).left+r}function Go(e,t){const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-Vt(e,r),n=r.top+t.scrollTop;return{x:o,y:n}}function ml(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e;const s=n==="fixed",l=Ie(o),c=t?jt(t.floating):!1;if(o===l||c&&s)return r;let d={scrollLeft:0,scrollTop:0},a=Ee(1);const u=Ee(0),g=le(o);if((g||!g&&!s)&&((_e(o)!=="body"||at(l))&&(d=Bt(o)),le(o))){const p=Ue(o);a=Ze(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const f=l&&!g&&!s?Go(l,d):Ee(0);return{width:r.width*a.x,height:r.height*a.y,x:r.x*a.x-d.scrollLeft*a.x+u.x+f.x,y:r.y*a.y-d.scrollTop*a.y+u.y+f.y}}function Cl(e){return Array.from(e.getClientRects())}function vl(e){const t=Ie(e),r=Bt(e),o=e.ownerDocument.body,n=me(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=me(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-r.scrollLeft+Vt(e);const c=-r.scrollTop;return ye(o).direction==="rtl"&&(l+=me(t.clientWidth,o.clientWidth)-n),{width:n,height:s,x:l,y:c}}const Hr=25;function wl(e,t){const r=Ce(e),o=Ie(e),n=r.visualViewport;let s=o.clientWidth,l=o.clientHeight,c=0,d=0;if(n){s=n.width,l=n.height;const u=zt();(!u||u&&t==="fixed")&&(c=n.offsetLeft,d=n.offsetTop)}const a=Vt(o);if(a<=0){const u=o.ownerDocument,g=u.body,f=getComputedStyle(g),p=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,x=Math.abs(o.clientWidth-g.clientWidth-p);x<=Hr&&(s-=x)}else a<=Hr&&(s+=a);return{width:s,height:l,x:c,y:d}}const yl=new Set(["absolute","fixed"]);function kl(e,t){const r=Ue(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,s=le(e)?Ze(e):Ee(1),l=e.clientWidth*s.x,c=e.clientHeight*s.y,d=n*s.x,a=o*s.y;return{width:l,height:c,x:d,y:a}}function Ur(e,t,r){let o;if(t==="viewport")o=wl(e,r);else if(t==="document")o=vl(Ie(e));else if(re(t))o=kl(t,r);else{const n=Uo(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ot(o)}function Ko(e,t){const r=Ae(e);return r===t||!re(r)||$e(r)?!1:ye(r).position==="fixed"||Ko(r,t)}function Rl(e,t){const r=t.get(e);if(r)return r;let o=Ne(e,[],!1).filter(c=>re(c)&&_e(c)!=="body"),n=null;const s=ye(e).position==="fixed";let l=s?Ae(e):e;for(;re(l)&&!$e(l);){const c=ye(l),d=xr(l);!d&&c.position==="fixed"&&(n=null),(s?!d&&!n:!d&&c.position==="static"&&!!n&&yl.has(n.position)||at(l)&&!d&&Ko(e,l))?o=o.filter(u=>u!==l):n=c,l=Ae(l)}return t.set(e,o),o}function Sl(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e;const l=[...r==="clippingAncestors"?jt(t)?[]:Rl(t,this._c):[].concat(r),o],c=l[0],d=l.reduce((a,u)=>{const g=Ur(t,u,n);return a.top=me(g.top,a.top),a.right=Je(g.right,a.right),a.bottom=Je(g.bottom,a.bottom),a.left=me(g.left,a.left),a},Ur(t,c,n));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function El(e){const{width:t,height:r}=Ho(e);return{width:t,height:r}}function Il(e,t,r){const o=le(t),n=Ie(t),s=r==="fixed",l=Ue(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const d=Ee(0);function a(){d.x=Vt(n)}if(o||!o&&!s)if((_e(t)!=="body"||at(n))&&(c=Bt(t)),o){const p=Ue(t,!0,s,t);d.x=p.x+t.clientLeft,d.y=p.y+t.clientTop}else n&&a();s&&!o&&n&&a();const u=n&&!o&&!s?Go(n,c):Ee(0),g=l.left+c.scrollLeft-d.x-u.x,f=l.top+c.scrollTop-d.y-u.y;return{x:g,y:f,width:l.width,height:l.height}}function Qt(e){return ye(e).position==="static"}function Gr(e,t){if(!le(e)||ye(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Ie(e)===r&&(r=r.ownerDocument.body),r}function qo(e,t){const r=Ce(e);if(jt(e))return r;if(!le(e)){let n=Ae(e);for(;n&&!$e(n);){if(re(n)&&!Qt(n))return n;n=Ae(n)}return r}let o=Gr(e,t);for(;o&&ui(o)&&Qt(o);)o=Gr(o,t);return o&&$e(o)&&Qt(o)&&!xr(o)?r:o||pi(e)||r}const Ol=async function(e){const t=this.getOffsetParent||qo,r=this.getDimensions,o=await r(e.floating);return{reference:Il(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Tl(e){return ye(e).direction==="rtl"}const $l={convertOffsetParentRelativeRectToViewportRelativeRect:ml,getDocumentElement:Ie,getClippingRect:Sl,getOffsetParent:qo,getElementRects:Ol,getClientRects:Cl,getDimensions:El,getScale:Ze,isElement:re,isRTL:Tl};function Xo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Al(e,t){let r=null,o;const n=Ie(e);function s(){var c;clearTimeout(o),(c=r)==null||c.disconnect(),r=null}function l(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),s();const a=e.getBoundingClientRect(),{left:u,top:g,width:f,height:p}=a;if(c||t(),!f||!p)return;const x=Ye(g),h=Ye(n.clientWidth-(u+f)),y=Ye(n.clientHeight-(g+p)),m=Ye(u),k={rootMargin:-x+"px "+-h+"px "+-y+"px "+-m+"px",threshold:me(0,Je(1,d))||1};let R=!0;function I(P){const L=P[0].intersectionRatio;if(L!==d){if(!R)return l();L?l(!1,L):o=setTimeout(()=>{l(!1,1e-7)},1e3)}L===1&&!Xo(a,e.getBoundingClientRect())&&l(),R=!1}try{r=new IntersectionObserver(I,{...k,root:n.ownerDocument})}catch{r=new IntersectionObserver(I,k)}r.observe(e)}return l(!0),s}function Yo(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:n=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,a=vr(e),u=n||s?[...a?Ne(a):[],...Ne(t)]:[];u.forEach(m=>{n&&m.addEventListener("scroll",r,{passive:!0}),s&&m.addEventListener("resize",r)});const g=a&&c?Al(a,r):null;let f=-1,p=null;l&&(p=new ResizeObserver(m=>{let[v]=m;v&&v.target===a&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var k;(k=p)==null||k.observe(t)})),r()}),a&&!d&&p.observe(a),p.observe(t));let x,h=d?Ue(e):null;d&&y();function y(){const m=Ue(e);h&&!Xo(h,m)&&r(),h=m,x=requestAnimationFrame(y)}return r(),()=>{var m;u.forEach(v=>{n&&v.removeEventListener("scroll",r),s&&v.removeEventListener("resize",r)}),g==null||g(),(m=p)==null||m.disconnect(),p=null,d&&cancelAnimationFrame(x)}}const Ml=gl,Pl=hl,Dl=ul,Ll=pl,Nl=(e,t,r)=>{const o=new Map,n={platform:$l,...r},s={...n.platform,_c:o};return al(e,t,{...n,platform:s})};var Fl=typeof document<"u",_l=function(){},St=Fl?X.useLayoutEffect:_l;function Pt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Pt(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){const s=n[o];if(!(s==="_owner"&&e.$$typeof)&&!Pt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Zo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Kr(e,t){const r=Zo(e);return Math.round(t*r)/r}function Jt(e){const t=C.useRef(e);return St(()=>{t.current=e}),t}function jl(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:d,open:a}=e,[u,g]=C.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=C.useState(o);Pt(f,o)||p(o);const[x,h]=C.useState(null),[y,m]=C.useState(null),v=C.useCallback(b=>{b!==P.current&&(P.current=b,h(b))},[]),k=C.useCallback(b=>{b!==L.current&&(L.current=b,m(b))},[]),R=s||x,I=l||y,P=C.useRef(null),L=C.useRef(null),j=C.useRef(u),Z=d!=null,$=Jt(d),F=Jt(n),Y=Jt(a),U=C.useCallback(()=>{if(!P.current||!L.current)return;const b={placement:t,strategy:r,middleware:f};F.current&&(b.platform=F.current),Nl(P.current,L.current,b).then(T=>{const N={...T,isPositioned:Y.current!==!1};S.current&&!Pt(j.current,N)&&(j.current=N,pn.flushSync(()=>{g(N)}))})},[f,t,r,F,Y]);St(()=>{a===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,g(b=>({...b,isPositioned:!1})))},[a]);const S=C.useRef(!1);St(()=>(S.current=!0,()=>{S.current=!1}),[]),St(()=>{if(R&&(P.current=R),I&&(L.current=I),R&&I){if($.current)return $.current(R,I,U);U()}},[R,I,U,$,Z]);const E=C.useMemo(()=>({reference:P,floating:L,setReference:v,setFloating:k}),[v,k]),_=C.useMemo(()=>({reference:R,floating:I}),[R,I]),D=C.useMemo(()=>{const b={position:r,left:0,top:0};if(!_.floating)return b;const T=Kr(_.floating,u.x),N=Kr(_.floating,u.y);return c?{...b,transform:"translate("+T+"px, "+N+"px)",...Zo(_.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:T,top:N}},[r,c,_.floating,u.x,u.y]);return C.useMemo(()=>({...u,update:U,refs:E,elements:_,floatingStyles:D}),[u,U,E,_,D])}const Qo=(e,t)=>({...Ml(e),options:[e,t]}),Jo=(e,t)=>({...Pl(e),options:[e,t]}),en=(e,t)=>({...Dl(e),options:[e,t]}),zl=(e,t)=>({...Ll(e),options:[e,t]}),Bl="data-floating-ui-focusable",qr="active",Xr="selected",ft="ArrowLeft",gt="ArrowRight",tn="ArrowUp",Ht="ArrowDown",Wl={...C};let Yr=!1,Vl=0;const Zr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Vl++;function Hl(){const[e,t]=C.useState(()=>Yr?Zr():void 0);return se(()=>{e==null&&t(Zr())},[]),C.useEffect(()=>{Yr=!0},[]),e}const Ul=Wl.useId,rn=Ul||Hl;let ct;process.env.NODE_ENV!=="production"&&(ct=new Set);function er(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];const n="Floating UI: "+r.join(" ");if(!((e=ct)!=null&&e.has(n))){var s;(s=ct)==null||s.add(n),console.warn(n)}}function Gl(){for(var e,t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];const n="Floating UI: "+r.join(" ");if(!((e=ct)!=null&&e.has(n))){var s;(s=ct)==null||s.add(n),console.error(n)}}function Kl(){const e=new Map;return{emit(t,r){var o;(o=e.get(t))==null||o.forEach(n=>n(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var o;(o=e.get(t))==null||o.delete(r)}}}const ql=C.createContext(null),Xl=C.createContext(null),wr=()=>{var e;return((e=C.useContext(ql))==null?void 0:e.id)||null},Ut=()=>C.useContext(Xl);function Dt(e){return"data-floating-ui-"+e}function pr(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let Qr=0;function Be(e,t){t===void 0&&(t={});const{preventScroll:r=!1,cancelPrevious:o=!0,sync:n=!1}=t;o&&cancelAnimationFrame(Qr);const s=()=>e==null?void 0:e.focus({preventScroll:r});n?s():Qr=requestAnimationFrame(s)}function Yl(e){return(e==null?void 0:e.ownerDocument)||document}const Qe={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Jr(e){return e==="inert"?Qe.inert:e==="aria-hidden"?Qe["aria-hidden"]:Qe.none}let Ct=new WeakSet,vt={},tr=0;const Zl=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,on=e=>e&&(e.host||on(e.parentNode)),Ql=(e,t)=>t.map(r=>{if(e.contains(r))return r;const o=on(r);return e.contains(o)?o:null}).filter(r=>r!=null);function Jl(e,t,r,o){const n="data-floating-ui-inert",s=o?"inert":r?"aria-hidden":null,l=Ql(t,e),c=new Set,d=new Set(l),a=[];vt[n]||(vt[n]=new WeakMap);const u=vt[n];l.forEach(g),f(t),c.clear();function g(p){!p||c.has(p)||(c.add(p),p.parentNode&&g(p.parentNode))}function f(p){!p||d.has(p)||[].forEach.call(p.children,x=>{if(_e(x)!=="script")if(c.has(x))f(x);else{const h=s?x.getAttribute(s):null,y=h!==null&&h!=="false",m=Jr(s),v=(m.get(x)||0)+1,k=(u.get(x)||0)+1;m.set(x,v),u.set(x,k),a.push(x),v===1&&y&&Ct.add(x),k===1&&x.setAttribute(n,""),!y&&s&&x.setAttribute(s,s==="inert"?"":"true")}})}return tr++,()=>{a.forEach(p=>{const x=Jr(s),y=(x.get(p)||0)-1,m=(u.get(p)||0)-1;x.set(p,y),u.set(p,m),y||(!Ct.has(p)&&s&&p.removeAttribute(s),Ct.delete(p)),m||p.removeAttribute(n)}),tr--,tr||(Qe.inert=new WeakMap,Qe["aria-hidden"]=new WeakMap,Qe.none=new WeakMap,Ct=new WeakSet,vt={})}}function eo(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=Yl(e[0]).body;return Jl(e.concat(Array.from(o.querySelectorAll('[aria-live],[role="status"],output'))),o,t,r)}const yr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},to=C.forwardRef(function(t,r){const[o,n]=C.useState();se(()=>{Hi()&&n("button")},[]);const s={ref:r,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Dt("focus-guard")]:"",style:yr};return We.jsx("span",{...t,...s})}),es=C.createContext(null),ts=()=>C.useContext(es);function ro(e){return C.useMemo(()=>t=>{e.forEach(r=>{r&&(r.current=t)})},e)}const rs=20;let Le=[];function kr(){Le=Le.filter(e=>e.isConnected)}function os(e){kr(),e&&_e(e)!=="body"&&(Le.push(e),Le.length>rs&&(Le=Le.slice(-20)))}function oo(){return kr(),Le[Le.length-1]}function ns(e){const t=Wt();return _o(e,t)?e:mr(e,t)[0]||e}function no(e,t){var r;if(!t.current.includes("floating")&&!((r=e.getAttribute("role"))!=null&&r.includes("dialog")))return;const o=Wt(),s=Wi(e,o).filter(c=>{const d=c.getAttribute("data-tabindex")||"";return _o(c,o)||c.hasAttribute("data-tabindex")&&!d.startsWith("-")}),l=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?l!=="0"&&e.setAttribute("tabindex","0"):(l!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const is=C.forwardRef(function(t,r){return We.jsx("button",{...t,type:"button",ref:r,tabIndex:-1,style:yr})});function ls(e){const{context:t,children:r,disabled:o=!1,order:n=["content"],guards:s=!0,initialFocus:l=0,returnFocus:c=!0,restoreFocus:d=!1,modal:a=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:g=!0,outsideElementsInert:f=!1,getInsideElements:p=()=>[]}=e,{open:x,onOpenChange:h,events:y,dataRef:m,elements:{domReference:v,floating:k}}=t,R=ue(()=>{var z;return(z=m.current.floatingContext)==null?void 0:z.nodeId}),I=ue(p),P=typeof l=="number"&&l<0,L=hr(v)&&P,j=Zl(),Z=j?s:!0,$=!Z||j&&f,F=Se(n),Y=Se(l),U=Se(c),S=Ut(),E=ts(),_=C.useRef(null),D=C.useRef(null),b=C.useRef(!1),T=C.useRef(!1),N=C.useRef(-1),ne=C.useRef(-1),be=E!=null,V=Mt(k),q=ue(function(z){return z===void 0&&(z=V),z?mr(z,Wt()):[]}),H=ue(z=>{const G=q(z);return F.current.map(B=>v&&B==="reference"?v:V&&B==="floating"?V:G).filter(Boolean).flat()});C.useEffect(()=>{if(o||!a)return;function z(B){if(B.key==="Tab"){xe(V,Pe(we(V)))&&q().length===0&&!L&&ae(B);const ee=H(),oe=De(B);F.current[0]==="reference"&&oe===v&&(ae(B),B.shiftKey?Be(ee[ee.length-1]):Be(ee[1])),F.current[1]==="floating"&&oe===V&&B.shiftKey&&(ae(B),Be(ee[0]))}}const G=we(V);return G.addEventListener("keydown",z),()=>{G.removeEventListener("keydown",z)}},[o,v,V,a,F,L,q,H]),C.useEffect(()=>{if(o||!k)return;function z(G){const B=De(G),oe=q().indexOf(B);oe!==-1&&(N.current=oe)}return k.addEventListener("focusin",z),()=>{k.removeEventListener("focusin",z)}},[o,k,q]),C.useEffect(()=>{if(o||!g)return;function z(){T.current=!0,setTimeout(()=>{T.current=!1})}function G(oe){const K=oe.relatedTarget,pe=oe.currentTarget,ce=De(oe);queueMicrotask(()=>{const fe=R(),ke=!(xe(v,K)||xe(k,K)||xe(K,k)||xe(E==null?void 0:E.portalNode,K)||K!=null&&K.hasAttribute(Dt("focus-guard"))||S&&(Ve(S.nodesRef.current,fe).find(M=>{var W,A;return xe((W=M.context)==null?void 0:W.elements.floating,K)||xe((A=M.context)==null?void 0:A.elements.domReference,K)})||jr(S.nodesRef.current,fe).find(M=>{var W,A,Q;return[(W=M.context)==null?void 0:W.elements.floating,Mt((A=M.context)==null?void 0:A.elements.floating)].includes(K)||((Q=M.context)==null?void 0:Q.elements.domReference)===K})));if(pe===v&&V&&no(V,F),d&&pe!==v&&!(ce!=null&&ce.isConnected)&&Pe(we(V))===we(V).body){le(V)&&V.focus();const M=N.current,W=q(),A=W[M]||W[W.length-1]||V;le(A)&&A.focus()}if(m.current.insideReactTree){m.current.insideReactTree=!1;return}(L||!a)&&K&&ke&&!T.current&&K!==oo()&&(b.current=!0,h(!1,oe,"focus-out"))})}const B=!!(!S&&E);function ee(){pr(ne),m.current.insideReactTree=!0,ne.current=window.setTimeout(()=>{m.current.insideReactTree=!1})}if(k&&le(v))return v.addEventListener("focusout",G),v.addEventListener("pointerdown",z),k.addEventListener("focusout",G),B&&k.addEventListener("focusout",ee,!0),()=>{v.removeEventListener("focusout",G),v.removeEventListener("pointerdown",z),k.removeEventListener("focusout",G),B&&k.removeEventListener("focusout",ee,!0)}},[o,v,k,V,a,S,E,h,g,d,q,L,R,F,m]);const J=C.useRef(null),de=C.useRef(null),tt=ro([J,E==null?void 0:E.beforeInsideRef]),Ge=ro([de,E==null?void 0:E.afterInsideRef]);C.useEffect(()=>{var z,G;if(o||!k)return;const B=Array.from((E==null||(z=E.portalNode)==null?void 0:z.querySelectorAll("["+Dt("portal")+"]"))||[]),oe=(G=(S?jr(S.nodesRef.current,R()):[]).find(ce=>{var fe;return hr(((fe=ce.context)==null?void 0:fe.elements.domReference)||null)}))==null||(G=G.context)==null?void 0:G.elements.domReference,K=[k,oe,...B,...I(),_.current,D.current,J.current,de.current,E==null?void 0:E.beforeOutsideRef.current,E==null?void 0:E.afterOutsideRef.current,F.current.includes("reference")||L?v:null].filter(ce=>ce!=null),pe=a||L?eo(K,!$,$):eo(K);return()=>{pe()}},[o,v,k,a,F,E,L,Z,$,S,R,I]),se(()=>{if(o||!le(V))return;const z=we(V),G=Pe(z);queueMicrotask(()=>{const B=H(V),ee=Y.current,oe=(typeof ee=="number"?B[ee]:ee.current)||V,K=xe(V,G);!P&&!K&&x&&Be(oe,{preventScroll:oe===V})})},[o,x,V,P,H,Y]),se(()=>{if(o||!V)return;const z=we(V),G=Pe(z);os(G);function B(K){let{reason:pe,event:ce,nested:fe}=K;if(["hover","safe-polygon"].includes(pe)&&ce.type==="mouseleave"&&(b.current=!0),pe==="outside-press")if(fe)b.current=!1;else if(Bo(ce)||Wo(ce))b.current=!1;else{let ke=!1;document.createElement("div").focus({get preventScroll(){return ke=!0,!1}}),ke?b.current=!1:b.current=!0}}y.on("openchange",B);const ee=z.createElement("span");ee.setAttribute("tabindex","-1"),ee.setAttribute("aria-hidden","true"),Object.assign(ee.style,yr),be&&v&&v.insertAdjacentElement("afterend",ee);function oe(){if(typeof U.current=="boolean"){const K=v||oo();return K&&K.isConnected?K:ee}return U.current.current||ee}return()=>{y.off("openchange",B);const K=Pe(z),pe=xe(k,K)||S&&Ve(S.nodesRef.current,R(),!1).some(fe=>{var ke;return xe((ke=fe.context)==null?void 0:ke.elements.floating,K)}),ce=oe();queueMicrotask(()=>{const fe=ns(ce);U.current&&!b.current&&le(fe)&&(!(fe!==K&&K!==z.body)||pe)&&fe.focus({preventScroll:!0}),ee.remove()})}},[o,k,V,U,m,y,S,be,v,R]),C.useEffect(()=>(queueMicrotask(()=>{b.current=!1}),()=>{queueMicrotask(kr)}),[o]),se(()=>{if(!o&&E)return E.setFocusManagerState({modal:a,closeOnFocusOut:g,open:x,onOpenChange:h,domReference:v}),()=>{E.setFocusManagerState(null)}},[o,E,a,x,h,g,v]),se(()=>{o||V&&no(V,F)},[o,V,F]);function Oe(z){return o||!u||!a?null:We.jsx(is,{ref:z==="start"?_:D,onClick:G=>h(!1,G.nativeEvent),children:typeof u=="string"?u:"Dismiss"})}const Ke=!o&&Z&&(a?!L:!0)&&(be||a);return We.jsxs(We.Fragment,{children:[Ke&&We.jsx(to,{"data-type":"inside",ref:tt,onFocus:z=>{if(a){const B=H();Be(n[0]==="reference"?B[0]:B[B.length-1])}else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(b.current=!1,Wr(z,E.portalNode)){const B=sl(v);B==null||B.focus()}else{var G;(G=E.beforeOutsideRef.current)==null||G.focus()}}}),!L&&Oe("start"),r,Oe("end"),Ke&&We.jsx(to,{"data-type":"inside",ref:Ge,onFocus:z=>{if(a)Be(H()[0]);else if(E!=null&&E.preserveTabOrder&&E.portalNode)if(g&&(b.current=!0),Wr(z,E.portalNode)){const B=cl(v);B==null||B.focus()}else{var G;(G=E.afterOutsideRef.current)==null||G.focus()}}})]})}function io(e){return le(e.target)&&e.target.tagName==="BUTTON"}function ss(e){return le(e.target)&&e.target.tagName==="A"}function lo(e){return zo(e)}function nn(e,t){t===void 0&&(t={});const{open:r,onOpenChange:o,dataRef:n,elements:{domReference:s}}=e,{enabled:l=!0,event:c="click",toggle:d=!0,ignoreMouse:a=!1,keyboardHandlers:u=!0,stickIfOpen:g=!0}=t,f=C.useRef(),p=C.useRef(!1),x=C.useMemo(()=>({onPointerDown(h){f.current=h.pointerType},onMouseDown(h){const y=f.current;h.button===0&&c!=="click"&&(zr(y)&&a||(r&&d&&(!(n.current.openEvent&&g)||n.current.openEvent.type==="mousedown")?o(!1,h.nativeEvent,"click"):(h.preventDefault(),o(!0,h.nativeEvent,"click"))))},onClick(h){const y=f.current;if(c==="mousedown"&&f.current){f.current=void 0;return}zr(y)&&a||(r&&d&&(!(n.current.openEvent&&g)||n.current.openEvent.type==="click")?o(!1,h.nativeEvent,"click"):o(!0,h.nativeEvent,"click"))},onKeyDown(h){f.current=void 0,!(h.defaultPrevented||!u||io(h))&&(h.key===" "&&!lo(s)&&(h.preventDefault(),p.current=!0),!ss(h)&&h.key==="Enter"&&o(!(r&&d),h.nativeEvent,"click"))},onKeyUp(h){h.defaultPrevented||!u||io(h)||lo(s)||h.key===" "&&p.current&&(p.current=!1,o(!(r&&d),h.nativeEvent,"click"))}}),[n,s,c,a,u,o,r,g,d]);return C.useMemo(()=>l?{reference:x}:{},[l,x])}const cs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},as={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},so=e=>{var t,r;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(r=e==null?void 0:e.outsidePress)!=null?r:!0}};function ln(e,t){t===void 0&&(t={});const{open:r,onOpenChange:o,elements:n,dataRef:s}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:a="pointerdown",referencePress:u=!1,referencePressEvent:g="pointerdown",ancestorScroll:f=!1,bubbles:p,capture:x}=t,h=Ut(),y=ue(typeof d=="function"?d:()=>!1),m=typeof d=="function"?y:d,v=C.useRef(!1),{escapeKey:k,outsidePress:R}=so(p),{escapeKey:I,outsidePress:P}=so(x),L=C.useRef(!1),j=ue(S=>{var E;if(!r||!l||!c||S.key!=="Escape"||L.current)return;const _=(E=s.current.floatingContext)==null?void 0:E.nodeId,D=h?Ve(h.nodesRef.current,_):[];if(!k&&(S.stopPropagation(),D.length>0)){let b=!0;if(D.forEach(T=>{var N;if((N=T.context)!=null&&N.open&&!T.context.dataRef.current.__escapeKeyBubbles){b=!1;return}}),!b)return}o(!1,Zi(S)?S.nativeEvent:S,"escape-key")}),Z=ue(S=>{var E;const _=()=>{var D;j(S),(D=De(S))==null||D.removeEventListener("keydown",_)};(E=De(S))==null||E.addEventListener("keydown",_)}),$=ue(S=>{var E;const _=s.current.insideReactTree;s.current.insideReactTree=!1;const D=v.current;if(v.current=!1,a==="click"&&D||_||typeof m=="function"&&!m(S))return;const b=De(S),T="["+Dt("inert")+"]",N=we(n.floating).querySelectorAll(T);let ne=re(b)?b:null;for(;ne&&!$e(ne);){const H=Ae(ne);if($e(H)||!re(H))break;ne=H}if(N.length&&re(b)&&!Xi(b)&&!xe(b,n.floating)&&Array.from(N).every(H=>!xe(ne,H)))return;if(le(b)&&U){const H=$e(b),J=ye(b),de=/auto|scroll/,tt=H||de.test(J.overflowX),Ge=H||de.test(J.overflowY),Oe=tt&&b.clientWidth>0&&b.scrollWidth>b.clientWidth,Ke=Ge&&b.clientHeight>0&&b.scrollHeight>b.clientHeight,z=J.direction==="rtl",G=Ke&&(z?S.offsetX<=b.offsetWidth-b.clientWidth:S.offsetX>b.clientWidth),B=Oe&&S.offsetY>b.clientHeight;if(G||B)return}const be=(E=s.current.floatingContext)==null?void 0:E.nodeId,V=h&&Ve(h.nodesRef.current,be).some(H=>{var J;return Yt(S,(J=H.context)==null?void 0:J.elements.floating)});if(Yt(S,n.floating)||Yt(S,n.domReference)||V)return;const q=h?Ve(h.nodesRef.current,be):[];if(q.length>0){let H=!0;if(q.forEach(J=>{var de;if((de=J.context)!=null&&de.open&&!J.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,S,"outside-press")}),F=ue(S=>{var E;const _=()=>{var D;$(S),(D=De(S))==null||D.removeEventListener(a,_)};(E=De(S))==null||E.addEventListener(a,_)});C.useEffect(()=>{if(!r||!l)return;s.current.__escapeKeyBubbles=k,s.current.__outsidePressBubbles=R;let S=-1;function E(N){o(!1,N,"ancestor-scroll")}function _(){window.clearTimeout(S),L.current=!0}function D(){S=window.setTimeout(()=>{L.current=!1},zt()?5:0)}const b=we(n.floating);c&&(b.addEventListener("keydown",I?Z:j,I),b.addEventListener("compositionstart",_),b.addEventListener("compositionend",D)),m&&b.addEventListener(a,P?F:$,P);let T=[];return f&&(re(n.domReference)&&(T=Ne(n.domReference)),re(n.floating)&&(T=T.concat(Ne(n.floating))),!re(n.reference)&&n.reference&&n.reference.contextElement&&(T=T.concat(Ne(n.reference.contextElement)))),T=T.filter(N=>{var ne;return N!==((ne=b.defaultView)==null?void 0:ne.visualViewport)}),T.forEach(N=>{N.addEventListener("scroll",E,{passive:!0})}),()=>{c&&(b.removeEventListener("keydown",I?Z:j,I),b.removeEventListener("compositionstart",_),b.removeEventListener("compositionend",D)),m&&b.removeEventListener(a,P?F:$,P),T.forEach(N=>{N.removeEventListener("scroll",E)}),window.clearTimeout(S)}},[s,n,c,m,a,r,o,f,l,k,R,j,I,Z,$,P,F]),C.useEffect(()=>{s.current.insideReactTree=!1},[s,m,a]);const Y=C.useMemo(()=>({onKeyDown:j,...u&&{[cs[g]]:S=>{o(!1,S.nativeEvent,"reference-press")},...g!=="click"&&{onClick(S){o(!1,S.nativeEvent,"reference-press")}}}}),[j,o,u,g]),U=C.useMemo(()=>({onKeyDown:j,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[as[a]]:()=>{s.current.insideReactTree=!0}}),[j,a,s]);return C.useMemo(()=>l?{reference:Y,floating:U}:{},[l,Y,U])}function us(e){const{open:t=!1,onOpenChange:r,elements:o}=e,n=rn(),s=C.useRef({}),[l]=C.useState(()=>Kl()),c=wr()!=null;if(process.env.NODE_ENV!=="production"){const p=o.reference;p&&!re(p)&&Gl("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[d,a]=C.useState(o.reference),u=ue((p,x,h)=>{s.current.openEvent=p?x:void 0,l.emit("openchange",{open:p,event:x,reason:h,nested:c}),r==null||r(p,x,h)}),g=C.useMemo(()=>({setPositionReference:a}),[]),f=C.useMemo(()=>({reference:d||o.reference||null,floating:o.floating||null,domReference:o.reference}),[d,o.reference,o.floating]);return C.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:f,events:l,floatingId:n,refs:g}),[t,u,f,l,n,g])}function sn(e){e===void 0&&(e={});const{nodeId:t}=e,r=us({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||r,n=o.elements,[s,l]=C.useState(null),[c,d]=C.useState(null),u=(n==null?void 0:n.domReference)||s,g=C.useRef(null),f=Ut();se(()=>{u&&(g.current=u)},[u]);const p=jl({...e,elements:{...n,...c&&{reference:c}}}),x=C.useCallback(k=>{const R=re(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),getClientRects:()=>k.getClientRects(),contextElement:k}:k;d(R),p.refs.setReference(R)},[p.refs]),h=C.useCallback(k=>{(re(k)||k===null)&&(g.current=k,l(k)),(re(p.refs.reference.current)||p.refs.reference.current===null||k!==null&&!re(k))&&p.refs.setReference(k)},[p.refs]),y=C.useMemo(()=>({...p.refs,setReference:h,setPositionReference:x,domReference:g}),[p.refs,h,x]),m=C.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),v=C.useMemo(()=>({...p,...o,refs:y,elements:m,nodeId:t}),[p,y,m,t,o]);return se(()=>{o.dataRef.current.floatingContext=v;const k=f==null?void 0:f.nodesRef.current.find(R=>R.id===t);k&&(k.context=v)}),C.useMemo(()=>({...p,context:v,refs:y,elements:m}),[p,y,m,v])}function rr(e,t,r){const o=new Map,n=r==="item";let s=e;if(n&&e){const{[qr]:l,[Xr]:c,...d}=e;s=d}return{...r==="floating"&&{tabIndex:-1,[Bl]:""},...s,...t.map(l=>{const c=l?l[r]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((l,c)=>(c&&Object.entries(c).forEach(d=>{let[a,u]=d;if(!(n&&[qr,Xr].includes(a)))if(a.indexOf("on")===0){if(o.has(a)||o.set(a,[]),typeof u=="function"){var g;(g=o.get(a))==null||g.push(u),l[a]=function(){for(var f,p=arguments.length,x=new Array(p),h=0;h<p;h++)x[h]=arguments[h];return(f=o.get(a))==null?void 0:f.map(y=>y(...x)).find(y=>y!==void 0)}}}else l[a]=u}),l),{})}}function cn(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),r=e.map(c=>c==null?void 0:c.floating),o=e.map(c=>c==null?void 0:c.item),n=C.useCallback(c=>rr(c,e,"reference"),t),s=C.useCallback(c=>rr(c,e,"floating"),r),l=C.useCallback(c=>rr(c,e,"item"),o);return C.useMemo(()=>({getReferenceProps:n,getFloatingProps:s,getItemProps:l}),[n,s,l])}const ds="Escape";function Gt(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function wt(e,t){return Gt(t,e===tn||e===Ht,e===ft||e===gt)}function or(e,t,r){return Gt(t,e===Ht,r?e===ft:e===gt)||e==="Enter"||e===" "||e===""}function co(e,t,r){return Gt(t,r?e===ft:e===gt,e===Ht)}function ao(e,t,r,o){const n=r?e===gt:e===ft,s=e===tn;return t==="both"||t==="horizontal"&&o&&o>1?e===ds:Gt(t,n,s)}function fs(e,t){const{open:r,onOpenChange:o,elements:n,floatingId:s}=e,{listRef:l,activeIndex:c,onNavigate:d=()=>{},enabled:a=!0,selectedIndex:u=null,allowEscape:g=!1,loop:f=!1,nested:p=!1,rtl:x=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:m=!0,openOnArrowKeyDown:v=!0,disabledIndices:k=void 0,orientation:R="vertical",parentOrientation:I,cols:P=1,scrollItemIntoView:L=!0,virtualItemRef:j,itemSizes:Z,dense:$=!1}=t;process.env.NODE_ENV!=="production"&&(g&&(f||er("`useListNavigation` looping must be enabled to allow escaping."),h||er("`useListNavigation` must be virtual to allow escaping.")),R==="vertical"&&P>1&&er("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const F=Mt(n.floating),Y=Se(F),U=wr(),S=Ut();se(()=>{e.dataRef.current.orientation=R},[e,R]);const E=ue(()=>{d(b.current===-1?null:b.current)}),_=hr(n.domReference),D=C.useRef(y),b=C.useRef(u??-1),T=C.useRef(null),N=C.useRef(!0),ne=C.useRef(E),be=C.useRef(!!n.floating),V=C.useRef(r),q=C.useRef(!1),H=C.useRef(!1),J=Se(k),de=Se(r),tt=Se(L),Ge=Se(u),[Oe,Ke]=C.useState(),[z,G]=C.useState(),B=ue(()=>{function M(te){if(h){var ie;(ie=te.id)!=null&&ie.endsWith("-fui-option")&&(te.id=s+"-"+Math.random().toString(16).slice(2,10)),Ke(te.id),S==null||S.events.emit("virtualfocus",te),j&&(j.current=te)}else Be(te,{sync:q.current,preventScroll:!0})}const W=l.current[b.current],A=H.current;W&&M(W),(q.current?te=>te():requestAnimationFrame)(()=>{const te=l.current[b.current]||W;if(!te)return;W||M(te);const ie=tt.current;ie&&oe&&(A||!N.current)&&(te.scrollIntoView==null||te.scrollIntoView(typeof ie=="boolean"?{block:"nearest",inline:"nearest"}:ie))})});se(()=>{a&&(r&&n.floating?D.current&&u!=null&&(H.current=!0,b.current=u,E()):be.current&&(b.current=-1,ne.current()))},[a,r,n.floating,u,E]),se(()=>{if(a&&r&&n.floating)if(c==null){if(q.current=!1,Ge.current!=null)return;if(be.current&&(b.current=-1,B()),(!V.current||!be.current)&&D.current&&(T.current!=null||D.current===!0&&T.current==null)){let M=0;const W=()=>{l.current[0]==null?(M<2&&(M?requestAnimationFrame:queueMicrotask)(W),M++):(b.current=T.current==null||or(T.current,R,x)||p?Zt(l,J.current):Br(l,J.current),T.current=null,E())};W()}}else lt(l,c)||(b.current=c,B(),H.current=!1)},[a,r,n.floating,c,Ge,p,l,R,x,E,B,J]),se(()=>{var M;if(!a||n.floating||!S||h||!be.current)return;const W=S.nodesRef.current,A=(M=W.find(ie=>ie.id===U))==null||(M=M.context)==null?void 0:M.elements.floating,Q=Pe(we(n.floating)),te=W.some(ie=>ie.context&&xe(ie.context.elements.floating,Q));A&&!te&&N.current&&A.focus({preventScroll:!0})},[a,n.floating,S,U,h]),se(()=>{if(!a||!S||!h||U)return;function M(W){G(W.id),j&&(j.current=W)}return S.events.on("virtualfocus",M),()=>{S.events.off("virtualfocus",M)}},[a,S,h,U,j]),se(()=>{ne.current=E,V.current=r,be.current=!!n.floating}),se(()=>{r||(T.current=null,D.current=y)},[r,y]);const ee=c!=null,oe=C.useMemo(()=>{function M(A){if(!de.current)return;const Q=l.current.indexOf(A);Q!==-1&&b.current!==Q&&(b.current=Q,E())}return{onFocus(A){let{currentTarget:Q}=A;q.current=!0,M(Q)},onClick:A=>{let{currentTarget:Q}=A;return Q.focus({preventScroll:!0})},onMouseMove(A){let{currentTarget:Q}=A;q.current=!0,H.current=!1,m&&M(Q)},onPointerLeave(A){let{pointerType:Q}=A;if(!(!N.current||Q==="touch")&&(q.current=!0,!!m&&(b.current=-1,E(),!h))){var te;(te=Y.current)==null||te.focus({preventScroll:!0})}}}},[de,Y,m,l,E,h]),K=C.useCallback(()=>{var M;return I??(S==null||(M=S.nodesRef.current.find(W=>W.id===U))==null||(M=M.context)==null||(M=M.dataRef)==null?void 0:M.current.orientation)},[U,S,I]),pe=ue(M=>{if(N.current=!1,q.current=!0,M.which===229||!de.current&&M.currentTarget===Y.current)return;if(p&&ao(M.key,R,x,P)){wt(M.key,K())||ae(M),o(!1,M.nativeEvent,"list-navigation"),le(n.domReference)&&(h?S==null||S.events.emit("virtualfocus",n.domReference):n.domReference.focus());return}const W=b.current,A=Zt(l,k),Q=Br(l,k);if(_||(M.key==="Home"&&(ae(M),b.current=A,E()),M.key==="End"&&(ae(M),b.current=Q,E())),P>1){const te=Z||Array.from({length:l.current.length},()=>({width:1,height:1})),ie=nl(te,P,$),rt=ie.findIndex(ve=>ve!=null&&!Rt(l,ve,k)),ht=ie.reduce((ve,je,pt)=>je!=null&&!Rt(l,je,k)?pt:ve,-1),ot=ie[ol({current:ie.map(ve=>ve!=null?l.current[ve]:null)},{event:M,orientation:R,loop:f,rtl:x,cols:P,disabledIndices:ll([...(typeof k!="function"?k:null)||l.current.map((ve,je)=>Rt(l,je,k)?je:void 0),void 0],ie),minIndex:rt,maxIndex:ht,prevIndex:il(b.current>Q?A:b.current,te,ie,P,M.key===Ht?"bl":M.key===(x?ft:gt)?"tr":"tl"),stopEvent:!0})];if(ot!=null&&(b.current=ot,E()),R==="both")return}if(wt(M.key,R)){if(ae(M),r&&!h&&Pe(M.currentTarget.ownerDocument)===M.currentTarget){b.current=or(M.key,R,x)?A:Q,E();return}or(M.key,R,x)?f?b.current=W>=Q?g&&W!==l.current.length?-1:A:he(l,{startingIndex:W,disabledIndices:k}):b.current=Math.min(Q,he(l,{startingIndex:W,disabledIndices:k})):f?b.current=W<=A?g&&W!==-1?l.current.length:Q:he(l,{startingIndex:W,decrement:!0,disabledIndices:k}):b.current=Math.max(A,he(l,{startingIndex:W,decrement:!0,disabledIndices:k})),lt(l,b.current)&&(b.current=-1),E()}}),ce=C.useMemo(()=>h&&r&&ee&&{"aria-activedescendant":z||Oe},[h,r,ee,z,Oe]),fe=C.useMemo(()=>({"aria-orientation":R==="both"?void 0:R,..._?{}:ce,onKeyDown:pe,onPointerMove(){N.current=!0}}),[ce,pe,R,_]),ke=C.useMemo(()=>{function M(A){y==="auto"&&Bo(A.nativeEvent)&&(D.current=!0)}function W(A){D.current=y,y==="auto"&&Wo(A.nativeEvent)&&(D.current=!0)}return{...ce,onKeyDown(A){N.current=!1;const Q=A.key.startsWith("Arrow"),te=["Home","End"].includes(A.key),ie=Q||te,rt=co(A.key,R,x),ht=ao(A.key,R,x,P),ot=co(A.key,K(),x),ve=wt(A.key,R),je=(p?ot:ve)||A.key==="Enter"||A.key.trim()==="";if(h&&r){const bt=S==null?void 0:S.nodesRef.current.find(xt=>xt.parentId==null),Me=S&&bt?Yi(S.nodesRef.current,bt.id):null;if(ie&&Me&&j){const xt=new KeyboardEvent("keydown",{key:A.key,bubbles:!0});if(rt||ht){var pt,Sr;const hn=((pt=Me.context)==null?void 0:pt.elements.domReference)===A.currentTarget,Ir=ht&&!hn?(Sr=Me.context)==null?void 0:Sr.elements.domReference:rt?l.current.find(Or=>(Or==null?void 0:Or.id)===Oe):null;Ir&&(ae(A),Ir.dispatchEvent(xt),G(void 0))}if((ve||te)&&Me.context&&Me.context.open&&Me.parentId&&A.currentTarget!==Me.context.elements.domReference){var Er;ae(A),(Er=Me.context.elements.domReference)==null||Er.dispatchEvent(xt);return}}return pe(A)}if(!(!r&&!v&&Q)){if(je){const bt=wt(A.key,K());T.current=p&&bt?null:A.key}if(p){ot&&(ae(A),r?(b.current=Zt(l,J.current),E()):o(!0,A.nativeEvent,"list-navigation"));return}ve&&(u!=null&&(b.current=u),ae(A),!r&&v?o(!0,A.nativeEvent,"list-navigation"):pe(A),r&&E())}},onFocus(){r&&!h&&(b.current=-1,E())},onPointerDown:W,onPointerEnter:W,onMouseDown:M,onClick:M}},[Oe,ce,P,pe,J,y,l,p,E,o,r,v,R,K,x,u,S,h,j]);return C.useMemo(()=>a?{reference:ke,floating:fe,item:oe}:{},[a,ke,fe,oe])}const gs=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hs(e,t){var r,o;t===void 0&&(t={});const{open:n,elements:s,floatingId:l}=e,{enabled:c=!0,role:d="dialog"}=t,a=rn(),u=((r=s.domReference)==null?void 0:r.id)||a,g=C.useMemo(()=>{var v;return((v=Mt(s.floating))==null?void 0:v.id)||l},[s.floating,l]),f=(o=gs.get(d))!=null?o:d,x=wr()!=null,h=C.useMemo(()=>f==="tooltip"||d==="label"?{["aria-"+(d==="label"?"labelledby":"describedby")]:n?g:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":f==="alertdialog"?"dialog":f,"aria-controls":n?g:void 0,...f==="listbox"&&{role:"combobox"},...f==="menu"&&{id:u},...f==="menu"&&x&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[f,g,x,n,u,d]),y=C.useMemo(()=>{const v={id:g,...f&&{role:f}};return f==="tooltip"||d==="label"?v:{...v,...f==="menu"&&{"aria-labelledby":u}}},[f,g,u,d]),m=C.useCallback(v=>{let{active:k,selected:R}=v;const I={role:"option",...k&&{id:g+"-fui-option"}};switch(d){case"select":case"combobox":return{...I,"aria-selected":R}}return{}},[g,d]);return C.useMemo(()=>c?{reference:h,floating:y,item:m}:{},[c,h,y,m])}function ps(e,t){var r;const{open:o,dataRef:n}=e,{listRef:s,activeIndex:l,onMatch:c,onTypingChange:d,enabled:a=!0,findMatch:u=null,resetMs:g=750,ignoreKeys:f=[],selectedIndex:p=null}=t,x=C.useRef(-1),h=C.useRef(""),y=C.useRef((r=p??l)!=null?r:-1),m=C.useRef(null),v=ue(c),k=ue(d),R=Se(u),I=Se(f);se(()=>{o&&(pr(x),m.current=null,h.current="")},[o]),se(()=>{if(o&&h.current===""){var $;y.current=($=p??l)!=null?$:-1}},[o,p,l]);const P=ue($=>{$?n.current.typing||(n.current.typing=$,k($)):n.current.typing&&(n.current.typing=$,k($))}),L=ue($=>{function F(_,D,b){const T=R.current?R.current(D,b):D.find(N=>(N==null?void 0:N.toLocaleLowerCase().indexOf(b.toLocaleLowerCase()))===0);return T?_.indexOf(T):-1}const Y=s.current;if(h.current.length>0&&h.current[0]!==" "&&(F(Y,Y,h.current)===-1?P(!1):$.key===" "&&ae($)),Y==null||I.current.includes($.key)||$.key.length!==1||$.ctrlKey||$.metaKey||$.altKey)return;o&&$.key!==" "&&(ae($),P(!0)),Y.every(_=>{var D,b;return _?((D=_[0])==null?void 0:D.toLocaleLowerCase())!==((b=_[1])==null?void 0:b.toLocaleLowerCase()):!0})&&h.current===$.key&&(h.current="",y.current=m.current),h.current+=$.key,pr(x),x.current=window.setTimeout(()=>{h.current="",y.current=m.current,P(!1)},g);const S=y.current,E=F(Y,[...Y.slice((S||0)+1),...Y.slice(0,(S||0)+1)],h.current);E!==-1?(v(E),m.current=E):$.key!==" "&&(h.current="",P(!1))}),j=C.useMemo(()=>({onKeyDown:L}),[L]),Z=C.useMemo(()=>({onKeyDown:L,onKeyUp($){$.key===" "&&P(!1)}}),[L,P]);return C.useMemo(()=>a?{reference:j,floating:Z}:{},[a,j,Z])}const bs=(e,t)=>`${e}-${t}`,xs=(e=Ro,t=So,r=Eo,o,n)=>{const[s,l]=X.useState(!1),c=o!==void 0,d=c?o:s,a=X.useCallback(v=>{c||l(v),n==null||n(v)},[c,n]),u=X.useMemo(()=>bs(e,t),[e,t]),{refs:g,floatingStyles:f,context:p}=sn({open:d,onOpenChange:a,placement:u,middleware:[Qo(r),en(),Jo({padding:8})],whileElementsMounted:Yo}),x=nn(p),h=ln(p,{escapeKey:!0,outsidePress:!0}),{getReferenceProps:y,getFloatingProps:m}=cn([x,h]);return{isOpen:d,setIsOpen:a,refs:{setReference:g.setReference,setFloating:g.setFloating},floatingStyles:f,getReferenceProps:y,getFloatingProps:m}},nr=w.classNameGetter("dropdown"),ms=({trigger:e,children:t,placement:r=Ro,align:o=So,offset:n=Eo,open:s,onOpenChange:l,portalRenderNode:c,classnames:d,className:a,fullWidth:u,...g})=>{const{isOpen:f,refs:p,floatingStyles:x,getReferenceProps:h,getFloatingProps:y}=xs(r,o,n,s,l),m=()=>{const v=w.jsx(si,{ref:p.setFloating,className:nr("content",d==null?void 0:d.content),style:x,$isOpen:f,...y(),children:t});return c?Ft.createPortal(v,c):v};return w.jsxs(ii,{...g,className:nr("container",a,d==null?void 0:d.container),$fullWidth:u,children:[w.jsx(li,{ref:p.setReference,className:nr("trigger",d==null?void 0:d.trigger),$fullWidth:u,...h(),children:e}),m()]})},uo={hidden:["M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7 7 0 0 0-2.79.588l.77.771A6 6 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755q-.247.248-.517.486z","M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829","M3.35 5.47q-.27.24-.518.487A13 13 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7 7 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12z"],visible:["M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8M1.173 8a13 13 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5s3.879 1.168 5.168 2.457A13 13 0 0 1 14.828 8q-.086.13-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5s-3.879-1.168-5.168-2.457A13 13 0 0 1 1.172 8z","M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0"]},Cs=(e,t,r)=>r?e.input.wrapper.disabled.backgroundColor:t==="warning"?e.input.state.warning.wrapper.backgroundColor:t==="error"?e.input.state.error.wrapper.backgroundColor:e.input.wrapper.backgroundColor,vs=(e,t,r)=>r?e.input.wrapper.disabled.borderColor:t==="warning"?e.input.state.warning.wrapper.borderColor:t==="error"?e.input.state.error.wrapper.borderColor:e.input.wrapper.borderColor,ws=(e,t)=>t==="warning"?e.input.state.warning.wrapper.focus.outlineColor:t==="error"?e.input.state.error.wrapper.focus.outlineColor:e.input.wrapper.focus.outlineColor,ys=(e,t)=>t==="warning"?e.input.state.warning.label.color:t==="error"?e.input.state.error.label.color:e.input.label.color,ks=(e,t)=>t==="warning"?e.input.state.warning.input.color:t==="error"?e.input.state.error.input.color:e.input.input.color,Rs=(e,t)=>t==="warning"?e.input.state.warning.input.placeholderColor:t==="error"?e.input.state.error.input.placeholderColor:e.input.input.placeholderColor,Ss=(e,t,r)=>r?e.input.icon.disabled.color:t==="warning"?e.input.state.warning.icon.color:t==="error"?e.input.state.error.icon.color:e.input.icon.color,Es=(e,t)=>t==="warning"?e.input.state.warning.icon.color:t==="error"?e.input.state.error.icon.color:e.input.toggle.color,Is=O.div`
|
|
310
|
+
border: 0;
|
|
311
|
+
`,Or=s.div`
|
|
235
312
|
display: flex;
|
|
236
313
|
flex-direction: column;
|
|
237
314
|
gap: 2px;
|
|
238
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
239
315
|
min-width: 0;
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
font-size: 11px;
|
|
316
|
+
`,$r=s.span`
|
|
317
|
+
font-size: 14px;
|
|
243
318
|
font-weight: 500;
|
|
244
|
-
line-height: 1.
|
|
245
|
-
color: ${
|
|
246
|
-
margin-left: 2px;
|
|
247
|
-
`,Ts=O.div`
|
|
248
|
-
display: grid;
|
|
249
|
-
grid-template-columns: auto 1fr auto;
|
|
250
|
-
align-items: center;
|
|
251
|
-
height: 32px;
|
|
252
|
-
padding: 0 12px;
|
|
253
|
-
background-color: ${({theme:e,$state:t,$disabled:r})=>Cs(e,t,r)};
|
|
254
|
-
border-radius: 10px;
|
|
255
|
-
border: 1px solid
|
|
256
|
-
${({theme:e,$state:t,$disabled:r})=>vs(e,t,r)};
|
|
257
|
-
transition: border-color 0.15s ease;
|
|
319
|
+
line-height: 1.4;
|
|
320
|
+
color: ${e=>ce(e.$variant).label.static};
|
|
258
321
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
outline-offset: 1px;
|
|
322
|
+
label[data-disabled='true'] & {
|
|
323
|
+
color: ${e=>ce(e.$variant).label.disabled};
|
|
262
324
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
cursor: not-allowed;
|
|
266
|
-
`}
|
|
267
|
-
`,$s=O.input`
|
|
268
|
-
grid-column: 2;
|
|
269
|
-
width: 100%;
|
|
270
|
-
height: 100%;
|
|
271
|
-
font-size: 14px;
|
|
325
|
+
`,Sr=s.span`
|
|
326
|
+
font-size: 12px;
|
|
272
327
|
font-weight: 400;
|
|
273
|
-
line-height: 1.
|
|
274
|
-
color: ${
|
|
275
|
-
background-color: transparent;
|
|
276
|
-
border: none;
|
|
277
|
-
outline: none;
|
|
278
|
-
|
|
279
|
-
&::placeholder {
|
|
280
|
-
color: ${({theme:e,$state:t})=>Rs(e,t)};
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
&:disabled {
|
|
284
|
-
color: ${({theme:e})=>e.input.input.disabled.color};
|
|
285
|
-
cursor: not-allowed;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
&::-webkit-outer-spin-button,
|
|
289
|
-
&::-webkit-inner-spin-button {
|
|
290
|
-
appearance: none;
|
|
291
|
-
margin: 0;
|
|
292
|
-
}
|
|
328
|
+
line-height: 1.4;
|
|
329
|
+
color: ${e=>ce(e.$variant).description.static};
|
|
293
330
|
|
|
294
|
-
|
|
295
|
-
|
|
331
|
+
label[data-disabled='true'] & {
|
|
332
|
+
color: ${e=>ce(e.$variant).description.disabled};
|
|
296
333
|
}
|
|
297
|
-
`,
|
|
334
|
+
`,Me=A.newClassNameGetter("checkbox-card"),yr=({checked:e,className:o,classnames:r,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...u})=>a.jsxs(fr,{className:Me("container",o),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(xr,{...u,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(Ke,{className:r==null?void 0:r.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Or,{className:Me("content",r==null?void 0:r.content),children:[a.jsx($r,{className:Me("label",r==null?void 0:r.label),$variant:h,children:c}),i&&a.jsx(Sr,{className:Me("description",r==null?void 0:r.description),$variant:h,children:i})]})]}),Tt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},vr=s.div`
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-direction: column;
|
|
337
|
+
gap: 8px;
|
|
338
|
+
`,mr=s.span`
|
|
339
|
+
font-size: 13px;
|
|
340
|
+
font-weight: 500;
|
|
341
|
+
line-height: 1.5;
|
|
342
|
+
color: ${e=>e.$disabled?Tt.label.disabledColor:Tt.label.color};
|
|
343
|
+
margin-bottom: 4px;
|
|
344
|
+
`,Cr=s.div`
|
|
298
345
|
display: flex;
|
|
346
|
+
flex-direction: column;
|
|
347
|
+
gap: 12px;
|
|
348
|
+
`,Qe=A.newClassNameGetter("checkbox-group"),wr=({className:e,classnames:o,disabled:r,label:i,onChange:n,options:l,ref:c,value:d,...p})=>{const h=(u,f)=>{n(f?[...d,u]:d.filter(x=>x!==u))};return a.jsxs(vr,{...p,ref:c,className:Qe("container",e),children:[i&&a.jsx(mr,{className:Qe("label",o==null?void 0:o.label),$disabled:r,children:i}),a.jsx(Cr,{className:Qe("options",o==null?void 0:o.options),children:l.map(u=>a.jsx(Ke,{className:o==null?void 0:o.checkbox,checked:d.includes(u.value),label:u.label,disabled:r,onChange:f=>h(u.value,f.target.checked)},u.value))})]})},Nt={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},ft=e=>Nt[e]??Nt.gray,Rr=s.span`
|
|
349
|
+
display: inline-flex;
|
|
350
|
+
align-items: center;
|
|
351
|
+
gap: 4px;
|
|
352
|
+
padding: 0 ${e=>e.$deletable?"7px":"10px"} 0 10px;
|
|
353
|
+
border-radius: 12px;
|
|
354
|
+
height: 24px;
|
|
355
|
+
font-size: 12px;
|
|
356
|
+
font-weight: 500;
|
|
357
|
+
line-height: 1.5;
|
|
358
|
+
background-color: ${e=>ft(e.$variant).background};
|
|
359
|
+
color: ${e=>ft(e.$variant).color};
|
|
360
|
+
`,kr=s.button`
|
|
361
|
+
display: inline-flex;
|
|
299
362
|
align-items: center;
|
|
300
363
|
justify-content: center;
|
|
301
|
-
margin-right: 8px;
|
|
302
|
-
color: ${({theme:e,$state:t,$disabled:r})=>Ss(e,t,r)};
|
|
303
|
-
`,Ms=O.button`
|
|
304
|
-
display: grid;
|
|
305
|
-
place-items: center;
|
|
306
|
-
margin-left: 8px;
|
|
307
364
|
padding: 0;
|
|
308
|
-
|
|
365
|
+
margin: 0;
|
|
366
|
+
margin-left: 2px;
|
|
309
367
|
border: none;
|
|
368
|
+
background: transparent;
|
|
369
|
+
color: inherit;
|
|
310
370
|
cursor: pointer;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
${({$disabled:e})=>e&&`
|
|
314
|
-
opacity: 0.5;
|
|
315
|
-
pointer-events: none;
|
|
316
|
-
`}
|
|
317
|
-
`,Ps=O.svg`
|
|
318
|
-
width: 16px;
|
|
319
|
-
height: 16px;
|
|
320
|
-
`,Ds=({onBlur:e,onFocus:t,type:r,value:o})=>{const[n,s]=X.useState(!1),l=r==="password";return{inputType:X.useMemo(()=>l&&n?"text":r,[l,n,r]),isPassword:l,isPasswordVisible:n,handleBlur:f=>{e==null||e(f)},handleFocus:f=>{t==null||t(f)},handlePasswordMouseDown:f=>{f.preventDefault(),o&&s(!0)},handlePasswordMouseUp:()=>{s(!1)}}},qe=w.classNameGetter("input"),Ls=({className:e,classnames:t,fullWidth:r,icon:o,label:n,onChange:s,onBlur:l,onFocus:c,ref:d,state:a,type:u,value:g,...f})=>{const{inputType:p,isPassword:x,isPasswordVisible:h,handleBlur:y,handleFocus:m,handlePasswordMouseDown:v,handlePasswordMouseUp:k}=Ds({onBlur:l,onFocus:c,type:u,value:g}),R=h?uo.visible:uo.hidden,I=()=>o||null;return w.jsxs(Is,{className:qe("container",e,t==null?void 0:t.container),$fullWidth:r,children:[n&&w.jsx(Os,{className:qe("label",t==null?void 0:t.label),$state:a,children:n}),w.jsxs(Ts,{className:qe("wrapper",t==null?void 0:t.wrapper),$state:a,$disabled:f.disabled,children:[o&&w.jsx(As,{className:qe("icon",t==null?void 0:t.icon),$disabled:f.disabled,$state:a,children:I()}),w.jsx($s,{...f,ref:d,className:qe("input",t==null?void 0:t.input),$state:a,type:p,value:g,onChange:s,onFocus:m,onBlur:y}),x&&w.jsx(Ms,{type:"button",className:qe("toggle",t==null?void 0:t.toggle),$state:a,$disabled:f.disabled,onMouseDown:v,onMouseUp:k,onMouseLeave:k,tabIndex:-1,children:w.jsx(Ps,{viewBox:"0 0 16 16",fill:"currentColor",children:R.map(P=>w.jsx("path",{d:P},P))})})]})]})},Ns=(e,t,r)=>t?r==="warning"?e.radio.state.warning.circle.checked.borderColor:r==="error"?e.radio.state.error.circle.checked.borderColor:e.radio.circle.checked.borderColor:r==="warning"?e.radio.state.warning.circle.borderColor:r==="error"?e.radio.state.error.circle.borderColor:e.radio.circle.borderColor,Fs=(e,t)=>t==="warning"?e.radio.state.warning.circle.focus.shadowColor:t==="error"?e.radio.state.error.circle.focus.shadowColor:e.radio.circle.focus.shadowColor,_s=(e,t)=>t==="warning"?e.radio.state.warning.dot.color:t==="error"?e.radio.state.error.dot.color:e.radio.dot.color,js=(e,t)=>t==="warning"?e.radio.state.warning.label.color:t==="error"?e.radio.state.error.label.color:e.radio.label.color,zs=O.label`
|
|
321
|
-
display: inline-flex;
|
|
322
|
-
align-items: center;
|
|
323
|
-
gap: 8px;
|
|
324
|
-
cursor: pointer;
|
|
371
|
+
border-radius: 4px;
|
|
372
|
+
transition: background-color 0.15s ease;
|
|
325
373
|
|
|
326
|
-
&:
|
|
327
|
-
|
|
374
|
+
&:hover {
|
|
375
|
+
background-color: ${e=>ft(e.$variant).deleteHover};
|
|
328
376
|
}
|
|
329
377
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
`,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
378
|
+
& svg {
|
|
379
|
+
width: 14px;
|
|
380
|
+
height: 14px;
|
|
381
|
+
}
|
|
382
|
+
`,Lr=s.span`
|
|
383
|
+
flex: 1 0 auto;
|
|
384
|
+
text-align: center;
|
|
385
|
+
`,et=A.newClassNameGetter("chip"),Xe=({children:e,className:o,classnames:r,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(Rr,{...d,ref:l,className:et("container",o),$variant:c,$deletable:!!i,children:[a.jsx(Lr,{className:et("label",r==null?void 0:r.label),children:e}),i&&a.jsx(kr,{type:"button",className:et("delete",r==null?void 0:r.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),zr="Confirm",Pr="Cancel",jr=ie.keyframes`
|
|
386
|
+
from {
|
|
387
|
+
opacity: 0;
|
|
388
|
+
transform: translateX(-50%) translateY(100%);
|
|
389
|
+
}
|
|
390
|
+
to {
|
|
391
|
+
opacity: 1;
|
|
392
|
+
transform: translateX(-50%) translateY(0);
|
|
393
|
+
}
|
|
394
|
+
`,Er=ie.keyframes`
|
|
395
|
+
from {
|
|
396
|
+
opacity: 1;
|
|
397
|
+
transform: translateX(-50%) translateY(0);
|
|
398
|
+
}
|
|
399
|
+
to {
|
|
400
|
+
opacity: 0;
|
|
401
|
+
transform: translateX(-50%) translateY(100%);
|
|
402
|
+
}
|
|
403
|
+
`,Tr=s.div`
|
|
404
|
+
position: fixed;
|
|
405
|
+
bottom: 24px;
|
|
406
|
+
left: 50%;
|
|
407
|
+
transform: translateX(-50%);
|
|
408
|
+
display: flex;
|
|
342
409
|
align-items: center;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
border
|
|
347
|
-
border:
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
`,
|
|
354
|
-
|
|
355
|
-
height: 10px;
|
|
356
|
-
border-radius: 50%;
|
|
357
|
-
background-color: ${({theme:e,$state:t})=>_s(e,t)};
|
|
358
|
-
opacity: ${({$visible:e})=>e?1:0};
|
|
359
|
-
transform: ${({$visible:e})=>e?"scale(1)":"scale(0)"};
|
|
360
|
-
transition:
|
|
361
|
-
opacity 0.15s ease,
|
|
362
|
-
transform 0.15s ease;
|
|
363
|
-
`,Hs=O.span`
|
|
410
|
+
gap: 16px;
|
|
411
|
+
padding: 12px 16px;
|
|
412
|
+
background-color: ${t.COLORS.white};
|
|
413
|
+
border: 1px dashed ${t.COLORS.gray};
|
|
414
|
+
border-radius: 12px;
|
|
415
|
+
box-shadow:
|
|
416
|
+
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
417
|
+
0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
418
|
+
animation: ${({$open:e})=>e?jr:Er} 0.2s ease-out forwards;
|
|
419
|
+
z-index: 1000;
|
|
420
|
+
`,Nr=s.p`
|
|
421
|
+
margin: 0;
|
|
364
422
|
font-size: 14px;
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
font-weight: 500;
|
|
369
|
-
`,it=w.classNameGetter("radio"),Rr=({checked:e,className:t,classnames:r,disabled:o,label:n,onChange:s,ref:l,state:c,...d})=>w.jsxs(zs,{className:it("container",t,r==null?void 0:r.container),$disabled:o,$state:c,children:[w.jsx(Bs,{...d,ref:l,type:"radio",className:it("input",r==null?void 0:r.input),checked:e,disabled:o,onChange:s}),w.jsx(Ws,{className:it("circle",r==null?void 0:r.circle),$checked:e,$state:c,children:w.jsx(Vs,{className:it("dot",r==null?void 0:r.dot),$visible:e,$state:c})}),n&&w.jsx(Hs,{className:it("label",r==null?void 0:r.label),$state:c,children:n})]});function Xe(e,t,r){let o=r.initialDeps??[],n,s=!0;function l(){var c,d,a;let u;r.key&&((c=r.debug)!=null&&c.call(r))&&(u=Date.now());const g=e();if(!(g.length!==o.length||g.some((x,h)=>o[h]!==x)))return n;o=g;let p;if(r.key&&((d=r.debug)!=null&&d.call(r))&&(p=Date.now()),n=t(...g),r.key&&((a=r.debug)!=null&&a.call(r))){const x=Math.round((Date.now()-u)*100)/100,h=Math.round((Date.now()-p)*100)/100,y=h/16,m=(v,k)=>{for(v=String(v);v.length<k;)v=" "+v;return v};console.info(`%c⏱ ${m(h,5)} /${m(x,5)} ms`,`
|
|
370
|
-
font-size: .6rem;
|
|
371
|
-
font-weight: bold;
|
|
372
|
-
color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,r==null?void 0:r.key)}return r!=null&&r.onChange&&!(s&&r.skipInitialOnChange)&&r.onChange(n),s=!1,n}return l.updateDeps=c=>{o=c},l}function fo(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Us=(e,t)=>Math.abs(e-t)<1.01,Gs=(e,t,r)=>{let o;return function(...n){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,n),r)}},go=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},Ks=e=>e,qs=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),o=[];for(let n=t;n<=r;n++)o.push(n);return o},Xs=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;const n=l=>{const{width:c,height:d}=l;t({width:Math.round(c),height:Math.round(d)})};if(n(go(r)),!o.ResizeObserver)return()=>{};const s=new o.ResizeObserver(l=>{const c=()=>{const d=l[0];if(d!=null&&d.borderBoxSize){const a=d.borderBoxSize[0];if(a){n({width:a.inlineSize,height:a.blockSize});return}}n(go(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return s.observe(r,{box:"border-box"}),()=>{s.unobserve(r)}},ho={passive:!0},po=typeof window>"u"?!0:"onscrollend"in window,Ys=(e,t)=>{const r=e.scrollElement;if(!r)return;const o=e.targetWindow;if(!o)return;let n=0;const s=e.options.useScrollendEvent&&po?()=>{}:Gs(o,()=>{t(n,!1)},e.options.isScrollingResetDelay),l=u=>()=>{const{horizontal:g,isRtl:f}=e.options;n=g?r.scrollLeft*(f&&-1||1):r.scrollTop,s(),t(n,u)},c=l(!0),d=l(!1);d(),r.addEventListener("scroll",c,ho);const a=e.options.useScrollendEvent&&po;return a&&r.addEventListener("scrollend",d,ho),()=>{r.removeEventListener("scroll",c),a&&r.removeEventListener("scrollend",d)}},Zs=(e,t,r)=>{if(t!=null&&t.borderBoxSize){const o=t.borderBoxSize[0];if(o)return Math.round(o[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Qs=(e,{adjustments:t=0,behavior:r},o)=>{var n,s;const l=e+t;(s=(n=o.scrollElement)==null?void 0:n.scrollTo)==null||s.call(n,{[o.options.horizontal?"left":"top"]:l,behavior:r})};class Js{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let r=null;const o=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(n=>{n.forEach(s=>{const l=()=>{this._measureElement(s.target,s)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=o())==null||n.disconnect(),r=null},observe:n=>{var s;return(s=o())==null?void 0:s.observe(n,{box:"border-box"})},unobserve:n=>{var s;return(s=o())==null?void 0:s.unobserve(n)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([o,n])=>{typeof n>"u"&&delete r[o]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ks,rangeExtractor:qs,onChange:()=>{},measureElement:Zs,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...r}},this.notify=r=>{var o,n;(n=(o=this.options).onChange)==null||n.call(o,this,r)},this.maybeNotify=Xe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),r=>{this.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this.elementsCache.forEach(n=>{this.observer.observe(n)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,n=>{this.scrollRect=n,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(n,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<n?"forward":"backward":null,this.scrollOffset=n,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(r,o)=>{const n=new Map,s=new Map;for(let l=o-1;l>=0;l--){const c=r[l];if(n.has(c.lane))continue;const d=s.get(c.lane);if(d==null||c.end>d.end?s.set(c.lane,c):c.end<d.end&&n.set(c.lane,!0),n.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((l,c)=>l.end===c.end?l.index-c.index:l.end-c.end)[0]:void 0},this.getMeasurementOptions=Xe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(r,o,n,s,l,c)=>(this.prevLanes!==void 0&&this.prevLanes!==c&&(this.lanesChangedFlag=!0),this.prevLanes=c,this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:n,getItemKey:s,enabled:l,lanes:c}),{key:!1,skipInitialOnChange:!0,onChange:()=>{this.notify(this.isScrolling)}}),this.getMeasurements=Xe(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:o,scrollMargin:n,getItemKey:s,enabled:l,lanes:c},d)=>{if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>r)for(const f of this.laneAssignments.keys())f>=r&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const a=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===r&&(this.lanesSettling=!1);const u=this.measurementsCache.slice(0,a),g=new Array(c).fill(void 0);for(let f=0;f<a;f++){const p=u[f];p&&(g[p.lane]=f)}for(let f=a;f<r;f++){const p=s(f),x=this.laneAssignments.get(f);let h,y;if(x!==void 0&&this.options.lanes>1){h=x;const R=g[h],I=R!==void 0?u[R]:void 0;y=I?I.end+this.options.gap:o+n}else{const R=this.options.lanes===1?u[f-1]:this.getFurthestMeasurement(u,f);y=R?R.end+this.options.gap:o+n,h=R?R.lane:f%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(f,h)}const m=d.get(p),v=typeof m=="number"?m:this.options.estimateSize(f),k=y+v;u[f]={index:f,start:y,size:v,end:k,key:p,lane:h},g[h]=f}return this.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Xe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(r,o,n,s)=>this.range=r.length>0&&o>0?ec({measurements:r,outerSize:o,scrollOffset:n,lanes:s}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Xe(()=>{let r=null,o=null;const n=this.calculateRange();return n&&(r=n.startIndex,o=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,r,o]),[this.options.rangeExtractor,this.options.overscan,this.options.count,r,o]},(r,o,n,s,l)=>s===null||l===null?[]:r({startIndex:s,endIndex:l,overscan:o,count:n}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=r=>{const o=this.options.indexAttribute,n=r.getAttribute(o);return n?parseInt(n,10):(console.warn(`Missing attribute name '${o}={index}' on measured element.`),-1)},this._measureElement=(r,o)=>{const n=this.indexFromElement(r),s=this.measurementsCache[n];if(!s)return;const l=s.key,c=this.elementsCache.get(l);c!==r&&(c&&this.observer.unobserve(c),this.observer.observe(r),this.elementsCache.set(l,r)),r.isConnected&&this.resizeItem(n,this.options.measureElement(r,o,this))},this.resizeItem=(r,o)=>{const n=this.measurementsCache[r];if(!n)return;const s=this.itemSizeCache.get(n.key)??n.size,l=o-s;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(n,l,this):n.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",l),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(n.index),this.itemSizeCache=new Map(this.itemSizeCache.set(n.key,o)),this.notify(!1))},this.measureElement=r=>{if(!r){this.elementsCache.forEach((o,n)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(n))});return}this._measureElement(r,void 0)},this.getVirtualItems=Xe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(r,o)=>{const n=[];for(let s=0,l=r.length;s<l;s++){const c=r[s],d=o[c];n.push(d)}return n},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const o=this.getMeasurements();if(o.length!==0)return fo(o[an(0,o.length-1,n=>fo(o[n]).start,r)])},this.getOffsetForAlignment=(r,o,n=0)=>{const s=this.getSize(),l=this.getScrollOffset();o==="auto"&&(o=r>=l+s?"end":"start"),o==="center"?r+=(n-s)/2:o==="end"&&(r-=s);const c=this.getTotalSize()+this.options.scrollMargin-s;return Math.max(Math.min(c,r),0)},this.getOffsetForIndex=(r,o="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const n=this.measurementsCache[r];if(!n)return;const s=this.getSize(),l=this.getScrollOffset();if(o==="auto")if(n.end>=l+s-this.options.scrollPaddingEnd)o="end";else if(n.start<=l+this.options.scrollPaddingStart)o="start";else return[l,o];const c=o==="end"?n.end+this.options.scrollPaddingEnd:n.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,o,n.size),o]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(r,{align:o="start",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,o),{adjustments:void 0,behavior:n})},this.scrollToIndex=(r,{align:o="auto",behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),r=Math.max(0,Math.min(r,this.options.count-1));let s=0;const l=10,c=a=>{if(!this.targetWindow)return;const u=this.getOffsetForIndex(r,a);if(!u){console.warn("Failed to get offset for index:",r);return}const[g,f]=u;this._scrollToOffset(g,{adjustments:void 0,behavior:n}),this.targetWindow.requestAnimationFrame(()=>{const p=this.getScrollOffset(),x=this.getOffsetForIndex(r,f);if(!x){console.warn("Failed to get offset for index:",r);return}Us(x[0],p)||d(f)})},d=a=>{this.targetWindow&&(s++,s<l?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",s,l),this.targetWindow.requestAnimationFrame(()=>c(a))):console.warn(`Failed to scroll to index ${r} after ${l} attempts.`))};c(o)},this.scrollBy=(r,{behavior:o}={})=>{o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:o})},this.getTotalSize=()=>{var r;const o=this.getMeasurements();let n;if(o.length===0)n=this.options.paddingStart;else if(this.options.lanes===1)n=((r=o[o.length-1])==null?void 0:r.end)??0;else{const s=Array(this.options.lanes).fill(null);let l=o.length-1;for(;l>=0&&s.some(c=>c===null);){const c=o[l];s[c.lane]===null&&(s[c.lane]=c.end),l--}n=Math.max(...s.filter(c=>c!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(r,{adjustments:o,behavior:n})=>{this.options.scrollToFn(r,{behavior:n,adjustments:o},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(t)}}const an=(e,t,r,o)=>{for(;e<=t;){const n=(e+t)/2|0,s=r(n);if(s<o)e=n+1;else if(s>o)t=n-1;else return n}return e>0?e-1:0};function ec({measurements:e,outerSize:t,scrollOffset:r,lanes:o}){const n=e.length-1,s=d=>e[d].start;if(e.length<=o)return{startIndex:0,endIndex:n};let l=an(0,n,s,r),c=l;if(o===1)for(;c<n&&e[c].end<r+t;)c++;else if(o>1){const d=Array(o).fill(0);for(;c<n&&d.some(u=>u<r+t);){const u=e[c];d[u.lane]=u.end,c++}const a=Array(o).fill(r+t);for(;l>=0&&a.some(u=>u>=r);){const u=e[l];a[u.lane]=u.start,l--}l=Math.max(0,l-l%o),c=Math.min(n,c+(o-1-c%o))}return{startIndex:l,endIndex:c}}const bo=typeof document<"u"?C.useLayoutEffect:C.useEffect;function tc(e){const t=C.useReducer(()=>({}),{})[1],r={...e,onChange:(n,s)=>{var l;s?Ft.flushSync(t):t(),(l=e.onChange)==null||l.call(e,n,s)}},[o]=C.useState(()=>new Js(r));return o.setOptions(r),bo(()=>o._didMount(),[]),bo(()=>o._willUpdate()),o}function rc(e){return tc({observeElementRect:Xs,observeElementOffset:Ys,scrollToFn:Qs,...e})}const oc="Select...",nc="Search...",ic="No options",un="bottom",lc=256,sc=32,cc=4,ac=(e,t,r)=>r?e.select.trigger.disabled.backgroundColor:t==="warning"?e.select.state.warning.trigger.backgroundColor:t==="error"?e.select.state.error.trigger.backgroundColor:e.select.trigger.backgroundColor,uc=(e,t,r)=>r?e.select.trigger.disabled.borderColor:t==="warning"?e.select.state.warning.trigger.borderColor:t==="error"?e.select.state.error.trigger.borderColor:e.select.trigger.borderColor,dc=(e,t)=>t==="warning"?e.select.state.warning.trigger.focus.outlineColor:t==="error"?e.select.state.error.trigger.focus.outlineColor:e.select.trigger.focus.outlineColor,fc=(e,t)=>t==="warning"?e.select.state.warning.label.color:t==="error"?e.select.state.error.label.color:e.select.label.color,gc=(e,t,r,o)=>r?e.select.value.disabled.color:o?t==="warning"?e.select.state.warning.value.placeholderColor:t==="error"?e.select.state.error.value.placeholderColor:e.select.value.placeholderColor:t==="warning"?e.select.state.warning.value.color:t==="error"?e.select.state.error.value.color:e.select.value.color,hc=(e,t,r)=>r?e.select.icon.disabled.color:t==="warning"?e.select.state.warning.icon.color:t==="error"?e.select.state.error.icon.color:e.select.icon.color,pc=(e,t,r)=>r?e.select.chevron.disabled.color:t==="warning"?e.select.state.warning.chevron.color:t==="error"?e.select.state.error.chevron.color:e.select.chevron.color,bc=O.div`
|
|
423
|
+
color: ${t.COLORS.black};
|
|
424
|
+
white-space: nowrap;
|
|
425
|
+
`,Ir=s.div`
|
|
373
426
|
display: flex;
|
|
427
|
+
align-items: center;
|
|
428
|
+
gap: 8px;
|
|
429
|
+
`,Re=A.newClassNameGetter("confirmation"),Ar=({cancelBindings:e,cancelLabel:o=Pr,className:r,classnames:i,confirmLabel:n=zr,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:u,submitBindings:f,...x})=>h?a.jsxs(Tr,{...x,ref:u,className:Re("container",r),$open:h,children:[a.jsx(Nr,{className:Re("message",i==null?void 0:i.message),children:c}),a.jsxs(Ir,{className:Re("actions",i==null?void 0:i.actions),children:[a.jsx(Te,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:Re("cancel-button",i==null?void 0:i.cancelButton),children:o}),a.jsx(Te,{variant:"danger",size:"compact",onClick:p,loading:l,keyBindings:f,className:Re("confirm-button",i==null?void 0:i.confirmButton),children:n})]})]}):null,ke={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},Dr=s.div`
|
|
430
|
+
width: 100%;
|
|
431
|
+
|
|
432
|
+
${t.mediaUp("sm")} {
|
|
433
|
+
max-width: ${ke.sm};
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
${t.mediaUp("md")} {
|
|
437
|
+
max-width: ${ke.md};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
${t.mediaUp("lg")} {
|
|
441
|
+
max-width: ${ke.lg};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
${t.mediaUp("xl")} {
|
|
445
|
+
max-width: ${ke.xl};
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
${t.mediaUp("2xl")} {
|
|
449
|
+
max-width: ${ke["2xl"]};
|
|
450
|
+
}
|
|
451
|
+
`,Mr=A.newClassNameGetter("container"),_r=({children:e,className:o,ref:r,...i})=>a.jsx(Dr,{...i,ref:r,className:Mr("container",o),children:e}),Ue={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},xe={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},ne=36,Ze=2,Fr=12,po=(e,o,r="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),h=c%12||12,u=c>=12,f=new Intl.DateTimeFormat(r,{month:"long"}).format(e),x=new Intl.DateTimeFormat(r,{month:"short"}).format(e),k=new Intl.DateTimeFormat(r,{weekday:"long"}).format(e),S=new Intl.DateTimeFormat(r,{weekday:"short"}).format(e),$=z=>z.toString().padStart(2,"0"),y=z=>z.toString().padStart(2," "),O=z=>`\0${z}\0`,L=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",k],["Jan","MONTHSHORT",x],["Mon","WEEKDAYSHORT",S],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",$(n+1)],["_2","DAYSPACE",y(l)],["02","DAYPAD",$(l)],["15","HOURTWENTYFOUR",$(c)],["03","HOURTWELVEPAD",$(h)],["04","MINUTE",$(d)],["05","SECOND",$(p)],["PM","AMPMUP",u?"PM":"AM"],["pm","AMPMLOW",u?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let b=o;for(const[z,j]of L)b=b.split(z).join(O(j));for(const[,z,j]of L)b=b.split(O(z)).join(j);return b},Br=(e,o)=>new Date(e,o+1,0).getDate(),Yr=(e,o)=>new Date(e,o,1).getDay(),Hr=(e,o,r=1)=>{const i=Br(e,o);let l=Yr(e,o)-r;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=i;d++)c.push(d);for(;c.length<42;)c.push(null);return c},Gr=(e,o=1)=>{const r=[];for(let i=0;i<7;i++){const n=(o+i)%7,l=new Date(2024,0,7+n);r.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return r},Wr=e=>{const o=[];for(let r=0;r<12;r++){const i=new Date(2024,r,1);o.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return o},It=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth()&&e.getDate()===o.getDate(),At=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth(),Vr=(e,o)=>e.getFullYear()===o.getFullYear(),Dt=(e,o,r,i,n)=>{const l=new Date(e,o,r);if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l<c)return!0}if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l>c)return!0}return!1},Mt=(e,o,r,i)=>{if(r){const n=r.getFullYear(),l=r.getMonth();if(e<n||e===n&&o<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&o>l)return!0}return!1},_t=(e,o,r)=>!!(o&&e<o.getFullYear()||r&&e>r.getFullYear()),Ur=(e,o=12)=>{const r=e-Math.floor(o/2),i=[];for(let n=0;n<o;n++)i.push(r+n);return i},Xr=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},qr=s.span`
|
|
452
|
+
font-size: 12px;
|
|
453
|
+
font-weight: 500;
|
|
454
|
+
color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
|
|
455
|
+
`,Kr=A.newClassNameGetter("field-label"),Se=({children:e,className:o,ref:r,required:i,variant:n="normal",...l})=>e?a.jsxs(qr,{...l,ref:r,className:Kr("container",o),$variant:n,children:[e," ",i&&"*"]}):null,Zr=s.div`
|
|
456
|
+
position: relative;
|
|
457
|
+
display: inline-flex;
|
|
374
458
|
flex-direction: column;
|
|
375
459
|
gap: 2px;
|
|
376
|
-
|
|
377
|
-
width: ${({$fullWidth:e})=>e?"100%":"
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
`,
|
|
381
|
-
font-size: 11px;
|
|
382
|
-
font-weight: 500;
|
|
383
|
-
line-height: 1.5;
|
|
384
|
-
color: ${({theme:e,$state:t})=>fc(e,t)};
|
|
385
|
-
margin-left: 2px;
|
|
386
|
-
`,mc=O.button`
|
|
460
|
+
min-width: 180px;
|
|
461
|
+
width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
|
|
462
|
+
`,Jr=s(Se)`
|
|
463
|
+
margin-left: 6px;
|
|
464
|
+
`,Qr=s.button`
|
|
387
465
|
display: flex;
|
|
388
466
|
align-items: center;
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
border-radius: 10px;
|
|
393
|
-
border: 1px solid
|
|
394
|
-
${({theme:e,$state:t,$disabled:r})=>uc(e,t,r)};
|
|
467
|
+
justify-content: space-between;
|
|
468
|
+
gap: 8px;
|
|
469
|
+
width: 100%;
|
|
395
470
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
396
|
-
|
|
397
|
-
font-
|
|
471
|
+
outline: none;
|
|
472
|
+
font-size: 14px;
|
|
473
|
+
font-weight: 500;
|
|
398
474
|
text-align: left;
|
|
399
|
-
|
|
475
|
+
height: ${({$size:e})=>Ue[e].height};
|
|
476
|
+
padding: ${({$size:e})=>Ue[e].padding};
|
|
477
|
+
border-radius: ${({$size:e})=>Ue[e].radius};
|
|
478
|
+
color: ${({$variant:e,$disabled:o,$hasValue:r})=>r?xe[e].color[o?"disabled":"static"]:xe[e].placeholder[o?"disabled":"static"]};
|
|
479
|
+
border: 1px solid
|
|
480
|
+
${({$variant:e,$disabled:o})=>xe[e].border[o?"disabled":"static"]};
|
|
481
|
+
background-color: ${({$variant:e,$disabled:o})=>xe[e].background[o?"disabled":"static"]};
|
|
400
482
|
|
|
401
483
|
&:focus-visible {
|
|
402
|
-
outline: 2px solid ${({
|
|
403
|
-
outline-offset: 1px;
|
|
484
|
+
outline: 2px solid ${({$variant:e})=>xe[e].focus};
|
|
404
485
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
color: ${({theme:e,$state:t,$disabled:r})=>hc(e,t,r)};
|
|
411
|
-
`,vc=O.span`
|
|
486
|
+
|
|
487
|
+
${({$open:e,$variant:o})=>e&&`
|
|
488
|
+
outline: 2px solid ${xe[o].focus};
|
|
489
|
+
`}
|
|
490
|
+
`,ei=s.span`
|
|
412
491
|
flex: 1;
|
|
413
|
-
min-width: 0;
|
|
414
|
-
font-size: 14px;
|
|
415
|
-
font-weight: 400;
|
|
416
|
-
line-height: 1.5;
|
|
417
492
|
overflow: hidden;
|
|
418
|
-
white-space: nowrap;
|
|
419
493
|
text-overflow: ellipsis;
|
|
420
|
-
|
|
421
|
-
`,
|
|
494
|
+
white-space: nowrap;
|
|
495
|
+
`,ti=s.span`
|
|
422
496
|
display: flex;
|
|
423
497
|
align-items: center;
|
|
424
498
|
justify-content: center;
|
|
425
|
-
|
|
426
|
-
color: ${({theme:e,$state:t,$disabled:r})=>pc(e,t,r)};
|
|
499
|
+
flex-shrink: 0;
|
|
427
500
|
transition: transform 0.15s ease;
|
|
428
|
-
transform: ${({$
|
|
429
|
-
`,
|
|
430
|
-
z-index:
|
|
431
|
-
|
|
432
|
-
|
|
501
|
+
transform: ${({$open:e})=>e?"rotate(180deg)":"rotate(0deg)"};
|
|
502
|
+
`,uo=`
|
|
503
|
+
z-index: 100;
|
|
504
|
+
background-color: ${t.COLORS.white};
|
|
505
|
+
border: 1px solid ${t.alpha(t.COLORS.black,15)};
|
|
433
506
|
border-radius: 12px;
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
507
|
+
box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
|
|
508
|
+
padding: ${Fr}px;
|
|
509
|
+
`,ho=(e,o)=>e?"translateY(0)":o==="bottom"?"translateY(-8px)":"translateY(8px)",oi=s.div`
|
|
510
|
+
position: absolute;
|
|
511
|
+
${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
512
|
+
left: 0;
|
|
513
|
+
${uo}
|
|
514
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
515
|
+
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
516
|
+
transform: ${({$open:e,$position:o})=>ho(e,o)};
|
|
440
517
|
transition:
|
|
441
518
|
opacity 0.15s ease,
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
519
|
+
transform 0.15s ease,
|
|
520
|
+
visibility 0.15s;
|
|
521
|
+
`,ri=s.div`
|
|
522
|
+
position: fixed;
|
|
523
|
+
${uo}
|
|
524
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
525
|
+
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
526
|
+
transform: ${({$open:e,$position:o})=>ho(e,o)};
|
|
527
|
+
transition:
|
|
528
|
+
opacity 0.15s ease,
|
|
529
|
+
transform 0.15s ease,
|
|
530
|
+
visibility 0.15s;
|
|
531
|
+
`,tt=s.div`
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: center;
|
|
534
|
+
justify-content: space-between;
|
|
535
|
+
margin-bottom: 8px;
|
|
536
|
+
`,ot=s.button`
|
|
537
|
+
display: flex;
|
|
538
|
+
align-items: center;
|
|
539
|
+
gap: 4px;
|
|
540
|
+
padding: 4px 8px;
|
|
541
|
+
border: none;
|
|
542
|
+
background: transparent;
|
|
543
|
+
border-radius: 6px;
|
|
450
544
|
font-size: 14px;
|
|
451
|
-
font-weight:
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
color: ${({theme:e})=>e.select.search.color};
|
|
455
|
-
background-color: ${({theme:e})=>e.select.search.backgroundColor};
|
|
456
|
-
border: 1px solid ${({theme:e})=>e.select.search.borderColor};
|
|
457
|
-
border-radius: 8px;
|
|
458
|
-
outline: none;
|
|
545
|
+
font-weight: 600;
|
|
546
|
+
color: ${t.COLORS.black};
|
|
547
|
+
cursor: pointer;
|
|
459
548
|
|
|
460
|
-
|
|
461
|
-
color: ${(
|
|
549
|
+
&:hover {
|
|
550
|
+
background-color: ${t.alpha(t.COLORS.black,5)};
|
|
462
551
|
}
|
|
463
552
|
|
|
464
|
-
&:focus {
|
|
465
|
-
outline: 2px solid ${(
|
|
466
|
-
outline-offset: 1px;
|
|
553
|
+
&:focus-visible {
|
|
554
|
+
outline: 2px solid ${t.alpha(t.COLORS.black,20)};
|
|
467
555
|
}
|
|
468
|
-
`,
|
|
469
|
-
padding: 4px;
|
|
470
|
-
overflow-y: auto;
|
|
471
|
-
max-height: inherit;
|
|
472
|
-
`,mo=O.div`
|
|
556
|
+
`,Oe=s.button`
|
|
473
557
|
display: flex;
|
|
474
558
|
align-items: center;
|
|
475
|
-
justify-content:
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
559
|
+
justify-content: center;
|
|
560
|
+
width: 28px;
|
|
561
|
+
height: 28px;
|
|
562
|
+
border: none;
|
|
563
|
+
background: transparent;
|
|
564
|
+
border-radius: 6px;
|
|
565
|
+
color: ${t.COLORS.black};
|
|
482
566
|
cursor: pointer;
|
|
483
|
-
transition: background-color 0.1s ease;
|
|
484
|
-
color: ${({theme:e,$isSelected:t})=>t?e.select.option.selected.color:e.select.option.color};
|
|
485
|
-
background-color: ${({theme:e,$isSelected:t,$isHighlighted:r})=>t?e.select.option.selected.backgroundColor:r?e.select.option.hover.backgroundColor:e.select.option.backgroundColor};
|
|
486
567
|
|
|
487
568
|
&:hover {
|
|
488
|
-
background-color: ${(
|
|
569
|
+
background-color: ${t.alpha(t.COLORS.black,5)};
|
|
489
570
|
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
571
|
+
|
|
572
|
+
&:focus-visible {
|
|
573
|
+
outline: 2px solid ${t.alpha(t.COLORS.black,20)};
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
&:disabled {
|
|
577
|
+
opacity: 0.3;
|
|
578
|
+
cursor: not-allowed;
|
|
579
|
+
|
|
580
|
+
&:hover {
|
|
581
|
+
background: transparent;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
`,rt=s.div`
|
|
585
|
+
display: flex;
|
|
586
|
+
gap: 4px;
|
|
587
|
+
`,ii=s.div`
|
|
588
|
+
display: grid;
|
|
589
|
+
grid-template-columns: repeat(7, ${ne}px);
|
|
590
|
+
gap: ${Ze}px;
|
|
591
|
+
margin-bottom: 4px;
|
|
592
|
+
`,ni=s.div`
|
|
497
593
|
display: flex;
|
|
498
594
|
align-items: center;
|
|
499
595
|
justify-content: center;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
596
|
+
height: ${ne}px;
|
|
597
|
+
font-size: 12px;
|
|
598
|
+
font-weight: 500;
|
|
599
|
+
color: ${t.alpha(t.COLORS.black,50)};
|
|
600
|
+
text-transform: uppercase;
|
|
601
|
+
`,ai=s.div`
|
|
602
|
+
display: grid;
|
|
603
|
+
grid-template-columns: repeat(7, ${ne}px);
|
|
604
|
+
gap: ${Ze}px;
|
|
605
|
+
`,li=s.button`
|
|
503
606
|
display: flex;
|
|
504
607
|
align-items: center;
|
|
505
608
|
justify-content: center;
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
grid-template-columns: auto 1fr;
|
|
513
|
-
align-items: start;
|
|
514
|
-
gap: 12px;
|
|
515
|
-
padding: 12px;
|
|
516
|
-
background-color: ${({theme:e,$checked:t,$disabled:r})=>Tc(e,t,r)};
|
|
517
|
-
border: 1px solid
|
|
518
|
-
${({theme:e,$state:t,$checked:r,$disabled:o})=>$c(e,t,r,o)};
|
|
519
|
-
border-radius: 12px;
|
|
609
|
+
width: ${ne}px;
|
|
610
|
+
height: ${ne}px;
|
|
611
|
+
border: none;
|
|
612
|
+
border-radius: 8px;
|
|
613
|
+
font-size: 13px;
|
|
614
|
+
font-weight: ${({$selected:e,$today:o})=>e||o?600:500};
|
|
520
615
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
background-color 0.15s ease;
|
|
524
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
525
|
-
min-width: 0;
|
|
616
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
|
|
617
|
+
color: ${({$selected:e,$disabled:o})=>e?t.COLORS.white:o?t.alpha(t.COLORS.black,30):t.COLORS.black};
|
|
526
618
|
|
|
527
|
-
|
|
528
|
-
|
|
619
|
+
${({$today:e,$selected:o})=>e&&!o&&`
|
|
620
|
+
box-shadow: inset 0 0 0 1px ${t.COLORS.black};
|
|
621
|
+
`}
|
|
622
|
+
|
|
623
|
+
&:hover:not(:disabled) {
|
|
624
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
529
625
|
}
|
|
530
626
|
|
|
531
|
-
&:
|
|
532
|
-
outline: 2px solid ${(
|
|
627
|
+
&:focus-visible {
|
|
628
|
+
outline: 2px solid ${t.alpha(t.COLORS.black,30)};
|
|
533
629
|
outline-offset: 1px;
|
|
534
630
|
}
|
|
535
631
|
|
|
536
|
-
|
|
537
|
-
|
|
632
|
+
&:disabled {
|
|
633
|
+
cursor: not-allowed;
|
|
538
634
|
}
|
|
539
|
-
`,
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
overflow: hidden;
|
|
546
|
-
clip: rect(0, 0, 0, 0);
|
|
547
|
-
white-space: nowrap;
|
|
548
|
-
border: 0;
|
|
549
|
-
`,Fc=O.div`
|
|
635
|
+
`,di=s.div`
|
|
636
|
+
display: grid;
|
|
637
|
+
grid-template-columns: repeat(3, 1fr);
|
|
638
|
+
gap: 8px;
|
|
639
|
+
width: ${7*ne+6*Ze}px;
|
|
640
|
+
`,ci=s.button`
|
|
550
641
|
display: flex;
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
642
|
+
align-items: center;
|
|
643
|
+
justify-content: center;
|
|
644
|
+
padding: 12px 8px;
|
|
645
|
+
border: none;
|
|
646
|
+
border-radius: 8px;
|
|
555
647
|
font-size: 14px;
|
|
556
|
-
font-weight:
|
|
557
|
-
|
|
558
|
-
color: ${({
|
|
648
|
+
font-weight: ${({$selected:e,$current:o})=>e||o?600:400};
|
|
649
|
+
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
650
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
|
|
651
|
+
color: ${({$selected:e,$disabled:o})=>e?t.COLORS.white:o?t.alpha(t.COLORS.black,30):t.COLORS.black};
|
|
559
652
|
|
|
560
|
-
|
|
561
|
-
|
|
653
|
+
${({$current:e,$selected:o})=>e&&!o&&`
|
|
654
|
+
box-shadow: inset 0 0 0 1px ${t.COLORS.black};
|
|
655
|
+
`}
|
|
656
|
+
|
|
657
|
+
&:hover:not(:disabled) {
|
|
658
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
562
659
|
}
|
|
563
|
-
`,jc=O.span`
|
|
564
|
-
font-size: 12px;
|
|
565
|
-
font-weight: 400;
|
|
566
|
-
line-height: 1.4;
|
|
567
|
-
color: ${({theme:e,$state:t})=>Dc(e,t)};
|
|
568
660
|
|
|
569
|
-
|
|
570
|
-
|
|
661
|
+
&:focus-visible {
|
|
662
|
+
outline: 2px solid ${t.alpha(t.COLORS.black,30)};
|
|
663
|
+
outline-offset: 1px;
|
|
571
664
|
}
|
|
572
|
-
`,
|
|
573
|
-
display:
|
|
574
|
-
|
|
665
|
+
`,si=s.div`
|
|
666
|
+
display: grid;
|
|
667
|
+
grid-template-columns: repeat(3, 1fr);
|
|
575
668
|
gap: 8px;
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
padding: 0;
|
|
579
|
-
`,Wc=O.span`
|
|
580
|
-
font-size: 13px;
|
|
581
|
-
font-weight: 500;
|
|
582
|
-
line-height: 1.5;
|
|
583
|
-
line-height: 1.5;
|
|
584
|
-
color: ${({theme:e})=>e.checkboxGroup.label.color};
|
|
585
|
-
margin-bottom: 4px;
|
|
586
|
-
padding: 0;
|
|
587
|
-
`,Vc=O.div`
|
|
669
|
+
width: ${7*ne+6*Ze}px;
|
|
670
|
+
`,pi=s.button`
|
|
588
671
|
display: flex;
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
padding: 12px;
|
|
597
|
-
background-color: ${({theme:e,$checked:t,$disabled:r})=>Uc(e,t,r)};
|
|
598
|
-
border: 1px solid
|
|
599
|
-
${({theme:e,$state:t,$checked:r,$disabled:o})=>Gc(e,t,r,o)};
|
|
600
|
-
border-radius: 12px;
|
|
672
|
+
align-items: center;
|
|
673
|
+
justify-content: center;
|
|
674
|
+
padding: 12px 8px;
|
|
675
|
+
border: none;
|
|
676
|
+
border-radius: 8px;
|
|
677
|
+
font-size: 14px;
|
|
678
|
+
font-weight: ${({$selected:e,$current:o})=>e||o?600:400};
|
|
601
679
|
cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
background-color 0.15s ease;
|
|
605
|
-
width: ${({$fullWidth:e})=>e?"100%":"auto"};
|
|
606
|
-
min-width: 0;
|
|
680
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
|
|
681
|
+
color: ${({$selected:e,$disabled:o})=>e?t.COLORS.white:o?t.alpha(t.COLORS.black,30):t.COLORS.black};
|
|
607
682
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
}
|
|
683
|
+
${({$current:e,$selected:o})=>e&&!o&&`
|
|
684
|
+
box-shadow: inset 0 0 0 1px ${t.COLORS.black};
|
|
685
|
+
`}
|
|
611
686
|
|
|
612
|
-
&:
|
|
613
|
-
|
|
614
|
-
outline-offset: 1px;
|
|
687
|
+
&:hover:not(:disabled) {
|
|
688
|
+
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
615
689
|
}
|
|
616
690
|
|
|
617
|
-
|
|
618
|
-
|
|
691
|
+
&:focus-visible {
|
|
692
|
+
outline: 2px solid ${t.alpha(t.COLORS.black,30)};
|
|
693
|
+
outline-offset: 1px;
|
|
619
694
|
}
|
|
620
|
-
`,
|
|
695
|
+
`,ui=s.div`
|
|
696
|
+
width: ${ne}px;
|
|
697
|
+
height: ${ne}px;
|
|
698
|
+
`,K=A.newClassNameGetter("date-picker"),_e=4,hi=300,bi=({value:e,onChange:o,mode:r="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:u="normal",disabled:f=!1,fullWidth:x=!1,label:k,portalRenderNode:S,open:$,onOpen:y,onClose:O,className:L,classnames:b,ref:z,...j})=>{const N=g.useMemo(()=>new Date,[]),[X,P]=g.useState(!1),[B,T]=g.useState({top:0,left:0}),[C,_]=g.useState("bottom"),[v,E]=g.useState(()=>r==="year"?"years":r==="month"?"months":"days"),[w,D]=g.useState(()=>e??N),[Y,M]=g.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),H=g.useRef(null),R=g.useRef(null),I=g.useRef(null),U=$!==void 0,q=U?$:X,ge=i??Xr(r),Ne=g.useMemo(()=>Gr(l,c),[l,c]),Je=g.useMemo(()=>Wr(l),[l]),Ro=g.useMemo(()=>Hr(w.getFullYear(),w.getMonth(),c),[w,c]),Ie=g.useMemo(()=>Ur(Y+6,12),[Y]),yt=g.useMemo(()=>e?po(e,ge,l):null,[e,ge,l]),ko=n??ge.replace(/2006|06|January|Jan|01|02/g,"__"),ye=g.useCallback(()=>{var me;if(!R.current)return;const m=R.current.getBoundingClientRect(),F=((me=I.current)==null?void 0:me.offsetHeight)??hi,ve=window.innerHeight-m.bottom-_e,Ae=m.top-_e,fe=ve<F&&Ae>ve?"top":"bottom";if(_(fe),S){const De=fe==="bottom"?m.bottom+_e:m.top-F-_e;T({top:De,left:m.left})}},[S]),vt=g.useCallback(()=>{if(f)return;U||P(!0),y==null||y(),E(r==="year"?"years":r==="month"?"months":"days");const m=e??N;D(m),M(m.getFullYear()-6)},[f,U,y,r,e,N]),Z=g.useCallback(()=>{U||P(!1),O==null||O()},[U,O]),Lo=g.useCallback(()=>{q?Z():vt()},[q,Z,vt]),zo=g.useCallback(m=>{const F=new Date(w.getFullYear(),w.getMonth(),m);o==null||o(F),Z()},[w,o,Z]),Po=g.useCallback(m=>{if(r==="month"){const F=new Date(w.getFullYear(),m,1);o==null||o(F),Z()}else D(new Date(w.getFullYear(),m,1)),E("days")},[r,w,o,Z]),jo=g.useCallback(m=>{if(r==="year"){const F=new Date(m,0,1);o==null||o(F),Z()}else r==="month"?(D(new Date(m,w.getMonth(),1)),E("months")):(D(new Date(m,w.getMonth(),1)),E("months"))},[r,w,o,Z]),Eo=g.useCallback(()=>{D(m=>new Date(m.getFullYear(),m.getMonth()-1,1))},[]),To=g.useCallback(()=>{D(m=>new Date(m.getFullYear(),m.getMonth()+1,1))},[]),No=g.useCallback(()=>{D(m=>new Date(m.getFullYear()-1,m.getMonth(),1))},[]),Io=g.useCallback(()=>{D(m=>new Date(m.getFullYear()+1,m.getMonth(),1))},[]),Ao=g.useCallback(()=>{M(m=>m-12)},[]),Do=g.useCallback(()=>{M(m=>m+12)},[]),mt=g.useCallback(()=>{v==="days"?E("months"):v==="months"&&E("years")},[v]);g.useLayoutEffect(()=>{q&&ye()},[q,ye]),g.useEffect(()=>{const m=fe=>{const me=fe.target,De=H.current&&!H.current.contains(me),Ho=I.current&&!I.current.contains(me);S?De&&Ho&&Z():De&&Z()},F=fe=>{fe.key==="Escape"&&Z()},ve=()=>{q&&S&&ye()},Ae=()=>{q&&S&&ye()};return q&&(document.addEventListener("mousedown",m),document.addEventListener("keydown",F),S&&(window.addEventListener("scroll",ve,!0),window.addEventListener("resize",Ae))),()=>{document.removeEventListener("mousedown",m),document.removeEventListener("keydown",F),window.removeEventListener("scroll",ve,!0),window.removeEventListener("resize",Ae)}},[q,Z,S,ye]);const Mo=Ue[h].iconSize,_o=()=>a.jsxs(a.Fragment,{children:[a.jsxs(tt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ot,{onClick:mt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(w)}),a.jsxs(rt,{children:[a.jsx(Oe,{onClick:Eo,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:To,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(ii,{children:Ne.map((m,F)=>a.jsx(ni,{children:m},F))}),a.jsx(ai,{className:K("grid",b==null?void 0:b.grid),children:Ro.map((m,F)=>m===null?a.jsx(ui,{},F):a.jsx(li,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?It(e,new Date(w.getFullYear(),w.getMonth(),m)):!1,$today:It(N,new Date(w.getFullYear(),w.getMonth(),m)),$disabled:Dt(w.getFullYear(),w.getMonth(),m,d,p),disabled:Dt(w.getFullYear(),w.getMonth(),m,d,p),onClick:()=>zo(m),children:m},F))})]}),Fo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(tt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ot,{onClick:mt,type:"button",children:w.getFullYear()}),a.jsxs(rt,{children:[a.jsx(Oe,{onClick:No,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Io,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(di,{className:K("grid",b==null?void 0:b.grid),children:Je.map((m,F)=>a.jsx(ci,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?At(e,new Date(w.getFullYear(),F,1)):!1,$current:At(N,new Date(w.getFullYear(),F,1)),$disabled:Mt(w.getFullYear(),F,d,p),disabled:Mt(w.getFullYear(),F,d,p),onClick:()=>Po(F),children:m},F))})]}),Bo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(tt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(ot,{type:"button",style:{cursor:"default"},children:[Ie[0]," - ",Ie[Ie.length-1]]}),a.jsxs(rt,{children:[a.jsx(Oe,{onClick:Ao,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Do,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(si,{className:K("grid",b==null?void 0:b.grid),children:Ie.map(m=>a.jsx(pi,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Vr(e,new Date(m,0,1)):!1,$current:N.getFullYear()===m,$disabled:_t(m,d,p),disabled:_t(m,d,p),onClick:()=>jo(m),children:m},m))})]}),Ct=()=>{switch(v){case"days":return _o();case"months":return Fo();case"years":return Bo()}},Yo=S?be.createPortal(a.jsx(ri,{ref:I,$open:q,$position:C,className:K("calendar",b==null?void 0:b.calendar),style:{top:B.top,left:B.left},children:Ct()}),S):a.jsx(oi,{ref:I,$open:q,$position:C,className:K("calendar",b==null?void 0:b.calendar),children:Ct()});return a.jsxs(Zr,{...j,ref:z??H,$fullWidth:x,className:K("container",L),children:[k&&a.jsx(Jr,{children:k}),a.jsxs(Qr,{ref:R,type:"button",onClick:Lo,disabled:f,$size:h,$variant:u,$disabled:f,$open:q,$hasValue:!!yt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(ei,{children:yt??ko}),a.jsx(ti,{$open:q,children:a.jsx(a.ChevronDown,{size:Mo})})]}),Yo]})},gi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},fi=(e,o)=>{switch(e){case"left":return`
|
|
699
|
+
top: 0;
|
|
700
|
+
left: 0;
|
|
701
|
+
height: 100%;
|
|
702
|
+
width: ${o};
|
|
703
|
+
`;case"right":return`
|
|
704
|
+
top: 0;
|
|
705
|
+
right: 0;
|
|
706
|
+
height: 100%;
|
|
707
|
+
width: ${o};
|
|
708
|
+
`;case"top":return`
|
|
709
|
+
top: 0;
|
|
710
|
+
left: 0;
|
|
711
|
+
width: 100%;
|
|
712
|
+
height: ${o};
|
|
713
|
+
`;case"bottom":return`
|
|
714
|
+
bottom: 0;
|
|
715
|
+
left: 0;
|
|
716
|
+
width: 100%;
|
|
717
|
+
height: ${o};
|
|
718
|
+
`}},xi=s.div`
|
|
719
|
+
position: fixed;
|
|
720
|
+
z-index: 1001;
|
|
721
|
+
background-color: ${t.COLORS.white};
|
|
722
|
+
box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
|
|
723
|
+
${e=>fi(e.$position,e.$size)}
|
|
724
|
+
animation: ${e=>gi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
|
|
725
|
+
`,Oi=A.newClassNameGetter("drawer"),$i=({animated:e,children:o,className:r,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?be.createPortal(a.jsx(xi,{...d,ref:l,className:Oi("container",r),$animated:!!e,$position:n,$size:c,children:o}),document.body):null,Si=s.div`
|
|
726
|
+
position: relative;
|
|
727
|
+
display: inline-block;
|
|
728
|
+
`,yi=s.div`
|
|
729
|
+
cursor: pointer;
|
|
730
|
+
`,bo=`
|
|
731
|
+
z-index: 100;
|
|
732
|
+
min-width: 160px;
|
|
733
|
+
padding: 8px;
|
|
734
|
+
background-color: ${t.COLORS.white};
|
|
735
|
+
border: 1px solid ${t.COLORS.gray};
|
|
736
|
+
border-radius: 8px;
|
|
737
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
738
|
+
`,go=(e,o)=>e?"translateY(0)":o==="bottom"?"translateY(-8px)":"translateY(8px)",vi=s.div`
|
|
621
739
|
position: absolute;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
740
|
+
${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
741
|
+
${({$align:e})=>e==="left"?"left: 0;":"right: 0;"}
|
|
742
|
+
${bo}
|
|
743
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
744
|
+
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
745
|
+
transform: ${({$open:e,$position:o})=>go(e,o)};
|
|
746
|
+
transition:
|
|
747
|
+
opacity 0.15s ease,
|
|
748
|
+
transform 0.15s ease,
|
|
749
|
+
visibility 0.15s;
|
|
750
|
+
`,mi=s.div`
|
|
751
|
+
position: fixed;
|
|
752
|
+
${bo}
|
|
753
|
+
opacity: ${({$open:e})=>e?1:0};
|
|
754
|
+
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
755
|
+
transform: ${({$open:e,$position:o})=>go(e,o)};
|
|
756
|
+
transition:
|
|
757
|
+
opacity 0.15s ease,
|
|
758
|
+
transform 0.15s ease,
|
|
759
|
+
visibility 0.15s;
|
|
760
|
+
`,Fe=A.newClassNameGetter("dropdown"),Be=4,Ci=100,wi=({align:e="left",children:o,className:r,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:p,trigger:h,...u})=>{const[f,x]=g.useState(!1),[k,S]=g.useState({top:0,left:0}),[$,y]=g.useState("bottom"),O=g.useRef(null),L=g.useRef(null),b=g.useRef(null),z=c!==void 0,j=z?c:f,N=g.useCallback(()=>{var D,Y;if(!L.current)return;const T=L.current.getBoundingClientRect(),C=((D=b.current)==null?void 0:D.offsetHeight)??Ci,_=((Y=b.current)==null?void 0:Y.offsetWidth)??160,v=window.innerHeight-T.bottom-Be,E=T.top-Be,w=v<C&&E>v?"top":"bottom";if(y(w),d){let M;e==="left"?M=T.left:M=T.right-_;const H=w==="bottom"?T.bottom+Be:T.top-C-Be;S({top:H,left:M})}},[e,d]),X=g.useCallback(()=>{z?j?n==null||n():l==null||l():x(T=>{const C=!T;return C?l==null||l():n==null||n(),C})},[z,j,n,l]),P=g.useCallback(()=>{z||x(!1),n==null||n()},[z,n]);g.useLayoutEffect(()=>{j&&N()},[j,N]),g.useEffect(()=>{const T=E=>{const w=E.target,D=O.current&&!O.current.contains(w),Y=b.current&&!b.current.contains(w);d?D&&Y&&P():D&&P()},C=E=>{E.key==="Escape"&&P()},_=()=>{j&&d&&N()},v=()=>{j&&d&&N()};return j&&(document.addEventListener("mousedown",T),document.addEventListener("keydown",C),d&&(window.addEventListener("scroll",_,!0),window.addEventListener("resize",v))),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",C),window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",v)}},[j,P,d,N]);const B=d?be.createPortal(a.jsx(mi,{ref:b,$open:j,$position:$,className:Fe("content",i==null?void 0:i.content),style:{top:k.top,left:k.left},children:o}),d):a.jsx(vi,{ref:b,$align:e,$open:j,$position:$,className:Fe("content",i==null?void 0:i.content),children:o});return a.jsxs(Si,{...u,ref:p??O,className:Fe("container",r),children:[a.jsx(yi,{ref:L,onClick:X,className:Fe("trigger",i==null?void 0:i.trigger),children:g.cloneElement(h)}),B]})},Ri=s.div`
|
|
631
761
|
display: flex;
|
|
632
762
|
flex-direction: column;
|
|
633
|
-
gap:
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
763
|
+
gap: 12px;
|
|
764
|
+
`,ki=s.div`
|
|
765
|
+
width: ${({$size:e})=>e}px;
|
|
766
|
+
height: ${({$size:e})=>e}px;
|
|
767
|
+
border-radius: 8px;
|
|
768
|
+
border: 1px dashed ${t.COLORS.gray};
|
|
769
|
+
overflow: hidden;
|
|
770
|
+
display: flex;
|
|
771
|
+
align-items: center;
|
|
772
|
+
justify-content: center;
|
|
773
|
+
background-color: ${t.COLORS.white};
|
|
774
|
+
|
|
775
|
+
img {
|
|
776
|
+
width: 100%;
|
|
777
|
+
height: 100%;
|
|
778
|
+
object-fit: cover;
|
|
779
|
+
}
|
|
780
|
+
`,Li=s.span`
|
|
781
|
+
font-size: 12px;
|
|
782
|
+
color: ${t.COLORS["iron-grey"]};
|
|
783
|
+
`,zi=e=>`
|
|
784
|
+
.${e} {
|
|
785
|
+
padding: 7px 16px;
|
|
786
|
+
font-size: 14px;
|
|
787
|
+
outline: 0;
|
|
788
|
+
border: 0;
|
|
789
|
+
background-color: #2F7FEF;
|
|
790
|
+
color: #FFFFFF;
|
|
791
|
+
border-radius: 20px;
|
|
792
|
+
user-select: none;
|
|
793
|
+
cursor: pointer;
|
|
794
|
+
-moz-user-select: none;
|
|
795
|
+
-webkit-user-select: none;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.${e}:active {
|
|
799
|
+
transform: translate(0, 1px);
|
|
800
|
+
}
|
|
801
|
+
`,Pi=e=>`
|
|
802
|
+
.${e} {
|
|
803
|
+
display: flex;
|
|
804
|
+
flex: 1 1 auto;
|
|
805
|
+
background: #33393F;
|
|
806
|
+
overflow: hidden;
|
|
807
|
+
align-items: center;
|
|
808
|
+
justify-content: center;
|
|
809
|
+
position: relative;
|
|
810
|
+
width: 500px;
|
|
811
|
+
height: 500px;
|
|
812
|
+
max-width: 100%;
|
|
813
|
+
max-height: 60vh;
|
|
814
|
+
min-height: 250px;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
@media (max-width: 540px) {
|
|
818
|
+
.${e} {
|
|
819
|
+
width: 100%;
|
|
820
|
+
height: auto;
|
|
821
|
+
aspect-ratio: 1;
|
|
822
|
+
max-height: 70vh;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
`,ji=e=>`
|
|
826
|
+
.${e} {
|
|
827
|
+
padding: 7px 16px;
|
|
828
|
+
font-size: 14px;
|
|
829
|
+
outline: 0;
|
|
830
|
+
border: 0;
|
|
831
|
+
background-color: #E8EFF7;
|
|
832
|
+
color: #768BA7;
|
|
833
|
+
border-radius: 20px;
|
|
834
|
+
cursor: pointer;
|
|
835
|
+
user-select: none;
|
|
836
|
+
-moz-user-select: none;
|
|
837
|
+
-webkit-user-select: none;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.${e}:active {
|
|
841
|
+
transform: translate(0, 1px);
|
|
842
|
+
}
|
|
843
|
+
`,Ei=e=>`
|
|
844
|
+
.${e} {
|
|
845
|
+
display: flex;
|
|
846
|
+
flex-direction: column;
|
|
847
|
+
background-color: #FFFFFF;
|
|
848
|
+
border-radius: 6px;
|
|
849
|
+
box-shadow: 0 4px 16px rgba(77, 96, 124, 0.2);
|
|
850
|
+
max-width: 100%;
|
|
851
|
+
max-height: 100%;
|
|
852
|
+
overflow: hidden;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
@media (max-width: 540px) {
|
|
856
|
+
.${e} {
|
|
857
|
+
width: 100%;
|
|
858
|
+
border-radius: 8px;
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
`,Ti=e=>`
|
|
862
|
+
.${e} {
|
|
863
|
+
display: flex;
|
|
864
|
+
justify-content: flex-end;
|
|
865
|
+
gap: 10px;
|
|
866
|
+
align-items: center;
|
|
867
|
+
height: 60px;
|
|
868
|
+
flex: 0 0 auto;
|
|
869
|
+
padding: 0 20px;
|
|
870
|
+
border-top: 1px solid #EEE;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
@media (max-width: 540px) {
|
|
874
|
+
.${e} {
|
|
875
|
+
height: 56px;
|
|
876
|
+
padding: 0 12px;
|
|
877
|
+
gap: 8px;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
`,Ni=e=>`
|
|
881
|
+
.${e} {
|
|
882
|
+
display: flex;
|
|
883
|
+
justify-content: flex-start;
|
|
884
|
+
gap: 10px;
|
|
885
|
+
align-items: center;
|
|
886
|
+
height: 60px;
|
|
887
|
+
flex: 0 0 auto;
|
|
888
|
+
padding: 0 20px;
|
|
889
|
+
border-top-left-radius: 6px;
|
|
890
|
+
border-top-right-radius: 6px;
|
|
891
|
+
border-bottom: 1px solid #EEE;
|
|
892
|
+
overflow: hidden;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
@media (max-width: 540px) {
|
|
896
|
+
.${e} {
|
|
897
|
+
height: 48px;
|
|
898
|
+
padding: 0 12px;
|
|
899
|
+
font-size: 14px;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
`,Ii=e=>`
|
|
903
|
+
.${e} {
|
|
904
|
+
display: block;
|
|
905
|
+
z-index: 101;
|
|
906
|
+
outline: 1px dashed #aaa;
|
|
907
|
+
background-color: transparent;
|
|
908
|
+
cursor: move;
|
|
909
|
+
-webkit-user-select: none;
|
|
910
|
+
-moz-user-select: none;
|
|
911
|
+
-ms-user-select: none;
|
|
912
|
+
user-select: none;
|
|
913
|
+
left: 0;
|
|
914
|
+
top: 0;
|
|
915
|
+
bottom: 0;
|
|
916
|
+
right: 0;
|
|
917
|
+
position: absolute;
|
|
918
|
+
touch-action: none;
|
|
919
|
+
}
|
|
920
|
+
`,Ai=e=>`
|
|
921
|
+
.${e} {
|
|
922
|
+
position: absolute;
|
|
923
|
+
z-index: 2;
|
|
924
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
925
|
+
touch-action: none;
|
|
926
|
+
}
|
|
927
|
+
`,Di=e=>`
|
|
928
|
+
.${e} {
|
|
929
|
+
position: absolute;
|
|
930
|
+
z-index: 3;
|
|
931
|
+
touch-action: none;
|
|
932
|
+
}
|
|
933
|
+
`,Mi=e=>`
|
|
934
|
+
.${e} {
|
|
935
|
+
backface-visibility: hidden;
|
|
936
|
+
perspective: 1000px;
|
|
937
|
+
max-inline-size: unset !important;
|
|
938
|
+
max-block-size: unset !important;
|
|
939
|
+
}
|
|
940
|
+
`,_i=e=>`
|
|
941
|
+
.${e} {
|
|
942
|
+
position: absolute;
|
|
943
|
+
z-index: 100;
|
|
944
|
+
left: 0;
|
|
945
|
+
top: 0;
|
|
946
|
+
right: 0;
|
|
947
|
+
bottom: 0;
|
|
948
|
+
overflow: hidden;
|
|
949
|
+
border-radius: 50%;
|
|
950
|
+
}
|
|
951
|
+
`,Fi={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},Bi={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Ye=(e,o)=>{const r=Fi[o],{h:i,v:n}=Bi[o];return`
|
|
952
|
+
.${e} {
|
|
953
|
+
display: block;
|
|
954
|
+
z-index: 102;
|
|
955
|
+
background-color: rgba(255, 255, 255, .6);
|
|
956
|
+
cursor: ${r};
|
|
957
|
+
-webkit-user-select: none;
|
|
958
|
+
-moz-user-select: none;
|
|
959
|
+
-ms-user-select: none;
|
|
960
|
+
user-select: none;
|
|
961
|
+
${i}: -3px;
|
|
962
|
+
${n}: -3px;
|
|
963
|
+
position: absolute;
|
|
964
|
+
width: 5px;
|
|
965
|
+
height: 5px;
|
|
966
|
+
touch-action: none;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
@media (max-width: 540px), (pointer: coarse) {
|
|
970
|
+
.${e} {
|
|
971
|
+
width: 24px;
|
|
972
|
+
height: 24px;
|
|
973
|
+
${i}: -12px;
|
|
974
|
+
${n}: -12px;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
`},Yi=e=>`
|
|
978
|
+
.${e} {
|
|
979
|
+
display: flex;
|
|
980
|
+
align-items: center;
|
|
981
|
+
justify-content: center;
|
|
982
|
+
background-color: rgba(0, 0, 0, .4);
|
|
983
|
+
width: 100vw;
|
|
984
|
+
height: 100vh;
|
|
985
|
+
height: 100dvh;
|
|
986
|
+
position: fixed;
|
|
987
|
+
left: 0;
|
|
988
|
+
top: 0;
|
|
989
|
+
z-index: 1000;
|
|
990
|
+
overflow-y: auto;
|
|
991
|
+
box-sizing: border-box;
|
|
992
|
+
padding: 16px;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
@media (max-width: 540px) {
|
|
996
|
+
.${e} {
|
|
997
|
+
padding: 8px;
|
|
998
|
+
align-items: flex-start;
|
|
999
|
+
padding-top: env(safe-area-inset-top, 8px);
|
|
1000
|
+
padding-bottom: env(safe-area-inset-bottom, 8px);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
`,Hi=e=>`
|
|
1004
|
+
.${e} {
|
|
1005
|
+
backface-visibility: hidden;
|
|
1006
|
+
user-select: none;
|
|
1007
|
+
perspective: 1000px;
|
|
1008
|
+
overflow: hidden;
|
|
1009
|
+
display: block;
|
|
1010
|
+
transform: translateZ(0);
|
|
1011
|
+
width: auto;
|
|
1012
|
+
-webkit-user-drag: none;
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
z-index: 1;
|
|
1015
|
+
}
|
|
1016
|
+
`,Gi=e=>{let o=5381;for(let r=0;r<e.length;r++)o=(o<<5)+o^e.charCodeAt(r);return Math.abs(o).toString(36)},G=e=>`hq-cropper__${Gi(e)}`,W=e=>e||[],V=(e,o)=>{if(o)for(const r of o)e.classList.add(r)},Wi=e=>{const o={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},r=`
|
|
1017
|
+
${zi(o.applyButton[0])}
|
|
1018
|
+
${Pi(o.body[0])}
|
|
1019
|
+
${ji(o.cancelButton[0])}
|
|
1020
|
+
${Ei(o.container[0])}
|
|
1021
|
+
${Ti(o.footer[0])}
|
|
1022
|
+
${Ni(o.header[0])}
|
|
1023
|
+
${Ii(o.handlerMove[0])}
|
|
1024
|
+
${Ai(o.portalArea[0])}
|
|
1025
|
+
${Di(o.portal[0])}
|
|
1026
|
+
${Mi(o.previewImage[0])}
|
|
1027
|
+
${_i(o.preview[0])}
|
|
1028
|
+
${Ye(o.handlerResizeBottomLeft[0],"bl")}
|
|
1029
|
+
${Ye(o.handlerResizeBottomRight[0],"br")}
|
|
1030
|
+
${Ye(o.handlerResizeTopLeft[0],"tl")}
|
|
1031
|
+
${Ye(o.handlerResizeTopRight[0],"tr")}
|
|
1032
|
+
${Yi(o.root[0])}
|
|
1033
|
+
${Hi(o.sourceImage[0])}
|
|
1034
|
+
`,i=document.createElement("style");return i.innerHTML=r,document.getElementsByTagName("head")[0].prepend(i),o};let Vi=0;const Ui=e=>{const o=new Map,r=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(o.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...r}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(r[n]=l)}},subscribe:(i,n)=>{const l=String(++Vi),c=o.get(i)||[];return o.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of o.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){o.set(n,c);return}}},unsubscribeAll:()=>{o.clear()}}},xt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},Xi=(e={},o={})=>Ui({...xt,config:{...xt.config,...e},css:Wi(o)}),qi=(e,o)=>{var x;const r=e(),i=document.querySelector(`.${(x=r.css)==null?void 0:x.body[0]}`);if(!i)return r.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=o.width/o.height;let p,h,u=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(o.height/o.width),u=(l-h)/2),{width:p,height:h,left:f,top:u}},Ki=(e,o,r)=>{const[i,n]=o,l=i+e>r.width?(r.width-e)/2:i,c=n+e>r.height?(r.height-e)/2:n;return[l,c]},Zi=(e,o)=>{const{config:r}=e(),i=Math.min(o.width,o.height)-r.framePadding*2,n=r.portalSize>i?i:r.portalSize;if(Array.isArray(r.portalPosition)&&r.portalPosition.length===2){const[l,c]=Ki(n,r.portalPosition,o);return{left:l,top:c,size:n}}return r.portalPosition==="center"?{size:n,left:(o.width-n)/2,top:(o.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const Ji=e=>{var i;const o=e(),r=document.createElement("span");return V(r,(i=o.css)==null?void 0:i.handlerMove),r.setAttribute("data-action",te.MOVE),r},Qi=e=>{var i;const o=e(),r=document.createElement("span");return V(r,(i=o.css)==null?void 0:i.handlerResizeBottomLeft),r.setAttribute("data-action",te.RESIZE_BL),r},en=e=>{var i;const o=e(),r=document.createElement("span");return V(r,(i=o.css)==null?void 0:i.handlerResizeBottomRight),r.setAttribute("data-action",te.RESIZE_BR),r},tn=e=>{var i;const o=e(),r=document.createElement("span");return V(r,(i=o.css)==null?void 0:i.handlerResizeTopLeft),r.setAttribute("data-action",te.RESIZE_TL),r},on=e=>{var i;const o=e(),r=document.createElement("span");return V(r,(i=o.css)==null?void 0:i.handlerResizeTopRight),r.setAttribute("data-action",te.RESIZE_TR),r},rn=e=>{var i;const o=e(),r=document.createElement("img");return V(r,(i=o.css)==null?void 0:i.previewImage),r},nn=e=>{var i;const o=e(),r=document.createElement("div");return V(r,(i=o.css)==null?void 0:i.preview),r.appendChild(rn(e)),r},an=e=>{var i;const o=e(),r=document.createElement("div");return V(r,(i=o.css)==null?void 0:i.portal),r.appendChild(nn(e)),r.appendChild(Ji(e)),r.appendChild(tn(e)),r.appendChild(on(e)),r.appendChild(Qi(e)),r.appendChild(en(e)),r},ln=e=>{var i;const o=e(),r=document.createElement("div");return V(r,(i=o.css)==null?void 0:i.portalArea),r.appendChild(an(e)),r},dn=e=>{var i;const o=e(),r=document.createElement("img");return V(r,(i=o.css)==null?void 0:i.sourceImage),r.setAttribute("alt","source"),r.setAttribute("crossOrigin","anonymous"),r.setAttribute("draggable","false"),r.setAttribute("src",o.sourceBase64),r},cn=e=>{var i;const o=e(),r=document.createElement("div");return V(r,(i=o.css)==null?void 0:i.body),r.appendChild(dn(e)),r.appendChild(ln(e)),r},sn=(e,o)=>{var n;const r=e(),i=document.createElement("div");return V(i,(n=r.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=r.config.applyButtonLabel,i.addEventListener("click",o),i},pn=(e,o)=>{var n;const r=e(),i=document.createElement("div");return V(i,(n=r.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=r.config.cancelButtonLabel,i.addEventListener("click",o),i},un=(e,o,r)=>{var l;const i=e(),n=document.createElement("div");return V(n,(l=i.css)==null?void 0:l.footer),n.appendChild(pn(e,r)),n.appendChild(sn(e,o)),n},hn=e=>{var i;const o=e(),r=document.createElement("div");return V(r,(i=o.css)==null?void 0:i.header),r},bn=(e,o,r)=>{var l;const i=e(),n=document.createElement("div");return V(n,(l=i.css)==null?void 0:l.container),n.appendChild(hn(e)),n.appendChild(cn(e)),n.appendChild(un(e,o,r)),n},gn=(e,o,r)=>{var l;const i=e(),n=document.createElement("div");V(n,(l=i.css)==null?void 0:l.root),n.appendChild(bn(e,o,r)),document.body.appendChild(n)},fn=e=>{const o=document.createElement("input");return o.style.display="none",o.setAttribute("type","file"),o.setAttribute("accept","image/x-png,image/jpeg"),o.addEventListener("change",e,!1),document.body.appendChild(o),o},je=new Map,xn={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},ue=(e,o)=>{if(je.has(e))return je.get(e);if(!o)return null;const r=o[xn[e]],i=document.querySelector(`.${r[0]}`);return je.set(e,i),i},On=()=>{je.clear()},$n=()=>{je.clear()},Sn=(e,o)=>{const r=ue("header",o.css);r&&(r.innerText=e)},yn=(e,o)=>{const r=ue("sourceImage",o.css);r&&(r.setAttribute("src",e),r.style.height=`${o.frame.height}px`,r.style.width=`${o.frame.width}px`,r.style.left=`${o.frame.left}px`,r.style.top=`${o.frame.top}px`);const i=ue("portalArea",o.css);i&&(i.style.height=`${o.frame.height}px`,i.style.width=`${o.frame.width}px`,i.style.left=`${o.frame.left}px`,i.style.top=`${o.frame.top}px`);const n=ue("portal",o.css);n&&(n.style.width=`${o.portal.size}px`,n.style.height=`${o.portal.size}px`,n.style.left=`${o.portal.left}px`,n.style.top=`${o.portal.top}px`);const l=ue("previewImage",o.css);l&&(l.setAttribute("src",e),l.style.height=`${o.frame.height}px`,l.style.width=`${o.frame.width}px`,l.style.marginLeft=`-${o.portal.left}px`,l.style.marginTop=`-${o.portal.top}px`)},vn=(e,o)=>{const r=ue("portal",o.css);r&&(r.style.left=`${e.left}px`,r.style.top=`${e.top}px`,r.style.width=`${e.size}px`,r.style.height=`${e.size}px`);const i=ue("previewImage",o.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},it=1,mn=e=>{var k,S;const o=e(),r=document.createElement("canvas"),i=o.frame.width||it,n=o.frame.height||it,l=o.sourceWidth/i,c=o.sourceHeight/n,d=o.portal.left*l,p=o.portal.top*c,h=Math.max(o.portal.size*Math.min(l,c),it),u=o.config.outputSize>0?o.config.outputSize:h;r.width=u,r.height=u;const f=document.querySelector(`.${(k=o.css)==null?void 0:k.sourceImage[0]}`);f&&((S=r.getContext("2d"))==null||S.drawImage(f,d,p,h,h,0,0,u,u));const x=r.toDataURL(`image/${o.config.type}`,o.config.compression);return new Promise(($,y)=>{try{r.toBlob(O=>{if(r.remove(),!O){y(new Error(`Failed to create blob for type: image/${o.config.type}`));return}$([x,O])},`image/${o.config.type}`,o.config.compression)}catch(O){r.remove(),y(O)}})},Cn=(e,o,r)=>{const{emitted:i,portal:n,frame:l,config:c}=o();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,u=l.width-c.framePadding-n.size,f=c.framePadding,x=l.height-c.framePadding-n.size;d<h&&(d=h),d>u&&(d=u),p<f&&(p=f),p>x&&(p=x),r({portal:{...n,left:d,top:p}})},wn=(e,o,r)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=o(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let u=n.size+Math.max(p,h);return u<d.minPortalSize&&(u=d.minPortalSize),n.top+u>c.height-d.framePadding&&(u=c.height-n.top-d.framePadding),n.left+u>c.width-d.framePadding&&(u=c.width-n.left-d.framePadding),r({portal:{...l,size:u}})}case te.RESIZE_TR:{let u=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return u<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,u=d.minPortalSize),n.left+u>c.width-d.framePadding&&(u=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(u=n.top+n.size,f=d.framePadding),r({portal:{...l,top:f,size:u}})}case te.RESIZE_TL:{const u=Math.min(p,h);let f=n.size-u,x=n.left+u,k=n.top+u;if(f<d.minPortalSize){const S=n.size-d.minPortalSize;f=d.minPortalSize,x=n.left+S,k=n.top+S}if(k<d.framePadding){const S=d.framePadding-k;k=d.framePadding,x=x+S,f=f-S}if(x<d.framePadding){const S=d.framePadding-x;x=d.framePadding,k=k+S,f=f-S}return r({portal:{...l,top:k,left:x,size:f}})}case te.RESIZE_BL:{let u=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return u<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,u=d.minPortalSize),u+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,u=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,u=n.left+n.size-d.framePadding),r({portal:{...l,left:f,size:u}})}default:return}},Ft=e=>{if("touches"in e&&e.touches.length>0){const r=e.touches[0];return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const r=e.changedTouches[0];return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}}const o=e;return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}},Rn=(e,o)=>{var x,k,S;const r=e(),i=document.querySelector(`.${(x=r.css)==null?void 0:x.portal[0]}`),n=document.querySelector(`.${(k=r.css)==null?void 0:k.portalArea[0]}`),l=document.querySelector(`.${(S=r.css)==null?void 0:S.root[0]}`);let c=null,d=null;const p=$=>{$.preventDefault();const{portal:y}=e(),O=Ft($);if($.target){const L=$.target.getAttribute("data-action"),b={X:O.pageX,Y:O.pageY,left:y.left,top:y.top,size:y.size};o({action:L,emitted:b})}},h=()=>{const{action:$}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,$&&o({action:null})},u=()=>{if(c=null,!d)return;const $=d;d=null;const{action:y}=e();if(y)switch(y){case te.MOVE:Cn($,e,o);break;default:wn($,e,o)}},f=$=>{const{action:y}=e();y&&($.preventDefault(),d=Ft($),c===null&&(c=requestAnimationFrame(u)))};return l&&(l.addEventListener("mouseup",h),l.addEventListener("touchend",h),l.addEventListener("touchcancel",h)),i&&(i.addEventListener("mousedown",p),i.addEventListener("touchstart",p,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",h),l.removeEventListener("touchend",h),l.removeEventListener("touchcancel",h)),i&&(i.removeEventListener("mousedown",p),i.removeEventListener("touchstart",p)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Bt=1024*1024,kn=(e,o)=>{if(!o.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${o.allowedTypes.join(", ")}`;if(o.maxFileSize>0&&e.size>o.maxFileSize){const r=(o.maxFileSize/Bt).toFixed(2);return`File size (${(e.size/Bt).toFixed(2)}MB) exceeds maximum allowed size (${r}MB)`}return null},Ln=(e,o,r,i,n,l,c)=>{const d=O=>{c?c(O):console.error(`HqCropper: ${O}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=o(),u=kn(p,h);if(u){d(u),e.target.value="";return}const f=new FileReader;let x=null;const k=()=>{var b;const O=o(),L=document.querySelector(`.${(b=O.css)==null?void 0:b.root[0]}`);L&&(L.remove(),document.removeEventListener("keydown",S),x==null||x(),$n(),l(),r(xt))},S=O=>{O.key==="Escape"&&o().sourceBase64&&$(O)},$=O=>{O.preventDefault(),k()},y=O=>{O.preventDefault();const L=o();mn(o).then(([b,z])=>{i(b,z,L),$(O)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=O=>{const L=new Image;if(!O.target||typeof O.target.result!="string"){d("Can't load result image");return}L.src=O.target.result,L.onerror=()=>{d("Failed to load image")},L.onload=()=>{var j;gn(o,y,$),On(),n("fileName",Sn),n("sourceBase64",yn),n("portal",vn);const b=qi(o,L),z=Zi(o,b);r({frame:b,portal:z,fileName:p.name,sourceBase64:(j=O.target)==null?void 0:j.result,sourceHeight:L.height,sourceWidth:L.width}),x=Rn(o,r),document.addEventListener("keydown",S)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},zn=(e,o,r,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=Xi(o,r),p=fn(h=>Ln(h,n,l,e,c,d,i));return{open:()=>p.click()}},ae={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Yt="vacano-image-cropper-styles",Pn=`
|
|
1035
|
+
.vacano-cropper-root {
|
|
1036
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
1037
|
+
backdrop-filter: blur(4px);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.vacano-cropper-header {
|
|
1041
|
+
border-bottom: 1px solid ${t.COLORS.gray};
|
|
1042
|
+
padding: 16px 20px;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.vacano-cropper-footer {
|
|
1046
|
+
border-top: 1px solid ${t.COLORS.gray};
|
|
1047
|
+
padding: 16px 20px;
|
|
1048
|
+
gap: 12px;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.vacano-cropper-cancel-button {
|
|
1052
|
+
padding: 8px 16px;
|
|
1053
|
+
border-radius: 16px;
|
|
1054
|
+
border: 1px solid ${t.COLORS.gray};
|
|
1055
|
+
background-color: ${t.COLORS.white};
|
|
1056
|
+
color: ${t.COLORS.black};
|
|
1057
|
+
font-size: 14px;
|
|
1058
|
+
font-weight: 500;
|
|
1059
|
+
cursor: pointer;
|
|
1060
|
+
transition: background-color 0.2s;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.vacano-cropper-cancel-button:hover {
|
|
1064
|
+
background-color: ${t.COLORS.gray};
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
.vacano-cropper-apply-button {
|
|
1068
|
+
padding: 8px 16px;
|
|
1069
|
+
border-radius: 16px;
|
|
1070
|
+
border: none;
|
|
1071
|
+
background-color: ${t.COLORS.black};
|
|
1072
|
+
color: ${t.COLORS.white};
|
|
1073
|
+
font-size: 14px;
|
|
1074
|
+
font-weight: 500;
|
|
1075
|
+
cursor: pointer;
|
|
1076
|
+
transition: background-color 0.2s;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
.vacano-cropper-apply-button:hover {
|
|
1080
|
+
background-color: ${t.COLORS["iron-grey"]};
|
|
1081
|
+
}
|
|
1082
|
+
`,jn=()=>{if(typeof document>"u"||document.getElementById(Yt))return;const e=document.createElement("style");e.id=Yt,e.textContent=Pn,document.head.appendChild(e)},En={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},fo=(e={})=>{const{allowedTypes:o=ae.allowedTypes,applyLabel:r=ae.applyLabel,cancelLabel:i=ae.cancelLabel,compression:n=ae.compression,maxFileSize:l=ae.maxFileSize,onCrop:c,onError:d,outputSize:p=ae.outputSize,portalSize:h=ae.portalSize,type:u=ae.type}=e,f=g.useRef(null);return{open:g.useCallback(()=>{f.current||(jn(),f.current=zn((k,S,$)=>{S&&(c==null||c({base64:k,blob:S,state:$}))},{portalSize:h,outputSize:p,compression:n,type:u,maxFileSize:l,allowedTypes:o,applyButtonLabel:r,cancelButtonLabel:i},En,k=>{d==null||d({code:"CROPPER_ERROR",message:k})})),f.current.open()},[o,r,i,n,l,c,d,p,h,u])}},nt=A.newClassNameGetter("image-cropper"),Tn=({allowedTypes:e,applyLabel:o,buttonLabel:r="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:h,outputSize:u,portalSize:f,previewSize:x=120,ref:k,type:S,value:$,...y})=>{const[O,L]=g.useState($??null),{open:b}=fo({allowedTypes:e,applyLabel:o,cancelLabel:i,compression:c,maxFileSize:d,onCrop:z=>{L(z.base64),p==null||p(z)},onError:h,outputSize:u,portalSize:f,type:S});return a.jsxs(Ri,{...y,ref:k,className:nt("container",n),children:[a.jsx(ki,{$size:x,className:nt("preview",l==null?void 0:l.preview),children:O?a.jsx("img",{src:O,alt:"Preview"}):a.jsx(Li,{children:"No image"})}),a.jsx(Te,{variant:"system",onClick:b,className:nt("button",l==null?void 0:l.button),style:{width:x},children:r})]})},Ht={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},Gt={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},re=e=>Gt[e]??Gt.normal,at=e=>Ht[e]??Ht.default,Nn=s.div`
|
|
1083
|
+
display: grid;
|
|
1084
|
+
flex-direction: column;
|
|
1085
|
+
gap: 2px;
|
|
1086
|
+
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1087
|
+
`,In=s(Se)`
|
|
1088
|
+
margin-left: 6px;
|
|
1089
|
+
`,An=s.input`
|
|
1090
|
+
flex: 1;
|
|
1091
|
+
min-width: 0;
|
|
1092
|
+
outline: none;
|
|
1093
|
+
font-size: 14px;
|
|
1094
|
+
font-weight: 500;
|
|
1095
|
+
height: ${e=>at(e.$size).height};
|
|
1096
|
+
padding: ${e=>at(e.$size).padding};
|
|
1097
|
+
border-radius: ${e=>at(e.$size).radius};
|
|
1098
|
+
|
|
1099
|
+
color: ${e=>re(e.$variant).color.static};
|
|
1100
|
+
border: 1px solid ${e=>re(e.$variant).border.static};
|
|
1101
|
+
background-color: ${e=>re(e.$variant).background.static};
|
|
1102
|
+
|
|
1103
|
+
&::placeholder {
|
|
1104
|
+
color: ${e=>re(e.$variant).placeholder.static};
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
&:disabled {
|
|
1108
|
+
cursor: not-allowed;
|
|
1109
|
+
color: ${e=>re(e.$variant).color.disabled};
|
|
1110
|
+
background-color: ${e=>re(e.$variant).background.disabled};
|
|
1111
|
+
border-color: ${e=>re(e.$variant).border.disabled};
|
|
1112
|
+
|
|
1113
|
+
&::placeholder {
|
|
1114
|
+
color: ${e=>re(e.$variant).placeholder.disabled};
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
&:focus-visible {
|
|
1119
|
+
outline: 2px solid ${e=>re(e.$variant).focus};
|
|
1120
|
+
}
|
|
1121
|
+
`,lt=A.newClassNameGetter("input"),xo=({className:e,classnames:o,disabled:r,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(Nn,{className:lt("container",e),$fullWidth:!!i,children:[a.jsx(In,{variant:d,className:lt("label",o==null?void 0:o.label),children:n}),a.jsx(An,{...p,ref:l,disabled:r,$size:c,$variant:d,className:lt("input",o==null?void 0:o.input)})]}),Dn=s.div`
|
|
1122
|
+
position: fixed;
|
|
1123
|
+
inset: 0;
|
|
1124
|
+
z-index: 1000;
|
|
1125
|
+
display: flex;
|
|
1126
|
+
align-items: center;
|
|
1127
|
+
justify-content: center;
|
|
1128
|
+
background-color: ${t.alpha(t.COLORS.black,50)};
|
|
1129
|
+
animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
|
|
1130
|
+
`,Mn=s.div`
|
|
1131
|
+
position: relative;
|
|
1132
|
+
z-index: 1001;
|
|
1133
|
+
width: ${e=>e.$width};
|
|
1134
|
+
max-width: calc(100vw - 32px);
|
|
1135
|
+
max-height: calc(100vh - 32px);
|
|
1136
|
+
overflow: auto;
|
|
1137
|
+
background-color: ${t.COLORS.white};
|
|
1138
|
+
border-radius: 16px;
|
|
1139
|
+
box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
|
|
1140
|
+
animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
|
|
1141
|
+
`,Wt=A.newClassNameGetter("modal"),Oo=({animated:e,children:o,className:r,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?be.createPortal(a.jsx(Dn,{className:Wt("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(Mn,{...d,ref:l,className:Wt("content",r,i==null?void 0:i.content),$animated:!!e,$width:c,children:o})}),document.body):null,$o={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},_n=s.div`
|
|
1142
|
+
display: flex;
|
|
1143
|
+
flex-direction: column;
|
|
1144
|
+
gap: 4px;
|
|
1145
|
+
`,Fn=s(Se)`
|
|
1146
|
+
margin-left: 6px;
|
|
1147
|
+
color: ${e=>$o[e.$variant].label};
|
|
1148
|
+
`,Bn=s.button`
|
|
1149
|
+
display: flex;
|
|
1150
|
+
flex-wrap: wrap;
|
|
1151
|
+
align-items: center;
|
|
1152
|
+
gap: 6px;
|
|
1153
|
+
min-height: 44px;
|
|
1154
|
+
padding: 8px 12px;
|
|
1155
|
+
border: 1px dashed ${e=>$o[e.$variant].border};
|
|
1156
|
+
border-radius: 8px;
|
|
1157
|
+
background: ${t.COLORS.white};
|
|
1158
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1159
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
1160
|
+
transition: border-color 0.15s ease;
|
|
1161
|
+
text-align: left;
|
|
1162
|
+
|
|
1163
|
+
&:hover:not(:disabled) {
|
|
1164
|
+
border-color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS.black};
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
&:focus-visible {
|
|
1168
|
+
outline: 2px solid
|
|
1169
|
+
${e=>e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
|
|
1170
|
+
outline-offset: 2px;
|
|
1171
|
+
}
|
|
1172
|
+
`,Yn=s.span`
|
|
1173
|
+
color: ${t.COLORS["iron-grey"]};
|
|
1174
|
+
font-size: 14px;
|
|
1175
|
+
`,Hn=s.div`
|
|
1176
|
+
display: flex;
|
|
1177
|
+
flex-direction: column;
|
|
1178
|
+
padding: 20px;
|
|
1179
|
+
gap: 16px;
|
|
1180
|
+
`,Gn=s.div`
|
|
1181
|
+
display: flex;
|
|
1182
|
+
align-items: center;
|
|
1183
|
+
justify-content: space-between;
|
|
1184
|
+
`,Wn=s.h3`
|
|
1185
|
+
margin: 0;
|
|
1186
|
+
font-size: 18px;
|
|
1187
|
+
font-weight: 600;
|
|
1188
|
+
color: ${t.COLORS.black};
|
|
1189
|
+
`,Vn=s.div`
|
|
1190
|
+
display: flex;
|
|
1191
|
+
flex-direction: column;
|
|
1192
|
+
gap: 4px;
|
|
1193
|
+
min-height: 200px;
|
|
1194
|
+
max-height: 300px;
|
|
1195
|
+
overflow-y: auto;
|
|
1196
|
+
`,Un=s.label`
|
|
1197
|
+
display: flex;
|
|
1198
|
+
align-items: center;
|
|
1199
|
+
gap: 10px;
|
|
1200
|
+
padding: 10px 12px;
|
|
1201
|
+
border-radius: 8px;
|
|
1202
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1203
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
1204
|
+
transition: background-color 0.15s ease;
|
|
1205
|
+
|
|
1206
|
+
&:hover {
|
|
1207
|
+
background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
|
|
1208
|
+
}
|
|
1209
|
+
`,Xn=s.span`
|
|
1210
|
+
font-size: 14px;
|
|
1211
|
+
color: ${t.COLORS.black};
|
|
1212
|
+
`,qn=s.div`
|
|
1213
|
+
display: flex;
|
|
1214
|
+
align-items: center;
|
|
1215
|
+
justify-content: center;
|
|
1216
|
+
padding: 32px 16px;
|
|
1217
|
+
color: ${t.COLORS["iron-grey"]};
|
|
1218
|
+
font-size: 14px;
|
|
1219
|
+
text-align: center;
|
|
1220
|
+
`,Q=A.newClassNameGetter("multi-select"),Kn=({className:e,classnames:o,disabled:r=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:h="Select...",ref:u,searchPlaceholder:f="Search...",value:x,variant:k="normal",...S})=>{const[$,y]=g.useState(!1),[O,L]=g.useState(""),b=g.useMemo(()=>p.filter(C=>x.includes(C.value)),[p,x]),z=g.useMemo(()=>{if(!O.trim())return p;const C=O.toLowerCase().trim();return p.filter(_=>_.label.toLowerCase().includes(C))},[p,O]),j=l===1/0?b:b.slice(0,l),N=b.length-j.length,X=()=>{r||(y(!0),L(""))},P=()=>{y(!1),L("")},B=C=>{x.includes(C)?d(x.filter(_=>_!==C)):d([...x,C])},T=C=>{d(x.filter(_=>_!==C))};return a.jsxs(_n,{...S,ref:u,className:Q("container",e),children:[n&&a.jsx(Fn,{$variant:k,className:Q("label",o==null?void 0:o.trigger),children:n}),a.jsx(Bn,{type:"button",$variant:k,$disabled:r,disabled:r,onClick:X,className:Q("trigger",o==null?void 0:o.trigger),children:b.length===0?a.jsx(Yn,{className:Q("placeholder",o==null?void 0:o.placeholder),children:h}):a.jsxs(a.Fragment,{children:[j.map(C=>a.jsx(Xe,{deletable:!0,onDelete:()=>T(C.value),onClick:_=>_.stopPropagation(),className:Q("chip",o==null?void 0:o.chip),children:C.label},C.value)),N>0&&a.jsxs(Xe,{variant:"gray",onClick:C=>C.stopPropagation(),className:Q("chip",o==null?void 0:o.chip),children:["+",N]})]})}),a.jsx(Oo,{open:$,width:"400px",animated:!0,className:Q("modal",o==null?void 0:o.modal),children:a.jsxs(Hn,{children:[a.jsxs(Gn,{children:[a.jsx(Wn,{children:c}),a.jsx(Te,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:P})]}),a.jsx(xo,{type:"text",value:O,onChange:C=>L(C.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",o==null?void 0:o.search)}),a.jsx(Vn,{className:Q("options",o==null?void 0:o.options),children:z.length===0?a.jsx(qn,{className:Q("empty",o==null?void 0:o.empty),children:i}):z.map(C=>a.jsxs(Un,{$disabled:!!C.disabled,className:Q("option",o==null?void 0:o.option),children:[a.jsx(Ke,{checked:x.includes(C.value),disabled:C.disabled,onChange:()=>B(C.value)}),a.jsx(Xn,{children:C.label})]},C.value))})]})})]})},Vt={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},qe=e=>Vt[e]??Vt.light,Zn=s.div`
|
|
1221
|
+
display: flex;
|
|
1222
|
+
flex-direction: column;
|
|
1223
|
+
gap: 16px;
|
|
1224
|
+
padding: 12px;
|
|
1225
|
+
border: 1px dashed ${({$variant:e})=>qe(e).border};
|
|
1226
|
+
border-radius: 16px;
|
|
1227
|
+
background-color: ${({$variant:e})=>qe(e).background};
|
|
1228
|
+
`,Jn=s.div`
|
|
1229
|
+
display: flex;
|
|
1230
|
+
flex-direction: column;
|
|
1231
|
+
gap: 4px;
|
|
1232
|
+
`,Qn=s.div`
|
|
1233
|
+
font-size: 18px;
|
|
1234
|
+
font-weight: 600;
|
|
1235
|
+
line-height: 1.4;
|
|
1236
|
+
color: ${({$variant:e})=>qe(e).title};
|
|
1237
|
+
`,ea=s.div`
|
|
1238
|
+
font-size: 14px;
|
|
1239
|
+
line-height: 1.5;
|
|
1240
|
+
color: ${({$variant:e})=>qe(e).description};
|
|
1241
|
+
`,ta=s.div`
|
|
1242
|
+
display: flex;
|
|
1243
|
+
flex-wrap: wrap;
|
|
1244
|
+
gap: 8px;
|
|
1245
|
+
`,He=A.newClassNameGetter("panel"),oa=({children:e,className:o,classnames:r,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(Zn,{...d,ref:n,className:He("container",o),$variant:c,children:[p&&a.jsxs(Jn,{children:[l&&a.jsx(Qn,{className:He("title",r==null?void 0:r.title),$variant:c,children:l}),i&&a.jsx(ea,{className:He("description",r==null?void 0:r.description),$variant:c,children:i})]}),a.jsx(ta,{className:He("content",r==null?void 0:r.content),children:e})]})},Ot={compact:{height:4,radius:2},default:{height:8,radius:4}},ra=s.div`
|
|
1246
|
+
width: 100%;
|
|
1247
|
+
height: ${({$size:e})=>Ot[e].height}px;
|
|
1248
|
+
border-radius: ${({$size:e})=>Ot[e].radius}px;
|
|
1249
|
+
background-color: ${t.COLORS.gray};
|
|
1250
|
+
overflow: hidden;
|
|
1251
|
+
`,ia=s.div`
|
|
1252
|
+
height: 100%;
|
|
1253
|
+
width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
|
|
1254
|
+
border-radius: ${({$size:e})=>Ot[e].radius}px;
|
|
1255
|
+
background-color: ${t.COLORS.black};
|
|
1256
|
+
transition: width 0.2s ease;
|
|
1257
|
+
`,Ut=A.newClassNameGetter("progress"),na=({value:e,size:o="default",className:r,classnames:i,ref:n,...l})=>a.jsx(ra,{...l,ref:n,$size:o,className:Ut("track",r,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(ia,{$size:o,$value:e,className:Ut("bar",i==null?void 0:i.bar)})}),Xt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},he=e=>Xt[e]??Xt.normal,aa=s.label`
|
|
1258
|
+
display: inline-flex;
|
|
1259
|
+
align-items: center;
|
|
1260
|
+
gap: 8px;
|
|
1261
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1262
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
1263
|
+
|
|
1264
|
+
&:has(input:focus-visible) > span:first-of-type {
|
|
1265
|
+
box-shadow: 0 0 0 2px ${e=>he(e.$variant).box.focusShadow};
|
|
1266
|
+
}
|
|
1267
|
+
`,la=s.input`
|
|
1268
|
+
position: absolute;
|
|
1269
|
+
opacity: 0;
|
|
1270
|
+
width: 0;
|
|
1271
|
+
height: 0;
|
|
1272
|
+
pointer-events: none;
|
|
1273
|
+
`,da=s.span`
|
|
1274
|
+
display: inline-flex;
|
|
1275
|
+
align-items: center;
|
|
1276
|
+
justify-content: center;
|
|
1277
|
+
flex-shrink: 0;
|
|
1278
|
+
width: 18px;
|
|
1279
|
+
height: 18px;
|
|
1280
|
+
border-radius: 50%;
|
|
1281
|
+
border: 1.5px solid
|
|
1282
|
+
${e=>e.$checked?he(e.$variant).box.borderChecked:he(e.$variant).box.border};
|
|
1283
|
+
background-color: ${e=>e.$checked?he(e.$variant).box.backgroundChecked:he(e.$variant).box.background};
|
|
1284
|
+
transition:
|
|
1285
|
+
border-color 0.15s ease,
|
|
1286
|
+
background-color 0.15s ease,
|
|
1287
|
+
box-shadow 0.15s ease;
|
|
1288
|
+
`,ca=s.span`
|
|
1289
|
+
width: 8px;
|
|
1290
|
+
height: 8px;
|
|
1291
|
+
border-radius: 50%;
|
|
1292
|
+
background-color: ${e=>he(e.$variant).dot};
|
|
1293
|
+
opacity: ${e=>e.$visible?1:0};
|
|
1294
|
+
transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
|
|
1295
|
+
transition:
|
|
1296
|
+
opacity 0.15s ease,
|
|
1297
|
+
transform 0.15s ease;
|
|
1298
|
+
`,sa=s.span`
|
|
1299
|
+
font-size: 14px;
|
|
1300
|
+
font-weight: 500;
|
|
1301
|
+
line-height: 1.5;
|
|
1302
|
+
color: ${e=>he(e.$variant).label};
|
|
1303
|
+
user-select: none;
|
|
1304
|
+
`,Le=A.newClassNameGetter("radio"),St=({checked:e,className:o,classnames:r,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(aa,{className:Le("container",o),$disabled:!!i,$variant:d,children:[a.jsx(la,{...p,ref:c,type:"radio",className:Le("input",r==null?void 0:r.input),checked:e,disabled:i,onChange:l}),a.jsx(da,{className:Le("box",r==null?void 0:r.box),$checked:e,$variant:d,children:a.jsx(ca,{className:Le("dot",r==null?void 0:r.dot),$visible:e,$variant:d})}),n&&a.jsx(sa,{className:Le("label",r==null?void 0:r.label),$variant:d,children:n})]}),qt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},se=e=>qt[e]??qt.normal,pa=s.label`
|
|
1305
|
+
display: grid;
|
|
1306
|
+
grid-template-columns: auto 1fr;
|
|
1307
|
+
align-items: start;
|
|
1308
|
+
gap: 8px;
|
|
1309
|
+
padding: 12px;
|
|
1310
|
+
background-color: ${e=>{const o=se(e.$variant);return e.$disabled?o.background.disabled:e.$checked?o.backgroundChecked:o.background.static}};
|
|
1311
|
+
border: 1px solid
|
|
1312
|
+
${e=>{const o=se(e.$variant);return e.$disabled?o.border.disabled:e.$checked?o.borderChecked:o.border.static}};
|
|
1313
|
+
border-radius: 12px;
|
|
1314
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1315
|
+
transition:
|
|
1316
|
+
border-color 0.15s ease,
|
|
1317
|
+
background-color 0.15s ease;
|
|
1318
|
+
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1319
|
+
min-width: 0;
|
|
1320
|
+
|
|
1321
|
+
&:hover:not([data-disabled='true']) {
|
|
1322
|
+
border-color: ${e=>{const o=se(e.$variant);return e.$checked?o.borderChecked:o.border.hover}};
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
&:has(:focus-visible) {
|
|
1326
|
+
outline: none;
|
|
1327
|
+
box-shadow: 0 0 0 3px ${e=>se(e.$variant).focusRing};
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.vacano_radio_container {
|
|
1331
|
+
pointer-events: none;
|
|
1332
|
+
}
|
|
1333
|
+
`,ua=s.input`
|
|
1334
|
+
position: absolute;
|
|
1335
|
+
width: 1px;
|
|
1336
|
+
height: 1px;
|
|
1337
|
+
margin: -1px;
|
|
1338
|
+
padding: 0;
|
|
1339
|
+
overflow: hidden;
|
|
1340
|
+
clip: rect(0, 0, 0, 0);
|
|
1341
|
+
white-space: nowrap;
|
|
1342
|
+
border: 0;
|
|
1343
|
+
`,ha=s.div`
|
|
1344
|
+
display: flex;
|
|
1345
|
+
flex-direction: column;
|
|
1346
|
+
gap: 2px;
|
|
1347
|
+
min-width: 0;
|
|
1348
|
+
`,ba=s.span`
|
|
1349
|
+
font-size: 14px;
|
|
1350
|
+
font-weight: 500;
|
|
1351
|
+
line-height: 1.4;
|
|
1352
|
+
color: ${e=>se(e.$variant).label.static};
|
|
1353
|
+
|
|
641
1354
|
label[data-disabled='true'] & {
|
|
642
|
-
color: ${(
|
|
1355
|
+
color: ${e=>se(e.$variant).label.disabled};
|
|
643
1356
|
}
|
|
644
|
-
`,
|
|
1357
|
+
`,ga=s.span`
|
|
645
1358
|
font-size: 12px;
|
|
646
1359
|
font-weight: 400;
|
|
647
1360
|
line-height: 1.4;
|
|
648
|
-
color: ${
|
|
1361
|
+
color: ${e=>se(e.$variant).description.static};
|
|
649
1362
|
|
|
650
1363
|
label[data-disabled='true'] & {
|
|
651
|
-
color: ${(
|
|
1364
|
+
color: ${e=>se(e.$variant).description.disabled};
|
|
652
1365
|
}
|
|
653
|
-
`,
|
|
1366
|
+
`,Ge=A.newClassNameGetter("radio-card"),fa=({checked:e,className:o,classnames:r,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...u})=>a.jsxs(pa,{className:Ge("container",o),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(ua,{...u,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(St,{className:r==null?void 0:r.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(ha,{className:Ge("content",r==null?void 0:r.content),children:[a.jsx(ba,{className:Ge("label",r==null?void 0:r.label),$variant:h,children:c}),i&&a.jsx(ga,{className:Ge("description",r==null?void 0:r.description),$variant:h,children:i})]})]}),Kt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},xa=s.div`
|
|
654
1367
|
display: flex;
|
|
655
1368
|
flex-direction: column;
|
|
656
1369
|
gap: 8px;
|
|
657
|
-
|
|
658
|
-
margin: 0;
|
|
659
|
-
padding: 0;
|
|
660
|
-
`,na=O.span`
|
|
1370
|
+
`,Oa=s.span`
|
|
661
1371
|
font-size: 13px;
|
|
662
1372
|
font-weight: 500;
|
|
663
1373
|
line-height: 1.5;
|
|
664
|
-
color: ${
|
|
1374
|
+
color: ${e=>e.$disabled?Kt.label.disabledColor:Kt.label.color};
|
|
665
1375
|
margin-bottom: 4px;
|
|
666
|
-
|
|
667
|
-
`,ia=O.div`
|
|
1376
|
+
`,$a=s.div`
|
|
668
1377
|
display: flex;
|
|
669
1378
|
flex-direction: column;
|
|
670
1379
|
gap: 12px;
|
|
671
|
-
`,lr=w.classNameGetter("radioGroup"),la=({className:e,classnames:t,disabled:r,label:o,name:n,onChange:s,options:l,value:c,...d})=>w.jsxs(oa,{...d,className:lr("container",e,t==null?void 0:t.container),children:[o&&w.jsx(na,{className:lr("label",t==null?void 0:t.label),children:o}),w.jsx(ia,{className:lr("options",t==null?void 0:t.options),children:l.map(a=>w.jsx(Rr,{className:t==null?void 0:t.radio,name:n,checked:c===a.value,label:a.label,disabled:r,onChange:()=>s(a.value)},a.value))})]}),i={black:"#000000",white:"#ffffff",onyx:"#111111",carbonBlack:"#232323",graphite:"#343434",slate:"#484848",ash:"#6b6b6b",silver:"#8c8c8c",mist:"#b0b0b0",cloud:"#d4d4d4",snow:"#ebebeb",icyBlue:"#bde0fe",blue:"#0050c8",green:"#009650",amber:"#b48200",red:"#c83232",grey:"#646464",blueBg:"#0064ff1a",greenBg:"#00c8641a",amberBg:"#ffb4001a",redBg:"#ff50501a",greyBg:"#0000000d",hoverLight:"#00000008",activeLight:"#00000012",hoverDark:"#ffffff12",activeDark:"#ffffff20",redLight:"#c8323214",redMedium:"#c8323228",focusRingDark:"#00000080",focusRingDarkSubtle:"#00000040",focusRingLight:"#ffffff80",focusRingLightSubtle:"#ffffff40",focusRingDanger:"#c8323280",focusRingWarning:"#b4820040",focusRingError:"#c8323240",inputBgLight:"#00000008",inputBgDark:"#ffffff0d",inputBgWarning:"#ffb4001a",inputBgError:"#ff50501a"},Lt={xl:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"},Nt={chip:{color:{default:i.grey,neutral:i.blue,success:i.green,warning:i.amber,error:i.red},backgroundColor:{default:i.greyBg,neutral:i.blueBg,success:i.greenBg,warning:i.amberBg,error:i.redBg}},button:{primary:{color:i.white,backgroundColor:i.onyx,borderColor:i.onyx,hover:{backgroundColor:i.carbonBlack,borderColor:i.carbonBlack},active:{backgroundColor:i.graphite,borderColor:i.graphite},focus:{outlineColor:i.focusRingDark},disabled:{color:i.silver,backgroundColor:i.snow,borderColor:i.snow},char:{color:i.snow,backgroundColor:i.slate},icon:{color:i.white}},secondary:{color:i.onyx,backgroundColor:i.snow,borderColor:i.cloud,hover:{backgroundColor:i.cloud,borderColor:i.mist},active:{backgroundColor:i.cloud,borderColor:i.silver},focus:{outlineColor:i.focusRingDarkSubtle},disabled:{color:i.silver,backgroundColor:i.snow,borderColor:i.snow},char:{color:i.slate,backgroundColor:i.mist},icon:{color:i.slate}},ghost:{color:i.onyx,backgroundColor:"transparent",borderColor:"transparent",hover:{backgroundColor:i.hoverLight,borderColor:"transparent"},active:{backgroundColor:i.activeLight,borderColor:"transparent"},focus:{outlineColor:i.focusRingDarkSubtle},disabled:{color:i.silver,backgroundColor:"transparent",borderColor:"transparent"},char:{color:i.ash,backgroundColor:i.snow},icon:{color:i.slate}},danger:{color:i.red,backgroundColor:"transparent",borderColor:i.redLight,hover:{backgroundColor:i.redLight,borderColor:i.redLight},active:{backgroundColor:i.redMedium,borderColor:i.redMedium},focus:{outlineColor:i.focusRingDanger},disabled:{color:i.mist,backgroundColor:i.snow,borderColor:i.snow},char:{color:i.red,backgroundColor:i.redLight},icon:{color:i.red}}},checkbox:{box:{backgroundColor:"transparent",borderColor:i.mist,checked:{backgroundColor:i.onyx,borderColor:i.onyx},focus:{shadowColor:i.focusRingDarkSubtle}},icon:{color:i.white},label:{color:i.onyx},state:{warning:{box:{borderColor:i.amber,checked:{backgroundColor:i.amber,borderColor:i.amber},focus:{shadowColor:i.focusRingWarning}},label:{color:i.amber}},error:{box:{borderColor:i.red,checked:{backgroundColor:i.red,borderColor:i.red},focus:{shadowColor:i.focusRingError}},label:{color:i.red}}}},checkboxCard:{container:{backgroundColor:i.white,borderColor:i.mist,hover:{borderColor:i.silver},checked:{backgroundColor:i.white,borderColor:i.onyx},focus:{outlineColor:i.focusRingDarkSubtle},disabled:{backgroundColor:i.snow,borderColor:i.cloud}},label:{color:i.onyx,disabled:{color:i.silver}},description:{color:i.slate,disabled:{color:i.silver}},state:{warning:{container:{borderColor:i.amber,checked:{borderColor:i.amber}},label:{color:i.amber},description:{color:i.amber}},error:{container:{borderColor:i.red,checked:{borderColor:i.red}},label:{color:i.red},description:{color:i.red}}}},checkboxGroup:{label:{color:i.onyx}},input:{wrapper:{backgroundColor:i.inputBgLight,borderColor:i.mist,focus:{outlineColor:i.focusRingDarkSubtle},disabled:{backgroundColor:i.snow,borderColor:i.cloud}},label:{color:i.slate},input:{color:i.onyx,placeholderColor:i.silver,disabled:{color:i.silver}},icon:{color:i.slate,disabled:{color:i.silver}},toggle:{color:i.slate},state:{warning:{wrapper:{backgroundColor:i.inputBgWarning,borderColor:i.amber,focus:{outlineColor:i.focusRingWarning}},label:{color:i.amber},input:{color:i.onyx,placeholderColor:i.amber},icon:{color:i.amber}},error:{wrapper:{backgroundColor:i.inputBgError,borderColor:i.red,focus:{outlineColor:i.focusRingError}},label:{color:i.red},input:{color:i.onyx,placeholderColor:i.red},icon:{color:i.red}}}},radio:{circle:{borderColor:i.mist,checked:{borderColor:i.onyx},focus:{shadowColor:i.focusRingDarkSubtle}},dot:{color:i.onyx},label:{color:i.onyx},state:{warning:{circle:{borderColor:i.amber,checked:{borderColor:i.amber},focus:{shadowColor:i.focusRingWarning}},dot:{color:i.amber},label:{color:i.amber}},error:{circle:{borderColor:i.red,checked:{borderColor:i.red},focus:{shadowColor:i.focusRingError}},dot:{color:i.red},label:{color:i.red}}}},radioCard:{container:{backgroundColor:i.white,borderColor:i.mist,hover:{borderColor:i.silver},checked:{backgroundColor:i.white,borderColor:i.onyx},focus:{outlineColor:i.focusRingDarkSubtle},disabled:{backgroundColor:i.snow,borderColor:i.cloud}},label:{color:i.onyx,disabled:{color:i.silver}},description:{color:i.slate,disabled:{color:i.silver}},state:{warning:{container:{borderColor:i.amber,checked:{borderColor:i.amber}},label:{color:i.amber},description:{color:i.amber}},error:{container:{borderColor:i.red,checked:{borderColor:i.red}},label:{color:i.red},description:{color:i.red}}}},radioGroup:{label:{color:i.onyx}},dropdown:{content:{backgroundColor:i.white,borderColor:i.cloud,shadow:Lt.xl}},select:{trigger:{backgroundColor:i.inputBgLight,borderColor:i.mist,focus:{outlineColor:i.focusRingDarkSubtle},disabled:{backgroundColor:i.snow,borderColor:i.cloud}},label:{color:i.slate},value:{color:i.onyx,placeholderColor:i.silver,disabled:{color:i.silver}},icon:{color:i.slate,disabled:{color:i.silver}},chevron:{color:i.slate,disabled:{color:i.silver}},content:{backgroundColor:i.white,borderColor:i.cloud,shadow:Lt.xl},option:{color:i.onyx,backgroundColor:"transparent",hover:{backgroundColor:i.hoverLight},selected:{backgroundColor:i.blueBg,color:i.blue}},search:{backgroundColor:i.snow,borderColor:i.cloud,color:i.onyx,placeholderColor:i.silver},empty:{color:i.silver},state:{warning:{trigger:{backgroundColor:i.inputBgWarning,borderColor:i.amber,focus:{outlineColor:i.focusRingWarning}},label:{color:i.amber},value:{color:i.onyx,placeholderColor:i.amber},icon:{color:i.amber},chevron:{color:i.amber}},error:{trigger:{backgroundColor:i.inputBgError,borderColor:i.red,focus:{outlineColor:i.focusRingError}},label:{color:i.red},value:{color:i.onyx,placeholderColor:i.red},icon:{color:i.red},chevron:{color:i.red}}}}},dn={chip:{color:{default:i.icyBlue,neutral:i.icyBlue,success:i.green,warning:i.amber,error:i.red},backgroundColor:{default:i.graphite,neutral:i.graphite,success:i.greenBg,warning:i.amberBg,error:i.redBg}},button:{primary:{color:i.black,backgroundColor:i.white,borderColor:i.white,hover:{backgroundColor:i.cloud,borderColor:i.cloud},active:{backgroundColor:i.mist,borderColor:i.mist},focus:{outlineColor:i.focusRingLight},disabled:{color:i.ash,backgroundColor:i.graphite,borderColor:i.graphite},char:{color:i.slate,backgroundColor:i.cloud},icon:{color:i.black}},secondary:{color:i.white,backgroundColor:i.graphite,borderColor:i.slate,hover:{backgroundColor:i.slate,borderColor:i.ash},active:{backgroundColor:i.ash,borderColor:i.silver},focus:{outlineColor:i.focusRingLightSubtle},disabled:{color:i.ash,backgroundColor:i.carbonBlack,borderColor:i.carbonBlack},char:{color:i.mist,backgroundColor:i.slate},icon:{color:i.cloud}},ghost:{color:i.white,backgroundColor:"transparent",borderColor:"transparent",hover:{backgroundColor:i.hoverDark,borderColor:"transparent"},active:{backgroundColor:i.activeDark,borderColor:"transparent"},focus:{outlineColor:i.focusRingLightSubtle},disabled:{color:i.ash,backgroundColor:"transparent",borderColor:"transparent"},char:{color:i.mist,backgroundColor:i.graphite},icon:{color:i.cloud}},danger:{color:i.red,backgroundColor:"transparent",borderColor:i.redLight,hover:{backgroundColor:i.redLight,borderColor:i.redLight},active:{backgroundColor:i.redMedium,borderColor:i.redMedium},focus:{outlineColor:i.focusRingDanger},disabled:{color:i.ash,backgroundColor:i.carbonBlack,borderColor:i.carbonBlack},char:{color:i.red,backgroundColor:i.redLight},icon:{color:i.red}}},checkbox:{box:{backgroundColor:"transparent",borderColor:i.ash,checked:{backgroundColor:i.white,borderColor:i.white},focus:{shadowColor:i.focusRingLightSubtle}},icon:{color:i.black},label:{color:i.white},state:{warning:{box:{borderColor:i.amber,checked:{backgroundColor:i.amber,borderColor:i.amber},focus:{shadowColor:i.focusRingWarning}},label:{color:i.amber}},error:{box:{borderColor:i.red,checked:{backgroundColor:i.red,borderColor:i.red},focus:{shadowColor:i.focusRingError}},label:{color:i.red}}}},checkboxCard:{container:{backgroundColor:i.graphite,borderColor:i.slate,hover:{borderColor:i.ash},checked:{backgroundColor:i.graphite,borderColor:i.white},focus:{outlineColor:i.focusRingLightSubtle},disabled:{backgroundColor:i.carbonBlack,borderColor:i.slate}},label:{color:i.white,disabled:{color:i.ash}},description:{color:i.cloud,disabled:{color:i.ash}},state:{warning:{container:{borderColor:i.amber,checked:{borderColor:i.amber}},label:{color:i.amber},description:{color:i.amber}},error:{container:{borderColor:i.red,checked:{borderColor:i.red}},label:{color:i.red},description:{color:i.red}}}},checkboxGroup:{label:{color:i.white}},input:{wrapper:{backgroundColor:i.inputBgDark,borderColor:i.slate,focus:{outlineColor:i.focusRingLightSubtle},disabled:{backgroundColor:i.graphite,borderColor:i.slate}},label:{color:i.cloud},input:{color:i.white,placeholderColor:i.ash,disabled:{color:i.ash}},icon:{color:i.cloud,disabled:{color:i.ash}},toggle:{color:i.cloud},state:{warning:{wrapper:{backgroundColor:i.inputBgWarning,borderColor:i.amber,focus:{outlineColor:i.focusRingWarning}},label:{color:i.amber},input:{color:i.white,placeholderColor:i.amber},icon:{color:i.amber}},error:{wrapper:{backgroundColor:i.inputBgError,borderColor:i.red,focus:{outlineColor:i.focusRingError}},label:{color:i.red},input:{color:i.white,placeholderColor:i.red},icon:{color:i.red}}}},radio:{circle:{borderColor:i.ash,checked:{borderColor:i.white},focus:{shadowColor:i.focusRingLightSubtle}},dot:{color:i.white},label:{color:i.white},state:{warning:{circle:{borderColor:i.amber,checked:{borderColor:i.amber},focus:{shadowColor:i.focusRingWarning}},dot:{color:i.amber},label:{color:i.amber}},error:{circle:{borderColor:i.red,checked:{borderColor:i.red},focus:{shadowColor:i.focusRingError}},dot:{color:i.red},label:{color:i.red}}}},radioCard:{container:{backgroundColor:i.graphite,borderColor:i.slate,hover:{borderColor:i.ash},checked:{backgroundColor:i.graphite,borderColor:i.white},focus:{outlineColor:i.focusRingLightSubtle},disabled:{backgroundColor:i.carbonBlack,borderColor:i.slate}},label:{color:i.white,disabled:{color:i.ash}},description:{color:i.cloud,disabled:{color:i.ash}},state:{warning:{container:{borderColor:i.amber,checked:{borderColor:i.amber}},label:{color:i.amber},description:{color:i.amber}},error:{container:{borderColor:i.red,checked:{borderColor:i.red}},label:{color:i.red},description:{color:i.red}}}},radioGroup:{label:{color:i.white}},dropdown:{content:{backgroundColor:i.graphite,borderColor:i.slate,shadow:Lt.xl}},select:{trigger:{backgroundColor:i.inputBgDark,borderColor:i.slate,focus:{outlineColor:i.focusRingLightSubtle},disabled:{backgroundColor:i.graphite,borderColor:i.slate}},label:{color:i.cloud},value:{color:i.white,placeholderColor:i.ash,disabled:{color:i.ash}},icon:{color:i.cloud,disabled:{color:i.ash}},chevron:{color:i.cloud,disabled:{color:i.ash}},content:{backgroundColor:i.graphite,borderColor:i.slate,shadow:Lt.xl},option:{color:i.white,backgroundColor:"transparent",hover:{backgroundColor:i.hoverDark},selected:{backgroundColor:i.blueBg,color:i.blue}},search:{backgroundColor:i.carbonBlack,borderColor:i.slate,color:i.white,placeholderColor:i.ash},empty:{color:i.ash},state:{warning:{trigger:{backgroundColor:i.inputBgWarning,borderColor:i.amber,focus:{outlineColor:i.focusRingWarning}},label:{color:i.amber},value:{color:i.white,placeholderColor:i.amber},icon:{color:i.amber},chevron:{color:i.amber}},error:{trigger:{backgroundColor:i.inputBgError,borderColor:i.red,focus:{outlineColor:i.focusRingError}},label:{color:i.red},value:{color:i.white,placeholderColor:i.red},icon:{color:i.red},chevron:{color:i.red}}}}},fn=X.createContext({mode:"light",theme:Nt,setMode:()=>{}}),sa=()=>{const e=X.useContext(fn);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e},ca=He.css`
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
1380
|
+
`,dt=A.newClassNameGetter("radio-group"),Sa=({className:e,classnames:o,disabled:r,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(xa,{...h,ref:d,className:dt("container",e),children:[i&&a.jsx(Oa,{className:dt("label",o==null?void 0:o.label),$disabled:r,children:i}),a.jsx($a,{className:dt("options",o==null?void 0:o.options),children:c.map(u=>a.jsx(St,{className:o==null?void 0:o.radio,name:n,checked:p===u.value,label:u.label,disabled:r,onChange:()=>l(u.value)},u.value))})]}),ct=40,ze=4,Zt={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},Jt={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},st=e=>Zt[e]??Zt.default,le=e=>Jt[e]??Jt.normal,ya=s.div`
|
|
1381
|
+
position: relative;
|
|
1382
|
+
display: grid;
|
|
1383
|
+
gap: 2px;
|
|
1384
|
+
min-width: 180px;
|
|
1385
|
+
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1386
|
+
`,va=s(Se)`
|
|
1387
|
+
margin-left: 6px;
|
|
1388
|
+
`,ma=s.button`
|
|
1389
|
+
display: flex;
|
|
1390
|
+
align-items: center;
|
|
1391
|
+
justify-content: space-between;
|
|
1392
|
+
gap: 8px;
|
|
1393
|
+
width: 100%;
|
|
1394
|
+
outline: none;
|
|
1395
|
+
font-size: 14px;
|
|
1396
|
+
font-weight: 500;
|
|
1397
|
+
text-align: left;
|
|
1398
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1399
|
+
height: ${e=>st(e.$size).height};
|
|
1400
|
+
padding: ${e=>st(e.$size).padding};
|
|
1401
|
+
border-radius: ${e=>st(e.$size).radius};
|
|
1402
|
+
|
|
1403
|
+
color: ${e=>e.$hasValue?e.$disabled?le(e.$variant).color.disabled:le(e.$variant).color.static:le(e.$variant).placeholder};
|
|
1404
|
+
border: 1px solid
|
|
1405
|
+
${e=>e.$disabled?le(e.$variant).border.disabled:le(e.$variant).border.static};
|
|
1406
|
+
background-color: ${e=>e.$disabled?le(e.$variant).background.disabled:le(e.$variant).background.static};
|
|
1407
|
+
|
|
1408
|
+
&:focus-visible {
|
|
1409
|
+
outline: 2px solid ${e=>le(e.$variant).focus};
|
|
676
1410
|
}
|
|
1411
|
+
`,Ca=s.span`
|
|
1412
|
+
flex: 1;
|
|
1413
|
+
min-width: 0;
|
|
1414
|
+
overflow: hidden;
|
|
1415
|
+
text-overflow: ellipsis;
|
|
1416
|
+
white-space: nowrap;
|
|
1417
|
+
`,wa=s.span`
|
|
1418
|
+
display: flex;
|
|
1419
|
+
align-items: center;
|
|
1420
|
+
justify-content: center;
|
|
1421
|
+
flex-shrink: 0;
|
|
1422
|
+
transition: transform 0.2s ease;
|
|
1423
|
+
transform: rotate(${e=>e.$open?"180deg":"0deg"});
|
|
1424
|
+
`,So=`
|
|
1425
|
+
padding: 4px;
|
|
1426
|
+
background: ${t.COLORS.white};
|
|
1427
|
+
border: 1px solid ${t.alpha(t.COLORS.black,10)};
|
|
1428
|
+
border-radius: 16px;
|
|
1429
|
+
box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
|
|
1430
|
+
z-index: 1000;
|
|
1431
|
+
`,Ra=s.div`
|
|
1432
|
+
position: absolute;
|
|
1433
|
+
left: -4px;
|
|
1434
|
+
width: calc(100% + 8px);
|
|
1435
|
+
${So}
|
|
1436
|
+
`,ka=s.div`
|
|
1437
|
+
position: fixed;
|
|
1438
|
+
${So}
|
|
1439
|
+
`,La=s.button`
|
|
1440
|
+
display: flex;
|
|
1441
|
+
align-items: center;
|
|
1442
|
+
justify-content: space-between;
|
|
1443
|
+
gap: 8px;
|
|
1444
|
+
width: 100%;
|
|
1445
|
+
height: 40px;
|
|
1446
|
+
padding: 0 14px;
|
|
1447
|
+
border: none;
|
|
1448
|
+
background: ${e=>e.$selected?t.alpha(t.COLORS.black,6):"transparent"};
|
|
1449
|
+
border-radius: 12px;
|
|
1450
|
+
font-size: 14px;
|
|
1451
|
+
font-weight: 500;
|
|
1452
|
+
text-align: left;
|
|
1453
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1454
|
+
color: ${e=>e.$disabled?t.alpha(t.COLORS.black,40):t.COLORS.black};
|
|
1455
|
+
transition: background-color 0.15s ease;
|
|
677
1456
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
padding: 0;
|
|
1457
|
+
&:hover:not(:disabled) {
|
|
1458
|
+
background: ${t.alpha(t.COLORS.black,8)};
|
|
681
1459
|
}
|
|
682
1460
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
text-size-adjust: 100%;
|
|
1461
|
+
&:focus-visible {
|
|
1462
|
+
outline: none;
|
|
1463
|
+
background: ${t.alpha(t.COLORS.black,8)};
|
|
687
1464
|
}
|
|
1465
|
+
`,za=s.span`
|
|
1466
|
+
display: flex;
|
|
1467
|
+
align-items: center;
|
|
1468
|
+
justify-content: center;
|
|
1469
|
+
flex-shrink: 0;
|
|
1470
|
+
color: ${t.COLORS.black};
|
|
1471
|
+
`,$e=A.newClassNameGetter("select"),Pa=({className:e,classnames:o,disabled:r=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:h,size:u="default",value:f,variant:x="normal",...k})=>{const[S,$]=g.useState(!1),[y,O]=g.useState({top:0,left:0,width:0}),L=g.useRef(null),b=g.useRef(null),z=g.useRef(null),j=c.find(v=>v.value===f),N=Math.max(0,c.findIndex(v=>v.value===f)),X=-(N*ct+ze),P=()=>{if(!b.current||!p)return;const v=b.current.getBoundingClientRect(),E=N*ct+ze;let w=v.top-E;const D=c.length*ct+ze*2,Y=8,M=window.innerHeight-D-8;w<Y&&(w=Y),w>M&&(w=M),O({top:w,left:v.left-ze,width:v.width+ze*2})},B=v=>{var E;l==null||l(v),$(!1),(E=b.current)==null||E.focus()},T=v=>{r||(v.key==="Enter"||v.key===" "?(v.preventDefault(),$(E=>!E)):v.key==="Escape"&&S?(v.preventDefault(),$(!1)):v.key==="ArrowDown"&&!S&&(v.preventDefault(),$(!0)))};g.useLayoutEffect(()=>{S&&p&&P()},[S,p,N,c.length]),g.useEffect(()=>{if(!S)return;const v=D=>{const Y=D.target,M=L.current&&!L.current.contains(Y),H=z.current&&!z.current.contains(Y);p?M&&H&&$(!1):M&&$(!1)},E=()=>{p&&P()},w=()=>{p&&P()};return document.addEventListener("mousedown",v),p&&(window.addEventListener("scroll",E,!0),window.addEventListener("resize",w)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",E,!0),window.removeEventListener("resize",w)}},[S,p]);const C=()=>c.map(v=>a.jsxs(La,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>B(v.value),className:$e("option",o==null?void 0:o.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(za,{children:a.jsx(a.Check,{size:16})})]},v.value)),_=p?be.createPortal(a.jsx(ka,{ref:z,role:"listbox",style:{top:y.top,left:y.left,width:y.width},className:$e("dropdown",o==null?void 0:o.dropdown),children:C()}),p):a.jsx(Ra,{ref:z,role:"listbox",style:{top:X},className:$e("dropdown",o==null?void 0:o.dropdown),children:C()});return a.jsxs(ya,{...k,ref:v=>{L.current=v,typeof h=="function"?h(v):h&&(h.current=v)},$fullWidth:i,className:$e("container",e),children:[n&&a.jsx(va,{className:$e("label",o==null?void 0:o.label),children:n}),a.jsxs(ma,{ref:b,type:"button",$size:u,$variant:x,$disabled:r,$hasValue:!!j,disabled:r,onClick:()=>!r&&$(v=>!v),onKeyDown:T,"aria-haspopup":"listbox","aria-expanded":S,className:$e("trigger",o==null?void 0:o.trigger),children:[a.jsx(Ca,{children:(j==null?void 0:j.label)??d}),a.jsx(wa,{$open:S,children:a.jsx(a.ChevronDown,{size:16})})]}),S&&_]})},Qt={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},eo={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},pt=e=>Qt[e]??Qt.md,ja=ie.keyframes`
|
|
1472
|
+
0% {
|
|
1473
|
+
transform: rotate(0deg);
|
|
1474
|
+
}
|
|
1475
|
+
100% {
|
|
1476
|
+
transform: rotate(360deg);
|
|
1477
|
+
}
|
|
1478
|
+
`,Ea=s.div`
|
|
1479
|
+
display: inline-block;
|
|
1480
|
+
width: ${e=>pt(e.$size).size};
|
|
1481
|
+
height: ${e=>pt(e.$size).size};
|
|
1482
|
+
border: ${e=>pt(e.$size).borderWidth} solid ${eo.track};
|
|
1483
|
+
border-top-color: ${eo.indicator};
|
|
1484
|
+
border-radius: 50%;
|
|
1485
|
+
animation: ${ja} 0.8s linear infinite;
|
|
1486
|
+
`,Ta=A.newClassNameGetter("spinner"),Na=({"aria-label":e="Loading",className:o,ref:r,size:i="md",...n})=>a.jsx(Ea,{...n,ref:r,className:Ta("container",o),role:"status","aria-label":e,$size:i}),to={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},Ia=e=>to[e]??to.neutral,Aa=s.div`
|
|
1487
|
+
display: flex;
|
|
1488
|
+
flex-direction: column;
|
|
1489
|
+
gap: 4px;
|
|
1490
|
+
padding: 20px;
|
|
1491
|
+
background-color: ${t.COLORS.white};
|
|
1492
|
+
border-radius: 16px;
|
|
1493
|
+
border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
|
|
1494
|
+
box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
|
|
1495
|
+
`,Da=s.div`
|
|
1496
|
+
display: flex;
|
|
1497
|
+
align-items: center;
|
|
1498
|
+
justify-content: space-between;
|
|
1499
|
+
gap: 8px;
|
|
1500
|
+
`,Ma=s.p`
|
|
1501
|
+
margin: 0;
|
|
1502
|
+
font-size: 13px;
|
|
1503
|
+
color: ${t.COLORS["iron-grey"]};
|
|
1504
|
+
`,_a=s.div`
|
|
1505
|
+
display: flex;
|
|
1506
|
+
align-items: center;
|
|
1507
|
+
justify-content: center;
|
|
1508
|
+
width: 32px;
|
|
1509
|
+
height: 32px;
|
|
1510
|
+
border-radius: 8px;
|
|
1511
|
+
background-color: #f5f5f5;
|
|
1512
|
+
color: ${t.COLORS["iron-grey"]};
|
|
688
1513
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
font-size: 1rem;
|
|
693
|
-
font-weight: 400;
|
|
694
|
-
line-height: 1.5;
|
|
695
|
-
letter-spacing: -0.011em;
|
|
696
|
-
font-feature-settings:
|
|
697
|
-
'kern' 1,
|
|
698
|
-
'liga' 1,
|
|
699
|
-
'calt' 1;
|
|
700
|
-
font-kerning: normal;
|
|
701
|
-
text-rendering: optimizeLegibility;
|
|
702
|
-
-webkit-font-smoothing: antialiased;
|
|
703
|
-
-moz-osx-font-smoothing: grayscale;
|
|
704
|
-
font-optical-sizing: auto;
|
|
705
|
-
font-variant-numeric: tabular-nums;
|
|
1514
|
+
& svg {
|
|
1515
|
+
width: 18px;
|
|
1516
|
+
height: 18px;
|
|
706
1517
|
}
|
|
1518
|
+
`,Fa=s.h3`
|
|
1519
|
+
margin: 0;
|
|
1520
|
+
font-size: 28px;
|
|
1521
|
+
font-weight: 600;
|
|
1522
|
+
line-height: 1.2;
|
|
1523
|
+
color: ${t.COLORS.black};
|
|
1524
|
+
`,Ba=s.p`
|
|
1525
|
+
margin: 0;
|
|
1526
|
+
font-size: 12px;
|
|
1527
|
+
color: ${({$variant:e})=>Ia(e)};
|
|
1528
|
+
`,We=A.newClassNameGetter("status-card"),Ya=({border:e=!1,className:o,classnames:r,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:h,...u})=>a.jsxs(Aa,{...u,ref:l,className:We("container",o),$border:e,$shadow:c,children:[a.jsxs(Da,{children:[a.jsx(Ma,{className:We("label",r==null?void 0:r.label),children:n}),i&&a.jsx(_a,{children:i})]}),a.jsx(Fa,{className:We("value",r==null?void 0:r.value),children:h}),d&&a.jsx(Ba,{className:We("trend",r==null?void 0:r.trend),$variant:p,children:d})]}),Ha=s.div`
|
|
1529
|
+
display: flex;
|
|
1530
|
+
align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
|
|
1531
|
+
flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
|
|
1532
|
+
`,Ga=s.div`
|
|
1533
|
+
display: flex;
|
|
1534
|
+
align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
|
|
1535
|
+
flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
|
|
1536
|
+
${e=>e.$orientation==="horizontal"&&"flex: 1; min-width: 0;"}
|
|
707
1537
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
video,
|
|
711
|
-
canvas,
|
|
712
|
-
svg {
|
|
713
|
-
display: block;
|
|
714
|
-
max-width: 100%;
|
|
1538
|
+
&:last-child {
|
|
1539
|
+
flex: 0;
|
|
715
1540
|
}
|
|
1541
|
+
`,Wa=s.button`
|
|
1542
|
+
display: flex;
|
|
1543
|
+
align-items: center;
|
|
1544
|
+
gap: 10px;
|
|
1545
|
+
padding: 0;
|
|
1546
|
+
border: none;
|
|
1547
|
+
background: transparent;
|
|
1548
|
+
cursor: ${e=>e.$clickable?"pointer":"default"};
|
|
1549
|
+
flex-shrink: 0;
|
|
716
1550
|
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
1551
|
+
&:focus-visible {
|
|
1552
|
+
outline: none;
|
|
1553
|
+
|
|
1554
|
+
& > div:first-of-type {
|
|
1555
|
+
outline: 2px solid ${t.COLORS["steel-blue"]};
|
|
1556
|
+
outline-offset: 2px;
|
|
1557
|
+
}
|
|
722
1558
|
}
|
|
1559
|
+
`,Va=s.div`
|
|
1560
|
+
display: flex;
|
|
1561
|
+
align-items: center;
|
|
1562
|
+
justify-content: center;
|
|
1563
|
+
width: 32px;
|
|
1564
|
+
height: 32px;
|
|
1565
|
+
border-radius: 50%;
|
|
1566
|
+
font-size: 14px;
|
|
1567
|
+
font-weight: 600;
|
|
1568
|
+
flex-shrink: 0;
|
|
1569
|
+
transition:
|
|
1570
|
+
background-color 0.2s ease,
|
|
1571
|
+
border-color 0.2s ease,
|
|
1572
|
+
color 0.2s ease;
|
|
723
1573
|
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
1574
|
+
${e=>e.$active||e.$completed?`
|
|
1575
|
+
background-color: ${t.COLORS.black};
|
|
1576
|
+
border: 2px solid ${t.COLORS.black};
|
|
1577
|
+
color: ${t.COLORS.white};
|
|
1578
|
+
`:`
|
|
1579
|
+
background-color: transparent;
|
|
1580
|
+
border: 2px solid ${t.COLORS.gray};
|
|
1581
|
+
color: ${t.COLORS["iron-grey"]};
|
|
1582
|
+
`}
|
|
1583
|
+
`,Ua=s.span`
|
|
1584
|
+
font-size: 14px;
|
|
1585
|
+
font-weight: 500;
|
|
1586
|
+
white-space: nowrap;
|
|
1587
|
+
color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
|
|
1588
|
+
transition: color 0.2s ease;
|
|
1589
|
+
`,Xa=s.div`
|
|
1590
|
+
background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
|
|
1591
|
+
transition: background-color 0.2s ease;
|
|
1592
|
+
|
|
1593
|
+
${e=>e.$orientation==="vertical"?`
|
|
1594
|
+
width: 2px;
|
|
1595
|
+
height: 24px;
|
|
1596
|
+
margin: 8px 0 8px 15px;
|
|
1597
|
+
`:`
|
|
1598
|
+
flex: 1;
|
|
1599
|
+
height: 2px;
|
|
1600
|
+
min-width: 16px;
|
|
1601
|
+
margin: 0 12px;
|
|
1602
|
+
`}
|
|
1603
|
+
`,Pe=A.newClassNameGetter("stepper"),qa=({className:e,classnames:o,onChange:r,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const p=g.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(Ha,{...d,ref:n,$orientation:i,className:Pe("container",e),children:l.map((h,u)=>{const f=h.value===c,x=u<p,k=u===l.length-1;return a.jsxs(Ga,{$orientation:i,children:[a.jsxs(Wa,{type:"button",$active:f,$completed:x,$clickable:!!r,onClick:()=>r==null?void 0:r(h.value),className:Pe("step",o==null?void 0:o.step),children:[a.jsx(Va,{$active:f,$completed:x,className:Pe("circle",o==null?void 0:o.circle),children:u+1}),a.jsx(Ua,{$active:f,$completed:x,className:Pe("label",o==null?void 0:o.label),children:h.label})]}),!k&&a.jsx(Xa,{$completed:x,$orientation:i,className:Pe("line",o==null?void 0:o.line)})]},h.value)})})},$t={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Ka=s.div`
|
|
1604
|
+
position: relative;
|
|
1605
|
+
display: flex;
|
|
1606
|
+
flex-direction: column;
|
|
1607
|
+
gap: 4px;
|
|
1608
|
+
`,Za=s(Se)`
|
|
1609
|
+
margin-left: 6px;
|
|
1610
|
+
color: ${e=>$t[e.$variant].label};
|
|
1611
|
+
`,Ja=s.div`
|
|
1612
|
+
display: flex;
|
|
1613
|
+
flex-wrap: wrap;
|
|
1614
|
+
align-items: center;
|
|
1615
|
+
gap: 6px;
|
|
1616
|
+
min-height: 44px;
|
|
1617
|
+
padding: 8px 12px;
|
|
1618
|
+
border: 1px dashed ${e=>$t[e.$variant].border};
|
|
1619
|
+
border-radius: 8px;
|
|
1620
|
+
background: ${t.COLORS.white};
|
|
1621
|
+
cursor: ${e=>e.$disabled?"not-allowed":"text"};
|
|
1622
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
1623
|
+
transition: border-color 0.15s ease;
|
|
1624
|
+
|
|
1625
|
+
&:hover {
|
|
1626
|
+
border-color: ${e=>e.$disabled?$t[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
|
|
732
1627
|
}
|
|
733
1628
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
1629
|
+
${e=>e.$focused&&`
|
|
1630
|
+
outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
|
|
1631
|
+
outline-offset: 2px;
|
|
1632
|
+
`}
|
|
1633
|
+
`,Qa=s.input`
|
|
1634
|
+
flex: 1;
|
|
1635
|
+
min-width: 80px;
|
|
1636
|
+
border: none;
|
|
1637
|
+
outline: none;
|
|
1638
|
+
background: transparent;
|
|
1639
|
+
font-size: 14px;
|
|
1640
|
+
color: ${t.COLORS.black};
|
|
1641
|
+
cursor: ${e=>e.$disabled?"not-allowed":"text"};
|
|
1642
|
+
|
|
1643
|
+
&::placeholder {
|
|
1644
|
+
color: ${t.COLORS["iron-grey"]};
|
|
737
1645
|
}
|
|
738
1646
|
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
1647
|
+
&:disabled {
|
|
1648
|
+
cursor: not-allowed;
|
|
1649
|
+
}
|
|
1650
|
+
`,yo=`
|
|
1651
|
+
z-index: 100;
|
|
1652
|
+
background-color: ${t.COLORS.white};
|
|
1653
|
+
border: 1px solid ${t.alpha(t.COLORS.black,15)};
|
|
1654
|
+
border-radius: 8px;
|
|
1655
|
+
box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
|
|
1656
|
+
max-height: 200px;
|
|
1657
|
+
overflow-y: auto;
|
|
1658
|
+
`,vo=(e,o)=>e?"translateY(0)":o==="bottom"?"translateY(-8px)":"translateY(8px)",mo=`
|
|
1659
|
+
opacity 0.15s ease,
|
|
1660
|
+
transform 0.15s ease,
|
|
1661
|
+
visibility 0.15s;
|
|
1662
|
+
`,el=s.div`
|
|
1663
|
+
position: absolute;
|
|
1664
|
+
left: 0;
|
|
1665
|
+
right: 0;
|
|
1666
|
+
${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
1667
|
+
${yo}
|
|
1668
|
+
opacity: ${e=>e.$open?1:0};
|
|
1669
|
+
visibility: ${e=>e.$open?"visible":"hidden"};
|
|
1670
|
+
transform: ${e=>vo(e.$open,e.$position)};
|
|
1671
|
+
transition: ${mo};
|
|
1672
|
+
`,tl=s.div`
|
|
1673
|
+
position: fixed;
|
|
1674
|
+
${yo}
|
|
1675
|
+
opacity: ${e=>e.$open?1:0};
|
|
1676
|
+
visibility: ${e=>e.$open?"visible":"hidden"};
|
|
1677
|
+
transform: ${e=>vo(e.$open,e.$position)};
|
|
1678
|
+
transition: ${mo};
|
|
1679
|
+
`,oo=s.button`
|
|
1680
|
+
display: flex;
|
|
1681
|
+
align-items: center;
|
|
1682
|
+
width: 100%;
|
|
1683
|
+
padding: 10px 12px;
|
|
1684
|
+
border: none;
|
|
1685
|
+
background: transparent;
|
|
1686
|
+
font-size: 14px;
|
|
1687
|
+
color: ${t.COLORS.black};
|
|
1688
|
+
text-align: left;
|
|
1689
|
+
cursor: pointer;
|
|
1690
|
+
transition: background-color 0.15s ease;
|
|
1691
|
+
|
|
1692
|
+
&:hover {
|
|
1693
|
+
background-color: ${t.COLORS.gray};
|
|
743
1694
|
}
|
|
744
1695
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
list-style: none;
|
|
1696
|
+
&:first-of-type {
|
|
1697
|
+
border-radius: 7px 7px 0 0;
|
|
748
1698
|
}
|
|
749
1699
|
|
|
750
|
-
|
|
751
|
-
border-
|
|
752
|
-
|
|
1700
|
+
&:last-of-type {
|
|
1701
|
+
border-radius: 0 0 7px 7px;
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
&:only-child {
|
|
1705
|
+
border-radius: 7px;
|
|
753
1706
|
}
|
|
754
|
-
`,
|
|
1707
|
+
`,ro=s.div`
|
|
1708
|
+
display: flex;
|
|
1709
|
+
align-items: center;
|
|
1710
|
+
justify-content: center;
|
|
1711
|
+
padding: 16px;
|
|
1712
|
+
color: ${t.COLORS["iron-grey"]};
|
|
1713
|
+
font-size: 14px;
|
|
1714
|
+
text-align: center;
|
|
1715
|
+
`,ee=A.newClassNameGetter("tags"),Ve=4,ol=({className:e,classnames:o,createKey:r="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:h="Add tag...",portalRenderNode:u,ref:f,value:x,variant:k="normal",...S})=>{const $=g.useRef(null),y=g.useRef(null),O=g.useRef(null),L=g.useRef(null),[b,z]=g.useState(""),[j,N]=g.useState(!1),[X,P]=g.useState("bottom"),[B,T]=g.useState({top:0,left:0,width:0}),C=g.useMemo(()=>{const R=p.filter(U=>!x.includes(U.value));if(!b.trim())return R;const I=b.toLowerCase().trim();return R.filter(U=>U.label.toLowerCase().includes(I))},[p,x,b]),_=j&&p.length>0,v=g.useCallback(()=>{var Ne;if(!y.current)return;const R=y.current.getBoundingClientRect(),I=((Ne=O.current)==null?void 0:Ne.offsetHeight)??200,U=window.innerHeight-R.bottom-Ve,q=R.top-Ve,ge=U<I&&q>U?"top":"bottom";if(P(ge),u){const Je=ge==="bottom"?R.bottom+Ve:R.top-I-Ve;T({top:Je,left:R.left,width:R.width})}},[u]);g.useEffect(()=>{if(j)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[j,v]);const E=g.useCallback(R=>{const I=R.trim();return!I||x.includes(I)?!1:(d([...x,I]),z(""),!0)},[x,d]),w=R=>{if(R.key===r&&b.trim())if(R.preventDefault(),l)E(b);else{const I=C.find(U=>U.label.toLowerCase()===b.toLowerCase().trim());I&&E(I.value)}else R.key==="Backspace"&&!b&&x.length>0&&d(x.slice(0,-1))},D=R=>{var I;E(R),(I=L.current)==null||I.focus()},Y=R=>{d(x.filter(I=>I!==R))},M=()=>{var R;i||(R=L.current)==null||R.focus()},H=R=>{const I=p.find(U=>U.value===R);return(I==null?void 0:I.label)??R};return a.jsxs(Ka,{...S,ref:f,className:ee("container",e),children:[c&&a.jsx(Za,{$variant:k,className:ee("label"),children:c}),a.jsxs("div",{ref:$,style:{position:"relative"},children:[a.jsxs(Ja,{ref:y,$variant:k,$disabled:i,$focused:j,onClick:M,className:ee("trigger",o==null?void 0:o.trigger),children:[x.map(R=>a.jsx(Xe,{deletable:!i,onDelete:()=>Y(R),className:ee("chip",o==null?void 0:o.chip),children:H(R)},R)),a.jsx(Qa,{ref:L,type:"text",value:b,onChange:R=>z(R.target.value),onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),150),onKeyDown:w,placeholder:x.length===0?h:"",disabled:i,$disabled:i,className:ee("input",o==null?void 0:o.input)})]}),p.length>0&&(u?be.createPortal(a.jsx(tl,{ref:O,$open:_,$position:X,style:{top:B.top,left:B.left,width:B.width},className:ee("dropdown",o==null?void 0:o.dropdown),children:C.length===0?a.jsx(ro,{className:ee("empty",o==null?void 0:o.empty),children:n}):C.map(R=>a.jsx(oo,{type:"button",onMouseDown:I=>I.preventDefault(),onClick:()=>D(R.value),className:ee("option",o==null?void 0:o.option),children:R.label},R.value))}),u):a.jsx(el,{ref:O,$open:_,$position:X,className:ee("dropdown",o==null?void 0:o.dropdown),children:C.length===0?a.jsx(ro,{className:ee("empty",o==null?void 0:o.empty),children:n}):C.map(R=>a.jsx(oo,{type:"button",onMouseDown:I=>I.preventDefault(),onClick:()=>D(R.value),className:ee("option",o==null?void 0:o.option),children:R.label},R.value))}))]})]})},rl=s.div`
|
|
1716
|
+
display: flex;
|
|
1717
|
+
align-items: center;
|
|
1718
|
+
gap: 6px;
|
|
1719
|
+
`,il=s.button`
|
|
1720
|
+
padding: 6px 16px;
|
|
1721
|
+
border: none;
|
|
1722
|
+
border-radius: 12px;
|
|
1723
|
+
background-color: ${e=>e.$active?t.COLORS.gray:"transparent"};
|
|
1724
|
+
color: ${t.COLORS.black};
|
|
1725
|
+
font-size: 14px;
|
|
1726
|
+
font-weight: 500;
|
|
1727
|
+
line-height: 1.4;
|
|
1728
|
+
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1729
|
+
opacity: ${e=>e.$disabled?.5:1};
|
|
1730
|
+
transition:
|
|
1731
|
+
background-color 0.15s ease,
|
|
1732
|
+
opacity 0.15s ease;
|
|
1733
|
+
|
|
1734
|
+
&:hover:not(:disabled) {
|
|
1735
|
+
background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
&:focus-visible {
|
|
1739
|
+
outline: 2px solid ${t.COLORS["steel-blue"]};
|
|
1740
|
+
outline-offset: 2px;
|
|
1741
|
+
}
|
|
1742
|
+
`,io=A.newClassNameGetter("tabs"),nl=({className:e,classnames:o,onChange:r,ref:i,tabs:n,value:l,...c})=>a.jsx(rl,{...c,ref:i,className:io("container",e),role:"tablist",children:n.map(d=>a.jsx(il,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>r(d.value),className:io("tab",o==null?void 0:o.tab),children:d.label},d.value))}),Co=g.createContext(null),ut=3,no={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},al=(e,o)=>{switch(o.type){case"ADD_TOAST":{const r=o.payload;return e.toasts.length<ut?{...e,toasts:[...e.toasts,r]}:{...e,queue:[...e.queue,r]}}case"REMOVE_TOAST":{const r=o.payload,i=e.toasts.filter(l=>l.id!==r),n=e.queue[0];return n&&i.length<ut?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const r=e.queue[0];return!r||e.toasts.length>=ut?e:{toasts:[...e.toasts,r],queue:e.queue.slice(1)}}default:return e}},ll={toasts:[],queue:[]},ht=e=>no[e]??no.default,dl=ie.keyframes`
|
|
1743
|
+
from {
|
|
1744
|
+
transform: translateY(100%);
|
|
1745
|
+
opacity: 0;
|
|
1746
|
+
}
|
|
1747
|
+
to {
|
|
1748
|
+
transform: translateY(0);
|
|
1749
|
+
opacity: 1;
|
|
1750
|
+
}
|
|
1751
|
+
`,cl=ie.keyframes`
|
|
1752
|
+
from {
|
|
1753
|
+
transform: translateY(0);
|
|
1754
|
+
opacity: 1;
|
|
1755
|
+
}
|
|
1756
|
+
to {
|
|
1757
|
+
transform: translateY(100%);
|
|
1758
|
+
opacity: 0;
|
|
1759
|
+
}
|
|
1760
|
+
`,sl=s.div`
|
|
1761
|
+
position: fixed;
|
|
1762
|
+
bottom: 24px;
|
|
1763
|
+
left: 24px;
|
|
1764
|
+
z-index: 9999;
|
|
1765
|
+
display: flex;
|
|
1766
|
+
flex-direction: column;
|
|
1767
|
+
gap: 12px;
|
|
1768
|
+
pointer-events: none;
|
|
1769
|
+
width: auto;
|
|
1770
|
+
max-width: 90vw;
|
|
1771
|
+
`,pl=s.div`
|
|
1772
|
+
display: flex;
|
|
1773
|
+
align-items: center;
|
|
1774
|
+
justify-content: space-between;
|
|
1775
|
+
gap: 12px;
|
|
1776
|
+
min-height: 32px;
|
|
1777
|
+
padding: 8px 8px 8px 16px;
|
|
1778
|
+
background-color: ${({$variant:e})=>ht(e).background};
|
|
1779
|
+
color: ${({$variant:e})=>ht(e).text};
|
|
1780
|
+
border: 1px solid ${({$variant:e})=>ht(e).border};
|
|
1781
|
+
border-radius: 96px;
|
|
1782
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
1783
|
+
animation: ${({$isExiting:e})=>e?cl:dl} 0.3s ease-out;
|
|
1784
|
+
pointer-events: auto;
|
|
1785
|
+
max-width: 500px;
|
|
1786
|
+
`,ul=s.span`
|
|
1787
|
+
font-size: 14px;
|
|
1788
|
+
font-weight: 500;
|
|
1789
|
+
line-height: 1.4;
|
|
1790
|
+
white-space: nowrap;
|
|
1791
|
+
overflow: hidden;
|
|
1792
|
+
text-overflow: ellipsis;
|
|
1793
|
+
`,hl=s.button`
|
|
1794
|
+
display: flex;
|
|
1795
|
+
align-items: center;
|
|
1796
|
+
justify-content: center;
|
|
1797
|
+
width: 20px;
|
|
1798
|
+
height: 20px;
|
|
1799
|
+
padding: 0;
|
|
1800
|
+
background: transparent;
|
|
1801
|
+
border: none;
|
|
1802
|
+
color: inherit;
|
|
1803
|
+
cursor: pointer;
|
|
1804
|
+
opacity: 0.7;
|
|
1805
|
+
transition: opacity 0.2s ease-in-out;
|
|
1806
|
+
flex-shrink: 0;
|
|
1807
|
+
|
|
1808
|
+
&:hover {
|
|
1809
|
+
opacity: 1;
|
|
1810
|
+
}
|
|
1811
|
+
`,bl=s.div`
|
|
1812
|
+
display: flex;
|
|
1813
|
+
align-items: center;
|
|
1814
|
+
justify-content: space-between;
|
|
1815
|
+
gap: 12px;
|
|
1816
|
+
width: 100%;
|
|
1817
|
+
`,gl=s.div`
|
|
1818
|
+
display: flex;
|
|
1819
|
+
align-items: center;
|
|
1820
|
+
justify-content: center;
|
|
1821
|
+
min-height: 32px;
|
|
1822
|
+
padding: 8px 16px;
|
|
1823
|
+
background-color: #374151;
|
|
1824
|
+
color: ${t.COLORS.white};
|
|
1825
|
+
border-radius: 96px;
|
|
1826
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
1827
|
+
pointer-events: auto;
|
|
1828
|
+
font-size: 14px;
|
|
1829
|
+
font-weight: 500;
|
|
1830
|
+
white-space: nowrap;
|
|
1831
|
+
margin-left: auto;
|
|
1832
|
+
`,ao=({toast:e,onRemove:o})=>{const[r,i]=g.useState(!1),n=()=>{i(!0),setTimeout(()=>{o(e.id)},300)};return g.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(pl,{$variant:e.variant,$isExiting:r,children:[a.jsx(ul,{children:e.message}),a.jsx(hl,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},fl=({toasts:e,queueCount:o,removeToast:r})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(sl,{children:e.map((n,l)=>l===i&&o>0?a.jsxs(bl,{children:[a.jsx(ao,{toast:n,onRemove:r}),a.jsxs(gl,{children:["+",o]})]},n.id):a.jsx(ao,{toast:n,onRemove:r},n.id))})},xl=({children:e})=>{const[o,r]=g.useReducer(al,ll),i=g.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;r({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),n=g.useCallback(l=>{r({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Co.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(fl,{toasts:o.toasts,queueCount:o.queue.length,removeToast:n})]})},Ol=()=>{const e=g.useContext(Co);if(!e)throw new Error("useToast must be used within ToastProvider");return e},lo={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},Ee=e=>lo[e]??lo.dark,$l=(e,o)=>{const r=Ee(o).background;switch(e){case"top":return`
|
|
1833
|
+
bottom: -12px;
|
|
1834
|
+
left: 50%;
|
|
1835
|
+
margin-left: -6px;
|
|
1836
|
+
border-top-color: ${r};
|
|
1837
|
+
`;case"bottom":return`
|
|
1838
|
+
top: -12px;
|
|
1839
|
+
left: 50%;
|
|
1840
|
+
margin-left: -6px;
|
|
1841
|
+
border-bottom-color: ${r};
|
|
1842
|
+
`;case"left":return`
|
|
1843
|
+
right: -12px;
|
|
1844
|
+
top: 50%;
|
|
1845
|
+
margin-top: -6px;
|
|
1846
|
+
border-left-color: ${r};
|
|
1847
|
+
`;case"right":return`
|
|
1848
|
+
left: -12px;
|
|
1849
|
+
top: 50%;
|
|
1850
|
+
margin-top: -6px;
|
|
1851
|
+
border-right-color: ${r};
|
|
1852
|
+
`;default:return""}},Sl=(e,o)=>{if(o!=="light")return"";const r=Ee(o).border;switch(e){case"top":return`
|
|
1853
|
+
&::after {
|
|
1854
|
+
bottom: -14px;
|
|
1855
|
+
left: 50%;
|
|
1856
|
+
margin-left: -7px;
|
|
1857
|
+
border-top-color: ${r};
|
|
1858
|
+
}
|
|
1859
|
+
`;case"bottom":return`
|
|
1860
|
+
&::after {
|
|
1861
|
+
top: -14px;
|
|
1862
|
+
left: 50%;
|
|
1863
|
+
margin-left: -7px;
|
|
1864
|
+
border-bottom-color: ${r};
|
|
1865
|
+
}
|
|
1866
|
+
`;case"left":return`
|
|
1867
|
+
&::after {
|
|
1868
|
+
right: -14px;
|
|
1869
|
+
top: 50%;
|
|
1870
|
+
margin-top: -7px;
|
|
1871
|
+
border-left-color: ${r};
|
|
1872
|
+
}
|
|
1873
|
+
`;case"right":return`
|
|
1874
|
+
&::after {
|
|
1875
|
+
left: -14px;
|
|
1876
|
+
top: 50%;
|
|
1877
|
+
margin-top: -7px;
|
|
1878
|
+
border-right-color: ${r};
|
|
1879
|
+
}
|
|
1880
|
+
`;default:return""}},wo=e=>`
|
|
1881
|
+
z-index: 1000;
|
|
1882
|
+
padding: 6px 12px;
|
|
1883
|
+
background-color: ${Ee(e.$variant).background};
|
|
1884
|
+
color: ${Ee(e.$variant).text};
|
|
1885
|
+
font-size: 13px;
|
|
1886
|
+
line-height: 1.4;
|
|
1887
|
+
border-radius: 6px;
|
|
1888
|
+
width: max-content;
|
|
1889
|
+
max-width: 300px;
|
|
1890
|
+
white-space: normal;
|
|
1891
|
+
word-wrap: break-word;
|
|
1892
|
+
pointer-events: none;
|
|
1893
|
+
opacity: ${e.$visible?1:0};
|
|
1894
|
+
visibility: ${e.$visible?"visible":"hidden"};
|
|
1895
|
+
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
|
|
1896
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
1897
|
+
|
|
1898
|
+
${e.$variant==="light"?`border: 1px solid ${Ee(e.$variant).border};`:""}
|
|
1899
|
+
|
|
1900
|
+
&::before {
|
|
1901
|
+
content: '';
|
|
1902
|
+
position: absolute;
|
|
1903
|
+
width: 0;
|
|
1904
|
+
height: 0;
|
|
1905
|
+
border: 6px solid transparent;
|
|
1906
|
+
${$l(e.$placement,e.$variant)}
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
${e.$variant==="light"?`
|
|
1910
|
+
&::after {
|
|
1911
|
+
content: '';
|
|
1912
|
+
position: absolute;
|
|
1913
|
+
width: 0;
|
|
1914
|
+
height: 0;
|
|
1915
|
+
border: 7px solid transparent;
|
|
1916
|
+
}
|
|
1917
|
+
`:""}
|
|
1918
|
+
|
|
1919
|
+
${Sl(e.$placement,e.$variant)}
|
|
1920
|
+
`,yl=s.div`
|
|
1921
|
+
position: relative;
|
|
1922
|
+
display: inline-block;
|
|
1923
|
+
`,vl=e=>{switch(e){case"top":return`
|
|
1924
|
+
bottom: calc(100% + 8px);
|
|
1925
|
+
left: 50%;
|
|
1926
|
+
transform: translateX(-50%);
|
|
1927
|
+
`;case"bottom":return`
|
|
1928
|
+
top: calc(100% + 8px);
|
|
1929
|
+
left: 50%;
|
|
1930
|
+
transform: translateX(-50%);
|
|
1931
|
+
`;case"left":return`
|
|
1932
|
+
right: calc(100% + 8px);
|
|
1933
|
+
top: 50%;
|
|
1934
|
+
transform: translateY(-50%);
|
|
1935
|
+
`;case"right":return`
|
|
1936
|
+
left: calc(100% + 8px);
|
|
1937
|
+
top: 50%;
|
|
1938
|
+
transform: translateY(-50%);
|
|
1939
|
+
`;default:return""}},ml=s.div`
|
|
1940
|
+
position: absolute;
|
|
1941
|
+
${e=>wo(e)}
|
|
1942
|
+
${({$placement:e})=>vl(e)}
|
|
1943
|
+
`,Cl=s.div`
|
|
1944
|
+
position: fixed;
|
|
1945
|
+
${e=>wo(e)}
|
|
1946
|
+
`,bt=A.newClassNameGetter("tooltip"),de=8,wl=({children:e,className:o,classnames:r,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...h})=>{const[u,f]=g.useState(!1),[x,k]=g.useState(null),[S,$]=g.useState(l),[y,O]=g.useState({top:0,left:0}),L=g.useRef(null),b=g.useRef(null),z=g.useCallback(()=>{var D,Y;if(!L.current)return;const P=L.current.getBoundingClientRect(),B=((D=b.current)==null?void 0:D.offsetWidth)??100,T=((Y=b.current)==null?void 0:Y.offsetHeight)??30,C=P.top-de,_=window.innerHeight-P.bottom-de,v=P.left-de,E=window.innerWidth-P.right-de;let w=l;if(l==="top"&&C<T&&_>C?w="bottom":l==="bottom"&&_<T&&C>_?w="top":l==="left"&&v<B&&E>v?w="right":l==="right"&&E<B&&v>E&&(w="left"),$(w),c){let M,H;switch(w){case"top":M=P.top-T-de,H=P.left+P.width/2-B/2;break;case"bottom":M=P.bottom+de,H=P.left+P.width/2-B/2;break;case"left":M=P.top+P.height/2-T/2,H=P.left-B-de;break;case"right":M=P.top+P.height/2-T/2,H=P.right+de;break;default:M=0,H=0}const R=8;H=Math.max(R,Math.min(H,window.innerWidth-B-R)),M=Math.max(R,Math.min(M,window.innerHeight-T-R)),O({top:M,left:H})}},[l,c]);g.useLayoutEffect(()=>{u&&z()},[u,z]);const j=()=>{const P=setTimeout(()=>{f(!0)},n);k(P)},N=()=>{x&&(clearTimeout(x),k(null)),f(!1)},X=c?be.createPortal(a.jsx(Cl,{ref:b,className:bt("content",r==null?void 0:r.content),$placement:S,$variant:p,$visible:u,style:{top:y.top,left:y.left},children:i}),c):a.jsx(ml,{ref:b,className:bt("content",r==null?void 0:r.content),$placement:S,$variant:p,$visible:u,children:i});return a.jsxs(yl,{...h,ref:P=>{L.current=P,typeof d=="function"?d(P):d&&(d.current=P)},className:bt("wrapper",o),onMouseEnter:j,onMouseLeave:N,children:[e,X]})};exports.Button=Te;exports.Card=sr;exports.Checkbox=Ke;exports.CheckboxCard=yr;exports.CheckboxGroup=wr;exports.Chip=Xe;exports.Confirmation=Ar;exports.Container=_r;exports.DatePicker=bi;exports.Drawer=$i;exports.Dropdown=wi;exports.FieldLabel=Se;exports.GlobalStyle=Vo;exports.ImageCropper=Tn;exports.Input=xo;exports.KeySymbol=co;exports.KeysBindings=so;exports.Modal=Oo;exports.MultiSelect=Kn;exports.Panel=oa;exports.Progress=na;exports.Radio=St;exports.RadioCard=fa;exports.RadioGroup=Sa;exports.Select=Pa;exports.Spinner=Na;exports.StatusCard=Ya;exports.Stepper=qa;exports.Tabs=nl;exports.Tags=ol;exports.ToastProvider=xl;exports.Tooltip=wl;exports.formatDateGo=po;exports.useImageCropper=fo;exports.useToast=Ol;
|
|
755
1947
|
//# sourceMappingURL=index.cjs.map
|