aha-components 1.7.11 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +10 -0
  2. package/dist/Avatar.esm.js +2 -0
  3. package/dist/Avatar.esm.js.map +1 -0
  4. package/dist/Avatar.js +2 -0
  5. package/dist/Avatar.js.map +1 -0
  6. package/dist/Badge.esm.js +2 -0
  7. package/dist/Badge.esm.js.map +1 -0
  8. package/dist/Badge.js +2 -0
  9. package/dist/Badge.js.map +1 -0
  10. package/dist/Checkbox.esm.js +1 -1
  11. package/dist/Checkbox.esm.js.map +1 -1
  12. package/dist/Checkbox.js +1 -1
  13. package/dist/Checkbox.js.map +1 -1
  14. package/dist/Radio.esm.js +1 -1
  15. package/dist/Radio.esm.js.map +1 -1
  16. package/dist/Radio.js +1 -1
  17. package/dist/Radio.js.map +1 -1
  18. package/dist/Table.esm.js +1 -1
  19. package/dist/Table.esm.js.map +1 -1
  20. package/dist/Table.js +1 -1
  21. package/dist/Table.js.map +1 -1
  22. package/dist/Tag.esm.js +1 -1
  23. package/dist/Tag.esm.js.map +1 -1
  24. package/dist/Tag.js +1 -1
  25. package/dist/Tag.js.map +1 -1
  26. package/dist/Textarea.esm.js +1 -1
  27. package/dist/Textarea.esm.js.map +1 -1
  28. package/dist/Textarea.js +1 -1
  29. package/dist/Textarea.js.map +1 -1
  30. package/dist/components/Avatar/Avatar.stories.d.ts +12 -0
  31. package/dist/components/Avatar/index.d.ts +42 -0
  32. package/dist/components/Badge/Badge.stories.d.ts +15 -0
  33. package/dist/components/Badge/index.d.ts +71 -0
  34. package/dist/components/Checkbox/Checkbox.stories.d.ts +5 -4
  35. package/dist/components/Checkbox/index.d.ts +6 -0
  36. package/dist/components/Radio/Radio.stories.d.ts +6 -4
  37. package/dist/components/Radio/index.d.ts +6 -0
  38. package/dist/components/Tag/Tag.stories.d.ts +5 -8
  39. package/dist/components/Tag/index.d.ts +24 -2
  40. package/dist/components/Textarea/Textarea.stories.d.ts +2 -0
  41. package/dist/components/Textarea/Textarea.test.d.ts +1 -0
  42. package/dist/components/Textarea/index.d.ts +12 -0
  43. package/dist/design-tokens/theme.css +26 -0
  44. package/dist/design-tokens/theme.tailwind4.css +26 -0
  45. package/dist/index.css +3848 -0
  46. package/dist/index.d.ts +153 -4
  47. package/dist/index.esm.css +3848 -0
  48. package/dist/index.esm.js +1 -1
  49. package/dist/index.esm.js.map +1 -1
  50. package/dist/index.js +1 -1
  51. package/dist/index.js.map +1 -1
  52. package/dist/theme.css +26 -0
  53. package/dist/tokens.d.ts +28 -0
  54. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c={primaryColor:"#FB6011"},d=t.createContext(c),u=function(){var e=t.useContext(d);return e||c},p={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},f={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",default:"secondary"},h={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}},x=function(t){var n=t.size,o=t.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: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"})]})]})},g=function(n){var o=n.children,a=n.type,l=void 0===a?"secondary":a,s=n.size,c=void 0===s?"md":s,d=n.disabled,g=void 0!==d&&d,v=n.loading,m=void 0!==v&&v,y=n.iconOnly,b=n.focused,w=void 0!==b&&b,C=n.onClick,F=n.htmlType,k=void 0===F?"button":F,j=n.className,S=void 0===j?"":j,D=n.style,M=n.icon,E=n.iconPosition,A=void 0===E?"left":E,L=i(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),z=u().primaryColor,T=t.useState(!1),B=T[0],R=T[1],W=t.useState(!1),N=W[0],I=W[1],H=f[l]||"secondary",Y=h[p[c]||"md"],O=null!=y?y:!!M&&null==o,P="link-color"===H||"link-gray"===H||"destructive-link"===H,V=g||m,q=w,X=z,_=function(){if(g)return"primary"===H||"secondary"===H||"destructive-primary"===H||"destructive-secondary"===H?{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=B||N;return"primary"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"}}(),Z=function(){if(q)return"destructive-primary"===H||"destructive-secondary"===H||"destructive-tertiary"===H||"destructive-link"===H?"destructive-primary"===H||"destructive-secondary"===H?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===H||"secondary"===H?"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)"}(),K=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Y.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:Y.fontSize,lineHeight:"".concat(Y.lineHeight,"px"),cursor:V?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:_.bg,color:_.color,border:_.border,boxShadow:null!=Z?Z:_.boxShadow,textDecoration:_.textDecoration},D);P?(K.borderRadius="4px",K.overflow="hidden",O?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX)):(K.borderRadius="var(--radius-md, 8px)",O?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX));var G=function(){return m?e.jsx(x,{size:Y.iconSize,color:_.iconColor}):M?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Y.iconSize,height:Y.iconSize,color:_.iconColor,flexShrink:0},children:M}):null},J=m||M&&"left"===A,U=!m&&M&&"right"===A;return e.jsxs("button",r({type:k,className:["aha-button","aha-button--".concat(H),"aha-button--".concat(p[c]||"md"),O&&"aha-button--icon-only",V&&"aha-button--disabled",m&&"aha-button--loading",q&&"aha-button--focused",S].filter(Boolean).join(" "),disabled:V,onClick:function(e){V?e.preventDefault():null==C||C(e)},onMouseEnter:function(){return!V&&R(!0)},onMouseLeave:function(){R(!1),I(!1)},onMouseDown:function(){return!V&&I(!0)},onMouseUp:function(){return I(!1)},style:K},L,{children:[J&&G(),!O&&o,U&&G(),O&&!M&&!m&&o]}))};g.displayName="Button";var v={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},m=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),y={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},b=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},w=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),C=new w,F=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=C.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=C.subscribe(function(){var e=C.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=o.filter(function(e){return"top-left"===e.props.position}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),c=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(k,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(k,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(k,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e.jsx(k,r({},t),t.id)})})]})},k=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),c=s[0],d=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,h=r.duration,x=void 0===h?3e3:h,g=r.icon,v=r.action,m=r.showClose,w=void 0===m||m,F=r.onClose,k=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:y.success};case"error":return{bgColor:"#E7000B",defaultIcon:y.error};case"question":return{bgColor:"#1C1917",defaultIcon:y.question};default:return{bgColor:"#1447E6",defaultIcon:y.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(x>0){var e=setTimeout(function(){S()},x);return function(){return clearTimeout(e)}}},[x,o]);var S=t.useCallback(function(){d(!0),setTimeout(function(){C.removeToast(o),null==F||F()},300)},[o,F]),D=t.useCallback(function(){null==k||k()},[k]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!c?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!c?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:D,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:j.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||j.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),v&&e.jsx("div",{style:{marginTop:"12px"},children:v})]}),w&&e.jsx("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(b,{})})]})})},j=function(e){return console.log("Toast: 调用 toast 函数",e),E(),setTimeout(function(){var t=C.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},S=null,D=null,M=!1,E=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(M)console.log("Toast: 容器正在初始化中,跳过");else if(S)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),M=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),S=t,void(M=!1);console.log("Toast: 创建容器元素"),(S=document.createElement("div")).id="aha-toast-container",document.body.appendChild(S),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(F,{})),console.log("Toast: 容器渲染完成"),M=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(F,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}M=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),M=!1})}}catch(e){console.error("Toast: 创建容器失败",e),M=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},A={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},L={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},z=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,c=void 0!==s&&s,d=n.error,p=void 0!==d&&d,f=n.readOnly,h=void 0!==f&&f,x=n.prefix,g=n.suffix,v=n.allowClear,m=void 0!==v&&v,y=n.onClear,b=n.className,w=void 0===b?"":b,C=n.style,F=n.type,k=void 0===F?"text":F,j=n.placeholder,S=n.value,D=n.defaultValue,M=n.onChange,E=n.onFocus,A=n.onBlur,L=n.onPressEnter,z=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),T=u().primaryColor,B=void 0===T?"#FB6011":T,R=t.useRef(null),W=t.useState(D||S||""),N=W[0],I=W[1],H=t.useState(!1),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(R.current):o&&(o.current=R.current)},[o]);var P=void 0!==S,V=P?S:N,q=function(e){var t;e.stopPropagation(),P||I("");null==M||M({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},X=m&&V&&!c,_={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},Z=g||X?"40px":"12px",K=r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":Y?B:"#D7D3D0"),backgroundColor:c||h?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:Z,paddingTop:_[l].paddingTop,paddingBottom:_[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},C);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\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"] {\n -moz-appearance: textfield;\n }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[x&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e.jsx("input",r({ref:R,type:k,value:V,placeholder:j,disabled:c,readOnly:h,onChange:function(e){P||I(e.target.value),null==M||M(e)},onFocus:function(e){O(!0),null==E||E(e)},onBlur:function(e){O(!1),null==A||A(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=z.onKeyDown)||void 0===t||t.call(z,e)},style:K,autoComplete:z.autoComplete||"off",autoCorrect:z.autoCorrect||"off",autoCapitalize:z.autoCapitalize||"off",spellCheck:z.spellCheck||!1},z)),(g||X)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[X&&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:q,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"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});z.displayName="Input";var T=function(o){var i,a=o.value,l=o.defaultValue,c=o.options,d=void 0===c?[]:c,p=o.mode,f=o.disabled,h=void 0!==f&&f,x=o.error,g=void 0!==x&&x,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,C=void 0!==w&&w,F=o.filterOption,k=void 0===F||F,j=o.allowClear,S=void 0!==j&&j,D=o.onChange,M=o.onSelect,E=o.onDeselect,A=o.onSearch,L=o.onFocus,z=o.onBlur,T=o.onDropdownVisibleChange,B=o.className,R=void 0===B?"":B,W=o.style,N=o.dropdownClassName,I=void 0===N?"":N,H=o.dropdownStyle,Y=o.defaultOpen,O=void 0!==Y&&Y,P=o.open,V=o.maxTagCount,q=o.tagRender,X=o.optionRender,_=u().primaryColor,Z=void 0===_?"#FB6011":_,K=t.useState(void 0!==l?l:p?[]:void 0),G=K[0],J=K[1],U=t.useState(O),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),ce=t.useState(null),de=ce[0],ue=ce[1],pe=void 0!==a,fe=void 0!==P,he=pe?a:G,xe=fe?P:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return d.filter(function(t){return e.includes(t.value)})},[he,d]),me=t.useCallback(function(){return C&&te?!1===k?d:"function"==typeof k?d.filter(function(e){return k(te,e)}):d.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):d},[d,te,C,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-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)},[xe,ye.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==T||T(!1),ne(""))};if(xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[xe,fe,T]),t.useEffect(function(){if(xe){var e=function(e){var t;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==T||T(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,re,fe,T]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(he)?he:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==E||E(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==M||M(e.value,e)),pe||J(n);var r=d.filter(function(e){return n.includes(e.value)});null==D||D(n,r)}else pe||J(e.value),null==D||D(e.value,e),null==M||M(e.value,e),fe||$(!1),null==T||T(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,d,D,M,E,T]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=d.find(function(e){return e.value===t});pe||J(n),null==D||D(n,ve()),null==E||E(t,o)}},[ge,he,pe,d,D,E,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==D||D(t,[]),ne("")},Fe={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"}},ke=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return S&&he&&!h},[S,he,h]),Se=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),De=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===V?ke.slice(0,2):V?ke.slice(0,V):ke,o=V&&ke.length>n.length?ke.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 o={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},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}),!h&&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)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,he,ke,V,h,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:r({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":xe?Z:"#D7D3D0"),backgroundColor:h?"#FAFAF9":"#FFFFFF",cursor:h?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Fe[b].paddingTop,paddingBottom:Fe[b].paddingBottom,fontSize:Fe[b].fontSize,lineHeight:Fe[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},W),onClick:function(){if(!h){var e=!xe;fe||$(e),null==T||T(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},onTouchStart:function(e){h||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:h?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?De||(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"}})):C&&xe?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==A||A(t),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:h?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Se?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Se?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Se?(null===(i=ke[0])||void 0===i?void 0:i.label)||he:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&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:Ce,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(t){var n=t.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:xe})]})]}),xe&&de&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(I),style:r({position:"absolute",top:"".concat(de.top,"px"),left:"".concat(de.left,"px"),width:"".concat(de.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"===de.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===de.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(t,n){var o=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,r=n===re;return X?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:X(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.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:t.label}),o&&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:Z,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};T.displayName="Select";var B=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},R=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},W=function(t){var n=t.className,o=t.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: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"})})},N=function(t){var n=t.className,o=t.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: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"})]})},I=function(t){var n=t.className,o=t.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: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"})]})},H=function(t){var n=t.className,o=t.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: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"})})},Y=function(t){var n=t.className,o=t.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: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"})})},O=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},P=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,d=n.defaultPageSize,p=void 0===d?10:d,f=n.showSizeChanger,h=void 0!==f&&f,x=n.pageSizeOptions,v=void 0===x?["10","20","50","100"]:x,m=n.showQuickJumper,y=void 0!==m&&m,b=n.showTotal,w=n.onChange,C=n.onShowSizeChange,F=n.simple,k=void 0!==F&&F,j=n.disabled,S=void 0!==j&&j,D=n.hideOnSinglePage,M=void 0!==D&&D,E=n.className,A=void 0===E?"":E,L=n.style,B=n.size,R=void 0===B?"default":B,W=n.responsive,N=void 0!==W&&W;n.showLessItems;var I=n.itemRender,O=u().primaryColor,P=void 0===O?"#FB6011":O,V=t.useState(a),q=V[0],X=V[1],_=t.useState(p),Z=_[0],K=_[1],G=t.useState(""),J=G[0],U=G[1],Q=null!=o?o:q,$=null!=c?c:Z,ee=t.useMemo(function(){return Math.ceil(s/$)},[s,$]);t.useEffect(function(){void 0!==o&&X(o)},[o]),t.useEffect(function(){void 0!==c&&K(c)},[c]);var te=function(e){e<1||e>ee||e===Q||S||(void 0===o&&X(e),null==w||w(e,$))},ne=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(te(e),U(""))};if(M&&ee<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(A),style:L,children:[e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Y,{})})]});var oe=(Q-1)*$+1,re=Math.min(Q*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(A),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:N?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},L),children:[b&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:b(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:I?I(Q-1,"prev",e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})})):e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e.jsx(g,{onClick:function(){return te(t)},disabled:S,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(P):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return I?I(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(g,{onClick:function(){return te(Math.max(1,Q-5))},disabled:S,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),I?I(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(g,{onClick:function(){return te(Math.min(ee,Q+5))},disabled:S,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),I?I(Q+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:I?I(Q+1,"next",e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Y,{})})):e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(Y,{})})}),h&&e.jsx(T,{value:$,options:v.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=Q>n?n:Q,void 0===c&&K(t),void 0===o&&X(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:S,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),y&&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(z,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:S,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof y&&y.goButton?e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},V=function(t){var n=t.checked,o=void 0!==n&&n,i=t.indeterminate,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l,c=t.onChange,d=t.className,p=void 0===d?"":d,f=t.style,h=t.children,x=u().primaryColor,g=o||a,v=s?"#FAFAF9":g?x:"white",m=s?"#FAFAF9":g?x:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},f),onClick:function(e){s||(null==c||c({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:g?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:a?e.jsx(R,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(B,{style:{width:"14px",height:"14px",display:"block"}})})}),h&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:s?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:h}),e.jsx("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=a)},onChange:c,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};V.displayName="Checkbox";var q=function(t){var n=t.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"})]})]})},X=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(q,{color:o}):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})},_=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},Z=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=_(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},K=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(I,{style:{color:o}}):"descend"===n?e.jsx(N,{style:{color:o}}):e.jsx(W,{})},G=function(t){var n=t.checked,o=void 0!==n&&n,i=t.disabled,a=void 0!==i&&i,l=t.onChange,s=t.className,c=void 0===s?"":s,d=t.style,p=t.children,f=t.value,h=t.name,x=u().primaryColor,g=void 0===x?"#FB6011":x,v=a?"#FAFAF9":o?g:"white",m=a?"#FAFAF9":o?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(c),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},d),onClick:function(e){a||(null==l||l({target:{checked:!o,value:f},currentTarget:{checked:!o,value:f}}))},children:[e.jsx("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:v,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e.jsx("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:o?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),p&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:p}),e.jsx("input",{type:"radio",checked:o,onChange:l,disabled:a,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};G.displayName="Radio";var J=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,c=void 0!==s&&s,d=n.readOnly,p=void 0!==d&&d,f=n.showCount,h=void 0!==f&&f,x=n.maxLength,g=n.className,v=void 0===g?"":g,m=n.style,y=n.placeholder,b=n.value,w=n.defaultValue,C=n.rows,F=void 0===C?3:C,k=n.autoSize,j=void 0!==k&&k,S=n.onChange,D=n.onFocus,M=n.onBlur,E=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),A=u().primaryColor,L=void 0===A?"#FB6011":A,z=t.useRef(null),T=t.useState(w||b||""),B=T[0],R=T[1],W=t.useState(!1),N=W[0],I=W[1],H=t.useState(void 0),Y=H[0],O=H[1];t.useEffect(function(){"function"==typeof o?o(z.current):o&&(o.current=z.current)},[o]);var P=void 0!==b,V=P?b:B,q=String(V||"").length;t.useEffect(function(){if(j&&z.current){var e=z.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),O(l)}},[V,j]);var X=r(r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":N?L:"#D7D3D0"),backgroundColor:l||p?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:j?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==Y&&j?{height:"".concat(Y,"px")}:{}),m);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n "}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(v),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e.jsx("textarea",r({ref:z,value:V,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){P||R(e.target.value),null==S||S(e)},onFocus:function(e){I(!0),null==D||D(e)},onBlur:function(e){I(!1),null==M||M(e)},style:X,autoComplete:E.autoComplete||"off",autoCorrect:E.autoCorrect||"off",autoCapitalize:E.autoCapitalize||"off",spellCheck:E.spellCheck||!1},E)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[q," / ",x]}):e.jsx("span",{children:q})})]})]})});J.displayName="Textarea";var U=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,c=n.onChange,d=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,h=n.size,x=void 0===h?"default":h,g=n.loading,v=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,F=t.useState(a),k=F[0],j=F[1],S=void 0!==o,D=S?o:k,M={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],E=D||v,A=s?"#E7E5E4":E?C:"#F5F5F4",L=E?"calc(100% - ".concat(M.thumbSize," - ").concat(M.thumbOffset,")"):M.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":D,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!D;S||j(t),null==c||c(t,e),null==d||d(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:E?"flex-end":"flex-start",width:M.width,height:M.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:A,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:E?"6px":"auto",right:E?"auto":"6px",fontSize:M.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:E?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:M.thumbSize,height:M.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===x?"8":"10",height:"small"===x?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};U.displayName="Switch";var Q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],$=["January","February","March","April","May","June","July","August","September","October","November","December"],ee=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),$[o]).replace(new RegExp("","g"),Q[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},te=function(e,t){return new Date(e,t+1,0).getDate()},ne=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},oe=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},re=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,c=o.error,d=void 0!==c&&c,p=o.placeholder,f=void 0===p?"Select date":p,h=o.startPlaceholder,x=void 0===h?"Start date":h,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,y=void 0===m?"medium":m,b=o.allowClear,w=void 0!==b&&b,C=o.format,F=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,k=o.onFocus,j=o.onBlur,S=o.onOpenChange,D=o.className,M=void 0===D?"":D,E=o.style,A=o.dropdownClassName,L=void 0===A?"":A,z=o.dropdownStyle,T=o.defaultOpen,B=void 0!==T&&T,R=o.open,W=o.minDate,N=o.maxDate,I=o.separator,H=void 0===I?" - ":I,Y=o.presetRanges,O=void 0!==Y&&Y,P=o.calendarCount,V=void 0===P?1:P,q=o.showApplyCancel,X=void 0!==q&&q,_=o.applyText,Z=void 0===_?"Apply":_,K=o.cancelText,G=void 0===K?"Cancel":K,J=o.onApply,U=o.onCancel,Q=o.showSelectedRange,re=void 0!==Q&&Q,ie=o.startSelectedRangeText,ae=void 0===ie?"Select dates":ie,le=o.endSelectedRangeText,se=void 0===le?"Select dates":le,ce=o.rangeDisplayMode,de=void 0===ce?"range":ce,ue=u().primaryColor,pe=void 0===ue?"#FB6011":ue,fe="range"===a,he=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),xe=he[0],ge=he[1],ve=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),me=ve[0],ye=ve[1],be=t.useState(B),we=be[0],Ce=be[1],Fe=t.useState(!0),ke=Fe[0],je=Fe[1],Se=t.useState(null),De=Se[0],Me=Se[1],Ee=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ae=Ee[0],Le=Ee[1],ze=t.useState(function(){if(2===V&&fe){var e=new Date(Ae.year,Ae.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Te=ze[0],Be=ze[1];t.useEffect(function(){if(2===V&&fe){var e=new Date(Ae.year,Ae.month+1,1);Be({year:e.getFullYear(),month:e.getMonth()})}else Be(null)},[Ae,V,fe]);var Re=t.useRef(null),We=t.useRef(null),Ne=t.useRef(null),Ie=t.useRef(null),He=t.useRef(null),Ye=t.useState(null),Oe=Ye[0],Pe=Ye[1],Ve=t.useRef(!1),qe=t.useRef(!1),Xe=t.useRef(null),_e="value"in o&&void 0!==o.value,Ze=void 0!==R,Ke=fe?null:_e&&"date"===a&&"value"in o?o.value:xe,Ge=fe?_e&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:me:{startDate:null,endDate:null},Je=Ze?R:we;t.useEffect(function(){if(Je&&!Ve.current){if(fe){var e=Ge.startDate||Ge.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}}else if(Ke){t=Ke.getFullYear(),n=Ke.getMonth();Le({year:t,month:n})}else{o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}Ve.current=!0}else Je||(Ve.current=!1)},[Je,Ke,Ge,fe]),t.useEffect(function(){if(Je&&Re.current){qe.current=!1,Xe.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==Xe.current){var t,n=Xe.current;if(He.current){var o=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Pe({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Pe({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(He.current){var t=He.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),qe.current=!0,Xe.current=i}Pe({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Pe(null),qe.current=!1,Xe.current=null},[Je]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Ze||Ce(!1),null==S||S(!1))};if(Je)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Je,Ze,S]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;oe(e,W,N)&&(_e||ge(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||Ce(!1),null==S||S(!1))},[_e,Ze,a,o,S,W,N]),nt=t.useCallback(function(e){var t;if(oe(e,W,N)){var n,r=X&&De?De:Ge;r.startDate&&r.endDate?(n={startDate:e,endDate:null},je(!1)):ke?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},je(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(je(!0),X||(Ze||Ce(!1),null==S||S(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),X||(Ze||Ce(!1),null==S||S(!1))),X?Me(n):(_e||ye(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[ke,Ge,De,X,_e,Ze,a,o,S,W,N]),ot=function(e){var t,n;if(e.stopPropagation(),fe){var r={startDate:null,endDate:null};_e||ye(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else _e||ge(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Je){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},rt=function(){if(!s){var e=!Je;if(Ze||Ce(e),null==S||S(e),e){if(fe){if(je(!Ge.startDate),X&&Me(Ge),!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!Ke){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&X&&Me(null)}},it=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(O)?O:!0===O?it:[]},[O,it]),lt=at.length>0,st=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Le({year:n,month:r})}X?Me(e):(_e||ye(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||Ce(!1),null==S||S(!1))},ct=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},dt=function(){Le(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ut=t.useCallback(function(e,t){for(var n=te(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),pt=t.useMemo(function(){return ut(Ae.year,Ae.month)},[Ae,ut]),ft=t.useMemo(function(){return 2===V&&fe&&Te?ut(Te.year,Te.month):null},[V,fe,Te,ut]),ht=function(){Te&&Be(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Te&&Be(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},gt={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"}},vt=w&&!s&&(fe?Ge.startDate||Ge.endDate:Ke),mt=Ke?ee(Ke,F):"",yt=Ge.startDate?ee(Ge.startDate,F):"",bt=Ge.endDate?ee(Ge.endDate,F):"",wt=t.useMemo(function(){if(!fe||"text"!==de)return"";if(Ge.startDate&&Ge.endDate){var e=ee(Ge.startDate,"MMM D, YYYY"),t=ee(Ge.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Ge.startDate?ee(Ge.startDate,"MMM D, YYYY"):Ge.endDate?ee(Ge.endDate,"MMM D, YYYY"):""},[fe,de,Ge,H]),Ct=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];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 @keyframes dropdownFadeInTop {\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:Re,className:"aha-date-picker ".concat(M),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":Je?pe:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:vt?"30px":"12px",paddingTop:gt[y].paddingTop,paddingBottom:gt[y].paddingBottom,fontSize:gt[y].fontSize,lineHeight:gt[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},E),onClick:rt,onFocus:function(e){null==k||k(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children: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",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),fe?"text"===de?e.jsx("input",{ref:We,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate||Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:Ne,type:"text",value:yt,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!0),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ie,type:"text",value:bt,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!1),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:We,type:"text",value:mt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ke?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),vt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children: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:ot,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"})})},{})})]}),Je&&Oe&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Oe.top,"px"),left:"".concat(Oe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Oe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Oe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},z),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:fe&&lt&&1===V?"column":"row"},children:[fe&&lt&&2===V&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:X?"0":"8px"},children:at.map(function(t,n){var o=De?ne(t.range.startDate,De.startDate)&&ne(t.range.endDate,De.endDate):ne(t.range.startDate,Ge.startDate)&&ne(t.range.endDate,Ge.endDate);return e.jsx("div",{onClick:function(){return st(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===V?"row":"column",gap:2===V?"24px":"0"},children:(et=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===V&&fe?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===V&&fe&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&fe?"absolute":"relative",left:2===V&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[$[t.month]," ",t.year]}),!(2===V&&fe&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&fe?"absolute":"relative",right:2===V&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),fe&&re&&1===V&&0===i&&(a=X&&De?De:Ge,l=a.startDate?ee(a.startDate,"MMM D, YYYY"):ae,s=a.endDate?ee(a.endDate,"MMM D, YYYY"):se,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),fe&&lt&&1===V&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var o=De?ne(t.range.startDate,De.startDate)&&ne(t.range.endDate,De.endDate):ne(t.range.startDate,Ge.startDate)&&ne(t.range.endDate,Ge.endDate);return e.jsx("button",{type:"button",onClick:function(){return st(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Ct.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=ne(n,new Date),c=!oe(n,W,N);if(fe){var d=X&&De?De:Ge,u=ne(n,d.startDate),p=ne(n,d.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,d.startDate,d.endDate),h=r%7==0,x=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(g||v)m.background=pe,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=te(t.year,t.month),w=n.getDate()===b,C=h||y,F=x||w;C&&F?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):F?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){c||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":pe}})]},"date-".concat(o)))}else{var k=ne(n,Ke);l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:k?pe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:k?500:400,color:k?"#FFFFFF":i?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||k||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){k||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!k&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:pe}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ae,pt,ct,dt,0),2===V&&fe&&Te&&ft&&et(Te,ft,ht,xt,1)]}))}),fe&&re&&2===V&&!X&&(Ue=Ge,Qe=Ue.startDate?ee(Ue.startDate,"MMM D, YYYY"):ae,$e=Ue.endDate?ee(Ue.endDate,"MMM D, YYYY"):se,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.startDate?"text-[#44403C]":"text-[#79716B]"),children:Qe}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.endDate?"text-[#44403C]":"text-[#79716B]"),children:$e})]})})),fe&&X&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[re&&2===V&&function(){var t=De||Ge,n=t.startDate?ee(t.startDate,"MMM D, YYYY"):ae,o=t.endDate?ee(t.endDate,"MMM D, YYYY"):se;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===V?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){Me(null),null==U||U(),Ze||Ce(!1),null==S||S(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:G}),e.jsx("button",{type:"button",onClick:function(){var e;De&&(_e||ye(De),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,De)),null==J||J(De),Ze||Ce(!1),null==S||S(!1),Me(null))},disabled:!De||!De.startDate||!De.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:De&&De.startDate&&De.endDate?pe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:De&&De.startDate&&De.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor=pe)},children:Z})]})]})]})]})}),document.body)]})};re.displayName="DatePicker";var ie=t.createContext(null),ae=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),le=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,c=n.onValuesChange,d=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,h=n.labelAlign,x=void 0===h?"right":h,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,y=void 0===m?"":m,b=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),F=C[0],k=C[1],j=t.useRef(F);t.useEffect(function(){j.current=F},[F]);var S=t.useRef({}),D=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),M=t.useCallback(function(e,t){k(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},c){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),c(i,a)}return o})},[c]),E=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),A=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),T=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),B=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),k(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),R=t.useRef();R.current=function(e,t){k(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var c=o[l],d=i[l];if((null==c?void 0:c.required)!==(null==d?void 0:d.required)||(null==c?void 0:c.message)!==(null==d?void 0:d.message)||(null==c?void 0:c.type)!==(null==d?void 0:d.type)||(null==c?void 0:c.pattern)!==(null==d?void 0:d.pattern)||(null==c?void 0:c.min)!==(null==d?void 0:d.min)||(null==c?void 0:c.max)!==(null==d?void 0:d.max)||(null==c?void 0:c.len)!==(null==d?void 0:d.len)||(null==c?void 0:c.whitespace)!==(null==d?void 0:d.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var W=t.useCallback(function(e,t){var n;null===(n=R.current)||void 0===n||n.call(R,e,t)},[]),N=t.useCallback(function(e){delete S.current[e],k(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),I=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,c,d,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];B(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],c=t.value,s.required&&(null==c||""===c))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=c&&""!==c&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!d(c))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=c&&""!==c&&!s.pattern.test(String(c)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof c&&c.trim()!==c)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,c)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),Y=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,I(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new ae("Form validation failed",r,o);return[2,H()]}})})},[I,H,u]),O=t.useCallback(function(e){k(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),P=t.useCallback(function(e){k(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),c){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),c(e,o)}return n})},[c]),V=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Y()];case 1:return e=t.sent(),null==d||d(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[Y,d]),q=t.useCallback(function(e){if(k(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),c&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return c(t,H())},0)}},[c,H]),X=t.useCallback(function(e,t){t?S.current[e]=t:delete S.current[e]},[]),_=t.useCallback(function(e,t){var n=S.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:D,getFieldsValue:H,setFieldValue:M,setFieldsValue:P,setFields:q,getFieldError:E,validateField:I,validateFields:Y,resetFields:O,submit:V,scrollToField:_}});var Z=t.useMemo(function(){return{fields:F,getFieldValue:D,setFieldValue:M,getFieldError:E,setFieldError:A,isFieldTouched:L,setFieldTouched:z,isFieldValidating:T,setFieldValidating:B,registerField:W,unregisterField:N,validateField:I,validateFields:Y,resetFields:O,getFieldsValue:H,setFieldsValue:P,setFields:q,submit:V,scrollToField:_,registerFieldRef:X,labelWidth:f,labelAlign:x}},[F,D,M,E,A,L,z,T,B,W,N,I,Y,O,H,P,q,V,_,X,f,x]),K=r({},b);return"vertical"===v?(K.display="flex",K.flexDirection="column"):"inline"===v&&(K.display="inline-flex",K.flexWrap="wrap",K.gap="16px"),e.jsx(ie.Provider,{value:Z,children:e.jsx("form",{className:"aha-form ".concat(y),style:K,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y()];case 2:return t=n.sent(),null==d||d(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});le.displayName="Form";var se=le;se.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,c=n.rules,d=void 0===c?[]:c;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,h=n.className,x=void 0===h?"":h,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,y=void 0!==m&&m,b=n.tooltip,w=t.useContext(ie),C=t.useRef(null),F=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),k=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,S=!(!o||!w)&&w.isFieldTouched(o),D=!(!o||!w)&&w.isFieldValidating(o);o&&k[o];var M=u||(j?"error":D?"validating":S&&!j?"success":void 0),E=void 0!==p?p:j||void 0,A=t.useRef(d),L=t.useRef(s),z=t.useRef(!1),T=s||d.some(function(e){return e.required}),B=t.useMemo(function(){if(!z.current)return z.current=!0,!0;if(A.current.length!==d.length)return!0;if(A.current===d)return!1;for(var e=0;e<d.length;e++){var t=A.current[e],n=d[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[d]);t.useEffect(function(){if(o&&w)return(!A.current||B||L.current!==s)&&(A.current=d,L.current=s,w.registerField(o,{rules:d,required:T})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:F,className:"aha-form-item ".concat(x),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,T&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(O,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:b})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,c,d,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var h=w.getFieldValue(o),x=w.setFieldValue;if(!x)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=h||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,y=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==y||y(e)},f.error="error"===M}else if("Select"===v){f.value=h;var b=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==b||b(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===M}else if("Switch"===v){f.checked=h||!1;var F=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==F||F(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=h||!1;var k=null===(c=e.props)||void 0===c?void 0:c.onChange;f.onChange=function(e){x(o,e.target.checked),null==k||k(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==j){f.checked=h===j;var S=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,j),null==S||S(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==h&&(f.value=h);var D=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(o,r),null==D||D(e)}}}return"error"===M&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),E&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===M?"#D92D20":"warning"===M?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:E}),f&&!E&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},se.useForm=function(){return[t.useRef(null)]};var ce=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,c=n.defaultSelectedKeys,d=void 0===c?[]:c,p=n.onSelect,f=n.onDeselect,h=n.onClick,x=n.className,g=void 0===x?"":x,v=n.style,m=n.width,y=void 0===m?320:m;u().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==l,F=t.useState(d),k=F[0],j=F[1],S=C?l:k,D=function(e){return"children"in e&&Array.isArray(e.children)},M=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(D(i)){var a=M(e,i.children,n);if(a)return a}else{var l=i,c=s(s([],n,!0),[l.key],!1);if(l.key===e)return c}}return null},[]),E=t.useCallback(function(e){var t;if(!e.disabled){var n,o=M(e.key,i)||[e.key];S.includes(e.key)?(n=S.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:o})}},[S,C,p,f,h,i,M]),A=function(t){var n=S.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return E(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof y?"".concat(y,"px"):y,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),z=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!D(o)||!(!D(n)||D(o))};return e.jsxs("div",{ref:b,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[z(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),D(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return A(e)})},"group-".concat(r.title))):A(n)]},o);var r})})]})};ce.displayName="MenuList";var de=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=o+6,c=0,d=0;switch(n){case"top":c=e.top-t.height-s+i,d=a-t.width/2+r;break;case"bottom":default:c=e.bottom+s+i,d=a-t.width/2+r;break;case"left":c=l-t.height/2+i,d=e.left-t.width-s+r;break;case"right":c=l-t.height/2+i,d=e.right+s+r;break;case"top-left":c=e.top-t.height-s+i,d=e.left+r;break;case"top-right":c=e.top-t.height-s+i,d=e.right-t.width+r;break;case"bottom-left":c=e.bottom+s+i,d=e.left+r;break;case"bottom-right":c=e.bottom+s+i,d=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return d<r+8?d=r+8:d+t.width>r+u-8&&(d=r+u-t.width-8),c<i+8?c=i+8:c+t.height>i+p-8&&(c=i+p-t.height-8),{top:c,left:d}},ue=function(e,t,n,o){void 0===o&&(o=6);var r=de(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),c=a-l,d=s+t.height,u=c+t.width,p=s,f=c,h=Math.max(p,e.top),x=Math.min(d,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},pe=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},fe=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},he=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},xe=function(o){var i,a=o.children,l=o.content,s=o.trigger,c=void 0===s?"click":s,d=o.open,u=o.defaultOpen,p=void 0!==u&&u,f=o.onOpenChange,h=o.placement,x=void 0===h?"right":h,g=o.width,v=o.offset,m=void 0===v?8:v,y=o.className,b=void 0===y?"":y,w=o.popoverClassName,C=void 0===w?"":w,F=o.disabled,k=void 0!==F&&F,j=o.destroyOnHide,S=o.destroyTooltipOnHide,D=null===(i=null!=j?j:S)||void 0===i||i,M=void 0!==d,E=t.useState(p),A=E[0],L=E[1],z=M?!!d:A,T=t.useState({top:0,left:0,opacity:0}),B=T[0],R=T[1],W=t.useRef(null),N=t.useRef(null),I=t.useCallback(function(e){M||L(e),null==f||f(e)},[M,f]),H=t.useCallback(function(){if(z&&W.current&&N.current){var e=W.current.getBoundingClientRect(),t=N.current.getBoundingClientRect(),n=function(){if(fe(e,t,x,m))return x;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(x);return fe(e,t,n,m)||he(e,n)>he(e,x)?n:x}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,m),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);R({top:r.top,left:r.left,opacity:1})}},[z,x,m]),Y=t.useCallback(function(){k||I(!0)},[k,I]),O=t.useCallback(function(){I(!1)},[I]),P=t.useCallback(function(){k||I(!z)},[k,z,I]);t.useEffect(function(){if(z)return requestAnimationFrame(function(){H()}),window.addEventListener("resize",H),window.addEventListener("scroll",H,!0),function(){window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0)}},[z,H]),t.useEffect(function(){if(z&&"click"===c){var e=function(e){var t=e.target;W.current&&N.current&&!W.current.contains(t)&&!N.current.contains(t)&&O()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[z,c,O]);var V="hover"===c?{onMouseEnter:Y,onMouseLeave:O,onFocus:Y,onBlur:O}:{onClick:function(e){e.stopPropagation(),P()}},q=z||!D?e.jsx("div",{ref:N,className:"aha-popover ".concat(C),style:{position:"absolute",zIndex:9999,top:B.top,left:B.left,opacity:z?B.opacity:0,visibility:z?"visible":"hidden",pointerEvents:z?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof g?"".concat(g,"px"):g,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===c?Y:void 0,onMouseLeave:"hover"===c?O:void 0,onMouseDown:"click"===c?function(e){return e.stopPropagation()}:void 0,children:l}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:W,className:"aha-popover-trigger ".concat(b),style:{display:"inline-block",cursor:k?"not-allowed":"pointer"}},V,{children:a})),q&&"undefined"!=typeof document&&n.createPortal(q,document.body)]})};xe.displayName="Popover";var ge=240,ve=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,c=o.afterOpenChange,d=o.title,u=o.extra,p=o.footer,f=o.children,h=o.placement,x=void 0===h?"right":h,g=o.width,v=void 0===g?378:g,m=o.height,y=void 0===m?378:m,b=o.mask,w=void 0===b||b,C=o.maskClosable,F=void 0===C||C,k=o.closable,j=void 0===k||k,S=o.closeIcon,D=o.keyboard,M=void 0===D||D,E=o.destroyOnClose,A=void 0!==E&&E,L=o.zIndex,z=void 0===L?1e3:L,T=o.mobileBreakpoint,B=void 0===T?768:T,R=o.className,W=void 0===R?"":R,N=o.style,I=o.drawerStyle,H=o.headerStyle,Y=o.bodyStyle,O=o.footerStyle,P=o.maskStyle,V=void 0!==i,q=t.useState(l),X=q[0],_=q[1],Z=V?!!i:X,K=t.useState(Z),G=K[0],J=K[1],U=t.useState(Z),Q=U[0],$=U[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<B)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[B]),t.useEffect(function(){if(Z){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==c||c(!0)},ge);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){A&&J(!1),null==c||c(!1)},ge);return function(){return window.clearTimeout(n)}},[Z,A,c]),t.useEffect(function(){if(Z&&M){var e=function(e){"Escape"===e.key&&(null==s||s(e),V||_(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[Z,M,s,V]),t.useEffect(function(){if(te&&Z){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[Z,te]);var ae=t.useCallback(function(e){null==s||s(e),V||_(!1)},[s,V]),le=t.useMemo(function(){return re?"100vw":"left"===x||"right"===x?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[x,re,v]),se=t.useMemo(function(){return"top"===x||"bottom"===x?"number"==typeof y?"".concat(y,"px"):y:"100vh"},[x,y]),ce=t.useMemo(function(){return re&&("left"===x||"right"===x)?"bottom":x},[re,x]),de=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(ge,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:z+1};switch(ce){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(100%)"})}},[ce,le,se,Q,z]);if(!te||!G&&!Z)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(W),style:r({position:"fixed",inset:0,zIndex:z,pointerEvents:Z||Q?"auto":"none"},N),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:F?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:Q?1:0,transition:"opacity ".concat(ge,"ms cubic-bezier(0.2, 0, 0, 1)")},P)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},de),I),children:[(void 0!==d||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:S||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},Y),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},O),children:p})]},"".concat(ce,"-").concat(Z?"open":"closed"))]});return n.createPortal(ue,document.body)};ve.displayName="Drawer";var me={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function ye(e,t,n){var o=e*Math.PI*2,r=Math.round(n.petalCount),i=n.baseRadius*Math.cos(o)-n.detailAmplitude*t*Math.cos(r*o),a=n.baseRadius*Math.sin(o)-n.detailAmplitude*t*Math.sin(r*o);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function be(e,t,n,o){var r=e/Math.max(1,o.particleCount-1),i=ye(function(e){return(e%1+1)%1}(t-r*o.trailSpan),n,o),a=Math.pow(1-r,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,c=n.icon,d=void 0===c?v[a]:c,u=n.showIcon,p=void 0===u||u,f=n.closeable,h=void 0!==f&&f,x=n.action,g=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1],F=function(){C(!1),null==y||y()},k=x||h;return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&d,e.jsxs("div",{className:"flex flex-col gap-1 ".concat(k?"flex-1 min-w-0":""),children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),g&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:g})]}),k&&e.jsxs("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[x,h&&e.jsx("div",{className:"cursor-pointer relative top-[-12px]",onClick:F,onKeyDown:function(e){return"Enter"===e.key&&F()},role:"button",tabIndex:0,"aria-label":"关闭",children:m})]})]}):null},exports.Button=g,exports.CheckIcon=B,exports.Checkbox=V,exports.DatePicker=re,exports.Drawer=ve,exports.Form=se,exports.Input=z,exports.Loading=function(n){var o=n.width,r=void 0===o?80:o,i=n.height,a=void 0===i?80:i,l=n.strokeWidth,s=n.color,c=void 0===s?"var(--theme-color, #5A31F0)":s,d=n.className,u=t.useState(0),p=u[0],f=u[1],h=t.useRef(null);t.useEffect(function(){var e,t=function(n){null===h.current&&(h.current=n),f(n-h.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var x,g,v=p,m=(g=v%(x=me).pulseDurationMs/x.pulseDurationMs*Math.PI*2,.52+(Math.sin(g+.55)+1)/2*.48),y=v%me.durationMs/me.durationMs,b=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(v,me),w=null!=l?l:me.strokeWidth,C=w/me.strokeWidth,F=function(e,t,n){void 0===n&&(n=480);for(var o=[],r=0;r<=n;r+=1){var i=ye(r/n,e,t);o.push("".concat(0===r?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return o.join(" ")}(m,me),k=[],j=0;j<me.particleCount;j+=1){var S=be(j,y,m,me);k.push({cx:S.x,cy:S.y,opacity:S.opacity,r:S.radius*C})}return e.jsx("div",{className:d,style:{width:r,height:a,display:"inline-block",color:c},role:"status","aria-label":"Loading",children:e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e.jsx("title",{children:"Thinking Five"}),e.jsxs("g",{transform:"rotate(".concat(b," 50 50)"),children:[e.jsx("path",{d:F,stroke:"currentColor",strokeWidth:w,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),k.map(function(t,n){return e.jsx("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})},exports.MenuList=ce,exports.MinusIcon=R,exports.Pagination=P,exports.Popover=xe,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,c=n.width,d=void 0===c?120:c,p=n.title,f=n.titlePosition,h=n.showPercent,x=void 0===h||h,g=n.animated,v=void 0!==g&&g,m=n.status,y=void 0===m?"normal":m,b=n.className,w=void 0===b?"":b,C=n.style,F=n.strokeColor,k=n.trailColor,j=void 0===k?"#F5F5F4":k,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),D=u().primaryColor,M=Math.min(100,Math.max(0,a)),E=t.useRef(!0),A=t.useState(!1),L=A[0],z=A[1],T=t.useState(0),B=T[0],R=T[1];t.useEffect(function(){if(v&&E.current&&M>0){E.current=!1,R(0),z(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(M)})});var e=setTimeout(function(){z(!1),R(M)},300);return function(){return clearTimeout(e)}}E.current?(E.current=!1,z(!1),R(M)):R(M)},[v,M]);var W=F||D||"#FB6011";"success"===y?W="#00BC7D":"exception"===y&&(W="#FB2C36");var N=f||"inside",I=Math.max(4,Math.round(.06*d)),H=(d-I)/2,Y="semicircle"===s?d/2:d,O="14px",P="12px",V=function(){var t=p&&"outside"===N?d+4+18+4:d,n=2*Math.PI*H,o=n-(L?B:M)/100*n;return e.jsxs("div",{style:{position:"relative",width:d,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:d,height:d,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(d/2," ").concat(d/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(M),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(M),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:d},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},S,{children:function(){switch(s){case"circle":return V();case"semicircle":return n=I/2,o=d-I/2,r=(t=Y+I)-I/2,i=Y/2+I/2+I/2,a=p&&"outside"===N?t+4+18+4:t,l=Math.PI*H,c=l-(L?B:M)/100*l,e.jsxs("div",{style:{position:"relative",width:d,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:d,height:t,viewBox:"0 0 ".concat(d," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(M),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:P,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(M),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),V()}var t,n,o,r,i,a,l,c}()}))},exports.Radio=G,exports.Select=T,exports.Switch=U,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,c=n.layout,d=void 0===c?"equal":c,p=n.defaultValue,f=n.value,h=n.onChange,x=n.className,g=void 0===x?"":x,v=n.mode,m=void 0===v?"children":v,y=n.scrollable,b=void 0!==y&&y,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var F=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),k=void 0!==f,j=F.length>0?F[0].key:"",S=function(e){if(void 0===e)return j;var t=F.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},D=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return S(t)}),M=D[0],E=D[1],A=k?void 0!==f?S(f):j:M;t.useEffect(function(){console.log("[Tab Debug] currentValue:",A,"type:",typeof A),console.log("[Tab Debug] normalizedItems:",F.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",k)},[A,F,f,k]);var L=t.useCallback(function(e,t){if(!t){k||E(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==h||h(n),b&&"underline"===s){var o=B.current[R(e)],r=I.current;if(o&&r){O.current=!0;var i,l=function(){if(r&&W.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},c=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),O.current=!1,r.removeEventListener("scroll",c)},150)};r.addEventListener("scroll",c,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[k,h,a,b,s]),z=F.find(function(e){if(e.key===A)return!0;if(String(e.key)===String(A))return!0;var t=Number(e.key),n=Number(A);return!isNaN(t)&&!isNaN(n)&&t===n}),T=C||"#FB6011",B=t.useRef({}),R=function(e){return String(e)},W=t.useRef(null),N=t.useRef(null),I=t.useRef(null),H=t.useRef(null),Y=t.useRef("");t.useRef(new Set);var O=t.useRef(!1),P=t.useState({width:0,left:0,opacity:0}),V=P[0],q=P[1],X=t.useState({width:0,left:0,opacity:0}),_=X[0],Z=X[1],K=t.useCallback(function(){"underline"===s&&I.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&I.current){var e=B.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=B.current[R(t)]}if(e){var n=I.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=I.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,A,F]),G=t.useCallback(function(){"background"===s&&H.current&&N.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(N.current&&H.current){var e=B.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=B.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");Z(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,A,F]);t.useEffect(function(){A?Y.current!==A&&(Y.current=A,"underline"===s&&I.current&&!O.current&&K(),"background"===s&&H.current&&N.current&&G()):Y.current=""},[A,s,F.length,k,K,G]),t.useEffect(function(){if(A){var e=setTimeout(function(){if("underline"===s)(e=B.current[R(A)])&&I.current&&W.current&&(K(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=B.current[R(A)])&&H.current&&N.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");Z({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&A&&!O.current){var e=setTimeout(function(){var e=B.current[R(A)],t=I.current;if(e&&t){O.current=!0;var n,o=function(){if(t&&W.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),O.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[A,b,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:I,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:T,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},V)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){B.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:b?0:void 0,whiteSpace:b?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?T:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?T:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?T:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?T:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?T:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?T:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===d?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(d," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:N,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},_)}),F.map(function(n){var o=function(){if(n.key===A)return!0;if(String(n.key)===String(A))return!0;var e=Number(n.key),t=Number(A);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===F[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:A,currentValueType:typeof A,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===d?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){B.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),b&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==z?void 0:z.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:z.children})]})},exports.Table=function(n){var o,a,l,c,d=n.columns,p=void 0===d?[]:d,f=n.dataSource,h=void 0===f?[]:f,x=n.rowKey,g=void 0===x?"key":x,v=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,C=n.bordered,F=void 0!==C&&C,k=n.loading,j=void 0!==k&&k,S=n.locale,D=n.showHeader,M=void 0===D||D,E=n.title,A=n.footer,L=n.summary,z=n.scroll,T=n.tableLayout,B=void 0===T?"auto":T,R=n.onChange,W=n.onSorterChange,N=n.onPaginationChange,I=n.onRow,H=n.className,Y=void 0===H?"":H,O=n.innerClassName,q=void 0===O?"":O,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=i(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=u().primaryColor||"#FB6011",te=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&oe(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var re=t.useState(new Map),ie=re[0],ae=re[1],le=t.useState((null==J?void 0:J.defaultExpandedRowKeys)||[]),se=le[0],ce=le[1],de=t.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=de[0],pe=de[1],fe=t.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),he=fe[0],xe=fe[1];t.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&xe(y.pageSize))},[y]);var ge=t.useState(null),ve=ge[0],me=ge[1],ye=t.useState(null),be=ye[0],we=ye[1],Ce=t.useState(!1),Fe=Ce[0],ke=Ce[1],je=t.useRef(null),Se=t.useRef(null);t.useEffect(function(){var e=function(){ke(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var De=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=Z(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var c=h.filter(function(e){return a.includes(Z(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,c),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,c,new Event("select"))}},[ne,g,v,h]),Me=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return Z(e,g)}),i=e?r:[];oe(i);var a=h.filter(function(e){return i.includes(Z(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,h]),Ee=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),W&&W(1===r.length?r[0]:r),R&&R({current:ue,pageSize:he},{},1===r.length?r[0]:r,{currentDataSource:h,action:"sort"})}},[ie,R,W,ue,he,h,p]);t.useCallback(function(e,t){var n,o,r,i=Z(e,g);r=t?s(s([],se,!0),[i],!1):se.filter(function(e){return e!==i}),ce(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[se,g,J]);var Ae,Le=t.useCallback(function(){var e=s([],h,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){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,t);else if(!0===r.sorter){var a=_(e,r.dataIndex||n),l=_(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[h,ie,p]),ze=Le(),Te=Boolean(y&&"object"==typeof y&&void 0!==y.total),Be=t.useMemo(function(){if(!1===y||!y)return ze;if(Te)return ze;var e=(ue-1)*he,t=e+he;return ze.slice(e,t)},[ze,ue,he,y,Te]),Re=t.useCallback(function(e,t){var n,o,r=null!=t?t:he;if(pe(e),t&&xe(t),N&&N(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,t),t&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,t))),R){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});R({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:ze,action:"paginate"})}},[y,N,R,he,ie,p,ze]),We=t.useCallback(function(e,t,n){var o=_(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ne=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.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"===o){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(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Ie=t.useCallback(function(){if(!M)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=ie.get(i)||null,l=Ne(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){Ee(t,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(K,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.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:[!v.hideSelectAll&&"radio"!==v.type&&(t=Be.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return Z(e,g)}),o=t.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(V,{checked:o,indeterminate:i&&!o,onChange:function(e){return Me(e.target.checked,Be)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var c=null==Q?void 0:Q(p,0);return e.jsx("thead",{ref:Se,children:e.jsx("tr",r({},c||{},{children:a}))})},[p,M,ie,v,ne,Be,g,Ee,Me,S,Q,Ne]),He=t.useCallback(function(e){me(e)},[]),Ye=t.useCallback(function(e,t){e.preventDefault(),we(t)},[]),Oe=t.useCallback(function(e,t){if(e.preventDefault(),null===ve||ve===t)return me(null),void we(null);var n=s([],Be,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),me(null),we(null)},[ve,Be]),Pe=t.useCallback(function(){me(null),we(null)},[]),Ve=t.useCallback(function(){var t=null==S?void 0:S.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?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:n})})},[null==S?void 0:S.emptyText,p.length,v]),qe=t.useCallback(function(){return 0===Be.length?Ve():Be.map(function(n,o){var i,a=Z(n,g),l=ne.includes(a),s=se.includes(a),c=(null==I?void 0:I(n,o))||{},d=o===Be.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof U?U(n,o):U||""," ").concat(ve===o?"dragging":""," ").concat(be===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Ye(e,o)},onDrop:function(e){return Oe(e,o)},onDragEnd:Pe,style:r({cursor:"move",opacity:ve===o?.5:1,backgroundColor:be===o?"#F9FAFB":"white",transition:"background-color 0.2s"},c.style),onMouseEnter:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="white")}},c,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(V,{checked:l,onChange:function(e){return De(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},c=Ne(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,right:"right"===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:We(t,n,o)}),l)})]})),(null==J?void 0:J.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:J.expandedRowRender(n,o,0,!0)})})]},a)})},[Be,g,ne,se,v,p,I,U,De,We,J,ve,be,He,Ye,Oe,Pe,Ne,Ve]),Xe=function(){var t;if(!1===y||!y)return null;var n=null!==(t=y.total)&&void 0!==t?t: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(P,{current:ue,total:n,pageSize:he,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"})})},_e=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ze=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),Ke=t.useMemo(function(){if(null==z?void 0:z.x){if("number"==typeof z.x)return z.x;if(!0===z.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(_e)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==z?void 0:z.x,v,_e]),Ge=t.useMemo(function(){return"fixed"===B||_e||Ze||p.some(function(e){return e.width})?"fixed":B},[B,_e,Ze,p]),Je=r(r({width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},F&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"},G);if(Fe)return e.jsxs("div",r({ref:je,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ue,"aria-busy":!!j||void 0},$,{children:[E&&e.jsx("div",{style:{marginBottom:"16px"},children:E(ze)}),y&&"object"==typeof y&&(null===(o=y.position)||void 0===o?void 0:o.startsWith("top"))&&Xe(),(Ae="function"==typeof(null==S?void 0:S.emptyText)?S.emptyText():void 0!==(null==S?void 0:S.emptyText)?S.emptyText:"No data",0===Be.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:Be.map(function(t,n){var o,r=Z(t,g),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:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(V,{checked:i,onChange:function(e){return De(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=_(t,o.dataIndex||""),a=o.render?o.render(i,t,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 o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),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")))&&Xe(),e.jsx(X,{loading:j,spinColor:ee})]}));var Qe={position:"relative",overflowX:(null==z?void 0:z.x)||_e?"auto":"visible",overflowY:(null==z?void 0:z.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==z?void 0:z.x)?"100%":"number"==typeof(null==z?void 0:z.x)?"".concat(z.x,"px"):void 0,maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:je,className:"aha-table ".concat(Y),style:Ue,"aria-busy":!!j||void 0},$,{children:[E&&e.jsx("div",{style:{marginBottom:"16px"},children:E(ze)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&Xe(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Je,className:q,children:[Ie(),e.jsx("tbody",{children:qe()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(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")))&&Xe(),e.jsx(X,{loading:j,spinColor:ee})]}))},exports.Tag=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,c=n.size,d=void 0===c?"large":c,p=n.stroke,f=void 0!==p&&p,h=n.icon,x=n.iconPosition,g=void 0===x?"none":x,v=n.className,m=void 0===v?"":v,y=n.onClick,b=i(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=u().primaryColor,C=function(e,t){if("string"==typeof e&&e in A){var n=A[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),i=parseInt(o.substr(0,2),16),a=parseInt(o.substr(2,2),16),l=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.1)"),text:e,border:"rgba(".concat(i,", ").concat(a,", ").concat(l,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return A.Green}(a,w),F=L[d],k={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===d?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===d?"1.375":"1",transition:"all 0.2s",fontSize:"large"===d?"14px":"12px",height:"small"===d?"20px":"24px"};"light"===s&&(k.backgroundColor=C.light.bg,k.color=C.light.text,f&&(k.outline="1px solid",k.outlineOffset="-1px",k.outlineColor=function(e){if("string"==typeof e&&e in A)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(r,", 0.3)")}return"#A4F4CF"}(a))),y&&(k.cursor="pointer",k.opacity="1");var j=["rounded-md","inline-flex","justify-start","items-center",F.padding,F.gap,"font-medium","font-dm-sans","large"===d?"leading-snug":"leading-none","transition-colors","duration-200","small"===d?"h-5":"h-6"].filter(Boolean);"fill"===s&&(k.backgroundColor=C.fill.bg,k.color=C.fill.text),y&&j.push("cursor-pointer","hover:opacity-80"),m&&j.push(m);var S=j.join(" "),D=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in A)switch(e){case"Green":default:return"#009966";case"Red":return"#E7000B";case"Orange":return t||"#E17100";case"Blue":return"#155DFC";case"Yellow":return"#EC470A";case"Cyan":return"#0092B8";case"Violet":return"#7F22FE";case"Pink":return"#E60076";case"Gray":return"#57534D"}return"string"==typeof e&&e.startsWith("#")?e:"#009966"}(a,w),o="small"===d?"14px":"16px";return e.jsx("div",{className:"flex items-center justify-center",style:{width:o,height:o},children:"svg"===h.type?t.cloneElement(h,{width:o,height:o,style:{fill:n}}):h})};return e.jsxs("div",r({className:S,style:k,onClick:y},b,{children:["leading"===g&&D(),e.jsx("div",{className:"px-1 flex justify-center items-center",children:e.jsx("div",{className:"justify-center ".concat(F.textSize," font-medium font-dm-sans ").concat("large"===d?"leading-snug":"leading-none"),children:o})}),"after"===g&&D()]}))},exports.Textarea=J,exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},c),o)},[o]);return e.jsx(d.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(k,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(F,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,c=o.trigger,d=void 0===c?"hover":c,u=o.delay,p=void 0===u?200:u,f=o.disabled,h=void 0!==f&&f,x=o.className,g=void 0===x?"":x,v=o.tooltipClassName,m=void 0===v?"":v,y=o.gap,b=void 0===y?6:y,w=o.showArrow,C=void 0===w||w,F=o.width,k=o.defaultVisible,j=void 0!==k&&k,S=o.visible,D=o.onVisibleChange,M=void 0!==S,E=t.useState(j),A=E[0],L=E[1],z=M?S:A,T=t.useState(M?null!=S&&S:j),B=T[0],R=T[1],W=t.useCallback(function(e){M||L(e),null==D||D(e)},[M,D]);t.useEffect(function(){M&&(S?requestAnimationFrame(function(){R(!0)}):R(!1))},[M,S]);var N=t.useState(s),I=N[0],H=N[1],Y=t.useState("320px"),O=Y[0],P=Y[1],V=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===d?"auto":"none"}),q=V[0],X=V[1],_=t.useState({}),Z=_[0],K=_[1],G=t.useRef(null),J=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(G.current&&J.current&&z&&B){var e=G.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!ue(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!ue(e,t,a,o))return a}return n}(e,t,s,b);H(n);var o=de(e,t,n,b),i=o.top,a=o.left;if(X(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===d?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,c=o-i,d=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);K(l)}}},[z,s,b,C,B,d]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){W(!0),M||requestAnimationFrame(function(){R(!0)})},p))},[h,p,W,M]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),M?W(!1):(R(!1),Q.current=setTimeout(function(){W(!1),Q.current=null},150))},[W,M]),ne=t.useCallback(function(){"hover"===d&&(Q.current&&(clearTimeout(Q.current),Q.current=null),z||(W(!0),requestAnimationFrame(function(){R(!0)})))},[d,z]),oe=t.useCallback(function(e){h||"click"!==d||(e.stopPropagation(),z?te():(U.current&&(clearTimeout(U.current),U.current=null),W(!0),requestAnimationFrame(function(){R(!0)})))},[h,d,z,te]);t.useEffect(function(){if(j&&z&&B){var e=function(){G.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,z,B,$]),t.useEffect(function(){if(z)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[z,$]),t.useEffect(function(){if(z&&"click"===d){var e=function(e){G.current&&J.current&&!G.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[z,d,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:B?1:0,transform:B?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===d?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){P(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==F?{width:"number"==typeof F?"".concat(F,"px"):F,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:O,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===d?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===d?ne:void 0,onMouseLeave:"hover"===d?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&pe(I,Z)]}),se=t.useCallback(function(){"hover"===d&&(Q.current=setTimeout(function(){te()},100))},[d,te]),ce="click"===d?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:se,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:G,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===d?"pointer":"default"}},ce,{children:a})),z&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){C.clearAll()},exports.closeToast=function(e){C.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",C.getToasts()),console.log("容器根节点:",D),console.log("是否正在初始化:",M),console.log("====================")},exports.toast=j,exports.toastError=function(e,t){return E(),j(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return E(),j(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return E(),j(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return E(),j(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)};var r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{s(o.next(e))}catch(e){i(e)}}function l(e){try{s(o.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function s(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var c={primaryColor:"#FB6011"},d=t.createContext(c),u=function(){var e=t.useContext(d);return e||c},p={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},f={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",default:"secondary"},h={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}},x=function(t){var n=t.size,o=t.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: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"})]})]})},g=function(n){var o=n.children,a=n.type,l=void 0===a?"secondary":a,s=n.size,c=void 0===s?"md":s,d=n.disabled,g=void 0!==d&&d,v=n.loading,m=void 0!==v&&v,y=n.iconOnly,b=n.focused,w=void 0!==b&&b,C=n.onClick,k=n.htmlType,F=void 0===k?"button":k,j=n.className,S=void 0===j?"":j,D=n.style,z=n.icon,M=n.iconPosition,E=void 0===M?"left":M,L=i(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),T=u().primaryColor,B=t.useState(!1),A=B[0],R=B[1],I=t.useState(!1),W=I[0],N=I[1],H=f[l]||"secondary",Y=h[p[c]||"md"],P=null!=y?y:!!z&&null==o,O="link-color"===H||"link-gray"===H||"destructive-link"===H,V=g||m,q=w,_=T,X=function(){if(g)return"primary"===H||"secondary"===H||"destructive-primary"===H||"destructive-secondary"===H?{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=A||W;return"primary"===H?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":_||"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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"===H?{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"}}(),Z=function(){if(q)return"destructive-primary"===H||"destructive-secondary"===H||"destructive-tertiary"===H||"destructive-link"===H?"destructive-primary"===H||"destructive-secondary"===H?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===H||"secondary"===H?"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)"}(),K=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Y.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:Y.fontSize,lineHeight:"".concat(Y.lineHeight,"px"),cursor:V?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:X.bg,color:X.color,border:X.border,boxShadow:null!=Z?Z:X.boxShadow,textDecoration:X.textDecoration},D);O?(K.borderRadius="4px",K.overflow="hidden",P?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX)):(K.borderRadius="var(--radius-md, 8px)",P?(K.width=Y.height,K.height=Y.height,K.padding=0):(K.height=Y.height,K.paddingLeft=Y.paddingX,K.paddingRight=Y.paddingX));var G=function(){return m?e.jsx(x,{size:Y.iconSize,color:X.iconColor}):z?e.jsx("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:Y.iconSize,height:Y.iconSize,color:X.iconColor,flexShrink:0},children:z}):null},J=m||z&&"left"===E,U=!m&&z&&"right"===E;return e.jsxs("button",r({type:F,className:["aha-button","aha-button--".concat(H),"aha-button--".concat(p[c]||"md"),P&&"aha-button--icon-only",V&&"aha-button--disabled",m&&"aha-button--loading",q&&"aha-button--focused",S].filter(Boolean).join(" "),disabled:V,onClick:function(e){V?e.preventDefault():null==C||C(e)},onMouseEnter:function(){return!V&&R(!0)},onMouseLeave:function(){R(!1),N(!1)},onMouseDown:function(){return!V&&N(!0)},onMouseUp:function(){return N(!1)},style:K},L,{children:[J&&G(),!P&&o,U&&G(),P&&!z&&!m&&o]}))};g.displayName="Button";var v={success:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 1.66663C5.40002 1.66663 1.66669 5.39996 1.66669 9.99996C1.66669 14.6 5.40002 18.3333 10 18.3333C14.6 18.3333 18.3334 14.6 18.3334 9.99996C18.3334 5.39996 14.6 1.66663 10 1.66663ZM13.3584 8.49997L9.46668 12.3833C9.35001 12.5083 9.19168 12.5666 9.02501 12.5666C8.86668 12.5666 8.70834 12.5083 8.58334 12.3833L6.64169 10.4417C6.40002 10.2 6.40002 9.79994 6.64169 9.55827C6.88336 9.3166 7.28335 9.3166 7.52502 9.55827L9.02501 11.0583L12.475 7.61664C12.7167 7.36664 13.1167 7.36664 13.3584 7.61664C13.6 7.8583 13.6 8.24997 13.3584 8.49997Z",fill:"#00BC7D"})}),error:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M17.1342 6.3009L13.6999 2.86666C13.4658 2.63249 13.1474 2.50085 12.8157 2.50085H7.18504C6.85337 2.50085 6.53584 2.63249 6.30084 2.86666L2.8666 6.3009C2.63243 6.53507 2.50079 6.85343 2.50079 7.1851V12.8158C2.50079 13.1475 2.63243 13.465 2.8666 13.7L6.30084 17.1342C6.53501 17.3684 6.85337 17.5 7.18504 17.5H12.8157C13.1474 17.5 13.4649 17.3684 13.6999 17.1342L17.1342 13.7C17.3683 13.4658 17.5 13.1475 17.5 12.8158V7.1851C17.5 6.85343 17.3683 6.53507 17.1342 6.3009ZM12.525 11.6417C12.7692 11.8858 12.7692 12.2817 12.525 12.5259C12.4033 12.6475 12.2433 12.7092 12.0833 12.7092C11.9233 12.7092 11.7633 12.6484 11.6416 12.5259L9.99998 10.8842L8.35834 12.5259C8.23667 12.6475 8.07665 12.7092 7.91665 12.7092C7.75665 12.7092 7.59662 12.6484 7.47496 12.5259C7.23079 12.2817 7.23079 11.8858 7.47496 11.6417L9.1166 10L7.47496 8.3584C7.23079 8.11423 7.23079 7.71837 7.47496 7.4742C7.71912 7.23004 8.11498 7.23004 8.35915 7.4742L10.0008 9.11585L11.6424 7.4742C11.8866 7.23004 12.2825 7.23004 12.5266 7.4742C12.7708 7.71837 12.7708 8.11423 12.5266 8.3584L10.885 10L12.525 11.6417Z",fill:"#FB2C36"})}),warning:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.0057 14.2935L12.4999 3.99662C11.4333 2.00162 8.56744 2.00162 7.49995 3.99662L1.99417 14.2935C1.01583 16.1235 2.3442 18.3334 4.42337 18.3334H15.5765C17.6549 18.3334 18.9841 16.1226 18.0057 14.2935ZM9.37495 8.33337C9.37495 7.98837 9.65494 7.70837 9.99994 7.70837C10.3449 7.70837 10.6249 7.98837 10.6249 8.33337V11.6667C10.6249 12.0117 10.3449 12.2917 9.99994 12.2917C9.65494 12.2917 9.37495 12.0117 9.37495 11.6667V8.33337ZM10.0166 15C9.55663 15 9.17902 14.6267 9.17902 14.1667C9.17902 13.7067 9.54829 13.3334 10.0083 13.3334H10.0166C10.4775 13.3334 10.85 13.7067 10.85 14.1667C10.85 14.6267 10.4766 15 10.0166 15Z",fill:"#FE9A00"})}),info:e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.6875 2.5H5.3125C3.4375 2.5 2.5 3.4375 2.5 5.3125V14.6875C2.5 16.5625 3.4375 17.5 5.3125 17.5H14.6875C16.5625 17.5 17.5 16.5625 17.5 14.6875V5.3125C17.5 3.4375 16.5625 2.5 14.6875 2.5ZM10.625 13.75C10.625 14.095 10.345 14.375 10 14.375C9.655 14.375 9.375 14.095 9.375 13.75V9.9408C9.375 9.5958 9.655 9.3158 10 9.3158C10.345 9.3158 10.625 9.5958 10.625 9.9408V13.75ZM10.0167 7.91667C9.55668 7.91667 9.17908 7.54333 9.17908 7.08333C9.17908 6.62333 9.54834 6.25 10.0083 6.25H10.0167C10.4775 6.25 10.85 6.62333 10.85 7.08333C10.85 7.54333 10.4767 7.91667 10.0167 7.91667Z",fill:"#2B7FFF"})})},m=e.jsx("svg",{className:"flex-shrink-0",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"#57534D"})}),y={success:e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM16.03 10.2L11.36 14.86C11.22 15.01 11.03 15.08 10.83 15.08C10.64 15.08 10.45 15.01 10.3 14.86L7.97 12.53C7.68 12.24 7.68 11.76 7.97 11.47C8.26 11.18 8.74 11.18 9.03 11.47L10.83 13.27L14.97 9.14001C15.26 8.84001 15.74 8.84001 16.03 9.14001C16.32 9.43001 16.32 9.90001 16.03 10.2Z",fill:"#ECFDF5"})}),error:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M21.3506 7.56104L17.2295 3.43994C16.9485 3.15894 16.5665 3.00098 16.1685 3.00098H9.41162C9.01362 3.00098 8.63259 3.15894 8.35059 3.43994L4.22949 7.56104C3.94849 7.84204 3.79053 8.22407 3.79053 8.62207V15.3789C3.79053 15.7769 3.94849 16.1579 4.22949 16.4399L8.35059 20.561C8.63159 20.842 9.01362 21 9.41162 21H16.1685C16.5665 21 16.9475 20.842 17.2295 20.561L21.3506 16.4399C21.6316 16.1589 21.7896 15.7769 21.7896 15.3789V8.62207C21.7896 8.22407 21.6316 7.84204 21.3506 7.56104ZM15.8196 13.97C16.1126 14.263 16.1126 14.738 15.8196 15.031C15.6736 15.177 15.4816 15.251 15.2896 15.251C15.0976 15.251 14.9055 15.178 14.7595 15.031L12.7896 13.061L10.8196 15.031C10.6736 15.177 10.4816 15.251 10.2896 15.251C10.0976 15.251 9.90552 15.178 9.75952 15.031C9.46652 14.738 9.46652 14.263 9.75952 13.97L11.7295 12L9.75952 10.03C9.46652 9.73703 9.46652 9.26199 9.75952 8.96899C10.0525 8.67599 10.5276 8.67599 10.8206 8.96899L12.7905 10.939L14.7605 8.96899C15.0535 8.67599 15.5285 8.67599 15.8215 8.96899C16.1145 9.26199 16.1145 9.73703 15.8215 10.03L13.8516 12L15.8196 13.97Z",fill:"#FEF2F2"})}),question:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})}),info:e.jsx("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M18.2041 3H6.9541C4.7041 3 3.5791 4.125 3.5791 6.375V17.625C3.5791 19.875 4.7041 21 6.9541 21H18.2041C20.4541 21 21.5791 19.875 21.5791 17.625V6.375C21.5791 4.125 20.4541 3 18.2041 3ZM12.5991 17.5C12.0471 17.5 11.594 17.052 11.594 16.5C11.594 15.948 12.0371 15.5 12.5891 15.5H12.5991C13.1521 15.5 13.5991 15.948 13.5991 16.5C13.5991 17.052 13.1511 17.5 12.5991 17.5ZM14.1821 12.5281C13.4511 13.0181 13.315 13.291 13.29 13.363C13.185 13.676 12.8931 13.874 12.5791 13.874C12.5001 13.874 12.4201 13.862 12.3411 13.835C11.9481 13.703 11.7372 13.278 11.8682 12.885C12.0492 12.345 12.5182 11.836 13.3462 11.281C14.3672 10.597 14.2361 9.84707 14.1931 9.60107C14.0801 8.94707 13.5291 8.38988 12.8821 8.27588C12.3891 8.18588 11.9092 8.31488 11.5332 8.62988C11.1552 8.94688 10.938 9.41391 10.938 9.90991C10.938 10.3239 10.602 10.6599 10.188 10.6599C9.77399 10.6599 9.43799 10.3239 9.43799 9.90991C9.43799 8.96891 9.85009 8.08396 10.5691 7.48096C11.2811 6.88496 12.2181 6.63605 13.1431 6.80005C14.4101 7.02405 15.4492 8.07097 15.6702 9.34497C15.8902 10.607 15.3611 11.7381 14.1821 12.5281Z",fill:"#FAFAF9"})})},b=function(t){var n=t.className;return e.jsx("svg",{className:"flex-shrink-0 ".concat(n),width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},w=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return s([],this.toasts,!0)},e.prototype.subscribe=function(e){var t=this;return this.listeners.add(e),function(){return t.listeners.delete(e)}},e.prototype.notifyListeners=function(){console.log("Toast: 通知监听器,监听器数量:",this.listeners.size),this.listeners.forEach(function(e){return e()})},e.prototype.clearAll=function(){this.toasts=[],this.notifyListeners()},e}(),C=new w,k=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=C.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=C.subscribe(function(){var e=C.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=o.filter(function(e){return"top-left"===e.props.position}),l=o.filter(function(e){return"top-right"===e.props.position}),s=o.filter(function(e){return"bottom-left"===e.props.position}),c=o.filter(function(e){return"bottom-right"===e.props.position});return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:l.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e.jsx(F,r({},t),t.id)})}),e.jsx("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e.jsx(F,r({},t),t.id)})})]})},F=function(n){var o=n.id,r=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),c=s[0],d=s[1],u=r.message,p=r.type,f=void 0===p?"info":p,h=r.duration,x=void 0===h?3e3:h,g=r.icon,v=r.action,m=r.showClose,w=void 0===m||m,k=r.onClose,F=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:y.success};case"error":return{bgColor:"#E7000B",defaultIcon:y.error};case"question":return{bgColor:"#1C1917",defaultIcon:y.question};default:return{bgColor:"#1447E6",defaultIcon:y.info}}}(f);t.useEffect(function(){var e=setTimeout(function(){l(!0)},10);return function(){return clearTimeout(e)}},[]),t.useEffect(function(){if(x>0){var e=setTimeout(function(){S()},x);return function(){return clearTimeout(e)}}},[x,o]);var S=t.useCallback(function(){d(!0),setTimeout(function(){C.removeToast(o),null==k||k()},300)},[o,k]),D=t.useCallback(function(){null==F||F()},[F]);return e.jsx("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!c?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!c?1:0,transition:"all 300ms ease-out",position:"relative",cursor:F?"pointer":"default"},onClick:D,children:e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:j.bgColor,color:"white"},children:[e.jsx("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:g||j.defaultIcon}),e.jsxs("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e.jsx("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:u}),v&&e.jsx("div",{style:{marginTop:"12px"},children:v})]}),w&&e.jsx("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(b,{})})]})})},j=function(e){return console.log("Toast: 调用 toast 函数",e),M(),setTimeout(function(){var t=C.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},S=null,D=null,z=!1,M=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(z)console.log("Toast: 容器正在初始化中,跳过");else if(S)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),z=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),S=t,void(z=!1);console.log("Toast: 创建容器元素"),(S=document.createElement("div")).id="aha-toast-container",document.body.appendChild(S),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(k,{})),console.log("Toast: 容器渲染完成"),z=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),D=n(S),console.log("Toast: 渲染 ToastContainer 组件"),D.render(e.jsx(k,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}z=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),z=!1})}}catch(e){console.error("Toast: 创建容器失败",e),z=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},L={sm:{basePx:8,basePy:3,plCheckbox:5,plAvatar:4,plDot:6,plIcon:4,prClose:4,prCount:4,fontSize:12,lineHeight:"18px",height:24,avatarSize:16,checkboxSize:14,contentGap:4,rootGap:3,countPx:4,countFontSize:12,closeSize:10,closePad:2},md:{basePx:9,basePy:2,plCheckbox:4,plAvatar:5,plDot:7,plIcon:5,prClose:4,prCount:3,fontSize:14,lineHeight:"20px",height:24,avatarSize:16,checkboxSize:16,contentGap:5,rootGap:4,countPx:5,countFontSize:12,closeSize:12,closePad:2},lg:{basePx:10,basePy:4,plCheckbox:5,plAvatar:7,plDot:9,plIcon:7,prClose:4,prCount:4,fontSize:14,lineHeight:"20px",height:28,avatarSize:18,checkboxSize:18,contentGap:6,rootGap:4,countPx:6,countFontSize:14,closeSize:14,closePad:3}},T=function(n){var o=n.src,r=n.alt,i=void 0===r?"Avatar":r,a=n.size,l=void 0===a?16:a,s=t.useState(!1),c=s[0],d=s[1];return e.jsx("div",{style:{width:l,height:l,borderRadius:"50%",overflow:"hidden",flexShrink:0,border:"0.667px solid rgba(0,0,0,0.08)",background:"#e5e5e4",display:"flex",alignItems:"center",justifyContent:"center"},children:o&&!c?e.jsx("img",{src:o,alt:i,onError:function(){return d(!0)},style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):e.jsxs("svg",{width:.625*l,height:.625*l,viewBox:"0 0 10 10",fill:"none",children:[e.jsx("circle",{cx:"5",cy:"3.5",r:"2",stroke:"#999",strokeWidth:"1.2"}),e.jsx("path",{d:"M1 9.5c0-2.2 1.8-4 4-4s4 1.8 4 4",stroke:"#999",strokeWidth:"1.2",strokeLinecap:"round"})]})})},B=t.forwardRef(function(n,o){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,c=void 0!==s&&s,d=n.error,p=void 0!==d&&d,f=n.readOnly,h=void 0!==f&&f,x=n.prefix,g=n.suffix,v=n.allowClear,m=void 0!==v&&v,y=n.onClear,b=n.className,w=void 0===b?"":b,C=n.style,k=n.type,F=void 0===k?"text":k,j=n.placeholder,S=n.value,D=n.defaultValue,z=n.onChange,M=n.onFocus,E=n.onBlur,L=n.onPressEnter,T=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=u().primaryColor,A=void 0===B?"#FB6011":B,R=t.useRef(null),I=t.useState(D||S||""),W=I[0],N=I[1],H=t.useState(!1),Y=H[0],P=H[1];t.useEffect(function(){"function"==typeof o?o(R.current):o&&(o.current=R.current)},[o]);var O=void 0!==S,V=O?S:W,q=function(e){var t;e.stopPropagation(),O||N("");null==z||z({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},_=m&&V&&!c,X={small:{height:"32px",paddingTop:"3px",paddingBottom:"3px"},mediumSmall:{height:"36px",paddingTop:"5px",paddingBottom:"5px"},medium:{height:"40px",paddingTop:"7px",paddingBottom:"7px"},large:{height:"48px",paddingTop:"11px",paddingBottom:"11px"}},Z=g||_?"40px":"12px",K=r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":Y?A:"#D7D3D0"),backgroundColor:c||h?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:Z,paddingTop:X[l].paddingTop,paddingBottom:X[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},C);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:'\n .aha-input-wrapper input::placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-webkit-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input::-moz-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-input-wrapper input:-ms-input-placeholder {\n color: #D7D3D0;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-input-wrapper input {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\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"] {\n -moz-appearance: textfield;\n }\n '}),e.jsxs("div",{className:"aha-input-wrapper ".concat(w),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[x&&e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e.jsx("input",r({ref:R,type:F,value:V,placeholder:j,disabled:c,readOnly:h,onChange:function(e){O||N(e.target.value),null==z||z(e)},onFocus:function(e){P(!0),null==M||M(e)},onBlur:function(e){P(!1),null==E||E(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=T.onKeyDown)||void 0===t||t.call(T,e)},style:K,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(g||_)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[_&&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:q,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"})})},{}),g&&e.jsx("span",{style:{pointerEvents:"none"},children:g})]})]})]})});B.displayName="Input";var A=function(o){var i,a=o.value,l=o.defaultValue,c=o.options,d=void 0===c?[]:c,p=o.mode,f=o.disabled,h=void 0!==f&&f,x=o.error,g=void 0!==x&&x,v=o.placeholder,m=void 0===v?"Please select":v,y=o.size,b=void 0===y?"medium":y,w=o.showSearch,C=void 0!==w&&w,k=o.filterOption,F=void 0===k||k,j=o.allowClear,S=void 0!==j&&j,D=o.onChange,z=o.onSelect,M=o.onDeselect,E=o.onSearch,L=o.onFocus,T=o.onBlur,B=o.onDropdownVisibleChange,A=o.className,R=void 0===A?"":A,I=o.style,W=o.dropdownClassName,N=void 0===W?"":W,H=o.dropdownStyle,Y=o.defaultOpen,P=void 0!==Y&&Y,O=o.open,V=o.maxTagCount,q=o.tagRender,_=o.optionRender,X=u().primaryColor,Z=void 0===X?"#FB6011":X,K=t.useState(void 0!==l?l:p?[]:void 0),G=K[0],J=K[1],U=t.useState(P),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),re=oe[0],ie=oe[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),ce=t.useState(null),de=ce[0],ue=ce[1],pe=void 0!==a,fe=void 0!==O,he=pe?a:G,xe=fe?O:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return d.filter(function(t){return e.includes(t.value)})},[he,d]),me=t.useCallback(function(){return C&&te?!1===F?d:"function"==typeof F?d.filter(function(e){return F(te,e)}):d.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):d},[d,te,C,F]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){var e,t;if(ae.current){var n=ae.current.getBoundingClientRect(),o=null!==(t=null===(e=se.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*ye.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-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)},[xe,ye.length]),t.useEffect(function(){var e=function(e){var t=e.target;ae.current&&!ae.current.contains(t)&&se.current&&!se.current.contains(t)&&(fe||$(!1),null==B||B(!1),ne(""))};if(xe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[xe,fe,B]),t.useEffect(function(){if(xe){var e=function(e){var t;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===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,re,fe,B]),t.useEffect(function(){if(re>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[re];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[re]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,o=Array.isArray(he)?he:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=s(s([],o,!0),[e.value],!1),null==z||z(e.value,e)),pe||J(n);var r=d.filter(function(e){return n.includes(e.value)});null==D||D(n,r)}else pe||J(e.value),null==D||D(e.value,e),null==z||z(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,d,D,z,M,B]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=d.find(function(e){return e.value===t});pe||J(n),null==D||D(n,ve()),null==M||M(t,o)}},[ge,he,pe,d,D,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||J(t),null==D||D(t,[]),ne("")},ke={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"}},Fe=t.useMemo(function(){return ve()},[ve]),je=t.useMemo(function(){return S&&he&&!h},[S,he,h]),Se=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),De=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===V?Fe.slice(0,2):V?Fe.slice(0,V):Fe,o=V&&Fe.length>n.length?Fe.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 o={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(o)},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}),!h&&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)}),o>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[ge,he,Fe,V,h,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:r({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":xe?Z:"#D7D3D0"),backgroundColor:h?"#FAFAF9":"#FFFFFF",cursor:h?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:ke[b].paddingTop,paddingBottom:ke[b].paddingBottom,fontSize:ke[b].fontSize,lineHeight:ke[b].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},I),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&C?setTimeout(function(){var e;null===(e=le.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==L||L(e)},onBlur:function(e){null==T||T(e)},onTouchStart:function(e){h||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:h?-1:0,children:[e.jsx("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:ge?De||(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"}})):C&&xe?e.jsx("input",{ref:le,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==E||E(t),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:h?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Se?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Se?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Se?(null===(i=Fe[0])||void 0===i?void 0:i.label)||he:m||" "})}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[je&&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:Ce,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(t){var n=t.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:xe})]})]}),xe&&de&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(N),style:r({position:"absolute",top:"".concat(de.top,"px"),left:"".concat(de.left,"px"),width:"".concat(de.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"===de.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===de.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(t,n){var o=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,r=n===re;return _?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:_(t,{selected:o,focused:r,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return be(t)},style:{padding:"8px 16px",cursor:t.disabled?"not-allowed":"pointer",color:t.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:t.label}),o&&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:Z,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};A.displayName="Select";var R=function(t){var n=t.className,o=t.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: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"})})},I=function(t){var n=t.className,o=t.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: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"})]})},W=function(t){var n=t.className,o=t.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: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"})]})},N=function(t){var n=t.className,o=t.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: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"})})},H=function(t){var n=t.className,o=t.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: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"})})},Y=function(t){var n=t.className,o=t.style;return e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:[e.jsx("g",{clipPath:"url(#clip0_54_1653)",children:e.jsx("path",{d:"M6.06 6C6.21674 5.55444 6.5261 5.17873 6.9333 4.93942C7.34051 4.7001 7.81926 4.61262 8.28479 4.69247C8.75031 4.77232 9.17255 5.01434 9.47672 5.37568C9.78089 5.73702 9.94737 6.19434 9.94667 6.66666C9.94667 8 7.94667 8.66666 7.94667 8.66666M8 11.3333H8.00667M14.6667 8C14.6667 11.6819 11.6819 14.6667 8 14.6667C4.3181 14.6667 1.33333 11.6819 1.33333 8C1.33333 4.3181 4.3181 1.33333 8 1.33333C11.6819 1.33333 14.6667 4.3181 14.6667 8Z",stroke:"currentColor",strokeWidth:"1.33333",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_54_1653",children:e.jsx("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},P=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,d=n.defaultPageSize,p=void 0===d?10:d,f=n.showSizeChanger,h=void 0!==f&&f,x=n.pageSizeOptions,v=void 0===x?["10","20","50","100"]:x,m=n.showQuickJumper,y=void 0!==m&&m,b=n.showTotal,w=n.onChange,C=n.onShowSizeChange,k=n.simple,F=void 0!==k&&k,j=n.disabled,S=void 0!==j&&j,D=n.hideOnSinglePage,z=void 0!==D&&D,M=n.className,E=void 0===M?"":M,L=n.style,T=n.size,R=void 0===T?"default":T,I=n.responsive,W=void 0!==I&&I;n.showLessItems;var Y=n.itemRender,P=u().primaryColor,O=void 0===P?"#FB6011":P,V=t.useState(a),q=V[0],_=V[1],X=t.useState(p),Z=X[0],K=X[1],G=t.useState(""),J=G[0],U=G[1],Q=null!=o?o:q,$=null!=c?c:Z,ee=t.useMemo(function(){return Math.ceil(s/$)},[s,$]);t.useEffect(function(){void 0!==o&&_(o)},[o]),t.useEffect(function(){void 0!==c&&K(c)},[c]);var te=function(e){e<1||e>ee||e===Q||S||(void 0===o&&_(e),null==w||w(e,$))},ne=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(te(e),U(""))};if(z&&ee<=1)return null;if(F)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(E),style:L,children:[e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})})]});var oe=(Q-1)*$+1,re=Math.min(Q*$,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(E),style:r({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:W?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},L),children:[b&&e.jsx("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:b(s,[oe,re])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[s>0&&e.jsx(e.Fragment,{children:Y?Y(Q-1,"prev",e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})):e.jsx(g,{onClick:function(){return te(Q-1)},disabled:S||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(N,{})})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e.jsx(g,{onClick:function(){return te(t)},disabled:S,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(O):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(g,{onClick:function(){return te(Math.max(1,Q-5))},disabled:S,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(g,{onClick:function(){return te(Math.min(ee,Q+5))},disabled:S,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),s>0&&e.jsx(e.Fragment,{children:Y?Y(Q+1,"next",e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})})):e.jsx(g,{onClick:function(){return te(Q+1)},disabled:S||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsx(H,{})})}),h&&e.jsx(A,{value:$,options:v.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(s/t),r=Q>n?n:Q,void 0===c&&K(t),void 0===o&&_(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:S,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),y&&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(B,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:ne,disabled:S,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof y&&y.goButton?e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(g,{onClick:ne,disabled:S,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},O=function(n){var o=n.checked,i=void 0!==o&&o,a=n.indeterminate,l=void 0!==a&&a,s=n.disabled,c=void 0!==s&&s,d=n.onChange,u=n.className,p=void 0===u?"":u,f=n.style,h=n.children,x=n.size,g=void 0===x?"sm":x,v=n.hint,m=n.isFocused,y=t.useState(!1),b=y[0],w=y[1],C=t.useState(!1),k=C[0],F=C[1],j=i||l,S=null!=m?m:k,D=function(){c||(null==d||d({target:{checked:!i},currentTarget:{checked:!i}}))},z="sm"===g?"16px":"20px",M="sm"===g?"12px":"14px",E="sm"===g?"var(--radius-xs, 4px)":"var(--radius-sm, 6px)",L="sm"===g?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",T="sm"===g?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",B="sm"===g?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",A=c&&j?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)",R=h||v;return e.jsxs("div",{className:"aha-checkbox ".concat(p),role:"checkbox","aria-checked":l?"mixed":i,"aria-disabled":c,tabIndex:c?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:B,cursor:c?"not-allowed":"pointer",outline:"none"},f),onClick:D,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),D())},onMouseEnter:function(){return!c&&w(!0)},onMouseLeave:function(){return w(!1)},onFocus:function(){return!c&&F(!0)},onBlur:function(){return F(!1)},children:[e.jsxs("div",{style:{position:"relative",width:z,height:z,minWidth:z,minHeight:z,flexShrink:0,borderRadius:E,border:c?"1px solid var(--color-border-disabled, #d7d3d0)":j?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:c?"var(--color-bg-disabled_subtle, #fafaf9)":j?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:S?"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:M,height:M,color:A,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:M,height:M,color:A,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"===g?"var(--spacing-xxs, 2px)":"0"},children:[h&&e.jsx("span",{style:{fontSize:L,lineHeight:T,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:c?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:h}),v&&e.jsx("span",{style:{fontSize:L,lineHeight:T,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:v})]})]})};O.displayName="Checkbox";var V=function(t){var n=t.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"})]})]})},q=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e.jsx(V,{color:o}):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})},_=function(e,t){return"string"==typeof t?null==e?void 0:e[t]:t.reduce(function(e,t){return null==e?void 0:e[t]},e)},X=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=_(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},Z=function(t){var n=t.order,o=u().primaryColor;return"ascend"===n?e.jsx(W,{style:{color:o}}):"descend"===n?e.jsx(I,{style:{color:o}}):e.jsx(R,{})},K=function(n){var o=n.checked,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,s=n.onChange,c=n.className,d=void 0===c?"":c,u=n.style,p=n.children,f=n.value;n.name;var h=n.size,x=void 0===h?"sm":h,g=n.hint,v=n.isFocused,m=t.useState(!1),y=m[0],b=m[1],w=t.useState(!1),C=w[0],k=w[1],F=null!=v?v:C,j=function(){l||i||(null==s||s({target:{checked:!0,value:f},currentTarget:{checked:!0,value:f}}))},S="sm"===x?"16px":"20px",D="sm"===x?"6px":"8px",z="sm"===x?"var(--font-size-text-sm, 14px)":"var(--font-size-text-md, 16px)",M="sm"===x?"var(--line-height-text-sm, 20px)":"var(--line-height-text-md, 24px)",E="sm"===x?"var(--spacing-md, 8px)":"var(--spacing-lg, 12px)",L=p||g,T=l&&i?"var(--color-fg-disabled_subtle, #d7d3d0)":"var(--color-fg-white, #ffffff)";return e.jsxs("div",{className:"aha-radio ".concat(d),role:"radio","aria-checked":i,"aria-disabled":l,tabIndex:l?-1:0,style:r({display:"inline-flex",alignItems:"flex-start",gap:E,cursor:l?"not-allowed":"pointer",outline:"none"},u),onClick:j,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),j())},onMouseEnter:function(){return!l&&b(!0)},onMouseLeave:function(){return b(!1)},onFocus:function(){return!l&&k(!0)},onBlur:function(){return k(!1)},children:[e.jsx("div",{style:{position:"relative",width:S,height:S,minWidth:S,minHeight:S,flexShrink:0,borderRadius:"50%",border:l?"1px solid var(--color-border-disabled, #d7d3d0)":i?y?"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:l?"var(--color-bg-disabled_subtle, #fafaf9)":i?y?"var(--color-bg-brand-solid_hover, #ec470a)":"var(--color-bg-brand-solid, #fb6011)":y?"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:F?"var(--focus-ring, 0px 0px 0px 2px #ffffff, 0px 0px 0px 4px #fb6011)":"none",marginTop:L?"2px":"0"},children:e.jsx("div",{style:{width:D,height:D,borderRadius:"50%",backgroundColor:T,opacity:i?1:0,transition:"opacity 0.15s",pointerEvents:"none",flexShrink:0}})}),L&&e.jsxs("div",{style:{display:"inline-flex",flexDirection:"column",gap:"md"===x?"var(--spacing-xxs, 2px)":"0"},children:[p&&e.jsx("span",{style:{fontSize:z,lineHeight:M,fontWeight:"var(--font-weight-medium, 500)",fontFamily:'var(--font-family-body, "DM Sans", sans-serif)',color:l?"var(--color-text-disabled, #79716b)":"var(--color-text-secondary, #44403c)",userSelect:"none"},children:p}),g&&e.jsx("span",{style:{fontSize:z,lineHeight:M,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})]})]})};K.displayName="Radio";var G=/^(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,J=/(https?:\/\/[^\s<]+|www\.[^\s<]+|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[^\s<]*)?)/gi,U=new Set(["com","cn","net","org","io","co","edu","gov","ai","app","dev","me","info","biz","tech","cc","tv","xyz","top","vip","pro","store","site","online","cloud"]),Q=function(e,t,n,o){if(void 0===t&&(t=!0),void 0===n&&(n=!0),!e||"string"!=typeof e)return!1;var r=e.trim();if(!r)return!1;var i=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(r);if(t&&!i)return!1;var a=i?r:"https://".concat(r);try{var l=new URL(a),s=l.protocol.toLowerCase();if("http:"!==s&&"https:"!==s)return!1;if(n){var c=l.hostname.toLowerCase();if(!c)return!1;if("localhost"===c)return!0;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(c))return c.split(".").every(function(e){var t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255});if(!G.test(c))return!1;var d=c.split(".").pop()||"";if(!(o?new Set(o.map(function(e){return e.toLowerCase()})):U).has(d))return!1}return!0}catch(e){return!1}},$=function(e){var t=e.match(/^(.*?)([),.;!?]+)?$/);return{core:(null==t?void 0:t[1])||e,suffix:(null==t?void 0:t[2])||""}},ee=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")},te=function(e){return e.replace(new RegExp("​","g"),"")},ne=function(e,t,n){var o=function(e,t){var n,o;if(!e)return[];for(var r=[],i=0,a=new RegExp(J),l=a.exec(e);l;){var s=l[0],c=l.index,d=c+s.length;c>i&&r.push({type:"text",text:e.slice(i,c)});var u=$(s),p=u.core,f=u.suffix,h=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(p)?p:"https://".concat(p),x=Q(p,null!==(n=null==t?void 0:t.needProtocol)&&void 0!==n&&n,null===(o=null==t?void 0:t.needHost)||void 0===o||o,null==t?void 0:t.allowedTlds);((null==t?void 0:t.validate)?t.validate(h):x)&&p?(r.push({type:"url",text:p,href:h}),f&&r.push({type:"text",text:f})):r.push({type:"text",text:s}),i=d,l=a.exec(e)}return i<e.length&&r.push({type:"text",text:e.slice(i)}),r}(e,t);if(0===o.length)return"";var r=o.map(function(e){if("text"===e.type)return ee(e.text);var o=(null==t?void 0:t.className)?' class="'.concat(t.className,'"'):"",r=n?"pointer-events: none;":"";return'<a href="'.concat(ee(e.href),'" target="_blank" rel="noopener noreferrer"').concat(o,' style="color: #2563EB; text-decoration: underline; ').concat(r,'">').concat(ee(e.text),"</a>")}).join("");return e.endsWith("\n")?"".concat(r,'<span data-aha-zwsp="true">').concat("​","</span>"):r},oe=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return 0;var n=t.getRangeAt(0);if(!e.contains(n.startContainer))return 0;var o=n.cloneRange();return o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),te(o.toString()).length},re=t.forwardRef(function(n,o){var a=n.disabled,l=void 0!==a&&a,s=n.error,c=void 0!==s&&s,d=n.readOnly,p=void 0!==d&&d,f=n.showCount,h=void 0!==f&&f,x=n.maxLength,g=n.className,v=void 0===g?"":g,m=n.style,y=n.placeholder,b=n.value,w=n.defaultValue,C=n.rows,k=void 0===C?3:C,F=n.autoSize,j=void 0!==F&&F,S=n.onChange,D=n.onFocus,z=n.onBlur,M=n.linkify,E=void 0!==M&&M,L=n.linkifyOptions,T=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur","linkify","linkifyOptions"]),B=u().primaryColor,A=void 0===B?"#FB6011":B,R=t.useRef(null),I=t.useRef(null),W=t.useRef(!1),N=t.useRef(null),H=t.useState(w||b||""),Y=H[0],P=H[1],O=t.useState(!1),V=O[0],q=O[1],_=t.useState(void 0),X=_[0],Z=_[1];t.useEffect(function(){"function"==typeof o?o(E?null:R.current):o&&(o.current=E?null:R.current)},[o,E]);var K=void 0!==b,G=K?b:Y,J=String(G||"").length,U=function(e){q(!0),null==D||D(e)},Q=function(e){q(!1),null==z||z(e)},$=t.useMemo(function(){return"number"==typeof x?x:void 0},[x]);t.useEffect(function(){if(!E&&j&&R.current){var e=R.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),Z(l)}},[G,j,E]),t.useEffect(function(){if(E&&j&&I.current){var e=I.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0,o=parseInt(window.getComputedStyle(e).lineHeight||"24",10),r=t*o+24,i=n?n*o+24:void 0;e.style.height="auto";var a=Math.max(e.scrollHeight,r);i&&(a=Math.min(a,i)),e.style.height="".concat(a,"px"),e.style.overflowY=i&&e.scrollHeight>i?"auto":"hidden",Z(a)}},[j,G,E]),t.useLayoutEffect(function(){var e;if(E&&I.current&&!W.current){var t=I.current,n=document.activeElement===t,o=n?oe(t):0,r=null!==(e=N.current)&&void 0!==e?e:o,i=ne(String(G||""),L,l);if(t.innerHTML!==i&&(t.innerHTML=i),n){var a=String(G||"").length;!function(e,t){var n=document.createRange(),o=window.getSelection();if(o){for(var r=Math.max(0,t),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=i.nextNode();a;){for(var l=a.textContent||"",s=0,c=-1,d=0;d<l.length;d+=1)if("​"!==l[d]&&(s+=1),s===r){c=d+1;break}if(0===r)return n.setStart(a,0),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);if(-1!==c)return n.setStart(a,c),n.collapse(!0),o.removeAllRanges(),void o.addRange(n);r-=s,a=i.nextNode()}n.selectNodeContents(e),n.collapse(!1),o.removeAllRanges(),o.addRange(n)}}(t,Math.min(r,a))}N.current=null}},[G,l,E,L]);var ee=function(e){null==S||S({target:{value:e},currentTarget:{value:e}})},re=function(){if(I.current&&!W.current){N.current=oe(I.current);var e=te(I.current.textContent||""),t=$?e.slice(0,$):e;K||P(t),ee(t)}},ie=r(r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":V?A:"#D7D3D0"),backgroundColor:l||p?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:j||E?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==X&&j?{height:"".concat(X,"px")}:{}),m);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-textarea-wrapper .aha-textarea-editable {\n white-space: pre-wrap;\n word-break: break-word;\n }\n .aha-textarea-wrapper .aha-textarea-editable:empty::before {\n content: attr(data-placeholder);\n color: #79716B;\n }\n .aha-textarea-wrapper .aha-textarea-editable a {\n color: #2563EB;\n }\n "}),e.jsxs("div",{className:"aha-textarea-wrapper ".concat(v),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[E?e.jsx("div",{ref:I,className:"aha-textarea-editable",contentEditable:!l&&!p,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-disabled":l,"data-placeholder":y||"",onInput:re,onPaste:function(e){var t;if(e.preventDefault(),!p&&!l){var n,o,r=e.clipboardData.getData("text/plain"),i=String(G||""),a=window.getSelection(),s="".concat(i).concat(r),c=i.length+r.length;if(a&&a.rangeCount>0&&(null===(t=I.current)||void 0===t?void 0:t.contains(a.anchorNode))){var d=oe(I.current),u=(n=a.getRangeAt(0),(o=n.cloneRange()).selectNodeContents(I.current),o.setEnd(n.endContainer,n.endOffset),o.toString().length);s=i.slice(0,d)+r+i.slice(u),c=d+r.length}$&&(s=s.slice(0,$),c=Math.min(c,s.length)),N.current=c,K||P(s),ee(s)}},onKeyDown:function(e){var t,n;if("Enter"===e.key&&!e.nativeEvent.isComposing&&!l&&!p&&I.current){e.preventDefault();var o=String(G||""),r=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;var o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset);var r=n.cloneRange();return r.selectNodeContents(e),r.setEnd(n.endContainer,n.endOffset),{start:te(o.toString()).length,end:te(r.toString()).length}}(I.current),i=null!==(t=null==r?void 0:r.start)&&void 0!==t?t:o.length,a=null!==(n=null==r?void 0:r.end)&&void 0!==n?n:i,s="".concat(o.slice(0,i),"\n").concat(o.slice(a));$&&(s=s.slice(0,$));var c=Math.min(i+1,s.length);N.current=c,K||P(s),ee(s)}},onFocus:function(e){return U(e)},onBlur:function(e){return Q(e)},onCompositionStart:function(){W.current=!0},onCompositionEnd:function(){W.current=!1,re()},style:r(r({},ie),{minHeight:j?void 0:"".concat(24*k+24,"px"),overflowY:j?"hidden":"auto"}),autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1}):e.jsx("textarea",r({ref:R,value:G,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:k,maxLength:x,onChange:function(e){K||P(e.target.value),null==S||S(e)},onFocus:U,onBlur:Q,style:ie,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[J," / ",x]}):e.jsx("span",{children:J})})]})]})});re.displayName="Textarea";var ie=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,c=n.onChange,d=n.onClick,p=n.checkedChildren,f=n.unCheckedChildren,h=n.size,x=void 0===h?"default":h,g=n.loading,v=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=u().primaryColor,C=void 0===w?"#FB6011":w,k=t.useState(a),F=k[0],j=k[1],S=void 0!==o,D=S?o:F,z={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],M=D||v,E=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(z.thumbSize," - ").concat(z.thumbOffset,")"):z.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":D,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!D;S||j(t),null==c||c(t,e),null==d||d(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:z.width,height:z.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:E,cursor:s||v?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(p||f)&&e.jsx("span",{style:{position:"absolute",left:M?"6px":"auto",right:M?"auto":"6px",fontSize:z.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:s?.5:1,zIndex:1,pointerEvents:"none"},children:M?p:f}),e.jsx("span",{style:{position:"absolute",left:L,top:"50%",transform:"translateY(-50%)",width:z.thumbSize,height:z.thumbSize,borderRadius:"50%",backgroundColor:"#FFFFFF",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.2)",transition:"left 0.2s, background-color 0.2s",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2},children:v&&e.jsxs("svg",{width:"small"===x?"8":"10",height:"small"===x?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e.jsx("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};ie.displayName="Switch";var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],le=["January","February","March","April","May","June","July","August","September","October","November","December"],se=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),le[o]).replace(new RegExp("","g"),ae[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},ce=function(e,t){return new Date(e,t+1,0).getDate()},de=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},ue=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},pe=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,c=o.error,d=void 0!==c&&c,p=o.placeholder,f=void 0===p?"Select date":p,h=o.startPlaceholder,x=void 0===h?"Start date":h,g=o.endPlaceholder,v=void 0===g?"End date":g,m=o.size,y=void 0===m?"medium":m,b=o.allowClear,w=void 0!==b&&b,C=o.format,k=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,F=o.onFocus,j=o.onBlur,S=o.onOpenChange,D=o.className,z=void 0===D?"":D,M=o.style,E=o.dropdownClassName,L=void 0===E?"":E,T=o.dropdownStyle,B=o.defaultOpen,A=void 0!==B&&B,R=o.open,I=o.minDate,W=o.maxDate,N=o.separator,H=void 0===N?" - ":N,Y=o.presetRanges,P=void 0!==Y&&Y,O=o.calendarCount,V=void 0===O?1:O,q=o.showApplyCancel,_=void 0!==q&&q,X=o.applyText,Z=void 0===X?"Apply":X,K=o.cancelText,G=void 0===K?"Cancel":K,J=o.onApply,U=o.onCancel,Q=o.showSelectedRange,$=void 0!==Q&&Q,ee=o.startSelectedRangeText,te=void 0===ee?"Select dates":ee,ne=o.endSelectedRangeText,oe=void 0===ne?"Select dates":ne,re=o.rangeDisplayMode,ie=void 0===re?"range":re,ae=u().primaryColor,pe=void 0===ae?"#FB6011":ae,fe="range"===a,he=t.useState(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),xe=he[0],ge=he[1],ve=t.useState(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),me=ve[0],ye=ve[1],be=t.useState(A),we=be[0],Ce=be[1],ke=t.useState(!0),Fe=ke[0],je=ke[1],Se=t.useState(null),De=Se[0],ze=Se[1],Me=t.useState(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ee=Me[0],Le=Me[1],Te=t.useState(function(){if(2===V&&fe){var e=new Date(Ee.year,Ee.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=Te[0],Ae=Te[1];t.useEffect(function(){if(2===V&&fe){var e=new Date(Ee.year,Ee.month+1,1);Ae({year:e.getFullYear(),month:e.getMonth()})}else Ae(null)},[Ee,V,fe]);var Re=t.useRef(null),Ie=t.useRef(null),We=t.useRef(null),Ne=t.useRef(null),He=t.useRef(null),Ye=t.useState(null),Pe=Ye[0],Oe=Ye[1],Ve=t.useRef(!1),qe=t.useRef(!1),_e=t.useRef(null),Xe="value"in o&&void 0!==o.value,Ze=void 0!==R,Ke=fe?null:Xe&&"date"===a&&"value"in o?o.value:xe,Ge=fe?Xe&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:me:{startDate:null,endDate:null},Je=Ze?R:we;t.useEffect(function(){if(Je&&!Ve.current){if(fe){var e=Ge.startDate||Ge.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}}else if(Ke){t=Ke.getFullYear(),n=Ke.getMonth();Le({year:t,month:n})}else{o=new Date;Le({year:o.getFullYear(),month:o.getMonth()})}Ve.current=!0}else Je||(Ve.current=!1)},[Je,Ke,Ge,fe]),t.useEffect(function(){if(Je&&Re.current){qe.current=!1,_e.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==_e.current){var t,n=_e.current;if(He.current){var o=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Oe({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Oe({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(He.current){var t=He.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),qe.current=!0,_e.current=i}Oe({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Oe(null),qe.current=!1,_e.current=null},[Je]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Ze||Ce(!1),null==S||S(!1))};if(Je)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Je,Ze,S]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;ue(e,I,W)&&(Xe||ge(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||Ce(!1),null==S||S(!1))},[Xe,Ze,a,o,S,I,W]),nt=t.useCallback(function(e){var t;if(ue(e,I,W)){var n,r=_&&De?De:Ge;r.startDate&&r.endDate?(n={startDate:e,endDate:null},je(!1)):Fe?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},je(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(je(!0),_||(Ze||Ce(!1),null==S||S(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),_||(Ze||Ce(!1),null==S||S(!1))),_?ze(n):(Xe||ye(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[Fe,Ge,De,_,Xe,Ze,a,o,S,I,W]),ot=function(e){var t,n;if(e.stopPropagation(),fe){var r={startDate:null,endDate:null};Xe||ye(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else Xe||ge(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!Je){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},rt=function(){if(!s){var e=!Je;if(Ze||Ce(e),null==S||S(e),e){if(fe){if(je(!Ge.startDate),_&&ze(Ge),!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!Ke){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&_&&ze(null)}},it=t.useMemo(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(P)?P:!0===P?it:[]},[P,it]),lt=at.length>0,st=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Le({year:n,month:r})}_?ze(e):(Xe||ye(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Ze||Ce(!1),null==S||S(!1))},ct=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},dt=function(){Le(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},ut=t.useCallback(function(e,t){for(var n=ce(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),pt=t.useMemo(function(){return ut(Ee.year,Ee.month)},[Ee,ut]),ft=t.useMemo(function(){return 2===V&&fe&&Be?ut(Be.year,Be.month):null},[V,fe,Be,ut]),ht=function(){Be&&Ae(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Be&&Ae(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},gt={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"}},vt=w&&!s&&(fe?Ge.startDate||Ge.endDate:Ke),mt=Ke?se(Ke,k):"",yt=Ge.startDate?se(Ge.startDate,k):"",bt=Ge.endDate?se(Ge.endDate,k):"",wt=t.useMemo(function(){if(!fe||"text"!==ie)return"";if(Ge.startDate&&Ge.endDate){var e=se(Ge.startDate,"MMM D, YYYY"),t=se(Ge.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Ge.startDate?se(Ge.startDate,"MMM D, YYYY"):Ge.endDate?se(Ge.endDate,"MMM D, YYYY"):""},[fe,ie,Ge,H]),Ct=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];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 @keyframes dropdownFadeInTop {\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:Re,className:"aha-date-picker ".concat(z),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":Je?pe:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:vt?"30px":"12px",paddingTop:gt[y].paddingTop,paddingBottom:gt[y].paddingBottom,fontSize:gt[y].fontSize,lineHeight:gt[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:rt,onFocus:function(e){null==F||F(e)},onBlur:function(e){null==j||j(e)},tabIndex:s?-1:0,children:[e.jsx("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:s?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children: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",children:e.jsx("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),fe?"text"===ie?e.jsx("input",{ref:Ie,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate||Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:We,type:"text",value:yt,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!0),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsx("span",{style:{color:s?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:H}),e.jsx("input",{ref:Ne,type:"text",value:bt,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){if(e.stopPropagation(),!s)if(je(!1),Je){if(!Ge.startDate&&!Ge.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:Ie,type:"text",value:mt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||rt()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ke?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),vt&&e.jsx("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children: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:ot,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"})})},{})})]}),Je&&Pe&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Pe.top,"px"),left:"".concat(Pe.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Pe.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Pe.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},T),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:fe&&lt&&1===V?"column":"row"},children:[fe&&lt&&2===V&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:_?"0":"8px"},children:at.map(function(t,n){var o=De?de(t.range.startDate,De.startDate)&&de(t.range.endDate,De.endDate):de(t.range.startDate,Ge.startDate)&&de(t.range.endDate,Ge.endDate);return e.jsx("div",{onClick:function(){return st(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),e.jsxs("div",{children:[e.jsx("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===V?"row":"column",gap:2===V?"24px":"0"},children:(et=function(t,n,o,r,i){return void 0===i&&(i=0),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:2===V&&fe?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===V&&fe&&1===i)&&e.jsx("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&fe?"absolute":"relative",left:2===V&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[le[t.month]," ",t.year]}),!(2===V&&fe&&0===i)&&e.jsx("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===V&&fe?"absolute":"relative",right:2===V&&fe?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),fe&&$&&1===V&&0===i&&(a=_&&De?De:Ge,l=a.startDate?se(a.startDate,"MMM D, YYYY"):te,s=a.endDate?se(a.endDate,"MMM D, YYYY"):oe,e.jsxs("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.startDate?"text-[#44403C]":"text-[#79716B]"),children:l}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(a.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),fe&&lt&&1===V&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var o=De?de(t.range.startDate,De.startDate)&&de(t.range.endDate,De.endDate):de(t.range.startDate,Ge.startDate)&&de(t.range.endDate,Ge.endDate);return e.jsx("button",{type:"button",onClick:function(){return st(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?pe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Ct.map(function(t){return e.jsx("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e.jsx("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,r,i=(o=t.year,r=t.month,new Date(o,r,1).getDay()),a=(0===i?7:i)-1,l=[],s=0;s<a;s++)l.push(e.jsx("div",{},"empty-".concat(s)));return n.forEach(function(n,o){if(n){var r=a+o,i=n.getMonth()===t.month,s=de(n,new Date),c=!ue(n,I,W);if(fe){var d=_&&De?De:Ge,u=de(n,d.startDate),p=de(n,d.endDate),f=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(n,d.startDate,d.endDate),h=r%7==0,x=r%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(g||v)m.background=pe,m.borderRadius="50%",m.color="#FFFFFF",m.fontWeight=500;else if(f){m.background="#F5F5F4",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=ce(t.year,t.month),w=n.getDate()===b,C=h||y,k=x||w;C&&k?m.borderRadius="18px":C?(m.borderTopLeftRadius="18px",m.borderBottomLeftRadius="18px",m.borderTopRightRadius="0",m.borderBottomRightRadius="0"):k?(m.borderTopRightRadius="18px",m.borderBottomRightRadius="18px",m.borderTopLeftRadius="0",m.borderBottomLeftRadius="0"):m.borderRadius="0"}else m.background="transparent",m.borderRadius="50%",m.color=i?c?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){c||g||v||(e.currentTarget.style.backgroundColor=f?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){g||v||(e.currentTarget.style.backgroundColor=f?"#F5F5F4":"transparent")},children:[n.getDate(),s&&e.jsx("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:g||v?"#FFFFFF":pe}})]},"date-".concat(o)))}else{var F=de(n,Ke);l.push(e.jsxs("button",{type:"button",disabled:c,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:F?pe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:F?500:400,color:F?"#FFFFFF":i?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||F||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){F||(e.currentTarget.style.backgroundColor="transparent")},children:[n.getDate(),s&&!F&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:pe}})]},"date-".concat(o)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ee,pt,ct,dt,0),2===V&&fe&&Be&&ft&&et(Be,ft,ht,xt,1)]}))}),fe&&$&&2===V&&!_&&(Ue=Ge,Qe=Ue.startDate?se(Ue.startDate,"MMM D, YYYY"):te,$e=Ue.endDate?se(Ue.endDate,"MMM D, YYYY"):oe,e.jsx("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.startDate?"text-[#44403C]":"text-[#79716B]"),children:Qe}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(Ue.endDate?"text-[#44403C]":"text-[#79716B]"),children:$e})]})})),fe&&_&&e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[$&&2===V&&function(){var t=De||Ge,n=t.startDate?se(t.startDate,"MMM D, YYYY"):te,o=t.endDate?se(t.endDate,"MMM D, YYYY"):oe;return e.jsxs("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.startDate?"text-[#44403C]":"text-[#79716B]"),children:n}),e.jsx("div",{children:H}),e.jsx("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(t.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),e.jsxs("div",{className:"".concat(2===V?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){ze(null),null==U||U(),Ze||Ce(!1),null==S||S(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:G}),e.jsx("button",{type:"button",onClick:function(){var e;De&&(Xe||ye(De),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,De)),null==J||J(De),Ze||Ce(!1),null==S||S(!1),ze(null))},disabled:!De||!De.startDate||!De.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:De&&De.startDate&&De.endDate?pe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:De&&De.startDate&&De.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){De&&De.startDate&&De.endDate&&(e.currentTarget.style.backgroundColor=pe)},children:Z})]})]})]})]})}),document.body)]})};pe.displayName="DatePicker";var fe=t.createContext(null),he=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),xe=t.forwardRef(function(n,o){var i=n.initialValues,s=void 0===i?{}:i,c=n.onValuesChange,d=n.onFinish,u=n.onFinishFailed,p=n.labelWidth,f=void 0===p?"120px":p,h=n.labelAlign,x=void 0===h?"right":h,g=n.layout,v=void 0===g?"horizontal":g;n.size;var m=n.className,y=void 0===m?"":m,b=n.style,w=n.children,C=t.useState(function(){var e={};return Object.keys(s).forEach(function(t){e[t]={value:s[t],error:void 0,touched:!1,validating:!1}}),e}),k=C[0],F=C[1],j=t.useRef(k);t.useEffect(function(){j.current=k},[k]);var S=t.useRef({}),D=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),z=t.useCallback(function(e,t){F(function(n){var o=r({},n);if(o[e]?o[e]=r(r({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=r(r({},j.current[e]),{value:t}):j.current[e]={value:t,error:void 0,touched:!1,validating:!1},c){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),c(i,a)}return o})},[c]),M=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),E=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{error:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),T=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{touched:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),B=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),A=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=r(r({},j.current[e]),{validating:t})),F(function(n){var o=r({},n);return o[e]?o[e]=r(r({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),R=t.useRef();R.current=function(e,t){F(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var c=o[l],d=i[l];if((null==c?void 0:c.required)!==(null==d?void 0:d.required)||(null==c?void 0:c.message)!==(null==d?void 0:d.message)||(null==c?void 0:c.type)!==(null==d?void 0:d.type)||(null==c?void 0:c.pattern)!==(null==d?void 0:d.pattern)||(null==c?void 0:c.min)!==(null==d?void 0:d.min)||(null==c?void 0:c.max)!==(null==d?void 0:d.max)||(null==c?void 0:c.len)!==(null==d?void 0:d.len)||(null==c?void 0:c.whitespace)!==(null==d?void 0:d.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var u=r({},n);return u[e]?u[e]=r(r({},u[e]),{rules:t.rules,required:t.required}):u[e]={value:s[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},u})};var I=t.useCallback(function(e,t){var n;null===(n=R.current)||void 0===n||n.call(R,e,t)},[]),W=t.useCallback(function(e){delete S.current[e],F(function(t){var n=r({},t);return delete n[e],n}),delete j.current[e]},[]),N=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,i,a,s,c,d,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];A(e,!0),n=t.rules||[],i=0,a=n,l.label=1;case 1:if(!(i<a.length))return[3,6];if(s=a[i],c=t.value,s.required&&(null==c||""===c))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=c&&""!==c&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[s.type])&&!d(c))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=c&&""!==c&&!s.pattern.test(String(c)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=c&&""!==c&&("string"==typeof c?c.length:Number(c))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof c&&c.trim()!==c)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,c)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),o=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return i++,[3,1];case 6:return j.current[e]?j.current[e]=r(r({},j.current[e]),{error:o,validating:!1,touched:!0}):j.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},F(function(n){var i=r({},n);return i[e]?i[e]=r(r({},i[e]),{error:o,validating:!1,touched:!0}):i[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,o]}})})},[]),H=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var o;n[e]=null===(o=t[e])||void 0===o?void 0:o.value}),n},[]),Y=t.useCallback(function(e){return a(void 0,void 0,void 0,function(){var t,n,o,r,i;return l(this,function(s){switch(s.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return a(void 0,void 0,void 0,function(){var n,o;return l(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return s.sent().forEach(function(e){var t=e.name,n=e.error;n&&o.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(s.sent(),o.length>0)throw r=H(),i={values:r,errorFields:o},null==u||u(i),new he("Form validation failed",r,o);return[2,H()]}})})},[N,H,u]),P=t.useCallback(function(e){F(function(t){var n=r({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=r(r({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}),j.current[e]=r({},n[e]))}),n})},[s]),O=t.useCallback(function(e){F(function(t){var n=r({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=r(r({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},j.current[t]=r({},n[t])}),c){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),c(e,o)}return n})},[c]),V=t.useCallback(function(){return a(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,Y()];case 1:return e=t.sent(),null==d||d(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[Y,d]),q=t.useCallback(function(e){if(F(function(t){var n=r({},t);return e.forEach(function(e){var t=e.name,o=e.value,i=e.errors,a=i&&i.length>0?i[0]:void 0;n[t]?n[t]=r(r(r({},n[t]),void 0!==o&&{value:o}),{error:a,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:a,touched:!0,validating:!1},j.current[t]=r({},n[t])}),n}),c&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return c(t,H())},0)}},[c,H]),_=t.useCallback(function(e,t){t?S.current[e]=t:delete S.current[e]},[]),X=t.useCallback(function(e,t){var n=S.current[e];null==n||n.scrollIntoView(r({behavior:"smooth",block:"center"},t))},[]);t.useImperativeHandle(o,function(){return{getFieldValue:D,getFieldsValue:H,setFieldValue:z,setFieldsValue:O,setFields:q,getFieldError:M,validateField:N,validateFields:Y,resetFields:P,submit:V,scrollToField:X}});var Z=t.useMemo(function(){return{fields:k,getFieldValue:D,setFieldValue:z,getFieldError:M,setFieldError:E,isFieldTouched:L,setFieldTouched:T,isFieldValidating:B,setFieldValidating:A,registerField:I,unregisterField:W,validateField:N,validateFields:Y,resetFields:P,getFieldsValue:H,setFieldsValue:O,setFields:q,submit:V,scrollToField:X,registerFieldRef:_,labelWidth:f,labelAlign:x}},[k,D,z,M,E,L,T,B,A,I,W,N,Y,P,H,O,q,V,X,_,f,x]),K=r({},b);return"vertical"===v?(K.display="flex",K.flexDirection="column"):"inline"===v&&(K.display="inline-flex",K.flexWrap="wrap",K.gap="16px"),e.jsx(fe.Provider,{value:Z,children:e.jsx("form",{className:"aha-form ".concat(y),style:K,onSubmit:function(e){return a(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,Y()];case 2:return t=n.sent(),null==d||d(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});xe.displayName="Form";var ge=xe;ge.Item=function(n){var o=n.name,i=n.label,a=n.htmlFor;n.labelCol,n.wrapperCol;var l=n.required,s=void 0!==l&&l,c=n.rules,d=void 0===c?[]:c;n.hasFeedback;var u=n.validateStatus,p=n.help,f=n.extra,h=n.className,x=void 0===h?"":h,g=n.style,v=n.children;n.labelAlign,n.labelWidth;var m=n.hidden,y=void 0!==m&&m,b=n.tooltip,w=t.useContext(fe),C=t.useRef(null),k=t.useCallback(function(e){C.current=e,o&&(null==w?void 0:w.registerFieldRef)&&w.registerFieldRef(o,e)},[o,w]),F=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var j=o&&w?w.getFieldError(o):void 0,S=!(!o||!w)&&w.isFieldTouched(o),D=!(!o||!w)&&w.isFieldValidating(o);o&&F[o];var z=u||(j?"error":D?"validating":S&&!j?"success":void 0),M=void 0!==p?p:j||void 0,E=t.useRef(d),L=t.useRef(s),T=t.useRef(!1),B=s||d.some(function(e){return e.required}),A=t.useMemo(function(){if(!T.current)return T.current=!0,!0;if(E.current.length!==d.length)return!0;if(E.current===d)return!1;for(var e=0;e<d.length;e++){var t=E.current[e],n=d[e];if((null==t?void 0:t.required)!==(null==n?void 0:n.required)||(null==t?void 0:t.message)!==(null==n?void 0:n.message)||(null==t?void 0:t.type)!==(null==n?void 0:n.type)||(null==t?void 0:t.pattern)!==(null==n?void 0:n.pattern)||(null==t?void 0:t.min)!==(null==n?void 0:n.min)||(null==t?void 0:t.max)!==(null==n?void 0:n.max)||(null==t?void 0:t.len)!==(null==n?void 0:n.len)||(null==t?void 0:t.whitespace)!==(null==n?void 0:n.whitespace))return!0}return!1},[d]);t.useEffect(function(){if(o&&w)return(!E.current||A||L.current!==s)&&(E.current=d,L.current=s,w.registerField(o,{rules:d,required:B})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:k,className:"aha-form-item ".concat(x),style:r({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[i&&e.jsxs("label",{htmlFor:a,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[i,B&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,r=t.useState(!1),i=r[0],a=r[1],l=t.useRef(null);return t.useEffect(function(){var e=function(e){l.current&&!l.current.contains(e.target)&&a(!1)};if(i)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[i]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),a(!i)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(Y,{})}),i&&e.jsxs("div",{ref:l,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[o,e.jsx("div",{style:{position:"absolute",top:"-4px",left:"50%",transform:"translateX(-50%)",width:0,height:0,borderLeft:"4px solid transparent",borderRight:"4px solid transparent",borderBottom:"4px solid #1C1917"}})]})]})},{content:b})]}),e.jsxs("div",{style:{width:"100%"},children:[e.jsx("div",{children:t.Children.map(v,function(e){return t.isValidElement(e)?function(e){var n,i,a,l,s,c,d,u,p;if(!t.isValidElement(e))return e;var f=r({},e.props);if(o&&w){var h=w.getFieldValue(o),x=w.setFieldValue;if(!x)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var v=g.displayName;if("Input"===v||"Textarea"===v){f.value=h||"";var m=null===(n=e.props)||void 0===n?void 0:n.onChange,y=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==m||m(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==y||y(e)},f.error="error"===z}else if("Select"===v){f.value=h;var b=null===(a=e.props)||void 0===a?void 0:a.onChange,C=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==b||b(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==C||C(e)},f.error="error"===z}else if("Switch"===v){f.checked=h||!1;var k=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==k||k(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===v){f.checked=h||!1;var F=null===(c=e.props)||void 0===c?void 0:c.onChange;f.onChange=function(e){x(o,e.target.checked),null==F||F(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Radio"===v){var j=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==j){f.checked=h===j;var S=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,j),null==S||S(e),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}}}else{void 0!==h&&(f.value=h);var D=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(o,r),null==D||D(e)}}}return"error"===z&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),M&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===z?"#D92D20":"warning"===z?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:M}),f&&!M&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})},ge.useForm=function(){return[t.useRef(null)]};var ve=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,l=n.selectedKeys,c=n.defaultSelectedKeys,d=void 0===c?[]:c,p=n.onSelect,f=n.onDeselect,h=n.onClick,x=n.className,g=void 0===x?"":x,v=n.style,m=n.width,y=void 0===m?320:m;u().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==l,k=t.useState(d),F=k[0],j=k[1],S=C?l:F,D=function(e){return"children"in e&&Array.isArray(e.children)},z=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(D(i)){var a=z(e,i.children,n);if(a)return a}else{var l=i,c=s(s([],n,!0),[l.key],!1);if(l.key===e)return c}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=z(e.key,i)||[e.key];S.includes(e.key)?(n=S.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:o,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:o})}},[S,C,p,f,h,i,z]),E=function(t){var n=S.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var o=r({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:t.disabled?.5:1},t.style);return e.jsxs("div",{ref:function(e){w.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:o,onClick:function(){return M(t)},onMouseEnter:function(e){t.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[t.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.icon}),e.jsx("span",{style:{flex:1},children:t.label}),t.suffixIcon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828"},children:t.suffixIcon})]},t.key)},L=r({width:"number"==typeof y?"".concat(y,"px"):y,backgroundColor:"#FFFFFF",borderRadius:"12px",boxShadow:"0px 10px 38px rgba(22, 23, 24, 0.35), 0px 10px 20px rgba(22, 23, 24, 0.2)",overflow:"hidden",fontFamily:"DM Sans, sans-serif"},v),T=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!D(o)||!(!D(n)||D(o))};return e.jsxs("div",{ref:b,className:"aha-menu-list ".concat(g),style:L,children:[a&&(a?a.render?a.render(a):e.jsx("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[e.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e.jsx("div",{children:i.map(function(n,o){return e.jsxs(t.Fragment,{children:[T(o,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),D(n)?(r=n,e.jsx("div",{className:"aha-menu-group ".concat(r.className||""),children:r.children.map(function(e){return E(e)})},"group-".concat(r.title))):E(n)]},o);var r})})]})};ve.displayName="MenuList";var me=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=o+6,c=0,d=0;switch(n){case"top":c=e.top-t.height-s+i,d=a-t.width/2+r;break;case"bottom":default:c=e.bottom+s+i,d=a-t.width/2+r;break;case"left":c=l-t.height/2+i,d=e.left-t.width-s+r;break;case"right":c=l-t.height/2+i,d=e.right+s+r;break;case"top-left":c=e.top-t.height-s+i,d=e.left+r;break;case"top-right":c=e.top-t.height-s+i,d=e.right-t.width+r;break;case"bottom-left":c=e.bottom+s+i,d=e.left+r;break;case"bottom-right":c=e.bottom+s+i,d=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return d<r+8?d=r+8:d+t.width>r+u-8&&(d=r+u-t.width-8),c<i+8?c=i+8:c+t.height>i+p-8&&(c=i+p-t.height-8),{top:c,left:d}},ye=function(e,t,n,o){void 0===o&&(o=6);var r=me(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),c=a-l,d=s+t.height,u=c+t.width,p=s,f=c,h=Math.max(p,e.top),x=Math.min(d,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},be=function(t,n){var o=r({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:r(r({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":r(r({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":r(r({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})},we=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},Ce=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},ke=function(o){var i,a=o.children,l=o.content,s=o.trigger,c=void 0===s?"click":s,d=o.open,u=o.defaultOpen,p=void 0!==u&&u,f=o.onOpenChange,h=o.placement,x=void 0===h?"right":h,g=o.width,v=o.offset,m=void 0===v?8:v,y=o.className,b=void 0===y?"":y,w=o.popoverClassName,C=void 0===w?"":w,k=o.disabled,F=void 0!==k&&k,j=o.destroyOnHide,S=o.destroyTooltipOnHide,D=null===(i=null!=j?j:S)||void 0===i||i,z=void 0!==d,M=t.useState(p),E=M[0],L=M[1],T=z?!!d:E,B=t.useState({top:0,left:0,opacity:0}),A=B[0],R=B[1],I=t.useRef(null),W=t.useRef(null),N=t.useCallback(function(e){z||L(e),null==f||f(e)},[z,f]),H=t.useCallback(function(){if(T&&I.current&&W.current){var e=I.current.getBoundingClientRect(),t=W.current.getBoundingClientRect(),n=function(){if(we(e,t,x,m))return x;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(x);return we(e,t,n,m)||Ce(e,n)>Ce(e,x)?n:x}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,m),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,s=t;return s<o+8&&(s=o+8),s+n.width>o+i-8&&(s=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:s}}(o.top,o.left,t);R({top:r.top,left:r.left,opacity:1})}},[T,x,m]),Y=t.useCallback(function(){F||N(!0)},[F,N]),P=t.useCallback(function(){N(!1)},[N]),O=t.useCallback(function(){F||N(!T)},[F,T,N]);t.useEffect(function(){if(T)return requestAnimationFrame(function(){H()}),window.addEventListener("resize",H),window.addEventListener("scroll",H,!0),function(){window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0)}},[T,H]),t.useEffect(function(){if(T&&"click"===c){var e=function(e){var t=e.target;I.current&&W.current&&!I.current.contains(t)&&!W.current.contains(t)&&P()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[T,c,P]);var V="hover"===c?{onMouseEnter:Y,onMouseLeave:P,onFocus:Y,onBlur:P}:{onClick:function(e){e.stopPropagation(),O()}},q=T||!D?e.jsx("div",{ref:W,className:"aha-popover ".concat(C),style:{position:"absolute",zIndex:9999,top:A.top,left:A.left,opacity:T?A.opacity:0,visibility:T?"visible":"hidden",pointerEvents:T?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof g?"".concat(g,"px"):g,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===c?Y:void 0,onMouseLeave:"hover"===c?P:void 0,onMouseDown:"click"===c?function(e){return e.stopPropagation()}:void 0,children:l}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:I,className:"aha-popover-trigger ".concat(b),style:{display:"inline-block",cursor:F?"not-allowed":"pointer"}},V,{children:a})),q&&"undefined"!=typeof document&&n.createPortal(q,document.body)]})};ke.displayName="Popover";var Fe=240,je=function(o){var i=o.open,a=o.defaultOpen,l=void 0!==a&&a,s=o.onClose,c=o.afterOpenChange,d=o.title,u=o.extra,p=o.footer,f=o.children,h=o.placement,x=void 0===h?"right":h,g=o.width,v=void 0===g?378:g,m=o.height,y=void 0===m?378:m,b=o.mask,w=void 0===b||b,C=o.maskClosable,k=void 0===C||C,F=o.closable,j=void 0===F||F,S=o.closeIcon,D=o.keyboard,z=void 0===D||D,M=o.destroyOnClose,E=void 0!==M&&M,L=o.zIndex,T=void 0===L?1e3:L,B=o.mobileBreakpoint,A=void 0===B?768:B,R=o.className,I=void 0===R?"":R,W=o.style,N=o.drawerStyle,H=o.headerStyle,Y=o.bodyStyle,P=o.footerStyle,O=o.maskStyle,V=void 0!==i,q=t.useState(l),_=q[0],X=q[1],Z=V?!!i:_,K=t.useState(Z),G=K[0],J=K[1],U=t.useState(Z),Q=U[0],$=U[1],ee=t.useState(!1),te=ee[0],ne=ee[1],oe=t.useState(!1),re=oe[0],ie=oe[1];t.useEffect(function(){ne(!0)},[]),t.useEffect(function(){var e=function(){ie(window.innerWidth<A)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[A]),t.useEffect(function(){if(Z){J(!0),$(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){$(!0)})}),t=window.setTimeout(function(){null==c||c(!0)},Fe);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}$(!1);var n=window.setTimeout(function(){E&&J(!1),null==c||c(!1)},Fe);return function(){return window.clearTimeout(n)}},[Z,E,c]),t.useEffect(function(){if(Z&&z){var e=function(e){"Escape"===e.key&&(null==s||s(e),V||X(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[Z,z,s,V]),t.useEffect(function(){if(te&&Z){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[Z,te]);var ae=t.useCallback(function(e){null==s||s(e),V||X(!1)},[s,V]),le=t.useMemo(function(){return re?"100vw":"left"===x||"right"===x?"number"==typeof v?"".concat(v,"px"):v:"100vw"},[x,re,v]),se=t.useMemo(function(){return"top"===x||"bottom"===x?"number"==typeof y?"".concat(y,"px"):y:"100vh"},[x,y]),ce=t.useMemo(function(){return re&&("left"===x||"right"===x)?"bottom":x},[re,x]),de=t.useMemo(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Fe,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:T+1};switch(ce){case"left":return r(r({},e),{top:0,left:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(-100%)"});case"right":return r(r({},e),{top:0,right:0,width:le,height:"100vh",transform:Q?"translateX(0)":"translateX(100%)"});case"top":return r(r({},e),{top:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(-100%)"});default:return r(r({},e),{bottom:0,left:0,width:"100vw",height:se,transform:Q?"translateY(0)":"translateY(100%)"})}},[ce,le,se,Q,T]);if(!te||!G&&!Z)return null;var ue=e.jsxs("div",{className:"aha-drawer-root ".concat(I),style:r({position:"fixed",inset:0,zIndex:T,pointerEvents:Z||Q?"auto":"none"},W),children:[w&&e.jsx("div",{"aria-hidden":!0,onClick:k?function(e){return ae(e)}:void 0,style:r({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:Q?1:0,transition:"opacity ".concat(Fe,"ms cubic-bezier(0.2, 0, 0, 1)")},O)}),e.jsxs("div",{role:"dialog","aria-modal":"true",style:r(r({},de),N),children:[(void 0!==d||j||u)&&e.jsxs("div",{style:r({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},H),children:[e.jsx("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[u,j&&e.jsx("button",{type:"button",onClick:function(e){return ae(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:S||e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e.jsx("div",{style:r({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},Y),children:f}),void 0!==p&&e.jsx("div",{style:r({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},P),children:p})]},"".concat(ce,"-").concat(Z?"open":"closed"))]});return n.createPortal(ue,document.body)};je.displayName="Drawer";var Se={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function De(e,t,n){var o=e*Math.PI*2,r=Math.round(n.petalCount),i=n.baseRadius*Math.cos(o)-n.detailAmplitude*t*Math.cos(r*o),a=n.baseRadius*Math.sin(o)-n.detailAmplitude*t*Math.sin(r*o);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function ze(e,t,n,o){var r=e/Math.max(1,o.particleCount-1),i=De(function(e){return(e%1+1)%1}(t-r*o.trailSpan),n,o),a=Math.pow(1-r,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}var Me={gray:{bg:"var(--color-gray-50)",text:"var(--color-gray-700)",ring:"var(--color-gray-200)",dot:"var(--color-gray-500)",btnText:"var(--color-gray-400)",btnHoverBg:"var(--color-gray-100)",btnHoverText:"var(--color-gray-500)"},brand:{bg:"var(--color-brand-50)",text:"var(--color-brand-700)",ring:"var(--color-brand-200)",dot:"var(--color-brand-500)",btnText:"var(--color-brand-400)",btnHoverBg:"var(--color-brand-100)",btnHoverText:"var(--color-brand-500)"},error:{bg:"var(--color-error-50)",text:"var(--color-error-700)",ring:"var(--color-error-200)",dot:"var(--color-error-500)",btnText:"var(--color-error-400)",btnHoverBg:"var(--color-error-100)",btnHoverText:"var(--color-error-500)"},warning:{bg:"var(--color-warning-50)",text:"var(--color-warning-700)",ring:"var(--color-warning-200)",dot:"var(--color-warning-500)",btnText:"var(--color-warning-400)",btnHoverBg:"var(--color-warning-100)",btnHoverText:"var(--color-warning-500)"},success:{bg:"var(--color-success-50)",text:"var(--color-success-700)",ring:"var(--color-success-200)",dot:"var(--color-success-500)",btnText:"var(--color-success-400)",btnHoverBg:"var(--color-success-100)",btnHoverText:"var(--color-success-500)"},grayBlue:{bg:"var(--color-gray-blue-50)",text:"var(--color-gray-blue-700)",ring:"var(--color-gray-blue-200)",dot:"var(--color-gray-blue-500)",btnText:"var(--color-gray-blue-400)",btnHoverBg:"var(--color-gray-blue-100)",btnHoverText:"var(--color-gray-blue-500)"},blueLight:{bg:"var(--color-blue-light-50)",text:"var(--color-blue-light-700)",ring:"var(--color-blue-light-200)",dot:"var(--color-blue-light-500)",btnText:"var(--color-blue-light-400)",btnHoverBg:"var(--color-blue-light-100)",btnHoverText:"var(--color-blue-light-500)"},blue:{bg:"var(--color-blue-50)",text:"var(--color-blue-700)",ring:"var(--color-blue-200)",dot:"var(--color-blue-500)",btnText:"var(--color-blue-400)",btnHoverBg:"var(--color-blue-100)",btnHoverText:"var(--color-blue-500)"},indigo:{bg:"var(--color-indigo-50)",text:"var(--color-indigo-700)",ring:"var(--color-indigo-200)",dot:"var(--color-indigo-500)",btnText:"var(--color-indigo-400)",btnHoverBg:"var(--color-indigo-100)",btnHoverText:"var(--color-indigo-500)"},purple:{bg:"var(--color-purple-50)",text:"var(--color-purple-700)",ring:"var(--color-purple-200)",dot:"var(--color-purple-500)",btnText:"var(--color-purple-400)",btnHoverBg:"var(--color-purple-100)",btnHoverText:"var(--color-purple-500)"},pink:{bg:"var(--color-pink-50)",text:"var(--color-pink-700)",ring:"var(--color-pink-200)",dot:"var(--color-pink-500)",btnText:"var(--color-pink-400)",btnHoverBg:"var(--color-pink-100)",btnHoverText:"var(--color-pink-500)"},orange:{bg:"var(--color-orange-50)",text:"var(--color-orange-700)",ring:"var(--color-orange-200)",dot:"var(--color-orange-500)",btnText:"var(--color-orange-400)",btnHoverBg:"var(--color-orange-100)",btnHoverText:"var(--color-orange-500)"}},Ee={sm:"2px 8px",md:"2px 10px",lg:"4px 12px"},Le={sm:"2px 6px",md:"2px 8px",lg:"4px 10px"},Te={sm:"12px",md:"14px",lg:"14px"};function Be(e,t){return"modern"===e?r(r({},Me[t]),{bg:"var(--color-bg-primary)",text:"var(--color-text-secondary)",ring:"var(--color-border-secondary)"}):Me[t]}function Ae(e,t,n,o){var i=Be(e,t),a="pill"===e,l="lg"===n&&!a,s="inset 0 0 0 1px ".concat(i.ring),c="modern"===e?"".concat(s,", 0px 1px 2px 0px rgba(10, 13, 18, 0.05)"):s;return r({display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",width:"max-content",borderRadius:a?"9999px":l?"8px":"6px",backgroundColor:i.bg,color:i.text,boxShadow:c,fontFamily:"DM Sans, system-ui, sans-serif",fontWeight:500,fontSize:Te[n],lineHeight:"sm"===n?"18px":"20px",padding:a?Ee[n]:Le[n]},o)}var Re=function(t){var n=t.color;return e.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:"4",cy:"4",r:"3",fill:n})})},Ie=function(t){var n=t.style;return e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",style:n,children:e.jsx("path",{d:"M9 3L3 9M3 3l6 6"})})},We={xs:{size:24,border:.5,fontSize:"var(--font-size-text-xs)",lineHeight:"var(--line-height-text-xs)",iconSize:16,onlineIndicator:{size:6,offset:-.5},companyIcon:{size:10,offset:-2.5,border:1.5},verifiedTick:{size:10,offset:-1.5}},sm:{size:32,border:.75,fontSize:"var(--font-size-text-sm)",lineHeight:"var(--line-height-text-sm)",iconSize:20,onlineIndicator:{size:8,offset:-.75},companyIcon:{size:12,offset:-2.75,border:1.5},verifiedTick:{size:12,offset:-.75}},md:{size:40,border:1,fontSize:"var(--font-size-text-md)",lineHeight:"var(--line-height-text-md)",iconSize:24,onlineIndicator:{size:10,offset:-1},companyIcon:{size:14,offset:-3,border:1.5},verifiedTick:{size:14,offset:-1}},lg:{size:48,border:1,fontSize:"var(--font-size-text-lg)",lineHeight:"var(--line-height-text-lg)",iconSize:28,onlineIndicator:{size:12,offset:-1},companyIcon:{size:16,offset:-3,border:1.5},verifiedTick:{size:16,offset:-1}},xl:{size:56,border:1,fontSize:"var(--font-size-text-xl)",lineHeight:"var(--line-height-text-xl)",iconSize:32,onlineIndicator:{size:14,offset:-1},companyIcon:{size:18,offset:-3,border:1.5},verifiedTick:{size:18,offset:-1}},"2xl":{size:64,border:1,fontSize:"var(--font-size-display-xs)",lineHeight:"var(--line-height-display-xs)",iconSize:32,onlineIndicator:{size:16,offset:-1},companyIcon:{size:20,offset:-3,border:1.667},verifiedTick:{size:20,offset:-1}}},Ne={sm:{gap:"var(--spacing-md)",nameFontSize:"var(--font-size-text-sm)",nameLineHeight:"var(--line-height-text-sm)",subFontSize:"var(--font-size-text-xs)",subLineHeight:"var(--line-height-text-xs)"},md:{gap:"var(--spacing-md)",nameFontSize:"var(--font-size-text-sm)",nameLineHeight:"var(--line-height-text-sm)",subFontSize:"var(--font-size-text-sm)",subLineHeight:"var(--line-height-text-sm)"},lg:{gap:"var(--spacing-lg)",nameFontSize:"var(--font-size-text-md)",nameLineHeight:"var(--line-height-text-md)",subFontSize:"var(--font-size-text-md)",subLineHeight:"var(--line-height-text-md)"},xl:{gap:"var(--spacing-xl)",nameFontSize:"var(--font-size-text-lg)",nameLineHeight:"var(--line-height-text-lg)",subFontSize:"var(--font-size-text-md)",subLineHeight:"var(--line-height-text-md)"}},He=function(t){var n=t.style;return e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:n,children:e.jsx("path",{d:"M20 21C20 19.6044 20 18.9067 19.8278 18.3389C19.44 17.0605 18.4395 16.06 17.1611 15.6722C16.5933 15.5 15.8956 15.5 14.5 15.5H9.5C8.10444 15.5 7.40665 15.5 6.83886 15.6722C5.56045 16.06 4.56004 17.0605 4.17224 18.3389C4 18.9067 4 19.6044 4 21M16.5 7.5C16.5 9.98528 14.4853 12 12 12C9.51472 12 7.5 9.98528 7.5 7.5C7.5 5.01472 9.51472 3 12 3C14.4853 3 16.5 5.01472 16.5 7.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Ye=function(t){var n=t.size,o=t.offset;return e.jsxs("svg",{viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",bottom:o,right:o,width:n,height:n,flexShrink:0,color:"var(--color-blue-500)",overflow:"hidden",zIndex:1},children:[e.jsx("path",{d:"M7.72237 1.77098C7.81734 2.00068 7.99965 2.18326 8.2292 2.27858L9.03413 2.61199C9.26384 2.70714 9.44635 2.88965 9.5415 3.11936C9.63665 3.34908 9.63665 3.60718 9.5415 3.83689L9.20833 4.64125C9.11313 4.87106 9.113 5.12943 9.20863 5.35913L9.54122 6.16325C9.58839 6.27702 9.61268 6.39897 9.6127 6.52214C9.61272 6.6453 9.58847 6.76726 9.54134 6.88105C9.4942 6.99484 9.42511 7.09823 9.33801 7.18531C9.2509 7.27238 9.14749 7.34144 9.03369 7.38854L8.22934 7.72171C7.99964 7.81669 7.81706 7.99899 7.72174 8.22855L7.38833 9.03348C7.29318 9.26319 7.11067 9.4457 6.88096 9.54085C6.65124 9.636 6.39314 9.636 6.16343 9.54085L5.35907 9.20767C5.12935 9.11276 4.87134 9.11295 4.64177 9.20821L3.83684 9.54115C3.60725 9.63608 3.34937 9.636 3.11984 9.54092C2.89032 9.44585 2.70791 9.26356 2.6127 9.03409L2.27918 8.22892C2.18421 7.99923 2.0019 7.81665 1.77235 7.72133L0.967421 7.38792C0.737807 7.29281 0.555355 7.11041 0.460169 6.88083C0.364983 6.65125 0.364854 6.39327 0.45981 6.16359L0.792984 5.35924C0.8879 5.12952 0.887707 4.87151 0.792445 4.64193L0.459749 3.83642C0.41258 3.72265 0.388291 3.60069 0.388272 3.47753C0.388252 3.35436 0.412501 3.2324 0.459634 3.11861C0.506767 3.00482 0.57586 2.90144 0.662965 2.81436C0.75007 2.72728 0.853479 2.65822 0.967283 2.61113L1.77164 2.27795C2.00113 2.18306 2.1836 2.00099 2.27899 1.7717L2.6124 0.966768C2.70755 0.737054 2.89006 0.554547 3.11978 0.459397C3.34949 0.364246 3.60759 0.364246 3.83731 0.459397L4.64166 0.792571C4.87138 0.887487 5.12939 0.887293 5.35897 0.792031L6.16424 0.459913C6.39392 0.364816 6.65197 0.364836 6.88164 0.459968C7.11131 0.555099 7.29379 0.737554 7.38895 0.967208L7.72247 1.77238L7.72237 1.77098Z",fill:"currentColor"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.95829 3.68932C7.02509 3.58439 7.04747 3.45723 7.02051 3.3358C6.99356 3.21437 6.91946 3.10862 6.81454 3.04182C6.70961 2.97502 6.58245 2.95264 6.46102 2.97959C6.33959 3.00655 6.23384 3.08064 6.16704 3.18557L4.33141 6.06995L3.49141 5.01995C3.41375 4.92281 3.30069 4.8605 3.17709 4.84673C3.05349 4.83296 2.92949 4.86885 2.83235 4.94651C2.73522 5.02417 2.67291 5.13723 2.65914 5.26083C2.64536 5.38443 2.68125 5.50843 2.75891 5.60557L4.00891 7.16807C4.0555 7.22638 4.11533 7.27271 4.18344 7.30323C4.25154 7.33375 4.32595 7.34757 4.40047 7.34353C4.47499 7.3395 4.54747 7.31773 4.61188 7.28004C4.67629 7.24234 4.73077 7.18981 4.77079 7.12682L6.95829 3.68932Z",fill:"white"})]})},Pe=function(n){var o=n.size,i=void 0===o?"md":o,a=n.src,l=n.alt,s=n.initials,c=n.placeholderIcon,d=n.status,u=n.companyIcon,p=n.verified,f=n.style,h=n.className,x=t.useState(!1),g=x[0],v=x[1],m=We[i],y=Boolean(a&&!g),b=!y,w=Boolean(d||u||p);return e.jsxs("div",{className:h,style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:m.size,height:m.size,borderRadius:"50%",border:"".concat(m.border,"px solid ").concat(b?"var(--color-border-secondary)":"rgba(0, 0, 0, 0.08)"),backgroundColor:b?"var(--color-bg-tertiary)":void 0,overflow:w?void 0:"hidden",flexShrink:0},f),children:[y?e.jsx("img",{src:a,alt:l,onError:function(){return v(!0)},style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",borderRadius:"50%",pointerEvents:"none"}}):s?e.jsx("span",{style:{fontSize:m.fontSize,lineHeight:m.lineHeight,fontWeight:600,color:"var(--color-text-quaternary)",fontFamily:"var(--font-family-body)",userSelect:"none"},children:s}):c?e.jsx(c,{style:{width:m.iconSize,height:m.iconSize,color:"var(--color-fg-quaternary)",flexShrink:0}}):e.jsx(He,{style:{width:m.iconSize,height:m.iconSize,color:"var(--color-fg-quaternary)",flexShrink:0}}),function(){if("online"===d||"offline"===d){var t=m.onlineIndicator,n=t.size,o=t.offset;return e.jsx("span",{style:{position:"absolute",bottom:o,right:o,width:n,height:n,borderRadius:"50%",backgroundColor:"online"===d?"var(--color-fg-success-secondary)":"var(--color-fg-quaternary)",border:"1.5px solid var(--color-bg-primary)",flexShrink:0}})}if(u){var r=m.companyIcon,i=r.size,a=(o=r.offset,r.border);return e.jsx("img",{src:u.src,alt:u.alt,style:{position:"absolute",bottom:o,right:o,width:i,height:i,borderRadius:"50%",border:"".concat(a,"px solid var(--color-bg-primary)"),objectFit:"cover",pointerEvents:"none"}})}return p?e.jsx(Ye,{size:m.verifiedTick.size,offset:m.verifiedTick.offset}):null}()]})};exports.Alert=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,c=n.icon,d=void 0===c?v[a]:c,u=n.showIcon,p=void 0===u||u,f=n.closeable,h=void 0!==f&&f,x=n.action,g=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1],k=function(){C(!1),null==y||y()},F=x||h;return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&d,e.jsxs("div",{className:"flex flex-col gap-1 ".concat(F?"flex-1 min-w-0":""),children:[l&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:l}),s&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),g&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:g})]}),F&&e.jsxs("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[x,h&&e.jsx("div",{className:"cursor-pointer relative top-[-12px]",onClick:k,onKeyDown:function(e){return"Enter"===e.key&&k()},role:"button",tabIndex:0,"aria-label":"关闭",children:m})]})]}):null},exports.Avatar=Pe,exports.AvatarLabelGroup=function(t){var n=t.size,o=void 0===n?"sm":n,i=t.name,a=t.supportingText,l=t.avatarSrc,s=t.avatarInitials,c=t.status,d=t.companyIcon,u=t.verified,p=t.style,f=t.className,h=Ne[o];return e.jsxs("div",{className:f,style:r({display:"inline-flex",alignItems:"center",gap:h.gap,position:"relative"},p),children:[e.jsx(Pe,{size:o,src:l,initials:s,status:c,companyIcon:d,verified:u}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",flexShrink:0,whiteSpace:"nowrap"},children:[e.jsx("span",{style:{fontSize:h.nameFontSize,lineHeight:h.nameLineHeight,fontWeight:600,color:"var(--color-text-primary)",fontFamily:"var(--font-family-body)"},children:i}),a&&e.jsx("span",{style:{fontSize:h.subFontSize,lineHeight:h.subLineHeight,fontWeight:400,color:"var(--color-text-tertiary)",fontFamily:"var(--font-family-body)"},children:a})]})]})},exports.Badge=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,c=t.children,d=t.style,u=t.className;return e.jsx("span",{style:r(r({},Ae(o,s,a)),d),className:u,children:c})},exports.BadgeIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,c=t.icon,d=t.style,u=t.className,p=Be(o,s),f="modern"===o?Me[s].dot:p.dot,h={sm:"12px",md:"12px",lg:"14px"};return e.jsx("span",{style:r(r(r({},Ae(o,s,a)),{padding:{sm:"5px",md:"6px",lg:"8px"}[a]}),d),className:u,children:e.jsx(c,{style:{width:h[a],height:h[a],color:f}})})},exports.BadgeWithButton=function(n){var o=n.variant,i=void 0===o?"pill":o,a=n.size,l=void 0===a?"md":a,s=n.color,c=void 0===s?"gray":s,d=n.icon,u=n.buttonLabel,p=n.onButtonClick,f=n.children,h=n.style,x=n.className,g=t.useState(!1),v=g[0],m=g[1],y=Be(i,c),b="pill"===i,w={sm:b?"8px":"6px",md:b?"10px":"8px",lg:b?"12px":"10px"},C={sm:"3px",md:"4px",lg:"6px"},k=b?"9999px":"3px";return e.jsxs("span",{style:r(r(r({},Ae(i,c,l)),{gap:{sm:"2px",md:"2px",lg:"2px"}[l],paddingLeft:w[l],paddingRight:C[l],paddingTop:"lg"===l?"4px":"2px",paddingBottom:"lg"===l?"4px":"2px"}),h),className:x,children:[f,e.jsx("button",{type:"button","aria-label":u,onClick:p,onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:"2px",border:"none",cursor:"pointer",borderRadius:k,backgroundColor:v?y.btnHoverBg:"transparent",color:v?y.btnHoverText:y.btnText,transition:"background-color 100ms linear, color 100ms linear",outline:"none",flexShrink:0},children:d?e.jsx(d,{style:{width:"12px",height:"12px"}}):e.jsx(Ie,{})})]})},exports.BadgeWithDot=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,c=t.children,d=t.style,u=t.className,p=Be(o,s),f="modern"===o?Me[s].dot:p.dot,h="pill"===o,x={sm:"6px",md:"8px",lg:"10px"},g={sm:h?"8px":"6px",md:h?"10px":"8px",lg:h?"12px":"10px"};return e.jsxs("span",{style:r(r(r({},Ae(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:x[a],paddingRight:g[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),d),className:u,children:[e.jsx(Re,{color:f}),c]})},exports.BadgeWithIcon=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,c=t.iconLeading,d=t.iconTrailing,u=t.children,p=t.style,f=t.className,h=Be(o,s),x="modern"===o?Me[s].dot:h.dot,g={sm:"12px",md:"12px",lg:"14px"},v="pill"===o,m=!!c,y={sm:{pl:m?"6px":"8px",pr:m?"8px":"6px"},md:{pl:v?m?"8px":"10px":"8px",pr:v&&m?"10px":"8px"},lg:{pl:v?m?"10px":"12px":"10px",pr:v&&m?"12px":"10px"}};return e.jsxs("span",{style:r(r(r({},Ae(o,s,a)),{gap:{sm:"2px",md:"4px",lg:"4px"}[a],paddingLeft:y[a].pl,paddingRight:y[a].pr,paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),p),className:f,children:[c&&e.jsx(c,{style:{width:g[a],height:g[a],color:x,flexShrink:0}}),u,d&&e.jsx(d,{style:{width:g[a],height:g[a],color:x,flexShrink:0}})]})},exports.BadgeWithImage=function(t){var n=t.variant,o=void 0===n?"pill":n,i=t.size,a=void 0===i?"md":i,l=t.color,s=void 0===l?"gray":l,c=t.imgSrc,d=t.imgAlt,u=void 0===d?"avatar":d,p=t.children,f=t.style,h=t.className,x="pill"===o,g={sm:x?"3px":"4px",md:x?"4px":"6px",lg:x?"6px":"8px"},v={sm:x?"8px":"6px",md:x?"10px":"8px",lg:x?"12px":"10px"},m={sm:"16px",md:"16px",lg:"18px"};return e.jsxs("span",{style:r(r(r({},Ae(o,s,a)),{gap:{sm:"4px",md:"6px",lg:"6px"}[a],paddingLeft:g[a],paddingRight:v[a],paddingTop:"lg"===a?"4px":"2px",paddingBottom:"lg"===a?"4px":"2px"}),f),className:h,children:[e.jsx("img",{src:c,alt:u,style:{width:m[a],height:m[a],borderRadius:"9999px",objectFit:"cover",flexShrink:0}}),p]})},exports.Button=g,exports.CheckIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Checkbox=O,exports.DatePicker=pe,exports.Drawer=je,exports.Form=ge,exports.Input=B,exports.Loading=function(n){var o=n.width,r=void 0===o?80:o,i=n.height,a=void 0===i?80:i,l=n.strokeWidth,s=n.color,c=void 0===s?"var(--theme-color, #5A31F0)":s,d=n.className,u=t.useState(0),p=u[0],f=u[1],h=t.useRef(null);t.useEffect(function(){var e,t=function(n){null===h.current&&(h.current=n),f(n-h.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var x,g,v=p,m=(g=v%(x=Se).pulseDurationMs/x.pulseDurationMs*Math.PI*2,.52+(Math.sin(g+.55)+1)/2*.48),y=v%Se.durationMs/Se.durationMs,b=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(v,Se),w=null!=l?l:Se.strokeWidth,C=w/Se.strokeWidth,k=function(e,t,n){void 0===n&&(n=480);for(var o=[],r=0;r<=n;r+=1){var i=De(r/n,e,t);o.push("".concat(0===r?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return o.join(" ")}(m,Se),F=[],j=0;j<Se.particleCount;j+=1){var S=ze(j,y,m,Se);F.push({cx:S.x,cy:S.y,opacity:S.opacity,r:S.radius*C})}return e.jsx("div",{className:d,style:{width:r,height:a,display:"inline-block",color:c},role:"status","aria-label":"Loading",children:e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e.jsx("title",{children:"Thinking Five"}),e.jsxs("g",{transform:"rotate(".concat(b," 50 50)"),children:[e.jsx("path",{d:k,stroke:"currentColor",strokeWidth:w,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),F.map(function(t,n){return e.jsx("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})},exports.MenuList=ve,exports.MinusIcon=function(t){var n=t.className,o=t.style;return e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:o,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},exports.Pagination=P,exports.Popover=ke,exports.Progress=function(n){var o=n.percent,a=void 0===o?0:o,l=n.type,s=void 0===l?"circle":l,c=n.width,d=void 0===c?120:c,p=n.title,f=n.titlePosition,h=n.showPercent,x=void 0===h||h,g=n.animated,v=void 0!==g&&g,m=n.status,y=void 0===m?"normal":m,b=n.className,w=void 0===b?"":b,C=n.style,k=n.strokeColor,F=n.trailColor,j=void 0===F?"#F5F5F4":F,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),D=u().primaryColor,z=Math.min(100,Math.max(0,a)),M=t.useRef(!0),E=t.useState(!1),L=E[0],T=E[1],B=t.useState(0),A=B[0],R=B[1];t.useEffect(function(){if(v&&M.current&&z>0){M.current=!1,R(0),T(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(z)})});var e=setTimeout(function(){T(!1),R(z)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,T(!1),R(z)):R(z)},[v,z]);var I=k||D||"#FB6011";"success"===y?I="#00BC7D":"exception"===y&&(I="#FB2C36");var W=f||"inside",N=Math.max(4,Math.round(.06*d)),H=(d-N)/2,Y="semicircle"===s?d/2:d,P="14px",O="12px",V=function(){var t=p&&"outside"===W?d+4+18+4:d,n=2*Math.PI*H,o=n-(L?A:z)/100*n;return e.jsxs("div",{style:{position:"relative",width:d,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:d,height:d,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("circle",{cx:d/2,cy:d/2,r:H,fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(d/2," ").concat(d/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:P,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(d,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:d},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},S,{children:function(){switch(s){case"circle":return V();case"semicircle":return n=N/2,o=d-N/2,r=(t=Y+N)-N/2,i=Y/2+N/2+N/2,a=p&&"outside"===W?t+4+18+4:t,l=Math.PI*H,c=l-(L?A:z)/100*l,e.jsxs("div",{style:{position:"relative",width:d,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:d,height:t,viewBox:"0 0 ".concat(d," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(r," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(r),fill:"none",stroke:I,strokeWidth:N,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===W?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(i,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:O,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(z),"%")}),p&&"outside"===W&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),V()}var t,n,o,r,i,a,l,c}()}))},exports.Radio=K,exports.Select=A,exports.Switch=ie,exports.Tab=function(n){var o=n.items,a=void 0===o?[]:o,l=n.variant,s=void 0===l?"underline":l,c=n.layout,d=void 0===c?"equal":c,p=n.defaultValue,f=n.value,h=n.onChange,x=n.className,g=void 0===x?"":x,v=n.mode,m=void 0===v?"children":v,y=n.scrollable,b=void 0!==y&&y,w=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=u().primaryColor;if(!a||0===a.length)return null;var k=t.useMemo(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),F=void 0!==f,j=k.length>0?k[0].key:"",S=function(e){if(void 0===e)return j;var t=k.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:j},D=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return S(t)}),z=D[0],M=D[1],E=F?void 0!==f?S(f):j:z;t.useEffect(function(){console.log("[Tab Debug] currentValue:",E,"type:",typeof E),console.log("[Tab Debug] normalizedItems:",k.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",f,"isControlled:",F)},[E,k,f,F]);var L=t.useCallback(function(e,t){if(!t){F||M(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==h||h(n),b&&"underline"===s){var o=A.current[R(e)],r=N.current;if(o&&r){P.current=!0;var i,l=function(){if(r&&I.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},c=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),P.current=!1,r.removeEventListener("scroll",c)},150)};r.addEventListener("scroll",c,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[F,h,a,b,s]),T=k.find(function(e){if(e.key===E)return!0;if(String(e.key)===String(E))return!0;var t=Number(e.key),n=Number(E);return!isNaN(t)&&!isNaN(n)&&t===n}),B=C||"#FB6011",A=t.useRef({}),R=function(e){return String(e)},I=t.useRef(null),W=t.useRef(null),N=t.useRef(null),H=t.useRef(null),Y=t.useRef("");t.useRef(new Set);var P=t.useRef(!1),O=t.useState({width:0,left:0,opacity:0}),V=O[0],q=O[1],_=t.useState({width:0,left:0,opacity:0}),X=_[0],Z=_[1],K=t.useCallback(function(){"underline"===s&&N.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(I.current&&N.current){var e=A.current[R(E)];if(!e&&k.length>0){var t=k[0].key;e=A.current[R(t)]}if(e){var n=N.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=N.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),s="".concat(a,"px");q(function(e){return e.left===l&&e.width===s&&1===e.opacity?e:{width:s,left:l,opacity:1}})}}}})})},[s,E,k]),G=t.useCallback(function(){"background"===s&&H.current&&W.current&&E&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&H.current){var e=A.current[R(E)];if(!e&&k.length>0){var t=k[0].key;e=A.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");Z(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[s,E,k]);t.useEffect(function(){E?Y.current!==E&&(Y.current=E,"underline"===s&&N.current&&!P.current&&K(),"background"===s&&H.current&&W.current&&G()):Y.current=""},[E,s,k.length,F,K,G]),t.useEffect(function(){if(E){var e=setTimeout(function(){if("underline"===s)(e=A.current[R(E)])&&N.current&&I.current&&(K(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=A.current[R(E)])&&H.current&&W.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");Z({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&E&&!P.current){var e=setTimeout(function(){var e=A.current[R(E)],t=N.current;if(e&&t){P.current=!0;var n,o=function(){if(t&&I.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),P.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[E,b,s]);var J;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(J={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(J.overflowX="auto",J.overflowY="hidden",J.scrollBehavior="smooth",J.scrollbarWidth="none",J.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:N,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:J},w,{children:[e.jsx("div",{ref:I,style:r({position:"absolute",bottom:"0px",height:"2px",backgroundColor:B,borderRadius:"1px 1px 0 0",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out"},V)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s}),e.jsxs("div",{ref:function(e){A.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:b?0:void 0,whiteSpace:b?"nowrap":void 0},children:[n.icon&&function(){var i,a=typeof n.icon,l=t.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:a,isReactElement:l,iconValue:n.icon}),t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?B:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:o?B:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?B:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?B:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===d?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(d," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",top:"4px",bottom:"4px",borderRadius:"6px",backgroundColor:"#FFFFFF",border:"none",boxShadow:"0px 1px 2px 0px rgba(10, 13, 18, 0.1)",transition:"left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out",pointerEvents:"none"},X)}),k.map(function(n){var o=function(){if(n.key===E)return!0;if(String(n.key)===String(E))return!0;var e=Number(n.key),t=Number(E);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===k[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:E,currentValueType:typeof E,isActive:o,variant:s});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===d?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return e.jsxs("div",{ref:function(e){A.current[R(n.key)]=e},onClick:function(){return L(n.key,n.disabled)},style:i,children:[n.icon&&function(){var i;return t.isValidElement(n.icon)?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:r(r({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),b&&"underline"===s&&e.jsx("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===m&&(null==T?void 0:T.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:T.children})]})},exports.Table=function(n){var o,a,l,c,d=n.columns,p=void 0===d?[]:d,f=n.dataSource,h=void 0===f?[]:f,x=n.rowKey,g=void 0===x?"key":x,v=n.rowSelection,m=n.pagination,y=void 0!==m&&m,b=n.size,w=void 0===b?"middle":b,C=n.bordered,k=void 0!==C&&C,F=n.loading,j=void 0!==F&&F,S=n.locale,D=n.showHeader,z=void 0===D||D,M=n.title,E=n.footer,L=n.summary,T=n.scroll,B=n.tableLayout,A=void 0===B?"auto":B,R=n.onChange,I=n.onSorterChange,W=n.onPaginationChange,N=n.onRow,H=n.className,Y=void 0===H?"":H,V=n.innerClassName,K=void 0===V?"":V,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=i(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=u().primaryColor||"#FB6011",te=t.useState((null==v?void 0:v.selectedRowKeys)||(null==v?void 0:v.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];t.useEffect(function(){void 0!==(null==v?void 0:v.selectedRowKeys)&&oe(v.selectedRowKeys)},[null==v?void 0:v.selectedRowKeys]);var re=t.useState(new Map),ie=re[0],ae=re[1],le=t.useState((null==J?void 0:J.defaultExpandedRowKeys)||[]),se=le[0],ce=le[1],de=t.useState(y&&"object"==typeof y&&(y.current||y.defaultCurrent)||1),ue=de[0],pe=de[1],fe=t.useState(y&&"object"==typeof y&&(y.pageSize||y.defaultPageSize)||10),he=fe[0],xe=fe[1];t.useEffect(function(){y&&"object"==typeof y&&(void 0!==y.current&&pe(y.current),void 0!==y.pageSize&&xe(y.pageSize))},[y]);var ge=t.useState(null),ve=ge[0],me=ge[1],ye=t.useState(null),be=ye[0],we=ye[1],Ce=t.useState(!1),ke=Ce[0],Fe=Ce[1],je=t.useRef(null),Se=t.useRef(null);t.useEffect(function(){var e=function(){Fe(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var De=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==v?void 0:v.getCheckboxProps)||void 0===n?void 0:n.call(v,e);if(!(null==i?void 0:i.disabled)){var a,l=X(e,g);a="radio"===(null==v?void 0:v.type)?t?[l]:[]:t?s(s([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var c=h.filter(function(e){return a.includes(X(e,g))});null===(o=null==v?void 0:v.onChange)||void 0===o||o.call(v,a,c),null===(r=null==v?void 0:v.onSelect)||void 0===r||r.call(v,e,t,c,new Event("select"))}},[ne,g,v,h]),ze=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}).map(function(e){return X(e,g)}),i=e?r:[];oe(i);var a=h.filter(function(e){return i.includes(X(e,g))}),l=e?t.filter(function(e){var t;return!(null===(t=null==v?void 0:v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}):[];null===(n=null==v?void 0:v.onChange)||void 0===n||n.call(v,i,a),null===(o=null==v?void 0:v.onSelectAll)||void 0===o||o.call(v,e,a,l)},[g,v,h]),Me=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),I&&I(1===r.length?r[0]:r),R&&R({current:ue,pageSize:he},{},1===r.length?r[0]:r,{currentDataSource:h,action:"sort"})}},[ie,R,I,ue,he,h,p]);t.useCallback(function(e,t){var n,o,r,i=X(e,g);r=t?s(s([],se,!0),[i],!1):se.filter(function(e){return e!==i}),ce(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[se,g,J]);var Ee,Le=t.useCallback(function(){var e=s([],h,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){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,t);else if(!0===r.sorter){var a=_(e,r.dataIndex||n),l=_(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[h,ie,p]),Te=Le(),Be=Boolean(y&&"object"==typeof y&&void 0!==y.total),Ae=t.useMemo(function(){if(!1===y||!y)return Te;if(Be)return Te;var e=(ue-1)*he,t=e+he;return Te.slice(e,t)},[Te,ue,he,y,Be]),Re=t.useCallback(function(e,t){var n,o,r=null!=t?t:he;if(pe(e),t&&xe(t),W&&W(e,r),y&&"object"==typeof y&&(null===(n=y.onChange)||void 0===n||n.call(y,e,t),t&&(null===(o=y.onShowSizeChange)||void 0===o||o.call(y,e,t))),R){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:p.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});R({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:Te,action:"paginate"})}},[y,W,R,he,ie,p,Te]),Ie=t.useCallback(function(e,t,n){var o=_(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),We=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(v&&("left"===v.fixed||!0===v.fixed))r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.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"===o){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(v&&"right"===v.fixed)r+="number"==typeof v.columnWidth?v.columnWidth:"string"==typeof v.columnWidth?parseInt(v.columnWidth):60;return r}}},[p,v]),Ne=t.useCallback(function(){if(!z)return null;var t,n,o,i,a=p.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=ie.get(i)||null,l=We(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:{width:s,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:s||void 0,maxWidth:s,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===t.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:(t.fixed,"#F9FAFB"),boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:t.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=t.onHeaderCell)||void 0===o?void 0:o.call(t,t))||{},{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===t.align?"flex-end":"center"===t.align?"center":"flex-start"},children:[e.jsx("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof t.title?t.title({sortOrder:a,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){Me(t,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(Z,{order:a||void 0})})]})}),i)});if(v){var l="number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.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:[!v.hideSelectAll&&"radio"!==v.type&&(t=Ae.filter(function(e){var t;return!(null===(t=v.getCheckboxProps)||void 0===t?void 0:t.call(v,e).disabled)}),n=t.map(function(e){return X(e,g)}),o=t.length>0&&n.every(function(e){return ne.includes(e)}),i=n.some(function(e){return ne.includes(e)}),e.jsx(O,{checked:o,indeterminate:i&&!o,onChange:function(e){return ze(e.target.checked,Ae)}})),v.columnTitle&&e.jsx("span",{style:{marginLeft:v.hideSelectAll?0:"8px"},children:v.columnTitle})]})},"selection");a.unshift(s)}var c=null==Q?void 0:Q(p,0);return e.jsx("thead",{ref:Se,children:e.jsx("tr",r({},c||{},{children:a}))})},[p,z,ie,v,ne,Ae,g,Me,ze,S,Q,We]),He=t.useCallback(function(e){me(e)},[]),Ye=t.useCallback(function(e,t){e.preventDefault(),we(t)},[]),Pe=t.useCallback(function(e,t){if(e.preventDefault(),null===ve||ve===t)return me(null),void we(null);var n=s([],Ae,!0),o=n[ve];n.splice(ve,1),n.splice(t,0,o),me(null),we(null)},[ve,Ae]),Oe=t.useCallback(function(){me(null),we(null)},[]),Ve=t.useCallback(function(){var t=null==S?void 0:S.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=p.length+(v?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:n})})},[null==S?void 0:S.emptyText,p.length,v]),qe=t.useCallback(function(){return 0===Ae.length?Ve():Ae.map(function(n,o){var i,a=X(n,g),l=ne.includes(a),s=se.includes(a),c=(null==N?void 0:N(n,o))||{},d=o===Ae.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof U?U(n,o):U||""," ").concat(ve===o?"dragging":""," ").concat(be===o?"drag-over":""),draggable:!0,onDragStart:function(){return He(o)},onDragOver:function(e){return Ye(e,o)},onDrop:function(e){return Pe(e,o)},onDragEnd:Oe,style:r({cursor:"move",opacity:ve===o?.5:1,backgroundColor:be===o?"#F9FAFB":"white",transition:"background-color 0.2s"},c.style),onMouseEnter:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ve!==o&&be!==o&&(e.currentTarget.style.backgroundColor="white")}},c,{children:[v&&e.jsx("td",{style:{width:"number"==typeof v.columnWidth?"".concat(v.columnWidth,"px"):"string"==typeof v.columnWidth?v.columnWidth:"60px",position:v.fixed?"sticky":"relative",left:"left"===v.fixed||!0===v.fixed?"0px":void 0,right:"right"===v.fixed?"0px":void 0,zIndex:v.fixed?"left"===v.fixed||!0===v.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(O,{checked:l,onChange:function(e){return De(n,e.target.checked)},disabled:null===(i=v.getCheckboxProps)||void 0===i?void 0:i.call(v,n).disabled})})}),p.map(function(t,i){var a,l=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||i,s=(null===(a=t.onCell)||void 0===a?void 0:a.call(t,n,o))||{},c=We(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",r({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:r({width:u,minWidth:t.minWidth?"number"==typeof t.minWidth?"".concat(t.minWidth,"px"):t.minWidth:u||void 0,maxWidth:u,position:t.fixed?"sticky":"relative",left:"left"===t.fixed||!0===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,right:"right"===t.fixed?void 0!==c?"".concat(c,"px"):"0":void 0,zIndex:t.fixed?"left"===t.fixed||!0===t.fixed?10:9:1,backgroundColor:"white",boxShadow:"left"===t.fixed||!0===t.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===t.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",textAlign:t.align||"left"},s.style),colSpan:t.colSpan,rowSpan:t.rowSpan},s,{children:Ie(t,n,o)}),l)})]})),(null==J?void 0:J.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:J.expandedRowRender(n,o,0,!0)})})]},a)})},[Ae,g,ne,se,v,p,N,U,De,Ie,J,ve,be,He,Ye,Pe,Oe,We,Ve]),_e=function(){var t;if(!1===y||!y)return null;var n=null!==(t=y.total)&&void 0!==t?t:Te.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(P,{current:ue,total:n,pageSize:he,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"})})},Xe=t.useMemo(function(){return p.some(function(e){return e.fixed})||v&&v.fixed},[p,v]),Ze=t.useMemo(function(){return p.every(function(e){return e.width})&&(!v||v.columnWidth)},[p,v]),Ke=t.useMemo(function(){if(null==T?void 0:T.x){if("number"==typeof T.x)return T.x;if(!0===T.x)return p.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(v?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth||"60").replace("px",""))||60:0)}if(Xe)return p.reduce(function(e,t){return t.fixed&&t.width?e+("number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0):e},0)+(v&&v.fixed&&v.columnWidth?"number"==typeof v.columnWidth?v.columnWidth:parseInt(String(v.columnWidth).replace("px",""))||60:0)},[p,null==T?void 0:T.x,v,Xe]),Ge=t.useMemo(function(){return"fixed"===A||Xe||Ze||p.some(function(e){return e.width})?"fixed":A},[A,Xe,Ze,p]),Je=r(r({width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:Ge,backgroundColor:"white"},k&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),Ue=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"},G);if(ke)return e.jsxs("div",r({ref:je,className:"aha-table aha-table-mobile-wrapper ".concat(Y),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Te)}),y&&"object"==typeof y&&(null===(o=y.position)||void 0===o?void 0:o.startsWith("top"))&&_e(),(Ee="function"==typeof(null==S?void 0:S.emptyText)?S.emptyText():void 0!==(null==S?void 0:S.emptyText)?S.emptyText:"No data",0===Ae.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:Ee}):e.jsx("div",{className:"aha-table-mobile",children:Ae.map(function(t,n){var o,r=X(t,g),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:[v&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(O,{checked:i,onChange:function(e){return De(t,e.target.checked)},disabled:null===(o=v.getCheckboxProps)||void 0===o?void 0:o.call(v,t).disabled})}),p.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=_(t,o.dataIndex||""),a=o.render?o.render(i,t,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 o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},r)})]},r)})})),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Te)}),y&&("object"!=typeof y||!(null===(a=y.position)||void 0===a?void 0:a.startsWith("top")))&&_e(),e.jsx(q,{loading:j,spinColor:ee})]}));var Qe={position:"relative",overflowX:(null==T?void 0:T.x)||Xe?"auto":"visible",overflowY:(null==T?void 0:T.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==T?void 0:T.x)?"100%":"number"==typeof(null==T?void 0:T.x)?"".concat(T.x,"px"):void 0,maxHeight:"number"==typeof(null==T?void 0:T.y)?"".concat(T.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:je,className:"aha-table ".concat(Y),style:Ue,"aria-busy":!!j||void 0},$,{children:[M&&e.jsx("div",{style:{marginBottom:"16px"},children:M(Te)}),y&&"object"==typeof y&&(null===(l=y.position)||void 0===l?void 0:l.startsWith("top"))&&_e(),e.jsx("div",{style:Qe,children:e.jsx("div",{style:{width:"100%",minWidth:Ke?"".concat(Ke,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Je,className:K,children:[Ne(),e.jsx("tbody",{children:qe()}),L&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:p.length+(v?1:0),children:L(Te)})})})]})})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(Te)}),y&&("object"!=typeof y||!(null===(c=y.position)||void 0===c?void 0:c.startsWith("top")))&&_e(),e.jsx(q,{loading:j,spinColor:ee})]}))},exports.Tag=function(n){var o=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,c=n.size,d=void 0===c?"md":c,p=n.stroke,f=void 0!==p&&p,h=n.iconType,x=n.icon,g=n.avatarSrc,v=n.dotColor,m=n.action,y=void 0===m?"none":m,b=n.count,w=n.onClose,C=n.checkbox,k=void 0!==C&&C,F=n.checked,j=n.onCheckedChange,S=n.iconPosition,D=n.className,z=void 0===D?"":D,M=n.onClick,B=i(n,["children","color","variant","size","stroke","iconType","icon","avatarSrc","dotColor","action","count","onClose","checkbox","checked","onCheckedChange","iconPosition","className","onClick"]),A=u().primaryColor,R=t.useState(!1),I=R[0],W=R[1],N=function(e){return"large"===e?"lg":"small"===e?"sm":e}(d),H=L[N],Y=void 0!==F?F:I,P=null!=h?h:x&&"leading"===S?"icon":"none",O="none"!==y?y:void 0,V=k?H.plCheckbox:"dot"===P?H.plDot:"avatar"===P||"icon"===P?H.plAvatar:H.basePx,q="x-close"===O?H.prClose:"count"===O?H.prCount:H.basePx,_={display:"inline-flex",alignItems:"center",gap:"x-close"===O?H.rootGap:0,paddingLeft:V,paddingRight:q,paddingTop:H.basePy,paddingBottom:H.basePy,height:H.height,borderRadius:6,fontFamily:"DM Sans, sans-serif",fontWeight:500,fontSize:H.fontSize,lineHeight:H.lineHeight,transition:"all 0.2s",cursor:M?"pointer":"default",boxSizing:"border-box",backgroundColor:"#ffffff",color:"#44403c",outline:"1px solid #d7d3d0",outlineOffset:"-1px"};if(a){var X=function(e,t){if(e in E){var n=E[e];return"Orange"===e&&t?r(r({},n),{fill:r(r({},n.fill),{bg:t})}):n}if(e.startsWith("#")){var o=parseInt(e.slice(1,3),16),i=parseInt(e.slice(3,5),16),a=parseInt(e.slice(5,7),16);return{light:{bg:"rgba(".concat(o,",").concat(i,",").concat(a,",0.1)"),text:e,border:"rgba(".concat(o,",").concat(i,",").concat(a,",0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Gray}(a,A);"light"===s?(_.backgroundColor=X.light.bg,_.color=X.light.text,_.outline=f?"1px solid ".concat(function(e){var t={Green:"#A4F4CF",Red:"#FFC9C9",Orange:"#FFD1A9",Blue:"#BEDBFF",Yellow:"#FFD1A9",Cyan:"#A2F4FD",Violet:"#DDD6FF",Pink:"#FCCEE8",Gray:"#E7E5E4"};if(e in t)return t[e];if(e.startsWith("#")){var n=parseInt(e.slice(1,3),16),o=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return"rgba(".concat(n,",").concat(o,",").concat(r,",0.3)")}return"#E7E5E4"}(a)):"none",_.outlineOffset=f?"-1px":void 0):(_.backgroundColor=X.fill.bg,_.color=X.fill.text,_.outline="none")}M&&(_.cursor="pointer");return e.jsxs("div",r({className:z,style:_,onClick:M},B,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:H.contentGap,flexShrink:0},children:[k&&e.jsx("div",{role:"checkbox","aria-checked":Y,onClick:function(e){e.stopPropagation();var t=!Y;void 0===F&&W(t),null==j||j(t)},style:{width:H.checkboxSize,height:H.checkboxSize,borderRadius:4,flexShrink:0,border:Y?"none":"1px solid #d7d3d0",background:Y?A||"#7F56D9":"#ffffff",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},children:Y&&e.jsx("svg",{width:Math.round(.65*H.checkboxSize),height:Math.round(.65*H.checkboxSize),viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M8.5 2L4 7.5 1.5 5",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),"avatar"===P?e.jsx(T,{src:g,size:H.avatarSize}):"dot"===P?e.jsx("svg",{width:8,height:8,viewBox:"0 0 8 8",fill:"none",style:{flexShrink:0},children:e.jsx("circle",{cx:4,cy:4,r:3.5,fill:v||"currentColor"})}):"icon"===P&&x?e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:t.cloneElement(x,{width:H.avatarSize,height:H.avatarSize})}):null,e.jsx("span",{style:{whiteSpace:"nowrap"},children:o}),"count"===O&&"number"==typeof b&&e.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center",paddingLeft:H.countPx,paddingRight:H.countPx,paddingTop:1,paddingBottom:1,background:"rgba(0,0,0,0.07)",borderRadius:3,fontSize:H.countFontSize,fontWeight:500,lineHeight:"16px",flexShrink:0},children:b})]}),"x-close"===O&&e.jsx("button",{"aria-label":"Remove",onClick:function(e){e.stopPropagation(),null==w||w()},style:{display:"flex",alignItems:"center",justifyContent:"center",padding:H.closePad,borderRadius:3,border:"none",background:"transparent",cursor:"pointer",flexShrink:0,color:"inherit",opacity:.55,lineHeight:0},children:e.jsx("svg",{width:H.closeSize,height:H.closeSize,viewBox:"0 0 10 10",fill:"none",children:e.jsx("path",{d:"M7.5 2.5l-5 5M2.5 2.5l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),"after"===S&&x&&!h&&e.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0,marginLeft:H.contentGap},children:x})]}))},exports.Textarea=re,exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},c),o)},[o]);return e.jsx(d.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(F,{id:"direct",props:t})},exports.ToastProvider=function(o){var r=o.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[r,a&&n.createPortal(e.jsx(k,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,c=o.trigger,d=void 0===c?"hover":c,u=o.delay,p=void 0===u?200:u,f=o.disabled,h=void 0!==f&&f,x=o.className,g=void 0===x?"":x,v=o.tooltipClassName,m=void 0===v?"":v,y=o.gap,b=void 0===y?6:y,w=o.showArrow,C=void 0===w||w,k=o.width,F=o.defaultVisible,j=void 0!==F&&F,S=o.visible,D=o.onVisibleChange,z=void 0!==S,M=t.useState(j),E=M[0],L=M[1],T=z?S:E,B=t.useState(z?null!=S&&S:j),A=B[0],R=B[1],I=t.useCallback(function(e){z||L(e),null==D||D(e)},[z,D]);t.useEffect(function(){z&&(S?requestAnimationFrame(function(){R(!0)}):R(!1))},[z,S]);var W=t.useState(s),N=W[0],H=W[1],Y=t.useState("320px"),P=Y[0],O=Y[1],V=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===d?"auto":"none"}),q=V[0],_=V[1],X=t.useState({}),Z=X[0],K=X[1],G=t.useRef(null),J=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(G.current&&J.current&&T&&A){var e=G.current.getBoundingClientRect(),t=J.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!ye(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!ye(e,t,a,o))return a}return n}(e,t,s,b);H(n);var o=me(e,t,n,b),i=o.top,a=o.left;if(_(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===d?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,c=o-i,d=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-c,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-d,6),n.height-6)};case"top-left":return{bottom:-6,left:12};case"top-right":return{bottom:-6,right:12};case"bottom-left":return{top:-6,left:12};case"bottom-right":return{top:-6,right:12};default:return{}}}(n,e,t,a,i);K(l)}}},[T,s,b,C,A,d]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){I(!0),z||requestAnimationFrame(function(){R(!0)})},p))},[h,p,I,z]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),z?I(!1):(R(!1),Q.current=setTimeout(function(){I(!1),Q.current=null},150))},[I,z]),ne=t.useCallback(function(){"hover"===d&&(Q.current&&(clearTimeout(Q.current),Q.current=null),T||(I(!0),requestAnimationFrame(function(){R(!0)})))},[d,T]),oe=t.useCallback(function(e){h||"click"!==d||(e.stopPropagation(),T?te():(U.current&&(clearTimeout(U.current),U.current=null),I(!0),requestAnimationFrame(function(){R(!0)})))},[h,d,T,te]);t.useEffect(function(){if(j&&T&&A){var e=function(){G.current&&J.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,T,A,$]),t.useEffect(function(){if(T)return requestAnimationFrame(function(){$()}),window.addEventListener("scroll",$,!0),window.addEventListener("resize",$),function(){window.removeEventListener("scroll",$,!0),window.removeEventListener("resize",$)}},[T,$]),t.useEffect(function(){if(T&&"click"===d){var e=function(e){G.current&&J.current&&!G.current.contains(e.target)&&!J.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[T,d,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var re={position:"absolute",top:0,left:0,opacity:A?1:0,transform:A?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===d?"auto":"none",zIndex:9999},ie=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){O(ie())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ie]);var ae=r(r({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==k?{width:"number"==typeof k?"".concat(k,"px"):k,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:P,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),le=e.jsxs("div",{style:r(r(r({},re),q),{pointerEvents:"hover"===d?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===d?ne:void 0,onMouseLeave:"hover"===d?te:void 0,children:[e.jsx("div",{ref:J,className:"aha-tooltip ".concat(m),style:ae,role:"tooltip",children:i}),C&&be(N,Z)]}),se=t.useCallback(function(){"hover"===d&&(Q.current=setTimeout(function(){te()},100))},[d,te]),ce="click"===d?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:se,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:G,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===d?"pointer":"default"}},ce,{children:a})),T&&"undefined"!=typeof document&&n.createPortal(le,document.body)]})},exports.clearAllToasts=function(){C.clearAll()},exports.closeToast=function(e){C.removeToast(e)},exports.debugToast=function(){console.log("=== Toast 调试信息 ==="),console.log("当前环境:","undefined"!=typeof window?"浏览器":"服务端"),console.log("document 可用:","undefined"!=typeof document),console.log("容器元素:",document.getElementById("aha-toast-container")),console.log("Toast 管理器状态:",C.getToasts()),console.log("容器根节点:",D),console.log("是否正在初始化:",z),console.log("====================")},exports.toast=j,exports.toastError=function(e,t){return M(),j(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return M(),j(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return M(),j(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return M(),j(r(r({},t),{message:e,type:"success"}))},exports.useTheme=u;
2
2
  //# sourceMappingURL=index.js.map