aha-components 1.3.2 → 1.3.4
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/Tooltip.esm.js +1 -1
- package/dist/Tooltip.esm.js.map +1 -1
- package/dist/Tooltip.js +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.stories.d.ts +2 -0
- package/dist/components/Tooltip/index.d.ts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom"),o=function(){return o=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function r(e,t,n,o){return new(n||(n=Promise))(function(i,r){function l(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,a)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function a(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||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,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 r,l=n.children,a=n.type,s=void 0===a?"default":a,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,C=n.className,w=void 0===C?"":C,F=n.style,k=n.icon,j=n.iconPosition,S=void 0===j?"left":j,E=i(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),A=c().primaryColor,z=void 0===A?"#FB6011":A,L=t.useState(!1),D=L[0],M=L[1],B=t.useState(!1),T=B[0],W=B[1],I=u[f],N=x||v,R=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(I.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:I.iconSize,height:I.iconSize,flexShrink:0},children:k}):null},H=(r=o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:I.gap,height:I.height,paddingLeft:I.paddingLeft,paddingRight:I.paddingRight,fontSize:I.fontSize,lineHeight:I.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?(r.color="#FFFFFF",r.backgroundColor=z,x?(r.opacity=.4,r.cursor="not-allowed"):v?r.backgroundColor=z:T?r.backgroundColor="#EC470A":D&&(r.backgroundColor="#FD843A")):x?(r.backgroundColor="#FAFAF9",r.color="#D6D3D1",r.border="1px solid #E7E5E4"):v?(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):T?(r.backgroundColor="#F5F5F4",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):D?(r.backgroundColor="#FAFAF9",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),r);return e.jsxs("button",o({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(f," ").concat(N?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(w),disabled:N,onClick:function(e){N?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!N&&M(!0)},onMouseLeave:function(){M(!1),W(!1)},onMouseDown:function(){return!N&&W(!0)},onMouseUp:function(){return W(!1)},style:H},E,{children:[v&&R(),!v&&"left"===S&&R(),l&&e.jsx("span",{style:{display:"inline-block"},children:l}),!v&&"right"===S&&R()]}))};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 a([],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([]),i=n[0],r=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=y.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),r(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})),r(e)});return t},[]);var l=i.filter(function(e){return"top-left"===e.props.position}),a=i.filter(function(e){return"top-right"===e.props.position}),s=i.filter(function(e){return"bottom-left"===e.props.position}),d=i.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:l.map(function(t){return e.jsx(C,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:a.map(function(t){return e.jsx(C,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(C,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:d.map(function(t){return e.jsx(C,o({},t),t.id)})})]})},C=function(n){var o=n.id,i=n.props,r=t.useState(!1),l=r[0],a=r[1],s=t.useState(!1),d=s[0],c=s[1],u=i.message,p=i.type,f=void 0===p?"info":p,h=i.duration,x=void 0===h?3e3:h,m=i.icon,b=i.action,C=i.showClose,w=void 0===C||C,F=i.onClose,k=i.onClick;i.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(){a(!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(){c(!0),setTimeout(function(){y.removeToast(o),null==F||F()},300)},[o,F]),E=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:l&&!d?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:l&&!d?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:E,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})]}),w&&e.jsx("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(v,{})})]})})},w=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 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},A={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},z=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"})})},L=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"})})},D=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"})})},M=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"})]})},B=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"})]})},T=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"})})},W=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"})})},I=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"})})})]})},N=function(n){var i=n.current,r=n.defaultCurrent,l=void 0===r?1:r,a=n.total,s=void 0===a?0:a,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,C=n.onChange,w=n.onShowSizeChange,F=n.simple,k=void 0!==F&&F,j=n.disabled,S=void 0!==j&&j,E=n.hideOnSinglePage,A=void 0!==E&&E,z=n.className,L=void 0===z?"":z,D=n.style,M=n.size,B=void 0===M?"default":M,I=n.responsive,N=void 0!==I&&I;n.showLessItems;var R=n.itemRender,H=c().primaryColor,O=void 0===H?"#FB6011":H,P=t.useState(l),V=P[0],q=P[1],Z=t.useState(p),K=Z[0],Y=Z[1],X=t.useState(""),G=X[0],_=X[1],U=null!=i?i:V,Q=null!=d?d:K,J=t.useMemo(function(){return Math.ceil(s/Q)},[s,Q]);t.useEffect(function(){void 0!==i&&q(i)},[i]),t.useEffect(function(){void 0!==d&&Y(d)},[d]);var $=function(e){e<1||e>J||e===U||S||(void 0===i&&q(e),null==C||C(e,Q))},ee=function(){var e=parseInt(G,10);e>=1&&e<=J&&($(e),_(""))};if(A&&J<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(L),style:D,children:[e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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:[U," / ",J]}),e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,type:"default",size:"default"===B?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var te=(U-1)*Q+1,ne=Math.min(U*Q,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(L),style:o({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:N?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},D),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:[R?R(U-1,"prev",e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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(T,{})," ",e.jsx("span",{children:"Previous"})]})})):e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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(T,{})," ",e.jsx("span",{children:"Previous"})]})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(J<=7)return Array.from({length:J},function(e,t){return t+1});var e=[];if(U<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(J)}else if(U>=J-3){e.push(1),e.push("jump-prev");for(t=J-4;t<=J;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=U-1;t<=U+1;t++)e.push(t);e.push("jump-next"),e.push(J)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===U,o=e.jsx(f,{onClick:function(){return $(t)},disabled:S,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?O:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return R?R(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(f,{onClick:function(){return $(Math.max(1,U-5))},disabled:S,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"),R?R(U-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(f,{onClick:function(){return $(Math.min(J,U+5))},disabled:S,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"),R?R(U+5,"jump-next",o):o;return null}(t)})}),R?R(U+1,"next",e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,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(W,{})]})})):e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,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(W,{})]})}),x&&e.jsx("select",{value:Q,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(s/t),o=U>n?n:U,void 0===d&&Y(t),void 0===i&&q(o),null==w||w(o,t),void(null==C||C(o,t));var t,n,o},disabled:S,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:S?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){S||(e.currentTarget.style.borderColor=O)},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 _(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ee()},disabled:S,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=O},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"===B?"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"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},R=function(t){var n=t.checked,i=void 0!==n&&n,r=t.indeterminate,l=void 0!==r&&r,a=t.disabled,s=void 0!==a&&a,d=t.onChange,u=t.className,p=void 0===u?"":u,f=t.style,h=t.children,x=c().primaryColor,g=i||l,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==d||d({target:{checked:!i},currentTarget:{checked:!i}}))},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:l?e.jsx(L,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(z,{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:i,ref:function(e){e&&(e.indeterminate=l)},onChange:d,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};R.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)},O=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:""},P=function(t){var n=t.order,o=c().primaryColor;return"ascend"===n?e.jsx(B,{style:{color:o}}):"descend"===n?e.jsx(M,{style:{color:o}}):e.jsx(D,{})},V=function(t){var n=t.checked,i=void 0!==n&&n,r=t.disabled,l=void 0!==r&&r,a=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=l?"#FAFAF9":i?g:"white",m=l?"#FAFAF9":i?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(d),style:o({display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer"},u),onClick:function(e){l||(null==a||a({target:{checked:!i,value:f},currentTarget:{checked:!i,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:i?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),p&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:l?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:p}),e.jsx("input",{type:"radio",checked:i,onChange:a,disabled:l,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};V.displayName="Radio";var q=t.forwardRef(function(n,r){var l=n.size,a=void 0===l?"medium":l,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,C=void 0===b?"":b,w=n.style,F=n.type,k=void 0===F?"text":F,j=n.placeholder,S=n.value,E=n.defaultValue,A=n.onChange,z=n.onFocus,L=n.onBlur,D=n.onPressEnter,M=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=c().primaryColor,T=void 0===B?"#FB6011":B,W=t.useRef(null),I=t.useState(E||S||""),N=I[0],R=I[1],H=t.useState(!1),O=H[0],P=H[1];t.useEffect(function(){"function"==typeof r?r(W.current):r&&(r.current=W.current)},[r]);var V=void 0!==S,q=V?S:N,Z=function(e){var t;e.stopPropagation(),V||R("");null==A||A({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=W.current)||void 0===t||t.focus()},K=m&&q&&!d,Y={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||K?"40px":"12px",G=o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":O?T:"#D7D3D0"),backgroundColor:d||h?"#FAFAF9":"#FFFFFF",color:d?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:X,paddingTop:Y[a].paddingTop,paddingBottom:Y[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},w);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(C),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",o({ref:W,type:k,value:q,placeholder:j,disabled:d,readOnly:h,onChange:function(e){V||R(e.target.value),null==A||A(e)},onFocus:function(e){P(!0),null==z||z(e)},onBlur:function(e){P(!1),null==L||L(e)},onKeyDown:function(e){var t;"Enter"===e.key&&D&&D(e),null===(t=M.onKeyDown)||void 0===t||t.call(M,e)},style:G,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(g||K)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:d?"#98A2B3":"#78716C",zIndex:1},children:[K&&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:Z,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})]})]})]})});q.displayName="Input";var Z=t.forwardRef(function(n,r){var l=n.disabled,a=void 0!==l&&l,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,C=n.defaultValue,w=n.rows,F=void 0===w?3:w,k=n.autoSize,j=void 0!==k&&k,S=n.onChange,E=n.onFocus,A=n.onBlur,z=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),L=c().primaryColor,D=void 0===L?"#FB6011":L,M=t.useRef(null),B=t.useState(C||b||""),T=B[0],W=B[1],I=t.useState(!1),N=I[0],R=I[1],H=t.useState(void 0),O=H[0],P=H[1];t.useEffect(function(){"function"==typeof r?r(M.current):r&&(r.current=M.current)},[r]);var V=void 0!==b,q=V?b:T,Z=String(q||"").length;t.useEffect(function(){if(j&&M.current){var e=M.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,i=parseInt(window.getComputedStyle(e).lineHeight||"22",10),r=t*i,l=n?n*i:void 0,a=Math.max(o,r);l&&(a=Math.min(a,l)),e.style.height="".concat(a,"px"),P(a)}},[q,j]);var K=o(o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":N?D:"#D7D3D0"),backgroundColor:a||p?"#FAFAF9":"#FFFFFF",color:a?"#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:a?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==O&&j?{height:"".concat(O,"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:M,value:q,placeholder:y,disabled:a,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){V||W(e.target.value),null==S||S(e)},onFocus:function(e){R(!0),null==E||E(e)},onBlur:function(e){R(!1),null==A||A(e)},style:K,autoComplete:z.autoComplete||"off",autoCorrect:z.autoCorrect||"off",autoCapitalize:z.autoCapitalize||"off",spellCheck:z.spellCheck||!1},z)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:a?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[Z," / ",x]}):e.jsx("span",{children:Z})})]})]})});Z.displayName="Textarea";var K=function(n){var i=n.checked,r=n.defaultChecked,l=void 0!==r&&r,a=n.disabled,s=void 0!==a&&a,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,C=c().primaryColor,w=void 0===C?"#FB6011":C,F=t.useState(l),k=F[0],j=F[1],S=void 0!==i,E=S?i:k,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],z=E||v,L=s?"#E7E5E4":z?w:"#F5F5F4",D=z?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":E,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!E;S||j(t),null==d||d(t,e),null==u||u(t,e)}},className:"aha-switch ".concat(y),style:o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:z?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:L,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:z?"6px":"auto",right:z?"auto":"6px",fontSize:A.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:z?p:f}),e.jsx("span",{style:{position:"absolute",left:D,top:"50%",transform:"translateY(-50%)",width:A.thumbSize,height:A.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"})]})})]})};K.displayName="Switch";var Y=function(i){var r,l=i.value,s=i.defaultValue,d=i.options,u=void 0===d?[]:d,p=i.mode,f=i.disabled,h=void 0!==f&&f,x=i.error,g=void 0!==x&&x,v=i.placeholder,m=void 0===v?"Please select":v,y=i.size,b=void 0===y?"medium":y,C=i.showSearch,w=void 0!==C&&C,F=i.filterOption,k=void 0===F||F,j=i.allowClear,S=void 0!==j&&j,E=i.onChange,A=i.onSelect,z=i.onDeselect,L=i.onSearch,D=i.onFocus,M=i.onBlur,B=i.onDropdownVisibleChange,T=i.className,W=void 0===T?"":T,I=i.style,N=i.dropdownClassName,R=void 0===N?"":N,H=i.dropdownStyle,O=i.defaultOpen,P=void 0!==O&&O,V=i.open,q=i.maxTagCount,Z=i.tagRender,K=i.optionRender,Y=c().primaryColor,X=void 0===Y?"#FB6011":Y,G=t.useState(void 0!==s?s:p?[]:void 0),_=G[0],U=G[1],Q=t.useState(P),J=Q[0],$=Q[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),ie=oe[0],re=oe[1],le=t.useRef(null),ae=t.useRef(null),se=t.useRef(null),de=t.useState(null),ce=de[0],ue=de[1],pe=void 0!==l,fe=void 0!==V,he=pe?l:_,xe=fe?V:J,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 w&&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,w,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&le.current){var e=function(){if(le.current){var e=le.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;le.current&&!le.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(),re(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),re(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ie>=0){e.preventDefault();var n=ye[ie];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(t=le.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,ie,fe,B]),t.useEffect(function(){if(ie>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[ie];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ie]);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==z||z(e.value,e)):(n=a(a([],o,!0),[e.value],!1),null==A||A(e.value,e)),pe||U(n);var i=u.filter(function(e){return n.includes(e.value)});null==E||E(n,i)}else pe||U(e.value),null==E||E(e.value,e),null==A||A(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=le.current)||void 0===t||t.focus()},[ge,he,pe,fe,u,E,A,z,B]),Ce=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||U(n),null==E||E(n,ve()),null==z||z(t,o)}},[ge,he,pe,u,E,z,ve]),we=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||U(t),null==E||E(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]),Ee=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===q?ke.slice(0,2):q?ke.slice(0,q):ke,o=q&&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 Ce({},n.value)}};return Z?e.jsx(t.Fragment,{children:Z(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 Ce(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,q,h,Z]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:le,className:"aha-select ".concat(W),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"},I),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&w?setTimeout(function(){var e;null===(e=ae.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==D||D(e)},onBlur:function(e){null==M||M(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?Ee||(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"}})):w&&xe?e.jsx("input",{ref:ae,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==L||L(t),re(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color: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===(r=ke[0])||void 0===r?void 0:r.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:we,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(R),style:o({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"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,i=n===ie;return K?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:K(t,{selected:o,focused:i,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:i?"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)]})};Y.displayName="Select";var X=t.createContext(null),G=t.forwardRef(function(n,i){var a=n.initialValues,s=void 0===a?{}:a,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,C=n.children,w=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=w[0],k=w[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},[]),E=t.useCallback(function(e,t){k(function(n){var i=o({},n);if(i[e]?i[e]=o(o({},i[e]),{value:t}):i[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},d){var r={};r[e]=t;var l={};Object.keys(i).forEach(function(e){l[e]=i[e].value}),d(r,l)}return i})},[d]),A=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{error:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{error:t}):i[e]={value:void 0,error:t,touched:!1,validating:!1},i})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),D=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{touched:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{touched:t}):i[e]={value:void 0,error:void 0,touched:t,validating:!1},i})},[]),M=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]=o(o({},j.current[e]),{validating:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{validating:t}):i[e]={value:void 0,error:void 0,touched:!1,validating:t},i})},[]),T=t.useRef();T.current=function(e,t){k(function(n){if(n[e]){var i=n[e].rules||[],r=t.rules||[],l=i.length===r.length;if(l&&i.length>0)for(var a=0;a<i.length;a++){var d=i[a],c=r[a];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)){l=!1;break}}if(l&&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 W=t.useCallback(function(e,t){var n;null===(n=T.current)||void 0===n||n.call(T,e,t)},[]),I=t.useCallback(function(e){k(function(t){var n=o({},t);return delete n[e],n})},[]),N=t.useCallback(function(e){return r(void 0,void 0,void 0,function(){var t,n,i,r,a,s,d,c,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];B(e,!0),n=t.rules||[],r=0,a=n,l.label=1;case 1:if(!(r<a.length))return[3,6];if(s=a[r],d=t.value,s.required&&(null==d||""===d))return i=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 i=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 i=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 i=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 i=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 i=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof d&&d.trim()!==d)return i=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,d)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),i=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return j.current[e]?j.current[e]=o(o({},j.current[e]),{error:i,validating:!1,touched:!0}):j.current[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var r=o({},n);return r[e]?r[e]=o(o({},r[e]),{error:i,validating:!1,touched:!0}):r[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,i]}})})},[]),R=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 r(void 0,void 0,void 0,function(){var t,n,o,i;return l(this,function(a){switch(a.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return r(void 0,void 0,void 0,function(){var n,o;return l(this,function(i){switch(i.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return o=i.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return a.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(a.sent(),o.length>0)throw i={values:R(),errorFields:o},null==u||u(i),i;return[2,R()]}})})},[N,R,u]),O=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]),P=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}}),d){var i={};Object.keys(n).forEach(function(e){i[e]=n[e].value}),d(e,i)}return n})},[d]),V=t.useCallback(function(){return r(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,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(i,function(){return{getFieldValue:S,getFieldsValue:R,setFieldValue:E,setFieldsValue:P,getFieldError:A,validateField:N,validateFields:H,resetFields:O,submit:V}});var q=t.useMemo(function(){return{fields:F,getFieldValue:S,setFieldValue:E,getFieldError:A,setFieldError:z,isFieldTouched:L,setFieldTouched:D,isFieldValidating:M,setFieldValidating:B,registerField:W,unregisterField:I,validateField:N,validateFields:H,resetFields:O,getFieldsValue:R,setFieldsValue:P,submit:V,labelWidth:f,labelAlign:x}},[F,S,E,A,z,L,D,M,B,W,I,N,H,O,R,P,V,f,x]),Z=o({},b);return"vertical"===v?(Z.display="flex",Z.flexDirection="column"):"inline"===v&&(Z.display="inline-flex",Z.flexWrap="wrap",Z.gap="16px"),e.jsx(X.Provider,{value:q,children:e.jsx("form",{className:"aha-form ".concat(y),style:Z,onSubmit:function(e){return r(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,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:C})})});G.displayName="Form";var _=G;_.Item=function(n){var i=n.name,r=n.label,l=n.htmlFor;n.labelCol,n.wrapperCol;var a=n.required,s=void 0!==a&&a,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,C=t.useContext(X),w=t.useRef(null),F=(null==C?void 0:C.fields)||{};i&&C&&C.getFieldValue(i);var k=i&&C?C.getFieldError(i):void 0,j=!(!i||!C)&&C.isFieldTouched(i),S=!(!i||!C)&&C.isFieldValidating(i);i&&F[i];var E=u||(k?"error":S?"validating":j&&!k?"success":void 0),A=void 0!==p?p:k||void 0,z=t.useRef(c),L=t.useRef(s),D=t.useRef(!1),M=s||c.some(function(e){return e.required}),B=t.useMemo(function(){if(!D.current)return D.current=!0,!0;if(z.current.length!==c.length)return!0;if(z.current===c)return!1;for(var e=0;e<c.length;e++){var t=z.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(i&&C)return(!z.current||B||L.current!==s)&&(z.current=c,L.current=s,C.registerField(i,{rules:c,required:M})),function(){i&&C&&C.unregisterField(i)}},[i]);if(y)return null;return e.jsxs("div",{ref:w,className:"aha-form-item ".concat(x),style:o({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[r&&e.jsxs("label",{htmlFor:l,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[r,M&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,i=t.useState(!1),r=i[0],l=i[1],a=t.useRef(null);return t.useEffect(function(){var e=function(e){a.current&&!a.current.contains(e.target)&&l(!1)};if(r)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),l(!r)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(I,{})}),r&&e.jsxs("div",{ref:a,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,r,l,a,s,d,c,u,p;if(!t.isValidElement(e))return e;var f=o({},e.props);if(i&&C){var h=C.getFieldValue(i),x=C.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===(r=e.props)||void 0===r?void 0:r.onBlur;f.onChange=function(e){x(i,e.target.value),null==v||v(e),i&&C&&setTimeout(function(){C.validateField(i)},0)},f.onBlur=function(e){i&&C&&(C.setFieldTouched(i,!0),C.validateField(i)),null==m||m(e)},f.error="error"===E}else if("Select"===g){f.value=h;var y=null===(l=e.props)||void 0===l?void 0:l.onChange,b=null===(a=e.props)||void 0===a?void 0:a.onBlur;f.onChange=function(e,t){x(i,e),null==y||y(e,t),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},0))},f.onBlur=function(e){i&&C&&(C.setFieldTouched(i,!0),C.validateField(i)),null==b||b(e)},f.error="error"===E}else if("Switch"===g){f.checked=h||!1;var w=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(i,e),null==w||w(e,t),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,e.target.checked),null==F||F(e),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,k),null==j||j(e),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,o),null==S||S(e)}}}return"error"===E&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),A&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===E?"#D92D20":"warning"===E?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:A}),f&&!A&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})};var U=function(n){var i=n.items,r=void 0===i?[]:i,l=n.userProfile,s=n.selectedKeys,d=n.defaultSelectedKeys,u=void 0===d?[]:d,p=n.onSelect,f=n.onDeselect,h=n.className,x=void 0===h?"":h,g=n.style,v=n.width,m=void 0===v?320:v;c().primaryColor;var y=t.useRef(null),b=t.useRef({}),C=void 0!==s,w=t.useState(u),F=w[0],k=w[1],j=C?s:F,S=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,i=t;o<i.length;o++){var r=i[o];if(S(r)){var l=E(e,r.children,n);if(l)return l}else{var s=r,d=a(a([],n,!0),[s.key],!1);if(s.key===e)return d}}return null},[]),A=t.useCallback(function(e){var t;if(!e.disabled){var n,o=E(e.key,r)||[e.key];j.includes(e.key)?(n=j.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||k(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o})}},[j,C,p,f,r,E]),z=function(t){var n=j.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var i=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){b.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:i,onClick:function(){return A(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 m?"".concat(m,"px"):m,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"},g),D=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!S(o)||!(!S(n)||S(o))};return e.jsxs("div",{ref:y,className:"aha-menu-list ".concat(x),style:L,children:[l&&(l?l.render?l.render(l):e.jsx("div",{onClick:l.onClick,style:{padding:"16px",cursor:l.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:[l.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 l.name?l.name.charAt(0).toUpperCase():"U"}),void 0!==l.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:l.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:l.name}),l.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.email})]})]})}):null),e.jsx("div",{children:r.map(function(n,o){return e.jsxs(t.Fragment,{children:[D(o,r)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),S(n)?(i=n,e.jsx("div",{className:"aha-menu-group ".concat(i.className||""),children:i.children.map(function(e){return z(e)})},"group-".concat(i.title))):z(n)]},o);var i})})]})};U.displayName="MenuList";var Q=function(e,t,n,o){void 0===o&&(o=6);var i=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,l=e.left+e.width/2,a=e.top+e.height/2,s=o+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+r,c=l-t.width/2+i;break;case"bottom":default:d=e.bottom+s+r,c=l-t.width/2+i;break;case"left":d=a-t.height/2+r,c=e.left-t.width-s+i;break;case"right":d=a-t.height/2+r,c=e.right+s+i;break;case"top-left":d=e.top-t.height-s+r,c=e.left+i;break;case"top-right":d=e.top-t.height-s+r,c=e.right-t.width+i;break;case"bottom-left":d=e.bottom+s+r,c=e.left+i;break;case"bottom-right":d=e.bottom+s+r,c=e.right-t.width+i}var u=window.innerWidth,p=window.innerHeight;return c<i+8?c=i+8:c+t.width>i+u-8&&(c=i+u-t.width-8),d<r+8?d=r+8:d+t.height>r+p-8&&(d=r+p-t.height-8),{top:d,left:c}},J=function(e,t,n,o){void 0===o&&(o=6);var i=Q(e,t,n,o),r=i.top,l=i.left,a=window.scrollX||window.pageXOffset,s=r-(window.scrollY||window.pageYOffset),d=l-a,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},$=function(t,n){var i=o({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:o(o({},i),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:r[t]})};exports.Alert=function(n){var o=n.className,i=void 0===o?"":o,r=n.type,l=void 0===r?"info":r,a=n.title,s=n.description,d=n.icon,c=void 0===d?h[l]: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),C=b[0],w=b[1];return C?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat(i),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[l],children:[p&&c,e.jsxs("div",{className:"flex flex-col gap-1",style:g?{paddingRight:"2rem"}:{},children:[a&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:a}),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(){w(!1),null==y||y()},children:x})]}):null},exports.Button=f,exports.CheckIcon=z,exports.Checkbox=R,exports.Form=_,exports.Input=q,exports.MenuList=U,exports.MinusIcon=L,exports.Pagination=N,exports.Progress=function(n){var r=n.percent,l=void 0===r?0:r,a=n.type,s=void 0===a?"circle":a,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,C=void 0===b?"":b,w=n.style,F=n.strokeColor,k=n.trailColor,j=void 0===k?"#F5F5F4":k,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),E=c().primaryColor,A=Math.min(100,Math.max(0,l)),z=t.useRef(!0),L=t.useState(!1),D=L[0],M=L[1],B=t.useState(0),T=B[0],W=B[1];t.useEffect(function(){if(v&&z.current&&A>0){z.current=!1,W(0),M(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){W(A)})});var e=setTimeout(function(){M(!1),W(A)},300);return function(){return clearTimeout(e)}}z.current?(z.current=!1,M(!1),W(A)):W(A)},[v,A]);var I=F||E||"#FB6011";"success"===y?I="#00BC7D":"exception"===y&&(I="#FB2C36");var N=f||"inside",R=Math.max(4,Math.round(.06*u)),H=(u-R)/2,O="semicircle"===s?u/2:u,P="14px",V="12px",q=function(){var t=p&&"outside"===N?u+4+18+4:u,n=2*Math.PI*H,o=n-(D?T:A)/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:R,strokeLinecap:"round"}),e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:I,strokeWidth:R,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(u/2," ").concat(u/2,")"),style:{transition:D?"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:P,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")})]}):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:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},Z=o({display:"inline-flex",flexDirection:"column",alignItems:"center",width:u},w);return e.jsx("div",o({className:"aha-progress aha-progress--".concat(s," ").concat(C),style:Z},S,{children:function(){switch(s){case"circle":return q();case"semicircle":return n=R/2,o=u-R/2,i=(t=O+R)-R/2,r=O/2+R/2+R/2,l=p&&"outside"===N?t+4+18+4:t,a=Math.PI*H,d=a-(D?T:A)/100*a,e.jsxs("div",{style:{position:"relative",width:u,height:l,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(i," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(i),fill:"none",stroke:j,strokeWidth:R,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(i," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(i),fill:"none",stroke:I,strokeWidth:R,strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:d,style:{transition:D?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),q()}var t,n,o,i,r,l,a,d}()}))},exports.Radio=V,exports.Select=Y,exports.Switch=K,exports.Tab=function(n){var r,l,a=n.items,s=void 0===a?[]:a,d=n.variant,u=void 0===d?"underline":d,p=n.layout,f=void 0===p?"equal":p,h=n.defaultValue,x=n.value,g=n.onChange,v=n.className,m=void 0===v?"":v,y=n.mode,b=void 0===y?"children":y,C=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode"]),w=c().primaryColor;if(!s||0===s.length)return null;var F=void 0!==x,k=x||h||(null===(r=s[0])||void 0===r?void 0:r.key)||"",j=t.useState(k),S=j[0],E=j[1],A=F?x||(null===(l=s[0])||void 0===l?void 0:l.key)||"":S,z=t.useCallback(function(e,t){t||(F||E(e),null==g||g(e))},[F,g]),L=s.find(function(e){return e.key===A}),D=w||"#FB6011",M=t.useRef({}),B=t.useRef(null),T=t.useRef(null),W=t.useRef(null),I=t.useRef(null),N=t.useState({width:0,left:0,opacity:0}),R=N[0],H=N[1],O=t.useState({width:0,left:0,opacity:0}),P=O[0],V=O[1];t.useEffect(function(){if("underline"===u&&B.current&&W.current){var e=setTimeout(function(){var e=M.current[A];if(e){var t=W.current.getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.left-t.left,i=n.width;H({width:"".concat(i,"px"),left:"".concat(o,"px"),opacity:1})}},0);return function(){return clearTimeout(e)}}if("background"===u&&T.current&&I.current){var t=setTimeout(function(){var e=M.current[A];if(e){var t=I.current.getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.left-t.left,i=n.width;V({width:"".concat(i,"px"),left:"".concat(o,"px"),opacity:1})}},0);return function(){return clearTimeout(t)}}},[A,u]);var q;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===u?e.jsxs("div",o({ref:W,className:"aha-tab aha-tab--underline ".concat(m),style:{display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"}},C,{children:[e.jsx("div",{ref:B,style:o({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:D,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"},R)}),s.map(function(n){var i,r=n.key===A;return e.jsxs("div",{ref:function(e){M.current[n.key]=e},onClick:function(){return z(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"},children:[n.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?D:"#79716B",transition:"color 0.2s ease-in-out"},children:t.isValidElement(n.icon)?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?D:"#79716B",transition:"color 0.2s ease-in-out"})}):n.icon}),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?D:"#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)})]})):(q={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"},q.width="equal"===f?"100%":"fit-content",e.jsxs("div",o({ref:I,className:"aha-tab aha-tab--background aha-tab--".concat(f," ").concat(m),style:q},C,{children:[e.jsx("div",{ref:T,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"},P)}),s.map(function(n){var i,r=n.key===A,l={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"===f?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){M.current[n.key]=e},onClick:function(){return z(n.key,n.disabled)},style:l,children:[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.isValidElement(n.icon)?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"})}):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)})]}))),"children"===b&&(null==L?void 0:L.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:L.children})]})},exports.Table=function(n){var r,l,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,C=n.bordered,w=void 0!==C&&C;n.loading;var F=n.locale,k=n.showHeader,j=void 0===k||k,S=n.title,E=n.footer,A=n.summary,z=n.scroll,L=n.tableLayout,D=void 0===L?"auto":L,M=n.onChange,B=n.onSorterChange,T=n.onPaginationChange,W=n.onRow,I=n.className,V=void 0===I?"":I,q=n.style,Z=n.expandable,K=n.rowClassName,Y=n.onHeaderRow;n.sticky;var X=i(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)||[]),_=G[0],U=G[1];t.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&U(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var Q=t.useState(new Map),J=Q[0],$=Q[1],ee=t.useState((null==Z?void 0:Z.defaultExpandedRowKeys)||[]),te=ee[0],ne=ee[1],oe=t.useState(m&&"object"==typeof m&&(m.current||m.defaultCurrent)||1),ie=oe[0],re=oe[1],le=t.useState(m&&"object"==typeof m&&(m.pageSize||m.defaultPageSize)||10),ae=le[0],se=le[1];t.useEffect(function(){m&&"object"==typeof m&&(void 0!==m.current&&re(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,o,i,r=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==r?void 0:r.disabled)){var l,s=O(e,x);l="radio"===(null==g?void 0:g.type)?t?[s]:[]:t?a(a([],_,!0),[s],!1):_.filter(function(e){return e!==s}),U(l);var d=f.filter(function(e){return l.includes(O(e,x))});null===(o=null==g?void 0:g.onChange)||void 0===o||o.call(g,l,d),null===(i=null==g?void 0:g.onSelect)||void 0===i||i.call(g,e,t,d,new Event("select"))}},[_,x,g,f]),Ce=t.useCallback(function(e,t){var n,o,i=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 O(e,x)}),r=e?i:[];U(r);var l=f.filter(function(e){return r.includes(O(e,x))}),a=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,r,l),null===(o=null==g?void 0:g.onSelectAll)||void 0===o||o.call(g,e,l,a)},[x,g,f]),we=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(J);null===t?o.delete(n):o.set(n,t),$(o);var i=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}}),r={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(r),B&&B(1===i.length?i[0]:i),M&&M({current:ie,pageSize:ae},{},1===i.length?i[0]:i,{currentDataSource:f,action:"sort"})}},[J,M,B,ie,ae,f,u]);t.useCallback(function(e,t){var n,o,i,r=O(e,x);i=t?a(a([],te,!0),[r],!1):te.filter(function(e){return e!==r}),ne(i),null===(n=null==Z?void 0:Z.onExpand)||void 0===n||n.call(Z,t,e),null===(o=null==Z?void 0:Z.onExpandedRowsChange)||void 0===o||o.call(Z,i)},[te,x,Z]);var Fe=t.useCallback(function(){var e=a([],f,!0);return J.size>0&&e.sort(function(e,t){for(var n=function(n,o){var i=u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!i)return"continue";var r=0;if("function"==typeof i.sorter)r=i.sorter(e,t);else if(!0===i.sorter){var l=H(e,i.dataIndex||n),a=H(t,i.dataIndex||n);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===o?r:-r}:void 0},o=0,i=Array.from(J.entries());o<i.length;o++){var r=i[o],l=n(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[f,J,u]),ke=Fe(),je=t.useMemo(function(){if(!1===m||!m)return ke;var e=(ie-1)*ae,t=e+ae;return ke.slice(e,t)},[ke,ie,ae,m]),Se=t.useCallback(function(e,t){var n,o,i=null!=t?t:ae;if(re(e),t&&se(t),T&&T(e,i),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))),M){var r=Array.from(J.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}});M({current:e,pageSize:i},{},1===r.length?r[0]:r,{currentDataSource:ke,action:"paginate"})}},[m,T,M,ae,J,u,ke]),Ee=t.useCallback(function(e,t,n){var o=H(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ae=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,i=0;if("left"===o){if(g&&("left"===g.fixed||!0===g.fixed))i+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=u[r]).fixed||!0===l.fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return i}if("right"===o){for(r=e+1;r<u.length;r++){var l;if("right"===(l=u[r]).fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(g&&"right"===g.fixed)i+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return i}}},[u,g]),ze=t.useCallback(function(){if(!j)return null;var t,n,i,r,l=u.map(function(t,n){var i,r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,l=J.get(r)||null,a=Ae(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!==a?"".concat(a,"px"):"0":void 0,right:"right"===t.fixed?void 0!==a?"".concat(a,"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===(i=t.onHeaderCell)||void 0===i?void 0:i.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:l,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){we(t,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:e.jsx(P,{order:l||void 0})})]})}),r)});if(g){var a="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",s=e.jsx("th",{style:{width:a,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 O(e,x)}),i=t.length>0&&n.every(function(e){return _.includes(e)}),r=n.some(function(e){return _.includes(e)}),e.jsx(R,{checked:i,indeterminate:r&&!i,onChange:function(e){return Ce(e.target.checked,je)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");l.unshift(s)}var d=null==Y?void 0:Y(u,0);return e.jsx("thead",{ref:ye,children:e.jsx("tr",o({},d||{},{children:l}))})},[u,j,J,g,_,je,x,we,Ce,F,Y,Ae]),Le=t.useCallback(function(e){ue(e)},[]),De=t.useCallback(function(e,t){e.preventDefault(),he(t)},[]),Me=t.useCallback(function(e,t){if(e.preventDefault(),null===ce||ce===t)return ue(null),void he(null);var n=a([],je,!0),o=n[ce];n.splice(ce,1),n.splice(t,0,o),ue(null),he(null)},[ce,je]),Be=t.useCallback(function(){ue(null),he(null)},[]),Te=t.useCallback(function(){return je.map(function(n,i){var r,l=O(n,x),a=_.includes(l),s=te.includes(l),d=(null==W?void 0:W(n,i))||{},c=i===je.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",o({className:"".concat("function"==typeof K?K(n,i):K||""," ").concat(ce===i?"dragging":""," ").concat(fe===i?"drag-over":""),draggable:!0,onDragStart:function(){return Le(i)},onDragOver:function(e){return De(e,i)},onDrop:function(e){return Me(e,i)},onDragEnd:Be,style:o({cursor:"move",opacity:ce===i?.5:1,backgroundColor:fe===i?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ce!==i&&fe!==i&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ce!==i&&fe!==i&&(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(R,{checked:a,onChange:function(e){return be(n,e.target.checked)},disabled:null===(r=g.getCheckboxProps)||void 0===r?void 0:r.call(g,n).disabled})})}),u.map(function(t,r){var l,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||r,s=(null===(l=t.onCell)||void 0===l?void 0:l.call(t,n,i))||{},d=Ae(r,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!==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:Ee(t,n,i)}),a)})]})),(null==Z?void 0:Z.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:Z.expandedRowRender(n,i,0,!0)})})]},l)})},[je,x,_,te,g,u,W,K,be,Ee,Z,ce,fe,Le,De,Me,Be,Ae]),We=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(N,{current:ie,total:n,pageSize:ae,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"})})},Ie=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]),Re=t.useMemo(function(){if(null==z?void 0:z.x){if("number"==typeof z.x)return z.x;if(!0===z.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(Ie)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==z?void 0:z.x,g,Ie]),He=t.useMemo(function(){return"fixed"===D||Ie||Ne||u.some(function(e){return e.width})?"fixed":D},[D,Ie,Ne,u]),Oe={width:"100%",minWidth:Re?"".concat(Re,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:He,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Pe=o({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"},q);if(ge)return e.jsxs("div",o({ref:me,className:"aha-table aha-table-mobile-wrapper ".concat(V),style:Pe},X,{children:[S&&e.jsx("div",{style:{marginBottom:"16px"},children:S(ke)}),m&&"object"==typeof m&&(null===(r=m.position)||void 0===r?void 0:r.startsWith("top"))&&We(),e.jsx("div",{className:"aha-table-mobile",children:je.map(function(t,n){var o,i=O(t,x),r=_.includes(i);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(r?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:r?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(R,{checked:r,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 i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),r=H(t,o.dataIndex||""),l=o.render?o.render(r,t,n):r;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(ke)}),m&&("object"!=typeof m||!(null===(l=m.position)||void 0===l?void 0:l.startsWith("top")))&&We()]}));var Ve={position:"relative",overflowX:(null==z?void 0:z.x)||Ie?"auto":"visible",overflowY:(null==z?void 0:z.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==z?void 0:z.x)?"100%":"number"==typeof(null==z?void 0:z.x)?"".concat(z.x,"px"):void 0,maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",o({ref:me,className:"aha-table ".concat(V),style:Pe},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"))&&We(),e.jsx("div",{style:Ve,children:e.jsx("div",{style:{width:"100%",minWidth:Re?"".concat(Re,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Oe,className:w?"bordered":"",children:[ze(),e.jsx("tbody",{children:Te()}),A&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:A(ke)})})})]})})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(ke)}),m&&("object"!=typeof m||!(null===(d=m.position)||void 0===d?void 0:d.startsWith("top")))&&We()]}))},exports.Tag=function(n){var r=n.children,l=n.color,a=n.variant,s=void 0===a?"light":a,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=i(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),C=c().primaryColor,w=function(e,t){if("string"==typeof e&&e in E){var n=E[e];return"Orange"===e&&t?o(o({},n),{fill:o(o({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var i=e.replace("#",""),r=parseInt(i.substr(0,2),16),l=parseInt(i.substr(2,2),16),a=parseInt(i.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(l,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(l,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Green}(l,C),F=A[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=w.light.bg,k.color=w.light.text,f&&(k.outline="1px solid",k.outlineOffset="-1px",k.outlineColor=function(e){if("string"==typeof e&&e in E)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),i=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(i,", 0.3)")}return"#A4F4CF"}(l))),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=w.fill.bg,k.color=w.fill.text),y&&j.push("cursor-pointer","hover:opacity-80"),m&&j.push(m);var S=j.join(" "),z=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in E)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"}(l,C),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&&z(),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:r})}),"after"===g&&z()]}))},exports.Textarea=Z,exports.ThemeProvider=function(n){var i=n.theme,r=n.children,l=t.useMemo(function(){return o(o({},s),i)},[i]);return e.jsx(d.Provider,{value:l,children:r})},exports.Toast=function(t){return e.jsx(C,{id:"direct",props:t})},exports.ToastProvider=function(o){var i=o.children,r=t.useState(!1),l=r[0],a=r[1];return t.useEffect(function(){a(!0)},[]),e.jsxs(e.Fragment,{children:[i,l&&n.createPortal(e.jsx(b,{}),document.body)]})},exports.Tooltip=function(i){var r=i.content,l=i.children,a=i.position,s=void 0===a?"top":a,d=i.trigger,c=void 0===d?"hover":d,u=i.delay,p=void 0===u?200:u,f=i.disabled,h=void 0!==f&&f,x=i.className,g=void 0===x?"":x,v=i.tooltipClassName,m=void 0===v?"":v,y=i.gap,b=void 0===y?6:y,C=i.showArrow,w=void 0===C||C,F=i.width,k=t.useState(!1),j=k[0],S=k[1],E=t.useState(!1),A=E[0],z=E[1],L=t.useState(s),D=L[0],M=L[1],B=t.useState("200px"),T=B[0],W=B[1],I=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===c?"auto":"none"}),N=I[0],R=I[1],H=t.useState({}),O=H[0],P=H[1],V=t.useRef(null),q=t.useRef(null),Z=t.useRef(null),K=t.useRef(null),Y=t.useCallback(function(){if(V.current&&q.current&&j&&A){var e=V.current.getBoundingClientRect(),t=q.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!J(e,t,n,o))return n;for(var i=0,r=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);i<r.length;i++){var l=r[i];if(!J(e,t,l,o))return l}return n}(e,t,s,b);M(n);var i=Q(e,t,n,b),r=i.top,l=i.left;if(R(function(e){return o(o({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(l,"px"),pointerEvents:"hover"===c?"auto":"none",zIndex:9999})}),w){var a=function(e,t,n,o,i){var r=window.scrollX||window.pageXOffset,l=window.scrollY||window.pageYOffset,a=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,d=o-r,c=i-l;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(a-d,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(a-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,l,r);P(a)}}},[j,s,b,w,A,c]),X=t.useCallback(function(){h||(K.current&&(clearTimeout(K.current),K.current=null),Z.current&&clearTimeout(Z.current),Z.current=setTimeout(function(){S(!0),requestAnimationFrame(function(){z(!0)})},p))},[h,p]),G=t.useCallback(function(){Z.current&&(clearTimeout(Z.current),Z.current=null),K.current&&clearTimeout(K.current),z(!1),K.current=setTimeout(function(){S(!1),K.current=null},150)},[]),_=t.useCallback(function(){"hover"===c&&(K.current&&(clearTimeout(K.current),K.current=null),j||(S(!0),requestAnimationFrame(function(){z(!0)})))},[c,j]),U=t.useCallback(function(e){h||"click"!==c||(e.stopPropagation(),j?G():(Z.current&&(clearTimeout(Z.current),Z.current=null),S(!0),requestAnimationFrame(function(){z(!0)})))},[h,c,j,G]);t.useEffect(function(){if(j)return requestAnimationFrame(function(){Y()}),window.addEventListener("scroll",Y,!0),window.addEventListener("resize",Y),function(){window.removeEventListener("scroll",Y,!0),window.removeEventListener("resize",Y)}},[j,Y]),t.useEffect(function(){if(j&&"click"===c){var e=function(e){V.current&&q.current&&!V.current.contains(e.target)&&!q.current.contains(e.target)&&G()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[j,c,G]),t.useEffect(function(){return function(){Z.current&&clearTimeout(Z.current),K.current&&clearTimeout(K.current)}},[]);var ee={position:"absolute",top:0,left:0,opacity:A?1:0,transform:A?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===c?"auto":"none",zIndex:9999},te=t.useCallback(function(){if("undefined"==typeof window)return"200px";var e=window.innerWidth;return"".concat(e<768?Math.max(120,e-32):200,"px")},[]);t.useEffect(function(){var e=function(){W(te())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[te]);var ne=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:"number"==typeof F?"".concat(F,"px"):F}:{maxWidth:T,minWidth:"120px",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"}),oe=e.jsxs("div",{style:o(o(o({},ee),N),{pointerEvents:"hover"===c?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===c?_:void 0,onMouseLeave:"hover"===c?G:void 0,children:[e.jsx("div",{ref:q,className:"aha-tooltip ".concat(m),style:ne,role:"tooltip",children:r}),w&&$(D,O)]}),ie=t.useCallback(function(){"hover"===c&&(K.current=setTimeout(function(){G()},100))},[c,G]),re="click"===c?{onClick:U}:{onMouseEnter:X,onMouseLeave:ie,onFocus:X,onBlur:G};return e.jsxs(e.Fragment,{children:[e.jsx("div",o({ref:V,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===c?"pointer":"default"}},re,{children:l})),j&&"undefined"!=typeof document&&n.createPortal(oe,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=w,exports.toastError=function(e,t){return S(),w(o(o({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return S(),w(o(o({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return S(),w(o(o({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return S(),w(o(o({},t),{message:e,type:"success"}))},exports.useTheme=c;
|
|
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 i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},o.apply(this,arguments)};function i(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}function r(e,t,n,o){return new(n||(n=Promise))(function(i,r){function l(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(l,a)}s((o=o.apply(e,t||[])).next())})}function l(e,t){var n,o,i,r={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return l.next=a(0),l.throw=a(1),l.return=a(2),"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l;function a(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,a[0]&&(r=0)),r;)try{if(n=1,o&&(i=2&a[0]?o.return:a[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;switch(o=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(i=r.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(6===a[0]&&r.label<i[1]){r.label=i[1],i=a;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(a);break}i[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}}function a(e,t,n){if(n||2===arguments.length)for(var o,i=0,r=t.length;i<r;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||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,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 r,l=n.children,a=n.type,s=void 0===a?"default":a,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,C=n.className,w=void 0===C?"":C,F=n.style,k=n.icon,j=n.iconPosition,S=void 0===j?"left":j,E=i(n,["children","type","size","disabled","loading","onClick","htmlType","className","style","icon","iconPosition"]),A=c().primaryColor,z=void 0===A?"#FB6011":A,L=t.useState(!1),D=L[0],M=L[1],B=t.useState(!1),T=B[0],W=B[1],I=u[f],N=x||v,R=function(){if(v){var t="primary"===s?"#FFFFFF":"#101828",n=parseInt(I.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:I.iconSize,height:I.iconSize,flexShrink:0},children:k}):null},H=(r=o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:I.gap,height:I.height,paddingLeft:I.paddingLeft,paddingRight:I.paddingRight,fontSize:I.fontSize,lineHeight:I.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?(r.color="#FFFFFF",r.backgroundColor=z,x?(r.opacity=.4,r.cursor="not-allowed"):v?r.backgroundColor=z:T?r.backgroundColor="#EC470A":D&&(r.backgroundColor="#FD843A")):x?(r.backgroundColor="#FAFAF9",r.color="#D6D3D1",r.border="1px solid #E7E5E4"):v?(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):T?(r.backgroundColor="#F5F5F4",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"):D?(r.backgroundColor="#FAFAF9",r.color="#101828",r.border="1px solid #D7D3D0",r.boxShadow="0px 2px 4px 0px rgba(12, 10, 9, 0.08)"):(r.backgroundColor="#FFFFFF",r.color="#101828",r.border="1px solid #E7E5E4",r.boxShadow="0px 1px 2px 0px rgba(12, 10, 9, 0.05)"),r);return e.jsxs("button",o({type:b,className:"aha-button aha-button--".concat(s," aha-button--").concat(f," ").concat(N?"aha-button--disabled":""," ").concat(v?"aha-button--loading":""," ").concat(w),disabled:N,onClick:function(e){N?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!N&&M(!0)},onMouseLeave:function(){M(!1),W(!1)},onMouseDown:function(){return!N&&W(!0)},onMouseUp:function(){return W(!1)},style:H},E,{children:[v&&R(),!v&&"left"===S&&R(),l&&e.jsx("span",{style:{display:"inline-block"},children:l}),!v&&"right"===S&&R()]}))};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 a([],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([]),i=n[0],r=n[1];t.useEffect(function(){console.log("Toast: ToastContainer 组件已挂载");var e=y.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),r(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})),r(e)});return t},[]);var l=i.filter(function(e){return"top-left"===e.props.position}),a=i.filter(function(e){return"top-right"===e.props.position}),s=i.filter(function(e){return"bottom-left"===e.props.position}),d=i.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:l.map(function(t){return e.jsx(C,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:a.map(function(t){return e.jsx(C,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(C,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:d.map(function(t){return e.jsx(C,o({},t),t.id)})})]})},C=function(n){var o=n.id,i=n.props,r=t.useState(!1),l=r[0],a=r[1],s=t.useState(!1),d=s[0],c=s[1],u=i.message,p=i.type,f=void 0===p?"info":p,h=i.duration,x=void 0===h?3e3:h,m=i.icon,b=i.action,C=i.showClose,w=void 0===C||C,F=i.onClose,k=i.onClick;i.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(){a(!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(){c(!0),setTimeout(function(){y.removeToast(o),null==F||F()},300)},[o,F]),E=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:l&&!d?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:l&&!d?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:E,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})]}),w&&e.jsx("button",{onClick:function(e){e.stopPropagation(),S()},style:{flexShrink:0,width:"20px",height:"20px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",transition:"all 200ms",position:"absolute",top:"14px",right:"16px",background:"transparent",border:"none",cursor:"pointer",color:"white"},onMouseEnter:function(e){e.currentTarget.style.background="rgba(255, 255, 255, 0.1)"},onMouseLeave:function(e){e.currentTarget.style.background="transparent"},children:e.jsx(v,{})})]})})},w=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 组件")},E={Green:{light:{bg:"#ECFDF5",text:"#006045",border:"#A4F4CF"},fill:{bg:"#00BC7D",text:"#FFFFFF"}},Red:{light:{bg:"#FEF2F2",text:"#9F0712",border:"#FFC9C9"},fill:{bg:"#FB2C36",text:"#FFFFFF"}},Orange:{light:{bg:"#FFF6ED",text:"#9B2911",border:"#FFD1A9"},fill:{bg:"#FB6011",text:"#FFFFFF"}},Cyan:{light:{bg:"#ECFEFF",text:"#005F78",border:"#A2F4FD"},fill:{bg:"#00B8DB",text:"#FFFFFF"}},Violet:{light:{bg:"#F5F3FF",text:"#5D0EC0",border:"#DDD6FF"},fill:{bg:"#8E51FF",text:"#FFFFFF"}},Pink:{light:{bg:"#FDF2F8",text:"#A3004C",border:"#FCCEE8"},fill:{bg:"#F6339A",text:"#FFFFFF"}},Gray:{light:{bg:"#F5F5F4",text:"#292524",border:"#E7E5E4"},fill:{bg:"#292524",text:"#FFFFFF"}},Yellow:{light:{bg:"#FFFBEB",text:"#973C00",border:"#FEE685"},fill:{bg:"#FE9A00",text:"#FFFFFF"}},Blue:{light:{bg:"#EFF6FF",text:"#193CB8",border:"#BEDBFF"},fill:{bg:"#2B7FFF",text:"#FFFFFF"}}},A={large:{padding:"px-2 py-0.5",textSize:"text-sm",iconSize:"w-4 h-4",gap:"gap-1"},small:{padding:"px-2 py-0.5",textSize:"text-xs",iconSize:"w-3 h-3",gap:"gap-0.5"}},z=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"})})},L=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"})})},D=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"})})},M=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"})]})},B=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"})]})},T=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"})})},W=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"})})},I=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"})})})]})},N=function(n){var i=n.current,r=n.defaultCurrent,l=void 0===r?1:r,a=n.total,s=void 0===a?0:a,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,C=n.onChange,w=n.onShowSizeChange,F=n.simple,k=void 0!==F&&F,j=n.disabled,S=void 0!==j&&j,E=n.hideOnSinglePage,A=void 0!==E&&E,z=n.className,L=void 0===z?"":z,D=n.style,M=n.size,B=void 0===M?"default":M,I=n.responsive,N=void 0!==I&&I;n.showLessItems;var R=n.itemRender,H=c().primaryColor,O=void 0===H?"#FB6011":H,P=t.useState(l),V=P[0],q=P[1],Z=t.useState(p),K=Z[0],Y=Z[1],X=t.useState(""),G=X[0],_=X[1],U=null!=i?i:V,Q=null!=d?d:K,J=t.useMemo(function(){return Math.ceil(s/Q)},[s,Q]);t.useEffect(function(){void 0!==i&&q(i)},[i]),t.useEffect(function(){void 0!==d&&Y(d)},[d]);var $=function(e){e<1||e>J||e===U||S||(void 0===i&&q(e),null==C||C(e,Q))},ee=function(){var e=parseInt(G,10);e>=1&&e<=J&&($(e),_(""))};if(A&&J<=1)return null;if(k)return e.jsxs("div",{className:"aha-pagination aha-pagination-simple ".concat(L),style:D,children:[e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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:[U," / ",J]}),e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,type:"default",size:"default"===B?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"下一页"})]});var te=(U-1)*Q+1,ne=Math.min(U*Q,s);return e.jsxs("div",{className:"aha-pagination w-full ".concat(L),style:o({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:N?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},D),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:[R?R(U-1,"prev",e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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(T,{})," ",e.jsx("span",{children:"Previous"})]})})):e.jsx(f,{onClick:function(){return $(U-1)},disabled:S||1===U,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(T,{})," ",e.jsx("span",{children:"Previous"})]})}),e.jsx("div",{style:{display:"flex",alignItems:"center",gap:0},children:function(){if(J<=7)return Array.from({length:J},function(e,t){return t+1});var e=[];if(U<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(J)}else if(U>=J-3){e.push(1),e.push("jump-prev");for(t=J-4;t<=J;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=U-1;t<=U+1;t++)e.push(t);e.push("jump-next"),e.push(J)}return e}().map(function(t,n){return function(t){if("number"==typeof t){var n=t===U,o=e.jsx(f,{onClick:function(){return $(t)},disabled:S,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?O:"#79716B",boxShadow:"none",borderRadius:"8px"},children:t},t);return R?R(t,"page",o):o}if("jump-prev"===t)return o=e.jsx(f,{onClick:function(){return $(Math.max(1,U-5))},disabled:S,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"),R?R(U-5,"jump-prev",o):o;if("jump-next"===t)return o=e.jsx(f,{onClick:function(){return $(Math.min(J,U+5))},disabled:S,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"),R?R(U+5,"jump-next",o):o;return null}(t)})}),R?R(U+1,"next",e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,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(W,{})]})})):e.jsx(f,{onClick:function(){return $(U+1)},disabled:S||U===J,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(W,{})]})}),x&&e.jsx("select",{value:Q,onChange:function(e){return t=Number(e.target.value),n=Math.ceil(s/t),o=U>n?n:U,void 0===d&&Y(t),void 0===i&&q(o),null==w||w(o,t),void(null==C||C(o,t));var t,n,o},disabled:S,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:S?"not-allowed":"pointer",backgroundColor:"white",outline:"none",transition:"all 0.2s"},onMouseEnter:function(e){S||(e.currentTarget.style.borderColor=O)},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 _(e.target.value)},onKeyPress:function(e){return"Enter"===e.key&&ee()},disabled:S,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=O},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"===B?"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"===B?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"确定"})]})]})]})},R=function(t){var n=t.checked,i=void 0!==n&&n,r=t.indeterminate,l=void 0!==r&&r,a=t.disabled,s=void 0!==a&&a,d=t.onChange,u=t.className,p=void 0===u?"":u,f=t.style,h=t.children,x=c().primaryColor,g=i||l,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==d||d({target:{checked:!i},currentTarget:{checked:!i}}))},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:l?e.jsx(L,{style:{width:"14px",height:"14px",display:"block"}}):e.jsx(z,{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:i,ref:function(e){e&&(e.indeterminate=l)},onChange:d,disabled:s,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};R.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)},O=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:""},P=function(t){var n=t.order,o=c().primaryColor;return"ascend"===n?e.jsx(B,{style:{color:o}}):"descend"===n?e.jsx(M,{style:{color:o}}):e.jsx(D,{})},V=function(t){var n=t.checked,i=void 0!==n&&n,r=t.disabled,l=void 0!==r&&r,a=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=l?"#FAFAF9":i?g:"white",m=l?"#FAFAF9":i?g:"#D7D3D0";return e.jsxs("div",{className:"aha-radio ".concat(d),style:o({display:"inline-flex",alignItems:"center",gap:"8px",cursor:l?"not-allowed":"pointer"},u),onClick:function(e){l||(null==a||a({target:{checked:!i,value:f},currentTarget:{checked:!i,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:i?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),p&&e.jsx("span",{style:{fontSize:"14px",lineHeight:"20px",color:l?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:p}),e.jsx("input",{type:"radio",checked:i,onChange:a,disabled:l,value:f,name:h,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};V.displayName="Radio";var q=t.forwardRef(function(n,r){var l=n.size,a=void 0===l?"medium":l,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,C=void 0===b?"":b,w=n.style,F=n.type,k=void 0===F?"text":F,j=n.placeholder,S=n.value,E=n.defaultValue,A=n.onChange,z=n.onFocus,L=n.onBlur,D=n.onPressEnter,M=i(n,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),B=c().primaryColor,T=void 0===B?"#FB6011":B,W=t.useRef(null),I=t.useState(E||S||""),N=I[0],R=I[1],H=t.useState(!1),O=H[0],P=H[1];t.useEffect(function(){"function"==typeof r?r(W.current):r&&(r.current=W.current)},[r]);var V=void 0!==S,q=V?S:N,Z=function(e){var t;e.stopPropagation(),V||R("");null==A||A({target:{value:""},currentTarget:{value:""}}),null==y||y(),null===(t=W.current)||void 0===t||t.focus()},K=m&&q&&!d,Y={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||K?"40px":"12px",G=o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(p?"#F04438":O?T:"#D7D3D0"),backgroundColor:d||h?"#FAFAF9":"#FFFFFF",color:d?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:X,paddingTop:Y[a].paddingTop,paddingBottom:Y[a].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},w);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(C),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",o({ref:W,type:k,value:q,placeholder:j,disabled:d,readOnly:h,onChange:function(e){V||R(e.target.value),null==A||A(e)},onFocus:function(e){P(!0),null==z||z(e)},onBlur:function(e){P(!1),null==L||L(e)},onKeyDown:function(e){var t;"Enter"===e.key&&D&&D(e),null===(t=M.onKeyDown)||void 0===t||t.call(M,e)},style:G,autoComplete:M.autoComplete||"off",autoCorrect:M.autoCorrect||"off",autoCapitalize:M.autoCapitalize||"off",spellCheck:M.spellCheck||!1},M)),(g||K)&&e.jsxs("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:d?"#98A2B3":"#78716C",zIndex:1},children:[K&&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:Z,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})]})]})]})});q.displayName="Input";var Z=t.forwardRef(function(n,r){var l=n.disabled,a=void 0!==l&&l,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,C=n.defaultValue,w=n.rows,F=void 0===w?3:w,k=n.autoSize,j=void 0!==k&&k,S=n.onChange,E=n.onFocus,A=n.onBlur,z=i(n,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),L=c().primaryColor,D=void 0===L?"#FB6011":L,M=t.useRef(null),B=t.useState(C||b||""),T=B[0],W=B[1],I=t.useState(!1),N=I[0],R=I[1],H=t.useState(void 0),O=H[0],P=H[1];t.useEffect(function(){"function"==typeof r?r(M.current):r&&(r.current=M.current)},[r]);var V=void 0!==b,q=V?b:T,Z=String(q||"").length;t.useEffect(function(){if(j&&M.current){var e=M.current,t="object"==typeof j&&j.minRows||1,n="object"==typeof j?j.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,i=parseInt(window.getComputedStyle(e).lineHeight||"22",10),r=t*i,l=n?n*i:void 0,a=Math.max(o,r);l&&(a=Math.min(a,l)),e.style.height="".concat(a,"px"),P(a)}},[q,j]);var K=o(o({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(d?"#F04438":N?D:"#D7D3D0"),backgroundColor:a||p?"#FAFAF9":"#FFFFFF",color:a?"#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:a?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==O&&j?{height:"".concat(O,"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:M,value:q,placeholder:y,disabled:a,readOnly:p,rows:j?void 0:F,maxLength:x,onChange:function(e){V||W(e.target.value),null==S||S(e)},onFocus:function(e){R(!0),null==E||E(e)},onBlur:function(e){R(!1),null==A||A(e)},style:K,autoComplete:z.autoComplete||"off",autoCorrect:z.autoCorrect||"off",autoCapitalize:z.autoCapitalize||"off",spellCheck:z.spellCheck||!1},z)),(h||x)&&e.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:a?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?e.jsxs("span",{children:[Z," / ",x]}):e.jsx("span",{children:Z})})]})]})});Z.displayName="Textarea";var K=function(n){var i=n.checked,r=n.defaultChecked,l=void 0!==r&&r,a=n.disabled,s=void 0!==a&&a,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,C=c().primaryColor,w=void 0===C?"#FB6011":C,F=t.useState(l),k=F[0],j=F[1],S=void 0!==i,E=S?i:k,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[x],z=E||v,L=s?"#E7E5E4":z?w:"#F5F5F4",D=z?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return e.jsxs("button",{type:"button",role:"switch","aria-checked":E,disabled:s||v,onClick:function(e){if(!s&&!v){var t=!E;S||j(t),null==d||d(t,e),null==u||u(t,e)}},className:"aha-switch ".concat(y),style:o({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:z?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===x?"10px":"12px",backgroundColor:L,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:z?"6px":"auto",right:z?"auto":"6px",fontSize:A.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:z?p:f}),e.jsx("span",{style:{position:"absolute",left:D,top:"50%",transform:"translateY(-50%)",width:A.thumbSize,height:A.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"})]})})]})};K.displayName="Switch";var Y=function(i){var r,l=i.value,s=i.defaultValue,d=i.options,u=void 0===d?[]:d,p=i.mode,f=i.disabled,h=void 0!==f&&f,x=i.error,g=void 0!==x&&x,v=i.placeholder,m=void 0===v?"Please select":v,y=i.size,b=void 0===y?"medium":y,C=i.showSearch,w=void 0!==C&&C,F=i.filterOption,k=void 0===F||F,j=i.allowClear,S=void 0!==j&&j,E=i.onChange,A=i.onSelect,z=i.onDeselect,L=i.onSearch,D=i.onFocus,M=i.onBlur,B=i.onDropdownVisibleChange,T=i.className,W=void 0===T?"":T,I=i.style,N=i.dropdownClassName,R=void 0===N?"":N,H=i.dropdownStyle,O=i.defaultOpen,P=void 0!==O&&O,V=i.open,q=i.maxTagCount,Z=i.tagRender,K=i.optionRender,Y=c().primaryColor,X=void 0===Y?"#FB6011":Y,G=t.useState(void 0!==s?s:p?[]:void 0),_=G[0],U=G[1],Q=t.useState(P),J=Q[0],$=Q[1],ee=t.useState(""),te=ee[0],ne=ee[1],oe=t.useState(-1),ie=oe[0],re=oe[1],le=t.useRef(null),ae=t.useRef(null),se=t.useRef(null),de=t.useState(null),ce=de[0],ue=de[1],pe=void 0!==l,fe=void 0!==V,he=pe?l:_,xe=fe?V:J,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 w&&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,w,k]),ye=t.useMemo(function(){return me()},[me]);t.useEffect(function(){if(xe&&le.current){var e=function(){if(le.current){var e=le.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;le.current&&!le.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(),re(function(e){return e<ye.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),re(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ie>=0){e.preventDefault();var n=ye[ie];n&&!n.disabled&&be(n)}else"Escape"===e.key&&(e.preventDefault(),fe||$(!1),null==B||B(!1),null===(t=le.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[xe,ye,ie,fe,B]),t.useEffect(function(){if(ie>=0&&se.current){var e=se.current.querySelectorAll(".aha-select-option")[ie];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ie]);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==z||z(e.value,e)):(n=a(a([],o,!0),[e.value],!1),null==A||A(e.value,e)),pe||U(n);var i=u.filter(function(e){return n.includes(e.value)});null==E||E(n,i)}else pe||U(e.value),null==E||E(e.value,e),null==A||A(e.value,e),fe||$(!1),null==B||B(!1),ne(""),null===(t=le.current)||void 0===t||t.focus()},[ge,he,pe,fe,u,E,A,z,B]),Ce=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||U(n),null==E||E(n,ve()),null==z||z(t,o)}},[ge,he,pe,u,E,z,ve]),we=function(e){e.stopPropagation();var t=ge?[]:void 0;pe||U(t),null==E||E(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]),Ee=t.useMemo(function(){if(!ge||!Array.isArray(he)||0===he.length)return null;var n="responsive"===q?ke.slice(0,2):q?ke.slice(0,q):ke,o=q&&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 Ce({},n.value)}};return Z?e.jsx(t.Fragment,{children:Z(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 Ce(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,q,h,Z]);return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),e.jsxs("div",{ref:le,className:"aha-select ".concat(W),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"},I),onClick:function(){if(!h){var e=!xe;fe||$(e),null==B||B(e),e&&w?setTimeout(function(){var e;null===(e=ae.current)||void 0===e||e.focus()},0):ne("")}},onFocus:function(e){null==D||D(e)},onBlur:function(e){null==M||M(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?Ee||(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"}})):w&&xe?e.jsx("input",{ref:ae,type:"text",value:te,onChange:function(e){var t=e.target.value;ne(t),null==L||L(t),re(-1)},onClick:function(e){return e.stopPropagation()},onFocus:function(e){return e.stopPropagation()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color: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===(r=ke[0])||void 0===r?void 0:r.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:we,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(R),style:o({position:"absolute",top:"".concat(ce.top,"px"),left:"".concat(ce.left,"px"),width:"".concat(ce.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"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,i=n===ie;return K?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:K(t,{selected:o,focused:i,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:i?"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)]})};Y.displayName="Select";var X=t.createContext(null),G=t.forwardRef(function(n,i){var a=n.initialValues,s=void 0===a?{}:a,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,C=n.children,w=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=w[0],k=w[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},[]),E=t.useCallback(function(e,t){k(function(n){var i=o({},n);if(i[e]?i[e]=o(o({},i[e]),{value:t}):i[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},d){var r={};r[e]=t;var l={};Object.keys(i).forEach(function(e){l[e]=i[e].value}),d(r,l)}return i})},[d]),A=t.useCallback(function(e){var t;return null===(t=j.current[e])||void 0===t?void 0:t.error},[]),z=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{error:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{error:t}):i[e]={value:void 0,error:t,touched:!1,validating:!1},i})},[]),L=t.useCallback(function(e){var t;return(null===(t=j.current[e])||void 0===t?void 0:t.touched)||!1},[]),D=t.useCallback(function(e,t){j.current[e]&&(j.current[e]=o(o({},j.current[e]),{touched:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{touched:t}):i[e]={value:void 0,error:void 0,touched:t,validating:!1},i})},[]),M=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]=o(o({},j.current[e]),{validating:t})),k(function(n){var i=o({},n);return i[e]?i[e]=o(o({},i[e]),{validating:t}):i[e]={value:void 0,error:void 0,touched:!1,validating:t},i})},[]),T=t.useRef();T.current=function(e,t){k(function(n){if(n[e]){var i=n[e].rules||[],r=t.rules||[],l=i.length===r.length;if(l&&i.length>0)for(var a=0;a<i.length;a++){var d=i[a],c=r[a];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)){l=!1;break}}if(l&&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 W=t.useCallback(function(e,t){var n;null===(n=T.current)||void 0===n||n.call(T,e,t)},[]),I=t.useCallback(function(e){k(function(t){var n=o({},t);return delete n[e],n})},[]),N=t.useCallback(function(e){return r(void 0,void 0,void 0,function(){var t,n,i,r,a,s,d,c,u;return l(this,function(l){switch(l.label){case 0:if(!(t=j.current[e]))return[2,void 0];B(e,!0),n=t.rules||[],r=0,a=n,l.label=1;case 1:if(!(r<a.length))return[3,6];if(s=a[r],d=t.value,s.required&&(null==d||""===d))return i=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 i=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 i=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 i=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 i=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 i=s.message||"".concat(e," must be exactly ").concat(s.len),[3,6];if(s.whitespace&&"string"==typeof d&&d.trim()!==d)return i=s.message||"".concat(e," cannot be whitespace"),[3,6];if(!s.validator)return[3,5];l.label=2;case 2:return l.trys.push([2,4,,5]),[4,s.validator(s,d)];case 3:return l.sent(),[3,5];case 4:return u=l.sent(),i=(null==u?void 0:u.message)||s.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return j.current[e]?j.current[e]=o(o({},j.current[e]),{error:i,validating:!1,touched:!0}):j.current[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},k(function(n){var r=o({},n);return r[e]?r[e]=o(o({},r[e]),{error:i,validating:!1,touched:!0}):r[e]={value:t.value,error:i,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,i]}})})},[]),R=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 r(void 0,void 0,void 0,function(){var t,n,o,i;return l(this,function(a){switch(a.label){case 0:return t=j.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return r(void 0,void 0,void 0,function(){var n,o;return l(this,function(i){switch(i.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,N(e)]:[3,2];case 1:return o=i.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return a.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(a.sent(),o.length>0)throw i={values:R(),errorFields:o},null==u||u(i),i;return[2,R()]}})})},[N,R,u]),O=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]),P=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}}),d){var i={};Object.keys(n).forEach(function(e){i[e]=n[e].value}),d(e,i)}return n})},[d]),V=t.useCallback(function(){return r(void 0,void 0,void 0,function(){var e;return l(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,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(i,function(){return{getFieldValue:S,getFieldsValue:R,setFieldValue:E,setFieldsValue:P,getFieldError:A,validateField:N,validateFields:H,resetFields:O,submit:V}});var q=t.useMemo(function(){return{fields:F,getFieldValue:S,setFieldValue:E,getFieldError:A,setFieldError:z,isFieldTouched:L,setFieldTouched:D,isFieldValidating:M,setFieldValidating:B,registerField:W,unregisterField:I,validateField:N,validateFields:H,resetFields:O,getFieldsValue:R,setFieldsValue:P,submit:V,labelWidth:f,labelAlign:x}},[F,S,E,A,z,L,D,M,B,W,I,N,H,O,R,P,V,f,x]),Z=o({},b);return"vertical"===v?(Z.display="flex",Z.flexDirection="column"):"inline"===v&&(Z.display="inline-flex",Z.flexWrap="wrap",Z.gap="16px"),e.jsx(X.Provider,{value:q,children:e.jsx("form",{className:"aha-form ".concat(y),style:Z,onSubmit:function(e){return r(void 0,void 0,void 0,function(){var t;return l(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,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:C})})});G.displayName="Form";var _=G;_.Item=function(n){var i=n.name,r=n.label,l=n.htmlFor;n.labelCol,n.wrapperCol;var a=n.required,s=void 0!==a&&a,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,C=t.useContext(X),w=t.useRef(null),F=(null==C?void 0:C.fields)||{};i&&C&&C.getFieldValue(i);var k=i&&C?C.getFieldError(i):void 0,j=!(!i||!C)&&C.isFieldTouched(i),S=!(!i||!C)&&C.isFieldValidating(i);i&&F[i];var E=u||(k?"error":S?"validating":j&&!k?"success":void 0),A=void 0!==p?p:k||void 0,z=t.useRef(c),L=t.useRef(s),D=t.useRef(!1),M=s||c.some(function(e){return e.required}),B=t.useMemo(function(){if(!D.current)return D.current=!0,!0;if(z.current.length!==c.length)return!0;if(z.current===c)return!1;for(var e=0;e<c.length;e++){var t=z.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(i&&C)return(!z.current||B||L.current!==s)&&(z.current=c,L.current=s,C.registerField(i,{rules:c,required:M})),function(){i&&C&&C.unregisterField(i)}},[i]);if(y)return null;return e.jsxs("div",{ref:w,className:"aha-form-item ".concat(x),style:o({display:"flex",flexDirection:"column",marginBottom:"16px"},g),children:[r&&e.jsxs("label",{htmlFor:l,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[r,M&&e.jsx("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),b&&e.jsx(function(n){var o=n.content,i=t.useState(!1),r=i[0],l=i[1],a=t.useRef(null);return t.useEffect(function(){var e=function(e){a.current&&!a.current.contains(e.target)&&l(!1)};if(r)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r]),e.jsxs("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e.jsx("div",{onClick:function(e){e.stopPropagation(),l(!r)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e.jsx(I,{})}),r&&e.jsxs("div",{ref:a,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,r,l,a,s,d,c,u,p;if(!t.isValidElement(e))return e;var f=o({},e.props);if(i&&C){var h=C.getFieldValue(i),x=C.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===(r=e.props)||void 0===r?void 0:r.onBlur;f.onChange=function(e){x(i,e.target.value),null==v||v(e),i&&C&&setTimeout(function(){C.validateField(i)},0)},f.onBlur=function(e){i&&C&&(C.setFieldTouched(i,!0),C.validateField(i)),null==m||m(e)},f.error="error"===E}else if("Select"===g){f.value=h;var y=null===(l=e.props)||void 0===l?void 0:l.onChange,b=null===(a=e.props)||void 0===a?void 0:a.onBlur;f.onChange=function(e,t){x(i,e),null==y||y(e,t),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},0))},f.onBlur=function(e){i&&C&&(C.setFieldTouched(i,!0),C.validateField(i)),null==b||b(e)},f.error="error"===E}else if("Switch"===g){f.checked=h||!1;var w=null===(s=e.props)||void 0===s?void 0:s.onChange;f.onChange=function(e,t){x(i,e),null==w||w(e,t),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,e.target.checked),null==F||F(e),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,k),null==j||j(e),i&&C&&(C.setFieldTouched(i,!0),setTimeout(function(){C.validateField(i)},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(i,o),null==S||S(e)}}}return"error"===E&&"error"in f&&(f.error=!0),t.cloneElement(e,f)}(e):e})}),A&&e.jsx("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===E?"#D92D20":"warning"===E?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:A}),f&&!A&&e.jsx("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:f})]})]})};var U=function(n){var i=n.items,r=void 0===i?[]:i,l=n.userProfile,s=n.selectedKeys,d=n.defaultSelectedKeys,u=void 0===d?[]:d,p=n.onSelect,f=n.onDeselect,h=n.className,x=void 0===h?"":h,g=n.style,v=n.width,m=void 0===v?320:v;c().primaryColor;var y=t.useRef(null),b=t.useRef({}),C=void 0!==s,w=t.useState(u),F=w[0],k=w[1],j=C?s:F,S=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,i=t;o<i.length;o++){var r=i[o];if(S(r)){var l=E(e,r.children,n);if(l)return l}else{var s=r,d=a(a([],n,!0),[s.key],!1);if(s.key===e)return d}}return null},[]),A=t.useCallback(function(e){var t;if(!e.disabled){var n,o=E(e.key,r)||[e.key];j.includes(e.key)?(n=j.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||k(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o})}},[j,C,p,f,r,E]),z=function(t){var n=j.includes(t.key);if(t.render)return e.jsx("div",{className:t.className,style:t.style,children:t.render(t,n)},t.key);var i=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){b.current[t.key]=e},className:"aha-menu-item ".concat(t.className||""),style:i,onClick:function(){return A(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 m?"".concat(m,"px"):m,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"},g),D=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!S(o)||!(!S(n)||S(o))};return e.jsxs("div",{ref:y,className:"aha-menu-list ".concat(x),style:L,children:[l&&(l?l.render?l.render(l):e.jsx("div",{onClick:l.onClick,style:{padding:"16px",cursor:l.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:[l.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 l.name?l.name.charAt(0).toUpperCase():"U"}),void 0!==l.online&&e.jsx("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:l.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:l.name}),l.email&&e.jsx("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.email})]})]})}):null),e.jsx("div",{children:r.map(function(n,o){return e.jsxs(t.Fragment,{children:[D(o,r)&&e.jsx("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),S(n)?(i=n,e.jsx("div",{className:"aha-menu-group ".concat(i.className||""),children:i.children.map(function(e){return z(e)})},"group-".concat(i.title))):z(n)]},o);var i})})]})};U.displayName="MenuList";var Q=function(e,t,n,o){void 0===o&&(o=6);var i=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,l=e.left+e.width/2,a=e.top+e.height/2,s=o+6,d=0,c=0;switch(n){case"top":d=e.top-t.height-s+r,c=l-t.width/2+i;break;case"bottom":default:d=e.bottom+s+r,c=l-t.width/2+i;break;case"left":d=a-t.height/2+r,c=e.left-t.width-s+i;break;case"right":d=a-t.height/2+r,c=e.right+s+i;break;case"top-left":d=e.top-t.height-s+r,c=e.left+i;break;case"top-right":d=e.top-t.height-s+r,c=e.right-t.width+i;break;case"bottom-left":d=e.bottom+s+r,c=e.left+i;break;case"bottom-right":d=e.bottom+s+r,c=e.right-t.width+i}var u=window.innerWidth,p=window.innerHeight;return c<i+8?c=i+8:c+t.width>i+u-8&&(c=i+u-t.width-8),d<r+8?d=r+8:d+t.height>r+p-8&&(d=r+p-t.height-8),{top:d,left:c}},J=function(e,t,n,o){void 0===o&&(o=6);var i=Q(e,t,n,o),r=i.top,l=i.left,a=window.scrollX||window.pageXOffset,s=r-(window.scrollY||window.pageYOffset),d=l-a,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},$=function(t,n){var i=o({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:o(o({},i),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":o(o({},i),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":o(o({},i),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e.jsx("div",{style:r[t]})};exports.Alert=function(n){var o=n.className,i=void 0===o?"":o,r=n.type,l=void 0===r?"info":r,a=n.title,s=n.description,d=n.icon,c=void 0===d?h[l]: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),C=b[0],w=b[1];return C?e.jsxs("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2 relative"," ").concat(i),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[l],children:[p&&c,e.jsxs("div",{className:"flex flex-col gap-1",style:g?{paddingRight:"2rem"}:{},children:[a&&e.jsx("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:a}),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(){w(!1),null==y||y()},children:x})]}):null},exports.Button=f,exports.CheckIcon=z,exports.Checkbox=R,exports.Form=_,exports.Input=q,exports.MenuList=U,exports.MinusIcon=L,exports.Pagination=N,exports.Progress=function(n){var r=n.percent,l=void 0===r?0:r,a=n.type,s=void 0===a?"circle":a,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,C=void 0===b?"":b,w=n.style,F=n.strokeColor,k=n.trailColor,j=void 0===k?"#F5F5F4":k,S=i(n,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),E=c().primaryColor,A=Math.min(100,Math.max(0,l)),z=t.useRef(!0),L=t.useState(!1),D=L[0],M=L[1],B=t.useState(0),T=B[0],W=B[1];t.useEffect(function(){if(v&&z.current&&A>0){z.current=!1,W(0),M(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){W(A)})});var e=setTimeout(function(){M(!1),W(A)},300);return function(){return clearTimeout(e)}}z.current?(z.current=!1,M(!1),W(A)):W(A)},[v,A]);var I=F||E||"#FB6011";"success"===y?I="#00BC7D":"exception"===y&&(I="#FB2C36");var N=f||"inside",R=Math.max(4,Math.round(.06*u)),H=(u-R)/2,O="semicircle"===s?u/2:u,P="14px",V="12px",q=function(){var t=p&&"outside"===N?u+4+18+4:u,n=2*Math.PI*H,o=n-(D?T:A)/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:R,strokeLinecap:"round"}),e.jsx("circle",{cx:u/2,cy:u/2,r:H,fill:"none",stroke:I,strokeWidth:R,strokeLinecap:"round",strokeDasharray:n,strokeDashoffset:o,transform:"rotate(-90 ".concat(u/2," ").concat(u/2,")"),style:{transition:D?"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:P,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")})]}):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:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(u,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]})},Z=o({display:"inline-flex",flexDirection:"column",alignItems:"center",width:u},w);return e.jsx("div",o({className:"aha-progress aha-progress--".concat(s," ").concat(C),style:Z},S,{children:function(){switch(s){case"circle":return q();case"semicircle":return n=R/2,o=u-R/2,i=(t=O+R)-R/2,r=O/2+R/2+R/2,l=p&&"outside"===N?t+4+18+4:t,a=Math.PI*H,d=a-(D?T:A)/100*a,e.jsxs("div",{style:{position:"relative",width:u,height:l,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(i," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(i),fill:"none",stroke:j,strokeWidth:R,strokeLinecap:"round"}),e.jsx("path",{d:"M ".concat(n," ").concat(i," A ").concat(H," ").concat(H," 0 0 1 ").concat(o," ").concat(i),fill:"none",stroke:I,strokeWidth:R,strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:d,style:{transition:D?"stroke-dashoffset 0.3s ease":"none"}})]}),p&&"inside"===N?e.jsxs("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e.jsx("div",{style:{fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:p}),x&&e.jsx("div",{style:{fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:V,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(A),"%")}),p&&"outside"===N&&e.jsx("div",{style:{position:"absolute",left:"50%",top:"".concat(t,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:P,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:p})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),q()}var t,n,o,i,r,l,a,d}()}))},exports.Radio=V,exports.Select=Y,exports.Switch=K,exports.Tab=function(n){var r,l,a=n.items,s=void 0===a?[]:a,d=n.variant,u=void 0===d?"underline":d,p=n.layout,f=void 0===p?"equal":p,h=n.defaultValue,x=n.value,g=n.onChange,v=n.className,m=void 0===v?"":v,y=n.mode,b=void 0===y?"children":y,C=i(n,["items","variant","layout","defaultValue","value","onChange","className","mode"]),w=c().primaryColor;if(!s||0===s.length)return null;var F=void 0!==x,k=x||h||(null===(r=s[0])||void 0===r?void 0:r.key)||"",j=t.useState(k),S=j[0],E=j[1],A=F?x||(null===(l=s[0])||void 0===l?void 0:l.key)||"":S,z=t.useCallback(function(e,t){t||(F||E(e),null==g||g(e))},[F,g]),L=s.find(function(e){return e.key===A}),D=w||"#FB6011",M=t.useRef({}),B=t.useRef(null),T=t.useRef(null),W=t.useRef(null),I=t.useRef(null),N=t.useState({width:0,left:0,opacity:0}),R=N[0],H=N[1],O=t.useState({width:0,left:0,opacity:0}),P=O[0],V=O[1];t.useEffect(function(){if("underline"===u&&B.current&&W.current){var e=setTimeout(function(){var e=M.current[A];if(e){var t=W.current.getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.left-t.left,i=n.width;H({width:"".concat(i,"px"),left:"".concat(o,"px"),opacity:1})}},0);return function(){return clearTimeout(e)}}if("background"===u&&T.current&&I.current){var t=setTimeout(function(){var e=M.current[A];if(e){var t=I.current.getBoundingClientRect(),n=e.getBoundingClientRect(),o=n.left-t.left,i=n.width;V({width:"".concat(i,"px"),left:"".concat(o,"px"),opacity:1})}},0);return function(){return clearTimeout(t)}}},[A,u]);var q;return e.jsxs("div",{className:"aha-tab-container",children:["underline"===u?e.jsxs("div",o({ref:W,className:"aha-tab aha-tab--underline ".concat(m),style:{display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"}},C,{children:[e.jsx("div",{ref:B,style:o({position:"absolute",bottom:"-1px",height:"2px",backgroundColor:D,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"},R)}),s.map(function(n){var i,r=n.key===A;return e.jsxs("div",{ref:function(e){M.current[n.key]=e},onClick:function(){return z(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"},children:[n.icon&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?D:"#79716B",transition:"color 0.2s ease-in-out"},children:t.isValidElement(n.icon)?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?D:"#79716B",transition:"color 0.2s ease-in-out"})}):n.icon}),e.jsx("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?D:"#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)})]})):(q={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"},q.width="equal"===f?"100%":"fit-content",e.jsxs("div",o({ref:I,className:"aha-tab aha-tab--background aha-tab--".concat(f," ").concat(m),style:q},C,{children:[e.jsx("div",{ref:T,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"},P)}),s.map(function(n){var i,r=n.key===A,l={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"===f?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){M.current[n.key]=e},onClick:function(){return z(n.key,n.disabled)},style:l,children:[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.isValidElement(n.icon)?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"})}):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)})]}))),"children"===b&&(null==L?void 0:L.children)&&e.jsx("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:L.children})]})},exports.Table=function(n){var r,l,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,C=n.bordered,w=void 0!==C&&C;n.loading;var F=n.locale,k=n.showHeader,j=void 0===k||k,S=n.title,E=n.footer,A=n.summary,z=n.scroll,L=n.tableLayout,D=void 0===L?"auto":L,M=n.onChange,B=n.onSorterChange,T=n.onPaginationChange,W=n.onRow,I=n.className,V=void 0===I?"":I,q=n.style,Z=n.expandable,K=n.rowClassName,Y=n.onHeaderRow;n.sticky;var X=i(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)||[]),_=G[0],U=G[1];t.useEffect(function(){void 0!==(null==g?void 0:g.selectedRowKeys)&&U(g.selectedRowKeys)},[null==g?void 0:g.selectedRowKeys]);var Q=t.useState(new Map),J=Q[0],$=Q[1],ee=t.useState((null==Z?void 0:Z.defaultExpandedRowKeys)||[]),te=ee[0],ne=ee[1],oe=t.useState(m&&"object"==typeof m&&(m.current||m.defaultCurrent)||1),ie=oe[0],re=oe[1],le=t.useState(m&&"object"==typeof m&&(m.pageSize||m.defaultPageSize)||10),ae=le[0],se=le[1];t.useEffect(function(){m&&"object"==typeof m&&(void 0!==m.current&&re(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,o,i,r=null===(n=null==g?void 0:g.getCheckboxProps)||void 0===n?void 0:n.call(g,e);if(!(null==r?void 0:r.disabled)){var l,s=O(e,x);l="radio"===(null==g?void 0:g.type)?t?[s]:[]:t?a(a([],_,!0),[s],!1):_.filter(function(e){return e!==s}),U(l);var d=f.filter(function(e){return l.includes(O(e,x))});null===(o=null==g?void 0:g.onChange)||void 0===o||o.call(g,l,d),null===(i=null==g?void 0:g.onSelect)||void 0===i||i.call(g,e,t,d,new Event("select"))}},[_,x,g,f]),Ce=t.useCallback(function(e,t){var n,o,i=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 O(e,x)}),r=e?i:[];U(r);var l=f.filter(function(e){return r.includes(O(e,x))}),a=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,r,l),null===(o=null==g?void 0:g.onSelectAll)||void 0===o||o.call(g,e,l,a)},[x,g,f]),we=t.useCallback(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(J);null===t?o.delete(n):o.set(n,t),$(o);var i=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}}),r={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(r),B&&B(1===i.length?i[0]:i),M&&M({current:ie,pageSize:ae},{},1===i.length?i[0]:i,{currentDataSource:f,action:"sort"})}},[J,M,B,ie,ae,f,u]);t.useCallback(function(e,t){var n,o,i,r=O(e,x);i=t?a(a([],te,!0),[r],!1):te.filter(function(e){return e!==r}),ne(i),null===(n=null==Z?void 0:Z.onExpand)||void 0===n||n.call(Z,t,e),null===(o=null==Z?void 0:Z.onExpandedRowsChange)||void 0===o||o.call(Z,i)},[te,x,Z]);var Fe=t.useCallback(function(){var e=a([],f,!0);return J.size>0&&e.sort(function(e,t){for(var n=function(n,o){var i=u.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!i)return"continue";var r=0;if("function"==typeof i.sorter)r=i.sorter(e,t);else if(!0===i.sorter){var l=H(e,i.dataIndex||n),a=H(t,i.dataIndex||n);l<a?r=-1:l>a&&(r=1)}return 0!==r?{value:"ascend"===o?r:-r}:void 0},o=0,i=Array.from(J.entries());o<i.length;o++){var r=i[o],l=n(r[0],r[1]);if("object"==typeof l)return l.value}return 0}),e},[f,J,u]),ke=Fe(),je=t.useMemo(function(){if(!1===m||!m)return ke;var e=(ie-1)*ae,t=e+ae;return ke.slice(e,t)},[ke,ie,ae,m]),Se=t.useCallback(function(e,t){var n,o,i=null!=t?t:ae;if(re(e),t&&se(t),T&&T(e,i),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))),M){var r=Array.from(J.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}});M({current:e,pageSize:i},{},1===r.length?r[0]:r,{currentDataSource:ke,action:"paginate"})}},[m,T,M,ae,J,u,ke]),Ee=t.useCallback(function(e,t,n){var o=H(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Ae=t.useCallback(function(e,t,n){if(t){var o=!0===t?"left":t,i=0;if("left"===o){if(g&&("left"===g.fixed||!0===g.fixed))i+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;for(var r=0;r<e;r++){if("left"===(l=u[r]).fixed||!0===l.fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}return i}if("right"===o){for(r=e+1;r<u.length;r++){var l;if("right"===(l=u[r]).fixed)i+=l.width?"number"==typeof l.width?l.width:parseInt(l.width)||0:150}if(g&&"right"===g.fixed)i+="number"==typeof g.columnWidth?g.columnWidth:"string"==typeof g.columnWidth?parseInt(g.columnWidth):60;return i}}},[u,g]),ze=t.useCallback(function(){if(!j)return null;var t,n,i,r,l=u.map(function(t,n){var i,r=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||n,l=J.get(r)||null,a=Ae(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!==a?"".concat(a,"px"):"0":void 0,right:"right"===t.fixed?void 0!==a?"".concat(a,"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===(i=t.onHeaderCell)||void 0===i?void 0:i.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:l,sortColumn:t}):t.title}),t.sorter&&e.jsx("button",{onClick:function(){we(t,null===l?"ascend":"ascend"===l?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:l?"#475467":"#98A2B3"},children:e.jsx(P,{order:l||void 0})})]})}),r)});if(g){var a="number"==typeof g.columnWidth?"".concat(g.columnWidth,"px"):"string"==typeof g.columnWidth?g.columnWidth:"60px",s=e.jsx("th",{style:{width:a,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 O(e,x)}),i=t.length>0&&n.every(function(e){return _.includes(e)}),r=n.some(function(e){return _.includes(e)}),e.jsx(R,{checked:i,indeterminate:r&&!i,onChange:function(e){return Ce(e.target.checked,je)}})),g.columnTitle&&e.jsx("span",{style:{marginLeft:g.hideSelectAll?0:"8px"},children:g.columnTitle})]})},"selection");l.unshift(s)}var d=null==Y?void 0:Y(u,0);return e.jsx("thead",{ref:ye,children:e.jsx("tr",o({},d||{},{children:l}))})},[u,j,J,g,_,je,x,we,Ce,F,Y,Ae]),Le=t.useCallback(function(e){ue(e)},[]),De=t.useCallback(function(e,t){e.preventDefault(),he(t)},[]),Me=t.useCallback(function(e,t){if(e.preventDefault(),null===ce||ce===t)return ue(null),void he(null);var n=a([],je,!0),o=n[ce];n.splice(ce,1),n.splice(t,0,o),ue(null),he(null)},[ce,je]),Be=t.useCallback(function(){ue(null),he(null)},[]),Te=t.useCallback(function(){return je.map(function(n,i){var r,l=O(n,x),a=_.includes(l),s=te.includes(l),d=(null==W?void 0:W(n,i))||{},c=i===je.length-1;return e.jsxs(t.Fragment,{children:[e.jsxs("tr",o({className:"".concat("function"==typeof K?K(n,i):K||""," ").concat(ce===i?"dragging":""," ").concat(fe===i?"drag-over":""),draggable:!0,onDragStart:function(){return Le(i)},onDragOver:function(e){return De(e,i)},onDrop:function(e){return Me(e,i)},onDragEnd:Be,style:o({cursor:"move",opacity:ce===i?.5:1,backgroundColor:fe===i?"#F9FAFB":"white",transition:"background-color 0.2s"},d.style),onMouseEnter:function(e){ce!==i&&fe!==i&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){ce!==i&&fe!==i&&(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(R,{checked:a,onChange:function(e){return be(n,e.target.checked)},disabled:null===(r=g.getCheckboxProps)||void 0===r?void 0:r.call(g,n).disabled})})}),u.map(function(t,r){var l,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||r,s=(null===(l=t.onCell)||void 0===l?void 0:l.call(t,n,i))||{},d=Ae(r,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!==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:Ee(t,n,i)}),a)})]})),(null==Z?void 0:Z.expandedRowRender)&&s&&e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:Z.expandedRowRender(n,i,0,!0)})})]},l)})},[je,x,_,te,g,u,W,K,be,Ee,Z,ce,fe,Le,De,Me,Be,Ae]),We=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(N,{current:ie,total:n,pageSize:ae,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"})})},Ie=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]),Re=t.useMemo(function(){if(null==z?void 0:z.x){if("number"==typeof z.x)return z.x;if(!0===z.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(Ie)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==z?void 0:z.x,g,Ie]),He=t.useMemo(function(){return"fixed"===D||Ie||Ne||u.some(function(e){return e.width})?"fixed":D},[D,Ie,Ne,u]),Oe={width:"100%",minWidth:Re?"".concat(Re,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:He,backgroundColor:"white",borderRadius:"8px",border:"1px solid #EAECF0"},Pe=o({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"},q);if(ge)return e.jsxs("div",o({ref:me,className:"aha-table aha-table-mobile-wrapper ".concat(V),style:Pe},X,{children:[S&&e.jsx("div",{style:{marginBottom:"16px"},children:S(ke)}),m&&"object"==typeof m&&(null===(r=m.position)||void 0===r?void 0:r.startsWith("top"))&&We(),e.jsx("div",{className:"aha-table-mobile",children:je.map(function(t,n){var o,i=O(t,x),r=_.includes(i);return e.jsxs("div",{className:"aha-table-mobile-row ".concat(r?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:r?"#e6f7ff":"white"},children:[g&&e.jsx("div",{style:{marginBottom:"8px"},children:e.jsx(R,{checked:r,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 i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),r=H(t,o.dataIndex||""),l=o.render?o.render(r,t,n):r;return e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[e.jsxs("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e.jsx("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(ke)}),m&&("object"!=typeof m||!(null===(l=m.position)||void 0===l?void 0:l.startsWith("top")))&&We()]}));var Ve={position:"relative",overflowX:(null==z?void 0:z.x)||Ie?"auto":"visible",overflowY:(null==z?void 0:z.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==z?void 0:z.x)?"100%":"number"==typeof(null==z?void 0:z.x)?"".concat(z.x,"px"):void 0,maxHeight:"number"==typeof(null==z?void 0:z.y)?"".concat(z.y,"px"):void 0,borderRadius:"8px"};return e.jsxs("div",o({ref:me,className:"aha-table ".concat(V),style:Pe},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"))&&We(),e.jsx("div",{style:Ve,children:e.jsx("div",{style:{width:"100%",minWidth:Re?"".concat(Re,"px"):"100%",display:"block"},children:e.jsxs("table",{style:Oe,className:w?"bordered":"",children:[ze(),e.jsx("tbody",{children:Te()}),A&&e.jsx("tfoot",{children:e.jsx("tr",{children:e.jsx("td",{colSpan:u.length+(g?1:0),children:A(ke)})})})]})})}),E&&e.jsx("div",{style:{marginTop:"16px"},children:E(ke)}),m&&("object"!=typeof m||!(null===(d=m.position)||void 0===d?void 0:d.startsWith("top")))&&We()]}))},exports.Tag=function(n){var r=n.children,l=n.color,a=n.variant,s=void 0===a?"light":a,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=i(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),C=c().primaryColor,w=function(e,t){if("string"==typeof e&&e in E){var n=E[e];return"Orange"===e&&t?o(o({},n),{fill:o(o({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var i=e.replace("#",""),r=parseInt(i.substr(0,2),16),l=parseInt(i.substr(2,2),16),a=parseInt(i.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(l,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(l,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return E.Green}(l,C),F=A[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=w.light.bg,k.color=w.light.text,f&&(k.outline="1px solid",k.outlineOffset="-1px",k.outlineColor=function(e){if("string"==typeof e&&e in E)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),i=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(i,", 0.3)")}return"#A4F4CF"}(l))),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=w.fill.bg,k.color=w.fill.text),y&&j.push("cursor-pointer","hover:opacity-80"),m&&j.push(m);var S=j.join(" "),z=function(){if(!h)return null;var n=function(e,t){if("string"==typeof e&&e in E)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"}(l,C),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&&z(),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:r})}),"after"===g&&z()]}))},exports.Textarea=Z,exports.ThemeProvider=function(n){var i=n.theme,r=n.children,l=t.useMemo(function(){return o(o({},s),i)},[i]);return e.jsx(d.Provider,{value:l,children:r})},exports.Toast=function(t){return e.jsx(C,{id:"direct",props:t})},exports.ToastProvider=function(o){var i=o.children,r=t.useState(!1),l=r[0],a=r[1];return t.useEffect(function(){a(!0)},[]),e.jsxs(e.Fragment,{children:[i,l&&n.createPortal(e.jsx(b,{}),document.body)]})},exports.Tooltip=function(i){var r=i.content,l=i.children,a=i.position,s=void 0===a?"top":a,d=i.trigger,c=void 0===d?"hover":d,u=i.delay,p=void 0===u?200:u,f=i.disabled,h=void 0!==f&&f,x=i.className,g=void 0===x?"":x,v=i.tooltipClassName,m=void 0===v?"":v,y=i.gap,b=void 0===y?6:y,C=i.showArrow,w=void 0===C||C,F=i.width,k=i.defaultVisible,j=void 0!==k&&k,S=i.visible,E=i.onVisibleChange,A=void 0!==S,z=t.useState(j),L=z[0],D=z[1],M=A?S:L,B=t.useState(A?null!=S&&S:j),T=B[0],W=B[1],I=t.useCallback(function(e){A||D(e),null==E||E(e)},[A,E]);t.useEffect(function(){A&&(S?requestAnimationFrame(function(){W(!0)}):W(!1))},[A,S]);var N=t.useState(s),R=N[0],H=N[1],O=t.useState("320px"),P=O[0],V=O[1],q=t.useState({position:"absolute",top:0,left:0,pointerEvents:"hover"===c?"auto":"none"}),Z=q[0],K=q[1],Y=t.useState({}),X=Y[0],G=Y[1],_=t.useRef(null),U=t.useRef(null),ee=t.useRef(null),te=t.useRef(null),ne=t.useCallback(function(){if(_.current&&U.current&&M&&T){var e=_.current.getBoundingClientRect(),t=U.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!J(e,t,n,o))return n;for(var i=0,r=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);i<r.length;i++){var l=r[i];if(!J(e,t,l,o))return l}return n}(e,t,s,b);H(n);var i=Q(e,t,n,b),r=i.top,l=i.left;if(K(function(e){return o(o({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(l,"px"),pointerEvents:"hover"===c?"auto":"none",zIndex:9999})}),w){var a=function(e,t,n,o,i){var r=window.scrollX||window.pageXOffset,l=window.scrollY||window.pageYOffset,a=t.left+(t.width-6)/2,s=t.top+(t.height-6)/2,d=o-r,c=i-l;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(a-d,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(a-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,l,r);G(a)}}},[M,s,b,w,T,c]),oe=t.useCallback(function(){h||(te.current&&(clearTimeout(te.current),te.current=null),ee.current&&clearTimeout(ee.current),ee.current=setTimeout(function(){I(!0),A||requestAnimationFrame(function(){W(!0)})},p))},[h,p,I,A]),ie=t.useCallback(function(){ee.current&&(clearTimeout(ee.current),ee.current=null),te.current&&clearTimeout(te.current),A?I(!1):(W(!1),te.current=setTimeout(function(){I(!1),te.current=null},150))},[I,A]),re=t.useCallback(function(){"hover"===c&&(te.current&&(clearTimeout(te.current),te.current=null),M||(I(!0),requestAnimationFrame(function(){W(!0)})))},[c,M]),le=t.useCallback(function(e){h||"click"!==c||(e.stopPropagation(),M?ie():(ee.current&&(clearTimeout(ee.current),ee.current=null),I(!0),requestAnimationFrame(function(){W(!0)})))},[h,c,M,ie]);t.useEffect(function(){if(j&&M&&T){var e=function(){_.current&&U.current?ne():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[j,M,T,ne]),t.useEffect(function(){if(M)return requestAnimationFrame(function(){ne()}),window.addEventListener("scroll",ne,!0),window.addEventListener("resize",ne),function(){window.removeEventListener("scroll",ne,!0),window.removeEventListener("resize",ne)}},[M,ne]),t.useEffect(function(){if(M&&"click"===c){var e=function(e){_.current&&U.current&&!_.current.contains(e.target)&&!U.current.contains(e.target)&&ie()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[M,c,ie]),t.useEffect(function(){return function(){ee.current&&clearTimeout(ee.current),te.current&&clearTimeout(te.current)}},[]);var ae={position:"absolute",top:0,left:0,opacity:T?1:0,transform:T?"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(){V(se())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[se]);var de=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:P,width:"max-content"}),{wordWrap:"break-word",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",whiteSpace:"pre-wrap",position:"relative",boxSizing:"border-box"}),ce=e.jsxs("div",{style:o(o(o({},ae),Z),{pointerEvents:"hover"===c?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(m),onMouseEnter:"hover"===c?re:void 0,onMouseLeave:"hover"===c?ie:void 0,children:[e.jsx("div",{ref:U,className:"aha-tooltip ".concat(m),style:de,role:"tooltip",children:r}),w&&$(R,X)]}),ue=t.useCallback(function(){"hover"===c&&(te.current=setTimeout(function(){ie()},100))},[c,ie]),pe="click"===c?{onClick:le}:{onMouseEnter:oe,onMouseLeave:ue,onFocus:oe,onBlur:ie};return e.jsxs(e.Fragment,{children:[e.jsx("div",o({ref:_,className:"aha-tooltip-trigger ".concat(g),style:{display:"inline-block",cursor:"click"===c?"pointer":"default"}},pe,{children:l})),M&&"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=w,exports.toastError=function(e,t){return S(),w(o(o({},t),{message:e,type:"error"}))},exports.toastInfo=function(e,t){return S(),w(o(o({},t),{message:e,type:"info"}))},exports.toastQuestion=function(e,t){return S(),w(o(o({},t),{message:e,type:"question"}))},exports.toastSuccess=function(e,t){return S(),w(o(o({},t),{message:e,type:"success"}))},exports.useTheme=c;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|