@vacano/ui 1.4.4 → 1.5.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"),ne=require("@emotion/react"),u=require("react"),t=require("./media-OVL6YjWb.cjs"),A=require("./tooling-Dflq0Y98.cjs"),xe=require("react-dom");function Qr(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=Qr(u);function yt(){return yt=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},yt.apply(null,arguments)}const eo=ne.css`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),oe=require("@emotion/react"),u=require("react"),t=require("./media-OVL6YjWb.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=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 Re=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=oe.css`
2
2
  *,
3
3
  *::before,
4
4
  *::after {
@@ -141,56 +141,52 @@
141
141
  :focus:not(:focus-visible) {
142
142
  outline: none;
143
143
  }
144
- `,to=()=>a.jsx(ne.Global,{styles:eo});var ro=/^((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)-.*))$/,oo=a.memoize(function(e){return ro.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),io=oo,no=function(r){return r!=="theme"},Et=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?io:no},Tt=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},ao=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},lo=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=Tt(r,o,i),p=d||Et(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 C=g.length,y=1;y<C;y++)f.push(g[y],O[y])}var S=ne.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=Re.useContext(ne.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?Et(b):p,E={};for(var w in v)h&&w==="as"||_(w)&&(E[w]=v[w]);return E.className=L,$&&(E.ref=$),Re.createElement(Re.Fragment,null,Re.createElement(ao,{cache:x,serialized:z,isStringTag:typeof b=="string"}),Re.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,yt({},o,x,{shouldForwardProp:Tt(S,x,!0)}));return $.apply(void 0,f)},S}},co=["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=lo.bind(null);co.forEach(function(e){s[e]=s(e)});const so=s.span`
144
+ `,io=()=>a.jsx(oe.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=oe.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=Re.useContext(oe.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=$),Re.createElement(Re.Fragment,null,Re.createElement(so,{cache:x,serialized:z,isStringTag:typeof b=="string"}),Re.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`
145
145
  font-size: 12px;
146
146
  font-weight: 500;
147
147
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
148
- `,po=A.newClassNameGetter("field-label"),ue=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(so,{...l,ref:o,className:po("container",r),$variant:n,children:[e," ",i&&"*"]}):null,ot={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)}},uo=s.div`
148
+ `,bo=A.newClassNameGetter("field-label"),ne=({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"}},ae={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`
149
149
  position: relative;
150
150
  display: grid;
151
151
  gap: 2px;
152
152
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
153
- `,ho=s(ue)`
153
+ `,fo=s(ne)`
154
154
  margin-left: 6px;
155
- `,bo=s.div`
155
+ `,xo=s.div`
156
156
  position: relative;
157
157
  display: flex;
158
158
  align-items: center;
159
- `,go=s.input`
159
+ `,Oo=s.input`
160
160
  flex: 1;
161
161
  min-width: 0;
162
162
  width: 100%;
163
163
  outline: none;
164
164
  font-size: 14px;
165
165
  font-weight: 500;
166
- height: ${e=>ot[e.$size].height};
167
- padding: ${e=>ot[e.$size].padding};
166
+ height: ${e=>it[e.$size].height};
167
+ padding: ${e=>it[e.$size].padding};
168
168
  padding-right: 40px;
169
- border-radius: ${e=>ot[e.$size].radius};
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=>ae[e.$variant].color.static};
172
+ border: 1px solid ${e=>ae[e.$variant].border.static};
173
+ background-color: ${e=>ae[e.$variant].background.static};
174
174
 
175
175
  &::placeholder {
176
- color: ${e=>oe[e.$variant].placeholder.static};
176
+ color: ${e=>ae[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=>ae[e.$variant].color.disabled};
182
+ background-color: ${e=>ae[e.$variant].background.disabled};
183
+ border-color: ${e=>ae[e.$variant].border.disabled};
184
184
 
185
185
  &::placeholder {
186
- color: ${e=>oe[e.$variant].placeholder.disabled};
186
+ color: ${e=>ae[e.$variant].placeholder.disabled};
187
187
  }
188
188
  }
189
-
190
- &:focus-visible {
191
- outline: 2px solid ${e=>oe[e.$variant].focus};
192
- }
193
- `,fo=s.div`
189
+ `,$o=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
- `,xo=s.div`
197
+ `,So=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
- `,Oo=s.div`
217
+ `,yo=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
- `,$o=s.img`
243
+ `,vo=s.img`
248
244
  width: 24px;
249
245
  height: 24px;
250
246
  border-radius: 6px;
251
247
  object-fit: cover;
252
- `,So=s.span`
248
+ `,Co=s.span`
253
249
  flex: 1;
254
250
  overflow: hidden;
255
251
  text-overflow: ellipsis;
256
252
  white-space: nowrap;
257
- `,yo=s.div`
253
+ `,mo=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
- `,Nt={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},It={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},it=e=>Nt[e]??Nt.md,vo=ne.keyframes`
258
+ `,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=oe.keyframes`
263
259
  0% {
264
260
  transform: rotate(0deg);
265
261
  }
266
262
  100% {
267
263
  transform: rotate(360deg);
268
264
  }
269
- `,mo=s.div`
265
+ `,Ro=s.div`
270
266
  display: inline-block;
271
- width: ${e=>it(e.$size).size};
272
- height: ${e=>it(e.$size).size};
273
- border: ${e=>it(e.$size).borderWidth} solid ${It.track};
274
- border-top-color: ${It.indicator};
267
+ width: ${e=>nt(e.$size).size};
268
+ height: ${e=>nt(e.$size).size};
269
+ border: ${e=>nt(e.$size).borderWidth} solid ${Dt.track};
270
+ border-top-color: ${Dt.indicator};
275
271
  border-radius: 50%;
276
- animation: ${vo} 0.8s linear infinite;
277
- `,Co=A.newClassNameGetter("spinner"),Rt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(mo,{...n,ref:o,className:Co("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),wo=({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:C="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]),m=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(uo,{ref:_,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx(ho,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(bo,{children:[a.jsx(go,{...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(fo,{children:a.jsx(Rt,{size:"xs"})})]}),a.jsx(xo,{$open:j&&H,className:ke("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(T=>a.jsxs(Oo,{onClick:()=>m(T),className:ke("item",r==null?void 0:r.item),children:[T.image_url&&a.jsx($o,{src:T.image_url,alt:T.value}),a.jsx(So,{children:T.value})]},T.id)):!b&&a.jsx(yo,{children:C})})]})},At={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Dt={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=Dt[e];return r||Dt.normal},re=e=>{const r=At[e];return r||At.default},Ro=e=>e?"auto":"fit-content",ko=s.button`
272
+ animation: ${wo} 0.8s linear infinite;
273
+ `,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}),ke=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:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx(fo,{variant:d,className:ke("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:ke("input",r==null?void 0:r.input)}),b&&a.jsx($o,{children:a.jsx(Lt,{size:"xs"})})]}),a.jsx(So,{$open:j&&H,className:ke("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(T=>a.jsxs(yo,{onClick:()=>C(T),className:ke("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`
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:Ro(!!e.$fullWidth)};
279
+ width: ${e=>e.$iconOnly?re(e.$size).height:Po(!!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
- `,Lo=s.div`
305
+ `,jo=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
- `,Po=s.span`
315
+ `,Eo=s.span`
324
316
  font-weight: 600;
325
317
  overflow: hidden;
326
318
  white-space: nowrap;
327
319
  text-overflow: ellipsis;
328
- `,zo=s(a.LoaderCircle)`
320
+ `,To=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
- `,jo=s.div`
324
+ `,No=s.div`
333
325
  display: flex;
334
326
  gap: 3px;
335
- `,Eo=s.span`
327
+ `,Io=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
- `,To=A.newClassNameGetter("key-symbol"),xr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(Eo,{...n,ref:r,className:To("container",e),$variant:i,children:o}):null,_t=A.newClassNameGetter("key-bindings"),Or=({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(jo,{...l,ref:i,className:_t("container",e),children:c.map(d=>a.jsx(xr,{symbol:d,className:_t("item",r==null?void 0:r.item),variant:n},d))})},Mt=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",...C})=>{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(ko,{...C,onClick:d,ref:y,type:S,disabled:i,className:Mt("container",r),$variant:O,$size:g,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(zo,{$size:g}),l&&!c&&a.jsx(Lo,{$size:g,children:l}),e&&a.jsx(Po,{className:Mt("label",o==null?void 0:o.label),children:e}),a.jsx(Or,{keys:h,variant:O==="system"?"light":"dark"})]})},No=s.div`
340
+ `,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`
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
- `,Io=A.newClassNameGetter("card"),Ao=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(No,{...l,ref:o,className:Io("container",r),$border:i,$shadow:n,children:e}),Ft={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}},be=e=>Ft[e]??Ft.normal,Do=s.label`
345
+ `,_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}},ye=e=>Yt[e]??Yt.normal,Fo=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=>be(e.$variant).box.focusShadow};
362
- }
363
- `,_o=s.input`
351
+ `,Bo=s.input`
364
352
  position: absolute;
365
353
  opacity: 0;
366
354
  width: 0;
367
355
  height: 0;
368
356
  pointer-events: none;
369
- `,Mo=s.span`
357
+ `,Yo=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?be(e.$variant).box.borderChecked:be(e.$variant).box.border};
379
- background-color: ${e=>e.$checked||e.$indeterminate?be(e.$variant).box.backgroundChecked:be(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
- `,Fo=s.span`
372
+ `,Ho=s.span`
385
373
  display: inline-flex;
386
374
  align-items: center;
387
375
  justify-content: center;
388
- color: ${e=>be(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
- `,Bo=s.span`
387
+ `,Vo=s.span`
400
388
  font-size: 14px;
401
389
  font-weight: 500;
402
390
  line-height: 1.4;
403
- color: ${e=>be(e.$variant).label};
391
+ color: ${e=>ye(e.$variant).label};
404
392
  user-select: none;
405
393
 
406
394
  a {
@@ -412,15 +400,15 @@
412
400
  text-decoration: none;
413
401
  }
414
402
  }
415
- `,Le=A.newClassNameGetter("checkbox"),et=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(Do,{className:Le("container",r),$disabled:!!i,$variant:p,children:[a.jsx(_o,{...h,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Mo,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Fo,{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(Bo,{className:Le("label",o==null?void 0:o.label),$variant:p,children:l})]}),Bt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},se=e=>Bt[e]??Bt.normal,Yo=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(Fo,{className:Le("container",r),$disabled:!!i,$variant:p,children:[a.jsx(Bo,{...h,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Yo,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Ho,{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(Vo,{className:Le("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)}}},he=e=>Ht[e]??Ht.normal,Go=s.label`
416
404
  display: grid;
417
405
  grid-template-columns: auto 1fr;
418
406
  align-items: start;
419
407
  gap: 8px;
420
408
  padding: 12px;
421
- background-color: ${e=>{const r=se(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
409
+ background-color: ${e=>{const r=he(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
422
410
  border: 1px solid
423
- ${e=>{const r=se(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
411
+ ${e=>{const r=he(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
424
412
  border-radius: 12px;
425
413
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
426
414
  transition:
@@ -430,18 +418,13 @@
430
418
  min-width: 0;
431
419
 
432
420
  &:hover:not([data-disabled='true']) {
433
- border-color: ${e=>{const r=se(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
434
- }
435
-
436
- &:has(:focus-visible) {
437
- outline: none;
438
- box-shadow: 0 0 0 3px ${e=>se(e.$variant).focusRing};
421
+ border-color: ${e=>{const r=he(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
439
422
  }
440
423
 
441
424
  .vacano_checkbox_container {
442
425
  pointer-events: none;
443
426
  }
444
- `,Ho=s.input`
427
+ `,Wo=s.input`
445
428
  position: absolute;
446
429
  width: 1px;
447
430
  height: 1px;
@@ -451,44 +434,44 @@
451
434
  clip: rect(0, 0, 0, 0);
452
435
  white-space: nowrap;
453
436
  border: 0;
454
- `,Go=s.div`
437
+ `,Xo=s.div`
455
438
  display: flex;
456
439
  flex-direction: column;
457
440
  gap: 2px;
458
441
  min-width: 0;
459
- `,Vo=s.span`
442
+ `,Uo=s.span`
460
443
  font-size: 14px;
461
444
  font-weight: 500;
462
445
  line-height: 1.4;
463
- color: ${e=>se(e.$variant).label.static};
446
+ color: ${e=>he(e.$variant).label.static};
464
447
 
465
448
  label[data-disabled='true'] & {
466
- color: ${e=>se(e.$variant).label.disabled};
449
+ color: ${e=>he(e.$variant).label.disabled};
467
450
  }
468
- `,Wo=s.span`
451
+ `,qo=s.span`
469
452
  font-size: 12px;
470
453
  font-weight: 400;
471
454
  line-height: 1.4;
472
- color: ${e=>se(e.$variant).description.static};
455
+ color: ${e=>he(e.$variant).description.static};
473
456
 
474
457
  label[data-disabled='true'] & {
475
- color: ${e=>se(e.$variant).description.disabled};
458
+ color: ${e=>he(e.$variant).description.disabled};
476
459
  }
477
- `,Ye=A.newClassNameGetter("checkbox-card"),Uo=({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(Yo,{className:Ye("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Ho,{...g,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(et,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Go,{className:Ye("content",o==null?void 0:o.content),children:[a.jsx(Vo,{className:Ye("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Wo,{className:Ye("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),Yt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Xo=s.div`
460
+ `,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`
478
461
  display: flex;
479
462
  flex-direction: column;
480
463
  gap: 8px;
481
- `,qo=s.span`
464
+ `,Jo=s.span`
482
465
  font-size: 13px;
483
466
  font-weight: 500;
484
467
  line-height: 1.5;
485
- color: ${e=>e.$disabled?Yt.label.disabledColor:Yt.label.color};
468
+ color: ${e=>e.$disabled?Vt.label.disabledColor:Vt.label.color};
486
469
  margin-bottom: 4px;
487
- `,Ko=s.div`
470
+ `,Qo=s.div`
488
471
  display: flex;
489
472
  flex-direction: column;
490
473
  gap: 12px;
491
- `,nt=A.newClassNameGetter("checkbox-group"),Zo=({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(Xo,{...p,ref:c,className:nt("container",e),children:[i&&a.jsx(qo,{className:nt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Ko,{className:nt("options",r==null?void 0:r.options),children:l.map(g=>a.jsx(et,{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))})]})},Ht={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)}},vt=e=>Ht[e]??Ht.gray,Jo=s.span`
474
+ `,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`
492
475
  display: inline-flex;
493
476
  align-items: center;
494
477
  gap: 4px;
@@ -498,9 +481,9 @@
498
481
  font-size: 12px;
499
482
  font-weight: 500;
500
483
  line-height: 1.5;
501
- background-color: ${e=>vt(e.$variant).background};
502
- color: ${e=>vt(e.$variant).color};
503
- `,Qo=s.button`
484
+ background-color: ${e=>mt(e.$variant).background};
485
+ color: ${e=>mt(e.$variant).color};
486
+ `,ri=s.button`
504
487
  display: inline-flex;
505
488
  align-items: center;
506
489
  justify-content: center;
@@ -515,17 +498,17 @@
515
498
  transition: background-color 0.15s ease;
516
499
 
517
500
  &:hover {
518
- background-color: ${e=>vt(e.$variant).deleteHover};
501
+ background-color: ${e=>mt(e.$variant).deleteHover};
519
502
  }
520
503
 
521
504
  & svg {
522
505
  width: 14px;
523
506
  height: 14px;
524
507
  }
525
- `,ei=s.span`
508
+ `,oi=s.span`
526
509
  flex: 1 0 auto;
527
510
  text-align: center;
528
- `,at=A.newClassNameGetter("chip"),Je=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(Jo,{...d,ref:l,className:at("container",r),$variant:c,$deletable:!!i,children:[a.jsx(ei,{className:at("label",o==null?void 0:o.label),children:e}),i&&a.jsx(Qo,{type:"button",className:at("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),ti="Confirm",ri="Cancel",oi=ne.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(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=oe.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
- `,ii=ne.keyframes`
520
+ `,li=oe.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
- `,ni=s.div`
529
+ `,di=s.div`
547
530
  position: fixed;
548
531
  bottom: 24px;
549
532
  left: 50%;
@@ -558,18 +541,18 @@
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?oi:ii} 0.2s ease-out forwards;
544
+ animation: ${({$open:e})=>e?ai:li} 0.2s ease-out forwards;
562
545
  z-index: 1000;
563
- `,ai=s.p`
546
+ `,ci=s.p`
564
547
  margin: 0;
565
548
  font-size: 14px;
566
549
  color: ${t.COLORS.black};
567
550
  white-space: nowrap;
568
- `,li=s.div`
551
+ `,si=s.div`
569
552
  display: flex;
570
553
  align-items: center;
571
554
  gap: 8px;
572
- `,Pe=A.newClassNameGetter("confirmation"),di=({cancelBindings:e,cancelLabel:r=ri,className:o,classnames:i,confirmLabel:n=ti,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:g,submitBindings:f,...O})=>h?a.jsxs(ni,{...O,ref:g,className:Pe("container",o),$open:h,children:[a.jsx(ai,{className:Pe("message",i==null?void 0:i.message),children:c}),a.jsxs(li,{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`},ci=s.div`
555
+ `,Pe=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:Pe("container",o),$open:h,children:[a.jsx(ci,{className:Pe("message",i==null?void 0:i.message),children:c}),a.jsxs(si,{className:Pe("actions",i==null?void 0:i.actions),children:[a.jsx(_e,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:Pe("cancel-button",i==null?void 0:i.cancelButton),children:r}),a.jsx(_e,{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`},ui=s.div`
573
556
  width: 100%;
574
557
 
575
558
  ${t.mediaUp("sm")} {
@@ -591,16 +574,16 @@
591
574
  ${t.mediaUp("2xl")} {
592
575
  max-width: ${ze["2xl"]};
593
576
  }
594
- `,si=A.newClassNameGetter("container"),pi=({children:e,className:r,ref:o,...i})=>a.jsx(ci,{...i,ref:o,className:si("container",r),children:e}),Ze={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Se={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)}},ae=36,tt=2,ui=12,$r=(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),C=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",C],["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},hi=(e,r)=>new Date(e,r+1,0).getDate(),bi=(e,r)=>new Date(e,r,1).getDay(),gi=(e,r,o=1)=>{const i=hi(e,r);let l=bi(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},fi=(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},xi=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},Gt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Vt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),Oi=(e,r)=>e.getFullYear()===r.getFullYear(),Wt=(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},Ut=(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},Xt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),$i=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Si=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},yi=s.div`
577
+ `,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}},je={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=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`
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
- `,vi=s(ue)`
584
+ `,wi=s(ne)`
602
585
  margin-left: 6px;
603
- `,mi=s.button`
586
+ `,Ri=s.button`
604
587
  display: flex;
605
588
  align-items: center;
606
589
  justify-content: space-between;
@@ -611,68 +594,64 @@
611
594
  font-size: 14px;
612
595
  font-weight: 500;
613
596
  text-align: left;
614
- height: ${({$size:e})=>Ze[e].height};
615
- padding: ${({$size:e})=>Ze[e].padding};
616
- border-radius: ${({$size:e})=>Ze[e].radius};
617
- color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?Se[e].color[r?"disabled":"static"]:Se[e].placeholder[r?"disabled":"static"]};
597
+ height: ${({$size:e})=>Je[e].height};
598
+ padding: ${({$size:e})=>Je[e].padding};
599
+ border-radius: ${({$size:e})=>Je[e].radius};
600
+ color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?je[e].color[r?"disabled":"static"]:je[e].placeholder[r?"disabled":"static"]};
618
601
  border: 1px solid
619
- ${({$variant:e,$disabled:r})=>Se[e].border[r?"disabled":"static"]};
620
- background-color: ${({$variant:e,$disabled:r})=>Se[e].background[r?"disabled":"static"]};
621
-
622
- &:focus-visible {
623
- outline: 2px solid ${({$variant:e})=>Se[e].focus};
624
- }
602
+ ${({$variant:e,$disabled:r})=>je[e].border[r?"disabled":"static"]};
603
+ background-color: ${({$variant:e,$disabled:r})=>je[e].background[r?"disabled":"static"]};
625
604
 
626
605
  ${({$open:e,$variant:r})=>e&&`
627
- outline: 2px solid ${Se[r].focus};
606
+ outline: 2px solid ${je[r].focus};
628
607
  `}
629
- `,Ci=s.span`
608
+ `,ki=s.span`
630
609
  flex: 1;
631
610
  overflow: hidden;
632
611
  text-overflow: ellipsis;
633
612
  white-space: nowrap;
634
- `,wi=s.span`
613
+ `,Li=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
- `,Sr=`
620
+ `,Cr=`
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: ${ui}px;
648
- `,yr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ri=s.div`
626
+ padding: ${gi}px;
627
+ `,mr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Pi=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
- ${Sr}
631
+ ${Cr}
653
632
  opacity: ${({$open:e})=>e?1:0};
654
633
  visibility: ${({$open:e})=>e?"visible":"hidden"};
655
- transform: ${({$open:e,$position:r})=>yr(e,r)};
634
+ transform: ${({$open:e,$position:r})=>mr(e,r)};
656
635
  transition:
657
636
  opacity 0.15s ease,
658
637
  transform 0.15s ease,
659
638
  visibility 0.15s;
660
- `,ki=s.div`
639
+ `,zi=s.div`
661
640
  position: fixed;
662
- ${Sr}
641
+ ${Cr}
663
642
  opacity: ${({$open:e})=>e?1:0};
664
643
  visibility: ${({$open:e})=>e?"visible":"hidden"};
665
- transform: ${({$open:e,$position:r})=>yr(e,r)};
644
+ transform: ${({$open:e,$position:r})=>mr(e,r)};
666
645
  transition:
667
646
  opacity 0.15s ease,
668
647
  transform 0.15s ease,
669
648
  visibility 0.15s;
670
- `,lt=s.div`
649
+ `,dt=s.div`
671
650
  display: flex;
672
651
  align-items: center;
673
652
  justify-content: space-between;
674
653
  margin-bottom: 8px;
675
- `,dt=s.button`
654
+ `,ct=s.button`
676
655
  display: flex;
677
656
  align-items: center;
678
657
  gap: 4px;
@@ -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
- `,ye=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;
@@ -720,33 +691,33 @@
720
691
  background: transparent;
721
692
  }
722
693
  }
723
- `,ct=s.div`
694
+ `,st=s.div`
724
695
  display: flex;
725
696
  gap: 4px;
726
- `,Li=s.div`
697
+ `,ji=s.div`
727
698
  display: grid;
728
- grid-template-columns: repeat(7, ${ae}px);
729
- gap: ${tt}px;
699
+ grid-template-columns: repeat(7, ${ie}px);
700
+ gap: ${rt}px;
730
701
  margin-bottom: 4px;
731
- `,Pi=s.div`
702
+ `,Ei=s.div`
732
703
  display: flex;
733
704
  align-items: center;
734
705
  justify-content: center;
735
- height: ${ae}px;
706
+ height: ${ie}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
- `,zi=s.div`
711
+ `,Ti=s.div`
741
712
  display: grid;
742
- grid-template-columns: repeat(7, ${ae}px);
743
- gap: ${tt}px;
744
- `,ji=s.button`
713
+ grid-template-columns: repeat(7, ${ie}px);
714
+ gap: ${rt}px;
715
+ `,Ni=s.button`
745
716
  display: flex;
746
717
  align-items: center;
747
718
  justify-content: center;
748
- width: ${ae}px;
749
- height: ${ae}px;
719
+ width: ${ie}px;
720
+ height: ${ie}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
- `,Ei=s.div`
740
+ `,Ii=s.div`
775
741
  display: grid;
776
742
  grid-template-columns: repeat(3, 1fr);
777
743
  gap: 8px;
778
- width: ${7*ae+6*tt}px;
779
- `,Ti=s.button`
744
+ width: ${7*ie+6*rt}px;
745
+ `,Ai=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
- `,Ni=s.div`
765
+ `,Di=s.div`
805
766
  display: grid;
806
767
  grid-template-columns: repeat(3, 1fr);
807
768
  gap: 8px;
808
- width: ${7*ae+6*tt}px;
809
- `,Ii=s.button`
769
+ width: ${7*ie+6*rt}px;
770
+ `,_i=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
- `,Ai=s.div`
835
- width: ${ae}px;
836
- height: ${ae}px;
837
- `,K=A.newClassNameGetter("date-picker"),He=4,Di=300,_i=({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:C,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"),[m,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),G=u.useRef(null),P=u.useRef(null),D=u.useRef(null),X=S!==void 0,q=X?S:H,Oe=i??Si(o),_e=u.useMemo(()=>fi(l,c),[l,c]),rt=u.useMemo(()=>xi(l),[l]),Ir=u.useMemo(()=>gi(k.getFullYear(),k.getMonth(),c),[k,c]),Me=u.useMemo(()=>$i(F+6,12),[F]),Lt=u.useMemo(()=>e?$r(e,Oe,l):null,[e,Oe,l]),Ar=n??Oe.replace(/2006|06|January|Jan|01|02/g,"__"),me=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Di,Ce=window.innerHeight-R.bottom-He,Fe=R.top-He,$e=Ce<Y&&Fe>Ce?"top":"bottom";if(M($e),y){const Be=$e==="bottom"?R.bottom+He:R.top-Y-He;E({top:Be,left:R.left})}},[y]),Pt=u.useCallback(()=>{if(f)return;X||z(!0),v==null||v(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,X,v,o,e,N]),Z=u.useCallback(()=>{X||z(!1),x==null||x()},[X,x]),Dr=u.useCallback(()=>{q?Z():Pt()},[q,Z,Pt]),_r=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Mr=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]),Fr=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]),Br=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Yr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),Hr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Gr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Vr=u.useCallback(()=>{B(R=>R-12)},[]),Wr=u.useCallback(()=>{B(R=>R+12)},[]),zt=u.useCallback(()=>{m==="days"?I("months"):m==="months"&&I("years")},[m]);u.useLayoutEffect(()=>{q&&me()},[q,me]),u.useEffect(()=>{const R=$e=>{const we=$e.target,Be=G.current&&!G.current.contains(we),Jr=D.current&&!D.current.contains(we);y?Be&&Jr&&Z():Be&&Z()},Y=$e=>{$e.key==="Escape"&&Z()},Ce=()=>{q&&y&&me()},Fe=()=>{q&&y&&me()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",Ce,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",Ce,!0),window.removeEventListener("resize",Fe)}},[q,Z,y,me]);const Ur=Ze[h].iconSize,Xr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Br,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Yr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Li,{children:_e.map((R,Y)=>a.jsx(Pi,{children:R},Y))}),a.jsx(zi,{className:K("grid",b==null?void 0:b.grid),children:Ir.map((R,Y)=>R===null?a.jsx(Ai,{},Y):a.jsx(ji,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Gt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Gt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Wt(k.getFullYear(),k.getMonth(),R,d,p),disabled:Wt(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>_r(R),children:R},Y))})]}),qr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:k.getFullYear()}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Hr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Gr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ei,{className:K("grid",b==null?void 0:b.grid),children:rt.map((R,Y)=>a.jsx(Ti,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Vt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Vt(N,new Date(k.getFullYear(),Y,1)),$disabled:Ut(k.getFullYear(),Y,d,p),disabled:Ut(k.getFullYear(),Y,d,p),onClick:()=>Mr(Y),children:R},Y))})]}),Kr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(dt,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Vr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Wr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ni,{className:K("grid",b==null?void 0:b.grid),children:Me.map(R=>a.jsx(Ii,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Oi(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:Xt(R,d,p),disabled:Xt(R,d,p),onClick:()=>Fr(R),children:R},R))})]}),jt=()=>{switch(m){case"days":return Xr();case"months":return qr();case"years":return Kr()}},Zr=y?xe.createPortal(a.jsx(ki,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:_.top,left:_.left},children:jt()}),y):a.jsx(Ri,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:jt()});return a.jsxs(yi,{...j,ref:L??G,$fullWidth:O,className:K("container",$),children:[C&&a.jsx(vi,{children:C}),a.jsxs(mi,{ref:P,type:"button",onClick:Dr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!Lt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(Ci,{children:Lt??Ar}),a.jsx(wi,{$open:q,children:a.jsx(a.ChevronDown,{size:Ur})})]}),Zr]})},Mi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Fi=(e,r)=>{switch(e){case"left":return`
790
+ `,Mi=s.div`
791
+ width: ${ie}px;
792
+ height: ${ie}px;
793
+ `,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,fe=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,fe,l):null,[e,fe,l]),Mr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),Ce=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Fi,me=window.innerHeight-R.bottom-Ve,Be=R.top-Ve,xe=me<Y&&Be>me?"top":"bottom";if(M(xe),y){const Ye=xe==="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&&Ce()},[q,Ce]),u.useEffect(()=>{const R=xe=>{const we=xe.target,Ye=V.current&&!V.current.contains(we),to=D.current&&!D.current.contains(we);y?Ye&&to&&Z():Ye&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},me=()=>{q&&y&&Ce()},Be=()=>{q&&y&&Ce()};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,Ce]);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(Oe,{onClick:Vr,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{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(Oe,{onClick:Wr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{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(Oe,{onClick:Ur,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{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?ge.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`
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
- `}},Bi=s.div`
813
+ `}},Vi=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=>Fi(e.$position,e.$size)}
863
- animation: ${e=>Mi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
864
- `,Yi=A.newClassNameGetter("drawer"),Hi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?xe.createPortal(a.jsx(Bi,{...d,ref:l,className:Yi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Gi=s.div`
818
+ ${e=>Hi(e.$position,e.$size)}
819
+ animation: ${e=>Yi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
820
+ `,Gi=A.newClassNameGetter("drawer"),Wi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.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`
865
821
  position: relative;
866
822
  display: inline-block;
867
- `,Vi=s.div`
823
+ `,Ui=s.div`
868
824
  cursor: pointer;
869
- `,vr=`
825
+ `,wr=`
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
- `,mr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Wi=s.div`
833
+ `,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",qi=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
- ${vr}
837
+ ${wr}
882
838
  opacity: ${({$open:e})=>e?1:0};
883
839
  visibility: ${({$open:e})=>e?"visible":"hidden"};
884
- transform: ${({$open:e,$position:r})=>mr(e,r)};
840
+ transform: ${({$open:e,$position:r})=>Rr(e,r)};
885
841
  transition:
886
842
  opacity 0.15s ease,
887
843
  transform 0.15s ease,
888
844
  visibility 0.15s;
889
- `,Ui=s.div`
845
+ `,Ki=s.div`
890
846
  position: fixed;
891
- ${vr}
847
+ ${wr}
892
848
  opacity: ${({$open:e})=>e?1:0};
893
849
  visibility: ${({$open:e})=>e?"visible":"hidden"};
894
- transform: ${({$open:e,$position:r})=>mr(e,r)};
850
+ transform: ${({$open:e,$position:r})=>Rr(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"),Ve=4,Xi=100,qi=({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),[C,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)??Xi,M=((F=b.current)==null?void 0:F.offsetWidth)??160,m=window.innerHeight-E.bottom-Ve,I=E.top-Ve,k=m<w&&I>m?"top":"bottom";if(v(k),d){let B;e==="left"?B=E.left:B=E.right-M;const G=k==="bottom"?E.bottom+Ve:E.top-w-Ve;y({top:G,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()},m=()=>{j&&d&&N()};return j&&(document.addEventListener("mousedown",E),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",m))),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",m)}},[j,z,d,N]);const _=d?xe.createPortal(a.jsx(Ui,{ref:b,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),style:{top:C.top,left:C.left},children:r}),d):a.jsx(Wi,{ref:b,$align:e,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),children:r});return a.jsxs(Gi,{...g,ref:p??x,className:Ge("container",o),children:[a.jsx(Vi,{ref:$,onClick:H,className:Ge("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),_]})},Ki={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},Zi=s.span`
855
+ `,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?ge.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`
900
856
  display: block;
901
857
  font-size: 12px;
902
858
  font-weight: 500;
903
859
  line-height: 1.4;
904
- color: ${e=>Ki[e.$variant]};
905
- `,Ji=A.newClassNameGetter("field-message"),Qi=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(Zi,{...n,ref:o,className:Ji("container",r),$variant:i,children:e}):null,en=s.div`
860
+ color: ${e=>Qi[e.$variant]};
861
+ `,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`
906
862
  display: flex;
907
863
  flex-direction: column;
908
864
  gap: 12px;
909
- `,tn=s.div`
865
+ `,nn=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
- `,rn=s.span`
881
+ `,an=s.span`
926
882
  font-size: 12px;
927
883
  color: ${t.COLORS["iron-grey"]};
928
- `,on=e=>`
884
+ `,ln=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
- `,nn=e=>`
902
+ `,dn=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
- `,an=e=>`
926
+ `,cn=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
- `,ln=e=>`
944
+ `,sn=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
- `,dn=e=>`
962
+ `,pn=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
- `,cn=e=>`
981
+ `,un=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
- `,sn=e=>`
1003
+ `,hn=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
- `,pn=e=>`
1021
+ `,bn=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
- `,un=e=>`
1028
+ `,gn=e=>`
1073
1029
  .${e} {
1074
1030
  position: absolute;
1075
1031
  z-index: 3;
1076
1032
  touch-action: none;
1077
1033
  }
1078
- `,hn=e=>`
1034
+ `,fn=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
- `,bn=e=>`
1041
+ `,xn=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
- `,gn={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},fn={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},We=(e,r)=>{const o=gn[r],{h:i,v:n}=fn[r];return`
1052
+ `,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`
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
- `},xn=e=>`
1078
+ `},Sn=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
- `,On=e=>`
1104
+ `,yn=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
- `,$n=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)},V=e=>`hq-cropper__${$n(e)}`,W=e=>e||[],U=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Sn=e=>{const r={applyButton:[V("applyButton"),...W(e.applyButton)],cancelButton:[V("cancelButton"),...W(e.cancelButton)],container:[V("container"),...W(e.container)],handlerMove:[V("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[V("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[V("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[V("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[V("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[V("sourceImage"),...W(e.sourceImage)],portalArea:[V("portalArea"),...W(e.portalArea)],previewImage:[V("previewImage"),...W(e.previewImage)],body:[V("body"),...W(e.body)],header:[V("header"),...W(e.header)],footer:[V("footer"),...W(e.footer)],portal:[V("portal"),...W(e.portal)],preview:[V("preview"),...W(e.preview)],root:[V("root"),...W(e.root)]},o=`
1162
- ${on(r.applyButton[0])}
1163
- ${nn(r.body[0])}
1164
- ${an(r.cancelButton[0])}
1165
- ${ln(r.container[0])}
1166
- ${dn(r.footer[0])}
1167
- ${cn(r.header[0])}
1168
- ${sn(r.handlerMove[0])}
1169
- ${pn(r.portalArea[0])}
1170
- ${un(r.portal[0])}
1171
- ${hn(r.previewImage[0])}
1172
- ${bn(r.preview[0])}
1173
- ${We(r.handlerResizeBottomLeft[0],"bl")}
1174
- ${We(r.handlerResizeBottomRight[0],"br")}
1175
- ${We(r.handlerResizeTopLeft[0],"tl")}
1176
- ${We(r.handlerResizeTopRight[0],"tr")}
1177
- ${xn(r.root[0])}
1178
- ${On(r.sourceImage[0])}
1179
- `,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let yn=0;const vn=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(++yn),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()}}},mt={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"]}},mn=(e={},r={})=>vn({...mt,config:{...mt.config,...e},css:Sn(r)}),Cn=(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}},wn=(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]},Rn=(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]=wn(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 kn=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},Ln=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},Pn=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},zn=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},jn=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},En=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Tn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(En(e)),o},Nn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Tn(e)),o.appendChild(kn(e)),o.appendChild(zn(e)),o.appendChild(jn(e)),o.appendChild(Ln(e)),o.appendChild(Pn(e)),o},In=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Nn(e)),o},An=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},Dn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(An(e)),o.appendChild(In(e)),o},_n=(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},Mn=(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},Fn=(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(Mn(e,o)),n.appendChild(_n(e,r)),n},Bn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},Yn=(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(Bn(e)),n.appendChild(Dn(e)),n.appendChild(Fn(e,r,o)),n},Hn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(Yn(e,r,o)),document.body.appendChild(n)},Gn=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},Ie=new Map,Vn={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},ge=(e,r)=>{if(Ie.has(e))return Ie.get(e);if(!r)return null;const o=r[Vn[e]],i=document.querySelector(`.${o[0]}`);return Ie.set(e,i),i},Wn=()=>{Ie.clear()},Un=()=>{Ie.clear()},Xn=(e,r)=>{const o=ge("header",r.css);o&&(o.innerText=e)},qn=(e,r)=>{const o=ge("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=ge("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=ge("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=ge("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`)},Kn=(e,r)=>{const o=ge("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=ge("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},st=1,Zn=e=>{var C,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||st,n=r.frame.height||st,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),st),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(C=r.css)==null?void 0:C.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)}})},Jn=(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}})},Qn=(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,C=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,C=n.top+y}if(C<d.framePadding){const y=d.framePadding-C;C=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,C=C+y,f=f-y}return o({portal:{...l,top:C,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}},qt=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}},ea=(e,r)=>{var O,C,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(C=o.css)==null?void 0:C.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=qt(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:Jn(S,e,r);break;default:Qn(S,e,r)}},f=S=>{const{action:v}=e();v&&(S.preventDefault(),d=qt(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))}},Kt=1024*1024,ta=(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/Kt).toFixed(2);return`File size (${(e.size/Kt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},ra=(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=ta(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const C=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Un(),l(),o(mt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),C()},v=x=>{x.preventDefault();const $=r();Zn(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;Hn(r,v,S),Wn(),n("fileName",Xn),n("sourceBase64",qn),n("portal",Kn);const b=Cn(r,$),L=Rn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(j=x.target)==null?void 0:j.result,sourceHeight:$.height,sourceWidth:$.width}),O=ea(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},oa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=mn(r,o),p=Gn(h=>ra(h,n,l,e,c,d,i));return{open:()=>p.click()}},le={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Zt="vacano-image-cropper-styles",ia=`
1117
+ `,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=`
1118
+ ${ln(r.applyButton[0])}
1119
+ ${dn(r.body[0])}
1120
+ ${cn(r.cancelButton[0])}
1121
+ ${sn(r.container[0])}
1122
+ ${pn(r.footer[0])}
1123
+ ${un(r.header[0])}
1124
+ ${hn(r.handlerMove[0])}
1125
+ ${bn(r.portalArea[0])}
1126
+ ${gn(r.portal[0])}
1127
+ ${fn(r.previewImage[0])}
1128
+ ${xn(r.preview[0])}
1129
+ ${Xe(r.handlerResizeBottomLeft[0],"bl")}
1130
+ ${Xe(r.handlerResizeBottomRight[0],"br")}
1131
+ ${Xe(r.handlerResizeTopLeft[0],"tl")}
1132
+ ${Xe(r.handlerResizeTopRight[0],"tr")}
1133
+ ${Sn(r.root[0])}
1134
+ ${yn(r.sourceImage[0])}
1135
+ `,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"},ue=(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=ue("header",r.css);o&&(o.innerText=e)},Jn=(e,r)=>{const o=ue("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=ue("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=ue("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=ue("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=ue("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=ue("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()}},le={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=`
1180
1136
  .vacano-cropper-root {
1181
1137
  background-color: rgba(0, 0, 0, 0.5);
1182
1138
  backdrop-filter: blur(4px);
@@ -1224,46 +1180,42 @@
1224
1180
  .vacano-cropper-apply-button:hover {
1225
1181
  background-color: ${t.COLORS["iron-grey"]};
1226
1182
  }
1227
- `,na=()=>{if(typeof document>"u"||document.getElementById(Zt))return;const e=document.createElement("style");e.id=Zt,e.textContent=ia,document.head.appendChild(e)},aa={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"]},Cr=(e={})=>{const{allowedTypes:r=le.allowedTypes,applyLabel:o=le.applyLabel,cancelLabel:i=le.cancelLabel,compression:n=le.compression,maxFileSize:l=le.maxFileSize,onCrop:c,onError:d,outputSize:p=le.outputSize,portalSize:h=le.portalSize,type:g=le.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(na(),f.current=oa((C,y,S)=>{y&&(c==null||c({base64:C,blob:y,state:S}))},{portalSize:h,outputSize:p,compression:n,type:g,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},aa,C=>{d==null||d({code:"CROPPER_ERROR",message:C})})),f.current.open()},[r,o,i,n,l,c,d,p,h,g])}},pt=A.newClassNameGetter("image-cropper"),la=({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:C,type:y,value:S,...v})=>{const[x,$]=u.useState(S??null),{open:b}=Cr({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(en,{...v,ref:C,className:pt("container",n),children:[a.jsx(tn,{$size:O,className:pt("preview",l==null?void 0:l.preview),children:x?a.jsx("img",{src:x,alt:"Preview"}):a.jsx(rn,{children:"No image"})}),a.jsx(De,{variant:"system",onClick:b,className:pt("button",l==null?void 0:l.button),style:{width:O},children:o})]})},Jt={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},Qt={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=>Qt[e]??Qt.normal,ut=e=>Jt[e]??Jt.default,da=s.div`
1183
+ `,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=le.allowedTypes,applyLabel:o=le.applyLabel,cancelLabel:i=le.cancelLabel,compression:n=le.compression,maxFileSize:l=le.maxFileSize,onCrop:c,onError:d,outputSize:p=le.outputSize,portalSize:h=le.portalSize,type:g=le.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)}},de=e=>tr[e]??tr.normal,ht=e=>er[e]??er.default,pa=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
- `,ca=s(ue)`
1188
+ `,ua=s(ne)`
1233
1189
  margin-left: 6px;
1234
- `,sa=s.input`
1190
+ `,ha=s.input`
1235
1191
  flex: 1;
1236
1192
  min-width: 0;
1237
1193
  outline: none;
1238
1194
  font-size: 14px;
1239
1195
  font-weight: 500;
1240
- height: ${e=>ut(e.$size).height};
1241
- padding: ${e=>ut(e.$size).padding};
1242
- border-radius: ${e=>ut(e.$size).radius};
1196
+ height: ${e=>ht(e.$size).height};
1197
+ padding: ${e=>ht(e.$size).padding};
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=>de(e.$variant).color.static};
1201
+ border: 1px solid ${e=>de(e.$variant).border.static};
1202
+ background-color: ${e=>de(e.$variant).background.static};
1247
1203
 
1248
1204
  &::placeholder {
1249
- color: ${e=>ie(e.$variant).placeholder.static};
1205
+ color: ${e=>de(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=>de(e.$variant).color.disabled};
1211
+ background-color: ${e=>de(e.$variant).background.disabled};
1212
+ border-color: ${e=>de(e.$variant).border.disabled};
1257
1213
 
1258
1214
  &::placeholder {
1259
- color: ${e=>ie(e.$variant).placeholder.disabled};
1215
+ color: ${e=>de(e.$variant).placeholder.disabled};
1260
1216
  }
1261
1217
  }
1262
-
1263
- &:focus-visible {
1264
- outline: 2px solid ${e=>ie(e.$variant).focus};
1265
- }
1266
- `,ht=A.newClassNameGetter("input"),wr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(da,{className:ht("container",e),$fullWidth:!!i,children:[a.jsx(ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:n}),a.jsx(sa,{...p,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),pa=s.div`
1218
+ `,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`
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
- `,ua=s.div`
1227
+ `,ga=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
- `,er=A.newClassNameGetter("modal"),Rr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?xe.createPortal(a.jsx(pa,{className:er("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(ua,{...d,ref:l,className:er("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,kr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},ha=s.div`
1238
+ `,rr=A.newClassNameGetter("modal"),Pr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.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`
1287
1239
  display: flex;
1288
1240
  flex-direction: column;
1289
1241
  gap: 4px;
1290
- `,ba=s(ue)`
1242
+ `,xa=s(ne)`
1291
1243
  margin-left: 6px;
1292
- color: ${e=>kr[e.$variant].label};
1293
- `,ga=s.button`
1244
+ color: ${e=>zr[e.$variant].label};
1245
+ `,Oa=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=>kr[e.$variant].border};
1252
+ border: 1px dashed ${e=>zr[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
- `,fa=s.span`
1263
+ `,$a=s.span`
1318
1264
  color: ${t.COLORS["iron-grey"]};
1319
1265
  font-size: 14px;
1320
- `,xa=s.div`
1266
+ `,Sa=s.div`
1321
1267
  display: flex;
1322
1268
  flex-direction: column;
1323
1269
  padding: 20px;
1324
1270
  gap: 16px;
1325
- `,Oa=s.div`
1271
+ `,ya=s.div`
1326
1272
  display: flex;
1327
1273
  align-items: center;
1328
1274
  justify-content: space-between;
1329
- `,$a=s.h3`
1275
+ `,va=s.h3`
1330
1276
  margin: 0;
1331
1277
  font-size: 18px;
1332
1278
  font-weight: 600;
1333
1279
  color: ${t.COLORS.black};
1334
- `,Sa=s.div`
1280
+ `,Ca=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
- `,ya=s.label`
1287
+ `,ma=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
- `,va=s.span`
1300
+ `,wa=s.span`
1355
1301
  font-size: 14px;
1356
1302
  color: ${t.COLORS.black};
1357
- `,ma=s.div`
1303
+ `,Ra=s.div`
1358
1304
  display: flex;
1359
1305
  align-items: center;
1360
1306
  justify-content: center;
@@ -1362,98 +1308,90 @@
1362
1308
  color: ${t.COLORS["iron-grey"]};
1363
1309
  font-size: 14px;
1364
1310
  text-align: center;
1365
- `,Q=A.newClassNameGetter("multi-select"),Ca=({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:C="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(ha,{...y,ref:g,className:Q("container",e),children:[n&&a.jsx(ba,{$variant:C,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(ga,{type:"button",$variant:C,$disabled:o,disabled:o,onClick:H,className:Q("trigger",r==null?void 0:r.trigger),children:b.length===0?a.jsx(fa,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[j.map(w=>a.jsx(Je,{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(Je,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",N]})]})}),a.jsx(Rr,{open:S,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(xa,{children:[a.jsxs(Oa,{children:[a.jsx($a,{children:c}),a.jsx(De,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:z})]}),a.jsx(wr,{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(Sa,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(ma,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(ya,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(et,{checked:O.includes(w.value),disabled:w.disabled,onChange:()=>_(w.value)}),a.jsx(va,{children:w.label})]},w.value))})]})})]})},tr={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},rr={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)}},Ne=e=>tr[e]??tr.default,he=e=>rr[e]??rr.normal,wa=s.div`
1311
+ `,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,$e=e=>ir[e]??ir.normal,La=s.div`
1366
1312
  display: inline-flex;
1367
1313
  flex-direction: column;
1368
1314
  gap: 2px;
1369
- `,Ra=s(ue)`
1315
+ `,Pa=s(ne)`
1370
1316
  margin-left: 6px;
1371
- `,ka=s.div`
1317
+ `,za=s.div`
1372
1318
  display: flex;
1373
- gap: ${e=>Ne(e.$size).gap};
1374
- `,La=s.input`
1375
- width: ${e=>Ne(e.$size).width};
1376
- height: ${e=>Ne(e.$size).height};
1377
- border-radius: ${e=>Ne(e.$size).radius};
1378
- font-size: ${e=>Ne(e.$size).fontSize};
1319
+ gap: ${e=>Ie(e.$size).gap};
1320
+ `,ja=s.input`
1321
+ width: ${e=>Ie(e.$size).width};
1322
+ height: ${e=>Ie(e.$size).height};
1323
+ border-radius: ${e=>Ie(e.$size).radius};
1324
+ font-size: ${e=>Ie(e.$size).fontSize};
1379
1325
  font-weight: 600;
1380
1326
  text-align: center;
1381
1327
  outline: none;
1382
- border: 1px solid ${e=>he(e.$variant).border.static};
1383
- background-color: ${e=>he(e.$variant).background.static};
1384
- color: ${e=>he(e.$variant).color.static};
1328
+ border: 1px solid ${e=>$e(e.$variant).border.static};
1329
+ background-color: ${e=>$e(e.$variant).background.static};
1330
+ color: ${e=>$e(e.$variant).color.static};
1385
1331
  transition:
1386
1332
  border-color 0.15s ease,
1387
1333
  box-shadow 0.15s ease;
1388
1334
 
1389
1335
  &:disabled {
1390
1336
  cursor: not-allowed;
1391
- color: ${e=>he(e.$variant).color.disabled};
1392
- background-color: ${e=>he(e.$variant).background.disabled};
1393
- border-color: ${e=>he(e.$variant).border.disabled};
1394
- }
1395
-
1396
- &:focus-visible {
1397
- outline: 2px solid ${e=>he(e.$variant).focus};
1337
+ color: ${e=>$e(e.$variant).color.disabled};
1338
+ background-color: ${e=>$e(e.$variant).background.disabled};
1339
+ border-color: ${e=>$e(e.$variant).border.disabled};
1398
1340
  }
1399
1341
 
1400
1342
  &::selection {
1401
1343
  background-color: transparent;
1402
1344
  }
1403
- `,bt=A.newClassNameGetter("otp-code"),Pa=({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 C=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&&C(_)},[h,l,c,C]),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("")),C(x-1))}else $.key==="ArrowLeft"&&x>0?($.preventDefault(),C(x-1)):$.key==="ArrowRight"&&x<l-1&&($.preventDefault(),C(x+1))},[h,l,c,C]),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);C(b)}},[l,c,C]);return a.jsxs(wa,{ref:d,className:bt("container",r),...f,children:[n&&a.jsx(Ra,{variant:g,className:bt("label",o==null?void 0:o.label),children:n}),a.jsx(ka,{$size:p,children:Array.from({length:l}).map((x,$)=>a.jsx(La,{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:bt("input",o==null?void 0:o.input)},$))})]})},or={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},Qe=e=>or[e]??or.light,za=s.div`
1345
+ `,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`
1404
1346
  display: flex;
1405
1347
  flex-direction: column;
1406
1348
  gap: 16px;
1407
1349
  padding: 12px;
1408
- border: 1px dashed ${({$variant:e})=>Qe(e).border};
1350
+ border: 1px dashed ${({$variant:e})=>et(e).border};
1409
1351
  border-radius: 16px;
1410
- background-color: ${({$variant:e})=>Qe(e).background};
1411
- `,ja=s.div`
1352
+ background-color: ${({$variant:e})=>et(e).background};
1353
+ `,Na=s.div`
1412
1354
  display: flex;
1413
1355
  flex-direction: column;
1414
1356
  gap: 4px;
1415
- `,Ea=s.div`
1357
+ `,Ia=s.div`
1416
1358
  font-size: 18px;
1417
1359
  font-weight: 600;
1418
1360
  line-height: 1.4;
1419
- color: ${({$variant:e})=>Qe(e).title};
1420
- `,Ta=s.div`
1361
+ color: ${({$variant:e})=>et(e).title};
1362
+ `,Aa=s.div`
1421
1363
  font-size: 14px;
1422
1364
  line-height: 1.5;
1423
- color: ${({$variant:e})=>Qe(e).description};
1424
- `,Na=s.div`
1365
+ color: ${({$variant:e})=>et(e).description};
1366
+ `,Da=s.div`
1425
1367
  display: flex;
1426
1368
  flex-wrap: wrap;
1427
1369
  gap: 8px;
1428
- `,Ue=A.newClassNameGetter("panel"),Ia=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(za,{...d,ref:n,className:Ue("container",r),$variant:c,children:[p&&a.jsxs(ja,{children:[l&&a.jsx(Ea,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(Ta,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(Na,{className:Ue("content",o==null?void 0:o.content),children:e})]})},Ct={compact:{height:4,radius:2},default:{height:8,radius:4}},Aa=s.div`
1370
+ `,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`
1429
1371
  width: 100%;
1430
- height: ${({$size:e})=>Ct[e].height}px;
1431
- border-radius: ${({$size:e})=>Ct[e].radius}px;
1372
+ height: ${({$size:e})=>Rt[e].height}px;
1373
+ border-radius: ${({$size:e})=>Rt[e].radius}px;
1432
1374
  background-color: ${t.COLORS.gray};
1433
1375
  overflow: hidden;
1434
- `,Da=s.div`
1376
+ `,Fa=s.div`
1435
1377
  height: 100%;
1436
1378
  width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
1437
- border-radius: ${({$size:e})=>Ct[e].radius}px;
1379
+ border-radius: ${({$size:e})=>Rt[e].radius}px;
1438
1380
  background-color: ${t.COLORS.black};
1439
1381
  transition: width 0.2s ease;
1440
- `,ir=A.newClassNameGetter("progress"),_a=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(Aa,{...l,ref:n,$size:r,className:ir("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(Da,{$size:r,$value:e,className:ir("bar",i==null?void 0:i.bar)})}),nr={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}},fe=e=>nr[e]??nr.normal,Ma=s.label`
1382
+ `,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}},ve=e=>lr[e]??lr.normal,Ya=s.label`
1441
1383
  display: inline-flex;
1442
1384
  align-items: flex-start;
1443
1385
  gap: 8px;
1444
1386
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1445
1387
  opacity: ${e=>e.$disabled?.5:1};
1446
-
1447
- &:has(input:focus-visible) > span:first-of-type {
1448
- box-shadow: 0 0 0 2px ${e=>fe(e.$variant).box.focusShadow};
1449
- }
1450
- `,Fa=s.input`
1388
+ `,Ha=s.input`
1451
1389
  position: absolute;
1452
1390
  opacity: 0;
1453
1391
  width: 0;
1454
1392
  height: 0;
1455
1393
  pointer-events: none;
1456
- `,Ba=s.span`
1394
+ `,Va=s.span`
1457
1395
  display: inline-flex;
1458
1396
  align-items: center;
1459
1397
  justify-content: center;
@@ -1462,27 +1400,27 @@
1462
1400
  height: 18px;
1463
1401
  border-radius: 50%;
1464
1402
  border: 1.5px solid
1465
- ${e=>e.$checked?fe(e.$variant).box.borderChecked:fe(e.$variant).box.border};
1466
- background-color: ${e=>e.$checked?fe(e.$variant).box.backgroundChecked:fe(e.$variant).box.background};
1403
+ ${e=>e.$checked?ve(e.$variant).box.borderChecked:ve(e.$variant).box.border};
1404
+ background-color: ${e=>e.$checked?ve(e.$variant).box.backgroundChecked:ve(e.$variant).box.background};
1467
1405
  transition:
1468
1406
  border-color 0.15s ease,
1469
1407
  background-color 0.15s ease,
1470
1408
  box-shadow 0.15s ease;
1471
- `,Ya=s.span`
1409
+ `,Ga=s.span`
1472
1410
  width: 8px;
1473
1411
  height: 8px;
1474
1412
  border-radius: 50%;
1475
- background-color: ${e=>fe(e.$variant).dot};
1413
+ background-color: ${e=>ve(e.$variant).dot};
1476
1414
  opacity: ${e=>e.$visible?1:0};
1477
1415
  transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
1478
1416
  transition:
1479
1417
  opacity 0.15s ease,
1480
1418
  transform 0.15s ease;
1481
- `,Ha=s.span`
1419
+ `,Wa=s.span`
1482
1420
  font-size: 14px;
1483
1421
  font-weight: 500;
1484
1422
  line-height: 1.5;
1485
- color: ${e=>fe(e.$variant).label};
1423
+ color: ${e=>ve(e.$variant).label};
1486
1424
  user-select: none;
1487
1425
 
1488
1426
  a {
@@ -1494,15 +1432,15 @@
1494
1432
  text-decoration: none;
1495
1433
  }
1496
1434
  }
1497
- `,je=A.newClassNameGetter("radio"),kt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(Ma,{className:je("container",r),$disabled:!!i,$variant:d,children:[a.jsx(Fa,{...p,ref:c,type:"radio",className:je("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(Ba,{className:je("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(Ya,{className:je("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(Ha,{className:je("label",o==null?void 0:o.label),$variant:d,children:n})]}),ar={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)}}},pe=e=>ar[e]??ar.normal,Ga=s.label`
1435
+ `,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)}}},be=e=>dr[e]??dr.normal,Xa=s.label`
1498
1436
  display: grid;
1499
1437
  grid-template-columns: auto 1fr;
1500
1438
  align-items: start;
1501
1439
  gap: 8px;
1502
1440
  padding: 12px;
1503
- background-color: ${e=>{const r=pe(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
1441
+ background-color: ${e=>{const r=be(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
1504
1442
  border: 1px solid
1505
- ${e=>{const r=pe(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
1443
+ ${e=>{const r=be(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
1506
1444
  border-radius: 12px;
1507
1445
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1508
1446
  transition:
@@ -1512,18 +1450,13 @@
1512
1450
  min-width: 0;
1513
1451
 
1514
1452
  &:hover:not([data-disabled='true']) {
1515
- border-color: ${e=>{const r=pe(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1516
- }
1517
-
1518
- &:has(:focus-visible) {
1519
- outline: none;
1520
- box-shadow: 0 0 0 3px ${e=>pe(e.$variant).focusRing};
1453
+ border-color: ${e=>{const r=be(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1521
1454
  }
1522
1455
 
1523
1456
  .vacano_radio_container {
1524
1457
  pointer-events: none;
1525
1458
  }
1526
- `,Va=s.input`
1459
+ `,Ua=s.input`
1527
1460
  position: absolute;
1528
1461
  width: 1px;
1529
1462
  height: 1px;
@@ -1533,44 +1466,44 @@
1533
1466
  clip: rect(0, 0, 0, 0);
1534
1467
  white-space: nowrap;
1535
1468
  border: 0;
1536
- `,Wa=s.div`
1469
+ `,qa=s.div`
1537
1470
  display: flex;
1538
1471
  flex-direction: column;
1539
1472
  gap: 2px;
1540
1473
  min-width: 0;
1541
- `,Ua=s.span`
1474
+ `,Ka=s.span`
1542
1475
  font-size: 14px;
1543
1476
  font-weight: 500;
1544
1477
  line-height: 1.4;
1545
- color: ${e=>pe(e.$variant).label.static};
1478
+ color: ${e=>be(e.$variant).label.static};
1546
1479
 
1547
1480
  label[data-disabled='true'] & {
1548
- color: ${e=>pe(e.$variant).label.disabled};
1481
+ color: ${e=>be(e.$variant).label.disabled};
1549
1482
  }
1550
- `,Xa=s.span`
1483
+ `,Za=s.span`
1551
1484
  font-size: 12px;
1552
1485
  font-weight: 400;
1553
1486
  line-height: 1.4;
1554
- color: ${e=>pe(e.$variant).description.static};
1487
+ color: ${e=>be(e.$variant).description.static};
1555
1488
 
1556
1489
  label[data-disabled='true'] & {
1557
- color: ${e=>pe(e.$variant).description.disabled};
1490
+ color: ${e=>be(e.$variant).description.disabled};
1558
1491
  }
1559
- `,Xe=A.newClassNameGetter("radio-card"),qa=({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(Ga,{className:Xe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Va,{...g,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(kt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Wa,{className:Xe("content",o==null?void 0:o.content),children:[a.jsx(Ua,{className:Xe("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Xa,{className:Xe("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),lr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Ka=s.div`
1492
+ `,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`
1560
1493
  display: flex;
1561
1494
  flex-direction: column;
1562
1495
  gap: 8px;
1563
- `,Za=s.span`
1496
+ `,el=s.span`
1564
1497
  font-size: 13px;
1565
1498
  font-weight: 500;
1566
1499
  line-height: 1.5;
1567
- color: ${e=>e.$disabled?lr.label.disabledColor:lr.label.color};
1500
+ color: ${e=>e.$disabled?cr.label.disabledColor:cr.label.color};
1568
1501
  margin-bottom: 4px;
1569
- `,Ja=s.div`
1502
+ `,tl=s.div`
1570
1503
  display: flex;
1571
1504
  flex-direction: column;
1572
1505
  gap: 12px;
1573
- `,gt=A.newClassNameGetter("radio-group"),Qa=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(Ka,{...h,ref:d,className:gt("container",e),children:[i&&a.jsx(Za,{className:gt("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Ja,{className:gt("options",r==null?void 0:r.options),children:c.map(g=>a.jsx(kt,{className:r==null?void 0:r.radio,name:n,checked:p===g.value,label:g.label,disabled:o,onChange:()=>l(g.value)},g.value))})]}),Lr=u.createContext(null),el=s.div`
1506
+ `,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`
1574
1507
  position: fixed;
1575
1508
  bottom: 24px;
1576
1509
  right: 24px;
@@ -1585,19 +1518,19 @@
1585
1518
  animation: ${t.KEYFRAMES.fadeIn} 0.2s ease-out;
1586
1519
  pointer-events: none;
1587
1520
  color: ${t.COLORS.black};
1588
- `,tl=s.span`
1521
+ `,il=s.span`
1589
1522
  font-size: 14px;
1590
1523
  font-weight: 500;
1591
1524
  white-space: nowrap;
1592
- `,rl=({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(Lr.Provider,{value:p,children:[e,o&&a.jsxs(el,{children:[a.jsx(Rt,{size:"sm"}),a.jsx(tl,{children:n})]})]})},ol=()=>{const e=u.useContext(Lr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},ft=40,Ee=4,dr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},cr={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)}},xt=e=>dr[e]??dr.default,de=e=>cr[e]??cr.normal,il=s.div`
1525
+ `,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,pe=e=>pr[e]??pr.normal,ll=s.div`
1593
1526
  position: relative;
1594
1527
  display: grid;
1595
1528
  gap: 2px;
1596
1529
  min-width: 180px;
1597
1530
  width: ${e=>e.$fullWidth?"100%":"fit-content"};
1598
- `,nl=s(ue)`
1531
+ `,dl=s(ne)`
1599
1532
  margin-left: 6px;
1600
- `,al=s.button`
1533
+ `,cl=s.button`
1601
1534
  display: flex;
1602
1535
  align-items: center;
1603
1536
  justify-content: space-between;
@@ -1608,47 +1541,43 @@
1608
1541
  font-weight: 500;
1609
1542
  text-align: left;
1610
1543
  cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1611
- height: ${e=>xt(e.$size).height};
1612
- padding: ${e=>xt(e.$size).padding};
1613
- border-radius: ${e=>xt(e.$size).radius};
1544
+ height: ${e=>Ot(e.$size).height};
1545
+ padding: ${e=>Ot(e.$size).padding};
1546
+ border-radius: ${e=>Ot(e.$size).radius};
1614
1547
 
1615
- color: ${e=>e.$hasValue?e.$disabled?de(e.$variant).color.disabled:de(e.$variant).color.static:de(e.$variant).placeholder};
1548
+ color: ${e=>e.$hasValue?e.$disabled?pe(e.$variant).color.disabled:pe(e.$variant).color.static:pe(e.$variant).placeholder};
1616
1549
  border: 1px solid
1617
- ${e=>e.$disabled?de(e.$variant).border.disabled:de(e.$variant).border.static};
1618
- background-color: ${e=>e.$disabled?de(e.$variant).background.disabled:de(e.$variant).background.static};
1619
-
1620
- &:focus-visible {
1621
- outline: 2px solid ${e=>de(e.$variant).focus};
1622
- }
1623
- `,ll=s.span`
1550
+ ${e=>e.$disabled?pe(e.$variant).border.disabled:pe(e.$variant).border.static};
1551
+ background-color: ${e=>e.$disabled?pe(e.$variant).background.disabled:pe(e.$variant).background.static};
1552
+ `,sl=s.span`
1624
1553
  flex: 1;
1625
1554
  min-width: 0;
1626
1555
  overflow: hidden;
1627
1556
  text-overflow: ellipsis;
1628
1557
  white-space: nowrap;
1629
- `,dl=s.span`
1558
+ `,pl=s.span`
1630
1559
  display: flex;
1631
1560
  align-items: center;
1632
1561
  justify-content: center;
1633
1562
  flex-shrink: 0;
1634
1563
  transition: transform 0.2s ease;
1635
1564
  transform: rotate(${e=>e.$open?"180deg":"0deg"});
1636
- `,Pr=`
1565
+ `,Er=`
1637
1566
  padding: 4px;
1638
1567
  background: ${t.COLORS.white};
1639
1568
  border: 1px solid ${t.alpha(t.COLORS.black,10)};
1640
1569
  border-radius: 16px;
1641
1570
  box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
1642
1571
  z-index: 1000;
1643
- `,cl=s.div`
1572
+ `,ul=s.div`
1644
1573
  position: absolute;
1645
1574
  left: -4px;
1646
1575
  width: calc(100% + 8px);
1647
- ${Pr}
1648
- `,sl=s.div`
1576
+ ${Er}
1577
+ `,hl=s.div`
1649
1578
  position: fixed;
1650
- ${Pr}
1651
- `,pl=s.button`
1579
+ ${Er}
1580
+ `,bl=s.button`
1652
1581
  display: flex;
1653
1582
  align-items: center;
1654
1583
  justify-content: space-between;
@@ -1669,18 +1598,13 @@
1669
1598
  &:hover:not(:disabled) {
1670
1599
  background: ${t.alpha(t.COLORS.black,8)};
1671
1600
  }
1672
-
1673
- &:focus-visible {
1674
- outline: none;
1675
- background: ${t.alpha(t.COLORS.black,8)};
1676
- }
1677
- `,ul=s.span`
1601
+ `,gl=s.span`
1678
1602
  display: flex;
1679
1603
  align-items: center;
1680
1604
  justify-content: center;
1681
1605
  flex-shrink: 0;
1682
1606
  color: ${t.COLORS.black};
1683
- `,ve=A.newClassNameGetter("select"),hl=({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",...C})=>{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(m=>m.value===f),N=Math.max(0,c.findIndex(m=>m.value===f)),H=-(N*ft+Ee),z=()=>{if(!b.current||!p)return;const m=b.current.getBoundingClientRect(),I=N*ft+Ee;let k=m.top-I;const T=c.length*ft+Ee*2,F=8,B=window.innerHeight-T-8;k<F&&(k=F),k>B&&(k=B),x({top:k,left:m.left-Ee,width:m.width+Ee*2})},_=m=>{var I;l==null||l(m),S(!1),(I=b.current)==null||I.focus()},E=m=>{o||(m.key==="Enter"||m.key===" "?(m.preventDefault(),S(I=>!I)):m.key==="Escape"&&y?(m.preventDefault(),S(!1)):m.key==="ArrowDown"&&!y&&(m.preventDefault(),S(!0)))};u.useLayoutEffect(()=>{y&&p&&z()},[y,p,N,c.length]),u.useEffect(()=>{if(!y)return;const m=T=>{const F=T.target,B=$.current&&!$.current.contains(F),G=L.current&&!L.current.contains(F);p?B&&G&&S(!1):B&&S(!1)},I=()=>{p&&z()},k=()=>{p&&z()};return document.addEventListener("mousedown",m),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",m),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[y,p]);const w=()=>c.map(m=>a.jsxs(pl,{type:"button",role:"option",$selected:m.value===f,$disabled:m.disabled??!1,disabled:m.disabled,"aria-selected":m.value===f,onClick:()=>_(m.value),className:ve("option",r==null?void 0:r.option),children:[a.jsx("span",{children:m.label}),m.value===f&&a.jsx(ul,{children:a.jsx(a.Check,{size:16})})]},m.value)),M=p?xe.createPortal(a.jsx(sl,{ref:L,role:"listbox",style:{top:v.top,left:v.left,width:v.width},className:ve("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(cl,{ref:L,role:"listbox",style:{top:H},className:ve("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(il,{...C,ref:m=>{$.current=m,typeof h=="function"?h(m):h&&(h.current=m)},$fullWidth:i,className:ve("container",e),children:[n&&a.jsx(nl,{className:ve("label",r==null?void 0:r.label),children:n}),a.jsxs(al,{ref:b,type:"button",$size:g,$variant:O,$disabled:o,$hasValue:!!j,disabled:o,onClick:()=>!o&&S(m=>!m),onKeyDown:E,"aria-haspopup":"listbox","aria-expanded":y,className:ve("trigger",r==null?void 0:r.trigger),children:[a.jsx(ll,{children:(j==null?void 0:j.label)??d}),a.jsx(dl,{$open:y,children:a.jsx(a.ChevronDown,{size:16})})]}),y&&M]})},sr={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},bl=e=>sr[e]??sr.neutral,gl=s.div`
1607
+ `,Se=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:Se("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?ge.createPortal(a.jsx(hl,{ref:L,role:"listbox",style:{top:v.top,left:v.left,width:v.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(ul,{ref:L,role:"listbox",style:{top:H},className:Se("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:Se("container",e),children:[n&&a.jsx(dl,{className:Se("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:Se("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`
1684
1608
  display: flex;
1685
1609
  flex-direction: column;
1686
1610
  gap: 4px;
@@ -1689,16 +1613,16 @@
1689
1613
  border-radius: 16px;
1690
1614
  border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
1691
1615
  box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
1692
- `,fl=s.div`
1616
+ `,$l=s.div`
1693
1617
  display: flex;
1694
1618
  align-items: center;
1695
1619
  justify-content: space-between;
1696
1620
  gap: 8px;
1697
- `,xl=s.p`
1621
+ `,Sl=s.p`
1698
1622
  margin: 0;
1699
1623
  font-size: 13px;
1700
1624
  color: ${t.COLORS["iron-grey"]};
1701
- `,Ol=s.div`
1625
+ `,yl=s.div`
1702
1626
  display: flex;
1703
1627
  align-items: center;
1704
1628
  justify-content: center;
@@ -1712,21 +1636,21 @@
1712
1636
  width: 18px;
1713
1637
  height: 18px;
1714
1638
  }
1715
- `,$l=s.h3`
1639
+ `,vl=s.h3`
1716
1640
  margin: 0;
1717
1641
  font-size: 28px;
1718
1642
  font-weight: 600;
1719
1643
  line-height: 1.2;
1720
1644
  color: ${t.COLORS.black};
1721
- `,Sl=s.p`
1645
+ `,Cl=s.p`
1722
1646
  margin: 0;
1723
1647
  font-size: 12px;
1724
- color: ${({$variant:e})=>bl(e)};
1725
- `,qe=A.newClassNameGetter("status-card"),yl=({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(gl,{...g,ref:l,className:qe("container",r),$border:e,$shadow:c,children:[a.jsxs(fl,{children:[a.jsx(xl,{className:qe("label",o==null?void 0:o.label),children:n}),i&&a.jsx(Ol,{children:i})]}),a.jsx($l,{className:qe("value",o==null?void 0:o.value),children:h}),d&&a.jsx(Sl,{className:qe("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),vl=s.div`
1648
+ color: ${({$variant:e})=>xl(e)};
1649
+ `,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`
1726
1650
  display: flex;
1727
1651
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1728
1652
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
1729
- `,ml=s.div`
1653
+ `,Rl=s.div`
1730
1654
  display: flex;
1731
1655
  align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
1732
1656
  flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
@@ -1735,7 +1659,7 @@
1735
1659
  &:last-child {
1736
1660
  flex: 0;
1737
1661
  }
1738
- `,Cl=s.button`
1662
+ `,kl=s.button`
1739
1663
  display: flex;
1740
1664
  align-items: center;
1741
1665
  gap: 10px;
@@ -1744,16 +1668,7 @@
1744
1668
  background: transparent;
1745
1669
  cursor: ${e=>e.$clickable?"pointer":"default"};
1746
1670
  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
- `,wl=s.div`
1671
+ `,Ll=s.div`
1757
1672
  display: flex;
1758
1673
  align-items: center;
1759
1674
  justify-content: center;
@@ -1777,13 +1692,13 @@
1777
1692
  border: 2px solid ${t.COLORS.gray};
1778
1693
  color: ${t.COLORS["iron-grey"]};
1779
1694
  `}
1780
- `,Rl=s.span`
1695
+ `,Pl=s.span`
1781
1696
  font-size: 14px;
1782
1697
  font-weight: 500;
1783
1698
  white-space: nowrap;
1784
1699
  color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
1785
1700
  transition: color 0.2s ease;
1786
- `,kl=s.div`
1701
+ `,zl=s.div`
1787
1702
  background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
1788
1703
  transition: background-color 0.2s ease;
1789
1704
 
@@ -1797,22 +1712,22 @@
1797
1712
  min-width: 16px;
1798
1713
  margin: 0 12px;
1799
1714
  `}
1800
- `,Te=A.newClassNameGetter("stepper"),Ll=({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(vl,{...d,ref:n,$orientation:i,className:Te("container",e),children:l.map((h,g)=>{const f=h.value===c,O=g<p,C=g===l.length-1;return a.jsxs(ml,{$orientation:i,children:[a.jsxs(Cl,{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(wl,{$active:f,$completed:O,className:Te("circle",r==null?void 0:r.circle),children:g+1}),a.jsx(Rl,{$active:f,$completed:O,className:Te("label",r==null?void 0:r.label),children:h.label})]}),!C&&a.jsx(kl,{$completed:O,$orientation:i,className:Te("line",r==null?void 0:r.line)})]},h.value)})})},wt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},Pl=s.div`
1715
+ `,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`
1801
1716
  position: relative;
1802
1717
  display: flex;
1803
1718
  flex-direction: column;
1804
1719
  gap: 4px;
1805
- `,zl=s(ue)`
1720
+ `,Tl=s(ne)`
1806
1721
  margin-left: 6px;
1807
- color: ${e=>wt[e.$variant].label};
1808
- `,jl=s.div`
1722
+ color: ${e=>kt[e.$variant].label};
1723
+ `,Nl=s.div`
1809
1724
  display: flex;
1810
1725
  flex-wrap: wrap;
1811
1726
  align-items: center;
1812
1727
  gap: 6px;
1813
1728
  min-height: 44px;
1814
1729
  padding: 8px 12px;
1815
- border: 1px dashed ${e=>wt[e.$variant].border};
1730
+ border: 1px dashed ${e=>kt[e.$variant].border};
1816
1731
  border-radius: 8px;
1817
1732
  background: ${t.COLORS.white};
1818
1733
  cursor: ${e=>e.$disabled?"not-allowed":"text"};
@@ -1820,14 +1735,14 @@
1820
1735
  transition: border-color 0.15s ease;
1821
1736
 
1822
1737
  &:hover {
1823
- border-color: ${e=>e.$disabled?wt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1738
+ border-color: ${e=>e.$disabled?kt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1824
1739
  }
1825
1740
 
1826
1741
  ${e=>e.$focused&&`
1827
1742
  outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1828
1743
  outline-offset: 2px;
1829
1744
  `}
1830
- `,El=s.input`
1745
+ `,Il=s.input`
1831
1746
  flex: 1;
1832
1747
  min-width: 80px;
1833
1748
  border: none;
@@ -1844,7 +1759,7 @@
1844
1759
  &:disabled {
1845
1760
  cursor: not-allowed;
1846
1761
  }
1847
- `,zr=`
1762
+ `,Tr=`
1848
1763
  z-index: 100;
1849
1764
  background-color: ${t.COLORS.white};
1850
1765
  border: 1px solid ${t.alpha(t.COLORS.black,15)};
@@ -1852,28 +1767,28 @@
1852
1767
  box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
1853
1768
  max-height: 200px;
1854
1769
  overflow-y: auto;
1855
- `,jr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Er=`
1770
+ `,Nr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ir=`
1856
1771
  opacity 0.15s ease,
1857
1772
  transform 0.15s ease,
1858
1773
  visibility 0.15s;
1859
- `,Tl=s.div`
1774
+ `,Al=s.div`
1860
1775
  position: absolute;
1861
1776
  left: 0;
1862
1777
  right: 0;
1863
1778
  ${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
1864
- ${zr}
1779
+ ${Tr}
1865
1780
  opacity: ${e=>e.$open?1:0};
1866
1781
  visibility: ${e=>e.$open?"visible":"hidden"};
1867
- transform: ${e=>jr(e.$open,e.$position)};
1868
- transition: ${Er};
1869
- `,Nl=s.div`
1782
+ transform: ${e=>Nr(e.$open,e.$position)};
1783
+ transition: ${Ir};
1784
+ `,Dl=s.div`
1870
1785
  position: fixed;
1871
- ${zr}
1786
+ ${Tr}
1872
1787
  opacity: ${e=>e.$open?1:0};
1873
1788
  visibility: ${e=>e.$open?"visible":"hidden"};
1874
- transform: ${e=>jr(e.$open,e.$position)};
1875
- transition: ${Er};
1876
- `,pr=s.button`
1789
+ transform: ${e=>Nr(e.$open,e.$position)};
1790
+ transition: ${Ir};
1791
+ `,hr=s.button`
1877
1792
  display: flex;
1878
1793
  align-items: center;
1879
1794
  width: 100%;
@@ -1901,7 +1816,7 @@
1901
1816
  &:only-child {
1902
1817
  border-radius: 7px;
1903
1818
  }
1904
- `,ur=s.div`
1819
+ `,br=s.div`
1905
1820
  display: flex;
1906
1821
  align-items: center;
1907
1822
  justify-content: center;
@@ -1909,11 +1824,11 @@
1909
1824
  color: ${t.COLORS["iron-grey"]};
1910
1825
  font-size: 14px;
1911
1826
  text-align: center;
1912
- `,ee=A.newClassNameGetter("tags"),Ke=4,Il=({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:C="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(X=>!O.includes(X.value));if(!b.trim())return P;const D=b.toLowerCase().trim();return P.filter(X=>X.label.toLowerCase().includes(D))},[p,O,b]),M=j&&p.length>0,m=u.useCallback(()=>{var _e;if(!v.current)return;const P=v.current.getBoundingClientRect(),D=((_e=x.current)==null?void 0:_e.offsetHeight)??200,X=window.innerHeight-P.bottom-Ke,q=P.top-Ke,Oe=X<D&&q>X?"top":"bottom";if(z(Oe),g){const rt=Oe==="bottom"?P.bottom+Ke:P.top-D-Ke;E({top:rt,left:P.left,width:P.width})}},[g]);u.useEffect(()=>{if(j)return m(),window.addEventListener("scroll",m,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",m,!0),window.removeEventListener("resize",m)}},[j,m]);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(X=>X.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()},G=P=>{const D=p.find(X=>X.value===P);return(D==null?void 0:D.label)??P};return a.jsxs(Pl,{...y,ref:f,className:ee("container",e),children:[c&&a.jsx(zl,{$variant:C,className:ee("label"),children:c}),a.jsxs("div",{ref:S,style:{position:"relative"},children:[a.jsxs(jl,{ref:v,$variant:C,$disabled:i,$focused:j,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(P=>a.jsx(Je,{deletable:!i,onDelete:()=>F(P),className:ee("chip",r==null?void 0:r.chip),children:G(P)},P)),a.jsx(El,{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?xe.createPortal(a.jsx(Nl,{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(ur,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(pr,{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(Tl,{ref:x,$open:M,$position:H,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(ur,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(pr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}))]})]})},Al=s.div`
1827
+ `,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,fe=U<D&&q>U?"top":"bottom";if(z(fe),g){const ot=fe==="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?ge.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`
1913
1828
  display: flex;
1914
1829
  align-items: center;
1915
1830
  gap: 6px;
1916
- `,Dl=s.button`
1831
+ `,Fl=s.button`
1917
1832
  padding: 6px 16px;
1918
1833
  border: none;
1919
1834
  border-radius: 12px;
@@ -1931,12 +1846,44 @@
1931
1846
  &:hover:not(:disabled) {
1932
1847
  background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
1933
1848
  }
1849
+ `,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)}},ce=e=>fr[e]??fr.normal,Yl=s.div`
1850
+ display: grid;
1851
+ flex-direction: column;
1852
+ gap: 2px;
1853
+ width: ${e=>e.$fullWidth?"100%":"fit-content"};
1854
+ `,Hl=s(ne)`
1855
+ margin-left: 6px;
1856
+ `,Vl=s.textarea`
1857
+ flex: 1;
1858
+ min-width: 0;
1859
+ outline: none;
1860
+ font-size: 14px;
1861
+ font-weight: 500;
1862
+ font-family: inherit;
1863
+ padding: 10px 14px;
1864
+ border-radius: 16px;
1865
+ resize: vertical;
1866
+
1867
+ color: ${e=>ce(e.$variant).color.static};
1868
+ border: 1px solid ${e=>ce(e.$variant).border.static};
1869
+ background-color: ${e=>ce(e.$variant).background.static};
1870
+
1871
+ &::placeholder {
1872
+ color: ${e=>ce(e.$variant).placeholder.static};
1873
+ }
1934
1874
 
1935
- &:focus-visible {
1936
- outline: 2px solid ${t.COLORS["steel-blue"]};
1937
- outline-offset: 2px;
1875
+ &:disabled {
1876
+ cursor: not-allowed;
1877
+ resize: none;
1878
+ color: ${e=>ce(e.$variant).color.disabled};
1879
+ background-color: ${e=>ce(e.$variant).background.disabled};
1880
+ border-color: ${e=>ce(e.$variant).border.disabled};
1881
+
1882
+ &::placeholder {
1883
+ color: ${e=>ce(e.$variant).placeholder.disabled};
1884
+ }
1938
1885
  }
1939
- `,hr=A.newClassNameGetter("tabs"),_l=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(Al,{...c,ref:i,className:hr("container",e),role:"tablist",children:n.map(d=>a.jsx(Dl,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:hr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),Tr=u.createContext(null),Ot=3,br={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}},Ml=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<Ot?{...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<Ot?{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>=Ot?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},Fl={toasts:[],queue:[]},$t=e=>br[e]??br.default,Bl=ne.keyframes`
1886
+ `,$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=oe.keyframes`
1940
1887
  from {
1941
1888
  transform: translateY(100%);
1942
1889
  opacity: 0;
@@ -1945,7 +1892,7 @@
1945
1892
  transform: translateY(0);
1946
1893
  opacity: 1;
1947
1894
  }
1948
- `,Yl=ne.keyframes`
1895
+ `,ql=oe.keyframes`
1949
1896
  from {
1950
1897
  transform: translateY(0);
1951
1898
  opacity: 1;
@@ -1954,7 +1901,7 @@
1954
1901
  transform: translateY(100%);
1955
1902
  opacity: 0;
1956
1903
  }
1957
- `,Hl=s.div`
1904
+ `,Kl=s.div`
1958
1905
  position: fixed;
1959
1906
  bottom: 24px;
1960
1907
  left: 24px;
@@ -1965,29 +1912,29 @@
1965
1912
  pointer-events: none;
1966
1913
  width: auto;
1967
1914
  max-width: 90vw;
1968
- `,Gl=s.div`
1915
+ `,Zl=s.div`
1969
1916
  display: flex;
1970
1917
  align-items: center;
1971
1918
  justify-content: space-between;
1972
1919
  gap: 12px;
1973
1920
  min-height: 32px;
1974
1921
  padding: 8px 8px 8px 16px;
1975
- background-color: ${({$variant:e})=>$t(e).background};
1976
- color: ${({$variant:e})=>$t(e).text};
1977
- border: 1px solid ${({$variant:e})=>$t(e).border};
1922
+ background-color: ${({$variant:e})=>yt(e).background};
1923
+ color: ${({$variant:e})=>yt(e).text};
1924
+ border: 1px solid ${({$variant:e})=>yt(e).border};
1978
1925
  border-radius: 96px;
1979
1926
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1980
- animation: ${({$isExiting:e})=>e?Yl:Bl} 0.3s ease-out;
1927
+ animation: ${({$isExiting:e})=>e?ql:Ul} 0.3s ease-out;
1981
1928
  pointer-events: auto;
1982
1929
  max-width: 500px;
1983
- `,Vl=s.span`
1930
+ `,Jl=s.span`
1984
1931
  font-size: 14px;
1985
1932
  font-weight: 500;
1986
1933
  line-height: 1.4;
1987
1934
  white-space: nowrap;
1988
1935
  overflow: hidden;
1989
1936
  text-overflow: ellipsis;
1990
- `,Wl=s.button`
1937
+ `,Ql=s.button`
1991
1938
  display: flex;
1992
1939
  align-items: center;
1993
1940
  justify-content: center;
@@ -2005,13 +1952,13 @@
2005
1952
  &:hover {
2006
1953
  opacity: 1;
2007
1954
  }
2008
- `,Ul=s.div`
1955
+ `,ed=s.div`
2009
1956
  display: flex;
2010
1957
  align-items: center;
2011
1958
  justify-content: space-between;
2012
1959
  gap: 12px;
2013
1960
  width: 100%;
2014
- `,Xl=s.div`
1961
+ `,td=s.div`
2015
1962
  display: flex;
2016
1963
  align-items: center;
2017
1964
  justify-content: center;
@@ -2026,7 +1973,7 @@
2026
1973
  font-weight: 500;
2027
1974
  white-space: nowrap;
2028
1975
  margin-left: auto;
2029
- `,gr=({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(Gl,{$variant:e.variant,$isExiting:o,children:[a.jsx(Vl,{children:e.message}),a.jsx(Wl,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},ql=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(Hl,{children:e.map((n,l)=>l===i&&r>0?a.jsxs(Ul,{children:[a.jsx(gr,{toast:n,onRemove:o}),a.jsxs(Xl,{children:["+",r]})]},n.id):a.jsx(gr,{toast:n,onRemove:o},n.id))})},Kl=({children:e})=>{const[r,o]=u.useReducer(Ml,Fl),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(Tr.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(ql,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},Zl=()=>{const e=u.useContext(Tr);if(!e)throw new Error("useToast must be used within ToastProvider");return e},fr={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}},Ae=e=>fr[e]??fr.dark,Jl=(e,r)=>{const o=Ae(r).background;switch(e){case"top":return`
1976
+ `,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`
2030
1977
  bottom: -12px;
2031
1978
  left: 50%;
2032
1979
  margin-left: -6px;
@@ -2046,7 +1993,7 @@
2046
1993
  top: 50%;
2047
1994
  margin-top: -6px;
2048
1995
  border-right-color: ${o};
2049
- `;default:return""}},Ql=(e,r)=>{if(r!=="light")return"";const o=Ae(r).border;switch(e){case"top":return`
1996
+ `;default:return""}},ad=(e,r)=>{if(r!=="light")return"";const o=De(r).border;switch(e){case"top":return`
2050
1997
  &::after {
2051
1998
  bottom: -14px;
2052
1999
  left: 50%;
@@ -2074,11 +2021,11 @@
2074
2021
  margin-top: -7px;
2075
2022
  border-right-color: ${o};
2076
2023
  }
2077
- `;default:return""}},Nr=e=>`
2024
+ `;default:return""}},Dr=e=>`
2078
2025
  z-index: 1000;
2079
2026
  padding: 6px 12px;
2080
- background-color: ${Ae(e.$variant).background};
2081
- color: ${Ae(e.$variant).text};
2027
+ background-color: ${De(e.$variant).background};
2028
+ color: ${De(e.$variant).text};
2082
2029
  font-size: 13px;
2083
2030
  line-height: 1.4;
2084
2031
  border-radius: 6px;
@@ -2092,7 +2039,7 @@
2092
2039
  transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
2093
2040
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
2094
2041
 
2095
- ${e.$variant==="light"?`border: 1px solid ${Ae(e.$variant).border};`:""}
2042
+ ${e.$variant==="light"?`border: 1px solid ${De(e.$variant).border};`:""}
2096
2043
 
2097
2044
  &::before {
2098
2045
  content: '';
@@ -2100,7 +2047,7 @@
2100
2047
  width: 0;
2101
2048
  height: 0;
2102
2049
  border: 6px solid transparent;
2103
- ${Jl(e.$placement,e.$variant)}
2050
+ ${nd(e.$placement,e.$variant)}
2104
2051
  }
2105
2052
 
2106
2053
  ${e.$variant==="light"?`
@@ -2113,11 +2060,11 @@
2113
2060
  }
2114
2061
  `:""}
2115
2062
 
2116
- ${Ql(e.$placement,e.$variant)}
2117
- `,ed=s.div`
2063
+ ${ad(e.$placement,e.$variant)}
2064
+ `,ld=s.div`
2118
2065
  position: relative;
2119
2066
  display: inline-block;
2120
- `,td=e=>{switch(e){case"top":return`
2067
+ `,dd=e=>{switch(e){case"top":return`
2121
2068
  bottom: calc(100% + 8px);
2122
2069
  left: 50%;
2123
2070
  transform: translateX(-50%);
@@ -2133,12 +2080,12 @@
2133
2080
  left: calc(100% + 8px);
2134
2081
  top: 50%;
2135
2082
  transform: translateY(-50%);
2136
- `;default:return""}},rd=s.div`
2083
+ `;default:return""}},cd=s.div`
2137
2084
  position: absolute;
2138
- ${e=>Nr(e)}
2139
- ${({$placement:e})=>td(e)}
2140
- `,od=s.div`
2085
+ ${e=>Dr(e)}
2086
+ ${({$placement:e})=>dd(e)}
2087
+ `,sd=s.div`
2141
2088
  position: fixed;
2142
- ${e=>Nr(e)}
2143
- `,St=A.newClassNameGetter("tooltip"),ce=8,id=({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,C]=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-ce,M=window.innerHeight-z.bottom-ce,m=z.left-ce,I=window.innerWidth-z.right-ce;let k=l;if(l==="top"&&w<E&&M>w?k="bottom":l==="bottom"&&M<E&&w>M?k="top":l==="left"&&m<_&&I>m?k="right":l==="right"&&I<_&&m>I&&(k="left"),S(k),c){let B,G;switch(k){case"top":B=z.top-E-ce,G=z.left+z.width/2-_/2;break;case"bottom":B=z.bottom+ce,G=z.left+z.width/2-_/2;break;case"left":B=z.top+z.height/2-E/2,G=z.left-_-ce;break;case"right":B=z.top+z.height/2-E/2,G=z.right+ce;break;default:B=0,G=0}const P=8;G=Math.max(P,Math.min(G,window.innerWidth-_-P)),B=Math.max(P,Math.min(B,window.innerHeight-E-P)),x({top:B,left:G})}},[l,c]);u.useLayoutEffect(()=>{g&&L()},[g,L]);const j=()=>{const z=setTimeout(()=>{f(!0)},n);C(z)},N=()=>{O&&(clearTimeout(O),C(null)),f(!1)},H=c?xe.createPortal(a.jsx(od,{ref:b,className:St("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(rd,{ref:b,className:St("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,children:i});return a.jsxs(ed,{...h,ref:z=>{$.current=z,typeof d=="function"?d(z):d&&(d.current=z)},className:St("wrapper",r),onMouseEnter:j,onMouseLeave:N,children:[e,H]})};exports.Autocomplete=wo;exports.Button=De;exports.Card=Ao;exports.Checkbox=et;exports.CheckboxCard=Uo;exports.CheckboxGroup=Zo;exports.Chip=Je;exports.Confirmation=di;exports.Container=pi;exports.DatePicker=_i;exports.Drawer=Hi;exports.Dropdown=qi;exports.FieldLabel=ue;exports.FieldMessage=Qi;exports.GlobalStyle=to;exports.ImageCropper=la;exports.Input=wr;exports.KeySymbol=xr;exports.KeysBindings=Or;exports.Modal=Rr;exports.MultiSelect=Ca;exports.OtpCode=Pa;exports.Panel=Ia;exports.Progress=_a;exports.Radio=kt;exports.RadioCard=qa;exports.RadioGroup=Qa;exports.SaveProgressProvider=rl;exports.Select=hl;exports.Spinner=Rt;exports.StatusCard=yl;exports.Stepper=Ll;exports.Tabs=_l;exports.Tags=Il;exports.ToastProvider=Kl;exports.Tooltip=id;exports.formatDateGo=$r;exports.useImageCropper=Cr;exports.useSaveProgress=ol;exports.useToast=Zl;
2089
+ ${e=>Dr(e)}
2090
+ `,vt=A.newClassNameGetter("tooltip"),se=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-se,M=window.innerHeight-z.bottom-se,C=z.left-se,I=window.innerWidth-z.right-se;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-se,V=z.left+z.width/2-_/2;break;case"bottom":B=z.bottom+se,V=z.left+z.width/2-_/2;break;case"left":B=z.top+z.height/2-E/2,V=z.left-_-se;break;case"right":B=z.top+z.height/2-E/2,V=z.right+se;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?ge.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=ne;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;
2144
2091
  //# sourceMappingURL=index.cjs.map