aha-components 1.7.11 → 1.7.12
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/Textarea.esm.js +1 -1
- package/dist/Textarea.esm.js.map +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/Textarea.js.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +2 -0
- package/dist/components/Textarea/Textarea.test.d.ts +1 -0
- package/dist/components/Textarea/index.d.ts +12 -0
- package/dist/index.d.ts +11 -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.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import o,{createContext as r,useMemo as i,useContext as a,useState as l,useEffect as d,useCallback as s,forwardRef as c,useRef as u,useImperativeHandle as p}from"react";import{createPortal as f}from"react-dom";var h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},h(e,t)};var g=function(){return g=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},g.apply(this,arguments)};function v(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}function m(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{d(o.next(e))}catch(e){i(e)}}function l(e){try{d(o.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}d((o=o.apply(e,t||[])).next())})}function x(e,t){var n,o,r,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(d){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,o&&(r=2&l[0]?o.return:l[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;switch(o=0,r&&(l=[2&l[0],r.value]),l[0]){case 0:case 1:r=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,o=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!r||l[1]>r[0]&&l[1]<r[3])){i.label=l[1];break}if(6===l[0]&&i.label<r[1]){i.label=r[1],r=l;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(l);break}r[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],o=0}finally{n=r=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}}function y(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r<i;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var b={primaryColor:"#FB6011"},w=r(b),C=function(t){var n=t.theme,o=t.children,r=i(function(){return g(g({},b),n)},[n]);return e(w.Provider,{value:r,children:o})},F=function(){var e=a(w);return e||b},k={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},D={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},S={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},M=function(o){var r=o.size,i=o.color;return t(n,{children:[e("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),t("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",opacity:"0.25"}),e("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:i,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},E=function(n){var o=n.children,r=n.type,i=void 0===r?"secondary":r,a=n.size,d=void 0===a?"md":a,s=n.disabled,c=void 0!==s&&s,u=n.loading,p=void 0!==u&&u,f=n.iconOnly,h=n.focused,m=void 0!==h&&h,x=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,E=n.style,A=n.icon,L=n.iconPosition,z=void 0===L?"left":L,B=v(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),T=F().primaryColor,W=l(!1),N=W[0],I=W[1],R=l(!1),j=R[0],H=R[1],Y=D[i]||"secondary",O=S[k[d]||"md"],V=null!=f?f:!!A&&null==o,P="link-color"===Y||"link-gray"===Y||"destructive-link"===Y,q=c||p,X=m,_=T,Z=function(){if(c)return"primary"===Y||"secondary"===Y||"destructive-primary"===Y||"destructive-secondary"===Y?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=N||j;return"primary"===Y?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":_||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===Y?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===Y?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===Y?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===Y?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===Y?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===Y?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===Y?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),K=function(){if(X)return"destructive-primary"===Y||"destructive-secondary"===Y||"destructive-tertiary"===Y||"destructive-link"===Y?"destructive-primary"===Y||"destructive-secondary"===Y?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===Y||"secondary"===Y?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),G=g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:O.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:O.fontSize,lineHeight:"".concat(O.lineHeight,"px"),cursor:q?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:Z.bg,color:Z.color,border:Z.border,boxShadow:null!=K?K:Z.boxShadow,textDecoration:Z.textDecoration},E);P?(G.borderRadius="4px",G.overflow="hidden",V?(G.width=O.height,G.height=O.height,G.padding=0):(G.height=O.height,G.paddingLeft=O.paddingX,G.paddingRight=O.paddingX)):(G.borderRadius="var(--radius-md, 8px)",V?(G.width=O.height,G.height=O.height,G.padding=0):(G.height=O.height,G.paddingLeft=O.paddingX,G.paddingRight=O.paddingX));var J=function(){return p?e(M,{size:O.iconSize,color:Z.iconColor}):A?e("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:O.iconSize,height:O.iconSize,color:Z.iconColor,flexShrink:0},children:A}):null},U=p||A&&"left"===z,Q=!p&&A&&"right"===z;return t("button",g({type:b,className:["aha-button","aha-button--".concat(Y),"aha-button--".concat(k[d]||"md"),V&&"aha-button--icon-only",q&&"aha-button--disabled",p&&"aha-button--loading",X&&"aha-button--focused",C].filter(Boolean).join(" "),disabled:q,onClick:function(e){q?e.preventDefault():null==x||x(e)},onMouseEnter:function(){return!q&&I(!0)},onMouseLeave:function(){I(!1),H(!1)},onMouseDown:function(){return!q&&H(!0)},onMouseUp:function(){return H(!1)},style:G},B,{children:[U&&J(),!V&&o,Q&&J(),V&&!A&&!p&&o]}))};E.displayName="Button";var A={success:e("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("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("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("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("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("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("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("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"})})},L=e("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("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"})}),z=function(n){var o=n.className,r=void 0===o?"":o,i=n.type,a=void 0===i?"info":i,d=n.title,s=n.description,c=n.icon,u=void 0===c?A[a]:c,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,m=n.children,x=n.onClose,y=l(!0),b=y[0],w=y[1],C=function(){w(!1),null==x||x()},F=v||g;return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(r),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[f&&u,t("div",{className:"flex flex-col gap-1 ".concat(F?"flex-1 min-w-0":""),children:[d&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:d}),s&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),m&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:m})]}),F&&t("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,g&&e("div",{className:"cursor-pointer relative top-[-12px]",onClick:C,onKeyDown:function(e){return"Enter"===e.key&&C()},role:"button",tabIndex:0,"aria-label":"关闭",children:L})]})]}):null},B={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})})},T=function(t){var n=t.className;return e("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("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},W=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return y([],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}(),N=new W,I=function(){var o=l([]),r=o[0],i=o[1];d(function(){console.log("Toast: ToastContainer 组件已挂载");var e=N.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=N.subscribe(function(){var e=N.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=r.filter(function(e){return"top-left"===e.props.position}),s=r.filter(function(e){return"top-right"===e.props.position}),c=r.filter(function(e){return"bottom-left"===e.props.position}),u=r.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e(R,g({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e(R,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(R,g({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(R,g({},t),t.id)})})]})},R=function(n){var o=n.id,r=n.props,i=l(!1),a=i[0],c=i[1],u=l(!1),p=u[0],f=u[1],h=r.message,g=r.type,v=void 0===g?"info":g,m=r.duration,x=void 0===m?3e3:m,y=r.icon,b=r.action,w=r.showClose,C=void 0===w||w,F=r.onClose,k=r.onClick;r.className;var D=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:B.success};case"error":return{bgColor:"#E7000B",defaultIcon:B.error};case"question":return{bgColor:"#1C1917",defaultIcon:B.question};default:return{bgColor:"#1447E6",defaultIcon:B.info}}}(v);d(function(){var e=setTimeout(function(){c(!0)},10);return function(){return clearTimeout(e)}},[]),d(function(){if(x>0){var e=setTimeout(function(){S()},x);return function(){return clearTimeout(e)}}},[x,o]);var S=s(function(){f(!0),setTimeout(function(){N.removeToast(o),null==F||F()},300)},[o,F]),M=s(function(){null==k||k()},[k]);return e("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:M,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:D.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||D.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("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(T,{})})]})})},j=function(t){return e(R,{id:"direct",props:t})},H=function(e){return console.log("Toast: 调用 toast 函数",e),J(),setTimeout(function(){var t=N.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},Y=function(e){N.removeToast(e)},O=function(){N.clearAll()},V=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 管理器状态:",N.getToasts()),console.log("容器根节点:",K),console.log("是否正在初始化:",G),console.log("====================")},P=function(e,t){return J(),H(g(g({},t),{message:e,type:"success"}))},q=function(e,t){return J(),H(g(g({},t),{message:e,type:"error"}))},X=function(e,t){return J(),H(g(g({},t),{message:e,type:"info"}))},_=function(e,t){return J(),H(g(g({},t),{message:e,type:"question"}))},Z=null,K=null,G=!1,J=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(G)console.log("Toast: 容器正在初始化中,跳过");else if(Z)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),G=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),Z=t,void(G=!1);console.log("Toast: 创建容器元素"),(Z=document.createElement("div")).id="aha-toast-container",document.body.appendChild(Z),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),K=n(Z),console.log("Toast: 渲染 ToastContainer 组件"),K.render(e(I,{})),console.log("Toast: 容器渲染完成"),G=!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(Z),console.log("Toast: 渲染 ToastContainer 组件"),K.render(e(I,{})),console.log("Toast: 容器渲染完成")}catch(e){console.error("Toast: 渲染容器失败",e)}G=!1}).catch(function(e){console.error("Toast: 导入 ReactDOM 失败",e),G=!1})}}catch(e){console.error("Toast: 创建容器失败",e),G=!1}}else console.warn("Toast: 当前环境不支持 Toast 组件")},U=function(o){var r=o.children,i=l(!1),a=i[0],s=i[1];return d(function(){s(!0)},[]),t(n,{children:[r,a&&f(e(I,{}),document.body)]})},Q={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"}}},$={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"}},ee=function(n){var r=n.children,i=n.color,a=n.variant,l=void 0===a?"light":a,d=n.size,s=void 0===d?"large":d,c=n.stroke,u=void 0!==c&&c,p=n.icon,f=n.iconPosition,h=void 0===f?"none":f,m=n.className,x=void 0===m?"":m,y=n.onClick,b=v(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=F().primaryColor,C=function(e,t){if("string"==typeof e&&e in Q){var n=Q[e];return"Orange"===e&&t?g(g({},n),{fill:g(g({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var o=e.replace("#",""),r=parseInt(o.substr(0,2),16),i=parseInt(o.substr(2,2),16),a=parseInt(o.substr(4,2),16);return{light:{bg:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(r,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return Q.Green}(i,w),k=$[s],D={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===s?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===s?"1.375":"1",transition:"all 0.2s",fontSize:"large"===s?"14px":"12px",height:"small"===s?"20px":"24px"};"light"===l&&(D.backgroundColor=C.light.bg,D.color=C.light.text,u&&(D.outline="1px solid",D.outlineOffset="-1px",D.outlineColor=function(e){if("string"==typeof e&&e in Q)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),r=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(o,", ").concat(r,", 0.3)")}return"#A4F4CF"}(i))),y&&(D.cursor="pointer",D.opacity="1");var S=["rounded-md","inline-flex","justify-start","items-center",k.padding,k.gap,"font-medium","font-dm-sans","large"===s?"leading-snug":"leading-none","transition-colors","duration-200","small"===s?"h-5":"h-6"].filter(Boolean);"fill"===l&&(D.backgroundColor=C.fill.bg,D.color=C.fill.text),y&&S.push("cursor-pointer","hover:opacity-80"),x&&S.push(x);var M=S.join(" "),E=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in Q)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"}(i,w),n="small"===s?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?o.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",g({className:M,style:D,onClick:y},b,{children:["leading"===h&&E(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(k.textSize," font-medium font-dm-sans ").concat("large"===s?"leading-snug":"leading-none"),children:r})}),"after"===h&&E()]}))},te=c(function(r,i){var a=r.size,l=void 0===a?"medium":a,s=r.disabled,c=void 0!==s&&s,p=r.error,f=void 0!==p&&p,h=r.readOnly,m=void 0!==h&&h,x=r.prefix,y=r.suffix,b=r.allowClear,w=void 0!==b&&b,C=r.onClear,k=r.className,D=void 0===k?"":k,S=r.style,M=r.type,E=void 0===M?"text":M,A=r.placeholder,L=r.value,z=r.defaultValue,B=r.onChange,T=r.onFocus,W=r.onBlur,N=r.onPressEnter,I=v(r,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),R=F().primaryColor,j=void 0===R?"#FB6011":R,H=u(null),Y=o.useState(z||L||""),O=Y[0],V=Y[1],P=o.useState(!1),q=P[0],X=P[1];d(function(){"function"==typeof i?i(H.current):i&&(i.current=H.current)},[i]);var _=void 0!==L,Z=_?L:O,K=function(e){var t;e.stopPropagation(),_||V("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(t=H.current)||void 0===t||t.focus()},G=w&&Z&&!c,J={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"}},U=y||G?"40px":"12px",Q=g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":q?j:"#D7D3D0"),backgroundColor:c||m?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:x?"40px":"12px",paddingRight:U,paddingTop:J[l].paddingTop,paddingBottom:J[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S);return t(n,{children:[e("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 '}),t("div",{className:"aha-input-wrapper ".concat(D),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[x&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:x}),e("input",g({ref:H,type:E,value:Z,placeholder:A,disabled:c,readOnly:m,onChange:function(e){_||V(e.target.value),null==B||B(e)},onFocus:function(e){X(!0),null==T||T(e)},onBlur:function(e){X(!1),null==W||W(e)},onKeyDown:function(e){var t;"Enter"===e.key&&N&&N(e),null===(t=I.onKeyDown)||void 0===t||t.call(I,e)},style:Q,autoComplete:I.autoComplete||"off",autoCorrect:I.autoCorrect||"off",autoCapitalize:I.autoCapitalize||"off",spellCheck:I.spellCheck||!1},I)),(y||G)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[G&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:K,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});te.displayName="Input";var ne=function(r){var a,c=r.value,p=r.defaultValue,h=r.options,v=void 0===h?[]:h,m=r.mode,x=r.disabled,b=void 0!==x&&x,w=r.error,C=void 0!==w&&w,k=r.placeholder,D=void 0===k?"Please select":k,S=r.size,M=void 0===S?"medium":S,E=r.showSearch,A=void 0!==E&&E,L=r.filterOption,z=void 0===L||L,B=r.allowClear,T=void 0!==B&&B,W=r.onChange,N=r.onSelect,I=r.onDeselect,R=r.onSearch,j=r.onFocus,H=r.onBlur,Y=r.onDropdownVisibleChange,O=r.className,V=void 0===O?"":O,P=r.style,q=r.dropdownClassName,X=void 0===q?"":q,_=r.dropdownStyle,Z=r.defaultOpen,K=void 0!==Z&&Z,G=r.open,J=r.maxTagCount,U=r.tagRender,Q=r.optionRender,$=F().primaryColor,ee=void 0===$?"#FB6011":$,te=l(void 0!==p?p:m?[]:void 0),ne=te[0],oe=te[1],re=l(K),ie=re[0],ae=re[1],le=l(""),de=le[0],se=le[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=u(null),he=u(null),ge=u(null),ve=l(null),me=ve[0],xe=ve[1],ye=void 0!==c,be=void 0!==G,we=ye?c:ne,Ce=be?G:ie,Fe="multiple"===m||"tags"===m,ke=s(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return v.filter(function(t){return e.includes(t.value)})},[we,v]),De=s(function(){return A&&de?!1===z?v:"function"==typeof z?v.filter(function(e){return z(de,e)}):v.filter(function(e){var t=String(e.label||"").toLowerCase(),n=de.toLowerCase();return t.includes(n)}):v},[v,de,A,z]),Se=i(function(){return De()},[De]);d(function(){if(Ce&&fe.current){var e=function(){var e,t;if(fe.current){var n=fe.current.getBoundingClientRect(),o=null!==(t=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*Se.length)),r=window.innerHeight-n.bottom,i=n.top,a=r<o+4&&i>r,l=a?n.top+window.scrollY-o-4:n.bottom+window.scrollY+4;xe({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}xe(null)},[Ce,Se.length]),d(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||ae(!1),null==Y||Y(!1),se(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,Y]),d(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Se.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=Se[ue];n&&!n.disabled&&Me(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==Y||Y(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Se,ue,be,Y]),d(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Me=s(function(e){var t;if(!e.disabled)if(Fe){var n,o=Array.isArray(we)?we:[];o.includes(e.value)?(n=o.filter(function(t){return t!==e.value}),null==I||I(e.value,e)):(n=y(y([],o,!0),[e.value],!1),null==N||N(e.value,e)),ye||oe(n);var r=v.filter(function(e){return n.includes(e.value)});null==W||W(n,r)}else ye||oe(e.value),null==W||W(e.value,e),null==N||N(e.value,e),be||ae(!1),null==Y||Y(!1),se(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,v,W,N,I,Y]),Ee=s(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),o=v.find(function(e){return e.value===t});ye||oe(n),null==W||W(n,ke()),null==I||I(t,o)}},[Fe,we,ye,v,W,I,ke]),Ae=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||oe(t),null==W||W(t,[]),se("")},Le={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"}},ze=i(function(){return ke()},[ke]),Be=i(function(){return T&&we&&!b},[T,we,b]),Te=i(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),We=i(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===J?ze.slice(0,2):J?ze.slice(0,J):ze,r=J&&ze.length>n.length?ze.length-n.length:0;return t("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"4px",flex:1,minWidth:0},children:[n.map(function(n){var r={label:n.label,value:n.value,closable:!b,onClose:function(){return Ee({},n.value)}};return U?e(o.Fragment,{children:U(r)},n.value):t("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("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!b&&e("span",{onClick:function(e){return Ee(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),r>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",r]})]})},[Fe,we,ze,J,b,U]);return t(n,{children:[e("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 "}),t("div",{ref:fe,className:"aha-select ".concat(V),style:g({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(C?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:b?"#FAFAF9":"#FFFFFF",cursor:b?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Le[M].paddingTop,paddingBottom:Le[M].paddingBottom,fontSize:Le[M].fontSize,lineHeight:Le[M].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},P),onClick:function(){if(!b){var e=!Ce;be||ae(e),null==Y||Y(e),e&&A?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==j||j(e)},onBlur:function(e){null==H||H(e)},onTouchStart:function(e){b||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:b?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?We||e("span",D?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:D}:{style:{flex:1,minHeight:"24px"}}):A&&Ce?e("input",{ref:he,type:"text",value:de,onChange:function(e){var t=e.target.value;se(t),null==R||R(t),pe(-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:b?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Te?void 0:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Te?b?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Te?(null===(a=ze[0])||void 0===a?void 0:a.label)||we:D||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Be&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ae,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("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("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&me&&f(e("div",{ref:ge,className:"aha-select-dropdown ".concat(X),style:g({position:"absolute",top:"".concat(me.top,"px"),left:"".concat(me.left,"px"),width:"".concat(me.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===me.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===me.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},_),children:0===Se.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Se.map(function(n,o){var r=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=o===ue;return Q?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Me(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:Q(n,{selected:r,focused:i,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(r?"bg-[#FAFAF9]":""),onClick:function(){return Me(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e("span",{children:n.label}),r&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};ne.displayName="Select";var oe=function(t){var n=t.className,o=t.style;return e("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("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},re=function(t){var n=t.className,o=t.style;return e("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("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ie=function(t){var n=t.className,o=t.style;return e("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("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"})})},ae=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},le=function(n){var o=n.className,r=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},de=function(t){var n=t.className,o=t.style;return e("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("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"})})},se=function(t){var n=t.className,o=t.style;return e("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("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"})})},ce=function(n){var o=n.className,r=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:o,style:r,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("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("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},ue=function(o){var r=o.current,a=o.defaultCurrent,s=void 0===a?1:a,c=o.total,u=void 0===c?0:c,p=o.pageSize,f=o.defaultPageSize,h=void 0===f?10:f,v=o.showSizeChanger,m=void 0!==v&&v,x=o.pageSizeOptions,y=void 0===x?["10","20","50","100"]:x,b=o.showQuickJumper,w=void 0!==b&&b,C=o.showTotal,k=o.onChange,D=o.onShowSizeChange,S=o.simple,M=void 0!==S&&S,A=o.disabled,L=void 0!==A&&A,z=o.hideOnSinglePage,B=void 0!==z&&z,T=o.className,W=void 0===T?"":T,N=o.style,I=o.size,R=void 0===I?"default":I,j=o.responsive,H=void 0!==j&&j;o.showLessItems;var Y=o.itemRender,O=F().primaryColor,V=void 0===O?"#FB6011":O,P=l(s),q=P[0],X=P[1],_=l(h),Z=_[0],K=_[1],G=l(""),J=G[0],U=G[1],Q=null!=r?r:q,$=null!=p?p:Z,ee=i(function(){return Math.ceil(u/$)},[u,$]);d(function(){void 0!==r&&X(r)},[r]),d(function(){void 0!==p&&K(p)},[p]);var oe=function(e){e<1||e>ee||e===Q||L||(void 0===r&&X(e),null==k||k(e,$))},re=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(oe(e),U(""))};if(B&&ee<=1)return null;if(M)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(W),style:N,children:[e(E,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(de,{})}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[Q," / ",ee]}),e(E,{onClick:function(){return oe(Q+1)},disabled:L||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})})]});var ie=(Q-1)*$+1,ae=Math.min(Q*$,u);return t("div",{className:"aha-pagination w-full ".concat(W),style:g({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:H?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},N),children:[C&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(u,[ie,ae])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[u>0&&e(n,{children:Y?Y(Q-1,"prev",e(E,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(de,{})})):e(E,{onClick:function(){return oe(Q-1)},disabled:L||1===Q,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(de,{})})}),e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if(Q<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if(Q>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=Q-1;t<=Q+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===Q,o=e(E,{onClick:function(){return oe(t)},disabled:L,type:n?"primary":"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",o):o}if("jump-prev"===t)return o=e(E,{onClick:function(){return oe(Math.max(1,Q-5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y(Q-5,"jump-prev",o):o;if("jump-next"===t)return o=e(E,{onClick:function(){return oe(Math.min(ee,Q+5))},disabled:L,type:"default",size:"default"===R?"medium":"small",style:{minWidth:"small"===R?"32px":"36px",height:"small"===R?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y(Q+5,"jump-next",o):o;return null}(t)})}),u>0&&e(n,{children:Y?Y(Q+1,"next",e(E,{onClick:function(){return oe(Q+1)},disabled:L||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})})):e(E,{onClick:function(){return oe(Q+1)},disabled:L||Q===ee,type:"default",size:"default"===R?"medium":"small",style:{height:"small"===R?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})})}),m&&e(ne,{value:$,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(u/t),o=Q>n?n:Q,void 0===p&&K(t),void 0===r&&X(o),null==D||D(o,t),void(null==k||k(o,t));var t,n,o},disabled:L,size:"small"===R?"small":"medium",style:{minWidth:"small"===R?80:96}}),w&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e(te,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:re,disabled:L,size:"small"===R?"small":"medium",style:{width:56,minWidth:56}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e(E,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e(E,{onClick:re,disabled:L,type:"default",size:"default"===R?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},pe=function(n){var o=n.checked,r=void 0!==o&&o,i=n.indeterminate,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.className,u=void 0===c?"":c,p=n.style,f=n.children,h=F().primaryColor,v=r||a,m=d?"#FAFAF9":v?h:"white",x=d?"#FAFAF9":v?h:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},p),onClick:function(e){d||(null==s||s({target:{checked:!r},currentTarget:{checked:!r}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(x),backgroundColor:m,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:v?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(a?re:oe,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:r,ref:function(e){e&&(e.indeterminate=a)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};pe.displayName="Checkbox";var fe=function(o){var r=o.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e("circle",{cx:"12",cy:"12",r:"10",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},he=function(t){var n=t.loading,o=t.spinColor;if(!n)return null;var r=!0===n?e(fe,{color:o}):n;return e("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:r})},ge=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)},ve=function(e,t){var n,o;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=ge(e,t))&&void 0!==n?n:"":null!==(o=e.key)&&void 0!==o?o:""},me=function(t){var n=t.order,o=F().primaryColor;return"ascend"===n?e(le,{style:{color:o}}):"descend"===n?e(ae,{style:{color:o}}):e(ie,{})},xe=function(n){var r,a,c,p,f=n.columns,h=void 0===f?[]:f,m=n.dataSource,x=void 0===m?[]:m,b=n.rowKey,w=void 0===b?"key":b,C=n.rowSelection,k=n.pagination,D=void 0!==k&&k,S=n.size,M=void 0===S?"middle":S,E=n.bordered,A=void 0!==E&&E,L=n.loading,z=void 0!==L&&L,B=n.locale,T=n.showHeader,W=void 0===T||T,N=n.title,I=n.footer,R=n.summary,j=n.scroll,H=n.tableLayout,Y=void 0===H?"auto":H,O=n.onChange,V=n.onSorterChange,P=n.onPaginationChange,q=n.onRow,X=n.className,_=void 0===X?"":X,Z=n.innerClassName,K=void 0===Z?"":Z,G=n.style,J=n.expandable,U=n.rowClassName,Q=n.onHeaderRow;n.sticky;var $=v(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=F().primaryColor||"#FB6011",te=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),ne=te[0],oe=te[1];d(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&oe(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var re=l(new Map),ie=re[0],ae=re[1],le=l((null==J?void 0:J.defaultExpandedRowKeys)||[]),de=le[0],se=le[1],ce=l(D&&"object"==typeof D&&(D.current||D.defaultCurrent)||1),fe=ce[0],xe=ce[1],ye=l(D&&"object"==typeof D&&(D.pageSize||D.defaultPageSize)||10),be=ye[0],we=ye[1];d(function(){D&&"object"==typeof D&&(void 0!==D.current&&xe(D.current),void 0!==D.pageSize&&we(D.pageSize))},[D]);var Ce=l(null),Fe=Ce[0],ke=Ce[1],De=l(null),Se=De[0],Me=De[1],Ee=l(!1),Ae=Ee[0],Le=Ee[1],ze=u(null),Be=u(null);d(function(){var e=function(){Le(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Te=s(function(e,t){var n,o,r,i=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==i?void 0:i.disabled)){var a,l=ve(e,w);a="radio"===(null==C?void 0:C.type)?t?[l]:[]:t?y(y([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),oe(a);var d=x.filter(function(e){return a.includes(ve(e,w))});null===(o=null==C?void 0:C.onChange)||void 0===o||o.call(C,a,d),null===(r=null==C?void 0:C.onSelect)||void 0===r||r.call(C,e,t,d,new Event("select"))}},[ne,w,C,x]),We=s(function(e,t){var n,o,r=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return ve(e,w)}),i=e?r:[];oe(i);var a=x.filter(function(e){return i.includes(ve(e,w))}),l=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,i,a),null===(o=null==C?void 0:C.onSelectAll)||void 0===o||o.call(C,e,a,l)},[w,C,x]),Ne=s(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var o=new Map(ie);null===t?o.delete(n):o.set(n,t),ae(o);var r=Array.from(o.entries()).map(function(t){var n=t[0],o=t[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:o,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),V&&V(1===r.length?r[0]:r),O&&O({current:fe,pageSize:be},{},1===r.length?r[0]:r,{currentDataSource:x,action:"sort"})}},[ie,O,V,fe,be,x,h]);s(function(e,t){var n,o,r,i=ve(e,w);r=t?y(y([],de,!0),[i],!1):de.filter(function(e){return e!==i}),se(r),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(o=null==J?void 0:J.onExpandedRowsChange)||void 0===o||o.call(J,r)},[de,w,J]);var Ie,Re=s(function(){var e=y([],x,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,o){var r=h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!r)return"continue";var i=0;if("function"==typeof r.sorter)i=r.sorter(e,t);else if(!0===r.sorter){var a=ge(e,r.dataIndex||n),l=ge(t,r.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===o?i:-i}:void 0},o=0,r=Array.from(ie.entries());o<r.length;o++){var i=r[o],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[x,ie,h]),je=Re(),He=Boolean(D&&"object"==typeof D&&void 0!==D.total),Ye=i(function(){if(!1===D||!D)return je;if(He)return je;var e=(fe-1)*be,t=e+be;return je.slice(e,t)},[je,fe,be,D,He]),Oe=s(function(e,t){var n,o,r=null!=t?t:be;if(xe(e),t&&we(t),P&&P(e,r),D&&"object"==typeof D&&(null===(n=D.onChange)||void 0===n||n.call(D,e,t),t&&(null===(o=D.onShowSizeChange)||void 0===o||o.call(D,e,t))),O){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});O({current:e,pageSize:r},{},1===i.length?i[0]:i,{currentDataSource:je,action:"paginate"})}},[D,P,O,be,ie,h,je]),Ve=s(function(e,t,n){var o=ge(t,e.dataIndex||"");return e.render?e.render(o,t,n):o},[]),Pe=s(function(e,t,n){if(t){var o=!0===t?"left":t,r=0;if("left"===o){if(C&&("left"===C.fixed||!0===C.fixed))r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=h[i]).fixed||!0===a.fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return r}if("right"===o){for(i=e+1;i<h.length;i++){var a;if("right"===(a=h[i]).fixed)r+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)r+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return r}}},[h,C]),qe=s(function(){if(!W)return null;var n,o,r,i,a=h.map(function(n,o){var r,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||o,a=ie.get(i)||null,l=Pe(o,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",g({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(r=n.onHeaderCell)||void 0===r?void 0:r.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){Ne(n,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e(me,{order:a||void 0})})]})}),i)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=e("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=Ye.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),o=n.map(function(e){return ve(e,w)}),r=n.length>0&&o.every(function(e){return ne.includes(e)}),i=o.some(function(e){return ne.includes(e)}),e(pe,{checked:r,indeterminate:i&&!r,onChange:function(e){return We(e.target.checked,Ye)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(d)}var s=null==Q?void 0:Q(h,0);return e("thead",{ref:Be,children:e("tr",g({},s||{},{children:a}))})},[h,W,ie,C,ne,Ye,w,Ne,We,B,Q,Pe]),Xe=s(function(e){ke(e)},[]),_e=s(function(e,t){e.preventDefault(),Me(t)},[]),Ze=s(function(e,t){if(e.preventDefault(),null===Fe||Fe===t)return ke(null),void Me(null);var n=y([],Ye,!0),o=n[Fe];n.splice(Fe,1),n.splice(t,0,o),ke(null),Me(null)},[Fe,Ye]),Ke=s(function(){ke(null),Me(null)},[]),Ge=s(function(){var t=null==B?void 0:B.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",o=h.length+(C?1:0);return e("tr",{className:"aha-table-placeholder",children:e("td",{colSpan:o,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==B?void 0:B.emptyText,h.length,C]),Je=s(function(){return 0===Ye.length?Ge():Ye.map(function(n,r){var i,a=ve(n,w),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,r))||{},c=r===Ye.length-1;return t(o.Fragment,{children:[t("tr",g({className:"".concat("function"==typeof U?U(n,r):U||""," ").concat(Fe===r?"dragging":""," ").concat(Se===r?"drag-over":""),draggable:!0,onDragStart:function(){return Xe(r)},onDragOver:function(e){return _e(e,r)},onDrop:function(e){return Ze(e,r)},onDragEnd:Ke,style:g({cursor:"move",opacity:Fe===r?.5:1,backgroundColor:Se===r?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Fe!==r&&Se!==r&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(pe,{checked:l,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),h.map(function(t,o){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||o,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,r))||{},d=Pe(o,t.fixed,!1),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",g({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:g({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!==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"},l.style),colSpan:t.colSpan,rowSpan:t.rowSpan},l,{children:Ve(t,n,r)}),a)})]})),(null==J?void 0:J.expandedRowRender)&&d&&e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:J.expandedRowRender(n,r,0,!0)})})]},a)})},[Ye,w,ne,de,C,h,q,U,Te,Ve,J,Fe,Se,Xe,_e,Ze,Ke,Pe,Ge]),Ue=function(){var t;if(!1===D||!D)return null;var n=null!==(t=D.total)&&void 0!==t?t:je.length,o=D.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:o.includes("Right")?"flex-end":o.includes("Left")?"flex-start":"center"},children:e(ue,{current:fe,total:n,pageSize:be,showSizeChanger:D.showSizeChanger,pageSizeOptions:D.pageSizeOptions,showQuickJumper:D.showQuickJumper,showTotal:D.showTotal,onChange:Oe,onShowSizeChange:Oe,simple:D.simple,responsive:D.responsive,size:"small"===M?"small":"default"})})},Qe=i(function(){return h.some(function(e){return e.fixed})||C&&C.fixed},[h,C]),$e=i(function(){return h.every(function(e){return e.width})&&(!C||C.columnWidth)},[h,C]),et=i(function(){if(null==j?void 0:j.x){if("number"==typeof j.x)return j.x;if(!0===j.x)return h.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if(Qe)return h.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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[h,null==j?void 0:j.x,C,Qe]),tt=i(function(){return"fixed"===Y||Qe||$e||h.some(function(e){return e.width})?"fixed":Y},[Y,Qe,$e,h]),nt=g(g({width:"100%",minWidth:et?"".concat(et,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:tt,backgroundColor:"white"},A&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),ot=g({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"},G);if(Ae)return t("div",g({ref:ze,className:"aha-table aha-table-mobile-wrapper ".concat(_),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(r=D.position)||void 0===r?void 0:r.startsWith("top"))&&Ue(),(Ie="function"==typeof(null==B?void 0:B.emptyText)?B.emptyText():void 0!==(null==B?void 0:B.emptyText)?B.emptyText:"No data",0===Ye.length?e("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Ie}):e("div",{className:"aha-table-mobile",children:Ye.map(function(n,o){var r,i=ve(n,w),a=ne.includes(i);return t("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(pe,{checked:a,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(r=C.getCheckboxProps)||void 0===r?void 0:r.call(C,n).disabled})}),h.map(function(r){var i=r.key||(Array.isArray(r.dataIndex)?r.dataIndex.join("."):r.dataIndex),a=ge(n,r.dataIndex||""),l=r.render?r.render(a,n,o):a;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof r.title?r.title({}):r.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})})),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(a=D.position)||void 0===a?void 0:a.startsWith("top")))&&Ue(),e(he,{loading:z,spinColor:ee})]}));var rt={position:"relative",overflowX:(null==j?void 0:j.x)||Qe?"auto":"visible",overflowY:(null==j?void 0:j.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==j?void 0:j.x)?"100%":"number"==typeof(null==j?void 0:j.x)?"".concat(j.x,"px"):void 0,maxHeight:"number"==typeof(null==j?void 0:j.y)?"".concat(j.y,"px"):void 0,borderRadius:"8px"};return t("div",g({ref:ze,className:"aha-table ".concat(_),style:ot,"aria-busy":!!z||void 0},$,{children:[N&&e("div",{style:{marginBottom:"16px"},children:N(je)}),D&&"object"==typeof D&&(null===(c=D.position)||void 0===c?void 0:c.startsWith("top"))&&Ue(),e("div",{style:rt,children:e("div",{style:{width:"100%",minWidth:et?"".concat(et,"px"):"100%",display:"block"},children:t("table",{style:nt,className:K,children:[qe(),e("tbody",{children:Je()}),R&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:R(je)})})})]})})}),I&&e("div",{style:{marginTop:"16px"},children:I(je)}),D&&("object"!=typeof D||!(null===(p=D.position)||void 0===p?void 0:p.startsWith("top")))&&Ue(),e(he,{loading:z,spinColor:ee})]}))},ye=function(n){var o=n.checked,r=void 0!==o&&o,i=n.disabled,a=void 0!==i&&i,l=n.onChange,d=n.className,s=void 0===d?"":d,c=n.style,u=n.children,p=n.value,f=n.name,h=F().primaryColor,v=void 0===h?"#FB6011":h,m=a?"#FAFAF9":r?v:"white",x=a?"#FAFAF9":r?v:"#D7D3D0";return t("div",{className:"aha-radio ".concat(s),style:g({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},c),onClick:function(e){a||(null==l||l({target:{checked:!r,value:p},currentTarget:{checked:!r,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(x),backgroundColor:m,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:r?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:r,onChange:l,disabled:a,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};ye.displayName="Radio";var be=function(n){var r=n.items,a=void 0===r?[]:r,c=n.variant,p=void 0===c?"underline":c,f=n.layout,h=void 0===f?"equal":f,m=n.defaultValue,x=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,C=n.mode,k=void 0===C?"children":C,D=n.scrollable,S=void 0!==D&&D,M=v(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),E=F().primaryColor;if(!a||0===a.length)return null;var A=i(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),L=void 0!==x,z=A.length>0?A[0].key:"",B=function(e){if(void 0===e)return z;var t=A.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),o=Number(e);return!isNaN(n)&&!isNaN(o)&&n===o});return t?t.key:z},T=l(function(){var e,t=null!==(e=null!=x?x:m)&&void 0!==e?e:z;return B(t)}),W=T[0],N=T[1],I=L?void 0!==x?B(x):z:W;d(function(){console.log("[Tab Debug] currentValue:",I,"type:",typeof I),console.log("[Tab Debug] normalizedItems:",A.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",x,"isControlled:",L)},[I,A,x,L]);var R=s(function(e,t){if(!t){L||N(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),S&&"underline"===p){var o=Y.current[O(e)],r=q.current;if(o&&r){Z.current=!0;var i,l=function(){if(r&&V.current&&o){var e=r.getBoundingClientRect(),t=o.getBoundingClientRect();if(e.width>0&&t.width>0){var n=r.scrollLeft||0,i=t.left-e.left+n,a=t.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),Z.current=!1,r.removeEventListener("scroll",d)},150)};r.addEventListener("scroll",d,{passive:!0}),o.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[L,y,a,S,p]),j=A.find(function(e){if(e.key===I)return!0;if(String(e.key)===String(I))return!0;var t=Number(e.key),n=Number(I);return!isNaN(t)&&!isNaN(n)&&t===n}),H=E||"#FB6011",Y=u({}),O=function(e){return String(e)},V=u(null),P=u(null),q=u(null),X=u(null),_=u("");u(new Set);var Z=u(!1),K=l({width:0,left:0,opacity:0}),G=K[0],J=K[1],U=l({width:0,left:0,opacity:0}),Q=U[0],$=U[1],ee=s(function(){"underline"===p&&q.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(V.current&&q.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=q.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=q.current.scrollLeft||0,i=o.left-n.left+r,a=o.width,l="".concat(i,"px"),d="".concat(a,"px");J(function(e){return e.left===l&&e.width===d&&1===e.opacity?e:{width:d,left:l,opacity:1}})}}}})})},[p,I,A]),te=s(function(){"background"===p&&X.current&&P.current&&I&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&X.current){var e=Y.current[O(I)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=X.current.getBoundingClientRect(),o=e.getBoundingClientRect();if(0!==n.width&&0!==o.width){var r=o.left-n.left,i=o.width,a="".concat(r,"px"),l="".concat(i,"px");$(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[p,I,A]);d(function(){I?_.current!==I&&(_.current=I,"underline"===p&&q.current&&!Z.current&&ee(),"background"===p&&X.current&&P.current&&te()):_.current=""},[I,p,A.length,L,ee,te]),d(function(){if(I){var e=setTimeout(function(){if("underline"===p)(e=Y.current[O(I)])&&q.current&&V.current&&(ee(),S&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=Y.current[O(I)])&&X.current&&P.current){var t=X.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var o=n.left-t.left,r=n.width,i="".concat(o,"px"),a="".concat(r,"px");$({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),d(function(){if(S&&"underline"===p&&I&&!Z.current){var e=setTimeout(function(){var e=Y.current[O(I)],t=q.current;if(e&&t){Z.current=!0;var n,o=function(){if(t&&V.current&&e){var n=t.getBoundingClientRect(),o=e.getBoundingClientRect();if(n.width>0&&o.width>0){var r=t.scrollLeft||0,i=o.left-n.left+r,a=o.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},r=function(){o(),clearTimeout(n),n=setTimeout(function(){o(),Z.current=!1,t.removeEventListener("scroll",r)},150)};t.addEventListener("scroll",r,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){o()})})}},50);return function(){return clearTimeout(e)}}},[I,S,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},S&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",g({ref:q,className:"aha-tab aha-tab--underline ".concat(S?"aha-tab--scrollable":""," ").concat(w),style:ne},M,{children:[e("div",{ref:V,style:g({position:"absolute",bottom:"0px",height:"2px",backgroundColor:H,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"},G)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p}),t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:S?0:void 0,whiteSpace:S?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=o.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:20,height:20,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?H:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:20,height:20,style:{color:r?H:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:r?H:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:r?H:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===h?"100%":"fit-content",t("div",g({ref:X,className:"aha-tab aha-tab--background aha-tab--".concat(h," ").concat(w),style:n},M,{children:[e("div",{ref:P,style:g({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"},Q)}),A.map(function(n){var r=function(){if(n.key===I)return!0;if(String(n.key)===String(I))return!0;var e=Number(n.key),t=Number(I);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:I,currentValueType:typeof I,isActive:r,variant:p});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===h?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return R(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return o.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.cloneElement(n.icon,{width:16,height:16,style:g(g({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:o.createElement(n.icon,{width:16,height:16,style:{color:r?"#44403C":"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:r?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("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("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:r?"#FFF6ED":"#FAFAF9",border:r?"1px solid #FFD1A9":"1px solid #E7E5E4",color:r?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),S&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===k&&(null==j?void 0:j.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:j.children})]})},we=function(o){var r=o.percent,i=void 0===r?0:r,a=o.type,s=void 0===a?"circle":a,c=o.width,p=void 0===c?120:c,f=o.title,h=o.titlePosition,m=o.showPercent,x=void 0===m||m,y=o.animated,b=void 0!==y&&y,w=o.status,C=void 0===w?"normal":w,k=o.className,D=void 0===k?"":k,S=o.style,M=o.strokeColor,E=o.trailColor,A=void 0===E?"#F5F5F4":E,L=v(o,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),z=F().primaryColor,B=Math.min(100,Math.max(0,i)),T=u(!0),W=l(!1),N=W[0],I=W[1],R=l(0),j=R[0],H=R[1];d(function(){if(b&&T.current&&B>0){T.current=!1,H(0),I(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){H(B)})});var e=setTimeout(function(){I(!1),H(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,I(!1),H(B)):H(B)},[b,B]);var Y=M||z||"#FB6011";"success"===C?Y="#00BC7D":"exception"===C&&(Y="#FB2C36");var O=h||"inside",V=Math.max(4,Math.round(.06*p)),P=(p-V)/2,q="semicircle"===s?p/2:p,X="14px",_="12px",Z=function(){var o=f&&"outside"===O?p+4+18+4:p,r=2*Math.PI*P,i=r-(N?j:B)/100*r;return t("div",{style:{position:"relative",width:p,height:o,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:r,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("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("div",{style:{fontSize:X,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),x&&e("div",{style:{fontSize:_,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[x&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:_,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},K=g({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},S);return e("div",g({className:"aha-progress aha-progress--".concat(s," ").concat(D),style:K},L,{children:function(){switch(s){case"circle":return Z();case"semicircle":return r=V/2,i=p-V/2,a=(o=q+V)-V/2,l=q/2+V/2+V/2,d=f&&"outside"===O?o+4+18+4:o,c=Math.PI*P,u=c-(N?j:B)/100*c,t("div",{style:{position:"relative",width:p,height:d,overflow:"hidden"},children:[t("svg",{width:p,height:o,viewBox:"0 0 ".concat(p," ").concat(o),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("path",{d:"M ".concat(r," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:N?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),x&&e("div",{style:{fontSize:_,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[x&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:_,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(o,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),Z()}var o,r,i,a,l,d,c,u}()}))},Ce=c(function(r,i){var a=r.disabled,l=void 0!==a&&a,s=r.error,c=void 0!==s&&s,p=r.readOnly,f=void 0!==p&&p,h=r.showCount,m=void 0!==h&&h,x=r.maxLength,y=r.className,b=void 0===y?"":y,w=r.style,C=r.placeholder,k=r.value,D=r.defaultValue,S=r.rows,M=void 0===S?3:S,E=r.autoSize,A=void 0!==E&&E,L=r.onChange,z=r.onFocus,B=r.onBlur,T=v(r,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur"]),W=F().primaryColor,N=void 0===W?"#FB6011":W,I=u(null),R=o.useState(D||k||""),j=R[0],H=R[1],Y=o.useState(!1),O=Y[0],V=Y[1],P=o.useState(void 0),q=P[0],X=P[1];d(function(){"function"==typeof i?i(I.current):i&&(i.current=I.current)},[i]);var _=void 0!==k,Z=_?k:j,K=String(Z||"").length;d(function(){if(A&&I.current){var e=I.current,t="object"==typeof A&&A.minRows||1,n="object"==typeof A?A.maxRows:void 0;e.style.height="auto";var o=e.scrollHeight,r=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*r,a=n?n*r:void 0,l=Math.max(o,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),X(l)}},[Z,A]);var G=g(g({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(c?"#F04438":O?N:"#D7D3D0"),backgroundColor:l||f?"#FAFAF9":"#FFFFFF",color:l?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",padding:"12px 14px",boxShadow:"0 1px 2px rgba(10, 13, 18, 0.05)",transition:"all 0.2s",outline:"none",resize:A?"none":"vertical",cursor:l?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==q&&A?{height:"".concat(q,"px")}:{}),w);return t(n,{children:[e("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 "}),t("div",{className:"aha-textarea-wrapper ".concat(b),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[e("textarea",g({ref:I,value:Z,placeholder:C,disabled:l,readOnly:f,rows:A?void 0:M,maxLength:x,onChange:function(e){_||H(e.target.value),null==L||L(e)},onFocus:function(e){V(!0),null==z||z(e)},onBlur:function(e){V(!1),null==B||B(e)},style:G,autoComplete:T.autoComplete||"off",autoCorrect:T.autoCorrect||"off",autoCapitalize:T.autoCapitalize||"off",spellCheck:T.spellCheck||!1},T)),(m||x)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:l?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:x?t("span",{children:[K," / ",x]}):e("span",{children:K})})]})]})});Ce.displayName="Textarea";var Fe=function(n){var r=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,h=void 0===f?"default":f,v=n.loading,m=void 0!==v&&v,x=n.className,y=void 0===x?"":x,b=n.style,w=F().primaryColor,C=void 0===w?"#FB6011":w,k=o.useState(a),D=k[0],S=k[1],M=void 0!==r,E=M?r:D,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[h],L=E||m,z=d?"#E7E5E4":L?C:"#F5F5F4",B=L?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":E,disabled:d||m,onClick:function(e){if(!d&&!m){var t=!E;M||S(t),null==s||s(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:g({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:L?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===h?"10px":"12px",backgroundColor:z,cursor:d||m?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:L?"6px":"auto",right:L?"auto":"6px",fontSize:A.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:d?.5:1,zIndex:1,pointerEvents:"none"},children:L?u:p}),e("span",{style:{position:"absolute",left:B,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:m&&t("svg",{width:"small"===h?"8":"10",height:"small"===h?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};Fe.displayName="Switch";var ke=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],De=["January","February","March","April","May","June","July","August","September","October","November","December"],Se=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),o=e.getMonth(),r=String(o+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),De[o]).replace(new RegExp("","g"),ke[o]).replace(new RegExp("","g"),r).replace(new RegExp("","g"),String(o+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},Me=function(e,t){return new Date(e,t+1,0).getDate()},Ee=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},Ae=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Le=function(o){var r=o.mode,a=void 0===r?"date":r,c=o.disabled,p=void 0!==c&&c,h=o.error,v=void 0!==h&&h,m=o.placeholder,x=void 0===m?"Select date":m,y=o.startPlaceholder,b=void 0===y?"Start date":y,w=o.endPlaceholder,C=void 0===w?"End date":w,k=o.size,D=void 0===k?"medium":k,S=o.allowClear,M=void 0!==S&&S,E=o.format,A=void 0===E?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":E,L=o.onFocus,z=o.onBlur,B=o.onOpenChange,T=o.className,W=void 0===T?"":T,N=o.style,I=o.dropdownClassName,R=void 0===I?"":I,j=o.dropdownStyle,H=o.defaultOpen,Y=void 0!==H&&H,O=o.open,V=o.minDate,P=o.maxDate,q=o.separator,X=void 0===q?" - ":q,_=o.presetRanges,Z=void 0!==_&&_,K=o.calendarCount,G=void 0===K?1:K,J=o.showApplyCancel,U=void 0!==J&&J,Q=o.applyText,$=void 0===Q?"Apply":Q,ee=o.cancelText,te=void 0===ee?"Cancel":ee,ne=o.onApply,oe=o.onCancel,re=o.showSelectedRange,ie=void 0!==re&&re,ae=o.startSelectedRangeText,le=void 0===ae?"Select dates":ae,de=o.endSelectedRangeText,se=void 0===de?"Select dates":de,ce=o.rangeDisplayMode,ue=void 0===ce?"range":ce,pe=F().primaryColor,fe=void 0===pe?"#FB6011":pe,he="range"===a,ge=l(function(){return"date"===a&&"defaultValue"in o&&o.defaultValue||null}),ve=ge[0],me=ge[1],xe=l(function(){return"range"===a&&"defaultValue"in o&&o.defaultValue||{startDate:null,endDate:null}}),ye=xe[0],be=xe[1],we=l(Y),Ce=we[0],Fe=we[1],ke=l(!0),Le=ke[0],ze=ke[1],Be=l(null),Te=Be[0],We=Be[1],Ne=l(function(){var e,t;if("date"===a&&"value"in o&&o.value&&(t=o.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in o&&o.value&&(t=(e=o.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in o&&o.defaultValue&&(t=o.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in o&&o.defaultValue&&(t=(e=o.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),Ie=Ne[0],Re=Ne[1],je=l(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),He=je[0],Ye=je[1];d(function(){if(2===G&&he){var e=new Date(Ie.year,Ie.month+1,1);Ye({year:e.getFullYear(),month:e.getMonth()})}else Ye(null)},[Ie,G,he]);var Oe=u(null),Ve=u(null),Pe=u(null),qe=u(null),Xe=u(null),_e=l(null),Ze=_e[0],Ke=_e[1],Ge=u(!1),Je=u(!1),Ue=u(null),Qe="value"in o&&void 0!==o.value,$e=void 0!==O,et=he?null:Qe&&"date"===a&&"value"in o?o.value:ve,tt=he?Qe&&"range"===a&&"value"in o?o.value||{startDate:null,endDate:null}:ye:{startDate:null,endDate:null},nt=$e?O:Ce;d(function(){if(nt&&!Ge.current){if(he){var e=tt.startDate||tt.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Re({year:t,month:n})}else{var o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}}else if(et){t=et.getFullYear(),n=et.getMonth();Re({year:t,month:n})}else{o=new Date;Re({year:o.getFullYear(),month:o.getMonth()})}Ge.current=!0}else nt||(Ge.current=!1)},[nt,et,tt,he]),d(function(){if(nt&&Oe.current){Je.current=!1,Ue.current=null;var e=function(){if(Oe.current){var e=Oe.current.getBoundingClientRect();if(Je.current&&null!==Ue.current){var t,n=Ue.current;if(Xe.current){var o=Xe.current.offsetHeight;t="top"===n?e.top+window.scrollY-o-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Ke({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var r=e.bottom+window.scrollY+4,i="bottom";Ke({top:r,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Xe.current){var t=Xe.current.offsetHeight,n=window.innerHeight-e.bottom-4,o=e.top-4;(n<t&&o>=t||n<t&&o<t&&o>n)&&(r=e.top+window.scrollY-t-4,i="top"),Je.current=!0,Ue.current=i}Ke({top:r,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Ke(null),Je.current=!1,Ue.current=null},[nt]),d(function(){var e=function(e){var t=e.target;Oe.current&&!Oe.current.contains(t)&&Xe.current&&!Xe.current.contains(t)&&($e||Fe(!1),null==B||B(!1))};if(nt)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[nt,$e,B]);var ot,rt,it,at,lt=s(function(e){var t;Ae(e,V,P)&&(Qe||me(e),"date"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Fe(!1),null==B||B(!1))},[Qe,$e,a,o,B,V,P]),dt=s(function(e){var t;if(Ae(e,V,P)){var n,r=U&&Te?Te:tt;r.startDate&&r.endDate?(n={startDate:e,endDate:null},ze(!1)):Le?r.endDate&&e>r.endDate?(n={startDate:r.endDate,endDate:e},ze(!1)):(n={startDate:e,endDate:r.endDate},r.endDate?(ze(!0),U||($e||Fe(!1),null==B||B(!1))):ze(!1)):r.startDate&&e<r.startDate?(n={startDate:e,endDate:r.startDate},ze(!1)):(n={startDate:r.startDate,endDate:e},ze(!0),U||($e||Fe(!1),null==B||B(!1))),U?We(n):(Qe||be(n),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,n)))}},[Le,tt,Te,U,Qe,$e,a,o,B,V,P]),st=function(e){var t,n;if(e.stopPropagation(),he){var r={startDate:null,endDate:null};Qe||be(r),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,r)),ze(!0)}else Qe||me(null),"date"===a&&"onChange"in o&&(null===(n=o.onChange)||void 0===n||n.call(o,null));if(!nt){var i=new Date;Re({year:i.getFullYear(),month:i.getMonth()})}},ct=function(){if(!p){var e=!nt;if($e||Fe(e),null==B||B(e),e){if(he){if(ze(!tt.startDate),U&&We(tt),!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else if(!et){t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else!e&&U&&We(null)}},ut=i(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var o=new Date(e),r=new Date(e),i=e.getDate();r.setMonth(e.getMonth()-1),r.getDate()!==i&&r.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:r,endDate:o}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),pt=i(function(){return Array.isArray(Z)?Z:!0===Z?ut:[]},[Z,ut]),ft=pt.length>0,ht=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),r=e.startDate.getMonth();Re({year:n,month:r})}U?We(e):(Qe||be(e),"range"===a&&"onChange"in o&&(null===(t=o.onChange)||void 0===t||t.call(o,e)),$e||Fe(!1),null==B||B(!1))},gt=function(){Re(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},vt=function(){Re(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},mt=s(function(e,t){for(var n=Me(e,t),o=[],r=1;r<=n;r++)o.push(new Date(e,t,r));return o},[]),xt=i(function(){return mt(Ie.year,Ie.month)},[Ie,mt]),yt=i(function(){return 2===G&&he&&He?mt(He.year,He.month):null},[G,he,He,mt]),bt=function(){He&&Ye(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},wt=function(){He&&Ye(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},Ct={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"}},Ft=M&&!p&&(he?tt.startDate||tt.endDate:et),kt=et?Se(et,A):"",Dt=tt.startDate?Se(tt.startDate,A):"",St=tt.endDate?Se(tt.endDate,A):"",Mt=i(function(){if(!he||"text"!==ue)return"";if(tt.startDate&&tt.endDate){var e=Se(tt.startDate,"MMM D, YYYY"),t=Se(tt.endDate,"MMM D, YYYY");return"".concat(e," ").concat(X," ").concat(t)}return tt.startDate?Se(tt.startDate,"MMM D, YYYY"):tt.endDate?Se(tt.endDate,"MMM D, YYYY"):""},[he,ue,tt,X]),Et=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:Oe,className:"aha-date-picker ".concat(W),style:g({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(v?"#F04438":nt?fe:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:Ft?"30px":"12px",paddingTop:Ct[D].paddingTop,paddingBottom:Ct[D].paddingBottom,fontSize:Ct[D].fontSize,lineHeight:Ct[D].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},N),onClick:ct,onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},tabIndex:p?-1:0,children:[e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),he?"text"===ue?e("input",{ref:Ve,type:"text",value:Mt,readOnly:!0,placeholder:x,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate||tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Pe,type:"text",value:Dt,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!0),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e("span",{style:{color:p?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:X}),e("input",{ref:qe,type:"text",value:St,readOnly:!0,placeholder:C,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(ze(!1),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Re({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Ve,type:"text",value:kt,readOnly:!0,placeholder:x,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":et?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),Ft&&e("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:st,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),nt&&Ze&&f(e("div",{ref:Xe,className:"aha-date-picker-dropdown ".concat(R),style:g({position:"absolute",top:"".concat(Ze.top,"px"),left:"".concat(Ze.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(Ze.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(Ze.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},j),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:he&&ft&&1===G?"column":"row"},children:[he&&ft&&2===G&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:pt.map(function(t,n){var o=Te?Ee(t.range.startDate,Te.startDate)&&Ee(t.range.endDate,Te.endDate):Ee(t.range.startDate,tt.startDate)&&Ee(t.range.endDate,tt.endDate);return e("div",{onClick:function(){return ht(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",fontWeight:o?500:400,transition:"all 0.2s"},onMouseEnter:function(e){o||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){o||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),t("div",{children:[e("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===G?"row":"column",gap:2===G?"24px":"0"},children:(at=function(n,o,r,i,a){return void 0===a&&(a=0),t("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:2===G&&he?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===G&&he&&1===a)&&e("button",{type:"button",onClick:r,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",left:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[De[n.month]," ",n.year]}),!(2===G&&he&&0===a)&&e("button",{type:"button",onClick:i,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",right:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),he&&ie&&1===G&&0===a&&(l=U&&Te?Te:tt,d=l.startDate?Se(l.startDate,"MMM D, YYYY"):le,s=l.endDate?Se(l.endDate,"MMM D, YYYY"):se,t("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.startDate?"text-[#44403C]":"text-[#79716B]"),children:d}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),he&&ft&&1===G&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:pt.map(function(t,n){var o=Te?Ee(t.range.startDate,Te.startDate)&&Ee(t.range.endDate,Te.endDate):Ee(t.range.startDate,tt.startDate)&&Ee(t.range.endDate,tt.endDate);return e("button",{type:"button",onClick:function(){return ht(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:o?fe:"#1C1917",backgroundColor:o?"#FAFAF9":"transparent",border:"none",fontWeight:o?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Et.map(function(t){return e("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var r,i,a=(r=n.year,i=n.month,new Date(r,i,1).getDay()),l=(0===a?7:a)-1,d=[],s=0;s<l;s++)d.push(e("div",{},"empty-".concat(s)));return o.forEach(function(o,r){if(o){var i=l+r,a=o.getMonth()===n.month,s=Ee(o,new Date),c=!Ae(o,V,P);if(he){var u=U&&Te?Te:tt,p=Ee(o,u.startDate),f=Ee(o,u.endDate),h=function(e,t,n){if(!t||!n)return!1;var o=e.getTime(),r=t.getTime(),i=n.getTime();return o>=r&&o<=i}(o,u.startDate,u.endDate),g=i%7==0,v=i%7==6,m=p,x=f,y={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(m||x)y.background=fe,y.borderRadius="50%",y.color="#FFFFFF",y.fontWeight=500;else if(h){y.background="#F5F5F4",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;var b=1===o.getDate(),w=Me(n.year,n.month),C=o.getDate()===w,F=g||b,k=v||C;F&&k?y.borderRadius="18px":F?(y.borderTopLeftRadius="18px",y.borderBottomLeftRadius="18px",y.borderTopRightRadius="0",y.borderBottomRightRadius="0"):k?(y.borderTopRightRadius="18px",y.borderBottomRightRadius="18px",y.borderTopLeftRadius="0",y.borderBottomLeftRadius="0"):y.borderRadius="0"}else y.background="transparent",y.borderRadius="50%",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;d.push(t("button",{type:"button",disabled:c,onClick:function(){return dt(o)},style:y,onMouseEnter:function(e){c||m||x||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){m||x||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[o.getDate(),s&&e("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:m||x?"#FFFFFF":fe}})]},"date-".concat(r)))}else{var D=Ee(o,et);d.push(t("button",{type:"button",disabled:c,onClick:function(){return lt(o)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:D?fe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:D?500:400,color:D?"#FFFFFF":a?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||D||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){D||(e.currentTarget.style.backgroundColor="transparent")},children:[o.getDate(),s&&!D&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:fe}})]},"date-".concat(r)))}}}),d}()})]},a);var l,d,s},t(n,{children:[at(Ie,xt,gt,vt,0),2===G&&he&&He&&yt&&at(He,yt,bt,wt,1)]}))}),he&&ie&&2===G&&!U&&(ot=tt,rt=ot.startDate?Se(ot.startDate,"MMM D, YYYY"):le,it=ot.endDate?Se(ot.endDate,"MMM D, YYYY"):se,e("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.startDate?"text-[#44403C]":"text-[#79716B]"),children:rt}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(ot.endDate?"text-[#44403C]":"text-[#79716B]"),children:it})]})})),he&&U&&t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[ie&&2===G&&function(){var n=Te||tt,o=n.startDate?Se(n.startDate,"MMM D, YYYY"):le,r=n.endDate?Se(n.endDate,"MMM D, YYYY"):se;return t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.startDate?"text-[#44403C]":"text-[#79716B]"),children:o}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.endDate?"text-[#44403C]":"text-[#79716B]"),children:r})]})}(),t("div",{className:"".concat(2===G?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e("button",{type:"button",onClick:function(){We(null),null==oe||oe(),$e||Fe(!1),null==B||B(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:te}),e("button",{type:"button",onClick:function(){var e;Te&&(Qe||be(Te),"range"===a&&"onChange"in o&&(null===(e=o.onChange)||void 0===e||e.call(o,Te)),null==ne||ne(Te),$e||Fe(!1),null==B||B(!1),We(null))},disabled:!Te||!Te.startDate||!Te.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Te&&Te.startDate&&Te.endDate?fe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Te&&Te.startDate&&Te.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Te&&Te.startDate&&Te.endDate&&(e.currentTarget.style.backgroundColor=fe)},children:$})]})]})]})]})}),document.body)]})};Le.displayName="DatePicker";var ze=r(null),Be=function(e){function t(n,o,r){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=o,i.errorFields=r,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Te=o.forwardRef(function(t,n){var o=t.initialValues,r=void 0===o?{}:o,a=t.onValuesChange,c=t.onFinish,f=t.onFinishFailed,h=t.labelWidth,v=void 0===h?"120px":h,y=t.labelAlign,b=void 0===y?"right":y,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,D=t.style,S=t.children,M=l(function(){var e={};return Object.keys(r).forEach(function(t){e[t]={value:r[t],error:void 0,touched:!1,validating:!1}}),e}),E=M[0],A=M[1],L=u(E);d(function(){L.current=E},[E]);var z=u({}),B=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.value},[]),T=s(function(e,t){A(function(n){var o=g({},n);if(o[e]?o[e]=g(g({},o[e]),{value:t}):o[e]={value:t,error:void 0,touched:!1,validating:!1},L.current[e]?L.current[e]=g(g({},L.current[e]),{value:t}):L.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var r={};r[e]=t;var i={};Object.keys(o).forEach(function(e){i[e]=o[e].value}),a(r,i)}return o})},[a]),W=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.error},[]),N=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{error:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{error:t}):o[e]={value:void 0,error:t,touched:!1,validating:!1},o})},[]),I=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.touched)||!1},[]),R=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{touched:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{touched:t}):o[e]={value:void 0,error:void 0,touched:t,validating:!1},o})},[]),j=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.validating)||!1},[]),H=s(function(e,t){L.current[e]&&(L.current[e]=g(g({},L.current[e]),{validating:t})),A(function(n){var o=g({},n);return o[e]?o[e]=g(g({},o[e]),{validating:t}):o[e]={value:void 0,error:void 0,touched:!1,validating:t},o})},[]),Y=u();Y.current=function(e,t){A(function(n){if(n[e]){var o=n[e].rules||[],i=t.rules||[],a=o.length===i.length;if(a&&o.length>0)for(var l=0;l<o.length;l++){var d=o[l],s=i[l];if((null==d?void 0:d.required)!==(null==s?void 0:s.required)||(null==d?void 0:d.message)!==(null==s?void 0:s.message)||(null==d?void 0:d.type)!==(null==s?void 0:s.type)||(null==d?void 0:d.pattern)!==(null==s?void 0:s.pattern)||(null==d?void 0:d.min)!==(null==s?void 0:s.min)||(null==d?void 0:d.max)!==(null==s?void 0:s.max)||(null==d?void 0:d.len)!==(null==s?void 0:s.len)||(null==d?void 0:d.whitespace)!==(null==s?void 0:s.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var c=g({},n);return c[e]?c[e]=g(g({},c[e]),{rules:t.rules,required:t.required}):c[e]={value:r[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var O=s(function(e,t){var n;null===(n=Y.current)||void 0===n||n.call(Y,e,t)},[]),V=s(function(e){delete z.current[e],A(function(t){var n=g({},t);return delete n[e],n}),delete L.current[e]},[]),P=s(function(e){return m(void 0,void 0,void 0,function(){var t,n,o,r,i,a,l,d,s;return x(this,function(c){switch(c.label){case 0:if(!(t=L.current[e]))return[2,void 0];H(e,!0),n=t.rules||[],r=0,i=n,c.label=1;case 1:if(!(r<i.length))return[3,6];if(a=i[r],l=t.value,a.required&&(null==l||""===l))return o=a.message||"".concat(e," is required"),[3,6];if(a.type&&null!=l&&""!==l&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[a.type])&&!d(l))return o=a.message||"".concat(e," must be a valid ").concat(a.type),[3,6];if(a.pattern&&null!=l&&""!==l&&!a.pattern.test(String(l)))return o=a.message||"".concat(e," format is invalid"),[3,6];if(void 0!==a.min&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))<a.min)return o=a.message||"".concat(e," must be at least ").concat(a.min),[3,6];if(void 0!==a.max&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))>a.max)return o=a.message||"".concat(e," must be at most ").concat(a.max),[3,6];if(void 0!==a.len&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))!==a.len)return o=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return o=a.message||"".concat(e," cannot be whitespace"),[3,6];if(!a.validator)return[3,5];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,a.validator(a,l)];case 3:return c.sent(),[3,5];case 4:return s=c.sent(),o=(null==s?void 0:s.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return r++,[3,1];case 6:return L.current[e]?L.current[e]=g(g({},L.current[e]),{error:o,validating:!1,touched:!0}):L.current[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},A(function(n){var r=g({},n);return r[e]?r[e]=g(g({},r[e]),{error:o,validating:!1,touched:!0}):r[e]={value:t.value,error:o,touched:!0,validating:!1,rules:t.rules,required:t.required},r}),[2,o]}})})},[]),q=s(function(e){var t=L.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},[]),X=s(function(e){return m(void 0,void 0,void 0,function(){var t,n,o,r,i;return x(this,function(a){switch(a.label){case 0:return t=L.current,n=e||Object.keys(t),o=[],[4,Promise.all(n.map(function(e){return m(void 0,void 0,void 0,function(){var n,o;return x(this,function(r){switch(r.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(e)]:[3,2];case 1:return o=r.sent(),[2,{name:e,error:o}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return 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 r=q(),i={values:r,errorFields:o},null==f||f(i),new Be("Form validation failed",r,o);return[2,q()]}})})},[P,q,f]),_=s(function(e){A(function(t){var n=g({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=g(g({},n[e]),{value:r[e],error:void 0,touched:!1,validating:!1}),L.current[e]=g({},n[e]))}),n})},[r]),Z=s(function(e){A(function(t){var n=g({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=g(g({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},L.current[t]=g({},n[t])}),a){var o={};Object.keys(n).forEach(function(e){o[e]=n[e].value}),a(e,o)}return n})},[a]),K=s(function(){return m(void 0,void 0,void 0,function(){var e;return x(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,X()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[X,c]),G=s(function(e){if(A(function(t){var n=g({},t);return e.forEach(function(e){var t=e.name,o=e.value,r=e.errors,i=r&&r.length>0?r[0]:void 0;n[t]?n[t]=g(g(g({},n[t]),void 0!==o&&{value:o}),{error:i,touched:!0}):n[t]={value:void 0!==o?o:void 0,error:i,touched:!0,validating:!1},L.current[t]=g({},n[t])}),n}),a&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return a(t,q())},0)}},[a,q]),J=s(function(e,t){t?z.current[e]=t:delete z.current[e]},[]),U=s(function(e,t){var n=z.current[e];null==n||n.scrollIntoView(g({behavior:"smooth",block:"center"},t))},[]);p(n,function(){return{getFieldValue:B,getFieldsValue:q,setFieldValue:T,setFieldsValue:Z,setFields:G,getFieldError:W,validateField:P,validateFields:X,resetFields:_,submit:K,scrollToField:U}});var Q=i(function(){return{fields:E,getFieldValue:B,setFieldValue:T,getFieldError:W,setFieldError:N,isFieldTouched:I,setFieldTouched:R,isFieldValidating:j,setFieldValidating:H,registerField:O,unregisterField:V,validateField:P,validateFields:X,resetFields:_,getFieldsValue:q,setFieldsValue:Z,setFields:G,submit:K,scrollToField:U,registerFieldRef:J,labelWidth:v,labelAlign:b}},[E,B,T,W,N,I,R,j,H,O,V,P,X,_,q,Z,G,K,U,J,v,b]),$=g({},D);return"vertical"===C?($.display="flex",$.flexDirection="column"):"inline"===C&&($.display="inline-flex",$.flexWrap="wrap",$.gap="16px"),e(ze.Provider,{value:Q,children:e("form",{className:"aha-form ".concat(k),style:$,onSubmit:function(e){return m(void 0,void 0,void 0,function(){var t;return x(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,X()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:S})})});Te.displayName="Form";var We=Te;We.Item=function(n){var r=n.name,l=n.label,c=n.htmlFor;n.labelCol,n.wrapperCol;var p=n.required,f=void 0!==p&&p,h=n.rules,v=void 0===h?[]:h;n.hasFeedback;var m=n.validateStatus,x=n.help,y=n.extra,b=n.className,w=void 0===b?"":b,C=n.style,F=n.children;n.labelAlign,n.labelWidth;var k=n.hidden,D=void 0!==k&&k,S=n.tooltip,M=a(ze),E=u(null),A=s(function(e){E.current=e,r&&(null==M?void 0:M.registerFieldRef)&&M.registerFieldRef(r,e)},[r,M]),L=(null==M?void 0:M.fields)||{};r&&M&&M.getFieldValue(r);var z=r&&M?M.getFieldError(r):void 0,B=!(!r||!M)&&M.isFieldTouched(r),T=!(!r||!M)&&M.isFieldValidating(r);r&&L[r];var W=m||(z?"error":T?"validating":B&&!z?"success":void 0),N=void 0!==x?x:z||void 0,I=u(v),R=u(f),j=u(!1),H=f||v.some(function(e){return e.required}),Y=i(function(){if(!j.current)return j.current=!0,!0;if(I.current.length!==v.length)return!0;if(I.current===v)return!1;for(var e=0;e<v.length;e++){var t=I.current[e],n=v[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},[v]);d(function(){if(r&&M)return(!I.current||Y||R.current!==f)&&(I.current=v,R.current=f,M.registerField(r,{rules:v,required:H})),function(){r&&M&&M.unregisterField(r)}},[r]);if(D)return null;return t("div",{ref:A,className:"aha-form-item ".concat(w),style:g({display:"flex",flexDirection:"column",marginBottom:"16px"},C),children:[l&&t("label",{htmlFor:c,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[l,H&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var r=n.content,i=o.useState(!1),a=i[0],l=i[1],d=o.useRef(null);return o.useEffect(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&l(!1)};if(a)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),l(!a)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(ce,{})}),a&&t("div",{ref:d,style:{position:"absolute",top:"100%",left:"50%",transform:"translateX(-50%)",marginTop:"4px",padding:"8px 12px",backgroundColor:"#1C1917",color:"#FFFFFF",fontSize:"12px",lineHeight:"18px",fontFamily:"DM Sans, sans-serif",borderRadius:"6px",whiteSpace:"nowrap",zIndex:1e3,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)"},children:[r,e("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:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:o.Children.map(F,function(e){return o.isValidElement(e)?function(e){var t,n,i,a,l,d,s,c,u;if(!o.isValidElement(e))return e;var p=g({},e.props);if(r&&M){var f=M.getFieldValue(r),h=M.setFieldValue;if(!h)return e;var v=e.type;if(v&&("object"==typeof v||"function"==typeof v)&&"displayName"in v){var m=v.displayName;if("Input"===m||"Textarea"===m){p.value=f||"";var x=null===(t=e.props)||void 0===t?void 0:t.onChange,y=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){h(r,e.target.value),null==x||x(e),r&&M&&setTimeout(function(){M.validateField(r)},0)},p.onBlur=function(e){r&&M&&(M.setFieldTouched(r,!0),M.validateField(r)),null==y||y(e)},p.error="error"===W}else if("Select"===m){p.value=f;var b=null===(i=e.props)||void 0===i?void 0:i.onChange,w=null===(a=e.props)||void 0===a?void 0:a.onBlur;p.onChange=function(e,t){h(r,e),null==b||b(e,t),r&&M&&(M.setFieldTouched(r,!0),setTimeout(function(){M.validateField(r)},0))},p.onBlur=function(e){r&&M&&(M.setFieldTouched(r,!0),M.validateField(r)),null==w||w(e)},p.error="error"===W}else if("Switch"===m){p.checked=f||!1;var C=null===(l=e.props)||void 0===l?void 0:l.onChange;p.onChange=function(e,t){h(r,e),null==C||C(e,t),r&&M&&(M.setFieldTouched(r,!0),setTimeout(function(){M.validateField(r)},0))}}else if("Checkbox"===m){p.checked=f||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;p.onChange=function(e){h(r,e.target.checked),null==F||F(e),r&&M&&(M.setFieldTouched(r,!0),setTimeout(function(){M.validateField(r)},0))}}else if("Radio"===m){var k=null===(s=e.props)||void 0===s?void 0:s.value;if(void 0!==k){p.checked=f===k;var D=null===(c=e.props)||void 0===c?void 0:c.onChange;p.onChange=function(e){h(r,k),null==D||D(e),r&&M&&(M.setFieldTouched(r,!0),setTimeout(function(){M.validateField(r)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.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;h(r,o),null==S||S(e)}}}return"error"===W&&"error"in p&&(p.error=!0),o.cloneElement(e,p)}(e):e})}),N&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===W?"#D92D20":"warning"===W?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:N}),y&&!N&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:y})]})]})},We.useForm=function(){return[u(null)]};var Ne=function(n){var r=n.items,i=void 0===r?[]:r,a=n.userProfile,d=n.selectedKeys,c=n.defaultSelectedKeys,p=void 0===c?[]:c,f=n.onSelect,h=n.onDeselect,v=n.onClick,m=n.className,x=void 0===m?"":m,b=n.style,w=n.width,C=void 0===w?320:w;F().primaryColor;var k=u(null),D=u({}),S=void 0!==d,M=l(p),E=M[0],A=M[1],L=S?d:E,z=function(e){return"children"in e&&Array.isArray(e.children)},B=s(function(e,t,n){void 0===n&&(n=[]);for(var o=0,r=t;o<r.length;o++){var i=r[o];if(z(i)){var a=B(e,i.children,n);if(a)return a}else{var l=i,d=y(y([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),T=s(function(e){var t;if(!e.disabled){var n,o=B(e.key,i)||[e.key];L.includes(e.key)?(n=L.filter(function(t){return t!==e.key}),null==h||h({key:e.key,keyPath:o,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:o,selectedKeys:n})),S||A(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:o}),e.skipGlobalClick||null==v||v({key:e.key,keyPath:o})}},[L,S,f,h,v,i,B]),W=function(n){var o=L.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,o)},n.key);var r=g({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){D.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:r,onClick:function(){return T(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label}),n.suffixIcon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.suffixIcon})]},n.key)},N=g({width:"number"==typeof C?"".concat(C,"px"):C,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"},b),I=function(e,t){if(0===e)return!1;var n=t[e],o=t[e-1];return!!z(o)||!(!z(n)||z(o))};return t("div",{ref:k,className:"aha-menu-list ".concat(x),style:N,children:[a&&(a?a.render?a.render(a):e("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e("div",{children:i.map(function(n,r){return t(o.Fragment,{children:[I(r,i)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),z(n)?(a=n,e("div",{className:"aha-menu-group ".concat(a.className||""),children:a.children.map(function(e){return W(e)})},"group-".concat(a.title))):W(n)]},r);var a})})]})};Ne.displayName="MenuList";var Ie=function(e,t,n,o){void 0===o&&(o=6);var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,d=o+6,s=0,c=0;switch(n){case"top":s=e.top-t.height-d+i,c=a-t.width/2+r;break;case"bottom":default:s=e.bottom+d+i,c=a-t.width/2+r;break;case"left":s=l-t.height/2+i,c=e.left-t.width-d+r;break;case"right":s=l-t.height/2+i,c=e.right+d+r;break;case"top-left":s=e.top-t.height-d+i,c=e.left+r;break;case"top-right":s=e.top-t.height-d+i,c=e.right-t.width+r;break;case"bottom-left":s=e.bottom+d+i,c=e.left+r;break;case"bottom-right":s=e.bottom+d+i,c=e.right-t.width+r}var u=window.innerWidth,p=window.innerHeight;return c<r+8?c=r+8:c+t.width>r+u-8&&(c=r+u-t.width-8),s<i+8?s=i+8:s+t.height>i+p-8&&(s=i+p-t.height-8),{top:s,left:c}},Re=function(e,t,n,o){void 0===o&&(o=6);var r=Ie(e,t,n,o),i=r.top,a=r.left,l=window.scrollX||window.pageXOffset,d=i-(window.scrollY||window.pageYOffset),s=a-l,c=d+t.height,u=s+t.width,p=d,f=s,h=Math.max(p,e.top),g=Math.min(c,e.bottom),v=Math.max(f,e.left),m=Math.min(u,e.right);return g>h+1&&m>v+1},je=function(t,n){var o=g({position:"absolute",width:0,height:0,borderStyle:"solid"},n),r={top:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:g(g({},o),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":g(g({},o),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":g(g({},o),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:r[t]})},He=function(o){var r=o.content,i=o.children,a=o.position,c=void 0===a?"top":a,p=o.trigger,h=void 0===p?"hover":p,v=o.delay,m=void 0===v?200:v,x=o.disabled,y=void 0!==x&&x,b=o.className,w=void 0===b?"":b,C=o.tooltipClassName,F=void 0===C?"":C,k=o.gap,D=void 0===k?6:k,S=o.showArrow,M=void 0===S||S,E=o.width,A=o.defaultVisible,L=void 0!==A&&A,z=o.visible,B=o.onVisibleChange,T=void 0!==z,W=l(L),N=W[0],I=W[1],R=T?z:N,j=l(T?null!=z&&z:L),H=j[0],Y=j[1],O=s(function(e){T||I(e),null==B||B(e)},[T,B]);d(function(){T&&(z?requestAnimationFrame(function(){Y(!0)}):Y(!1))},[T,z]);var V=l(c),P=V[0],q=V[1],X=l("320px"),_=X[0],Z=X[1],K=l({position:"absolute",top:0,left:0,pointerEvents:"hover"===h?"auto":"none"}),G=K[0],J=K[1],U=l({}),Q=U[0],$=U[1],ee=u(null),te=u(null),ne=u(null),oe=u(null),re=s(function(){if(ee.current&&te.current&&R&&H){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,o){if(void 0===o&&(o=6),!Re(e,t,n,o))return n;for(var r=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);r<i.length;r++){var a=i[r];if(!Re(e,t,a,o))return a}return n}(e,t,c,D);q(n);var o=Ie(e,t,n,D),r=o.top,i=o.left;if(J(function(e){return g(g({},e),{position:"absolute",top:"".concat(r,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===h?"auto":"none",zIndex:9999})}),M){var a=function(e,t,n,o,r){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,d=t.top+(t.height-6)/2,s=o-i,c=r-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(d-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,i,r);$(a)}}},[R,c,D,M,H,h]),ie=s(function(){y||(oe.current&&(clearTimeout(oe.current),oe.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){O(!0),T||requestAnimationFrame(function(){Y(!0)})},m))},[y,m,O,T]),ae=s(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),oe.current&&clearTimeout(oe.current),T?O(!1):(Y(!1),oe.current=setTimeout(function(){O(!1),oe.current=null},150))},[O,T]),le=s(function(){"hover"===h&&(oe.current&&(clearTimeout(oe.current),oe.current=null),R||(O(!0),requestAnimationFrame(function(){Y(!0)})))},[h,R]),de=s(function(e){y||"click"!==h||(e.stopPropagation(),R?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),O(!0),requestAnimationFrame(function(){Y(!0)})))},[y,h,R,ae]);d(function(){if(L&&R&&H){var e=function(){ee.current&&te.current?re():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[L,R,H,re]),d(function(){if(R)return requestAnimationFrame(function(){re()}),window.addEventListener("scroll",re,!0),window.addEventListener("resize",re),function(){window.removeEventListener("scroll",re,!0),window.removeEventListener("resize",re)}},[R,re]),d(function(){if(R&&"click"===h){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&ae()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[R,h,ae]),d(function(){return function(){ne.current&&clearTimeout(ne.current),oe.current&&clearTimeout(oe.current)}},[]);var se={position:"absolute",top:0,left:0,opacity:H?1:0,transform:H?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===h?"auto":"none",zIndex:9999},ce=s(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);d(function(){var e=function(){Z(ce())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ce]);var ue=g(g({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==E?{width:"number"==typeof E?"".concat(E,"px"):E,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:_,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"}),pe=t("div",{style:g(g(g({},se),G),{pointerEvents:"hover"===h?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===h?le:void 0,onMouseLeave:"hover"===h?ae:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:r}),M&&je(P,Q)]}),fe=s(function(){"hover"===h&&(oe.current=setTimeout(function(){ae()},100))},[h,ae]),he="click"===h?{onClick:de}:{onMouseEnter:ie,onMouseLeave:fe,onFocus:ie,onBlur:ae};return t(n,{children:[e("div",g({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===h?"pointer":"default"}},he,{children:i})),R&&"undefined"!=typeof document&&f(pe,document.body)]})},Ye=function(e,t,n,o){switch(n){case"top":return e.top>=t.height+o+8;case"bottom":return window.innerHeight-e.bottom>=t.height+o+8;case"left":return e.left>=t.width+o+8;default:return window.innerWidth-e.right>=t.width+o+8}},Oe=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},Ve=function(o){var r,i=o.children,a=o.content,c=o.trigger,p=void 0===c?"click":c,h=o.open,v=o.defaultOpen,m=void 0!==v&&v,x=o.onOpenChange,y=o.placement,b=void 0===y?"right":y,w=o.width,C=o.offset,F=void 0===C?8:C,k=o.className,D=void 0===k?"":k,S=o.popoverClassName,M=void 0===S?"":S,E=o.disabled,A=void 0!==E&&E,L=o.destroyOnHide,z=o.destroyTooltipOnHide,B=null===(r=null!=L?L:z)||void 0===r||r,T=void 0!==h,W=l(m),N=W[0],I=W[1],R=T?!!h:N,j=l({top:0,left:0,opacity:0}),H=j[0],Y=j[1],O=u(null),V=u(null),P=s(function(e){T||I(e),null==x||x(e)},[T,x]),q=s(function(){if(R&&O.current&&V.current){var e=O.current.getBoundingClientRect(),t=V.current.getBoundingClientRect(),n=function(){if(Ye(e,t,b,F))return b;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(b);return Ye(e,t,n,F)||Oe(e,n)>Oe(e,b)?n:b}(),o=function(e,t,n,o){var r=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-o+i,left:a-t.width/2+r};case"bottom":return{top:e.bottom+o+i,left:a-t.width/2+r};case"left":return{top:l-t.height/2+i,left:e.left-t.width-o+r};default:return{top:l-t.height/2+i,left:e.right+o+r}}}(e,t,n,F),r=function(e,t,n){var o=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,d=t;return d<o+8&&(d=o+8),d+n.width>o+i-8&&(d=o+i-n.width-8),l<r+8&&(l=r+8),l+n.height>r+a-8&&(l=r+a-n.height-8),{top:l,left:d}}(o.top,o.left,t);Y({top:r.top,left:r.left,opacity:1})}},[R,b,F]),X=s(function(){A||P(!0)},[A,P]),_=s(function(){P(!1)},[P]),Z=s(function(){A||P(!R)},[A,R,P]);d(function(){if(R)return requestAnimationFrame(function(){q()}),window.addEventListener("resize",q),window.addEventListener("scroll",q,!0),function(){window.removeEventListener("resize",q),window.removeEventListener("scroll",q,!0)}},[R,q]),d(function(){if(R&&"click"===p){var e=function(e){var t=e.target;O.current&&V.current&&!O.current.contains(t)&&!V.current.contains(t)&&_()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[R,p,_]);var K="hover"===p?{onMouseEnter:X,onMouseLeave:_,onFocus:X,onBlur:_}:{onClick:function(e){e.stopPropagation(),Z()}},G=R||!B?e("div",{ref:V,className:"aha-popover ".concat(M),style:{position:"absolute",zIndex:9999,top:H.top,left:H.left,opacity:R?H.opacity:0,visibility:R?"visible":"hidden",pointerEvents:R?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof w?"".concat(w,"px"):w,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===p?X:void 0,onMouseLeave:"hover"===p?_:void 0,onMouseDown:"click"===p?function(e){return e.stopPropagation()}:void 0,children:a}):null;return t(n,{children:[e("div",g({ref:O,className:"aha-popover-trigger ".concat(D),style:{display:"inline-block",cursor:A?"not-allowed":"pointer"}},K,{children:i})),G&&"undefined"!=typeof document&&f(G,document.body)]})};Ve.displayName="Popover";var Pe=240,qe=function(n){var o=n.open,r=n.defaultOpen,a=void 0!==r&&r,c=n.onClose,u=n.afterOpenChange,p=n.title,h=n.extra,v=n.footer,m=n.children,x=n.placement,y=void 0===x?"right":x,b=n.width,w=void 0===b?378:b,C=n.height,F=void 0===C?378:C,k=n.mask,D=void 0===k||k,S=n.maskClosable,M=void 0===S||S,E=n.closable,A=void 0===E||E,L=n.closeIcon,z=n.keyboard,B=void 0===z||z,T=n.destroyOnClose,W=void 0!==T&&T,N=n.zIndex,I=void 0===N?1e3:N,R=n.mobileBreakpoint,j=void 0===R?768:R,H=n.className,Y=void 0===H?"":H,O=n.style,V=n.drawerStyle,P=n.headerStyle,q=n.bodyStyle,X=n.footerStyle,_=n.maskStyle,Z=void 0!==o,K=l(a),G=K[0],J=K[1],U=Z?!!o:G,Q=l(U),$=Q[0],ee=Q[1],te=l(U),ne=te[0],oe=te[1],re=l(!1),ie=re[0],ae=re[1],le=l(!1),de=le[0],se=le[1];d(function(){ae(!0)},[]),d(function(){var e=function(){se(window.innerWidth<j)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[j]),d(function(){if(U){ee(!0),oe(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){oe(!0)})}),t=window.setTimeout(function(){null==u||u(!0)},Pe);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}oe(!1);var n=window.setTimeout(function(){W&&ee(!1),null==u||u(!1)},Pe);return function(){return window.clearTimeout(n)}},[U,W,u]),d(function(){if(U&&B){var e=function(e){"Escape"===e.key&&(null==c||c(e),Z||J(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[U,B,c,Z]),d(function(){if(ie&&U){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[U,ie]);var ce=s(function(e){null==c||c(e),Z||J(!1)},[c,Z]),ue=i(function(){return de?"100vw":"left"===y||"right"===y?"number"==typeof w?"".concat(w,"px"):w:"100vw"},[y,de,w]),pe=i(function(){return"top"===y||"bottom"===y?"number"==typeof F?"".concat(F,"px"):F:"100vh"},[y,F]),fe=i(function(){return de&&("left"===y||"right"===y)?"bottom":y},[de,y]),he=i(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Pe,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:I+1};switch(fe){case"left":return g(g({},e),{top:0,left:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(-100%)"});case"right":return g(g({},e),{top:0,right:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(100%)"});case"top":return g(g({},e),{top:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(-100%)"});default:return g(g({},e),{bottom:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(100%)"})}},[fe,ue,pe,ne,I]);if(!ie||!$&&!U)return null;var ge=t("div",{className:"aha-drawer-root ".concat(Y),style:g({position:"fixed",inset:0,zIndex:I,pointerEvents:U||ne?"auto":"none"},O),children:[D&&e("div",{"aria-hidden":!0,onClick:M?function(e){return ce(e)}:void 0,style:g({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:ne?1:0,transition:"opacity ".concat(Pe,"ms cubic-bezier(0.2, 0, 0, 1)")},_)}),t("div",{role:"dialog","aria-modal":"true",style:g(g({},he),V),children:[(void 0!==p||A||h)&&t("div",{style:g({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},P),children:[e("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:p}),t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[h,A&&e("button",{type:"button",onClick:function(e){return ce(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:L||e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e("div",{style:g({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},q),children:m}),void 0!==v&&e("div",{style:g({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},X),children:v})]},"".concat(fe,"-").concat(U?"open":"closed"))]});return f(ge,document.body)};qe.displayName="Drawer";var Xe={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function _e(e,t,n){var o=e*Math.PI*2,r=Math.round(n.petalCount),i=n.baseRadius*Math.cos(o)-n.detailAmplitude*t*Math.cos(r*o),a=n.baseRadius*Math.sin(o)-n.detailAmplitude*t*Math.sin(r*o);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function Ze(e,t,n,o){var r=e/Math.max(1,o.particleCount-1),i=_e(function(e){return(e%1+1)%1}(t-r*o.trailSpan),n,o),a=Math.pow(1-r,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}var Ke=function(n){var o=n.width,r=void 0===o?80:o,i=n.height,a=void 0===i?80:i,s=n.strokeWidth,c=n.color,p=void 0===c?"var(--theme-color, #5A31F0)":c,f=n.className,h=l(0),g=h[0],v=h[1],m=u(null);d(function(){var e,t=function(n){null===m.current&&(m.current=n),v(n-m.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var x,y,b=g,w=(y=b%(x=Xe).pulseDurationMs/x.pulseDurationMs*Math.PI*2,.52+(Math.sin(y+.55)+1)/2*.48),C=b%Xe.durationMs/Xe.durationMs,F=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(b,Xe),k=null!=s?s:Xe.strokeWidth,D=k/Xe.strokeWidth,S=function(e,t,n){void 0===n&&(n=480);for(var o=[],r=0;r<=n;r+=1){var i=_e(r/n,e,t);o.push("".concat(0===r?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return o.join(" ")}(w,Xe),M=[],E=0;E<Xe.particleCount;E+=1){var A=Ze(E,C,w,Xe);M.push({cx:A.x,cy:A.y,opacity:A.opacity,r:A.radius*D})}return e("div",{className:f,style:{width:r,height:a,display:"inline-block",color:p},role:"status","aria-label":"Loading",children:t("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e("title",{children:"Thinking Five"}),t("g",{transform:"rotate(".concat(F," 50 50)"),children:[e("path",{d:S,stroke:"currentColor",strokeWidth:k,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),M.map(function(t,n){return e("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})};export{z as Alert,E as Button,oe as CheckIcon,pe as Checkbox,Le as DatePicker,qe as Drawer,We as Form,te as Input,Ke as Loading,Ne as MenuList,re as MinusIcon,ue as Pagination,Ve as Popover,we as Progress,ye as Radio,ne as Select,Fe as Switch,be as Tab,xe as Table,ee as Tag,Ce as Textarea,C as ThemeProvider,j as Toast,U as ToastProvider,He as Tooltip,O as clearAllToasts,Y as closeToast,V as debugToast,H as toast,q as toastError,X as toastInfo,_ as toastQuestion,P as toastSuccess,F as useTheme};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{createContext as o,useMemo as i,useContext as a,useState as l,useEffect as d,useCallback as s,forwardRef as c,useRef as u,useLayoutEffect as p,useImperativeHandle as f}from"react";import{createPortal as h}from"react-dom";var g=function(e,t){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},g(e,t)};var v=function(){return v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},v.apply(this,arguments)};function x(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function m(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{d(r.next(e))}catch(e){i(e)}}function l(e){try{d(r.throw(e))}catch(e){i(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}d((r=r.apply(e,t||[])).next())})}function y(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(d){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}}function b(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var w={primaryColor:"#FB6011"},C=o(w),F=function(t){var n=t.theme,r=t.children,o=i(function(){return v(v({},w),n)},[n]);return e(C.Provider,{value:o,children:r})},k=function(){var e=a(C);return e||w},D={sm:"sm",md:"md",lg:"lg",xl:"xl",small:"sm",mediumSmall:"sm",medium:"md",large:"xl"},S={primary:"primary",secondary:"secondary",tertiary:"tertiary","link-color":"link-color","link-gray":"link-gray","destructive-primary":"destructive-primary","destructive-secondary":"destructive-secondary","destructive-tertiary":"destructive-tertiary","destructive-link":"destructive-link",default:"secondary"},M={sm:{height:36,paddingX:12,paddingXLg:12,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:8},md:{height:40,paddingX:14,paddingXLg:14,fontSize:14,lineHeight:20,iconSize:20,gap:4,iconOnlyPad:10},lg:{height:44,paddingX:16,paddingXLg:16,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:12},xl:{height:48,paddingX:18,paddingXLg:18,fontSize:16,lineHeight:24,iconSize:20,gap:6,iconOnlyPad:14}},E=function(r){var o=r.size,i=r.color;return t(n,{children:[e("style",{children:"@keyframes aha-button-spin{from{transform:rotate(0)}to{transform:rotate(360deg)}}"}),t("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-button-spin 1s linear infinite",flexShrink:0},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:i,strokeWidth:"2",opacity:"0.25"}),e("path",{d:"M22 12a10 10 0 0 1-10 10",stroke:i,strokeWidth:"2",strokeLinecap:"round",fill:"none"})]})]})},A=function(n){var r=n.children,o=n.type,i=void 0===o?"secondary":o,a=n.size,d=void 0===a?"md":a,s=n.disabled,c=void 0!==s&&s,u=n.loading,p=void 0!==u&&u,f=n.iconOnly,h=n.focused,g=void 0!==h&&h,m=n.onClick,y=n.htmlType,b=void 0===y?"button":y,w=n.className,C=void 0===w?"":w,F=n.style,A=n.icon,L=n.iconPosition,z=void 0===L?"left":L,B=x(n,["children","type","size","disabled","loading","iconOnly","focused","onClick","htmlType","className","style","icon","iconPosition"]),T=k().primaryColor,N=l(!1),W=N[0],R=N[1],I=l(!1),H=I[0],j=I[1],Y=S[i]||"secondary",O=M[D[d]||"md"],V=null!=f?f:!!A&&null==r,P="link-color"===Y||"link-gray"===Y||"destructive-link"===Y,q=c||p,X=g,Z=T,_=function(){if(c)return"primary"===Y||"secondary"===Y||"destructive-primary"===Y||"destructive-secondary"===Y?{bg:"var(--color-bg-disabled, #f5f5f4)",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"1px solid var(--color-border-disabled_subtle, #e7e5e4)",boxShadow:"none"}:{bg:"transparent",color:"var(--color-fg-disabled, #a9a29d)",iconColor:"var(--color-fg-disabled, #a9a29d)",border:"none",boxShadow:"none"};var e=W||H;return"primary"===Y?{bg:e?"var(--color-bg-brand-solid_hover, #ec470a)":Z||"var(--color-bg-brand-solid, #fb6011)",color:"var(--color-text-white, #ffffff)",iconColor:"var(--color-brand-300, #feb073)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic, 0 1px 2px 0 rgba(10,13,18,.05))"}:"secondary"===Y?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"var(--color-bg-primary, #ffffff)",color:e?"var(--color-text-secondary_hover, #292524)":"var(--color-text-secondary, #44403c)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"tertiary"===Y?{bg:e?"var(--color-bg-primary_hover, #fafaf9)":"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:e?"var(--color-fg-quaternary_hover, #79716b)":"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none"}:"link-color"===Y?{bg:"transparent",color:e?"var(--color-text-brand-secondary_hover, #c4330a)":"var(--color-text-brand-secondary, #ec470a)",iconColor:"var(--color-fg-brand-secondary_alt, #fb6011)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"link-gray"===Y?{bg:"transparent",color:e?"var(--color-text-tertiary_hover, #44403c)":"var(--color-text-tertiary, #57534e)",iconColor:"var(--color-fg-quaternary, #a9a29d)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}:"destructive-primary"===Y?{bg:e?"var(--color-error-600)":"var(--color-error-500)",color:"var(--color-text-white)",iconColor:e?"var(--color-error-200)":"var(--color-error-300)",border:"none",boxShadow:"var(--shadow-xs-skeuomorphic)"}:"destructive-secondary"===Y?{bg:e?"var(--color-bg-error-primary)":"var(--color-bg-primary)",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"inset 0 0 0 1px var(--color-border-error_subtle), inset 0 -2px 0 0 rgba(10,13,18,0.05), 0 1px 2px 0 rgba(10,13,18,0.05)"}:"destructive-tertiary"===Y?{bg:e?"var(--color-bg-error-primary)":"transparent",color:"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none"}:{bg:"transparent",color:e?"var(--color-text-error-primary_hover)":"var(--color-text-error-primary)",iconColor:"var(--color-fg-error-secondary)",border:"none",boxShadow:"none",textDecoration:e?"underline":"none"}}(),K=function(){if(X)return"destructive-primary"===Y||"destructive-secondary"===Y||"destructive-tertiary"===Y||"destructive-link"===Y?"destructive-primary"===Y||"destructive-secondary"===Y?"var(--focus-ring-error-shadow-xs-skeuomorphic)":"var(--focus-ring-error)":"primary"===Y||"secondary"===Y?"var(--focus-ring-shadow-xs-skeuomorphic, 0 0 0 2px #fff, 0 0 0 4px #fb6011)":"var(--focus-ring, 0 0 0 2px #fff, 0 0 0 4px #fb6011)"}(),G=v({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:O.gap,fontFamily:'var(--font-family-body, "DM Sans", system-ui, sans-serif)',fontWeight:600,fontSize:O.fontSize,lineHeight:"".concat(O.lineHeight,"px"),cursor:q?"not-allowed":"pointer",outline:"none",transition:"background-color .15s ease, color .15s ease, box-shadow .15s ease",userSelect:"none",WebkitTapHighlightColor:"transparent",whiteSpace:"nowrap",backgroundColor:_.bg,color:_.color,border:_.border,boxShadow:null!=K?K:_.boxShadow,textDecoration:_.textDecoration},F);P?(G.borderRadius="4px",G.overflow="hidden",V?(G.width=O.height,G.height=O.height,G.padding=0):(G.height=O.height,G.paddingLeft=O.paddingX,G.paddingRight=O.paddingX)):(G.borderRadius="var(--radius-md, 8px)",V?(G.width=O.height,G.height=O.height,G.padding=0):(G.height=O.height,G.paddingLeft=O.paddingX,G.paddingRight=O.paddingX));var J=function(){return p?e(E,{size:O.iconSize,color:_.iconColor}):A?e("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:O.iconSize,height:O.iconSize,color:_.iconColor,flexShrink:0},children:A}):null},U=p||A&&"left"===z,$=!p&&A&&"right"===z;return t("button",v({type:b,className:["aha-button","aha-button--".concat(Y),"aha-button--".concat(D[d]||"md"),V&&"aha-button--icon-only",q&&"aha-button--disabled",p&&"aha-button--loading",X&&"aha-button--focused",C].filter(Boolean).join(" "),disabled:q,onClick:function(e){q?e.preventDefault():null==m||m(e)},onMouseEnter:function(){return!q&&R(!0)},onMouseLeave:function(){R(!1),j(!1)},onMouseDown:function(){return!q&&j(!0)},onMouseUp:function(){return j(!1)},style:G},B,{children:[U&&J(),!V&&r,$&&J(),V&&!A&&!p&&r]}))};A.displayName="Button";var L={success:e("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("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("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("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("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("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("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("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"})})},z=e("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("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"})}),B=function(n){var r=n.className,o=void 0===r?"":r,i=n.type,a=void 0===i?"info":i,d=n.title,s=n.description,c=n.icon,u=void 0===c?L[a]:c,p=n.showIcon,f=void 0===p||p,h=n.closeable,g=void 0!==h&&h,v=n.action,x=n.children,m=n.onClose,y=l(!0),b=y[0],w=y[1],C=function(){w(!1),null==m||m()},F=v||g;return b?t("div",{className:"".concat("aha-alert px-4 py-3 rounded-md flex gap-2"," ").concat(o),style:{success:{backgroundColor:"#ECFDF5"},error:{backgroundColor:"#FEF2F2"},warning:{backgroundColor:"#FFFBEB"},info:{backgroundColor:"#EFF6FF"}}[a],children:[f&&u,t("div",{className:"flex flex-col gap-1 ".concat(F?"flex-1 min-w-0":""),children:[d&&e("div",{className:"justify-start text-[#292524] text-base font-semibold font-['DM_Sans'] leading-normal",children:d}),s&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:s}),x&&e("div",{className:"w-full justify-center text-[#57534D] text-sm font-normal font-['DM_Sans'] leading-snug",children:x})]}),F&&t("div",{className:"ml-auto flex-shrink-0 self-center flex items-center gap-2",children:[v,g&&e("div",{className:"cursor-pointer relative top-[-12px]",onClick:C,onKeyDown:function(e){return"Enter"===e.key&&C()},role:"button",tabIndex:0,"aria-label":"关闭",children:z})]})]}):null},T={success:e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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("svg",{width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("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"})})},N=function(t){var n=t.className;return e("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("path",{d:"M15.4416 14.5583C15.6858 14.8025 15.6858 15.1984 15.4416 15.4425C15.32 15.5642 15.16 15.6258 15 15.6258C14.84 15.6258 14.68 15.565 14.5583 15.4425L9.99997 10.8842L5.44164 15.4425C5.31997 15.5642 5.15997 15.6258 4.99997 15.6258C4.83997 15.6258 4.67997 15.565 4.55831 15.4425C4.31414 15.1984 4.31414 14.8025 4.55831 14.5583L9.11664 10L4.55831 5.44171C4.31414 5.19754 4.31414 4.80168 4.55831 4.55751C4.80247 4.31335 5.19831 4.31335 5.44248 4.55751L10.0008 9.11587L14.5591 4.55751C14.8033 4.31335 15.1991 4.31335 15.4433 4.55751C15.6875 4.80168 15.6875 5.19754 15.4433 5.44171L10.885 10L15.4416 14.5583Z",fill:"currentColor"})})},W=function(){function e(){this.toasts=[],this.listeners=new Set}return e.prototype.addToast=function(e){var t=Math.random().toString(36).slice(-8),n={id:t,props:e};return this.toasts.push(n),console.log("Toast: 添加 Toast 到管理器,ID:",t,"当前总数:",this.toasts.length),this.notifyListeners(),t},e.prototype.removeToast=function(e){this.toasts=this.toasts.filter(function(t){return t.id!==e}),this.notifyListeners()},e.prototype.getToasts=function(){return b([],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}(),R=new W,I=function(){var r=l([]),o=r[0],i=r[1];d(function(){console.log("Toast: ToastContainer 组件已挂载");var e=R.getToasts();console.log("Toast: 初始 Toast 数量:",e.length),i(e);var t=R.subscribe(function(){var e=R.getToasts();console.log("Toast: 收到 Toast 更新,当前数量:",e.length,"Toast IDs:",e.map(function(e){return e.id})),i(e)});return t},[]);var a=o.filter(function(e){return"top-left"===e.props.position}),s=o.filter(function(e){return"top-right"===e.props.position}),c=o.filter(function(e){return"bottom-left"===e.props.position}),u=o.filter(function(e){return"bottom-right"===e.props.position});return t(n,{children:[e("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:a.map(function(t){return e(H,v({},t),t.id)})}),e("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:s.map(function(t){return e(H,v({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",left:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:c.map(function(t){return e(H,v({},t),t.id)})}),e("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9999,pointerEvents:"none",display:"flex",flexDirection:"column",gap:"8px"},children:u.map(function(t){return e(H,v({},t),t.id)})})]})},H=function(n){var r=n.id,o=n.props,i=l(!1),a=i[0],c=i[1],u=l(!1),p=u[0],f=u[1],h=o.message,g=o.type,v=void 0===g?"info":g,x=o.duration,m=void 0===x?3e3:x,y=o.icon,b=o.action,w=o.showClose,C=void 0===w||w,F=o.onClose,k=o.onClick;o.className;var D=function(e){switch(e){case"success":return{bgColor:"#009966",defaultIcon:T.success};case"error":return{bgColor:"#E7000B",defaultIcon:T.error};case"question":return{bgColor:"#1C1917",defaultIcon:T.question};default:return{bgColor:"#1447E6",defaultIcon:T.info}}}(v);d(function(){var e=setTimeout(function(){c(!0)},10);return function(){return clearTimeout(e)}},[]),d(function(){if(m>0){var e=setTimeout(function(){S()},m);return function(){return clearTimeout(e)}}},[m,r]);var S=s(function(){f(!0),setTimeout(function(){R.removeToast(r),null==F||F()},300)},[r,F]),M=s(function(){null==k||k()},[k]);return e("div",{style:{pointerEvents:"auto",maxWidth:"380px",background:"white",borderRadius:"8px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",overflow:"hidden",transform:a&&!p?"translateY(0) scale(1)":"translateY(8px) scale(0.95)",opacity:a&&!p?1:0,transition:"all 300ms ease-out",position:"relative",cursor:k?"pointer":"default"},onClick:M,children:t("div",{style:{display:"flex",alignItems:"flex-start",padding:"16px",backgroundColor:D.bgColor,color:"white"},children:[e("div",{style:{flexShrink:0,width:"24px",height:"24px",borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",marginRight:"8px"},children:y||D.defaultIcon}),t("div",{style:{flex:1,minWidth:0,paddingRight:"20px"},children:[e("div",{style:{width:"100%",justifyContent:"flex-start",color:"#f0fdf4",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"24px"},children:h}),b&&e("div",{style:{marginTop:"12px"},children:b})]}),C&&e("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(N,{})})]})})},j=function(t){return e(H,{id:"direct",props:t})},Y=function(e){return console.log("Toast: 调用 toast 函数",e),U(),setTimeout(function(){var t=R.addToast(e);console.log("Toast: 添加 Toast 成功,ID:",t)},100),Math.random().toString(36).slice(-8)},O=function(e){R.removeToast(e)},V=function(){R.clearAll()},P=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 管理器状态:",R.getToasts()),console.log("容器根节点:",G),console.log("是否正在初始化:",J),console.log("====================")},q=function(e,t){return U(),Y(v(v({},t),{message:e,type:"success"}))},X=function(e,t){return U(),Y(v(v({},t),{message:e,type:"error"}))},Z=function(e,t){return U(),Y(v(v({},t),{message:e,type:"info"}))},_=function(e,t){return U(),Y(v(v({},t),{message:e,type:"question"}))},K=null,G=null,J=!1,U=function(){if(console.log("Toast: 开始确保容器存在"),"undefined"!=typeof window&&"undefined"!=typeof document)if(J)console.log("Toast: 容器正在初始化中,跳过");else if(K)console.log("Toast: 容器已存在,跳过创建");else{console.log("Toast: 创建新的 Toast 容器"),J=!0;try{var t=document.getElementById("aha-toast-container");if(t)return console.log("Toast: 发现已存在的容器"),K=t,void(J=!1);console.log("Toast: 创建容器元素"),(K=document.createElement("div")).id="aha-toast-container",document.body.appendChild(K),console.log("Toast: 容器已添加到 document.body"),console.log("Toast: 开始导入 ReactDOM");try{var n=require("react-dom/client").createRoot;console.log("Toast: ReactDOM 同步导入成功,创建根节点"),G=n(K),console.log("Toast: 渲染 ToastContainer 组件"),G.render(e(I,{})),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 动态导入成功,创建根节点"),G=n(K),console.log("Toast: 渲染 ToastContainer 组件"),G.render(e(I,{})),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 组件")},$=function(r){var o=r.children,i=l(!1),a=i[0],s=i[1];return d(function(){s(!0)},[]),t(n,{children:[o,a&&h(e(I,{}),document.body)]})},Q={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"}}},ee={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"}},te=function(n){var o=n.children,i=n.color,a=n.variant,l=void 0===a?"light":a,d=n.size,s=void 0===d?"large":d,c=n.stroke,u=void 0!==c&&c,p=n.icon,f=n.iconPosition,h=void 0===f?"none":f,g=n.className,m=void 0===g?"":g,y=n.onClick,b=x(n,["children","color","variant","size","stroke","icon","iconPosition","className","onClick"]),w=k().primaryColor,C=function(e,t){if("string"==typeof e&&e in Q){var n=Q[e];return"Orange"===e&&t?v(v({},n),{fill:v(v({},n.fill),{bg:t})}):n}if("string"==typeof e&&e.startsWith("#")){var r=e.replace("#",""),o=parseInt(r.substr(0,2),16),i=parseInt(r.substr(2,2),16),a=parseInt(r.substr(4,2),16);return{light:{bg:"rgba(".concat(o,", ").concat(i,", ").concat(a,", 0.1)"),text:e,border:"rgba(".concat(o,", ").concat(i,", ").concat(a,", 0.3)")},fill:{bg:e,text:"#FFFFFF"}}}return Q.Green}(i,w),F=ee[s],D={borderRadius:"0.375rem",display:"inline-flex",justifyContent:"start",alignItems:"center",padding:"2px 8px",gap:"large"===s?"4px":"2px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"large"===s?"1.375":"1",transition:"all 0.2s",fontSize:"large"===s?"14px":"12px",height:"small"===s?"20px":"24px"};"light"===l&&(D.backgroundColor=C.light.bg,D.color=C.light.text,u&&(D.outline="1px solid",D.outlineOffset="-1px",D.outlineColor=function(e){if("string"==typeof e&&e in Q)switch(e){case"Green":default:return"#A4F4CF";case"Red":return"#FFC9C9";case"Orange":case"Yellow":return"#FFD1A9";case"Blue":return"#BEDBFF";case"Cyan":return"#A2F4FD";case"Violet":return"#DDD6FF";case"Pink":return"#FCCEE8";case"Gray":return"#E7E5E4"}if("string"==typeof e&&e.startsWith("#")){var t=e.replace("#",""),n=parseInt(t.substr(0,2),16),r=parseInt(t.substr(2,2),16),o=parseInt(t.substr(4,2),16);return"rgba(".concat(n,", ").concat(r,", ").concat(o,", 0.3)")}return"#A4F4CF"}(i))),y&&(D.cursor="pointer",D.opacity="1");var S=["rounded-md","inline-flex","justify-start","items-center",F.padding,F.gap,"font-medium","font-dm-sans","large"===s?"leading-snug":"leading-none","transition-colors","duration-200","small"===s?"h-5":"h-6"].filter(Boolean);"fill"===l&&(D.backgroundColor=C.fill.bg,D.color=C.fill.text),y&&S.push("cursor-pointer","hover:opacity-80"),m&&S.push(m);var M=S.join(" "),E=function(){if(!p)return null;var t=function(e,t){if("string"==typeof e&&e in Q)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"}(i,w),n="small"===s?"14px":"16px";return e("div",{className:"flex items-center justify-center",style:{width:n,height:n},children:"svg"===p.type?r.cloneElement(p,{width:n,height:n,style:{fill:t}}):p})};return t("div",v({className:M,style:D,onClick:y},b,{children:["leading"===h&&E(),e("div",{className:"px-1 flex justify-center items-center",children:e("div",{className:"justify-center ".concat(F.textSize," font-medium font-dm-sans ").concat("large"===s?"leading-snug":"leading-none"),children:o})}),"after"===h&&E()]}))},ne=c(function(o,i){var a=o.size,l=void 0===a?"medium":a,s=o.disabled,c=void 0!==s&&s,p=o.error,f=void 0!==p&&p,h=o.readOnly,g=void 0!==h&&h,m=o.prefix,y=o.suffix,b=o.allowClear,w=void 0!==b&&b,C=o.onClear,F=o.className,D=void 0===F?"":F,S=o.style,M=o.type,E=void 0===M?"text":M,A=o.placeholder,L=o.value,z=o.defaultValue,B=o.onChange,T=o.onFocus,N=o.onBlur,W=o.onPressEnter,R=x(o,["size","disabled","error","readOnly","prefix","suffix","allowClear","onClear","className","style","type","placeholder","value","defaultValue","onChange","onFocus","onBlur","onPressEnter"]),I=k().primaryColor,H=void 0===I?"#FB6011":I,j=u(null),Y=r.useState(z||L||""),O=Y[0],V=Y[1],P=r.useState(!1),q=P[0],X=P[1];d(function(){"function"==typeof i?i(j.current):i&&(i.current=j.current)},[i]);var Z=void 0!==L,_=Z?L:O,K=function(e){var t;e.stopPropagation(),Z||V("");null==B||B({target:{value:""},currentTarget:{value:""}}),null==C||C(),null===(t=j.current)||void 0===t||t.focus()},G=w&&_&&!c,J={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"}},U=y||G?"40px":"12px",$=v({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":q?H:"#D7D3D0"),backgroundColor:c||g?"#FAFAF9":"#FFFFFF",color:c?"#98A2B3":"#1C1917",fontSize:"16px",fontWeight:400,lineHeight:"24px",paddingLeft:m?"40px":"12px",paddingRight:U,paddingTop:J[l].paddingTop,paddingBottom:J[l].paddingBottom,transition:"all 0.2s",outline:"none",WebkitAppearance:"none",MozAppearance:"textfield",appearance:"none"},S);return t(n,{children:[e("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 '}),t("div",{className:"aha-input-wrapper ".concat(D),style:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%"},children:[m&&e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:c?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:m}),e("input",v({ref:j,type:E,value:_,placeholder:A,disabled:c,readOnly:g,onChange:function(e){Z||V(e.target.value),null==B||B(e)},onFocus:function(e){X(!0),null==T||T(e)},onBlur:function(e){X(!1),null==N||N(e)},onKeyDown:function(e){var t;"Enter"===e.key&&W&&W(e),null===(t=R.onKeyDown)||void 0===t||t.call(R,e)},style:$,autoComplete:R.autoComplete||"off",autoCorrect:R.autoCorrect||"off",autoCapitalize:R.autoCapitalize||"off",spellCheck:R.spellCheck||!1},R)),(y||G)&&t("span",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px",color:c?"#98A2B3":"#78716C",zIndex:1},children:[G&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:K,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),y&&e("span",{style:{pointerEvents:"none"},children:y})]})]})]})});ne.displayName="Input";var re=function(o){var a,c=o.value,p=o.defaultValue,f=o.options,g=void 0===f?[]:f,x=o.mode,m=o.disabled,y=void 0!==m&&m,w=o.error,C=void 0!==w&&w,F=o.placeholder,D=void 0===F?"Please select":F,S=o.size,M=void 0===S?"medium":S,E=o.showSearch,A=void 0!==E&&E,L=o.filterOption,z=void 0===L||L,B=o.allowClear,T=void 0!==B&&B,N=o.onChange,W=o.onSelect,R=o.onDeselect,I=o.onSearch,H=o.onFocus,j=o.onBlur,Y=o.onDropdownVisibleChange,O=o.className,V=void 0===O?"":O,P=o.style,q=o.dropdownClassName,X=void 0===q?"":q,Z=o.dropdownStyle,_=o.defaultOpen,K=void 0!==_&&_,G=o.open,J=o.maxTagCount,U=o.tagRender,$=o.optionRender,Q=k().primaryColor,ee=void 0===Q?"#FB6011":Q,te=l(void 0!==p?p:x?[]:void 0),ne=te[0],re=te[1],oe=l(K),ie=oe[0],ae=oe[1],le=l(""),de=le[0],se=le[1],ce=l(-1),ue=ce[0],pe=ce[1],fe=u(null),he=u(null),ge=u(null),ve=l(null),xe=ve[0],me=ve[1],ye=void 0!==c,be=void 0!==G,we=ye?c:ne,Ce=be?G:ie,Fe="multiple"===x||"tags"===x,ke=s(function(){if(!we)return[];var e=Array.isArray(we)?we:[we];return g.filter(function(t){return e.includes(t.value)})},[we,g]),De=s(function(){return A&&de?!1===z?g:"function"==typeof z?g.filter(function(e){return z(de,e)}):g.filter(function(e){var t=String(e.label||"").toLowerCase(),n=de.toLowerCase();return t.includes(n)}):g},[g,de,A,z]),Se=i(function(){return De()},[De]);d(function(){if(Ce&&fe.current){var e=function(){var e,t;if(fe.current){var n=fe.current.getBoundingClientRect(),r=null!==(t=null===(e=ge.current)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:Math.min(256,Math.max(40,40*Se.length)),o=window.innerHeight-n.bottom,i=n.top,a=o<r+4&&i>o,l=a?n.top+window.scrollY-r-4:n.bottom+window.scrollY+4;me({top:l,left:n.left+window.scrollX,width:n.width,placement:a?"top":"bottom"})}};return e(),requestAnimationFrame(e),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}me(null)},[Ce,Se.length]),d(function(){var e=function(e){var t=e.target;fe.current&&!fe.current.contains(t)&&ge.current&&!ge.current.contains(t)&&(be||ae(!1),null==Y||Y(!1),se(""))};if(Ce)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[Ce,be,Y]),d(function(){if(Ce){var e=function(e){var t;if("ArrowDown"===e.key)e.preventDefault(),pe(function(e){return e<Se.length-1?e+1:e});else if("ArrowUp"===e.key)e.preventDefault(),pe(function(e){return e>0?e-1:0});else if("Enter"===e.key&&ue>=0){e.preventDefault();var n=Se[ue];n&&!n.disabled&&Me(n)}else"Escape"===e.key&&(e.preventDefault(),be||ae(!1),null==Y||Y(!1),null===(t=fe.current)||void 0===t||t.focus())};return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}},[Ce,Se,ue,be,Y]),d(function(){if(ue>=0&&ge.current){var e=ge.current.querySelectorAll(".aha-select-option")[ue];e&&e.scrollIntoView({block:"nearest",behavior:"smooth"})}},[ue]);var Me=s(function(e){var t;if(!e.disabled)if(Fe){var n,r=Array.isArray(we)?we:[];r.includes(e.value)?(n=r.filter(function(t){return t!==e.value}),null==R||R(e.value,e)):(n=b(b([],r,!0),[e.value],!1),null==W||W(e.value,e)),ye||re(n);var o=g.filter(function(e){return n.includes(e.value)});null==N||N(n,o)}else ye||re(e.value),null==N||N(e.value,e),null==W||W(e.value,e),be||ae(!1),null==Y||Y(!1),se(""),null===(t=fe.current)||void 0===t||t.focus()},[Fe,we,ye,be,g,N,W,R,Y]),Ee=s(function(e,t){if(e.stopPropagation(),Fe&&Array.isArray(we)){var n=we.filter(function(e){return e!==t}),r=g.find(function(e){return e.value===t});ye||re(n),null==N||N(n,ke()),null==R||R(t,r)}},[Fe,we,ye,g,N,R,ke]),Ae=function(e){e.stopPropagation();var t=Fe?[]:void 0;ye||re(t),null==N||N(t,[]),se("")},Le={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"}},ze=i(function(){return ke()},[ke]),Be=i(function(){return T&&we&&!y},[T,we,y]),Te=i(function(){return Fe?Array.isArray(we)&&we.length>0:null!=we&&""!==we},[Fe,we]),Ne=i(function(){if(!Fe||!Array.isArray(we)||0===we.length)return null;var n="responsive"===J?ze.slice(0,2):J?ze.slice(0,J):ze,o=J&&ze.length>n.length?ze.length-n.length:0;return t("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:!y,onClose:function(){return Ee({},n.value)}};return U?e(r.Fragment,{children:U(o)},n.value):t("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("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n.label}),!y&&e("span",{onClick:function(e){return Ee(e,n.value)},style:{cursor:"pointer",display:"flex",alignItems:"center",color:"#78716C",marginLeft:"4px"},children:e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]},n.value)}),o>0&&t("span",{style:{fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:["+",o]})]})},[Fe,we,ze,J,y,U]);return t(n,{children:[e("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 "}),t("div",{ref:fe,className:"aha-select ".concat(V),style:v({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(C?"#F04438":Ce?ee:"#D7D3D0"),backgroundColor:y?"#FAFAF9":"#FFFFFF",cursor:y?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"12px",paddingRight:"36px",paddingTop:Le[M].paddingTop,paddingBottom:Le[M].paddingBottom,fontSize:Le[M].fontSize,lineHeight:Le[M].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},P),onClick:function(){if(!y){var e=!Ce;be||ae(e),null==Y||Y(e),e&&A?setTimeout(function(){var e;null===(e=he.current)||void 0===e||e.focus()},0):se("")}},onFocus:function(e){null==H||H(e)},onBlur:function(e){null==j||j(e)},onTouchStart:function(e){y||(e.currentTarget.style.opacity="0.8")},onTouchEnd:function(e){e.currentTarget.style.opacity="1"},tabIndex:y?-1:0,children:[e("div",{style:{display:"flex",alignItems:"center",flex:1,minWidth:0,gap:"8px"},children:Fe?Ne||e("span",D?{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400},children:D}:{style:{flex:1,minHeight:"24px"}}):A&&Ce?e("input",{ref:he,type:"text",value:de,onChange:function(e){var t=e.target.value;se(t),null==I||I(t),pe(-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:y?"#98A2B3":"#1C1917",fontFamily:"DM Sans, sans-serif",minWidth:0,WebkitAppearance:"none",appearance:"none"},placeholder:Te?void 0:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}):e("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:Te?y?"#98A2B3":"#1C1917":"#79716B",fontSize:"16px",lineHeight:"24px",fontWeight:400,minHeight:"24px",display:"inline-block"},children:Te?(null===(a=ze[0])||void 0===a?void 0:a.label)||we:D||" "})}),t("div",{style:{position:"absolute",right:"12px",display:"flex",alignItems:"center",gap:"4px"},children:[Be&&e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:Ae,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{}),e(function(t){var n=t.isOpen;return e("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("path",{d:"M4 6L8 10L12 6",stroke:"#78716C",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{isOpen:Ce})]})]}),Ce&&xe&&h(e("div",{ref:ge,className:"aha-select-dropdown ".concat(X),style:v({position:"absolute",top:"".concat(xe.top,"px"),left:"".concat(xe.left,"px"),width:"".concat(xe.width,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",maxHeight:"256px",overflow:"auto",opacity:0,transform:"top"===xe.placement?"translateY(8px)":"translateY(-8px)",animation:"dropdownFadeIn 0.2s ease-out forwards",transformOrigin:"top"===xe.placement?"bottom center":"top center",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},Z),children:0===Se.length?e("div",{style:{padding:"8px 16px",textAlign:"center",color:"#78716C",fontSize:"14px",fontFamily:"DM Sans, sans-serif"},children:"No data"}):Se.map(function(n,r){var o=Fe?Array.isArray(we)&&we.includes(n.value):we===n.value,i=r===ue;return $?e("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return!n.disabled&&Me(n)},style:{cursor:n.disabled?"not-allowed":"pointer",transition:"background-color 0.2s"},children:$(n,{selected:o,focused:i,disabled:n.disabled||!1})},n.value):t("div",{className:"aha-select-option ".concat(n.disabled?"":"hover:bg-[#FAFAF9]"," ").concat(o?"bg-[#FAFAF9]":""),onClick:function(){return Me(n)},style:{padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",color:n.disabled?"#98A2B3":"#101828",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",display:"flex",alignItems:"center",justifyContent:"space-between",transition:"background-color 0.2s"},children:[e("span",{children:n.label}),o&&e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:i?"hidden":"",children:e("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:ee,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},n.value)})}),document.body)]})};re.displayName="Select";var oe=function(t){var n=t.className,r=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:e("path",{d:"M11.6666 3.5L5.24992 9.91667L2.33325 7",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ie=function(t){var n=t.className,r=t.style;return e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:e("path",{d:"M3.5 7H10.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},ae=function(t){var n=t.className,r=t.style;return e("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:e("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"})})},le=function(n){var r=n.className,o=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:o,children:[e("path",{d:"M3.5 4.5L6 2L8.5 4.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M3.5 7.5L6 10L8.5 7.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},de=function(n){var r=n.className,o=n.style;return t("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:o,children:[e("path",{d:"M8.5 7.5L6 10L3.5 7.5",stroke:"#A9A29D",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M8.5 4.5L6 2L3.5 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},se=function(t){var n=t.className,r=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:e("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"})})},ce=function(t){var n=t.className,r=t.style;return e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:e("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"})})},ue=function(n){var r=n.className,o=n.style;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:o,children:[e("g",{clipPath:"url(#clip0_54_1653)",children:e("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("defs",{children:e("clipPath",{id:"clip0_54_1653",children:e("rect",{width:"16",height:"16",fill:"currentColor"})})})]})},pe=function(r){var o=r.current,a=r.defaultCurrent,s=void 0===a?1:a,c=r.total,u=void 0===c?0:c,p=r.pageSize,f=r.defaultPageSize,h=void 0===f?10:f,g=r.showSizeChanger,x=void 0!==g&&g,m=r.pageSizeOptions,y=void 0===m?["10","20","50","100"]:m,b=r.showQuickJumper,w=void 0!==b&&b,C=r.showTotal,F=r.onChange,D=r.onShowSizeChange,S=r.simple,M=void 0!==S&&S,E=r.disabled,L=void 0!==E&&E,z=r.hideOnSinglePage,B=void 0!==z&&z,T=r.className,N=void 0===T?"":T,W=r.style,R=r.size,I=void 0===R?"default":R,H=r.responsive,j=void 0!==H&&H;r.showLessItems;var Y=r.itemRender,O=k().primaryColor,V=void 0===O?"#FB6011":O,P=l(s),q=P[0],X=P[1],Z=l(h),_=Z[0],K=Z[1],G=l(""),J=G[0],U=G[1],$=null!=o?o:q,Q=null!=p?p:_,ee=i(function(){return Math.ceil(u/Q)},[u,Q]);d(function(){void 0!==o&&X(o)},[o]),d(function(){void 0!==p&&K(p)},[p]);var te=function(e){e<1||e>ee||e===$||L||(void 0===o&&X(e),null==F||F(e,Q))},oe=function(){var e=parseInt(J,10);e>=1&&e<=ee&&(te(e),U(""))};if(B&&ee<=1)return null;if(M)return t("div",{className:"aha-pagination aha-pagination-simple ".concat(N),style:W,children:[e(A,{onClick:function(){return te($-1)},disabled:L||1===$,type:"default",size:"default"===I?"medium":"small",style:{marginRight:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})}),t("span",{style:{margin:"0 8px",fontSize:"14px",lineHeight:"20px",color:"#475467",fontFamily:"DM Sans, sans-serif"},children:[$," / ",ee]}),e(A,{onClick:function(){return te($+1)},disabled:L||$===ee,type:"default",size:"default"===I?"medium":"small",style:{marginLeft:"8px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ce,{})})]});var ie=($-1)*Q+1,ae=Math.min($*Q,u);return t("div",{className:"aha-pagination w-full ".concat(N),style:v({display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:j?"wrap":"nowrap",fontFamily:"DM Sans, sans-serif"},W),children:[C&&e("div",{className:"justify-start text-Text-text-secondary text-sm font-medium font-['DM_Sans'] leading-5",children:C(u,[ie,ae])}),t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[u>0&&e(n,{children:Y?Y($-1,"prev",e(A,{onClick:function(){return te($-1)},disabled:L||1===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})})):e(A,{onClick:function(){return te($-1)},disabled:L||1===$,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(se,{})})}),e("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:function(){if(ee<=7)return Array.from({length:ee},function(e,t){return t+1});var e=[];if($<=4){for(var t=1;t<=5;t++)e.push(t);e.push("jump-next"),e.push(ee)}else if($>=ee-3){e.push(1),e.push("jump-prev");for(t=ee-4;t<=ee;t++)e.push(t)}else{e.push(1),e.push("jump-prev");for(t=$-1;t<=$+1;t++)e.push(t);e.push("jump-next"),e.push(ee)}return e}().map(function(t){return function(t){if("number"==typeof t){var n=t===$,r=e(A,{onClick:function(){return te(t)},disabled:L,type:n?"primary":"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,fontWeight:n?500:400,border:n?"1px solid ".concat(V):void 0,boxShadow:"none",borderRadius:"8px"},children:t},t);return Y?Y(t,"page",r):r}if("jump-prev"===t)return r=e(A,{onClick:function(){return te(Math.max(1,$-5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-prev"),Y?Y($-5,"jump-prev",r):r;if("jump-next"===t)return r=e(A,{onClick:function(){return te(Math.min(ee,$+5))},disabled:L,type:"default",size:"default"===I?"medium":"small",style:{minWidth:"small"===I?"32px":"36px",height:"small"===I?"32px":"36px",padding:"0 12px",margin:0,border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"•••"},"jump-next"),Y?Y($+5,"jump-next",r):r;return null}(t)})}),u>0&&e(n,{children:Y?Y($+1,"next",e(A,{onClick:function(){return te($+1)},disabled:L||$===ee,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ce,{})})):e(A,{onClick:function(){return te($+1)},disabled:L||$===ee,type:"default",size:"default"===I?"medium":"small",style:{height:"small"===I?"32px":"36px",padding:"0 12px",gap:"4px",border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:e(ce,{})})}),x&&e(re,{value:Q,options:y.map(function(e){return{label:"".concat(e," / page"),value:Number(e)}}),onChange:function(e){return t=Number(e),n=Math.ceil(u/t),r=$>n?n:$,void 0===p&&K(t),void 0===o&&X(r),null==D||D(r,t),void(null==F||F(r,t));var t,n,r},disabled:L,size:"small"===I?"small":"medium",style:{minWidth:"small"===I?80:96}}),w&&t("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontFamily:"DM Sans, sans-serif"},children:[e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"Go to"}),e(ne,{type:"number",min:1,value:J,onChange:function(e){return U(e.target.value)},onPressEnter:oe,disabled:L,size:"small"===I?"small":"medium",style:{width:56,minWidth:56}}),e("span",{style:{fontSize:"14px",lineHeight:"20px",color:"#475467"},children:"page"}),"object"==typeof w&&w.goButton?e(A,{onClick:oe,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:w.goButton}):e(A,{onClick:oe,disabled:L,type:"default",size:"default"===I?"medium":"small",style:{border:"1px solid #EAECF0",boxShadow:"none",borderRadius:"8px"},children:"OK"})]})]})]})},fe=function(n){var r=n.checked,o=void 0!==r&&r,i=n.indeterminate,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.className,u=void 0===c?"":c,p=n.style,f=n.children,h=k().primaryColor,g=o||a,x=d?"#FAFAF9":g?h:"white",m=d?"#FAFAF9":g?h:"#D7D3D0";return t("div",{className:"aha-checkbox ".concat(u),style:v({display:"inline-flex",alignItems:"center",gap:"8px",cursor:d?"not-allowed":"pointer"},p),onClick:function(e){d||(null==s||s({target:{checked:!o},currentTarget:{checked:!o}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"4px",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"14px",opacity:g?1:0,transition:"opacity 0.2s",pointerEvents:"none"},children:e(a?ie:oe,{style:{width:"14px",height:"14px",display:"block"}})})}),f&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:d?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:f}),e("input",{type:"checkbox",checked:o,ref:function(e){e&&(e.indeterminate=a)},onChange:s,disabled:d,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};fe.displayName="Checkbox";var he=function(r){var o=r.color;return t(n,{children:[e("style",{children:"\n @keyframes aha-table-loading-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),t("svg",{width:32,height:32,viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,style:{animation:"aha-table-loading-spin 1s linear infinite"},children:[e("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24",opacity:.3}),e("circle",{cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"16"})]})]})},ge=function(t){var n=t.loading,r=t.spinColor;if(!n)return null;var o=!0===n?e(he,{color:r}):n;return e("div",{role:"status","aria-live":"polite","aria-label":"Loading",className:"aha-table-loading-overlay",style:{position:"absolute",inset:0,zIndex:50,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.55)",pointerEvents:"auto"},children:o})},ve=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)},xe=function(e,t){var n,r;return"function"==typeof t?t(e):"string"==typeof t?null!==(n=ve(e,t))&&void 0!==n?n:"":null!==(r=e.key)&&void 0!==r?r:""},me=function(t){var n=t.order,r=k().primaryColor;return"ascend"===n?e(de,{style:{color:r}}):"descend"===n?e(le,{style:{color:r}}):e(ae,{})},ye=function(n){var o,a,c,p,f=n.columns,h=void 0===f?[]:f,g=n.dataSource,m=void 0===g?[]:g,y=n.rowKey,w=void 0===y?"key":y,C=n.rowSelection,F=n.pagination,D=void 0!==F&&F,S=n.size,M=void 0===S?"middle":S,E=n.bordered,A=void 0!==E&&E,L=n.loading,z=void 0!==L&&L,B=n.locale,T=n.showHeader,N=void 0===T||T,W=n.title,R=n.footer,I=n.summary,H=n.scroll,j=n.tableLayout,Y=void 0===j?"auto":j,O=n.onChange,V=n.onSorterChange,P=n.onPaginationChange,q=n.onRow,X=n.className,Z=void 0===X?"":X,_=n.innerClassName,K=void 0===_?"":_,G=n.style,J=n.expandable,U=n.rowClassName,$=n.onHeaderRow;n.sticky;var Q=x(n,["columns","dataSource","rowKey","rowSelection","pagination","size","bordered","loading","locale","showHeader","title","footer","summary","scroll","tableLayout","onChange","onSorterChange","onPaginationChange","onRow","className","innerClassName","style","expandable","rowClassName","onHeaderRow","sticky"]),ee=k().primaryColor||"#FB6011",te=l((null==C?void 0:C.selectedRowKeys)||(null==C?void 0:C.defaultSelectedRowKeys)||[]),ne=te[0],re=te[1];d(function(){void 0!==(null==C?void 0:C.selectedRowKeys)&&re(C.selectedRowKeys)},[null==C?void 0:C.selectedRowKeys]);var oe=l(new Map),ie=oe[0],ae=oe[1],le=l((null==J?void 0:J.defaultExpandedRowKeys)||[]),de=le[0],se=le[1],ce=l(D&&"object"==typeof D&&(D.current||D.defaultCurrent)||1),ue=ce[0],he=ce[1],ye=l(D&&"object"==typeof D&&(D.pageSize||D.defaultPageSize)||10),be=ye[0],we=ye[1];d(function(){D&&"object"==typeof D&&(void 0!==D.current&&he(D.current),void 0!==D.pageSize&&we(D.pageSize))},[D]);var Ce=l(null),Fe=Ce[0],ke=Ce[1],De=l(null),Se=De[0],Me=De[1],Ee=l(!1),Ae=Ee[0],Le=Ee[1],ze=u(null),Be=u(null);d(function(){var e=function(){Le(window.innerWidth<768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]);var Te=s(function(e,t){var n,r,o,i=null===(n=null==C?void 0:C.getCheckboxProps)||void 0===n?void 0:n.call(C,e);if(!(null==i?void 0:i.disabled)){var a,l=xe(e,w);a="radio"===(null==C?void 0:C.type)?t?[l]:[]:t?b(b([],ne,!0),[l],!1):ne.filter(function(e){return e!==l}),re(a);var d=m.filter(function(e){return a.includes(xe(e,w))});null===(r=null==C?void 0:C.onChange)||void 0===r||r.call(C,a,d),null===(o=null==C?void 0:C.onSelect)||void 0===o||o.call(C,e,t,d,new Event("select"))}},[ne,w,C,m]),Ne=s(function(e,t){var n,r,o=t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}).map(function(e){return xe(e,w)}),i=e?o:[];re(i);var a=m.filter(function(e){return i.includes(xe(e,w))}),l=e?t.filter(function(e){var t;return!(null===(t=null==C?void 0:C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}):[];null===(n=null==C?void 0:C.onChange)||void 0===n||n.call(C,i,a),null===(r=null==C?void 0:C.onSelectAll)||void 0===r||r.call(C,e,a,l)},[w,C,m]),We=s(function(e,t){var n=e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex);if(n){var r=new Map(ie);null===t?r.delete(n):r.set(n,t),ae(r);var o=Array.from(r.entries()).map(function(t){var n=t[0],r=t[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n})||e,order:r,field:n,columnKey:n}}),i={column:e,order:t,field:n,columnKey:n};e.onSorterChange&&e.onSorterChange(i),V&&V(1===o.length?o[0]:o),O&&O({current:ue,pageSize:be},{},1===o.length?o[0]:o,{currentDataSource:m,action:"sort"})}},[ie,O,V,ue,be,m,h]);s(function(e,t){var n,r,o,i=xe(e,w);o=t?b(b([],de,!0),[i],!1):de.filter(function(e){return e!==i}),se(o),null===(n=null==J?void 0:J.onExpand)||void 0===n||n.call(J,t,e),null===(r=null==J?void 0:J.onExpandedRowsChange)||void 0===r||r.call(J,o)},[de,w,J]);var Re,Ie=s(function(){var e=b([],m,!0);return ie.size>0&&e.sort(function(e,t){for(var n=function(n,r){var o=h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===n});if(!o)return"continue";var i=0;if("function"==typeof o.sorter)i=o.sorter(e,t);else if(!0===o.sorter){var a=ve(e,o.dataIndex||n),l=ve(t,o.dataIndex||n);a<l?i=-1:a>l&&(i=1)}return 0!==i?{value:"ascend"===r?i:-i}:void 0},r=0,o=Array.from(ie.entries());r<o.length;r++){var i=o[r],a=n(i[0],i[1]);if("object"==typeof a)return a.value}return 0}),e},[m,ie,h]),He=Ie(),je=Boolean(D&&"object"==typeof D&&void 0!==D.total),Ye=i(function(){if(!1===D||!D)return He;if(je)return He;var e=(ue-1)*be,t=e+be;return He.slice(e,t)},[He,ue,be,D,je]),Oe=s(function(e,t){var n,r,o=null!=t?t:be;if(he(e),t&&we(t),P&&P(e,o),D&&"object"==typeof D&&(null===(n=D.onChange)||void 0===n||n.call(D,e,t),t&&(null===(r=D.onShowSizeChange)||void 0===r||r.call(D,e,t))),O){var i=Array.from(ie.entries()).map(function(e){var t=e[0],n=e[1];return{column:h.find(function(e){return(e.key||(Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex))===t}),order:n,field:t,columnKey:t}});O({current:e,pageSize:o},{},1===i.length?i[0]:i,{currentDataSource:He,action:"paginate"})}},[D,P,O,be,ie,h,He]),Ve=s(function(e,t,n){var r=ve(t,e.dataIndex||"");return e.render?e.render(r,t,n):r},[]),Pe=s(function(e,t,n){if(t){var r=!0===t?"left":t,o=0;if("left"===r){if(C&&("left"===C.fixed||!0===C.fixed))o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;for(var i=0;i<e;i++){if("left"===(a=h[i]).fixed||!0===a.fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}return o}if("right"===r){for(i=e+1;i<h.length;i++){var a;if("right"===(a=h[i]).fixed)o+=a.width?"number"==typeof a.width?a.width:parseInt(a.width)||0:150}if(C&&"right"===C.fixed)o+="number"==typeof C.columnWidth?C.columnWidth:"string"==typeof C.columnWidth?parseInt(C.columnWidth):60;return o}}},[h,C]),qe=s(function(){if(!N)return null;var n,r,o,i,a=h.map(function(n,r){var o,i=n.key||(Array.isArray(n.dataIndex)?n.dataIndex.join("."):n.dataIndex)||r,a=ie.get(i)||null,l=Pe(r,n.fixed,!0),d=n.width?"number"==typeof n.width?"".concat(n.width,"px"):n.width:void 0;return e("th",v({className:"".concat(n.className||""," ").concat(n.align?"text-".concat(n.align):""),style:{width:d,minWidth:n.minWidth?"number"==typeof n.minWidth?"".concat(n.minWidth,"px"):n.minWidth:d||void 0,maxWidth:d,position:n.fixed?"sticky":"relative",left:"left"===n.fixed||!0===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,right:"right"===n.fixed?void 0!==l?"".concat(l,"px"):"0":void 0,zIndex:n.fixed?"left"===n.fixed||!0===n.fixed?10:9:1,backgroundColor:(n.fixed,"#F9FAFB"),boxShadow:"left"===n.fixed||!0===n.fixed?"2px 0 4px rgba(0, 0, 0, 0.05)":"right"===n.fixed?"-2px 0 4px rgba(0, 0, 0, 0.05)":void 0,padding:"12px 16px",textAlign:n.align||"left",borderBottom:"1px solid #EAECF0",fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467",fontFamily:"DM Sans, sans-serif"}},(null===(o=n.onHeaderCell)||void 0===o?void 0:o.call(n,n))||{},{children:t("div",{style:{display:"flex",alignItems:"center",gap:"8px",justifyContent:"right"===n.align?"flex-end":"center"===n.align?"center":"flex-start"},children:[e("span",{style:{fontWeight:600,fontSize:"12px",lineHeight:"18px",color:"#475467"},children:"function"==typeof n.title?n.title({sortOrder:a,sortColumn:n}):n.title}),n.sorter&&e("button",{onClick:function(){We(n,null===a?"ascend":"ascend"===a?"descend":null)},style:{border:"none",background:"none",cursor:"pointer",display:"flex",alignItems:"center",padding:"2px",color:a?"#475467":"#98A2B3"},children:e(me,{order:a||void 0})})]})}),i)});if(C){var l="number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",d=e("th",{style:{width:l,position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.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:t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[!C.hideSelectAll&&"radio"!==C.type&&(n=Ye.filter(function(e){var t;return!(null===(t=C.getCheckboxProps)||void 0===t?void 0:t.call(C,e).disabled)}),r=n.map(function(e){return xe(e,w)}),o=n.length>0&&r.every(function(e){return ne.includes(e)}),i=r.some(function(e){return ne.includes(e)}),e(fe,{checked:o,indeterminate:i&&!o,onChange:function(e){return Ne(e.target.checked,Ye)}})),C.columnTitle&&e("span",{style:{marginLeft:C.hideSelectAll?0:"8px"},children:C.columnTitle})]})},"selection");a.unshift(d)}var s=null==$?void 0:$(h,0);return e("thead",{ref:Be,children:e("tr",v({},s||{},{children:a}))})},[h,N,ie,C,ne,Ye,w,We,Ne,B,$,Pe]),Xe=s(function(e){ke(e)},[]),Ze=s(function(e,t){e.preventDefault(),Me(t)},[]),_e=s(function(e,t){if(e.preventDefault(),null===Fe||Fe===t)return ke(null),void Me(null);var n=b([],Ye,!0),r=n[Fe];n.splice(Fe,1),n.splice(t,0,r),ke(null),Me(null)},[Fe,Ye]),Ke=s(function(){ke(null),Me(null)},[]),Ge=s(function(){var t=null==B?void 0:B.emptyText,n="function"==typeof t?t():void 0!==t?t:"No data",r=h.length+(C?1:0);return e("tr",{className:"aha-table-placeholder",children:e("td",{colSpan:r,style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",borderBottom:"none",backgroundColor:"white"},children:n})})},[null==B?void 0:B.emptyText,h.length,C]),Je=s(function(){return 0===Ye.length?Ge():Ye.map(function(n,o){var i,a=xe(n,w),l=ne.includes(a),d=de.includes(a),s=(null==q?void 0:q(n,o))||{},c=o===Ye.length-1;return t(r.Fragment,{children:[t("tr",v({className:"".concat("function"==typeof U?U(n,o):U||""," ").concat(Fe===o?"dragging":""," ").concat(Se===o?"drag-over":""),draggable:!0,onDragStart:function(){return Xe(o)},onDragOver:function(e){return Ze(e,o)},onDrop:function(e){return _e(e,o)},onDragEnd:Ke,style:v({cursor:"move",opacity:Fe===o?.5:1,backgroundColor:Se===o?"#F9FAFB":"white",transition:"background-color 0.2s"},s.style),onMouseEnter:function(e){Fe!==o&&Se!==o&&(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){Fe!==o&&Se!==o&&(e.currentTarget.style.backgroundColor="white")}},s,{children:[C&&e("td",{style:{width:"number"==typeof C.columnWidth?"".concat(C.columnWidth,"px"):"string"==typeof C.columnWidth?C.columnWidth:"60px",position:C.fixed?"sticky":"relative",left:"left"===C.fixed||!0===C.fixed?"0px":void 0,right:"right"===C.fixed?"0px":void 0,zIndex:C.fixed?"left"===C.fixed||!0===C.fixed?12:11:1,backgroundColor:"white",padding:"16px",borderBottom:c?"none":"1px solid #EAECF0",textAlign:"center"},children:e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:e(fe,{checked:l,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(i=C.getCheckboxProps)||void 0===i?void 0:i.call(C,n).disabled})})}),h.map(function(t,r){var i,a=t.key||(Array.isArray(t.dataIndex)?t.dataIndex.join("."):t.dataIndex)||r,l=(null===(i=t.onCell)||void 0===i?void 0:i.call(t,n,o))||{},d=Pe(r,t.fixed,!1),s=t.width?"number"==typeof t.width?"".concat(t.width,"px"):t.width:void 0;return e("td",v({className:"".concat(t.className||""," ").concat(t.align?"text-".concat(t.align):""),style:v({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!==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"},l.style),colSpan:t.colSpan,rowSpan:t.rowSpan},l,{children:Ve(t,n,o)}),a)})]})),(null==J?void 0:J.expandedRowRender)&&d&&e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:J.expandedRowRender(n,o,0,!0)})})]},a)})},[Ye,w,ne,de,C,h,q,U,Te,Ve,J,Fe,Se,Xe,Ze,_e,Ke,Pe,Ge]),Ue=function(){var t;if(!1===D||!D)return null;var n=null!==(t=D.total)&&void 0!==t?t:He.length,r=D.position||"bottomRight";return e("div",{style:{marginTop:"16px",display:"flex",justifyContent:r.includes("Right")?"flex-end":r.includes("Left")?"flex-start":"center"},children:e(pe,{current:ue,total:n,pageSize:be,showSizeChanger:D.showSizeChanger,pageSizeOptions:D.pageSizeOptions,showQuickJumper:D.showQuickJumper,showTotal:D.showTotal,onChange:Oe,onShowSizeChange:Oe,simple:D.simple,responsive:D.responsive,size:"small"===M?"small":"default"})})},$e=i(function(){return h.some(function(e){return e.fixed})||C&&C.fixed},[h,C]),Qe=i(function(){return h.every(function(e){return e.width})&&(!C||C.columnWidth)},[h,C]),et=i(function(){if(null==H?void 0:H.x){if("number"==typeof H.x)return H.x;if(!0===H.x)return h.reduce(function(e,t){return e+(t.width?"number"==typeof t.width?t.width:parseInt(String(t.width).replace("px",""))||0:150)},0)+(C?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth||"60").replace("px",""))||60:0)}if($e)return h.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)+(C&&C.fixed&&C.columnWidth?"number"==typeof C.columnWidth?C.columnWidth:parseInt(String(C.columnWidth).replace("px",""))||60:0)},[h,null==H?void 0:H.x,C,$e]),tt=i(function(){return"fixed"===Y||$e||Qe||h.some(function(e){return e.width})?"fixed":Y},[Y,$e,Qe,h]),nt=v(v({width:"100%",minWidth:et?"".concat(et,"px"):"100%",borderCollapse:"separate",borderSpacing:0,tableLayout:tt,backgroundColor:"white"},A&&{borderRadius:"8px",border:"1px solid #EAECF0"}),{overflow:"hidden"}),rt=v({position:"relative",width:"100%",maxWidth:"100%",maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"},G);if(Ae)return t("div",v({ref:ze,className:"aha-table aha-table-mobile-wrapper ".concat(Z),style:rt,"aria-busy":!!z||void 0},Q,{children:[W&&e("div",{style:{marginBottom:"16px"},children:W(He)}),D&&"object"==typeof D&&(null===(o=D.position)||void 0===o?void 0:o.startsWith("top"))&&Ue(),(Re="function"==typeof(null==B?void 0:B.emptyText)?B.emptyText():void 0!==(null==B?void 0:B.emptyText)?B.emptyText:"No data",0===Ye.length?e("div",{className:"aha-table-mobile aha-table-placeholder",style:{padding:"48px 16px",textAlign:"center",color:"#98A2B3",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif"},children:Re}):e("div",{className:"aha-table-mobile",children:Ye.map(function(n,r){var o,i=xe(n,w),a=ne.includes(i);return t("div",{className:"aha-table-mobile-row ".concat(a?"selected":""),style:{border:"1px solid #e8e8e8",borderRadius:"4px",padding:"12px",marginBottom:"12px",backgroundColor:a?"#e6f7ff":"white"},children:[C&&e("div",{style:{marginBottom:"8px"},children:e(fe,{checked:a,onChange:function(e){return Te(n,e.target.checked)},disabled:null===(o=C.getCheckboxProps)||void 0===o?void 0:o.call(C,n).disabled})}),h.map(function(o){var i=o.key||(Array.isArray(o.dataIndex)?o.dataIndex.join("."):o.dataIndex),a=ve(n,o.dataIndex||""),l=o.render?o.render(a,n,r):a;return t("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"8px",paddingBottom:"8px",borderBottom:"1px solid #f0f0f0"},children:[t("span",{style:{fontWeight:"bold",color:"#666"},children:["function"==typeof o.title?o.title({}):o.title,":"]}),e("span",{style:{flex:1,textAlign:"right"},children:l})]},i)})]},i)})})),R&&e("div",{style:{marginTop:"16px"},children:R(He)}),D&&("object"!=typeof D||!(null===(a=D.position)||void 0===a?void 0:a.startsWith("top")))&&Ue(),e(ge,{loading:z,spinColor:ee})]}));var ot={position:"relative",overflowX:(null==H?void 0:H.x)||$e?"auto":"visible",overflowY:(null==H?void 0:H.y)?"auto":"visible",width:"100%",maxWidth:!0===(null==H?void 0:H.x)?"100%":"number"==typeof(null==H?void 0:H.x)?"".concat(H.x,"px"):void 0,maxHeight:"number"==typeof(null==H?void 0:H.y)?"".concat(H.y,"px"):void 0,borderRadius:"8px"};return t("div",v({ref:ze,className:"aha-table ".concat(Z),style:rt,"aria-busy":!!z||void 0},Q,{children:[W&&e("div",{style:{marginBottom:"16px"},children:W(He)}),D&&"object"==typeof D&&(null===(c=D.position)||void 0===c?void 0:c.startsWith("top"))&&Ue(),e("div",{style:ot,children:e("div",{style:{width:"100%",minWidth:et?"".concat(et,"px"):"100%",display:"block"},children:t("table",{style:nt,className:K,children:[qe(),e("tbody",{children:Je()}),I&&e("tfoot",{children:e("tr",{children:e("td",{colSpan:h.length+(C?1:0),children:I(He)})})})]})})}),R&&e("div",{style:{marginTop:"16px"},children:R(He)}),D&&("object"!=typeof D||!(null===(p=D.position)||void 0===p?void 0:p.startsWith("top")))&&Ue(),e(ge,{loading:z,spinColor:ee})]}))},be=function(n){var r=n.checked,o=void 0!==r&&r,i=n.disabled,a=void 0!==i&&i,l=n.onChange,d=n.className,s=void 0===d?"":d,c=n.style,u=n.children,p=n.value,f=n.name,h=k().primaryColor,g=void 0===h?"#FB6011":h,x=a?"#FAFAF9":o?g:"white",m=a?"#FAFAF9":o?g:"#D7D3D0";return t("div",{className:"aha-radio ".concat(s),style:v({display:"inline-flex",alignItems:"center",gap:"8px",cursor:a?"not-allowed":"pointer"},c),onClick:function(e){a||(null==l||l({target:{checked:!o,value:p},currentTarget:{checked:!o,value:p}}))},children:[e("div",{style:{position:"relative",width:"20px",height:"20px",minWidth:"20px",minHeight:"20px",borderRadius:"50%",border:"1px solid ".concat(m),backgroundColor:x,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s",flexShrink:0,boxSizing:"border-box"},children:e("div",{style:{width:"8px",height:"8px",minWidth:"8px",minHeight:"8px",borderRadius:"50%",backgroundColor:"white",opacity:o?1:0,transition:"opacity 0.2s",pointerEvents:"none",boxSizing:"border-box"}})}),u&&e("span",{style:{fontSize:"14px",lineHeight:"20px",color:a?"#98A2B3":"#101828",fontFamily:"DM Sans, sans-serif"},children:u}),e("input",{type:"radio",checked:o,onChange:l,disabled:a,value:p,name:f,style:{position:"absolute",opacity:0,width:0,height:0,pointerEvents:"none"},"aria-hidden":"true"})]})};be.displayName="Radio";var we=function(n){var o=n.items,a=void 0===o?[]:o,c=n.variant,p=void 0===c?"underline":c,f=n.layout,h=void 0===f?"equal":f,g=n.defaultValue,m=n.value,y=n.onChange,b=n.className,w=void 0===b?"":b,C=n.mode,F=void 0===C?"children":C,D=n.scrollable,S=void 0!==D&&D,M=x(n,["items","variant","layout","defaultValue","value","onChange","className","mode","scrollable"]),E=k().primaryColor;if(!a||0===a.length)return null;var A=i(function(){if(0===a.length)return[];var e=a[0];return"string"==typeof e||"number"==typeof e?a.map(function(e,t){return{key:String(e),label:String(e)}}):a},[a]),L=void 0!==m,z=A.length>0?A[0].key:"",B=function(e){if(void 0===e)return z;var t=A.find(function(t){if(t.key===e)return!0;if(String(t.key)===String(e))return!0;var n=Number(t.key),r=Number(e);return!isNaN(n)&&!isNaN(r)&&n===r});return t?t.key:z},T=l(function(){var e,t=null!==(e=null!=m?m:g)&&void 0!==e?e:z;return B(t)}),N=T[0],W=T[1],R=L?void 0!==m?B(m):z:N;d(function(){console.log("[Tab Debug] currentValue:",R,"type:",typeof R),console.log("[Tab Debug] normalizedItems:",A.map(function(e){return{key:e.key,type:typeof e.key}})),console.log("[Tab Debug] controlledValue:",m,"isControlled:",L)},[R,A,m,L]);var I=s(function(e,t){if(!t){L||W(e);var n="number"==typeof a[0]&&"number"==typeof e?e:"number"==typeof e?String(e):e;if(null==y||y(n),S&&"underline"===p){var r=Y.current[O(e)],o=q.current;if(r&&o){_.current=!0;var i,l=function(){if(o&&V.current&&r){var e=o.getBoundingClientRect(),t=r.getBoundingClientRect();if(e.width>0&&t.width>0){var n=o.scrollLeft||0,i=t.left-e.left+n,a=t.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},d=function(){l(),clearTimeout(i),i=setTimeout(function(){l(),_.current=!1,o.removeEventListener("scroll",d)},150)};o.addEventListener("scroll",d,{passive:!0}),r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){l()})})}}}},[L,y,a,S,p]),H=A.find(function(e){if(e.key===R)return!0;if(String(e.key)===String(R))return!0;var t=Number(e.key),n=Number(R);return!isNaN(t)&&!isNaN(n)&&t===n}),j=E||"#FB6011",Y=u({}),O=function(e){return String(e)},V=u(null),P=u(null),q=u(null),X=u(null),Z=u("");u(new Set);var _=u(!1),K=l({width:0,left:0,opacity:0}),G=K[0],J=K[1],U=l({width:0,left:0,opacity:0}),$=U[0],Q=U[1],ee=s(function(){"underline"===p&&q.current&&R&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(V.current&&q.current){var e=Y.current[O(R)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=q.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=q.current.scrollLeft||0,i=r.left-n.left+o,a=r.width,l="".concat(i,"px"),d="".concat(a,"px");J(function(e){return e.left===l&&e.width===d&&1===e.opacity?e:{width:d,left:l,opacity:1}})}}}})})},[p,R,A]),te=s(function(){"background"===p&&X.current&&P.current&&R&&requestAnimationFrame(function(){requestAnimationFrame(function(){if(P.current&&X.current){var e=Y.current[O(R)];if(!e&&A.length>0){var t=A[0].key;e=Y.current[O(t)]}if(e){var n=X.current.getBoundingClientRect(),r=e.getBoundingClientRect();if(0!==n.width&&0!==r.width){var o=r.left-n.left,i=r.width,a="".concat(o,"px"),l="".concat(i,"px");Q(function(e){return e.left===a&&e.width===l&&1===e.opacity?e:{width:l,left:a,opacity:1}})}}}})})},[p,R,A]);d(function(){R?Z.current!==R&&(Z.current=R,"underline"===p&&q.current&&!_.current&&ee(),"background"===p&&X.current&&P.current&&te()):Z.current=""},[R,p,A.length,L,ee,te]),d(function(){if(R){var e=setTimeout(function(){if("underline"===p)(e=Y.current[O(R)])&&q.current&&V.current&&(ee(),S&&e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}));else if("background"===p){var e;if((e=Y.current[O(R)])&&X.current&&P.current){var t=X.current.getBoundingClientRect(),n=e.getBoundingClientRect();if(t.width>0&&n.width>0){var r=n.left-t.left,o=n.width,i="".concat(r,"px"),a="".concat(o,"px");Q({width:a,left:i,opacity:1})}}}},100);return function(){return clearTimeout(e)}}},[]),d(function(){if(S&&"underline"===p&&R&&!_.current){var e=setTimeout(function(){var e=Y.current[O(R)],t=q.current;if(e&&t){_.current=!0;var n,r=function(){if(t&&V.current&&e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect();if(n.width>0&&r.width>0){var o=t.scrollLeft||0,i=r.left-n.left+o,a=r.width;J({width:"".concat(a,"px"),left:"".concat(i,"px"),opacity:1})}}},o=function(){r(),clearTimeout(n),n=setTimeout(function(){r(),_.current=!1,t.removeEventListener("scroll",o)},150)};t.addEventListener("scroll",o,{passive:!0}),e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),requestAnimationFrame(function(){requestAnimationFrame(function(){r()})})}},50);return function(){return clearTimeout(e)}}},[R,S,p]);var ne;return t("div",{className:"aha-tab-container",children:["underline"===p?(ne={display:"flex",alignItems:"center",gap:"32px",borderBottom:"1px solid #E7E5E4",paddingBottom:"0",position:"relative"},S&&(ne.overflowX="auto",ne.overflowY="hidden",ne.scrollBehavior="smooth",ne.scrollbarWidth="none",ne.WebkitOverflowScrolling="touch"),t("div",v({ref:q,className:"aha-tab aha-tab--underline ".concat(S?"aha-tab--scrollable":""," ").concat(w),style:ne},M,{children:[e("div",{ref:V,style:v({position:"absolute",bottom:"0px",height:"2px",backgroundColor:j,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"},G)}),A.map(function(n){var o=function(){if(n.key===R)return!0;if(String(n.key)===String(R))return!0;var e=Number(n.key),t=Number(R);return!isNaN(e)&&!isNaN(t)&&e===t}();return n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:R,currentValueType:typeof R,isActive:o,variant:p}),t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return I(n.key,n.disabled)},style:{position:"relative",padding:"12px 0",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",opacity:n.disabled?.5:1,transition:"color 0.2s ease-in-out",flexShrink:S?0:void 0,whiteSpace:S?"nowrap":void 0},children:[n.icon&&function(){var t,i=typeof n.icon,a=r.isValidElement(n.icon);return console.log("[Tab Debug] Icon render:",{itemKey:n.key,iconType:i,isReactElement:a,iconValue:n.icon}),r.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?j:"#79716B",transition:"color 0.2s ease-in-out"},children:r.cloneElement(n.icon,{width:20,height:20,style:v(v({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:o?j:"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?j:"#79716B",transition:"color 0.2s ease-in-out"},children:r.createElement(n.icon,{width:20,height:20,style:{color:o?j:"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",color:o?j:"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?j:"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))):function(){var n={display:"flex",alignItems:"center",backgroundColor:"#FAFAF9",borderRadius:"8px",padding:"4px",border:"1px solid #E7E5E4",gap:"4px",position:"relative"};return n.width="equal"===h?"100%":"fit-content",t("div",v({ref:X,className:"aha-tab aha-tab--background aha-tab--".concat(h," ").concat(w),style:n},M,{children:[e("div",{ref:P,style:v({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"},$)}),A.map(function(n){var o=function(){if(n.key===R)return!0;if(String(n.key)===String(R))return!0;var e=Number(n.key),t=Number(R);return!isNaN(e)&&!isNaN(t)&&e===t}();n.key===A[0].key&&console.log("[Tab Debug] isActive check:",{itemKey:n.key,itemKeyType:typeof n.key,currentValue:R,currentValueType:typeof R,isActive:o,variant:p});var i={position:"relative",padding:"8px 16px",cursor:n.disabled?"not-allowed":"pointer",display:"flex",alignItems:"center",gap:"8px",borderRadius:"6px",opacity:n.disabled?.5:1,flex:"equal"===h?1:"none",justifyContent:"center",backgroundColor:"transparent",border:"1px solid transparent",transition:"color 0.2s ease-in-out",zIndex:1};return t("div",{ref:function(e){Y.current[O(n.key)]=e},onClick:function(){return I(n.key,n.disabled)},style:i,children:[n.icon&&function(){var t;return r.isValidElement(n.icon)?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:r.cloneElement(n.icon,{width:16,height:16,style:v(v({},null===(t=n.icon.props)||void 0===t?void 0:t.style),{color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"})})}):"function"==typeof n.icon?e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:r.createElement(n.icon,{width:16,height:16,style:{color:o?"#44403C":"#79716B"}})}):e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",color:o?"#44403C":"#79716B",transition:"color 0.2s ease-in-out"},children:n.icon})}(),e("span",{style:{fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",color:o?"#44403C":"#79716B",lineHeight:"1.375",transition:"color 0.2s ease-in-out"},children:n.label}),void 0!==n.badge&&null!==n.badge&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:"20px",height:"20px",padding:"0 6px",borderRadius:"10px",backgroundColor:o?"#FFF6ED":"#FAFAF9",border:o?"1px solid #FFD1A9":"1px solid #E7E5E4",color:o?"#C4330A":"#44403C",fontSize:"12px",fontWeight:500,fontFamily:"DM Sans, sans-serif",lineHeight:"1",transition:"all 0.2s ease-in-out"},children:n.badge}),n.customElement]},n.key)})]}))}(),S&&"underline"===p&&e("style",{children:"\n .aha-tab--scrollable::-webkit-scrollbar {\n display: none;\n }\n .aha-tab--scrollable {\n -ms-overflow-style: none;\n }\n "}),"children"===F&&(null==H?void 0:H.children)&&e("div",{className:"aha-tab-content",style:{marginTop:"24px"},children:H.children})]})},Ce=function(r){var o=r.percent,i=void 0===o?0:o,a=r.type,s=void 0===a?"circle":a,c=r.width,p=void 0===c?120:c,f=r.title,h=r.titlePosition,g=r.showPercent,m=void 0===g||g,y=r.animated,b=void 0!==y&&y,w=r.status,C=void 0===w?"normal":w,F=r.className,D=void 0===F?"":F,S=r.style,M=r.strokeColor,E=r.trailColor,A=void 0===E?"#F5F5F4":E,L=x(r,["percent","type","width","title","titlePosition","showPercent","animated","status","className","style","strokeColor","trailColor"]),z=k().primaryColor,B=Math.min(100,Math.max(0,i)),T=u(!0),N=l(!1),W=N[0],R=N[1],I=l(0),H=I[0],j=I[1];d(function(){if(b&&T.current&&B>0){T.current=!1,j(0),R(!0),requestAnimationFrame(function(){requestAnimationFrame(function(){j(B)})});var e=setTimeout(function(){R(!1),j(B)},300);return function(){return clearTimeout(e)}}T.current?(T.current=!1,R(!1),j(B)):j(B)},[b,B]);var Y=M||z||"#FB6011";"success"===C?Y="#00BC7D":"exception"===C&&(Y="#FB2C36");var O=h||"inside",V=Math.max(4,Math.round(.06*p)),P=(p-V)/2,q="semicircle"===s?p/2:p,X="14px",Z="12px",_=function(){var r=f&&"outside"===O?p+4+18+4:p,o=2*Math.PI*P,i=o-(W?H:B)/100*o;return t("div",{style:{position:"relative",width:p,height:r,display:"flex",alignItems:"center",justifyContent:"center"},children:[t("svg",{width:p,height:p,style:{position:"absolute",top:0,left:0},children:[e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("circle",{cx:p/2,cy:p/2,r:P,fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:o,strokeDashoffset:i,transform:"rotate(-90 ".concat(p/2," ").concat(p/2,")"),style:{transition:W?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("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("div",{style:{fontSize:X,color:"#292524",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p/2,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(p,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]})},K=v({display:"inline-flex",flexDirection:"column",alignItems:"center",width:p},S);return e("div",v({className:"aha-progress aha-progress--".concat(s," ").concat(D),style:K},L,{children:function(){switch(s){case"circle":return _();case"semicircle":return o=V/2,i=p-V/2,a=(r=q+V)-V/2,l=q/2+V/2+V/2,d=f&&"outside"===O?r+4+18+4:r,c=Math.PI*P,u=c-(W?H:B)/100*c,t("div",{style:{position:"relative",width:p,height:d,overflow:"hidden"},children:[t("svg",{width:p,height:r,viewBox:"0 0 ".concat(p," ").concat(r),style:{position:"absolute",top:0,left:0},children:[e("path",{d:"M ".concat(o," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:A,strokeWidth:V,strokeLinecap:"round"}),e("path",{d:"M ".concat(o," ").concat(a," A ").concat(P," ").concat(P," 0 0 1 ").concat(i," ").concat(a),fill:"none",stroke:Y,strokeWidth:V,strokeLinecap:"round",strokeDasharray:c,strokeDashoffset:u,style:{transition:W?"stroke-dashoffset 0.3s ease":"none"}})]}),f&&"inside"===O?t("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},children:[e("div",{style:{fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:f}),m&&e("div",{style:{fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")})]}):t(n,{children:[m&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(l,"px"),transform:"translate(-50%, -50%)",textAlign:"center",fontSize:Z,fontWeight:600,color:"#1C1917",fontFamily:"DM Sans, sans-serif",lineHeight:1},children:"".concat(Math.round(B),"%")}),f&&"outside"===O&&e("div",{style:{position:"absolute",left:"50%",top:"".concat(r,"px"),transform:"translateX(-50%)",marginTop:"4px",textAlign:"center",fontSize:X,color:"#57534E",fontFamily:"DM Sans, sans-serif",lineHeight:"18px"},children:f})]})]});default:return console.warn('Progress type "'.concat(s,'" is not supported yet, using "circle" as fallback')),_()}var r,o,i,a,l,d,c,u}()}))},Fe=/^(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,ke=/(https?:\/\/[^\s<]+|www\.[^\s<]+|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(?:\/[^\s<]*)?)/gi,De=new Set(["com","cn","net","org","io","co","edu","gov","ai","app","dev","me","info","biz","tech","cc","tv","xyz","top","vip","pro","store","site","online","cloud"]),Se=function(e,t,n,r){if(void 0===t&&(t=!0),void 0===n&&(n=!0),!e||"string"!=typeof e)return!1;var o=e.trim();if(!o)return!1;var i=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(o);if(t&&!i)return!1;var a=i?o:"https://".concat(o);try{var l=new URL(a),d=l.protocol.toLowerCase();if("http:"!==d&&"https:"!==d)return!1;if(n){var s=l.hostname.toLowerCase();if(!s)return!1;if("localhost"===s)return!0;if(/^\d{1,3}(\.\d{1,3}){3}$/.test(s))return s.split(".").every(function(e){var t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255});if(!Fe.test(s))return!1;var c=s.split(".").pop()||"";if(!(r?new Set(r.map(function(e){return e.toLowerCase()})):De).has(c))return!1}return!0}catch(e){return!1}},Me=function(e){var t=e.match(/^(.*?)([),.;!?]+)?$/);return{core:(null==t?void 0:t[1])||e,suffix:(null==t?void 0:t[2])||""}},Ee=function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},Ae=function(e){return e.replace(new RegExp("","g"),"")},Le=function(e,t,n){var r=function(e,t){var n,r;if(!e)return[];for(var o=[],i=0,a=new RegExp(ke),l=a.exec(e);l;){var d=l[0],s=l.index,c=s+d.length;s>i&&o.push({type:"text",text:e.slice(i,s)});var u=Me(d),p=u.core,f=u.suffix,h=/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(p)?p:"https://".concat(p),g=Se(p,null!==(n=null==t?void 0:t.needProtocol)&&void 0!==n&&n,null===(r=null==t?void 0:t.needHost)||void 0===r||r,null==t?void 0:t.allowedTlds);((null==t?void 0:t.validate)?t.validate(h):g)&&p?(o.push({type:"url",text:p,href:h}),f&&o.push({type:"text",text:f})):o.push({type:"text",text:d}),i=c,l=a.exec(e)}return i<e.length&&o.push({type:"text",text:e.slice(i)}),o}(e,t);if(0===r.length)return"";var o=r.map(function(e){if("text"===e.type)return Ee(e.text);var r=(null==t?void 0:t.className)?' class="'.concat(t.className,'"'):"",o=n?"pointer-events: none;":"";return'<a href="'.concat(Ee(e.href),'" target="_blank" rel="noopener noreferrer"').concat(r,' style="color: #2563EB; text-decoration: underline; ').concat(o,'">').concat(Ee(e.text),"</a>")}).join("");return e.endsWith("\n")?"".concat(o,'<span data-aha-zwsp="true">').concat("","</span>"):o},ze=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return 0;var n=t.getRangeAt(0);if(!e.contains(n.startContainer))return 0;var r=n.cloneRange();return r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset),Ae(r.toString()).length},Be=c(function(o,a){var l=o.disabled,s=void 0!==l&&l,c=o.error,f=void 0!==c&&c,h=o.readOnly,g=void 0!==h&&h,m=o.showCount,y=void 0!==m&&m,b=o.maxLength,w=o.className,C=void 0===w?"":w,F=o.style,D=o.placeholder,S=o.value,M=o.defaultValue,E=o.rows,A=void 0===E?3:E,L=o.autoSize,z=void 0!==L&&L,B=o.onChange,T=o.onFocus,N=o.onBlur,W=o.linkify,R=void 0!==W&&W,I=o.linkifyOptions,H=x(o,["disabled","error","readOnly","showCount","maxLength","className","style","placeholder","value","defaultValue","rows","autoSize","onChange","onFocus","onBlur","linkify","linkifyOptions"]),j=k().primaryColor,Y=void 0===j?"#FB6011":j,O=u(null),V=u(null),P=u(!1),q=u(null),X=r.useState(M||S||""),Z=X[0],_=X[1],K=r.useState(!1),G=K[0],J=K[1],U=r.useState(void 0),$=U[0],Q=U[1];d(function(){"function"==typeof a?a(R?null:O.current):a&&(a.current=R?null:O.current)},[a,R]);var ee=void 0!==S,te=ee?S:Z,ne=String(te||"").length,re=function(e){J(!0),null==T||T(e)},oe=function(e){J(!1),null==N||N(e)},ie=i(function(){return"number"==typeof b?b:void 0},[b]);d(function(){if(!R&&z&&O.current){var e=O.current,t="object"==typeof z&&z.minRows||1,n="object"==typeof z?z.maxRows:void 0;e.style.height="auto";var r=e.scrollHeight,o=parseInt(window.getComputedStyle(e).lineHeight||"22",10),i=t*o,a=n?n*o:void 0,l=Math.max(r,i);a&&(l=Math.min(l,a)),e.style.height="".concat(l,"px"),Q(l)}},[te,z,R]),d(function(){if(R&&z&&V.current){var e=V.current,t="object"==typeof z&&z.minRows||1,n="object"==typeof z?z.maxRows:void 0,r=parseInt(window.getComputedStyle(e).lineHeight||"24",10),o=t*r+24,i=n?n*r+24:void 0;e.style.height="auto";var a=Math.max(e.scrollHeight,o);i&&(a=Math.min(a,i)),e.style.height="".concat(a,"px"),e.style.overflowY=i&&e.scrollHeight>i?"auto":"hidden",Q(a)}},[z,te,R]),p(function(){var e;if(R&&V.current&&!P.current){var t=V.current,n=document.activeElement===t,r=n?ze(t):0,o=null!==(e=q.current)&&void 0!==e?e:r,i=Le(String(te||""),I,s);if(t.innerHTML!==i&&(t.innerHTML=i),n){var a=String(te||"").length;!function(e,t){var n=document.createRange(),r=window.getSelection();if(r){for(var o=Math.max(0,t),i=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),a=i.nextNode();a;){for(var l=a.textContent||"",d=0,s=-1,c=0;c<l.length;c+=1)if(""!==l[c]&&(d+=1),d===o){s=c+1;break}if(0===o)return n.setStart(a,0),n.collapse(!0),r.removeAllRanges(),void r.addRange(n);if(-1!==s)return n.setStart(a,s),n.collapse(!0),r.removeAllRanges(),void r.addRange(n);o-=d,a=i.nextNode()}n.selectNodeContents(e),n.collapse(!1),r.removeAllRanges(),r.addRange(n)}}(t,Math.min(o,a))}q.current=null}},[te,s,R,I]);var ae=function(e){null==B||B({target:{value:e},currentTarget:{value:e}})},le=function(){if(V.current&&!P.current){q.current=ze(V.current);var e=Ae(V.current.textContent||""),t=ie?e.slice(0,ie):e;ee||_(t),ae(t)}},de=v(v({width:"100%",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(f?"#F04438":G?Y:"#D7D3D0"),backgroundColor:s||g?"#FAFAF9":"#FFFFFF",color:s?"#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:z||R?"none":"vertical",cursor:s?"not-allowed":"text",WebkitAppearance:"none",appearance:"none"},void 0!==$&&z?{height:"".concat($,"px")}:{}),F);return t(n,{children:[e("style",{children:"\n .aha-textarea-wrapper textarea::placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-webkit-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea::-moz-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n .aha-textarea-wrapper textarea:-ms-input-placeholder {\n color: #79716B;\n font-size: 16px;\n font-weight: 400;\n opacity: 1;\n }\n /* 移动端优化 */\n .aha-textarea-wrapper textarea {\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n }\n .aha-textarea-wrapper .aha-textarea-editable {\n white-space: pre-wrap;\n word-break: break-word;\n }\n .aha-textarea-wrapper .aha-textarea-editable:empty::before {\n content: attr(data-placeholder);\n color: #79716B;\n }\n .aha-textarea-wrapper .aha-textarea-editable a {\n color: #2563EB;\n }\n "}),t("div",{className:"aha-textarea-wrapper ".concat(C),style:{position:"relative",display:"inline-flex",flexDirection:"column",width:"100%"},children:[R?e("div",{ref:V,className:"aha-textarea-editable",contentEditable:!s&&!g,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-disabled":s,"data-placeholder":D||"",onInput:le,onPaste:function(e){var t;if(e.preventDefault(),!g&&!s){var n,r,o=e.clipboardData.getData("text/plain"),i=String(te||""),a=window.getSelection(),l="".concat(i).concat(o),d=i.length+o.length;if(a&&a.rangeCount>0&&(null===(t=V.current)||void 0===t?void 0:t.contains(a.anchorNode))){var c=ze(V.current),u=(n=a.getRangeAt(0),(r=n.cloneRange()).selectNodeContents(V.current),r.setEnd(n.endContainer,n.endOffset),r.toString().length);l=i.slice(0,c)+o+i.slice(u),d=c+o.length}ie&&(l=l.slice(0,ie),d=Math.min(d,l.length)),q.current=d,ee||_(l),ae(l)}},onKeyDown:function(e){var t,n;if("Enter"===e.key&&!e.nativeEvent.isComposing&&!s&&!g&&V.current){e.preventDefault();var r=String(te||""),o=function(e){var t=window.getSelection();if(!t||0===t.rangeCount)return null;var n=t.getRangeAt(0);if(!e.contains(n.startContainer)||!e.contains(n.endContainer))return null;var r=n.cloneRange();r.selectNodeContents(e),r.setEnd(n.startContainer,n.startOffset);var o=n.cloneRange();return o.selectNodeContents(e),o.setEnd(n.endContainer,n.endOffset),{start:Ae(r.toString()).length,end:Ae(o.toString()).length}}(V.current),i=null!==(t=null==o?void 0:o.start)&&void 0!==t?t:r.length,a=null!==(n=null==o?void 0:o.end)&&void 0!==n?n:i,l="".concat(r.slice(0,i),"\n").concat(r.slice(a));ie&&(l=l.slice(0,ie));var d=Math.min(i+1,l.length);q.current=d,ee||_(l),ae(l)}},onFocus:function(e){return re(e)},onBlur:function(e){return oe(e)},onCompositionStart:function(){P.current=!0},onCompositionEnd:function(){P.current=!1,le()},style:v(v({},de),{minHeight:z?void 0:"".concat(24*A+24,"px"),overflowY:z?"hidden":"auto"}),autoCorrect:H.autoCorrect||"off",autoCapitalize:H.autoCapitalize||"off",spellCheck:H.spellCheck||!1}):e("textarea",v({ref:O,value:te,placeholder:D,disabled:s,readOnly:g,rows:z?void 0:A,maxLength:b,onChange:function(e){ee||_(e.target.value),null==B||B(e)},onFocus:re,onBlur:oe,style:de,autoComplete:H.autoComplete||"off",autoCorrect:H.autoCorrect||"off",autoCapitalize:H.autoCapitalize||"off",spellCheck:H.spellCheck||!1},H)),(y||b)&&e("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:s?"#98A2B3":"#78716C",fontFamily:"DM Sans, sans-serif"},children:b?t("span",{children:[ne," / ",b]}):e("span",{children:ne})})]})]})});Be.displayName="Textarea";var Te=function(n){var o=n.checked,i=n.defaultChecked,a=void 0!==i&&i,l=n.disabled,d=void 0!==l&&l,s=n.onChange,c=n.onClick,u=n.checkedChildren,p=n.unCheckedChildren,f=n.size,h=void 0===f?"default":f,g=n.loading,x=void 0!==g&&g,m=n.className,y=void 0===m?"":m,b=n.style,w=k().primaryColor,C=void 0===w?"#FB6011":w,F=r.useState(a),D=F[0],S=F[1],M=void 0!==o,E=M?o:D,A={small:{width:"36px",height:"20px",thumbSize:"16px",thumbOffset:"2px",fontSize:"10px"},default:{width:"44px",height:"24px",thumbSize:"20px",thumbOffset:"2px",fontSize:"12px"}}[h],L=E||x,z=d?"#E7E5E4":L?C:"#F5F5F4",B=L?"calc(100% - ".concat(A.thumbSize," - ").concat(A.thumbOffset,")"):A.thumbOffset;return t("button",{type:"button",role:"switch","aria-checked":E,disabled:d||x,onClick:function(e){if(!d&&!x){var t=!E;M||S(t),null==s||s(t,e),null==c||c(t,e)}},className:"aha-switch ".concat(y),style:v({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:L?"flex-end":"flex-start",width:A.width,height:A.height,padding:"0",margin:"0",border:"none",borderRadius:"small"===h?"10px":"12px",backgroundColor:z,cursor:d||x?"not-allowed":"pointer",transition:"all 0.2s",outline:"none",boxSizing:"border-box"},b),children:[(u||p)&&e("span",{style:{position:"absolute",left:L?"6px":"auto",right:L?"auto":"6px",fontSize:A.fontSize,lineHeight:"1",color:"#FFFFFF",fontFamily:"DM Sans, sans-serif",fontWeight:500,transition:"opacity 0.2s",opacity:d?.5:1,zIndex:1,pointerEvents:"none"},children:L?u:p}),e("span",{style:{position:"absolute",left:B,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:x&&t("svg",{width:"small"===h?"8":"10",height:"small"===h?"8":"10",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[e("style",{children:"\n @keyframes spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n "}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",opacity:"0.3"}),e("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"24"})]})})]})};Te.displayName="Switch";var Ne=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=["January","February","March","April","May","June","July","August","September","October","November","December"],Re=function(e,t){if(void 0===t&&(t="YYYY-MM-DD"),!e)return"";var n=e.getFullYear(),r=e.getMonth(),o=String(r+1).padStart(2,"0"),i=String(e.getDate()).padStart(2,"0"),a=String(e.getDate());return t.replace(/YYYY/g,"").replace(/YY/g,"").replace(/MMMM/g,"").replace(/MMM/g,"").replace(/MM/g,"").replace(/DD/g,"").replace(/D/g,"").replace(/M/g,"").replace(new RegExp("","g"),String(n)).replace(new RegExp("","g"),String(n).slice(-2)).replace(new RegExp("","g"),We[r]).replace(new RegExp("","g"),Ne[r]).replace(new RegExp("","g"),o).replace(new RegExp("","g"),String(r+1)).replace(new RegExp("","g"),i).replace(new RegExp("","g"),a)},Ie=function(e,t){return new Date(e,t+1,0).getDate()},He=function(e,t){return!(!e||!t)&&(e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate())},je=function(e,t,n){return!(t&&e<t)&&!(n&&e>n)},Ye=function(r){var o=r.mode,a=void 0===o?"date":o,c=r.disabled,p=void 0!==c&&c,f=r.error,g=void 0!==f&&f,x=r.placeholder,m=void 0===x?"Select date":x,y=r.startPlaceholder,b=void 0===y?"Start date":y,w=r.endPlaceholder,C=void 0===w?"End date":w,F=r.size,D=void 0===F?"medium":F,S=r.allowClear,M=void 0!==S&&S,E=r.format,A=void 0===E?"range"===a?"MMM D, YYYY":"YYYY-MM-DD":E,L=r.onFocus,z=r.onBlur,B=r.onOpenChange,T=r.className,N=void 0===T?"":T,W=r.style,R=r.dropdownClassName,I=void 0===R?"":R,H=r.dropdownStyle,j=r.defaultOpen,Y=void 0!==j&&j,O=r.open,V=r.minDate,P=r.maxDate,q=r.separator,X=void 0===q?" - ":q,Z=r.presetRanges,_=void 0!==Z&&Z,K=r.calendarCount,G=void 0===K?1:K,J=r.showApplyCancel,U=void 0!==J&&J,$=r.applyText,Q=void 0===$?"Apply":$,ee=r.cancelText,te=void 0===ee?"Cancel":ee,ne=r.onApply,re=r.onCancel,oe=r.showSelectedRange,ie=void 0!==oe&&oe,ae=r.startSelectedRangeText,le=void 0===ae?"Select dates":ae,de=r.endSelectedRangeText,se=void 0===de?"Select dates":de,ce=r.rangeDisplayMode,ue=void 0===ce?"range":ce,pe=k().primaryColor,fe=void 0===pe?"#FB6011":pe,he="range"===a,ge=l(function(){return"date"===a&&"defaultValue"in r&&r.defaultValue||null}),ve=ge[0],xe=ge[1],me=l(function(){return"range"===a&&"defaultValue"in r&&r.defaultValue||{startDate:null,endDate:null}}),ye=me[0],be=me[1],we=l(Y),Ce=we[0],Fe=we[1],ke=l(!0),De=ke[0],Se=ke[1],Me=l(null),Ee=Me[0],Ae=Me[1],Le=l(function(){var e,t;if("date"===a&&"value"in r&&r.value&&(t=r.value))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"value"in r&&r.value&&(t=(e=r.value).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};if("date"===a&&"defaultValue"in r&&r.defaultValue&&(t=r.defaultValue))return{year:t.getFullYear(),month:t.getMonth()};if("range"===a&&"defaultValue"in r&&r.defaultValue&&(t=(e=r.defaultValue).startDate||e.endDate))return{year:t.getFullYear(),month:t.getMonth()};var n=new Date;return{year:n.getFullYear(),month:n.getMonth()}}),ze=Le[0],Be=Le[1],Te=l(function(){if(2===G&&he){var e=new Date(ze.year,ze.month+1,1);return{year:e.getFullYear(),month:e.getMonth()}}return null}),Ne=Te[0],Ye=Te[1];d(function(){if(2===G&&he){var e=new Date(ze.year,ze.month+1,1);Ye({year:e.getFullYear(),month:e.getMonth()})}else Ye(null)},[ze,G,he]);var Oe=u(null),Ve=u(null),Pe=u(null),qe=u(null),Xe=u(null),Ze=l(null),_e=Ze[0],Ke=Ze[1],Ge=u(!1),Je=u(!1),Ue=u(null),$e="value"in r&&void 0!==r.value,Qe=void 0!==O,et=he?null:$e&&"date"===a&&"value"in r?r.value:ve,tt=he?$e&&"range"===a&&"value"in r?r.value||{startDate:null,endDate:null}:ye:{startDate:null,endDate:null},nt=Qe?O:Ce;d(function(){if(nt&&!Ge.current){if(he){var e=tt.startDate||tt.endDate;if(e){var t=e.getFullYear(),n=e.getMonth();Be({year:t,month:n})}else{var r=new Date;Be({year:r.getFullYear(),month:r.getMonth()})}}else if(et){t=et.getFullYear(),n=et.getMonth();Be({year:t,month:n})}else{r=new Date;Be({year:r.getFullYear(),month:r.getMonth()})}Ge.current=!0}else nt||(Ge.current=!1)},[nt,et,tt,he]),d(function(){if(nt&&Oe.current){Je.current=!1,Ue.current=null;var e=function(){if(Oe.current){var e=Oe.current.getBoundingClientRect();if(Je.current&&null!==Ue.current){var t,n=Ue.current;if(Xe.current){var r=Xe.current.offsetHeight;t="top"===n?e.top+window.scrollY-r-4:e.bottom+window.scrollY+4}else t="top"===n?e.top+window.scrollY-400-4:e.bottom+window.scrollY+4;return void Ke({top:t,left:e.left+window.scrollX,width:e.width,placement:n})}var o=e.bottom+window.scrollY+4,i="bottom";Ke({top:o,left:e.left+window.scrollX,width:e.width,placement:i}),requestAnimationFrame(function(){requestAnimationFrame(function(){!function(){if(Xe.current){var t=Xe.current.offsetHeight,n=window.innerHeight-e.bottom-4,r=e.top-4;(n<t&&r>=t||n<t&&r<t&&r>n)&&(o=e.top+window.scrollY-t-4,i="top"),Je.current=!0,Ue.current=i}Ke({top:o,left:e.left+window.scrollX,width:e.width,placement:i})}()})})}};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),function(){window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}}Ke(null),Je.current=!1,Ue.current=null},[nt]),d(function(){var e=function(e){var t=e.target;Oe.current&&!Oe.current.contains(t)&&Xe.current&&!Xe.current.contains(t)&&(Qe||Fe(!1),null==B||B(!1))};if(nt)return document.addEventListener("mousedown",e,!0),document.addEventListener("touchstart",e,!0),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("touchstart",e,!0)}},[nt,Qe,B]);var rt,ot,it,at,lt=s(function(e){var t;je(e,V,P)&&($e||xe(e),"date"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),Qe||Fe(!1),null==B||B(!1))},[$e,Qe,a,r,B,V,P]),dt=s(function(e){var t;if(je(e,V,P)){var n,o=U&&Ee?Ee:tt;o.startDate&&o.endDate?(n={startDate:e,endDate:null},Se(!1)):De?o.endDate&&e>o.endDate?(n={startDate:o.endDate,endDate:e},Se(!1)):(n={startDate:e,endDate:o.endDate},o.endDate?(Se(!0),U||(Qe||Fe(!1),null==B||B(!1))):Se(!1)):o.startDate&&e<o.startDate?(n={startDate:e,endDate:o.startDate},Se(!1)):(n={startDate:o.startDate,endDate:e},Se(!0),U||(Qe||Fe(!1),null==B||B(!1))),U?Ae(n):($e||be(n),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,n)))}},[De,tt,Ee,U,$e,Qe,a,r,B,V,P]),st=function(e){var t,n;if(e.stopPropagation(),he){var o={startDate:null,endDate:null};$e||be(o),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,o)),Se(!0)}else $e||xe(null),"date"===a&&"onChange"in r&&(null===(n=r.onChange)||void 0===n||n.call(r,null));if(!nt){var i=new Date;Be({year:i.getFullYear(),month:i.getMonth()})}},ct=function(){if(!p){var e=!nt;if(Qe||Fe(e),null==B||B(e),e){if(he){if(Se(!tt.startDate),U&&Ae(tt),!tt.startDate&&!tt.endDate){var t=new Date;Be({year:t.getFullYear(),month:t.getMonth()})}}else if(!et){t=new Date;Be({year:t.getFullYear(),month:t.getMonth()})}}else!e&&U&&Ae(null)}},ut=i(function(){var e=new Date;e.setHours(0,0,0,0);var t=new Date(e),n=new Date(e);n.setDate(e.getDate()-6);var r=new Date(e),o=new Date(e),i=e.getDate();o.setMonth(e.getMonth()-1),o.getDate()!==i&&o.setDate(0);var a=new Date(e),l=new Date(e);return l.setFullYear(e.getFullYear()-1),[{label:"Last week",range:{startDate:n,endDate:t}},{label:"Last month",range:{startDate:o,endDate:r}},{label:"Last year",range:{startDate:l,endDate:a}}]},[]),pt=i(function(){return Array.isArray(_)?_:!0===_?ut:[]},[_,ut]),ft=pt.length>0,ht=function(e){var t;if(e.startDate){var n=e.startDate.getFullYear(),o=e.startDate.getMonth();Be({year:n,month:o})}U?Ae(e):($e||be(e),"range"===a&&"onChange"in r&&(null===(t=r.onChange)||void 0===t||t.call(r,e)),Qe||Fe(!1),null==B||B(!1))},gt=function(){Be(function(e){return 0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}})},vt=function(){Be(function(e){return 11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}})},xt=s(function(e,t){for(var n=Ie(e,t),r=[],o=1;o<=n;o++)r.push(new Date(e,t,o));return r},[]),mt=i(function(){return xt(ze.year,ze.month)},[ze,xt]),yt=i(function(){return 2===G&&he&&Ne?xt(Ne.year,Ne.month):null},[G,he,Ne,xt]),bt=function(){Ne&&Ye(function(e){return e?0===e.month?{year:e.year-1,month:11}:{year:e.year,month:e.month-1}:null})},wt=function(){Ne&&Ye(function(e){return e?11===e.month?{year:e.year+1,month:0}:{year:e.year,month:e.month+1}:null})},Ct={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"}},Ft=M&&!p&&(he?tt.startDate||tt.endDate:et),kt=et?Re(et,A):"",Dt=tt.startDate?Re(tt.startDate,A):"",St=tt.endDate?Re(tt.endDate,A):"",Mt=i(function(){if(!he||"text"!==ue)return"";if(tt.startDate&&tt.endDate){var e=Re(tt.startDate,"MMM D, YYYY"),t=Re(tt.endDate,"MMM D, YYYY");return"".concat(e," ").concat(X," ").concat(t)}return tt.startDate?Re(tt.startDate,"MMM D, YYYY"):tt.endDate?Re(tt.endDate,"MMM D, YYYY"):""},[he,ue,tt,X]),Et=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"];return t(n,{children:[e("style",{children:"\n @keyframes dropdownFadeIn {\n from {\n opacity: 0;\n transform: translateY(-8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes dropdownFadeInTop {\n from {\n opacity: 0;\n transform: translateY(8px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n "}),t("div",{ref:Oe,className:"aha-date-picker ".concat(N),style:v({position:"relative",display:"inline-flex",alignItems:"center",boxSizing:"border-box",fontFamily:"DM Sans, sans-serif",borderRadius:"8px",border:"1px solid ".concat(g?"#F04438":nt?fe:"#D7D3D0"),backgroundColor:p?"#FAFAF9":"#FFFFFF",cursor:p?"not-allowed":"pointer",transition:"all 0.2s",paddingLeft:"40px",paddingRight:Ft?"30px":"12px",paddingTop:Ct[D].paddingTop,paddingBottom:Ct[D].paddingBottom,fontSize:Ct[D].fontSize,lineHeight:Ct[D].lineHeight,fontWeight:400,WebkitTapHighlightColor:"transparent",WebkitTouchCallout:"none",touchAction:"manipulation",userSelect:"none"},W),onClick:ct,onFocus:function(e){null==L||L(e)},onBlur:function(e){null==z||z(e)},tabIndex:p?-1:0,children:[e("span",{style:{position:"absolute",left:"12px",display:"flex",alignItems:"center",color:p?"#98A2B3":"#78716C",zIndex:1,pointerEvents:"none"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M12.6667 2.66667H12V2C12 1.63181 11.7015 1.33333 11.3333 1.33333C10.9651 1.33333 10.6667 1.63181 10.6667 2V2.66667H5.33333V2C5.33333 1.63181 5.03486 1.33333 4.66667 1.33333C4.29848 1.33333 4 1.63181 4 2V2.66667H3.33333C2.59695 2.66667 2 3.26362 2 4V13.3333C2 14.0697 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0697 14 13.3333V4C14 3.26362 13.403 2.66667 12.6667 2.66667ZM12.6667 13.3333H3.33333V7.33333H12.6667V13.3333ZM12.6667 6H3.33333V4H12.6667V6Z",fill:"currentColor"})})},{})}),he?"text"===ue?e("input",{ref:Ve,type:"text",value:Mt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate||tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}):t("div",{style:{display:"flex",alignItems:"center",flex:1,gap:"8px",minWidth:0},children:[e("input",{ref:Pe,type:"text",value:Dt,readOnly:!0,placeholder:b,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(Se(!0),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Be({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.startDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),e("span",{style:{color:p?"#98A2B3":"#78716C",fontSize:"16px",flexShrink:0},children:X}),e("input",{ref:qe,type:"text",value:St,readOnly:!0,placeholder:C,disabled:p,onClick:function(e){if(e.stopPropagation(),!p)if(Se(!1),nt){if(!tt.startDate&&!tt.endDate){var t=new Date;Be({year:t.getFullYear(),month:t.getMonth()})}}else ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":tt.endDate?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}})]}):e("input",{ref:Ve,type:"text",value:kt,readOnly:!0,placeholder:m,disabled:p,onClick:function(e){e.stopPropagation(),p||ct()},style:{flex:1,border:"none",outline:"none",background:"transparent",fontSize:"16px",lineHeight:"24px",fontWeight:400,color:p?"#98A2B3":et?"#1C1917":"#79716B",fontFamily:"DM Sans, sans-serif",minWidth:0,cursor:p?"not-allowed":"pointer",WebkitAppearance:"none",appearance:"none"}}),Ft&&e("div",{style:{position:"absolute",right:"10px",display:"flex",alignItems:"center",gap:"4px"},children:e(function(){return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:st,style:{cursor:"pointer",flexShrink:0,color:"#78716C"},children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})},{})})]}),nt&&_e&&h(e("div",{ref:Xe,className:"aha-date-picker-dropdown ".concat(I),style:v({position:"absolute",top:"".concat(_e.top,"px"),left:"".concat(_e.left,"px"),zIndex:1050,backgroundColor:"#FFFFFF",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",border:"1px solid #E7E5E4",padding:"0",opacity:0,transform:"top"===(_e.placement||"bottom")?"translateY(8px)":"translateY(-8px)",animation:"top"===(_e.placement||"bottom")?"dropdownFadeInTop 0.2s ease-out forwards":"dropdownFadeIn 0.2s ease-out forwards",display:"flex",flexDirection:"column"},H),children:t("div",{style:{display:"flex",flex:1,minHeight:0,flexDirection:he&&ft&&1===G?"column":"row"},children:[he&&ft&&2===G&&e("div",{style:{width:"140px",borderRight:"1px solid #E7E5E4",padding:"12px 0",backgroundColor:"#FFFFFF",borderTopLeftRadius:"8px",borderBottomLeftRadius:U?"0":"8px"},children:pt.map(function(t,n){var r=Ee?He(t.range.startDate,Ee.startDate)&&He(t.range.endDate,Ee.endDate):He(t.range.startDate,tt.startDate)&&He(t.range.endDate,tt.endDate);return e("div",{onClick:function(){return ht(t.range)},style:{padding:"8px 16px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:r?fe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",fontWeight:r?500:400,transition:"all 0.2s"},onMouseEnter:function(e){r||(e.currentTarget.style.backgroundColor="#F5F5F4")},onMouseLeave:function(e){r||(e.currentTarget.style.backgroundColor="transparent")},children:t.label},n)})}),t("div",{children:[e("div",{style:{flex:1,padding:"16px",display:"flex",flexDirection:2===G?"row":"column",gap:2===G?"24px":"0"},children:(at=function(n,r,o,i,a){return void 0===a&&(a=0),t("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:[t("div",{style:{display:"flex",alignItems:"center",justifyContent:2===G&&he?"center":"space-between",marginBottom:"16px",position:"relative"},children:[!(2===G&&he&&1===a)&&e("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",left:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M10 12L6 8L10 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t("div",{style:{fontSize:"16px",fontWeight:500,color:"#1C1917",fontFamily:"DM Sans, sans-serif"},children:[We[n.month]," ",n.year]}),!(2===G&&he&&0===a)&&e("button",{type:"button",onClick:i,style:{display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",border:"none",background:"transparent",cursor:"pointer",borderRadius:"4px",color:"#78716C",transition:"all 0.2s",position:2===G&&he?"absolute":"relative",right:2===G&&he?0:void 0},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),he&&ie&&1===G&&0===a&&(l=U&&Ee?Ee:tt,d=l.startDate?Re(l.startDate,"MMM D, YYYY"):le,s=l.endDate?Re(l.endDate,"MMM D, YYYY"):se,t("div",{className:"flex items-center gap-2",style:{fontSize:"14px",marginBottom:"16px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.startDate?"text-[#44403C]":"text-[#79716B]"),children:d}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(l.endDate?"text-[#44403C]":"text-[#79716B]"),children:s})]})),he&&ft&&1===G&&e("div",{style:{width:"252px",display:"flex",flexWrap:"wrap",paddingBottom:"16px"},children:pt.map(function(t,n){var r=Ee?He(t.range.startDate,Ee.startDate)&&He(t.range.endDate,Ee.endDate):He(t.range.startDate,tt.startDate)&&He(t.range.endDate,tt.endDate);return e("button",{type:"button",onClick:function(){return ht(t.range)},style:{padding:"4px 8px",cursor:"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",color:r?fe:"#1C1917",backgroundColor:r?"#FAFAF9":"transparent",border:"none",fontWeight:r?500:400,transition:"all 0.2s",borderRadius:"4px"},children:t.label},n)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",marginBottom:"8px"},children:Et.map(function(t){return e("div",{style:{width:"36px",textAlign:"center",fontSize:"12px",fontWeight:500,color:"#78716C",fontFamily:"DM Sans, sans-serif",padding:"4px"},children:t},t)})}),e("div",{style:{width:"252px",display:"grid",gridTemplateColumns:"repeat(7, 1fr)",rowGap:"4px",columnGap:"0px"},children:function(){for(var o,i,a=(o=n.year,i=n.month,new Date(o,i,1).getDay()),l=(0===a?7:a)-1,d=[],s=0;s<l;s++)d.push(e("div",{},"empty-".concat(s)));return r.forEach(function(r,o){if(r){var i=l+o,a=r.getMonth()===n.month,s=He(r,new Date),c=!je(r,V,P);if(he){var u=U&&Ee?Ee:tt,p=He(r,u.startDate),f=He(r,u.endDate),h=function(e,t,n){if(!t||!n)return!1;var r=e.getTime(),o=t.getTime(),i=n.getTime();return r>=o&&r<=i}(r,u.startDate,u.endDate),g=i%7==0,v=i%7==6,x=p,m=f,y={display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",cursor:c?"not-allowed":"pointer",fontSize:"14px",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0};if(x||m)y.background=fe,y.borderRadius="50%",y.color="#FFFFFF",y.fontWeight=500;else if(h){y.background="#F5F5F4",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;var b=1===r.getDate(),w=Ie(n.year,n.month),C=r.getDate()===w,F=g||b,k=v||C;F&&k?y.borderRadius="18px":F?(y.borderTopLeftRadius="18px",y.borderBottomLeftRadius="18px",y.borderTopRightRadius="0",y.borderBottomRightRadius="0"):k?(y.borderTopRightRadius="18px",y.borderBottomRightRadius="18px",y.borderTopLeftRadius="0",y.borderBottomLeftRadius="0"):y.borderRadius="0"}else y.background="transparent",y.borderRadius="50%",y.color=a?c?"#D7D3D0":"#1C1917":"#78716C",y.fontWeight=400;d.push(t("button",{type:"button",disabled:c,onClick:function(){return dt(r)},style:y,onMouseEnter:function(e){c||x||m||(e.currentTarget.style.backgroundColor=h?"#E7E5E4":"#FAFAF9")},onMouseLeave:function(e){x||m||(e.currentTarget.style.backgroundColor=h?"#F5F5F4":"transparent")},children:[r.getDate(),s&&e("div",{style:{position:"absolute",bottom:"3px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:x||m?"#FFFFFF":fe}})]},"date-".concat(o)))}else{var D=He(r,et);d.push(t("button",{type:"button",disabled:c,onClick:function(){return lt(r)},style:{display:"flex",alignItems:"center",justifyContent:"center",width:"36px",height:"36px",border:"none",background:D?fe:"transparent",cursor:c?"not-allowed":"pointer",borderRadius:"4px",fontSize:"14px",fontWeight:D?500:400,color:D?"#FFFFFF":a?c?"#D7D3D0":"#1C1917":"#78716C",fontFamily:"DM Sans, sans-serif",transition:"all 0.2s",opacity:c?.4:1,position:"relative",padding:0,margin:0},onMouseEnter:function(e){c||D||(e.currentTarget.style.backgroundColor="#FAFAF9")},onMouseLeave:function(e){D||(e.currentTarget.style.backgroundColor="transparent")},children:[r.getDate(),s&&!D&&e("div",{style:{position:"absolute",bottom:"2px",left:"50%",transform:"translateX(-50%)",width:"4px",height:"4px",borderRadius:"50%",backgroundColor:fe}})]},"date-".concat(o)))}}}),d}()})]},a);var l,d,s},t(n,{children:[at(ze,mt,gt,vt,0),2===G&&he&&Ne&&yt&&at(Ne,yt,bt,wt,1)]}))}),he&&ie&&2===G&&!U&&(rt=tt,ot=rt.startDate?Re(rt.startDate,"MMM D, YYYY"):le,it=rt.endDate?Re(rt.endDate,"MMM D, YYYY"):se,e("div",{className:"flex items-center gap-2",style:{padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(rt.startDate?"text-[#44403C]":"text-[#79716B]"),children:ot}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(rt.endDate?"text-[#44403C]":"text-[#79716B]"),children:it})]})})),he&&U&&t("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",padding:"12px 16px",borderTop:"1px solid #E7E5E4",borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px"},children:[ie&&2===G&&function(){var n=Ee||tt,r=n.startDate?Re(n.startDate,"MMM D, YYYY"):le,o=n.endDate?Re(n.endDate,"MMM D, YYYY"):se;return t("div",{className:"w-[260px] flex items-center gap-2",style:{fontSize:"14px"},children:[e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.startDate?"text-[#44403C]":"text-[#79716B]"),children:r}),e("div",{children:X}),e("div",{className:"flex-1 text-center border border-[#D7D3D0] rounded-md px-2 py-[6px] ".concat(n.endDate?"text-[#44403C]":"text-[#79716B]"),children:o})]})}(),t("div",{className:"".concat(2===G?"":"w-full"),style:{display:"flex",gap:"8px",flexShrink:0,marginLeft:"auto"},children:[e("button",{type:"button",onClick:function(){Ae(null),null==re||re(),Qe||Fe(!1),null==B||B(!1)},style:{flex:1,padding:"8px 16px",border:"1px solid #E7E5E4",borderRadius:"8px",background:"#FFFFFF",color:"#1C1917",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:"pointer",transition:"all 0.2s"},onMouseEnter:function(e){e.currentTarget.style.backgroundColor="#FAFAF9"},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="#FFFFFF"},children:te}),e("button",{type:"button",onClick:function(){var e;Ee&&($e||be(Ee),"range"===a&&"onChange"in r&&(null===(e=r.onChange)||void 0===e||e.call(r,Ee)),null==ne||ne(Ee),Qe||Fe(!1),null==B||B(!1),Ae(null))},disabled:!Ee||!Ee.startDate||!Ee.endDate,style:{flex:1,padding:"8px 16px",border:"none",borderRadius:"8px",background:Ee&&Ee.startDate&&Ee.endDate?fe:"#D7D3D0",color:"#FFFFFF",fontSize:"14px",fontWeight:500,fontFamily:"DM Sans, sans-serif",cursor:Ee&&Ee.startDate&&Ee.endDate?"pointer":"not-allowed",transition:"all 0.2s"},onMouseEnter:function(e){Ee&&Ee.startDate&&Ee.endDate&&(e.currentTarget.style.backgroundColor="#FD843A")},onMouseLeave:function(e){Ee&&Ee.startDate&&Ee.endDate&&(e.currentTarget.style.backgroundColor=fe)},children:Q})]})]})]})]})}),document.body)]})};Ye.displayName="DatePicker";var Oe=o(null),Ve=function(e){function t(n,r,o){var i=e.call(this,n)||this;return i.name="FormValidationError",i.values=r,i.errorFields=o,Object.setPrototypeOf(i,t.prototype),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error),Pe=r.forwardRef(function(t,n){var r=t.initialValues,o=void 0===r?{}:r,a=t.onValuesChange,c=t.onFinish,p=t.onFinishFailed,h=t.labelWidth,g=void 0===h?"120px":h,x=t.labelAlign,b=void 0===x?"right":x,w=t.layout,C=void 0===w?"horizontal":w;t.size;var F=t.className,k=void 0===F?"":F,D=t.style,S=t.children,M=l(function(){var e={};return Object.keys(o).forEach(function(t){e[t]={value:o[t],error:void 0,touched:!1,validating:!1}}),e}),E=M[0],A=M[1],L=u(E);d(function(){L.current=E},[E]);var z=u({}),B=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.value},[]),T=s(function(e,t){A(function(n){var r=v({},n);if(r[e]?r[e]=v(v({},r[e]),{value:t}):r[e]={value:t,error:void 0,touched:!1,validating:!1},L.current[e]?L.current[e]=v(v({},L.current[e]),{value:t}):L.current[e]={value:t,error:void 0,touched:!1,validating:!1},a){var o={};o[e]=t;var i={};Object.keys(r).forEach(function(e){i[e]=r[e].value}),a(o,i)}return r})},[a]),N=s(function(e){var t;return null===(t=L.current[e])||void 0===t?void 0:t.error},[]),W=s(function(e,t){L.current[e]&&(L.current[e]=v(v({},L.current[e]),{error:t})),A(function(n){var r=v({},n);return r[e]?r[e]=v(v({},r[e]),{error:t}):r[e]={value:void 0,error:t,touched:!1,validating:!1},r})},[]),R=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.touched)||!1},[]),I=s(function(e,t){L.current[e]&&(L.current[e]=v(v({},L.current[e]),{touched:t})),A(function(n){var r=v({},n);return r[e]?r[e]=v(v({},r[e]),{touched:t}):r[e]={value:void 0,error:void 0,touched:t,validating:!1},r})},[]),H=s(function(e){var t;return(null===(t=L.current[e])||void 0===t?void 0:t.validating)||!1},[]),j=s(function(e,t){L.current[e]&&(L.current[e]=v(v({},L.current[e]),{validating:t})),A(function(n){var r=v({},n);return r[e]?r[e]=v(v({},r[e]),{validating:t}):r[e]={value:void 0,error:void 0,touched:!1,validating:t},r})},[]),Y=u();Y.current=function(e,t){A(function(n){if(n[e]){var r=n[e].rules||[],i=t.rules||[],a=r.length===i.length;if(a&&r.length>0)for(var l=0;l<r.length;l++){var d=r[l],s=i[l];if((null==d?void 0:d.required)!==(null==s?void 0:s.required)||(null==d?void 0:d.message)!==(null==s?void 0:s.message)||(null==d?void 0:d.type)!==(null==s?void 0:s.type)||(null==d?void 0:d.pattern)!==(null==s?void 0:s.pattern)||(null==d?void 0:d.min)!==(null==s?void 0:s.min)||(null==d?void 0:d.max)!==(null==s?void 0:s.max)||(null==d?void 0:d.len)!==(null==s?void 0:s.len)||(null==d?void 0:d.whitespace)!==(null==s?void 0:s.whitespace)){a=!1;break}}if(a&&n[e].required===t.required)return n}var c=v({},n);return c[e]?c[e]=v(v({},c[e]),{rules:t.rules,required:t.required}):c[e]={value:o[e],error:void 0,touched:!1,validating:!1,rules:t.rules,required:t.required},c})};var O=s(function(e,t){var n;null===(n=Y.current)||void 0===n||n.call(Y,e,t)},[]),V=s(function(e){delete z.current[e],A(function(t){var n=v({},t);return delete n[e],n}),delete L.current[e]},[]),P=s(function(e){return m(void 0,void 0,void 0,function(){var t,n,r,o,i,a,l,d,s;return y(this,function(c){switch(c.label){case 0:if(!(t=L.current[e]))return[2,void 0];j(e,!0),n=t.rules||[],o=0,i=n,c.label=1;case 1:if(!(o<i.length))return[3,6];if(a=i[o],l=t.value,a.required&&(null==l||""===l))return r=a.message||"".concat(e," is required"),[3,6];if(a.type&&null!=l&&""!==l&&(d={string:function(e){return"string"==typeof e},number:function(e){return"number"==typeof e&&!isNaN(e)},boolean:function(e){return"boolean"==typeof e},email:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(e))},url:function(e){try{return new URL(String(e)),!0}catch(e){return!1}}}[a.type])&&!d(l))return r=a.message||"".concat(e," must be a valid ").concat(a.type),[3,6];if(a.pattern&&null!=l&&""!==l&&!a.pattern.test(String(l)))return r=a.message||"".concat(e," format is invalid"),[3,6];if(void 0!==a.min&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))<a.min)return r=a.message||"".concat(e," must be at least ").concat(a.min),[3,6];if(void 0!==a.max&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))>a.max)return r=a.message||"".concat(e," must be at most ").concat(a.max),[3,6];if(void 0!==a.len&&null!=l&&""!==l&&("string"==typeof l?l.length:Number(l))!==a.len)return r=a.message||"".concat(e," must be exactly ").concat(a.len),[3,6];if(a.whitespace&&"string"==typeof l&&l.trim()!==l)return r=a.message||"".concat(e," cannot be whitespace"),[3,6];if(!a.validator)return[3,5];c.label=2;case 2:return c.trys.push([2,4,,5]),[4,a.validator(a,l)];case 3:return c.sent(),[3,5];case 4:return s=c.sent(),r=(null==s?void 0:s.message)||a.message||"".concat(e," validation failed"),[3,6];case 5:return o++,[3,1];case 6:return L.current[e]?L.current[e]=v(v({},L.current[e]),{error:r,validating:!1,touched:!0}):L.current[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},A(function(n){var o=v({},n);return o[e]?o[e]=v(v({},o[e]),{error:r,validating:!1,touched:!0}):o[e]={value:t.value,error:r,touched:!0,validating:!1,rules:t.rules,required:t.required},o}),[2,r]}})})},[]),q=s(function(e){var t=L.current,n={};return(e||Object.keys(t)).forEach(function(e){var r;n[e]=null===(r=t[e])||void 0===r?void 0:r.value}),n},[]),X=s(function(e){return m(void 0,void 0,void 0,function(){var t,n,r,o,i;return y(this,function(a){switch(a.label){case 0:return t=L.current,n=e||Object.keys(t),r=[],[4,Promise.all(n.map(function(e){return m(void 0,void 0,void 0,function(){var n,r;return y(this,function(o){switch(o.label){case 0:return(n=t[e])&&n.rules&&n.rules.length>0?[4,P(e)]:[3,2];case 1:return r=o.sent(),[2,{name:e,error:r}];case 2:return[2,{name:e,error:void 0}]}})})}))];case 1:return a.sent().forEach(function(e){var t=e.name,n=e.error;n&&r.push({name:t,errors:[n]})}),[4,new Promise(function(e){return requestAnimationFrame(function(){setTimeout(e,0)})})];case 2:if(a.sent(),r.length>0)throw o=q(),i={values:o,errorFields:r},null==p||p(i),new Ve("Form validation failed",o,r);return[2,q()]}})})},[P,q,p]),Z=s(function(e){A(function(t){var n=v({},t);return(e||Object.keys(n)).forEach(function(e){n[e]&&(n[e]=v(v({},n[e]),{value:o[e],error:void 0,touched:!1,validating:!1}),L.current[e]=v({},n[e]))}),n})},[o]),_=s(function(e){A(function(t){var n=v({},t);if(Object.keys(e).forEach(function(t){n[t]?n[t]=v(v({},n[t]),{value:e[t]}):n[t]={value:e[t],error:void 0,touched:!1,validating:!1},L.current[t]=v({},n[t])}),a){var r={};Object.keys(n).forEach(function(e){r[e]=n[e].value}),a(e,r)}return n})},[a]),K=s(function(){return m(void 0,void 0,void 0,function(){var e;return y(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,X()];case 1:return e=t.sent(),null==c||c(e),[2,e];case 2:throw t.sent();case 3:return[2]}})})},[X,c]),G=s(function(e){if(A(function(t){var n=v({},t);return e.forEach(function(e){var t=e.name,r=e.value,o=e.errors,i=o&&o.length>0?o[0]:void 0;n[t]?n[t]=v(v(v({},n[t]),void 0!==r&&{value:r}),{error:i,touched:!0}):n[t]={value:void 0!==r?r:void 0,error:i,touched:!0,validating:!1},L.current[t]=v({},n[t])}),n}),a&&e.some(function(e){return void 0!==e.value})){var t={};e.forEach(function(e){void 0!==e.value&&(t[e.name]=e.value)}),setTimeout(function(){return a(t,q())},0)}},[a,q]),J=s(function(e,t){t?z.current[e]=t:delete z.current[e]},[]),U=s(function(e,t){var n=z.current[e];null==n||n.scrollIntoView(v({behavior:"smooth",block:"center"},t))},[]);f(n,function(){return{getFieldValue:B,getFieldsValue:q,setFieldValue:T,setFieldsValue:_,setFields:G,getFieldError:N,validateField:P,validateFields:X,resetFields:Z,submit:K,scrollToField:U}});var $=i(function(){return{fields:E,getFieldValue:B,setFieldValue:T,getFieldError:N,setFieldError:W,isFieldTouched:R,setFieldTouched:I,isFieldValidating:H,setFieldValidating:j,registerField:O,unregisterField:V,validateField:P,validateFields:X,resetFields:Z,getFieldsValue:q,setFieldsValue:_,setFields:G,submit:K,scrollToField:U,registerFieldRef:J,labelWidth:g,labelAlign:b}},[E,B,T,N,W,R,I,H,j,O,V,P,X,Z,q,_,G,K,U,J,g,b]),Q=v({},D);return"vertical"===C?(Q.display="flex",Q.flexDirection="column"):"inline"===C&&(Q.display="inline-flex",Q.flexWrap="wrap",Q.gap="16px"),e(Oe.Provider,{value:$,children:e("form",{className:"aha-form ".concat(k),style:Q,onSubmit:function(e){return m(void 0,void 0,void 0,function(){var t;return y(this,function(n){switch(n.label){case 0:e.preventDefault(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,X()];case 2:return t=n.sent(),null==c||c(t),[3,4];case 3:return n.sent(),[3,4];case 4:return[2]}})})},children:S})})});Pe.displayName="Form";var qe=Pe;qe.Item=function(n){var o=n.name,l=n.label,c=n.htmlFor;n.labelCol,n.wrapperCol;var p=n.required,f=void 0!==p&&p,h=n.rules,g=void 0===h?[]:h;n.hasFeedback;var x=n.validateStatus,m=n.help,y=n.extra,b=n.className,w=void 0===b?"":b,C=n.style,F=n.children;n.labelAlign,n.labelWidth;var k=n.hidden,D=void 0!==k&&k,S=n.tooltip,M=a(Oe),E=u(null),A=s(function(e){E.current=e,o&&(null==M?void 0:M.registerFieldRef)&&M.registerFieldRef(o,e)},[o,M]),L=(null==M?void 0:M.fields)||{};o&&M&&M.getFieldValue(o);var z=o&&M?M.getFieldError(o):void 0,B=!(!o||!M)&&M.isFieldTouched(o),T=!(!o||!M)&&M.isFieldValidating(o);o&&L[o];var N=x||(z?"error":T?"validating":B&&!z?"success":void 0),W=void 0!==m?m:z||void 0,R=u(g),I=u(f),H=u(!1),j=f||g.some(function(e){return e.required}),Y=i(function(){if(!H.current)return H.current=!0,!0;if(R.current.length!==g.length)return!0;if(R.current===g)return!1;for(var e=0;e<g.length;e++){var t=R.current[e],n=g[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},[g]);d(function(){if(o&&M)return(!R.current||Y||I.current!==f)&&(R.current=g,I.current=f,M.registerField(o,{rules:g,required:j})),function(){o&&M&&M.unregisterField(o)}},[o]);if(D)return null;return t("div",{ref:A,className:"aha-form-item ".concat(w),style:v({display:"flex",flexDirection:"column",marginBottom:"16px"},C),children:[l&&t("label",{htmlFor:c,style:{display:"flex",alignItems:"center",marginBottom:"6px",fontSize:"14px",lineHeight:"20px",color:"#44403C",fontFamily:"DM Sans, sans-serif",fontWeight:500},children:[l,j&&e("span",{style:{color:"#EC470A",marginLeft:"4px"},children:"*"}),S&&e(function(n){var o=n.content,i=r.useState(!1),a=i[0],l=i[1],d=r.useRef(null);return r.useEffect(function(){var e=function(e){d.current&&!d.current.contains(e.target)&&l(!1)};if(a)return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[a]),t("div",{style:{position:"relative",display:"inline-block",marginLeft:"4px"},children:[e("div",{onClick:function(e){e.stopPropagation(),l(!a)},style:{display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#A9A29D"},children:e(ue,{})}),a&&t("div",{ref:d,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("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:S})]}),t("div",{style:{width:"100%"},children:[e("div",{children:r.Children.map(F,function(e){return r.isValidElement(e)?function(e){var t,n,i,a,l,d,s,c,u;if(!r.isValidElement(e))return e;var p=v({},e.props);if(o&&M){var f=M.getFieldValue(o),h=M.setFieldValue;if(!h)return e;var g=e.type;if(g&&("object"==typeof g||"function"==typeof g)&&"displayName"in g){var x=g.displayName;if("Input"===x||"Textarea"===x){p.value=f||"";var m=null===(t=e.props)||void 0===t?void 0:t.onChange,y=null===(n=e.props)||void 0===n?void 0:n.onBlur;p.onChange=function(e){h(o,e.target.value),null==m||m(e),o&&M&&setTimeout(function(){M.validateField(o)},0)},p.onBlur=function(e){o&&M&&(M.setFieldTouched(o,!0),M.validateField(o)),null==y||y(e)},p.error="error"===N}else if("Select"===x){p.value=f;var b=null===(i=e.props)||void 0===i?void 0:i.onChange,w=null===(a=e.props)||void 0===a?void 0:a.onBlur;p.onChange=function(e,t){h(o,e),null==b||b(e,t),o&&M&&(M.setFieldTouched(o,!0),setTimeout(function(){M.validateField(o)},0))},p.onBlur=function(e){o&&M&&(M.setFieldTouched(o,!0),M.validateField(o)),null==w||w(e)},p.error="error"===N}else if("Switch"===x){p.checked=f||!1;var C=null===(l=e.props)||void 0===l?void 0:l.onChange;p.onChange=function(e,t){h(o,e),null==C||C(e,t),o&&M&&(M.setFieldTouched(o,!0),setTimeout(function(){M.validateField(o)},0))}}else if("Checkbox"===x){p.checked=f||!1;var F=null===(d=e.props)||void 0===d?void 0:d.onChange;p.onChange=function(e){h(o,e.target.checked),null==F||F(e),o&&M&&(M.setFieldTouched(o,!0),setTimeout(function(){M.validateField(o)},0))}}else if("Radio"===x){var k=null===(s=e.props)||void 0===s?void 0:s.value;if(void 0!==k){p.checked=f===k;var D=null===(c=e.props)||void 0===c?void 0:c.onChange;p.onChange=function(e){h(o,k),null==D||D(e),o&&M&&(M.setFieldTouched(o,!0),setTimeout(function(){M.validateField(o)},0))}}}}else{void 0!==f&&(p.value=f);var S=null===(u=e.props)||void 0===u?void 0:u.onChange;p.onChange=function(e){var t,n,r=null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:e;h(o,r),null==S||S(e)}}}return"error"===N&&"error"in p&&(p.error=!0),r.cloneElement(e,p)}(e):e})}),W&&e("div",{style:{marginTop:"6px",fontSize:"14px",lineHeight:"20px",fontWeight:400,color:"error"===N?"#D92D20":"warning"===N?"#F59E0B":"#78716C",fontFamily:"DM Sans, sans-serif"},children:W}),y&&!W&&e("div",{style:{marginTop:"4px",fontSize:"12px",lineHeight:"18px",color:"#78716C",fontFamily:"DM Sans, sans-serif"},children:y})]})]})},qe.useForm=function(){return[u(null)]};var Xe=function(n){var o=n.items,i=void 0===o?[]:o,a=n.userProfile,d=n.selectedKeys,c=n.defaultSelectedKeys,p=void 0===c?[]:c,f=n.onSelect,h=n.onDeselect,g=n.onClick,x=n.className,m=void 0===x?"":x,y=n.style,w=n.width,C=void 0===w?320:w;k().primaryColor;var F=u(null),D=u({}),S=void 0!==d,M=l(p),E=M[0],A=M[1],L=S?d:E,z=function(e){return"children"in e&&Array.isArray(e.children)},B=s(function(e,t,n){void 0===n&&(n=[]);for(var r=0,o=t;r<o.length;r++){var i=o[r];if(z(i)){var a=B(e,i.children,n);if(a)return a}else{var l=i,d=b(b([],n,!0),[l.key],!1);if(l.key===e)return d}}return null},[]),T=s(function(e){var t;if(!e.disabled){var n,r=B(e.key,i)||[e.key];L.includes(e.key)?(n=L.filter(function(t){return t!==e.key}),null==h||h({key:e.key,keyPath:r,selectedKeys:n})):(n=[e.key],null==f||f({key:e.key,keyPath:r,selectedKeys:n})),S||A(n),null===(t=e.onClick)||void 0===t||t.call(e,{key:e.key,keyPath:r}),e.skipGlobalClick||null==g||g({key:e.key,keyPath:r})}},[L,S,f,h,g,i,B]),N=function(n){var r=L.includes(n.key);if(n.render)return e("div",{className:n.className,style:n.style,children:n.render(n,r)},n.key);var o=v({display:"flex",alignItems:"center",padding:"10px 16px",cursor:n.disabled?"not-allowed":"pointer",fontSize:"14px",lineHeight:"20px",fontFamily:"DM Sans, sans-serif",fontWeight:600,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#44403C",backgroundColor:"transparent",transition:"background-color 0.15s",opacity:n.disabled?.5:1},n.style);return t("div",{ref:function(e){D.current[n.key]=e},className:"aha-menu-item ".concat(n.className||""),style:o,onClick:function(){return T(n)},onMouseEnter:function(e){n.disabled||(e.currentTarget.style.backgroundColor="#F9FAFB")},onMouseLeave:function(e){e.currentTarget.style.backgroundColor="transparent"},children:[n.icon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginRight:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.icon}),e("span",{style:{flex:1},children:n.label}),n.suffixIcon&&e("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"20px",height:"20px",marginLeft:"12px",flexShrink:0,color:n.disabled?"#98A2B3":n.danger?"#DC2626":"#101828"},children:n.suffixIcon})]},n.key)},W=v({width:"number"==typeof C?"".concat(C,"px"):C,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"},y),R=function(e,t){if(0===e)return!1;var n=t[e],r=t[e-1];return!!z(r)||!(!z(n)||z(r))};return t("div",{ref:F,className:"aha-menu-list ".concat(m),style:W,children:[a&&(a?a.render?a.render(a):e("div",{onClick:a.onClick,style:{padding:"16px",cursor:a.onClick?"pointer":"default",borderBottom:"1px solid #E7E5E4"},children:t("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[t("div",{style:{position:"relative",flexShrink:0},children:[a.avatar||e("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"#F5F5F4",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"16px",color:"#78716C"},children:"string"==typeof a.name?a.name.charAt(0).toUpperCase():"U"}),void 0!==a.online&&e("div",{style:{position:"absolute",bottom:"0",right:"0",width:"12px",height:"12px",borderRadius:"50%",backgroundColor:a.online?"#10B981":"#9CA3AF",border:"2px solid #FFFFFF"}})]}),t("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{fontSize:"14px",fontWeight:500,lineHeight:"20px",color:"#101828",fontFamily:"DM Sans, sans-serif",marginBottom:"2px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.name}),a.email&&e("div",{style:{fontSize:"14px",lineHeight:"20px",color:"#78716C",fontFamily:"DM Sans, sans-serif",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.email})]})]})}):null),e("div",{children:i.map(function(n,o){return t(r.Fragment,{children:[R(o,i)&&e("div",{style:{height:"1px",backgroundColor:"#E7E5E4",margin:"4px 0"}}),z(n)?(a=n,e("div",{className:"aha-menu-group ".concat(a.className||""),children:a.children.map(function(e){return N(e)})},"group-".concat(a.title))):N(n)]},o);var a})})]})};Xe.displayName="MenuList";var Ze=function(e,t,n,r){void 0===r&&(r=6);var o=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2,d=r+6,s=0,c=0;switch(n){case"top":s=e.top-t.height-d+i,c=a-t.width/2+o;break;case"bottom":default:s=e.bottom+d+i,c=a-t.width/2+o;break;case"left":s=l-t.height/2+i,c=e.left-t.width-d+o;break;case"right":s=l-t.height/2+i,c=e.right+d+o;break;case"top-left":s=e.top-t.height-d+i,c=e.left+o;break;case"top-right":s=e.top-t.height-d+i,c=e.right-t.width+o;break;case"bottom-left":s=e.bottom+d+i,c=e.left+o;break;case"bottom-right":s=e.bottom+d+i,c=e.right-t.width+o}var u=window.innerWidth,p=window.innerHeight;return c<o+8?c=o+8:c+t.width>o+u-8&&(c=o+u-t.width-8),s<i+8?s=i+8:s+t.height>i+p-8&&(s=i+p-t.height-8),{top:s,left:c}},_e=function(e,t,n,r){void 0===r&&(r=6);var o=Ze(e,t,n,r),i=o.top,a=o.left,l=window.scrollX||window.pageXOffset,d=i-(window.scrollY||window.pageYOffset),s=a-l,c=d+t.height,u=s+t.width,p=d,f=s,h=Math.max(p,e.top),g=Math.min(c,e.bottom),v=Math.max(f,e.left),x=Math.min(u,e.right);return g>h+1&&x>v+1},Ke=function(t,n){var r=v({position:"absolute",width:0,height:0,borderStyle:"solid"},n),o={top:v(v({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),bottom:v(v({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),left:v(v({},r),{borderWidth:"".concat(6,"px 0 ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent transparent #0C0A09"}),right:v(v({},r),{borderWidth:"".concat(6,"px ").concat(6,"px ").concat(6,"px 0"),borderColor:"transparent #0C0A09 transparent transparent"}),"top-left":v(v({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"top-right":v(v({},r),{borderWidth:"".concat(6,"px ").concat(6,"px 0 ").concat(6,"px"),borderColor:"#0C0A09 transparent transparent transparent"}),"bottom-left":v(v({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"}),"bottom-right":v(v({},r),{borderWidth:"0 ".concat(6,"px ").concat(6,"px ").concat(6,"px"),borderColor:"transparent transparent #0C0A09 transparent"})};return e("div",{style:o[t]})},Ge=function(r){var o=r.content,i=r.children,a=r.position,c=void 0===a?"top":a,p=r.trigger,f=void 0===p?"hover":p,g=r.delay,x=void 0===g?200:g,m=r.disabled,y=void 0!==m&&m,b=r.className,w=void 0===b?"":b,C=r.tooltipClassName,F=void 0===C?"":C,k=r.gap,D=void 0===k?6:k,S=r.showArrow,M=void 0===S||S,E=r.width,A=r.defaultVisible,L=void 0!==A&&A,z=r.visible,B=r.onVisibleChange,T=void 0!==z,N=l(L),W=N[0],R=N[1],I=T?z:W,H=l(T?null!=z&&z:L),j=H[0],Y=H[1],O=s(function(e){T||R(e),null==B||B(e)},[T,B]);d(function(){T&&(z?requestAnimationFrame(function(){Y(!0)}):Y(!1))},[T,z]);var V=l(c),P=V[0],q=V[1],X=l("320px"),Z=X[0],_=X[1],K=l({position:"absolute",top:0,left:0,pointerEvents:"hover"===f?"auto":"none"}),G=K[0],J=K[1],U=l({}),$=U[0],Q=U[1],ee=u(null),te=u(null),ne=u(null),re=u(null),oe=s(function(){if(ee.current&&te.current&&I&&j){var e=ee.current.getBoundingClientRect(),t=te.current.getBoundingClientRect(),n=function(e,t,n,r){if(void 0===r&&(r=6),!_e(e,t,n,r))return n;for(var o=0,i=function(e){switch(e){case"top":return["bottom","right","left"];case"bottom":return["top","right","left"];case"left":return["right","top","bottom"];case"right":return["left","top","bottom"];case"top-left":return["bottom-left","top-right","bottom-right","right","left"];case"top-right":return["bottom-right","top-left","bottom-left","left","right"];case"bottom-left":return["top-left","bottom-right","top-right","right","left"];case"bottom-right":return["top-right","bottom-left","top-left","left","right"];default:return[]}}(n);o<i.length;o++){var a=i[o];if(!_e(e,t,a,r))return a}return n}(e,t,c,D);q(n);var r=Ze(e,t,n,D),o=r.top,i=r.left;if(J(function(e){return v(v({},e),{position:"absolute",top:"".concat(o,"px"),left:"".concat(i,"px"),pointerEvents:"hover"===f?"auto":"none",zIndex:9999})}),M){var a=function(e,t,n,r,o){var i=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset,l=t.left+(t.width-6)/2,d=t.top+(t.height-6)/2,s=r-i,c=o-a;switch(e){case"top":return{bottom:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"bottom":return{top:-6,left:Math.min(Math.max(l-s,6),n.width-6)};case"left":return{right:-6,top:Math.min(Math.max(d-c,6),n.height-6)};case"right":return{left:-6,top:Math.min(Math.max(d-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,i,o);Q(a)}}},[I,c,D,M,j,f]),ie=s(function(){y||(re.current&&(clearTimeout(re.current),re.current=null),ne.current&&clearTimeout(ne.current),ne.current=setTimeout(function(){O(!0),T||requestAnimationFrame(function(){Y(!0)})},x))},[y,x,O,T]),ae=s(function(){ne.current&&(clearTimeout(ne.current),ne.current=null),re.current&&clearTimeout(re.current),T?O(!1):(Y(!1),re.current=setTimeout(function(){O(!1),re.current=null},150))},[O,T]),le=s(function(){"hover"===f&&(re.current&&(clearTimeout(re.current),re.current=null),I||(O(!0),requestAnimationFrame(function(){Y(!0)})))},[f,I]),de=s(function(e){y||"click"!==f||(e.stopPropagation(),I?ae():(ne.current&&(clearTimeout(ne.current),ne.current=null),O(!0),requestAnimationFrame(function(){Y(!0)})))},[y,f,I,ae]);d(function(){if(L&&I&&j){var e=function(){ee.current&&te.current?oe():setTimeout(function(){requestAnimationFrame(e)},10)};setTimeout(function(){requestAnimationFrame(e)},0)}},[L,I,j,oe]),d(function(){if(I)return requestAnimationFrame(function(){oe()}),window.addEventListener("scroll",oe,!0),window.addEventListener("resize",oe),function(){window.removeEventListener("scroll",oe,!0),window.removeEventListener("resize",oe)}},[I,oe]),d(function(){if(I&&"click"===f){var e=function(e){ee.current&&te.current&&!ee.current.contains(e.target)&&!te.current.contains(e.target)&&ae()};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[I,f,ae]),d(function(){return function(){ne.current&&clearTimeout(ne.current),re.current&&clearTimeout(re.current)}},[]);var se={position:"absolute",top:0,left:0,opacity:j?1:0,transform:j?"scale(1)":"scale(0.95)",transition:"opacity 150ms ease-out, transform 150ms ease-out",pointerEvents:"hover"===f?"auto":"none",zIndex:9999},ce=s(function(){return"undefined"==typeof window||window.innerWidth>=768?"320px":"calc(100vw - 32px)"},[]);d(function(){var e=function(){_(ce())};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[ce]);var ue=v(v({backgroundColor:"#0C0A09",color:"#FFFFFF",padding:"8px 12px",borderRadius:"6px",fontSize:"12px",fontWeight:400,fontFamily:"DM Sans, sans-serif",lineHeight:"16px"},void 0!==E?{width:"number"==typeof E?"".concat(E,"px"):E,maxWidth:"undefined"!=typeof window&&window.innerWidth<768?"calc(100vw - 32px)":void 0}:{maxWidth:Z,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"}),pe=t("div",{style:v(v(v({},se),G),{pointerEvents:"hover"===f?"auto":"none"}),className:"aha-tooltip-wrapper ".concat(F),onMouseEnter:"hover"===f?le:void 0,onMouseLeave:"hover"===f?ae:void 0,children:[e("div",{ref:te,className:"aha-tooltip ".concat(F),style:ue,role:"tooltip",children:o}),M&&Ke(P,$)]}),fe=s(function(){"hover"===f&&(re.current=setTimeout(function(){ae()},100))},[f,ae]),he="click"===f?{onClick:de}:{onMouseEnter:ie,onMouseLeave:fe,onFocus:ie,onBlur:ae};return t(n,{children:[e("div",v({ref:ee,className:"aha-tooltip-trigger ".concat(w),style:{display:"inline-block",cursor:"click"===f?"pointer":"default"}},he,{children:i})),I&&"undefined"!=typeof document&&h(pe,document.body)]})},Je=function(e,t,n,r){switch(n){case"top":return e.top>=t.height+r+8;case"bottom":return window.innerHeight-e.bottom>=t.height+r+8;case"left":return e.left>=t.width+r+8;default:return window.innerWidth-e.right>=t.width+r+8}},Ue=function(e,t){switch(t){case"top":return e.top;case"bottom":return window.innerHeight-e.bottom;case"left":return e.left;default:return window.innerWidth-e.right}},$e=function(r){var o,i=r.children,a=r.content,c=r.trigger,p=void 0===c?"click":c,f=r.open,g=r.defaultOpen,x=void 0!==g&&g,m=r.onOpenChange,y=r.placement,b=void 0===y?"right":y,w=r.width,C=r.offset,F=void 0===C?8:C,k=r.className,D=void 0===k?"":k,S=r.popoverClassName,M=void 0===S?"":S,E=r.disabled,A=void 0!==E&&E,L=r.destroyOnHide,z=r.destroyTooltipOnHide,B=null===(o=null!=L?L:z)||void 0===o||o,T=void 0!==f,N=l(x),W=N[0],R=N[1],I=T?!!f:W,H=l({top:0,left:0,opacity:0}),j=H[0],Y=H[1],O=u(null),V=u(null),P=s(function(e){T||R(e),null==m||m(e)},[T,m]),q=s(function(){if(I&&O.current&&V.current){var e=O.current.getBoundingClientRect(),t=V.current.getBoundingClientRect(),n=function(){if(Je(e,t,b,F))return b;var n=function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";default:return"left"}}(b);return Je(e,t,n,F)||Ue(e,n)>Ue(e,b)?n:b}(),r=function(e,t,n,r){var o=window.scrollX||window.pageXOffset,i=window.scrollY||window.pageYOffset,a=e.left+e.width/2,l=e.top+e.height/2;switch(n){case"top":return{top:e.top-t.height-r+i,left:a-t.width/2+o};case"bottom":return{top:e.bottom+r+i,left:a-t.width/2+o};case"left":return{top:l-t.height/2+i,left:e.left-t.width-r+o};default:return{top:l-t.height/2+i,left:e.right+r+o}}}(e,t,n,F),o=function(e,t,n){var r=window.scrollX||window.pageXOffset,o=window.scrollY||window.pageYOffset,i=window.innerWidth,a=window.innerHeight,l=e,d=t;return d<r+8&&(d=r+8),d+n.width>r+i-8&&(d=r+i-n.width-8),l<o+8&&(l=o+8),l+n.height>o+a-8&&(l=o+a-n.height-8),{top:l,left:d}}(r.top,r.left,t);Y({top:o.top,left:o.left,opacity:1})}},[I,b,F]),X=s(function(){A||P(!0)},[A,P]),Z=s(function(){P(!1)},[P]),_=s(function(){A||P(!I)},[A,I,P]);d(function(){if(I)return requestAnimationFrame(function(){q()}),window.addEventListener("resize",q),window.addEventListener("scroll",q,!0),function(){window.removeEventListener("resize",q),window.removeEventListener("scroll",q,!0)}},[I,q]),d(function(){if(I&&"click"===p){var e=function(e){var t=e.target;O.current&&V.current&&!O.current.contains(t)&&!V.current.contains(t)&&Z()};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}},[I,p,Z]);var K="hover"===p?{onMouseEnter:X,onMouseLeave:Z,onFocus:X,onBlur:Z}:{onClick:function(e){e.stopPropagation(),_()}},G=I||!B?e("div",{ref:V,className:"aha-popover ".concat(M),style:{position:"absolute",zIndex:9999,top:j.top,left:j.left,opacity:I?j.opacity:0,visibility:I?"visible":"hidden",pointerEvents:I?"auto":"none",transition:"opacity 120ms ease-out",width:"number"==typeof w?"".concat(w,"px"):w,maxWidth:"calc(100vw - ".concat(16,"px)"),backgroundColor:"#FFFFFF",border:"1px solid #00000014",borderRadius:"12px",padding:"6px",boxSizing:"border-box",boxShadow:"0px 2px 2px -1px var(--ColorsEffectsShadowsshadow-lg03), 0px 4px 6px -2px var(--ColorsEffectsShadowsshadow-lg02), 0px 12px 16px -4px var(--ColorsEffectsShadowsshadow-lg01)"},onMouseEnter:"hover"===p?X:void 0,onMouseLeave:"hover"===p?Z:void 0,onMouseDown:"click"===p?function(e){return e.stopPropagation()}:void 0,children:a}):null;return t(n,{children:[e("div",v({ref:O,className:"aha-popover-trigger ".concat(D),style:{display:"inline-block",cursor:A?"not-allowed":"pointer"}},K,{children:i})),G&&"undefined"!=typeof document&&h(G,document.body)]})};$e.displayName="Popover";var Qe=240,et=function(n){var r=n.open,o=n.defaultOpen,a=void 0!==o&&o,c=n.onClose,u=n.afterOpenChange,p=n.title,f=n.extra,g=n.footer,x=n.children,m=n.placement,y=void 0===m?"right":m,b=n.width,w=void 0===b?378:b,C=n.height,F=void 0===C?378:C,k=n.mask,D=void 0===k||k,S=n.maskClosable,M=void 0===S||S,E=n.closable,A=void 0===E||E,L=n.closeIcon,z=n.keyboard,B=void 0===z||z,T=n.destroyOnClose,N=void 0!==T&&T,W=n.zIndex,R=void 0===W?1e3:W,I=n.mobileBreakpoint,H=void 0===I?768:I,j=n.className,Y=void 0===j?"":j,O=n.style,V=n.drawerStyle,P=n.headerStyle,q=n.bodyStyle,X=n.footerStyle,Z=n.maskStyle,_=void 0!==r,K=l(a),G=K[0],J=K[1],U=_?!!r:G,$=l(U),Q=$[0],ee=$[1],te=l(U),ne=te[0],re=te[1],oe=l(!1),ie=oe[0],ae=oe[1],le=l(!1),de=le[0],se=le[1];d(function(){ae(!0)},[]),d(function(){var e=function(){se(window.innerWidth<H)};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[H]),d(function(){if(U){ee(!0),re(!1);var e=requestAnimationFrame(function(){requestAnimationFrame(function(){re(!0)})}),t=window.setTimeout(function(){null==u||u(!0)},Qe);return function(){cancelAnimationFrame(e),window.clearTimeout(t)}}re(!1);var n=window.setTimeout(function(){N&&ee(!1),null==u||u(!1)},Qe);return function(){return window.clearTimeout(n)}},[U,N,u]),d(function(){if(U&&B){var e=function(e){"Escape"===e.key&&(null==c||c(e),_||J(!1))};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}},[U,B,c,_]),d(function(){if(ie&&U){var e=document.body.style.overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=e}}},[U,ie]);var ce=s(function(e){null==c||c(e),_||J(!1)},[c,_]),ue=i(function(){return de?"100vw":"left"===y||"right"===y?"number"==typeof w?"".concat(w,"px"):w:"100vw"},[y,de,w]),pe=i(function(){return"top"===y||"bottom"===y?"number"==typeof F?"".concat(F,"px"):F:"100vh"},[y,F]),fe=i(function(){return de&&("left"===y||"right"===y)?"bottom":y},[de,y]),he=i(function(){var e={position:"fixed",backgroundColor:"#FFFFFF",display:"flex",flexDirection:"column",boxSizing:"border-box",boxShadow:"0 6px 16px rgba(0, 0, 0, 0.08), 0 3px 6px rgba(0, 0, 0, 0.12)",transition:"transform ".concat(Qe,"ms cubic-bezier(0.2, 0, 0, 1)"),zIndex:R+1};switch(fe){case"left":return v(v({},e),{top:0,left:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(-100%)"});case"right":return v(v({},e),{top:0,right:0,width:ue,height:"100vh",transform:ne?"translateX(0)":"translateX(100%)"});case"top":return v(v({},e),{top:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(-100%)"});default:return v(v({},e),{bottom:0,left:0,width:"100vw",height:pe,transform:ne?"translateY(0)":"translateY(100%)"})}},[fe,ue,pe,ne,R]);if(!ie||!Q&&!U)return null;var ge=t("div",{className:"aha-drawer-root ".concat(Y),style:v({position:"fixed",inset:0,zIndex:R,pointerEvents:U||ne?"auto":"none"},O),children:[D&&e("div",{"aria-hidden":!0,onClick:M?function(e){return ce(e)}:void 0,style:v({position:"absolute",inset:0,background:"rgba(0, 0, 0, 0.45)",opacity:ne?1:0,transition:"opacity ".concat(Qe,"ms cubic-bezier(0.2, 0, 0, 1)")},Z)}),t("div",{role:"dialog","aria-modal":"true",style:v(v({},he),V),children:[(void 0!==p||A||f)&&t("div",{style:v({minHeight:"56px",padding:"16px 24px",borderBottom:"1px solid #F0F0F0",display:"flex",alignItems:"center",justifyContent:"space-between",gap:"12px"},P),children:[e("div",{style:{fontSize:"16px",fontWeight:600,color:"#1F2937",flex:1},children:p}),t("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[f,A&&e("button",{type:"button",onClick:function(e){return ce(e)},style:{border:"none",background:"transparent",padding:0,margin:0,width:"24px",height:"24px",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",color:"#6B7280"},"aria-label":"Close",children:L||e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),e("div",{style:v({padding:"24px",overflowY:"auto",flex:1,boxSizing:"border-box"},q),children:x}),void 0!==g&&e("div",{style:v({borderTop:"1px solid #F0F0F0",padding:"12px 16px"},X),children:g})]},"".concat(fe,"-").concat(U?"open":"closed"))]});return h(ge,document.body)};et.displayName="Drawer";var tt={name:"Thinking Five",tag:"Custom Rose Trail",rotate:!0,particleCount:62,trailSpan:.38,durationMs:3900,rotationDurationMs:28e3,pulseDurationMs:3e3,strokeWidth:5.5,baseRadius:7,detailAmplitude:3,petalCount:5,curveScale:3};function nt(e,t,n){var r=e*Math.PI*2,o=Math.round(n.petalCount),i=n.baseRadius*Math.cos(r)-n.detailAmplitude*t*Math.cos(o*r),a=n.baseRadius*Math.sin(r)-n.detailAmplitude*t*Math.sin(o*r);return{x:50+i*n.curveScale,y:50+a*n.curveScale}}function rt(e,t,n,r){var o=e/Math.max(1,r.particleCount-1),i=nt(function(e){return(e%1+1)%1}(t-o*r.trailSpan),n,r),a=Math.pow(1-o,.56);return{x:i.x,y:i.y,radius:.9+2.7*a,opacity:.04+.96*a}}var ot=function(n){var r=n.width,o=void 0===r?80:r,i=n.height,a=void 0===i?80:i,s=n.strokeWidth,c=n.color,p=void 0===c?"var(--theme-color, #5A31F0)":c,f=n.className,h=l(0),g=h[0],v=h[1],x=u(null);d(function(){var e,t=function(n){null===x.current&&(x.current=n),v(n-x.current),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),function(){return cancelAnimationFrame(e)}},[]);for(var m,y,b=g,w=(y=b%(m=tt).pulseDurationMs/m.pulseDurationMs*Math.PI*2,.52+(Math.sin(y+.55)+1)/2*.48),C=b%tt.durationMs/tt.durationMs,F=function(e,t){return t.rotate?-e%t.rotationDurationMs/t.rotationDurationMs*360:0}(b,tt),k=null!=s?s:tt.strokeWidth,D=k/tt.strokeWidth,S=function(e,t,n){void 0===n&&(n=480);for(var r=[],o=0;o<=n;o+=1){var i=nt(o/n,e,t);r.push("".concat(0===o?"M":"L"," ").concat(i.x.toFixed(2)," ").concat(i.y.toFixed(2)))}return r.join(" ")}(w,tt),M=[],E=0;E<tt.particleCount;E+=1){var A=rt(E,C,w,tt);M.push({cx:A.x,cy:A.y,opacity:A.opacity,r:A.radius*D})}return e("div",{className:f,style:{width:o,height:a,display:"inline-block",color:p},role:"status","aria-label":"Loading",children:t("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",fill:"none",preserveAspectRatio:"xMidYMid meet",style:{overflow:"visible"},children:[e("title",{children:"Thinking Five"}),t("g",{transform:"rotate(".concat(F," 50 50)"),children:[e("path",{d:S,stroke:"currentColor",strokeWidth:k,strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:.1}),M.map(function(t,n){return e("circle",{cx:t.cx,cy:t.cy,r:t.r,fill:"currentColor",opacity:t.opacity},n)})]})]})})};export{B as Alert,A as Button,oe as CheckIcon,fe as Checkbox,Ye as DatePicker,et as Drawer,qe as Form,ne as Input,ot as Loading,Xe as MenuList,ie as MinusIcon,pe as Pagination,$e as Popover,Ce as Progress,be as Radio,re as Select,Te as Switch,we as Tab,ye as Table,te as Tag,Be as Textarea,F as ThemeProvider,j as Toast,$ as ToastProvider,Ge as Tooltip,V as clearAllToasts,O as closeToast,P as debugToast,Y as toast,X as toastError,Z as toastInfo,_ as toastQuestion,q as toastSuccess,k as useTheme};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|