aha-components 1.5.1 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(){return o=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},o.apply(this,arguments)};function r(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 i(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 a(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 l(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 s={primaryColor:"#FB6011"},c=t.createContext(s),d=function(){var e=t.useContext(c);return e||s},u={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},p=function(t){var n=t.size,o=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},f=function(n){var i,a=n.children,l=n.type,s=void 0===l?"default":l,c=n.size,f=void 0===c?"medium":c,h=n.disabled,x=void 0!==h&&h,g=n.loading,v=void 0!==g&&g,m=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,F=n.style,k=n.icon,j=n.iconPosition,S=void 0===j?"left":j,D=r(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=d().primaryColor,M=void 0===E?"#FB6011":E,A=t.useState(!1),L=A[0],T=A[1],z=t.useState(!1),B=z[0],R=z[1],W=u[f],I=x||v,N=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(W.iconSize.replace("px",""));return e.jsx(p,{size:n,color:t})}return k?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:W.iconSize,height:W.iconSize,flexShrink:0},children:k}):null},H=(i=o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:W.gap,height:W.height,paddingLeft:W.paddingLeft,paddingRight:W.paddingRight,fontSize:W.fontSize,lineHeight:W.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:I?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},F),"primary"===s?(i.color="#FFFFFF",i.backgroundColor=M,x?(i.opacity=.4,i.cursor="not-allowed"):v?i.backgroundColor=M:B?i.backgroundColor="#EC470A":L&&(i.backgroundColor="#FD843A")):x?(i.backgroundColor="#FAFAF9",i.color="#D6D3D1",i.border="1px solid #E7E5E4"):v?(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):B?(i.backgroundColor="#F5F5F4",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):L?(i.backgroundColor="#FAFAF9",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),i);return e.jsxs("button",o({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(f," ").concat(I?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(C),disabled:I,onClick:function(e){I?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!I&&T(!0)},onMouseLeave:function(){T(!1),R(!1)},onMouseDown:function(){return!I&&R(!0)},onMouseUp:function(){return R(!1)},style:H},D,{children:[v&&N(),!v&&"left"===S&&N(),a&&e.jsx("span",{style:{display:"inline-block"},children:a}),!v&&"right"===S&&N()]}))};f.displayName="Button";var h={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"})})},x=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"})}),g={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"})})},v=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"})})},m=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 l([],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}(),y=new m,b=function(){var n=t.useState([]),r=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=y.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=y.subscribe(function(){var e=y.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=r.filter(function(e){return"top-left"===e.props.position}),l=r.filter(function(e){return"top-right"===e.props.position}),s=r.filter(function(e){return"bottom-left"===e.props.position}),c=r.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(w,o({},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(w,o({},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(w,o({},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(w,o({},t),t.id)})})]})},w=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,m=r.icon,b=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:g.success};case"error":return{bgColor:"#E7000B",defaultIcon:g.error};case"question":return{bgColor:"#1C1917",defaultIcon:g.question};default:return{bgColor:"#1447E6",defaultIcon:g.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(){y.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:m||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}),b&&e.jsx("div",{style:{marginTop:"12px"},children:b})]}),C&&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(v,{})})]})})},C=function(e){return console.log("Toast: 调用 toast 函数",e),S(),setTimeout(function(){var t=y.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},F=null,k=null,j=!1,S=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(j)console.log("Toast: 容器正在初始化中,跳过");else if(F)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),j=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),F=t,void(j=!1);console.log("Toast: 创建容器元素"),(F=document.createElement("div")).id="aha-toast-container",document.body.appendChild(F),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),k=n(F),console.log("Toast: 渲染 ToastContainer 组件"),k.render(e.jsx(b,{})),console.log("Toast: 容器渲染完成"),j=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),k=n(F),console.log("Toast: 渲染 ToastContainer 组件"),k.render(e.jsx(b,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}j=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),j=!1})}}catch(e){console.error("Toast: 创建容器失败",e),j=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},D={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"}}},E={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"}},M=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"})})},A=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"})})},L=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"})})},T=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"})]})},z=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"})]})},B=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"})})},R=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"})})},W=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"})})})]})},I=function(n){var r=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,c=n.pageSize,u=n.defaultPageSize,p=void 0===u?10:u,h=n.showSizeChanger,x=void 0!==h&&h,g=n.pageSizeOptions,v=void 0===g?["10","20","50","100"]:g,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,E=void 0!==D&&D,M=n.className,A=void 0===M?"":M,L=n.style,T=n.size,z=void 0===T?"default":T,W=n.responsive,I=void 0!==W&&W;n.showLessItems;var N=n.itemRender,H=d().primaryColor,V=void 0===H?"#FB6011":H,O=t.useState(a),P=O[0],Y=O[1],q=t.useState(p),Z=q[0],K=q[1],X=t.useState(""),G=X[0],J=X[1],_=null!=r?r:P,U=null!=c?c:Z,Q=t.useMemo(function(){return Math.ceil(s/U)},[s,U]);t.useEffect(function(){void 0!==r&&Y(r)},[r]),t.useEffect(function(){void 0!==c&&K(c)},[c]);var $=function(e){e<1||e>Q||e===_||S||(void 0===r&&Y(e),null==w||w(e,U))},ee=function(){var e=parseInt(G,10);e>=1&&e<=Q&&($(e),J(""))};if(E&&Q<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(A),style:L,children:[e.jsx(f,{onClick:function(){return $(_-1)},disabled:S||1===_,type:"default",size:"default"===z?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[_," / ",Q]}),e.jsx(f,{onClick:function(){return $(_+1)},disabled:S||_===Q,type:"default",size:"default"===z?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var te=(_-1)*U+1,ne=Math.min(_*U,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(A),style:o({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:I?"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,[te,ne])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[N?N(_-1,"prev",e.jsx(f,{onClick:function(){return $(_-1)},disabled:S||1===_,type:"default",size:"default"===z?"medium":"small",style:{height:"small"===z?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{})," ",e.jsx("span",{children:"Previous"})]})})):e.jsx(f,{onClick:function(){return $(_-1)},disabled:S||1===_,type:"default",size:"default"===z?"medium":"small",style:{height:"small"===z?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(B,{})," ",e.jsx("span",{children:"Previous"})]})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(Q<=7)return Array.from({length:Q},function(e,t){return t+1});var e=[];if(_<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(Q)}else if(_>=Q-3){e.push(1),e.push("jump-prev");for(t=Q-4;t<=Q;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=_-1;t<=_+1;t++)e.push(t);e.push("jump-next"),e.push(Q)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===_,o=e.jsx(f,{onClick:function(){return $(t)},disabled:S,type:"default",size:"default"===z?"medium":"small",style:{minWidth:"small"===z?"32px":"36px",height:"small"===z?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:"none",background:n?"#FAFAF9":"white",backgroundColor:n?"#FAFAF9":"white",color:n?V:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return N?N(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(f,{onClick:function(){return $(Math.max(1,_-5))},disabled:S,type:"default",size:"default"===z?"medium":"small",style:{minWidth:"small"===z?"32px":"36px",height:"small"===z?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),N?N(_-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(f,{onClick:function(){return $(Math.min(Q,_+5))},disabled:S,type:"default",size:"default"===z?"medium":"small",style:{minWidth:"small"===z?"32px":"36px",height:"small"===z?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),N?N(_+5,"jump-next",o):o;return null}(t)})}),N?N(_+1,"next",e.jsx(f,{onClick:function(){return $(_+1)},disabled:S||_===Q,type:"default",size:"default"===z?"medium":"small",style:{height:"small"===z?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"Next"})," ",e.jsx(R,{})]})})):e.jsx(f,{onClick:function(){return $(_+1)},disabled:S||_===Q,type:"default",size:"default"===z?"medium":"small",style:{height:"small"===z?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"Next"})," ",e.jsx(R,{})]})}),x&&e.jsx("select",{value:U,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(s/t),o=_>n?n:_,void 0===c&&K(t),void 0===r&&Y(o),null==C||C(o,t),void(null==w||w(o,t));var t,n,o},disabled:S,style:{padding:"small"===z?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===z?"12px":"14px",lineHeight:"small"===z?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:S?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){S||(e.currentTarget.style.borderColor=V)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:v.map(function(t){return e.jsxs("option",{value:t,children:[t," 条/页"]},t)})}),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:"跳至"}),e.jsx("input",{type:"number",min:"1",value:G,onChange:function(e){return J(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ee()},disabled:S,style:{width:"56px",height:"small"===z?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=V},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof y&&y.goButton?e.jsx(f,{onClick:ee,disabled:S,type:"default",size:"default"===z?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(f,{onClick:ee,disabled:S,type:"default",size:"default"===z?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},N=function(t){var n=t.checked,r=void 0!==n&&n,i=t.indeterminate,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l,c=t.onChange,u=t.className,p=void 0===u?"":u,f=t.style,h=t.children,x=d().primaryColor,g=r||a,v=s?"#FAFAF9":g?x:"white",m=s?"#FAFAF9":g?x:"#D7D3D0";return e.jsxs("div",{className:"aha-checkbox ".concat(p),style:o({display:"inline-flex",alignItems:"center",gap:"8px",cursor:s?"not-allowed":"pointer"},f),onClick:function(e){s||(null==c||c({target:{checked:!r},currentTarget:{checked:!r}}))},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(A,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(M,{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:r,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"})]})};N.displayName="Checkbox";var H=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)},V=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=H(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},O=function(t){var n=t.order,o=d().primaryColor;return"ascend"===n?e.jsx(z,{style:{color:o}}):"descend"===n?e.jsx(T,{style:{color:o}}):e.jsx(L,{})},P=function(t){var n=t.checked,r=void 0!==n&&n,i=t.disabled,a=void 0!==i&&i,l=t.onChange,s=t.className,c=void 0===s?"":s,u=t.style,p=t.children,f=t.value,h=t.name,x=d().primaryColor,g=void 0===x?"#FB6011":x,v=a?"#FAFAF9":r?g:"white",m=a?"#FAFAF9":r?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(c),style:o({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},u),onClick:function(e){a||(null==l||l({target:{checked:!r,value:f},currentTarget:{checked:!r,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:r?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:r,onChange:l,disabled:a,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};P.displayName="Radio";var Y=t.forwardRef(function(n,i){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,c=void 0!==s&&s,u=n.error,p=void 0!==u&&u,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,E=n.onChange,M=n.onFocus,A=n.onBlur,L=n.onPressEnter,T=r(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),z=d().primaryColor,B=void 0===z?"#FB6011":z,R=t.useRef(null),W=t.useState(D||S||""),I=W[0],N=W[1],H=t.useState(!1),V=H[0],O=H[1];t.useEffect(function(){"function"==typeof i?i(R.current):i&&(i.current=R.current)},[i]);var P=void 0!==S,Y=P?S:I,q=function(e){var t;e.stopPropagation(),P||N("");null==E||E({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},Z=m&&Y&&!c,K={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"}},X=g||Z?"40px":"12px",G=o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":V?B:"#D7D3D0"),backgroundColor:c||h?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:X,paddingTop:K[l].paddingTop,paddingBottom:K[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",o({ref:R,type:k,value:Y,placeholder:j,disabled:c,readOnly:h,onChange:function(e){P||N(e.target.value),null==E||E(e)},onFocus:function(e){O(!0),null==M||M(e)},onBlur:function(e){O(!1),null==A||A(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=T.onKeyDown)||void 0===t||t.call(T,e)},style:G,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(g||Z)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[Z&&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})]})]})]})});Y.displayName="Input";var q=t.forwardRef(function(n,i){var a=n.disabled,l=void 0!==a&&a,s=n.error,c=void 0!==s&&s,u=n.readOnly,p=void 0!==u&&u,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,E=n.onBlur,M=r(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),A=d().primaryColor,L=void 0===A?"#FB6011":A,T=t.useRef(null),z=t.useState(w||b||""),B=z[0],R=z[1],W=t.useState(!1),I=W[0],N=W[1],H=t.useState(void 0),V=H[0],O=H[1];t.useEffect(function(){"function"==typeof i?i(T.current):i&&(i.current=T.current)},[i]);var P=void 0!==b,Y=P?b:B,q=String(Y||"").length;t.useEffect(function(){if(j&&T.current){var e=T.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)}},[Y,j]);var Z=o(o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":I?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!==V&&j?{height:"".concat(V,"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",o({ref:T,value:Y,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){N(!0),null==D||D(e)},onBlur:function(e){N(!1),null==E||E(e)},style:Z,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(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})})]})]})});q.displayName="Textarea";var Z=function(n){var r=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,c=n.onChange,u=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=d().primaryColor,C=void 0===w?"#FB6011":w,F=t.useState(a),k=F[0],j=F[1],S=void 0!==r,D=S?r:k,E={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,A=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(E.thumbSize," - ").concat(E.thumbOffset,")"):E.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==u||u(t,e)}},className:"aha-switch ".concat(y),style:o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:E.width,height:E.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:M?"6px":"auto",right:M?"auto":"6px",fontSize:E.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:E.thumbSize,height:E.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"})]})})]})};Z.displayName="Switch";var K=function(r){var i,a=r.value,s=r.defaultValue,c=r.options,u=void 0===c?[]:c,p=r.mode,f=r.disabled,h=void 0!==f&&f,x=r.error,g=void 0!==x&&x,v=r.placeholder,m=void 0===v?"Please select":v,y=r.size,b=void 0===y?"medium":y,w=r.showSearch,C=void 0!==w&&w,F=r.filterOption,k=void 0===F||F,j=r.allowClear,S=void 0!==j&&j,D=r.onChange,E=r.onSelect,M=r.onDeselect,A=r.onSearch,L=r.onFocus,T=r.onBlur,z=r.onDropdownVisibleChange,B=r.className,R=void 0===B?"":B,W=r.style,I=r.dropdownClassName,N=void 0===I?"":I,H=r.dropdownStyle,V=r.defaultOpen,O=void 0!==V&&V,P=r.open,Y=r.maxTagCount,q=r.tagRender,Z=r.optionRender,K=d().primaryColor,X=void 0===K?"#FB6011":K,G=t.useState(void 0!==s?s:p?[]:void 0),J=G[0],_=G[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:J,xe=fe?P:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return u.filter(function(t){return e.includes(t.value)})},[he,u]),me=t.useCallback(function(){return C&&te?!1===k?u:"function"==typeof k?u.filter(function(e){return k(te,e)}):u.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):u},[u,te,C,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){if(ae.current){var e=ae.current.getBoundingClientRect();ue({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[xe]),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==z||z(!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,z]),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==z||z(!1),null===(t=ae.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,re,fe,z]),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=l(l([],o,!0),[e.value],!1),null==E||E(e.value,e)),pe||_(n);var r=u.filter(function(e){return n.includes(e.value)});null==D||D(n,r)}else pe||_(e.value),null==D||D(e.value,e),null==E||E(e.value,e),fe||$(!1),null==z||z(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,u,D,E,M,z]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),o=u.find(function(e){return e.value===t});pe||_(n),null==D||D(n,ve()),null==M||M(t,o)}},[ge,he,pe,u,D,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||_(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"===Y?ke.slice(0,2):Y?ke.slice(0,Y):ke,o=Y&&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,Y,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:o({position:"relative",display:"inline-flex",alignItems:"center",width:"100%",minWidth:"120px",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":xe?X:"#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==z||z(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==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(N),style:o({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:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",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 Z?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:Z(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:X,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};K.displayName="Select";var X=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],G=["January","February","March","April","May","June","July","August","September","October","November","December"],J=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"),G[o]).replace(new RegExp("","g"),X[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},_=function(e,t){return new Date(e,t+1,0).getDate()},U=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Q=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},$=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i},ee=function(r){var i=r.mode,a=void 0===i?"date":i,l=r.disabled,s=void 0!==l&&l,c=r.error,u=void 0!==c&&c,p=r.placeholder,f=void 0===p?"Select date":p,h=r.startPlaceholder,x=void 0===h?"Start date":h,g=r.endPlaceholder,v=void 0===g?"End date":g,m=r.size,y=void 0===m?"medium":m,b=r.allowClear,w=void 0!==b&&b,C=r.format,F=void 0===C?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":C,k=r.onFocus,j=r.onBlur,S=r.onOpenChange,D=r.className,E=void 0===D?"":D,M=r.style,A=r.dropdownClassName,L=void 0===A?"":A,T=r.dropdownStyle,z=r.defaultOpen,B=void 0!==z&&z,R=r.open,W=r.minDate,I=r.maxDate,N=r.separator,H=void 0===N?" - ":N,V=r.presetRanges,O=void 0!==V&&V,P=r.calendarCount,Y=void 0===P?1:P,q=r.showApplyCancel,Z=void 0!==q&&q,K=r.applyText,X=void 0===K?"Apply":K,ee=r.cancelText,te=void 0===ee?"Cancel":ee,ne=r.onApply,oe=r.onCancel,re=d().primaryColor,ie=void 0===re?"#FB6011":re,ae="range"===a,le=t.useState(function(){return"date"===a&&"defaultValue"in r&&r.defaultValue||null}),se=le[0],ce=le[1],de=t.useState(function(){return"range"===a&&"defaultValue"in r&&r.defaultValue||{startDate:null,endDate:null}}),ue=de[0],pe=de[1],fe=t.useState(B),he=fe[0],xe=fe[1],ge=t.useState(!0),ve=ge[0],me=ge[1],ye=t.useState(null),be=ye[0],we=ye[1],Ce=t.useState(function(){var e,t;if("date"===a&&"value"in r&&r.value&&(t=r.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in r&&r.value&&(t=(e=r.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in r&&r.defaultValue&&(t=r.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in r&&r.defaultValue&&(t=(e=r.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Fe=Ce[0],ke=Ce[1],je=t.useState(function(){if(2===Y&&ae){var e=new Date(Fe.year,Fe.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Se=je[0],De=je[1];t.useEffect(function(){if(2===Y&&ae){var e=new Date(Fe.year,Fe.month+1,1);De({year:e.getFullYear(),month:e.getMonth()})}else De(null)},[Fe,Y,ae]);var Ee=t.useRef(null),Me=t.useRef(null),Ae=t.useRef(null),Le=t.useRef(null),Te=t.useRef(null),ze=t.useState(null),Be=ze[0],Re=ze[1],We=t.useRef(!1),Ie="value"in r&&void 0!==r.value,Ne=void 0!==R,He=ae?null:Ie&&"date"===a&&"value"in r?r.value:se,Ve=ae?Ie&&"range"===a&&"value"in r?r.value||{startDate:null,endDate:null}:ue:{startDate:null,endDate:null},Oe=Ne?R:he;t.useEffect(function(){if(Oe&&!We.current){if(ae){var e=Ve.startDate||Ve.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Fe.year===t&&Fe.month===n||ke({year:t,month:n})}}else if(He){t=He.getFullYear(),n=He.getMonth();Fe.year===t&&Fe.month===n||ke({year:t,month:n})}We.current=!0}else Oe||(We.current=!1)},[Oe,He,Ve,ae,Fe]),t.useEffect(function(){if(Oe&&Ee.current){var e=function(){if(Ee.current){var e=Ee.current.getBoundingClientRect();Re({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Re(null)},[Oe]),t.useEffect(function(){var e=function(e){var t=e.target;Ee.current&&!Ee.current.contains(t)&&Te.current&&!Te.current.contains(t)&&(Ne||xe(!1),null==S||S(!1))};if(Oe)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Oe,Ne,S]);var Pe,Ye=t.useCallback(function(e){var t;Q(e,W,I)&&(Ie||ce(e),"date"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),Ne||xe(!1),null==S||S(!1))},[Ie,Ne,a,r,S,W,I]),qe=t.useCallback(function(e){var t;if(Q(e,W,I)){var n,o=Z&&be?be:Ve;ve?o.endDate&&e>o.endDate?(n={startDate:o.endDate,endDate:e},me(!1)):(n={startDate:e,endDate:o.endDate},o.endDate?(me(!0),Z||(Ne||xe(!1),null==S||S(!1))):me(!1)):o.startDate&&e<o.startDate?(n={startDate:e,endDate:o.startDate},me(!1)):(n={startDate:o.startDate,endDate:e},me(!0),Z||(Ne||xe(!1),null==S||S(!1))),Z?we(n):(Ie||pe(n),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,n)))}},[ve,Ve,be,Z,Ie,Ne,a,r,S,W,I]),Ze=function(e){var t,n;if(e.stopPropagation(),ae){var o={startDate:null,endDate:null};Ie||pe(o),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,o)),me(!0)}else Ie||ce(null),"date"===a&&"onChange"in r&&(null===(n=r.onChange)||void 0===n||n.call(r,null))},Ke=function(){if(!s){var e=!Oe;Ne||xe(e),null==S||S(e),e&&ae?(me(!Ve.startDate),Z&&we(Ve)):!e&&Z&&we(null)}},Xe=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}}]},[]),Ge=function(e){var t;Z?we(e):(Ie||pe(e),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),Ne||xe(!1),null==S||S(!1))},Je=function(){ke(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},_e=function(){ke(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},Ue=t.useCallback(function(e,t){for(var n=_(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),Qe=t.useMemo(function(){return Ue(Fe.year,Fe.month)},[Fe,Ue]),$e=t.useMemo(function(){return 2===Y&&ae&&Se?Ue(Se.year,Se.month):null},[Y,ae,Se,Ue]),et=function(){Se&&De(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},tt=function(){Se&&De(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},nt={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"}},ot=w&&!s&&(ae?Ve.startDate||Ve.endDate:He),rt=He?J(He,F):"",it=Ve.startDate?J(Ve.startDate,F):"",at=Ve.endDate?J(Ve.endDate,F):"",lt=["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 "}),e.jsxs("div",{ref:Ee,className:"aha-date-picker ".concat(E),style:o({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(u?"#F04438":Oe?ie:"#D7D3D0"),backgroundColor:s?"#FAFAF9":"#FFFFFF",cursor:s?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:"36px",paddingTop:nt[y].paddingTop,paddingBottom:nt[y].paddingBottom,fontSize:nt[y].fontSize,lineHeight:nt[y].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},M),onClick:Ke,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"})})},{})}),ae?e.jsxs("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e.jsx("input",{ref:Ae,type:"text",value:it,readOnly:!0,placeholder:x,disabled:s,onClick:function(e){e.stopPropagation(),s||(me(!0),Oe||Ke())},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ve.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:Le,type:"text",value:at,readOnly:!0,placeholder:v,disabled:s,onClick:function(e){e.stopPropagation(),s||(me(!1),Oe||Ke())},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ve.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e.jsx("input",{ref:Me,type:"text",value:rt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||Ke()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":He?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:s?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e.jsxs("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[ot&&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:Ze,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:Oe})]})]}),Oe&&Be&&n.createPortal(e.jsx("div",{ref:Te,className:"aha-date-picker-dropdown ".concat(L),style:o({position:"absolute",top:"".concat(Be.top,"px"),left:"".concat(Be.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:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},T),children:e.jsxs("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:ae&&O&&1===Y?"column":"row"},children:[ae&&O&&2===Y&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:Z?"0":"8px"},children:Xe.map(function(t,n){var o=be?U(t.range.startDate,be.startDate)&&U(t.range.endDate,be.endDate):U(t.range.startDate,Ve.startDate)&&U(t.range.endDate,Ve.endDate);return e.jsx("div",{onClick:function(){return Ge(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?ie:"#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===Y?"row":"column",gap:2===Y?"24px":"0"},children:(Pe=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===Y&&ae?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===Y&&ae&&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===Y&&ae?"absolute":"relative",left:2===Y&&ae?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:[G[t.month]," ",t.year]}),!(2===Y&&ae&&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===Y&&ae?"absolute":"relative",right:2===Y&&ae?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"})})})]}),ae&&O&&1===Y&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:Xe.map(function(t,n){var o=be?U(t.range.startDate,be.startDate)&&U(t.range.endDate,be.endDate):U(t.range.startDate,Ve.startDate)&&U(t.range.endDate,Ve.endDate);return e.jsx("button",{type:"button",onClick:function(){return Ge(t.range)},style:{padding:"4px 9px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?ie:"#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:lt.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(o,r){if(o){var i=a+r,s=o.getMonth()===t.month,c=U(o,new Date),d=!Q(o,W,I);if(ae){var u=Z&&be?be:Ve,p=U(o,u.startDate),f=U(o,u.endDate),h=$(o,u.startDate,u.endDate),x=i%7==0,g=i%7==6,v=p,m=f,y=r>0?n[r-1]:null,b=r<n.length-1?n[r+1]:null;y&&$(y,u.startDate,u.endDate),b&&$(b,u.startDate,u.endDate);var w=r-7,C=r+7,F=w>=0?n[w]:null,k=C<n.length?n[C]:null;F&&$(F,u.startDate,u.endDate),k&&$(k,u.startDate,u.endDate);var j={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:d?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0};if(v||m)j.background=ie,j.borderRadius="50%",j.color="#FFFFFF",j.fontWeight=500;else if(h){j.background="#F5F5F4",j.color=s?d?"#D7D3D0":"#1C1917":"#78716C",j.fontWeight=400;var S=1===o.getDate(),D=_(t.year,t.month),E=o.getDate()===D,M=x||S,A=g||E;M&&A?j.borderRadius="18px":M?(j.borderTopLeftRadius="18px",j.borderBottomLeftRadius="18px",j.borderTopRightRadius="0",j.borderBottomRightRadius="0"):A?(j.borderTopRightRadius="18px",j.borderBottomRightRadius="18px",j.borderTopLeftRadius="0",j.borderBottomLeftRadius="0"):j.borderRadius="0"}else j.background="transparent",j.borderRadius="50%",j.color=s?d?"#D7D3D0":"#1C1917":"#78716C",j.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return qe(o)},style:j,onMouseEnter:function(e){d||v||m||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){v||m||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[o.getDate(),c&&!v&&!m&&!h&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:ie}})]},"date-".concat(r)))}else{var L=U(o,He);l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return Ye(o)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:L?ie:"transparent",cursor:d?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:L?500:400,color:L?"#FFFFFF":s?d?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){d||L||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){L||(e.currentTarget.style.backgroundColor="transparent")},children:[o.getDate(),c&&!L&&e.jsx("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:ie}})]},"date-".concat(r)))}}}),l}()})]},i)},e.jsxs(e.Fragment,{children:[Pe(Fe,Qe,Je,_e,0),2===Y&&ae&&Se&&$e&&Pe(Se,$e,et,tt,1)]}))}),ae&&Z&&e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[e.jsx("button",{type:"button",onClick:function(){we(null),null==oe||oe(),Ne||xe(!1),null==S||S(!1)},style:{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:te}),e.jsx("button",{type:"button",onClick:function(){var e;be&&(Ie||pe(be),"range"===a&&"onChange"in r&&(null===(e=r.onChange)||void 0===e||e.call(r,be)),null==ne||ne(be),Ne||xe(!1),null==S||S(!1),we(null))},disabled:!be||!be.startDate||!be.endDate,style:{padding:"8px 16px",border:"none",borderRadius:"8px",background:be&&be.startDate&&be.endDate?ie:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:be&&be.startDate&&be.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){be&&be.startDate&&be.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){be&&be.startDate&&be.endDate&&(e.currentTarget.style.backgroundColor=ie)},children:X})]})]})]})}),document.body)]})};ee.displayName="DatePicker";var te=t.createContext(null),ne=t.forwardRef(function(n,r){var l=n.initialValues,s=void 0===l?{}:l,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.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),D=t.useCallback(function(e,t){k(function(n){var r=o({},n);if(r[e]?r[e]=o(o({},r[e]),{value:t}):r[e]={value:t,error:void 0,touched:!1,validating:!1},j.current[e]?j.current[e]=o(o({},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(r).forEach(function(e){a[e]=r[e].value}),c(i,a)}return r})},[c]),E=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),M=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{error:t})),k(function(n){var r=o({},n);return r[e]?r[e]=o(o({},r[e]),{error:t}):r[e]={value:void 0,error:t,touched:!1,validating:!1},r})},[]),A=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),L=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{touched:t})),k(function(n){var r=o({},n);return r[e]?r[e]=o(o({},r[e]),{touched:t}):r[e]={value:void 0,error:void 0,touched:t,validating:!1},r})},[]),T=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.validating)||!1},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{validating:t})),k(function(n){var r=o({},n);return r[e]?r[e]=o(o({},r[e]),{validating:t}):r[e]={value:void 0,error:void 0,touched:!1,validating:t},r})},[]),B=t.useRef();B.current=function(e,t){k(function(n){if(n[e]){var r=n[e].rules||[],i=t.rules||[],a=r.length===i.length;if(a&&r.length>0)for(var l=0;l<r.length;l++){var c=r[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=o({},n);return u[e]?u[e]=o(o({},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 R=t.useCallback(function(e,t){var n;null===(n=B.current)||void 0===n||n.call(B,e,t)},[]),W=t.useCallback(function(e){k(function(t){var n=o({},t);return delete n[e],n})},[]),I=t.useCallback(function(e){return i(void 0,void 0,void 0,function(){var t,n,r,i,l,s,c,d,u;return a(this,function(a){switch(a.label){case 0:if(!(t=j.current[e]))return[2,void 0];z(e,!0),n=t.rules||[],i=0,l=n,a.label=1;case 1:if(!(i<l.length))return[3,6];if(s=l[i],c=t.value,s.required&&(null==c||""===c))return r=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 r=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 r=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 r=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 r=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 r=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof c&&c.trim()!==c)return r=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,s.validator(s,c)];case 3:return a.sent(),[3,5];case 4:return u=a.sent(),r=(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]=o(o({},j.current[e]),{error:r,validating:!1,touched:!0}):j.current[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{error:r,validating:!1,touched:!0}):i[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},i}),[2,r]}})})},[]),N=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},[]),H=t.useCallback(function(e){return i(void 0,void 0,void 0,function(){var t,n,o,r;return a(this,function(l){switch(l.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return i(void 0,void 0,void 0,function(){var n,o;return a(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 l.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(l.sent(),o.length>0)throw r={values:N(),errorFields:o},null==u||u(r),r;return[2,N()]}})})},[I,N,u]),V=t.useCallback(function(e){k(function(t){var n=o({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=o(o({},n[e]),{value:s[e],error:void 0,touched:!1,validating:!1}))}),n})},[s]),O=t.useCallback(function(e){k(function(t){var n=o({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=o(o({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1}}),c){var r={};Object.keys(n).forEach(function(e){r[e]=n[e].value}),c(e,r)}return n})},[c]),P=t.useCallback(function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,H()];case 1:return e=t.sent(),null==d||d(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[H,d]);t.useImperativeHandle(r,function(){return{getFieldValue:S,getFieldsValue:N,setFieldValue:D,setFieldsValue:O,getFieldError:E,validateField:I,validateFields:H,resetFields:V,submit:P}});var Y=t.useMemo(function(){return{fields:F,getFieldValue:S,setFieldValue:D,getFieldError:E,setFieldError:M,isFieldTouched:A,setFieldTouched:L,isFieldValidating:T,setFieldValidating:z,registerField:R,unregisterField:W,validateField:I,validateFields:H,resetFields:V,getFieldsValue:N,setFieldsValue:O,submit:P,labelWidth:f,labelAlign:x}},[F,S,D,E,M,A,L,T,z,R,W,I,H,V,N,O,P,f,x]),q=o({},b);return"vertical"===v?(q.display="flex",q.flexDirection="column"):"inline"===v&&(q.display="inline-flex",q.flexWrap="wrap",q.gap="16px"),e.jsx(te.Provider,{value:Y,children:e.jsx("form",{className:"aha-form ".concat(y),style:q,onSubmit:function(e){return i(void 0,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,H()];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})})});ne.displayName="Form";var oe=ne;oe.Item=function(n){var r=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(te),C=t.useRef(null),F=(null==w?void 0:w.fields)||{};r&&w&&w.getFieldValue(r);var k=r&&w?w.getFieldError(r):void 0,j=!(!r||!w)&&w.isFieldTouched(r),S=!(!r||!w)&&w.isFieldValidating(r);r&&F[r];var D=u||(k?"error":S?"validating":j&&!k?"success":void 0),E=void 0!==p?p:k||void 0,M=t.useRef(d),A=t.useRef(s),L=t.useRef(!1),T=s||d.some(function(e){return e.required}),z=t.useMemo(function(){if(!L.current)return L.current=!0,!0;if(M.current.length!==d.length)return!0;if(M.current===d)return!1;for(var e=0;e<d.length;e++){var t=M.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(r&&w)return(!M.current||z||A.current!==s)&&(M.current=d,A.current=s,w.registerField(r,{rules:d,required:T})),function(){r&&w&&w.unregisterField(r)}},[r]);if(y)return null;return e.jsxs("div",{ref:C,className:"aha-form-item ".concat(x),style:o({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(W,{})}),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=o({},e.props);if(r&&w){var h=w.getFieldValue(r),x=w.setFieldValue;if(!x)return e;if(e.type&&"object"==typeof e.type&&"displayName"in e.type){var g=e.type.displayName;if("Input"===g||"Textarea"===g){f.value=h||"";var v=null===(n=e.props)||void 0===n?void 0:n.onChange,m=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(r,e.target.value),null==v||v(e),r&&w&&setTimeout(function(){w.validateField(r)},0)},f.onBlur=function(e){r&&w&&(w.setFieldTouched(r,!0),w.validateField(r)),null==m||m(e)},f.error="error"===D}else if("Select"===g){f.value=h;var y=null===(a=e.props)||void 0===a?void 0:a.onChange,b=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(r,e),null==y||y(e,t),r&&w&&(w.setFieldTouched(r,!0),setTimeout(function(){w.validateField(r)},0))},f.onBlur=function(e){r&&w&&(w.setFieldTouched(r,!0),w.validateField(r)),null==b||b(e)},f.error="error"===D}else if("Switch"===g){f.checked=h||!1;var C=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(r,e),null==C||C(e,t),r&&w&&(w.setFieldTouched(r,!0),setTimeout(function(){w.validateField(r)},0))}}else if("Checkbox"===g){f.checked=h||!1;var F=null===(c=e.props)||void 0===c?void 0:c.onChange;f.onChange=function(e){x(r,e.target.checked),null==F||F(e),r&&w&&(w.setFieldTouched(r,!0),setTimeout(function(){w.validateField(r)},0))}}else if("Radio"===g){var k=null===(d=e.props)||void 0===d?void 0:d.value;if(void 0!==k){f.checked=h===k;var j=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(r,k),null==j||j(e),r&&w&&(w.setFieldTouched(r,!0),setTimeout(function(){w.validateField(r)},0))}}}}else{void 0!==h&&(f.value=h);var S=null===(p=e.props)||void 0===p?void 0:p.onChange;f.onChange=function(e){var t,n,o=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;x(r,o),null==S||S(e)}}}return"error"===D&&"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"===D?"#D92D20":"warning"===D?"#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})]})]})};var re=function(n){var r=n.items,i=void 0===r?[]:r,a=n.userProfile,s=n.selectedKeys,c=n.defaultSelectedKeys,u=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;d().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==s,F=t.useState(u),k=F[0],j=F[1],S=C?s:k,D=function(e){return"children"in e&&Array.isArray(e.children)},E=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=E(e,i.children,n);if(a)return a}else{var s=i,c=l(l([],n,!0),[s.key],!1);if(s.key===e)return c}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,o=E(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,E]),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 r=o({display:"flex",alignItems:"center",padding:"10px 16px",cursor:t.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828",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:r,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.key)},L=o({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 A(e)})},"group-".concat(r.title))):A(n)]},o);var r})})]})};re.displayName="MenuList";var ie=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}},ae=function(e,t,n,o){void 0===o&&(o=6);var r=ie(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},le=function(t,n){var r=o({position:"absolute",width:0,height:0,borderStyle:"solid"},n),i={top:o(o({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:o(o({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:o(o({},r),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:o(o({},r),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":o(o({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":o(o({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":o(o({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":o(o({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:i[t]})};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?h[a]:c,u=n.showIcon,p=void 0===u||u,f=n.closeable,g=void 0!==f&&f,v=n.action,m=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1];return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").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",style:g?{paddingRight:"2rem"}:{},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}),m&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:m}),v&&g&&e.jsx("div",{className:"mt-3",children:v})]}),v&&!g&&e.jsx("div",{className:"ml-3",children:v}),g&&e.jsx("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){C(!1),null==y||y()},children:x})]}):null},exports.Button=f,exports.CheckIcon=M,exports.Checkbox=N,exports.DatePicker=ee,exports.Form=oe,exports.Input=Y,exports.MenuList=re,exports.MinusIcon=A,exports.Pagination=I,exports.Progress=function(n){var i=n.percent,a=void 0===i?0:i,l=n.type,s=void 0===l?"circle":l,c=n.width,u=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=r(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),D=d().primaryColor,E=Math.min(100,Math.max(0,a)),M=t.useRef(!0),A=t.useState(!1),L=A[0],T=A[1],z=t.useState(0),B=z[0],R=z[1];t.useEffect(function(){if(v&&M.current&&E>0){M.current=!1,R(0),T(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(E)})});var e=setTimeout(function(){T(!1),R(E)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,T(!1),R(E)):R(E)},[v,E]);var W=F||D||"#FB6011";"success"===y?W="#00BC7D":"exception"===y&&(W="#FB2C36");var I=f||"inside",N=Math.max(4,Math.round(.06*u)),H=(u-N)/2,V="semicircle"===s?u/2:u,O="14px",P="12px",Y=function(){var t=p&&"outside"===I?u+4+18+4:u,n=2*Math.PI*H,o=n-(L?B:E)/100*n;return e.jsxs("div",{style:{position:"relative",width:u,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:u,height:u,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:j,strokeWidth:N,strokeLinecap:"round"}),e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:W,strokeWidth:N,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(u/2," ").concat(u/2,")"),style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===I?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(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u/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(E),"%")}),p&&"outside"===I&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:O,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=o({display:"inline-flex",flexDirection:"column",alignItems:"center",width:u},C);return e.jsx("div",o({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},S,{children:function(){switch(s){case"circle":return Y();case"semicircle":return n=N/2,o=u-N/2,r=(t=V+N)-N/2,i=V/2+N/2+N/2,a=p&&"outside"===I?t+4+18+4:t,l=Math.PI*H,c=l-(L?B:E)/100*l,e.jsxs("div",{style:{position:"relative",width:u,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:u,height:t,viewBox:"0 0 ".concat(u," ").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:W,strokeWidth:N,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:c,style:{transition:L?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===I?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(E),"%")})]}):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(E),"%")}),p&&"outside"===I&&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')),Y()}var t,n,o,r,i,a,l,c}()}))},exports.Radio=P,exports.Select=K,exports.Switch=Z,exports.Tab=function(n){var i=n.items,a=void 0===i?[]:i,l=n.variant,s=void 0===l?"underline":l,c=n.layout,u=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=r(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=d().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)}),E=D[0],M=D[1],A=k?void 0!==f?S(f):j:E;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||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=B.current[R(e)],r=N.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]),T=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}),z=C||"#FB6011",B=t.useRef({}),R=function(e){return String(e)},W=t.useRef(null),I=t.useRef(null),N=t.useRef(null),H=t.useRef(null),V=t.useRef("");t.useRef(new Set);var O=t.useRef(!1),P=t.useState({width:0,left:0,opacity:0}),Y=P[0],q=P[1],Z=t.useState({width:0,left:0,opacity:0}),K=Z[0],X=Z[1],G=t.useCallback(function(){"underline"===s&&N.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&N.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=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,A,F]),J=t.useCallback(function(){"background"===s&&H.current&&I.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(I.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");X(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?V.current!==A&&(V.current=A,"underline"===s&&N.current&&!O.current&&G(),"background"===s&&H.current&&I.current&&J()):V.current=""},[A,s,F.length,k,G,J]),t.useEffect(function(){if(A){var e=setTimeout(function(){if("underline"===s)(e=B.current[R(A)])&&N.current&&W.current&&(G(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=B.current[R(A)])&&H.current&&I.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");X({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=N.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 _;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(_={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(_.overflowX="auto",_.overflowY="hidden",_.scrollBehavior="smooth",_.scrollbarWidth="none",_.WebkitOverflowScrolling="touch"),e.jsxs("div",o({ref:N,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:_},w,{children:[e.jsx("div",{ref:W,style:o({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:z,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"},Y)}),F.map(function(n){var r=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:r,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:r?z:"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:20,height:20,style:o(o({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:r?z:"#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:r?z:"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:20,height:20,style:{color:r?z:"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?z:"#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:r?z:"#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:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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"===u?"100%":"fit-content",e.jsxs("div",o({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(u," ").concat(g),style:n},w,{children:[e.jsx("div",{ref:I,style:o({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"},K)}),F.map(function(n){var r=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:r,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"===u?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:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.cloneElement(n.icon,{width:16,height:16,style:o(o({},null===(i=n.icon.props)||void 0===i?void 0:i.style),{color:r?"#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:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:t.createElement(n.icon,{width:16,height:16,style:{color:r?"#44403C":"#79716B"}})}):e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#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:r?"#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:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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 i,a,s,c,d=n.columns,u=void 0===d?[]:d,p=n.dataSource,f=void 0===p?[]:p,h=n.rowKey,x=void 0===h?"key":h,g=n.rowSelection,v=n.pagination,m=void 0!==v&&v,y=n.size,b=void 0===y?"middle":y,w=n.bordered,C=void 0!==w&&w;n.loading;var F=n.locale,k=n.showHeader,j=void 0===k||k,S=n.title,D=n.footer,E=n.summary,M=n.scroll,A=n.tableLayout,L=void 0===A?"auto":A,T=n.onChange,z=n.onSorterChange,B=n.onPaginationChange,R=n.onRow,W=n.className,P=void 0===W?"":W,Y=n.style,q=n.expandable,Z=n.rowClassName,K=n.onHeaderRow;n.sticky;var X=r(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","style","expandable","rowClassName","onHeaderRow","sticky"]),G=t.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),J=G[0],_=G[1];t.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&_(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var U=t.useState(new Map),Q=U[0],$=U[1],ee=t.useState((null==q?void 0:q.defaultExpandedRowKeys)||[]),te=ee[0],ne=ee[1],oe=t.useState(m&&"object"==typeof m&&(m.current||m.defaultCurrent)||1),re=oe[0],ie=oe[1],ae=t.useState(m&&"object"==typeof m&&(m.pageSize||m.defaultPageSize)||10),le=ae[0],se=ae[1];t.useEffect(function(){m&&"object"==typeof m&&(void 0!==m.current&&ie(m.current),void 0!==m.pageSize&&se(m.pageSize))},[m]);var ce=t.useState(null),de=ce[0],ue=ce[1],pe=t.useState(null),fe=pe[0],he=pe[1],xe=t.useState(!1),ge=xe[0],ve=xe[1],me=t.useRef(null),ye=t.useRef(null);t.useEffect(function(){var e=function(){ve(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var be=t.useCallback(function(e,t){var n,o,r,i=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==i?void 0:i.disabled)){var a,s=V(e,x);a="radio"===(null==g?void 0:g.type)?t?[s]:[]:t?l(l([],J,!0),[s],!1):J.filter(function(e){return e!==s}),_(a);var c=f.filter(function(e){return a.includes(V(e,x))});null===(o=null==g?void 0:g.onChange)||void 0===o||o.call(g,a,c),null===(r=null==g?void 0:g.onSelect)||void 0===r||r.call(g,e,t,c,new Event("select"))}},[J,x,g,f]),we=t.useCallback(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}).map(function(e){return V(e,x)}),i=e?r:[];_(i);var a=f.filter(function(e){return i.includes(V(e,x))}),l=e?t.filter(function(e){var t;return!(null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}):[];null===(n=null==g?void 0:g.onChange)||void 0===n||n.call(g,i,a),null===(o=null==g?void 0:g.onSelectAll)||void 0===o||o.call(g,e,a,l)},[x,g,f]),Ce=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(Q);null===t?o.delete(n):o.set(n,t),$(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:u.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),z&&z(1===r.length?r[0]:r),T&&T({current:re,pageSize:le},{},1===r.length?r[0]:r,{currentDataSource:f,action:"sort"})}},[Q,T,z,re,le,f,u]);t.useCallback(function(e,t){var n,o,r,i=V(e,x);r=t?l(l([],te,!0),[i],!1):te.filter(function(e){return e!==i}),ne(r),null===(n=null==q?void 0:q.onExpand)||void 0===n||n.call(q,t,e),null===(o=null==q?void 0:q.onExpandedRowsChange)||void 0===o||o.call(q,r)},[te,x,q]);var Fe=t.useCallback(function(){var e=l([],f,!0);return Q.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=u.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=H(e,r.dataIndex||n),l=H(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(Q.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},[f,Q,u]),ke=Fe(),je=t.useMemo(function(){if(!1===m||!m)return ke;var e=(re-1)*le,t=e+le;return ke.slice(e,t)},[ke,re,le,m]),Se=t.useCallback(function(e,t){var n,o,r=null!=t?t:le;if(ie(e),t&&se(t),B&&B(e,r),m&&"object"==typeof m&&(null===(n=m.onChange)||void 0===n||n.call(m,e,t),t&&(null===(o=m.onShowSizeChange)||void 0===o||o.call(m,e,t))),T){var i=Array.from(Q.entries()).map(function(e){var t=e[0],n=e[1];return{column:u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});T({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:ke,action:"paginate"})}},[m,B,T,le,Q,u,ke]),De=t.useCallback(function(e,t,n){var o=H(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ee=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(g&&("left"===g.fixed||!0===g.fixed))r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=u[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<u.length;i++){var a;if("right"===(a=u[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(g&&"right"===g.fixed)r+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return r}}},[u,g]),Me=t.useCallback(function(){if(!j)return null;var t,n,r,i,a=u.map(function(t,n){var r,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=Q.get(i)||null,l=Ee(n,t.fixed,!0),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("th",o({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===(r=t.onHeaderCell)||void 0===r?void 0:r.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(){Ce(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(O,{order:a||void 0})})]})}),i)});if(g){var l="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(t=je.filter(function(e){var t;return!(null===(t=g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}),n=t.map(function(e){return V(e,x)}),r=t.length>0&&n.every(function(e){return J.includes(e)}),i=n.some(function(e){return J.includes(e)}),e.jsx(N,{checked:r,indeterminate:i&&!r,onChange:function(e){return we(e.target.checked,je)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");a.unshift(s)}var c=null==K?void 0:K(u,0);return e.jsx("thead",{ref:ye,children:e.jsx("tr",o({},c||{},{children:a}))})},[u,j,Q,g,J,je,x,Ce,we,F,K,Ee]),Ae=t.useCallback(function(e){ue(e)},[]),Le=t.useCallback(function(e,t){e.preventDefault(),he(t)},[]),Te=t.useCallback(function(e,t){if(e.preventDefault(),null===de||de===t)return ue(null),void he(null);var n=l([],je,!0),o=n[de];n.splice(de,1),n.splice(t,0,o),ue(null),he(null)},[de,je]),ze=t.useCallback(function(){ue(null),he(null)},[]),Be=t.useCallback(function(){return je.map(function(n,r){var i,a=V(n,x),l=J.includes(a),s=te.includes(a),c=(null==R?void 0:R(n,r))||{},d=r===je.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",o({className:"".concat("function"==typeof Z?Z(n,r):Z||""," ").concat(de===r?"dragging":""," ").concat(fe===r?"drag-over":""),draggable:!0,onDragStart:function(){return Ae(r)},onDragOver:function(e){return Le(e,r)},onDrop:function(e){return Te(e,r)},onDragEnd:ze,style:o({cursor:"move",opacity:de===r?.5:1,backgroundColor:fe===r?"#F9FAFB":"white",transition:"background-color 0.2s"},c.style),onMouseEnter:function(e){de!==r&&fe!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){de!==r&&fe!==r&&(e.currentTarget.style.backgroundColor="white")}},c,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:d?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(N,{checked:l,onChange:function(e){return be(n,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,n).disabled})})}),u.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,r))||{},c=Ee(i,t.fixed,!1),u=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e.jsx("td",o({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:o({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:De(t,n,r)}),l)})]})),(null==q?void 0:q.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:q.expandedRowRender(n,r,0,!0)})})]},a)})},[je,x,J,te,g,u,R,Z,be,De,q,de,fe,Ae,Le,Te,ze,Ee]),Re=function(){var t;if(!1===m||!m)return null;var n=null!==(t=m.total)&&void 0!==t?t:ke.length,o=m.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(I,{current:re,total:n,pageSize:le,showSizeChanger:m.showSizeChanger,pageSizeOptions:m.pageSizeOptions,showQuickJumper:m.showQuickJumper,showTotal:m.showTotal,onChange:Se,onShowSizeChange:Se,simple:m.simple,responsive:m.responsive,size:"small"===b?"small":"default"})})},We=t.useMemo(function(){return u.some(function(e){return e.fixed})||g&&g.fixed},[u,g]),Ie=t.useMemo(function(){return u.every(function(e){return e.width})&&(!g||g.columnWidth)},[u,g]),Ne=t.useMemo(function(){if(null==M?void 0:M.x){if("number"==typeof M.x)return M.x;if(!0===M.x)return u.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(We)return u.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)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[u,null==M?void 0:M.x,g,We]),He=t.useMemo(function(){return"fixed"===L||We||Ie||u.some(function(e){return e.width})?"fixed":L},[L,We,Ie,u]),Ve={width:"100%",minWidth:Ne?"".concat(Ne,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:He,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Oe=o({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==M?void 0:M.y)?"".concat(M.y,"px"):void 0,borderRadius:"8px"},Y);if(ge)return e.jsxs("div",o({ref:me,className:"aha-table aha-table-mobile-wrapper ".concat(P),style:Oe},X,{children:[S&&e.jsx("div",{style:{marginBottom:"16px"},children:S(ke)}),m&&"object"==typeof m&&(null===(i=m.position)||void 0===i?void 0:i.startsWith("top"))&&Re(),e.jsx("div",{className:"aha-table-mobile",children:je.map(function(t,n){var o,r=V(t,x),i=J.includes(r);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(N,{checked:i,onChange:function(e){return be(t,e.target.checked)},disabled:null===(o=g.getCheckboxProps)||void 0===o?void 0:o.call(g,t).disabled})}),u.map(function(o){var r=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),i=H(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)})}),D&&e.jsx("div",{style:{marginTop:"16px"},children:D(ke)}),m&&("object"!=typeof m||!(null===(a=m.position)||void 0===a?void 0:a.startsWith("top")))&&Re()]}));var Pe={position:"relative",overflowX:(null==M?void 0:M.x)||We?"auto":"visible",overflowY:(null==M?void 0:M.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==M?void 0:M.x)?"100%":"number"==typeof(null==M?void 0:M.x)?"".concat(M.x,"px"):void 0,maxHeight:"number"==typeof(null==M?void 0:M.y)?"".concat(M.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",o({ref:me,className:"aha-table ".concat(P),style:Oe},X,{children:[S&&e.jsx("div",{style:{marginBottom:"16px"},children:S(ke)}),m&&"object"==typeof m&&(null===(s=m.position)||void 0===s?void 0:s.startsWith("top"))&&Re(),e.jsx("div",{style:Pe,children:e.jsx("div",{style:{width:"100%",minWidth:Ne?"".concat(Ne,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ve,className:C?"bordered":"",children:[Me(),e.jsx("tbody",{children:Be()}),E&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:E(ke)})})})]})})}),D&&e.jsx("div",{style:{marginTop:"16px"},children:D(ke)}),m&&("object"!=typeof m||!(null===(c=m.position)||void 0===c?void 0:c.startsWith("top")))&&Re()]}))},exports.Tag=function(n){var i=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,c=n.size,u=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=r(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=d().primaryColor,C=function(e,t){if("string"==typeof e&&e in D){var n=D[e];return"Orange"===e&&t?o(o({},n),{fill:o(o({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var r=e.replace("#",""),i=parseInt(r.substr(0,2),16),a=parseInt(r.substr(2,2),16),l=parseInt(r.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 D.Green}(a,w),F=E[u],k={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===u?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===u?"1.375":"1",transition:"all 0.2s",fontSize:"large"===u?"14px":"12px",height:"small"===u?"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 D)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"===u?"leading-snug":"leading-none","transition-colors","duration-200","small"===u?"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(" "),M=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in D)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"===u?"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",o({className:S,style:k,onClick:y},b,{children:["leading"===g&&M(),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"===u?"leading-snug":"leading-none"),children:i})}),"after"===g&&M()]}))},exports.Textarea=q,exports.ThemeProvider=function(n){var r=n.theme,i=n.children,a=t.useMemo(function(){return o(o({},s),r)},[r]);return e.jsx(c.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(w,{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(b,{}),document.body)]})},exports.Tooltip=function(r){var i=r.content,a=r.children,l=r.position,s=void 0===l?"top":l,c=r.trigger,d=void 0===c?"hover":c,u=r.delay,p=void 0===u?200:u,f=r.disabled,h=void 0!==f&&f,x=r.className,g=void 0===x?"":x,v=r.tooltipClassName,m=void 0===v?"":v,y=r.gap,b=void 0===y?6:y,w=r.showArrow,C=void 0===w||w,F=r.width,k=r.defaultVisible,j=void 0!==k&&k,S=r.visible,D=r.onVisibleChange,E=void 0!==S,M=t.useState(j),A=M[0],L=M[1],T=E?S:A,z=t.useState(E?null!=S&&S:j),B=z[0],R=z[1],W=t.useCallback(function(e){E||L(e),null==D||D(e)},[E,D]);t.useEffect(function(){E&&(S?requestAnimationFrame(function(){R(!0)}):R(!1))},[E,S]);var I=t.useState(s),N=I[0],H=I[1],V=t.useState("320px"),O=V[0],P=V[1],Y=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===d?"auto":"none"}),q=Y[0],Z=Y[1],K=t.useState({}),X=K[0],G=K[1],J=t.useRef(null),_=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(J.current&&_.current&&T&&B){var e=J.current.getBoundingClientRect(),t=_.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!ae(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(!ae(e,t,a,o))return a}return n}(e,t,s,b);H(n);var r=ie(e,t,n,b),i=r.top,a=r.left;if(Z(function(e){return o(o({},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);G(l)}}},[T,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),E||requestAnimationFrame(function(){R(!0)})},p))},[h,p,W,E]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),E?W(!1):(R(!1),Q.current=setTimeout(function(){W(!1),Q.current=null},150))},[W,E]),ne=t.useCallback(function(){"hover"===d&&(Q.current&&(clearTimeout(Q.current),Q.current=null),T||(W(!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),W(!0),requestAnimationFrame(function(){R(!0)})))},[h,d,T,te]);t.useEffect(function(){if(j&&T&&B){var e=function(){J.current&&_.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,T,B,$]),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){J.current&&_.current&&!J.current.contains(e.target)&&!_.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: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},se=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){P(se())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[se]);var ce=o(o({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"}),de=e.jsxs("div",{style:o(o(o({},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:_,className:"aha-tooltip ".concat(m),style:ce,role:"tooltip",children:i}),C&&le(N,X)]}),ue=t.useCallback(function(){"hover"===d&&(Q.current=setTimeout(function(){te()},100))},[d,te]),pe="click"===d?{onClick:oe}:{onMouseEnter:ee,onMouseLeave:ue,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",o({ref:J,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===d?"pointer":"default"}},pe,{children:a})),T&&"undefined"!=typeof document&&n.createPortal(de,document.body)]})},exports.clearAllToasts=function(){y.clearAll()},exports.closeToast=function(e){y.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 管理器状态:",y.getToasts()),console.log("容器根节点:",k),console.log("是否正在初始化:",j),console.log("====================")},exports.toast=C,exports.toastError=function(e,t){return S(),C(o(o({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return S(),C(o(o({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return S(),C(o(o({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return S(),C(o(o({},t),{message:e,type:"success"}))},exports.useTheme=d;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),r=function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function i(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}s((r=r.apply(e,t||[])).next())})}function a(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[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,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var s={primaryColor:"#FB6011"},d=t.createContext(s),c=function(){var e=t.useContext(d);return e||s},u={small:{height:"32px",paddingLeft:"12px",paddingRight:"12px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},mediumSmall:{height:"36px",paddingLeft:"14px",paddingRight:"14px",fontSize:"14px",lineHeight:"20px",iconSize:"16px",gap:"6px"},medium:{height:"40px",paddingLeft:"16px",paddingRight:"16px",fontSize:"14px",lineHeight:"20px",iconSize:"18px",gap:"8px"},large:{height:"48px",paddingLeft:"20px",paddingRight:"20px",fontSize:"16px",lineHeight:"24px",iconSize:"20px",gap:"8px"}},p=function(t){var n=t.size,r=t.color;return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes aha-button-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",style:{animation:"aha-button-spin 1s linear infinite"},children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:"0.3"}),e.jsx("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},f=function(n){var i,a=n.children,l=n.type,s=void 0===l?"default":l,d=n.size,f=void 0===d?"medium":d,h=n.disabled,x=void 0!==h&&h,g=n.loading,v=void 0!==g&&g,m=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,F=n.style,k=n.icon,j=n.iconPosition,D=void 0===j?"left":j,S=o(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),E=c().primaryColor,M=void 0===E?"#FB6011":E,A=t.useState(!1),L=A[0],T=A[1],B=t.useState(!1),z=B[0],R=B[1],W=u[f],N=x||v,I=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(W.iconSize.replace("px",""));return e.jsx(p,{size:n,color:t})}return k?e.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:W.iconSize,height:W.iconSize,flexShrink:0},children:k}):null},H=(i=r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:W.gap,height:W.height,paddingLeft:W.paddingLeft,paddingRight:W.paddingRight,fontSize:W.fontSize,lineHeight:W.lineHeight,fontWeight:500,fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"none",cursor:N?"not-allowed":"pointer",outline:"none",transition:"all 0.2s",userSelect:"none",WebkitTapHighlightColor:"transparent"},F),"primary"===s?(i.color="#FFFFFF",i.backgroundColor=M,x?(i.opacity=.4,i.cursor="not-allowed"):v?i.backgroundColor=M:z?i.backgroundColor="#EC470A":L&&(i.backgroundColor="#FD843A")):x?(i.backgroundColor="#FAFAF9",i.color="#D6D3D1",i.border="1px solid #E7E5E4"):v?(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):z?(i.backgroundColor="#F5F5F4",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):L?(i.backgroundColor="#FAFAF9",i.color="#101828",i.border="1px solid #D7D3D0",i.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(i.backgroundColor="#FFFFFF",i.color="#101828",i.border="1px solid #E7E5E4",i.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),i);return e.jsxs("button",r({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(f," ").concat(N?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(C),disabled:N,onClick:function(e){N?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!N&&T(!0)},onMouseLeave:function(){T(!1),R(!1)},onMouseDown:function(){return!N&&R(!0)},onMouseUp:function(){return R(!1)},style:H},S,{children:[v&&I(),!v&&"left"===D&&I(),a&&e.jsx("span",{style:{display:"inline-block"},children:a}),!v&&"right"===D&&I()]}))};f.displayName="Button";var h={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"})})},x=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"})}),g={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"})})},v=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"})})},m=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 l([],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}(),y=new m,b=function(){var n=t.useState([]),o=n[0],i=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=y.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=y.subscribe(function(){var e=y.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}),d=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(w,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(w,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(w,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:d.map(function(t){return e.jsx(w,r({},t),t.id)})})]})},w=function(n){var r=n.id,o=n.props,i=t.useState(!1),a=i[0],l=i[1],s=t.useState(!1),d=s[0],c=s[1],u=o.message,p=o.type,f=void 0===p?"info":p,h=o.duration,x=void 0===h?3e3:h,m=o.icon,b=o.action,w=o.showClose,C=void 0===w||w,F=o.onClose,k=o.onClick;o.className;var j=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:g.success};case"error":return{bgColor:"#E7000B",defaultIcon:g.error};case"question":return{bgColor:"#1C1917",defaultIcon:g.question};default:return{bgColor:"#1447E6",defaultIcon:g.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(){D()},x);return function(){return clearTimeout(e)}}},[x,r]);var D=t.useCallback(function(){c(!0),setTimeout(function(){y.removeToast(r),null==F||F()},300)},[r,F]),S=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&&!d?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!d?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:S,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:m||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}),b&&e.jsx("div",{style:{marginTop:"12px"},children:b})]}),C&&e.jsx("button",{onClick:function(e){e.stopPropagation(),D()},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(v,{})})]})})},C=function(e){return console.log("Toast: 调用 toast 函数",e),D(),setTimeout(function(){var t=y.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},F=null,k=null,j=!1,D=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(j)console.log("Toast: 容器正在初始化中,跳过");else if(F)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),j=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),F=t,void(j=!1);console.log("Toast: 创建容器元素"),(F=document.createElement("div")).id="aha-toast-container",document.body.appendChild(F),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),k=n(F),console.log("Toast: 渲染 ToastContainer 组件"),k.render(e.jsx(b,{})),console.log("Toast: 容器渲染完成"),j=!1}catch(t){console.log("Toast: 同步导入失败,尝试动态导入",t),import("react-dom/client").then(function(t){var n=t.createRoot;try{console.log("Toast: ReactDOM 动态导入成功,创建根节点"),k=n(F),console.log("Toast: 渲染 ToastContainer 组件"),k.render(e.jsx(b,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}j=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),j=!1})}}catch(e){console.error("Toast: 创建容器失败",e),j=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},S={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"}}},E={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"}},M=function(t){var n=t.className,r=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:r,children:e.jsx("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},A=function(t){var n=t.className,r=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:r,children:e.jsx("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},L=function(t){var n=t.className,r=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:r,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"})})},T=function(t){var n=t.className,r=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:r,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"})]})},B=function(t){var n=t.className,r=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:r,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"})]})},z=function(t){var n=t.className,r=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:r,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"})})},R=function(t){var n=t.className,r=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:r,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"})})},W=function(t){var n=t.className,r=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:r,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"})})})]})},N=function(n){var o=n.current,i=n.defaultCurrent,a=void 0===i?1:i,l=n.total,s=void 0===l?0:l,d=n.pageSize,u=n.defaultPageSize,p=void 0===u?10:u,h=n.showSizeChanger,x=void 0!==h&&h,g=n.pageSizeOptions,v=void 0===g?["10","20","50","100"]:g,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,D=void 0!==j&&j,S=n.hideOnSinglePage,E=void 0!==S&&S,M=n.className,A=void 0===M?"":M,L=n.style,T=n.size,B=void 0===T?"default":T,W=n.responsive,N=void 0!==W&&W;n.showLessItems;var I=n.itemRender,H=c().primaryColor,Y=void 0===H?"#FB6011":H,V=t.useState(a),P=V[0],O=V[1],q=t.useState(p),Z=q[0],K=q[1],X=t.useState(""),G=X[0],J=X[1],_=null!=o?o:P,U=null!=d?d:Z,Q=t.useMemo(function(){return Math.ceil(s/U)},[s,U]);t.useEffect(function(){void 0!==o&&O(o)},[o]),t.useEffect(function(){void 0!==d&&K(d)},[d]);var $=function(e){e<1||e>Q||e===_||D||(void 0===o&&O(e),null==w||w(e,U))},ee=function(){var e=parseInt(G,10);e>=1&&e<=Q&&($(e),J(""))};if(E&&Q<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(A),style:L,children:[e.jsx(f,{onClick:function(){return $(_-1)},disabled:D||1===_,type:"default",size:"default"===B?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"上一页"}),e.jsxs("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[_," / ",Q]}),e.jsx(f,{onClick:function(){return $(_+1)},disabled:D||_===Q,type:"default",size:"default"===B?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var te=(_-1)*U+1,ne=Math.min(_*U,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,[te,ne])}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[I?I(_-1,"prev",e.jsx(f,{onClick:function(){return $(_-1)},disabled:D||1===_,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{})," ",e.jsx("span",{children:"Previous"})]})})):e.jsx(f,{onClick:function(){return $(_-1)},disabled:D||1===_,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(z,{})," ",e.jsx("span",{children:"Previous"})]})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(Q<=7)return Array.from({length:Q},function(e,t){return t+1});var e=[];if(_<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(Q)}else if(_>=Q-3){e.push(1),e.push("jump-prev");for(t=Q-4;t<=Q;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=_-1;t<=_+1;t++)e.push(t);e.push("jump-next"),e.push(Q)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===_,r=e.jsx(f,{onClick:function(){return $(t)},disabled:D,type:"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:"none",background:n?"#FAFAF9":"white",backgroundColor:n?"#FAFAF9":"white",color:n?Y:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return I?I(t,"page",r):r}if("jump-prev"===t)return r=e.jsx(f,{onClick:function(){return $(Math.max(1,_-5))},disabled:D,type:"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),I?I(_-5,"jump-prev",r):r;if("jump-next"===t)return r=e.jsx(f,{onClick:function(){return $(Math.min(Q,_+5))},disabled:D,type:"default",size:"default"===B?"medium":"small",style:{minWidth:"small"===B?"32px":"36px",height:"small"===B?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),I?I(_+5,"jump-next",r):r;return null}(t)})}),I?I(_+1,"next",e.jsx(f,{onClick:function(){return $(_+1)},disabled:D||_===Q,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"Next"})," ",e.jsx(R,{})]})})):e.jsx(f,{onClick:function(){return $(_+1)},disabled:D||_===Q,type:"default",size:"default"===B?"medium":"small",style:{height:"small"===B?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{children:"Next"})," ",e.jsx(R,{})]})}),x&&e.jsx("select",{value:U,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(s/t),r=_>n?n:_,void 0===d&&K(t),void 0===o&&O(r),null==C||C(r,t),void(null==w||w(r,t));var t,n,r},disabled:D,style:{padding:"small"===B?"6px 12px":"8px 12px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"small"===B?"12px":"14px",lineHeight:"small"===B?"18px":"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",cursor:D?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){D||(e.currentTarget.style.borderColor=Y)},onMouseLeave:function(e){e.currentTarget.style.borderColor="#EAECF0"},children:v.map(function(t){return e.jsxs("option",{value:t,children:[t," 条/页"]},t)})}),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:"跳至"}),e.jsx("input",{type:"number",min:"1",value:G,onChange:function(e){return J(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ee()},disabled:D,style:{width:"56px",height:"small"===B?"28px":"36px",padding:"0 8px",border:"1px solid #EAECF0",borderRadius:"8px",fontSize:"14px",lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",outline:"none",transition:"all 0.2s"},onFocus:function(e){e.currentTarget.style.borderColor=Y},onBlur:function(e){e.currentTarget.style.borderColor="#EAECF0"}}),e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"页"}),"object"==typeof y&&y.goButton?e.jsx(f,{onClick:ee,disabled:D,type:"default",size:"default"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:y.goButton}):e.jsx(f,{onClick:ee,disabled:D,type:"default",size:"default"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},I=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,d=t.onChange,u=t.className,p=void 0===u?"":u,f=t.style,h=t.children,x=c().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==d||d({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(A,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(M,{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:d,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};I.displayName="Checkbox";var H=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)},Y=function(e,t){var n,r;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=H(e,t))&&void 0!==n?n:"":null!==(r=e.key)&&void 0!==r?r:""},V=function(t){var n=t.order,r=c().primaryColor;return"ascend"===n?e.jsx(B,{style:{color:r}}):"descend"===n?e.jsx(T,{style:{color:r}}):e.jsx(L,{})},P=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,d=void 0===s?"":s,u=t.style,p=t.children,f=t.value,h=t.name,x=c().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(d),style:r({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},u),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"})]})};P.displayName="Radio";var O=t.forwardRef(function(n,i){var a=n.size,l=void 0===a?"medium":a,s=n.disabled,d=void 0!==s&&s,u=n.error,p=void 0!==u&&u,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,D=n.value,S=n.defaultValue,E=n.onChange,M=n.onFocus,A=n.onBlur,L=n.onPressEnter,T=o(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=c().primaryColor,z=void 0===B?"#FB6011":B,R=t.useRef(null),W=t.useState(S||D||""),N=W[0],I=W[1],H=t.useState(!1),Y=H[0],V=H[1];t.useEffect(function(){"function"==typeof i?i(R.current):i&&(i.current=R.current)},[i]);var P=void 0!==D,O=P?D:N,q=function(e){var t;e.stopPropagation(),P||I("");null==E||E({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=R.current)||void 0===t||t.focus()},Z=m&&O&&!d,K={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"}},X=g||Z?"40px":"12px",G=r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":Y?z:"#D7D3D0"),backgroundColor:d||h?"#FAFAF9":"#FFFFFF",color:d?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:X,paddingTop:K[l].paddingTop,paddingBottom:K[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:d?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e.jsx("input",r({ref:R,type:k,value:O,placeholder:j,disabled:d,readOnly:h,onChange:function(e){P||I(e.target.value),null==E||E(e)},onFocus:function(e){V(!0),null==M||M(e)},onBlur:function(e){V(!1),null==A||A(e)},onKeyDown:function(e){var t;"Enter"===e.key&&L&&L(e),null===(t=T.onKeyDown)||void 0===t||t.call(T,e)},style:G,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(g||Z)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:d?"#98A2B3":"#78716C",zIndex:1},children:[Z&&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})]})]})]})});O.displayName="Input";var q=t.forwardRef(function(n,i){var a=n.disabled,l=void 0!==a&&a,s=n.error,d=void 0!==s&&s,u=n.readOnly,p=void 0!==u&&u,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,D=n.onChange,S=n.onFocus,E=n.onBlur,M=o(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),A=c().primaryColor,L=void 0===A?"#FB6011":A,T=t.useRef(null),B=t.useState(w||b||""),z=B[0],R=B[1],W=t.useState(!1),N=W[0],I=W[1],H=t.useState(void 0),Y=H[0],V=H[1];t.useEffect(function(){"function"==typeof i?i(T.current):i&&(i.current=T.current)},[i]);var P=void 0!==b,O=P?b:z,q=String(O||"").length;t.useEffect(function(){if(j&&T.current){var e=T.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var r=e.scrollHeight,o=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*o,a=n?n*o:void 0,l=Math.max(r,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),V(l)}},[O,j]);var Z=r(r({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#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:T,value:O,placeholder:y,disabled:l,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){P||R(e.target.value),null==D||D(e)},onFocus:function(e){I(!0),null==S||S(e)},onBlur:function(e){I(!1),null==E||E(e)},style:Z,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(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})})]})]})});q.displayName="Textarea";var Z=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,s=void 0!==l&&l,d=n.onChange,u=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=c().primaryColor,C=void 0===w?"#FB6011":w,F=t.useState(a),k=F[0],j=F[1],D=void 0!==o,S=D?o:k,E={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],M=S||v,A=s?"#E7E5E4":M?C:"#F5F5F4",L=M?"calc(100% - ".concat(E.thumbSize," - ").concat(E.thumbOffset,")"):E.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":S,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!S;D||j(t),null==d||d(t,e),null==u||u(t,e)}},className:"aha-switch ".concat(y),style:r({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:M?"flex-end":"flex-start",width:E.width,height:E.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:M?"6px":"auto",right:M?"auto":"6px",fontSize:E.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:E.thumbSize,height:E.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"})]})})]})};Z.displayName="Switch";var K=function(o){var i,a=o.value,s=o.defaultValue,d=o.options,u=void 0===d?[]:d,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,D=void 0!==j&&j,S=o.onChange,E=o.onSelect,M=o.onDeselect,A=o.onSearch,L=o.onFocus,T=o.onBlur,B=o.onDropdownVisibleChange,z=o.className,R=void 0===z?"":z,W=o.style,N=o.dropdownClassName,I=void 0===N?"":N,H=o.dropdownStyle,Y=o.defaultOpen,V=void 0!==Y&&Y,P=o.open,O=o.maxTagCount,q=o.tagRender,Z=o.optionRender,K=c().primaryColor,X=void 0===K?"#FB6011":K,G=t.useState(void 0!==s?s:p?[]:void 0),J=G[0],_=G[1],U=t.useState(V),Q=U[0],$=U[1],ee=t.useState(""),te=ee[0],ne=ee[1],re=t.useState(-1),oe=re[0],ie=re[1],ae=t.useRef(null),le=t.useRef(null),se=t.useRef(null),de=t.useState(null),ce=de[0],ue=de[1],pe=void 0!==a,fe=void 0!==P,he=pe?a:J,xe=fe?P:Q,ge="multiple"===p||"tags"===p,ve=t.useCallback(function(){if(!he)return[];var e=Array.isArray(he)?he:[he];return u.filter(function(t){return e.includes(t.value)})},[he,u]),me=t.useCallback(function(){return C&&te?!1===k?u:"function"==typeof k?u.filter(function(e){return k(te,e)}):u.filter(function(e){var t=String(e.label||"").toLowerCase(),n=te.toLowerCase();return t.includes(n)}):u},[u,te,C,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&ae.current){var e=function(){if(ae.current){var e=ae.current.getBoundingClientRect();ue({top:e.bottom+window.scrollY+4,left:e.left+window.scrollX,width:e.width})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}ue(null)},[xe]),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&&oe>=0){e.preventDefault();var n=ye[oe];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,oe,fe,B]),t.useEffect(function(){if(oe>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[oe];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[oe]);var be=t.useCallback(function(e){var t;if(!e.disabled)if(ge){var n,r=Array.isArray(he)?he:[];r.includes(e.value)?(n=r.filter(function(t){return t!==e.value}),null==M||M(e.value,e)):(n=l(l([],r,!0),[e.value],!1),null==E||E(e.value,e)),pe||_(n);var o=u.filter(function(e){return n.includes(e.value)});null==S||S(n,o)}else pe||_(e.value),null==S||S(e.value,e),null==E||E(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=ae.current)||void 0===t||t.focus()},[ge,he,pe,fe,u,S,E,M,B]),we=t.useCallback(function(e,t){if(e.stopPropagation(),ge&&Array.isArray(he)){var n=he.filter(function(e){return e!==t}),r=u.find(function(e){return e.value===t});pe||_(n),null==S||S(n,ve()),null==M||M(t,r)}},[ge,he,pe,u,S,M,ve]),Ce=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||_(t),null==S||S(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 D&&he&&!h},[D,he,h]),De=t.useMemo(function(){return ge?Array.isArray(he)&&he.length>0:null!=he&&""!==he},[ge,he]),Se=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===O?ke.slice(0,2):O?ke.slice(0,O):ke,r=O&&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 r={label:n.label,value:n.value,closable:!h,onClose:function(){return we({},n.value)}};return q?e.jsx(t.Fragment,{children:q(r)},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)}),r>0&&e.jsxs("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",r]})]})},[ge,he,ke,O,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?X:"#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==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?Se||(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:De?void 0:m,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:De?h?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:De?(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&&ce&&n.createPortal(e.jsx("div",{ref:se,className:"aha-select-dropdown ".concat(I),style:r({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",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 r=ge?Array.isArray(he)&&he.includes(t.value):he===t.value,o=n===oe;return Z?e.jsx("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return!t.disabled&&be(t)},style:{cursor:t.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Z(t,{selected:r,focused:o,disabled:t.disabled||!1})},t.value):e.jsxs("div",{className:"aha-select-option ".concat(t.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"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}),r&&e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o?"hidden":"",children:e.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:X,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},t.value)})}),document.body)]})};K.displayName="Select";var X=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],G=["January","February","March","April","May","June","July","August","September","October","November","December"],J=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),r=e.getMonth(),o=String(r+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"),G[r]).replace(new RegExp("","g"),X[r]).replace(new RegExp("","g"),o).replace(new RegExp("","g"),String(r+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},_=function(e,t){return new Date(e,t+1,0).getDate()},U=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Q=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},$=function(o){var i=o.mode,a=void 0===i?"date":i,l=o.disabled,s=void 0!==l&&l,d=o.error,u=void 0!==d&&d,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,D=o.onOpenChange,S=o.className,E=void 0===S?"":S,M=o.style,A=o.dropdownClassName,L=void 0===A?"":A,T=o.dropdownStyle,B=o.defaultOpen,z=void 0!==B&&B,R=o.open,W=o.minDate,N=o.maxDate,I=o.separator,H=void 0===I?" - ":I,Y=o.presetRanges,V=void 0!==Y&&Y,P=o.calendarCount,O=void 0===P?1:P,q=o.showApplyCancel,Z=void 0!==q&&q,K=o.applyText,X=void 0===K?"Apply":K,$=o.cancelText,ee=void 0===$?"Cancel":$,te=o.onApply,ne=o.onCancel,re=o.showSelectedRange,oe=void 0!==re&&re,ie=o.startSelectedRangeText,ae=void 0===ie?"Select dates":ie,le=o.endSelectedRangeText,se=void 0===le?"Select dates":le,de=o.rangeDisplayMode,ce=void 0===de?"range":de,ue=c().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(z),we=be[0],Ce=be[1],Fe=t.useState(!0),ke=Fe[0],je=Fe[1],De=t.useState(null),Se=De[0],Ee=De[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()}}),Ae=Me[0],Le=Me[1],Te=t.useState(function(){if(2===O&&fe){var e=new Date(Ae.year,Ae.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Be=Te[0],ze=Te[1];t.useEffect(function(){if(2===O&&fe){var e=new Date(Ae.year,Ae.month+1,1);ze({year:e.getFullYear(),month:e.getMonth()})}else ze(null)},[Ae,O,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),Ve=Ye[0],Pe=Ye[1],Oe=t.useRef(!1),qe=t.useRef(!1),Ze=t.useRef(null),Ke="value"in o&&void 0!==o.value,Xe=void 0!==R,Ge=fe?null:Ke&&"date"===a&&"value"in o?o.value:xe,Je=fe?Ke&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:me:{startDate:null,endDate:null},_e=Xe?R:we;t.useEffect(function(){if(_e&&!Oe.current){if(fe){var e=Je.startDate||Je.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Le({year:t,month:n})}else{var r=new Date;Le({year:r.getFullYear(),month:r.getMonth()})}}else if(Ge){t=Ge.getFullYear(),n=Ge.getMonth();Le({year:t,month:n})}else{r=new Date;Le({year:r.getFullYear(),month:r.getMonth()})}Oe.current=!0}else _e||(Oe.current=!1)},[_e,Ge,Je,fe]),t.useEffect(function(){if(_e&&Re.current){qe.current=!1,Ze.current=null;var e=function(){if(Re.current){var e=Re.current.getBoundingClientRect();if(qe.current&&null!==Ze.current){var t,n=Ze.current;if(He.current){var r=He.current.offsetHeight;t="top"===n?e.top+window.scrollY-r-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 o=e.bottom+window.scrollY+4,i="bottom";Pe({top:o,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,r=e.top-4;(n<t&&r>=t||n<t&&r<t&&r>n)&&(o=e.top+window.scrollY-t-4,i="top"),qe.current=!0,Ze.current=i}Pe({top:o,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,Ze.current=null},[_e]),t.useEffect(function(){var e=function(e){var t=e.target;Re.current&&!Re.current.contains(t)&&He.current&&!He.current.contains(t)&&(Xe||Ce(!1),null==D||D(!1))};if(_e)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[_e,Xe,D]);var Ue,Qe,$e,et,tt=t.useCallback(function(e){var t;Q(e,W,N)&&(Ke||ge(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Xe||Ce(!1),null==D||D(!1))},[Ke,Xe,a,o,D,W,N]),nt=t.useCallback(function(e){var t;if(Q(e,W,N)){var n,r=Z&&Se?Se:Je;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),Z||(Xe||Ce(!1),null==D||D(!1))):je(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},je(!1)):(n={startDate:r.startDate,endDate:e},je(!0),Z||(Xe||Ce(!1),null==D||D(!1))),Z?Ee(n):(Ke||ye(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[ke,Je,Se,Z,Ke,Xe,a,o,D,W,N]),rt=function(e){var t,n;if(e.stopPropagation(),fe){var r={startDate:null,endDate:null};Ke||ye(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),je(!0)}else Ke||ge(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!_e){var i=new Date;Le({year:i.getFullYear(),month:i.getMonth()})}},ot=function(){if(!s){var e=!_e;if(Xe||Ce(e),null==D||D(e),e){if(fe){if(je(!Je.startDate),Z&&Ee(Je),!Je.startDate&&!Je.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else if(!Ge){t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else!e&&Z&&Ee(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 r=new Date(e),o=new Date(e),i=e.getDate();o.setMonth(e.getMonth()-1),o.getDate()!==i&&o.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:o,endDate:r}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),at=t.useMemo(function(){return Array.isArray(V)?V:!0===V?it:[]},[V,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})}Z?Ee(e):(Ke||ye(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),Xe||Ce(!1),null==D||D(!1))},dt=function(){Le(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},ct=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=_(e,t),r=[],o=1;o<=n;o++)r.push(new Date(e,t,o));return r},[]),pt=t.useMemo(function(){return ut(Ae.year,Ae.month)},[Ae,ut]),ft=t.useMemo(function(){return 2===O&&fe&&Be?ut(Be.year,Be.month):null},[O,fe,Be,ut]),ht=function(){Be&&ze(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},xt=function(){Be&&ze(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?Je.startDate||Je.endDate:Ge),mt=Ge?J(Ge,F):"",yt=Je.startDate?J(Je.startDate,F):"",bt=Je.endDate?J(Je.endDate,F):"",wt=t.useMemo(function(){if(!fe||"text"!==ce)return"";if(Je.startDate&&Je.endDate){var e=J(Je.startDate,"MMM D, YYYY"),t=J(Je.endDate,"MMM D, YYYY");return"".concat(e," ").concat(H," ").concat(t)}return Je.startDate?J(Je.startDate,"MMM D, YYYY"):Je.endDate?J(Je.endDate,"MMM D, YYYY"):""},[fe,ce,Je,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(E),style:r({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(u?"#F04438":_e?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:ot,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"===ce?e.jsx("input",{ref:We,type:"text",value:wt,readOnly:!0,placeholder:f,disabled:s,onClick:function(e){e.stopPropagation(),s||ot()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Je.startDate||Je.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),_e){if(!Je.startDate&&!Je.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else ot()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Je.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),_e){if(!Je.startDate&&!Je.endDate){var t=new Date;Le({year:t.getFullYear(),month:t.getMonth()})}}else ot()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Je.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||ot()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:s?"#98A2B3":Ge?"#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:rt,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&&Ve&&n.createPortal(e.jsx("div",{ref:He,className:"aha-date-picker-dropdown ".concat(L),style:r({position:"absolute",top:"".concat(Ve.top,"px"),left:"".concat(Ve.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"===(Ve.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Ve.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===O?"column":"row"},children:[fe&&lt&&2===O&&e.jsx("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:Z?"0":"8px"},children:at.map(function(t,n){var r=Se?U(t.range.startDate,Se.startDate)&&U(t.range.endDate,Se.endDate):U(t.range.startDate,Je.startDate)&&U(t.range.endDate,Je.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:r?pe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",fontWeight:r?500:400,transition:"all 0.2s"},onMouseEnter:function(e){r||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){r||(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===O?"row":"column",gap:2===O?"24px":"0"},children:(et=function(t,n,r,o,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===O&&fe?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===O&&fe&&1===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===O&&fe?"absolute":"relative",left:2===O&&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:[G[t.month]," ",t.year]}),!(2===O&&fe&&0===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===O&&fe?"absolute":"relative",right:2===O&&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&&oe&&1===O&&0===i&&(a=Z&&Se?Se:Je,l=a.startDate?J(a.startDate,"MMM D, YYYY"):ae,s=a.endDate?J(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===O&&e.jsx("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:at.map(function(t,n){var r=Se?U(t.range.startDate,Se.startDate)&&U(t.range.endDate,Se.endDate):U(t.range.startDate,Je.startDate)&&U(t.range.endDate,Je.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:r?pe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",border:"none",fontWeight:r?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 r,o,i=(r=t.year,o=t.month,new Date(r,o,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,r){if(n){var o=a+r,i=n.getMonth()===t.month,s=U(n,new Date),d=!Q(n,W,N);if(fe){var c=Z&&Se?Se:Je,u=U(n,c.startDate),p=U(n,c.endDate),f=function(e,t,n){if(!t||!n)return!1;var r=e.getTime(),o=t.getTime(),i=n.getTime();return r>=o&&r<=i}(n,c.startDate,c.endDate),h=o%7==0,x=o%7==6,g=u,v=p,m={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:d?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.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?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;var y=1===n.getDate(),b=_(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?d?"#D7D3D0":"#1C1917":"#78716C",m.fontWeight=400;l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return nt(n)},style:m,onMouseEnter:function(e){d||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(r)))}else{var k=U(n,Ge);l.push(e.jsxs("button",{type:"button",disabled:d,onClick:function(){return tt(n)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:k?pe:"transparent",cursor:d?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:k?500:400,color:k?"#FFFFFF":i?d?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:d?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){d||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(r)))}}}),l}()})]},i);var a,l,s},e.jsxs(e.Fragment,{children:[et(Ae,pt,dt,ct,0),2===O&&fe&&Be&&ft&&et(Be,ft,ht,xt,1)]}))}),fe&&oe&&2===O&&!Z&&(Ue=Je,Qe=Ue.startDate?J(Ue.startDate,"MMM D, YYYY"):ae,$e=Ue.endDate?J(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&&Z&&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:[oe&&2===O&&function(){var t=Se||Je,n=t.startDate?J(t.startDate,"MMM D, YYYY"):ae,r=t.endDate?J(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:r})]})}(),e.jsxs("div",{className:"".concat(2===O?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e.jsx("button",{type:"button",onClick:function(){Ee(null),null==ne||ne(),Xe||Ce(!1),null==D||D(!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:ee}),e.jsx("button",{type:"button",onClick:function(){var e;Se&&(Ke||ye(Se),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Se)),null==te||te(Se),Xe||Ce(!1),null==D||D(!1),Ee(null))},disabled:!Se||!Se.startDate||!Se.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Se&&Se.startDate&&Se.endDate?pe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Se&&Se.startDate&&Se.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Se&&Se.startDate&&Se.endDate&&(e.currentTarget.style.backgroundColor=pe)},children:X})]})]})]})]})}),document.body)]})};$.displayName="DatePicker";var ee=t.createContext(null),te=t.forwardRef(function(n,o){var l=n.initialValues,s=void 0===l?{}:l,d=n.onValuesChange,c=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 D=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.value},[]),S=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},d){var i={};i[e]=t;var a={};Object.keys(o).forEach(function(e){a[e]=o[e].value}),d(i,a)}return o})},[d]),E=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),M=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})},[]),A=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),L=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})},[]),z=t.useRef();z.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 d=o[l],c=i[l];if((null==d?void 0:d.required)!==(null==c?void 0:c.required)||(null==d?void 0:d.message)!==(null==c?void 0:c.message)||(null==d?void 0:d.type)!==(null==c?void 0:c.type)||(null==d?void 0:d.pattern)!==(null==c?void 0:c.pattern)||(null==d?void 0:d.min)!==(null==c?void 0:c.min)||(null==d?void 0:d.max)!==(null==c?void 0:c.max)||(null==d?void 0:d.len)!==(null==c?void 0:c.len)||(null==d?void 0:d.whitespace)!==(null==c?void 0:c.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 R=t.useCallback(function(e,t){var n;null===(n=z.current)||void 0===n||n.call(z,e,t)},[]),W=t.useCallback(function(e){k(function(t){var n=r({},t);return delete n[e],n})},[]),N=t.useCallback(function(e){return i(void 0,void 0,void 0,function(){var t,n,o,i,l,s,d,c,u;return a(this,function(a){switch(a.label){case 0:if(!(t=j.current[e]))return[2,void 0];B(e,!0),n=t.rules||[],i=0,l=n,a.label=1;case 1:if(!(i<l.length))return[3,6];if(s=l[i],d=t.value,s.required&&(null==d||""===d))return o=s.message||"".concat(e," is required"),[3,6];if(s.type&&null!=d&&""!==d&&(c={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])&&!c(d))return o=s.message||"".concat(e," must be a valid ").concat(s.type),[3,6];if(s.pattern&&null!=d&&""!==d&&!s.pattern.test(String(d)))return o=s.message||"".concat(e," format is invalid"),[3,6];if(void 0!==s.min&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))<s.min)return o=s.message||"".concat(e," must be at least ").concat(s.min),[3,6];if(void 0!==s.max&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))>s.max)return o=s.message||"".concat(e," must be at most ").concat(s.max),[3,6];if(void 0!==s.len&&null!=d&&""!==d&&("string"==typeof d?d.length:Number(d))!==s.len)return o=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof d&&d.trim()!==d)return o=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];a.label=2;case 2:return a.trys.push([2,4,,5]),[4,s.validator(s,d)];case 3:return a.sent(),[3,5];case 4:return u=a.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]}})})},[]),I=t.useCallback(function(e){var t=j.current,n={};return(e||Object.keys(t)).forEach(function(e){var r;n[e]=null===(r=t[e])||void 0===r?void 0:r.value}),n},[]),H=t.useCallback(function(e){return i(void 0,void 0,void 0,function(){var t,n,r,o;return a(this,function(l){switch(l.label){case 0:return t=j.current,n=e||Object.keys(t),r=[],[4,Promise.all(n.map(function(e){return i(void 0,void 0,void 0,function(){var n,r;return a(this,function(o){switch(o.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return r=o.sent(),[2,{name:e,error:r}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return l.sent().forEach(function(e){var t=e.name,n=e.error;n&&r.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(l.sent(),r.length>0)throw o={values:I(),errorFields:r},null==u||u(o),o;return[2,I()]}})})},[N,I,u]),Y=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}))}),n})},[s]),V=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}}),d){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),d(e,o)}return n})},[d]),P=t.useCallback(function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,H()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[H,c]);t.useImperativeHandle(o,function(){return{getFieldValue:D,getFieldsValue:I,setFieldValue:S,setFieldsValue:V,getFieldError:E,validateField:N,validateFields:H,resetFields:Y,submit:P}});var O=t.useMemo(function(){return{fields:F,getFieldValue:D,setFieldValue:S,getFieldError:E,setFieldError:M,isFieldTouched:A,setFieldTouched:L,isFieldValidating:T,setFieldValidating:B,registerField:R,unregisterField:W,validateField:N,validateFields:H,resetFields:Y,getFieldsValue:I,setFieldsValue:V,submit:P,labelWidth:f,labelAlign:x}},[F,D,S,E,M,A,L,T,B,R,W,N,H,Y,I,V,P,f,x]),q=r({},b);return"vertical"===v?(q.display="flex",q.flexDirection="column"):"inline"===v&&(q.display="inline-flex",q.flexWrap="wrap",q.gap="16px"),e.jsx(ee.Provider,{value:O,children:e.jsx("form",{className:"aha-form ".concat(y),style:q,onSubmit:function(e){return i(void 0,void 0,void 0,function(){var t;return a(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,H()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:w})})});te.displayName="Form";var ne=te;ne.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,d=n.rules,c=void 0===d?[]:d;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(ee),C=t.useRef(null),F=(null==w?void 0:w.fields)||{};o&&w&&w.getFieldValue(o);var k=o&&w?w.getFieldError(o):void 0,j=!(!o||!w)&&w.isFieldTouched(o),D=!(!o||!w)&&w.isFieldValidating(o);o&&F[o];var S=u||(k?"error":D?"validating":j&&!k?"success":void 0),E=void 0!==p?p:k||void 0,M=t.useRef(c),A=t.useRef(s),L=t.useRef(!1),T=s||c.some(function(e){return e.required}),B=t.useMemo(function(){if(!L.current)return L.current=!0,!0;if(M.current.length!==c.length)return!0;if(M.current===c)return!1;for(var e=0;e<c.length;e++){var t=M.current[e],n=c[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},[c]);t.useEffect(function(){if(o&&w)return(!M.current||B||A.current!==s)&&(M.current=c,A.current=s,w.registerField(o,{rules:c,required:T})),function(){o&&w&&w.unregisterField(o)}},[o]);if(y)return null;return e.jsxs("div",{ref:C,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 r=n.content,o=t.useState(!1),i=o[0],a=o[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(W,{})}),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:[r,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,d,c,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;if(e.type&&"object"==typeof e.type&&"displayName"in e.type){var g=e.type.displayName;if("Input"===g||"Textarea"===g){f.value=h||"";var v=null===(n=e.props)||void 0===n?void 0:n.onChange,m=null===(i=e.props)||void 0===i?void 0:i.onBlur;f.onChange=function(e){x(o,e.target.value),null==v||v(e),o&&w&&setTimeout(function(){w.validateField(o)},0)},f.onBlur=function(e){o&&w&&(w.setFieldTouched(o,!0),w.validateField(o)),null==m||m(e)},f.error="error"===S}else if("Select"===g){f.value=h;var y=null===(a=e.props)||void 0===a?void 0:a.onChange,b=null===(l=e.props)||void 0===l?void 0:l.onBlur;f.onChange=function(e,t){x(o,e),null==y||y(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==b||b(e)},f.error="error"===S}else if("Switch"===g){f.checked=h||!1;var C=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(o,e),null==C||C(e,t),o&&w&&(w.setFieldTouched(o,!0),setTimeout(function(){w.validateField(o)},0))}}else if("Checkbox"===g){f.checked=h||!1;var F=null===(d=e.props)||void 0===d?void 0:d.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"===g){var k=null===(c=e.props)||void 0===c?void 0:c.value;if(void 0!==k){f.checked=h===k;var j=null===(u=e.props)||void 0===u?void 0:u.onChange;f.onChange=function(e){x(o,k),null==j||j(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"===S&&"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"===S?"#D92D20":"warning"===S?"#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})]})]})};var re=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,s=n.selectedKeys,d=n.defaultSelectedKeys,u=void 0===d?[]:d,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;c().primaryColor;var b=t.useRef(null),w=t.useRef({}),C=void 0!==s,F=t.useState(u),k=F[0],j=F[1],D=C?s:k,S=function(e){return"children"in e&&Array.isArray(e.children)},E=t.useCallback(function(e,t,n){void 0===n&&(n=[]);for(var r=0,o=t;r<o.length;r++){var i=o[r];if(S(i)){var a=E(e,i.children,n);if(a)return a}else{var s=i,d=l(l([],n,!0),[s.key],!1);if(s.key===e)return d}}return null},[]),M=t.useCallback(function(e){var t;if(!e.disabled){var n,r=E(e.key,i)||[e.key];D.includes(e.key)?(n=D.filter(function(t){return t!==e.key}),null==f||f({key:e.key,keyPath:r,selectedKeys:n})):(n=[e.key],null==p||p({key:e.key,keyPath:r,selectedKeys:n})),C||j(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:r}),e.skipGlobalClick||null==h||h({key:e.key,keyPath:r})}},[D,C,p,f,h,i,E]),A=function(t){var n=D.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",color:t.disabled?"#98A2B3":t.danger?"#DC2626":"#101828",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.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],r=t[e-1];return!!S(r)||!(!S(n)||S(r))};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,r){return e.jsxs(t.Fragment,{children:[T(r,i)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),S(n)?(o=n,e.jsx("div",{className:"aha-menu-group ".concat(o.className||""),children:o.children.map(function(e){return A(e)})},"group-".concat(o.title))):A(n)]},r);var o})})]})};re.displayName="MenuList";var oe=function(e,t,n,r){void 0===r&&(r=6);var o=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,s=r+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+i,c=a-t.width/2+o;break;case"bottom":default:d=e.bottom+s+i,c=a-t.width/2+o;break;case"left":d=l-t.height/2+i,c=e.left-t.width-s+o;break;case"right":d=l-t.height/2+i,c=e.right+s+o;break;case"top-left":d=e.top-t.height-s+i,c=e.left+o;break;case"top-right":d=e.top-t.height-s+i,c=e.right-t.width+o;break;case"bottom-left":d=e.bottom+s+i,c=e.left+o;break;case"bottom-right":d=e.bottom+s+i,c=e.right-t.width+o}var u=window.innerWidth,p=window.innerHeight;return c<o+8?c=o+8:c+t.width>o+u-8&&(c=o+u-t.width-8),d<i+8?d=i+8:d+t.height>i+p-8&&(d=i+p-t.height-8),{top:d,left:c}},ie=function(e,t,n,r){void 0===r&&(r=6);var o=oe(e,t,n,r),i=o.top,a=o.left,l=window.scrollX||window.pageXOffset,s=i-(window.scrollY||window.pageYOffset),d=a-l,c=s+t.height,u=d+t.width,p=s,f=d,h=Math.max(p,e.top),x=Math.min(c,e.bottom),g=Math.max(f,e.left),v=Math.min(u,e.right);return x>h+1&&v>g+1},ae=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]})};exports.Alert=function(n){var r=n.className,o=void 0===r?"":r,i=n.type,a=void 0===i?"info":i,l=n.title,s=n.description,d=n.icon,c=void 0===d?h[a]:d,u=n.showIcon,p=void 0===u||u,f=n.closeable,g=void 0!==f&&f,v=n.action,m=n.children,y=n.onClose,b=t.useState(!0),w=b[0],C=b[1];return w?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat(o),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[p&&c,e.jsxs("div",{className:"flex flex-col gap-1",style:g?{paddingRight:"2rem"}:{},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}),m&&e.jsx("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:m}),v&&g&&e.jsx("div",{className:"mt-3",children:v})]}),v&&!g&&e.jsx("div",{className:"ml-3",children:v}),g&&e.jsx("div",{className:"absolute right-4 top-3 cursor-pointer",onClick:function(){C(!1),null==y||y()},children:x})]}):null},exports.Button=f,exports.CheckIcon=M,exports.Checkbox=I,exports.DatePicker=$,exports.Form=ne,exports.Input=O,exports.MenuList=re,exports.MinusIcon=A,exports.Pagination=N,exports.Progress=function(n){var i=n.percent,a=void 0===i?0:i,l=n.type,s=void 0===l?"circle":l,d=n.width,u=void 0===d?120:d,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,D=o(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),S=c().primaryColor,E=Math.min(100,Math.max(0,a)),M=t.useRef(!0),A=t.useState(!1),L=A[0],T=A[1],B=t.useState(0),z=B[0],R=B[1];t.useEffect(function(){if(v&&M.current&&E>0){M.current=!1,R(0),T(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){R(E)})});var e=setTimeout(function(){T(!1),R(E)},300);return function(){return clearTimeout(e)}}M.current?(M.current=!1,T(!1),R(E)):R(E)},[v,E]);var W=F||S||"#FB6011";"success"===y?W="#00BC7D":"exception"===y&&(W="#FB2C36");var N=f||"inside",I=Math.max(4,Math.round(.06*u)),H=(u-I)/2,Y="semicircle"===s?u/2:u,V="14px",P="12px",O=function(){var t=p&&"outside"===N?u+4+18+4:u,n=2*Math.PI*H,r=n-(L?z:E)/100*n;return e.jsxs("div",{style:{position:"relative",width:u,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:[e.jsxs("svg",{width:u,height:u,style:{position:"absolute",top:0,left:0},children:[e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:r,transform:"rotate(-90 ".concat(u/2," ").concat(u/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:V,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(E),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u/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(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:V,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},q=r({display:"inline-flex",flexDirection:"column",alignItems:"center",width:u},C);return e.jsx("div",r({className:"aha-progress aha-progress--".concat(s," ").concat(w),style:q},D,{children:function(){switch(s){case"circle":return O();case"semicircle":return n=I/2,r=u-I/2,o=(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,d=l-(L?z:E)/100*l,e.jsxs("div",{style:{position:"relative",width:u,height:a,overflow:"hidden"},children:[e.jsxs("svg",{width:u,height:t,viewBox:"0 0 ".concat(u," ").concat(t),style:{position:"absolute",top:0,left:0},children:[e.jsx("path",{d:"M ".concat(n," ").concat(o," A ").concat(H," ").concat(H," 0 0 1 ").concat(r," ").concat(o),fill:"none",stroke:j,strokeWidth:I,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(o," A ").concat(H," ").concat(H," 0 0 1 ").concat(r," ").concat(o),fill:"none",stroke:W,strokeWidth:I,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:d,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:V,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(E),"%")})]}):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(E),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:V,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')),O()}var t,n,r,o,i,a,l,d}()}))},exports.Radio=P,exports.Select=K,exports.Switch=Z,exports.Tab=function(n){var i=n.items,a=void 0===i?[]:i,l=n.variant,s=void 0===l?"underline":l,d=n.layout,u=void 0===d?"equal":d,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=o(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),C=c().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:"",D=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),r=Number(e);return!isNaN(n)&&!isNaN(r)&&n===r});return t?t.key:j},S=t.useState(function(){var e,t=null!==(e=null!=f?f:p)&&void 0!==e?e:j;return D(t)}),E=S[0],M=S[1],A=k?void 0!==f?D(f):j:E;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||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 r=z.current[R(e)],o=I.current;if(r&&o){V.current=!0;var i,l=function(){if(o&&W.current&&r){var e=o.getBoundingClientRect(),t=r.getBoundingClientRect();if(e.width>0&&t.width>0){var n=o.scrollLeft||0,i=t.left-e.left+n,a=t.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),V.current=!1,o.removeEventListener("scroll",d)},150)};o.addEventListener("scroll",d,{passive:!0}),r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[k,h,a,b,s]),T=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}),B=C||"#FB6011",z=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 V=t.useRef(!1),P=t.useState({width:0,left:0,opacity:0}),O=P[0],q=P[1],Z=t.useState({width:0,left:0,opacity:0}),K=Z[0],X=Z[1],G=t.useCallback(function(){"underline"===s&&I.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(W.current&&I.current){var e=z.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=z.current[R(t)]}if(e){var n=I.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=I.current.scrollLeft||0,i=r.left-n.left+o,a=r.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]),J=t.useCallback(function(){"background"===s&&H.current&&N.current&&A&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(N.current&&H.current){var e=z.current[R(A)];if(!e&&F.length>0){var t=F[0].key;e=z.current[R(t)]}if(e){var n=H.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=r.left-n.left,i=r.width,a="".concat(o,"px"),l="".concat(i,"px");X(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&&!V.current&&G(),"background"===s&&H.current&&N.current&&J()):Y.current=""},[A,s,F.length,k,G,J]),t.useEffect(function(){if(A){var e=setTimeout(function(){if("underline"===s)(e=z.current[R(A)])&&I.current&&W.current&&(G(),b&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===s){var e;if((e=z.current[R(A)])&&H.current&&N.current){var t=H.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var r=n.left-t.left,o=n.width,i="".concat(r,"px"),a="".concat(o,"px");X({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),t.useEffect(function(){if(b&&"underline"===s&&A&&!V.current){var e=setTimeout(function(){var e=z.current[R(A)],t=I.current;if(e&&t){V.current=!0;var n,r=function(){if(t&&W.current&&e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(n.width>0&&r.width>0){var o=t.scrollLeft||0,i=r.left-n.left+o,a=r.width;q({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},o=function(){r(),clearTimeout(n),n=setTimeout(function(){r(),V.current=!1,t.removeEventListener("scroll",o)},150)};t.addEventListener("scroll",o,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){r()})})}},50);return function(){return clearTimeout(e)}}},[A,b,s]);var _;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===s?(_={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},b&&(_.overflowX="auto",_.overflowY="hidden",_.scrollBehavior="smooth",_.scrollbarWidth="none",_.WebkitOverflowScrolling="touch"),e.jsxs("div",r({ref:I,className:"aha-tab aha-tab--underline ".concat(b?"aha-tab--scrollable":""," ").concat(g),style:_},w,{children:[e.jsx("div",{ref:W,style:r({position:"absolute",bottom:"-1px",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"},O)}),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){z.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:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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"===u?"100%":"fit-content",e.jsxs("div",r({ref:H,className:"aha-tab aha-tab--background aha-tab--".concat(u," ").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"},K)}),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"===u?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){z.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:"#FAFAF9",border:"1px solid #E7E5E4",color:"#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 i,a,s,d,c=n.columns,u=void 0===c?[]:c,p=n.dataSource,f=void 0===p?[]:p,h=n.rowKey,x=void 0===h?"key":h,g=n.rowSelection,v=n.pagination,m=void 0!==v&&v,y=n.size,b=void 0===y?"middle":y,w=n.bordered,C=void 0!==w&&w;n.loading;var F=n.locale,k=n.showHeader,j=void 0===k||k,D=n.title,S=n.footer,E=n.summary,M=n.scroll,A=n.tableLayout,L=void 0===A?"auto":A,T=n.onChange,B=n.onSorterChange,z=n.onPaginationChange,R=n.onRow,W=n.className,P=void 0===W?"":W,O=n.style,q=n.expandable,Z=n.rowClassName,K=n.onHeaderRow;n.sticky;var X=o(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","style","expandable","rowClassName","onHeaderRow","sticky"]),G=t.useState((null==g?void 0:g.selectedRowKeys)||(null==g?void 0:g.defaultSelectedRowKeys)||[]),J=G[0],_=G[1];t.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&_(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var U=t.useState(new Map),Q=U[0],$=U[1],ee=t.useState((null==q?void 0:q.defaultExpandedRowKeys)||[]),te=ee[0],ne=ee[1],re=t.useState(m&&"object"==typeof m&&(m.current||m.defaultCurrent)||1),oe=re[0],ie=re[1],ae=t.useState(m&&"object"==typeof m&&(m.pageSize||m.defaultPageSize)||10),le=ae[0],se=ae[1];t.useEffect(function(){m&&"object"==typeof m&&(void 0!==m.current&&ie(m.current),void 0!==m.pageSize&&se(m.pageSize))},[m]);var de=t.useState(null),ce=de[0],ue=de[1],pe=t.useState(null),fe=pe[0],he=pe[1],xe=t.useState(!1),ge=xe[0],ve=xe[1],me=t.useRef(null),ye=t.useRef(null);t.useEffect(function(){var e=function(){ve(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var be=t.useCallback(function(e,t){var n,r,o,i=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==i?void 0:i.disabled)){var a,s=Y(e,x);a="radio"===(null==g?void 0:g.type)?t?[s]:[]:t?l(l([],J,!0),[s],!1):J.filter(function(e){return e!==s}),_(a);var d=f.filter(function(e){return a.includes(Y(e,x))});null===(r=null==g?void 0:g.onChange)||void 0===r||r.call(g,a,d),null===(o=null==g?void 0:g.onSelect)||void 0===o||o.call(g,e,t,d,new Event("select"))}},[J,x,g,f]),we=t.useCallback(function(e,t){var n,r,o=t.filter(function(e){var t;return!(null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}).map(function(e){return Y(e,x)}),i=e?o:[];_(i);var a=f.filter(function(e){return i.includes(Y(e,x))}),l=e?t.filter(function(e){var t;return!(null===(t=null==g?void 0:g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}):[];null===(n=null==g?void 0:g.onChange)||void 0===n||n.call(g,i,a),null===(r=null==g?void 0:g.onSelectAll)||void 0===r||r.call(g,e,a,l)},[x,g,f]),Ce=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var r=new Map(Q);null===t?r.delete(n):r.set(n,t),$(r);var o=Array.from(r.entries()).map(function(t){var n=t[0],r=t[1];return{column:u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:r,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),B&&B(1===o.length?o[0]:o),T&&T({current:oe,pageSize:le},{},1===o.length?o[0]:o,{currentDataSource:f,action:"sort"})}},[Q,T,B,oe,le,f,u]);t.useCallback(function(e,t){var n,r,o,i=Y(e,x);o=t?l(l([],te,!0),[i],!1):te.filter(function(e){return e!==i}),ne(o),null===(n=null==q?void 0:q.onExpand)||void 0===n||n.call(q,t,e),null===(r=null==q?void 0:q.onExpandedRowsChange)||void 0===r||r.call(q,o)},[te,x,q]);var Fe=t.useCallback(function(){var e=l([],f,!0);return Q.size>0&&e.sort(function(e,t){for(var n=function(n,r){var o=u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!o)return"continue";var i=0;if("function"==typeof o.sorter)i=o.sorter(e,t);else if(!0===o.sorter){var a=H(e,o.dataIndex||n),l=H(t,o.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===r?i:-i}:void 0},r=0,o=Array.from(Q.entries());r<o.length;r++){var i=o[r],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[f,Q,u]),ke=Fe(),je=t.useMemo(function(){if(!1===m||!m)return ke;var e=(oe-1)*le,t=e+le;return ke.slice(e,t)},[ke,oe,le,m]),De=t.useCallback(function(e,t){var n,r,o=null!=t?t:le;if(ie(e),t&&se(t),z&&z(e,o),m&&"object"==typeof m&&(null===(n=m.onChange)||void 0===n||n.call(m,e,t),t&&(null===(r=m.onShowSizeChange)||void 0===r||r.call(m,e,t))),T){var i=Array.from(Q.entries()).map(function(e){var t=e[0],n=e[1];return{column:u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});T({current:e,pageSize:o},{},1===i.length?i[0]:i,{currentDataSource:ke,action:"paginate"})}},[m,z,T,le,Q,u,ke]),Se=t.useCallback(function(e,t,n){var r=H(t,e.dataIndex||"");return e.render?e.render(r,t,n):r},[]),Ee=t.useCallback(function(e,t,n){if(t){var r=!0===t?"left":t,o=0;if("left"===r){if(g&&("left"===g.fixed||!0===g.fixed))o+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=u[i]).fixed||!0===a.fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return o}if("right"===r){for(i=e+1;i<u.length;i++){var a;if("right"===(a=u[i]).fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(g&&"right"===g.fixed)o+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return o}}},[u,g]),Me=t.useCallback(function(){if(!j)return null;var t,n,o,i,a=u.map(function(t,n){var o,i=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,a=Q.get(i)||null,l=Ee(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(){Ce(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(V,{order:a||void 0})})]})}),i)});if(g){var l="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",s=e.jsx("th",{style:{width:l,position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"#F9FAFB",padding:"12px 16px",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif",textAlign:"center"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!g.hideSelectAll&&"radio"!==g.type&&(t=je.filter(function(e){var t;return!(null===(t=g.getCheckboxProps)||void 0===t?void 0:t.call(g,e).disabled)}),n=t.map(function(e){return Y(e,x)}),o=t.length>0&&n.every(function(e){return J.includes(e)}),i=n.some(function(e){return J.includes(e)}),e.jsx(I,{checked:o,indeterminate:i&&!o,onChange:function(e){return we(e.target.checked,je)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");a.unshift(s)}var d=null==K?void 0:K(u,0);return e.jsx("thead",{ref:ye,children:e.jsx("tr",r({},d||{},{children:a}))})},[u,j,Q,g,J,je,x,Ce,we,F,K,Ee]),Ae=t.useCallback(function(e){ue(e)},[]),Le=t.useCallback(function(e,t){e.preventDefault(),he(t)},[]),Te=t.useCallback(function(e,t){if(e.preventDefault(),null===ce||ce===t)return ue(null),void he(null);var n=l([],je,!0),r=n[ce];n.splice(ce,1),n.splice(t,0,r),ue(null),he(null)},[ce,je]),Be=t.useCallback(function(){ue(null),he(null)},[]),ze=t.useCallback(function(){return je.map(function(n,o){var i,a=Y(n,x),l=J.includes(a),s=te.includes(a),d=(null==R?void 0:R(n,o))||{},c=o===je.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",r({className:"".concat("function"==typeof Z?Z(n,o):Z||""," ").concat(ce===o?"dragging":""," ").concat(fe===o?"drag-over":""),draggable:!0,onDragStart:function(){return Ae(o)},onDragOver:function(e){return Le(e,o)},onDrop:function(e){return Te(e,o)},onDragEnd:Be,style:r({cursor:"move",opacity:ce===o?.5:1,backgroundColor:fe===o?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ce!==o&&fe!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ce!==o&&fe!==o&&(e.currentTarget.style.backgroundColor="white")}},d,{children:[g&&e.jsx("td",{style:{width:"number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",position:g.fixed?"sticky":"relative",left:"left"===g.fixed||!0===g.fixed?"0px":void 0,right:"right"===g.fixed?"0px":void 0,zIndex:g.fixed?"left"===g.fixed||!0===g.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(I,{checked:l,onChange:function(e){return be(n,e.target.checked)},disabled:null===(i=g.getCheckboxProps)||void 0===i?void 0:i.call(g,n).disabled})})}),u.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))||{},d=Ee(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!==d?"".concat(d,"px"):"0":void 0,right:"right"===t.fixed?void 0!==d?"".concat(d,"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:c?"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:Se(t,n,o)}),l)})]})),(null==q?void 0:q.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:q.expandedRowRender(n,o,0,!0)})})]},a)})},[je,x,J,te,g,u,R,Z,be,Se,q,ce,fe,Ae,Le,Te,Be,Ee]),Re=function(){var t;if(!1===m||!m)return null;var n=null!==(t=m.total)&&void 0!==t?t:ke.length,r=m.position||"bottomRight";return e.jsx("div",{style:{marginTop:"16px",display:"flex",justifyContent:r.includes("Right")?"flex-end":r.includes("Left")?"flex-start":"center"},children:e.jsx(N,{current:oe,total:n,pageSize:le,showSizeChanger:m.showSizeChanger,pageSizeOptions:m.pageSizeOptions,showQuickJumper:m.showQuickJumper,showTotal:m.showTotal,onChange:De,onShowSizeChange:De,simple:m.simple,responsive:m.responsive,size:"small"===b?"small":"default"})})},We=t.useMemo(function(){return u.some(function(e){return e.fixed})||g&&g.fixed},[u,g]),Ne=t.useMemo(function(){return u.every(function(e){return e.width})&&(!g||g.columnWidth)},[u,g]),Ie=t.useMemo(function(){if(null==M?void 0:M.x){if("number"==typeof M.x)return M.x;if(!0===M.x)return u.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(g?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth||"60").replace("px",""))||60:0)}if(We)return u.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)+(g&&g.fixed&&g.columnWidth?"number"==typeof g.columnWidth?g.columnWidth:parseInt(String(g.columnWidth).replace("px",""))||60:0)},[u,null==M?void 0:M.x,g,We]),He=t.useMemo(function(){return"fixed"===L||We||Ne||u.some(function(e){return e.width})?"fixed":L},[L,We,Ne,u]),Ye={width:"100%",minWidth:Ie?"".concat(Ie,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:He,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Ve=r({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==M?void 0:M.y)?"".concat(M.y,"px"):void 0,borderRadius:"8px"},O);if(ge)return e.jsxs("div",r({ref:me,className:"aha-table aha-table-mobile-wrapper ".concat(P),style:Ve},X,{children:[D&&e.jsx("div",{style:{marginBottom:"16px"},children:D(ke)}),m&&"object"==typeof m&&(null===(i=m.position)||void 0===i?void 0:i.startsWith("top"))&&Re(),e.jsx("div",{className:"aha-table-mobile",children:je.map(function(t,n){var r,o=Y(t,x),i=J.includes(o);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(i?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:i?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(I,{checked:i,onChange:function(e){return be(t,e.target.checked)},disabled:null===(r=g.getCheckboxProps)||void 0===r?void 0:r.call(g,t).disabled})}),u.map(function(r){var o=r.key||(Array.isArray(r.dataIndex)?r.dataIndex.join("."):r.dataIndex),i=H(t,r.dataIndex||""),a=r.render?r.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 r.title?r.title({}):r.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:a})]},o)})]},o)})}),S&&e.jsx("div",{style:{marginTop:"16px"},children:S(ke)}),m&&("object"!=typeof m||!(null===(a=m.position)||void 0===a?void 0:a.startsWith("top")))&&Re()]}));var Pe={position:"relative",overflowX:(null==M?void 0:M.x)||We?"auto":"visible",overflowY:(null==M?void 0:M.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==M?void 0:M.x)?"100%":"number"==typeof(null==M?void 0:M.x)?"".concat(M.x,"px"):void 0,maxHeight:"number"==typeof(null==M?void 0:M.y)?"".concat(M.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",r({ref:me,className:"aha-table ".concat(P),style:Ve},X,{children:[D&&e.jsx("div",{style:{marginBottom:"16px"},children:D(ke)}),m&&"object"==typeof m&&(null===(s=m.position)||void 0===s?void 0:s.startsWith("top"))&&Re(),e.jsx("div",{style:Pe,children:e.jsx("div",{style:{width:"100%",minWidth:Ie?"".concat(Ie,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Ye,className:C?"bordered":"",children:[Me(),e.jsx("tbody",{children:ze()}),E&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:E(ke)})})})]})})}),S&&e.jsx("div",{style:{marginTop:"16px"},children:S(ke)}),m&&("object"!=typeof m||!(null===(d=m.position)||void 0===d?void 0:d.startsWith("top")))&&Re()]}))},exports.Tag=function(n){var i=n.children,a=n.color,l=n.variant,s=void 0===l?"light":l,d=n.size,u=void 0===d?"large":d,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=o(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=c().primaryColor,C=function(e,t){if("string"==typeof e&&e in S){var n=S[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 S.Green}(a,w),F=E[u],k={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===u?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===u?"1.375":"1",transition:"all 0.2s",fontSize:"large"===u?"14px":"12px",height:"small"===u?"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 S)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),r=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(r,", ").concat(o,", 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"===u?"leading-snug":"leading-none","transition-colors","duration-200","small"===u?"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 D=j.join(" "),M=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in S)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),r="small"===u?"14px":"16px";return e.jsx("div",{className:"flex items-center justify-center",style:{width:r,height:r},children:"svg"===h.type?t.cloneElement(h,{width:r,height:r,style:{fill:n}}):h})};return e.jsxs("div",r({className:D,style:k,onClick:y},b,{children:["leading"===g&&M(),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"===u?"leading-snug":"leading-none"),children:i})}),"after"===g&&M()]}))},exports.Textarea=q,exports.ThemeProvider=function(n){var o=n.theme,i=n.children,a=t.useMemo(function(){return r(r({},s),o)},[o]);return e.jsx(d.Provider,{value:a,children:i})},exports.Toast=function(t){return e.jsx(w,{id:"direct",props:t})},exports.ToastProvider=function(r){var o=r.children,i=t.useState(!1),a=i[0],l=i[1];return t.useEffect(function(){l(!0)},[]),e.jsxs(e.Fragment,{children:[o,a&&n.createPortal(e.jsx(b,{}),document.body)]})},exports.Tooltip=function(o){var i=o.content,a=o.children,l=o.position,s=void 0===l?"top":l,d=o.trigger,c=void 0===d?"hover":d,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,D=o.visible,S=o.onVisibleChange,E=void 0!==D,M=t.useState(j),A=M[0],L=M[1],T=E?D:A,B=t.useState(E?null!=D&&D:j),z=B[0],R=B[1],W=t.useCallback(function(e){E||L(e),null==S||S(e)},[E,S]);t.useEffect(function(){E&&(D?requestAnimationFrame(function(){R(!0)}):R(!1))},[E,D]);var N=t.useState(s),I=N[0],H=N[1],Y=t.useState("320px"),V=Y[0],P=Y[1],O=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===c?"auto":"none"}),q=O[0],Z=O[1],K=t.useState({}),X=K[0],G=K[1],J=t.useRef(null),_=t.useRef(null),U=t.useRef(null),Q=t.useRef(null),$=t.useCallback(function(){if(J.current&&_.current&&T&&z){var e=J.current.getBoundingClientRect(),t=_.current.getBoundingClientRect(),n=function(e,t,n,r){if(void 0===r&&(r=6),!ie(e,t,n,r))return n;for(var o=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);o<i.length;o++){var a=i[o];if(!ie(e,t,a,r))return a}return n}(e,t,s,b);H(n);var o=oe(e,t,n,b),i=o.top,a=o.left;if(Z(function(e){return r(r({},e),{position:"absolute",top:"".concat(i,"px"),left:"".concat(a,"px"),pointerEvents:"hover"===c?"auto":"none",zIndex:9999})}),C){var l=function(e,t,n,r,o){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,d=r-i,c=o-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-d,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(s-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(s-c,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);G(l)}}},[T,s,b,C,z,c]),ee=t.useCallback(function(){h||(Q.current&&(clearTimeout(Q.current),Q.current=null),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){W(!0),E||requestAnimationFrame(function(){R(!0)})},p))},[h,p,W,E]),te=t.useCallback(function(){U.current&&(clearTimeout(U.current),U.current=null),Q.current&&clearTimeout(Q.current),E?W(!1):(R(!1),Q.current=setTimeout(function(){W(!1),Q.current=null},150))},[W,E]),ne=t.useCallback(function(){"hover"===c&&(Q.current&&(clearTimeout(Q.current),Q.current=null),T||(W(!0),requestAnimationFrame(function(){R(!0)})))},[c,T]),re=t.useCallback(function(e){h||"click"!==c||(e.stopPropagation(),T?te():(U.current&&(clearTimeout(U.current),U.current=null),W(!0),requestAnimationFrame(function(){R(!0)})))},[h,c,T,te]);t.useEffect(function(){if(j&&T&&z){var e=function(){J.current&&_.current?$():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,T,z,$]),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"===c){var e=function(e){J.current&&_.current&&!J.current.contains(e.target)&&!_.current.contains(e.target)&&te()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[T,c,te]),t.useEffect(function(){return function(){U.current&&clearTimeout(U.current),Q.current&&clearTimeout(Q.current)}},[]);var le={position:"absolute",top:0,left:0,opacity:z?1:0,transform:z?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===c?"auto":"none",zIndex:9999},se=t.useCallback(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);t.useEffect(function(){var e=function(){P(se())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[se]);var de=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:V,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"}),ce=e.jsxs("div",{style:r(r(r({},le),q),{pointerEvents:"hover"===c?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===c?ne:void 0,onMouseLeave:"hover"===c?te:void 0,children:[e.jsx("div",{ref:_,className:"aha-tooltip ".concat(m),style:de,role:"tooltip",children:i}),C&&ae(I,X)]}),ue=t.useCallback(function(){"hover"===c&&(Q.current=setTimeout(function(){te()},100))},[c,te]),pe="click"===c?{onClick:re}:{onMouseEnter:ee,onMouseLeave:ue,onFocus:ee,onBlur:te};return e.jsxs(e.Fragment,{children:[e.jsx("div",r({ref:J,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===c?"pointer":"default"}},pe,{children:a})),T&&"undefined"!=typeof document&&n.createPortal(ce,document.body)]})},exports.clearAllToasts=function(){y.clearAll()},exports.closeToast=function(e){y.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 管理器状态:",y.getToasts()),console.log("容器根节点:",k),console.log("是否正在初始化:",j),console.log("====================")},exports.toast=C,exports.toastError=function(e,t){return D(),C(r(r({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return D(),C(r(r({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return D(),C(r(r({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return D(),C(r(r({},t),{message:e,type:"success"}))},exports.useTheme=c;
2
2
  //# sourceMappingURL=index.js.map