@justin_evo/evo-ui 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),Nn=require("react-dom"),En=r.createContext(null),Tn="evo-ui-theme";function un(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hn(n){if(!n||typeof window>"u")return null;try{const t=window.localStorage.getItem(n);if(t==="light"||t==="dark"||t==="system")return t}catch{}return null}const os=({children:n,defaultTheme:t="system",storageKey:s=Tn,attribute:o="data-theme",enableTransitions:a=!0,target:i})=>{const[c,l]=r.useState(()=>hn(s)??t),[p,g]=r.useState(()=>{const B=hn(s)??t;return B==="system"?un():B}),b=r.useRef(!0),_=r.useCallback(B=>{if(typeof document>"u")return;const T=i??document.documentElement;a&&!b.current&&(T.setAttribute("data-theme-transition","true"),window.clearTimeout(T.__evoThemeTimer),T.__evoThemeTimer=window.setTimeout(()=>{T.removeAttribute("data-theme-transition")},250)),o==="class"&&(T.classList.remove("light","dark"),T.classList.add(B)),T.setAttribute("data-theme",B),b.current=!1},[o,a,i]);r.useEffect(()=>{_(p)},[p,_]),r.useEffect(()=>{g(c==="system"?un():c)},[c]),r.useEffect(()=>{if(c!=="system"||typeof window>"u"||!window.matchMedia)return;const B=window.matchMedia("(prefers-color-scheme: dark)"),T=R=>{g(R.matches?"dark":"light")};return B.addEventListener("change",T),()=>B.removeEventListener("change",T)},[c]);const y=r.useCallback(B=>{if(l(B),s&&typeof window<"u")try{window.localStorage.setItem(s,B)}catch{}},[s]),I=r.useCallback(()=>{y(p==="dark"?"light":"dark")},[p,y]),j=r.useMemo(()=>({theme:c,resolvedTheme:p,setTheme:y,toggleTheme:I}),[c,p,y,I]);return e.jsx(En.Provider,{value:j,children:n})},In=()=>{const n=r.useContext(En);if(n)return n;const t=typeof document<"u"&&document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light";return{theme:t,resolvedTheme:t,setTheme:()=>{typeof document<"u"&&console.warn("[evo-ui] useEvoTheme called without <EvoThemeProvider>. Wrap your app in <EvoThemeProvider> to enable setTheme().")},toggleTheme:()=>{}}},rs=(n=Tn)=>`(function(){try{var s=localStorage.getItem('${n}');var t=s||'system';var r=t==='system'?(matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'):t;document.documentElement.setAttribute('data-theme',r);}catch(e){}})();`,as="_toggle_1aoav_1",is="_track_1aoav_19",ls="_thumb_1aoav_29",cs="_sun_1aoav_49",ds="_moon_1aoav_54",us="_sm_1aoav_68",hs="_md_1aoav_81",ps="_lg_1aoav_94",gt={toggle:as,track:is,thumb:ls,sun:cs,moon:ds,sm:us,md:hs,lg:ps},_s=({size:n="md",ariaLabel:t="Toggle color theme",className:s})=>{const{resolvedTheme:o,toggleTheme:a}=In(),i=o==="dark",c=[gt.toggle,gt[n],s].filter(Boolean).join(" ");return e.jsx("button",{type:"button",role:"switch","aria-checked":i,"aria-label":t,onClick:a,className:c,"data-theme-state":o,children:e.jsx("span",{className:gt.track,children:e.jsxs("span",{className:gt.thumb,children:[e.jsxs("svg",{className:gt.sun,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),e.jsx("svg",{className:gt.moon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})]})})})},fs="_button_5wbw9_1",ms="_label_5wbw9_38",vs="_icon_5wbw9_44",xs="_spinner_5wbw9_56",gs="_sm_5wbw9_72",bs="_md_5wbw9_80",ys="_lg_5wbw9_82",ws="_rounded_5wbw9_90",js="_square_5wbw9_94",ks="_iconOnly_5wbw9_106",Ns="_fullWidth_5wbw9_119",Es="_solid_5wbw9_124",Ts="_outline_5wbw9_126",Is="_ghost_5wbw9_130",$s="_soft_5wbw9_135",Cs="_primary_5wbw9_139",Ms="_secondary_5wbw9_197",Ls="_danger_5wbw9_257",Ds="_warning_5wbw9_315",Bs="_success_5wbw9_371",Ss="_info_5wbw9_429",Ue={button:fs,label:ms,icon:vs,spinner:xs,"evo-btn-spin":"_evo-btn-spin_5wbw9_1",sm:gs,md:bs,lg:ys,rounded:ws,square:js,iconOnly:ks,fullWidth:Ns,solid:Es,outline:Ts,ghost:Is,soft:$s,primary:Cs,secondary:Ms,danger:Ls,warning:Ds,success:Bs,info:Ss},Rs=r.forwardRef(function({label:t,children:s,variant:o="solid",severity:a="primary",size:i="md",shape:c="default",iconLeft:l,iconRight:p,loading:g=!1,loadingText:b,fullWidth:_=!1,disabled:y,type:I="button",className:j,...B},T){const O=g?b:s??t,q=y||g,oe=[Ue.button,Ue[o],Ue[a],Ue[i],c!=="default"?Ue[c]:"",_?Ue.fullWidth:"",O?"":Ue.iconOnly,j].filter(Boolean).join(" ");return e.jsxs("button",{ref:T,type:I,className:oe,disabled:q,"aria-busy":g||void 0,...B,children:[g?e.jsx("span",{className:Ue.spinner,"aria-hidden":"true"}):l&&e.jsx("span",{className:Ue.icon,children:l}),O!=null&&O!==""&&e.jsx("span",{className:Ue.label,children:O}),!g&&p&&e.jsx("span",{className:Ue.icon,children:p})]})}),As="_root_kkcxo_1",zs="_elevated_kkcxo_15",Ps="_outlined_kkcxo_20",Os="_ghost_kkcxo_26",Ws="_media_kkcxo_40",Hs="_interactive_kkcxo_72",Fs="_mediaImg_kkcxo_112",qs="_header_kkcxo_119",Gs="_body_kkcxo_126",Vs="_footer_kkcxo_132",Us="_title_kkcxo_141",Ks="_description_kkcxo_149",Ke={root:As,elevated:zs,outlined:Ps,ghost:Os,"orient-vertical":"_orient-vertical_kkcxo_32","orient-horizontal":"_orient-horizontal_kkcxo_36",media:Ws,"orient-responsive":"_orient-responsive_kkcxo_51",interactive:Hs,mediaImg:Fs,header:qs,body:Gs,footer:Vs,title:Us,description:Ks};function xt(...n){return n.filter(Boolean).join(" ")}function Qs(n,t,s,o){return xt(Ke.root,Ke[n],Ke[`orient-${t}`],s&&Ke.interactive,o)}const Bt=r.forwardRef(function(t,s){const{variant:o="elevated",orientation:a="vertical",interactive:i,className:c,children:l,...p}=t,g=i===!0,b=Qs(o,a,g,c);if(g&&typeof p.href=="string"){const _=p;return e.jsx("a",{ref:s,className:b,..._,children:l})}if(g){const{type:_="button",...y}=p;return e.jsx("button",{ref:s,type:_,className:b,...y,children:l})}return e.jsx("div",{ref:s,className:b,...p,children:l})});Bt.displayName="EvoCardRoot";const Vt=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ke.header,t),...s})});Vt.displayName="EvoCardHeader";const Ut=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ke.body,t),...s})});Ut.displayName="EvoCardBody";const Kt=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ke.footer,t),...s})});Kt.displayName="EvoCardFooter";const Qt=r.forwardRef(function({as:t="h3",className:s,children:o,...a},i){return r.createElement(t,{ref:i,className:xt(Ke.title,s),...a},o)});Qt.displayName="EvoCardTitle";const Yt=r.forwardRef(function({className:t,...s},o){return e.jsx("p",{ref:o,className:xt(Ke.description,t),...s})});Yt.displayName="EvoCardDescription";const Xt=r.forwardRef(function({src:t,alt:s,aspectRatio:o,className:a,style:i,children:c,...l},p){const g=o!=null?{aspectRatio:o,...i}:i;return e.jsx("div",{ref:p,className:xt(Ke.media,a),style:g,...l,children:t?e.jsx("img",{src:t,alt:s??"",className:Ke.mediaImg}):c})});Xt.displayName="EvoCardMedia";const lt=Bt;lt.Root=Bt;lt.Header=Vt;lt.Title=Qt;lt.Description=Yt;lt.Body=Ut;lt.Footer=Kt;lt.Media=Xt;const Ys={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Xs={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},Js=({children:n,direction:t="column",gap:s="1rem",align:o="stretch",justify:a="start",wrap:i=!1,className:c="",style:l})=>e.jsx("div",{className:c,style:{display:"flex",flexDirection:t,gap:typeof s=="number"?`${s}px`:s,alignItems:Ys[o],justifyContent:Xs[a],flexWrap:i?"wrap":"nowrap",...l},children:n}),Pt=n=>n===void 0?void 0:typeof n=="number"?`${n}px`:n,Zs=({children:n,colSpan:t,rowSpan:s,className:o="",style:a})=>e.jsx("div",{className:o,style:{gridColumn:t?`span ${t}`:void 0,gridRow:s?`span ${s}`:void 0,...a},children:n}),$n=({children:n,cols:t=3,rows:s,gap:o="1rem",colGap:a,rowGap:i,className:c="",style:l})=>e.jsx("div",{className:c,style:{display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, 1fr)`:t,gridTemplateRows:s?typeof s=="number"?`repeat(${s}, auto)`:s:void 0,gap:Pt(o),columnGap:Pt(a),rowGap:Pt(i),...l},children:n});$n.Item=Zs;const eo="_divider_rorxd_1",to="_horizontal_rorxd_6",no="_vertical_rorxd_13",so="_labeled_rorxd_20",oo="_line_rorxd_27",ro="_labelText_rorxd_33",ut={divider:eo,horizontal:to,vertical:no,labeled:so,line:oo,labelText:ro},ao=({orientation:n="horizontal",label:t,className:s=""})=>t?e.jsxs("div",{className:`${ut.labeled} ${s}`,children:[e.jsx("div",{className:ut.line}),e.jsx("span",{className:ut.labelText,children:t}),e.jsx("div",{className:ut.line})]}):e.jsx("div",{className:[ut.divider,n==="vertical"?ut.vertical:ut.horizontal,s].filter(Boolean).join(" ")}),io="_container_131l9_1",lo="_centered_131l9_7",co="_sm_131l9_12",uo="_md_131l9_16",ho="_lg_131l9_20",po="_xl_131l9_24",_o="_full_131l9_28",Ot={container:io,centered:lo,sm:co,md:uo,lg:ho,xl:po,full:_o},fo=({children:n,size:t="lg",centered:s=!0,className:o=""})=>e.jsx("div",{className:[Ot.container,Ot[t],s?Ot.centered:"",o].filter(Boolean).join(" "),children:n}),mo="_tabs_9memw_1",vo="_tabList_9memw_6",xo="_tab_9memw_1",go="_disabled_9memw_36",bo="_active_9memw_36",yo="_tabPanel_9memw_52",wt={tabs:mo,tabList:vo,tab:xo,disabled:go,active:bo,tabPanel:yo},Cn=r.createContext(null),Mn=()=>{const n=r.useContext(Cn);if(!n)throw new Error("Tab components must be used within EvoTabs");return n},wo=({children:n,className:t=""})=>e.jsx("div",{className:`${wt.tabList} ${t}`,role:"tablist",children:n}),jo=({id:n,children:t,disabled:s=!1,className:o=""})=>{const{active:a,setActive:i}=Mn();return e.jsx("button",{role:"tab","aria-selected":a===n,disabled:s,className:[wt.tab,a===n?wt.active:"",s?wt.disabled:"",o].filter(Boolean).join(" "),onClick:()=>i(n),children:t})},ko=({id:n,children:t,className:s=""})=>{const{active:o}=Mn();return o!==n?null:e.jsx("div",{role:"tabpanel",className:`${wt.tabPanel} ${s}`,children:t})},St=({children:n,defaultTab:t="",className:s=""})=>{const[o,a]=r.useState(t);return e.jsx(Cn.Provider,{value:{active:o,setActive:a},children:e.jsx("div",{className:`${wt.tabs} ${s}`,children:n})})};St.List=wo;St.Tab=jo;St.Panel=ko;const No="_breadcrumb_7jmv3_1",Eo="_item_7jmv3_12",To="_separator_7jmv3_18",Io="_link_7jmv3_28",$o="_text_7jmv3_44",Co="_current_7jmv3_49",yt={breadcrumb:No,item:Eo,separator:To,link:Io,text:$o,current:Co},Mo=({children:n,href:t,current:s=!1})=>e.jsx("li",{className:yt.item,children:t&&!s?e.jsx("a",{href:t,className:yt.link,children:n}):e.jsx("span",{className:[yt.text,s?yt.current:""].filter(Boolean).join(" "),"aria-current":s?"page":void 0,children:n})}),Ln=({children:n,separator:t="/",className:s=""})=>{const o=r.Children.toArray(n);return e.jsx("nav",{"aria-label":"breadcrumb",className:s,children:e.jsx("ol",{className:yt.breadcrumb,children:o.map((a,i)=>e.jsxs(r.Fragment,{children:[a,i<o.length-1&&e.jsx("li",{className:yt.separator,"aria-hidden":"true",children:t})]},i))})})};Ln.Item=Mo;const Lo="_navContainer_ng5y4_1",Do="_navList_ng5y4_7",Bo="_navLi_ng5y4_7",So="_navRow_ng5y4_20",Ro="_navIcon_ng5y4_47",Ao="_active_ng5y4_55",zo="_disabled_ng5y4_63",Po="_navRowTop_ng5y4_69",Oo="_navRowSub_ng5y4_73",Wo="_navLabel_ng5y4_81",Ho="_chevron_ng5y4_157",Fo="_chevronOpen_ng5y4_162",qo="_navSubList_ng5y4_166",Go="_navGroup_ng5y4_178",Vo="_navGroupLabel_ng5y4_187",Uo="_navGroupLabelText_ng5y4_199",Ko="_navGroupToggle_ng5y4_208",Qo="_navGroupCount_ng5y4_228",Yo="_navGroupPanel_ng5y4_244",Xo="_navSkeletonItem_ng5y4_260",Jo="_navSkeletonIcon_ng5y4_267",Zo="_navSkeletonText_ng5y4_276",er="_navQuickAction_ng5y4_292",tr="_navTrigger_ng5y4_321",nr="_navBackdrop_ng5y4_344",sr="_navDesktop_ng5y4_352",or="_navMobile_ng5y4_356",rr="_navDrawerOpen_ng5y4_377",ar="_navCollapsed_ng5y4_389",he={navContainer:Lo,navList:Do,navLi:Bo,navRow:So,navIcon:Ro,active:Ao,disabled:zo,navRowTop:Po,navRowSub:Oo,navLabel:Wo,chevron:Ho,chevronOpen:Fo,navSubList:qo,navGroup:Go,navGroupLabel:Vo,navGroupLabelText:Uo,navGroupToggle:Ko,navGroupCount:Qo,navGroupPanel:Yo,navSkeletonItem:Xo,navSkeletonIcon:Jo,navSkeletonText:Zo,navQuickAction:er,navTrigger:tr,navBackdrop:nr,navDesktop:sr,navMobile:or,navDrawerOpen:rr,navCollapsed:ar},Jt=r.createContext(null),pn=r.createContext({depth:0});function ir(n){const[t,s]=r.useState(!1);return r.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const o=window.matchMedia(`(max-width: ${n-1}px)`),a=()=>s(o.matches);return a(),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[n]),t}function Zt(n,t,s){const[o,a]=r.useState(t),i=n!==void 0,c=i?n:o,l=r.useCallback(p=>{i||a(p),s==null||s(p)},[i,s]);return[c,l]}const Ft="data-evo-nav-row";function lr(n){return n?Array.from(n.querySelectorAll(`[${Ft}]:not([data-disabled="true"])`)).filter(t=>t.offsetParent!==null&&t.closest("[inert]")===null):[]}function $t(n,t,s){var c;const o=lr(n);if(o.length===0)return;const a=o.indexOf(t);let i;s==="first"?i=0:s==="last"?i=o.length-1:i=Math.max(0,Math.min(o.length-1,a+s)),(c=o[i])==null||c.focus()}const Dn=({open:n})=>e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"12",height:"12","aria-hidden":"true",className:[he.chevron,n?he.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),cr=()=>e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"14",height:"14","aria-hidden":"true",children:e.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),dr=()=>e.jsx("svg",{viewBox:"0 0 20 20",fill:"none",width:"18",height:"18","aria-hidden":"true",children:e.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),ur=()=>e.jsx("svg",{viewBox:"0 0 20 20",fill:"none",width:"18",height:"18","aria-hidden":"true",children:e.jsx("path",{d:"M5 5l10 10M15 5L5 15",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})});function hr(n){const t=[],s=[],o=a=>{if(Array.isArray(a)){a.forEach(o);return}if(r.isValidElement(a)){const i=a.type;if(typeof i!="string"&&(i==null?void 0:i.displayName)==="EvoNavSubItem"){s.push(a);return}}t.push(a)};return o(n),{label:t,subs:s}}const Bn=r.forwardRef(function({children:t,icon:s,active:o=!1,href:a,onClick:i,tooltip:c,open:l,defaultOpen:p=!1,onOpenChange:g,disabled:b=!1,className:_,tier:y},I){const j=r.useContext(Jt),B=(j==null?void 0:j.collapsed)??!1,{depth:T}=r.useContext(pn),R=r.useRef(null),O=r.useId(),q=`${O}-sub`,{label:oe,subs:w}=r.useMemo(()=>hr(t),[t]),D=w.length>0,[M,$]=Zt(D?l:!1,D?p:!1,g),te=r.useCallback(()=>{D&&$(!M)},[D,M,$]),W=r.useCallback(A=>{b||(D&&!a&&te(),i==null||i(A),j!=null&&j.isMobile&&a&&!D&&j.closeDrawer())},[b,D,a,i,j,te]),v=A=>{var de,ie,se;if(b)return;const Z=A.currentTarget,Q=Z.closest(`.${he.navContainer}`);switch(A.key){case"ArrowDown":A.preventDefault(),$t(Q,Z,1);break;case"ArrowUp":A.preventDefault(),$t(Q,Z,-1);break;case"ArrowRight":if(D)if(A.preventDefault(),!M)$(!0);else{const J=Z.closest("li"),ve=J==null?void 0:J.querySelector(`ul [${Ft}]`);ve==null||ve.focus()}break;case"ArrowLeft":if(A.preventDefault(),D&&M)$(!1);else if(T>0){const J=(ie=(de=Z.closest("li"))==null?void 0:de.parentElement)==null?void 0:ie.closest("li");(se=J==null?void 0:J.querySelector(`[${Ft}]`))==null||se.focus()}break;case"Home":A.preventDefault(),$t(Q,Z,"first");break;case"End":A.preventDefault(),$t(Q,Z,"last");break;case"Enter":case" ":{(A.key===" "||a===void 0)&&(A.preventDefault(),W(A));break}}},X=[he.navRow,y==="subitem"?he.navRowSub:he.navRowTop,o?he.active:"",b?he.disabled:"",_].filter(Boolean).join(" "),S=y==="subitem"&&T>0?{"--evo-nav-indent":`${T*.875}rem`}:void 0,re={"data-evo-nav-row":"",id:O,className:X,style:S,title:B&&c?c:void 0,"aria-current":o?"page":void 0,"aria-expanded":D?M:void 0,"aria-controls":D?q:void 0,"aria-disabled":b||void 0,"data-disabled":b?"true":void 0,"data-active":o?"true":void 0,tabIndex:b?-1:0,onKeyDown:v},C=e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:he.navIcon,children:s}),e.jsx("span",{className:he.navLabel,children:oe}),D&&e.jsx(Dn,{open:M})]});let K;if(a&&!b){const A={href:a,onClick:W};K=e.jsx("a",{ref:R,...re,...A,children:C})}else K=e.jsx("button",{ref:R,type:"button",disabled:b,onClick:W,...re,children:C});return e.jsxs("li",{ref:I,className:he.navLi,children:[K,D&&e.jsx(pn.Provider,{value:{depth:T+1},children:e.jsx("ul",{id:q,role:"group","aria-labelledby":O,hidden:!M,className:he.navSubList,children:w})})]})}),en=r.forwardRef(function(t,s){return e.jsx(Bn,{ref:s,tier:"item",...t})});en.displayName="EvoNavItem";const tn=r.forwardRef(function(t,s){return e.jsx(Bn,{ref:s,tier:"subitem",...t})});tn.displayName="EvoNavSubItem";const nn=r.forwardRef(function({label:t,children:s,className:o,collapsible:a=!1,defaultOpen:i=!0,open:c,onOpenChange:l,count:p},g){var oe;const b=r.useId(),_=`${b}-panel`,y=((oe=r.useContext(Jt))==null?void 0:oe.collapsed)??!1,I=a&&!y,[j,B]=Zt(I?c:!0,I?i:!0,l),T=y?!0:j,R=r.useRef(null);r.useEffect(()=>{const w=R.current;w&&(T?w.removeAttribute("inert"):w.setAttribute("inert",""))},[T]);const O=p!=null?e.jsx("span",{className:he.navGroupCount,"aria-hidden":"true",children:p}):null,q=e.jsx("ul",{role:"group","aria-labelledby":b,className:he.navList,children:s});return e.jsxs("li",{ref:g,className:[he.navGroup,o].filter(Boolean).join(" "),children:[I?e.jsxs("button",{type:"button",id:b,className:[he.navGroupLabel,he.navGroupToggle].join(" "),"aria-expanded":T,"aria-controls":_,onClick:()=>B(!j),children:[e.jsx("span",{className:he.navGroupLabelText,children:t}),O,e.jsx(Dn,{open:T})]}):e.jsxs("div",{id:b,role:"heading","aria-level":3,className:he.navGroupLabel,children:[e.jsx("span",{className:he.navGroupLabelText,children:t}),O]}),I?e.jsx("div",{ref:R,id:_,className:he.navGroupPanel,"data-open":T?"true":"false",children:q}):q]})});nn.displayName="EvoNavGroup";const Sn=({count:n=4})=>e.jsx(e.Fragment,{children:Array.from({length:n}).map((t,s)=>e.jsxs("li",{"aria-hidden":"true",className:he.navSkeletonItem,children:[e.jsx("span",{className:he.navSkeletonIcon}),e.jsx("span",{className:he.navSkeletonText,style:{width:`${45+s%4*12}%`}})]},s))}),sn=r.forwardRef(function({label:t="Create New",icon:s,className:o,type:a="button",...i},c){return e.jsx("li",{className:he.navLi,children:e.jsxs("button",{ref:c,type:a,className:[he.navQuickAction,o].filter(Boolean).join(" "),...i,children:[e.jsx("span",{className:he.navIcon,children:s??e.jsx(cr,{})}),e.jsx("span",{className:he.navLabel,children:t})]})})});sn.displayName="EvoNavQuickAction";const Rn=r.forwardRef(function({children:t,breakpoint:s=768,drawerOpen:o,defaultDrawerOpen:a=!1,onDrawerOpenChange:i,hideTrigger:c=!1,collapsed:l=!1,className:p,"aria-label":g="Main navigation",...b},_){const y=ir(s),[I,j]=Zt(o,a,i),B=r.useCallback(()=>j(!1),[j]),T=r.useId(),R=r.useRef(null);r.useEffect(()=>{if(!y||!I)return;const w=D=>{D.key==="Escape"&&B()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[y,I,B]),r.useEffect(()=>{if(!y||!I)return;const w=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=w}},[y,I]),r.useEffect(()=>{!y&&I&&B()},[y,I,B]);const O=r.useMemo(()=>({isMobile:y,drawerOpen:I,setDrawerOpen:j,closeDrawer:B,rootId:T,collapsed:l}),[y,I,j,B,T,l]),q=[he.navContainer,y?he.navMobile:he.navDesktop,y&&I?he.navDrawerOpen:"",l?he.navCollapsed:"",p].filter(Boolean).join(" "),oe=w=>{R.current=w,typeof _=="function"?_(w):_&&(_.current=w)};return e.jsxs(Jt.Provider,{value:O,children:[y&&!c&&e.jsx("button",{type:"button",className:he.navTrigger,"aria-expanded":I,"aria-controls":T,"aria-label":I?"Close navigation":"Open navigation",onClick:()=>j(!I),children:I?e.jsx(ur,{}):e.jsx(dr,{})}),y&&I&&e.jsx("div",{className:he.navBackdrop,"aria-hidden":"true",onClick:B}),e.jsx("nav",{ref:oe,id:T,role:"navigation","aria-label":g,"aria-hidden":y&&!I?!0:void 0,className:q,...b,children:e.jsx("ul",{className:he.navList,children:t})})]})});Rn.displayName="EvoNav";const pr=Object.assign(Rn,{Group:nn,Item:en,SubItem:tn,Skeleton:Sn,QuickAction:sn}),_r="_topNav_hpesm_27",fr="_topNavInner_hpesm_35",mr="_topNavBrand_hpesm_43",vr="_topNavMenu_hpesm_52",xr="_topNavItemRow_hpesm_63",gr="_topNavMenuScroll_hpesm_68",br="_topNavItem_hpesm_63",yr="_topNavItemActive_hpesm_108",wr="_topNavItemLabel_hpesm_117",jr="_topNavIcon_hpesm_121",kr="_topNavActions_hpesm_131",Nr="_topNavToggle_hpesm_139",Er="_toggleIcon_hpesm_163",Tr="_topNavDropdown_hpesm_167",Ir="_topNavDropdownContent_hpesm_183",$r="_topNavDropdownContentOpen_hpesm_206",Cr="_topNavDropdownItem_hpesm_211",Mr="_topNavMenuDrawer_hpesm_247",Lr="_topNavDropdownTrigger_hpesm_265",Dr="_topNavMenuDrawerClosed_hpesm_272",Br="_topNavDropdownInDrawer_hpesm_278",Sr="_topNavBackdrop_hpesm_291",Rr="_topNavReducedMotion_hpesm_301",pe={topNav:_r,topNavInner:fr,topNavBrand:mr,topNavMenu:vr,topNavItemRow:xr,topNavMenuScroll:gr,topNavItem:br,topNavItemActive:yr,topNavItemLabel:wr,topNavIcon:jr,topNavActions:kr,topNavToggle:Nr,toggleIcon:Er,topNavDropdown:Tr,topNavDropdownContent:Ir,topNavDropdownContentOpen:$r,topNavDropdownItem:Cr,topNavMenuDrawer:Mr,topNavDropdownTrigger:Lr,topNavMenuDrawerClosed:Dr,topNavDropdownInDrawer:Br,topNavBackdrop:Sr,topNavReducedMotion:Rr},Ve=(...n)=>n.filter(Boolean).join(" ");function Ar(n,t){return s=>{n==null||n(s),s.defaultPrevented||t==null||t(s)}}function An(n){const{value:t,defaultValue:s,onChange:o}=n,[a,i]=r.useState(s),c=t!==void 0,l=c?t:a,p=r.useCallback(g=>{c||i(g),o==null||o(g)},[c,o]);return[l,p]}const zr=typeof window<"u"?r.useLayoutEffect:r.useEffect;function on(n,t=!1){const[s,o]=r.useState(t);return zr(()=>{var c;if(typeof window>"u"||!window.matchMedia)return;const a=window.matchMedia(n),i=()=>o(a.matches);return i(),(c=a.addEventListener)==null||c.call(a,"change",i),()=>{var l;return(l=a.removeEventListener)==null?void 0:l.call(a,"change",i)}},[n]),s}const Pr=n=>on(`(max-width: ${n-1}px)`),Or=()=>on("(hover: hover) and (pointer: fine)",!0),Wr=()=>on("(prefers-reduced-motion: reduce)");function qt(n){return n?Array.from(n.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])')).filter(t=>!t.hasAttribute("aria-hidden")&&t.offsetParent!==null):[]}const zn=r.forwardRef(function({children:t,...s},o){const a=r.Children.only(t),i=a.props??{},c={...s,...i};c.className=Ve(s.className,i.className),(s.style||i.style)&&(c.style={...s.style,...i.style});for(const l of Object.keys(s))if(l.startsWith("on")&&typeof s[l]=="function"){const p=s[l],g=i[l];c[l]=Ar(p,g)}return r.cloneElement(a,c)}),Tt=r.createContext(null);function Pn(n){const t=r.useContext(Tt);if(!t)throw new Error(`EvoTopNav.${n} must be rendered inside <EvoTopNav>.`);return t}const On=r.createContext(null),Hr=({open:n})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",className:pe.toggleIcon,children:n?e.jsx(e.Fragment,{children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}):e.jsx(e.Fragment,{children:e.jsx("path",{d:"M3 5h12M3 9h12M3 13h12",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}),Fr=({open:n})=>e.jsx("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none","aria-hidden":"true",className:Ve(pe.dropdownChevron,n&&pe.dropdownChevronOpen),children:e.jsx("path",{d:"M3 4.5l3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Wn=r.forwardRef(function({children:t,className:s,...o},a){return e.jsx("div",{ref:a,className:Ve(pe.topNavBrand,s),...o,children:t})}),Hn=r.forwardRef(function({children:t,className:s,...o},a){const i=Pn("Menu"),c=r.useRef(null),l=_=>{c.current=_,i.menuRef.current=_,typeof a=="function"?a(_):a&&(a.current=_)},p=i.toggleCount>0,g=i.isCollapsed&&p,b=g&&!i.drawerOpen;return e.jsx("ul",{ref:l,id:i.menuId,className:Ve(pe.topNavMenu,g&&pe.topNavMenuDrawer,b&&pe.topNavMenuDrawerClosed,i.isCollapsed&&!p&&pe.topNavMenuScroll,s),"data-state":g?i.drawerOpen?"open":"closed":"inline","aria-hidden":b||void 0,...o,children:t})}),Fn=r.forwardRef(function({children:t,active:s,icon:o,href:a,target:i,rel:c,onClick:l,asChild:p,className:g},b){const _=r.useContext(Tt),y=!!_&&_.isCollapsed&&_.drawerOpen,I=R=>{l==null||l(R),!R.defaultPrevented&&y&&_.setDrawerOpen(!1)},j={className:Ve(pe.topNavItem,s&&pe.topNavItemActive,g),"aria-current":s?"page":void 0,"data-active":s||void 0},B=e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:pe.topNavIcon,"aria-hidden":"true",children:o}),e.jsx("span",{className:pe.topNavItemLabel,children:t})]});let T;return p?T=e.jsx(zn,{...j,onClick:I,ref:b,children:t}):a?T=e.jsx("a",{ref:b,href:a,target:i,rel:c??(i==="_blank"?"noopener noreferrer":void 0),onClick:I,...j,children:B}):T=e.jsx("button",{ref:b,type:"button",onClick:I,...j,children:B}),e.jsx("li",{className:pe.topNavItemRow,children:T})}),qn=r.forwardRef(function({children:t,className:s,...o},a){return e.jsx("div",{ref:a,className:Ve(pe.topNavActions,s),...o,children:t})}),Gn=r.forwardRef(function({icon:t,className:s,onClick:o,"aria-label":a,...i},c){const l=Pn("Toggle"),p=r.useRef(null);r.useEffect(()=>l.registerToggle(),[l]);const g=_=>{p.current=_,l.toggleRef.current=_,typeof c=="function"?c(_):c&&(c.current=_)},b=_=>{o==null||o(_),_.defaultPrevented||l.setDrawerOpen(!l.drawerOpen)};return e.jsx("button",{ref:g,id:l.toggleId,type:"button",className:Ve(pe.topNavToggle,s),"aria-expanded":l.drawerOpen,"aria-controls":l.menuId,"aria-label":a??(l.drawerOpen?"Close menu":"Open menu"),onClick:b,...i,children:t??e.jsx(Hr,{open:l.drawerOpen})})}),Vn=({label:n,icon:t,active:s,hoverable:o=!0,open:a,defaultOpen:i=!1,onOpenChange:c,children:l,className:p})=>{const g=r.useContext(Tt),b=!!g&&g.isCollapsed&&g.toggleCount>0,[_,y]=An({value:a,defaultValue:i,onChange:c}),I=Or(),j=o&&I&&!b,B=r.useRef(null),T=r.useRef(null),R=r.useRef(null),O=r.useId(),q=r.useRef(null),oe=r.useCallback(()=>{var v;y(!1),(v=B.current)==null||v.focus()},[y]);r.useEffect(()=>{if(!_||b)return;const v=X=>{const S=R.current;S&&X.target instanceof Node&&!S.contains(X.target)&&y(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[_,b,y]),r.useEffect(()=>{if(!_||b)return;const v=X=>{X.key==="Escape"&&(X.stopPropagation(),oe())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[_,b,oe]);const w=r.useCallback(v=>{var K;const X=qt(T.current);if(X.length===0)return;const S=document.activeElement,re=S?X.indexOf(S):-1;let C=0;v==="first"?C=0:v==="last"?C=X.length-1:v===1?C=re<0?0:(re+1)%X.length:C=re<0?X.length-1:(re-1+X.length)%X.length,(K=X[C])==null||K.focus()},[]),D=v=>{v.key==="ArrowDown"||v.key==="Enter"||v.key===" "?(v.preventDefault(),y(!0),requestAnimationFrame(()=>w("first"))):v.key==="ArrowUp"&&(v.preventDefault(),y(!0),requestAnimationFrame(()=>w("last")))},M=v=>{v.key==="ArrowDown"?(v.preventDefault(),w(1)):v.key==="ArrowUp"?(v.preventDefault(),w(-1)):v.key==="Home"?(v.preventDefault(),w("first")):v.key==="End"?(v.preventDefault(),w("last")):v.key==="Tab"&&y(!1)},$=()=>{j&&(q.current&&clearTimeout(q.current),y(!0))},te=()=>{j&&(q.current&&clearTimeout(q.current),q.current=setTimeout(()=>y(!1),120))},W=r.useMemo(()=>({open:_,setOpen:y,triggerRef:B,contentRef:T,contentId:O,focusItem:w,inDrawer:b}),[_,y,O,w,b]);return e.jsx(On.Provider,{value:W,children:e.jsxs("li",{ref:R,className:Ve(pe.topNavDropdown,b&&pe.topNavDropdownInDrawer,_&&pe.topNavDropdownOpen,p),onMouseEnter:$,onMouseLeave:te,children:[e.jsxs("button",{ref:B,type:"button",className:Ve(pe.topNavItem,pe.topNavDropdownTrigger,s&&pe.topNavItemActive),"aria-haspopup":"menu","aria-expanded":_,"aria-controls":O,"aria-current":s?"page":void 0,onClick:()=>y(!_),onKeyDown:D,children:[t&&e.jsx("span",{className:pe.topNavIcon,"aria-hidden":"true",children:t}),e.jsx("span",{className:pe.topNavItemLabel,children:n}),e.jsx(Fr,{open:_})]}),e.jsx("ul",{ref:T,id:O,role:"menu",className:Ve(pe.topNavDropdownContent,_&&pe.topNavDropdownContentOpen),"aria-hidden":!_||void 0,onKeyDown:M,children:l})]})})},Un=r.forwardRef(function({children:t,icon:s,active:o,href:a,target:i,rel:c,onClick:l,asChild:p,className:g},b){const _=r.useContext(On),y=r.useContext(Tt),I=R=>{l==null||l(R),R.defaultPrevented||(_==null||_.setOpen(!1),y&&y.isCollapsed&&y.drawerOpen&&y.setDrawerOpen(!1))},j={className:Ve(pe.topNavDropdownItem,o&&pe.topNavItemActive,g),role:"menuitem","aria-current":o?"page":void 0},B=e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:pe.topNavIcon,"aria-hidden":"true",children:s}),e.jsx("span",{className:pe.topNavItemLabel,children:t})]});let T;return p?T=e.jsx(zn,{...j,onClick:I,ref:b,children:t}):a?T=e.jsx("a",{ref:b,href:a,target:i,rel:c??(i==="_blank"?"noopener noreferrer":void 0),onClick:I,...j,children:B}):T=e.jsx("button",{ref:b,type:"button",onClick:I,...j,children:B}),e.jsx("li",{children:T})}),tt=r.forwardRef(function({children:t,open:s,defaultOpen:o=!1,onOpenChange:a,collapseBelow:i=768,className:c,...l},p){const[g,b]=An({value:s,defaultValue:o,onChange:a}),_=Pr(i),y=Wr(),[I,j]=r.useState(0),B=r.useCallback(()=>(j(M=>M+1),()=>j(M=>Math.max(0,M-1))),[]),T=r.useId(),R=r.useId(),O=r.useRef(null),q=r.useRef(null),oe=r.useRef(null),w=_&&g&&I>0;r.useEffect(()=>{!_&&g&&b(!1)},[_,g,b]),r.useEffect(()=>{if(!w)return;const M=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=M}},[w]),r.useEffect(()=>{if(!w)return;oe.current=document.activeElement??null;const $=requestAnimationFrame(()=>{var v;(v=qt(O.current)[0])==null||v.focus()}),te=W=>{if(W.key==="Escape"){W.preventDefault(),b(!1);return}if(W.key!=="Tab"||!O.current)return;const v=qt(O.current);if(v.length===0)return;const X=v[0],S=v[v.length-1],re=document.activeElement;W.shiftKey&&re===X?(W.preventDefault(),S.focus()):(!W.shiftKey&&re===S||re&&!O.current.contains(re))&&(W.preventDefault(),X.focus())};return document.addEventListener("keydown",te),()=>{cancelAnimationFrame($),document.removeEventListener("keydown",te)}},[w,b]),r.useEffect(()=>{if(w)return;const M=oe.current;if(M&&typeof M.focus=="function"){const $=document.activeElement;(!$||$===document.body||O.current&&O.current.contains($))&&M.focus(),oe.current=null}},[w]);const D=r.useMemo(()=>({drawerOpen:g,setDrawerOpen:b,isCollapsed:_,menuId:T,toggleId:R,registerToggle:B,toggleCount:I,menuRef:O,toggleRef:q}),[g,b,_,T,R,B,I]);return e.jsx(Tt.Provider,{value:D,children:e.jsxs("nav",{ref:p,className:Ve(pe.topNav,w&&pe.topNavDrawerOpen,y&&pe.topNavReducedMotion,c),"data-collapsed":_||void 0,"data-drawer-open":w||void 0,...l,children:[e.jsx("div",{className:pe.topNavInner,children:t}),w&&e.jsx("div",{className:pe.topNavBackdrop,onClick:()=>b(!1),"aria-hidden":"true"})]})})});Wn.displayName="EvoTopNav.Brand";Hn.displayName="EvoTopNav.Menu";Fn.displayName="EvoTopNav.Item";qn.displayName="EvoTopNav.Actions";Gn.displayName="EvoTopNav.Toggle";Vn.displayName="EvoTopNav.Dropdown";Un.displayName="EvoTopNav.DropdownItem";tt.displayName="EvoTopNav";tt.Brand=Wn;tt.Menu=Hn;tt.Item=Fn;tt.Actions=qn;tt.Toggle=Gn;tt.Dropdown=Vn;tt.DropdownItem=Un;const qr="_pagination_1lhxw_1",Gr="_pageBtn_1lhxw_8",Vr="_activePage_1lhxw_34",Ur="_navBtn_1lhxw_45",Kr="_ellipsis_1lhxw_49",ot={pagination:qr,pageBtn:Gr,activePage:Vr,navBtn:Ur,ellipsis:Kr},_n=(n,t)=>Array.from({length:t-n+1},(s,o)=>n+o),Qr=({total:n,page:t,pageSize:s=10,siblingCount:o=1,onChange:a,className:i=""})=>{const c=Math.max(1,Math.ceil(n/s)),l=()=>{if(c<=7)return _n(1,c);const p=Math.max(2,t-o),g=Math.min(c-1,t+o),b=[1];return p>2&&b.push("..."),b.push(..._n(p,g)),g<c-1&&b.push("..."),c>1&&b.push(c),b};return e.jsxs("nav",{className:`${ot.pagination} ${i}`,"aria-label":"Pagination",children:[e.jsx("button",{className:`${ot.pageBtn} ${ot.navBtn}`,disabled:t<=1,onClick:()=>a(t-1),"aria-label":"Previous page",children:"‹"}),l().map((p,g)=>p==="..."?e.jsx("span",{className:ot.ellipsis,children:"…"},`ellipsis-${g}`):e.jsx("button",{className:[ot.pageBtn,p===t?ot.activePage:""].filter(Boolean).join(" "),onClick:()=>a(p),"aria-label":`Page ${p}`,"aria-current":p===t?"page":void 0,children:p},p)),e.jsx("button",{className:`${ot.pageBtn} ${ot.navBtn}`,disabled:t>=c,onClick:()=>a(t+1),"aria-label":"Next page",children:"›"})]})},Yr="_overlay_1qpdy_1",Xr="_palette_1qpdy_23",Jr="_searchRow_1qpdy_46",Zr="_searchIconWrap_1qpdy_54",ea="_searchInput_1qpdy_61",ta="_escBadge_1qpdy_75",na="_results_1qpdy_86",sa="_empty_1qpdy_102",oa="_group_1qpdy_109",ra="_groupLabel_1qpdy_113",aa="_resultItem_1qpdy_122",ia="_resultActive_1qpdy_135",la="_resultIcon_1qpdy_139",ca="_resultLabel_1qpdy_149",da="_resultDesc_1qpdy_157",ua="_resultShortcut_1qpdy_163",ha="_footer_1qpdy_178",pa="_footerRight_1qpdy_202",De={overlay:Yr,palette:Xr,searchRow:Jr,searchIconWrap:Zr,searchInput:ea,escBadge:ta,results:na,empty:sa,group:oa,groupLabel:ra,resultItem:aa,resultActive:ia,resultIcon:la,resultLabel:ca,resultDesc:da,resultShortcut:ua,footer:ha,footerRight:pa},_a=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),fa=()=>e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",width:"16",height:"16",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ma=({items:n,placeholder:t="Search commands…",open:s,onClose:o})=>{const[a,i]=r.useState(!1),[c,l]=r.useState(""),[p,g]=r.useState(0),b=r.useRef(null),_=r.useRef(null),y=s!==void 0,I=y?s:a,j=r.useCallback(()=>{y||i(!1),o==null||o()},[y,o]);r.useEffect(()=>{const w=D=>{(D.ctrlKey||D.metaKey)&&D.key==="k"&&(D.preventDefault(),y||i(M=>!M)),D.key==="Escape"&&I&&j()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[y,I,j]),r.useEffect(()=>{if(I){l(""),g(0);const w=setTimeout(()=>{var D;return(D=b.current)==null?void 0:D.focus()},30);return()=>clearTimeout(w)}},[I]);const T=(c.trim()?n.filter(w=>{var D,M;return w.label.toLowerCase().includes(c.toLowerCase())||((D=w.description)==null?void 0:D.toLowerCase().includes(c.toLowerCase()))||((M=w.group)==null?void 0:M.toLowerCase().includes(c.toLowerCase()))}):n).reduce((w,D)=>{const M=D.group??"Actions";return w[M]||(w[M]=[]),w[M].push(D),w},{}),R=Object.values(T).flat(),O=w=>{var M;const D=(M=_.current)==null?void 0:M.querySelector(`[data-idx="${w}"]`);D==null||D.scrollIntoView({block:"nearest"})},q=w=>{w.key==="ArrowDown"?(w.preventDefault(),g(D=>{const M=Math.min(D+1,R.length-1);return O(M),M})):w.key==="ArrowUp"?(w.preventDefault(),g(D=>{const M=Math.max(D-1,0);return O(M),M})):w.key==="Enter"&&R[p]&&(R[p].onSelect(),j())};if(!I)return null;let oe=0;return e.jsx("div",{className:De.overlay,onClick:j,role:"dialog","aria-modal":"true",children:e.jsxs("div",{className:De.palette,onClick:w=>w.stopPropagation(),onKeyDown:q,children:[e.jsxs("div",{className:De.searchRow,children:[e.jsx("span",{className:De.searchIconWrap,children:e.jsx(fa,{})}),e.jsx("input",{ref:b,className:De.searchInput,placeholder:t,value:c,onChange:w=>{l(w.target.value),g(0)},"aria-label":"Command search"}),e.jsx("kbd",{className:De.escBadge,children:"Esc"})]}),e.jsxs("div",{className:De.results,ref:_,children:[R.length===0&&e.jsxs("div",{className:De.empty,children:["No results for “",c,"”"]}),Object.entries(T).map(([w,D])=>e.jsxs("div",{className:De.group,children:[e.jsx("div",{className:De.groupLabel,children:w}),D.map(M=>{const $=oe++;return e.jsxs("button",{"data-idx":$,className:[De.resultItem,$===p?De.resultActive:""].filter(Boolean).join(" "),onClick:()=>{M.onSelect(),j()},onMouseEnter:()=>g($),children:[M.icon&&e.jsx("span",{className:De.resultIcon,children:M.icon}),e.jsx("span",{className:De.resultLabel,children:M.label}),M.description&&e.jsx("span",{className:De.resultDesc,children:M.description}),M.shortcut&&e.jsx("span",{className:De.resultShortcut,children:M.shortcut.map((te,W)=>e.jsx("kbd",{children:te},W))})]},M.label)})]},w))]}),e.jsxs("div",{className:De.footer,children:[e.jsxs("span",{children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"})," navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"↵"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"Esc"})," close"]}),e.jsxs("span",{className:De.footerRight,children:[e.jsx("kbd",{children:_a?"⌘":"Ctrl"}),e.jsx("kbd",{children:"K"})," toggle"]})]})]})})},va="_field_l0kkf_1",xa="_fullWidth_l0kkf_8",ga="_label_l0kkf_12",ba="_inputWrapper_l0kkf_18",ya="_hasError_l0kkf_30",wa="_sm_l0kkf_38",ja="_md_l0kkf_42",ka="_lg_l0kkf_46",Na="_input_l0kkf_18",Ea="_adornment_l0kkf_69",Ta="_trailingAdornment_l0kkf_78",Ia="_errorText_l0kkf_83",$a="_helperText_l0kkf_89",Ge={field:va,fullWidth:xa,label:ga,inputWrapper:ba,hasError:ya,sm:wa,md:ja,lg:ka,input:Na,adornment:Ea,trailingAdornment:Ta,errorText:Ia,helperText:$a},Ca=({label:n,helperText:t,error:s,size:o="md",leadingAdornment:a,trailingAdornment:i,fullWidth:c=!1,className:l="",id:p,...g})=>{const b=p??(n==null?void 0:n.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:[Ge.field,c?Ge.fullWidth:"",l].filter(Boolean).join(" "),children:[n&&e.jsx("label",{htmlFor:b,className:Ge.label,children:n}),e.jsxs("div",{className:[Ge.inputWrapper,Ge[o],s?Ge.hasError:""].filter(Boolean).join(" "),children:[a&&e.jsx("span",{className:Ge.adornment,children:a}),e.jsx("input",{id:b,className:Ge.input,"aria-invalid":!!s,"aria-describedby":s?`${b}-error`:t?`${b}-helper`:void 0,...g}),i&&e.jsx("span",{className:`${Ge.adornment} ${Ge.trailingAdornment}`,children:i})]}),s&&e.jsx("p",{id:`${b}-error`,className:Ge.errorText,children:s}),!s&&t&&e.jsx("p",{id:`${b}-helper`,className:Ge.helperText,children:t})]})},Ma="_field_t1e02_1",La="_fullWidth_t1e02_9",Da="_label_t1e02_13",Ba="_shell_t1e02_19",Sa="_hasError_t1e02_33",Ra="_disabled_t1e02_39",Aa="_dragOver_t1e02_43",za="_toolbar_t1e02_48",Pa="_divider_t1e02_61",Oa="_toolBtn_t1e02_69",Wa="_toolBtnActive_t1e02_101",Ha="_editor_t1e02_110",Fa="_editorEmpty_t1e02_122",qa="_dropOverlay_t1e02_186",Ga="_linkPrompt_t1e02_202",Va="_linkInput_t1e02_211",Ua="_linkBtn_t1e02_228",Ka="_linkBtnGhost_t1e02_229",Qa="_helperText_t1e02_256",Ya="_errorText_t1e02_262",Ee={field:Ma,fullWidth:La,label:Da,shell:Ba,hasError:Sa,disabled:Ra,dragOver:Aa,toolbar:za,divider:Pa,toolBtn:Oa,toolBtnActive:Wa,editor:Ha,editorEmpty:Fa,dropOverlay:qa,linkPrompt:Ga,linkInput:Va,linkBtn:Ua,linkBtnGhost:Ka,helperText:Qa,errorText:Ya},Ce=({children:n})=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),Me={bold:e.jsxs(Ce,{children:[e.jsx("path",{d:"M6 4h8a4 4 0 0 1 0 8H6z"}),e.jsx("path",{d:"M6 12h9a4 4 0 0 1 0 8H6z"})]}),italic:e.jsxs(Ce,{children:[e.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),e.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),e.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]}),underline:e.jsxs(Ce,{children:[e.jsx("path",{d:"M6 3v7a6 6 0 0 0 12 0V3"}),e.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]}),strike:e.jsxs(Ce,{children:[e.jsx("path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}),e.jsx("path",{d:"M14 12a4 4 0 0 1 0 8H6"}),e.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]}),h1:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M17 10l3-2v10"})]}),h2:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"})]}),h3:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"}),e.jsx("path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"})]}),paragraph:e.jsxs(Ce,{children:[e.jsx("path",{d:"M13 4v16"}),e.jsx("path",{d:"M17 4v16"}),e.jsx("path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13"})]}),ul:e.jsxs(Ce,{children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),e.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),ol:e.jsxs(Ce,{children:[e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"10",y1:"18",x2:"21",y2:"18"}),e.jsx("path",{d:"M4 6h1v4"}),e.jsx("path",{d:"M4 10h2"}),e.jsx("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]}),quote:e.jsxs(Ce,{children:[e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"}),e.jsx("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"})]}),code:e.jsxs(Ce,{children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}),link:e.jsxs(Ce,{children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),image:e.jsxs(Ce,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]}),alignLeft:e.jsxs(Ce,{children:[e.jsx("line",{x1:"17",y1:"10",x2:"3",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"17",y1:"18",x2:"3",y2:"18"})]}),alignCenter:e.jsxs(Ce,{children:[e.jsx("line",{x1:"18",y1:"10",x2:"6",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"18",y1:"18",x2:"6",y2:"18"})]}),alignRight:e.jsxs(Ce,{children:[e.jsx("line",{x1:"21",y1:"10",x2:"7",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"21",y1:"18",x2:"7",y2:"18"})]}),clear:e.jsx(Ce,{children:e.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),undo:e.jsxs(Ce,{children:[e.jsx("path",{d:"M3 7v6h6"}),e.jsx("path",{d:"M21 17a9 9 0 0 0-15-6.7L3 13"})]}),redo:e.jsxs(Ce,{children:[e.jsx("path",{d:"M21 7v6h-6"}),e.jsx("path",{d:"M3 17a9 9 0 0 1 15-6.7L21 13"})]})},Wt={bold:{label:"Bold",icon:Me.bold,command:"bold",shortcut:"⌘B"},italic:{label:"Italic",icon:Me.italic,command:"italic",shortcut:"⌘I"},underline:{label:"Underline",icon:Me.underline,command:"underline",shortcut:"⌘U"},strike:{label:"Strikethrough",icon:Me.strike,command:"strikeThrough",query:"strikeThrough"},h1:{label:"Heading 1",icon:Me.h1,command:"formatBlock",arg:"H1"},h2:{label:"Heading 2",icon:Me.h2,command:"formatBlock",arg:"H2"},h3:{label:"Heading 3",icon:Me.h3,command:"formatBlock",arg:"H3"},paragraph:{label:"Paragraph",icon:Me.paragraph,command:"formatBlock",arg:"P"},ul:{label:"Bulleted list",icon:Me.ul,command:"insertUnorderedList"},ol:{label:"Numbered list",icon:Me.ol,command:"insertOrderedList"},quote:{label:"Blockquote",icon:Me.quote,command:"formatBlock",arg:"BLOCKQUOTE"},code:{label:"Inline code",icon:Me.code,command:"formatBlock",arg:"PRE"},"align-left":{label:"Align left",icon:Me.alignLeft,command:"justifyLeft"},"align-center":{label:"Align center",icon:Me.alignCenter,command:"justifyCenter"},"align-right":{label:"Align right",icon:Me.alignRight,command:"justifyRight"},clear:{label:"Clear formatting",icon:Me.clear,command:"removeFormat"},undo:{label:"Undo",icon:Me.undo,command:"undo",shortcut:"⌘Z"},redo:{label:"Redo",icon:Me.redo,command:"redo",shortcut:"⇧⌘Z"}},Xa=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"];function Ja(n){return typeof n=="object"&&n!==null}function Za(n){return new Promise((t,s)=>{const o=new FileReader;o.onload=()=>t(String(o.result)),o.onerror=()=>s(o.error),o.readAsDataURL(n)})}function ht(n,t){try{document.execCommand(n,!1,t)}catch{}}const ei=/^(?:P|DIV|H[1-6]|BLOCKQUOTE|PRE|UL|OL|LI|TABLE)$/;function Ct(n,t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const o=s.getRangeAt(0).startContainer,a=o.nodeType===1?o:o.parentElement;let i=null;try{i=(a==null?void 0:a.closest(t))??null}catch{return null}return i&&n.contains(i)&&i!==n?i:null}function fn(n,t){var b;const s=window.getSelection();if(!s||s.rangeCount===0)return!1;const o=s.getRangeAt(0),a=o.startContainer,i=a.nodeType===1?a:a.parentElement;if(!i)return!1;const c=[];let l=null;try{l=i.closest(t)}catch{return!1}for(;l&&n.contains(l)&&l!==n;)c.push(l),l=((b=l.parentElement)==null?void 0:b.closest(t))??null;if(c.length===0)return!1;const p=document.createElement("span");p.setAttribute("data-evo-caret",""),o.insertNode(p),c.forEach(_=>{if(Array.from(_.children).some(I=>ei.test(I.tagName)))_.replaceWith(...Array.from(_.childNodes));else{const I=document.createElement("p");for(;_.firstChild;)I.appendChild(_.firstChild);I.childNodes.length||I.appendChild(document.createElement("br")),_.replaceWith(I)}});const g=n.querySelector("span[data-evo-caret]");if(g){const _=g.parentElement,y=document.createRange();y.setStartBefore(g),y.collapse(!0),s.removeAllRanges(),s.addRange(y),g.remove(),_&&!_.childNodes.length&&_.appendChild(document.createElement("br"))}return!0}function ti(n){const t=/^(?:P|DIV|H[1-6]|UL|OL|PRE|BLOCKQUOTE|TABLE)$/,s=[];let o=[];const a=()=>{if(!o.length)return;const i=document.createElement("p");o.forEach(c=>i.appendChild(c)),o=[],s.push(i)};return Array.from(n.childNodes).forEach(i=>{if(i.nodeType===1&&t.test(i.tagName)){a();let c=i;if(c.tagName==="DIV"){const l=document.createElement("p");for(;c.firstChild;)l.appendChild(c.firstChild);c=l}s.push(c)}else o.push(i)}),a(),s.forEach(i=>{!i.textContent&&!i.querySelector("br,img")&&i.appendChild(document.createElement("br"))}),s}function ni(n){const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const s=t.getRangeAt(0);if(!s.collapsed)return!1;const o=s.startContainer,a=o.nodeType===1?o:o.parentElement,i=(a==null?void 0:a.closest("pre,blockquote"))??null;if(!i||!n.contains(i)||i===n)return!1;const c=document.createRange();c.setStart(s.startContainer,s.startOffset),c.setEnd(i,i.childNodes.length);const l=ti(c.extractContents());if(l.length===0){const b=document.createElement("p");b.appendChild(document.createElement("br")),l.push(b)}let p=i;l.forEach(b=>{p.after(b),p=b}),i.firstChild||i.remove();const g=document.createRange();return g.setStart(l[0],0),g.collapse(!0),t.removeAllRanges(),t.addRange(g),!0}const si=["bold","italic","underline","divider","h1","h2","divider","ul","ol","divider","link","image"],oi=r.forwardRef(function({value:t,defaultValue:s,onChange:o,tools:a=si,placeholder:i="Start writing…",minHeight:c=160,maxHeight:l,disabled:p=!1,readOnly:g=!1,label:b,helperText:_,error:y,fullWidth:I=!1,onImageUpload:j,acceptedImageTypes:B=Xa,maxImageSize:T,onImageError:R,className:O="",id:q},oe){const w=r.useRef(null),D=r.useRef(null),M=r.useRef(""),$=t!==void 0,[te,W]=r.useState({}),[v,X]=r.useState(!0),[S,re]=r.useState(!1),[C,K]=r.useState(null),A=q??(b==null?void 0:b.toLowerCase().replace(/\s+/g,"-"))??void 0;r.useEffect(()=>{var u,N;const m=w.current;m&&($?t!==M.current&&(m.innerHTML=t??"",M.current=t??"",X(!((u=m.textContent)!=null&&u.trim()))):s&&!M.current&&(m.innerHTML=s,M.current=s,X(!((N=m.textContent)!=null&&N.trim()))))},[t,s,$]);const Z=r.useCallback(()=>{const m=w.current,u={};Object.entries(Wt).forEach(([N,E])=>{try{E.command==="formatBlock"?m?(E.arg??"").toUpperCase()==="P"?u[N]=!!Ct(m,"P,DIV")&&!Ct(m,"BLOCKQUOTE,PRE,H1,H2,H3,H4,H5,H6"):u[N]=!!Ct(m,E.arg??""):u[N]=!1:u[N]=document.queryCommandState(E.query??E.command)}catch{u[N]=!1}}),W(u)},[]),Q=r.useCallback(()=>{var N;const m=w.current;if(!m)return;const u=m.innerHTML;M.current=u,X(!((N=m.textContent)!=null&&N.trim())&&!m.querySelector("img")),o==null||o(u),Z()},[o,Z]);r.useImperativeHandle(oe,()=>({getHTML:()=>{var m;return((m=w.current)==null?void 0:m.innerHTML)??""},setHTML:m=>{const u=w.current;u&&(u.innerHTML=m,Q())},getText:()=>{var m;return((m=w.current)==null?void 0:m.textContent)??""},focus:()=>{var m;return(m=w.current)==null?void 0:m.focus()},insertImage:(m,u="")=>de(m,u),insertHTML:m=>{var u;(u=w.current)==null||u.focus(),ht("insertHTML",m),Q()},clear:()=>{const m=w.current;m&&(m.innerHTML="",Q())}}),[Q]);const de=r.useCallback((m,u="")=>{var E;(E=w.current)==null||E.focus();const N=`<img src="${m.replace(/"/g,"&quot;")}" alt="${u.replace(/"/g,"&quot;")}" />`;ht("insertHTML",N),Q()},[Q]),ie=r.useCallback(async m=>{if(!B.includes(m.type)){R==null||R({code:"wrong-type",message:`Unsupported image type: ${m.type}`});return}if(T&&m.size>T){R==null||R({code:"too-large",message:`Image exceeds ${(T/1024/1024).toFixed(1)} MB`});return}try{const u=j?await j(m):await Za(m);de(u,m.name)}catch(u){R==null||R({code:"upload-failed",message:u instanceof Error?u.message:"Upload failed"})}},[B,T,j,R,de]),se=r.useCallback(m=>{const u=w.current;u==null||u.focus();const N=Wt[m];if(N){if(N.command==="formatBlock"&&u){const E=N.arg??"";E.toUpperCase()!=="P"&&Ct(u,E)?fn(u,E):(fn(u,"BLOCKQUOTE,PRE,H1,H2,H3,H4,H5,H6"),ht("formatBlock",E))}else ht(N.command,N.arg);Q()}},[Q]),J=r.useCallback(()=>{var m;(m=D.current)==null||m.click()},[]),ve=r.useCallback(()=>{const m=window.getSelection(),u=m&&m.rangeCount>0?m.getRangeAt(0).cloneRange():null;K({url:"https://",range:u})},[]),Te=r.useCallback(()=>{var N,E;if(!C)return;const{url:m,range:u}=C;if((N=w.current)==null||N.focus(),u){const V=window.getSelection();V==null||V.removeAllRanges(),V==null||V.addRange(u)}if(m&&m!=="https://"){ht("createLink",m);const V=(E=w.current)==null?void 0:E.querySelectorAll('a[href="'+m+'"]');V==null||V.forEach(be=>be.setAttribute("target","_blank"))}K(null),Q()},[C,Q]),ye=r.useCallback(()=>{Q()},[Q]),le=r.useCallback(m=>{if(m.key==="Enter"&&!m.shiftKey&&!m.metaKey&&!m.ctrlKey&&!m.altKey){const E=w.current;if(E&&ni(E)){m.preventDefault(),Q();return}}if(!(m.metaKey||m.ctrlKey))return;const N=m.key.toLowerCase();N==="b"?(m.preventDefault(),se("bold")):N==="i"?(m.preventDefault(),se("italic")):N==="u"&&(m.preventDefault(),se("underline"))},[se,Q]),Be=r.useCallback(async m=>{var E,V;const u=(E=m.clipboardData)==null?void 0:E.items;if(!u)return;for(let be=0;be<u.length;be++){const ue=u[be];if(ue.type.startsWith("image/")){m.preventDefault();const Pe=ue.getAsFile();Pe&&await ie(Pe);return}}const N=(V=m.clipboardData)==null?void 0:V.getData("text/plain");N!==void 0&&N!==""&&(m.preventDefault(),ht("insertText",N))},[ie]),we=r.useCallback(m=>{m.dataTransfer.types.includes("Files")&&(m.preventDefault(),re(!0))},[]),xe=r.useCallback(()=>re(!1),[]),ce=r.useCallback(async m=>{re(!1);const u=Array.from(m.dataTransfer.files??[]).filter(N=>N.type.startsWith("image/"));if(u.length!==0){m.preventDefault();for(const N of u)await ie(N)}},[ie]),ge=r.useCallback(async m=>{const u=Array.from(m.target.files??[]);m.target.value="";for(const N of u)await ie(N)},[ie]);r.useEffect(()=>{const m=()=>{const u=w.current;u&&(document.activeElement===u||u.contains(document.activeElement))&&Z()};return document.addEventListener("selectionchange",m),()=>document.removeEventListener("selectionchange",m)},[Z]);const We=r.useMemo(()=>a.length>0?e.jsx("div",{className:Ee.toolbar,role:"toolbar","aria-label":"Formatting toolbar",children:a.map((u,N)=>{var be;if(u==="divider")return e.jsx("span",{className:Ee.divider,"aria-hidden":"true"},`d-${N}`);if(Ja(u)){const ue=((be=u.isActive)==null?void 0:be.call(u))??!1;return e.jsx("button",{type:"button",className:[Ee.toolBtn,ue?Ee.toolBtnActive:""].filter(Boolean).join(" "),title:u.label,"aria-label":u.label,"aria-pressed":ue,disabled:p||g,onMouseDown:Pe=>Pe.preventDefault(),onClick:()=>u.onAction(je()),children:u.icon},u.key)}if(u==="image")return e.jsx("button",{type:"button",className:Ee.toolBtn,title:"Insert image","aria-label":"Insert image",disabled:p||g,onMouseDown:ue=>ue.preventDefault(),onClick:J,children:Me.image},"image");if(u==="link")return e.jsx("button",{type:"button",className:Ee.toolBtn,title:"Insert link","aria-label":"Insert link",disabled:p||g,onMouseDown:ue=>ue.preventDefault(),onClick:ve,children:Me.link},"link");const E=Wt[u];if(!E)return null;const V=!!te[u];return e.jsx("button",{type:"button",className:[Ee.toolBtn,V?Ee.toolBtnActive:""].filter(Boolean).join(" "),title:`${E.label}${E.shortcut?` (${E.shortcut})`:""}`,"aria-label":E.label,"aria-pressed":V,disabled:p||g,onMouseDown:ue=>ue.preventDefault(),onClick:()=>se(u),children:E.icon},u)})}):null,[a,te,p,g,J,ve,se]),je=r.useCallback(()=>({getHTML:()=>{var m;return((m=w.current)==null?void 0:m.innerHTML)??""},setHTML:m=>{const u=w.current;u&&(u.innerHTML=m,Q())},getText:()=>{var m;return((m=w.current)==null?void 0:m.textContent)??""},focus:()=>{var m;return(m=w.current)==null?void 0:m.focus()},insertImage:(m,u="")=>de(m,u),insertHTML:m=>{var u;(u=w.current)==null||u.focus(),ht("insertHTML",m),Q()},clear:()=>{const m=w.current;m&&(m.innerHTML="",Q())}}),[Q,de]),Ne={minHeight:typeof c=="number"?`${c}px`:c,maxHeight:l!==void 0?typeof l=="number"?`${l}px`:l:void 0};return e.jsxs("div",{className:[Ee.field,I?Ee.fullWidth:"",O].filter(Boolean).join(" "),children:[b&&e.jsx("label",{htmlFor:A,className:Ee.label,children:b}),e.jsxs("div",{className:[Ee.shell,y?Ee.hasError:"",p?Ee.disabled:"",S?Ee.dragOver:""].filter(Boolean).join(" "),children:[We,e.jsx("div",{ref:w,id:A,className:[Ee.editor,v?Ee.editorEmpty:""].filter(Boolean).join(" "),contentEditable:!p&&!g,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":b??"Rich text editor","aria-invalid":!!y,"aria-readonly":g,"aria-disabled":p,"data-placeholder":i,style:Ne,onInput:ye,onKeyDown:le,onPaste:Be,onDragOver:we,onDragLeave:xe,onDrop:ce,onBlur:Z}),S&&e.jsx("div",{className:Ee.dropOverlay,"aria-hidden":"true",children:e.jsx("span",{children:"Drop image to upload"})}),C&&e.jsxs("div",{className:Ee.linkPrompt,role:"dialog","aria-label":"Insert link",children:[e.jsx("input",{type:"url",className:Ee.linkInput,value:C.url,autoFocus:!0,onChange:m=>K({...C,url:m.target.value}),onKeyDown:m=>{m.key==="Enter"?(m.preventDefault(),Te()):m.key==="Escape"&&(m.preventDefault(),K(null))},placeholder:"https://example.com"}),e.jsx("button",{type:"button",className:Ee.linkBtn,onClick:Te,children:"Apply"}),e.jsx("button",{type:"button",className:Ee.linkBtnGhost,onClick:()=>K(null),children:"Cancel"})]}),e.jsx("input",{ref:D,type:"file",accept:B.join(","),multiple:!0,hidden:!0,onChange:ge})]}),y&&e.jsx("p",{className:Ee.errorText,children:y}),!y&&_&&e.jsx("p",{className:Ee.helperText,children:_})]})}),ri="_field_121w6_7",ai="_fullWidth_121w6_15",ii="_disabled_121w6_19",li="_trigger_121w6_19",ci="_label_121w6_25",di="_selectWrapper_121w6_33",ui="_open_121w6_66",hi="_hasError_121w6_70",pi="_sm_121w6_82",_i="_md_121w6_89",fi="_lg_121w6_95",mi="_triggerValue_121w6_102",vi="_triggerPlaceholder_121w6_103",xi="_triggerChips_121w6_113",gi="_chipRow_121w6_120",bi="_chip_121w6_120",yi="_chipIcon_121w6_143",wi="_chipLabel_121w6_151",ji="_chipRemove_121w6_158",ki="_countMore_121w6_175",Ni="_triggerText_121w6_185",Ei="_triggerIcon_121w6_192",Ti="_triggerActions_121w6_200",Ii="_clearBtn_121w6_208",$i="_chevron_121w6_225",Ci="_chevronOpen_121w6_233",Mi="_menu_121w6_245",Li="_menuOpen_121w6_1",Di="_searchRow_121w6_271",Bi="_searchIconWrap_121w6_280",Si="_searchInput_121w6_286",Ri="_bulkRow_121w6_302",Ai="_bulkBtn_121w6_311",zi="_bulkCount_121w6_333",Pi="_list_121w6_341",Oi="_empty_121w6_367",Wi="_option_121w6_375",Hi="_optionActive_121w6_396",Fi="_optionDisabled_121w6_396",qi="_optionSelected_121w6_401",Gi="_optionTitle_121w6_404",Vi="_optionIcon_121w6_413",Ui="_optionLabel_121w6_424",Ki="_optionDesc_121w6_439",Qi="_check_121w6_448",Yi="_checkbox_121w6_459",Xi="_checkboxChecked_121w6_473",Ji="_errorText_121w6_484",Zi="_helperText_121w6_491",U={field:ri,fullWidth:ai,disabled:ii,trigger:li,label:ci,selectWrapper:di,open:ui,hasError:hi,sm:pi,md:_i,lg:fi,triggerValue:mi,triggerPlaceholder:vi,triggerChips:xi,chipRow:gi,chip:bi,chipIcon:yi,chipLabel:wi,chipRemove:ji,countMore:ki,triggerText:Ni,triggerIcon:Ei,triggerActions:Ti,clearBtn:Ii,chevron:$i,chevronOpen:Ci,menu:Mi,menuOpen:Li,searchRow:Di,searchIconWrap:Bi,searchInput:Si,bulkRow:Ri,bulkBtn:Ai,bulkCount:zi,list:Pi,empty:Oi,option:Wi,optionActive:Hi,optionDisabled:Fi,optionSelected:qi,optionTitle:Gi,optionIcon:Vi,optionLabel:Ui,optionDesc:Ki,check:Qi,checkbox:Yi,checkboxChecked:Xi,errorText:Ji,helperText:Zi},el=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),mn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),vn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),tl=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),nl=n=>{const{label:t,options:s,placeholder:o="Select an option",helperText:a,error:i,size:c="md",fullWidth:l=!1,disabled:p=!1,searchable:g=!1,clearable:b=!1,id:_,name:y,className:I=""}=n,j=n.multiple===!0,B=j?n.multipleDisplay??"chips":"chips",T=j?n.maxSelections:void 0,R=j?n.showSelectAll??!1:!1,O=r.useId(),q=_??`evo-select-${O}`,oe=`${q}-listbox`,w=n.value,D=n.defaultValue,M=w!==void 0,$=j?Array.isArray(D)?D:[]:typeof D=="string"?D:"",[te,W]=r.useState($),v=M?w:te,X=j?Array.isArray(v)?v:[]:typeof v=="string"&&v?[v]:[],[S,re]=r.useState(!1),[C,K]=r.useState(-1),[A,Z]=r.useState(""),Q=r.useRef(null),de=r.useRef(null),ie=r.useRef(null),se=r.useRef(null),J=g&&A?s.filter(u=>u.label.toLowerCase().includes(A.toLowerCase())):s,ve=j?void 0:s.find(u=>u.value===v),Te=j?s.filter(u=>X.includes(u.value)):[],ye=j&&T!==void 0&&X.length>=T,le=r.useCallback(u=>{var N,E;M||W(u),j?(N=n.onChange)==null||N.call(n,u):(E=n.onChange)==null||E.call(n,u)},[M,j,n.onChange]),Be=r.useCallback(u=>{if(j){const N=Array.isArray(v)?v:[];if(N.includes(u))le(N.filter(E=>E!==u));else{if(T!==void 0&&N.length>=T)return;le([...N,u])}}else le(u)},[le,j,T,v]);r.useEffect(()=>{if(!S)return;const u=N=>{var E;(E=Q.current)!=null&&E.contains(N.target)||(re(!1),Z(""))};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[S]),r.useEffect(()=>{if(S){const u=J.findIndex(N=>X.includes(N.value));if(K(u>=0?u:J.findIndex(N=>!N.disabled)),g){const N=setTimeout(()=>{var E;return(E=ie.current)==null?void 0:E.focus()},30);return()=>clearTimeout(N)}}else Z(""),K(-1)},[S]),r.useEffect(()=>{var N;if(!S||C<0)return;const u=(N=se.current)==null?void 0:N.querySelector(`[data-idx="${C}"]`);u==null||u.scrollIntoView({block:"nearest"})},[C,S]);const we=u=>{if(J.length===0)return;let N=C;for(let E=0;E<J.length;E++)if(N=(N+u+J.length)%J.length,!J[N].disabled){K(N);return}},xe=u=>{var N,E;if(!p){if(!S){(u.key==="Enter"||u.key===" "||u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),re(!0));return}if(u.key==="Escape")u.preventDefault(),re(!1),(N=de.current)==null||N.focus();else if(u.key==="ArrowDown")u.preventDefault(),we(1);else if(u.key==="ArrowUp")u.preventDefault(),we(-1);else if(u.key==="Enter"){u.preventDefault();const V=J[C];if(V&&!V.disabled){if(!X.includes(V.value)&&ye)return;Be(V.value),j||(re(!1),(E=de.current)==null||E.focus())}}else if(u.key==="Home"){u.preventDefault();const V=J.findIndex(be=>!be.disabled);V>=0&&K(V)}else if(u.key==="End"){u.preventDefault();for(let V=J.length-1;V>=0;V--)if(!J[V].disabled){K(V);break}}else u.key==="Tab"&&re(!1)}},ce=u=>{var E;u.disabled||!X.includes(u.value)&&ye||(Be(u.value),j||(re(!1),(E=de.current)==null||E.focus()))},ge=u=>{u.stopPropagation(),le(j?[]:"")},We=(u,N)=>{if(u.stopPropagation(),!j)return;const E=Array.isArray(v)?v:[];le(E.filter(V=>V!==N))},je=()=>{if(!j)return;const u=J.filter(V=>!V.disabled).map(V=>V.value),N=Array.from(new Set([...Array.isArray(v)?v:[],...u])),E=T!==void 0?N.slice(0,T):N;le(E)},Ne=j?X.length>0:!!v,m=()=>{var u;if(!Ne)return e.jsx("span",{className:U.triggerPlaceholder,children:e.jsx("span",{className:U.triggerText,children:o})});if(!j)return e.jsxs("span",{className:U.triggerValue,children:[(ve==null?void 0:ve.icon)&&e.jsx("span",{className:U.triggerIcon,children:ve.icon}),e.jsx("span",{className:U.triggerText,children:ve==null?void 0:ve.label})]});if(B==="count"){const N=((u=Te[0])==null?void 0:u.label)??"",E=Te.length-1;return e.jsx("span",{className:U.triggerValue,children:e.jsxs("span",{className:U.triggerText,children:[N,E>0&&e.jsxs("span",{className:U.countMore,children:[", +",E," more"]})]})})}return e.jsx("span",{className:U.chipRow,children:Te.map(N=>e.jsxs("span",{className:U.chip,children:[N.icon&&e.jsx("span",{className:U.chipIcon,children:N.icon}),e.jsx("span",{className:U.chipLabel,children:N.label}),!p&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":`Remove ${N.label}`,className:U.chipRemove,onClick:E=>We(E,N.value),onMouseDown:E=>E.preventDefault(),children:e.jsx(vn,{})})]},N.value))})};return e.jsxs("div",{ref:Q,className:[U.field,l?U.fullWidth:"",p?U.disabled:"",I].filter(Boolean).join(" "),children:[t&&e.jsx("label",{htmlFor:q,className:U.label,children:t}),e.jsxs("div",{className:U.selectWrapper,children:[e.jsxs("button",{ref:de,id:q,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":oe,"aria-invalid":!!i,"aria-multiselectable":j||void 0,disabled:p,className:[U.trigger,U[c],S?U.open:"",i?U.hasError:"",j&&B==="chips"&&X.length>0?U.triggerChips:""].filter(Boolean).join(" "),onClick:()=>!p&&re(u=>!u),onKeyDown:xe,children:[m(),e.jsxs("span",{className:U.triggerActions,children:[b&&Ne&&!p&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Clear selection",className:U.clearBtn,onClick:ge,onMouseDown:u=>u.preventDefault(),children:e.jsx(vn,{})}),e.jsx("span",{className:[U.chevron,S?U.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx(el,{})})]})]}),S&&e.jsxs("div",{className:U.menu,role:"listbox",id:oe,"aria-labelledby":q,"aria-multiselectable":j||void 0,"aria-activedescendant":C>=0?`${q}-opt-${C}`:void 0,children:[g&&e.jsxs("div",{className:U.searchRow,children:[e.jsx("span",{className:U.searchIconWrap,children:e.jsx(tl,{})}),e.jsx("input",{ref:ie,type:"text",className:U.searchInput,placeholder:"Search...",value:A,onChange:u=>{Z(u.target.value),K(0)},onKeyDown:xe})]}),j&&R&&J.length>0&&e.jsxs("div",{className:U.bulkRow,children:[e.jsx("button",{type:"button",className:U.bulkBtn,onClick:je,disabled:T!==void 0&&X.length>=T,children:"Select all"}),e.jsx("button",{type:"button",className:U.bulkBtn,onClick:()=>le([]),disabled:X.length===0,children:"Clear all"}),T!==void 0&&e.jsxs("span",{className:U.bulkCount,children:[X.length," / ",T]})]}),e.jsx("div",{className:U.list,ref:se,role:"presentation",children:J.length===0?e.jsx("div",{className:U.empty,children:"No results"}):J.map((u,N)=>{const E=X.includes(u.value),V=N===C,be=!E&&ye,ue=u.disabled||be;return e.jsxs("div",{id:`${q}-opt-${N}`,role:"option","aria-selected":E,"aria-disabled":ue,"data-idx":N,className:[U.option,E?U.optionSelected:"",V?U.optionActive:"",ue?U.optionDisabled:""].filter(Boolean).join(" "),onClick:()=>!ue&&ce(u),onMouseEnter:()=>!ue&&K(N),children:[j&&e.jsx("span",{className:[U.checkbox,E?U.checkboxChecked:""].filter(Boolean).join(" "),"aria-hidden":"true",children:E&&e.jsx(mn,{})}),u.icon&&e.jsx("span",{className:U.optionIcon,children:u.icon}),e.jsxs("span",{className:U.optionLabel,children:[e.jsx("span",{className:U.optionTitle,children:u.label}),u.description&&e.jsx("span",{className:U.optionDesc,children:u.description})]}),!j&&e.jsx("span",{className:U.check,"aria-hidden":!0,children:E&&e.jsx(mn,{})})]},u.value)})})]}),y&&!j&&e.jsx("input",{type:"hidden",name:y,value:v}),y&&j&&X.map(u=>e.jsx("input",{type:"hidden",name:y,value:u},u))]}),i&&e.jsx("p",{className:U.errorText,children:i}),!i&&a&&e.jsx("p",{className:U.helperText,children:a})]})},sl="_field_sc9v8_16",ol="_fullWidth_sc9v8_24",rl="_disabled_sc9v8_28",al="_trigger_sc9v8_28",il="_label_sc9v8_34",ll="_selectWrapper_sc9v8_41",cl="_open_sc9v8_70",dl="_hasError_sc9v8_74",ul="_sm_sc9v8_86",hl="_md_sc9v8_93",pl="_lg_sc9v8_99",_l="_triggerValue_sc9v8_106",fl="_triggerPlaceholder_sc9v8_107",ml="_triggerText_sc9v8_120",vl="_triggerActions_sc9v8_127",xl="_chip_sc9v8_136",gl="_chipLabel_sc9v8_152",bl="_chipRemove_sc9v8_158",yl="_chipOverflow_sc9v8_174",wl="_clearBtn_sc9v8_188",jl="_chevron_sc9v8_204",kl="_chevronOpen_sc9v8_212",Nl="_menu_sc9v8_224",El="_menuOpen_sc9v8_1",Tl="_searchRow_sc9v8_250",Il="_searchIconWrap_sc9v8_259",$l="_searchInput_sc9v8_265",Cl="_tree_sc9v8_281",Ml="_empty_sc9v8_306",Ll="_row_sc9v8_314",Dl="_rowDisabled_sc9v8_331",Bl="_rowActive_sc9v8_335",Sl="_rowSelected_sc9v8_340",Rl="_rowLabel_sc9v8_343",Al="_indent_sc9v8_353",zl="_indentUnit_sc9v8_359",Pl="_toggle_sc9v8_375",Ol="_toggleOpen_sc9v8_391",Wl="_togglePlaceholder_sc9v8_396",Hl="_spinner_sc9v8_403",Fl="_spin_sc9v8_403",ql="_checkbox_sc9v8_418",Gl="_checkboxChecked_sc9v8_436",Vl="_checkboxMixed_sc9v8_442",Ul="_rowIcon_sc9v8_449",Kl="_rowText_sc9v8_459",Ql="_rowDesc_sc9v8_474",Yl="_match_sc9v8_483",Xl="_check_sc9v8_418",Jl="_menuFooter_sc9v8_502",Zl="_footerBtn_sc9v8_513",ec="_errorText_sc9v8_529",tc="_helperText_sc9v8_536",G={field:sl,fullWidth:ol,disabled:rl,trigger:al,label:il,selectWrapper:ll,open:cl,hasError:dl,sm:ul,md:hl,lg:pl,triggerValue:_l,triggerPlaceholder:fl,triggerText:ml,triggerActions:vl,chip:xl,chipLabel:gl,chipRemove:bl,chipOverflow:yl,clearBtn:wl,chevron:jl,chevronOpen:kl,menu:Nl,menuOpen:El,searchRow:Tl,searchIconWrap:Il,searchInput:$l,tree:Cl,empty:Ml,row:Ll,rowDisabled:Dl,rowActive:Bl,rowSelected:Sl,rowLabel:Rl,indent:Al,indentUnit:zl,toggle:Pl,toggleOpen:Ol,togglePlaceholder:Wl,spinner:Hl,spin:Fl,checkbox:ql,checkboxChecked:Gl,checkboxMixed:Vl,rowIcon:Ul,rowText:Kl,rowDesc:Ql,match:Yl,check:Xl,menuFooter:Jl,footerBtn:Zl,errorText:ec,helperText:tc},nc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),sc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"10",height:"10",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),xn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),oc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"10",height:"10",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 8h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),gn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),rc=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),ac=n=>{const t=new Map,s=new Map,o=new Set,a=(i,c)=>{for(const l of i)t.set(l.value,l),s.set(l.value,c),!l.children||l.children.length===0?l.isLeaf!==!1&&o.add(l.value):a(l.children,l.value)};return a(n,null),{nodeByValue:t,parentByValue:s,leafValues:o}},bt=(n,t=[])=>{if(!n.children||n.children.length===0)return t.push(n.value),t;for(const s of n.children)bt(s,t);return t},ic=(n,t,s)=>{const o=new Set,a=new Set,i=(c,l)=>{let p=!1;for(const g of c){const b=s(g,t),_=g.children?i(g.children,[...l,g.value]):!1;(b||_)&&(o.add(g.value),l.forEach(y=>o.add(y)),p=!0,b&&a.add(g.value))}return p};return i(n,[]),{visible:o,matched:a}},lc=(n,t)=>n.label.toLowerCase().includes(t.toLowerCase()),cc=(n,t)=>{if(!t)return n;const s=n.toLowerCase().indexOf(t.toLowerCase());return s===-1?n:e.jsxs(e.Fragment,{children:[n.slice(0,s),e.jsx("span",{className:G.match,children:n.slice(s,s+t.length)}),n.slice(s+t.length)]})},dc=({data:n,value:t,defaultValue:s,onChange:o,multiple:a=!1,checkStrictly:i=!1,checkedStrategy:c="leaf",expandedKeys:l,defaultExpandedKeys:p,onExpandedChange:g,defaultExpandAll:b=!1,loadChildren:_,searchable:y=!1,filter:I=lc,maxTagCount:j=3,label:B,placeholder:T=a?"Select items":"Select an item",helperText:R,error:O,size:q="md",fullWidth:oe=!1,disabled:w=!1,clearable:D=!1,id:M,name:$,className:te=""})=>{const W=r.useId(),v=M??`evo-tree-${W}`,X=`${v}-tree`,S=t!==void 0,re=r.useMemo(()=>{const h=S?t:s;return h==null?[]:Array.isArray(h)?h:[h]},[]),[C,K]=r.useState(re),A=r.useMemo(()=>S?t==null?[]:Array.isArray(t)?t:[t]:C,[S,t,C]),[Z,Q]=r.useState({}),[de,ie]=r.useState(new Set),se=r.useMemo(()=>{if(Object.keys(Z).length===0)return n;const h=d=>d.map(x=>{const z=Z[x.value]??x.children;return z?{...x,children:h(z)}:x});return h(n)},[n,Z]),J=r.useMemo(()=>ac(se),[se]),ve=r.useMemo(()=>{if(l)return l;if(p)return p;if(b){const h=[],d=x=>x.forEach(k=>{k.children&&k.children.length&&(h.push(k.value),d(k.children))});return d(n),h}return[]},[]),[Te,ye]=r.useState(ve),le=l??Te,Be=r.useMemo(()=>new Set(le),[le]),we=r.useCallback(h=>{l===void 0&&ye(h),g==null||g(h)},[l,g]),[xe,ce]=r.useState(!1),[ge,We]=r.useState(""),[je,Ne]=r.useState(-1),m=r.useRef(null),u=r.useRef(null),N=r.useRef(null),E=r.useRef(null),V=r.useMemo(()=>!y||!ge.trim()?null:ic(se,ge,I),[se,ge,y,I]),be=r.useMemo(()=>V?V.visible:Be,[V,Be]),ue=r.useMemo(()=>{const h=[],d=(x,k)=>{for(const z of x){if(V&&!V.visible.has(z.value))continue;const ee=z.children&&z.children.length>0||z.isLeaf===!1;h.push({node:z,level:k,hasChildren:ee}),ee&&be.has(z.value)&&z.children&&d(z.children,k+1)}};return d(se,0),h},[se,be,V]),Pe=r.useMemo(()=>new Set(A),[A]),ze=r.useCallback(h=>{if(!a||i||!h.children||h.children.length===0)return Pe.has(h.value)?"checked":"unchecked";const d=bt(h);if(d.length===0)return Pe.has(h.value)?"checked":"unchecked";let x=0;for(const k of d)Pe.has(k)&&x++;return x===0?"unchecked":x===d.length?"checked":"mixed"},[a,i,Pe]),He=r.useCallback(h=>{if(!a||i)return Array.from(h);if(c==="leaf")return Array.from(h).filter(k=>J.leafValues.has(k));if(c==="all"){const k=new Set(h),z=ee=>{for(const _e of ee)_e.children&&_e.children.length&&(z(_e.children),bt(_e).every(ke=>h.has(ke))&&k.add(_e.value))};return z(se),Array.from(k)}const d=[],x=k=>{for(const z of k)z.children&&z.children.length?bt(z).every(_e=>h.has(_e))?d.push(z.value):x(z.children):h.has(z.value)&&d.push(z.value)};return x(se),d},[a,i,c,se,J.leafValues]),Le=r.useCallback(h=>{const d=He(h);S||K(d);const x=d.map(k=>J.nodeByValue.get(k)).filter(Boolean);o==null||o(d,x)},[He,S,J.nodeByValue,o]),Qe=r.useCallback(h=>{S||K(h?[h]:[]),o==null||o(h,h?J.nodeByValue.get(h)??null:null)},[S,J.nodeByValue,o]),Ze=r.useMemo(()=>{if(!a||i)return new Set(A);const h=new Set;for(const d of A){const x=J.nodeByValue.get(d);if(!x){h.add(d);continue}!x.children||x.children.length===0?h.add(d):bt(x).forEach(k=>h.add(k))}return h},[A,a,i,J.nodeByValue]),nt=r.useCallback(h=>{if(Be.has(h.value)){we(le.filter(k=>k!==h.value));return}we([...le,h.value]),_&&!Z[h.value]&&(h.isLeaf===!1||!h.children&&h.isLeaf!==!0)&&(ie(k=>new Set(k).add(h.value)),_(h).then(k=>{Q(z=>({...z,[h.value]:k}))}).finally(()=>{ie(k=>{const z=new Set(k);return z.delete(h.value),z})}))},[le,Be,we,_,Z]),Ye=r.useCallback(h=>{var z;if(h.disabled)return;if(!a){Qe(h.value),ce(!1),(z=u.current)==null||z.focus();return}if(i){const ee=new Set(A);ee.has(h.value)?ee.delete(h.value):ee.add(h.value);const _e=Array.from(ee);S||K(_e);const Se=_e.map(ke=>J.nodeByValue.get(ke)).filter(Boolean);o==null||o(_e,Se);return}const d=new Set(Ze),x=ze(h),k=h.children&&h.children.length?bt(h):[h.value];x==="checked"?k.forEach(ee=>d.delete(ee)):k.forEach(ee=>d.add(ee)),Le(d)},[a,i,A,Ze,ze,Le,Qe,S,J.nodeByValue,o]);r.useEffect(()=>{if(!xe)return;const h=d=>{var x;(x=m.current)!=null&&x.contains(d.target)||(ce(!1),We(""))};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[xe]),r.useEffect(()=>{if(xe){const h=ue.findIndex(d=>Pe.has(d.node.value));if(Ne(h>=0?h:ue.findIndex(d=>!d.node.disabled)),y){const d=setTimeout(()=>{var x;return(x=N.current)==null?void 0:x.focus()},30);return()=>clearTimeout(d)}}else We(""),Ne(-1)},[xe]),r.useEffect(()=>{var d;if(!xe||je<0)return;const h=(d=E.current)==null?void 0:d.querySelector(`[data-idx="${je}"]`);h==null||h.scrollIntoView({block:"nearest"})},[je,xe]);const ct=h=>{if(ue.length===0)return;let d=je;for(let x=0;x<ue.length;x++)if(d=(d+h+ue.length)%ue.length,!ue[d].node.disabled){Ne(d);return}},dt=h=>{var x;if(w)return;if(!xe){(h.key==="Enter"||h.key===" "||h.key==="ArrowDown"||h.key==="ArrowUp")&&(h.preventDefault(),ce(!0));return}const d=ue[je];if(h.key==="Escape")h.preventDefault(),ce(!1),(x=u.current)==null||x.focus();else if(h.key==="ArrowDown")h.preventDefault(),ct(1);else if(h.key==="ArrowUp")h.preventDefault(),ct(-1);else if(h.key==="ArrowRight"){if(!d)return;if(h.preventDefault(),d.hasChildren&&!Be.has(d.node.value))nt(d.node);else if(d.hasChildren){const k=je+1;k<ue.length&&ue[k].level>d.level&&Ne(k)}}else if(h.key==="ArrowLeft"){if(!d)return;if(h.preventDefault(),d.hasChildren&&Be.has(d.node.value))nt(d.node);else for(let k=je-1;k>=0;k--)if(ue[k].level<d.level){Ne(k);break}}else if(h.key==="Enter")h.preventDefault(),d&&Ye(d.node);else if(h.key===" "&&a)h.preventDefault(),d&&Ye(d.node);else if(h.key==="Home"){h.preventDefault();const k=ue.findIndex(z=>!z.node.disabled);k>=0&&Ne(k)}else if(h.key==="End"){h.preventDefault();for(let k=ue.length-1;k>=0;k--)if(!ue[k].node.disabled){Ne(k);break}}else h.key==="Tab"&&ce(!1)},kt=h=>{h.stopPropagation(),a?Le(new Set):Qe("")},f=()=>{if(a){const d=A.map(z=>J.nodeByValue.get(z)).filter(Boolean);if(d.length===0)return e.jsx("span",{className:G.triggerPlaceholder,children:e.jsx("span",{className:G.triggerText,children:T})});const x=d.slice(0,j),k=d.length-x.length;return e.jsxs("span",{className:G.triggerValue,children:[x.map(z=>e.jsxs("span",{className:G.chip,children:[e.jsx("span",{className:G.chipLabel,children:z.label}),e.jsx("span",{role:"button","aria-label":`Remove ${z.label}`,tabIndex:-1,className:G.chipRemove,onMouseDown:ee=>ee.preventDefault(),onClick:ee=>{ee.stopPropagation(),Ye(z)},children:e.jsx(gn,{})})]},z.value)),k>0&&e.jsxs("span",{className:G.chipOverflow,children:["+",k]})]})}const h=A[0]?J.nodeByValue.get(A[0]):void 0;return e.jsxs("span",{className:h?G.triggerValue:G.triggerPlaceholder,children:[(h==null?void 0:h.icon)&&e.jsx("span",{className:G.rowIcon,children:h.icon}),e.jsx("span",{className:G.triggerText,children:(h==null?void 0:h.label)??T})]})},L=(h,d)=>{const{node:x,level:k,hasChildren:z}=h,ee=Be.has(x.value),_e=ze(x),Se=!a&&Pe.has(x.value),ke=d===je,Ie=de.has(x.value);return e.jsxs("div",{id:`${v}-row-${d}`,role:"treeitem","aria-level":k+1,"aria-expanded":z?ee:void 0,"aria-selected":a?void 0:Se,"aria-checked":a?_e==="mixed"?"mixed":_e==="checked"?"true":"false":void 0,"aria-disabled":x.disabled,"data-idx":d,className:[G.row,ke?G.rowActive:"",Se?G.rowSelected:"",x.disabled?G.rowDisabled:""].filter(Boolean).join(" "),onClick:()=>Ye(x),onMouseEnter:()=>!x.disabled&&Ne(d),children:[e.jsx("span",{className:G.indent,"aria-hidden":!0,children:Array.from({length:k}).map(($e,Re)=>e.jsx("span",{className:G.indentUnit},Re))}),z?Ie?e.jsx("span",{className:G.toggle,"aria-hidden":!0,children:e.jsx("span",{className:G.spinner})}):e.jsx("span",{className:[G.toggle,ee?G.toggleOpen:""].filter(Boolean).join(" "),role:"button",tabIndex:-1,"aria-label":ee?"Collapse":"Expand",onClick:$e=>{$e.stopPropagation(),nt(x)},onMouseDown:$e=>$e.preventDefault(),children:e.jsx(sc,{})}):e.jsx("span",{className:G.togglePlaceholder,"aria-hidden":!0}),a&&e.jsxs("span",{className:[G.checkbox,_e==="checked"?G.checkboxChecked:"",_e==="mixed"?G.checkboxMixed:""].filter(Boolean).join(" "),"aria-hidden":!0,children:[_e==="checked"&&e.jsx(xn,{}),_e==="mixed"&&e.jsx(oc,{})]}),x.icon&&e.jsx("span",{className:G.rowIcon,children:x.icon}),e.jsxs("span",{className:G.rowText,children:[e.jsx("span",{className:G.rowLabel,children:ge?cc(x.label,ge):x.label}),x.description&&e.jsx("span",{className:G.rowDesc,children:x.description})]}),!a&&Se&&e.jsx("span",{className:G.check,"aria-hidden":!0,children:e.jsx(xn,{})})]},x.value)},F=A.length>0,Y=a?A.join(","):A[0]??"";return e.jsxs("div",{ref:m,className:[G.field,oe?G.fullWidth:"",w?G.disabled:"",te].filter(Boolean).join(" "),children:[B&&e.jsx("label",{htmlFor:v,className:G.label,children:B}),e.jsxs("div",{className:G.selectWrapper,children:[e.jsxs("button",{ref:u,id:v,type:"button",role:"combobox","aria-haspopup":"tree","aria-expanded":xe,"aria-controls":X,"aria-invalid":!!O,disabled:w,className:[G.trigger,G[q],xe?G.open:"",O?G.hasError:""].filter(Boolean).join(" "),onClick:()=>!w&&ce(h=>!h),onKeyDown:dt,children:[f(),e.jsxs("span",{className:G.triggerActions,children:[D&&F&&!w&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Clear selection",className:G.clearBtn,onClick:kt,onMouseDown:h=>h.preventDefault(),children:e.jsx(gn,{})}),e.jsx("span",{className:[G.chevron,xe?G.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx(nc,{})})]})]}),xe&&e.jsxs("div",{className:G.menu,children:[y&&e.jsxs("div",{className:G.searchRow,children:[e.jsx("span",{className:G.searchIconWrap,children:e.jsx(rc,{})}),e.jsx("input",{ref:N,type:"text",className:G.searchInput,placeholder:"Search...",value:ge,onChange:h=>{We(h.target.value),Ne(0)},onKeyDown:dt})]}),e.jsx("div",{ref:E,className:G.tree,role:"tree",id:X,"aria-labelledby":v,"aria-multiselectable":a||void 0,"aria-activedescendant":je>=0?`${v}-row-${je}`:void 0,children:ue.length===0?e.jsx("div",{className:G.empty,children:"No results"}):ue.map((h,d)=>L(h,d))}),a&&F&&e.jsxs("div",{className:G.menuFooter,children:[e.jsxs("span",{children:[A.length," selected"]}),e.jsx("button",{type:"button",className:G.footerBtn,onClick:()=>Le(new Set),children:"Clear all"})]})]}),$&&e.jsx("input",{type:"hidden",name:$,value:Y})]}),O&&e.jsx("p",{className:G.errorText,children:O}),!O&&R&&e.jsx("p",{className:G.helperText,children:R})]})},uc="_field_1i6oh_7",hc="_fullWidth_1i6oh_15",pc="_disabled_1i6oh_19",_c="_inputWrapper_1i6oh_19",fc="_label_1i6oh_25",mc="_acWrapper_1i6oh_33",vc="_open_1i6oh_57",xc="_hasError_1i6oh_61",gc="_sm_1i6oh_69",bc="_md_1i6oh_74",yc="_lg_1i6oh_79",wc="_searchIconWrap_1i6oh_85",jc="_input_1i6oh_19",kc="_actions_1i6oh_119",Nc="_statusIcon_1i6oh_126",Ec="_clearBtn_1i6oh_132",Tc="_spinner_1i6oh_152",Ic="_evoAcSpin_1i6oh_1",$c="_menu_1i6oh_169",Cc="_evoAcMenuOpen_1i6oh_1",Mc="_sectionHeader_1i6oh_200",Lc="_recoveryBox_1i6oh_216",Dc="_list_1i6oh_227",Bc="_empty_1i6oh_252",Sc="_statusRow_1i6oh_253",Rc="_option_1i6oh_268",Ac="_optionActive_1i6oh_290",zc="_optionDisabled_1i6oh_290",Pc="_optionSelected_1i6oh_294",Oc="_optionTitle_1i6oh_297",Wc="_optionRecovery_1i6oh_306",Hc="_optionIcon_1i6oh_310",Fc="_optionLabel_1i6oh_321",qc="_optionDesc_1i6oh_336",Gc="_mark_1i6oh_346",Vc="_check_1i6oh_353",Uc="_errorText_1i6oh_364",Kc="_helperText_1i6oh_371",ae={field:uc,fullWidth:hc,disabled:pc,inputWrapper:_c,label:fc,acWrapper:mc,open:vc,hasError:xc,sm:gc,md:bc,lg:yc,searchIconWrap:wc,input:jc,actions:kc,statusIcon:Nc,clearBtn:Ec,spinner:Tc,evoAcSpin:Ic,menu:$c,evoAcMenuOpen:Cc,sectionHeader:Mc,recoveryBox:Lc,list:Dc,empty:Bc,statusRow:Sc,option:Rc,optionActive:Ac,optionDisabled:zc,optionSelected:Pc,optionTitle:Oc,optionRecovery:Wc,optionIcon:Hc,optionLabel:Fc,optionDesc:qc,mark:Gc,check:Vc,errorText:Uc,helperText:Kc},Qc=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Yc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),Xc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),bn=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 4.5V8l2.5 1.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),Jc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M8 1.5l1.6 4.9 4.9 1.6-4.9 1.6L8 14.5l-1.6-4.9L1.5 8l4.9-1.6L8 1.5z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})}),yn=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",className:ae.spinner,children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"0.25"}),e.jsx("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),wn=new Map,Zc=n=>({get:()=>wn.get(n)??[],set:t=>{wn.set(n,t)}}),ed=n=>({get:()=>{if(typeof window>"u")return[];try{const t=window.localStorage.getItem(`evo-recents:${n}`),s=t?JSON.parse(t):[];return Array.isArray(s)?s.filter(o=>typeof o=="string"):[]}catch{return[]}},set:t=>{if(!(typeof window>"u"))try{window.localStorage.setItem(`evo-recents:${n}`,JSON.stringify(t))}catch{}}});function jn(n,t){const s=n.length,o=t.length;if(s===0)return o;if(o===0)return s;let a=Array.from({length:o+1},(c,l)=>l),i=new Array(o+1);for(let c=1;c<=s;c++){i[0]=c;for(let l=1;l<=o;l++){const p=n[c-1]===t[l-1]?0:1;i[l]=Math.min(a[l]+1,i[l-1]+1,a[l-1]+p)}[a,i]=[i,a]}return a[o]}function td(n,t){const s=t.trim().toLowerCase();if(s.length<2)return null;let o=null,a=1/0;for(const c of n){if(c.disabled)continue;const l=c.label.toLowerCase(),p=Math.min(jn(s,l),jn(s,l.slice(0,s.length)));p<a&&(a=p,o=c)}if(!o)return null;const i=Math.max(1,Math.min(3,Math.round(s.length*.4)));return a<=i?{option:o,distance:a}:null}function nd(n,t){const s=t.trim();if(!s)return n;const o=n.toLowerCase().indexOf(s.toLowerCase());return o<0?n:e.jsxs(e.Fragment,{children:[n.slice(0,o),e.jsx("mark",{className:ae.mark,children:n.slice(o,o+s.length)}),n.slice(o+s.length)]})}const Kn=r.forwardRef(({options:n,value:t,defaultValue:s=null,onChange:o,inputValue:a,onInputChange:i,label:c,placeholder:l="Search…",helperText:p,error:g,size:b="md",fullWidth:_=!1,disabled:y=!1,clearable:I=!0,loading:j=!1,debounce:B=0,minChars:T=0,maxResults:R=50,filter:O,highlightMatch:q=!0,openOnFocus:oe=!0,emptyMessage:w="No results",smartRecovery:D=!1,recents:M=!1,renderOption:$,id:te,name:W,className:v="",...X},S)=>{const re=r.useId(),C=te??`evo-autocomplete-${re}`,K=`${C}-listbox`,A=t!==void 0,[Z,Q]=r.useState(s),de=A?t:Z,ie=r.useMemo(()=>n.find(d=>d.value===de)??null,[n,de]),se=a!==void 0,[J,ve]=r.useState(()=>{var d;return((d=n.find(x=>x.value===s))==null?void 0:d.label)??""}),Te=se?a:J,ye=r.useMemo(()=>{if(!M)return null;const d={max:5,storage:Zc(W??C),label:"Recent"};return typeof M=="object"?{...d,...M}:d},[M,W,C]),[le,Be]=r.useState(()=>(ye==null?void 0:ye.storage.get())??[]),[we,xe]=r.useState(!1),[ce,ge]=r.useState(0),We=r.useRef(null),je=r.useRef(null),Ne=r.useRef(null),m=r.useRef(null),u=r.useCallback(d=>{je.current=d,typeof S=="function"?S(d):S&&(S.current=d)},[S]),E=Te.trim(),V=E.length>0&&E.length<T,be=!!ye&&E.length===0&&le.length>0,ue=r.useMemo(()=>be?le.map(d=>n.find(x=>x.value===d)).filter(d=>!!d&&!d.disabled).slice(0,ye.max):[],[be,le,n,ye]),Pe=r.useMemo(()=>{if(V)return[];if(O===!1||E.length===0)return n.slice(0,R);const d=typeof O=="function"?O:(x,k)=>x.label.toLowerCase().includes(k.toLowerCase());return n.filter(x=>d(x,E)).slice(0,R)},[n,O,E,V,R]),ze=be?ue:Pe,He=r.useMemo(()=>!D||j||V||be||ze.length>0||E.length===0?null:td(n,E),[D,j,V,be,ze.length,E,n]),Le=He?[He.option]:ze;r.useEffect(()=>{if(!we)return;const d=x=>{var k;(k=We.current)!=null&&k.contains(x.target)||Ye()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[we]),r.useEffect(()=>{var x;if(!we)return;const d=(x=Ne.current)==null?void 0:x.querySelector(`[data-idx="${ce}"]`);d==null||d.scrollIntoView({block:"nearest"})},[ce,we]),r.useEffect(()=>{we||se||ve((ie==null?void 0:ie.label)??"")},[de]),r.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const Qe=r.useCallback(d=>{i&&(B>0?(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>i(d),B)):i(d))},[i,B]),Ze=r.useCallback((d,x)=>{A||Q(d),o==null||o(d,x)},[A,o]),nt=r.useCallback(d=>{ye&&Be(x=>{const k=[d,...x.filter(z=>z!==d)].slice(0,ye.max);return ye.storage.set(k),k})},[ye]),Ye=r.useCallback(()=>{xe(!1),ge(0),!se&&ie&&ve(ie.label)},[se,ie]),ct=r.useCallback(d=>{var x;d.disabled||(Ze(d.value,d),se||ve(d.label),Qe(d.label),nt(d.value),xe(!1),ge(0),(x=je.current)==null||x.focus())},[Ze,se,Qe,nt]),dt=d=>{const x=d.target.value;se||ve(x),Qe(x),ie&&x!==ie.label&&Ze(null,null),ge(0),we||xe(!0)},kt=()=>{var d;se||ve(""),Qe(""),Ze(null,null),ge(0),(d=je.current)==null||d.focus(),xe(!0)},f=d=>{if(Le.length===0)return;let x=ce;for(let k=0;k<Le.length;k++)if(x=(x+d+Le.length)%Le.length,!Le[x].disabled){ge(x);return}},L=d=>{if(!y){if(!we){(d.key==="ArrowDown"||d.key==="ArrowUp")&&(d.preventDefault(),xe(!0));return}switch(d.key){case"ArrowDown":d.preventDefault(),f(1);break;case"ArrowUp":d.preventDefault(),f(-1);break;case"Home":d.preventDefault(),ge(Le.findIndex(x=>!x.disabled));break;case"End":d.preventDefault();for(let x=Le.length-1;x>=0;x--)if(!Le[x].disabled){ge(x);break}break;case"Enter":{const x=Le[ce];x&&!x.disabled&&(d.preventDefault(),ct(x));break}case"Escape":d.preventDefault(),Ye();break;case"Tab":Ye();break}}},F=ae[b],Y=we&&Le[ce]?`${C}-opt-${ce}`:void 0,h=(d,x,k)=>{const z=x===ce,ee=d.value===de;return e.jsx("div",{id:`${C}-opt-${x}`,role:"option","aria-selected":ee,"aria-disabled":d.disabled||void 0,"data-idx":x,className:[ae.option,z?ae.optionActive:"",ee?ae.optionSelected:"",d.disabled?ae.optionDisabled:"",k==="recovery"?ae.optionRecovery:""].filter(Boolean).join(" "),onClick:()=>ct(d),onMouseEnter:()=>!d.disabled&&ge(x),children:$?$(d,{active:z,query:E}):e.jsxs(e.Fragment,{children:[k==="recent"&&e.jsx("span",{className:ae.optionIcon,"aria-hidden":"true",children:e.jsx(bn,{})}),k!=="recent"&&d.icon&&e.jsx("span",{className:ae.optionIcon,"aria-hidden":"true",children:d.icon}),e.jsxs("span",{className:ae.optionLabel,children:[e.jsx("span",{className:ae.optionTitle,children:q&&k==="option"?nd(d.label,E):d.label}),d.description&&e.jsx("span",{className:ae.optionDesc,children:d.description})]}),ee&&e.jsx("span",{className:ae.check,"aria-hidden":"true",children:e.jsx(Xc,{})})]})},`${k}-${d.value}`)};return e.jsxs("div",{ref:We,className:[ae.field,_?ae.fullWidth:"",y?ae.disabled:"",v].filter(Boolean).join(" "),children:[c&&e.jsx("label",{htmlFor:C,className:ae.label,children:c}),e.jsxs("div",{className:ae.acWrapper,children:[e.jsxs("div",{className:[ae.inputWrapper,F,we?ae.open:"",g?ae.hasError:""].filter(Boolean).join(" "),children:[e.jsx("span",{className:ae.searchIconWrap,"aria-hidden":"true",children:e.jsx(Qc,{})}),e.jsx("input",{...X,ref:u,id:C,type:"text",role:"combobox",autoComplete:"off","aria-autocomplete":"list","aria-expanded":we,"aria-controls":K,"aria-activedescendant":Y,"aria-invalid":!!g||void 0,"aria-describedby":g?`${C}-error`:p?`${C}-helper`:void 0,className:ae.input,placeholder:l,value:Te,disabled:y,onChange:dt,onKeyDown:L,onFocus:()=>oe&&!y&&xe(!0)}),e.jsxs("span",{className:ae.actions,children:[j&&e.jsx("span",{className:ae.statusIcon,"aria-hidden":"true",children:e.jsx(yn,{})}),I&&!y&&(Te.length>0||de)&&e.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Clear",className:ae.clearBtn,onClick:kt,onMouseDown:d=>d.preventDefault(),children:e.jsx(Yc,{})})]})]}),we&&e.jsx("div",{className:ae.menu,role:"listbox",id:K,"aria-label":c??"Suggestions",children:j?e.jsxs("div",{className:ae.statusRow,children:[e.jsx(yn,{}),e.jsx("span",{children:"Loading…"})]}):V?e.jsxs("div",{className:ae.empty,children:["Type ",T-E.length," more character",T-E.length===1?"":"s","…"]}):He?e.jsxs("div",{className:ae.recoveryBox,children:[e.jsxs("div",{className:ae.sectionHeader,children:[e.jsx(Jc,{}),e.jsxs("span",{children:["No exact match — did you mean",He.distance===1?" this":"","?"]})]}),e.jsx("div",{className:ae.list,ref:Ne,role:"presentation",children:h(He.option,0,"recovery")})]}):Le.length>0?e.jsxs(e.Fragment,{children:[be&&e.jsxs("div",{className:ae.sectionHeader,children:[e.jsx(bn,{}),e.jsx("span",{children:ye.label})]}),e.jsx("div",{className:ae.list,ref:Ne,role:"presentation",children:Le.map((d,x)=>h(d,x,be?"recent":"option"))})]}):E.length===0?e.jsx("div",{className:ae.empty,children:"Type to search…"}):e.jsx("div",{className:ae.empty,children:w})}),W&&e.jsx("input",{type:"hidden",name:W,value:de??""})]}),g&&e.jsx("p",{id:`${C}-error`,className:ae.errorText,children:g}),!g&&p&&e.jsx("p",{id:`${C}-helper`,className:ae.helperText,children:p})]})});Kn.displayName="EvoAutoComplete";const sd="_group_ufbfw_1",od="_groupLabel_ufbfw_10",rd="_checkbox_ufbfw_18",ad="_disabled_ufbfw_23",id="_input_ufbfw_28",ld="_label_ufbfw_35",cd="_checkmark_ufbfw_35",dd="_labelText_ufbfw_100",ud="_helperText_ufbfw_105",et={group:sd,groupLabel:od,checkbox:rd,disabled:ad,input:id,label:ld,checkmark:cd,labelText:dd,helperText:ud},hd=({children:n,label:t,className:s=""})=>e.jsxs("fieldset",{className:`${et.group} ${s}`,children:[t&&e.jsx("legend",{className:et.groupLabel,children:t}),n]}),Qn=({label:n,helperText:t,indeterminate:s=!1,className:o="",disabled:a,id:i,...c})=>{const l=r.useRef(null);r.useEffect(()=>{l.current&&(l.current.indeterminate=s)},[s]);const p=i??(n==null?void 0:n.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:[et.checkbox,a?et.disabled:"",o].filter(Boolean).join(" "),children:[e.jsx("input",{type:"checkbox",id:p,ref:l,disabled:a,className:et.input,...c}),e.jsxs("label",{htmlFor:p,className:et.label,children:[e.jsx("span",{className:et.checkmark}),e.jsx("span",{className:et.labelText,children:n})]}),t&&e.jsx("p",{className:et.helperText,children:t})]})};Qn.Group=hd;const pd="_group_1oqsu_1",_d="_groupLabel_1oqsu_10",fd="_radio_1oqsu_18",md="_disabled_1oqsu_22",vd="_input_1oqsu_27",xd="_label_1oqsu_34",gd="_radiomark_1oqsu_34",bd="_labelText_1oqsu_78",at={group:pd,groupLabel:_d,radio:fd,disabled:md,input:vd,label:xd,radiomark:gd,labelText:bd},Yn=r.createContext(null),yd=({children:n,name:t,value:s,onChange:o,label:a,className:i=""})=>e.jsx(Yn.Provider,{value:{name:t,value:s,onChange:o},children:e.jsxs("fieldset",{className:`${at.group} ${i}`,children:[a&&e.jsx("legend",{className:at.groupLabel,children:a}),n]})}),Xn=({value:n,label:t,disabled:s=!1,className:o=""})=>{const a=r.useContext(Yn),i=a?a.value===n:!1,c=`${(a==null?void 0:a.name)??"radio"}-${n}`;return e.jsxs("div",{className:[at.radio,s?at.disabled:"",o].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",id:c,name:a==null?void 0:a.name,value:n,checked:i,disabled:s,className:at.input,onChange:()=>a==null?void 0:a.onChange(n)}),e.jsxs("label",{htmlFor:c,className:at.label,children:[e.jsx("span",{className:at.radiomark}),e.jsx("span",{className:at.labelText,children:t})]})]})};Xn.Group=yd;const wd="_toggleWrapper_ke3d2_1",jd="_disabled_ke3d2_8",kd="_hiddenInput_ke3d2_14",Nd="_track_ke3d2_21",Ed="_sm_ke3d2_29",Td="_md_ke3d2_33",Id="_lg_ke3d2_37",$d="_on_ke3d2_41",Cd="_thumb_ke3d2_45",Md="_label_ke3d2_55",rt={toggleWrapper:wd,disabled:jd,hiddenInput:kd,track:Nd,sm:Ed,md:Td,lg:Id,on:$d,thumb:Cd,label:Md},kn={sm:"0.75rem",md:"1rem",lg:"1.25rem"},Ld={sm:"0.75rem",md:"1rem",lg:"1.25rem"},Dd=({checked:n,onChange:t,label:s,disabled:o=!1,size:a="md",className:i=""})=>e.jsxs("label",{className:[rt.toggleWrapper,o?rt.disabled:"",i].filter(Boolean).join(" "),children:[e.jsx("input",{type:"checkbox",role:"switch",className:rt.hiddenInput,checked:n,disabled:o,onChange:c=>t(c.target.checked)}),e.jsx("span",{className:[rt.track,rt[a],n?rt.on:""].filter(Boolean).join(" "),children:e.jsx("span",{className:rt.thumb,style:{width:kn[a],height:kn[a],transform:n?`translateX(${Ld[a]})`:"translateX(0)"}})}),s&&e.jsx("span",{className:rt.label,children:s})]}),Bd="_form_1cylw_1",Sd="_form_sm_1cylw_10",Rd="_form_md_1cylw_15",Ad="_form_lg_1cylw_20",zd="_header_1cylw_25",Pd="_headerBadge_1cylw_33",Od="_headerTitle_1cylw_47",Wd="_headerDesc_1cylw_56",Hd="_section_1cylw_63",Fd="_sectionHead_1cylw_74",qd="_sectionTitle_1cylw_93",Gd="_sectionDesc_1cylw_102",Vd="_sectionBody_1cylw_109",Ud="_section_split_1cylw_116",Kd="_row_1cylw_130",Qd="_row_sm_1cylw_139",Yd="_row_md_1cylw_143",Xd="_row_lg_1cylw_147",Jd="_row_align_start_1cylw_151",Zd="_row_align_center_1cylw_155",eu="_row_align_end_1cylw_159",tu="_field_1cylw_163",nu="_fieldLabel_1cylw_170",su="_fieldRequired_1cylw_180",ou="_fieldControl_1cylw_186",ru="_fieldDesc_1cylw_191",au="_fieldError_1cylw_198",iu="_field_error_1cylw_217",lu="_actions_1cylw_221",cu="_actions_divider_1cylw_229",du="_actions_left_1cylw_235",uu="_actions_right_1cylw_239",hu="_actions_center_1cylw_243",pu="_actions_between_1cylw_247",me={form:Bd,form_sm:Sd,form_md:Rd,form_lg:Ad,header:zd,headerBadge:Pd,headerTitle:Od,headerDesc:Wd,section:Hd,sectionHead:Fd,sectionTitle:qd,sectionDesc:Gd,sectionBody:Vd,section_split:Ud,row:Kd,row_sm:Qd,row_md:Yd,row_lg:Xd,row_align_start:Jd,row_align_center:Zd,row_align_end:eu,field:tu,fieldLabel:nu,fieldRequired:su,fieldControl:ou,fieldDesc:ru,fieldError:au,field_error:iu,actions:lu,actions_divider:cu,actions_left:du,actions_right:uu,actions_center:hu,actions_between:pu},Jn=r.createContext({}),_u=()=>r.useContext(Jn),vt=(...n)=>n.filter(Boolean).join(" "),jt=({children:n,disabled:t=!1,size:s="md",layout:o="vertical",maxWidth:a,className:i="",style:c,...l})=>e.jsx(Jn.Provider,{value:{disabled:t,size:s,layout:o},children:e.jsx("form",{className:vt(me.form,me[`form_${s}`],me[`form_${o}`],i),style:a!==void 0?{maxWidth:a,...c}:c,...l,children:n})}),fu=({title:n,description:t,badge:s,children:o,className:a=""})=>e.jsxs("header",{className:vt(me.header,a),children:[s&&e.jsx("div",{className:me.headerBadge,children:s}),n&&e.jsx("h2",{className:me.headerTitle,children:n}),t&&e.jsx("p",{className:me.headerDesc,children:t}),o]}),mu=({title:n,description:t,variant:s="stacked",children:o,className:a=""})=>e.jsxs("section",{className:vt(me.section,me[`section_${s}`],a),children:[(n||t)&&e.jsxs("div",{className:me.sectionHead,children:[n&&e.jsx("h3",{className:me.sectionTitle,children:n}),t&&e.jsx("p",{className:me.sectionDesc,children:t})]}),e.jsx("div",{className:me.sectionBody,children:o})]}),vu=({children:n,gap:t="md",align:s="start",className:o=""})=>e.jsx("div",{className:vt(me.row,me[`row_${t}`],me[`row_align_${s}`],o),children:n}),xu=({children:n,label:t,description:s,error:o,required:a,htmlFor:i,className:c=""})=>{const l=r.useId(),p=i??`evo-field-${l}`;return t||s||o?e.jsxs("div",{className:vt(me.field,o?me.field_error:"",c),children:[t&&e.jsxs("label",{htmlFor:p,className:me.fieldLabel,children:[t,a&&e.jsx("span",{className:me.fieldRequired,"aria-hidden":"true",children:"*"})]}),e.jsx("div",{className:me.fieldControl,children:n}),o?e.jsx("p",{className:me.fieldError,role:"alert",children:o}):s?e.jsx("p",{className:me.fieldDesc,children:s}):null]}):e.jsx("div",{className:vt(me.field,c),children:n})},gu=({children:n,align:t="right",divider:s=!0,className:o=""})=>e.jsx("div",{className:vt(me.actions,me[`actions_${t}`],s?me.actions_divider:"",o),children:n});jt.Header=fu;jt.Section=mu;jt.Row=vu;jt.Field=xu;jt.Actions=gu;const bu="_overlay_118t4_19",yu="_overlayFadeIn_118t4_1",wu="_dialog_118t4_32",ju="_dialogSlideUp_118t4_1",ku="_sm_118t4_45",Nu="_md_118t4_48",Eu="_lg_118t4_51",Tu="_fullscreen_118t4_54",Iu="_header_118t4_60",$u="_headerContent_118t4_70",Cu="_closeBtn_118t4_78",Mu="_body_118t4_98",Lu="_footer_118t4_108",it={overlay:bu,overlayFadeIn:yu,dialog:wu,dialogSlideUp:ju,sm:ku,md:Nu,lg:Eu,fullscreen:Tu,header:Iu,headerContent:$u,closeBtn:Cu,body:Mu,footer:Lu},Du=({children:n,onClose:t})=>e.jsxs("div",{className:it.header,children:[e.jsx("div",{className:it.headerContent,children:n}),t&&e.jsx("button",{className:it.closeBtn,onClick:t,"aria-label":"Close modal",children:"✕"})]}),Bu=({children:n})=>e.jsx("div",{className:it.body,children:n}),Su=({children:n})=>e.jsx("div",{className:it.footer,children:n}),Rt=({open:n,onClose:t,children:s,size:o="md",className:a=""})=>(r.useEffect(()=>{if(n)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[n]),r.useEffect(()=>{if(!n)return;const i=c=>{c.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n,t]),n?Nn.createPortal(e.jsx("div",{className:it.overlay,onClick:i=>{i.target===i.currentTarget&&t()},children:e.jsx("div",{className:[it.dialog,it[o],a].filter(Boolean).join(" "),role:"dialog","aria-modal":"true",children:s})}),document.body):null);Rt.Header=Du;Rt.Body=Bu;Rt.Footer=Su;const Ru="_toasterRoot_izzak_61",Au="_srOnly_izzak_68",zu="_anchor_izzak_80",Pu="_overflowPill_izzak_145",Ou="_toast_izzak_61",Wu="_evoToastEnterRight_izzak_1",Hu="_evoToastEnterLeft_izzak_1",Fu="_evoToastEnterTop_izzak_1",qu="_evoToastEnterBottom_izzak_1",Gu="_exiting_izzak_207",Vu="_evoToastExit_izzak_1",Uu="_noMotion_izzak_211",Ku="_toastIcon_izzak_227",Qu="_toastBody_izzak_269",Yu="_toastTitle_izzak_274",Xu="_toastDescription_izzak_279",Ju="_toastCount_izzak_285",Zu="_toastProgressTrack_izzak_303",eh="_toastProgressFill_izzak_315",th="_toastAction_izzak_348",nh="_toastClose_izzak_371",sh="_bellWrapper_izzak_392",oh="_bell_izzak_392",rh="_bellOpen_izzak_442",ah="_bellBadge_izzak_446",ih="_bellBadgeZero_izzak_465",lh="_bellPanelHost_izzak_470",ch="_panel_izzak_514",dh="_evoPanelEnter_izzak_1",uh="_panelHeader_izzak_532",hh="_panelTitle_izzak_541",ph="_panelHeaderActions_izzak_546",_h="_panelMarkAll_izzak_552",fh="_panelClose_izzak_572",mh="_panelBody_izzak_591",vh="_panelState_izzak_595",xh="_panelStateError_izzak_605",gh="_itemList_izzak_609",bh="_emptyState_izzak_621",yh="_emptyIcon_izzak_630",wh="_emptyTitle_izzak_641",jh="_emptyHint_izzak_647",kh="_item_izzak_609",Nh="_itemUnread_izzak_661",Eh="_itemInteractive_izzak_665",Th="_itemUnreadDot_izzak_676",Ih="_itemMedia_izzak_690",$h="_itemAvatar_izzak_716",Ch="_itemMediaGlyph_izzak_722",Mh="_itemBody_izzak_726",Lh="_itemTitle_izzak_731",Dh="_itemDescription_izzak_738",Bh="_itemMeta_izzak_749",Sh="_itemTimestamp_izzak_758",Rh="_itemAction_izzak_762",Ah="_itemDismiss_izzak_782",P={toasterRoot:Ru,srOnly:Au,anchor:zu,"anchor-top-left":"_anchor-top-left_izzak_94","anchor-top-center":"_anchor-top-center_izzak_101","anchor-top-right":"_anchor-top-right_izzak_109","anchor-bottom-left":"_anchor-bottom-left_izzak_116","anchor-bottom-center":"_anchor-bottom-center_izzak_122","anchor-bottom-right":"_anchor-bottom-right_izzak_129",overflowPill:Pu,toast:Ou,evoToastEnterRight:Wu,evoToastEnterLeft:Hu,evoToastEnterTop:Fu,evoToastEnterBottom:qu,exiting:Gu,evoToastExit:Vu,noMotion:Uu,"sev-success":"_sev-success_izzak_224",toastIcon:Ku,"sev-error":"_sev-error_izzak_232","sev-warning":"_sev-warning_izzak_240","sev-info":"_sev-info_izzak_248",toastBody:Qu,toastTitle:Yu,toastDescription:Xu,toastCount:Ju,toastProgressTrack:Zu,toastProgressFill:eh,toastAction:th,toastClose:nh,bellWrapper:sh,bell:oh,"bell-ghost":"_bell-ghost_izzak_418","bell-solid":"_bell-solid_izzak_422","bell-sm":"_bell-sm_izzak_427","bell-md":"_bell-md_izzak_432","bell-lg":"_bell-lg_izzak_437",bellOpen:rh,bellBadge:ah,bellBadgeZero:ih,bellPanelHost:lh,"place-bottom-end":"_place-bottom-end_izzak_488","place-bottom-start":"_place-bottom-start_izzak_493","place-bottom":"_place-bottom_izzak_488","place-top-end":"_place-top-end_izzak_504","place-top-start":"_place-top-start_izzak_509",panel:ch,evoPanelEnter:dh,panelHeader:uh,panelTitle:hh,panelHeaderActions:ph,panelMarkAll:_h,panelClose:fh,panelBody:mh,panelState:vh,panelStateError:xh,itemList:gh,emptyState:bh,emptyIcon:yh,emptyTitle:wh,emptyHint:jh,item:kh,itemUnread:Nh,itemInteractive:Eh,itemUnreadDot:Th,itemMedia:Ih,itemAvatar:$h,itemMediaGlyph:Ch,itemBody:Mh,itemTitle:Lh,itemDescription:Dh,itemMeta:Bh,itemTimestamp:Sh,itemAction:Rh,itemDismiss:Ah},Zn={defaultAnchor:"top-right",defaultDuration:4e3,maxVisible:3,pauseOnFocusLoss:!0,persistErrors:!1},zh=180,Ph=Object.freeze([]),Oh=Object.freeze({items:Object.freeze([]),unread:0});class Wh{constructor(){this.toasts=[],this.inboxItems=[],this.inboxSnapshot={items:[],unread:0},this.inboxOwnedExternally=!1,this.inboxOnChange=null,this.toastListeners=new Set,this.inboxListeners=new Set,this.configListeners=new Set,this.config=Zn,this.counter=0}setConfig(t){const s={...this.config,...t};Object.keys(s).some(a=>s[a]!==this.config[a])&&(this.config=s,this.notifyConfig())}getConfig(){return this.config}subscribeConfig(t){return this.configListeners.add(t),()=>{this.configListeners.delete(t)}}notifyConfig(){this.configListeners.forEach(t=>t())}resolveDuration(t,s){return t.persistent===!0?1/0:t.duration!=null?t.duration:s==="error"&&this.config.persistErrors&&t.persistent!==!1?1/0:this.config.defaultDuration}bindExternalInbox(t,s){t!==void 0?(this.inboxOwnedExternally=!0,this.inboxItems=t,this.inboxOnChange=s??null,this.refreshInboxSnapshot(),this.notifyInbox()):(this.inboxOwnedExternally=!1,this.inboxOnChange=null)}refreshInboxSnapshot(){let t=0;for(const s of this.inboxItems)s.read||(t+=1);this.inboxSnapshot={items:this.inboxItems,unread:t}}nextId(){return this.counter+=1,`evo-${Date.now().toString(36)}-${this.counter}`}pushToast(t,s={}){const o=s.severity??"info";if(s.groupKey!=null&&s.id==null){const l=this.toasts.find(p=>p.groupKey===s.groupKey&&!p.exiting);if(l)return this.toasts=this.toasts.map(p=>p.id===l.id?{...p,...s,id:l.id,severity:o,duration:this.resolveDuration(s,o),message:t,count:p.count+1,restartKey:p.restartKey+1}:p),this.applyInboxSideEffect(l.id,t,s),this.notifyToasts(),l.id}const a=s.id??this.nextId(),i=this.resolveDuration(s,o);if(this.toasts.find(l=>l.id===a))this.toasts=this.toasts.map(l=>l.id===a?{...l,...s,id:a,severity:o,duration:i,message:t,restartKey:l.restartKey+1,exiting:!1}:l);else{const l={...s,id:a,severity:o,duration:i,message:t,createdAt:Date.now(),count:1,restartKey:0};this.toasts=[...this.toasts,l]}return this.applyInboxSideEffect(a,t,s),this.notifyToasts(),a}applyInboxSideEffect(t,s,o){if(!o.inbox)return;const a={id:`${t}-inbox`,title:o.title??s,description:o.description,severity:o.severity??"info",icon:o.icon,action:o.action,...typeof o.inbox=="object"?o.inbox:{}};this.pushInbox(a)}updateToast(t,s){const o=this.toasts.findIndex(c=>c.id===t);if(o===-1)return;const a=this.toasts[o],i={...a,...s,id:t,severity:s.severity??a.severity,message:"title"in s&&s.title!=null?s.title:a.message,restartKey:a.restartKey+1};s.persistent===!0?i.duration=1/0:s.duration!=null?i.duration=s.duration:s.persistent===!1&&(i.duration=this.resolveDuration({...s,persistent:!1},i.severity)),this.toasts=this.toasts.map(c=>c.id===t?i:c),this.notifyToasts()}dismissToast(t,s="dismiss"){var a,i;if(t==null){const c=this.toasts.filter(l=>!l.exiting);if(c.length===0)return;c.forEach(l=>{var p;return(p=l.onDismiss)==null?void 0:p.call(l,l.id)}),this.toasts=this.toasts.map(l=>l.exiting?l:{...l,exiting:!0}),this.notifyToasts();return}const o=this.toasts.find(c=>c.id===t);!o||o.exiting||(s==="auto"?(a=o.onAutoClose)==null||a.call(o,t):(i=o.onDismiss)==null||i.call(o,t),this.toasts=this.toasts.map(c=>c.id===t?{...c,exiting:!0}:c),this.notifyToasts())}removeToast(t){const s=this.toasts.length;this.toasts=this.toasts.filter(o=>o.id!==t),this.toasts.length!==s&&this.notifyToasts()}getToasts(){return this.toasts}subscribeToasts(t){return this.toastListeners.add(t),()=>{this.toastListeners.delete(t)}}notifyToasts(){this.toastListeners.forEach(t=>t(this.toasts))}pushInbox(t){const s=t.id??this.nextId(),o=t.timestamp instanceof Date?t.timestamp.getTime():t.timestamp??Date.now(),a={id:s,title:t.title,description:t.description,severity:t.severity??"info",icon:t.icon,avatarUrl:t.avatarUrl,timestamp:o,read:t.read??!1,action:t.action,onClick:t.onClick,meta:t.meta},c=this.inboxItems.findIndex(l=>l.id===s)===-1?[a,...this.inboxItems]:this.inboxItems.map(l=>l.id===s?a:l);if(this.commitInbox(c),t.toast){const l={id:`${s}-toast`,title:a.title,description:a.description,severity:a.severity,icon:a.icon,action:a.action,...typeof t.toast=="object"?t.toast:{}};this.pushToast(a.title,l)}return s}markRead(t){this.commitInbox(this.inboxItems.map(s=>s.id===t?{...s,read:!0}:s))}markUnread(t){this.commitInbox(this.inboxItems.map(s=>s.id===t?{...s,read:!1}:s))}markAllRead(){this.commitInbox(this.inboxItems.map(t=>t.read?t:{...t,read:!0}))}removeInbox(t){this.commitInbox(this.inboxItems.filter(s=>s.id!==t))}clearInbox(){this.commitInbox([])}setInboxItems(t){this.commitInbox(t)}getInboxState(){return this.inboxSnapshot}subscribeInbox(t){return this.inboxListeners.add(t),()=>{this.inboxListeners.delete(t)}}commitInbox(t){var s;this.inboxItems=t,this.refreshInboxSnapshot(),this.inboxOwnedExternally&&((s=this.inboxOnChange)==null||s.call(this,t)),this.notifyInbox()}notifyInbox(){const t=this.inboxSnapshot;this.inboxListeners.forEach(s=>s(t))}}const ne=new Wh,Hh=(n,t)=>ne.pushToast(n,t),Je=Hh;Je.success=(n,t)=>ne.pushToast(n,{...t,severity:"success"});Je.error=(n,t)=>ne.pushToast(n,{...t,severity:"error"});Je.warning=(n,t)=>ne.pushToast(n,{...t,severity:"warning"});Je.info=(n,t)=>ne.pushToast(n,{...t,severity:"info"});Je.loading=(n,t)=>ne.pushToast(n,{...t,severity:"info",persistent:!0,dismissible:!1});Je.update=(n,t)=>ne.updateToast(n,t);Je.dismiss=n=>ne.dismissToast(n);Je.promise=(n,t)=>{const s=ne.pushToast(typeof t.loading=="object"&&t.loading!==null&&!Mt(t.loading)?t.loading.title??"":t.loading,{...typeof t.loading=="object"&&!Mt(t.loading)?t.loading:{},severity:"info",persistent:!0,dismissible:!1});return(typeof n=="function"?n():n).then(a=>{const i=typeof t.success=="function"?t.success(a):t.success,c=i!==null&&typeof i=="object"&&!Mt(i),l=c?i:{},p=c?l.title??"":i;ne.updateToast(s,{...l,severity:"success",persistent:!1,dismissible:!0,title:p})},a=>{const i=typeof t.error=="function"?t.error(a):t.error,c=i!==null&&typeof i=="object"&&!Mt(i),l=c?i:{},p=c?l.title??"":i;ne.updateToast(s,{...l,severity:"error",persistent:!1,dismissible:!0,title:p})}),s};Je.progress=(n,t)=>{const s=ne.pushToast(n,{...t,severity:(t==null?void 0:t.severity)??"info",persistent:!0,dismissible:(t==null?void 0:t.dismissible)??!1,progress:Gt((t==null?void 0:t.progress)??0)});return{id:s,setProgress:o=>ne.updateToast(s,{progress:Gt(o)}),update:o=>ne.updateToast(s,o),done:o=>ne.updateToast(s,{...o,severity:(o==null?void 0:o.severity)??"success",progress:1,persistent:!1,dismissible:!0}),fail:o=>ne.updateToast(s,{...o,severity:(o==null?void 0:o.severity)??"error",persistent:!1,dismissible:!0}),dismiss:()=>ne.dismissToast(s)}};function Mt(n){if(n==null)return!0;const t=typeof n;return!!(t==="string"||t==="number"||t==="boolean"||Array.isArray(n)||t==="object"&&n!==null&&"$$typeof"in n)}function Gt(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}const Fh={toast:Je,push:n=>ne.pushInbox(n),inbox:{markRead:n=>ne.markRead(n),markUnread:n=>ne.markUnread(n),markAllRead:()=>ne.markAllRead(),remove:n=>ne.removeInbox(n),clear:()=>ne.clearInbox(),setItems:n=>ne.setInboxItems(n),getState:()=>ne.getInboxState(),subscribe:n=>ne.subscribeInbox(n)},dismissAll:()=>ne.dismissToast()};function Xe(...n){return n.filter(Boolean).join(" ")}const es={success:"✓",error:"✕",warning:"!",info:"i"};function qh(n,t){const s=Math.max(0,t-n),o=Math.floor(s/1e3);if(o<60)return"just now";const a=Math.floor(o/60);if(a<60)return`${a}m ago`;const i=Math.floor(a/60);if(i<24)return`${i}h ago`;const c=Math.floor(i/24);return c<7?`${c}d ago`:new Date(n).toLocaleDateString()}function ts(n){const t=[],s=n.title??n.message;return(typeof s=="string"||typeof s=="number")&&t.push(String(s)),(typeof n.description=="string"||typeof n.description=="number")&&t.push(String(n.description)),t.join(". ")}function Gh(){return r.useSyncExternalStore(n=>ne.subscribeToasts(()=>n()),()=>ne.getToasts(),()=>Ph)}function rn(){return r.useSyncExternalStore(n=>ne.subscribeInbox(()=>n()),()=>ne.getInboxState(),()=>Oh)}function Vh(){return r.useSyncExternalStore(n=>ne.subscribeConfig(n),()=>ne.getConfig(),()=>Zn)}const an=({children:n,defaultAnchor:t="top-right",maxVisible:s=3,defaultDuration:o=4e3,pauseOnFocusLoss:a=!0,persistErrors:i=!1,inboxItems:c,onInboxChange:l})=>(r.useLayoutEffect(()=>{ne.setConfig({defaultAnchor:t,maxVisible:s,defaultDuration:o,pauseOnFocusLoss:a,persistErrors:i})},[t,s,o,a,i]),r.useLayoutEffect(()=>{ne.bindExternalInbox(c,l)},[c,l]),e.jsx(e.Fragment,{children:n}));an.displayName="EvoNotificationProvider";const Uh=({toast:n,anchor:t,index:s,total:o,hovered:a,pausedExternally:i,reducedMotion:c})=>{const l=r.useRef(0),p=r.useRef(null),g=r.useRef(null),b=r.useRef(n.restartKey),_=n.exiting??!1,y=a||i,I=Number.isFinite(n.duration);r.useEffect(()=>{if(!_)return;const v=window.setTimeout(()=>ne.removeToast(n.id),c?0:zh);return()=>window.clearTimeout(v)},[_,c,n.id]),r.useEffect(()=>{if(b.current!==n.restartKey&&(b.current=n.restartKey,l.current=0),!I||_)return;if(y){p.current!=null&&(l.current+=Date.now()-p.current,p.current=null),g.current!=null&&(window.clearTimeout(g.current),g.current=null);return}const v=Math.max(0,n.duration-l.current);return p.current=Date.now(),g.current=window.setTimeout(()=>ne.dismissToast(n.id,"auto"),v),()=>{g.current!=null&&(window.clearTimeout(g.current),g.current=null),p.current!=null&&(l.current+=Date.now()-p.current,p.current=null)}},[y,I,_,n.duration,n.restartKey,n.id]);const j=o-1-s,B=a?1:Math.max(.94,1-j*.04),T=a?j*8:j*6,R=a?1:Math.max(.7,1-j*.15),O=t.startsWith("bottom")?1:-1,q={transform:`translateY(${T*O}px) scale(${B})`,opacity:R,zIndex:1e3+s},oe=n.dismissible??!0,w=n.icon??es[n.severity],D=n.title??n.message,M=ts(n),$=typeof n.progress=="number",te=$?Gt(n.progress):0,W=M!=="";return e.jsxs("div",{className:Xe(P.toast,P[`sev-${n.severity}`],_&&P.exiting,c&&P.noMotion,n.className),style:q,role:W?"group":n.severity==="error"?"alert":"status","aria-label":W?M:void 0,children:[e.jsx("span",{className:P.toastIcon,"aria-hidden":"true",children:w}),e.jsxs("div",{className:P.toastBody,children:[D!=null&&e.jsxs("div",{className:P.toastTitle,children:[D,n.count>1&&e.jsxs("span",{className:P.toastCount,"aria-label":`repeated ${n.count} times`,children:["×",n.count]})]}),n.description!=null&&e.jsx("div",{className:P.toastDescription,children:n.description})]}),n.action&&e.jsx("button",{type:"button",className:P.toastAction,onClick:v=>{n.action.onClick(v),ne.dismissToast(n.id)},children:n.action.label}),oe&&e.jsx("button",{type:"button",className:P.toastClose,onClick:()=>{ne.dismissToast(n.id)},"aria-label":"Dismiss notification",children:"✕"}),$&&e.jsx("div",{className:P.toastProgressTrack,role:"progressbar","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":te,children:e.jsx("div",{className:P.toastProgressFill,style:{transform:`scaleX(${te})`}})})]})},Kh=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"];let Nt=null;const ln=({anchor:n,className:t})=>{const s=Gh(),{defaultAnchor:o,maxVisible:a,pauseOnFocusLoss:i}=Vh(),c=n??o,[l,p]=r.useState(null),[g,b]=r.useState(!0),[_,y]=r.useState(!1),[I,j]=r.useState(!1),[B,T]=r.useState(!1),[R,O]=r.useState(""),[q,oe]=r.useState(""),w=r.useRef(new Set),D=r.useRef(null);if(D.current||(D.current=Symbol("evo-toaster")),r.useEffect(()=>{const $=D.current;return Nt==null?(Nt=$,T(!0)):Nt!==$&&console.warn("[EvoNotification] More than one <EvoNotificationToaster> is mounted; only the first renders. Remove the duplicate(s)."),()=>{Nt===$&&(Nt=null)}},[]),r.useEffect(()=>{var W;if(j(!0),typeof window>"u")return;const $=window.matchMedia("(prefers-reduced-motion: reduce)");y($.matches);const te=v=>y(v.matches);return(W=$.addEventListener)==null||W.call($,"change",te),()=>{var v;return(v=$.removeEventListener)==null?void 0:v.call($,"change",te)}},[]),r.useEffect(()=>{if(!i)return;const $=()=>b(!0),te=()=>b(!1);return window.addEventListener("focus",$),window.addEventListener("blur",te),()=>{window.removeEventListener("focus",$),window.removeEventListener("blur",te)}},[i]),r.useEffect(()=>{const $=w.current,te=new Set;for(const W of s){if(te.add(W.id),$.has(W.id)||W.exiting)continue;$.add(W.id);const v=ts(W);v&&(W.severity==="error"?oe(v):O(v))}for(const W of $)te.has(W)||$.delete(W)},[s]),r.useEffect(()=>{const $=te=>{if(te.key==="Escape"&&l!=null){const W=s.filter(v=>!v.exiting&&(v.anchor??c)===l);W.length>0&&ne.dismissToast(W[W.length-1].id)}};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[s,c,l]),!I||typeof document>"u"||!B)return null;const M={"top-left":[],"top-center":[],"top-right":[],"bottom-left":[],"bottom-center":[],"bottom-right":[]};for(const $ of s){const te=$.anchor??c;M[te].push($)}return Nn.createPortal(e.jsxs("div",{className:Xe(P.toasterRoot,t),"aria-label":"Notifications",children:[e.jsx("div",{className:P.srOnly,"aria-live":"polite","aria-atomic":"true",children:R}),e.jsx("div",{className:P.srOnly,"aria-live":"assertive","aria-atomic":"true",children:q}),Kh.map($=>{const te=M[$];if(te.length===0)return null;const W=Math.max(0,te.length-a),v=te.slice(Math.max(0,te.length-a)),X=l===$,S=!g;return e.jsxs("div",{className:Xe(P.anchor,P[`anchor-${$}`]),onMouseEnter:()=>p($),onMouseLeave:()=>p(null),onFocus:()=>p($),onBlur:re=>{re.currentTarget.contains(re.relatedTarget)||p(null)},children:[W>0&&e.jsxs("div",{className:P.overflowPill,"aria-hidden":"true",children:["+",W," more"]}),v.map((re,C)=>e.jsx(Uh,{toast:re,anchor:$,index:C,total:v.length,hovered:X,pausedExternally:S,reducedMotion:_},re.id))]},$)})]}),document.body)};ln.displayName="EvoNotificationToaster";const cn=r.forwardRef(function({variant:t="ghost",size:s="md",hideZero:o=!0,maxBadgeCount:a=99,panelPlacement:i="bottom-end",renderPanel:c="popover",panelTitle:l,panelEmptyState:p,className:g,onClick:b,..._},y){const{unread:I}=rn(),[j,B]=r.useState(!1),T=r.useRef(null),R=r.useId();r.useEffect(()=>{if(!j||c!=="popover")return;const oe=D=>{var M;(M=T.current)!=null&&M.contains(D.target)||B(!1)},w=D=>{D.key==="Escape"&&B(!1)};return document.addEventListener("mousedown",oe),document.addEventListener("keydown",w),()=>{document.removeEventListener("mousedown",oe),document.removeEventListener("keydown",w)}},[j,c]);const O=I>a?`${a}+`:String(I),q=I>0||!o;return e.jsxs("div",{ref:T,className:P.bellWrapper,children:[e.jsxs("button",{ref:y,type:"button",className:Xe(P.bell,P[`bell-${t}`],P[`bell-${s}`],j&&P.bellOpen,g),"aria-label":I>0?`Notifications, ${I} unread`:"Notifications","aria-haspopup":c==="popover"?"dialog":void 0,"aria-expanded":c==="popover"?j:void 0,"aria-controls":c==="popover"?R:void 0,onClick:oe=>{b==null||b(oe),c==="popover"&&B(w=>!w)},..._,children:[e.jsx(ns,{}),q&&e.jsx("span",{className:Xe(P.bellBadge,I===0&&P.bellBadgeZero),children:O})]}),c==="popover"&&j&&e.jsx("div",{id:R,className:Xe(P.bellPanelHost,P[`place-${i}`]),children:e.jsx(At,{open:!0,onClose:()=>B(!1),title:l,emptyState:p})})]})});cn.displayName="EvoNotificationBell";const ns=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]}),At=r.forwardRef(function({open:t=!0,onClose:s,title:o="Notifications",emptyState:a,loading:i=!1,error:c,showMarkAllRead:l=!0,maxHeight:p=480,className:g,style:b,..._},y){const{items:I,unread:j}=rn();return t?e.jsxs("div",{ref:y,className:Xe(P.panel,g),role:"dialog","aria-label":typeof o=="string"?o:"Notifications",style:b,..._,children:[e.jsxs("header",{className:P.panelHeader,children:[e.jsx("div",{className:P.panelTitle,children:o}),e.jsxs("div",{className:P.panelHeaderActions,children:[l&&j>0&&e.jsx("button",{type:"button",className:P.panelMarkAll,onClick:()=>ne.markAllRead(),children:"Mark all read"}),s&&e.jsx("button",{type:"button",className:P.panelClose,onClick:s,"aria-label":"Close notifications",children:"✕"})]})]}),e.jsx("div",{className:P.panelBody,style:{maxHeight:typeof p=="number"?`${p}px`:p},children:i?e.jsx("div",{className:P.panelState,children:"Loading…"}):c?e.jsx("div",{className:Xe(P.panelState,P.panelStateError),children:c}):I.length===0?e.jsx("div",{className:P.panelState,children:a??e.jsx(Qh,{})}):e.jsx("ul",{className:P.itemList,children:I.map(B=>e.jsx("li",{children:e.jsx(zt,{item:B})},B.id))})})]}):null});At.displayName="EvoNotificationPanel";const Qh=()=>e.jsxs("div",{className:P.emptyState,children:[e.jsx("div",{className:P.emptyIcon,"aria-hidden":"true",children:e.jsx(ns,{})}),e.jsx("div",{className:P.emptyTitle,children:"You're all caught up"}),e.jsx("div",{className:P.emptyHint,children:"New notifications will appear here."})]}),zt=r.forwardRef(function({item:t,onClick:s,className:o,...a},i){const[c,l]=r.useState(t.timestamp);r.useEffect(()=>{l(Date.now());const y=window.setInterval(()=>l(Date.now()),6e4);return()=>window.clearInterval(y)},[]);const p=r.useCallback(()=>{var y;(y=s??t.onClick)==null||y(t),t.read||ne.markRead(t.id)},[t,s]),g=r.useCallback(y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),p())},[p]),b=!!(s??t.onClick),_=t.icon??es[t.severity];return e.jsxs("div",{ref:i,className:Xe(P.item,!t.read&&P.itemUnread,b&&P.itemInteractive,o),role:b?"button":"group",tabIndex:b?0:void 0,onClick:b?p:void 0,onKeyDown:b?g:void 0,...a,children:[e.jsx("span",{className:P.itemUnreadDot,"aria-hidden":t.read}),e.jsx("div",{className:Xe(P.itemMedia,P[`sev-${t.severity}`]),"aria-hidden":"true",children:t.avatarUrl?e.jsx("img",{src:t.avatarUrl,alt:"",className:P.itemAvatar}):e.jsx("span",{className:P.itemMediaGlyph,children:_})}),e.jsxs("div",{className:P.itemBody,children:[e.jsx("div",{className:P.itemTitle,children:t.title}),t.description!=null&&e.jsx("div",{className:P.itemDescription,children:t.description}),e.jsxs("div",{className:P.itemMeta,children:[e.jsx("span",{className:P.itemTimestamp,children:qh(t.timestamp,c)}),t.action&&e.jsx("button",{type:"button",className:P.itemAction,onClick:y=>{y.stopPropagation(),t.action.onClick(y)},children:t.action.label})]})]}),e.jsx("button",{type:"button",className:P.itemDismiss,onClick:y=>{y.stopPropagation(),ne.removeInbox(t.id)},"aria-label":"Remove notification",children:"✕"})]})});zt.displayName="EvoNotificationItem";function Yh(){return rn()}const Xh={Provider:an,Toaster:ln,Bell:cn,Panel:At,Item:zt},Jh="_wrapper_1fxx0_11",Zh="_tooltip_1fxx0_17",ep="_tooltipFadeIn_1fxx0_1",tp="_top_1fxx0_33",np="_bottom_1fxx0_38",sp="_left_1fxx0_43",op="_right_1fxx0_48",rp="_arrow_1fxx0_54",Lt={wrapper:Jh,tooltip:Zh,tooltipFadeIn:ep,top:tp,bottom:np,left:sp,right:op,arrow:rp},ap=({content:n,children:t,placement:s="top",className:o=""})=>{const[a,i]=r.useState(!1);return e.jsxs("span",{className:`${Lt.wrapper} ${o}`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),children:[t,a&&e.jsxs("span",{className:`${Lt.tooltip} ${Lt[s]}`,role:"tooltip",children:[n,e.jsx("span",{className:Lt.arrow})]})]})},ip="_alert_slsq7_1",lp="_success_slsq7_10",cp="_alertIcon_slsq7_14",dp="_alertTitle_slsq7_17",up="_error_slsq7_20",hp="_warning_slsq7_30",pp="_info_slsq7_40",_p="_alertContent_slsq7_65",fp="_alertDescription_slsq7_76",mp="_dismissBtn_slsq7_83",pt={alert:ip,success:lp,alertIcon:cp,alertTitle:dp,error:up,warning:hp,info:pp,alertContent:_p,alertDescription:fp,dismissBtn:mp},vp={success:"✓",error:"✕",warning:"⚠",info:"i"},xp=({type:n="info",title:t,children:s,dismissible:o=!1,className:a=""})=>{const[i,c]=r.useState(!1);return i?null:e.jsxs("div",{className:[pt.alert,pt[n],a].filter(Boolean).join(" "),role:"alert",children:[e.jsx("span",{className:pt.alertIcon,children:vp[n]}),e.jsxs("div",{className:pt.alertContent,children:[t&&e.jsx("p",{className:pt.alertTitle,children:t}),e.jsx("div",{className:pt.alertDescription,children:s})]}),o&&e.jsx("button",{className:pt.dismissBtn,onClick:()=>c(!0),"aria-label":"Dismiss alert",children:"✕"})]})},gp="_badge_nypvn_1",bp="_sm_nypvn_12",yp="_md_nypvn_16",wp="_lg_nypvn_20",jp="_solid_nypvn_25",kp="_primary_nypvn_25",Np="_secondary_nypvn_30",Ep="_success_nypvn_35",Tp="_warning_nypvn_40",Ip="_danger_nypvn_45",$p="_info_nypvn_50",Cp="_outline_nypvn_56",Mp="_subtle_nypvn_84",Lp="_dot_nypvn_115",Dp="_removeBtn_nypvn_123",Bp="_badgeGroup_nypvn_142",ft={badge:gp,sm:bp,md:yp,lg:wp,solid:jp,primary:kp,secondary:Np,success:Ep,warning:Tp,danger:Ip,info:$p,outline:Cp,subtle:Mp,dot:Lp,removeBtn:Dp,badgeGroup:Bp},Sp=({children:n,className:t=""})=>e.jsx("div",{className:`${ft.badgeGroup} ${t}`,children:n}),ss=({children:n,severity:t="primary",variant:s="solid",size:o="md",dot:a=!1,removable:i=!1,onRemove:c,className:l=""})=>e.jsxs("span",{className:[ft.badge,ft[t],ft[s],ft[o],l].filter(Boolean).join(" "),children:[a&&e.jsx("span",{className:ft.dot}),n,i&&e.jsx("button",{className:ft.removeBtn,onClick:c,"aria-label":"Remove",children:"✕"})]});ss.Group=Sp;const Rp="_skeleton_7wr3a_9",Ap="_animated_7wr3a_14",zp="_textGroup_7wr3a_20",mt={skeleton:Rp,animated:Ap,textGroup:zp},Et=n=>typeof n=="number"?`${n}px`:n,Pp=({lines:n=3,className:t="",animated:s=!0})=>e.jsx("div",{className:`${mt.textGroup} ${t}`,children:Array.from({length:n}).map((o,a)=>e.jsx("div",{className:[mt.skeleton,s?mt.animated:""].filter(Boolean).join(" "),style:{width:a===n-1?"65%":"100%",height:"0.875rem",borderRadius:"4px"}},a))}),Op=({size:n=40,className:t="",animated:s=!0})=>e.jsx("div",{className:[mt.skeleton,s?mt.animated:"",t].filter(Boolean).join(" "),style:{width:Et(n),height:Et(n),borderRadius:"50%"}}),dn=({width:n="100%",height:t="1rem",borderRadius:s="6px",className:o="",animated:a=!0})=>e.jsx("div",{className:[mt.skeleton,a?mt.animated:"",o].filter(Boolean).join(" "),style:{width:Et(n),height:Et(t),borderRadius:Et(s)}});dn.Text=Pp;dn.Circle=Op;const Wp="_wrapper_69yee_1",Hp="_scroll_69yee_11",Fp="_table_69yee_30",qp="_caption_69yee_38",Gp="_thead_69yee_46",Vp="_th_69yee_46",Up="_sortBtn_69yee_63",Kp="_sortIcon_69yee_85",Qp="_sortActive_69yee_92",Yp="_tbody_69yee_99",Xp="_tr_69yee_99",Jp="_td_69yee_103",Zp="_hoverable_69yee_167",e_="_striped_69yee_171",t_="_bordered_69yee_179",n_="_stickyHeader_69yee_184",s_="_clickable_69yee_195",o_="_empty_69yee_202",r_="_emptyText_69yee_209",a_="_skeleton_69yee_213",i_="_evoTableShimmer_69yee_1",l_="_responsiveStack_69yee_237",c_="_emptyRow_69yee_272",fe={wrapper:Wp,scroll:Hp,table:Fp,caption:qp,thead:Gp,th:Vp,sortBtn:Up,sortIcon:Kp,sortActive:Qp,tbody:Yp,tr:Xp,td:Jp,"align-left":"_align-left_69yee_115","align-center":"_align-center_69yee_119","align-right":"_align-right_69yee_123","size-sm":"_size-sm_69yee_137","size-md":"_size-md_69yee_147","size-lg":"_size-lg_69yee_157",hoverable:Zp,striped:e_,bordered:t_,stickyHeader:n_,clickable:s_,empty:o_,emptyText:r_,skeleton:a_,evoTableShimmer:i_,responsiveStack:l_,emptyRow:c_};function Ht(n,t){return t.split(".").reduce((s,o)=>{if(s!=null&&typeof s=="object")return s[o]},n)}function d_(n,t){return n==null&&t==null?0:n==null?-1:t==null?1:typeof n=="number"&&typeof t=="number"?n-t:String(n).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}function u_(n,t,s){if(typeof s=="function")return s(n,t);if(s&&n&&typeof n=="object"){const o=n[s];if(typeof o=="string"||typeof o=="number")return o}return t}const h_=({direction:n})=>e.jsxs("svg",{className:fe.sortIcon,width:"8",height:"12",viewBox:"0 0 8 12","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{d:"M4 0 L8 4 H0 Z",fill:"currentColor",opacity:n==="asc"?1:.3}),e.jsx("path",{d:"M4 12 L0 8 H8 Z",fill:"currentColor",opacity:n==="desc"?1:.3})]}),p_=({columns:n,data:t,size:s="md",striped:o=!1,hoverable:a=!0,bordered:i=!1,stickyHeader:c=!1,loading:l=!1,loadingRows:p=5,rowKey:g,emptyState:b,emptyText:_="No data available.",onRowClick:y,onRowDoubleClick:I,getRowClassName:j,responsive:B="scroll",caption:T,sort:R,onSortChange:O,defaultSort:q,className:oe})=>{const w=R!==void 0,[D,M]=r.useState(q??null),$=w?R:D,te=C=>{let K;!$||$.key!==C?K={key:C,direction:"asc"}:$.direction==="asc"?K={key:C,direction:"desc"}:K=null,w||M(K),O==null||O(K)},W=r.useMemo(()=>{if(!$)return t;const C=n.find(Z=>Z.key===$.key);if(!C)return t;const K=$.direction,A=[...t];return C.sortFn?A.sort((Z,Q)=>C.sortFn(Z,Q,K)):A.sort((Z,Q)=>{const de=Ht(Z,C.key),ie=Ht(Q,C.key),se=d_(de,ie);return K==="asc"?se:-se}),A},[t,n,$]),v=!!(y||I),X=[fe.wrapper,fe[`size-${s}`],o&&fe.striped,a&&fe.hoverable,i&&fe.bordered,c&&fe.stickyHeader,B==="stack"&&fe.responsiveStack,v&&fe.clickable,oe].filter(Boolean).join(" "),S=C=>{const K=C.align??"left",A=($==null?void 0:$.key)===C.key,Z=A?$.direction:void 0,Q=A?Z==="asc"?"ascending":"descending":C.sortable?"none":void 0,de=[fe.th,fe[`align-${K}`],C.headerClassName].filter(Boolean).join(" ");return e.jsx("th",{scope:"col",className:de,style:C.width?{width:C.width}:void 0,"aria-sort":Q,children:C.sortable?e.jsxs("button",{type:"button",className:[fe.sortBtn,A?fe.sortActive:""].filter(Boolean).join(" "),onClick:()=>te(C.key),children:[e.jsx("span",{children:C.header}),e.jsx(h_,{direction:Z})]}):C.header},C.key)},re=()=>l?Array.from({length:Math.max(1,p)}).map((C,K)=>e.jsx("tr",{className:fe.tr,children:n.map(A=>e.jsx("td",{className:[fe.td,fe[`align-${A.align??"left"}`]].filter(Boolean).join(" "),"data-label":typeof A.header=="string"?A.header:A.key,children:e.jsx("span",{className:fe.skeleton})},A.key))},`evo-skeleton-${K}`)):W.length===0?e.jsx("tr",{className:fe.emptyRow,children:e.jsx("td",{colSpan:n.length,className:fe.empty,children:b??e.jsx("span",{className:fe.emptyText,children:_})})}):W.map((C,K)=>{const A=[fe.tr,j==null?void 0:j(C,K)].filter(Boolean).join(" ");return e.jsx("tr",{className:A,onClick:y?()=>y(C,K):void 0,onDoubleClick:I?()=>I(C,K):void 0,children:n.map(Z=>{const Q=Ht(C,Z.key),de=Z.align??"left",ie=[fe.td,fe[`align-${de}`],Z.cellClassName].filter(Boolean).join(" ");return e.jsx("td",{className:ie,"data-label":typeof Z.header=="string"?Z.header:Z.key,children:Z.render?Z.render(Q,C,K):Q==null?"":String(Q)},Z.key)})},u_(C,K,g))});return e.jsx("div",{className:X,children:e.jsx("div",{className:fe.scroll,children:e.jsxs("table",{className:fe.table,children:[T&&e.jsx("caption",{className:fe.caption,children:T}),e.jsx("thead",{className:fe.thead,children:e.jsx("tr",{children:n.map(S)})}),e.jsx("tbody",{className:fe.tbody,children:re()})]})})})},__="_root_1wpat_1",f_="_fullWidth_1wpat_11",m_="_label_1wpat_15",v_="_stage_1wpat_21",x_="_disabled_1wpat_38",g_="_bgChecker_1wpat_43",b_="_imageWrap_1wpat_49",y_="_image_1wpat_49",w_="_overlay_1wpat_68",j_="_overlayCircle_1wpat_77",k_="_circleMask_1wpat_82",N_="_grid_1wpat_89",E_="_gridLine_1wpat_95",T_="_h_1wpat_99",I_="_v_1wpat_104",$_="_handle_1wpat_110",C_="_handleTL_1wpat_128",M_="_handleTR_1wpat_134",L_="_handleBL_1wpat_140",D_="_handleBR_1wpat_146",B_="_handleT_1wpat_128",S_="_handleB_1wpat_140",R_="_handleL_1wpat_166",A_="_handleR_1wpat_166",z_="_controls_1wpat_200",P_="_controlGroup_1wpat_211",O_="_controlLabel_1wpat_218",W_="_iconBtn_1wpat_227",H_="_zoomSlider_1wpat_260",F_="_ratioRow_1wpat_294",q_="_ratioChip_1wpat_300",G_="_active_1wpat_318",V_="_divider_1wpat_333",U_="_helper_1wpat_339",K_="_placeholder_1wpat_344",Q_="_spinner_1wpat_356",H={root:__,fullWidth:f_,label:m_,stage:v_,disabled:x_,bgChecker:g_,imageWrap:b_,image:y_,overlay:w_,overlayCircle:j_,circleMask:k_,grid:N_,gridLine:E_,h:T_,v:I_,handle:$_,handleTL:C_,handleTR:M_,handleBL:L_,handleBR:D_,handleT:B_,handleB:S_,handleL:R_,handleR:A_,controls:z_,controlGroup:P_,controlLabel:O_,iconBtn:W_,zoomSlider:H_,ratioRow:F_,ratioChip:q_,active:G_,divider:V_,helper:U_,placeholder:K_,spinner:Q_},Y_=[{label:"Free",value:null},{label:"1:1",value:1},{label:"4:3",value:4/3},{label:"3:4",value:3/4},{label:"16:9",value:16/9},{label:"9:16",value:9/16}],Dt=24,Fe=(n,t,s)=>Math.min(s,Math.max(t,n)),_t=n=>(Math.round(n/90)*90%360+360)%360,X_=r.forwardRef(function({src:t,aspectRatio:s,circular:o=!1,showGrid:a=!0,showControls:i=!0,ratioPresets:c,minZoom:l=1,maxZoom:p=4,defaultZoom:g=1,defaultRotation:b=0,defaultCrop:_,height:y=360,background:I="checker",label:j,helperText:B,onChange:T,onReady:R,onError:O,disabled:q=!1,fullWidth:oe=!0,className:w,ariaLabel:D},M){const $=o?1:s,te=r.useRef(null),W=r.useRef(null),[v,X]=r.useState({w:0,h:0}),[S,re]=r.useState(null),[C,K]=r.useState(!1),[A,Z]=r.useState(!1),[Q,de]=r.useState(g),[ie,se]=r.useState(_t(b)),[J,ve]=r.useState({x:0,y:0}),[Te,ye]=r.useState({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80}),[le,Be]=r.useState($??null);r.useEffect(()=>{Be($??null)},[$]),r.useLayoutEffect(()=>{const f=te.current;if(!f)return;const L=()=>{const Y=f.getBoundingClientRect();X({w:Y.width,h:Y.height})};L();const F=new ResizeObserver(L);return F.observe(f),()=>F.disconnect()},[]),r.useEffect(()=>{if(K(!1),Z(!1),re(null),!t)return;const f=new Image;return f.crossOrigin="anonymous",f.onload=()=>{re({w:f.naturalWidth,h:f.naturalHeight}),K(!0),R==null||R({naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},f.onerror=()=>{Z(!0),O==null||O(new Error(`Failed to load image: ${t}`))},f.src=t,()=>{f.onload=null,f.onerror=null}},[t]);const we=r.useMemo(()=>{if(!S||!v.w||!v.h)return 1;const f=ie===90||ie===270,L=f?S.h:S.w,F=f?S.w:S.h;return Math.min(v.w/L,v.h/F)},[S,v.w,v.h,ie]),xe=r.useMemo(()=>{if(!S)return{w:0,h:0};const f=we*Q;return{w:S.w*f,h:S.h*f}},[S,we,Q]),ce=r.useMemo(()=>({left:Te.left/100*v.w,top:Te.top/100*v.h,width:Te.width/100*v.w,height:Te.height/100*v.h}),[Te,v]),ge=r.useCallback(()=>{if(!S||!v.w||!v.h)return null;const f=we*Q,L=v.w/2+J.x,F=v.h/2+J.y,Y=ce.left+ce.width/2,h=ce.top+ce.height/2,d=Y-L,x=h-F,k=-ie*Math.PI/180,z=d*Math.cos(k)-x*Math.sin(k),ee=d*Math.sin(k)+x*Math.cos(k),_e=ie===90||ie===270,Se=_e?ce.height:ce.width,ke=_e?ce.width:ce.height,Ie=(z-Se/2)/f+S.w/2,$e=(ee-ke/2)/f+S.h/2,Re=Se/f,Oe=ke/f;return{x:Ie,y:$e,width:Re,height:Oe,rotation:ie,sourceWidth:S.w,sourceHeight:S.h}},[S,v,we,Q,J,ce,ie]),We=r.useRef("");r.useEffect(()=>{if(!C)return;const f=ge();if(!f)return;const L=`${f.x.toFixed(2)},${f.y.toFixed(2)},${f.width.toFixed(2)},${f.height.toFixed(2)},${f.rotation}`;L!==We.current&&(We.current=L,T==null||T(f))},[C,ge,T]),r.useEffect(()=>{le==null||!v.w||!v.h||ye(f=>{const L=f.width/100*v.w,F=f.height/100*v.h,Y=L/le;let h=L,d=Y;Y>F&&(d=F,h=F*le);const x=(f.left+f.width/2)/100*v.w,k=(f.top+f.height/2)/100*v.h;let z=x-h/2,ee=k-d/2;return z=Fe(z,0,v.w-h),ee=Fe(ee,0,v.h-d),{left:z/v.w*100,top:ee/v.h*100,width:h/v.w*100,height:d/v.h*100}})},[le,v.w,v.h]);const je=r.useRef(null),Ne=r.useRef(null),m=r.useRef(new Map),u=f=>{var L,F;if(!(q||!C)){if((F=(L=f.target).setPointerCapture)==null||F.call(L,f.pointerId),m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),m.current.size===2){const Y=Array.from(m.current.values()),h=Math.hypot(Y[0].x-Y[1].x,Y[0].y-Y[1].y);Ne.current={startDist:h,startZoom:Q},je.current=null;return}je.current={type:"pan",startX:f.clientX,startY:f.clientY,startPan:J}}},N=f=>{if(!m.current.has(f.pointerId))return;if(m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),Ne.current&&m.current.size>=2){const h=Array.from(m.current.values()),d=Math.hypot(h[0].x-h[1].x,h[0].y-h[1].y),x=Fe(Ne.current.startZoom*(d/Ne.current.startDist),l,p);de(x);return}const L=je.current;if(!L)return;const F=f.clientX-L.startX,Y=f.clientY-L.startY;L.type==="pan"?ve({x:L.startPan.x+F,y:L.startPan.y+Y}):L.type==="move"?be(F,Y,L.startCrop):L.type==="resize"&&ue(L.corner,F,Y,L.startCrop)},E=f=>{m.current.delete(f.pointerId),m.current.size<2&&(Ne.current=null),m.current.size===0&&(je.current=null)},V=f=>{if(q||!C)return;f.preventDefault();const L=-f.deltaY*.0015;de(F=>Fe(F*(1+L),l,p))},be=(f,L,F)=>{const Y=v.w,h=v.h,d=F.left/100*Y,x=F.top/100*h,k=F.width/100*Y,z=F.height/100*h,ee=Fe(d+f,0,Y-k),_e=Fe(x+L,0,h-z);ye({left:ee/Y*100,top:_e/h*100,width:F.width,height:F.height})},ue=(f,L,F,Y)=>{const h=v.w,d=v.h;let x=Y.left/100*h,k=Y.top/100*d,z=Y.width/100*h,ee=Y.height/100*d;const _e=x+z,Se=k+ee;let ke=x,Ie=k,$e=_e,Re=Se;f.includes("l")&&(ke=Fe(x+L,0,_e-Dt)),f.includes("r")&&($e=Fe(_e+L,x+Dt,h)),f.includes("t")&&(Ie=Fe(k+F,0,Se-Dt)),f.includes("b")&&(Re=Fe(Se+F,k+Dt,d));let Oe=$e-ke,qe=Re-Ie;if(le!=null){if(f.length===2){const Ae=Oe,st=Oe/le;st<=qe||f==="tl"||f==="tr"||f==="bl"||f==="br"?qe=Ae/le:Oe=st*le,f.includes("t")&&(Ie=Re-qe),f.includes("b")&&(Re=Ie+qe),f.includes("l")&&(ke=$e-Oe),f.includes("r")&&($e=ke+Oe)}else if(f==="l"||f==="r"){qe=Oe/le;const Ae=(k+Se)/2;Ie=Ae-qe/2,Re=Ae+qe/2}else if(f==="t"||f==="b"){Oe=qe*le;const Ae=(x+_e)/2;ke=Ae-Oe/2,$e=Ae+Oe/2}if(ke<0&&($e+=-ke,ke=0),Ie<0&&(Re+=-Ie,Ie=0),$e>h){const Ae=$e-h;$e=h,ke-=Ae}if(Re>d){const Ae=Re-d;Re=d,Ie-=Ae}if(Oe=$e-ke,qe=Re-Ie,Math.abs(Oe/qe-le)>.001)if(Oe/qe>le){const Ae=qe*le,st=(ke+$e)/2;ke=st-Ae/2,$e=st+Ae/2}else{const Ae=Oe/le,st=(Ie+Re)/2;Ie=st-Ae/2,Re=st+Ae/2}}ye({left:ke/h*100,top:Ie/d*100,width:($e-ke)/h*100,height:(Re-Ie)/d*100})},Pe=f=>{var L,F;q||!C||(f.stopPropagation(),(F=(L=f.target).setPointerCapture)==null||F.call(L,f.pointerId),m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),je.current={type:"move",startX:f.clientX,startY:f.clientY,startCrop:{...Te}})},ze=f=>L=>{var F,Y;q||!C||(L.stopPropagation(),(Y=(F=L.target).setPointerCapture)==null||Y.call(F,L.pointerId),m.current.set(L.pointerId,{x:L.clientX,y:L.clientY}),je.current={type:"resize",corner:f,startX:L.clientX,startY:L.clientY,startCrop:{...Te}})},He=r.useCallback(f=>{const L=ge();if(!L||!W.current)return null;let F=Math.max(1,Math.round(L.width)),Y=Math.max(1,Math.round(L.height));const{maxWidth:h,maxHeight:d}=f??{};if(h&&F>h){const ee=h/F;F=h,Y=Math.round(Y*ee)}if(d&&Y>d){const ee=d/Y;Y=d,F=Math.round(F*ee)}const x=document.createElement("canvas");x.width=F,x.height=Y;const k=x.getContext("2d");if(!k)return null;k.imageSmoothingQuality="high";const z=W.current;if(k.save(),L.rotation===0)k.drawImage(z,L.x,L.y,L.width,L.height,0,0,F,Y);else{k.translate(F/2,Y/2),k.rotate(L.rotation*Math.PI/180);const ee=L.rotation===90||L.rotation===270,_e=ee?Y:F,Se=ee?F:Y,ke=ee?L.height:L.width,Ie=ee?L.width:L.height;k.drawImage(z,L.x,L.y,ke,Ie,-_e/2,-Se/2,_e,Se)}return k.restore(),o&&(k.globalCompositeOperation="destination-in",k.beginPath(),k.arc(F/2,Y/2,Math.min(F,Y)/2,0,Math.PI*2),k.closePath(),k.fill()),x},[ge,o]);r.useImperativeHandle(M,()=>({getCrop:()=>ge(),getCroppedCanvas:f=>He(f),getCroppedBlob:f=>new Promise((L,F)=>{const Y=He(f);if(!Y)return F(new Error("Cropper not ready"));Y.toBlob(h=>h?L(h):F(new Error("Canvas export failed")),(f==null?void 0:f.type)??"image/png",(f==null?void 0:f.quality)??.92)}),getCroppedDataURL:async f=>{const L=He(f);if(!L)throw new Error("Cropper not ready");return L.toDataURL((f==null?void 0:f.type)??"image/png",(f==null?void 0:f.quality)??.92)},reset:()=>{de(g),se(_t(b)),ve({x:0,y:0}),ye({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80})},rotate:f=>{se(f===void 0?L=>_t(L+90):_t(f))},setZoom:f=>de(Fe(f,l,p))}),[ge,He,g,b,_,l,p]);const Le={height:typeof y=="number"?`${y}px`:y},Qe=S?{width:xe.w,height:xe.h,transform:`translate(${J.x}px, ${J.y}px) rotate(${ie}deg)`}:{display:"none"},Ze={left:ce.left,top:ce.top,width:ce.width,height:ce.height},nt=o?{"--mask-cx":`${ce.left+ce.width/2}px`,"--mask-cy":`${ce.top+ce.height/2}px`,"--mask-r":`${Math.min(ce.width,ce.height)/2}px`}:{},Ye=[H.stage,I==="checker"?H.bgChecker:"",q?H.disabled:""].filter(Boolean).join(" "),ct=[H.root,oe?H.fullWidth:"",w??""].filter(Boolean).join(" "),dt=c??Y_,kt=i&&!o&&dt.length>0;return e.jsxs("div",{className:ct,children:[j&&e.jsx("div",{className:H.label,children:j}),kt&&e.jsx("div",{className:H.ratioRow,role:"radiogroup","aria-label":"Aspect ratio",children:dt.map(f=>e.jsx("button",{type:"button",role:"radio","aria-checked":le===f.value,className:`${H.ratioChip} ${le===f.value?H.active:""}`,disabled:q,onClick:()=>Be(f.value),children:f.label},f.label))}),e.jsxs("div",{ref:te,className:Ye,style:Le,role:"application","aria-label":D??"Image cropper","aria-disabled":q,onPointerDown:u,onPointerMove:N,onPointerUp:E,onPointerCancel:E,onWheel:V,children:[!C&&!A&&e.jsxs("div",{className:H.placeholder,children:[e.jsx("div",{className:H.spinner,"aria-hidden":!0}),e.jsx("div",{children:"Loading image…"})]}),A&&e.jsx("div",{className:H.placeholder,children:e.jsx("div",{children:"Couldn't load image."})}),e.jsx("div",{className:H.imageWrap,children:e.jsx("img",{ref:W,src:t,alt:"",draggable:!1,className:H.image,style:Qe})}),C&&e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:H.circleMask,style:nt}),e.jsxs("div",{className:`${H.overlay} ${o?H.overlayCircle:""}`,style:Ze,onPointerDown:Pe,onPointerMove:N,onPointerUp:E,onPointerCancel:E,children:[a&&!o&&e.jsxs("div",{className:H.grid,"aria-hidden":!0,children:[e.jsx("div",{className:`${H.gridLine} ${H.h}`,style:{top:"33.33%"}}),e.jsx("div",{className:`${H.gridLine} ${H.h}`,style:{top:"66.66%"}}),e.jsx("div",{className:`${H.gridLine} ${H.v}`,style:{left:"33.33%"}}),e.jsx("div",{className:`${H.gridLine} ${H.v}`,style:{left:"66.66%"}})]}),e.jsx("div",{className:`${H.handle} ${H.handleTL}`,onPointerDown:ze("tl")}),e.jsx("div",{className:`${H.handle} ${H.handleTR}`,onPointerDown:ze("tr")}),e.jsx("div",{className:`${H.handle} ${H.handleBL}`,onPointerDown:ze("bl")}),e.jsx("div",{className:`${H.handle} ${H.handleBR}`,onPointerDown:ze("br")}),e.jsx("div",{className:`${H.handle} ${H.handleT}`,onPointerDown:ze("t")}),e.jsx("div",{className:`${H.handle} ${H.handleB}`,onPointerDown:ze("b")}),e.jsx("div",{className:`${H.handle} ${H.handleL}`,onPointerDown:ze("l")}),e.jsx("div",{className:`${H.handle} ${H.handleR}`,onPointerDown:ze("r")})]})]})]}),i&&e.jsxs("div",{className:H.controls,"aria-label":"Cropper controls",children:[e.jsxs("div",{className:H.controlGroup,children:[e.jsx("span",{className:H.controlLabel,children:"Zoom"}),e.jsx("button",{type:"button",className:H.iconBtn,"aria-label":"Zoom out",disabled:q||Q<=l,onClick:()=>de(f=>Fe(f-.1,l,p)),children:e.jsx(Z_,{})}),e.jsx("input",{type:"range",className:H.zoomSlider,min:l,max:p,step:.01,value:Q,disabled:q,onChange:f=>de(parseFloat(f.target.value)),"aria-label":"Zoom level"}),e.jsx("button",{type:"button",className:H.iconBtn,"aria-label":"Zoom in",disabled:q||Q>=p,onClick:()=>de(f=>Fe(f+.1,l,p)),children:e.jsx(J_,{})})]}),e.jsx("div",{className:H.divider,"aria-hidden":!0}),e.jsxs("div",{className:H.controlGroup,children:[e.jsx("span",{className:H.controlLabel,children:"Rotate"}),e.jsx("button",{type:"button",className:H.iconBtn,"aria-label":"Rotate left",disabled:q,onClick:()=>se(f=>_t(f-90)),children:e.jsx(ef,{})}),e.jsx("button",{type:"button",className:H.iconBtn,"aria-label":"Rotate right",disabled:q,onClick:()=>se(f=>_t(f+90)),children:e.jsx(tf,{})})]}),e.jsx("div",{className:H.divider,"aria-hidden":!0}),e.jsx("div",{className:H.controlGroup,children:e.jsx("button",{type:"button",className:H.iconBtn,"aria-label":"Reset",disabled:q,onClick:()=>{de(g),se(_t(b)),ve({x:0,y:0}),ye({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80})},children:e.jsx(nf,{})})})]}),B&&e.jsx("div",{className:H.helper,children:B})]})}),It={width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},J_=()=>e.jsxs("svg",{...It,children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),Z_=()=>e.jsx("svg",{...It,children:e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})}),ef=()=>e.jsxs("svg",{...It,children:[e.jsx("polyline",{points:"1 4 1 10 7 10"}),e.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),tf=()=>e.jsxs("svg",{...It,children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.13-9.36L23 10"})]}),nf=()=>e.jsxs("svg",{...It,children:[e.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.jsx("polyline",{points:"3 3 3 8 8 8"})]});exports.EvoAlert=xp;exports.EvoAutoComplete=Kn;exports.EvoBadge=ss;exports.EvoBreadcrumb=Ln;exports.EvoButton=Rs;exports.EvoCard=lt;exports.EvoCardBody=Ut;exports.EvoCardDescription=Yt;exports.EvoCardFooter=Kt;exports.EvoCardHeader=Vt;exports.EvoCardMedia=Xt;exports.EvoCardRoot=Bt;exports.EvoCardTitle=Qt;exports.EvoCheckbox=Qn;exports.EvoCommandPalette=ma;exports.EvoContainer=fo;exports.EvoDivider=ao;exports.EvoForm=jt;exports.EvoGrid=$n;exports.EvoImageCropper=X_;exports.EvoInput=Ca;exports.EvoModal=Rt;exports.EvoNav=pr;exports.EvoNavGroup=nn;exports.EvoNavItem=en;exports.EvoNavQuickAction=sn;exports.EvoNavSkeleton=Sn;exports.EvoNavSubItem=tn;exports.EvoNotification=Xh;exports.EvoNotificationBell=cn;exports.EvoNotificationItem=zt;exports.EvoNotificationPanel=At;exports.EvoNotificationProvider=an;exports.EvoNotificationToaster=ln;exports.EvoPagination=Qr;exports.EvoRadio=Xn;exports.EvoRichTextArea=oi;exports.EvoSelect=nl;exports.EvoSkeleton=dn;exports.EvoStack=Js;exports.EvoTable=p_;exports.EvoTabs=St;exports.EvoThemeProvider=os;exports.EvoThemeToggle=_s;exports.EvoToggle=Dd;exports.EvoTooltip=ap;exports.EvoTopNav=tt;exports.EvoTreeSelect=dc;exports.evoLocalRecents=ed;exports.evoNotify=Fh;exports.getEvoThemeScript=rs;exports.useEvoInbox=Yh;exports.useEvoTheme=In;exports.useFormContext=_u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),Nn=require("react-dom"),En=r.createContext(null),Tn="evo-ui-theme";function un(){return typeof window>"u"||!window.matchMedia?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function hn(n){if(!n||typeof window>"u")return null;try{const t=window.localStorage.getItem(n);if(t==="light"||t==="dark"||t==="system")return t}catch{}return null}const rs=({children:n,defaultTheme:t="system",storageKey:s=Tn,attribute:o="data-theme",enableTransitions:a=!0,target:i})=>{const[l,c]=r.useState(()=>hn(s)??t),[p,v]=r.useState(()=>{const C=hn(s)??t;return C==="system"?un():C}),b=r.useRef(!0),_=r.useCallback(C=>{if(typeof document>"u")return;const E=i??document.documentElement;a&&!b.current&&(E.setAttribute("data-theme-transition","true"),window.clearTimeout(E.__evoThemeTimer),E.__evoThemeTimer=window.setTimeout(()=>{E.removeAttribute("data-theme-transition")},250)),o==="class"&&(E.classList.remove("light","dark"),E.classList.add(C)),E.setAttribute("data-theme",C),b.current=!1},[o,a,i]);r.useEffect(()=>{_(p)},[p,_]),r.useEffect(()=>{v(l==="system"?un():l)},[l]),r.useEffect(()=>{if(l!=="system"||typeof window>"u"||!window.matchMedia)return;const C=window.matchMedia("(prefers-color-scheme: dark)"),E=D=>{v(D.matches?"dark":"light")};return C.addEventListener("change",E),()=>C.removeEventListener("change",E)},[l]);const x=r.useCallback(C=>{if(c(C),s&&typeof window<"u")try{window.localStorage.setItem(s,C)}catch{}},[s]),N=r.useCallback(()=>{x(p==="dark"?"light":"dark")},[p,x]),w=r.useMemo(()=>({theme:l,resolvedTheme:p,setTheme:x,toggleTheme:N}),[l,p,x,N]);return e.jsx(En.Provider,{value:w,children:n})},In=()=>{const n=r.useContext(En);if(n)return n;const t=typeof document<"u"&&document.documentElement.getAttribute("data-theme")==="dark"?"dark":"light";return{theme:t,resolvedTheme:t,setTheme:()=>{typeof document<"u"&&console.warn("[evo-ui] useEvoTheme called without <EvoThemeProvider>. Wrap your app in <EvoThemeProvider> to enable setTheme().")},toggleTheme:()=>{}}},as=(n=Tn)=>`(function(){try{var s=localStorage.getItem('${n}');var t=s||'system';var r=t==='system'?(matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light'):t;document.documentElement.setAttribute('data-theme',r);}catch(e){}})();`,is="_toggle_1aoav_1",cs="_track_1aoav_19",ls="_thumb_1aoav_29",ds="_sun_1aoav_49",us="_moon_1aoav_54",hs="_sm_1aoav_68",ps="_md_1aoav_81",_s="_lg_1aoav_94",gt={toggle:is,track:cs,thumb:ls,sun:ds,moon:us,sm:hs,md:ps,lg:_s},fs=({size:n="md",ariaLabel:t="Toggle color theme",className:s})=>{const{resolvedTheme:o,toggleTheme:a}=In(),i=o==="dark",l=[gt.toggle,gt[n],s].filter(Boolean).join(" ");return e.jsx("button",{type:"button",role:"switch","aria-checked":i,"aria-label":t,onClick:a,className:l,"data-theme-state":o,children:e.jsx("span",{className:gt.track,children:e.jsxs("span",{className:gt.thumb,children:[e.jsxs("svg",{className:gt.sun,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"12",cy:"12",r:"4"}),e.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]}),e.jsx("svg",{className:gt.moon,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})]})})})},ms="_button_5wbw9_1",vs="_label_5wbw9_38",xs="_icon_5wbw9_44",gs="_spinner_5wbw9_56",bs="_sm_5wbw9_72",ys="_md_5wbw9_80",ws="_lg_5wbw9_82",js="_rounded_5wbw9_90",ks="_square_5wbw9_94",Ns="_iconOnly_5wbw9_106",Es="_fullWidth_5wbw9_119",Ts="_solid_5wbw9_124",Is="_outline_5wbw9_126",$s="_ghost_5wbw9_130",Cs="_soft_5wbw9_135",Ss="_primary_5wbw9_139",Ls="_secondary_5wbw9_197",Ms="_danger_5wbw9_257",Ds="_warning_5wbw9_315",Bs="_success_5wbw9_371",Rs="_info_5wbw9_429",Ke={button:ms,label:vs,icon:xs,spinner:gs,"evo-btn-spin":"_evo-btn-spin_5wbw9_1",sm:bs,md:ys,lg:ws,rounded:js,square:ks,iconOnly:Ns,fullWidth:Es,solid:Ts,outline:Is,ghost:$s,soft:Cs,primary:Ss,secondary:Ls,danger:Ms,warning:Ds,success:Bs,info:Rs},As=r.forwardRef(function({label:t,children:s,variant:o="solid",severity:a="primary",size:i="md",shape:l="default",iconLeft:c,iconRight:p,loading:v=!1,loadingText:b,fullWidth:_=!1,disabled:x,type:N="button",className:w,...C},E){const V=v?b:s??t,H=x||v,ue=[Ke.button,Ke[o],Ke[a],Ke[i],l!=="default"?Ke[l]:"",_?Ke.fullWidth:"",V?"":Ke.iconOnly,w].filter(Boolean).join(" ");return e.jsxs("button",{ref:E,type:N,className:ue,disabled:H,"aria-busy":v||void 0,...C,children:[v?e.jsx("span",{className:Ke.spinner,"aria-hidden":"true"}):c&&e.jsx("span",{className:Ke.icon,children:c}),V!=null&&V!==""&&e.jsx("span",{className:Ke.label,children:V}),!v&&p&&e.jsx("span",{className:Ke.icon,children:p})]})}),zs="_root_kkcxo_1",Ps="_elevated_kkcxo_15",Os="_outlined_kkcxo_20",Ws="_ghost_kkcxo_26",Hs="_media_kkcxo_40",qs="_interactive_kkcxo_72",Fs="_mediaImg_kkcxo_112",Gs="_header_kkcxo_119",Vs="_body_kkcxo_126",Ks="_footer_kkcxo_132",Us="_title_kkcxo_141",Ys="_description_kkcxo_149",Ue={root:zs,elevated:Ps,outlined:Os,ghost:Ws,"orient-vertical":"_orient-vertical_kkcxo_32","orient-horizontal":"_orient-horizontal_kkcxo_36",media:Hs,"orient-responsive":"_orient-responsive_kkcxo_51",interactive:qs,mediaImg:Fs,header:Gs,body:Vs,footer:Ks,title:Us,description:Ys};function xt(...n){return n.filter(Boolean).join(" ")}function Qs(n,t,s,o){return xt(Ue.root,Ue[n],Ue[`orient-${t}`],s&&Ue.interactive,o)}const Dt=r.forwardRef(function(t,s){const{variant:o="elevated",orientation:a="vertical",interactive:i,className:l,children:c,...p}=t,v=i===!0,b=Qs(o,a,v,l);if(v&&typeof p.href=="string"){const _=p;return e.jsx("a",{ref:s,className:b,..._,children:c})}if(v){const{type:_="button",...x}=p;return e.jsx("button",{ref:s,type:_,className:b,...x,children:c})}return e.jsx("div",{ref:s,className:b,...p,children:c})});Dt.displayName="EvoCardRoot";const Vt=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ue.header,t),...s})});Vt.displayName="EvoCardHeader";const Kt=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ue.body,t),...s})});Kt.displayName="EvoCardBody";const Ut=r.forwardRef(function({className:t,...s},o){return e.jsx("div",{ref:o,className:xt(Ue.footer,t),...s})});Ut.displayName="EvoCardFooter";const Yt=r.forwardRef(function({as:t="h3",className:s,children:o,...a},i){return r.createElement(t,{ref:i,className:xt(Ue.title,s),...a},o)});Yt.displayName="EvoCardTitle";const Qt=r.forwardRef(function({className:t,...s},o){return e.jsx("p",{ref:o,className:xt(Ue.description,t),...s})});Qt.displayName="EvoCardDescription";const Xt=r.forwardRef(function({src:t,alt:s,aspectRatio:o,className:a,style:i,children:l,...c},p){const v=o!=null?{aspectRatio:o,...i}:i;return e.jsx("div",{ref:p,className:xt(Ue.media,a),style:v,...c,children:t?e.jsx("img",{src:t,alt:s??"",className:Ue.mediaImg}):l})});Xt.displayName="EvoCardMedia";const ct=Dt;ct.Root=Dt;ct.Header=Vt;ct.Title=Yt;ct.Description=Qt;ct.Body=Kt;ct.Footer=Ut;ct.Media=Xt;const Xs={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"},Js={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},Zs=({children:n,direction:t="column",gap:s="1rem",align:o="stretch",justify:a="start",wrap:i=!1,className:l="",style:c})=>e.jsx("div",{className:l,style:{display:"flex",flexDirection:t,gap:typeof s=="number"?`${s}px`:s,alignItems:Xs[o],justifyContent:Js[a],flexWrap:i?"wrap":"nowrap",...c},children:n}),Pt=n=>n===void 0?void 0:typeof n=="number"?`${n}px`:n,eo=({children:n,colSpan:t,rowSpan:s,className:o="",style:a})=>e.jsx("div",{className:o,style:{gridColumn:t?`span ${t}`:void 0,gridRow:s?`span ${s}`:void 0,...a},children:n}),$n=({children:n,cols:t=3,rows:s,gap:o="1rem",colGap:a,rowGap:i,className:l="",style:c})=>e.jsx("div",{className:l,style:{display:"grid",gridTemplateColumns:typeof t=="number"?`repeat(${t}, 1fr)`:t,gridTemplateRows:s?typeof s=="number"?`repeat(${s}, auto)`:s:void 0,gap:Pt(o),columnGap:Pt(a),rowGap:Pt(i),...c},children:n});$n.Item=eo;const to="_divider_rorxd_1",no="_horizontal_rorxd_6",so="_vertical_rorxd_13",oo="_labeled_rorxd_20",ro="_line_rorxd_27",ao="_labelText_rorxd_33",ut={divider:to,horizontal:no,vertical:so,labeled:oo,line:ro,labelText:ao},io=({orientation:n="horizontal",label:t,className:s=""})=>t?e.jsxs("div",{className:`${ut.labeled} ${s}`,children:[e.jsx("div",{className:ut.line}),e.jsx("span",{className:ut.labelText,children:t}),e.jsx("div",{className:ut.line})]}):e.jsx("div",{className:[ut.divider,n==="vertical"?ut.vertical:ut.horizontal,s].filter(Boolean).join(" ")}),co="_container_131l9_1",lo="_centered_131l9_7",uo="_sm_131l9_12",ho="_md_131l9_16",po="_lg_131l9_20",_o="_xl_131l9_24",fo="_full_131l9_28",Ot={container:co,centered:lo,sm:uo,md:ho,lg:po,xl:_o,full:fo},mo=({children:n,size:t="lg",centered:s=!0,className:o=""})=>e.jsx("div",{className:[Ot.container,Ot[t],s?Ot.centered:"",o].filter(Boolean).join(" "),children:n}),vo="_tabs_9memw_1",xo="_tabList_9memw_6",go="_tab_9memw_1",bo="_disabled_9memw_36",yo="_active_9memw_36",wo="_tabPanel_9memw_52",wt={tabs:vo,tabList:xo,tab:go,disabled:bo,active:yo,tabPanel:wo},Cn=r.createContext(null),Sn=()=>{const n=r.useContext(Cn);if(!n)throw new Error("Tab components must be used within EvoTabs");return n},jo=({children:n,className:t=""})=>e.jsx("div",{className:`${wt.tabList} ${t}`,role:"tablist",children:n}),ko=({id:n,children:t,disabled:s=!1,className:o=""})=>{const{active:a,setActive:i}=Sn();return e.jsx("button",{role:"tab","aria-selected":a===n,disabled:s,className:[wt.tab,a===n?wt.active:"",s?wt.disabled:"",o].filter(Boolean).join(" "),onClick:()=>i(n),children:t})},No=({id:n,children:t,className:s=""})=>{const{active:o}=Sn();return o!==n?null:e.jsx("div",{role:"tabpanel",className:`${wt.tabPanel} ${s}`,children:t})},Bt=({children:n,defaultTab:t="",className:s=""})=>{const[o,a]=r.useState(t);return e.jsx(Cn.Provider,{value:{active:o,setActive:a},children:e.jsx("div",{className:`${wt.tabs} ${s}`,children:n})})};Bt.List=jo;Bt.Tab=ko;Bt.Panel=No;const Eo="_breadcrumb_7jmv3_1",To="_item_7jmv3_12",Io="_separator_7jmv3_18",$o="_link_7jmv3_28",Co="_text_7jmv3_44",So="_current_7jmv3_49",yt={breadcrumb:Eo,item:To,separator:Io,link:$o,text:Co,current:So},Lo=({children:n,href:t,current:s=!1})=>e.jsx("li",{className:yt.item,children:t&&!s?e.jsx("a",{href:t,className:yt.link,children:n}):e.jsx("span",{className:[yt.text,s?yt.current:""].filter(Boolean).join(" "),"aria-current":s?"page":void 0,children:n})}),Ln=({children:n,separator:t="/",className:s=""})=>{const o=r.Children.toArray(n);return e.jsx("nav",{"aria-label":"breadcrumb",className:s,children:e.jsx("ol",{className:yt.breadcrumb,children:o.map((a,i)=>e.jsxs(r.Fragment,{children:[a,i<o.length-1&&e.jsx("li",{className:yt.separator,"aria-hidden":"true",children:t})]},i))})})};Ln.Item=Lo;const Mo="_navContainer_ng5y4_1",Do="_navList_ng5y4_7",Bo="_navLi_ng5y4_7",Ro="_navRow_ng5y4_20",Ao="_navIcon_ng5y4_47",zo="_active_ng5y4_55",Po="_disabled_ng5y4_63",Oo="_navRowTop_ng5y4_69",Wo="_navRowSub_ng5y4_73",Ho="_navLabel_ng5y4_81",qo="_chevron_ng5y4_157",Fo="_chevronOpen_ng5y4_162",Go="_navSubList_ng5y4_166",Vo="_navGroup_ng5y4_178",Ko="_navGroupLabel_ng5y4_187",Uo="_navGroupLabelText_ng5y4_199",Yo="_navGroupToggle_ng5y4_208",Qo="_navGroupCount_ng5y4_228",Xo="_navGroupPanel_ng5y4_244",Jo="_navSkeletonItem_ng5y4_260",Zo="_navSkeletonIcon_ng5y4_267",er="_navSkeletonText_ng5y4_276",tr="_navQuickAction_ng5y4_292",nr="_navTrigger_ng5y4_321",sr="_navBackdrop_ng5y4_344",or="_navDesktop_ng5y4_352",rr="_navMobile_ng5y4_356",ar="_navDrawerOpen_ng5y4_377",ir="_navCollapsed_ng5y4_389",pe={navContainer:Mo,navList:Do,navLi:Bo,navRow:Ro,navIcon:Ao,active:zo,disabled:Po,navRowTop:Oo,navRowSub:Wo,navLabel:Ho,chevron:qo,chevronOpen:Fo,navSubList:Go,navGroup:Vo,navGroupLabel:Ko,navGroupLabelText:Uo,navGroupToggle:Yo,navGroupCount:Qo,navGroupPanel:Xo,navSkeletonItem:Jo,navSkeletonIcon:Zo,navSkeletonText:er,navQuickAction:tr,navTrigger:nr,navBackdrop:sr,navDesktop:or,navMobile:rr,navDrawerOpen:ar,navCollapsed:ir},Jt=r.createContext(null),pn=r.createContext({depth:0});function cr(n){const[t,s]=r.useState(!1);return r.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const o=window.matchMedia(`(max-width: ${n-1}px)`),a=()=>s(o.matches);return a(),o.addEventListener("change",a),()=>o.removeEventListener("change",a)},[n]),t}function Zt(n,t,s){const[o,a]=r.useState(t),i=n!==void 0,l=i?n:o,c=r.useCallback(p=>{i||a(p),s==null||s(p)},[i,s]);return[l,c]}const qt="data-evo-nav-row";function lr(n){return n?Array.from(n.querySelectorAll(`[${qt}]:not([data-disabled="true"])`)).filter(t=>t.offsetParent!==null&&t.closest("[inert]")===null):[]}function $t(n,t,s){var l;const o=lr(n);if(o.length===0)return;const a=o.indexOf(t);let i;s==="first"?i=0:s==="last"?i=o.length-1:i=Math.max(0,Math.min(o.length-1,a+s)),(l=o[i])==null||l.focus()}const Mn=({open:n})=>e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"12",height:"12","aria-hidden":"true",className:[pe.chevron,n?pe.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),dr=()=>e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",width:"14",height:"14","aria-hidden":"true",children:e.jsx("path",{d:"M8 3v10M3 8h10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),ur=()=>e.jsx("svg",{viewBox:"0 0 20 20",fill:"none",width:"18",height:"18","aria-hidden":"true",children:e.jsx("path",{d:"M3 5h14M3 10h14M3 15h14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),hr=()=>e.jsx("svg",{viewBox:"0 0 20 20",fill:"none",width:"18",height:"18","aria-hidden":"true",children:e.jsx("path",{d:"M5 5l10 10M15 5L5 15",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})});function pr(n){const t=[],s=[],o=a=>{if(Array.isArray(a)){a.forEach(o);return}if(r.isValidElement(a)){const i=a.type;if(typeof i!="string"&&(i==null?void 0:i.displayName)==="EvoNavSubItem"){s.push(a);return}}t.push(a)};return o(n),{label:t,subs:s}}const Dn=r.forwardRef(function({children:t,icon:s,active:o=!1,href:a,onClick:i,tooltip:l,open:c,defaultOpen:p=!1,onOpenChange:v,disabled:b=!1,className:_,tier:x},N){const w=r.useContext(Jt),C=(w==null?void 0:w.collapsed)??!1,{depth:E}=r.useContext(pn),D=r.useRef(null),V=r.useId(),H=`${V}-sub`,{label:ue,subs:j}=r.useMemo(()=>pr(t),[t]),M=j.length>0,[B,S]=Zt(M?c:!1,M?p:!1,v),se=r.useCallback(()=>{M&&S(!B)},[M,B,S]),Q=r.useCallback(A=>{b||(M&&!a&&se(),i==null||i(A),w!=null&&w.isMobile&&a&&!M&&w.closeDrawer())},[b,M,a,i,w,se]),y=A=>{var ae,ee,J;if(b)return;const W=A.currentTarget,G=W.closest(`.${pe.navContainer}`);switch(A.key){case"ArrowDown":A.preventDefault(),$t(G,W,1);break;case"ArrowUp":A.preventDefault(),$t(G,W,-1);break;case"ArrowRight":if(M)if(A.preventDefault(),!B)S(!0);else{const Y=W.closest("li"),me=Y==null?void 0:Y.querySelector(`ul [${qt}]`);me==null||me.focus()}break;case"ArrowLeft":if(A.preventDefault(),M&&B)S(!1);else if(E>0){const Y=(ee=(ae=W.closest("li"))==null?void 0:ae.parentElement)==null?void 0:ee.closest("li");(J=Y==null?void 0:Y.querySelector(`[${qt}]`))==null||J.focus()}break;case"Home":A.preventDefault(),$t(G,W,"first");break;case"End":A.preventDefault(),$t(G,W,"last");break;case"Enter":case" ":{(A.key===" "||a===void 0)&&(A.preventDefault(),Q(A));break}}},te=[pe.navRow,x==="subitem"?pe.navRowSub:pe.navRowTop,o?pe.active:"",b?pe.disabled:"",_].filter(Boolean).join(" "),R=x==="subitem"&&E>0?{"--evo-nav-indent":`${E*.875}rem`}:void 0,he={"data-evo-nav-row":"",id:V,className:te,style:R,title:C&&l?l:void 0,"aria-current":o?"page":void 0,"aria-expanded":M?B:void 0,"aria-controls":M?H:void 0,"aria-disabled":b||void 0,"data-disabled":b?"true":void 0,"data-active":o?"true":void 0,tabIndex:b?-1:0,onKeyDown:y},$=e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:pe.navIcon,children:s}),e.jsx("span",{className:pe.navLabel,children:ue}),M&&e.jsx(Mn,{open:B})]});let P;if(a&&!b){const A={href:a,onClick:Q};P=e.jsx("a",{ref:D,...he,...A,children:$})}else P=e.jsx("button",{ref:D,type:"button",disabled:b,onClick:Q,...he,children:$});return e.jsxs("li",{ref:N,className:pe.navLi,children:[P,M&&e.jsx(pn.Provider,{value:{depth:E+1},children:e.jsx("ul",{id:H,role:"group","aria-labelledby":V,hidden:!B,className:pe.navSubList,children:j})})]})}),en=r.forwardRef(function(t,s){return e.jsx(Dn,{ref:s,tier:"item",...t})});en.displayName="EvoNavItem";const tn=r.forwardRef(function(t,s){return e.jsx(Dn,{ref:s,tier:"subitem",...t})});tn.displayName="EvoNavSubItem";const nn=r.forwardRef(function({label:t,children:s,className:o,collapsible:a=!1,defaultOpen:i=!0,open:l,onOpenChange:c,count:p},v){var ue;const b=r.useId(),_=`${b}-panel`,x=((ue=r.useContext(Jt))==null?void 0:ue.collapsed)??!1,N=a&&!x,[w,C]=Zt(N?l:!0,N?i:!0,c),E=x?!0:w,D=r.useRef(null);r.useEffect(()=>{const j=D.current;j&&(E?j.removeAttribute("inert"):j.setAttribute("inert",""))},[E]);const V=p!=null?e.jsx("span",{className:pe.navGroupCount,"aria-hidden":"true",children:p}):null,H=e.jsx("ul",{role:"group","aria-labelledby":b,className:pe.navList,children:s});return e.jsxs("li",{ref:v,className:[pe.navGroup,o].filter(Boolean).join(" "),children:[N?e.jsxs("button",{type:"button",id:b,className:[pe.navGroupLabel,pe.navGroupToggle].join(" "),"aria-expanded":E,"aria-controls":_,onClick:()=>C(!w),children:[e.jsx("span",{className:pe.navGroupLabelText,children:t}),V,e.jsx(Mn,{open:E})]}):e.jsxs("div",{id:b,role:"heading","aria-level":3,className:pe.navGroupLabel,children:[e.jsx("span",{className:pe.navGroupLabelText,children:t}),V]}),N?e.jsx("div",{ref:D,id:_,className:pe.navGroupPanel,"data-open":E?"true":"false",children:H}):H]})});nn.displayName="EvoNavGroup";const Bn=({count:n=4})=>e.jsx(e.Fragment,{children:Array.from({length:n}).map((t,s)=>e.jsxs("li",{"aria-hidden":"true",className:pe.navSkeletonItem,children:[e.jsx("span",{className:pe.navSkeletonIcon}),e.jsx("span",{className:pe.navSkeletonText,style:{width:`${45+s%4*12}%`}})]},s))}),sn=r.forwardRef(function({label:t="Create New",icon:s,className:o,type:a="button",...i},l){return e.jsx("li",{className:pe.navLi,children:e.jsxs("button",{ref:l,type:a,className:[pe.navQuickAction,o].filter(Boolean).join(" "),...i,children:[e.jsx("span",{className:pe.navIcon,children:s??e.jsx(dr,{})}),e.jsx("span",{className:pe.navLabel,children:t})]})})});sn.displayName="EvoNavQuickAction";const Rn=r.forwardRef(function({children:t,breakpoint:s=768,drawerOpen:o,defaultDrawerOpen:a=!1,onDrawerOpenChange:i,hideTrigger:l=!1,collapsed:c=!1,className:p,"aria-label":v="Main navigation",...b},_){const x=cr(s),[N,w]=Zt(o,a,i),C=r.useCallback(()=>w(!1),[w]),E=r.useId(),D=r.useRef(null);r.useEffect(()=>{if(!x||!N)return;const j=M=>{M.key==="Escape"&&C()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[x,N,C]),r.useEffect(()=>{if(!x||!N)return;const j=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=j}},[x,N]),r.useEffect(()=>{!x&&N&&C()},[x,N,C]);const V=r.useMemo(()=>({isMobile:x,drawerOpen:N,setDrawerOpen:w,closeDrawer:C,rootId:E,collapsed:c}),[x,N,w,C,E,c]),H=[pe.navContainer,x?pe.navMobile:pe.navDesktop,x&&N?pe.navDrawerOpen:"",c?pe.navCollapsed:"",p].filter(Boolean).join(" "),ue=j=>{D.current=j,typeof _=="function"?_(j):_&&(_.current=j)};return e.jsxs(Jt.Provider,{value:V,children:[x&&!l&&e.jsx("button",{type:"button",className:pe.navTrigger,"aria-expanded":N,"aria-controls":E,"aria-label":N?"Close navigation":"Open navigation",onClick:()=>w(!N),children:N?e.jsx(hr,{}):e.jsx(ur,{})}),x&&N&&e.jsx("div",{className:pe.navBackdrop,"aria-hidden":"true",onClick:C}),e.jsx("nav",{ref:ue,id:E,role:"navigation","aria-label":v,"aria-hidden":x&&!N?!0:void 0,className:H,...b,children:e.jsx("ul",{className:pe.navList,children:t})})]})});Rn.displayName="EvoNav";const _r=Object.assign(Rn,{Group:nn,Item:en,SubItem:tn,Skeleton:Bn,QuickAction:sn}),fr="_topNav_hq4o3_45",mr="_topNavInner_hq4o3_53",vr="_topNavBrand_hq4o3_61",xr="_topNavMenu_hq4o3_70",gr="_topNavItemRow_hq4o3_81",br="_topNavMenuScroll_hq4o3_86",yr="_topNavItem_hq4o3_81",wr="_topNavItemActive_hq4o3_126",jr="_topNavItemLabel_hq4o3_135",kr="_topNavIcon_hq4o3_139",Nr="_topNavActions_hq4o3_149",Er="_topNavSearch_hq4o3_157",Tr="_topNavSearchIcon_hq4o3_182",Ir="_topNavSearchText_hq4o3_187",$r="_topNavSearchKbd_hq4o3_192",Cr="_topNavToggle_hq4o3_203",Sr="_toggleIcon_hq4o3_227",Lr="_topNavDropdown_hq4o3_231",Mr="_topNavDropdownContent_hq4o3_247",Dr="_topNavDropdownContentOpen_hq4o3_270",Br="_topNavDropdownItem_hq4o3_275",Rr="_topNavMenuDrawer_hq4o3_311",Ar="_topNavDropdownTrigger_hq4o3_329",zr="_topNavMenuDrawerClosed_hq4o3_336",Pr="_topNavDropdownInDrawer_hq4o3_342",Or="_topNavBackdrop_hq4o3_355",Wr="_topNavSticky_hq4o3_422",Hr="_topNavProgress_hq4o3_455",qr="_topNavReducedMotion_hq4o3_468",ie={topNav:fr,topNavInner:mr,topNavBrand:vr,topNavMenu:xr,topNavItemRow:gr,topNavMenuScroll:br,topNavItem:yr,topNavItemActive:wr,topNavItemLabel:jr,topNavIcon:kr,topNavActions:Nr,topNavSearch:Er,topNavSearchIcon:Tr,topNavSearchText:Ir,topNavSearchKbd:$r,topNavToggle:Cr,toggleIcon:Sr,topNavDropdown:Lr,topNavDropdownContent:Mr,topNavDropdownContentOpen:Dr,topNavDropdownItem:Br,topNavMenuDrawer:Rr,topNavDropdownTrigger:Ar,topNavMenuDrawerClosed:zr,topNavDropdownInDrawer:Pr,topNavBackdrop:Or,topNavSticky:Wr,topNavProgress:Hr,topNavReducedMotion:qr},Fe=(...n)=>n.filter(Boolean).join(" ");function Fr(n,t){return s=>{n==null||n(s),s.defaultPrevented||t==null||t(s)}}function An(n){const{value:t,defaultValue:s,onChange:o}=n,[a,i]=r.useState(s),l=t!==void 0,c=l?t:a,p=r.useCallback(v=>{l||i(v),o==null||o(v)},[l,o]);return[c,p]}const Gr=typeof window<"u"?r.useLayoutEffect:r.useEffect;function on(n,t=!1){const[s,o]=r.useState(t);return Gr(()=>{var l;if(typeof window>"u"||!window.matchMedia)return;const a=window.matchMedia(n),i=()=>o(a.matches);return i(),(l=a.addEventListener)==null||l.call(a,"change",i),()=>{var c;return(c=a.removeEventListener)==null?void 0:c.call(a,"change",i)}},[n]),s}const Vr=n=>on(`(max-width: ${n-1}px)`),Kr=()=>on("(hover: hover) and (pointer: fine)",!0),Ur=()=>on("(prefers-reduced-motion: reduce)");function Yr(n,t,s){const[o,a]=r.useState(!1),[i,l]=r.useState(!1),[c,p]=r.useState(0),v=r.useRef(0);return r.useEffect(()=>{if(typeof window>"u"||!n){a(!1),l(!1),p(0),v.current=0;return}let b=0;const _=()=>{b=0;const N=document.documentElement,w=window.scrollY||N.scrollTop||0;if(a(w>8),l(t==="hide"?w>v.current&&w>64:!1),s){const C=N.scrollHeight-N.clientHeight||1;p(Math.min(1,Math.max(0,w/C)))}v.current=w},x=()=>{b||(b=requestAnimationFrame(_))};return _(),window.addEventListener("scroll",x,{passive:!0}),window.addEventListener("resize",x,{passive:!0}),()=>{b&&cancelAnimationFrame(b),window.removeEventListener("scroll",x),window.removeEventListener("resize",x)}},[n,t,s]),{scrolled:o,hidden:i,progress:c}}function Ft(n){return n?Array.from(n.querySelectorAll('a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])')).filter(t=>!t.hasAttribute("aria-hidden")&&t.offsetParent!==null):[]}const zn=r.forwardRef(function({children:t,...s},o){const a=r.Children.only(t),i=a.props??{},l={...s,...i};l.className=Fe(s.className,i.className),(s.style||i.style)&&(l.style={...s.style,...i.style});for(const c of Object.keys(s))if(c.startsWith("on")&&typeof s[c]=="function"){const p=s[c],v=i[c];l[c]=Fr(p,v)}return r.cloneElement(a,l)}),Tt=r.createContext(null);function Pn(n){const t=r.useContext(Tt);if(!t)throw new Error(`EvoTopNav.${n} must be rendered inside <EvoTopNav>.`);return t}const On=r.createContext(null),Qr=({open:n})=>e.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",className:ie.toggleIcon,children:n?e.jsx(e.Fragment,{children:e.jsx("path",{d:"M4 4l10 10M14 4L4 14",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}):e.jsx(e.Fragment,{children:e.jsx("path",{d:"M3 5h12M3 9h12M3 13h12",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})})}),Xr=({open:n})=>e.jsx("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none","aria-hidden":"true",className:Fe(ie.dropdownChevron,n&&ie.dropdownChevronOpen),children:e.jsx("path",{d:"M3 4.5l3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Jr=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m20 20-3.2-3.2"})]}),Wn=r.forwardRef(function({children:t,className:s,...o},a){return e.jsx("div",{ref:a,className:Fe(ie.topNavBrand,s),...o,children:t})}),Hn=r.forwardRef(function({children:t,className:s,...o},a){const i=Pn("Menu"),l=r.useRef(null),c=_=>{l.current=_,i.menuRef.current=_,typeof a=="function"?a(_):a&&(a.current=_)},p=i.toggleCount>0,v=i.isCollapsed&&p,b=v&&!i.drawerOpen;return e.jsx("ul",{ref:c,id:i.menuId,className:Fe(ie.topNavMenu,v&&ie.topNavMenuDrawer,b&&ie.topNavMenuDrawerClosed,i.isCollapsed&&!p&&ie.topNavMenuScroll,s),"data-state":v?i.drawerOpen?"open":"closed":"inline","aria-hidden":b||void 0,...o,children:t})}),qn=r.forwardRef(function({children:t,active:s,icon:o,href:a,target:i,rel:l,onClick:c,asChild:p,className:v},b){const _=r.useContext(Tt),x=!!_&&_.isCollapsed&&_.drawerOpen,N=D=>{c==null||c(D),!D.defaultPrevented&&x&&_.setDrawerOpen(!1)},w={className:Fe(ie.topNavItem,s&&ie.topNavItemActive,v),"aria-current":s?"page":void 0,"data-active":s||void 0},C=e.jsxs(e.Fragment,{children:[o&&e.jsx("span",{className:ie.topNavIcon,"aria-hidden":"true",children:o}),e.jsx("span",{className:ie.topNavItemLabel,children:t})]});let E;return p?E=e.jsx(zn,{...w,onClick:N,ref:b,children:t}):a?E=e.jsx("a",{ref:b,href:a,target:i,rel:l??(i==="_blank"?"noopener noreferrer":void 0),onClick:N,...w,children:C}):E=e.jsx("button",{ref:b,type:"button",onClick:N,...w,children:C}),e.jsx("li",{className:ie.topNavItemRow,children:E})}),Fn=r.forwardRef(function({children:t,className:s,...o},a){return e.jsx("div",{ref:a,className:Fe(ie.topNavActions,s),...o,children:t})}),Gn=r.forwardRef(function({icon:t,className:s,onClick:o,"aria-label":a,...i},l){const c=Pn("Toggle"),p=r.useRef(null);r.useEffect(()=>c.registerToggle(),[c]);const v=_=>{p.current=_,c.toggleRef.current=_,typeof l=="function"?l(_):l&&(l.current=_)},b=_=>{o==null||o(_),_.defaultPrevented||c.setDrawerOpen(!c.drawerOpen)};return e.jsx("button",{ref:v,id:c.toggleId,type:"button",className:Fe(ie.topNavToggle,s),"aria-expanded":c.drawerOpen,"aria-controls":c.menuId,"aria-label":a??(c.drawerOpen?"Close menu":"Open menu"),onClick:b,...i,children:t??e.jsx(Qr,{open:c.drawerOpen})})}),Vn=r.forwardRef(function({placeholder:t="Search…",shortcut:s,shortcutHint:o,className:a,onClick:i,...l},c){const p=r.useRef(null),v=N=>{p.current=N,typeof c=="function"?c(N):c&&(c.current=N)},[b,_]=r.useState(null);r.useEffect(()=>{if(o!==void 0)return;const N=typeof navigator<"u"&&(navigator.platform||navigator.userAgent)||"";_(/Mac|iPhone|iPad|iPod/.test(N)?"⌘K":"Ctrl K")},[o]);const x=o!==void 0?o:b;return r.useEffect(()=>{if(!s)return;const N=s.toLowerCase().split("+").map(D=>D.trim()),w=N.some(D=>["mod","cmd","meta","ctrl","control"].includes(D)),C=N[N.length-1],E=D=>{var H;const V=D.metaKey||D.ctrlKey;(!w||V)&&D.key.toLowerCase()===C&&(D.preventDefault(),(H=p.current)==null||H.click())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[s]),e.jsxs("button",{ref:v,className:Fe(ie.topNavSearch,a),onClick:i,...l,type:"button",children:[e.jsx("span",{className:ie.topNavSearchIcon,"aria-hidden":"true",children:e.jsx(Jr,{})}),e.jsx("span",{className:ie.topNavSearchText,children:t}),x!=null&&e.jsx("kbd",{className:ie.topNavSearchKbd,children:x})]})}),Kn=({label:n,icon:t,active:s,hoverable:o=!0,open:a,defaultOpen:i=!1,onOpenChange:l,children:c,className:p})=>{const v=r.useContext(Tt),b=!!v&&v.isCollapsed&&v.toggleCount>0,[_,x]=An({value:a,defaultValue:i,onChange:l}),N=Kr(),w=o&&N&&!b,C=r.useRef(null),E=r.useRef(null),D=r.useRef(null),V=r.useId(),H=r.useRef(null),ue=r.useCallback(()=>{var y;x(!1),(y=C.current)==null||y.focus()},[x]);r.useEffect(()=>{if(!_||b)return;const y=te=>{const R=D.current;R&&te.target instanceof Node&&!R.contains(te.target)&&x(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[_,b,x]),r.useEffect(()=>{if(!_||b)return;const y=te=>{te.key==="Escape"&&(te.stopPropagation(),ue())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[_,b,ue]);const j=r.useCallback(y=>{var P;const te=Ft(E.current);if(te.length===0)return;const R=document.activeElement,he=R?te.indexOf(R):-1;let $=0;y==="first"?$=0:y==="last"?$=te.length-1:y===1?$=he<0?0:(he+1)%te.length:$=he<0?te.length-1:(he-1+te.length)%te.length,(P=te[$])==null||P.focus()},[]),M=y=>{y.key==="ArrowDown"||y.key==="Enter"||y.key===" "?(y.preventDefault(),x(!0),requestAnimationFrame(()=>j("first"))):y.key==="ArrowUp"&&(y.preventDefault(),x(!0),requestAnimationFrame(()=>j("last")))},B=y=>{y.key==="ArrowDown"?(y.preventDefault(),j(1)):y.key==="ArrowUp"?(y.preventDefault(),j(-1)):y.key==="Home"?(y.preventDefault(),j("first")):y.key==="End"?(y.preventDefault(),j("last")):y.key==="Tab"&&x(!1)},S=()=>{w&&(H.current&&clearTimeout(H.current),x(!0))},se=()=>{w&&(H.current&&clearTimeout(H.current),H.current=setTimeout(()=>x(!1),120))},Q=r.useMemo(()=>({open:_,setOpen:x,triggerRef:C,contentRef:E,contentId:V,focusItem:j,inDrawer:b}),[_,x,V,j,b]);return e.jsx(On.Provider,{value:Q,children:e.jsxs("li",{ref:D,className:Fe(ie.topNavDropdown,b&&ie.topNavDropdownInDrawer,_&&ie.topNavDropdownOpen,p),onMouseEnter:S,onMouseLeave:se,children:[e.jsxs("button",{ref:C,type:"button",className:Fe(ie.topNavItem,ie.topNavDropdownTrigger,s&&ie.topNavItemActive),"aria-haspopup":"menu","aria-expanded":_,"aria-controls":V,"aria-current":s?"page":void 0,onClick:()=>x(!_),onKeyDown:M,children:[t&&e.jsx("span",{className:ie.topNavIcon,"aria-hidden":"true",children:t}),e.jsx("span",{className:ie.topNavItemLabel,children:n}),e.jsx(Xr,{open:_})]}),e.jsx("ul",{ref:E,id:V,role:"menu",className:Fe(ie.topNavDropdownContent,_&&ie.topNavDropdownContentOpen),"aria-hidden":!_||void 0,onKeyDown:B,children:c})]})})},Un=r.forwardRef(function({children:t,icon:s,active:o,href:a,target:i,rel:l,onClick:c,asChild:p,className:v},b){const _=r.useContext(On),x=r.useContext(Tt),N=D=>{c==null||c(D),D.defaultPrevented||(_==null||_.setOpen(!1),x&&x.isCollapsed&&x.drawerOpen&&x.setDrawerOpen(!1))},w={className:Fe(ie.topNavDropdownItem,o&&ie.topNavItemActive,v),role:"menuitem","aria-current":o?"page":void 0},C=e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:ie.topNavIcon,"aria-hidden":"true",children:s}),e.jsx("span",{className:ie.topNavItemLabel,children:t})]});let E;return p?E=e.jsx(zn,{...w,onClick:N,ref:b,children:t}):a?E=e.jsx("a",{ref:b,href:a,target:i,rel:l??(i==="_blank"?"noopener noreferrer":void 0),onClick:N,...w,children:C}):E=e.jsx("button",{ref:b,type:"button",onClick:N,...w,children:C}),e.jsx("li",{children:E})}),Je=r.forwardRef(function({children:t,open:s,defaultOpen:o=!1,onOpenChange:a,collapseBelow:i=768,entrance:l="none",sticky:c=!1,scrollBehavior:p="none",showProgress:v=!1,className:b,style:_,...x},N){const[w,C]=An({value:s,defaultValue:o,onChange:a}),E=Vr(i),D=Ur(),V=p!=="none"||v,{scrolled:H,hidden:ue,progress:j}=Yr(V,p,v),M=l!=="none"&&!D,B=v?{..._,"--evo-topnav-progress":j}:_,[S,se]=r.useState(0),Q=r.useCallback(()=>(se(W=>W+1),()=>se(W=>Math.max(0,W-1))),[]),y=r.useId(),te=r.useId(),R=r.useRef(null),he=r.useRef(null),$=r.useRef(null),P=E&&w&&S>0;r.useEffect(()=>{!E&&w&&C(!1)},[E,w,C]),r.useEffect(()=>{if(!P)return;const W=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=W}},[P]),r.useEffect(()=>{if(!P)return;$.current=document.activeElement??null;const G=requestAnimationFrame(()=>{var J;(J=Ft(R.current)[0])==null||J.focus()}),ae=ee=>{if(ee.key==="Escape"){ee.preventDefault(),C(!1);return}if(ee.key!=="Tab"||!R.current)return;const J=Ft(R.current);if(J.length===0)return;const Y=J[0],me=J[J.length-1],ye=document.activeElement;ee.shiftKey&&ye===Y?(ee.preventDefault(),me.focus()):(!ee.shiftKey&&ye===me||ye&&!R.current.contains(ye))&&(ee.preventDefault(),Y.focus())};return document.addEventListener("keydown",ae),()=>{cancelAnimationFrame(G),document.removeEventListener("keydown",ae)}},[P,C]),r.useEffect(()=>{if(P)return;const W=$.current;if(W&&typeof W.focus=="function"){const G=document.activeElement;(!G||G===document.body||R.current&&R.current.contains(G))&&W.focus(),$.current=null}},[P]);const A=r.useMemo(()=>({drawerOpen:w,setDrawerOpen:C,isCollapsed:E,menuId:y,toggleId:te,registerToggle:Q,toggleCount:S,menuRef:R,toggleRef:he}),[w,C,E,y,te,Q,S]);return e.jsx(Tt.Provider,{value:A,children:e.jsxs("nav",{ref:N,className:Fe(ie.topNav,c&&ie.topNavSticky,P&&ie.topNavDrawerOpen,D&&ie.topNavReducedMotion,b),style:B,"data-collapsed":E||void 0,"data-drawer-open":P||void 0,"data-entrance":M?l:void 0,"data-scroll":p!=="none"?p:void 0,"data-scrolled":H||void 0,"data-hidden":ue||void 0,...x,children:[e.jsx("div",{className:ie.topNavInner,children:t}),v&&e.jsx("span",{className:ie.topNavProgress,"aria-hidden":"true"}),P&&e.jsx("div",{className:ie.topNavBackdrop,onClick:()=>C(!1),"aria-hidden":"true"})]})})});Wn.displayName="EvoTopNav.Brand";Hn.displayName="EvoTopNav.Menu";qn.displayName="EvoTopNav.Item";Fn.displayName="EvoTopNav.Actions";Gn.displayName="EvoTopNav.Toggle";Vn.displayName="EvoTopNav.Search";Kn.displayName="EvoTopNav.Dropdown";Un.displayName="EvoTopNav.DropdownItem";Je.displayName="EvoTopNav";Je.Brand=Wn;Je.Menu=Hn;Je.Item=qn;Je.Actions=Fn;Je.Toggle=Gn;Je.Search=Vn;Je.Dropdown=Kn;Je.DropdownItem=Un;const Zr="_pagination_1lhxw_1",ea="_pageBtn_1lhxw_8",ta="_activePage_1lhxw_34",na="_navBtn_1lhxw_45",sa="_ellipsis_1lhxw_49",ot={pagination:Zr,pageBtn:ea,activePage:ta,navBtn:na,ellipsis:sa},_n=(n,t)=>Array.from({length:t-n+1},(s,o)=>n+o),oa=({total:n,page:t,pageSize:s=10,siblingCount:o=1,onChange:a,className:i=""})=>{const l=Math.max(1,Math.ceil(n/s)),c=()=>{if(l<=7)return _n(1,l);const p=Math.max(2,t-o),v=Math.min(l-1,t+o),b=[1];return p>2&&b.push("..."),b.push(..._n(p,v)),v<l-1&&b.push("..."),l>1&&b.push(l),b};return e.jsxs("nav",{className:`${ot.pagination} ${i}`,"aria-label":"Pagination",children:[e.jsx("button",{className:`${ot.pageBtn} ${ot.navBtn}`,disabled:t<=1,onClick:()=>a(t-1),"aria-label":"Previous page",children:"‹"}),c().map((p,v)=>p==="..."?e.jsx("span",{className:ot.ellipsis,children:"…"},`ellipsis-${v}`):e.jsx("button",{className:[ot.pageBtn,p===t?ot.activePage:""].filter(Boolean).join(" "),onClick:()=>a(p),"aria-label":`Page ${p}`,"aria-current":p===t?"page":void 0,children:p},p)),e.jsx("button",{className:`${ot.pageBtn} ${ot.navBtn}`,disabled:t>=l,onClick:()=>a(t+1),"aria-label":"Next page",children:"›"})]})},ra="_overlay_1qpdy_1",aa="_palette_1qpdy_23",ia="_searchRow_1qpdy_46",ca="_searchIconWrap_1qpdy_54",la="_searchInput_1qpdy_61",da="_escBadge_1qpdy_75",ua="_results_1qpdy_86",ha="_empty_1qpdy_102",pa="_group_1qpdy_109",_a="_groupLabel_1qpdy_113",fa="_resultItem_1qpdy_122",ma="_resultActive_1qpdy_135",va="_resultIcon_1qpdy_139",xa="_resultLabel_1qpdy_149",ga="_resultDesc_1qpdy_157",ba="_resultShortcut_1qpdy_163",ya="_footer_1qpdy_178",wa="_footerRight_1qpdy_202",De={overlay:ra,palette:aa,searchRow:ia,searchIconWrap:ca,searchInput:la,escBadge:da,results:ua,empty:ha,group:pa,groupLabel:_a,resultItem:fa,resultActive:ma,resultIcon:va,resultLabel:xa,resultDesc:ga,resultShortcut:ba,footer:ya,footerRight:wa},ja=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),ka=()=>e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",width:"16",height:"16",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),Na=({items:n,placeholder:t="Search commands…",open:s,onClose:o})=>{const[a,i]=r.useState(!1),[l,c]=r.useState(""),[p,v]=r.useState(0),b=r.useRef(null),_=r.useRef(null),x=s!==void 0,N=x?s:a,w=r.useCallback(()=>{x||i(!1),o==null||o()},[x,o]);r.useEffect(()=>{const j=M=>{(M.ctrlKey||M.metaKey)&&M.key==="k"&&(M.preventDefault(),x||i(B=>!B)),M.key==="Escape"&&N&&w()};return document.addEventListener("keydown",j),()=>document.removeEventListener("keydown",j)},[x,N,w]),r.useEffect(()=>{if(N){c(""),v(0);const j=setTimeout(()=>{var M;return(M=b.current)==null?void 0:M.focus()},30);return()=>clearTimeout(j)}},[N]);const E=(l.trim()?n.filter(j=>{var M,B;return j.label.toLowerCase().includes(l.toLowerCase())||((M=j.description)==null?void 0:M.toLowerCase().includes(l.toLowerCase()))||((B=j.group)==null?void 0:B.toLowerCase().includes(l.toLowerCase()))}):n).reduce((j,M)=>{const B=M.group??"Actions";return j[B]||(j[B]=[]),j[B].push(M),j},{}),D=Object.values(E).flat(),V=j=>{var B;const M=(B=_.current)==null?void 0:B.querySelector(`[data-idx="${j}"]`);M==null||M.scrollIntoView({block:"nearest"})},H=j=>{j.key==="ArrowDown"?(j.preventDefault(),v(M=>{const B=Math.min(M+1,D.length-1);return V(B),B})):j.key==="ArrowUp"?(j.preventDefault(),v(M=>{const B=Math.max(M-1,0);return V(B),B})):j.key==="Enter"&&D[p]&&(D[p].onSelect(),w())};if(!N)return null;let ue=0;return e.jsx("div",{className:De.overlay,onClick:w,role:"dialog","aria-modal":"true",children:e.jsxs("div",{className:De.palette,onClick:j=>j.stopPropagation(),onKeyDown:H,children:[e.jsxs("div",{className:De.searchRow,children:[e.jsx("span",{className:De.searchIconWrap,children:e.jsx(ka,{})}),e.jsx("input",{ref:b,className:De.searchInput,placeholder:t,value:l,onChange:j=>{c(j.target.value),v(0)},"aria-label":"Command search"}),e.jsx("kbd",{className:De.escBadge,children:"Esc"})]}),e.jsxs("div",{className:De.results,ref:_,children:[D.length===0&&e.jsxs("div",{className:De.empty,children:["No results for “",l,"”"]}),Object.entries(E).map(([j,M])=>e.jsxs("div",{className:De.group,children:[e.jsx("div",{className:De.groupLabel,children:j}),M.map(B=>{const S=ue++;return e.jsxs("button",{"data-idx":S,className:[De.resultItem,S===p?De.resultActive:""].filter(Boolean).join(" "),onClick:()=>{B.onSelect(),w()},onMouseEnter:()=>v(S),children:[B.icon&&e.jsx("span",{className:De.resultIcon,children:B.icon}),e.jsx("span",{className:De.resultLabel,children:B.label}),B.description&&e.jsx("span",{className:De.resultDesc,children:B.description}),B.shortcut&&e.jsx("span",{className:De.resultShortcut,children:B.shortcut.map((se,Q)=>e.jsx("kbd",{children:se},Q))})]},B.label)})]},j))]}),e.jsxs("div",{className:De.footer,children:[e.jsxs("span",{children:[e.jsx("kbd",{children:"↑"}),e.jsx("kbd",{children:"↓"})," navigate"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"↵"})," select"]}),e.jsxs("span",{children:[e.jsx("kbd",{children:"Esc"})," close"]}),e.jsxs("span",{className:De.footerRight,children:[e.jsx("kbd",{children:ja?"⌘":"Ctrl"}),e.jsx("kbd",{children:"K"})," toggle"]})]})]})})},Ea="_field_l0kkf_1",Ta="_fullWidth_l0kkf_8",Ia="_label_l0kkf_12",$a="_inputWrapper_l0kkf_18",Ca="_hasError_l0kkf_30",Sa="_sm_l0kkf_38",La="_md_l0kkf_42",Ma="_lg_l0kkf_46",Da="_input_l0kkf_18",Ba="_adornment_l0kkf_69",Ra="_trailingAdornment_l0kkf_78",Aa="_errorText_l0kkf_83",za="_helperText_l0kkf_89",Ve={field:Ea,fullWidth:Ta,label:Ia,inputWrapper:$a,hasError:Ca,sm:Sa,md:La,lg:Ma,input:Da,adornment:Ba,trailingAdornment:Ra,errorText:Aa,helperText:za},Pa=({label:n,helperText:t,error:s,size:o="md",leadingAdornment:a,trailingAdornment:i,fullWidth:l=!1,className:c="",id:p,...v})=>{const b=p??(n==null?void 0:n.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:[Ve.field,l?Ve.fullWidth:"",c].filter(Boolean).join(" "),children:[n&&e.jsx("label",{htmlFor:b,className:Ve.label,children:n}),e.jsxs("div",{className:[Ve.inputWrapper,Ve[o],s?Ve.hasError:""].filter(Boolean).join(" "),children:[a&&e.jsx("span",{className:Ve.adornment,children:a}),e.jsx("input",{id:b,className:Ve.input,"aria-invalid":!!s,"aria-describedby":s?`${b}-error`:t?`${b}-helper`:void 0,...v}),i&&e.jsx("span",{className:`${Ve.adornment} ${Ve.trailingAdornment}`,children:i})]}),s&&e.jsx("p",{id:`${b}-error`,className:Ve.errorText,children:s}),!s&&t&&e.jsx("p",{id:`${b}-helper`,className:Ve.helperText,children:t})]})},Oa="_field_t1e02_1",Wa="_fullWidth_t1e02_9",Ha="_label_t1e02_13",qa="_shell_t1e02_19",Fa="_hasError_t1e02_33",Ga="_disabled_t1e02_39",Va="_dragOver_t1e02_43",Ka="_toolbar_t1e02_48",Ua="_divider_t1e02_61",Ya="_toolBtn_t1e02_69",Qa="_toolBtnActive_t1e02_101",Xa="_editor_t1e02_110",Ja="_editorEmpty_t1e02_122",Za="_dropOverlay_t1e02_186",ei="_linkPrompt_t1e02_202",ti="_linkInput_t1e02_211",ni="_linkBtn_t1e02_228",si="_linkBtnGhost_t1e02_229",oi="_helperText_t1e02_256",ri="_errorText_t1e02_262",Te={field:Oa,fullWidth:Wa,label:Ha,shell:qa,hasError:Fa,disabled:Ga,dragOver:Va,toolbar:Ka,divider:Ua,toolBtn:Ya,toolBtnActive:Qa,editor:Xa,editorEmpty:Ja,dropOverlay:Za,linkPrompt:ei,linkInput:ti,linkBtn:ni,linkBtnGhost:si,helperText:oi,errorText:ri},Ce=({children:n})=>e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:n}),Se={bold:e.jsxs(Ce,{children:[e.jsx("path",{d:"M6 4h8a4 4 0 0 1 0 8H6z"}),e.jsx("path",{d:"M6 12h9a4 4 0 0 1 0 8H6z"})]}),italic:e.jsxs(Ce,{children:[e.jsx("line",{x1:"19",y1:"4",x2:"10",y2:"4"}),e.jsx("line",{x1:"14",y1:"20",x2:"5",y2:"20"}),e.jsx("line",{x1:"15",y1:"4",x2:"9",y2:"20"})]}),underline:e.jsxs(Ce,{children:[e.jsx("path",{d:"M6 3v7a6 6 0 0 0 12 0V3"}),e.jsx("line",{x1:"4",y1:"21",x2:"20",y2:"21"})]}),strike:e.jsxs(Ce,{children:[e.jsx("path",{d:"M16 4H9a3 3 0 0 0-2.83 4"}),e.jsx("path",{d:"M14 12a4 4 0 0 1 0 8H6"}),e.jsx("line",{x1:"4",y1:"12",x2:"20",y2:"12"})]}),h1:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M17 10l3-2v10"})]}),h2:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1"})]}),h3:e.jsxs(Ce,{children:[e.jsx("path",{d:"M4 12h8"}),e.jsx("path",{d:"M4 18V6"}),e.jsx("path",{d:"M12 18V6"}),e.jsx("path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2"}),e.jsx("path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"})]}),paragraph:e.jsxs(Ce,{children:[e.jsx("path",{d:"M13 4v16"}),e.jsx("path",{d:"M17 4v16"}),e.jsx("path",{d:"M19 4H9.5a4.5 4.5 0 0 0 0 9H13"})]}),ul:e.jsxs(Ce,{children:[e.jsx("line",{x1:"8",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"8",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"8",y1:"18",x2:"21",y2:"18"}),e.jsx("line",{x1:"3",y1:"6",x2:"3.01",y2:"6"}),e.jsx("line",{x1:"3",y1:"12",x2:"3.01",y2:"12"}),e.jsx("line",{x1:"3",y1:"18",x2:"3.01",y2:"18"})]}),ol:e.jsxs(Ce,{children:[e.jsx("line",{x1:"10",y1:"6",x2:"21",y2:"6"}),e.jsx("line",{x1:"10",y1:"12",x2:"21",y2:"12"}),e.jsx("line",{x1:"10",y1:"18",x2:"21",y2:"18"}),e.jsx("path",{d:"M4 6h1v4"}),e.jsx("path",{d:"M4 10h2"}),e.jsx("path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1"})]}),quote:e.jsxs(Ce,{children:[e.jsx("path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z"}),e.jsx("path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z"})]}),code:e.jsxs(Ce,{children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}),link:e.jsxs(Ce,{children:[e.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),e.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),image:e.jsxs(Ce,{children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),e.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),e.jsx("polyline",{points:"21 15 16 10 5 21"})]}),alignLeft:e.jsxs(Ce,{children:[e.jsx("line",{x1:"17",y1:"10",x2:"3",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"17",y1:"18",x2:"3",y2:"18"})]}),alignCenter:e.jsxs(Ce,{children:[e.jsx("line",{x1:"18",y1:"10",x2:"6",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"18",y1:"18",x2:"6",y2:"18"})]}),alignRight:e.jsxs(Ce,{children:[e.jsx("line",{x1:"21",y1:"10",x2:"7",y2:"10"}),e.jsx("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),e.jsx("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),e.jsx("line",{x1:"21",y1:"18",x2:"7",y2:"18"})]}),clear:e.jsx(Ce,{children:e.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),undo:e.jsxs(Ce,{children:[e.jsx("path",{d:"M3 7v6h6"}),e.jsx("path",{d:"M21 17a9 9 0 0 0-15-6.7L3 13"})]}),redo:e.jsxs(Ce,{children:[e.jsx("path",{d:"M21 7v6h-6"}),e.jsx("path",{d:"M3 17a9 9 0 0 1 15-6.7L21 13"})]})},Wt={bold:{label:"Bold",icon:Se.bold,command:"bold",shortcut:"⌘B"},italic:{label:"Italic",icon:Se.italic,command:"italic",shortcut:"⌘I"},underline:{label:"Underline",icon:Se.underline,command:"underline",shortcut:"⌘U"},strike:{label:"Strikethrough",icon:Se.strike,command:"strikeThrough",query:"strikeThrough"},h1:{label:"Heading 1",icon:Se.h1,command:"formatBlock",arg:"H1"},h2:{label:"Heading 2",icon:Se.h2,command:"formatBlock",arg:"H2"},h3:{label:"Heading 3",icon:Se.h3,command:"formatBlock",arg:"H3"},paragraph:{label:"Paragraph",icon:Se.paragraph,command:"formatBlock",arg:"P"},ul:{label:"Bulleted list",icon:Se.ul,command:"insertUnorderedList"},ol:{label:"Numbered list",icon:Se.ol,command:"insertOrderedList"},quote:{label:"Blockquote",icon:Se.quote,command:"formatBlock",arg:"BLOCKQUOTE"},code:{label:"Inline code",icon:Se.code,command:"formatBlock",arg:"PRE"},"align-left":{label:"Align left",icon:Se.alignLeft,command:"justifyLeft"},"align-center":{label:"Align center",icon:Se.alignCenter,command:"justifyCenter"},"align-right":{label:"Align right",icon:Se.alignRight,command:"justifyRight"},clear:{label:"Clear formatting",icon:Se.clear,command:"removeFormat"},undo:{label:"Undo",icon:Se.undo,command:"undo",shortcut:"⌘Z"},redo:{label:"Redo",icon:Se.redo,command:"redo",shortcut:"⇧⌘Z"}},ai=["image/png","image/jpeg","image/gif","image/webp","image/svg+xml"];function ii(n){return typeof n=="object"&&n!==null}function ci(n){return new Promise((t,s)=>{const o=new FileReader;o.onload=()=>t(String(o.result)),o.onerror=()=>s(o.error),o.readAsDataURL(n)})}function ht(n,t){try{document.execCommand(n,!1,t)}catch{}}const li=/^(?:P|DIV|H[1-6]|BLOCKQUOTE|PRE|UL|OL|LI|TABLE)$/;function Ct(n,t){const s=window.getSelection();if(!s||s.rangeCount===0)return null;const o=s.getRangeAt(0).startContainer,a=o.nodeType===1?o:o.parentElement;let i=null;try{i=(a==null?void 0:a.closest(t))??null}catch{return null}return i&&n.contains(i)&&i!==n?i:null}function fn(n,t){var b;const s=window.getSelection();if(!s||s.rangeCount===0)return!1;const o=s.getRangeAt(0),a=o.startContainer,i=a.nodeType===1?a:a.parentElement;if(!i)return!1;const l=[];let c=null;try{c=i.closest(t)}catch{return!1}for(;c&&n.contains(c)&&c!==n;)l.push(c),c=((b=c.parentElement)==null?void 0:b.closest(t))??null;if(l.length===0)return!1;const p=document.createElement("span");p.setAttribute("data-evo-caret",""),o.insertNode(p),l.forEach(_=>{if(Array.from(_.children).some(N=>li.test(N.tagName)))_.replaceWith(...Array.from(_.childNodes));else{const N=document.createElement("p");for(;_.firstChild;)N.appendChild(_.firstChild);N.childNodes.length||N.appendChild(document.createElement("br")),_.replaceWith(N)}});const v=n.querySelector("span[data-evo-caret]");if(v){const _=v.parentElement,x=document.createRange();x.setStartBefore(v),x.collapse(!0),s.removeAllRanges(),s.addRange(x),v.remove(),_&&!_.childNodes.length&&_.appendChild(document.createElement("br"))}return!0}function di(n){const t=/^(?:P|DIV|H[1-6]|UL|OL|PRE|BLOCKQUOTE|TABLE)$/,s=[];let o=[];const a=()=>{if(!o.length)return;const i=document.createElement("p");o.forEach(l=>i.appendChild(l)),o=[],s.push(i)};return Array.from(n.childNodes).forEach(i=>{if(i.nodeType===1&&t.test(i.tagName)){a();let l=i;if(l.tagName==="DIV"){const c=document.createElement("p");for(;l.firstChild;)c.appendChild(l.firstChild);l=c}s.push(l)}else o.push(i)}),a(),s.forEach(i=>{!i.textContent&&!i.querySelector("br,img")&&i.appendChild(document.createElement("br"))}),s}function ui(n){const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const s=t.getRangeAt(0);if(!s.collapsed)return!1;const o=s.startContainer,a=o.nodeType===1?o:o.parentElement,i=(a==null?void 0:a.closest("pre,blockquote"))??null;if(!i||!n.contains(i)||i===n)return!1;const l=document.createRange();l.setStart(s.startContainer,s.startOffset),l.setEnd(i,i.childNodes.length);const c=di(l.extractContents());if(c.length===0){const b=document.createElement("p");b.appendChild(document.createElement("br")),c.push(b)}let p=i;c.forEach(b=>{p.after(b),p=b}),i.firstChild||i.remove();const v=document.createRange();return v.setStart(c[0],0),v.collapse(!0),t.removeAllRanges(),t.addRange(v),!0}const hi=["bold","italic","underline","divider","h1","h2","divider","ul","ol","divider","link","image"],pi=r.forwardRef(function({value:t,defaultValue:s,onChange:o,tools:a=hi,placeholder:i="Start writing…",minHeight:l=160,maxHeight:c,disabled:p=!1,readOnly:v=!1,label:b,helperText:_,error:x,fullWidth:N=!1,onImageUpload:w,acceptedImageTypes:C=ai,maxImageSize:E,onImageError:D,className:V="",id:H},ue){const j=r.useRef(null),M=r.useRef(null),B=r.useRef(""),S=t!==void 0,[se,Q]=r.useState({}),[y,te]=r.useState(!0),[R,he]=r.useState(!1),[$,P]=r.useState(null),A=H??(b==null?void 0:b.toLowerCase().replace(/\s+/g,"-"))??void 0;r.useEffect(()=>{var u,T;const m=j.current;m&&(S?t!==B.current&&(m.innerHTML=t??"",B.current=t??"",te(!((u=m.textContent)!=null&&u.trim()))):s&&!B.current&&(m.innerHTML=s,B.current=s,te(!((T=m.textContent)!=null&&T.trim()))))},[t,s,S]);const W=r.useCallback(()=>{const m=j.current,u={};Object.entries(Wt).forEach(([T,I])=>{try{I.command==="formatBlock"?m?(I.arg??"").toUpperCase()==="P"?u[T]=!!Ct(m,"P,DIV")&&!Ct(m,"BLOCKQUOTE,PRE,H1,H2,H3,H4,H5,H6"):u[T]=!!Ct(m,I.arg??""):u[T]=!1:u[T]=document.queryCommandState(I.query??I.command)}catch{u[T]=!1}}),Q(u)},[]),G=r.useCallback(()=>{var T;const m=j.current;if(!m)return;const u=m.innerHTML;B.current=u,te(!((T=m.textContent)!=null&&T.trim())&&!m.querySelector("img")),o==null||o(u),W()},[o,W]);r.useImperativeHandle(ue,()=>({getHTML:()=>{var m;return((m=j.current)==null?void 0:m.innerHTML)??""},setHTML:m=>{const u=j.current;u&&(u.innerHTML=m,G())},getText:()=>{var m;return((m=j.current)==null?void 0:m.textContent)??""},focus:()=>{var m;return(m=j.current)==null?void 0:m.focus()},insertImage:(m,u="")=>ae(m,u),insertHTML:m=>{var u;(u=j.current)==null||u.focus(),ht("insertHTML",m),G()},clear:()=>{const m=j.current;m&&(m.innerHTML="",G())}}),[G]);const ae=r.useCallback((m,u="")=>{const T=j.current;if(!T)return;T.focus();const I=m.replace(/"/g,"&quot;"),K=u.replace(/"/g,"&quot;");ht("insertHTML",`<img src="${I}" alt="${K}" /><p data-evo-caret><br></p>`);const fe=T.querySelector("p[data-evo-caret]");if(fe){fe.removeAttribute("data-evo-caret");const oe=window.getSelection(),Le=document.createRange();Le.setStart(fe,0),Le.collapse(!0),oe==null||oe.removeAllRanges(),oe==null||oe.addRange(Le)}G()},[G]),ee=r.useCallback(async m=>{if(!C.includes(m.type)){D==null||D({code:"wrong-type",message:`Unsupported image type: ${m.type}`});return}if(E&&m.size>E){D==null||D({code:"too-large",message:`Image exceeds ${(E/1024/1024).toFixed(1)} MB`});return}try{const u=w?await w(m):await ci(m);ae(u,m.name)}catch(u){D==null||D({code:"upload-failed",message:u instanceof Error?u.message:"Upload failed"})}},[C,E,w,D,ae]),J=r.useCallback(m=>{const u=j.current;u==null||u.focus();const T=Wt[m];if(T){if(T.command==="formatBlock"&&u){const I=T.arg??"";I.toUpperCase()!=="P"&&Ct(u,I)?fn(u,I):(fn(u,"BLOCKQUOTE,PRE,H1,H2,H3,H4,H5,H6"),ht("formatBlock",I))}else ht(T.command,T.arg);G()}},[G]),Y=r.useCallback(()=>{var m;(m=M.current)==null||m.click()},[]),me=r.useCallback(()=>{const m=window.getSelection(),u=m&&m.rangeCount>0?m.getRangeAt(0).cloneRange():null;P({url:"https://",range:u})},[]),ye=r.useCallback(()=>{var T,I;if(!$)return;const{url:m,range:u}=$;if((T=j.current)==null||T.focus(),u){const K=window.getSelection();K==null||K.removeAllRanges(),K==null||K.addRange(u)}if(m&&m!=="https://"){ht("createLink",m);const K=(I=j.current)==null?void 0:I.querySelectorAll('a[href="'+m+'"]');K==null||K.forEach(fe=>fe.setAttribute("target","_blank"))}P(null),G()},[$,G]),we=r.useCallback(()=>{G()},[G]),le=r.useCallback(m=>{if(m.key==="Enter"&&!m.shiftKey&&!m.metaKey&&!m.ctrlKey&&!m.altKey){const I=j.current;if(I&&ui(I)){m.preventDefault(),G();return}}if(!(m.metaKey||m.ctrlKey))return;const T=m.key.toLowerCase();T==="b"?(m.preventDefault(),J("bold")):T==="i"?(m.preventDefault(),J("italic")):T==="u"&&(m.preventDefault(),J("underline"))},[J,G]),Be=r.useCallback(async m=>{var I,K;const u=(I=m.clipboardData)==null?void 0:I.items;if(!u)return;for(let fe=0;fe<u.length;fe++){const oe=u[fe];if(oe.type.startsWith("image/")){m.preventDefault();const Le=oe.getAsFile();Le&&await ee(Le);return}}const T=(K=m.clipboardData)==null?void 0:K.getData("text/plain");T!==void 0&&T!==""&&(m.preventDefault(),ht("insertText",T))},[ee]),je=r.useCallback(m=>{m.dataTransfer.types.includes("Files")&&(m.preventDefault(),he(!0))},[]),ge=r.useCallback(()=>he(!1),[]),de=r.useCallback(async m=>{he(!1);const u=Array.from(m.dataTransfer.files??[]).filter(T=>T.type.startsWith("image/"));if(u.length!==0){m.preventDefault();for(const T of u)await ee(T)}},[ee]),be=r.useCallback(async m=>{const u=Array.from(m.target.files??[]);m.target.value="";for(const T of u)await ee(T)},[ee]);r.useEffect(()=>{const m=()=>{const u=j.current;u&&(document.activeElement===u||u.contains(document.activeElement))&&W()};return document.addEventListener("selectionchange",m),()=>document.removeEventListener("selectionchange",m)},[W]);const We=r.useMemo(()=>a.length>0?e.jsx("div",{className:Te.toolbar,role:"toolbar","aria-label":"Formatting toolbar",children:a.map((u,T)=>{var fe;if(u==="divider")return e.jsx("span",{className:Te.divider,"aria-hidden":"true"},`d-${T}`);if(ii(u)){const oe=((fe=u.isActive)==null?void 0:fe.call(u))??!1;return e.jsx("button",{type:"button",className:[Te.toolBtn,oe?Te.toolBtnActive:""].filter(Boolean).join(" "),title:u.label,"aria-label":u.label,"aria-pressed":oe,disabled:p||v,onMouseDown:Le=>Le.preventDefault(),onClick:()=>u.onAction(ke()),children:u.icon},u.key)}if(u==="image")return e.jsx("button",{type:"button",className:Te.toolBtn,title:"Insert image","aria-label":"Insert image",disabled:p||v,onMouseDown:oe=>oe.preventDefault(),onClick:Y,children:Se.image},"image");if(u==="link")return e.jsx("button",{type:"button",className:Te.toolBtn,title:"Insert link","aria-label":"Insert link",disabled:p||v,onMouseDown:oe=>oe.preventDefault(),onClick:me,children:Se.link},"link");const I=Wt[u];if(!I)return null;const K=!!se[u];return e.jsx("button",{type:"button",className:[Te.toolBtn,K?Te.toolBtnActive:""].filter(Boolean).join(" "),title:`${I.label}${I.shortcut?` (${I.shortcut})`:""}`,"aria-label":I.label,"aria-pressed":K,disabled:p||v,onMouseDown:oe=>oe.preventDefault(),onClick:()=>J(u),children:I.icon},u)})}):null,[a,se,p,v,Y,me,J]),ke=r.useCallback(()=>({getHTML:()=>{var m;return((m=j.current)==null?void 0:m.innerHTML)??""},setHTML:m=>{const u=j.current;u&&(u.innerHTML=m,G())},getText:()=>{var m;return((m=j.current)==null?void 0:m.textContent)??""},focus:()=>{var m;return(m=j.current)==null?void 0:m.focus()},insertImage:(m,u="")=>ae(m,u),insertHTML:m=>{var u;(u=j.current)==null||u.focus(),ht("insertHTML",m),G()},clear:()=>{const m=j.current;m&&(m.innerHTML="",G())}}),[G,ae]),Ee={minHeight:typeof l=="number"?`${l}px`:l,maxHeight:c!==void 0?typeof c=="number"?`${c}px`:c:void 0};return e.jsxs("div",{className:[Te.field,N?Te.fullWidth:"",V].filter(Boolean).join(" "),children:[b&&e.jsx("label",{htmlFor:A,className:Te.label,children:b}),e.jsxs("div",{className:[Te.shell,x?Te.hasError:"",p?Te.disabled:"",R?Te.dragOver:""].filter(Boolean).join(" "),children:[We,e.jsx("div",{ref:j,id:A,className:[Te.editor,y?Te.editorEmpty:""].filter(Boolean).join(" "),contentEditable:!p&&!v,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":b??"Rich text editor","aria-invalid":!!x,"aria-readonly":v,"aria-disabled":p,"data-placeholder":i,style:Ee,onInput:we,onKeyDown:le,onPaste:Be,onDragOver:je,onDragLeave:ge,onDrop:de,onBlur:W}),R&&e.jsx("div",{className:Te.dropOverlay,"aria-hidden":"true",children:e.jsx("span",{children:"Drop image to upload"})}),$&&e.jsxs("div",{className:Te.linkPrompt,role:"dialog","aria-label":"Insert link",children:[e.jsx("input",{type:"url",className:Te.linkInput,value:$.url,autoFocus:!0,onChange:m=>P({...$,url:m.target.value}),onKeyDown:m=>{m.key==="Enter"?(m.preventDefault(),ye()):m.key==="Escape"&&(m.preventDefault(),P(null))},placeholder:"https://example.com"}),e.jsx("button",{type:"button",className:Te.linkBtn,onClick:ye,children:"Apply"}),e.jsx("button",{type:"button",className:Te.linkBtnGhost,onClick:()=>P(null),children:"Cancel"})]}),e.jsx("input",{ref:M,type:"file",accept:C.join(","),multiple:!0,hidden:!0,onChange:be})]}),x&&e.jsx("p",{className:Te.errorText,children:x}),!x&&_&&e.jsx("p",{className:Te.helperText,children:_})]})}),_i="_field_121w6_7",fi="_fullWidth_121w6_15",mi="_disabled_121w6_19",vi="_trigger_121w6_19",xi="_label_121w6_25",gi="_selectWrapper_121w6_33",bi="_open_121w6_66",yi="_hasError_121w6_70",wi="_sm_121w6_82",ji="_md_121w6_89",ki="_lg_121w6_95",Ni="_triggerValue_121w6_102",Ei="_triggerPlaceholder_121w6_103",Ti="_triggerChips_121w6_113",Ii="_chipRow_121w6_120",$i="_chip_121w6_120",Ci="_chipIcon_121w6_143",Si="_chipLabel_121w6_151",Li="_chipRemove_121w6_158",Mi="_countMore_121w6_175",Di="_triggerText_121w6_185",Bi="_triggerIcon_121w6_192",Ri="_triggerActions_121w6_200",Ai="_clearBtn_121w6_208",zi="_chevron_121w6_225",Pi="_chevronOpen_121w6_233",Oi="_menu_121w6_245",Wi="_menuOpen_121w6_1",Hi="_searchRow_121w6_271",qi="_searchIconWrap_121w6_280",Fi="_searchInput_121w6_286",Gi="_bulkRow_121w6_302",Vi="_bulkBtn_121w6_311",Ki="_bulkCount_121w6_333",Ui="_list_121w6_341",Yi="_empty_121w6_367",Qi="_option_121w6_375",Xi="_optionActive_121w6_396",Ji="_optionDisabled_121w6_396",Zi="_optionSelected_121w6_401",ec="_optionTitle_121w6_404",tc="_optionIcon_121w6_413",nc="_optionLabel_121w6_424",sc="_optionDesc_121w6_439",oc="_check_121w6_448",rc="_checkbox_121w6_459",ac="_checkboxChecked_121w6_473",ic="_errorText_121w6_484",cc="_helperText_121w6_491",X={field:_i,fullWidth:fi,disabled:mi,trigger:vi,label:xi,selectWrapper:gi,open:bi,hasError:yi,sm:wi,md:ji,lg:ki,triggerValue:Ni,triggerPlaceholder:Ei,triggerChips:Ti,chipRow:Ii,chip:$i,chipIcon:Ci,chipLabel:Si,chipRemove:Li,countMore:Mi,triggerText:Di,triggerIcon:Bi,triggerActions:Ri,clearBtn:Ai,chevron:zi,chevronOpen:Pi,menu:Oi,menuOpen:Wi,searchRow:Hi,searchIconWrap:qi,searchInput:Fi,bulkRow:Gi,bulkBtn:Vi,bulkCount:Ki,list:Ui,empty:Yi,option:Qi,optionActive:Xi,optionDisabled:Ji,optionSelected:Zi,optionTitle:ec,optionIcon:tc,optionLabel:nc,optionDesc:sc,check:oc,checkbox:rc,checkboxChecked:ac,errorText:ic,helperText:cc},lc=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),mn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),vn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),dc=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),uc=n=>{const{label:t,options:s,placeholder:o="Select an option",helperText:a,error:i,size:l="md",fullWidth:c=!1,disabled:p=!1,searchable:v=!1,clearable:b=!1,id:_,name:x,className:N=""}=n,w=n.multiple===!0,C=w?n.multipleDisplay??"chips":"chips",E=w?n.maxSelections:void 0,D=w?n.showSelectAll??!1:!1,V=r.useId(),H=_??`evo-select-${V}`,ue=`${H}-listbox`,j=n.value,M=n.defaultValue,B=j!==void 0,S=w?Array.isArray(M)?M:[]:typeof M=="string"?M:"",[se,Q]=r.useState(S),y=B?j:se,te=w?Array.isArray(y)?y:[]:typeof y=="string"&&y?[y]:[],[R,he]=r.useState(!1),[$,P]=r.useState(-1),[A,W]=r.useState(""),G=r.useRef(null),ae=r.useRef(null),ee=r.useRef(null),J=r.useRef(null),Y=v&&A?s.filter(u=>u.label.toLowerCase().includes(A.toLowerCase())):s,me=w?void 0:s.find(u=>u.value===y),ye=w?s.filter(u=>te.includes(u.value)):[],we=w&&E!==void 0&&te.length>=E,le=r.useCallback(u=>{var T,I;B||Q(u),w?(T=n.onChange)==null||T.call(n,u):(I=n.onChange)==null||I.call(n,u)},[B,w,n.onChange]),Be=r.useCallback(u=>{if(w){const T=Array.isArray(y)?y:[];if(T.includes(u))le(T.filter(I=>I!==u));else{if(E!==void 0&&T.length>=E)return;le([...T,u])}}else le(u)},[le,w,E,y]);r.useEffect(()=>{if(!R)return;const u=T=>{var I;(I=G.current)!=null&&I.contains(T.target)||(he(!1),W(""))};return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[R]),r.useEffect(()=>{if(R){const u=Y.findIndex(T=>te.includes(T.value));if(P(u>=0?u:Y.findIndex(T=>!T.disabled)),v){const T=setTimeout(()=>{var I;return(I=ee.current)==null?void 0:I.focus()},30);return()=>clearTimeout(T)}}else W(""),P(-1)},[R]),r.useEffect(()=>{var T;if(!R||$<0)return;const u=(T=J.current)==null?void 0:T.querySelector(`[data-idx="${$}"]`);u==null||u.scrollIntoView({block:"nearest"})},[$,R]);const je=u=>{if(Y.length===0)return;let T=$;for(let I=0;I<Y.length;I++)if(T=(T+u+Y.length)%Y.length,!Y[T].disabled){P(T);return}},ge=u=>{var T,I;if(!p){if(!R){(u.key==="Enter"||u.key===" "||u.key==="ArrowDown"||u.key==="ArrowUp")&&(u.preventDefault(),he(!0));return}if(u.key==="Escape")u.preventDefault(),he(!1),(T=ae.current)==null||T.focus();else if(u.key==="ArrowDown")u.preventDefault(),je(1);else if(u.key==="ArrowUp")u.preventDefault(),je(-1);else if(u.key==="Enter"){u.preventDefault();const K=Y[$];if(K&&!K.disabled){if(!te.includes(K.value)&&we)return;Be(K.value),w||(he(!1),(I=ae.current)==null||I.focus())}}else if(u.key==="Home"){u.preventDefault();const K=Y.findIndex(fe=>!fe.disabled);K>=0&&P(K)}else if(u.key==="End"){u.preventDefault();for(let K=Y.length-1;K>=0;K--)if(!Y[K].disabled){P(K);break}}else u.key==="Tab"&&he(!1)}},de=u=>{var I;u.disabled||!te.includes(u.value)&&we||(Be(u.value),w||(he(!1),(I=ae.current)==null||I.focus()))},be=u=>{u.stopPropagation(),le(w?[]:"")},We=(u,T)=>{if(u.stopPropagation(),!w)return;const I=Array.isArray(y)?y:[];le(I.filter(K=>K!==T))},ke=()=>{if(!w)return;const u=Y.filter(K=>!K.disabled).map(K=>K.value),T=Array.from(new Set([...Array.isArray(y)?y:[],...u])),I=E!==void 0?T.slice(0,E):T;le(I)},Ee=w?te.length>0:!!y,m=()=>{var u;if(!Ee)return e.jsx("span",{className:X.triggerPlaceholder,children:e.jsx("span",{className:X.triggerText,children:o})});if(!w)return e.jsxs("span",{className:X.triggerValue,children:[(me==null?void 0:me.icon)&&e.jsx("span",{className:X.triggerIcon,children:me.icon}),e.jsx("span",{className:X.triggerText,children:me==null?void 0:me.label})]});if(C==="count"){const T=((u=ye[0])==null?void 0:u.label)??"",I=ye.length-1;return e.jsx("span",{className:X.triggerValue,children:e.jsxs("span",{className:X.triggerText,children:[T,I>0&&e.jsxs("span",{className:X.countMore,children:[", +",I," more"]})]})})}return e.jsx("span",{className:X.chipRow,children:ye.map(T=>e.jsxs("span",{className:X.chip,children:[T.icon&&e.jsx("span",{className:X.chipIcon,children:T.icon}),e.jsx("span",{className:X.chipLabel,children:T.label}),!p&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":`Remove ${T.label}`,className:X.chipRemove,onClick:I=>We(I,T.value),onMouseDown:I=>I.preventDefault(),children:e.jsx(vn,{})})]},T.value))})};return e.jsxs("div",{ref:G,className:[X.field,c?X.fullWidth:"",p?X.disabled:"",N].filter(Boolean).join(" "),children:[t&&e.jsx("label",{htmlFor:H,className:X.label,children:t}),e.jsxs("div",{className:X.selectWrapper,children:[e.jsxs("button",{ref:ae,id:H,type:"button",role:"combobox","aria-haspopup":"listbox","aria-expanded":R,"aria-controls":ue,"aria-invalid":!!i,"aria-multiselectable":w||void 0,disabled:p,className:[X.trigger,X[l],R?X.open:"",i?X.hasError:"",w&&C==="chips"&&te.length>0?X.triggerChips:""].filter(Boolean).join(" "),onClick:()=>!p&&he(u=>!u),onKeyDown:ge,children:[m(),e.jsxs("span",{className:X.triggerActions,children:[b&&Ee&&!p&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Clear selection",className:X.clearBtn,onClick:be,onMouseDown:u=>u.preventDefault(),children:e.jsx(vn,{})}),e.jsx("span",{className:[X.chevron,R?X.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx(lc,{})})]})]}),R&&e.jsxs("div",{className:X.menu,role:"listbox",id:ue,"aria-labelledby":H,"aria-multiselectable":w||void 0,"aria-activedescendant":$>=0?`${H}-opt-${$}`:void 0,children:[v&&e.jsxs("div",{className:X.searchRow,children:[e.jsx("span",{className:X.searchIconWrap,children:e.jsx(dc,{})}),e.jsx("input",{ref:ee,type:"text",className:X.searchInput,placeholder:"Search...",value:A,onChange:u=>{W(u.target.value),P(0)},onKeyDown:ge})]}),w&&D&&Y.length>0&&e.jsxs("div",{className:X.bulkRow,children:[e.jsx("button",{type:"button",className:X.bulkBtn,onClick:ke,disabled:E!==void 0&&te.length>=E,children:"Select all"}),e.jsx("button",{type:"button",className:X.bulkBtn,onClick:()=>le([]),disabled:te.length===0,children:"Clear all"}),E!==void 0&&e.jsxs("span",{className:X.bulkCount,children:[te.length," / ",E]})]}),e.jsx("div",{className:X.list,ref:J,role:"presentation",children:Y.length===0?e.jsx("div",{className:X.empty,children:"No results"}):Y.map((u,T)=>{const I=te.includes(u.value),K=T===$,fe=!I&&we,oe=u.disabled||fe;return e.jsxs("div",{id:`${H}-opt-${T}`,role:"option","aria-selected":I,"aria-disabled":oe,"data-idx":T,className:[X.option,I?X.optionSelected:"",K?X.optionActive:"",oe?X.optionDisabled:""].filter(Boolean).join(" "),onClick:()=>!oe&&de(u),onMouseEnter:()=>!oe&&P(T),children:[w&&e.jsx("span",{className:[X.checkbox,I?X.checkboxChecked:""].filter(Boolean).join(" "),"aria-hidden":"true",children:I&&e.jsx(mn,{})}),u.icon&&e.jsx("span",{className:X.optionIcon,children:u.icon}),e.jsxs("span",{className:X.optionLabel,children:[e.jsx("span",{className:X.optionTitle,children:u.label}),u.description&&e.jsx("span",{className:X.optionDesc,children:u.description})]}),!w&&e.jsx("span",{className:X.check,"aria-hidden":!0,children:I&&e.jsx(mn,{})})]},u.value)})})]}),x&&!w&&e.jsx("input",{type:"hidden",name:x,value:y}),x&&w&&te.map(u=>e.jsx("input",{type:"hidden",name:x,value:u},u))]}),i&&e.jsx("p",{className:X.errorText,children:i}),!i&&a&&e.jsx("p",{className:X.helperText,children:a})]})},hc="_field_sc9v8_16",pc="_fullWidth_sc9v8_24",_c="_disabled_sc9v8_28",fc="_trigger_sc9v8_28",mc="_label_sc9v8_34",vc="_selectWrapper_sc9v8_41",xc="_open_sc9v8_70",gc="_hasError_sc9v8_74",bc="_sm_sc9v8_86",yc="_md_sc9v8_93",wc="_lg_sc9v8_99",jc="_triggerValue_sc9v8_106",kc="_triggerPlaceholder_sc9v8_107",Nc="_triggerText_sc9v8_120",Ec="_triggerActions_sc9v8_127",Tc="_chip_sc9v8_136",Ic="_chipLabel_sc9v8_152",$c="_chipRemove_sc9v8_158",Cc="_chipOverflow_sc9v8_174",Sc="_clearBtn_sc9v8_188",Lc="_chevron_sc9v8_204",Mc="_chevronOpen_sc9v8_212",Dc="_menu_sc9v8_224",Bc="_menuOpen_sc9v8_1",Rc="_searchRow_sc9v8_250",Ac="_searchIconWrap_sc9v8_259",zc="_searchInput_sc9v8_265",Pc="_tree_sc9v8_281",Oc="_empty_sc9v8_306",Wc="_row_sc9v8_314",Hc="_rowDisabled_sc9v8_331",qc="_rowActive_sc9v8_335",Fc="_rowSelected_sc9v8_340",Gc="_rowLabel_sc9v8_343",Vc="_indent_sc9v8_353",Kc="_indentUnit_sc9v8_359",Uc="_toggle_sc9v8_375",Yc="_toggleOpen_sc9v8_391",Qc="_togglePlaceholder_sc9v8_396",Xc="_spinner_sc9v8_403",Jc="_spin_sc9v8_403",Zc="_checkbox_sc9v8_418",el="_checkboxChecked_sc9v8_436",tl="_checkboxMixed_sc9v8_442",nl="_rowIcon_sc9v8_449",sl="_rowText_sc9v8_459",ol="_rowDesc_sc9v8_474",rl="_match_sc9v8_483",al="_check_sc9v8_418",il="_menuFooter_sc9v8_502",cl="_footerBtn_sc9v8_513",ll="_errorText_sc9v8_529",dl="_helperText_sc9v8_536",U={field:hc,fullWidth:pc,disabled:_c,trigger:fc,label:mc,selectWrapper:vc,open:xc,hasError:gc,sm:bc,md:yc,lg:wc,triggerValue:jc,triggerPlaceholder:kc,triggerText:Nc,triggerActions:Ec,chip:Tc,chipLabel:Ic,chipRemove:$c,chipOverflow:Cc,clearBtn:Sc,chevron:Lc,chevronOpen:Mc,menu:Dc,menuOpen:Bc,searchRow:Rc,searchIconWrap:Ac,searchInput:zc,tree:Pc,empty:Oc,row:Wc,rowDisabled:Hc,rowActive:qc,rowSelected:Fc,rowLabel:Gc,indent:Vc,indentUnit:Kc,toggle:Uc,toggleOpen:Yc,togglePlaceholder:Qc,spinner:Xc,spin:Jc,checkbox:Zc,checkboxChecked:el,checkboxMixed:tl,rowIcon:nl,rowText:sl,rowDesc:ol,match:rl,check:al,menuFooter:il,footerBtn:cl,errorText:ll,helperText:dl},ul=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),hl=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"10",height:"10",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),xn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),pl=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"10",height:"10",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 8h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),gn=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),_l=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),fl=n=>{const t=new Map,s=new Map,o=new Set,a=(i,l)=>{for(const c of i)t.set(c.value,c),s.set(c.value,l),!c.children||c.children.length===0?c.isLeaf!==!1&&o.add(c.value):a(c.children,c.value)};return a(n,null),{nodeByValue:t,parentByValue:s,leafValues:o}},bt=(n,t=[])=>{if(!n.children||n.children.length===0)return t.push(n.value),t;for(const s of n.children)bt(s,t);return t},ml=(n,t,s)=>{const o=new Set,a=new Set,i=(l,c)=>{let p=!1;for(const v of l){const b=s(v,t),_=v.children?i(v.children,[...c,v.value]):!1;(b||_)&&(o.add(v.value),c.forEach(x=>o.add(x)),p=!0,b&&a.add(v.value))}return p};return i(n,[]),{visible:o,matched:a}},vl=(n,t)=>n.label.toLowerCase().includes(t.toLowerCase()),xl=(n,t)=>{if(!t)return n;const s=n.toLowerCase().indexOf(t.toLowerCase());return s===-1?n:e.jsxs(e.Fragment,{children:[n.slice(0,s),e.jsx("span",{className:U.match,children:n.slice(s,s+t.length)}),n.slice(s+t.length)]})},gl=({data:n,value:t,defaultValue:s,onChange:o,multiple:a=!1,checkStrictly:i=!1,checkedStrategy:l="leaf",expandedKeys:c,defaultExpandedKeys:p,onExpandedChange:v,defaultExpandAll:b=!1,loadChildren:_,searchable:x=!1,filter:N=vl,maxTagCount:w=3,label:C,placeholder:E=a?"Select items":"Select an item",helperText:D,error:V,size:H="md",fullWidth:ue=!1,disabled:j=!1,clearable:M=!1,id:B,name:S,className:se=""})=>{const Q=r.useId(),y=B??`evo-tree-${Q}`,te=`${y}-tree`,R=t!==void 0,he=r.useMemo(()=>{const h=R?t:s;return h==null?[]:Array.isArray(h)?h:[h]},[]),[$,P]=r.useState(he),A=r.useMemo(()=>R?t==null?[]:Array.isArray(t)?t:[t]:$,[R,t,$]),[W,G]=r.useState({}),[ae,ee]=r.useState(new Set),J=r.useMemo(()=>{if(Object.keys(W).length===0)return n;const h=d=>d.map(g=>{const z=W[g.value]??g.children;return z?{...g,children:h(z)}:g});return h(n)},[n,W]),Y=r.useMemo(()=>fl(J),[J]),me=r.useMemo(()=>{if(c)return c;if(p)return p;if(b){const h=[],d=g=>g.forEach(k=>{k.children&&k.children.length&&(h.push(k.value),d(k.children))});return d(n),h}return[]},[]),[ye,we]=r.useState(me),le=c??ye,Be=r.useMemo(()=>new Set(le),[le]),je=r.useCallback(h=>{c===void 0&&we(h),v==null||v(h)},[c,v]),[ge,de]=r.useState(!1),[be,We]=r.useState(""),[ke,Ee]=r.useState(-1),m=r.useRef(null),u=r.useRef(null),T=r.useRef(null),I=r.useRef(null),K=r.useMemo(()=>!x||!be.trim()?null:ml(J,be,N),[J,be,x,N]),fe=r.useMemo(()=>K?K.visible:Be,[K,Be]),oe=r.useMemo(()=>{const h=[],d=(g,k)=>{for(const z of g){if(K&&!K.visible.has(z.value))continue;const ne=z.children&&z.children.length>0||z.isLeaf===!1;h.push({node:z,level:k,hasChildren:ne}),ne&&fe.has(z.value)&&z.children&&d(z.children,k+1)}};return d(J,0),h},[J,fe,K]),Le=r.useMemo(()=>new Set(A),[A]),Pe=r.useCallback(h=>{if(!a||i||!h.children||h.children.length===0)return Le.has(h.value)?"checked":"unchecked";const d=bt(h);if(d.length===0)return Le.has(h.value)?"checked":"unchecked";let g=0;for(const k of d)Le.has(k)&&g++;return g===0?"unchecked":g===d.length?"checked":"mixed"},[a,i,Le]),He=r.useCallback(h=>{if(!a||i)return Array.from(h);if(l==="leaf")return Array.from(h).filter(k=>Y.leafValues.has(k));if(l==="all"){const k=new Set(h),z=ne=>{for(const _e of ne)_e.children&&_e.children.length&&(z(_e.children),bt(_e).every(Ne=>h.has(Ne))&&k.add(_e.value))};return z(J),Array.from(k)}const d=[],g=k=>{for(const z of k)z.children&&z.children.length?bt(z).every(_e=>h.has(_e))?d.push(z.value):g(z.children):h.has(z.value)&&d.push(z.value)};return g(J),d},[a,i,l,J,Y.leafValues]),Me=r.useCallback(h=>{const d=He(h);R||P(d);const g=d.map(k=>Y.nodeByValue.get(k)).filter(Boolean);o==null||o(d,g)},[He,R,Y.nodeByValue,o]),Ye=r.useCallback(h=>{R||P(h?[h]:[]),o==null||o(h,h?Y.nodeByValue.get(h)??null:null)},[R,Y.nodeByValue,o]),et=r.useMemo(()=>{if(!a||i)return new Set(A);const h=new Set;for(const d of A){const g=Y.nodeByValue.get(d);if(!g){h.add(d);continue}!g.children||g.children.length===0?h.add(d):bt(g).forEach(k=>h.add(k))}return h},[A,a,i,Y.nodeByValue]),nt=r.useCallback(h=>{if(Be.has(h.value)){je(le.filter(k=>k!==h.value));return}je([...le,h.value]),_&&!W[h.value]&&(h.isLeaf===!1||!h.children&&h.isLeaf!==!0)&&(ee(k=>new Set(k).add(h.value)),_(h).then(k=>{G(z=>({...z,[h.value]:k}))}).finally(()=>{ee(k=>{const z=new Set(k);return z.delete(h.value),z})}))},[le,Be,je,_,W]),Qe=r.useCallback(h=>{var z;if(h.disabled)return;if(!a){Ye(h.value),de(!1),(z=u.current)==null||z.focus();return}if(i){const ne=new Set(A);ne.has(h.value)?ne.delete(h.value):ne.add(h.value);const _e=Array.from(ne);R||P(_e);const Re=_e.map(Ne=>Y.nodeByValue.get(Ne)).filter(Boolean);o==null||o(_e,Re);return}const d=new Set(et),g=Pe(h),k=h.children&&h.children.length?bt(h):[h.value];g==="checked"?k.forEach(ne=>d.delete(ne)):k.forEach(ne=>d.add(ne)),Me(d)},[a,i,A,et,Pe,Me,Ye,R,Y.nodeByValue,o]);r.useEffect(()=>{if(!ge)return;const h=d=>{var g;(g=m.current)!=null&&g.contains(d.target)||(de(!1),We(""))};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[ge]),r.useEffect(()=>{if(ge){const h=oe.findIndex(d=>Le.has(d.node.value));if(Ee(h>=0?h:oe.findIndex(d=>!d.node.disabled)),x){const d=setTimeout(()=>{var g;return(g=T.current)==null?void 0:g.focus()},30);return()=>clearTimeout(d)}}else We(""),Ee(-1)},[ge]),r.useEffect(()=>{var d;if(!ge||ke<0)return;const h=(d=I.current)==null?void 0:d.querySelector(`[data-idx="${ke}"]`);h==null||h.scrollIntoView({block:"nearest"})},[ke,ge]);const lt=h=>{if(oe.length===0)return;let d=ke;for(let g=0;g<oe.length;g++)if(d=(d+h+oe.length)%oe.length,!oe[d].node.disabled){Ee(d);return}},dt=h=>{var g;if(j)return;if(!ge){(h.key==="Enter"||h.key===" "||h.key==="ArrowDown"||h.key==="ArrowUp")&&(h.preventDefault(),de(!0));return}const d=oe[ke];if(h.key==="Escape")h.preventDefault(),de(!1),(g=u.current)==null||g.focus();else if(h.key==="ArrowDown")h.preventDefault(),lt(1);else if(h.key==="ArrowUp")h.preventDefault(),lt(-1);else if(h.key==="ArrowRight"){if(!d)return;if(h.preventDefault(),d.hasChildren&&!Be.has(d.node.value))nt(d.node);else if(d.hasChildren){const k=ke+1;k<oe.length&&oe[k].level>d.level&&Ee(k)}}else if(h.key==="ArrowLeft"){if(!d)return;if(h.preventDefault(),d.hasChildren&&Be.has(d.node.value))nt(d.node);else for(let k=ke-1;k>=0;k--)if(oe[k].level<d.level){Ee(k);break}}else if(h.key==="Enter")h.preventDefault(),d&&Qe(d.node);else if(h.key===" "&&a)h.preventDefault(),d&&Qe(d.node);else if(h.key==="Home"){h.preventDefault();const k=oe.findIndex(z=>!z.node.disabled);k>=0&&Ee(k)}else if(h.key==="End"){h.preventDefault();for(let k=oe.length-1;k>=0;k--)if(!oe[k].node.disabled){Ee(k);break}}else h.key==="Tab"&&de(!1)},kt=h=>{h.stopPropagation(),a?Me(new Set):Ye("")},f=()=>{if(a){const d=A.map(z=>Y.nodeByValue.get(z)).filter(Boolean);if(d.length===0)return e.jsx("span",{className:U.triggerPlaceholder,children:e.jsx("span",{className:U.triggerText,children:E})});const g=d.slice(0,w),k=d.length-g.length;return e.jsxs("span",{className:U.triggerValue,children:[g.map(z=>e.jsxs("span",{className:U.chip,children:[e.jsx("span",{className:U.chipLabel,children:z.label}),e.jsx("span",{role:"button","aria-label":`Remove ${z.label}`,tabIndex:-1,className:U.chipRemove,onMouseDown:ne=>ne.preventDefault(),onClick:ne=>{ne.stopPropagation(),Qe(z)},children:e.jsx(gn,{})})]},z.value)),k>0&&e.jsxs("span",{className:U.chipOverflow,children:["+",k]})]})}const h=A[0]?Y.nodeByValue.get(A[0]):void 0;return e.jsxs("span",{className:h?U.triggerValue:U.triggerPlaceholder,children:[(h==null?void 0:h.icon)&&e.jsx("span",{className:U.rowIcon,children:h.icon}),e.jsx("span",{className:U.triggerText,children:(h==null?void 0:h.label)??E})]})},L=(h,d)=>{const{node:g,level:k,hasChildren:z}=h,ne=Be.has(g.value),_e=Pe(g),Re=!a&&Le.has(g.value),Ne=d===ke,Ie=ae.has(g.value);return e.jsxs("div",{id:`${y}-row-${d}`,role:"treeitem","aria-level":k+1,"aria-expanded":z?ne:void 0,"aria-selected":a?void 0:Re,"aria-checked":a?_e==="mixed"?"mixed":_e==="checked"?"true":"false":void 0,"aria-disabled":g.disabled,"data-idx":d,className:[U.row,Ne?U.rowActive:"",Re?U.rowSelected:"",g.disabled?U.rowDisabled:""].filter(Boolean).join(" "),onClick:()=>Qe(g),onMouseEnter:()=>!g.disabled&&Ee(d),children:[e.jsx("span",{className:U.indent,"aria-hidden":!0,children:Array.from({length:k}).map(($e,Ae)=>e.jsx("span",{className:U.indentUnit},Ae))}),z?Ie?e.jsx("span",{className:U.toggle,"aria-hidden":!0,children:e.jsx("span",{className:U.spinner})}):e.jsx("span",{className:[U.toggle,ne?U.toggleOpen:""].filter(Boolean).join(" "),role:"button",tabIndex:-1,"aria-label":ne?"Collapse":"Expand",onClick:$e=>{$e.stopPropagation(),nt(g)},onMouseDown:$e=>$e.preventDefault(),children:e.jsx(hl,{})}):e.jsx("span",{className:U.togglePlaceholder,"aria-hidden":!0}),a&&e.jsxs("span",{className:[U.checkbox,_e==="checked"?U.checkboxChecked:"",_e==="mixed"?U.checkboxMixed:""].filter(Boolean).join(" "),"aria-hidden":!0,children:[_e==="checked"&&e.jsx(xn,{}),_e==="mixed"&&e.jsx(pl,{})]}),g.icon&&e.jsx("span",{className:U.rowIcon,children:g.icon}),e.jsxs("span",{className:U.rowText,children:[e.jsx("span",{className:U.rowLabel,children:be?xl(g.label,be):g.label}),g.description&&e.jsx("span",{className:U.rowDesc,children:g.description})]}),!a&&Re&&e.jsx("span",{className:U.check,"aria-hidden":!0,children:e.jsx(xn,{})})]},g.value)},F=A.length>0,Z=a?A.join(","):A[0]??"";return e.jsxs("div",{ref:m,className:[U.field,ue?U.fullWidth:"",j?U.disabled:"",se].filter(Boolean).join(" "),children:[C&&e.jsx("label",{htmlFor:y,className:U.label,children:C}),e.jsxs("div",{className:U.selectWrapper,children:[e.jsxs("button",{ref:u,id:y,type:"button",role:"combobox","aria-haspopup":"tree","aria-expanded":ge,"aria-controls":te,"aria-invalid":!!V,disabled:j,className:[U.trigger,U[H],ge?U.open:"",V?U.hasError:""].filter(Boolean).join(" "),onClick:()=>!j&&de(h=>!h),onKeyDown:dt,children:[f(),e.jsxs("span",{className:U.triggerActions,children:[M&&F&&!j&&e.jsx("span",{role:"button",tabIndex:-1,"aria-label":"Clear selection",className:U.clearBtn,onClick:kt,onMouseDown:h=>h.preventDefault(),children:e.jsx(gn,{})}),e.jsx("span",{className:[U.chevron,ge?U.chevronOpen:""].filter(Boolean).join(" "),children:e.jsx(ul,{})})]})]}),ge&&e.jsxs("div",{className:U.menu,children:[x&&e.jsxs("div",{className:U.searchRow,children:[e.jsx("span",{className:U.searchIconWrap,children:e.jsx(_l,{})}),e.jsx("input",{ref:T,type:"text",className:U.searchInput,placeholder:"Search...",value:be,onChange:h=>{We(h.target.value),Ee(0)},onKeyDown:dt})]}),e.jsx("div",{ref:I,className:U.tree,role:"tree",id:te,"aria-labelledby":y,"aria-multiselectable":a||void 0,"aria-activedescendant":ke>=0?`${y}-row-${ke}`:void 0,children:oe.length===0?e.jsx("div",{className:U.empty,children:"No results"}):oe.map((h,d)=>L(h,d))}),a&&F&&e.jsxs("div",{className:U.menuFooter,children:[e.jsxs("span",{children:[A.length," selected"]}),e.jsx("button",{type:"button",className:U.footerBtn,onClick:()=>Me(new Set),children:"Clear all"})]})]}),S&&e.jsx("input",{type:"hidden",name:S,value:Z})]}),V&&e.jsx("p",{className:U.errorText,children:V}),!V&&D&&e.jsx("p",{className:U.helperText,children:D})]})},bl="_field_1i6oh_7",yl="_fullWidth_1i6oh_15",wl="_disabled_1i6oh_19",jl="_inputWrapper_1i6oh_19",kl="_label_1i6oh_25",Nl="_acWrapper_1i6oh_33",El="_open_1i6oh_57",Tl="_hasError_1i6oh_61",Il="_sm_1i6oh_69",$l="_md_1i6oh_74",Cl="_lg_1i6oh_79",Sl="_searchIconWrap_1i6oh_85",Ll="_input_1i6oh_19",Ml="_actions_1i6oh_119",Dl="_statusIcon_1i6oh_126",Bl="_clearBtn_1i6oh_132",Rl="_spinner_1i6oh_152",Al="_evoAcSpin_1i6oh_1",zl="_menu_1i6oh_169",Pl="_evoAcMenuOpen_1i6oh_1",Ol="_sectionHeader_1i6oh_200",Wl="_recoveryBox_1i6oh_216",Hl="_list_1i6oh_227",ql="_empty_1i6oh_252",Fl="_statusRow_1i6oh_253",Gl="_option_1i6oh_268",Vl="_optionActive_1i6oh_290",Kl="_optionDisabled_1i6oh_290",Ul="_optionSelected_1i6oh_294",Yl="_optionTitle_1i6oh_297",Ql="_optionRecovery_1i6oh_306",Xl="_optionIcon_1i6oh_310",Jl="_optionLabel_1i6oh_321",Zl="_optionDesc_1i6oh_336",ed="_mark_1i6oh_346",td="_check_1i6oh_353",nd="_errorText_1i6oh_364",sd="_helperText_1i6oh_371",ce={field:bl,fullWidth:yl,disabled:wl,inputWrapper:jl,label:kl,acWrapper:Nl,open:El,hasError:Tl,sm:Il,md:$l,lg:Cl,searchIconWrap:Sl,input:Ll,actions:Ml,statusIcon:Dl,clearBtn:Bl,spinner:Rl,evoAcSpin:Al,menu:zl,evoAcMenuOpen:Pl,sectionHeader:Ol,recoveryBox:Wl,list:Hl,empty:ql,statusRow:Fl,option:Gl,optionActive:Vl,optionDisabled:Kl,optionSelected:Ul,optionTitle:Yl,optionRecovery:Ql,optionIcon:Xl,optionLabel:Jl,optionDesc:Zl,mark:ed,check:td,errorText:nd,helperText:sd},od=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"7",cy:"7",r:"4.5",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M10.5 10.5L13 13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),rd=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"12",height:"12",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})}),ad=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M3.5 8.5l3 3 6-7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),bn=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none","aria-hidden":"true",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M8 4.5V8l2.5 1.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),id=()=>e.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M8 1.5l1.6 4.9 4.9 1.6-4.9 1.6L8 14.5l-1.6-4.9L1.5 8l4.9-1.6L8 1.5z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})}),yn=()=>e.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",className:ce.spinner,children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"0.25"}),e.jsx("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]}),wn=new Map,cd=n=>({get:()=>wn.get(n)??[],set:t=>{wn.set(n,t)}}),ld=n=>({get:()=>{if(typeof window>"u")return[];try{const t=window.localStorage.getItem(`evo-recents:${n}`),s=t?JSON.parse(t):[];return Array.isArray(s)?s.filter(o=>typeof o=="string"):[]}catch{return[]}},set:t=>{if(!(typeof window>"u"))try{window.localStorage.setItem(`evo-recents:${n}`,JSON.stringify(t))}catch{}}});function jn(n,t){const s=n.length,o=t.length;if(s===0)return o;if(o===0)return s;let a=Array.from({length:o+1},(l,c)=>c),i=new Array(o+1);for(let l=1;l<=s;l++){i[0]=l;for(let c=1;c<=o;c++){const p=n[l-1]===t[c-1]?0:1;i[c]=Math.min(a[c]+1,i[c-1]+1,a[c-1]+p)}[a,i]=[i,a]}return a[o]}function dd(n,t){const s=t.trim().toLowerCase();if(s.length<2)return null;let o=null,a=1/0;for(const l of n){if(l.disabled)continue;const c=l.label.toLowerCase(),p=Math.min(jn(s,c),jn(s,c.slice(0,s.length)));p<a&&(a=p,o=l)}if(!o)return null;const i=Math.max(1,Math.min(3,Math.round(s.length*.4)));return a<=i?{option:o,distance:a}:null}function ud(n,t){const s=t.trim();if(!s)return n;const o=n.toLowerCase().indexOf(s.toLowerCase());return o<0?n:e.jsxs(e.Fragment,{children:[n.slice(0,o),e.jsx("mark",{className:ce.mark,children:n.slice(o,o+s.length)}),n.slice(o+s.length)]})}const Yn=r.forwardRef(({options:n,value:t,defaultValue:s=null,onChange:o,inputValue:a,onInputChange:i,label:l,placeholder:c="Search…",helperText:p,error:v,size:b="md",fullWidth:_=!1,disabled:x=!1,clearable:N=!0,loading:w=!1,debounce:C=0,minChars:E=0,maxResults:D=50,filter:V,highlightMatch:H=!0,openOnFocus:ue=!0,emptyMessage:j="No results",smartRecovery:M=!1,recents:B=!1,renderOption:S,id:se,name:Q,className:y="",...te},R)=>{const he=r.useId(),$=se??`evo-autocomplete-${he}`,P=`${$}-listbox`,A=t!==void 0,[W,G]=r.useState(s),ae=A?t:W,ee=r.useMemo(()=>n.find(d=>d.value===ae)??null,[n,ae]),J=a!==void 0,[Y,me]=r.useState(()=>{var d;return((d=n.find(g=>g.value===s))==null?void 0:d.label)??""}),ye=J?a:Y,we=r.useMemo(()=>{if(!B)return null;const d={max:5,storage:cd(Q??$),label:"Recent"};return typeof B=="object"?{...d,...B}:d},[B,Q,$]),[le,Be]=r.useState(()=>(we==null?void 0:we.storage.get())??[]),[je,ge]=r.useState(!1),[de,be]=r.useState(0),We=r.useRef(null),ke=r.useRef(null),Ee=r.useRef(null),m=r.useRef(null),u=r.useCallback(d=>{ke.current=d,typeof R=="function"?R(d):R&&(R.current=d)},[R]),I=ye.trim(),K=I.length>0&&I.length<E,fe=!!we&&I.length===0&&le.length>0,oe=r.useMemo(()=>fe?le.map(d=>n.find(g=>g.value===d)).filter(d=>!!d&&!d.disabled).slice(0,we.max):[],[fe,le,n,we]),Le=r.useMemo(()=>{if(K)return[];if(V===!1||I.length===0)return n.slice(0,D);const d=typeof V=="function"?V:(g,k)=>g.label.toLowerCase().includes(k.toLowerCase());return n.filter(g=>d(g,I)).slice(0,D)},[n,V,I,K,D]),Pe=fe?oe:Le,He=r.useMemo(()=>!M||w||K||fe||Pe.length>0||I.length===0?null:dd(n,I),[M,w,K,fe,Pe.length,I,n]),Me=He?[He.option]:Pe;r.useEffect(()=>{if(!je)return;const d=g=>{var k;(k=We.current)!=null&&k.contains(g.target)||Qe()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[je]),r.useEffect(()=>{var g;if(!je)return;const d=(g=Ee.current)==null?void 0:g.querySelector(`[data-idx="${de}"]`);d==null||d.scrollIntoView({block:"nearest"})},[de,je]),r.useEffect(()=>{je||J||me((ee==null?void 0:ee.label)??"")},[ae]),r.useEffect(()=>()=>{m.current&&clearTimeout(m.current)},[]);const Ye=r.useCallback(d=>{i&&(C>0?(m.current&&clearTimeout(m.current),m.current=setTimeout(()=>i(d),C)):i(d))},[i,C]),et=r.useCallback((d,g)=>{A||G(d),o==null||o(d,g)},[A,o]),nt=r.useCallback(d=>{we&&Be(g=>{const k=[d,...g.filter(z=>z!==d)].slice(0,we.max);return we.storage.set(k),k})},[we]),Qe=r.useCallback(()=>{ge(!1),be(0),!J&&ee&&me(ee.label)},[J,ee]),lt=r.useCallback(d=>{var g;d.disabled||(et(d.value,d),J||me(d.label),Ye(d.label),nt(d.value),ge(!1),be(0),(g=ke.current)==null||g.focus())},[et,J,Ye,nt]),dt=d=>{const g=d.target.value;J||me(g),Ye(g),ee&&g!==ee.label&&et(null,null),be(0),je||ge(!0)},kt=()=>{var d;J||me(""),Ye(""),et(null,null),be(0),(d=ke.current)==null||d.focus(),ge(!0)},f=d=>{if(Me.length===0)return;let g=de;for(let k=0;k<Me.length;k++)if(g=(g+d+Me.length)%Me.length,!Me[g].disabled){be(g);return}},L=d=>{if(!x){if(!je){(d.key==="ArrowDown"||d.key==="ArrowUp")&&(d.preventDefault(),ge(!0));return}switch(d.key){case"ArrowDown":d.preventDefault(),f(1);break;case"ArrowUp":d.preventDefault(),f(-1);break;case"Home":d.preventDefault(),be(Me.findIndex(g=>!g.disabled));break;case"End":d.preventDefault();for(let g=Me.length-1;g>=0;g--)if(!Me[g].disabled){be(g);break}break;case"Enter":{const g=Me[de];g&&!g.disabled&&(d.preventDefault(),lt(g));break}case"Escape":d.preventDefault(),Qe();break;case"Tab":Qe();break}}},F=ce[b],Z=je&&Me[de]?`${$}-opt-${de}`:void 0,h=(d,g,k)=>{const z=g===de,ne=d.value===ae;return e.jsx("div",{id:`${$}-opt-${g}`,role:"option","aria-selected":ne,"aria-disabled":d.disabled||void 0,"data-idx":g,className:[ce.option,z?ce.optionActive:"",ne?ce.optionSelected:"",d.disabled?ce.optionDisabled:"",k==="recovery"?ce.optionRecovery:""].filter(Boolean).join(" "),onClick:()=>lt(d),onMouseEnter:()=>!d.disabled&&be(g),children:S?S(d,{active:z,query:I}):e.jsxs(e.Fragment,{children:[k==="recent"&&e.jsx("span",{className:ce.optionIcon,"aria-hidden":"true",children:e.jsx(bn,{})}),k!=="recent"&&d.icon&&e.jsx("span",{className:ce.optionIcon,"aria-hidden":"true",children:d.icon}),e.jsxs("span",{className:ce.optionLabel,children:[e.jsx("span",{className:ce.optionTitle,children:H&&k==="option"?ud(d.label,I):d.label}),d.description&&e.jsx("span",{className:ce.optionDesc,children:d.description})]}),ne&&e.jsx("span",{className:ce.check,"aria-hidden":"true",children:e.jsx(ad,{})})]})},`${k}-${d.value}`)};return e.jsxs("div",{ref:We,className:[ce.field,_?ce.fullWidth:"",x?ce.disabled:"",y].filter(Boolean).join(" "),children:[l&&e.jsx("label",{htmlFor:$,className:ce.label,children:l}),e.jsxs("div",{className:ce.acWrapper,children:[e.jsxs("div",{className:[ce.inputWrapper,F,je?ce.open:"",v?ce.hasError:""].filter(Boolean).join(" "),children:[e.jsx("span",{className:ce.searchIconWrap,"aria-hidden":"true",children:e.jsx(od,{})}),e.jsx("input",{...te,ref:u,id:$,type:"text",role:"combobox",autoComplete:"off","aria-autocomplete":"list","aria-expanded":je,"aria-controls":P,"aria-activedescendant":Z,"aria-invalid":!!v||void 0,"aria-describedby":v?`${$}-error`:p?`${$}-helper`:void 0,className:ce.input,placeholder:c,value:ye,disabled:x,onChange:dt,onKeyDown:L,onFocus:()=>ue&&!x&&ge(!0)}),e.jsxs("span",{className:ce.actions,children:[w&&e.jsx("span",{className:ce.statusIcon,"aria-hidden":"true",children:e.jsx(yn,{})}),N&&!x&&(ye.length>0||ae)&&e.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Clear",className:ce.clearBtn,onClick:kt,onMouseDown:d=>d.preventDefault(),children:e.jsx(rd,{})})]})]}),je&&e.jsx("div",{className:ce.menu,role:"listbox",id:P,"aria-label":l??"Suggestions",children:w?e.jsxs("div",{className:ce.statusRow,children:[e.jsx(yn,{}),e.jsx("span",{children:"Loading…"})]}):K?e.jsxs("div",{className:ce.empty,children:["Type ",E-I.length," more character",E-I.length===1?"":"s","…"]}):He?e.jsxs("div",{className:ce.recoveryBox,children:[e.jsxs("div",{className:ce.sectionHeader,children:[e.jsx(id,{}),e.jsxs("span",{children:["No exact match — did you mean",He.distance===1?" this":"","?"]})]}),e.jsx("div",{className:ce.list,ref:Ee,role:"presentation",children:h(He.option,0,"recovery")})]}):Me.length>0?e.jsxs(e.Fragment,{children:[fe&&e.jsxs("div",{className:ce.sectionHeader,children:[e.jsx(bn,{}),e.jsx("span",{children:we.label})]}),e.jsx("div",{className:ce.list,ref:Ee,role:"presentation",children:Me.map((d,g)=>h(d,g,fe?"recent":"option"))})]}):I.length===0?e.jsx("div",{className:ce.empty,children:"Type to search…"}):e.jsx("div",{className:ce.empty,children:j})}),Q&&e.jsx("input",{type:"hidden",name:Q,value:ae??""})]}),v&&e.jsx("p",{id:`${$}-error`,className:ce.errorText,children:v}),!v&&p&&e.jsx("p",{id:`${$}-helper`,className:ce.helperText,children:p})]})});Yn.displayName="EvoAutoComplete";const hd="_group_1xjt7_1",pd="_groupLabel_1xjt7_10",_d="_checkbox_1xjt7_18",fd="_disabled_1xjt7_23",md="_input_1xjt7_28",vd="_label_1xjt7_35",xd="_checkmark_1xjt7_35",gd="_labelText_1xjt7_100",bd="_helperText_1xjt7_105",tt={group:hd,groupLabel:pd,checkbox:_d,disabled:fd,input:md,label:vd,checkmark:xd,labelText:gd,helperText:bd},yd=({children:n,label:t,className:s=""})=>e.jsxs("fieldset",{className:`${tt.group} ${s}`,children:[t&&e.jsx("legend",{className:tt.groupLabel,children:t}),n]}),Qn=({label:n,helperText:t,indeterminate:s=!1,className:o="",disabled:a,id:i,...l})=>{const c=r.useRef(null);r.useEffect(()=>{c.current&&(c.current.indeterminate=s)},[s]);const p=i??(n==null?void 0:n.toLowerCase().replace(/\s+/g,"-"));return e.jsxs("div",{className:[tt.checkbox,a?tt.disabled:"",o].filter(Boolean).join(" "),children:[e.jsx("input",{type:"checkbox",id:p,ref:c,disabled:a,className:tt.input,...l}),e.jsxs("label",{htmlFor:p,className:tt.label,children:[e.jsx("span",{className:tt.checkmark}),e.jsx("span",{className:tt.labelText,children:n})]}),t&&e.jsx("p",{className:tt.helperText,children:t})]})};Qn.Group=yd;const wd="_group_1oqsu_1",jd="_groupLabel_1oqsu_10",kd="_radio_1oqsu_18",Nd="_disabled_1oqsu_22",Ed="_input_1oqsu_27",Td="_label_1oqsu_34",Id="_radiomark_1oqsu_34",$d="_labelText_1oqsu_78",at={group:wd,groupLabel:jd,radio:kd,disabled:Nd,input:Ed,label:Td,radiomark:Id,labelText:$d},Xn=r.createContext(null),Cd=({children:n,name:t,value:s,onChange:o,label:a,className:i=""})=>e.jsx(Xn.Provider,{value:{name:t,value:s,onChange:o},children:e.jsxs("fieldset",{className:`${at.group} ${i}`,children:[a&&e.jsx("legend",{className:at.groupLabel,children:a}),n]})}),Jn=({value:n,label:t,disabled:s=!1,className:o=""})=>{const a=r.useContext(Xn),i=a?a.value===n:!1,l=`${(a==null?void 0:a.name)??"radio"}-${n}`;return e.jsxs("div",{className:[at.radio,s?at.disabled:"",o].filter(Boolean).join(" "),children:[e.jsx("input",{type:"radio",id:l,name:a==null?void 0:a.name,value:n,checked:i,disabled:s,className:at.input,onChange:()=>a==null?void 0:a.onChange(n)}),e.jsxs("label",{htmlFor:l,className:at.label,children:[e.jsx("span",{className:at.radiomark}),e.jsx("span",{className:at.labelText,children:t})]})]})};Jn.Group=Cd;const Sd="_toggleWrapper_ke3d2_1",Ld="_disabled_ke3d2_8",Md="_hiddenInput_ke3d2_14",Dd="_track_ke3d2_21",Bd="_sm_ke3d2_29",Rd="_md_ke3d2_33",Ad="_lg_ke3d2_37",zd="_on_ke3d2_41",Pd="_thumb_ke3d2_45",Od="_label_ke3d2_55",rt={toggleWrapper:Sd,disabled:Ld,hiddenInput:Md,track:Dd,sm:Bd,md:Rd,lg:Ad,on:zd,thumb:Pd,label:Od},kn={sm:"0.75rem",md:"1rem",lg:"1.25rem"},Wd={sm:"0.75rem",md:"1rem",lg:"1.25rem"},Hd=({checked:n,onChange:t,label:s,disabled:o=!1,size:a="md",className:i=""})=>e.jsxs("label",{className:[rt.toggleWrapper,o?rt.disabled:"",i].filter(Boolean).join(" "),children:[e.jsx("input",{type:"checkbox",role:"switch",className:rt.hiddenInput,checked:n,disabled:o,onChange:l=>t(l.target.checked)}),e.jsx("span",{className:[rt.track,rt[a],n?rt.on:""].filter(Boolean).join(" "),children:e.jsx("span",{className:rt.thumb,style:{width:kn[a],height:kn[a],transform:n?`translateX(${Wd[a]})`:"translateX(0)"}})}),s&&e.jsx("span",{className:rt.label,children:s})]}),qd="_form_1cylw_1",Fd="_form_sm_1cylw_10",Gd="_form_md_1cylw_15",Vd="_form_lg_1cylw_20",Kd="_header_1cylw_25",Ud="_headerBadge_1cylw_33",Yd="_headerTitle_1cylw_47",Qd="_headerDesc_1cylw_56",Xd="_section_1cylw_63",Jd="_sectionHead_1cylw_74",Zd="_sectionTitle_1cylw_93",eu="_sectionDesc_1cylw_102",tu="_sectionBody_1cylw_109",nu="_section_split_1cylw_116",su="_row_1cylw_130",ou="_row_sm_1cylw_139",ru="_row_md_1cylw_143",au="_row_lg_1cylw_147",iu="_row_align_start_1cylw_151",cu="_row_align_center_1cylw_155",lu="_row_align_end_1cylw_159",du="_field_1cylw_163",uu="_fieldLabel_1cylw_170",hu="_fieldRequired_1cylw_180",pu="_fieldControl_1cylw_186",_u="_fieldDesc_1cylw_191",fu="_fieldError_1cylw_198",mu="_field_error_1cylw_217",vu="_actions_1cylw_221",xu="_actions_divider_1cylw_229",gu="_actions_left_1cylw_235",bu="_actions_right_1cylw_239",yu="_actions_center_1cylw_243",wu="_actions_between_1cylw_247",xe={form:qd,form_sm:Fd,form_md:Gd,form_lg:Vd,header:Kd,headerBadge:Ud,headerTitle:Yd,headerDesc:Qd,section:Xd,sectionHead:Jd,sectionTitle:Zd,sectionDesc:eu,sectionBody:tu,section_split:nu,row:su,row_sm:ou,row_md:ru,row_lg:au,row_align_start:iu,row_align_center:cu,row_align_end:lu,field:du,fieldLabel:uu,fieldRequired:hu,fieldControl:pu,fieldDesc:_u,fieldError:fu,field_error:mu,actions:vu,actions_divider:xu,actions_left:gu,actions_right:bu,actions_center:yu,actions_between:wu},Zn=r.createContext({}),ju=()=>r.useContext(Zn),vt=(...n)=>n.filter(Boolean).join(" "),jt=({children:n,disabled:t=!1,size:s="md",layout:o="vertical",maxWidth:a,className:i="",style:l,...c})=>e.jsx(Zn.Provider,{value:{disabled:t,size:s,layout:o},children:e.jsx("form",{className:vt(xe.form,xe[`form_${s}`],xe[`form_${o}`],i),style:a!==void 0?{maxWidth:a,...l}:l,...c,children:n})}),ku=({title:n,description:t,badge:s,children:o,className:a=""})=>e.jsxs("header",{className:vt(xe.header,a),children:[s&&e.jsx("div",{className:xe.headerBadge,children:s}),n&&e.jsx("h2",{className:xe.headerTitle,children:n}),t&&e.jsx("p",{className:xe.headerDesc,children:t}),o]}),Nu=({title:n,description:t,variant:s="stacked",children:o,className:a=""})=>e.jsxs("section",{className:vt(xe.section,xe[`section_${s}`],a),children:[(n||t)&&e.jsxs("div",{className:xe.sectionHead,children:[n&&e.jsx("h3",{className:xe.sectionTitle,children:n}),t&&e.jsx("p",{className:xe.sectionDesc,children:t})]}),e.jsx("div",{className:xe.sectionBody,children:o})]}),Eu=({children:n,gap:t="md",align:s="start",className:o=""})=>e.jsx("div",{className:vt(xe.row,xe[`row_${t}`],xe[`row_align_${s}`],o),children:n}),Tu=({children:n,label:t,description:s,error:o,required:a,htmlFor:i,className:l=""})=>{const c=r.useId(),p=i??`evo-field-${c}`;return t||s||o?e.jsxs("div",{className:vt(xe.field,o?xe.field_error:"",l),children:[t&&e.jsxs("label",{htmlFor:p,className:xe.fieldLabel,children:[t,a&&e.jsx("span",{className:xe.fieldRequired,"aria-hidden":"true",children:"*"})]}),e.jsx("div",{className:xe.fieldControl,children:n}),o?e.jsx("p",{className:xe.fieldError,role:"alert",children:o}):s?e.jsx("p",{className:xe.fieldDesc,children:s}):null]}):e.jsx("div",{className:vt(xe.field,l),children:n})},Iu=({children:n,align:t="right",divider:s=!0,className:o=""})=>e.jsx("div",{className:vt(xe.actions,xe[`actions_${t}`],s?xe.actions_divider:"",o),children:n});jt.Header=ku;jt.Section=Nu;jt.Row=Eu;jt.Field=Tu;jt.Actions=Iu;const $u="_overlay_118t4_19",Cu="_overlayFadeIn_118t4_1",Su="_dialog_118t4_32",Lu="_dialogSlideUp_118t4_1",Mu="_sm_118t4_45",Du="_md_118t4_48",Bu="_lg_118t4_51",Ru="_fullscreen_118t4_54",Au="_header_118t4_60",zu="_headerContent_118t4_70",Pu="_closeBtn_118t4_78",Ou="_body_118t4_98",Wu="_footer_118t4_108",it={overlay:$u,overlayFadeIn:Cu,dialog:Su,dialogSlideUp:Lu,sm:Mu,md:Du,lg:Bu,fullscreen:Ru,header:Au,headerContent:zu,closeBtn:Pu,body:Ou,footer:Wu},Hu=({children:n,onClose:t})=>e.jsxs("div",{className:it.header,children:[e.jsx("div",{className:it.headerContent,children:n}),t&&e.jsx("button",{className:it.closeBtn,onClick:t,"aria-label":"Close modal",children:"✕"})]}),qu=({children:n})=>e.jsx("div",{className:it.body,children:n}),Fu=({children:n})=>e.jsx("div",{className:it.footer,children:n}),Rt=({open:n,onClose:t,children:s,size:o="md",className:a=""})=>(r.useEffect(()=>{if(n)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[n]),r.useEffect(()=>{if(!n)return;const i=l=>{l.key==="Escape"&&t()};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[n,t]),n?Nn.createPortal(e.jsx("div",{className:it.overlay,onClick:i=>{i.target===i.currentTarget&&t()},children:e.jsx("div",{className:[it.dialog,it[o],a].filter(Boolean).join(" "),role:"dialog","aria-modal":"true",children:s})}),document.body):null);Rt.Header=Hu;Rt.Body=qu;Rt.Footer=Fu;const Gu="_toasterRoot_izzak_61",Vu="_srOnly_izzak_68",Ku="_anchor_izzak_80",Uu="_overflowPill_izzak_145",Yu="_toast_izzak_61",Qu="_evoToastEnterRight_izzak_1",Xu="_evoToastEnterLeft_izzak_1",Ju="_evoToastEnterTop_izzak_1",Zu="_evoToastEnterBottom_izzak_1",eh="_exiting_izzak_207",th="_evoToastExit_izzak_1",nh="_noMotion_izzak_211",sh="_toastIcon_izzak_227",oh="_toastBody_izzak_269",rh="_toastTitle_izzak_274",ah="_toastDescription_izzak_279",ih="_toastCount_izzak_285",ch="_toastProgressTrack_izzak_303",lh="_toastProgressFill_izzak_315",dh="_toastAction_izzak_348",uh="_toastClose_izzak_371",hh="_bellWrapper_izzak_392",ph="_bell_izzak_392",_h="_bellOpen_izzak_442",fh="_bellBadge_izzak_446",mh="_bellBadgeZero_izzak_465",vh="_bellPanelHost_izzak_470",xh="_panel_izzak_514",gh="_evoPanelEnter_izzak_1",bh="_panelHeader_izzak_532",yh="_panelTitle_izzak_541",wh="_panelHeaderActions_izzak_546",jh="_panelMarkAll_izzak_552",kh="_panelClose_izzak_572",Nh="_panelBody_izzak_591",Eh="_panelState_izzak_595",Th="_panelStateError_izzak_605",Ih="_itemList_izzak_609",$h="_emptyState_izzak_621",Ch="_emptyIcon_izzak_630",Sh="_emptyTitle_izzak_641",Lh="_emptyHint_izzak_647",Mh="_item_izzak_609",Dh="_itemUnread_izzak_661",Bh="_itemInteractive_izzak_665",Rh="_itemUnreadDot_izzak_676",Ah="_itemMedia_izzak_690",zh="_itemAvatar_izzak_716",Ph="_itemMediaGlyph_izzak_722",Oh="_itemBody_izzak_726",Wh="_itemTitle_izzak_731",Hh="_itemDescription_izzak_738",qh="_itemMeta_izzak_749",Fh="_itemTimestamp_izzak_758",Gh="_itemAction_izzak_762",Vh="_itemDismiss_izzak_782",O={toasterRoot:Gu,srOnly:Vu,anchor:Ku,"anchor-top-left":"_anchor-top-left_izzak_94","anchor-top-center":"_anchor-top-center_izzak_101","anchor-top-right":"_anchor-top-right_izzak_109","anchor-bottom-left":"_anchor-bottom-left_izzak_116","anchor-bottom-center":"_anchor-bottom-center_izzak_122","anchor-bottom-right":"_anchor-bottom-right_izzak_129",overflowPill:Uu,toast:Yu,evoToastEnterRight:Qu,evoToastEnterLeft:Xu,evoToastEnterTop:Ju,evoToastEnterBottom:Zu,exiting:eh,evoToastExit:th,noMotion:nh,"sev-success":"_sev-success_izzak_224",toastIcon:sh,"sev-error":"_sev-error_izzak_232","sev-warning":"_sev-warning_izzak_240","sev-info":"_sev-info_izzak_248",toastBody:oh,toastTitle:rh,toastDescription:ah,toastCount:ih,toastProgressTrack:ch,toastProgressFill:lh,toastAction:dh,toastClose:uh,bellWrapper:hh,bell:ph,"bell-ghost":"_bell-ghost_izzak_418","bell-solid":"_bell-solid_izzak_422","bell-sm":"_bell-sm_izzak_427","bell-md":"_bell-md_izzak_432","bell-lg":"_bell-lg_izzak_437",bellOpen:_h,bellBadge:fh,bellBadgeZero:mh,bellPanelHost:vh,"place-bottom-end":"_place-bottom-end_izzak_488","place-bottom-start":"_place-bottom-start_izzak_493","place-bottom":"_place-bottom_izzak_488","place-top-end":"_place-top-end_izzak_504","place-top-start":"_place-top-start_izzak_509",panel:xh,evoPanelEnter:gh,panelHeader:bh,panelTitle:yh,panelHeaderActions:wh,panelMarkAll:jh,panelClose:kh,panelBody:Nh,panelState:Eh,panelStateError:Th,itemList:Ih,emptyState:$h,emptyIcon:Ch,emptyTitle:Sh,emptyHint:Lh,item:Mh,itemUnread:Dh,itemInteractive:Bh,itemUnreadDot:Rh,itemMedia:Ah,itemAvatar:zh,itemMediaGlyph:Ph,itemBody:Oh,itemTitle:Wh,itemDescription:Hh,itemMeta:qh,itemTimestamp:Fh,itemAction:Gh,itemDismiss:Vh},es={defaultAnchor:"top-right",defaultDuration:4e3,maxVisible:3,pauseOnFocusLoss:!0,persistErrors:!1},Kh=180,Uh=Object.freeze([]),Yh=Object.freeze({items:Object.freeze([]),unread:0});class Qh{constructor(){this.toasts=[],this.inboxItems=[],this.inboxSnapshot={items:[],unread:0},this.inboxOwnedExternally=!1,this.inboxOnChange=null,this.toastListeners=new Set,this.inboxListeners=new Set,this.configListeners=new Set,this.config=es,this.counter=0}setConfig(t){const s={...this.config,...t};Object.keys(s).some(a=>s[a]!==this.config[a])&&(this.config=s,this.notifyConfig())}getConfig(){return this.config}subscribeConfig(t){return this.configListeners.add(t),()=>{this.configListeners.delete(t)}}notifyConfig(){this.configListeners.forEach(t=>t())}resolveDuration(t,s){return t.persistent===!0?1/0:t.duration!=null?t.duration:s==="error"&&this.config.persistErrors&&t.persistent!==!1?1/0:this.config.defaultDuration}bindExternalInbox(t,s){t!==void 0?(this.inboxOwnedExternally=!0,this.inboxItems=t,this.inboxOnChange=s??null,this.refreshInboxSnapshot(),this.notifyInbox()):(this.inboxOwnedExternally=!1,this.inboxOnChange=null)}refreshInboxSnapshot(){let t=0;for(const s of this.inboxItems)s.read||(t+=1);this.inboxSnapshot={items:this.inboxItems,unread:t}}nextId(){return this.counter+=1,`evo-${Date.now().toString(36)}-${this.counter}`}pushToast(t,s={}){const o=s.severity??"info";if(s.groupKey!=null&&s.id==null){const c=this.toasts.find(p=>p.groupKey===s.groupKey&&!p.exiting);if(c)return this.toasts=this.toasts.map(p=>p.id===c.id?{...p,...s,id:c.id,severity:o,duration:this.resolveDuration(s,o),message:t,count:p.count+1,restartKey:p.restartKey+1}:p),this.applyInboxSideEffect(c.id,t,s),this.notifyToasts(),c.id}const a=s.id??this.nextId(),i=this.resolveDuration(s,o);if(this.toasts.find(c=>c.id===a))this.toasts=this.toasts.map(c=>c.id===a?{...c,...s,id:a,severity:o,duration:i,message:t,restartKey:c.restartKey+1,exiting:!1}:c);else{const c={...s,id:a,severity:o,duration:i,message:t,createdAt:Date.now(),count:1,restartKey:0};this.toasts=[...this.toasts,c]}return this.applyInboxSideEffect(a,t,s),this.notifyToasts(),a}applyInboxSideEffect(t,s,o){if(!o.inbox)return;const a={id:`${t}-inbox`,title:o.title??s,description:o.description,severity:o.severity??"info",icon:o.icon,action:o.action,...typeof o.inbox=="object"?o.inbox:{}};this.pushInbox(a)}updateToast(t,s){const o=this.toasts.findIndex(l=>l.id===t);if(o===-1)return;const a=this.toasts[o],i={...a,...s,id:t,severity:s.severity??a.severity,message:"title"in s&&s.title!=null?s.title:a.message,restartKey:a.restartKey+1};s.persistent===!0?i.duration=1/0:s.duration!=null?i.duration=s.duration:s.persistent===!1&&(i.duration=this.resolveDuration({...s,persistent:!1},i.severity)),this.toasts=this.toasts.map(l=>l.id===t?i:l),this.notifyToasts()}dismissToast(t,s="dismiss"){var a,i;if(t==null){const l=this.toasts.filter(c=>!c.exiting);if(l.length===0)return;l.forEach(c=>{var p;return(p=c.onDismiss)==null?void 0:p.call(c,c.id)}),this.toasts=this.toasts.map(c=>c.exiting?c:{...c,exiting:!0}),this.notifyToasts();return}const o=this.toasts.find(l=>l.id===t);!o||o.exiting||(s==="auto"?(a=o.onAutoClose)==null||a.call(o,t):(i=o.onDismiss)==null||i.call(o,t),this.toasts=this.toasts.map(l=>l.id===t?{...l,exiting:!0}:l),this.notifyToasts())}removeToast(t){const s=this.toasts.length;this.toasts=this.toasts.filter(o=>o.id!==t),this.toasts.length!==s&&this.notifyToasts()}getToasts(){return this.toasts}subscribeToasts(t){return this.toastListeners.add(t),()=>{this.toastListeners.delete(t)}}notifyToasts(){this.toastListeners.forEach(t=>t(this.toasts))}pushInbox(t){const s=t.id??this.nextId(),o=t.timestamp instanceof Date?t.timestamp.getTime():t.timestamp??Date.now(),a={id:s,title:t.title,description:t.description,severity:t.severity??"info",icon:t.icon,avatarUrl:t.avatarUrl,timestamp:o,read:t.read??!1,action:t.action,onClick:t.onClick,meta:t.meta},l=this.inboxItems.findIndex(c=>c.id===s)===-1?[a,...this.inboxItems]:this.inboxItems.map(c=>c.id===s?a:c);if(this.commitInbox(l),t.toast){const c={id:`${s}-toast`,title:a.title,description:a.description,severity:a.severity,icon:a.icon,action:a.action,...typeof t.toast=="object"?t.toast:{}};this.pushToast(a.title,c)}return s}markRead(t){this.commitInbox(this.inboxItems.map(s=>s.id===t?{...s,read:!0}:s))}markUnread(t){this.commitInbox(this.inboxItems.map(s=>s.id===t?{...s,read:!1}:s))}markAllRead(){this.commitInbox(this.inboxItems.map(t=>t.read?t:{...t,read:!0}))}removeInbox(t){this.commitInbox(this.inboxItems.filter(s=>s.id!==t))}clearInbox(){this.commitInbox([])}setInboxItems(t){this.commitInbox(t)}getInboxState(){return this.inboxSnapshot}subscribeInbox(t){return this.inboxListeners.add(t),()=>{this.inboxListeners.delete(t)}}commitInbox(t){var s;this.inboxItems=t,this.refreshInboxSnapshot(),this.inboxOwnedExternally&&((s=this.inboxOnChange)==null||s.call(this,t)),this.notifyInbox()}notifyInbox(){const t=this.inboxSnapshot;this.inboxListeners.forEach(s=>s(t))}}const re=new Qh,Xh=(n,t)=>re.pushToast(n,t),Ze=Xh;Ze.success=(n,t)=>re.pushToast(n,{...t,severity:"success"});Ze.error=(n,t)=>re.pushToast(n,{...t,severity:"error"});Ze.warning=(n,t)=>re.pushToast(n,{...t,severity:"warning"});Ze.info=(n,t)=>re.pushToast(n,{...t,severity:"info"});Ze.loading=(n,t)=>re.pushToast(n,{...t,severity:"info",persistent:!0,dismissible:!1});Ze.update=(n,t)=>re.updateToast(n,t);Ze.dismiss=n=>re.dismissToast(n);Ze.promise=(n,t)=>{const s=re.pushToast(typeof t.loading=="object"&&t.loading!==null&&!St(t.loading)?t.loading.title??"":t.loading,{...typeof t.loading=="object"&&!St(t.loading)?t.loading:{},severity:"info",persistent:!0,dismissible:!1});return(typeof n=="function"?n():n).then(a=>{const i=typeof t.success=="function"?t.success(a):t.success,l=i!==null&&typeof i=="object"&&!St(i),c=l?i:{},p=l?c.title??"":i;re.updateToast(s,{...c,severity:"success",persistent:!1,dismissible:!0,title:p})},a=>{const i=typeof t.error=="function"?t.error(a):t.error,l=i!==null&&typeof i=="object"&&!St(i),c=l?i:{},p=l?c.title??"":i;re.updateToast(s,{...c,severity:"error",persistent:!1,dismissible:!0,title:p})}),s};Ze.progress=(n,t)=>{const s=re.pushToast(n,{...t,severity:(t==null?void 0:t.severity)??"info",persistent:!0,dismissible:(t==null?void 0:t.dismissible)??!1,progress:Gt((t==null?void 0:t.progress)??0)});return{id:s,setProgress:o=>re.updateToast(s,{progress:Gt(o)}),update:o=>re.updateToast(s,o),done:o=>re.updateToast(s,{...o,severity:(o==null?void 0:o.severity)??"success",progress:1,persistent:!1,dismissible:!0}),fail:o=>re.updateToast(s,{...o,severity:(o==null?void 0:o.severity)??"error",persistent:!1,dismissible:!0}),dismiss:()=>re.dismissToast(s)}};function St(n){if(n==null)return!0;const t=typeof n;return!!(t==="string"||t==="number"||t==="boolean"||Array.isArray(n)||t==="object"&&n!==null&&"$$typeof"in n)}function Gt(n){return typeof n!="number"||Number.isNaN(n)||n<0?0:n>1?1:n}const Jh={toast:Ze,push:n=>re.pushInbox(n),inbox:{markRead:n=>re.markRead(n),markUnread:n=>re.markUnread(n),markAllRead:()=>re.markAllRead(),remove:n=>re.removeInbox(n),clear:()=>re.clearInbox(),setItems:n=>re.setInboxItems(n),getState:()=>re.getInboxState(),subscribe:n=>re.subscribeInbox(n)},dismissAll:()=>re.dismissToast()};function Xe(...n){return n.filter(Boolean).join(" ")}const ts={success:"✓",error:"✕",warning:"!",info:"i"};function Zh(n,t){const s=Math.max(0,t-n),o=Math.floor(s/1e3);if(o<60)return"just now";const a=Math.floor(o/60);if(a<60)return`${a}m ago`;const i=Math.floor(a/60);if(i<24)return`${i}h ago`;const l=Math.floor(i/24);return l<7?`${l}d ago`:new Date(n).toLocaleDateString()}function ns(n){const t=[],s=n.title??n.message;return(typeof s=="string"||typeof s=="number")&&t.push(String(s)),(typeof n.description=="string"||typeof n.description=="number")&&t.push(String(n.description)),t.join(". ")}function ep(){return r.useSyncExternalStore(n=>re.subscribeToasts(()=>n()),()=>re.getToasts(),()=>Uh)}function rn(){return r.useSyncExternalStore(n=>re.subscribeInbox(()=>n()),()=>re.getInboxState(),()=>Yh)}function tp(){return r.useSyncExternalStore(n=>re.subscribeConfig(n),()=>re.getConfig(),()=>es)}const an=({children:n,defaultAnchor:t="top-right",maxVisible:s=3,defaultDuration:o=4e3,pauseOnFocusLoss:a=!0,persistErrors:i=!1,inboxItems:l,onInboxChange:c})=>(r.useLayoutEffect(()=>{re.setConfig({defaultAnchor:t,maxVisible:s,defaultDuration:o,pauseOnFocusLoss:a,persistErrors:i})},[t,s,o,a,i]),r.useLayoutEffect(()=>{re.bindExternalInbox(l,c)},[l,c]),e.jsx(e.Fragment,{children:n}));an.displayName="EvoNotificationProvider";const np=({toast:n,anchor:t,index:s,total:o,hovered:a,pausedExternally:i,reducedMotion:l})=>{const c=r.useRef(0),p=r.useRef(null),v=r.useRef(null),b=r.useRef(n.restartKey),_=n.exiting??!1,x=a||i,N=Number.isFinite(n.duration);r.useEffect(()=>{if(!_)return;const y=window.setTimeout(()=>re.removeToast(n.id),l?0:Kh);return()=>window.clearTimeout(y)},[_,l,n.id]),r.useEffect(()=>{if(b.current!==n.restartKey&&(b.current=n.restartKey,c.current=0),!N||_)return;if(x){p.current!=null&&(c.current+=Date.now()-p.current,p.current=null),v.current!=null&&(window.clearTimeout(v.current),v.current=null);return}const y=Math.max(0,n.duration-c.current);return p.current=Date.now(),v.current=window.setTimeout(()=>re.dismissToast(n.id,"auto"),y),()=>{v.current!=null&&(window.clearTimeout(v.current),v.current=null),p.current!=null&&(c.current+=Date.now()-p.current,p.current=null)}},[x,N,_,n.duration,n.restartKey,n.id]);const w=o-1-s,C=a?1:Math.max(.94,1-w*.04),E=a?w*8:w*6,D=a?1:Math.max(.7,1-w*.15),V=t.startsWith("bottom")?1:-1,H={transform:`translateY(${E*V}px) scale(${C})`,opacity:D,zIndex:1e3+s},ue=n.dismissible??!0,j=n.icon??ts[n.severity],M=n.title??n.message,B=ns(n),S=typeof n.progress=="number",se=S?Gt(n.progress):0,Q=B!=="";return e.jsxs("div",{className:Xe(O.toast,O[`sev-${n.severity}`],_&&O.exiting,l&&O.noMotion,n.className),style:H,role:Q?"group":n.severity==="error"?"alert":"status","aria-label":Q?B:void 0,children:[e.jsx("span",{className:O.toastIcon,"aria-hidden":"true",children:j}),e.jsxs("div",{className:O.toastBody,children:[M!=null&&e.jsxs("div",{className:O.toastTitle,children:[M,n.count>1&&e.jsxs("span",{className:O.toastCount,"aria-label":`repeated ${n.count} times`,children:["×",n.count]})]}),n.description!=null&&e.jsx("div",{className:O.toastDescription,children:n.description})]}),n.action&&e.jsx("button",{type:"button",className:O.toastAction,onClick:y=>{n.action.onClick(y),re.dismissToast(n.id)},children:n.action.label}),ue&&e.jsx("button",{type:"button",className:O.toastClose,onClick:()=>{re.dismissToast(n.id)},"aria-label":"Dismiss notification",children:"✕"}),S&&e.jsx("div",{className:O.toastProgressTrack,role:"progressbar","aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":se,children:e.jsx("div",{className:O.toastProgressFill,style:{transform:`scaleX(${se})`}})})]})},sp=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"];let Nt=null;const cn=({anchor:n,className:t})=>{const s=ep(),{defaultAnchor:o,maxVisible:a,pauseOnFocusLoss:i}=tp(),l=n??o,[c,p]=r.useState(null),[v,b]=r.useState(!0),[_,x]=r.useState(!1),[N,w]=r.useState(!1),[C,E]=r.useState(!1),[D,V]=r.useState(""),[H,ue]=r.useState(""),j=r.useRef(new Set),M=r.useRef(null);if(M.current||(M.current=Symbol("evo-toaster")),r.useEffect(()=>{const S=M.current;return Nt==null?(Nt=S,E(!0)):Nt!==S&&console.warn("[EvoNotification] More than one <EvoNotificationToaster> is mounted; only the first renders. Remove the duplicate(s)."),()=>{Nt===S&&(Nt=null)}},[]),r.useEffect(()=>{var Q;if(w(!0),typeof window>"u")return;const S=window.matchMedia("(prefers-reduced-motion: reduce)");x(S.matches);const se=y=>x(y.matches);return(Q=S.addEventListener)==null||Q.call(S,"change",se),()=>{var y;return(y=S.removeEventListener)==null?void 0:y.call(S,"change",se)}},[]),r.useEffect(()=>{if(!i)return;const S=()=>b(!0),se=()=>b(!1);return window.addEventListener("focus",S),window.addEventListener("blur",se),()=>{window.removeEventListener("focus",S),window.removeEventListener("blur",se)}},[i]),r.useEffect(()=>{const S=j.current,se=new Set;for(const Q of s){if(se.add(Q.id),S.has(Q.id)||Q.exiting)continue;S.add(Q.id);const y=ns(Q);y&&(Q.severity==="error"?ue(y):V(y))}for(const Q of S)se.has(Q)||S.delete(Q)},[s]),r.useEffect(()=>{const S=se=>{if(se.key==="Escape"&&c!=null){const Q=s.filter(y=>!y.exiting&&(y.anchor??l)===c);Q.length>0&&re.dismissToast(Q[Q.length-1].id)}};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[s,l,c]),!N||typeof document>"u"||!C)return null;const B={"top-left":[],"top-center":[],"top-right":[],"bottom-left":[],"bottom-center":[],"bottom-right":[]};for(const S of s){const se=S.anchor??l;B[se].push(S)}return Nn.createPortal(e.jsxs("div",{className:Xe(O.toasterRoot,t),"aria-label":"Notifications",children:[e.jsx("div",{className:O.srOnly,"aria-live":"polite","aria-atomic":"true",children:D}),e.jsx("div",{className:O.srOnly,"aria-live":"assertive","aria-atomic":"true",children:H}),sp.map(S=>{const se=B[S];if(se.length===0)return null;const Q=Math.max(0,se.length-a),y=se.slice(Math.max(0,se.length-a)),te=c===S,R=!v;return e.jsxs("div",{className:Xe(O.anchor,O[`anchor-${S}`]),onMouseEnter:()=>p(S),onMouseLeave:()=>p(null),onFocus:()=>p(S),onBlur:he=>{he.currentTarget.contains(he.relatedTarget)||p(null)},children:[Q>0&&e.jsxs("div",{className:O.overflowPill,"aria-hidden":"true",children:["+",Q," more"]}),y.map((he,$)=>e.jsx(np,{toast:he,anchor:S,index:$,total:y.length,hovered:te,pausedExternally:R,reducedMotion:_},he.id))]},S)})]}),document.body)};cn.displayName="EvoNotificationToaster";const ln=r.forwardRef(function({variant:t="ghost",size:s="md",hideZero:o=!0,maxBadgeCount:a=99,panelPlacement:i="bottom-end",renderPanel:l="popover",panelTitle:c,panelEmptyState:p,className:v,onClick:b,..._},x){const{unread:N}=rn(),[w,C]=r.useState(!1),E=r.useRef(null),D=r.useId();r.useEffect(()=>{if(!w||l!=="popover")return;const ue=M=>{var B;(B=E.current)!=null&&B.contains(M.target)||C(!1)},j=M=>{M.key==="Escape"&&C(!1)};return document.addEventListener("mousedown",ue),document.addEventListener("keydown",j),()=>{document.removeEventListener("mousedown",ue),document.removeEventListener("keydown",j)}},[w,l]);const V=N>a?`${a}+`:String(N),H=N>0||!o;return e.jsxs("div",{ref:E,className:O.bellWrapper,children:[e.jsxs("button",{ref:x,type:"button",className:Xe(O.bell,O[`bell-${t}`],O[`bell-${s}`],w&&O.bellOpen,v),"aria-label":N>0?`Notifications, ${N} unread`:"Notifications","aria-haspopup":l==="popover"?"dialog":void 0,"aria-expanded":l==="popover"?w:void 0,"aria-controls":l==="popover"?D:void 0,onClick:ue=>{b==null||b(ue),l==="popover"&&C(j=>!j)},..._,children:[e.jsx(ss,{}),H&&e.jsx("span",{className:Xe(O.bellBadge,N===0&&O.bellBadgeZero),children:V})]}),l==="popover"&&w&&e.jsx("div",{id:D,className:Xe(O.bellPanelHost,O[`place-${i}`]),children:e.jsx(At,{open:!0,onClose:()=>C(!1),title:c,emptyState:p})})]})});ln.displayName="EvoNotificationBell";const ss=()=>e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 8 3 8H3s3-1 3-8"}),e.jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]}),At=r.forwardRef(function({open:t=!0,onClose:s,title:o="Notifications",emptyState:a,loading:i=!1,error:l,showMarkAllRead:c=!0,maxHeight:p=480,className:v,style:b,..._},x){const{items:N,unread:w}=rn();return t?e.jsxs("div",{ref:x,className:Xe(O.panel,v),role:"dialog","aria-label":typeof o=="string"?o:"Notifications",style:b,..._,children:[e.jsxs("header",{className:O.panelHeader,children:[e.jsx("div",{className:O.panelTitle,children:o}),e.jsxs("div",{className:O.panelHeaderActions,children:[c&&w>0&&e.jsx("button",{type:"button",className:O.panelMarkAll,onClick:()=>re.markAllRead(),children:"Mark all read"}),s&&e.jsx("button",{type:"button",className:O.panelClose,onClick:s,"aria-label":"Close notifications",children:"✕"})]})]}),e.jsx("div",{className:O.panelBody,style:{maxHeight:typeof p=="number"?`${p}px`:p},children:i?e.jsx("div",{className:O.panelState,children:"Loading…"}):l?e.jsx("div",{className:Xe(O.panelState,O.panelStateError),children:l}):N.length===0?e.jsx("div",{className:O.panelState,children:a??e.jsx(op,{})}):e.jsx("ul",{className:O.itemList,children:N.map(C=>e.jsx("li",{children:e.jsx(zt,{item:C})},C.id))})})]}):null});At.displayName="EvoNotificationPanel";const op=()=>e.jsxs("div",{className:O.emptyState,children:[e.jsx("div",{className:O.emptyIcon,"aria-hidden":"true",children:e.jsx(ss,{})}),e.jsx("div",{className:O.emptyTitle,children:"You're all caught up"}),e.jsx("div",{className:O.emptyHint,children:"New notifications will appear here."})]}),zt=r.forwardRef(function({item:t,onClick:s,className:o,...a},i){const[l,c]=r.useState(t.timestamp);r.useEffect(()=>{c(Date.now());const x=window.setInterval(()=>c(Date.now()),6e4);return()=>window.clearInterval(x)},[]);const p=r.useCallback(()=>{var x;(x=s??t.onClick)==null||x(t),t.read||re.markRead(t.id)},[t,s]),v=r.useCallback(x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),p())},[p]),b=!!(s??t.onClick),_=t.icon??ts[t.severity];return e.jsxs("div",{ref:i,className:Xe(O.item,!t.read&&O.itemUnread,b&&O.itemInteractive,o),role:b?"button":"group",tabIndex:b?0:void 0,onClick:b?p:void 0,onKeyDown:b?v:void 0,...a,children:[e.jsx("span",{className:O.itemUnreadDot,"aria-hidden":t.read}),e.jsx("div",{className:Xe(O.itemMedia,O[`sev-${t.severity}`]),"aria-hidden":"true",children:t.avatarUrl?e.jsx("img",{src:t.avatarUrl,alt:"",className:O.itemAvatar}):e.jsx("span",{className:O.itemMediaGlyph,children:_})}),e.jsxs("div",{className:O.itemBody,children:[e.jsx("div",{className:O.itemTitle,children:t.title}),t.description!=null&&e.jsx("div",{className:O.itemDescription,children:t.description}),e.jsxs("div",{className:O.itemMeta,children:[e.jsx("span",{className:O.itemTimestamp,children:Zh(t.timestamp,l)}),t.action&&e.jsx("button",{type:"button",className:O.itemAction,onClick:x=>{x.stopPropagation(),t.action.onClick(x)},children:t.action.label})]})]}),e.jsx("button",{type:"button",className:O.itemDismiss,onClick:x=>{x.stopPropagation(),re.removeInbox(t.id)},"aria-label":"Remove notification",children:"✕"})]})});zt.displayName="EvoNotificationItem";function rp(){return rn()}const ap={Provider:an,Toaster:cn,Bell:ln,Panel:At,Item:zt},ip="_wrapper_1fxx0_11",cp="_tooltip_1fxx0_17",lp="_tooltipFadeIn_1fxx0_1",dp="_top_1fxx0_33",up="_bottom_1fxx0_38",hp="_left_1fxx0_43",pp="_right_1fxx0_48",_p="_arrow_1fxx0_54",Lt={wrapper:ip,tooltip:cp,tooltipFadeIn:lp,top:dp,bottom:up,left:hp,right:pp,arrow:_p},fp=({content:n,children:t,placement:s="top",className:o=""})=>{const[a,i]=r.useState(!1);return e.jsxs("span",{className:`${Lt.wrapper} ${o}`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),children:[t,a&&e.jsxs("span",{className:`${Lt.tooltip} ${Lt[s]}`,role:"tooltip",children:[n,e.jsx("span",{className:Lt.arrow})]})]})},mp="_alert_slsq7_1",vp="_success_slsq7_10",xp="_alertIcon_slsq7_14",gp="_alertTitle_slsq7_17",bp="_error_slsq7_20",yp="_warning_slsq7_30",wp="_info_slsq7_40",jp="_alertContent_slsq7_65",kp="_alertDescription_slsq7_76",Np="_dismissBtn_slsq7_83",pt={alert:mp,success:vp,alertIcon:xp,alertTitle:gp,error:bp,warning:yp,info:wp,alertContent:jp,alertDescription:kp,dismissBtn:Np},Ep={success:"✓",error:"✕",warning:"⚠",info:"i"},Tp=({type:n="info",title:t,children:s,dismissible:o=!1,className:a=""})=>{const[i,l]=r.useState(!1);return i?null:e.jsxs("div",{className:[pt.alert,pt[n],a].filter(Boolean).join(" "),role:"alert",children:[e.jsx("span",{className:pt.alertIcon,children:Ep[n]}),e.jsxs("div",{className:pt.alertContent,children:[t&&e.jsx("p",{className:pt.alertTitle,children:t}),e.jsx("div",{className:pt.alertDescription,children:s})]}),o&&e.jsx("button",{className:pt.dismissBtn,onClick:()=>l(!0),"aria-label":"Dismiss alert",children:"✕"})]})},Ip="_badge_nypvn_1",$p="_sm_nypvn_12",Cp="_md_nypvn_16",Sp="_lg_nypvn_20",Lp="_solid_nypvn_25",Mp="_primary_nypvn_25",Dp="_secondary_nypvn_30",Bp="_success_nypvn_35",Rp="_warning_nypvn_40",Ap="_danger_nypvn_45",zp="_info_nypvn_50",Pp="_outline_nypvn_56",Op="_subtle_nypvn_84",Wp="_dot_nypvn_115",Hp="_removeBtn_nypvn_123",qp="_badgeGroup_nypvn_142",ft={badge:Ip,sm:$p,md:Cp,lg:Sp,solid:Lp,primary:Mp,secondary:Dp,success:Bp,warning:Rp,danger:Ap,info:zp,outline:Pp,subtle:Op,dot:Wp,removeBtn:Hp,badgeGroup:qp},Fp=({children:n,className:t=""})=>e.jsx("div",{className:`${ft.badgeGroup} ${t}`,children:n}),os=({children:n,severity:t="primary",variant:s="solid",size:o="md",dot:a=!1,removable:i=!1,onRemove:l,className:c=""})=>e.jsxs("span",{className:[ft.badge,ft[t],ft[s],ft[o],c].filter(Boolean).join(" "),children:[a&&e.jsx("span",{className:ft.dot}),n,i&&e.jsx("button",{className:ft.removeBtn,onClick:l,"aria-label":"Remove",children:"✕"})]});os.Group=Fp;const Gp="_skeleton_7wr3a_9",Vp="_animated_7wr3a_14",Kp="_textGroup_7wr3a_20",mt={skeleton:Gp,animated:Vp,textGroup:Kp},Et=n=>typeof n=="number"?`${n}px`:n,Up=({lines:n=3,className:t="",animated:s=!0})=>e.jsx("div",{className:`${mt.textGroup} ${t}`,children:Array.from({length:n}).map((o,a)=>e.jsx("div",{className:[mt.skeleton,s?mt.animated:""].filter(Boolean).join(" "),style:{width:a===n-1?"65%":"100%",height:"0.875rem",borderRadius:"4px"}},a))}),Yp=({size:n=40,className:t="",animated:s=!0})=>e.jsx("div",{className:[mt.skeleton,s?mt.animated:"",t].filter(Boolean).join(" "),style:{width:Et(n),height:Et(n),borderRadius:"50%"}}),dn=({width:n="100%",height:t="1rem",borderRadius:s="6px",className:o="",animated:a=!0})=>e.jsx("div",{className:[mt.skeleton,a?mt.animated:"",o].filter(Boolean).join(" "),style:{width:Et(n),height:Et(t),borderRadius:Et(s)}});dn.Text=Up;dn.Circle=Yp;const Qp="_wrapper_69yee_1",Xp="_scroll_69yee_11",Jp="_table_69yee_30",Zp="_caption_69yee_38",e_="_thead_69yee_46",t_="_th_69yee_46",n_="_sortBtn_69yee_63",s_="_sortIcon_69yee_85",o_="_sortActive_69yee_92",r_="_tbody_69yee_99",a_="_tr_69yee_99",i_="_td_69yee_103",c_="_hoverable_69yee_167",l_="_striped_69yee_171",d_="_bordered_69yee_179",u_="_stickyHeader_69yee_184",h_="_clickable_69yee_195",p_="_empty_69yee_202",__="_emptyText_69yee_209",f_="_skeleton_69yee_213",m_="_evoTableShimmer_69yee_1",v_="_responsiveStack_69yee_237",x_="_emptyRow_69yee_272",ve={wrapper:Qp,scroll:Xp,table:Jp,caption:Zp,thead:e_,th:t_,sortBtn:n_,sortIcon:s_,sortActive:o_,tbody:r_,tr:a_,td:i_,"align-left":"_align-left_69yee_115","align-center":"_align-center_69yee_119","align-right":"_align-right_69yee_123","size-sm":"_size-sm_69yee_137","size-md":"_size-md_69yee_147","size-lg":"_size-lg_69yee_157",hoverable:c_,striped:l_,bordered:d_,stickyHeader:u_,clickable:h_,empty:p_,emptyText:__,skeleton:f_,evoTableShimmer:m_,responsiveStack:v_,emptyRow:x_};function Ht(n,t){return t.split(".").reduce((s,o)=>{if(s!=null&&typeof s=="object")return s[o]},n)}function g_(n,t){return n==null&&t==null?0:n==null?-1:t==null?1:typeof n=="number"&&typeof t=="number"?n-t:String(n).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}function b_(n,t,s){if(typeof s=="function")return s(n,t);if(s&&n&&typeof n=="object"){const o=n[s];if(typeof o=="string"||typeof o=="number")return o}return t}const y_=({direction:n})=>e.jsxs("svg",{className:ve.sortIcon,width:"8",height:"12",viewBox:"0 0 8 12","aria-hidden":"true",focusable:"false",children:[e.jsx("path",{d:"M4 0 L8 4 H0 Z",fill:"currentColor",opacity:n==="asc"?1:.3}),e.jsx("path",{d:"M4 12 L0 8 H8 Z",fill:"currentColor",opacity:n==="desc"?1:.3})]}),w_=({columns:n,data:t,size:s="md",striped:o=!1,hoverable:a=!0,bordered:i=!1,stickyHeader:l=!1,loading:c=!1,loadingRows:p=5,rowKey:v,emptyState:b,emptyText:_="No data available.",onRowClick:x,onRowDoubleClick:N,getRowClassName:w,responsive:C="scroll",caption:E,sort:D,onSortChange:V,defaultSort:H,className:ue})=>{const j=D!==void 0,[M,B]=r.useState(H??null),S=j?D:M,se=$=>{let P;!S||S.key!==$?P={key:$,direction:"asc"}:S.direction==="asc"?P={key:$,direction:"desc"}:P=null,j||B(P),V==null||V(P)},Q=r.useMemo(()=>{if(!S)return t;const $=n.find(W=>W.key===S.key);if(!$)return t;const P=S.direction,A=[...t];return $.sortFn?A.sort((W,G)=>$.sortFn(W,G,P)):A.sort((W,G)=>{const ae=Ht(W,$.key),ee=Ht(G,$.key),J=g_(ae,ee);return P==="asc"?J:-J}),A},[t,n,S]),y=!!(x||N),te=[ve.wrapper,ve[`size-${s}`],o&&ve.striped,a&&ve.hoverable,i&&ve.bordered,l&&ve.stickyHeader,C==="stack"&&ve.responsiveStack,y&&ve.clickable,ue].filter(Boolean).join(" "),R=$=>{const P=$.align??"left",A=(S==null?void 0:S.key)===$.key,W=A?S.direction:void 0,G=A?W==="asc"?"ascending":"descending":$.sortable?"none":void 0,ae=[ve.th,ve[`align-${P}`],$.headerClassName].filter(Boolean).join(" ");return e.jsx("th",{scope:"col",className:ae,style:$.width?{width:$.width}:void 0,"aria-sort":G,children:$.sortable?e.jsxs("button",{type:"button",className:[ve.sortBtn,A?ve.sortActive:""].filter(Boolean).join(" "),onClick:()=>se($.key),children:[e.jsx("span",{children:$.header}),e.jsx(y_,{direction:W})]}):$.header},$.key)},he=()=>c?Array.from({length:Math.max(1,p)}).map(($,P)=>e.jsx("tr",{className:ve.tr,children:n.map(A=>e.jsx("td",{className:[ve.td,ve[`align-${A.align??"left"}`]].filter(Boolean).join(" "),"data-label":typeof A.header=="string"?A.header:A.key,children:e.jsx("span",{className:ve.skeleton})},A.key))},`evo-skeleton-${P}`)):Q.length===0?e.jsx("tr",{className:ve.emptyRow,children:e.jsx("td",{colSpan:n.length,className:ve.empty,children:b??e.jsx("span",{className:ve.emptyText,children:_})})}):Q.map(($,P)=>{const A=[ve.tr,w==null?void 0:w($,P)].filter(Boolean).join(" ");return e.jsx("tr",{className:A,onClick:x?()=>x($,P):void 0,onDoubleClick:N?()=>N($,P):void 0,children:n.map(W=>{const G=Ht($,W.key),ae=W.align??"left",ee=[ve.td,ve[`align-${ae}`],W.cellClassName].filter(Boolean).join(" ");return e.jsx("td",{className:ee,"data-label":typeof W.header=="string"?W.header:W.key,children:W.render?W.render(G,$,P):G==null?"":String(G)},W.key)})},b_($,P,v))});return e.jsx("div",{className:te,children:e.jsx("div",{className:ve.scroll,children:e.jsxs("table",{className:ve.table,children:[E&&e.jsx("caption",{className:ve.caption,children:E}),e.jsx("thead",{className:ve.thead,children:e.jsx("tr",{children:n.map(R)})}),e.jsx("tbody",{className:ve.tbody,children:he()})]})})})},j_="_root_1wpat_1",k_="_fullWidth_1wpat_11",N_="_label_1wpat_15",E_="_stage_1wpat_21",T_="_disabled_1wpat_38",I_="_bgChecker_1wpat_43",$_="_imageWrap_1wpat_49",C_="_image_1wpat_49",S_="_overlay_1wpat_68",L_="_overlayCircle_1wpat_77",M_="_circleMask_1wpat_82",D_="_grid_1wpat_89",B_="_gridLine_1wpat_95",R_="_h_1wpat_99",A_="_v_1wpat_104",z_="_handle_1wpat_110",P_="_handleTL_1wpat_128",O_="_handleTR_1wpat_134",W_="_handleBL_1wpat_140",H_="_handleBR_1wpat_146",q_="_handleT_1wpat_128",F_="_handleB_1wpat_140",G_="_handleL_1wpat_166",V_="_handleR_1wpat_166",K_="_controls_1wpat_200",U_="_controlGroup_1wpat_211",Y_="_controlLabel_1wpat_218",Q_="_iconBtn_1wpat_227",X_="_zoomSlider_1wpat_260",J_="_ratioRow_1wpat_294",Z_="_ratioChip_1wpat_300",ef="_active_1wpat_318",tf="_divider_1wpat_333",nf="_helper_1wpat_339",sf="_placeholder_1wpat_344",of="_spinner_1wpat_356",q={root:j_,fullWidth:k_,label:N_,stage:E_,disabled:T_,bgChecker:I_,imageWrap:$_,image:C_,overlay:S_,overlayCircle:L_,circleMask:M_,grid:D_,gridLine:B_,h:R_,v:A_,handle:z_,handleTL:P_,handleTR:O_,handleBL:W_,handleBR:H_,handleT:q_,handleB:F_,handleL:G_,handleR:V_,controls:K_,controlGroup:U_,controlLabel:Y_,iconBtn:Q_,zoomSlider:X_,ratioRow:J_,ratioChip:Z_,active:ef,divider:tf,helper:nf,placeholder:sf,spinner:of},rf=[{label:"Free",value:null},{label:"1:1",value:1},{label:"4:3",value:4/3},{label:"3:4",value:3/4},{label:"16:9",value:16/9},{label:"9:16",value:9/16}],Mt=24,qe=(n,t,s)=>Math.min(s,Math.max(t,n)),_t=n=>(Math.round(n/90)*90%360+360)%360,af=r.forwardRef(function({src:t,aspectRatio:s,circular:o=!1,showGrid:a=!0,showControls:i=!0,ratioPresets:l,minZoom:c=1,maxZoom:p=4,defaultZoom:v=1,defaultRotation:b=0,defaultCrop:_,height:x=360,background:N="checker",label:w,helperText:C,onChange:E,onReady:D,onError:V,disabled:H=!1,fullWidth:ue=!0,className:j,ariaLabel:M},B){const S=o?1:s,se=r.useRef(null),Q=r.useRef(null),[y,te]=r.useState({w:0,h:0}),[R,he]=r.useState(null),[$,P]=r.useState(!1),[A,W]=r.useState(!1),[G,ae]=r.useState(v),[ee,J]=r.useState(_t(b)),[Y,me]=r.useState({x:0,y:0}),[ye,we]=r.useState({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80}),[le,Be]=r.useState(S??null);r.useEffect(()=>{Be(S??null)},[S]),r.useLayoutEffect(()=>{const f=se.current;if(!f)return;const L=()=>{const Z=f.getBoundingClientRect();te({w:Z.width,h:Z.height})};L();const F=new ResizeObserver(L);return F.observe(f),()=>F.disconnect()},[]),r.useEffect(()=>{if(P(!1),W(!1),he(null),!t)return;const f=new Image;return f.crossOrigin="anonymous",f.onload=()=>{he({w:f.naturalWidth,h:f.naturalHeight}),P(!0),D==null||D({naturalWidth:f.naturalWidth,naturalHeight:f.naturalHeight})},f.onerror=()=>{W(!0),V==null||V(new Error(`Failed to load image: ${t}`))},f.src=t,()=>{f.onload=null,f.onerror=null}},[t]);const je=r.useMemo(()=>{if(!R||!y.w||!y.h)return 1;const f=ee===90||ee===270,L=f?R.h:R.w,F=f?R.w:R.h;return Math.min(y.w/L,y.h/F)},[R,y.w,y.h,ee]),ge=r.useMemo(()=>{if(!R)return{w:0,h:0};const f=je*G;return{w:R.w*f,h:R.h*f}},[R,je,G]),de=r.useMemo(()=>({left:ye.left/100*y.w,top:ye.top/100*y.h,width:ye.width/100*y.w,height:ye.height/100*y.h}),[ye,y]),be=r.useCallback(()=>{if(!R||!y.w||!y.h)return null;const f=je*G,L=y.w/2+Y.x,F=y.h/2+Y.y,Z=de.left+de.width/2,h=de.top+de.height/2,d=Z-L,g=h-F,k=-ee*Math.PI/180,z=d*Math.cos(k)-g*Math.sin(k),ne=d*Math.sin(k)+g*Math.cos(k),_e=ee===90||ee===270,Re=_e?de.height:de.width,Ne=_e?de.width:de.height,Ie=(z-Re/2)/f+R.w/2,$e=(ne-Ne/2)/f+R.h/2,Ae=Re/f,Oe=Ne/f;return{x:Ie,y:$e,width:Ae,height:Oe,rotation:ee,sourceWidth:R.w,sourceHeight:R.h}},[R,y,je,G,Y,de,ee]),We=r.useRef("");r.useEffect(()=>{if(!$)return;const f=be();if(!f)return;const L=`${f.x.toFixed(2)},${f.y.toFixed(2)},${f.width.toFixed(2)},${f.height.toFixed(2)},${f.rotation}`;L!==We.current&&(We.current=L,E==null||E(f))},[$,be,E]),r.useEffect(()=>{le==null||!y.w||!y.h||we(f=>{const L=f.width/100*y.w,F=f.height/100*y.h,Z=L/le;let h=L,d=Z;Z>F&&(d=F,h=F*le);const g=(f.left+f.width/2)/100*y.w,k=(f.top+f.height/2)/100*y.h;let z=g-h/2,ne=k-d/2;return z=qe(z,0,y.w-h),ne=qe(ne,0,y.h-d),{left:z/y.w*100,top:ne/y.h*100,width:h/y.w*100,height:d/y.h*100}})},[le,y.w,y.h]);const ke=r.useRef(null),Ee=r.useRef(null),m=r.useRef(new Map),u=f=>{var L,F;if(!(H||!$)){if((F=(L=f.target).setPointerCapture)==null||F.call(L,f.pointerId),m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),m.current.size===2){const Z=Array.from(m.current.values()),h=Math.hypot(Z[0].x-Z[1].x,Z[0].y-Z[1].y);Ee.current={startDist:h,startZoom:G},ke.current=null;return}ke.current={type:"pan",startX:f.clientX,startY:f.clientY,startPan:Y}}},T=f=>{if(!m.current.has(f.pointerId))return;if(m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),Ee.current&&m.current.size>=2){const h=Array.from(m.current.values()),d=Math.hypot(h[0].x-h[1].x,h[0].y-h[1].y),g=qe(Ee.current.startZoom*(d/Ee.current.startDist),c,p);ae(g);return}const L=ke.current;if(!L)return;const F=f.clientX-L.startX,Z=f.clientY-L.startY;L.type==="pan"?me({x:L.startPan.x+F,y:L.startPan.y+Z}):L.type==="move"?fe(F,Z,L.startCrop):L.type==="resize"&&oe(L.corner,F,Z,L.startCrop)},I=f=>{m.current.delete(f.pointerId),m.current.size<2&&(Ee.current=null),m.current.size===0&&(ke.current=null)},K=f=>{if(H||!$)return;f.preventDefault();const L=-f.deltaY*.0015;ae(F=>qe(F*(1+L),c,p))},fe=(f,L,F)=>{const Z=y.w,h=y.h,d=F.left/100*Z,g=F.top/100*h,k=F.width/100*Z,z=F.height/100*h,ne=qe(d+f,0,Z-k),_e=qe(g+L,0,h-z);we({left:ne/Z*100,top:_e/h*100,width:F.width,height:F.height})},oe=(f,L,F,Z)=>{const h=y.w,d=y.h;let g=Z.left/100*h,k=Z.top/100*d,z=Z.width/100*h,ne=Z.height/100*d;const _e=g+z,Re=k+ne;let Ne=g,Ie=k,$e=_e,Ae=Re;f.includes("l")&&(Ne=qe(g+L,0,_e-Mt)),f.includes("r")&&($e=qe(_e+L,g+Mt,h)),f.includes("t")&&(Ie=qe(k+F,0,Re-Mt)),f.includes("b")&&(Ae=qe(Re+F,k+Mt,d));let Oe=$e-Ne,Ge=Ae-Ie;if(le!=null){if(f.length===2){const ze=Oe,st=Oe/le;st<=Ge||f==="tl"||f==="tr"||f==="bl"||f==="br"?Ge=ze/le:Oe=st*le,f.includes("t")&&(Ie=Ae-Ge),f.includes("b")&&(Ae=Ie+Ge),f.includes("l")&&(Ne=$e-Oe),f.includes("r")&&($e=Ne+Oe)}else if(f==="l"||f==="r"){Ge=Oe/le;const ze=(k+Re)/2;Ie=ze-Ge/2,Ae=ze+Ge/2}else if(f==="t"||f==="b"){Oe=Ge*le;const ze=(g+_e)/2;Ne=ze-Oe/2,$e=ze+Oe/2}if(Ne<0&&($e+=-Ne,Ne=0),Ie<0&&(Ae+=-Ie,Ie=0),$e>h){const ze=$e-h;$e=h,Ne-=ze}if(Ae>d){const ze=Ae-d;Ae=d,Ie-=ze}if(Oe=$e-Ne,Ge=Ae-Ie,Math.abs(Oe/Ge-le)>.001)if(Oe/Ge>le){const ze=Ge*le,st=(Ne+$e)/2;Ne=st-ze/2,$e=st+ze/2}else{const ze=Oe/le,st=(Ie+Ae)/2;Ie=st-ze/2,Ae=st+ze/2}}we({left:Ne/h*100,top:Ie/d*100,width:($e-Ne)/h*100,height:(Ae-Ie)/d*100})},Le=f=>{var L,F;H||!$||(f.stopPropagation(),(F=(L=f.target).setPointerCapture)==null||F.call(L,f.pointerId),m.current.set(f.pointerId,{x:f.clientX,y:f.clientY}),ke.current={type:"move",startX:f.clientX,startY:f.clientY,startCrop:{...ye}})},Pe=f=>L=>{var F,Z;H||!$||(L.stopPropagation(),(Z=(F=L.target).setPointerCapture)==null||Z.call(F,L.pointerId),m.current.set(L.pointerId,{x:L.clientX,y:L.clientY}),ke.current={type:"resize",corner:f,startX:L.clientX,startY:L.clientY,startCrop:{...ye}})},He=r.useCallback(f=>{const L=be();if(!L||!Q.current)return null;let F=Math.max(1,Math.round(L.width)),Z=Math.max(1,Math.round(L.height));const{maxWidth:h,maxHeight:d}=f??{};if(h&&F>h){const ne=h/F;F=h,Z=Math.round(Z*ne)}if(d&&Z>d){const ne=d/Z;Z=d,F=Math.round(F*ne)}const g=document.createElement("canvas");g.width=F,g.height=Z;const k=g.getContext("2d");if(!k)return null;k.imageSmoothingQuality="high";const z=Q.current;if(k.save(),L.rotation===0)k.drawImage(z,L.x,L.y,L.width,L.height,0,0,F,Z);else{k.translate(F/2,Z/2),k.rotate(L.rotation*Math.PI/180);const ne=L.rotation===90||L.rotation===270,_e=ne?Z:F,Re=ne?F:Z,Ne=ne?L.height:L.width,Ie=ne?L.width:L.height;k.drawImage(z,L.x,L.y,Ne,Ie,-_e/2,-Re/2,_e,Re)}return k.restore(),o&&(k.globalCompositeOperation="destination-in",k.beginPath(),k.arc(F/2,Z/2,Math.min(F,Z)/2,0,Math.PI*2),k.closePath(),k.fill()),g},[be,o]);r.useImperativeHandle(B,()=>({getCrop:()=>be(),getCroppedCanvas:f=>He(f),getCroppedBlob:f=>new Promise((L,F)=>{const Z=He(f);if(!Z)return F(new Error("Cropper not ready"));Z.toBlob(h=>h?L(h):F(new Error("Canvas export failed")),(f==null?void 0:f.type)??"image/png",(f==null?void 0:f.quality)??.92)}),getCroppedDataURL:async f=>{const L=He(f);if(!L)throw new Error("Cropper not ready");return L.toDataURL((f==null?void 0:f.type)??"image/png",(f==null?void 0:f.quality)??.92)},reset:()=>{ae(v),J(_t(b)),me({x:0,y:0}),we({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80})},rotate:f=>{J(f===void 0?L=>_t(L+90):_t(f))},setZoom:f=>ae(qe(f,c,p))}),[be,He,v,b,_,c,p]);const Me={height:typeof x=="number"?`${x}px`:x},Ye=R?{width:ge.w,height:ge.h,transform:`translate(${Y.x}px, ${Y.y}px) rotate(${ee}deg)`}:{display:"none"},et={left:de.left,top:de.top,width:de.width,height:de.height},nt=o?{"--mask-cx":`${de.left+de.width/2}px`,"--mask-cy":`${de.top+de.height/2}px`,"--mask-r":`${Math.min(de.width,de.height)/2}px`}:{},Qe=[q.stage,N==="checker"?q.bgChecker:"",H?q.disabled:""].filter(Boolean).join(" "),lt=[q.root,ue?q.fullWidth:"",j??""].filter(Boolean).join(" "),dt=l??rf,kt=i&&!o&&dt.length>0;return e.jsxs("div",{className:lt,children:[w&&e.jsx("div",{className:q.label,children:w}),kt&&e.jsx("div",{className:q.ratioRow,role:"radiogroup","aria-label":"Aspect ratio",children:dt.map(f=>e.jsx("button",{type:"button",role:"radio","aria-checked":le===f.value,className:`${q.ratioChip} ${le===f.value?q.active:""}`,disabled:H,onClick:()=>Be(f.value),children:f.label},f.label))}),e.jsxs("div",{ref:se,className:Qe,style:Me,role:"application","aria-label":M??"Image cropper","aria-disabled":H,onPointerDown:u,onPointerMove:T,onPointerUp:I,onPointerCancel:I,onWheel:K,children:[!$&&!A&&e.jsxs("div",{className:q.placeholder,children:[e.jsx("div",{className:q.spinner,"aria-hidden":!0}),e.jsx("div",{children:"Loading image…"})]}),A&&e.jsx("div",{className:q.placeholder,children:e.jsx("div",{children:"Couldn't load image."})}),e.jsx("div",{className:q.imageWrap,children:e.jsx("img",{ref:Q,src:t,alt:"",draggable:!1,className:q.image,style:Ye})}),$&&e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:q.circleMask,style:nt}),e.jsxs("div",{className:`${q.overlay} ${o?q.overlayCircle:""}`,style:et,onPointerDown:Le,onPointerMove:T,onPointerUp:I,onPointerCancel:I,children:[a&&!o&&e.jsxs("div",{className:q.grid,"aria-hidden":!0,children:[e.jsx("div",{className:`${q.gridLine} ${q.h}`,style:{top:"33.33%"}}),e.jsx("div",{className:`${q.gridLine} ${q.h}`,style:{top:"66.66%"}}),e.jsx("div",{className:`${q.gridLine} ${q.v}`,style:{left:"33.33%"}}),e.jsx("div",{className:`${q.gridLine} ${q.v}`,style:{left:"66.66%"}})]}),e.jsx("div",{className:`${q.handle} ${q.handleTL}`,onPointerDown:Pe("tl")}),e.jsx("div",{className:`${q.handle} ${q.handleTR}`,onPointerDown:Pe("tr")}),e.jsx("div",{className:`${q.handle} ${q.handleBL}`,onPointerDown:Pe("bl")}),e.jsx("div",{className:`${q.handle} ${q.handleBR}`,onPointerDown:Pe("br")}),e.jsx("div",{className:`${q.handle} ${q.handleT}`,onPointerDown:Pe("t")}),e.jsx("div",{className:`${q.handle} ${q.handleB}`,onPointerDown:Pe("b")}),e.jsx("div",{className:`${q.handle} ${q.handleL}`,onPointerDown:Pe("l")}),e.jsx("div",{className:`${q.handle} ${q.handleR}`,onPointerDown:Pe("r")})]})]})]}),i&&e.jsxs("div",{className:q.controls,"aria-label":"Cropper controls",children:[e.jsxs("div",{className:q.controlGroup,children:[e.jsx("span",{className:q.controlLabel,children:"Zoom"}),e.jsx("button",{type:"button",className:q.iconBtn,"aria-label":"Zoom out",disabled:H||G<=c,onClick:()=>ae(f=>qe(f-.1,c,p)),children:e.jsx(lf,{})}),e.jsx("input",{type:"range",className:q.zoomSlider,min:c,max:p,step:.01,value:G,disabled:H,onChange:f=>ae(parseFloat(f.target.value)),"aria-label":"Zoom level"}),e.jsx("button",{type:"button",className:q.iconBtn,"aria-label":"Zoom in",disabled:H||G>=p,onClick:()=>ae(f=>qe(f+.1,c,p)),children:e.jsx(cf,{})})]}),e.jsx("div",{className:q.divider,"aria-hidden":!0}),e.jsxs("div",{className:q.controlGroup,children:[e.jsx("span",{className:q.controlLabel,children:"Rotate"}),e.jsx("button",{type:"button",className:q.iconBtn,"aria-label":"Rotate left",disabled:H,onClick:()=>J(f=>_t(f-90)),children:e.jsx(df,{})}),e.jsx("button",{type:"button",className:q.iconBtn,"aria-label":"Rotate right",disabled:H,onClick:()=>J(f=>_t(f+90)),children:e.jsx(uf,{})})]}),e.jsx("div",{className:q.divider,"aria-hidden":!0}),e.jsx("div",{className:q.controlGroup,children:e.jsx("button",{type:"button",className:q.iconBtn,"aria-label":"Reset",disabled:H,onClick:()=>{ae(v),J(_t(b)),me({x:0,y:0}),we({left:(_==null?void 0:_.x)??10,top:(_==null?void 0:_.y)??10,width:(_==null?void 0:_.width)??80,height:(_==null?void 0:_.height)??80})},children:e.jsx(hf,{})})})]}),C&&e.jsx("div",{className:q.helper,children:C})]})}),It={width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cf=()=>e.jsxs("svg",{...It,children:[e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),lf=()=>e.jsx("svg",{...It,children:e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})}),df=()=>e.jsxs("svg",{...It,children:[e.jsx("polyline",{points:"1 4 1 10 7 10"}),e.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),uf=()=>e.jsxs("svg",{...It,children:[e.jsx("polyline",{points:"23 4 23 10 17 10"}),e.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.13-9.36L23 10"})]}),hf=()=>e.jsxs("svg",{...It,children:[e.jsx("path",{d:"M3 12a9 9 0 1 0 3-6.7L3 8"}),e.jsx("polyline",{points:"3 3 3 8 8 8"})]});exports.EvoAlert=Tp;exports.EvoAutoComplete=Yn;exports.EvoBadge=os;exports.EvoBreadcrumb=Ln;exports.EvoButton=As;exports.EvoCard=ct;exports.EvoCardBody=Kt;exports.EvoCardDescription=Qt;exports.EvoCardFooter=Ut;exports.EvoCardHeader=Vt;exports.EvoCardMedia=Xt;exports.EvoCardRoot=Dt;exports.EvoCardTitle=Yt;exports.EvoCheckbox=Qn;exports.EvoCommandPalette=Na;exports.EvoContainer=mo;exports.EvoDivider=io;exports.EvoForm=jt;exports.EvoGrid=$n;exports.EvoImageCropper=af;exports.EvoInput=Pa;exports.EvoModal=Rt;exports.EvoNav=_r;exports.EvoNavGroup=nn;exports.EvoNavItem=en;exports.EvoNavQuickAction=sn;exports.EvoNavSkeleton=Bn;exports.EvoNavSubItem=tn;exports.EvoNotification=ap;exports.EvoNotificationBell=ln;exports.EvoNotificationItem=zt;exports.EvoNotificationPanel=At;exports.EvoNotificationProvider=an;exports.EvoNotificationToaster=cn;exports.EvoPagination=oa;exports.EvoRadio=Jn;exports.EvoRichTextArea=pi;exports.EvoSelect=uc;exports.EvoSkeleton=dn;exports.EvoStack=Zs;exports.EvoTable=w_;exports.EvoTabs=Bt;exports.EvoThemeProvider=rs;exports.EvoThemeToggle=fs;exports.EvoToggle=Hd;exports.EvoTooltip=fp;exports.EvoTopNav=Je;exports.EvoTreeSelect=gl;exports.evoLocalRecents=ld;exports.evoNotify=Jh;exports.getEvoThemeScript=as;exports.useEvoInbox=rp;exports.useEvoTheme=In;exports.useFormContext=ju;