@vacano/ui 1.4.5 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),ae=require("@emotion/react"),u=require("react"),t=require("./media-OVL6YjWb.cjs"),A=require("./tooling-Dflq0Y98.cjs"),Oe=require("react-dom");function ro(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const ke=ro(u);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},Ct.apply(null,arguments)}const oo=ae.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),be=require("@emotion/react"),u=require("react"),t=require("./media-BuwIclXE.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function no(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=no(u);function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},vt.apply(null,arguments)}const ao=be.css`
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -141,22 +141,22 @@
141
141
  :focus:not(:focus-visible) {
142
142
  outline: none;
143
143
  }
144
- `,io=()=>a.jsx(ae.Global,{styles:oo});var no=/^((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)-.*))$/,ao=a.memoize(function(e){return no.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),lo=ao,co=function(r){return r!=="theme"},Nt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?lo:co},It=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},so=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},po=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=It(r,o,i),p=d||Nt(n),h=!p("as");return function(){var g=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),g[0]==null||g[0].raw===void 0)f.push.apply(f,g);else{var O=g[0];f.push(O[0]);for(var m=g.length,y=1;y<m;y++)f.push(g[y],O[y])}var S=ae.withEmotionCache(function(v,x,$){var b=h&&v.as||n,L="",j=[],N=v;if(v.theme==null){N={};for(var H in v)N[H]=v[H];N.theme=ke.useContext(ae.ThemeContext)}typeof v.className=="string"?L=a.getRegisteredStyles(x.registered,j,v.className):v.className!=null&&(L=v.className+" ");var z=a.serializeStyles(f.concat(j),x.registered,N);L+=x.key+"-"+z.name,c!==void 0&&(L+=" "+c);var _=h&&d===void 0?Nt(b):p,E={};for(var w in v)h&&w==="as"||_(w)&&(E[w]=v[w]);return E.className=L,$&&(E.ref=$),ke.createElement(ke.Fragment,null,ke.createElement(so,{cache:x,serialized:z,isStringTag:typeof b=="string"}),ke.createElement(b,E))});return S.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",S.defaultProps=r.defaultProps,S.__emotion_real=S,S.__emotion_base=n,S.__emotion_styles=f,S.__emotion_forwardProp=d,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(v,x){var $=e(v,Ct({},o,x,{shouldForwardProp:It(S,x,!0)}));return $.apply(void 0,f)},S}},uo=["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=po.bind(null);uo.forEach(function(e){s[e]=s(e)});const ho=s.span`
144
+ `,lo=()=>a.jsx(be.Global,{styles:ao});var co=/^((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)-.*))$/,so=a.memoize(function(e){return co.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),po=so,uo=function(r){return r!=="theme"},Tt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?po:uo},It=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},ho=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},bo=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=It(r,o,i),p=d||Tt(n),h=!p("as");return function(){var g=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),g[0]==null||g[0].raw===void 0)f.push.apply(f,g);else{var O=g[0];f.push(O[0]);for(var m=g.length,y=1;y<m;y++)f.push(g[y],O[y])}var S=be.withEmotionCache(function(C,x,$){var b=h&&C.as||n,L="",E=[],T=C;if(C.theme==null){T={};for(var V in C)T[V]=C[V];T.theme=Re.useContext(be.ThemeContext)}typeof C.className=="string"?L=a.getRegisteredStyles(x.registered,E,C.className):C.className!=null&&(L=C.className+" ");var z=a.serializeStyles(f.concat(E),x.registered,T);L+=x.key+"-"+z.name,c!==void 0&&(L+=" "+c);var D=h&&d===void 0?Tt(b):p,j={};for(var w in C)h&&w==="as"||D(w)&&(j[w]=C[w]);return j.className=L,$&&(j.ref=$),Re.createElement(Re.Fragment,null,Re.createElement(ho,{cache:x,serialized:z,isStringTag:typeof b=="string"}),Re.createElement(b,j))});return S.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",S.defaultProps=r.defaultProps,S.__emotion_real=S,S.__emotion_base=n,S.__emotion_styles=f,S.__emotion_forwardProp=d,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(C,x){var $=e(C,vt({},o,x,{shouldForwardProp:It(S,x,!0)}));return $.apply(void 0,f)},S}},go=["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=bo.bind(null);go.forEach(function(e){s[e]=s(e)});const fo=s.span`
145
145
  font-size: 12px;
146
146
  font-weight: 500;
147
147
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
148
- `,bo=A.newClassNameGetter("field-label"),de=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(ho,{...l,ref:o,className:bo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,it={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},oe={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)}},go=s.div`
148
+ `,xo=A.newClassNameGetter("field-label"),ie=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(fo,{...l,ref:o,className:xo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,it={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ne={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)}},Oo=s.div`
149
149
  position: relative;
150
150
  display: grid;
151
151
  gap: 2px;
152
152
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
153
- `,fo=s(de)`
153
+ `,$o=s(ie)`
154
154
  margin-left: 6px;
155
- `,xo=s.div`
155
+ `,So=s.div`
156
156
  position: relative;
157
157
  display: flex;
158
158
  align-items: center;
159
- `,Oo=s.input`
159
+ `,yo=s.input`
160
160
  flex: 1;
161
161
  min-width: 0;
162
162
  width: 100%;
@@ -168,29 +168,25 @@
168
168
  padding-right: 40px;
169
169
  border-radius: ${e=>it[e.$size].radius};
170
170
 
171
- color: ${e=>oe[e.$variant].color.static};
172
- border: 1px solid ${e=>oe[e.$variant].border.static};
173
- background-color: ${e=>oe[e.$variant].background.static};
171
+ color: ${e=>ne[e.$variant].color.static};
172
+ border: 1px solid ${e=>ne[e.$variant].border.static};
173
+ background-color: ${e=>ne[e.$variant].background.static};
174
174
 
175
175
  &::placeholder {
176
- color: ${e=>oe[e.$variant].placeholder.static};
176
+ color: ${e=>ne[e.$variant].placeholder.static};
177
177
  }
178
178
 
179
179
  &:disabled {
180
180
  cursor: not-allowed;
181
- color: ${e=>oe[e.$variant].color.disabled};
182
- background-color: ${e=>oe[e.$variant].background.disabled};
183
- border-color: ${e=>oe[e.$variant].border.disabled};
181
+ color: ${e=>ne[e.$variant].color.disabled};
182
+ background-color: ${e=>ne[e.$variant].background.disabled};
183
+ border-color: ${e=>ne[e.$variant].border.disabled};
184
184
 
185
185
  &::placeholder {
186
- color: ${e=>oe[e.$variant].placeholder.disabled};
186
+ color: ${e=>ne[e.$variant].placeholder.disabled};
187
187
  }
188
188
  }
189
-
190
- &:focus-visible {
191
- outline: 2px solid ${e=>oe[e.$variant].focus};
192
- }
193
- `,$o=s.div`
189
+ `,Co=s.div`
194
190
  position: absolute;
195
191
  right: 12px;
196
192
  top: 50%;
@@ -198,7 +194,7 @@
198
194
  display: flex;
199
195
  align-items: center;
200
196
  justify-content: center;
201
- `,So=s.div`
197
+ `,vo=s.div`
202
198
  position: absolute;
203
199
  top: 100%;
204
200
  left: 0;
@@ -218,7 +214,7 @@
218
214
  opacity 0.15s ease,
219
215
  transform 0.15s ease,
220
216
  visibility 0.15s;
221
- `,yo=s.div`
217
+ `,mo=s.div`
222
218
  display: flex;
223
219
  align-items: center;
224
220
  gap: 10px;
@@ -244,43 +240,43 @@
244
240
  &:hover {
245
241
  background-color: ${t.alpha(t.COLORS.black,5)};
246
242
  }
247
- `,vo=s.img`
243
+ `,wo=s.img`
248
244
  width: 24px;
249
245
  height: 24px;
250
246
  border-radius: 6px;
251
247
  object-fit: cover;
252
- `,Co=s.span`
248
+ `,Ro=s.span`
253
249
  flex: 1;
254
250
  overflow: hidden;
255
251
  text-overflow: ellipsis;
256
252
  white-space: nowrap;
257
- `,mo=s.div`
253
+ `,ko=s.div`
258
254
  padding: 12px 14px;
259
255
  font-size: 14px;
260
256
  color: ${t.alpha(t.COLORS.black,50)};
261
257
  text-align: center;
262
- `,At={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},Dt={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},nt=e=>At[e]??At.md,wo=ae.keyframes`
258
+ `,At={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},_t={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},nt=e=>At[e]??At.md,Lo=be.keyframes`
263
259
  0% {
264
260
  transform: rotate(0deg);
265
261
  }
266
262
  100% {
267
263
  transform: rotate(360deg);
268
264
  }
269
- `,Ro=s.div`
265
+ `,Po=s.div`
270
266
  display: inline-block;
271
267
  width: ${e=>nt(e.$size).size};
272
268
  height: ${e=>nt(e.$size).size};
273
- border: ${e=>nt(e.$size).borderWidth} solid ${Dt.track};
274
- border-top-color: ${Dt.indicator};
269
+ border: ${e=>nt(e.$size).borderWidth} solid ${_t.track};
270
+ border-top-color: ${_t.indicator};
275
271
  border-radius: 50%;
276
- animation: ${wo} 0.8s linear infinite;
277
- `,ko=A.newClassNameGetter("spinner"),Lt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Ro,{...n,ref:o,className:ko("container",r),role:"status","aria-label":e,$size:i}),Le=A.newClassNameGetter("autocomplete"),Lo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:p,onChange:h,onSearch:g,debounceMs:f=300,minChars:O=1,noResultsMessage:m="No results found",...y})=>{const[S,v]=u.useState((p==null?void 0:p.value)??""),[x,$]=u.useState([]),[b,L]=u.useState(!1),[j,N]=u.useState(!1),[H,z]=u.useState(!1),_=u.useRef(null),E=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&v(p.value)},[p==null?void 0:p.value]);const w=u.useCallback(async T=>{if(T.length<O){$([]),z(!1);return}L(!0),z(!0);try{const F=await g(T);$(F),N(!0)}catch{$([])}finally{L(!1)}},[g,O]),M=u.useCallback(T=>{const F=T.target.value;v(F),h==null||h({value:F,image_url:null}),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{w(F)},f)},[h,w,f]),C=u.useCallback(T=>{v(T.value),$([]),N(!1),z(!1),h==null||h({value:T.value,image_url:T.image_url})},[h]),I=u.useCallback(()=>{setTimeout(()=>{N(!1)},150)},[]),k=u.useCallback(()=>{x.length>0&&N(!0)},[x.length]);return u.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),a.jsxs(go,{ref:_,className:Le("container",e),$fullWidth:!!i,children:[n&&a.jsx(fo,{variant:d,className:Le("label",r==null?void 0:r.label),children:n}),a.jsxs(xo,{children:[a.jsx(Oo,{...y,ref:l,type:"text",value:S,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:Le("input",r==null?void 0:r.input)}),b&&a.jsx($o,{children:a.jsx(Lt,{size:"xs"})})]}),a.jsx(So,{$open:j&&H,className:Le("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(T=>a.jsxs(yo,{onClick:()=>C(T),className:Le("item",r==null?void 0:r.item),children:[T.image_url&&a.jsx(vo,{src:T.image_url,alt:T.value}),a.jsx(Co,{children:T.value})]},T.id)):!b&&a.jsx(mo,{children:m})})]})},_t={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Mt={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 r=Mt[e];return r||Mt.normal},re=e=>{const r=_t[e];return r||_t.default},Po=e=>e?"auto":"fit-content",zo=s.button`
272
+ animation: ${Lo} 0.8s linear infinite;
273
+ `,zo=A.newClassNameGetter("spinner"),Lt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Po,{...n,ref:o,className:zo("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),Eo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:p,onChange:h,onSearch:g,debounceMs:f=300,minChars:O=1,noResultsMessage:m="No results found",...y})=>{const[S,C]=u.useState((p==null?void 0:p.value)??""),[x,$]=u.useState([]),[b,L]=u.useState(!1),[E,T]=u.useState(!1),[V,z]=u.useState(!1),D=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&C(p.value)},[p==null?void 0:p.value]);const w=u.useCallback(async N=>{if(N.length<O){$([]),z(!1);return}L(!0),z(!0);try{const F=await g(N);$(F),T(!0)}catch{$([])}finally{L(!1)}},[g,O]),M=u.useCallback(N=>{const F=N.target.value;C(F),h==null||h({value:F,image_url:null}),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{w(F)},f)},[h,w,f]),v=u.useCallback(N=>{C(N.value),$([]),T(!1),z(!1),h==null||h({value:N.value,image_url:N.image_url})},[h]),I=u.useCallback(()=>{setTimeout(()=>{T(!1)},150)},[]),k=u.useCallback(()=>{x.length>0&&T(!0)},[x.length]);return u.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),a.jsxs(Oo,{ref:D,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx($o,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(So,{children:[a.jsx(yo,{...y,ref:l,type:"text",value:S,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),b&&a.jsx(Co,{children:a.jsx(Lt,{size:"xs"})})]}),a.jsx(vo,{$open:E&&V,className:ke("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(N=>a.jsxs(mo,{onClick:()=>v(N),className:ke("item",r==null?void 0:r.item),children:[N.image_url&&a.jsx(wo,{src:N.image_url,alt:N.value}),a.jsx(Ro,{children:N.value})]},N.id)):!b&&a.jsx(ko,{children:m})})]})},Dt={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Mt={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 r=Mt[e];return r||Mt.normal},re=e=>{const r=Dt[e];return r||Dt.default},jo=e=>e?"auto":"fit-content",No=s.button`
278
274
  display: flex;
279
275
  gap: 6px;
280
276
  text-decoration: none;
281
277
  align-items: center;
282
278
  justify-content: center;
283
- width: ${e=>e.$iconOnly?re(e.$size).height:Po(!!e.$fullWidth)};
279
+ width: ${e=>e.$iconOnly?re(e.$size).height:jo(!!e.$fullWidth)};
284
280
  color: ${e=>J(e.$variant).color.static};
285
281
  background-color: ${e=>J(e.$variant).background.static};
286
282
  height: ${e=>re(e.$size).height};
@@ -300,17 +296,13 @@
300
296
  border-color: ${e=>J(e.$variant).borderColor.active};
301
297
  }
302
298
 
303
- &:focus-visible {
304
- outline-color: ${t.alpha(t.COLORS["iron-grey"],30)};
305
- }
306
-
307
299
  &:disabled {
308
300
  cursor: not-allowed;
309
301
  color: ${e=>J(e.$variant).color.disabled};
310
302
  background-color: ${e=>J(e.$variant).background.disabled};
311
303
  border-color: ${e=>J(e.$variant).borderColor.disabled};
312
304
  }
313
- `,jo=s.div`
305
+ `,To=s.div`
314
306
  display: grid;
315
307
  place-items: center;
316
308
  width: ${e=>re(e.$size).iconSize};
@@ -320,19 +312,19 @@
320
312
  width: ${e=>re(e.$size).iconSize};
321
313
  height: ${e=>re(e.$size).iconSize};
322
314
  }
323
- `,Eo=s.span`
315
+ `,Io=s.span`
324
316
  font-weight: 600;
325
317
  overflow: hidden;
326
318
  white-space: nowrap;
327
319
  text-overflow: ellipsis;
328
- `,To=s(a.LoaderCircle)`
320
+ `,Ao=s(a.LoaderCircle)`
329
321
  width: ${e=>re(e.$size).iconSize};
330
322
  height: ${e=>re(e.$size).iconSize};
331
323
  animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
332
- `,No=s.div`
324
+ `,_o=s.div`
333
325
  display: flex;
334
326
  gap: 3px;
335
- `,Io=s.span`
327
+ `,Do=s.span`
336
328
  text-align: center;
337
329
  display: flex;
338
330
  justify-content: center;
@@ -345,28 +337,24 @@
345
337
  border-radius: 4px;
346
338
  width: fit-content;
347
339
  background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
348
- `,Ao=A.newClassNameGetter("key-symbol"),Sr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(Io,{...n,ref:r,className:Ao("container",e),$variant:i,children:o}):null,Ft=A.newClassNameGetter("key-bindings"),yr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(No,{...l,ref:i,className:Ft("container",e),children:c.map(d=>a.jsx(Sr,{symbol:d,className:Ft("item",r==null?void 0:r.item),variant:n},d))})},Bt=A.newClassNameGetter("button"),_e=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:h=[],size:g="default",type:f="button",variant:O="normal",...m})=>{const y=u.useRef(null);u.useImperativeHandle(p,()=>y.current,[]),t.useKeyBinding(h,()=>{var v;(v=y.current)==null||v.click()});const S=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(zo,{...m,onClick:d,ref:y,type:S,disabled:i,className:Bt("container",r),$variant:O,$size:g,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(To,{$size:g}),l&&!c&&a.jsx(jo,{$size:g,children:l}),e&&a.jsx(Eo,{className:Bt("label",o==null?void 0:o.label),children:e}),a.jsx(yr,{keys:h,variant:O==="system"?"light":"dark"})]})},Do=s.div`
340
+ `,Mo=A.newClassNameGetter("key-symbol"),Cr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(Do,{...n,ref:r,className:Mo("container",e),$variant:i,children:o}):null,Ft=A.newClassNameGetter("key-bindings"),vr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(_o,{...l,ref:i,className:Ft("container",e),children:c.map(d=>a.jsx(Cr,{symbol:d,className:Ft("item",r==null?void 0:r.item),variant:n},d))})},Bt=A.newClassNameGetter("button"),De=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:h=[],size:g="default",type:f="button",variant:O="normal",...m})=>{const y=u.useRef(null);u.useImperativeHandle(p,()=>y.current,[]),t.useKeyBinding(h,()=>{var C;(C=y.current)==null||C.click()});const S=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(No,{...m,onClick:d,ref:y,type:S,disabled:i,className:Bt("container",r),$variant:O,$size:g,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(Ao,{$size:g}),l&&!c&&a.jsx(To,{$size:g,children:l}),e&&a.jsx(Io,{className:Bt("label",o==null?void 0:o.label),children:e}),a.jsx(vr,{keys:h,variant:O==="system"?"light":"dark"})]})},Fo=s.div`
349
341
  background-color: ${t.COLORS.white};
350
342
  border-radius: 16px;
351
343
  border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
352
344
  box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
353
- `,_o=A.newClassNameGetter("card"),Mo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Do,{...l,ref:o,className:_o("container",r),$border:i,$shadow:n,children:e}),Yt={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}},ge=e=>Yt[e]??Yt.normal,Fo=s.label`
345
+ `,Bo=A.newClassNameGetter("card"),Yo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Fo,{...l,ref:o,className:Bo("container",r),$border:i,$shadow:n,children:e}),Yt={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}},ye=e=>Yt[e]??Yt.normal,Vo=s.label`
354
346
  display: inline-flex;
355
347
  align-items: flex-start;
356
348
  gap: 8px;
357
349
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
358
350
  opacity: ${e=>e.$disabled?.5:1};
359
-
360
- &:has(input:focus-visible) > span:first-of-type {
361
- box-shadow: 0 0 0 2px ${e=>ge(e.$variant).box.focusShadow};
362
- }
363
- `,Bo=s.input`
351
+ `,Ho=s.input`
364
352
  position: absolute;
365
353
  opacity: 0;
366
354
  width: 0;
367
355
  height: 0;
368
356
  pointer-events: none;
369
- `,Yo=s.span`
357
+ `,Go=s.span`
370
358
  display: inline-flex;
371
359
  align-items: center;
372
360
  justify-content: center;
@@ -375,17 +363,17 @@
375
363
  height: 18px;
376
364
  border-radius: 6px;
377
365
  border: 1.5px solid
378
- ${e=>e.$checked||e.$indeterminate?ge(e.$variant).box.borderChecked:ge(e.$variant).box.border};
379
- background-color: ${e=>e.$checked||e.$indeterminate?ge(e.$variant).box.backgroundChecked:ge(e.$variant).box.background};
366
+ ${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.borderChecked:ye(e.$variant).box.border};
367
+ background-color: ${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.backgroundChecked:ye(e.$variant).box.background};
380
368
  transition:
381
369
  border-color 0.15s ease,
382
370
  background-color 0.15s ease,
383
371
  box-shadow 0.15s ease;
384
- `,Ho=s.span`
372
+ `,Wo=s.span`
385
373
  display: inline-flex;
386
374
  align-items: center;
387
375
  justify-content: center;
388
- color: ${e=>ge(e.$variant).icon};
376
+ color: ${e=>ye(e.$variant).icon};
389
377
  opacity: ${e=>e.$visible?1:0};
390
378
  transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
391
379
  transition:
@@ -396,11 +384,11 @@
396
384
  width: 12px;
397
385
  height: 12px;
398
386
  }
399
- `,Vo=s.span`
387
+ `,Uo=s.span`
400
388
  font-size: 14px;
401
389
  font-weight: 500;
402
390
  line-height: 1.4;
403
- color: ${e=>ge(e.$variant).label};
391
+ color: ${e=>ye(e.$variant).label};
404
392
  user-select: none;
405
393
 
406
394
  a {
@@ -412,7 +400,7 @@
412
400
  text-decoration: none;
413
401
  }
414
402
  }
415
- `,Pe=A.newClassNameGetter("checkbox"),tt=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(Fo,{className:Pe("container",r),$disabled:!!i,$variant:p,children:[a.jsx(Bo,{...h,ref:d,type:"checkbox",className:Pe("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Yo,{className:Pe("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Ho,{className:Pe("icon",o==null?void 0:o.icon),$visible:n||e,$variant:p,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Vo,{className:Pe("label",o==null?void 0:o.label),$variant:p,children:l})]}),Ht={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)}}},ue=e=>Ht[e]??Ht.normal,Go=s.label`
403
+ `,Le=A.newClassNameGetter("checkbox"),tt=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(Vo,{className:Le("container",r),$disabled:!!i,$variant:p,children:[a.jsx(Ho,{...h,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Go,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Wo,{className:Le("icon",o==null?void 0:o.icon),$visible:n||e,$variant:p,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Uo,{className:Le("label",o==null?void 0:o.label),$variant:p,children:l})]}),Vt={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)}}},ue=e=>Vt[e]??Vt.normal,Xo=s.label`
416
404
  display: grid;
417
405
  grid-template-columns: auto 1fr;
418
406
  align-items: start;
@@ -433,15 +421,10 @@
433
421
  border-color: ${e=>{const r=ue(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
434
422
  }
435
423
 
436
- &:has(:focus-visible) {
437
- outline: none;
438
- box-shadow: 0 0 0 3px ${e=>ue(e.$variant).focusRing};
439
- }
440
-
441
424
  .vacano_checkbox_container {
442
425
  pointer-events: none;
443
426
  }
444
- `,Wo=s.input`
427
+ `,qo=s.input`
445
428
  position: absolute;
446
429
  width: 1px;
447
430
  height: 1px;
@@ -451,12 +434,12 @@
451
434
  clip: rect(0, 0, 0, 0);
452
435
  white-space: nowrap;
453
436
  border: 0;
454
- `,Xo=s.div`
437
+ `,Ko=s.div`
455
438
  display: flex;
456
439
  flex-direction: column;
457
440
  gap: 2px;
458
441
  min-width: 0;
459
- `,Uo=s.span`
442
+ `,Zo=s.span`
460
443
  font-size: 14px;
461
444
  font-weight: 500;
462
445
  line-height: 1.4;
@@ -465,7 +448,7 @@
465
448
  label[data-disabled='true'] & {
466
449
  color: ${e=>ue(e.$variant).label.disabled};
467
450
  }
468
- `,qo=s.span`
451
+ `,Jo=s.span`
469
452
  font-size: 12px;
470
453
  font-weight: 400;
471
454
  line-height: 1.4;
@@ -474,21 +457,21 @@
474
457
  label[data-disabled='true'] & {
475
458
  color: ${e=>ue(e.$variant).description.disabled};
476
459
  }
477
- `,He=A.newClassNameGetter("checkbox-card"),Ko=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Go,{className:He("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Wo,{...g,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(tt,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Xo,{className:He("content",o==null?void 0:o.content),children:[a.jsx(Uo,{className:He("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(qo,{className:He("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Zo=s.div`
460
+ `,Ve=A.newClassNameGetter("checkbox-card"),Qo=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Xo,{className:Ve("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(qo,{...g,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(tt,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Ko,{className:Ve("content",o==null?void 0:o.content),children:[a.jsx(Zo,{className:Ve("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Jo,{className:Ve("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),Ht={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ei=s.div`
478
461
  display: flex;
479
462
  flex-direction: column;
480
463
  gap: 8px;
481
- `,Jo=s.span`
464
+ `,ti=s.span`
482
465
  font-size: 13px;
483
466
  font-weight: 500;
484
467
  line-height: 1.5;
485
- color: ${e=>e.$disabled?Vt.label.disabledColor:Vt.label.color};
468
+ color: ${e=>e.$disabled?Ht.label.disabledColor:Ht.label.color};
486
469
  margin-bottom: 4px;
487
- `,Qo=s.div`
470
+ `,ri=s.div`
488
471
  display: flex;
489
472
  flex-direction: column;
490
473
  gap: 12px;
491
- `,at=A.newClassNameGetter("checkbox-group"),ei=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...p})=>{const h=(g,f)=>{n(f?[...d,g]:d.filter(O=>O!==g))};return a.jsxs(Zo,{...p,ref:c,className:at("container",e),children:[i&&a.jsx(Jo,{className:at("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Qo,{className:at("options",r==null?void 0:r.options),children:l.map(g=>a.jsx(tt,{className:r==null?void 0:r.checkbox,checked:d.includes(g.value),label:g.label,disabled:o,onChange:f=>h(g.value,f.target.checked)},g.value))})]})},Gt={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)}},mt=e=>Gt[e]??Gt.gray,ti=s.span`
474
+ `,at=A.newClassNameGetter("checkbox-group"),oi=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...p})=>{const h=(g,f)=>{n(f?[...d,g]:d.filter(O=>O!==g))};return a.jsxs(ei,{...p,ref:c,className:at("container",e),children:[i&&a.jsx(ti,{className:at("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(ri,{className:at("options",r==null?void 0:r.options),children:l.map(g=>a.jsx(tt,{className:r==null?void 0:r.checkbox,checked:d.includes(g.value),label:g.label,disabled:o,onChange:f=>h(g.value,f.target.checked)},g.value))})]})},Gt={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)}},mt=e=>Gt[e]??Gt.gray,ii=s.span`
492
475
  display: inline-flex;
493
476
  align-items: center;
494
477
  gap: 4px;
@@ -500,7 +483,7 @@
500
483
  line-height: 1.5;
501
484
  background-color: ${e=>mt(e.$variant).background};
502
485
  color: ${e=>mt(e.$variant).color};
503
- `,ri=s.button`
486
+ `,ni=s.button`
504
487
  display: inline-flex;
505
488
  align-items: center;
506
489
  justify-content: center;
@@ -522,10 +505,10 @@
522
505
  width: 14px;
523
506
  height: 14px;
524
507
  }
525
- `,oi=s.span`
508
+ `,ai=s.span`
526
509
  flex: 1 0 auto;
527
510
  text-align: center;
528
- `,lt=A.newClassNameGetter("chip"),Qe=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ti,{...d,ref:l,className:lt("container",r),$variant:c,$deletable:!!i,children:[a.jsx(oi,{className:lt("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ri,{type:"button",className:lt("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),ii="Confirm",ni="Cancel",ai=ae.keyframes`
511
+ `,lt=A.newClassNameGetter("chip"),Qe=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ii,{...d,ref:l,className:lt("container",r),$variant:c,$deletable:!!i,children:[a.jsx(ai,{className:lt("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ni,{type:"button",className:lt("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),li="Confirm",di="Cancel",ci=be.keyframes`
529
512
  from {
530
513
  opacity: 0;
531
514
  transform: translateX(-50%) translateY(100%);
@@ -534,7 +517,7 @@
534
517
  opacity: 1;
535
518
  transform: translateX(-50%) translateY(0);
536
519
  }
537
- `,li=ae.keyframes`
520
+ `,si=be.keyframes`
538
521
  from {
539
522
  opacity: 1;
540
523
  transform: translateX(-50%) translateY(0);
@@ -543,7 +526,7 @@
543
526
  opacity: 0;
544
527
  transform: translateX(-50%) translateY(100%);
545
528
  }
546
- `,di=s.div`
529
+ `,pi=s.div`
547
530
  position: fixed;
548
531
  bottom: 24px;
549
532
  left: 50%;
@@ -558,49 +541,49 @@
558
541
  box-shadow:
559
542
  0 4px 6px -1px rgba(0, 0, 0, 0.1),
560
543
  0 2px 4px -2px rgba(0, 0, 0, 0.1);
561
- animation: ${({$open:e})=>e?ai:li} 0.2s ease-out forwards;
544
+ animation: ${({$open:e})=>e?ci:si} 0.2s ease-out forwards;
562
545
  z-index: 1000;
563
- `,ci=s.p`
546
+ `,ui=s.p`
564
547
  margin: 0;
565
548
  font-size: 14px;
566
549
  color: ${t.COLORS.black};
567
550
  white-space: nowrap;
568
- `,si=s.div`
551
+ `,hi=s.div`
569
552
  display: flex;
570
553
  align-items: center;
571
554
  gap: 8px;
572
- `,ze=A.newClassNameGetter("confirmation"),pi=({cancelBindings:e,cancelLabel:r=ni,className:o,classnames:i,confirmLabel:n=ii,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:g,submitBindings:f,...O})=>h?a.jsxs(di,{...O,ref:g,className:ze("container",o),$open:h,children:[a.jsx(ci,{className:ze("message",i==null?void 0:i.message),children:c}),a.jsxs(si,{className:ze("actions",i==null?void 0:i.actions),children:[a.jsx(_e,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:ze("cancel-button",i==null?void 0:i.cancelButton),children:r}),a.jsx(_e,{variant:"danger",size:"compact",onClick:p,loading:l,keyBindings:f,className:ze("confirm-button",i==null?void 0:i.confirmButton),children:n})]})]}):null,je={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`},ui=s.div`
555
+ `,Pe=A.newClassNameGetter("confirmation"),bi=({cancelBindings:e,cancelLabel:r=di,className:o,classnames:i,confirmLabel:n=li,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:g,submitBindings:f,...O})=>h?a.jsxs(pi,{...O,ref:g,className:Pe("container",o),$open:h,children:[a.jsx(ui,{className:Pe("message",i==null?void 0:i.message),children:c}),a.jsxs(hi,{className:Pe("actions",i==null?void 0:i.actions),children:[a.jsx(De,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:Pe("cancel-button",i==null?void 0:i.cancelButton),children:r}),a.jsx(De,{variant:"danger",size:"compact",onClick:p,loading:l,keyBindings:f,className:Pe("confirm-button",i==null?void 0:i.confirmButton),children:n})]})]}):null,ze={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`},gi=s.div`
573
556
  width: 100%;
574
557
 
575
558
  ${t.mediaUp("sm")} {
576
- max-width: ${je.sm};
559
+ max-width: ${ze.sm};
577
560
  }
578
561
 
579
562
  ${t.mediaUp("md")} {
580
- max-width: ${je.md};
563
+ max-width: ${ze.md};
581
564
  }
582
565
 
583
566
  ${t.mediaUp("lg")} {
584
- max-width: ${je.lg};
567
+ max-width: ${ze.lg};
585
568
  }
586
569
 
587
570
  ${t.mediaUp("xl")} {
588
- max-width: ${je.xl};
571
+ max-width: ${ze.xl};
589
572
  }
590
573
 
591
574
  ${t.mediaUp("2xl")} {
592
- max-width: ${je["2xl"]};
575
+ max-width: ${ze["2xl"]};
593
576
  }
594
- `,hi=A.newClassNameGetter("container"),bi=({children:e,className:r,ref:o,...i})=>a.jsx(ui,{...i,ref:o,className:hi("container",r),children:e}),Je={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},ye={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)}},le=36,rt=2,gi=12,vr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),h=c%12||12,g=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),O=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),y=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),S=L=>L.toString().padStart(2,"0"),v=L=>L.toString().padStart(2," "),x=L=>`\0${L}\0`,$=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",y],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",S(n+1)],["_2","DAYSPACE",v(l)],["02","DAYPAD",S(l)],["15","HOURTWENTYFOUR",S(c)],["03","HOURTWELVEPAD",S(h)],["04","MINUTE",S(d)],["05","SECOND",S(p)],["PM","AMPMUP",g?"PM":"AM"],["pm","AMPMLOW",g?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let b=r;for(const[L,j]of $)b=b.split(L).join(x(j));for(const[,L,j]of $)b=b.split(x(L)).join(j);return b},fi=(e,r)=>new Date(e,r+1,0).getDate(),xi=(e,r)=>new Date(e,r,1).getDay(),Oi=(e,r,o=1)=>{const i=fi(e,r);let l=xi(e,r)-o;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},$i=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Si=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Xt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),yi=(e,r)=>e.getFullYear()===r.getFullYear(),Ut=(e,r,o,i,n)=>{const l=new Date(e,r,o);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},qt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},Kt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),vi=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ci=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},mi=s.div`
577
+ `,fi=A.newClassNameGetter("container"),xi=({children:e,className:r,ref:o,...i})=>a.jsx(gi,{...i,ref:o,className:fi("container",r),children:e}),Je={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Ee={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)}},oe=36,rt=2,Oi=12,mr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),h=c%12||12,g=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),O=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),y=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),S=L=>L.toString().padStart(2,"0"),C=L=>L.toString().padStart(2," "),x=L=>`\0${L}\0`,$=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",y],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",S(n+1)],["_2","DAYSPACE",C(l)],["02","DAYPAD",S(l)],["15","HOURTWENTYFOUR",S(c)],["03","HOURTWELVEPAD",S(h)],["04","MINUTE",S(d)],["05","SECOND",S(p)],["PM","AMPMUP",g?"PM":"AM"],["pm","AMPMLOW",g?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let b=r;for(const[L,E]of $)b=b.split(L).join(x(E));for(const[,L,E]of $)b=b.split(x(L)).join(E);return b},$i=(e,r)=>new Date(e,r+1,0).getDate(),Si=(e,r)=>new Date(e,r,1).getDay(),yi=(e,r,o=1)=>{const i=$i(e,r);let l=Si(e,r)-o;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},Ci=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},vi=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Ut=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),mi=(e,r)=>e.getFullYear()===r.getFullYear(),Xt=(e,r,o,i,n)=>{const l=new Date(e,r,o);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},qt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},Kt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),wi=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ri=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},ki=s.div`
595
578
  position: relative;
596
579
  display: inline-flex;
597
580
  flex-direction: column;
598
581
  gap: 2px;
599
582
  min-width: 180px;
600
583
  width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
601
- `,wi=s(de)`
584
+ `,Li=s(ie)`
602
585
  margin-left: 6px;
603
- `,Ri=s.button`
586
+ `,Pi=s.button`
604
587
  display: flex;
605
588
  align-items: center;
606
589
  justify-content: space-between;
@@ -614,55 +597,51 @@
614
597
  height: ${({$size:e})=>Je[e].height};
615
598
  padding: ${({$size:e})=>Je[e].padding};
616
599
  border-radius: ${({$size:e})=>Je[e].radius};
617
- color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?ye[e].color[r?"disabled":"static"]:ye[e].placeholder[r?"disabled":"static"]};
600
+ color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?Ee[e].color[r?"disabled":"static"]:Ee[e].placeholder[r?"disabled":"static"]};
618
601
  border: 1px solid
619
- ${({$variant:e,$disabled:r})=>ye[e].border[r?"disabled":"static"]};
620
- background-color: ${({$variant:e,$disabled:r})=>ye[e].background[r?"disabled":"static"]};
621
-
622
- &:focus-visible {
623
- outline: 2px solid ${({$variant:e})=>ye[e].focus};
624
- }
602
+ ${({$variant:e,$disabled:r})=>Ee[e].border[r?"disabled":"static"]};
603
+ background-color: ${({$variant:e,$disabled:r})=>Ee[e].background[r?"disabled":"static"]};
625
604
 
626
605
  ${({$open:e,$variant:r})=>e&&`
627
- outline: 2px solid ${ye[r].focus};
606
+ outline: 2px solid ${Ee[r].focus};
628
607
  `}
629
- `,ki=s.span`
608
+ `,zi=s.span`
630
609
  flex: 1;
631
610
  overflow: hidden;
632
611
  text-overflow: ellipsis;
633
612
  white-space: nowrap;
634
- `,Li=s.span`
613
+ `,Ei=s.span`
635
614
  display: flex;
636
615
  align-items: center;
637
616
  justify-content: center;
638
617
  flex-shrink: 0;
639
618
  transition: transform 0.15s ease;
640
619
  transform: ${({$open:e})=>e?"rotate(180deg)":"rotate(0deg)"};
641
- `,Cr=`
620
+ `,wr=`
642
621
  z-index: 100;
643
622
  background-color: ${t.COLORS.white};
644
623
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
645
624
  border-radius: 12px;
646
625
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
647
- padding: ${gi}px;
648
- `,mr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Pi=s.div`
626
+ padding: ${Oi}px;
627
+ `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",ji=s.div`
649
628
  position: absolute;
650
629
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
651
630
  left: 0;
652
- ${Cr}
631
+ ${wr}
653
632
  opacity: ${({$open:e})=>e?1:0};
654
633
  visibility: ${({$open:e})=>e?"visible":"hidden"};
655
- transform: ${({$open:e,$position:r})=>mr(e,r)};
634
+ transform: ${({$open:e,$position:r})=>Rr(e,r)};
656
635
  transition:
657
636
  opacity 0.15s ease,
658
637
  transform 0.15s ease,
659
638
  visibility 0.15s;
660
- `,zi=s.div`
639
+ `,Ni=s.div`
661
640
  position: fixed;
662
- ${Cr}
641
+ ${wr}
663
642
  opacity: ${({$open:e})=>e?1:0};
664
643
  visibility: ${({$open:e})=>e?"visible":"hidden"};
665
- transform: ${({$open:e,$position:r})=>mr(e,r)};
644
+ transform: ${({$open:e,$position:r})=>Rr(e,r)};
666
645
  transition:
667
646
  opacity 0.15s ease,
668
647
  transform 0.15s ease,
@@ -688,11 +667,7 @@
688
667
  &:hover {
689
668
  background-color: ${t.alpha(t.COLORS.black,5)};
690
669
  }
691
-
692
- &:focus-visible {
693
- outline: 2px solid ${t.alpha(t.COLORS.black,20)};
694
- }
695
- `,ve=s.button`
670
+ `,Oe=s.button`
696
671
  display: flex;
697
672
  align-items: center;
698
673
  justify-content: center;
@@ -708,10 +683,6 @@
708
683
  background-color: ${t.alpha(t.COLORS.black,5)};
709
684
  }
710
685
 
711
- &:focus-visible {
712
- outline: 2px solid ${t.alpha(t.COLORS.black,20)};
713
- }
714
-
715
686
  &:disabled {
716
687
  opacity: 0.3;
717
688
  cursor: not-allowed;
@@ -723,30 +694,30 @@
723
694
  `,st=s.div`
724
695
  display: flex;
725
696
  gap: 4px;
726
- `,ji=s.div`
697
+ `,Ti=s.div`
727
698
  display: grid;
728
- grid-template-columns: repeat(7, ${le}px);
699
+ grid-template-columns: repeat(7, ${oe}px);
729
700
  gap: ${rt}px;
730
701
  margin-bottom: 4px;
731
- `,Ei=s.div`
702
+ `,Ii=s.div`
732
703
  display: flex;
733
704
  align-items: center;
734
705
  justify-content: center;
735
- height: ${le}px;
706
+ height: ${oe}px;
736
707
  font-size: 12px;
737
708
  font-weight: 500;
738
709
  color: ${t.alpha(t.COLORS.black,50)};
739
710
  text-transform: uppercase;
740
- `,Ti=s.div`
711
+ `,Ai=s.div`
741
712
  display: grid;
742
- grid-template-columns: repeat(7, ${le}px);
713
+ grid-template-columns: repeat(7, ${oe}px);
743
714
  gap: ${rt}px;
744
- `,Ni=s.button`
715
+ `,_i=s.button`
745
716
  display: flex;
746
717
  align-items: center;
747
718
  justify-content: center;
748
- width: ${le}px;
749
- height: ${le}px;
719
+ width: ${oe}px;
720
+ height: ${oe}px;
750
721
  border: none;
751
722
  border-radius: 8px;
752
723
  font-size: 13px;
@@ -763,20 +734,15 @@
763
734
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
764
735
  }
765
736
 
766
- &:focus-visible {
767
- outline: 2px solid ${t.alpha(t.COLORS.black,30)};
768
- outline-offset: 1px;
769
- }
770
-
771
737
  &:disabled {
772
738
  cursor: not-allowed;
773
739
  }
774
- `,Ii=s.div`
740
+ `,Di=s.div`
775
741
  display: grid;
776
742
  grid-template-columns: repeat(3, 1fr);
777
743
  gap: 8px;
778
- width: ${7*le+6*rt}px;
779
- `,Ai=s.button`
744
+ width: ${7*oe+6*rt}px;
745
+ `,Mi=s.button`
780
746
  display: flex;
781
747
  align-items: center;
782
748
  justify-content: center;
@@ -796,17 +762,12 @@
796
762
  &:hover:not(:disabled) {
797
763
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
798
764
  }
799
-
800
- &:focus-visible {
801
- outline: 2px solid ${t.alpha(t.COLORS.black,30)};
802
- outline-offset: 1px;
803
- }
804
- `,Di=s.div`
765
+ `,Fi=s.div`
805
766
  display: grid;
806
767
  grid-template-columns: repeat(3, 1fr);
807
768
  gap: 8px;
808
- width: ${7*le+6*rt}px;
809
- `,_i=s.button`
769
+ width: ${7*oe+6*rt}px;
770
+ `,Bi=s.button`
810
771
  display: flex;
811
772
  align-items: center;
812
773
  justify-content: center;
@@ -826,15 +787,10 @@
826
787
  &:hover:not(:disabled) {
827
788
  background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
828
789
  }
829
-
830
- &:focus-visible {
831
- outline: 2px solid ${t.alpha(t.COLORS.black,30)};
832
- outline-offset: 1px;
833
- }
834
- `,Mi=s.div`
835
- width: ${le}px;
836
- height: ${le}px;
837
- `,K=A.newClassNameGetter("date-picker"),Ve=4,Fi=300,Bi=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:g="normal",disabled:f=!1,fullWidth:O=!1,label:m,portalRenderNode:y,open:S,onOpen:v,onClose:x,className:$,classnames:b,ref:L,...j})=>{const N=u.useMemo(()=>new Date,[]),[H,z]=u.useState(!1),[_,E]=u.useState({top:0,left:0}),[w,M]=u.useState("bottom"),[C,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,T]=u.useState(()=>e??N),[F,B]=u.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),V=u.useRef(null),P=u.useRef(null),D=u.useRef(null),U=S!==void 0,q=U?S:H,$e=i??Ci(o),Me=u.useMemo(()=>$i(l,c),[l,c]),ot=u.useMemo(()=>Si(l),[l]),_r=u.useMemo(()=>Oi(k.getFullYear(),k.getMonth(),c),[k,c]),Fe=u.useMemo(()=>vi(F+6,12),[F]),zt=u.useMemo(()=>e?vr(e,$e,l):null,[e,$e,l]),Mr=n??$e.replace(/2006|06|January|Jan|01|02/g,"__"),me=u.useCallback(()=>{var Re;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((Re=D.current)==null?void 0:Re.offsetHeight)??Fi,we=window.innerHeight-R.bottom-Ve,Be=R.top-Ve,Se=we<Y&&Be>we?"top":"bottom";if(M(Se),y){const Ye=Se==="bottom"?R.bottom+Ve:R.top-Y-Ve;E({top:Ye,left:R.left})}},[y]),jt=u.useCallback(()=>{if(f)return;U||z(!0),v==null||v(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,U,v,o,e,N]),Z=u.useCallback(()=>{U||z(!1),x==null||x()},[U,x]),Fr=u.useCallback(()=>{q?Z():jt()},[q,Z,jt]),Br=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Yr=u.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else T(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Hr=u.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(T(new Date(R,k.getMonth(),1)),I("months")):(T(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Vr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Gr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),Wr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Xr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Ur=u.useCallback(()=>{B(R=>R-12)},[]),qr=u.useCallback(()=>{B(R=>R+12)},[]),Et=u.useCallback(()=>{C==="days"?I("months"):C==="months"&&I("years")},[C]);u.useLayoutEffect(()=>{q&&me()},[q,me]),u.useEffect(()=>{const R=Se=>{const Re=Se.target,Ye=V.current&&!V.current.contains(Re),to=D.current&&!D.current.contains(Re);y?Ye&&to&&Z():Ye&&Z()},Y=Se=>{Se.key==="Escape"&&Z()},we=()=>{q&&y&&me()},Be=()=>{q&&y&&me()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",we,!0),window.addEventListener("resize",Be))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",we,!0),window.removeEventListener("resize",Be)}},[q,Z,y,me]);const Kr=Je[h].iconSize,Zr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:Et,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(st,{children:[a.jsx(ve,{onClick:Vr,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ve,{onClick:Gr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(ji,{children:Me.map((R,Y)=>a.jsx(Ei,{children:R},Y))}),a.jsx(Ti,{className:K("grid",b==null?void 0:b.grid),children:_r.map((R,Y)=>R===null?a.jsx(Mi,{},Y):a.jsx(Ni,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Wt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Wt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Ut(k.getFullYear(),k.getMonth(),R,d,p),disabled:Ut(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>Br(R),children:R},Y))})]}),Jr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:Et,type:"button",children:k.getFullYear()}),a.jsxs(st,{children:[a.jsx(ve,{onClick:Wr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ve,{onClick:Xr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ii,{className:K("grid",b==null?void 0:b.grid),children:ot.map((R,Y)=>a.jsx(Ai,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Xt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Xt(N,new Date(k.getFullYear(),Y,1)),$disabled:qt(k.getFullYear(),Y,d,p),disabled:qt(k.getFullYear(),Y,d,p),onClick:()=>Yr(Y),children:R},Y))})]}),Qr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(ct,{type:"button",style:{cursor:"default"},children:[Fe[0]," - ",Fe[Fe.length-1]]}),a.jsxs(st,{children:[a.jsx(ve,{onClick:Ur,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ve,{onClick:qr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{className:K("grid",b==null?void 0:b.grid),children:Fe.map(R=>a.jsx(_i,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?yi(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:Kt(R,d,p),disabled:Kt(R,d,p),onClick:()=>Hr(R),children:R},R))})]}),Tt=()=>{switch(C){case"days":return Zr();case"months":return Jr();case"years":return Qr()}},eo=y?Oe.createPortal(a.jsx(zi,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:_.top,left:_.left},children:Tt()}),y):a.jsx(Pi,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:Tt()});return a.jsxs(mi,{...j,ref:L??V,$fullWidth:O,className:K("container",$),children:[m&&a.jsx(wi,{children:m}),a.jsxs(Ri,{ref:P,type:"button",onClick:Fr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!zt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(ki,{children:zt??Mr}),a.jsx(Li,{$open:q,children:a.jsx(a.ChevronDown,{size:Kr})})]}),eo]})},Yi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Hi=(e,r)=>{switch(e){case"left":return`
790
+ `,Yi=s.div`
791
+ width: ${oe}px;
792
+ height: ${oe}px;
793
+ `,K=A.newClassNameGetter("date-picker"),He=4,Vi=300,Hi=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:g="normal",disabled:f=!1,fullWidth:O=!1,label:m,portalRenderNode:y,open:S,onOpen:C,onClose:x,className:$,classnames:b,ref:L,...E})=>{const T=u.useMemo(()=>new Date,[]),[V,z]=u.useState(!1),[D,j]=u.useState({top:0,left:0}),[w,M]=u.useState("bottom"),[v,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,N]=u.useState(()=>e??T),[F,B]=u.useState(()=>((e==null?void 0:e.getFullYear())??T.getFullYear())-6),H=u.useRef(null),P=u.useRef(null),_=u.useRef(null),X=S!==void 0,q=X?S:V,fe=i??Ri(o),Me=u.useMemo(()=>Ci(l,c),[l,c]),ot=u.useMemo(()=>vi(l),[l]),Br=u.useMemo(()=>yi(k.getFullYear(),k.getMonth(),c),[k,c]),Fe=u.useMemo(()=>wi(F+6,12),[F]),zt=u.useMemo(()=>e?mr(e,fe,l):null,[e,fe,l]),Yr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),ve=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=_.current)==null?void 0:we.offsetHeight)??Vi,me=window.innerHeight-R.bottom-He,Be=R.top-He,xe=me<Y&&Be>me?"top":"bottom";if(M(xe),y){const Ye=xe==="bottom"?R.bottom+He:R.top-Y-He;j({top:Ye,left:R.left})}},[y]),Et=u.useCallback(()=>{if(f)return;X||z(!0),C==null||C(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??T;N(R),B(R.getFullYear()-6)},[f,X,C,o,e,T]),Z=u.useCallback(()=>{X||z(!1),x==null||x()},[X,x]),Vr=u.useCallback(()=>{q?Z():Et()},[q,Z,Et]),Hr=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Gr=u.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else N(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Wr=u.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(N(new Date(R,k.getMonth(),1)),I("months")):(N(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Ur=u.useCallback(()=>{N(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Xr=u.useCallback(()=>{N(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),qr=u.useCallback(()=>{N(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Kr=u.useCallback(()=>{N(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Zr=u.useCallback(()=>{B(R=>R-12)},[]),Jr=u.useCallback(()=>{B(R=>R+12)},[]),jt=u.useCallback(()=>{v==="days"?I("months"):v==="months"&&I("years")},[v]);u.useLayoutEffect(()=>{q&&ve()},[q,ve]),u.useEffect(()=>{const R=xe=>{const we=xe.target,Ye=H.current&&!H.current.contains(we),io=_.current&&!_.current.contains(we);y?Ye&&io&&Z():Ye&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},me=()=>{q&&y&&ve()},Be=()=>{q&&y&&ve()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",me,!0),window.addEventListener("resize",Be))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",me,!0),window.removeEventListener("resize",Be)}},[q,Z,y,ve]);const Qr=Je[h].iconSize,eo=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:jt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ti,{children:Me.map((R,Y)=>a.jsx(Ii,{children:R},Y))}),a.jsx(Ai,{className:K("grid",b==null?void 0:b.grid),children:Br.map((R,Y)=>R===null?a.jsx(Yi,{},Y):a.jsx(_i,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Wt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Wt(T,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Xt(k.getFullYear(),k.getMonth(),R,d,p),disabled:Xt(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>Hr(R),children:R},Y))})]}),to=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:jt,type:"button",children:k.getFullYear()}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Kr,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:ot.map((R,Y)=>a.jsx(Mi,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Ut(e,new Date(k.getFullYear(),Y,1)):!1,$current:Ut(T,new Date(k.getFullYear(),Y,1)),$disabled:qt(k.getFullYear(),Y,d,p),disabled:qt(k.getFullYear(),Y,d,p),onClick:()=>Gr(Y),children:R},Y))})]}),ro=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(ct,{type:"button",style:{cursor:"default"},children:[Fe[0]," - ",Fe[Fe.length-1]]}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Zr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Jr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Fi,{className:K("grid",b==null?void 0:b.grid),children:Fe.map(R=>a.jsx(Bi,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?mi(e,new Date(R,0,1)):!1,$current:T.getFullYear()===R,$disabled:Kt(R,d,p),disabled:Kt(R,d,p),onClick:()=>Wr(R),children:R},R))})]}),Nt=()=>{switch(v){case"days":return eo();case"months":return to();case"years":return ro()}},oo=y?ge.createPortal(a.jsx(Ni,{ref:_,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:D.top,left:D.left},children:Nt()}),y):a.jsx(ji,{ref:_,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:Nt()});return a.jsxs(ki,{...E,ref:L??H,$fullWidth:O,className:K("container",$),children:[m&&a.jsx(Li,{children:m}),a.jsxs(Pi,{ref:P,type:"button",onClick:Vr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!zt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(zi,{children:zt??Yr}),a.jsx(Ei,{$open:q,children:a.jsx(a.ChevronDown,{size:Qr})})]}),oo]})},Gi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Wi=(e,r)=>{switch(e){case"left":return`
838
794
  top: 0;
839
795
  left: 0;
840
796
  height: 100%;
@@ -854,19 +810,19 @@
854
810
  left: 0;
855
811
  width: 100%;
856
812
  height: ${r};
857
- `}},Vi=s.div`
813
+ `}},Ui=s.div`
858
814
  position: fixed;
859
815
  z-index: 1001;
860
816
  background-color: ${t.COLORS.white};
861
817
  box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
862
- ${e=>Hi(e.$position,e.$size)}
863
- animation: ${e=>Yi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
864
- `,Gi=A.newClassNameGetter("drawer"),Wi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?Oe.createPortal(a.jsx(Vi,{...d,ref:l,className:Gi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Xi=s.div`
818
+ ${e=>Wi(e.$position,e.$size)}
819
+ animation: ${e=>Gi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
820
+ `,Xi=A.newClassNameGetter("drawer"),qi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.createPortal(a.jsx(Ui,{...d,ref:l,className:Xi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Ki=s.div`
865
821
  position: relative;
866
822
  display: inline-block;
867
- `,Ui=s.div`
823
+ `,Zi=s.div`
868
824
  cursor: pointer;
869
- `,wr=`
825
+ `,kr=`
870
826
  z-index: 100;
871
827
  min-width: 160px;
872
828
  padding: 8px;
@@ -874,39 +830,39 @@
874
830
  border: 1px solid ${t.COLORS.gray};
875
831
  border-radius: 8px;
876
832
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
877
- `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",qi=s.div`
833
+ `,Lr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ji=s.div`
878
834
  position: absolute;
879
835
  ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
880
836
  ${({$align:e})=>e==="left"?"left: 0;":"right: 0;"}
881
- ${wr}
837
+ ${kr}
882
838
  opacity: ${({$open:e})=>e?1:0};
883
839
  visibility: ${({$open:e})=>e?"visible":"hidden"};
884
- transform: ${({$open:e,$position:r})=>Rr(e,r)};
840
+ transform: ${({$open:e,$position:r})=>Lr(e,r)};
885
841
  transition:
886
842
  opacity 0.15s ease,
887
843
  transform 0.15s ease,
888
844
  visibility 0.15s;
889
- `,Ki=s.div`
845
+ `,Qi=s.div`
890
846
  position: fixed;
891
- ${wr}
847
+ ${kr}
892
848
  opacity: ${({$open:e})=>e?1:0};
893
849
  visibility: ${({$open:e})=>e?"visible":"hidden"};
894
- transform: ${({$open:e,$position:r})=>Rr(e,r)};
850
+ transform: ${({$open:e,$position:r})=>Lr(e,r)};
895
851
  transition:
896
852
  opacity 0.15s ease,
897
853
  transform 0.15s ease,
898
854
  visibility 0.15s;
899
- `,Ge=A.newClassNameGetter("dropdown"),We=4,Zi=100,Ji=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:p,trigger:h,...g})=>{const[f,O]=u.useState(!1),[m,y]=u.useState({top:0,left:0}),[S,v]=u.useState("bottom"),x=u.useRef(null),$=u.useRef(null),b=u.useRef(null),L=c!==void 0,j=L?c:f,N=u.useCallback(()=>{var T,F;if(!$.current)return;const E=$.current.getBoundingClientRect(),w=((T=b.current)==null?void 0:T.offsetHeight)??Zi,M=((F=b.current)==null?void 0:F.offsetWidth)??160,C=window.innerHeight-E.bottom-We,I=E.top-We,k=C<w&&I>C?"top":"bottom";if(v(k),d){let B;e==="left"?B=E.left:B=E.right-M;const V=k==="bottom"?E.bottom+We:E.top-w-We;y({top:V,left:B})}},[e,d]),H=u.useCallback(()=>{L?j?n==null||n():l==null||l():O(E=>{const w=!E;return w?l==null||l():n==null||n(),w})},[L,j,n,l]),z=u.useCallback(()=>{L||O(!1),n==null||n()},[L,n]);u.useLayoutEffect(()=>{j&&N()},[j,N]),u.useEffect(()=>{const E=I=>{const k=I.target,T=x.current&&!x.current.contains(k),F=b.current&&!b.current.contains(k);d?T&&F&&z():T&&z()},w=I=>{I.key==="Escape"&&z()},M=()=>{j&&d&&N()},C=()=>{j&&d&&N()};return j&&(document.addEventListener("mousedown",E),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",C))),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",C)}},[j,z,d,N]);const _=d?Oe.createPortal(a.jsx(Ki,{ref:b,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(qi,{ref:b,$align:e,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),children:r});return a.jsxs(Xi,{...g,ref:p??x,className:Ge("container",o),children:[a.jsx(Ui,{ref:$,onClick:H,className:Ge("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),_]})},Qi={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},en=s.span`
855
+ `,Ge=A.newClassNameGetter("dropdown"),We=4,en=100,tn=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:p,trigger:h,...g})=>{const[f,O]=u.useState(!1),[m,y]=u.useState({top:0,left:0}),[S,C]=u.useState("bottom"),x=u.useRef(null),$=u.useRef(null),b=u.useRef(null),L=c!==void 0,E=L?c:f,T=u.useCallback(()=>{var N,F;if(!$.current)return;const j=$.current.getBoundingClientRect(),w=((N=b.current)==null?void 0:N.offsetHeight)??en,M=((F=b.current)==null?void 0:F.offsetWidth)??160,v=window.innerHeight-j.bottom-We,I=j.top-We,k=v<w&&I>v?"top":"bottom";if(C(k),d){let B;e==="left"?B=j.left:B=j.right-M;const H=k==="bottom"?j.bottom+We:j.top-w-We;y({top:H,left:B})}},[e,d]),V=u.useCallback(()=>{L?E?n==null||n():l==null||l():O(j=>{const w=!j;return w?l==null||l():n==null||n(),w})},[L,E,n,l]),z=u.useCallback(()=>{L||O(!1),n==null||n()},[L,n]);u.useLayoutEffect(()=>{E&&T()},[E,T]),u.useEffect(()=>{const j=I=>{const k=I.target,N=x.current&&!x.current.contains(k),F=b.current&&!b.current.contains(k);d?N&&F&&z():N&&z()},w=I=>{I.key==="Escape"&&z()},M=()=>{E&&d&&T()},v=()=>{E&&d&&T()};return E&&(document.addEventListener("mousedown",j),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",v))),()=>{document.removeEventListener("mousedown",j),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",v)}},[E,z,d,T]);const D=d?ge.createPortal(a.jsx(Qi,{ref:b,$open:E,$position:S,className:Ge("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(Ji,{ref:b,$align:e,$open:E,$position:S,className:Ge("content",i==null?void 0:i.content),children:r});return a.jsxs(Ki,{...g,ref:p??x,className:Ge("container",o),children:[a.jsx(Zi,{ref:$,onClick:V,className:Ge("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),D]})},rn={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},on=s.span`
900
856
  display: block;
901
857
  font-size: 12px;
902
858
  font-weight: 500;
903
859
  line-height: 1.4;
904
- color: ${e=>Qi[e.$variant]};
905
- `,tn=A.newClassNameGetter("field-message"),rn=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(en,{...n,ref:o,className:tn("container",r),$variant:i,children:e}):null,on=s.div`
860
+ color: ${e=>rn[e.$variant]};
861
+ `,nn=A.newClassNameGetter("field-message"),an=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(on,{...n,ref:o,className:nn("container",r),$variant:i,children:e}):null,ln=s.div`
906
862
  display: flex;
907
863
  flex-direction: column;
908
864
  gap: 12px;
909
- `,nn=s.div`
865
+ `,dn=s.div`
910
866
  width: ${({$size:e})=>e}px;
911
867
  height: ${({$size:e})=>e}px;
912
868
  border-radius: 8px;
@@ -922,10 +878,10 @@
922
878
  height: 100%;
923
879
  object-fit: cover;
924
880
  }
925
- `,an=s.span`
881
+ `,cn=s.span`
926
882
  font-size: 12px;
927
883
  color: ${t.COLORS["iron-grey"]};
928
- `,ln=e=>`
884
+ `,sn=e=>`
929
885
  .${e} {
930
886
  padding: 7px 16px;
931
887
  font-size: 14px;
@@ -943,7 +899,7 @@
943
899
  .${e}:active {
944
900
  transform: translate(0, 1px);
945
901
  }
946
- `,dn=e=>`
902
+ `,pn=e=>`
947
903
  .${e} {
948
904
  display: flex;
949
905
  flex: 1 1 auto;
@@ -967,7 +923,7 @@
967
923
  max-height: 70vh;
968
924
  }
969
925
  }
970
- `,cn=e=>`
926
+ `,un=e=>`
971
927
  .${e} {
972
928
  padding: 7px 16px;
973
929
  font-size: 14px;
@@ -985,7 +941,7 @@
985
941
  .${e}:active {
986
942
  transform: translate(0, 1px);
987
943
  }
988
- `,sn=e=>`
944
+ `,hn=e=>`
989
945
  .${e} {
990
946
  display: flex;
991
947
  flex-direction: column;
@@ -1003,7 +959,7 @@
1003
959
  border-radius: 8px;
1004
960
  }
1005
961
  }
1006
- `,pn=e=>`
962
+ `,bn=e=>`
1007
963
  .${e} {
1008
964
  display: flex;
1009
965
  justify-content: flex-end;
@@ -1022,7 +978,7 @@
1022
978
  gap: 8px;
1023
979
  }
1024
980
  }
1025
- `,un=e=>`
981
+ `,gn=e=>`
1026
982
  .${e} {
1027
983
  display: flex;
1028
984
  justify-content: flex-start;
@@ -1044,7 +1000,7 @@
1044
1000
  font-size: 14px;
1045
1001
  }
1046
1002
  }
1047
- `,hn=e=>`
1003
+ `,fn=e=>`
1048
1004
  .${e} {
1049
1005
  display: block;
1050
1006
  z-index: 101;
@@ -1062,27 +1018,27 @@
1062
1018
  position: absolute;
1063
1019
  touch-action: none;
1064
1020
  }
1065
- `,bn=e=>`
1021
+ `,xn=e=>`
1066
1022
  .${e} {
1067
1023
  position: absolute;
1068
1024
  z-index: 2;
1069
1025
  background-color: rgba(0, 0, 0, 0.6);
1070
1026
  touch-action: none;
1071
1027
  }
1072
- `,gn=e=>`
1028
+ `,On=e=>`
1073
1029
  .${e} {
1074
1030
  position: absolute;
1075
1031
  z-index: 3;
1076
1032
  touch-action: none;
1077
1033
  }
1078
- `,fn=e=>`
1034
+ `,$n=e=>`
1079
1035
  .${e} {
1080
1036
  backface-visibility: hidden;
1081
1037
  perspective: 1000px;
1082
1038
  max-inline-size: unset !important;
1083
1039
  max-block-size: unset !important;
1084
1040
  }
1085
- `,xn=e=>`
1041
+ `,Sn=e=>`
1086
1042
  .${e} {
1087
1043
  position: absolute;
1088
1044
  z-index: 100;
@@ -1093,7 +1049,7 @@
1093
1049
  overflow: hidden;
1094
1050
  border-radius: 50%;
1095
1051
  }
1096
- `,On={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},$n={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Xe=(e,r)=>{const o=On[r],{h:i,v:n}=$n[r];return`
1052
+ `,yn={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},Cn={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Ue=(e,r)=>{const o=yn[r],{h:i,v:n}=Cn[r];return`
1097
1053
  .${e} {
1098
1054
  display: block;
1099
1055
  z-index: 102;
@@ -1119,7 +1075,7 @@
1119
1075
  ${n}: -12px;
1120
1076
  }
1121
1077
  }
1122
- `},Sn=e=>`
1078
+ `},vn=e=>`
1123
1079
  .${e} {
1124
1080
  display: flex;
1125
1081
  align-items: center;
@@ -1145,7 +1101,7 @@
1145
1101
  padding-bottom: env(safe-area-inset-bottom, 8px);
1146
1102
  }
1147
1103
  }
1148
- `,yn=e=>`
1104
+ `,mn=e=>`
1149
1105
  .${e} {
1150
1106
  backface-visibility: hidden;
1151
1107
  user-select: none;
@@ -1158,25 +1114,25 @@
1158
1114
  position: absolute;
1159
1115
  z-index: 1;
1160
1116
  }
1161
- `,vn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${vn(e)}`,W=e=>e||[],X=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Cn=e=>{const r={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)]},o=`
1162
- ${ln(r.applyButton[0])}
1163
- ${dn(r.body[0])}
1164
- ${cn(r.cancelButton[0])}
1165
- ${sn(r.container[0])}
1166
- ${pn(r.footer[0])}
1167
- ${un(r.header[0])}
1168
- ${hn(r.handlerMove[0])}
1169
- ${bn(r.portalArea[0])}
1170
- ${gn(r.portal[0])}
1171
- ${fn(r.previewImage[0])}
1172
- ${xn(r.preview[0])}
1173
- ${Xe(r.handlerResizeBottomLeft[0],"bl")}
1174
- ${Xe(r.handlerResizeBottomRight[0],"br")}
1175
- ${Xe(r.handlerResizeTopLeft[0],"tl")}
1176
- ${Xe(r.handlerResizeTopRight[0],"tr")}
1177
- ${Sn(r.root[0])}
1178
- ${yn(r.sourceImage[0])}
1179
- `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let mn=0;const wn=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++mn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},wt={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"]}},Rn=(e={},r={})=>wn({...wt,config:{...wt.config,...e},css:Cn(r)}),kn=(e,r)=>{var O;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let p,h,g=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(r.height/r.width),g=(l-h)/2),{width:p,height:h,left:f,top:g}},Ln=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},Pn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=Ln(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.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 zn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},jn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},En=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Tn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Nn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},In=e=>{var i;const r=e(),o=document.createElement("img");return X(o,(i=r.css)==null?void 0:i.previewImage),o},An=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.preview),o.appendChild(In(e)),o},Dn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.portal),o.appendChild(An(e)),o.appendChild(zn(e)),o.appendChild(Tn(e)),o.appendChild(Nn(e)),o.appendChild(jn(e)),o.appendChild(En(e)),o},_n=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Dn(e)),o},Mn=e=>{var i;const r=e(),o=document.createElement("img");return X(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Fn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.body),o.appendChild(Mn(e)),o.appendChild(_n(e)),o},Bn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return X(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Yn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return X(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Hn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return X(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Yn(e,o)),n.appendChild(Bn(e,r)),n},Vn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.header),o},Gn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return X(n,(l=i.css)==null?void 0:l.container),n.appendChild(Vn(e)),n.appendChild(Fn(e)),n.appendChild(Hn(e,r,o)),n},Wn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");X(n,(l=i.css)==null?void 0:l.root),n.appendChild(Gn(e,r,o)),document.body.appendChild(n)},Xn=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ae=new Map,Un={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},fe=(e,r)=>{if(Ae.has(e))return Ae.get(e);if(!r)return null;const o=r[Un[e]],i=document.querySelector(`.${o[0]}`);return Ae.set(e,i),i},qn=()=>{Ae.clear()},Kn=()=>{Ae.clear()},Zn=(e,r)=>{const o=fe("header",r.css);o&&(o.innerText=e)},Jn=(e,r)=>{const o=fe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=fe("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=fe("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=fe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},Qn=(e,r)=>{const o=fe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=fe("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},pt=1,ea=e=>{var m,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||pt,n=r.frame.height||pt,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,p=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),pt),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((y=o.getContext("2d"))==null||y.drawImage(f,d,p,h,h,0,0,g,g));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((S,v)=>{try{o.toBlob(x=>{if(o.remove(),!x){v(new Error(`Failed to create blob for type: image/${r.config.type}`));return}S([O,x])},`image/${r.config.type}`,r.config.compression)}catch(x){o.remove(),v(x)}})},ta=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,g=l.width-c.framePadding-n.size,f=c.framePadding,O=l.height-c.framePadding-n.size;d<h&&(d=h),d>g&&(d=g),p<f&&(p=f),p>O&&(p=O),o({portal:{...n,left:d,top:p}})},ra=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let g=n.size+Math.max(p,h);return g<d.minPortalSize&&(g=d.minPortalSize),n.top+g>c.height-d.framePadding&&(g=c.height-n.top-d.framePadding),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding),o({portal:{...l,size:g}})}case te.RESIZE_TR:{let g=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return g<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,g=d.minPortalSize),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(g=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:g}})}case te.RESIZE_TL:{const g=Math.min(p,h);let f=n.size-g,O=n.left+g,m=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,m=n.top+y}if(m<d.framePadding){const y=d.framePadding-m;m=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,m=m+y,f=f-y}return o({portal:{...l,top:m,left:O,size:f}})}case te.RESIZE_BL:{let g=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return g<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,g=d.minPortalSize),g+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,g=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,g=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:g}})}default:return}},Zt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},oa=(e,r)=>{var O,m,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(y=o.css)==null?void 0:y.root[0]}`);let c=null,d=null;const p=S=>{S.preventDefault();const{portal:v}=e(),x=Zt(S);if(S.target){const $=S.target.getAttribute("data-action"),b={X:x.pageX,Y:x.pageY,left:v.left,top:v.top,size:v.size};r({action:$,emitted:b})}},h=()=>{const{action:S}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,S&&r({action:null})},g=()=>{if(c=null,!d)return;const S=d;d=null;const{action:v}=e();if(v)switch(v){case te.MOVE:ta(S,e,r);break;default:ra(S,e,r)}},f=S=>{const{action:v}=e();v&&(S.preventDefault(),d=Zt(S),c===null&&(c=requestAnimationFrame(g)))};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))}},Jt=1024*1024,ia=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Jt).toFixed(2);return`File size (${(e.size/Jt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},na=(e,r,o,i,n,l,c)=>{const d=x=>{c?c(x):console.error(`HqCropper: ${x}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=r(),g=ia(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const m=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Kn(),l(),o(wt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),m()},v=x=>{x.preventDefault();const $=r();ea(r).then(([b,L])=>{i(b,L,$),S(x)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=x=>{const $=new Image;if(!x.target||typeof x.target.result!="string"){d("Can't load result image");return}$.src=x.target.result,$.onerror=()=>{d("Failed to load image")},$.onload=()=>{var j;Wn(r,v,S),qn(),n("fileName",Zn),n("sourceBase64",Jn),n("portal",Qn);const b=kn(r,$),L=Pn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(j=x.target)==null?void 0:j.result,sourceHeight:$.height,sourceWidth:$.width}),O=oa(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},aa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=Rn(r,o),p=Xn(h=>na(h,n,l,e,c,d,i));return{open:()=>p.click()}},ce={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Qt="vacano-image-cropper-styles",la=`
1117
+ `,wn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${wn(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Rn=e=>{const r={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)]},o=`
1118
+ ${sn(r.applyButton[0])}
1119
+ ${pn(r.body[0])}
1120
+ ${un(r.cancelButton[0])}
1121
+ ${hn(r.container[0])}
1122
+ ${bn(r.footer[0])}
1123
+ ${gn(r.header[0])}
1124
+ ${fn(r.handlerMove[0])}
1125
+ ${xn(r.portalArea[0])}
1126
+ ${On(r.portal[0])}
1127
+ ${$n(r.previewImage[0])}
1128
+ ${Sn(r.preview[0])}
1129
+ ${Ue(r.handlerResizeBottomLeft[0],"bl")}
1130
+ ${Ue(r.handlerResizeBottomRight[0],"br")}
1131
+ ${Ue(r.handlerResizeTopLeft[0],"tl")}
1132
+ ${Ue(r.handlerResizeTopRight[0],"tr")}
1133
+ ${vn(r.root[0])}
1134
+ ${mn(r.sourceImage[0])}
1135
+ `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let kn=0;const Ln=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++kn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},wt={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"]}},Pn=(e={},r={})=>Ln({...wt,config:{...wt.config,...e},css:Rn(r)}),zn=(e,r)=>{var O;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let p,h,g=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(r.height/r.width),g=(l-h)/2),{width:p,height:h,left:f,top:g}},En=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},jn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=En(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.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 Nn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},Tn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},In=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},An=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},_n=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},Dn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Mn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(Dn(e)),o},Fn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Mn(e)),o.appendChild(Nn(e)),o.appendChild(An(e)),o.appendChild(_n(e)),o.appendChild(Tn(e)),o.appendChild(In(e)),o},Bn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Fn(e)),o},Yn=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Vn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(Yn(e)),o.appendChild(Bn(e)),o},Hn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Gn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Wn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Gn(e,o)),n.appendChild(Hn(e,r)),n},Un=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},Xn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.container),n.appendChild(Un(e)),n.appendChild(Vn(e)),n.appendChild(Wn(e,r,o)),n},qn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(Xn(e,r,o)),document.body.appendChild(n)},Kn=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ae=new Map,Zn={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},pe=(e,r)=>{if(Ae.has(e))return Ae.get(e);if(!r)return null;const o=r[Zn[e]],i=document.querySelector(`.${o[0]}`);return Ae.set(e,i),i},Jn=()=>{Ae.clear()},Qn=()=>{Ae.clear()},ea=(e,r)=>{const o=pe("header",r.css);o&&(o.innerText=e)},ta=(e,r)=>{const o=pe("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=pe("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=pe("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=pe("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},ra=(e,r)=>{const o=pe("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=pe("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},pt=1,oa=e=>{var m,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||pt,n=r.frame.height||pt,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,p=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),pt),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((y=o.getContext("2d"))==null||y.drawImage(f,d,p,h,h,0,0,g,g));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((S,C)=>{try{o.toBlob(x=>{if(o.remove(),!x){C(new Error(`Failed to create blob for type: image/${r.config.type}`));return}S([O,x])},`image/${r.config.type}`,r.config.compression)}catch(x){o.remove(),C(x)}})},ia=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,g=l.width-c.framePadding-n.size,f=c.framePadding,O=l.height-c.framePadding-n.size;d<h&&(d=h),d>g&&(d=g),p<f&&(p=f),p>O&&(p=O),o({portal:{...n,left:d,top:p}})},na=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let g=n.size+Math.max(p,h);return g<d.minPortalSize&&(g=d.minPortalSize),n.top+g>c.height-d.framePadding&&(g=c.height-n.top-d.framePadding),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding),o({portal:{...l,size:g}})}case te.RESIZE_TR:{let g=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return g<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,g=d.minPortalSize),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(g=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:g}})}case te.RESIZE_TL:{const g=Math.min(p,h);let f=n.size-g,O=n.left+g,m=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,m=n.top+y}if(m<d.framePadding){const y=d.framePadding-m;m=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,m=m+y,f=f-y}return o({portal:{...l,top:m,left:O,size:f}})}case te.RESIZE_BL:{let g=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return g<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,g=d.minPortalSize),g+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,g=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,g=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:g}})}default:return}},Zt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},aa=(e,r)=>{var O,m,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(y=o.css)==null?void 0:y.root[0]}`);let c=null,d=null;const p=S=>{S.preventDefault();const{portal:C}=e(),x=Zt(S);if(S.target){const $=S.target.getAttribute("data-action"),b={X:x.pageX,Y:x.pageY,left:C.left,top:C.top,size:C.size};r({action:$,emitted:b})}},h=()=>{const{action:S}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,S&&r({action:null})},g=()=>{if(c=null,!d)return;const S=d;d=null;const{action:C}=e();if(C)switch(C){case te.MOVE:ia(S,e,r);break;default:na(S,e,r)}},f=S=>{const{action:C}=e();C&&(S.preventDefault(),d=Zt(S),c===null&&(c=requestAnimationFrame(g)))};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))}},Jt=1024*1024,la=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Jt).toFixed(2);return`File size (${(e.size/Jt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},da=(e,r,o,i,n,l,c)=>{const d=x=>{c?c(x):console.error(`HqCropper: ${x}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=r(),g=la(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const m=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Qn(),l(),o(wt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),m()},C=x=>{x.preventDefault();const $=r();oa(r).then(([b,L])=>{i(b,L,$),S(x)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=x=>{const $=new Image;if(!x.target||typeof x.target.result!="string"){d("Can't load result image");return}$.src=x.target.result,$.onerror=()=>{d("Failed to load image")},$.onload=()=>{var E;qn(r,C,S),Jn(),n("fileName",ea),n("sourceBase64",ta),n("portal",ra);const b=zn(r,$),L=jn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(E=x.target)==null?void 0:E.result,sourceHeight:$.height,sourceWidth:$.width}),O=aa(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},ca=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=Pn(r,o),p=Kn(h=>da(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"},Qt="vacano-image-cropper-styles",sa=`
1180
1136
  .vacano-cropper-root {
1181
1137
  background-color: rgba(0, 0, 0, 0.5);
1182
1138
  backdrop-filter: blur(4px);
@@ -1224,14 +1180,14 @@
1224
1180
  .vacano-cropper-apply-button:hover {
1225
1181
  background-color: ${t.COLORS["iron-grey"]};
1226
1182
  }
1227
- `,da=()=>{if(typeof document>"u"||document.getElementById(Qt))return;const e=document.createElement("style");e.id=Qt,e.textContent=la,document.head.appendChild(e)},ca={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"]},kr=(e={})=>{const{allowedTypes:r=ce.allowedTypes,applyLabel:o=ce.applyLabel,cancelLabel:i=ce.cancelLabel,compression:n=ce.compression,maxFileSize:l=ce.maxFileSize,onCrop:c,onError:d,outputSize:p=ce.outputSize,portalSize:h=ce.portalSize,type:g=ce.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(da(),f.current=aa((m,y,S)=>{y&&(c==null||c({base64:m,blob:y,state:S}))},{portalSize:h,outputSize:p,compression:n,type:g,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},ca,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,p,h,g])}},ut=A.newClassNameGetter("image-cropper"),sa=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:h,outputSize:g,portalSize:f,previewSize:O=120,ref:m,type:y,value:S,...v})=>{const[x,$]=u.useState(S??null),{open:b}=kr({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{$(L.base64),p==null||p(L)},onError:h,outputSize:g,portalSize:f,type:y});return a.jsxs(on,{...v,ref:m,className:ut("container",n),children:[a.jsx(nn,{$size:O,className:ut("preview",l==null?void 0:l.preview),children:x?a.jsx("img",{src:x,alt:"Preview"}):a.jsx(an,{children:"No image"})}),a.jsx(_e,{variant:"system",onClick:b,className:ut("button",l==null?void 0:l.button),style:{width:O},children:o})]})},er={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},tr={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)}},ie=e=>tr[e]??tr.normal,ht=e=>er[e]??er.default,pa=s.div`
1183
+ `,pa=()=>{if(typeof document>"u"||document.getElementById(Qt))return;const e=document.createElement("style");e.id=Qt,e.textContent=sa,document.head.appendChild(e)},ua={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"]},Pr=(e={})=>{const{allowedTypes:r=ae.allowedTypes,applyLabel:o=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:g=ae.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(pa(),f.current=ca((m,y,S)=>{y&&(c==null||c({base64:m,blob:y,state:S}))},{portalSize:h,outputSize:p,compression:n,type:g,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},ua,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,p,h,g])}},ut=A.newClassNameGetter("image-cropper"),ha=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:h,outputSize:g,portalSize:f,previewSize:O=120,ref:m,type:y,value:S,...C})=>{const[x,$]=u.useState(S??null),{open:b}=Pr({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{$(L.base64),p==null||p(L)},onError:h,outputSize:g,portalSize:f,type:y});return a.jsxs(ln,{...C,ref:m,className:ut("container",n),children:[a.jsx(dn,{$size:O,className:ut("preview",l==null?void 0:l.preview),children:x?a.jsx("img",{src:x,alt:"Preview"}):a.jsx(cn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:b,className:ut("button",l==null?void 0:l.button),style:{width:O},children:o})]})},er={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},tr={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)}},le=e=>tr[e]??tr.normal,ht=e=>er[e]??er.default,ba=s.div`
1228
1184
  display: grid;
1229
1185
  flex-direction: column;
1230
1186
  gap: 2px;
1231
1187
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1232
- `,ua=s(de)`
1188
+ `,ga=s(ie)`
1233
1189
  margin-left: 6px;
1234
- `,ha=s.input`
1190
+ `,fa=s.input`
1235
1191
  flex: 1;
1236
1192
  min-width: 0;
1237
1193
  outline: none;
@@ -1241,29 +1197,25 @@
1241
1197
  padding: ${e=>ht(e.$size).padding};
1242
1198
  border-radius: ${e=>ht(e.$size).radius};
1243
1199
 
1244
- color: ${e=>ie(e.$variant).color.static};
1245
- border: 1px solid ${e=>ie(e.$variant).border.static};
1246
- background-color: ${e=>ie(e.$variant).background.static};
1200
+ color: ${e=>le(e.$variant).color.static};
1201
+ border: 1px solid ${e=>le(e.$variant).border.static};
1202
+ background-color: ${e=>le(e.$variant).background.static};
1247
1203
 
1248
1204
  &::placeholder {
1249
- color: ${e=>ie(e.$variant).placeholder.static};
1205
+ color: ${e=>le(e.$variant).placeholder.static};
1250
1206
  }
1251
1207
 
1252
1208
  &:disabled {
1253
1209
  cursor: not-allowed;
1254
- color: ${e=>ie(e.$variant).color.disabled};
1255
- background-color: ${e=>ie(e.$variant).background.disabled};
1256
- border-color: ${e=>ie(e.$variant).border.disabled};
1210
+ color: ${e=>le(e.$variant).color.disabled};
1211
+ background-color: ${e=>le(e.$variant).background.disabled};
1212
+ border-color: ${e=>le(e.$variant).border.disabled};
1257
1213
 
1258
1214
  &::placeholder {
1259
- color: ${e=>ie(e.$variant).placeholder.disabled};
1215
+ color: ${e=>le(e.$variant).placeholder.disabled};
1260
1216
  }
1261
1217
  }
1262
-
1263
- &:focus-visible {
1264
- outline: 2px solid ${e=>ie(e.$variant).focus};
1265
- }
1266
- `,bt=A.newClassNameGetter("input"),Lr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(pa,{className:bt("container",e),$fullWidth:!!i,children:[a.jsx(ua,{variant:d,className:bt("label",r==null?void 0:r.label),children:n}),a.jsx(ha,{...p,ref:l,disabled:o,$size:c,$variant:d,className:bt("input",r==null?void 0:r.input)})]}),ba=s.div`
1218
+ `,bt=A.newClassNameGetter("input"),zr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(ba,{className:bt("container",e),$fullWidth:!!i,children:[a.jsx(ga,{variant:d,className:bt("label",r==null?void 0:r.label),children:n}),a.jsx(fa,{...p,ref:l,disabled:o,$size:c,$variant:d,className:bt("input",r==null?void 0:r.input)})]}),xa=s.div`
1267
1219
  position: fixed;
1268
1220
  inset: 0;
1269
1221
  z-index: 1000;
@@ -1272,7 +1224,7 @@
1272
1224
  justify-content: center;
1273
1225
  background-color: ${t.alpha(t.COLORS.black,50)};
1274
1226
  animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1275
- `,ga=s.div`
1227
+ `,Oa=s.div`
1276
1228
  position: relative;
1277
1229
  z-index: 1001;
1278
1230
  width: ${e=>e.$width};
@@ -1283,21 +1235,21 @@
1283
1235
  border-radius: 16px;
1284
1236
  box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
1285
1237
  animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
1286
- `,rr=A.newClassNameGetter("modal"),Pr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?Oe.createPortal(a.jsx(ba,{className:rr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(ga,{...d,ref:l,className:rr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,zr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},fa=s.div`
1238
+ `,rr=A.newClassNameGetter("modal"),Er=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.createPortal(a.jsx(xa,{className:rr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(Oa,{...d,ref:l,className:rr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,jr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},$a=s.div`
1287
1239
  display: flex;
1288
1240
  flex-direction: column;
1289
1241
  gap: 4px;
1290
- `,xa=s(de)`
1242
+ `,Sa=s(ie)`
1291
1243
  margin-left: 6px;
1292
- color: ${e=>zr[e.$variant].label};
1293
- `,Oa=s.button`
1244
+ color: ${e=>jr[e.$variant].label};
1245
+ `,ya=s.button`
1294
1246
  display: flex;
1295
1247
  flex-wrap: wrap;
1296
1248
  align-items: center;
1297
1249
  gap: 6px;
1298
1250
  min-height: 44px;
1299
1251
  padding: 8px 12px;
1300
- border: 1px dashed ${e=>zr[e.$variant].border};
1252
+ border: 1px dashed ${e=>jr[e.$variant].border};
1301
1253
  border-radius: 8px;
1302
1254
  background: ${t.COLORS.white};
1303
1255
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
@@ -1308,37 +1260,31 @@
1308
1260
  &:hover:not(:disabled) {
1309
1261
  border-color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1310
1262
  }
1311
-
1312
- &:focus-visible {
1313
- outline: 2px solid
1314
- ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1315
- outline-offset: 2px;
1316
- }
1317
- `,$a=s.span`
1263
+ `,Ca=s.span`
1318
1264
  color: ${t.COLORS["iron-grey"]};
1319
1265
  font-size: 14px;
1320
- `,Sa=s.div`
1266
+ `,va=s.div`
1321
1267
  display: flex;
1322
1268
  flex-direction: column;
1323
1269
  padding: 20px;
1324
1270
  gap: 16px;
1325
- `,ya=s.div`
1271
+ `,ma=s.div`
1326
1272
  display: flex;
1327
1273
  align-items: center;
1328
1274
  justify-content: space-between;
1329
- `,va=s.h3`
1275
+ `,wa=s.h3`
1330
1276
  margin: 0;
1331
1277
  font-size: 18px;
1332
1278
  font-weight: 600;
1333
1279
  color: ${t.COLORS.black};
1334
- `,Ca=s.div`
1280
+ `,Ra=s.div`
1335
1281
  display: flex;
1336
1282
  flex-direction: column;
1337
1283
  gap: 4px;
1338
1284
  min-height: 200px;
1339
1285
  max-height: 300px;
1340
1286
  overflow-y: auto;
1341
- `,ma=s.label`
1287
+ `,ka=s.label`
1342
1288
  display: flex;
1343
1289
  align-items: center;
1344
1290
  gap: 10px;
@@ -1351,10 +1297,10 @@
1351
1297
  &:hover {
1352
1298
  background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
1353
1299
  }
1354
- `,wa=s.span`
1300
+ `,La=s.span`
1355
1301
  font-size: 14px;
1356
1302
  color: ${t.COLORS.black};
1357
- `,Ra=s.div`
1303
+ `,Pa=s.div`
1358
1304
  display: flex;
1359
1305
  align-items: center;
1360
1306
  justify-content: center;
@@ -1362,16 +1308,63 @@
1362
1308
  color: ${t.COLORS["iron-grey"]};
1363
1309
  font-size: 14px;
1364
1310
  text-align: center;
1365
- `,Q=A.newClassNameGetter("multi-select"),ka=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:h="Select...",ref:g,searchPlaceholder:f="Search...",value:O,variant:m="normal",...y})=>{const[S,v]=u.useState(!1),[x,$]=u.useState(""),b=u.useMemo(()=>p.filter(w=>O.includes(w.value)),[p,O]),L=u.useMemo(()=>{if(!x.trim())return p;const w=x.toLowerCase().trim();return p.filter(M=>M.label.toLowerCase().includes(w))},[p,x]),j=l===1/0?b:b.slice(0,l),N=b.length-j.length,H=()=>{o||(v(!0),$(""))},z=()=>{v(!1),$("")},_=w=>{O.includes(w)?d(O.filter(M=>M!==w)):d([...O,w])},E=w=>{d(O.filter(M=>M!==w))};return a.jsxs(fa,{...y,ref:g,className:Q("container",e),children:[n&&a.jsx(xa,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(Oa,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:H,className:Q("trigger",r==null?void 0:r.trigger),children:b.length===0?a.jsx($a,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[j.map(w=>a.jsx(Qe,{deletable:!0,onDelete:()=>E(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),N>0&&a.jsxs(Qe,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",N]})]})}),a.jsx(Pr,{open:S,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Sa,{children:[a.jsxs(ya,{children:[a.jsx(va,{children:c}),a.jsx(_e,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:z})]}),a.jsx(Lr,{type:"text",value:x,onChange:w=>$(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ca,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Ra,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(ma,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(tt,{checked:O.includes(w.value),disabled:w.disabled,onChange:()=>_(w.value)}),a.jsx(wa,{children:w.label})]},w.value))})]})})]})},or={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},ir={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)},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)},focus:t.alpha(t.COLORS.red,30)}},Ie=e=>or[e]??or.default,be=e=>ir[e]??ir.normal,La=s.div`
1311
+ `,Q=A.newClassNameGetter("multi-select"),za=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:h="Select...",ref:g,searchPlaceholder:f="Search...",value:O,variant:m="normal",...y})=>{const[S,C]=u.useState(!1),[x,$]=u.useState(""),b=u.useMemo(()=>p.filter(w=>O.includes(w.value)),[p,O]),L=u.useMemo(()=>{if(!x.trim())return p;const w=x.toLowerCase().trim();return p.filter(M=>M.label.toLowerCase().includes(w))},[p,x]),E=l===1/0?b:b.slice(0,l),T=b.length-E.length,V=()=>{o||(C(!0),$(""))},z=()=>{C(!1),$("")},D=w=>{O.includes(w)?d(O.filter(M=>M!==w)):d([...O,w])},j=w=>{d(O.filter(M=>M!==w))};return a.jsxs($a,{...y,ref:g,className:Q("container",e),children:[n&&a.jsx(Sa,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(ya,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:V,className:Q("trigger",r==null?void 0:r.trigger),children:b.length===0?a.jsx(Ca,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[E.map(w=>a.jsx(Qe,{deletable:!0,onDelete:()=>j(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),T>0&&a.jsxs(Qe,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",T]})]})}),a.jsx(Er,{open:S,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(va,{children:[a.jsxs(ma,{children:[a.jsx(wa,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:z})]}),a.jsx(zr,{type:"text",value:x,onChange:w=>$(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ra,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Pa,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(ka,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(tt,{checked:O.includes(w.value),disabled:w.disabled,onChange:()=>D(w.value)}),a.jsx(La,{children:w.label})]},w.value))})]})})]})},Ea=5e3,or={default:{background:"#374151",text:t.COLORS.white},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},info:{background:t.COLORS["steel-blue"],text:t.COLORS.white}},Nr=u.createContext(null),ir=e=>or[e]??or.default,ja=s.div`
1312
+ position: fixed;
1313
+ top: 0;
1314
+ left: 0;
1315
+ right: 0;
1316
+ z-index: 9999;
1317
+ pointer-events: none;
1318
+ `,Na=s.div`
1319
+ display: flex;
1320
+ align-items: center;
1321
+ justify-content: center;
1322
+ gap: 12px;
1323
+ min-height: 44px;
1324
+ padding: 12px 48px;
1325
+ background-color: ${({$variant:e})=>ir(e).background};
1326
+ color: ${({$variant:e})=>ir(e).text};
1327
+ animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutTopFade:t.KEYFRAMES.slideInTopFade}
1328
+ 0.3s ease-out forwards;
1329
+ pointer-events: auto;
1330
+ `,Ta=s.span`
1331
+ font-size: 14px;
1332
+ font-weight: 500;
1333
+ line-height: 1.4;
1334
+ text-align: center;
1335
+ `,Ia=s.button`
1336
+ position: absolute;
1337
+ right: 16px;
1338
+ top: 50%;
1339
+ transform: translateY(-50%);
1340
+ display: flex;
1341
+ align-items: center;
1342
+ justify-content: center;
1343
+ width: 24px;
1344
+ height: 24px;
1345
+ padding: 0;
1346
+ background: transparent;
1347
+ border: none;
1348
+ color: inherit;
1349
+ cursor: pointer;
1350
+ opacity: 0.7;
1351
+ transition: opacity 0.2s ease-in-out;
1352
+
1353
+ &:hover {
1354
+ opacity: 1;
1355
+ }
1356
+ `,Aa=s.div`
1357
+ position: relative;
1358
+ `,_a=({notification:e,onRemove:r,onAnimationEnd:o})=>{const[i,n]=u.useState(!1),l=()=>{n(!0)},c=()=>{i&&(r(),o())};return u.useEffect(()=>{const d=setTimeout(()=>{l()},e.duration);return()=>clearTimeout(d)},[e.duration,e.id]),a.jsx(Aa,{children:a.jsxs(Na,{$variant:e.variant,$isExiting:i,onAnimationEnd:c,children:[a.jsx(Ta,{children:e.message}),a.jsx(Ia,{onClick:l,children:a.jsx(a.X,{style:{width:18,height:18}})})]})})},Da=(e,r)=>{switch(r.type){case"ADD_NOTIFICATION":{const o=r.payload;return e.current?{...e,queue:[...e.queue,o]}:{...e,current:o}}case"REMOVE_CURRENT":return{...e,current:null};case"SHOW_NEXT":{const o=e.queue[0];return o?{current:o,queue:e.queue.slice(1)}:e}default:return e}},Ma={current:null,queue:[]},Fa=({children:e})=>{const[r,o]=u.useReducer(Da,Ma),i=u.useCallback((d,p="default",h=Ea)=>{const g=`notification-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_NOTIFICATION",payload:{id:g,message:d,variant:p,duration:h}})},[]),n=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),l=u.useCallback(()=>{o({type:"REMOVE_CURRENT"})},[]),c=u.useCallback(()=>{setTimeout(()=>{o({type:"SHOW_NEXT"})},100)},[]);return a.jsxs(Nr.Provider,{value:{show:i,hide:n},children:[e,a.jsx(ja,{children:r.current&&a.jsx(_a,{notification:r.current,onRemove:l,onAnimationEnd:c},r.current.id)})]})},Ba=()=>{const e=u.useContext(Nr);if(!e)throw new Error("useNotification must be used within NotificationProvider");return e},nr={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},ar={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)},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)},focus:t.alpha(t.COLORS.red,30)}},Ie=e=>nr[e]??nr.default,$e=e=>ar[e]??ar.normal,Ya=s.div`
1366
1359
  display: inline-flex;
1367
1360
  flex-direction: column;
1368
1361
  gap: 2px;
1369
- `,Pa=s(de)`
1362
+ `,Va=s(ie)`
1370
1363
  margin-left: 6px;
1371
- `,za=s.div`
1364
+ `,Ha=s.div`
1372
1365
  display: flex;
1373
1366
  gap: ${e=>Ie(e.$size).gap};
1374
- `,ja=s.input`
1367
+ `,Ga=s.input`
1375
1368
  width: ${e=>Ie(e.$size).width};
1376
1369
  height: ${e=>Ie(e.$size).height};
1377
1370
  border-radius: ${e=>Ie(e.$size).radius};
@@ -1379,28 +1372,24 @@
1379
1372
  font-weight: 600;
1380
1373
  text-align: center;
1381
1374
  outline: none;
1382
- border: 1px solid ${e=>be(e.$variant).border.static};
1383
- background-color: ${e=>be(e.$variant).background.static};
1384
- color: ${e=>be(e.$variant).color.static};
1375
+ border: 1px solid ${e=>$e(e.$variant).border.static};
1376
+ background-color: ${e=>$e(e.$variant).background.static};
1377
+ color: ${e=>$e(e.$variant).color.static};
1385
1378
  transition:
1386
1379
  border-color 0.15s ease,
1387
1380
  box-shadow 0.15s ease;
1388
1381
 
1389
1382
  &:disabled {
1390
1383
  cursor: not-allowed;
1391
- color: ${e=>be(e.$variant).color.disabled};
1392
- background-color: ${e=>be(e.$variant).background.disabled};
1393
- border-color: ${e=>be(e.$variant).border.disabled};
1394
- }
1395
-
1396
- &:focus-visible {
1397
- outline: 2px solid ${e=>be(e.$variant).focus};
1384
+ color: ${e=>$e(e.$variant).color.disabled};
1385
+ background-color: ${e=>$e(e.$variant).background.disabled};
1386
+ border-color: ${e=>$e(e.$variant).border.disabled};
1398
1387
  }
1399
1388
 
1400
1389
  &::selection {
1401
1390
  background-color: transparent;
1402
1391
  }
1403
- `,gt=A.newClassNameGetter("otp-code"),Ea=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:p="default",value:h="",variant:g="normal",...f})=>{const O=u.useRef([]);u.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const m=u.useCallback(x=>{const $=O.current[x];$&&($.focus(),$.select())},[]),y=u.useCallback((x,$)=>{const L=$.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const j=h.padEnd(l," ").split(""),N=j.findIndex(E=>E===" "||E===""),H=N!==-1?N:x;j[H]=L;const z=j.join("").replace(/ /g,"");c==null||c(z);const _=H+1;_<l&&m(_)},[h,l,c,m]),S=u.useCallback((x,$)=>{if($.key==="Backspace"){$.preventDefault();const b=h.split("");b[x]?(b[x]="",c==null||c(b.join(""))):x>0&&(b[x-1]="",c==null||c(b.join("")),m(x-1))}else $.key==="ArrowLeft"&&x>0?($.preventDefault(),m(x-1)):$.key==="ArrowRight"&&x<l-1&&($.preventDefault(),m(x+1))},[h,l,c,m]),v=u.useCallback(x=>{x.preventDefault();const $=x.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if($){c==null||c($);const b=Math.min($.length,l-1);m(b)}},[l,c,m]);return a.jsxs(La,{ref:d,className:gt("container",r),...f,children:[n&&a.jsx(Pa,{variant:g,className:gt("label",o==null?void 0:o.label),children:n}),a.jsx(za,{$size:p,children:Array.from({length:l}).map((x,$)=>a.jsx(ja,{ref:b=>{O.current[$]=b},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:h[$]??"",onChange:b=>y($,b),onKeyDown:b=>S($,b),onPaste:v,onFocus:b=>b.target.select(),$size:p,$variant:g,className:gt("input",o==null?void 0:o.input)},$))})]})},nr={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"}},et=e=>nr[e]??nr.light,Ta=s.div`
1392
+ `,gt=A.newClassNameGetter("otp-code"),Wa=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:p="default",value:h="",variant:g="normal",...f})=>{const O=u.useRef([]);u.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const m=u.useCallback(x=>{const $=O.current[x];$&&($.focus(),$.select())},[]),y=u.useCallback((x,$)=>{const L=$.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const E=h.padEnd(l," ").split(""),T=E.findIndex(j=>j===" "||j===""),V=T!==-1?T:x;E[V]=L;const z=E.join("").replace(/ /g,"");c==null||c(z);const D=V+1;D<l&&m(D)},[h,l,c,m]),S=u.useCallback((x,$)=>{if($.key==="Backspace"){$.preventDefault();const b=h.split("");b[x]?(b[x]="",c==null||c(b.join(""))):x>0&&(b[x-1]="",c==null||c(b.join("")),m(x-1))}else $.key==="ArrowLeft"&&x>0?($.preventDefault(),m(x-1)):$.key==="ArrowRight"&&x<l-1&&($.preventDefault(),m(x+1))},[h,l,c,m]),C=u.useCallback(x=>{x.preventDefault();const $=x.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if($){c==null||c($);const b=Math.min($.length,l-1);m(b)}},[l,c,m]);return a.jsxs(Ya,{ref:d,className:gt("container",r),...f,children:[n&&a.jsx(Va,{variant:g,className:gt("label",o==null?void 0:o.label),children:n}),a.jsx(Ha,{$size:p,children:Array.from({length:l}).map((x,$)=>a.jsx(Ga,{ref:b=>{O.current[$]=b},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:h[$]??"",onChange:b=>y($,b),onKeyDown:b=>S($,b),onPaste:C,onFocus:b=>b.target.select(),$size:p,$variant:g,className:gt("input",o==null?void 0:o.input)},$))})]})},lr={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"}},et=e=>lr[e]??lr.light,Ua=s.div`
1404
1393
  display: flex;
1405
1394
  flex-direction: column;
1406
1395
  gap: 16px;
@@ -1408,52 +1397,48 @@
1408
1397
  border: 1px dashed ${({$variant:e})=>et(e).border};
1409
1398
  border-radius: 16px;
1410
1399
  background-color: ${({$variant:e})=>et(e).background};
1411
- `,Na=s.div`
1400
+ `,Xa=s.div`
1412
1401
  display: flex;
1413
1402
  flex-direction: column;
1414
1403
  gap: 4px;
1415
- `,Ia=s.div`
1404
+ `,qa=s.div`
1416
1405
  font-size: 18px;
1417
1406
  font-weight: 600;
1418
1407
  line-height: 1.4;
1419
1408
  color: ${({$variant:e})=>et(e).title};
1420
- `,Aa=s.div`
1409
+ `,Ka=s.div`
1421
1410
  font-size: 14px;
1422
1411
  line-height: 1.5;
1423
1412
  color: ${({$variant:e})=>et(e).description};
1424
- `,Da=s.div`
1413
+ `,Za=s.div`
1425
1414
  display: flex;
1426
1415
  flex-wrap: wrap;
1427
1416
  gap: 8px;
1428
- `,Ue=A.newClassNameGetter("panel"),_a=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(Ta,{...d,ref:n,className:Ue("container",r),$variant:c,children:[p&&a.jsxs(Na,{children:[l&&a.jsx(Ia,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(Aa,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(Da,{className:Ue("content",o==null?void 0:o.content),children:e})]})},Rt={compact:{height:4,radius:2},default:{height:8,radius:4}},Ma=s.div`
1417
+ `,Xe=A.newClassNameGetter("panel"),Ja=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(Ua,{...d,ref:n,className:Xe("container",r),$variant:c,children:[p&&a.jsxs(Xa,{children:[l&&a.jsx(qa,{className:Xe("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(Ka,{className:Xe("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(Za,{className:Xe("content",o==null?void 0:o.content),children:e})]})},Rt={compact:{height:4,radius:2},default:{height:8,radius:4}},Qa=s.div`
1429
1418
  width: 100%;
1430
1419
  height: ${({$size:e})=>Rt[e].height}px;
1431
1420
  border-radius: ${({$size:e})=>Rt[e].radius}px;
1432
1421
  background-color: ${t.COLORS.gray};
1433
1422
  overflow: hidden;
1434
- `,Fa=s.div`
1423
+ `,el=s.div`
1435
1424
  height: 100%;
1436
1425
  width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
1437
1426
  border-radius: ${({$size:e})=>Rt[e].radius}px;
1438
1427
  background-color: ${t.COLORS.black};
1439
1428
  transition: width 0.2s ease;
1440
- `,ar=A.newClassNameGetter("progress"),Ba=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(Ma,{...l,ref:n,$size:r,className:ar("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(Fa,{$size:r,$value:e,className:ar("bar",i==null?void 0:i.bar)})}),lr={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}},xe=e=>lr[e]??lr.normal,Ya=s.label`
1429
+ `,dr=A.newClassNameGetter("progress"),tl=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(Qa,{...l,ref:n,$size:r,className:dr("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(el,{$size:r,$value:e,className:dr("bar",i==null?void 0:i.bar)})}),cr={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}},Ce=e=>cr[e]??cr.normal,rl=s.label`
1441
1430
  display: inline-flex;
1442
1431
  align-items: flex-start;
1443
1432
  gap: 8px;
1444
1433
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1445
1434
  opacity: ${e=>e.$disabled?.5:1};
1446
-
1447
- &:has(input:focus-visible) > span:first-of-type {
1448
- box-shadow: 0 0 0 2px ${e=>xe(e.$variant).box.focusShadow};
1449
- }
1450
- `,Ha=s.input`
1435
+ `,ol=s.input`
1451
1436
  position: absolute;
1452
1437
  opacity: 0;
1453
1438
  width: 0;
1454
1439
  height: 0;
1455
1440
  pointer-events: none;
1456
- `,Va=s.span`
1441
+ `,il=s.span`
1457
1442
  display: inline-flex;
1458
1443
  align-items: center;
1459
1444
  justify-content: center;
@@ -1462,27 +1447,27 @@
1462
1447
  height: 18px;
1463
1448
  border-radius: 50%;
1464
1449
  border: 1.5px solid
1465
- ${e=>e.$checked?xe(e.$variant).box.borderChecked:xe(e.$variant).box.border};
1466
- background-color: ${e=>e.$checked?xe(e.$variant).box.backgroundChecked:xe(e.$variant).box.background};
1450
+ ${e=>e.$checked?Ce(e.$variant).box.borderChecked:Ce(e.$variant).box.border};
1451
+ background-color: ${e=>e.$checked?Ce(e.$variant).box.backgroundChecked:Ce(e.$variant).box.background};
1467
1452
  transition:
1468
1453
  border-color 0.15s ease,
1469
1454
  background-color 0.15s ease,
1470
1455
  box-shadow 0.15s ease;
1471
- `,Ga=s.span`
1456
+ `,nl=s.span`
1472
1457
  width: 8px;
1473
1458
  height: 8px;
1474
1459
  border-radius: 50%;
1475
- background-color: ${e=>xe(e.$variant).dot};
1460
+ background-color: ${e=>Ce(e.$variant).dot};
1476
1461
  opacity: ${e=>e.$visible?1:0};
1477
1462
  transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
1478
1463
  transition:
1479
1464
  opacity 0.15s ease,
1480
1465
  transform 0.15s ease;
1481
- `,Wa=s.span`
1466
+ `,al=s.span`
1482
1467
  font-size: 14px;
1483
1468
  font-weight: 500;
1484
1469
  line-height: 1.5;
1485
- color: ${e=>xe(e.$variant).label};
1470
+ color: ${e=>Ce(e.$variant).label};
1486
1471
  user-select: none;
1487
1472
 
1488
1473
  a {
@@ -1494,7 +1479,7 @@
1494
1479
  text-decoration: none;
1495
1480
  }
1496
1481
  }
1497
- `,Ee=A.newClassNameGetter("radio"),Pt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(Ya,{className:Ee("container",r),$disabled:!!i,$variant:d,children:[a.jsx(Ha,{...p,ref:c,type:"radio",className:Ee("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(Va,{className:Ee("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(Ga,{className:Ee("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(Wa,{className:Ee("label",o==null?void 0:o.label),$variant:d,children:n})]}),dr={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)}}},he=e=>dr[e]??dr.normal,Xa=s.label`
1482
+ `,je=A.newClassNameGetter("radio"),Pt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(rl,{className:je("container",r),$disabled:!!i,$variant:d,children:[a.jsx(ol,{...p,ref:c,type:"radio",className:je("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(il,{className:je("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(nl,{className:je("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(al,{className:je("label",o==null?void 0:o.label),$variant:d,children:n})]}),sr={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)}}},he=e=>sr[e]??sr.normal,ll=s.label`
1498
1483
  display: grid;
1499
1484
  grid-template-columns: auto 1fr;
1500
1485
  align-items: start;
@@ -1515,15 +1500,10 @@
1515
1500
  border-color: ${e=>{const r=he(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1516
1501
  }
1517
1502
 
1518
- &:has(:focus-visible) {
1519
- outline: none;
1520
- box-shadow: 0 0 0 3px ${e=>he(e.$variant).focusRing};
1521
- }
1522
-
1523
1503
  .vacano_radio_container {
1524
1504
  pointer-events: none;
1525
1505
  }
1526
- `,Ua=s.input`
1506
+ `,dl=s.input`
1527
1507
  position: absolute;
1528
1508
  width: 1px;
1529
1509
  height: 1px;
@@ -1533,12 +1513,12 @@
1533
1513
  clip: rect(0, 0, 0, 0);
1534
1514
  white-space: nowrap;
1535
1515
  border: 0;
1536
- `,qa=s.div`
1516
+ `,cl=s.div`
1537
1517
  display: flex;
1538
1518
  flex-direction: column;
1539
1519
  gap: 2px;
1540
1520
  min-width: 0;
1541
- `,Ka=s.span`
1521
+ `,sl=s.span`
1542
1522
  font-size: 14px;
1543
1523
  font-weight: 500;
1544
1524
  line-height: 1.4;
@@ -1547,7 +1527,7 @@
1547
1527
  label[data-disabled='true'] & {
1548
1528
  color: ${e=>he(e.$variant).label.disabled};
1549
1529
  }
1550
- `,Za=s.span`
1530
+ `,pl=s.span`
1551
1531
  font-size: 12px;
1552
1532
  font-weight: 400;
1553
1533
  line-height: 1.4;
@@ -1556,21 +1536,21 @@
1556
1536
  label[data-disabled='true'] & {
1557
1537
  color: ${e=>he(e.$variant).description.disabled};
1558
1538
  }
1559
- `,qe=A.newClassNameGetter("radio-card"),Ja=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Xa,{className:qe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Ua,{...g,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Pt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(qa,{className:qe("content",o==null?void 0:o.content),children:[a.jsx(Ka,{className:qe("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Za,{className:qe("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),cr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Qa=s.div`
1539
+ `,qe=A.newClassNameGetter("radio-card"),ul=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(ll,{className:qe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(dl,{...g,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Pt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(cl,{className:qe("content",o==null?void 0:o.content),children:[a.jsx(sl,{className:qe("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(pl,{className:qe("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),pr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},hl=s.div`
1560
1540
  display: flex;
1561
1541
  flex-direction: column;
1562
1542
  gap: 8px;
1563
- `,el=s.span`
1543
+ `,bl=s.span`
1564
1544
  font-size: 13px;
1565
1545
  font-weight: 500;
1566
1546
  line-height: 1.5;
1567
- color: ${e=>e.$disabled?cr.label.disabledColor:cr.label.color};
1547
+ color: ${e=>e.$disabled?pr.label.disabledColor:pr.label.color};
1568
1548
  margin-bottom: 4px;
1569
- `,tl=s.div`
1549
+ `,gl=s.div`
1570
1550
  display: flex;
1571
1551
  flex-direction: column;
1572
1552
  gap: 12px;
1573
- `,ft=A.newClassNameGetter("radio-group"),rl=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(Qa,{...h,ref:d,className:ft("container",e),children:[i&&a.jsx(el,{className:ft("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(tl,{className:ft("options",r==null?void 0:r.options),children:c.map(g=>a.jsx(Pt,{className:r==null?void 0:r.radio,name:n,checked:p===g.value,label:g.label,disabled:o,onChange:()=>l(g.value)},g.value))})]}),jr=u.createContext(null),ol=s.div`
1553
+ `,ft=A.newClassNameGetter("radio-group"),fl=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(hl,{...h,ref:d,className:ft("container",e),children:[i&&a.jsx(bl,{className:ft("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(gl,{className:ft("options",r==null?void 0:r.options),children:c.map(g=>a.jsx(Pt,{className:r==null?void 0:r.radio,name:n,checked:p===g.value,label:g.label,disabled:o,onChange:()=>l(g.value)},g.value))})]}),Tr=u.createContext(null),xl=s.div`
1574
1554
  position: fixed;
1575
1555
  bottom: 24px;
1576
1556
  right: 24px;
@@ -1585,19 +1565,19 @@
1585
1565
  animation: ${t.KEYFRAMES.fadeIn} 0.2s ease-out;
1586
1566
  pointer-events: none;
1587
1567
  color: ${t.COLORS.black};
1588
- `,il=s.span`
1568
+ `,Ol=s.span`
1589
1569
  font-size: 14px;
1590
1570
  font-weight: 500;
1591
1571
  white-space: nowrap;
1592
- `,nl=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=u.useState(!1),[n,l]=u.useState(r),c=u.useCallback(h=>{l(h??r),i(!0)},[r]),d=u.useCallback(()=>{i(!1)},[]),p=u.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(jr.Provider,{value:p,children:[e,o&&a.jsxs(ol,{children:[a.jsx(Lt,{size:"sm"}),a.jsx(il,{children:n})]})]})},al=()=>{const e=u.useContext(jr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},xt=40,Te=4,sr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},pr={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)}},Ot=e=>sr[e]??sr.default,se=e=>pr[e]??pr.normal,ll=s.div`
1572
+ `,$l=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=u.useState(!1),[n,l]=u.useState(r),c=u.useCallback(h=>{l(h??r),i(!0)},[r]),d=u.useCallback(()=>{i(!1)},[]),p=u.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(Tr.Provider,{value:p,children:[e,o&&a.jsxs(xl,{children:[a.jsx(Lt,{size:"sm"}),a.jsx(Ol,{children:n})]})]})},Sl=()=>{const e=u.useContext(Tr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},xt=40,Ne=4,ur={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},hr={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)}},Ot=e=>ur[e]??ur.default,se=e=>hr[e]??hr.normal,yl=s.div`
1593
1573
  position: relative;
1594
1574
  display: grid;
1595
1575
  gap: 2px;
1596
1576
  min-width: 180px;
1597
1577
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1598
- `,dl=s(de)`
1578
+ `,Cl=s(ie)`
1599
1579
  margin-left: 6px;
1600
- `,cl=s.button`
1580
+ `,vl=s.button`
1601
1581
  display: flex;
1602
1582
  align-items: center;
1603
1583
  justify-content: space-between;
@@ -1616,39 +1596,35 @@
1616
1596
  border: 1px solid
1617
1597
  ${e=>e.$disabled?se(e.$variant).border.disabled:se(e.$variant).border.static};
1618
1598
  background-color: ${e=>e.$disabled?se(e.$variant).background.disabled:se(e.$variant).background.static};
1619
-
1620
- &:focus-visible {
1621
- outline: 2px solid ${e=>se(e.$variant).focus};
1622
- }
1623
- `,sl=s.span`
1599
+ `,ml=s.span`
1624
1600
  flex: 1;
1625
1601
  min-width: 0;
1626
1602
  overflow: hidden;
1627
1603
  text-overflow: ellipsis;
1628
1604
  white-space: nowrap;
1629
- `,pl=s.span`
1605
+ `,wl=s.span`
1630
1606
  display: flex;
1631
1607
  align-items: center;
1632
1608
  justify-content: center;
1633
1609
  flex-shrink: 0;
1634
1610
  transition: transform 0.2s ease;
1635
1611
  transform: rotate(${e=>e.$open?"180deg":"0deg"});
1636
- `,Er=`
1612
+ `,Ir=`
1637
1613
  padding: 4px;
1638
1614
  background: ${t.COLORS.white};
1639
1615
  border: 1px solid ${t.alpha(t.COLORS.black,10)};
1640
1616
  border-radius: 16px;
1641
1617
  box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
1642
1618
  z-index: 1000;
1643
- `,ul=s.div`
1619
+ `,Rl=s.div`
1644
1620
  position: absolute;
1645
1621
  left: -4px;
1646
1622
  width: calc(100% + 8px);
1647
- ${Er}
1648
- `,hl=s.div`
1623
+ ${Ir}
1624
+ `,kl=s.div`
1649
1625
  position: fixed;
1650
- ${Er}
1651
- `,bl=s.button`
1626
+ ${Ir}
1627
+ `,Ll=s.button`
1652
1628
  display: flex;
1653
1629
  align-items: center;
1654
1630
  justify-content: space-between;
@@ -1669,18 +1645,13 @@
1669
1645
  &:hover:not(:disabled) {
1670
1646
  background: ${t.alpha(t.COLORS.black,8)};
1671
1647
  }
1672
-
1673
- &:focus-visible {
1674
- outline: none;
1675
- background: ${t.alpha(t.COLORS.black,8)};
1676
- }
1677
- `,gl=s.span`
1648
+ `,Pl=s.span`
1678
1649
  display: flex;
1679
1650
  align-items: center;
1680
1651
  justify-content: center;
1681
1652
  flex-shrink: 0;
1682
1653
  color: ${t.COLORS.black};
1683
- `,Ce=A.newClassNameGetter("select"),fl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:h,size:g="default",value:f,variant:O="normal",...m})=>{const[y,S]=u.useState(!1),[v,x]=u.useState({top:0,left:0,width:0}),$=u.useRef(null),b=u.useRef(null),L=u.useRef(null),j=c.find(C=>C.value===f),N=Math.max(0,c.findIndex(C=>C.value===f)),H=-(N*xt+Te),z=()=>{if(!b.current||!p)return;const C=b.current.getBoundingClientRect(),I=N*xt+Te;let k=C.top-I;const T=c.length*xt+Te*2,F=8,B=window.innerHeight-T-8;k<F&&(k=F),k>B&&(k=B),x({top:k,left:C.left-Te,width:C.width+Te*2})},_=C=>{var I;l==null||l(C),S(!1),(I=b.current)==null||I.focus()},E=C=>{o||(C.key==="Enter"||C.key===" "?(C.preventDefault(),S(I=>!I)):C.key==="Escape"&&y?(C.preventDefault(),S(!1)):C.key==="ArrowDown"&&!y&&(C.preventDefault(),S(!0)))};u.useLayoutEffect(()=>{y&&p&&z()},[y,p,N,c.length]),u.useEffect(()=>{if(!y)return;const C=T=>{const F=T.target,B=$.current&&!$.current.contains(F),V=L.current&&!L.current.contains(F);p?B&&V&&S(!1):B&&S(!1)},I=()=>{p&&z()},k=()=>{p&&z()};return document.addEventListener("mousedown",C),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",C),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[y,p]);const w=()=>c.map(C=>a.jsxs(bl,{type:"button",role:"option",$selected:C.value===f,$disabled:C.disabled??!1,disabled:C.disabled,"aria-selected":C.value===f,onClick:()=>_(C.value),className:Ce("option",r==null?void 0:r.option),children:[a.jsx("span",{children:C.label}),C.value===f&&a.jsx(gl,{children:a.jsx(a.Check,{size:16})})]},C.value)),M=p?Oe.createPortal(a.jsx(hl,{ref:L,role:"listbox",style:{top:v.top,left:v.left,width:v.width},className:Ce("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(ul,{ref:L,role:"listbox",style:{top:H},className:Ce("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(ll,{...m,ref:C=>{$.current=C,typeof h=="function"?h(C):h&&(h.current=C)},$fullWidth:i,className:Ce("container",e),children:[n&&a.jsx(dl,{className:Ce("label",r==null?void 0:r.label),children:n}),a.jsxs(cl,{ref:b,type:"button",$size:g,$variant:O,$disabled:o,$hasValue:!!j,disabled:o,onClick:()=>!o&&S(C=>!C),onKeyDown:E,"aria-haspopup":"listbox","aria-expanded":y,className:Ce("trigger",r==null?void 0:r.trigger),children:[a.jsx(sl,{children:(j==null?void 0:j.label)??d}),a.jsx(pl,{$open:y,children:a.jsx(a.ChevronDown,{size:16})})]}),y&&M]})},ur={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},xl=e=>ur[e]??ur.neutral,Ol=s.div`
1654
+ `,Se=A.newClassNameGetter("select"),zl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:h,size:g="default",value:f,variant:O="normal",...m})=>{const[y,S]=u.useState(!1),[C,x]=u.useState({top:0,left:0,width:0}),$=u.useRef(null),b=u.useRef(null),L=u.useRef(null),E=c.find(v=>v.value===f),T=Math.max(0,c.findIndex(v=>v.value===f)),V=-(T*xt+Ne),z=()=>{if(!b.current||!p)return;const v=b.current.getBoundingClientRect(),I=T*xt+Ne;let k=v.top-I;const N=c.length*xt+Ne*2,F=8,B=window.innerHeight-N-8;k<F&&(k=F),k>B&&(k=B),x({top:k,left:v.left-Ne,width:v.width+Ne*2})},D=v=>{var I;l==null||l(v),S(!1),(I=b.current)==null||I.focus()},j=v=>{o||(v.key==="Enter"||v.key===" "?(v.preventDefault(),S(I=>!I)):v.key==="Escape"&&y?(v.preventDefault(),S(!1)):v.key==="ArrowDown"&&!y&&(v.preventDefault(),S(!0)))};u.useLayoutEffect(()=>{y&&p&&z()},[y,p,T,c.length]),u.useEffect(()=>{if(!y)return;const v=N=>{const F=N.target,B=$.current&&!$.current.contains(F),H=L.current&&!L.current.contains(F);p?B&&H&&S(!1):B&&S(!1)},I=()=>{p&&z()},k=()=>{p&&z()};return document.addEventListener("mousedown",v),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",v),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[y,p]);const w=()=>c.map(v=>a.jsxs(Ll,{type:"button",role:"option",$selected:v.value===f,$disabled:v.disabled??!1,disabled:v.disabled,"aria-selected":v.value===f,onClick:()=>D(v.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:v.label}),v.value===f&&a.jsx(Pl,{children:a.jsx(a.Check,{size:16})})]},v.value)),M=p?ge.createPortal(a.jsx(kl,{ref:L,role:"listbox",style:{top:C.top,left:C.left,width:C.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(Rl,{ref:L,role:"listbox",style:{top:V},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(yl,{...m,ref:v=>{$.current=v,typeof h=="function"?h(v):h&&(h.current=v)},$fullWidth:i,className:Se("container",e),children:[n&&a.jsx(Cl,{className:Se("label",r==null?void 0:r.label),children:n}),a.jsxs(vl,{ref:b,type:"button",$size:g,$variant:O,$disabled:o,$hasValue:!!E,disabled:o,onClick:()=>!o&&S(v=>!v),onKeyDown:j,"aria-haspopup":"listbox","aria-expanded":y,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(ml,{children:(E==null?void 0:E.label)??d}),a.jsx(wl,{$open:y,children:a.jsx(a.ChevronDown,{size:16})})]}),y&&M]})},br={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},El=e=>br[e]??br.neutral,jl=s.div`
1684
1655
  display: flex;
1685
1656
  flex-direction: column;
1686
1657
  gap: 4px;
@@ -1689,16 +1660,16 @@
1689
1660
  border-radius: 16px;
1690
1661
  border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
1691
1662
  box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
1692
- `,$l=s.div`
1663
+ `,Nl=s.div`
1693
1664
  display: flex;
1694
1665
  align-items: center;
1695
1666
  justify-content: space-between;
1696
1667
  gap: 8px;
1697
- `,Sl=s.p`
1668
+ `,Tl=s.p`
1698
1669
  margin: 0;
1699
1670
  font-size: 13px;
1700
1671
  color: ${t.COLORS["iron-grey"]};
1701
- `,yl=s.div`
1672
+ `,Il=s.div`
1702
1673
  display: flex;
1703
1674
  align-items: center;
1704
1675
  justify-content: center;
@@ -1712,21 +1683,21 @@
1712
1683
  width: 18px;
1713
1684
  height: 18px;
1714
1685
  }
1715
- `,vl=s.h3`
1686
+ `,Al=s.h3`
1716
1687
  margin: 0;
1717
1688
  font-size: 28px;
1718
1689
  font-weight: 600;
1719
1690
  line-height: 1.2;
1720
1691
  color: ${t.COLORS.black};
1721
- `,Cl=s.p`
1692
+ `,_l=s.p`
1722
1693
  margin: 0;
1723
1694
  font-size: 12px;
1724
- color: ${({$variant:e})=>xl(e)};
1725
- `,Ke=A.newClassNameGetter("status-card"),ml=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:h,...g})=>a.jsxs(Ol,{...g,ref:l,className:Ke("container",r),$border:e,$shadow:c,children:[a.jsxs($l,{children:[a.jsx(Sl,{className:Ke("label",o==null?void 0:o.label),children:n}),i&&a.jsx(yl,{children:i})]}),a.jsx(vl,{className:Ke("value",o==null?void 0:o.value),children:h}),d&&a.jsx(Cl,{className:Ke("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),wl=s.div`
1695
+ color: ${({$variant:e})=>El(e)};
1696
+ `,Ke=A.newClassNameGetter("status-card"),Dl=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:h,...g})=>a.jsxs(jl,{...g,ref:l,className:Ke("container",r),$border:e,$shadow:c,children:[a.jsxs(Nl,{children:[a.jsx(Tl,{className:Ke("label",o==null?void 0:o.label),children:n}),i&&a.jsx(Il,{children:i})]}),a.jsx(Al,{className:Ke("value",o==null?void 0:o.value),children:h}),d&&a.jsx(_l,{className:Ke("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),Ml=s.div`
1726
1697
  display: flex;
1727
1698
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1728
1699
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
1729
- `,Rl=s.div`
1700
+ `,Fl=s.div`
1730
1701
  display: flex;
1731
1702
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1732
1703
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
@@ -1735,7 +1706,7 @@
1735
1706
  &:last-child {
1736
1707
  flex: 0;
1737
1708
  }
1738
- `,kl=s.button`
1709
+ `,Bl=s.button`
1739
1710
  display: flex;
1740
1711
  align-items: center;
1741
1712
  gap: 10px;
@@ -1744,16 +1715,7 @@
1744
1715
  background: transparent;
1745
1716
  cursor: ${e=>e.$clickable?"pointer":"default"};
1746
1717
  flex-shrink: 0;
1747
-
1748
- &:focus-visible {
1749
- outline: none;
1750
-
1751
- & > div:first-of-type {
1752
- outline: 2px solid ${t.COLORS["steel-blue"]};
1753
- outline-offset: 2px;
1754
- }
1755
- }
1756
- `,Ll=s.div`
1718
+ `,Yl=s.div`
1757
1719
  display: flex;
1758
1720
  align-items: center;
1759
1721
  justify-content: center;
@@ -1777,13 +1739,13 @@
1777
1739
  border: 2px solid ${t.COLORS.gray};
1778
1740
  color: ${t.COLORS["iron-grey"]};
1779
1741
  `}
1780
- `,Pl=s.span`
1742
+ `,Vl=s.span`
1781
1743
  font-size: 14px;
1782
1744
  font-weight: 500;
1783
1745
  white-space: nowrap;
1784
1746
  color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
1785
1747
  transition: color 0.2s ease;
1786
- `,zl=s.div`
1748
+ `,Hl=s.div`
1787
1749
  background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
1788
1750
  transition: background-color 0.2s ease;
1789
1751
 
@@ -1797,15 +1759,15 @@
1797
1759
  min-width: 16px;
1798
1760
  margin: 0 12px;
1799
1761
  `}
1800
- `,Ne=A.newClassNameGetter("stepper"),jl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(wl,{...d,ref:n,$orientation:i,className:Ne("container",e),children:l.map((h,g)=>{const f=h.value===c,O=g<p,m=g===l.length-1;return a.jsxs(Rl,{$orientation:i,children:[a.jsxs(kl,{type:"button",$active:f,$completed:O,$clickable:!!o,onClick:()=>o==null?void 0:o(h.value),className:Ne("step",r==null?void 0:r.step),children:[a.jsx(Ll,{$active:f,$completed:O,className:Ne("circle",r==null?void 0:r.circle),children:g+1}),a.jsx(Pl,{$active:f,$completed:O,className:Ne("label",r==null?void 0:r.label),children:h.label})]}),!m&&a.jsx(zl,{$completed:O,$orientation:i,className:Ne("line",r==null?void 0:r.line)})]},h.value)})})},kt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},El=s.div`
1762
+ `,Te=A.newClassNameGetter("stepper"),Gl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(Ml,{...d,ref:n,$orientation:i,className:Te("container",e),children:l.map((h,g)=>{const f=h.value===c,O=g<p,m=g===l.length-1;return a.jsxs(Fl,{$orientation:i,children:[a.jsxs(Bl,{type:"button",$active:f,$completed:O,$clickable:!!o,onClick:()=>o==null?void 0:o(h.value),className:Te("step",r==null?void 0:r.step),children:[a.jsx(Yl,{$active:f,$completed:O,className:Te("circle",r==null?void 0:r.circle),children:g+1}),a.jsx(Vl,{$active:f,$completed:O,className:Te("label",r==null?void 0:r.label),children:h.label})]}),!m&&a.jsx(Hl,{$completed:O,$orientation:i,className:Te("line",r==null?void 0:r.line)})]},h.value)})})},kt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Wl=s.div`
1801
1763
  position: relative;
1802
1764
  display: flex;
1803
1765
  flex-direction: column;
1804
1766
  gap: 4px;
1805
- `,Tl=s(de)`
1767
+ `,Ul=s(ie)`
1806
1768
  margin-left: 6px;
1807
1769
  color: ${e=>kt[e.$variant].label};
1808
- `,Nl=s.div`
1770
+ `,Xl=s.div`
1809
1771
  display: flex;
1810
1772
  flex-wrap: wrap;
1811
1773
  align-items: center;
@@ -1827,7 +1789,7 @@
1827
1789
  outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1828
1790
  outline-offset: 2px;
1829
1791
  `}
1830
- `,Il=s.input`
1792
+ `,ql=s.input`
1831
1793
  flex: 1;
1832
1794
  min-width: 80px;
1833
1795
  border: none;
@@ -1844,7 +1806,7 @@
1844
1806
  &:disabled {
1845
1807
  cursor: not-allowed;
1846
1808
  }
1847
- `,Tr=`
1809
+ `,Ar=`
1848
1810
  z-index: 100;
1849
1811
  background-color: ${t.COLORS.white};
1850
1812
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
@@ -1852,28 +1814,28 @@
1852
1814
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
1853
1815
  max-height: 200px;
1854
1816
  overflow-y: auto;
1855
- `,Nr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ir=`
1817
+ `,_r=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Dr=`
1856
1818
  opacity 0.15s ease,
1857
1819
  transform 0.15s ease,
1858
1820
  visibility 0.15s;
1859
- `,Al=s.div`
1821
+ `,Kl=s.div`
1860
1822
  position: absolute;
1861
1823
  left: 0;
1862
1824
  right: 0;
1863
1825
  ${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
1864
- ${Tr}
1826
+ ${Ar}
1865
1827
  opacity: ${e=>e.$open?1:0};
1866
1828
  visibility: ${e=>e.$open?"visible":"hidden"};
1867
- transform: ${e=>Nr(e.$open,e.$position)};
1868
- transition: ${Ir};
1869
- `,Dl=s.div`
1829
+ transform: ${e=>_r(e.$open,e.$position)};
1830
+ transition: ${Dr};
1831
+ `,Zl=s.div`
1870
1832
  position: fixed;
1871
- ${Tr}
1833
+ ${Ar}
1872
1834
  opacity: ${e=>e.$open?1:0};
1873
1835
  visibility: ${e=>e.$open?"visible":"hidden"};
1874
- transform: ${e=>Nr(e.$open,e.$position)};
1875
- transition: ${Ir};
1876
- `,hr=s.button`
1836
+ transform: ${e=>_r(e.$open,e.$position)};
1837
+ transition: ${Dr};
1838
+ `,gr=s.button`
1877
1839
  display: flex;
1878
1840
  align-items: center;
1879
1841
  width: 100%;
@@ -1901,7 +1863,7 @@
1901
1863
  &:only-child {
1902
1864
  border-radius: 7px;
1903
1865
  }
1904
- `,br=s.div`
1866
+ `,fr=s.div`
1905
1867
  display: flex;
1906
1868
  align-items: center;
1907
1869
  justify-content: center;
@@ -1909,11 +1871,11 @@
1909
1871
  color: ${t.COLORS["iron-grey"]};
1910
1872
  font-size: 14px;
1911
1873
  text-align: center;
1912
- `,ee=A.newClassNameGetter("tags"),Ze=4,_l=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:h="Add tag...",portalRenderNode:g,ref:f,value:O,variant:m="normal",...y})=>{const S=u.useRef(null),v=u.useRef(null),x=u.useRef(null),$=u.useRef(null),[b,L]=u.useState(""),[j,N]=u.useState(!1),[H,z]=u.useState("bottom"),[_,E]=u.useState({top:0,left:0,width:0}),w=u.useMemo(()=>{const P=p.filter(U=>!O.includes(U.value));if(!b.trim())return P;const D=b.toLowerCase().trim();return P.filter(U=>U.label.toLowerCase().includes(D))},[p,O,b]),M=j&&p.length>0,C=u.useCallback(()=>{var Me;if(!v.current)return;const P=v.current.getBoundingClientRect(),D=((Me=x.current)==null?void 0:Me.offsetHeight)??200,U=window.innerHeight-P.bottom-Ze,q=P.top-Ze,$e=U<D&&q>U?"top":"bottom";if(z($e),g){const ot=$e==="bottom"?P.bottom+Ze:P.top-D-Ze;E({top:ot,left:P.left,width:P.width})}},[g]);u.useEffect(()=>{if(j)return C(),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[j,C]);const I=u.useCallback(P=>{const D=P.trim();return!D||O.includes(D)?!1:(d([...O,D]),L(""),!0)},[O,d]),k=P=>{if(P.key===o&&b.trim())if(P.preventDefault(),l)I(b);else{const D=w.find(U=>U.label.toLowerCase()===b.toLowerCase().trim());D&&I(D.value)}else P.key==="Backspace"&&!b&&O.length>0&&d(O.slice(0,-1))},T=P=>{var D;I(P),(D=$.current)==null||D.focus()},F=P=>{d(O.filter(D=>D!==P))},B=()=>{var P;i||(P=$.current)==null||P.focus()},V=P=>{const D=p.find(U=>U.value===P);return(D==null?void 0:D.label)??P};return a.jsxs(El,{...y,ref:f,className:ee("container",e),children:[c&&a.jsx(Tl,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:S,style:{position:"relative"},children:[a.jsxs(Nl,{ref:v,$variant:m,$disabled:i,$focused:j,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(P=>a.jsx(Qe,{deletable:!i,onDelete:()=>F(P),className:ee("chip",r==null?void 0:r.chip),children:V(P)},P)),a.jsx(Il,{ref:$,type:"text",value:b,onChange:P=>L(P.target.value),onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),150),onKeyDown:k,placeholder:O.length===0?h:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(g?Oe.createPortal(a.jsx(Dl,{ref:x,$open:M,$position:H,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(br,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(hr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}),g):a.jsx(Al,{ref:x,$open:M,$position:H,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(br,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(hr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}))]})]})},Ml=s.div`
1874
+ `,ee=A.newClassNameGetter("tags"),Ze=4,Jl=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:h="Add tag...",portalRenderNode:g,ref:f,value:O,variant:m="normal",...y})=>{const S=u.useRef(null),C=u.useRef(null),x=u.useRef(null),$=u.useRef(null),[b,L]=u.useState(""),[E,T]=u.useState(!1),[V,z]=u.useState("bottom"),[D,j]=u.useState({top:0,left:0,width:0}),w=u.useMemo(()=>{const P=p.filter(X=>!O.includes(X.value));if(!b.trim())return P;const _=b.toLowerCase().trim();return P.filter(X=>X.label.toLowerCase().includes(_))},[p,O,b]),M=E&&p.length>0,v=u.useCallback(()=>{var Me;if(!C.current)return;const P=C.current.getBoundingClientRect(),_=((Me=x.current)==null?void 0:Me.offsetHeight)??200,X=window.innerHeight-P.bottom-Ze,q=P.top-Ze,fe=X<_&&q>X?"top":"bottom";if(z(fe),g){const ot=fe==="bottom"?P.bottom+Ze:P.top-_-Ze;j({top:ot,left:P.left,width:P.width})}},[g]);u.useEffect(()=>{if(E)return v(),window.addEventListener("scroll",v,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",v,!0),window.removeEventListener("resize",v)}},[E,v]);const I=u.useCallback(P=>{const _=P.trim();return!_||O.includes(_)?!1:(d([...O,_]),L(""),!0)},[O,d]),k=P=>{if(P.key===o&&b.trim())if(P.preventDefault(),l)I(b);else{const _=w.find(X=>X.label.toLowerCase()===b.toLowerCase().trim());_&&I(_.value)}else P.key==="Backspace"&&!b&&O.length>0&&d(O.slice(0,-1))},N=P=>{var _;I(P),(_=$.current)==null||_.focus()},F=P=>{d(O.filter(_=>_!==P))},B=()=>{var P;i||(P=$.current)==null||P.focus()},H=P=>{const _=p.find(X=>X.value===P);return(_==null?void 0:_.label)??P};return a.jsxs(Wl,{...y,ref:f,className:ee("container",e),children:[c&&a.jsx(Ul,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:S,style:{position:"relative"},children:[a.jsxs(Xl,{ref:C,$variant:m,$disabled:i,$focused:E,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(P=>a.jsx(Qe,{deletable:!i,onDelete:()=>F(P),className:ee("chip",r==null?void 0:r.chip),children:H(P)},P)),a.jsx(ql,{ref:$,type:"text",value:b,onChange:P=>L(P.target.value),onFocus:()=>T(!0),onBlur:()=>setTimeout(()=>T(!1),150),onKeyDown:k,placeholder:O.length===0?h:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(g?ge.createPortal(a.jsx(Zl,{ref:x,$open:M,$position:V,style:{top:D.top,left:D.left,width:D.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(fr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(gr,{type:"button",onMouseDown:_=>_.preventDefault(),onClick:()=>N(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}),g):a.jsx(Kl,{ref:x,$open:M,$position:V,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(fr,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(gr,{type:"button",onMouseDown:_=>_.preventDefault(),onClick:()=>N(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}))]})]})},Ql=s.div`
1913
1875
  display: flex;
1914
1876
  align-items: center;
1915
1877
  gap: 6px;
1916
- `,Fl=s.button`
1878
+ `,ed=s.button`
1917
1879
  padding: 6px 16px;
1918
1880
  border: none;
1919
1881
  border-radius: 12px;
@@ -1931,19 +1893,14 @@
1931
1893
  &:hover:not(:disabled) {
1932
1894
  background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
1933
1895
  }
1934
-
1935
- &:focus-visible {
1936
- outline: 2px solid ${t.COLORS["steel-blue"]};
1937
- outline-offset: 2px;
1938
- }
1939
- `,gr=A.newClassNameGetter("tabs"),Bl=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(Ml,{...c,ref:i,className:gr("container",e),role:"tablist",children:n.map(d=>a.jsx(Fl,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:gr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),fr={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=e=>fr[e]??fr.normal,Yl=s.div`
1896
+ `,xr=A.newClassNameGetter("tabs"),td=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(Ql,{...c,ref:i,className:xr("container",e),role:"tablist",children:n.map(d=>a.jsx(ed,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:xr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),Or={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)}},de=e=>Or[e]??Or.normal,rd=s.div`
1940
1897
  display: grid;
1941
1898
  flex-direction: column;
1942
1899
  gap: 2px;
1943
1900
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1944
- `,Hl=s(de)`
1901
+ `,od=s(ie)`
1945
1902
  margin-left: 6px;
1946
- `,Vl=s.textarea`
1903
+ `,id=s.textarea`
1947
1904
  flex: 1;
1948
1905
  min-width: 0;
1949
1906
  outline: none;
@@ -1954,48 +1911,26 @@
1954
1911
  border-radius: 16px;
1955
1912
  resize: vertical;
1956
1913
 
1957
- color: ${e=>ne(e.$variant).color.static};
1958
- border: 1px solid ${e=>ne(e.$variant).border.static};
1959
- background-color: ${e=>ne(e.$variant).background.static};
1914
+ color: ${e=>de(e.$variant).color.static};
1915
+ border: 1px solid ${e=>de(e.$variant).border.static};
1916
+ background-color: ${e=>de(e.$variant).background.static};
1960
1917
 
1961
1918
  &::placeholder {
1962
- color: ${e=>ne(e.$variant).placeholder.static};
1919
+ color: ${e=>de(e.$variant).placeholder.static};
1963
1920
  }
1964
1921
 
1965
1922
  &:disabled {
1966
1923
  cursor: not-allowed;
1967
1924
  resize: none;
1968
- color: ${e=>ne(e.$variant).color.disabled};
1969
- background-color: ${e=>ne(e.$variant).background.disabled};
1970
- border-color: ${e=>ne(e.$variant).border.disabled};
1925
+ color: ${e=>de(e.$variant).color.disabled};
1926
+ background-color: ${e=>de(e.$variant).background.disabled};
1927
+ border-color: ${e=>de(e.$variant).border.disabled};
1971
1928
 
1972
1929
  &::placeholder {
1973
- color: ${e=>ne(e.$variant).placeholder.disabled};
1930
+ color: ${e=>de(e.$variant).placeholder.disabled};
1974
1931
  }
1975
1932
  }
1976
-
1977
- &:focus-visible {
1978
- outline: 2px solid ${e=>ne(e.$variant).focus};
1979
- }
1980
- `,$t=A.newClassNameGetter("textarea"),Gl=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(Yl,{className:$t("container",e),$fullWidth:!!i,children:[n&&a.jsx(Hl,{variant:c,className:$t("label",r==null?void 0:r.label),children:n}),a.jsx(Vl,{...p,ref:l,rows:d,disabled:o,$variant:c,className:$t("textarea",r==null?void 0:r.textarea)})]}),Ar=u.createContext(null),St=3,xr={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}},Wl=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<St?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<St?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=St?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},Xl={toasts:[],queue:[]},yt=e=>xr[e]??xr.default,Ul=ae.keyframes`
1981
- from {
1982
- transform: translateY(100%);
1983
- opacity: 0;
1984
- }
1985
- to {
1986
- transform: translateY(0);
1987
- opacity: 1;
1988
- }
1989
- `,ql=ae.keyframes`
1990
- from {
1991
- transform: translateY(0);
1992
- opacity: 1;
1993
- }
1994
- to {
1995
- transform: translateY(100%);
1996
- opacity: 0;
1997
- }
1998
- `,Kl=s.div`
1933
+ `,$t=A.newClassNameGetter("textarea"),nd=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(rd,{className:$t("container",e),$fullWidth:!!i,children:[n&&a.jsx(od,{variant:c,className:$t("label",r==null?void 0:r.label),children:n}),a.jsx(id,{...p,ref:l,rows:d,disabled:o,$variant:c,className:$t("textarea",r==null?void 0:r.textarea)})]}),Mr=u.createContext(null),St=3,$r={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}},ad=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<St?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<St?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=St?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},ld={toasts:[],queue:[]},yt=e=>$r[e]??$r.default,dd=s.div`
1999
1934
  position: fixed;
2000
1935
  bottom: 24px;
2001
1936
  left: 24px;
@@ -2006,7 +1941,7 @@
2006
1941
  pointer-events: none;
2007
1942
  width: auto;
2008
1943
  max-width: 90vw;
2009
- `,Zl=s.div`
1944
+ `,cd=s.div`
2010
1945
  display: flex;
2011
1946
  align-items: center;
2012
1947
  justify-content: space-between;
@@ -2018,17 +1953,18 @@
2018
1953
  border: 1px solid ${({$variant:e})=>yt(e).border};
2019
1954
  border-radius: 96px;
2020
1955
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
2021
- animation: ${({$isExiting:e})=>e?ql:Ul} 0.3s ease-out;
1956
+ animation: ${({$isExiting:e})=>e?t.KEYFRAMES.slideOutBottomFade:t.KEYFRAMES.slideInBottomFade}
1957
+ 0.3s ease-out;
2022
1958
  pointer-events: auto;
2023
1959
  max-width: 500px;
2024
- `,Jl=s.span`
1960
+ `,sd=s.span`
2025
1961
  font-size: 14px;
2026
1962
  font-weight: 500;
2027
1963
  line-height: 1.4;
2028
1964
  white-space: nowrap;
2029
1965
  overflow: hidden;
2030
1966
  text-overflow: ellipsis;
2031
- `,Ql=s.button`
1967
+ `,pd=s.button`
2032
1968
  display: flex;
2033
1969
  align-items: center;
2034
1970
  justify-content: center;
@@ -2046,13 +1982,13 @@
2046
1982
  &:hover {
2047
1983
  opacity: 1;
2048
1984
  }
2049
- `,ed=s.div`
1985
+ `,ud=s.div`
2050
1986
  display: flex;
2051
1987
  align-items: center;
2052
1988
  justify-content: space-between;
2053
1989
  gap: 12px;
2054
1990
  width: 100%;
2055
- `,td=s.div`
1991
+ `,hd=s.div`
2056
1992
  display: flex;
2057
1993
  align-items: center;
2058
1994
  justify-content: center;
@@ -2067,7 +2003,7 @@
2067
2003
  font-weight: 500;
2068
2004
  white-space: nowrap;
2069
2005
  margin-left: auto;
2070
- `,Or=({toast:e,onRemove:r})=>{const[o,i]=u.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(Zl,{$variant:e.variant,$isExiting:o,children:[a.jsx(Jl,{children:e.message}),a.jsx(Ql,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},rd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(Kl,{children:e.map((n,l)=>l===i&&r>0?a.jsxs(ed,{children:[a.jsx(Or,{toast:n,onRemove:o}),a.jsxs(td,{children:["+",r]})]},n.id):a.jsx(Or,{toast:n,onRemove:o},n.id))})},od=({children:e})=>{const[r,o]=u.useReducer(Wl,Xl),i=u.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),n=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Ar.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(rd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},id=()=>{const e=u.useContext(Ar);if(!e)throw new Error("useToast must be used within ToastProvider");return e},$r={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}},De=e=>$r[e]??$r.dark,nd=(e,r)=>{const o=De(r).background;switch(e){case"top":return`
2006
+ `,Sr=({toast:e,onRemove:r})=>{const[o,i]=u.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(cd,{$variant:e.variant,$isExiting:o,children:[a.jsx(sd,{children:e.message}),a.jsx(pd,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},bd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(dd,{children:e.map((n,l)=>l===i&&r>0?a.jsxs(ud,{children:[a.jsx(Sr,{toast:n,onRemove:o}),a.jsxs(hd,{children:["+",r]})]},n.id):a.jsx(Sr,{toast:n,onRemove:o},n.id))})},gd=({children:e})=>{const[r,o]=u.useReducer(ad,ld),i=u.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),n=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Mr.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(bd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},fd=()=>{const e=u.useContext(Mr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},yr={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}},_e=e=>yr[e]??yr.dark,xd=(e,r)=>{const o=_e(r).background;switch(e){case"top":return`
2071
2007
  bottom: -12px;
2072
2008
  left: 50%;
2073
2009
  margin-left: -6px;
@@ -2087,7 +2023,7 @@
2087
2023
  top: 50%;
2088
2024
  margin-top: -6px;
2089
2025
  border-right-color: ${o};
2090
- `;default:return""}},ad=(e,r)=>{if(r!=="light")return"";const o=De(r).border;switch(e){case"top":return`
2026
+ `;default:return""}},Od=(e,r)=>{if(r!=="light")return"";const o=_e(r).border;switch(e){case"top":return`
2091
2027
  &::after {
2092
2028
  bottom: -14px;
2093
2029
  left: 50%;
@@ -2115,11 +2051,11 @@
2115
2051
  margin-top: -7px;
2116
2052
  border-right-color: ${o};
2117
2053
  }
2118
- `;default:return""}},Dr=e=>`
2054
+ `;default:return""}},Fr=e=>`
2119
2055
  z-index: 1000;
2120
2056
  padding: 6px 12px;
2121
- background-color: ${De(e.$variant).background};
2122
- color: ${De(e.$variant).text};
2057
+ background-color: ${_e(e.$variant).background};
2058
+ color: ${_e(e.$variant).text};
2123
2059
  font-size: 13px;
2124
2060
  line-height: 1.4;
2125
2061
  border-radius: 6px;
@@ -2133,7 +2069,7 @@
2133
2069
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
2134
2070
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
2135
2071
 
2136
- ${e.$variant==="light"?`border: 1px solid ${De(e.$variant).border};`:""}
2072
+ ${e.$variant==="light"?`border: 1px solid ${_e(e.$variant).border};`:""}
2137
2073
 
2138
2074
  &::before {
2139
2075
  content: '';
@@ -2141,7 +2077,7 @@
2141
2077
  width: 0;
2142
2078
  height: 0;
2143
2079
  border: 6px solid transparent;
2144
- ${nd(e.$placement,e.$variant)}
2080
+ ${xd(e.$placement,e.$variant)}
2145
2081
  }
2146
2082
 
2147
2083
  ${e.$variant==="light"?`
@@ -2154,11 +2090,11 @@
2154
2090
  }
2155
2091
  `:""}
2156
2092
 
2157
- ${ad(e.$placement,e.$variant)}
2158
- `,ld=s.div`
2093
+ ${Od(e.$placement,e.$variant)}
2094
+ `,$d=s.div`
2159
2095
  position: relative;
2160
2096
  display: inline-block;
2161
- `,dd=e=>{switch(e){case"top":return`
2097
+ `,Sd=e=>{switch(e){case"top":return`
2162
2098
  bottom: calc(100% + 8px);
2163
2099
  left: 50%;
2164
2100
  transform: translateX(-50%);
@@ -2174,12 +2110,12 @@
2174
2110
  left: calc(100% + 8px);
2175
2111
  top: 50%;
2176
2112
  transform: translateY(-50%);
2177
- `;default:return""}},cd=s.div`
2113
+ `;default:return""}},yd=s.div`
2178
2114
  position: absolute;
2179
- ${e=>Dr(e)}
2180
- ${({$placement:e})=>dd(e)}
2181
- `,sd=s.div`
2115
+ ${e=>Fr(e)}
2116
+ ${({$placement:e})=>Sd(e)}
2117
+ `,Cd=s.div`
2182
2118
  position: fixed;
2183
- ${e=>Dr(e)}
2184
- `,vt=A.newClassNameGetter("tooltip"),pe=8,pd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...h})=>{const[g,f]=u.useState(!1),[O,m]=u.useState(null),[y,S]=u.useState(l),[v,x]=u.useState({top:0,left:0}),$=u.useRef(null),b=u.useRef(null),L=u.useCallback(()=>{var T,F;if(!$.current)return;const z=$.current.getBoundingClientRect(),_=((T=b.current)==null?void 0:T.offsetWidth)??100,E=((F=b.current)==null?void 0:F.offsetHeight)??30,w=z.top-pe,M=window.innerHeight-z.bottom-pe,C=z.left-pe,I=window.innerWidth-z.right-pe;let k=l;if(l==="top"&&w<E&&M>w?k="bottom":l==="bottom"&&M<E&&w>M?k="top":l==="left"&&C<_&&I>C?k="right":l==="right"&&I<_&&C>I&&(k="left"),S(k),c){let B,V;switch(k){case"top":B=z.top-E-pe,V=z.left+z.width/2-_/2;break;case"bottom":B=z.bottom+pe,V=z.left+z.width/2-_/2;break;case"left":B=z.top+z.height/2-E/2,V=z.left-_-pe;break;case"right":B=z.top+z.height/2-E/2,V=z.right+pe;break;default:B=0,V=0}const P=8;V=Math.max(P,Math.min(V,window.innerWidth-_-P)),B=Math.max(P,Math.min(B,window.innerHeight-E-P)),x({top:B,left:V})}},[l,c]);u.useLayoutEffect(()=>{g&&L()},[g,L]);const j=()=>{const z=setTimeout(()=>{f(!0)},n);m(z)},N=()=>{O&&(clearTimeout(O),m(null)),f(!1)},H=c?Oe.createPortal(a.jsx(sd,{ref:b,className:vt("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,style:{top:v.top,left:v.left},children:i}),c):a.jsx(cd,{ref:b,className:vt("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,children:i});return a.jsxs(ld,{...h,ref:z=>{$.current=z,typeof d=="function"?d(z):d&&(d.current=z)},className:vt("wrapper",r),onMouseEnter:j,onMouseLeave:N,children:[e,H]})};exports.Autocomplete=Lo;exports.Button=_e;exports.Card=Mo;exports.Checkbox=tt;exports.CheckboxCard=Ko;exports.CheckboxGroup=ei;exports.Chip=Qe;exports.Confirmation=pi;exports.Container=bi;exports.DatePicker=Bi;exports.Drawer=Wi;exports.Dropdown=Ji;exports.FieldLabel=de;exports.FieldMessage=rn;exports.GlobalStyle=io;exports.ImageCropper=sa;exports.Input=Lr;exports.KeySymbol=Sr;exports.KeysBindings=yr;exports.Modal=Pr;exports.MultiSelect=ka;exports.OtpCode=Ea;exports.Panel=_a;exports.Progress=Ba;exports.Radio=Pt;exports.RadioCard=Ja;exports.RadioGroup=rl;exports.SaveProgressProvider=nl;exports.Select=fl;exports.Spinner=Lt;exports.StatusCard=ml;exports.Stepper=jl;exports.Tabs=Bl;exports.Tags=_l;exports.Textarea=Gl;exports.ToastProvider=od;exports.Tooltip=pd;exports.formatDateGo=vr;exports.useImageCropper=kr;exports.useSaveProgress=al;exports.useToast=id;
2119
+ ${e=>Fr(e)}
2120
+ `,Ct=A.newClassNameGetter("tooltip"),ce=8,vd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...h})=>{const[g,f]=u.useState(!1),[O,m]=u.useState(null),[y,S]=u.useState(l),[C,x]=u.useState({top:0,left:0}),$=u.useRef(null),b=u.useRef(null),L=u.useCallback(()=>{var N,F;if(!$.current)return;const z=$.current.getBoundingClientRect(),D=((N=b.current)==null?void 0:N.offsetWidth)??100,j=((F=b.current)==null?void 0:F.offsetHeight)??30,w=z.top-ce,M=window.innerHeight-z.bottom-ce,v=z.left-ce,I=window.innerWidth-z.right-ce;let k=l;if(l==="top"&&w<j&&M>w?k="bottom":l==="bottom"&&M<j&&w>M?k="top":l==="left"&&v<D&&I>v?k="right":l==="right"&&I<D&&v>I&&(k="left"),S(k),c){let B,H;switch(k){case"top":B=z.top-j-ce,H=z.left+z.width/2-D/2;break;case"bottom":B=z.bottom+ce,H=z.left+z.width/2-D/2;break;case"left":B=z.top+z.height/2-j/2,H=z.left-D-ce;break;case"right":B=z.top+z.height/2-j/2,H=z.right+ce;break;default:B=0,H=0}const P=8;H=Math.max(P,Math.min(H,window.innerWidth-D-P)),B=Math.max(P,Math.min(B,window.innerHeight-j-P)),x({top:B,left:H})}},[l,c]);u.useLayoutEffect(()=>{g&&L()},[g,L]);const E=()=>{const z=setTimeout(()=>{f(!0)},n);m(z)},T=()=>{O&&(clearTimeout(O),m(null)),f(!1)},V=c?ge.createPortal(a.jsx(Cd,{ref:b,className:Ct("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,style:{top:C.top,left:C.left},children:i}),c):a.jsx(yd,{ref:b,className:Ct("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,children:i});return a.jsxs($d,{...h,ref:z=>{$.current=z,typeof d=="function"?d(z):d&&(d.current=z)},className:Ct("wrapper",r),onMouseEnter:E,onMouseLeave:T,children:[e,V]})};exports.Autocomplete=Eo;exports.Button=De;exports.Card=Yo;exports.Checkbox=tt;exports.CheckboxCard=Qo;exports.CheckboxGroup=oi;exports.Chip=Qe;exports.Confirmation=bi;exports.Container=xi;exports.DatePicker=Hi;exports.Drawer=qi;exports.Dropdown=tn;exports.FieldLabel=ie;exports.FieldMessage=an;exports.GlobalStyle=lo;exports.ImageCropper=ha;exports.Input=zr;exports.KeySymbol=Cr;exports.KeysBindings=vr;exports.Modal=Er;exports.MultiSelect=za;exports.NotificationProvider=Fa;exports.OtpCode=Wa;exports.Panel=Ja;exports.Progress=tl;exports.Radio=Pt;exports.RadioCard=ul;exports.RadioGroup=fl;exports.SaveProgressProvider=$l;exports.Select=zl;exports.Spinner=Lt;exports.StatusCard=Dl;exports.Stepper=Gl;exports.Tabs=td;exports.Tags=Jl;exports.Textarea=nd;exports.ToastProvider=gd;exports.Tooltip=vd;exports.formatDateGo=mr;exports.useImageCropper=Pr;exports.useNotification=Ba;exports.useSaveProgress=Sl;exports.useToast=fd;
2185
2121
  //# sourceMappingURL=index.cjs.map