aha-components 1.8.4 → 1.8.5
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/Avatar.esm.js +1 -1
- package/dist/Avatar.esm.js.map +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/Avatar.js.map +1 -1
- package/dist/Badge.esm.js +1 -1
- package/dist/Badge.esm.js.map +1 -1
- package/dist/Badge.js +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Button.esm.js +1 -1
- package/dist/Button.esm.js.map +1 -1
- package/dist/Button.js +1 -1
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.esm.js +1 -1
- package/dist/Checkbox.esm.js.map +1 -1
- package/dist/Checkbox.js +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/Input.esm.js +1 -1
- package/dist/Input.esm.js.map +1 -1
- package/dist/Input.js +1 -1
- package/dist/Input.js.map +1 -1
- package/dist/Loading.esm.js +1 -1
- package/dist/Loading.esm.js.map +1 -1
- package/dist/Loading.js +1 -1
- package/dist/Loading.js.map +1 -1
- package/dist/Pagination.esm.js +1 -1
- package/dist/Pagination.esm.js.map +1 -1
- package/dist/Pagination.js +1 -1
- package/dist/Pagination.js.map +1 -1
- package/dist/Popover.esm.js +1 -1
- package/dist/Popover.esm.js.map +1 -1
- package/dist/Popover.js +1 -1
- package/dist/Popover.js.map +1 -1
- package/dist/Radio.esm.js +1 -1
- package/dist/Radio.esm.js.map +1 -1
- package/dist/Radio.js +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/Table.esm.js +1 -1
- package/dist/Table.esm.js.map +1 -1
- package/dist/Table.js +1 -1
- package/dist/Table.js.map +1 -1
- package/dist/Textarea.esm.js +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/components/Badge/index.d.ts +2 -1
- package/dist/components/shared/badgeColors.d.ts +25 -0
- package/dist/components/shared/buttonStyles.d.ts +18 -0
- package/dist/components/shared/colorUtils.d.ts +6 -0
- package/dist/components/shared/controlStyles.d.ts +27 -0
- package/dist/components/shared/fieldStyles.d.ts +37 -0
- package/dist/index.css +1924 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.esm.css +1924 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/tokens.d.ts +14 -14
- package/package.json +1 -1
package/dist/Table.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react"),n=require("react-dom"),t=function(){return t=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var r in o=arguments[n])Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);return e},t.apply(this,arguments)};function r(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(t=Object.getOwnPropertySymbols(e);r<t.length;r++)o.indexOf(t[r])<0&&Object.prototype.propertyIsEnumerable.call(e,t[r])&&(n[t[r]]=e[t[r]])}return n}function i(e,o,n){if(n||2===arguments.length)for(var t,r=0,i=o.length;r<i;r++)!t&&r in o||(t||(t=Array.prototype.slice.call(o,0,r)),t[r]=o[r]);return e.concat(t||Array.prototype.slice.call(o))}"function"==typeof SuppressedError&&SuppressedError;var a={primaryColor:"#FB6011"},l=o.createContext(a),d=function(){var e=o.useContext(l);return e||a},s={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},c={default:"default",primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link"},u={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},p=function(o){var n=o.size,t=o.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:t,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},f=function(n){var i=n.children,a=n.type,l=void 0===a?"default":a,f=n.size,x=void 0===f?"md":f,h=n.disabled,v=void 0!==h&&h,g=n.loading,m=void 0!==g&&g,y=n.iconOnly,b=n.focused,w=void 0!==b&&b,k=n.onClick,j=n.htmlType,S=void 0===j?"button":j,C=n.className,z=void 0===C?"":C,F=n.style,W=n.icon,L=n.iconPosition,A=void 0===L?"left":L,E=r(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),I=d().primaryColor,B=o.useState(!1),M=B[0],R=B[1],N=o.useState(!1),D=N[0],H=N[1],T=c[l]||"default",O=u[s[x]||"md"],P=null!=y?y:!!W&&null==i,_="link-color"===T||"link-gray"===T||"destructive-link"===T,K=v||m,q=w,X=I,Y=function(){if(v)return"default"===T||"primary"===T||"secondary"===T||"destructive-primary"===T||"destructive-secondary"===T?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=M||D;return"default"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-brand-secondary, #ec470a)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-brand-secondary_alt, #fb6011)":"var(--color-fg-quaternary, #a9a29d)",border:e?"1px solid var(--color-border-brand, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",boxShadow:"none"}:"primary"===T?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":X||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===T?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===T?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===T?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===T?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===T?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===T?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),V=function(){if(q)return"destructive-primary"===T||"destructive-secondary"===T||"destructive-tertiary"===T||"destructive-link"===T?"destructive-primary"===T||"destructive-secondary"===T?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===T||"secondary"===T?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),J=t({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:O.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:O.fontSize,lineHeight:"".concat(O.lineHeight,"px"),cursor:K?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:Y.bg,color:Y.color,border:Y.border,boxShadow:null!=V?V:Y.boxShadow,textDecoration:Y.textDecoration},F);_?(J.borderRadius="4px",J.overflow="hidden",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX)):(J.borderRadius="var(--radius-md, 8px)",P?(J.width=O.height,J.height=O.height,J.padding=0):(J.height=O.height,J.paddingLeft=O.paddingX,J.paddingRight=O.paddingX));var Q=function(){return m?e.jsx(p,{size:O.iconSize,color:Y.iconColor}):W?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:O.iconSize,height:O.iconSize,color:Y.iconColor,flexShrink:0},children:W}):null},G=m||W&&"left"===A,U=!m&&W&&"right"===A;return e.jsxs("button",t({type:S,className:["aha-button","aha-button--".concat(T),"aha-button--".concat(s[x]||"md"),P&&"aha-button--icon-only",K&&"aha-button--disabled",m&&"aha-button--loading",q&&"aha-button--focused",z].filter(Boolean).join(" "),disabled:K,onClick:function(e){K?e.preventDefault():null==k||k(e)},onMouseEnter:function(){return!K&&R(!0)},onMouseLeave:function(){R(!1),H(!1)},onMouseDown:function(){return!K&&H(!0)},onMouseUp:function(){return H(!1)},style:J},E,{children:[G&&Q(),!P&&i,U&&Q(),P&&!W&&!m&&i]}))};f.displayName="Button";var x="var(--shadow-xs)",h={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}};o.forwardRef(function(n,i){var a=n.size,l=void 0===a?"mediumSmall":a,d=n.error,s=void 0!==d&&d,c=n.disabled,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,v=n.prefix,g=n.suffix,m=n.leadingText,y=n.trailingText,b=n.leadingAddon,w=n.trailingAddon,k=n.className,j=void 0===k?"":k,S=n.style,C=n.onFocus,z=n.onBlur,F=n.onKeyDown,W=n.onPressEnter,L=n.value,A=n.defaultValue,E=n.onChange,I=n.placeholder,B=n.type,M=void 0===B?"text":B,R=n.label,N=n.required,D=n.hintText,H=r(n,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),T=o.useRef(null),O=o.useState(!1),P=O[0],_=O[1],K=o.useState(null!=A?A:""),q=K[0],X=K[1];o.useEffect(function(){"function"==typeof i?i(T.current):i&&(i.current=T.current)},[i]);var Y=void 0!==L,V=Y?L:q,J=u?{border:"1px solid var(--color-border-disabled)",boxShadow:x,outline:"none"}:s&&P?{border:"1px solid var(--color-border-error)",boxShadow:x,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:s?{border:"1px solid var(--color-border-error_subtle)",boxShadow:x,outline:"none"}:P?{border:"1px solid var(--color-border-brand)",boxShadow:x,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:x,outline:"none"},Q=J.border,G=J.boxShadow,U=J.outline,Z=J.outlineOffset,$=h[l],ee=$.pt,oe=$.pb,ne=u?"var(--color-border-disabled)":"var(--color-border-primary)",te=!!v,re=!!g,ie={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1,pointerEvents:"none"},ae={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:oe,paddingLeft:"14px",paddingRight:"12px",color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",whiteSpace:"nowrap",flexShrink:0,backgroundColor:u?"var(--color-bg-disabled_subtle)":"transparent"},le=e.jsxs("div",{className:"aha-input-group ".concat(j),style:t({display:"flex",alignItems:"stretch",width:"100%",border:Q,boxShadow:G,outline:U,outlineOffset:Z,borderRadius:"var(--radius-md)",backgroundColor:u||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},S),children:[void 0!==m&&e.jsx("div",{style:t(t({},ae),{borderRight:"1px solid ".concat(ne)}),children:m}),void 0!==b&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(ne)},children:b}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[te&&e.jsx("span",{style:t(t({},ie),{left:"14px"}),children:v}),e.jsx("input",t({ref:T,type:M,value:V,placeholder:I,disabled:u,readOnly:f,onChange:function(e){Y||X(e.target.value),null==E||E(e)},onFocus:function(e){_(!0),null==C||C(e)},onBlur:function(e){_(!1),null==z||z(e)},onKeyDown:function(e){"Enter"===e.key&&W&&W(e),null==F||F(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",backgroundColor:"transparent",color:u?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:ee,paddingBottom:oe,paddingLeft:te?"40px":"14px",paddingRight:re?"40px":"14px"},autoComplete:H.autoComplete||"off"},H)),re&&e.jsx("span",{style:t(t({},ie),{right:"14px"}),children:g})]}),void 0!==y&&e.jsx("div",{style:t(t({},ae),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(ne)}),children:y}),void 0!==w&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(ne)},children:w})]});if(!R&&!D)return le;var de={margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:s?"var(--color-error-600)":"var(--color-text-tertiary)"};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[R&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[R,N&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),le,D&&e.jsx("p",{style:de,children:D})]})}).displayName="InputGroup";var v={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},g="var(--shadow-xs)",m=function(o){var n=o.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:n,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},y=o.forwardRef(function(n,i){var a=n.size,l=void 0===a?"mediumSmall":a,d=n.disabled,s=void 0!==d&&d,c=n.error,u=void 0!==c&&c,p=n.readOnly,f=void 0!==p&&p,x=n.prefix,h=n.suffix,y=n.allowClear,b=void 0!==y&&y,w=n.onClear,k=n.className,j=void 0===k?"":k,S=n.style,C=n.type,z=void 0===C?"text":C,F=n.placeholder,W=n.value,L=n.defaultValue,A=n.onChange,E=n.onFocus,I=n.onBlur,B=n.onPressEnter,M=n.label,R=n.required,N=n.hintText,D=r(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),H=o.useRef(null),T=o.useState(L||W||""),O=T[0],P=T[1],_=o.useState(!1),K=_[0],q=_[1];o.useEffect(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var X=void 0!==W,Y=X?W:O,V=b&&Y&&!s,J=s?{border:"1px solid var(--color-border-disabled)",boxShadow:g,outline:"none"}:u&&K?{border:"1px solid var(--color-border-error)",boxShadow:g,outline:"2px solid var(--color-border-error)",outlineOffset:"-2px"}:u?{border:"1px solid var(--color-border-error_subtle)",boxShadow:g,outline:"none"}:K?{border:"1px solid var(--color-border-brand)",boxShadow:g,outline:"2px solid var(--color-border-brand)",outlineOffset:"-2px"}:{border:"1px solid var(--color-border-primary)",boxShadow:g,outline:"none"},Q=J.border,G=J.boxShadow,U=J.outline,Z=J.outlineOffset,$=v[l],ee=$.height,oe=$.paddingTop,ne=$.paddingBottom,te=t({width:"100%",height:ee,boxSizing:"border-box",fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-md)",fontWeight:400,lineHeight:"var(--line-height-text-md)",borderRadius:"var(--radius-md)",border:Q,boxShadow:G,backgroundColor:s||f?"var(--color-bg-disabled_subtle)":"var(--color-bg-primary)",color:s?"var(--color-text-disabled)":"var(--color-text-primary)",paddingTop:oe,paddingBottom:ne,paddingLeft:x?"40px":"14px",paddingRight:h||V?"40px":"14px",transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",outline:U,outlineOffset:Z,WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S),re={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:s?"var(--color-fg-disabled)":"var(--color-fg-quaternary)",zIndex:1},ie=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: var(--color-text-placeholder);\n font-size: var(--font-size-text-md);\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input::-moz-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input:-ms-input-placeholder { color: var(--color-text-placeholder); }\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(j),style:{position:"relative",display:"block",width:"100%"},children:[x&&e.jsx("span",{style:t(t({},re),{left:"14px",pointerEvents:"none"}),children:x}),e.jsx("input",t({ref:H,type:z,value:Y,placeholder:F,disabled:s,readOnly:f,onChange:function(e){X||P(e.target.value),null==A||A(e)},onFocus:function(e){q(!0),null==E||E(e)},onBlur:function(e){q(!1),null==I||I(e)},onKeyDown:function(e){var o;"Enter"===e.key&&B&&B(e),null===(o=D.onKeyDown)||void 0===o||o.call(D,e)},style:te,autoComplete:D.autoComplete||"off",autoCorrect:D.autoCorrect||"off",autoCapitalize:D.autoCapitalize||"off",spellCheck:D.spellCheck||!1},D)),(h||V)&&e.jsxs("span",{style:t(t({},re),{right:"14px",gap:"var(--spacing-xs)"}),children:[V&&e.jsx(m,{onClick:function(e){var o;e.stopPropagation(),X||P("");null==A||A({target:{value:""},currentTarget:{value:""}}),null==w||w(),null===(o=H.current)||void 0===o||o.focus()}}),h]})]})]});return M||N?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[M&&e.jsxs("label",{style:{fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:500,lineHeight:"20px",color:"var(--color-text-secondary)"},children:[M,R&&e.jsx("span",{style:{color:"var(--color-error-600)",marginLeft:"2px"},children:"*"})]}),ie,N&&e.jsx("p",{style:{margin:0,fontFamily:"var(--font-family-body)",fontSize:"var(--font-size-text-sm)",fontWeight:400,lineHeight:"20px",color:u?"var(--color-error-600)":"var(--color-text-tertiary)"},children:N})]}):ie});y.displayName="Input";var b=function(r){var a,l=r.value,s=r.defaultValue,c=r.options,u=void 0===c?[]:c,p=r.mode,f=r.disabled,x=void 0!==f&&f,h=r.error,v=void 0!==h&&h,g=r.placeholder,m=void 0===g?"Please select":g,y=r.size,b=void 0===y?"medium":y,w=r.showSearch,k=void 0!==w&&w,j=r.filterOption,S=void 0===j||j,C=r.allowClear,z=void 0!==C&&C,F=r.onChange,W=r.onSelect,L=r.onDeselect,A=r.onSearch,E=r.onFocus,I=r.onBlur,B=r.onDropdownVisibleChange,M=r.className,R=void 0===M?"":M,N=r.style,D=r.dropdownClassName,H=void 0===D?"":D,T=r.dropdownStyle,O=r.defaultOpen,P=void 0!==O&&O,_=r.open,K=r.maxTagCount,q=r.tagRender,X=r.optionRender,Y=d().primaryColor,V=void 0===Y?"#FB6011":Y,J=o.useState(void 0!==s?s:p?[]:void 0),Q=J[0],G=J[1],U=o.useState(P),Z=U[0],$=U[1],ee=o.useState(""),oe=ee[0],ne=ee[1],te=o.useState(-1),re=te[0],ie=te[1],ae=o.useRef(null),le=o.useRef(null),de=o.useRef(null),se=o.useState(null),ce=se[0],ue=se[1],pe=void 0!==l,fe=void 0!==_,xe=pe?l:Q,he=fe?_:Z,ve="multiple"===p||"tags"===p,ge=o.useCallback(function(){if(!xe)return[];var e=Array.isArray(xe)?xe:[xe];return u.filter(function(o){return e.includes(o.value)})},[xe,u]),me=o.useCallback(function(){return k&&oe?!1===S?u:"function"==typeof S?u.filter(function(e){return S(oe,e)}):u.filter(function(e){var o=String(e.label||"").toLowerCase(),n=oe.toLowerCase();return o.includes(n)}):u},[u,oe,k,S]),ye=o.useMemo(function(){return me()},[me]);o.useEffect(function(){if(he&&ae.current){var e=function(){var e,o;if(ae.current){var n=ae.current.getBoundingClientRect(),t=null!==(o=null===(e=de.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==o?o:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<t+4&&i>r,l=a?n.top+window.scrollY-t-4:n.bottom+window.scrollY+4;ue({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[he,ye.length]),o.useEffect(function(){var e=function(e){var o=e.target;ae.current&&!ae.current.contains(o)&&de.current&&!de.current.contains(o)&&(fe||$(!1),null==B||B(!1),ne(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,fe,B]),o.useEffect(function(){if(he){var e=function(e){var o;if("ArrowDown"===e.key)e.preventDefault(),ie(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),ie(function(e){return e>0?e-1:0});else if("Enter"===e.key&&re>=0){e.preventDefault();var n=ye[re];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(o=ae.current)||void 0===o||o.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,re,fe,B]),o.useEffect(function(){if(re>=0&&de.current){var e=de.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=o.useCallback(function(e){var o;if(!e.disabled)if(ve){var n,t=Array.isArray(xe)?xe:[];t.includes(e.value)?(n=t.filter(function(o){return o!==e.value}),null==L||L(e.value,e)):(n=i(i([],t,!0),[e.value],!1),null==W||W(e.value,e)),pe||G(n);var r=u.filter(function(e){return n.includes(e.value)});null==F||F(n,r)}else pe||G(e.value),null==F||F(e.value,e),null==W||W(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(o=ae.current)||void 0===o||o.focus()},[ve,xe,pe,fe,u,F,W,L,B]),we=o.useCallback(function(e,o){if(e.stopPropagation(),ve&&Array.isArray(xe)){var n=xe.filter(function(e){return e!==o}),t=u.find(function(e){return e.value===o});pe||G(n),null==F||F(n,ge()),null==L||L(o,t)}},[ve,xe,pe,u,F,L,ge]),ke=function(e){e.stopPropagation();var o=ve?[]:void 0;pe||G(o),null==F||F(o,[]),ne("")},je={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Se=o.useMemo(function(){return ge()},[ge]),Ce=o.useMemo(function(){return z&&xe&&!x},[z,xe,x]),ze=o.useMemo(function(){return ve?Array.isArray(xe)&&xe.length>0:null!=xe&&""!==xe},[ve,xe]),Fe=o.useMemo(function(){if(!ve||!Array.isArray(xe)||0===xe.length)return null;var n="responsive"===K?Se.slice(0,2):K?Se.slice(0,K):Se,t=K&&Se.length>n.length?Se.length-n.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var t={label:n.label,value:n.value,closable:!x,onClose:function(){return we({},n.value)}};return q?e.jsx(o.Fragment,{children:q(t)},n.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!x&&e.jsx("span",{onClick:function(e){return we(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),t>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",t]})]})},[ve,xe,Se,K,x,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:ae,className:"aha-select ".concat(R),style:t({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(v?"#F04438":he?V:"#D7D3D0"),backgroundColor:x?"#FAFAF9":"#FFFFFF",cursor:x?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:je[b].paddingTop,paddingBottom:je[b].paddingBottom,fontSize:je[b].fontSize,lineHeight:je[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:function(){if(!x){var e=!he;fe||$(e),null==B||B(e),e&&k?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==I||I(e)},onTouchStart:function(e){x||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:x?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ve?Fe||(m?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:m}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):k&&he?e.jsx("input",{ref:le,type:"text",value:oe,onChange:function(e){var o=e.target.value;ne(o),null==A||A(o),ie(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:x?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:ze?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:ze?x?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:ze?(null===(a=Se[0])||void 0===a?void 0:a.label)||xe:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Ce&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ke,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(o){var n=o.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:n?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ce&&n.createPortal(e.jsx("div",{ref:de,className:"aha-select-dropdown ".concat(H),style:t({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},T),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(o,n){var t=ve?Array.isArray(xe)&&xe.includes(o.value):xe===o.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(o.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return!o.disabled&&be(o)},style:{cursor:o.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(o,{selected:t,focused:r,disabled:o.disabled||!1})},o.value):e.jsxs("div",{className:"aha-select-option ".concat(o.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(t?"bg-[#FAFAF9]":""),onClick:function(){return be(o)},style:{padding:"8px 16px",cursor:o.disabled?"not-allowed":"pointer",color:o.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:o.label}),t&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:V,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},o.value)})}),document.body)]})};b.displayName="Select";var w=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},k=function(o){var n=o.className,t=o.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},j=function(o){var n=o.className,t=o.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},S=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},C=function(o){var n=o.className,t=o.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:t,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},z=function(n){var r=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,u=n.defaultPageSize,p=void 0===u?10:u,x=n.showSizeChanger,h=void 0!==x&&x,v=n.pageSizeOptions,g=void 0===v?["10","20","50","100"]:v,m=n.showQuickJumper,w=void 0!==m&&m,k=n.showTotal,j=n.onChange,z=n.onShowSizeChange,F=n.simple,W=void 0!==F&&F,L=n.disabled,A=void 0!==L&&L,E=n.hideOnSinglePage,I=void 0!==E&&E,B=n.className,M=void 0===B?"":B,R=n.style,N=n.size,D=void 0===N?"default":N,H=n.responsive,T=void 0!==H&&H;n.showLessItems;var O=n.itemRender,P=d().primaryColor,_=void 0===P?"#FB6011":P,K=o.useState(a),q=K[0],X=K[1],Y=o.useState(p),V=Y[0],J=Y[1],Q=o.useState(""),G=Q[0],U=Q[1],Z=null!=r?r:q,$=null!=c?c:V,ee=o.useMemo(function(){return Math.ceil(s/$)},[s,$]);o.useEffect(function(){void 0!==r&&X(r)},[r]),o.useEffect(function(){void 0!==c&&J(c)},[c]);var oe=function(e){e<1||e>ee||e===Z||A||(void 0===r&&X(e),null==j||j(e,$))},ne=function(){var e=parseInt(G,10);e>=1&&e<=ee&&(oe(e),U(""))};if(I&&ee<=1)return null;if(W)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(M),style:R,children:[e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Z," / ",ee]}),e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})]});var te=(Z-1)*$+1,re=Math.min(Z*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(M),style:t({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:T?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},R),children:[k&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:k(s,[te,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:O?O(Z-1,"prev",e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})})):e.jsx(f,{onClick:function(){return oe(Z-1)},disabled:A||1===Z,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(S,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,o){return o+1});var e=[];if(Z<=4){for(var o=1;o<=5;o++)e.push(o);e.push("jump-next"),e.push(ee)}else if(Z>=ee-3){e.push(1),e.push("jump-prev");for(o=ee-4;o<=ee;o++)e.push(o)}else{e.push(1),e.push("jump-prev");for(o=Z-1;o<=Z+1;o++)e.push(o);e.push("jump-next"),e.push(ee)}return e}().map(function(o){return function(o){if("number"==typeof o){var n=o===Z,t=e.jsx(f,{onClick:function(){return oe(o)},disabled:A,type:n?"primary":"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(_):void 0,boxShadow:"none",borderRadius:"8px"},children:o},o);return O?O(o,"page",t):t}if("jump-prev"===o)return t=e.jsx(f,{onClick:function(){return oe(Math.max(1,Z-5))},disabled:A,type:"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),O?O(Z-5,"jump-prev",t):t;if("jump-next"===o)return t=e.jsx(f,{onClick:function(){return oe(Math.min(ee,Z+5))},disabled:A,type:"default",size:"default"===D?"medium":"small",style:{minWidth:"small"===D?"32px":"36px",height:"small"===D?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),O?O(Z+5,"jump-next",t):t;return null}(o)})}),s>0&&e.jsx(e.Fragment,{children:O?O(Z+1,"next",e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})):e.jsx(f,{onClick:function(){return oe(Z+1)},disabled:A||Z===ee,type:"default",size:"default"===D?"medium":"small",style:{height:"small"===D?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(C,{})})}),h&&e.jsx(b,{value:$,options:g.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return o=Number(e),n=Math.ceil(s/o),t=Z>n?n:Z,void 0===c&&J(o),void 0===r&&X(t),null==z||z(t,o),void(null==j||j(t,o));var o,n,t},disabled:A,size:"small"===D?"small":"medium",style:{minWidth:"small"===D?80:96}}),w&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(y,{type:"number",min:1,value:G,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:A,size:"small"===D?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e.jsx(f,{onClick:ne,disabled:A,type:"default",size:"default"===D?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e.jsx(f,{onClick:ne,disabled:A,type:"default",size:"default"===D?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},F=function(n){var r=n.checked,i=void 0!==r&&r,a=n.indeterminate,l=void 0!==a&&a,d=n.disabled,s=void 0!==d&&d,c=n.onChange,u=n.className,p=void 0===u?"":u,f=n.style,x=n.children,h=n.size,v=void 0===h?"sm":h,g=n.hint,m=n.isFocused,y=o.useState(!1),b=y[0],w=y[1],k=o.useState(!1),j=k[0],S=k[1],C=i||l,z=null!=m?m:j,F=function(){s||(null==c||c({target:{checked:!i},currentTarget:{checked:!i}}))},W="sm"===v?"16px":"20px",L="sm"===v?"12px":"14px",A="sm"===v?"var(--radius-xs, 4px)":"var(--radius-sm, 6px)",E="sm"===v?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",I="sm"===v?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",B="sm"===v?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",M=s&&C?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)",R=x||g;return e.jsxs("div",{className:"aha-checkbox ".concat(p),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":s,tabIndex:s?-1:0,style:t({display:"inline-flex",alignItems:"flex-start",gap:B,cursor:s?"not-allowed":"pointer",outline:"none"},f),onClick:F,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),F())},onMouseEnter:function(){return!s&&w(!0)},onMouseLeave:function(){return w(!1)},onFocus:function(){return!s&&S(!0)},onBlur:function(){return S(!1)},children:[e.jsxs("div",{style:{position:"relative",width:W,height:W,minWidth:W,minHeight:W,flexShrink:0,borderRadius:A,border:s?"1px solid var(--color-border-disabled, #d7d3d0)":C?b?"1px solid var(--color-bg-brand-solid_hover, #ec470a)":"1px solid var(--color-bg-brand-solid, #fb6011)":"1px solid var(--color-border-primary, #d7d3d0)",backgroundColor:s?"var(--color-bg-disabled_subtle, #fafaf9)":C?b?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":b?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:z?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:R?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:M,opacity:l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:L,height:L,color:M,opacity:i&&!l?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),R&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===v?"var(--spacing-xxs, 2px)":"0"},children:[x&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:s?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:x}),g&&e.jsx("span",{style:{fontSize:E,lineHeight:I,fontWeight:"var(--font-weight-regular, 400)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:"var(--color-text-tertiary, #57534e)"},onClick:function(e){return e.stopPropagation()},children:g})]})]})};F.displayName="Checkbox";var W=function(o){var n=o.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},L=function(o){var n=o.loading,t=o.spinColor;if(!n)return null;var r=!0===n?e.jsx(W,{color:t}):n;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},A=function(e,o){return"string"==typeof o?null==e?void 0:e[o]:o.reduce(function(e,o){return null==e?void 0:e[o]},e)},E=function(e,o){var n,t;return"function"==typeof o?o(e):"string"==typeof o?null!==(n=A(e,o))&&void 0!==n?n:"":null!==(t=e.key)&&void 0!==t?t:""},I=function(o){var n=o.order,t=d().primaryColor;return"ascend"===n?e.jsx(j,{style:{color:t}}):"descend"===n?e.jsx(k,{style:{color:t}}):e.jsx(w,{})};exports.default=function(n){var a,l,s,c,u=n.columns,p=void 0===u?[]:u,f=n.dataSource,x=void 0===f?[]:f,h=n.rowKey,v=void 0===h?"key":h,g=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,k=n.bordered,j=void 0!==k&&k,S=n.loading,C=void 0!==S&&S,W=n.locale,B=n.showHeader,M=void 0===B||B,R=n.title,N=n.footer,D=n.summary,H=n.scroll,T=n.tableLayout,O=void 0===T?"auto":T,P=n.onChange,_=n.onSorterChange,K=n.onPaginationChange,q=n.onRow,X=n.className,Y=void 0===X?"":X,V=n.innerClassName,J=void 0===V?"":V,Q=n.style,G=n.expandable,U=n.rowClassName,Z=n.onHeaderRow;n.sticky;var $=r(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=d().primaryColor||"#FB6011",oe=o.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),ne=oe[0],te=oe[1];o.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&te(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var re=o.useState(new Map),ie=re[0],ae=re[1],le=o.useState((null==G?void 0:G.defaultExpandedRowKeys)||[]),de=le[0],se=le[1],ce=o.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=ce[0],pe=ce[1],fe=o.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),xe=fe[0],he=fe[1];o.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&he(y.pageSize))},[y]);var ve=o.useState(null),ge=ve[0],me=ve[1],ye=o.useState(null),be=ye[0],we=ye[1],ke=o.useState(!1),je=ke[0],Se=ke[1],Ce=o.useRef(null),ze=o.useRef(null);o.useEffect(function(){var e=function(){Se(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Fe=o.useCallback(function(e,o){var n,t,r,a=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==a?void 0:a.disabled)){var l,d=E(e,v);l="radio"===(null==g?void 0:g.type)?o?[d]:[]:o?i(i([],ne,!0),[d],!1):ne.filter(function(e){return e!==d}),te(l);var s=x.filter(function(e){return l.includes(E(e,v))});null===(t=null==g?void 0:g.onChange)||void 0===t||t.call(g,l,s),null===(r=null==g?void 0:g.onSelect)||void 0===r||r.call(g,e,o,s,new Event("select"))}},[ne,v,g,x]),We=o.useCallback(function(e,o){var n,t,r=o.filter(function(e){var o;return!(null===(o=null==g?void 0:g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}).map(function(e){return E(e,v)}),i=e?r:[];te(i);var a=x.filter(function(e){return i.includes(E(e,v))}),l=e?o.filter(function(e){var o;return!(null===(o=null==g?void 0:g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}):[];null===(n=null==g?void 0:g.onChange)||void 0===n||n.call(g,i,a),null===(t=null==g?void 0:g.onSelectAll)||void 0===t||t.call(g,e,a,l)},[v,g,x]),Le=o.useCallback(function(e,o){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var t=new Map(ie);null===o?t.delete(n):t.set(n,o),ae(t);var r=Array.from(t.entries()).map(function(o){var n=o[0],t=o[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:t,field:n,columnKey:n}}),i={column:e,order:o,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),_&&_(1===r.length?r[0]:r),P&&P({current:ue,pageSize:xe},{},1===r.length?r[0]:r,{currentDataSource:x,action:"sort"})}},[ie,P,_,ue,xe,x,p]);o.useCallback(function(e,o){var n,t,r,a=E(e,v);r=o?i(i([],de,!0),[a],!1):de.filter(function(e){return e!==a}),se(r),null===(n=null==G?void 0:G.onExpand)||void 0===n||n.call(G,o,e),null===(t=null==G?void 0:G.onExpandedRowsChange)||void 0===t||t.call(G,r)},[de,v,G]);var Ae,Ee=o.useCallback(function(){var e=i([],x,!0);return ie.size>0&&e.sort(function(e,o){for(var n=function(n,t){var r=p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,o);else if(!0===r.sorter){var a=A(e,r.dataIndex||n),l=A(o,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===t?i:-i}:void 0},t=0,r=Array.from(ie.entries());t<r.length;t++){var i=r[t],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[x,ie,p]),Ie=Ee(),Be=Boolean(y&&"object"==typeof y&&void 0!==y.total),Me=o.useMemo(function(){if(!1===y||!y)return Ie;if(Be)return Ie;var e=(ue-1)*xe,o=e+xe;return Ie.slice(e,o)},[Ie,ue,xe,y,Be]),Re=o.useCallback(function(e,o){var n,t,r=null!=o?o:xe;if(pe(e),o&&he(o),K&&K(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,o),o&&(null===(t=y.onShowSizeChange)||void 0===t||t.call(y,e,o))),P){var i=Array.from(ie.entries()).map(function(e){var o=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===o}),order:n,field:o,columnKey:o}});P({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Ie,action:"paginate"})}},[y,K,P,xe,ie,p,Ie]),Ne=o.useCallback(function(e,o,n){var t=A(o,e.dataIndex||"");return e.render?e.render(t,o,n):t},[]),De=o.useCallback(function(e,o,n){if(o){var t=!0===o?"left":o,r=0;if("left"===t){if(g&&("left"===g.fixed||!0===g.fixed))r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=p[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===t){for(i=e+1;i<p.length;i++){var a;if("right"===(a=p[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(g&&"right"===g.fixed)r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return r}}},[p,g]),He=o.useCallback(function(){if(!M)return null;var o,n,r,i,a=p.map(function(o,n){var r,i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex)||n,a=ie.get(i)||null,l=De(n,o.fixed,!0),d=o.width?"number"==typeof o.width?"".concat(o.width,"px"):o.width:void 0;return e.jsx("th",t({className:"".concat(o.className||""," ").concat(o.align?"text-".concat(o.align):""),style:{width:d,minWidth:o.minWidth?"number"==typeof o.minWidth?"".concat(o.minWidth,"px"):o.minWidth:d||void 0,maxWidth:d,position:o.fixed?"sticky":"relative",left:"left"===o.fixed||!0===o.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===o.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:o.fixed?"left"===o.fixed||!0===o.fixed?10:9:1,backgroundColor:(o.fixed,"#F9FAFB"),boxShadow:"left"===o.fixed||!0===o.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===o.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:o.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=o.onHeaderCell)||void 0===r?void 0:r.call(o,o))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===o.align?"flex-end":"center"===o.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof o.title?o.title({sortOrder:a,sortColumn:o}):o.title}),o.sorter&&e.jsx("button",{onClick:function(){Le(o,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e.jsx(I,{order:a||void 0})})]})}),i)});if(g){var l="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",d=e.jsx("th",{style:{width:l,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(o=Me.filter(function(e){var o;return!(null===(o=g.getCheckboxProps)||void 0===o?void 0:o.call(g,e).disabled)}),n=o.map(function(e){return E(e,v)}),r=o.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(F,{checked:r,indeterminate:i&&!r,onChange:function(e){return We(e.target.checked,Me)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");a.unshift(d)}var s=null==Z?void 0:Z(p,0);return e.jsx("thead",{ref:ze,children:e.jsx("tr",t({},s||{},{children:a}))})},[p,M,ie,g,ne,Me,v,Le,We,W,Z,De]),Te=o.useCallback(function(e){me(e)},[]),Oe=o.useCallback(function(e,o){e.preventDefault(),we(o)},[]),Pe=o.useCallback(function(e,o){if(e.preventDefault(),null===ge||ge===o)return me(null),void we(null);var n=i([],Me,!0),t=n[ge];n.splice(ge,1),n.splice(o,0,t),me(null),we(null)},[ge,Me]),_e=o.useCallback(function(){me(null),we(null)},[]),Ke=o.useCallback(function(){var o=null==W?void 0:W.emptyText,n="function"==typeof o?o():void 0!==o?o:"No data",t=p.length+(g?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:t,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==W?void 0:W.emptyText,p.length,g]),qe=o.useCallback(function(){return 0===Me.length?Ke():Me.map(function(n,r){var i,a=E(n,v),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,r))||{},c=r===Me.length-1;return e.jsxs(o.Fragment,{children:[e.jsxs("tr",t({className:"".concat("function"==typeof U?U(n,r):U||""," ").concat(ge===r?"dragging":""," ").concat(be===r?"drag-over":""),draggable:!0,onDragStart:function(){return Te(r)},onDragOver:function(e){return Oe(e,r)},onDrop:function(e){return Pe(e,r)},onDragEnd:_e,style:t({cursor:"move",opacity:ge===r?.5:1,backgroundColor:be===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ge!==r&&be!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(F,{checked:l,onChange:function(e){return Fe(n,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,n).disabled})})}),p.map(function(o,i){var a,l=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex)||i,d=(null===(a=o.onCell)||void 0===a?void 0:a.call(o,n,r))||{},s=De(i,o.fixed,!1),u=o.width?"number"==typeof o.width?"".concat(o.width,"px"):o.width:void 0;return e.jsx("td",t({className:"".concat(o.className||""," ").concat(o.align?"text-".concat(o.align):""),style:t({width:u,minWidth:o.minWidth?"number"==typeof o.minWidth?"".concat(o.minWidth,"px"):o.minWidth:u||void 0,maxWidth:u,position:o.fixed?"sticky":"relative",left:"left"===o.fixed||!0===o.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===o.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,zIndex:o.fixed?"left"===o.fixed||!0===o.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===o.fixed||!0===o.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===o.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:o.align||"left"},d.style),colSpan:o.colSpan,rowSpan:o.rowSpan},d,{children:Ne(o,n,r)}),l)})]})),(null==G?void 0:G.expandedRowRender)&&d&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:G.expandedRowRender(n,r,0,!0)})})]},a)})},[Me,v,ne,de,g,p,q,U,Fe,Ne,G,ge,be,Te,Oe,Pe,_e,De,Ke]),Xe=function(){var o;if(!1===y||!y)return null;var n=null!==(o=y.total)&&void 0!==o?o:Ie.length,t=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:t.includes("Right")?"flex-end":t.includes("Left")?"flex-start":"center"},children:e.jsx(z,{current:ue,total:n,pageSize:xe,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:Re,onShowSizeChange:Re,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Ye=o.useMemo(function(){return p.some(function(e){return e.fixed})||g&&g.fixed},[p,g]),Ve=o.useMemo(function(){return p.every(function(e){return e.width})&&(!g||g.columnWidth)},[p,g]),Je=o.useMemo(function(){if(null==H?void 0:H.x){if("number"==typeof H.x)return H.x;if(!0===H.x)return p.reduce(function(e,o){return e+(o.width?"number"==typeof o.width?o.width:parseInt(String(o.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(Ye)return p.reduce(function(e,o){return o.fixed&&o.width?e+("number"==typeof o.width?o.width:parseInt(String(o.width).replace("px",""))||0):e},0)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[p,null==H?void 0:H.x,g,Ye]),Qe=o.useMemo(function(){return"fixed"===O||Ye||Ve||p.some(function(e){return e.width})?"fixed":O},[O,Ye,Ve,p]),Ge=t(t({width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Qe,backgroundColor:"white"},j&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=t({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"},Q);if(je)return e.jsxs("div",t({ref:Ce,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ue,"aria-busy":!!C||void 0},$,{children:[R&&e.jsx("div",{style:{marginBottom:"16px"},children:R(Ie)}),y&&"object"==typeof y&&(null===(a=y.position)||void 0===a?void 0:a.startsWith("top"))&&Xe(),(Ae="function"==typeof(null==W?void 0:W.emptyText)?W.emptyText():void 0!==(null==W?void 0:W.emptyText)?W.emptyText:"No data",0===Me.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ae}):e.jsx("div",{className:"aha-table-mobile",children:Me.map(function(o,n){var t,r=E(o,v),i=ne.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(F,{checked:i,onChange:function(e){return Fe(o,e.target.checked)},disabled:null===(t=g.getCheckboxProps)||void 0===t?void 0:t.call(g,o).disabled})}),p.map(function(t){var r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex),i=A(o,t.dataIndex||""),a=t.render?t.render(i,o,n):i;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof t.title?t.title({}):t.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(l=y.position)||void 0===l?void 0:l.startsWith("top")))&&Xe(),e.jsx(L,{loading:C,spinColor:ee})]}));var Ze={position:"relative",overflowX:(null==H?void 0:H.x)||Ye?"auto":"visible",overflowY:(null==H?void 0:H.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==H?void 0:H.x)?"100%":"number"==typeof(null==H?void 0:H.x)?"".concat(H.x,"px"):void 0,maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",t({ref:Ce,className:"aha-table ".concat(Y),style:Ue,"aria-busy":!!C||void 0},$,{children:[R&&e.jsx("div",{style:{marginBottom:"16px"},children:R(Ie)}),y&&"object"==typeof y&&(null===(s=y.position)||void 0===s?void 0:s.startsWith("top"))&&Xe(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:Je?"".concat(Je,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ge,className:J,children:[He(),e.jsx("tbody",{children:qe()}),D&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(g?1:0),children:D(Ie)})})})]})})}),N&&e.jsx("div",{style:{marginTop:"16px"},children:N(Ie)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&Xe(),e.jsx(L,{loading:C,spinColor:ee})]}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("react-dom"),o=function(){return o=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},o.apply(this,arguments)};function i(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)n.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(t[o[i]]=e[o[i]])}return t}function r(e,n,t){if(t||2===arguments.length)for(var o,i=0,r=n.length;i<r;i++)!o&&i in n||(o||(o=Array.prototype.slice.call(n,0,i)),o[i]=n[i]);return e.concat(o||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var l={primaryColor:"#FB6011"},a=n.createContext(l),d=function(){var e=n.useContext(a);return e||l},s="#feb073",c="#fb6011",p="#ec470a",u="#c4330a",x="#fecdca",f="#fda29b",h="#f04438",g="#d92d20",m="#b42318",v="#1c1917",y="#44403c",b="#57534e",w="#79716b",k="#79716b",j="#ffffff",S="#d92d20",C="#d7d3d0",z="#fb6011",F="#f04438",L="#fda29b",W="#d7d3d0",A="#e7e5e4",E="#ffffff",I="#fafaf9",B="#f5f5f4",D="#fafaf9",M="#fef3f2",R="#a9a29d",N="#a9a29d",T="#d7d3d0",H="#ffffff",P="#f04438",O={display:'"DM Sans", system-ui, -apple-system, sans-serif',body:'"DM Sans", system-ui, -apple-system, sans-serif',base:'"DM Sans", system-ui, -apple-system, sans-serif'},X={xs:"12px",sm:"14px",base:"16px",md:"16px",lg:"18px",xl:"20px",displayXs:"24px",displaySm:"30px",displayMd:"36px",displayLg:"48px",displayXl:"60px",display2xl:"72px"},K={regular:400,medium:500,semibold:600,bold:700},q={xs:"18px",sm:"20px",base:"24px",md:"24px",lg:"28px",xl:"30px",displayXs:"32px",displaySm:"38px",displayMd:"44px",displayLg:"60px",displayXl:"72px",display2xl:"90px"},Y="2px",V="4px",Q="8px",G="12px",J="4px",_="6px",U="8px",Z="0px 1px 2px 0px #0a0d120d",$="inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d",ee={default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(c),shadowXs:"0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(c),shadowXsSkeuomorphic:"inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(c),shadowSm:"0px 1px 3px 0px #0a0d121a, 0px 1px 2px 0px #0a0d121a, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(c),error:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(h),errorShadowXs:"0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(h),errorShadowXsSkeuomorphic:"inset 0px 0px 0px 1px #0a0d122e, inset 0px -2px 0px 0px #0a0d120d, 0px 1px 2px 0px #0a0d120d, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(h)},ne=c;function te(e){return!e||e.toLowerCase()===ne.toLowerCase()}function oe(e){return e||ne}var ie=p,re=c;var le=O.body,ae=U,de={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},se={default:"default",primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link"},ce={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},pe=function(n){var t=n.size,o=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),e.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",opacity:"0.25"}),e.jsx("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:o,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},ue=function(t){var r=t.children,l=t.type,a=void 0===l?"default":l,c=t.size,v=void 0===c?"md":c,w=t.disabled,k=void 0!==w&&w,z=t.loading,F=void 0!==z&&z,W=t.iconOnly,D=t.focused,T=void 0!==D&&D,H=t.onClick,O=t.htmlType,X=void 0===O?"button":O,K=t.className,q=void 0===K?"":K,Y=t.style,V=t.icon,Q=t.iconPosition,G=void 0===Q?"left":Q,J=i(t,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),_=d().primaryColor,U=n.useState(!1),Z=U[0],ne=U[1],ue=n.useState(!1),xe=ue[0],fe=ue[1],he=se[a]||"default",ge=ce[de[v]||"md"],me=null!=W?W:!!V&&null==r,ve="link-color"===he||"link-gray"===he||"destructive-link"===he,ye=k||F,be=T,we=_,ke=function(e){var n=e.hierarchy,t=e.disabled,o=e.interactive,i=oe(e.brandColor),r=ie,l=p,a=u;return t?"default"===n||"primary"===n||"secondary"===n||"destructive-primary"===n||"destructive-secondary"===n?{bg:B,color:N,iconColor:N,border:"1px solid ".concat(A),boxShadow:"none"}:{bg:"transparent",color:N,iconColor:N,border:"none",boxShadow:"none"}:"default"===n?{bg:o?I:E,color:o?l:y,iconColor:o?re:R,border:"1px solid ".concat(o?re:C),boxShadow:"none"}:"primary"===n?{bg:o?r:i,color:j,iconColor:s,border:"none",boxShadow:$}:"secondary"===n?{bg:o?I:E,color:o?"#292524":y,iconColor:o?"#79716b":R,border:"none",boxShadow:$}:"tertiary"===n?{bg:o?I:"transparent",color:o?"#44403c":b,iconColor:o?"#79716b":R,border:"none",boxShadow:"none"}:"link-color"===n?{bg:"transparent",color:o?a:l,iconColor:re,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}:"link-gray"===n?{bg:"transparent",color:o?"#44403c":b,iconColor:R,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}:"destructive-primary"===n?{bg:o?g:h,color:j,iconColor:o?x:f,border:"none",boxShadow:$}:"destructive-secondary"===n?{bg:o?M:E,color:S,iconColor:P,border:"none",boxShadow:"inset 0 0 0 1px ".concat(L,", inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)")}:"destructive-tertiary"===n?{bg:o?M:"transparent",color:S,iconColor:P,border:"none",boxShadow:"none"}:{bg:"transparent",color:o?m:S,iconColor:P,border:"none",boxShadow:"none",textDecoration:o?"underline":"none"}}({hierarchy:he,disabled:k,interactive:Z||xe,brandColor:we}),je=function(e,n,t){if(n)return"destructive-primary"===e||"destructive-secondary"===e||"destructive-tertiary"===e||"destructive-link"===e?"destructive-primary"===e||"destructive-secondary"===e?ee.errorShadowXsSkeuomorphic:ee.error:"primary"===e||"secondary"===e?te(t)?ee.shadowXsSkeuomorphic:"".concat($,", 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ").concat(t):te(t)?ee.default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(t)}(he,be,we),Se=o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:ge.gap,fontFamily:le,fontWeight:600,fontSize:ge.fontSize,lineHeight:"".concat(ge.lineHeight,"px"),cursor:ye?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:ke.bg,color:ke.color,border:ke.border,boxShadow:null!=je?je:ke.boxShadow,textDecoration:ke.textDecoration},Y);ve?(Se.borderRadius="4px",Se.overflow="hidden",me?(Se.width=ge.height,Se.height=ge.height,Se.padding=0):(Se.height=ge.height,Se.paddingLeft=ge.paddingX,Se.paddingRight=ge.paddingX)):(Se.borderRadius=ae,me?(Se.width=ge.height,Se.height=ge.height,Se.padding=0):(Se.height=ge.height,Se.paddingLeft=ge.paddingX,Se.paddingRight=ge.paddingX));var Ce=function(){return F?e.jsx(pe,{size:ge.iconSize,color:ke.iconColor}):V?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:ge.iconSize,height:ge.iconSize,color:ke.iconColor,flexShrink:0},children:V}):null},ze=F||V&&"left"===G,Fe=!F&&V&&"right"===G;return e.jsxs("button",o({type:X,className:["aha-button","aha-button--".concat(he),"aha-button--".concat(de[v]||"md"),me&&"aha-button--icon-only",ye&&"aha-button--disabled",F&&"aha-button--loading",be&&"aha-button--focused",q].filter(Boolean).join(" "),disabled:ye,onClick:function(e){ye?e.preventDefault():null==H||H(e)},onMouseEnter:function(){return!ye&&ne(!0)},onMouseLeave:function(){ne(!1),fe(!1)},onMouseDown:function(){return!ye&&fe(!0)},onMouseUp:function(){return fe(!1)},style:Se},J,{children:[ze&&Ce(),!me&&r,Fe&&Ce(),me&&!V&&!F&&r]}))};ue.displayName="Button";var xe=O.body,fe=X.md,he=X.sm,ge=q.md,me=q.sm,ve=U,ye=Z,be=V,we={textPrimary:v,textSecondary:y,textTertiary:b,textDisabled:w,textPlaceholder:k,borderPrimary:C,borderDisabled:W,borderBrand:z,borderError:F,borderErrorSubtle:L,bgPrimary:E,bgDisabledSubtle:D,fgDisabled:N,fgQuaternary:R,error600:g};function ke(e){var n=e.disabled,t=void 0!==n&&n,o=e.error,i=void 0!==o&&o,r=e.focused,l=void 0!==r&&r,a=e.brandColor,d=we,s=ye,c=a||d.borderBrand;return t?{border:"1px solid ".concat(d.borderDisabled),boxShadow:s,outline:"none"}:i&&l?{border:"1px solid ".concat(d.borderError),boxShadow:s,outline:"2px solid ".concat(d.borderError),outlineOffset:"-2px"}:i?{border:"1px solid ".concat(d.borderErrorSubtle),boxShadow:s,outline:"none"}:l?{border:"1px solid ".concat(c),boxShadow:s,outline:"2px solid ".concat(c),outlineOffset:"-2px"}:{border:"1px solid ".concat(d.borderPrimary),boxShadow:s,outline:"none"}}function je(){return{fontFamily:xe,fontSize:he,fontWeight:500,lineHeight:me,color:we.textSecondary}}function Se(e){return void 0===e&&(e=!1),{margin:0,fontFamily:xe,fontSize:he,fontWeight:400,lineHeight:me,color:e?we.error600:we.textTertiary}}var Ce={small:{pt:"5px",pb:"5px"},mediumSmall:{pt:"7px",pb:"7px"},medium:{pt:"9px",pb:"9px"},large:{pt:"11px",pb:"11px"}};n.forwardRef(function(t,r){var l=t.size,a=void 0===l?"mediumSmall":l,s=t.error,c=void 0!==s&&s,p=t.disabled,u=void 0!==p&&p,x=t.readOnly,f=void 0!==x&&x,h=t.prefix,g=t.suffix,m=t.leadingText,v=t.trailingText,y=t.leadingAddon,b=t.trailingAddon,w=t.className,k=void 0===w?"":w,j=t.style,S=t.onFocus,C=t.onBlur,z=t.onKeyDown,F=t.onPressEnter,L=t.value,W=t.defaultValue,A=t.onChange,E=t.placeholder,I=t.type,B=void 0===I?"text":I,D=t.label,M=t.required,R=t.hintText,N=i(t,["size","error","disabled","readOnly","prefix","suffix","leadingText","trailingText","leadingAddon","trailingAddon","className","style","onFocus","onBlur","onKeyDown","onPressEnter","value","defaultValue","onChange","placeholder","type","label","required","hintText"]),T=n.useRef(null),H=n.useState(!1),P=H[0],O=H[1],X=n.useState(null!=W?W:""),K=X[0],q=X[1],Y=d().primaryColor;n.useEffect(function(){"function"==typeof r?r(T.current):r&&(r.current=T.current)},[r]);var V=void 0!==L,Q=V?L:K,G=ke({disabled:u,error:c,focused:P,brandColor:Y}),J=G.border,_=G.boxShadow,U=G.outline,Z=G.outlineOffset,$=Ce[a],ee=$.pt,ne=$.pb,te=u?we.borderDisabled:we.borderPrimary,oe=!!h,ie=!!g,re={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:u?we.fgDisabled:we.fgQuaternary,zIndex:1,pointerEvents:"none"},le={display:"flex",alignItems:"center",paddingTop:ee,paddingBottom:ne,paddingLeft:"14px",paddingRight:"12px",color:we.textTertiary,fontFamily:xe,fontSize:fe,lineHeight:ge,whiteSpace:"nowrap",flexShrink:0,backgroundColor:u?we.bgDisabledSubtle:"transparent"},ae=e.jsxs("div",{className:"aha-input-group ".concat(k),style:o({display:"flex",alignItems:"stretch",width:"100%",border:J,boxShadow:_,outline:U,outlineOffset:Z,borderRadius:ve,backgroundColor:u||f?we.bgDisabledSubtle:we.bgPrimary,overflow:"hidden",boxSizing:"border-box",transition:"border-color 0.15s ease, box-shadow 0.15s ease"},j),children:[void 0!==m&&e.jsx("div",{style:o(o({},le),{borderRight:"1px solid ".concat(te)}),children:m}),void 0!==y&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderRight:"1px solid ".concat(te)},children:y}),e.jsxs("div",{style:{flex:1,position:"relative",display:"flex",alignItems:"stretch",minWidth:0},children:[oe&&e.jsx("span",{style:o(o({},re),{left:"14px"}),children:h}),e.jsx("input",o({ref:T,type:B,value:Q,placeholder:E,disabled:u,readOnly:f,onChange:function(e){V||q(e.target.value),null==A||A(e)},onFocus:function(e){O(!0),null==S||S(e)},onBlur:function(e){O(!1),null==C||C(e)},onKeyDown:function(e){"Enter"===e.key&&F&&F(e),null==z||z(e)},style:{flex:1,border:"none",outline:"none",width:"100%",boxSizing:"border-box",fontFamily:xe,fontSize:fe,fontWeight:400,lineHeight:ge,backgroundColor:"transparent",color:u?we.textDisabled:we.textPrimary,paddingTop:ee,paddingBottom:ne,paddingLeft:oe?"40px":"14px",paddingRight:ie?"40px":"14px"},autoComplete:N.autoComplete||"off"},N)),ie&&e.jsx("span",{style:o(o({},re),{right:"14px"}),children:g})]}),void 0!==v&&e.jsx("div",{style:o(o({},le),{paddingLeft:"12px",paddingRight:"14px",borderLeft:"1px solid ".concat(te)}),children:v}),void 0!==b&&e.jsx("div",{style:{display:"flex",alignItems:"stretch",flexShrink:0,borderLeft:"1px solid ".concat(te)},children:b})]});return D||R?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[D&&e.jsxs("label",{style:je(),children:[D,M&&e.jsx("span",{style:{color:we.error600,marginLeft:"2px"},children:"*"})]}),ae,R&&e.jsx("p",{style:Se(c),children:R})]}):ae}).displayName="InputGroup";var ze={small:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},mediumSmall:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},medium:{height:"44px",paddingTop:"9px",paddingBottom:"9px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},Fe=function(n){var t=n.onClick;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:t,style:{cursor:"pointer",flexShrink:0},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},Le=n.forwardRef(function(t,r){var l=t.size,a=void 0===l?"mediumSmall":l,s=t.disabled,c=void 0!==s&&s,p=t.error,u=void 0!==p&&p,x=t.readOnly,f=void 0!==x&&x,h=t.prefix,g=t.suffix,m=t.allowClear,v=void 0!==m&&m,y=t.onClear,b=t.className,w=void 0===b?"":b,k=t.style,j=t.type,S=void 0===j?"text":j,C=t.placeholder,z=t.value,F=t.defaultValue,L=t.onChange,W=t.onFocus,A=t.onBlur,E=t.onPressEnter,I=t.label,B=t.required,D=t.hintText,M=i(t,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter","label","required","hintText"]),R=n.useRef(null),N=n.useState(F||z||""),T=N[0],H=N[1],P=n.useState(!1),O=P[0],X=P[1],K=d().primaryColor;n.useEffect(function(){"function"==typeof r?r(R.current):r&&(r.current=R.current)},[r]);var q,Y,V,Q=void 0!==z,G=Q?z:T,J=v&&G&&!c,_=ke({disabled:c,error:u,focused:O,brandColor:K}),U=ze[a],Z=U.height,$=U.paddingTop,ee=U.paddingBottom,ne=h?"40px":"14px",te=g||J?"40px":"14px",oe=o(o(o({width:"100%",height:Z,boxSizing:"border-box",fontFamily:xe,fontSize:fe,fontWeight:400,lineHeight:ge,borderRadius:ve},_),{backgroundColor:c||f?we.bgDisabledSubtle:we.bgPrimary,color:c?we.textDisabled:we.textPrimary,paddingTop:$,paddingBottom:ee,paddingLeft:ne,paddingRight:te,transition:"border-color 0.15s ease, box-shadow 0.15s ease, outline-color 0.15s ease",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"}),k),ie=(void 0===(Y='\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-input-wrapper input[type="number"]::-webkit-inner-spin-button,\n .aha-input-wrapper input[type="number"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n .aha-input-wrapper input[type="number"] { -moz-appearance: textfield; }\n ')&&(Y=""),void 0===V&&(V=we.textPlaceholder),"\n ".concat(q=".aha-input-wrapper input","::placeholder {\n color: ").concat(V,";\n font-size: ").concat(fe,";\n font-weight: 400;\n opacity: 1;\n }\n ").concat(q,"::-webkit-input-placeholder { color: ").concat(V,"; }\n ").concat(q,"::-moz-placeholder { color: ").concat(V,"; }\n ").concat(q,":-ms-input-placeholder { color: ").concat(V,"; }\n ").concat(Y,"\n ")),re={position:"absolute",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",color:c?we.fgDisabled:we.fgQuaternary,zIndex:1},le=e.jsxs(e.Fragment,{children:[e.jsx("style",{children:ie}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"block",width:"100%"},children:[h&&e.jsx("span",{style:o(o({},re),{left:"14px",pointerEvents:"none"}),children:h}),e.jsx("input",o({ref:R,type:S,value:G,placeholder:C,disabled:c,readOnly:f,onChange:function(e){Q||H(e.target.value),null==L||L(e)},onFocus:function(e){X(!0),null==W||W(e)},onBlur:function(e){X(!1),null==A||A(e)},onKeyDown:function(e){var n;"Enter"===e.key&&E&&E(e),null===(n=M.onKeyDown)||void 0===n||n.call(M,e)},style:oe,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(g||J)&&e.jsxs("span",{style:o(o({},re),{right:"14px",gap:be}),children:[J&&e.jsx(Fe,{onClick:function(e){var n;e.stopPropagation(),Q||H("");null==L||L({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(n=R.current)||void 0===n||n.focus()}}),g]})]})]});return I||D?e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",width:"100%"},children:[I&&e.jsxs("label",{style:je(),children:[I,B&&e.jsx("span",{style:{color:we.error600,marginLeft:"2px"},children:"*"})]}),le,D&&e.jsx("p",{style:Se(u),children:D})]}):le});Le.displayName="Input";var We=function(i){var l,a=i.value,s=i.defaultValue,c=i.options,p=void 0===c?[]:c,u=i.mode,x=i.disabled,f=void 0!==x&&x,h=i.error,g=void 0!==h&&h,m=i.placeholder,v=void 0===m?"Please select":m,y=i.size,b=void 0===y?"medium":y,w=i.showSearch,k=void 0!==w&&w,j=i.filterOption,S=void 0===j||j,C=i.allowClear,z=void 0!==C&&C,F=i.onChange,L=i.onSelect,W=i.onDeselect,A=i.onSearch,E=i.onFocus,I=i.onBlur,B=i.onDropdownVisibleChange,D=i.className,M=void 0===D?"":D,R=i.style,N=i.dropdownClassName,T=void 0===N?"":N,H=i.dropdownStyle,P=i.defaultOpen,O=void 0!==P&&P,X=i.open,K=i.maxTagCount,q=i.tagRender,Y=i.optionRender,V=d().primaryColor,Q=void 0===V?"#FB6011":V,G=n.useState(void 0!==s?s:u?[]:void 0),J=G[0],_=G[1],U=n.useState(O),Z=U[0],$=U[1],ee=n.useState(""),ne=ee[0],te=ee[1],oe=n.useState(-1),ie=oe[0],re=oe[1],le=n.useRef(null),ae=n.useRef(null),de=n.useRef(null),se=n.useState(null),ce=se[0],pe=se[1],ue=void 0!==a,xe=void 0!==X,fe=ue?a:J,he=xe?X:Z,ge="multiple"===u||"tags"===u,me=n.useCallback(function(){if(!fe)return[];var e=Array.isArray(fe)?fe:[fe];return p.filter(function(n){return e.includes(n.value)})},[fe,p]),ve=n.useCallback(function(){return k&&ne?!1===S?p:"function"==typeof S?p.filter(function(e){return S(ne,e)}):p.filter(function(e){var n=String(e.label||"").toLowerCase(),t=ne.toLowerCase();return n.includes(t)}):p},[p,ne,k,S]),ye=n.useMemo(function(){return ve()},[ve]);n.useEffect(function(){if(he&&le.current){var e=function(){var e,n;if(le.current){var t=le.current.getBoundingClientRect(),o=null!==(n=null===(e=de.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==n?n:Math.min(256,Math.max(40,40*ye.length)),i=window.innerHeight-t.bottom,r=t.top,l=i<o+4&&r>i,a=l?t.top+window.scrollY-o-4:t.bottom+window.scrollY+4;pe({top:a,left:t.left+window.scrollX,width:t.width,placement:l?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}pe(null)},[he,ye.length]),n.useEffect(function(){var e=function(e){var n=e.target;le.current&&!le.current.contains(n)&&de.current&&!de.current.contains(n)&&(xe||$(!1),null==B||B(!1),te(""))};if(he)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[he,xe,B]),n.useEffect(function(){if(he){var e=function(e){var n;if("ArrowDown"===e.key)e.preventDefault(),re(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),re(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ie>=0){e.preventDefault();var t=ye[ie];t&&!t.disabled&&be(t)}else"Escape"===e.key&&(e.preventDefault(),xe||$(!1),null==B||B(!1),null===(n=le.current)||void 0===n||n.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[he,ye,ie,xe,B]),n.useEffect(function(){if(ie>=0&&de.current){var e=de.current.querySelectorAll(".aha-select-option")[ie];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ie]);var be=n.useCallback(function(e){var n;if(!e.disabled)if(ge){var t,o=Array.isArray(fe)?fe:[];o.includes(e.value)?(t=o.filter(function(n){return n!==e.value}),null==W||W(e.value,e)):(t=r(r([],o,!0),[e.value],!1),null==L||L(e.value,e)),ue||_(t);var i=p.filter(function(e){return t.includes(e.value)});null==F||F(t,i)}else ue||_(e.value),null==F||F(e.value,e),null==L||L(e.value,e),xe||$(!1),null==B||B(!1),te(""),null===(n=le.current)||void 0===n||n.focus()},[ge,fe,ue,xe,p,F,L,W,B]),we=n.useCallback(function(e,n){if(e.stopPropagation(),ge&&Array.isArray(fe)){var t=fe.filter(function(e){return e!==n}),o=p.find(function(e){return e.value===n});ue||_(t),null==F||F(t,me()),null==W||W(n,o)}},[ge,fe,ue,p,F,W,me]),ke=function(e){e.stopPropagation();var n=ge?[]:void 0;ue||_(n),null==F||F(n,[]),te("")},je={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px",fontSize:"16px",lineHeight:"24px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px",fontSize:"16px",lineHeight:"24px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px",fontSize:"16px",lineHeight:"24px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px",fontSize:"16px",lineHeight:"24px"}},Se=n.useMemo(function(){return me()},[me]),Ce=n.useMemo(function(){return z&&fe&&!f},[z,fe,f]),ze=n.useMemo(function(){return ge?Array.isArray(fe)&&fe.length>0:null!=fe&&""!==fe},[ge,fe]),Fe=n.useMemo(function(){if(!ge||!Array.isArray(fe)||0===fe.length)return null;var t="responsive"===K?Se.slice(0,2):K?Se.slice(0,K):Se,o=K&&Se.length>t.length?Se.length-t.length:0;return e.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[t.map(function(t){var o={label:t.label,value:t.value,closable:!f,onClose:function(){return we({},t.value)}};return q?e.jsx(n.Fragment,{children:q(o)},t.value):e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",backgroundColor:"#F5F5F4",borderRadius:"4px",fontSize:"12px",lineHeight:"18px",color:"#101828",fontFamily:"DM Sans, sans-serif",maxWidth:"100%"},children:[e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.label}),!f&&e.jsx("span",{onClick:function(e){return we(e,t.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},t.value)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,fe,Se,K,f,q]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:le,className:"aha-select ".concat(M),style:o({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":he?Q:"#D7D3D0"),backgroundColor:f?"#FAFAF9":"#FFFFFF",cursor:f?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:je[b].paddingTop,paddingBottom:je[b].paddingBottom,fontSize:je[b].fontSize,lineHeight:je[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},R),onClick:function(){if(!f){var e=!he;xe||$(e),null==B||B(e),e&&k?setTimeout(function(){var e;null===(e=ae.current)||void 0===e||e.focus()},0):te("")}},onFocus:function(e){null==E||E(e)},onBlur:function(e){null==I||I(e)},onTouchStart:function(e){f||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:f?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?Fe||(v?e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:v}):e.jsx("span",{style:{flex:1,minHeight:"24px"}})):k&&he?e.jsx("input",{ref:ae,type:"text",value:ne,onChange:function(e){var n=e.target.value;te(n),null==A||A(n),re(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:f?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:ze?void 0:v,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:ze?f?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:ze?(null===(l=Se[0])||void 0===l?void 0:l.label)||fe:v||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Ce&&e.jsx(function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:ke,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e.jsx(function(n){var t=n.isOpen;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out",flexShrink:0},children:e.jsx("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:he})]})]}),he&&ce&&t.createPortal(e.jsx("div",{ref:de,className:"aha-select-dropdown ".concat(T),style:o({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===ce.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===ce.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},H),children:0===ye.length?e.jsx("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):ye.map(function(n,t){var o=ge?Array.isArray(fe)&&fe.includes(n.value):fe===n.value,i=t===ie;return Y?e.jsx("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&be(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Y(n,{selected:o,focused:i,disabled:n.disabled||!1})},n.value):e.jsxs("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e.jsx("span",{children:n.label}),o&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:Q,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};We.displayName="Select";var Ae=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},Ee=function(n){var t=n.className,o=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:[e.jsx("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},Ie=function(n){var t=n.className,o=n.style;return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:[e.jsx("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},Be=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("path",{d:"M15.8334 10H4.16675M4.16675 10L10.0001 15.8334M4.16675 10L10.0001 4.16669",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},De=function(n){var t=n.className,o=n.style;return e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,style:o,children:e.jsx("path",{d:"M4.16675 10H15.8334M15.8334 10L10.0001 4.16669M15.8334 10L10.0001 15.8334",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})})},Me=function(t){var i=t.current,r=t.defaultCurrent,l=void 0===r?1:r,a=t.total,s=void 0===a?0:a,c=t.pageSize,p=t.defaultPageSize,u=void 0===p?10:p,x=t.showSizeChanger,f=void 0!==x&&x,h=t.pageSizeOptions,g=void 0===h?["10","20","50","100"]:h,m=t.showQuickJumper,v=void 0!==m&&m,y=t.showTotal,b=t.onChange,w=t.onShowSizeChange,k=t.simple,j=void 0!==k&&k,S=t.disabled,C=void 0!==S&&S,z=t.hideOnSinglePage,F=void 0!==z&&z,L=t.className,W=void 0===L?"":L,A=t.style,E=t.size,I=void 0===E?"default":E,B=t.responsive,D=void 0!==B&&B;t.showLessItems;var M=t.itemRender,R=d().primaryColor,N=void 0===R?"#FB6011":R,T=n.useState(l),H=T[0],P=T[1],O=n.useState(u),X=O[0],K=O[1],q=n.useState(""),Y=q[0],V=q[1],Q=null!=i?i:H,G=null!=c?c:X,J=n.useMemo(function(){return Math.ceil(s/G)},[s,G]);n.useEffect(function(){void 0!==i&&P(i)},[i]),n.useEffect(function(){void 0!==c&&K(c)},[c]);var _=function(e){e<1||e>J||e===Q||C||(void 0===i&&P(e),null==b||b(e,G))},U=function(){var e=parseInt(Y,10);e>=1&&e<=J&&(_(e),V(""))};if(F&&J<=1)return null;if(j)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(W),style:A,children:[e.jsx(ue,{onClick:function(){return _(Q-1)},disabled:C||1===Q,type:"default",size:"default"===I?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Be,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",J]}),e.jsx(ue,{onClick:function(){return _(Q+1)},disabled:C||Q===J,type:"default",size:"default"===I?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(De,{})})]});var Z=(Q-1)*G+1,$=Math.min(Q*G,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(W),style:o({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:D?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},A),children:[y&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:y(s,[Z,$])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:M?M(Q-1,"prev",e.jsx(ue,{onClick:function(){return _(Q-1)},disabled:C||1===Q,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Be,{})})):e.jsx(ue,{onClick:function(){return _(Q-1)},disabled:C||1===Q,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Be,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(J<=7)return Array.from({length:J},function(e,n){return n+1});var e=[];if(Q<=4){for(var n=1;n<=5;n++)e.push(n);e.push("jump-next"),e.push(J)}else if(Q>=J-3){e.push(1),e.push("jump-prev");for(n=J-4;n<=J;n++)e.push(n)}else{e.push(1),e.push("jump-prev");for(n=Q-1;n<=Q+1;n++)e.push(n);e.push("jump-next"),e.push(J)}return e}().map(function(n){return function(n){if("number"==typeof n){var t=n===Q,o=e.jsx(ue,{onClick:function(){return _(n)},disabled:C,type:t?"primary":"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,fontWeight:t?500:400,border:t?"1px solid ".concat(N):void 0,boxShadow:"none",borderRadius:"8px"},children:n},n);return M?M(n,"page",o):o}if("jump-prev"===n)return o=e.jsx(ue,{onClick:function(){return _(Math.max(1,Q-5))},disabled:C,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),M?M(Q-5,"jump-prev",o):o;if("jump-next"===n)return o=e.jsx(ue,{onClick:function(){return _(Math.min(J,Q+5))},disabled:C,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),M?M(Q+5,"jump-next",o):o;return null}(n)})}),s>0&&e.jsx(e.Fragment,{children:M?M(Q+1,"next",e.jsx(ue,{onClick:function(){return _(Q+1)},disabled:C||Q===J,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(De,{})})):e.jsx(ue,{onClick:function(){return _(Q+1)},disabled:C||Q===J,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(De,{})})}),f&&e.jsx(We,{value:G,options:g.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return n=Number(e),t=Math.ceil(s/n),o=Q>t?t:Q,void 0===c&&K(n),void 0===i&&P(o),null==w||w(o,n),void(null==b||b(o,n));var n,t,o},disabled:C,size:"small"===I?"small":"medium",style:{minWidth:"small"===I?80:96}}),v&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e.jsx(Le,{type:"number",min:1,value:Y,onChange:function(e){return V(e.target.value)},onPressEnter:U,disabled:C,size:"small"===I?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof v&&v.goButton?e.jsx(ue,{onClick:U,disabled:C,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:v.goButton}):e.jsx(ue,{onClick:U,disabled:C,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},Re=O.body,Ne=K.medium,Te=K.regular;function He(e){return{fontSize:"sm"===e?X.sm:X.md,lineHeight:"sm"===e?q.sm:q.md,gap:"sm"===e?Q:G,hintGap:"md"===e?Y:"0"}}function Pe(e,n){return e?te(n)?ee.default:"0px 0px 0px 2px #ffffff, 0px 0px 0px 4px ".concat(n):"none"}function Oe(e){var n=He(e.size);return{fontSize:n.fontSize,lineHeight:n.lineHeight,fontWeight:Ne,fontFamily:Re,color:e.disabled?w:y,userSelect:"none"}}function Xe(e){var n=He(e);return{fontSize:n.fontSize,lineHeight:n.lineHeight,fontWeight:Te,fontFamily:Re,color:b}}var Ke=function(t){var i=t.checked,r=void 0!==i&&i,l=t.indeterminate,a=void 0!==l&&l,s=t.disabled,c=void 0!==s&&s,p=t.onChange,u=t.className,x=void 0===u?"":u,f=t.style,h=t.children,g=t.size,m=void 0===g?"sm":g,v=t.hint,y=t.isFocused,b=d().primaryColor,w=n.useState(!1),k=w[0],j=w[1],S=n.useState(!1),z=S[0],F=S[1],L=r||a,A=null!=y?y:z,B=function(){c||(null==p||p({target:{checked:!r},currentTarget:{checked:!r}}))},M="sm"===m?"16px":"20px",R="sm"===m?"12px":"14px",N=function(e){return"sm"===e?J:_}(m),P=He(m),O=P.gap,X=P.hintGap,K=function(e){var n=e.disabled,t=e.active,o=e.hovered,i=oe(e.brandColor);return{bg:n?D:t?o?ie:i:o?I:E,border:"1px solid ".concat(n?W:t?o?ie:i:C)}}({disabled:c,active:L,hovered:k,brandColor:b}),q=K.bg,Y=K.border,V=function(e,n){return e&&n?T:H}(c,L),Q=h||v;return e.jsxs("div",{className:"aha-checkbox ".concat(x),role:"checkbox","aria-checked":a?"mixed":r,"aria-disabled":c,tabIndex:c?-1:0,style:o({display:"inline-flex",alignItems:"flex-start",gap:O,cursor:c?"not-allowed":"pointer",outline:"none"},f),onClick:B,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),B())},onMouseEnter:function(){return!c&&j(!0)},onMouseLeave:function(){return j(!1)},onFocus:function(){return!c&&F(!0)},onBlur:function(){return F(!1)},children:[e.jsxs("div",{style:{position:"relative",width:M,height:M,minWidth:M,minHeight:M,flexShrink:0,borderRadius:N,border:Y,backgroundColor:q,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.15s, border-color 0.15s, box-shadow 0.15s",boxSizing:"border-box",boxShadow:Pe(A,b),marginTop:Q?"2px":"0"},children:[e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:R,height:R,color:V,opacity:a?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M2.91675 7H11.0834",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 14 14",fill:"none",style:{position:"absolute",width:R,height:R,color:V,opacity:r&&!a?1:0,transition:"opacity 0.15s",pointerEvents:"none"},children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),Q&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:X},children:[h&&e.jsx("span",{style:Oe({size:m,disabled:c}),children:h}),v&&e.jsx("span",{style:Xe(m),onClick:function(e){return e.stopPropagation()},children:v})]})]})};Ke.displayName="Checkbox";var qe=function(n){var t=n.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},Ye=function(n){var t=n.loading,o=n.spinColor;if(!t)return null;var i=!0===t?e.jsx(qe,{color:o}):t;return e.jsx("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:i})},Ve=function(e,n){return"string"==typeof n?null==e?void 0:e[n]:n.reduce(function(e,n){return null==e?void 0:e[n]},e)},Qe=function(e,n){var t,o;return"function"==typeof n?n(e):"string"==typeof n?null!==(t=Ve(e,n))&&void 0!==t?t:"":null!==(o=e.key)&&void 0!==o?o:""},Ge=function(n){var t=n.order,o=d().primaryColor;return"ascend"===t?e.jsx(Ie,{style:{color:o}}):"descend"===t?e.jsx(Ee,{style:{color:o}}):e.jsx(Ae,{})};exports.default=function(t){var l,a,s,c,p=t.columns,u=void 0===p?[]:p,x=t.dataSource,f=void 0===x?[]:x,h=t.rowKey,g=void 0===h?"key":h,m=t.rowSelection,v=t.pagination,y=void 0!==v&&v,b=t.size,w=void 0===b?"middle":b,k=t.bordered,j=void 0!==k&&k,S=t.loading,C=void 0!==S&&S,z=t.locale,F=t.showHeader,L=void 0===F||F,W=t.title,A=t.footer,E=t.summary,I=t.scroll,B=t.tableLayout,D=void 0===B?"auto":B,M=t.onChange,R=t.onSorterChange,N=t.onPaginationChange,T=t.onRow,H=t.className,P=void 0===H?"":H,O=t.innerClassName,X=void 0===O?"":O,K=t.style,q=t.expandable,Y=t.rowClassName,V=t.onHeaderRow;t.sticky;var Q=i(t,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),G=d().primaryColor||"#FB6011",J=n.useState((null==m?void 0:m.selectedRowKeys)||(null==m?void 0:m.defaultSelectedRowKeys)||[]),_=J[0],U=J[1];n.useEffect(function(){void 0!==(null==m?void 0:m.selectedRowKeys)&&U(m.selectedRowKeys)},[null==m?void 0:m.selectedRowKeys]);var Z=n.useState(new Map),$=Z[0],ee=Z[1],ne=n.useState((null==q?void 0:q.defaultExpandedRowKeys)||[]),te=ne[0],oe=ne[1],ie=n.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),re=ie[0],le=ie[1],ae=n.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),de=ae[0],se=ae[1];n.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&le(y.current),void 0!==y.pageSize&&se(y.pageSize))},[y]);var ce=n.useState(null),pe=ce[0],ue=ce[1],xe=n.useState(null),fe=xe[0],he=xe[1],ge=n.useState(!1),me=ge[0],ve=ge[1],ye=n.useRef(null),be=n.useRef(null);n.useEffect(function(){var e=function(){ve(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var we=n.useCallback(function(e,n){var t,o,i,l=null===(t=null==m?void 0:m.getCheckboxProps)||void 0===t?void 0:t.call(m,e);if(!(null==l?void 0:l.disabled)){var a,d=Qe(e,g);a="radio"===(null==m?void 0:m.type)?n?[d]:[]:n?r(r([],_,!0),[d],!1):_.filter(function(e){return e!==d}),U(a);var s=f.filter(function(e){return a.includes(Qe(e,g))});null===(o=null==m?void 0:m.onChange)||void 0===o||o.call(m,a,s),null===(i=null==m?void 0:m.onSelect)||void 0===i||i.call(m,e,n,s,new Event("select"))}},[_,g,m,f]),ke=n.useCallback(function(e,n){var t,o,i=n.filter(function(e){var n;return!(null===(n=null==m?void 0:m.getCheckboxProps)||void 0===n?void 0:n.call(m,e).disabled)}).map(function(e){return Qe(e,g)}),r=e?i:[];U(r);var l=f.filter(function(e){return r.includes(Qe(e,g))}),a=e?n.filter(function(e){var n;return!(null===(n=null==m?void 0:m.getCheckboxProps)||void 0===n?void 0:n.call(m,e).disabled)}):[];null===(t=null==m?void 0:m.onChange)||void 0===t||t.call(m,r,l),null===(o=null==m?void 0:m.onSelectAll)||void 0===o||o.call(m,e,l,a)},[g,m,f]),je=n.useCallback(function(e,n){var t=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(t){var o=new Map($);null===n?o.delete(t):o.set(t,n),ee(o);var i=Array.from(o.entries()).map(function(n){var t=n[0],o=n[1];return{column:u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t})||e,order:o,field:t,columnKey:t}}),r={column:e,order:n,field:t,columnKey:t};e.onSorterChange&&e.onSorterChange(r),R&&R(1===i.length?i[0]:i),M&&M({current:re,pageSize:de},{},1===i.length?i[0]:i,{currentDataSource:f,action:"sort"})}},[$,M,R,re,de,f,u]);n.useCallback(function(e,n){var t,o,i,l=Qe(e,g);i=n?r(r([],te,!0),[l],!1):te.filter(function(e){return e!==l}),oe(i),null===(t=null==q?void 0:q.onExpand)||void 0===t||t.call(q,n,e),null===(o=null==q?void 0:q.onExpandedRowsChange)||void 0===o||o.call(q,i)},[te,g,q]);var Se,Ce=n.useCallback(function(){var e=r([],f,!0);return $.size>0&&e.sort(function(e,n){for(var t=function(t,o){var i=u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t});if(!i)return"continue";var r=0;if("function"==typeof i.sorter)r=i.sorter(e,n);else if(!0===i.sorter){var l=Ve(e,i.dataIndex||t),a=Ve(n,i.dataIndex||t);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===o?r:-r}:void 0},o=0,i=Array.from($.entries());o<i.length;o++){var r=i[o],l=t(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[f,$,u]),ze=Ce(),Fe=Boolean(y&&"object"==typeof y&&void 0!==y.total),Le=n.useMemo(function(){if(!1===y||!y)return ze;if(Fe)return ze;var e=(re-1)*de,n=e+de;return ze.slice(e,n)},[ze,re,de,y,Fe]),We=n.useCallback(function(e,n){var t,o,i=null!=n?n:de;if(le(e),n&&se(n),N&&N(e,i),y&&"object"==typeof y&&(null===(t=y.onChange)||void 0===t||t.call(y,e,n),n&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,n))),M){var r=Array.from($.entries()).map(function(e){var n=e[0],t=e[1];return{column:u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n}),order:t,field:n,columnKey:n}});M({current:e,pageSize:i},{},1===r.length?r[0]:r,{currentDataSource:ze,action:"paginate"})}},[y,N,M,de,$,u,ze]),Ae=n.useCallback(function(e,n,t){var o=Ve(n,e.dataIndex||"");return e.render?e.render(o,n,t):o},[]),Ee=n.useCallback(function(e,n,t){if(n){var o=!0===n?"left":n,i=0;if("left"===o){if(m&&("left"===m.fixed||!0===m.fixed))i+="number"==typeof m.columnWidth?m.columnWidth:"string"==typeof m.columnWidth?parseInt(m.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=u[r]).fixed||!0===l.fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return i}if("right"===o){for(r=e+1;r<u.length;r++){var l;if("right"===(l=u[r]).fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(m&&"right"===m.fixed)i+="number"==typeof m.columnWidth?m.columnWidth:"string"==typeof m.columnWidth?parseInt(m.columnWidth):60;return i}}},[u,m]),Ie=n.useCallback(function(){if(!L)return null;var n,t,i,r,l=u.map(function(n,t){var i,r=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||t,l=$.get(r)||null,a=Ee(t,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("th",o({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,right:"right"===n.fixed?void 0!==a?"".concat(a,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(i=n.onHeaderCell)||void 0===i?void 0:i.call(n,n))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:l,sortColumn:n}):n.title}),n.sorter&&e.jsx("button",{onClick:function(){je(n,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:e.jsx(Ge,{order:l||void 0})})]})}),r)});if(m){var a="number"==typeof m.columnWidth?"".concat(m.columnWidth,"px"):"string"==typeof m.columnWidth?m.columnWidth:"60px",d=e.jsx("th",{style:{width:a,position:m.fixed?"sticky":"relative",left:"left"===m.fixed||!0===m.fixed?"0px":void 0,right:"right"===m.fixed?"0px":void 0,zIndex:m.fixed?"left"===m.fixed||!0===m.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!m.hideSelectAll&&"radio"!==m.type&&(n=Le.filter(function(e){var n;return!(null===(n=m.getCheckboxProps)||void 0===n?void 0:n.call(m,e).disabled)}),t=n.map(function(e){return Qe(e,g)}),i=n.length>0&&t.every(function(e){return _.includes(e)}),r=t.some(function(e){return _.includes(e)}),e.jsx(Ke,{checked:i,indeterminate:r&&!i,onChange:function(e){return ke(e.target.checked,Le)}})),m.columnTitle&&e.jsx("span",{style:{marginLeft:m.hideSelectAll?0:"8px"},children:m.columnTitle})]})},"selection");l.unshift(d)}var s=null==V?void 0:V(u,0);return e.jsx("thead",{ref:be,children:e.jsx("tr",o({},s||{},{children:l}))})},[u,L,$,m,_,Le,g,je,ke,z,V,Ee]),Be=n.useCallback(function(e){ue(e)},[]),De=n.useCallback(function(e,n){e.preventDefault(),he(n)},[]),Re=n.useCallback(function(e,n){if(e.preventDefault(),null===pe||pe===n)return ue(null),void he(null);var t=r([],Le,!0),o=t[pe];t.splice(pe,1),t.splice(n,0,o),ue(null),he(null)},[pe,Le]),Ne=n.useCallback(function(){ue(null),he(null)},[]),Te=n.useCallback(function(){var n=null==z?void 0:z.emptyText,t="function"==typeof n?n():void 0!==n?n:"No data",o=u.length+(m?1:0);return e.jsx("tr",{className:"aha-table-placeholder",children:e.jsx("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:t})})},[null==z?void 0:z.emptyText,u.length,m]),He=n.useCallback(function(){return 0===Le.length?Te():Le.map(function(t,i){var r,l=Qe(t,g),a=_.includes(l),d=te.includes(l),s=(null==T?void 0:T(t,i))||{},c=i===Le.length-1;return e.jsxs(n.Fragment,{children:[e.jsxs("tr",o({className:"".concat("function"==typeof Y?Y(t,i):Y||""," ").concat(pe===i?"dragging":""," ").concat(fe===i?"drag-over":""),draggable:!0,onDragStart:function(){return Be(i)},onDragOver:function(e){return De(e,i)},onDrop:function(e){return Re(e,i)},onDragEnd:Ne,style:o({cursor:"move",opacity:pe===i?.5:1,backgroundColor:fe===i?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){pe!==i&&fe!==i&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){pe!==i&&fe!==i&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[m&&e.jsx("td",{style:{width:"number"==typeof m.columnWidth?"".concat(m.columnWidth,"px"):"string"==typeof m.columnWidth?m.columnWidth:"60px",position:m.fixed?"sticky":"relative",left:"left"===m.fixed||!0===m.fixed?"0px":void 0,right:"right"===m.fixed?"0px":void 0,zIndex:m.fixed?"left"===m.fixed||!0===m.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Ke,{checked:a,onChange:function(e){return we(t,e.target.checked)},disabled:null===(r=m.getCheckboxProps)||void 0===r?void 0:r.call(m,t).disabled})})}),u.map(function(n,r){var l,a=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||r,d=(null===(l=n.onCell)||void 0===l?void 0:l.call(n,t,i))||{},s=Ee(r,n.fixed,!1),p=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e.jsx("td",o({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:o({width:p,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:p||void 0,maxWidth:p,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,right:"right"===n.fixed?void 0!==s?"".concat(s,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:n.align||"left"},d.style),colSpan:n.colSpan,rowSpan:n.rowSpan},d,{children:Ae(n,t,i)}),a)})]})),(null==q?void 0:q.expandedRowRender)&&d&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(m?1:0),children:q.expandedRowRender(t,i,0,!0)})})]},l)})},[Le,g,_,te,m,u,T,Y,we,Ae,q,pe,fe,Be,De,Re,Ne,Ee,Te]),Pe=function(){var n;if(!1===y||!y)return null;var t=null!==(n=y.total)&&void 0!==n?n:ze.length,o=y.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e.jsx(Me,{current:re,total:t,pageSize:de,showSizeChanger:y.showSizeChanger,pageSizeOptions:y.pageSizeOptions,showQuickJumper:y.showQuickJumper,showTotal:y.showTotal,onChange:We,onShowSizeChange:We,simple:y.simple,responsive:y.responsive,size:"small"===w?"small":"default"})})},Oe=n.useMemo(function(){return u.some(function(e){return e.fixed})||m&&m.fixed},[u,m]),Xe=n.useMemo(function(){return u.every(function(e){return e.width})&&(!m||m.columnWidth)},[u,m]),qe=n.useMemo(function(){if(null==I?void 0:I.x){if("number"==typeof I.x)return I.x;if(!0===I.x)return u.reduce(function(e,n){return e+(n.width?"number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0:150)},0)+(m?"number"==typeof m.columnWidth?m.columnWidth:parseInt(String(m.columnWidth||"60").replace("px",""))||60:0)}if(Oe)return u.reduce(function(e,n){return n.fixed&&n.width?e+("number"==typeof n.width?n.width:parseInt(String(n.width).replace("px",""))||0):e},0)+(m&&m.fixed&&m.columnWidth?"number"==typeof m.columnWidth?m.columnWidth:parseInt(String(m.columnWidth).replace("px",""))||60:0)},[u,null==I?void 0:I.x,m,Oe]),Je=n.useMemo(function(){return"fixed"===D||Oe||Xe||u.some(function(e){return e.width})?"fixed":D},[D,Oe,Xe,u]),_e=o(o({width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Je,backgroundColor:"white"},j&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=o({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==I?void 0:I.y)?"".concat(I.y,"px"):void 0,borderRadius:"8px"},K);if(me)return e.jsxs("div",o({ref:ye,className:"aha-table aha-table-mobile-wrapper ".concat(P),style:Ue,"aria-busy":!!C||void 0},Q,{children:[W&&e.jsx("div",{style:{marginBottom:"16px"},children:W(ze)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&Pe(),(Se="function"==typeof(null==z?void 0:z.emptyText)?z.emptyText():void 0!==(null==z?void 0:z.emptyText)?z.emptyText:"No data",0===Le.length?e.jsx("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Se}):e.jsx("div",{className:"aha-table-mobile",children:Le.map(function(n,t){var o,i=Qe(n,g),r=_.includes(i);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(r?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:r?"#e6f7ff":"white"},children:[m&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(Ke,{checked:r,onChange:function(e){return we(n,e.target.checked)},disabled:null===(o=m.getCheckboxProps)||void 0===o?void 0:o.call(m,n).disabled})}),u.map(function(o){var i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),r=Ve(n,o.dataIndex||""),l=o.render?o.render(r,n,t):r;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})})),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&Pe(),e.jsx(Ye,{loading:C,spinColor:G})]}));var Ze={position:"relative",overflowX:(null==I?void 0:I.x)||Oe?"auto":"visible",overflowY:(null==I?void 0:I.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==I?void 0:I.x)?"100%":"number"==typeof(null==I?void 0:I.x)?"".concat(I.x,"px"):void 0,maxHeight:"number"==typeof(null==I?void 0:I.y)?"".concat(I.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",o({ref:ye,className:"aha-table ".concat(P),style:Ue,"aria-busy":!!C||void 0},Q,{children:[W&&e.jsx("div",{style:{marginBottom:"16px"},children:W(ze)}),y&&"object"==typeof y&&(null===(s=y.position)||void 0===s?void 0:s.startsWith("top"))&&Pe(),e.jsx("div",{style:Ze,children:e.jsx("div",{style:{width:"100%",minWidth:qe?"".concat(qe,"px"):"100%",display:"block"},children:e.jsxs("table",{style:_e,className:X,children:[Ie(),e.jsx("tbody",{children:He()}),E&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(m?1:0),children:E(ze)})})})]})})}),A&&e.jsx("div",{style:{marginTop:"16px"},children:A(ze)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&Pe(),e.jsx(Ye,{loading:C,spinColor:G})]}))};
|
|
2
2
|
//# sourceMappingURL=Table.js.map
|