@wraps.dev/cli 2.17.15 → 2.17.17
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/cli.js +39 -12
- package/dist/cli.js.map +1 -1
- package/dist/console/assets/{index-CNn3fWLq.js → index-41T2hONy.js} +45 -45
- package/dist/console/index.html +1 -1
- package/dist/lambda/event-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/.bundled +1 -1
- package/dist/lambda/inbound-processor/index.js +37 -37
- package/dist/lambda/sms-event-processor/.bundled +1 -1
- package/package.json +18 -6
|
@@ -57,27 +57,27 @@ Error generating stack: `+p.message+`
|
|
|
57
57
|
* @license MIT
|
|
58
58
|
*/var Z2="popstate";function $U(e={}){function t(r,i){let{pathname:o,search:l,hash:u}=r.location;return V1("",{pathname:o,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Fu(i)}return LU(t,n,null,e)}function Mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function IU(){return Math.random().toString(36).substring(2,10)}function J2(e,t){return{usr:e.state,key:e.key,idx:t}}function V1(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?nc(t):t,state:n,key:t&&t.key||r||IU()}}function Fu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function nc(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function LU(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:o=!1}=r,l=i.history,u="POP",d=null,h=v();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function v(){return(l.state||{idx:null}).idx}function m(){u="POP";let x=v(),E=x==null?null:x-h;h=x,d&&d({action:u,location:S.location,delta:E})}function g(x,E){u="PUSH";let N=V1(S.location,x,E);h=v()+1;let _=J2(N,h),C=S.createHref(N);try{l.pushState(_,"",C)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;i.location.assign(C)}o&&d&&d({action:u,location:S.location,delta:1})}function b(x,E){u="REPLACE";let N=V1(S.location,x,E);h=v();let _=J2(N,h),C=S.createHref(N);l.replaceState(_,"",C),o&&d&&d({action:u,location:S.location,delta:0})}function O(x){return zU(x)}let S={get action(){return u},get location(){return e(i,l)},listen(x){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(Z2,m),d=x,()=>{i.removeEventListener(Z2,m),d=null}},createHref(x){return t(i,x)},createURL:O,encodeLocation(x){let E=O(x);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:g,replace:b,go(x){return l.go(x)}};return S}function zU(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Mt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Fu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function V4(e,t,n="/"){return BU(e,t,n,!1)}function BU(e,t,n,r){let i=typeof t=="string"?nc(t):t,o=ni(i.pathname||"/",n);if(o==null)return null;let l=Y4(e);qU(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let h=ZU(o);u=XU(l[d],h,r)}return u}function Y4(e,t=[],n=[],r="",i=!1){let o=(l,u,d=i,h)=>{let v={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(r)&&d)return;Mt(v.relativePath.startsWith(r),`Absolute route path "${v.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(r.length)}let m=Xa([r,v.relativePath]),g=n.concat(v);l.children&&l.children.length>0&&(Mt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),Y4(l.children,t,g,m,d)),!(l.path==null&&!l.index)&&t.push({path:m,score:WU(m,l.index),routesMeta:g})};return e.forEach((l,u)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))o(l,u);else for(let h of W4(l.path))o(l,u,!0,h)}),t}function W4(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let l=W4(r.join("/")),u=[];return u.push(...l.map(d=>d===""?o:[o,d].join("/"))),i&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function qU(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KU(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var UU=/^:[\w-]+$/,HU=3,FU=2,GU=1,VU=10,YU=-2,eC=e=>e==="*";function WU(e,t){let n=e.split("/"),r=n.length;return n.some(eC)&&(r+=YU),t&&(r+=FU),n.filter(i=>!eC(i)).reduce((i,o)=>i+(UU.test(o)?HU:o===""?GU:VU),r)}function KU(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function XU(e,t,n=!1){let{routesMeta:r}=e,i={},o="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],h=u===r.length-1,v=o==="/"?t:t.slice(o.length)||"/",m=Jh({path:d.relativePath,caseSensitive:d.caseSensitive,end:h},v),g=d.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=Jh({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},v)),!m)return null;Object.assign(i,m.params),l.push({params:i,pathname:Xa([o,m.pathname]),pathnameBase:nH(Xa([o,m.pathnameBase])),route:g}),m.pathnameBase!=="/"&&(o=Xa([o,m.pathnameBase]))}return l}function Jh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=QU(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let o=i[0],l=o.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((h,{paramName:v,isOptional:m},g)=>{if(v==="*"){let O=u[g]||"";l=o.slice(0,o.length-O.length).replace(/(.)\/+$/,"$1")}const b=u[g];return m&&!b?h[v]=void 0:h[v]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function QU(e,t=!1,n=!0){Dr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ZU(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ni(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var JU=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function eH(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?nc(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=tC(n.substring(1),"/"):o=tC(n,t)):o=t,{pathname:o,search:rH(r),hash:aH(i)}}function tC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function yb(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function tH(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qj(e){let t=tH(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Uj(e,t,n,r=!1){let i;typeof e=="string"?i=nc(e):(i={...e},Mt(!i.pathname||!i.pathname.includes("?"),yb("?","pathname","search",i)),Mt(!i.pathname||!i.pathname.includes("#"),yb("#","pathname","hash",i)),Mt(!i.search||!i.search.includes("#"),yb("#","search","hash",i)));let o=e===""||i.pathname==="",l=o?"/":i.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let g=l.split("/");for(;g[0]==="..";)g.shift(),m-=1;i.pathname=g.join("/")}u=m>=0?t[m]:"/"}let d=eH(i,u),h=l&&l!=="/"&&l.endsWith("/"),v=(o||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(h||v)&&(d.pathname+="/"),d}var Xa=e=>e.join("/").replace(/\/\/+/g,"/"),nH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,iH=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function oH(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function sH(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var K4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function X4(e,t){let n=e;if(typeof n!="string"||!JU.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(K4)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),u=ni(l.pathname,t);l.origin===o.origin&&u!=null?n=u+l.search+l.hash:i=!0}catch{Dr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Q4=["POST","PUT","PATCH","DELETE"];new Set(Q4);var lH=["GET",...Q4];new Set(lH);var rc=w.createContext(null);rc.displayName="DataRouter";var Mp=w.createContext(null);Mp.displayName="DataRouterState";var cH=w.createContext(!1),Z4=w.createContext({isTransitioning:!1});Z4.displayName="ViewTransition";var uH=w.createContext(new Map);uH.displayName="Fetchers";var fH=w.createContext(null);fH.displayName="Await";var ur=w.createContext(null);ur.displayName="Navigation";var $f=w.createContext(null);$f.displayName="Location";var Qr=w.createContext({outlet:null,matches:[],isDataRoute:!1});Qr.displayName="Route";var Hj=w.createContext(null);Hj.displayName="RouteError";var J4="REACT_ROUTER_ERROR",dH="REDIRECT",hH="ROUTE_ERROR_RESPONSE";function mH(e){if(e.startsWith(`${J4}:${dH}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function pH(e){if(e.startsWith(`${J4}:${hH}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new iH(t.status,t.statusText,t.data)}catch{}}function vH(e,{relative:t}={}){Mt(ac(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=w.useContext(ur),{hash:i,pathname:o,search:l}=If(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:Xa([n,o])),r.createHref({pathname:u,search:l,hash:i})}function ac(){return w.useContext($f)!=null}function Zr(){return Mt(ac(),"useLocation() may be used only in the context of a <Router> component."),w.useContext($f).location}var e$="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function t$(e){w.useContext(ur).static||w.useLayoutEffect(e)}function Sa(){let{isDataRoute:e}=w.useContext(Qr);return e?CH():gH()}function gH(){Mt(ac(),"useNavigate() may be used only in the context of a <Router> component.");let e=w.useContext(rc),{basename:t,navigator:n}=w.useContext(ur),{matches:r}=w.useContext(Qr),{pathname:i}=Zr(),o=JSON.stringify(qj(r)),l=w.useRef(!1);return t$(()=>{l.current=!0}),w.useCallback((d,h={})=>{if(Dr(l.current,e$),!l.current)return;if(typeof d=="number"){n.go(d);return}let v=Uj(d,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Xa([t,v.pathname])),(h.replace?n.replace:n.push)(v,h.state,h)},[t,n,o,i,e])}w.createContext(null);function Fj(){let{matches:e}=w.useContext(Qr),t=e[e.length-1];return t?t.params:{}}function If(e,{relative:t}={}){let{matches:n}=w.useContext(Qr),{pathname:r}=Zr(),i=JSON.stringify(qj(n));return w.useMemo(()=>Uj(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function yH(e,t){return n$(e,t)}function n$(e,t,n,r,i){var N;Mt(ac(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=w.useContext(ur),{matches:l}=w.useContext(Qr),u=l[l.length-1],d=u?u.params:{},h=u?u.pathname:"/",v=u?u.pathnameBase:"/",m=u&&u.route;{let _=m&&m.path||"";a$(h,!m||_.endsWith("*")||_.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${_}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
59
|
|
|
60
|
-
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Zr(),b;if(t){let _=typeof t=="string"?nc(t):t;Mt(v==="/"||((N=_.pathname)==null?void 0:N.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${_.pathname}" was given in the \`location\` prop.`),b=_}else b=g;let O=b.pathname||"/",S=O;if(v!=="/"){let _=v.replace(/^\//,"").split("/");S="/"+O.replace(/^\//,"").split("/").slice(_.length).join("/")}let x=V4(e,{pathname:S});Dr(m||x!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Dr(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=jH(x&&x.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Xa([v,o.encodeLocation?o.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?v:Xa([v,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,i);return t&&E?w.createElement($f.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function bH(){let e=AH(),t=oH(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,l)}var xH=w.createElement(bH,null),r$=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=pH(e.digest);n&&(e=n)}let t=e!==void 0?w.createElement(Qr.Provider,{value:this.props.routeContext},w.createElement(Hj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(wH,{error:e},t):t}};r$.contextType=cH;var bb=new WeakMap;function wH({children:e,error:t}){let{basename:n}=w.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=mH(t.digest);if(r){let i=bb.get(t);if(i)throw i;let o=X4(r.location,n);if(K4&&!bb.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw bb.set(t,l),l}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function SH({routeContext:e,match:t,children:n}){let r=w.useContext(rc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Qr.Provider,{value:e},n)}function jH(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let v=o.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Mt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let u=!1,d=-1;if(n)for(let v=0;v<o.length;v++){let m=o[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=v),m.route.id){let{loaderData:g,errors:b}=n,O=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||O){u=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}let h=n&&r?(v,m)=>{var g,b;r(v,{location:n.location,params:((b=(g=n.matches)==null?void 0:g[0])==null?void 0:b.params)??{},unstable_pattern:sH(n.matches),errorInfo:m})}:void 0;return o.reduceRight((v,m,g)=>{let b,O=!1,S=null,x=null;n&&(b=l&&m.route.id?l[m.route.id]:void 0,S=m.route.errorElement||xH,u&&(d<0&&g===0?(a$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,x=null):d===g&&(O=!0,x=m.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,g+1)),N=()=>{let _;return b?_=S:O?_=x:m.route.Component?_=w.createElement(m.route.Component,null):m.route.element?_=m.route.element:_=v,w.createElement(SH,{match:m,routeContext:{outlet:v,matches:E,isDataRoute:n!=null},children:_})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?w.createElement(r$,{location:n.location,revalidation:n.revalidation,component:S,error:b,children:N(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):N()},null)}function Gj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OH(e){let t=w.useContext(rc);return Mt(t,Gj(e)),t}function EH(e){let t=w.useContext(Mp);return Mt(t,Gj(e)),t}function _H(e){let t=w.useContext(Qr);return Mt(t,Gj(e)),t}function Vj(e){let t=_H(e),n=t.matches[t.matches.length-1];return Mt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NH(){return Vj("useRouteId")}function AH(){var r;let e=w.useContext(Hj),t=EH("useRouteError"),n=Vj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function CH(){let{router:e}=OH("useNavigate"),t=Vj("useNavigate"),n=w.useRef(!1);return t$(()=>{n.current=!0}),w.useCallback(async(i,o={})=>{Dr(n.current,e$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var nC={};function a$(e,t,n){!t&&!nC[e]&&(nC[e]=!0,Dr(!1,n))}w.memo(TH);function TH({routes:e,future:t,state:n,onError:r}){return n$(e,void 0,n,r,t)}function MH({to:e,replace:t,state:n,relative:r}){Mt(ac(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=w.useContext(ur);Dr(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=w.useContext(Qr),{pathname:l}=Zr(),u=Sa(),d=Uj(e,qj(o),l,r==="path"),h=JSON.stringify(d);return w.useEffect(()=>{u(JSON.parse(h),{replace:t,state:n,relative:r})},[u,h,r,t,n]),null}function Bn(e){Mt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function RH({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){Mt(!ac(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=w.useMemo(()=>({basename:u,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[u,i,o,l]);typeof n=="string"&&(n=nc(n));let{pathname:h="/",search:v="",hash:m="",state:g=null,key:b="default"}=n,O=w.useMemo(()=>{let S=ni(h,u);return S==null?null:{location:{pathname:S,search:v,hash:m,state:g,key:b},navigationType:r}},[u,h,v,m,g,b,r]);return Dr(O!=null,`<Router basename="${u}"> is not able to match the URL "${h}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:w.createElement(ur.Provider,{value:d},w.createElement($f.Provider,{children:t,value:O}))}function DH({children:e,location:t}){return yH(Y1(e),t)}function Y1(e,t=[]){let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;let o=[...t,i];if(r.type===w.Fragment){n.push.apply(n,Y1(r.props.children,o));return}Mt(r.type===Bn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Mt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Y1(r.props.children,o)),n.push(l)}),n}var Vh="get",Yh="application/x-www-form-urlencoded";function Rp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PH(e){return Rp(e)&&e.tagName.toLowerCase()==="button"}function kH(e){return Rp(e)&&e.tagName.toLowerCase()==="form"}function $H(e){return Rp(e)&&e.tagName.toLowerCase()==="input"}function IH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LH(e,t){return e.button===0&&(!t||t==="_self")&&!IH(e)}function W1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function zH(e,t){let n=W1(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var yh=null;function BH(){if(yh===null)try{new FormData(document.createElement("form"),0),yh=!1}catch{yh=!0}return yh}var qH=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xb(e){return e!=null&&!qH.has(e)?(Dr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yh}"`),null):e}function UH(e,t){let n,r,i,o,l;if(kH(e)){let u=e.getAttribute("action");r=u?ni(u,t):null,n=e.getAttribute("method")||Vh,i=xb(e.getAttribute("enctype"))||Yh,o=new FormData(e)}else if(PH(e)||$H(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(r=d?ni(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Vh,i=xb(e.getAttribute("formenctype"))||xb(u.getAttribute("enctype"))||Yh,o=new FormData(u,e),!BH()){let{name:h,type:v,value:m}=e;if(v==="image"){let g=h?`${h}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else h&&o.append(h,m)}}else{if(Rp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vh,r=null,i=Yh,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yj(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function HH(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ni(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function FH(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GH(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function VH(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await FH(o,n);return l.links?l.links():[]}return[]}));return XH(r.flat(1).filter(GH).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function rC(e,t,n,r,i,o){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,u=(d,h)=>{var v;return n[h].pathname!==d.pathname||((v=n[h].route.path)==null?void 0:v.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return o==="assets"?t.filter((d,h)=>l(d,h)||u(d,h)):o==="data"?t.filter((d,h)=>{var m;let v=r.routes[d.route.id];if(!v||!v.hasLoader)return!1;if(l(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function YH(e,t,{includeHydrateFallback:n}={}){return WH(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function WH(e){return[...new Set(e)]}function KH(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function XH(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(KH(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function i$(){let e=w.useContext(rc);return Yj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function QH(){let e=w.useContext(Mp);return Yj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wj=w.createContext(void 0);Wj.displayName="FrameworkContext";function o$(){let e=w.useContext(Wj);return Yj(e,"You must render this element inside a <HydratedRouter> element"),e}function ZH(e,t){let n=w.useContext(Wj),[r,i]=w.useState(!1),[o,l]=w.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:v,onTouchStart:m}=t,g=w.useRef(null);w.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=E=>{E.forEach(N=>{l(N.isIntersecting)})},x=new IntersectionObserver(S,{threshold:.5});return g.current&&x.observe(g.current),()=>{x.disconnect()}}},[e]),w.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let b=()=>{i(!0)},O=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:bu(u,b),onBlur:bu(d,O),onMouseEnter:bu(h,b),onMouseLeave:bu(v,O),onTouchStart:bu(m,b)}]:[!1,g,{}]}function bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JH({page:e,...t}){let{router:n}=i$(),r=w.useMemo(()=>V4(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(tF,{page:e,matches:r,...t}):null}function eF(e){let{manifest:t,routeModules:n}=o$(),[r,i]=w.useState([]);return w.useEffect(()=>{let o=!1;return VH(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function tF({page:e,matches:t,...n}){let r=Zr(),{future:i,manifest:o,routeModules:l}=o$(),{basename:u}=i$(),{loaderData:d,matches:h}=QH(),v=w.useMemo(()=>rC(e,t,h,o,r,"data"),[e,t,h,o,r]),m=w.useMemo(()=>rC(e,t,h,o,r,"assets"),[e,t,h,o,r]),g=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,x=!1;if(t.forEach(N=>{var C;let _=o.routes[N.route.id];!_||!_.hasLoader||(!v.some(A=>A.route.id===N.route.id)&&N.route.id in d&&((C=l[N.route.id])!=null&&C.shouldRevalidate)||_.hasClientLoader?x=!0:S.add(N.route.id))}),S.size===0)return[];let E=HH(e,u,i.unstable_trailingSlashAwareDataRequests,"data");return x&&S.size>0&&E.searchParams.set("_routes",t.filter(N=>S.has(N.route.id)).map(N=>N.route.id).join(",")),[E.pathname+E.search]},[u,i.unstable_trailingSlashAwareDataRequests,d,r,o,v,t,e,l]),b=w.useMemo(()=>YH(m,o),[m,o]),O=eF(m);return w.createElement(w.Fragment,null,g.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),b.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),O.map(({key:S,link:x})=>w.createElement("link",{key:S,nonce:n.nonce,...x,crossOrigin:x.crossOrigin??n.crossOrigin})))}function nF(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var rF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rF&&(window.__reactRouterVersion="7.13.0")}catch{}function aF({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=w.useRef();i.current==null&&(i.current=$U({window:r,v5Compat:!0}));let o=i.current,[l,u]=w.useState({action:o.action,location:o.location}),d=w.useCallback(h=>{n===!1?u(h):w.startTransition(()=>u(h))},[n]);return w.useLayoutEffect(()=>o.listen(d),[o,d]),w.createElement(RH,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var s$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,em=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,state:u,target:d,to:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...b},O){let{basename:S,unstable_useTransitions:x}=w.useContext(ur),E=typeof h=="string"&&s$.test(h),N=X4(h,S);h=N.to;let _=vH(h,{relative:i}),[C,A,M]=ZH(r,b),R=lF(h,{replace:l,state:u,target:d,preventScrollReset:v,relative:i,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:x});function D(G){t&&t(G),G.defaultPrevented||R(G)}let z=w.createElement("a",{...b,...M,href:N.absoluteURL||_,onClick:N.isExternal||o?t:D,ref:nF(O,A),target:d,"data-discover":!E&&n==="render"?"true":void 0});return C&&!E?w.createElement(w.Fragment,null,z,w.createElement(JH,{page:_})):z});em.displayName="Link";var iF=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:u,children:d,...h},v){let m=If(l,{relative:h.relative}),g=Zr(),b=w.useContext(Mp),{navigator:O,basename:S}=w.useContext(ur),x=b!=null&&mF(m)&&u===!0,E=O.encodeLocation?O.encodeLocation(m).pathname:m.pathname,N=g.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(N=N.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase()),_&&S&&(_=ni(_,S)||_);const C=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let A=N===E||!i&&N.startsWith(E)&&N.charAt(C)==="/",M=_!=null&&(_===E||!i&&_.startsWith(E)&&_.charAt(E.length)==="/"),R={isActive:A,isPending:M,isTransitioning:x},D=A?t:void 0,z;typeof r=="function"?z=r(R):z=[r,A?"active":null,M?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let G=typeof o=="function"?o(R):o;return w.createElement(em,{...h,"aria-current":D,className:z,ref:v,style:G,to:l,viewTransition:u},typeof d=="function"?d(R):d)});iF.displayName="NavLink";var oF=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=Vh,action:u,onSubmit:d,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...b},O)=>{let{unstable_useTransitions:S}=w.useContext(ur),x=dF(),E=hF(u,{relative:h}),N=l.toLowerCase()==="get"?"get":"post",_=typeof u=="string"&&s$.test(u),C=A=>{if(d&&d(A),A.defaultPrevented)return;A.preventDefault();let M=A.nativeEvent.submitter,R=(M==null?void 0:M.getAttribute("formmethod"))||l,D=()=>x(M||A.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:o,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g});S&&n!==!1?w.startTransition(()=>D()):D()};return w.createElement("form",{ref:O,method:N,action:E,onSubmit:r?d:C,...b,"data-discover":!_&&e==="render"?"true":void 0})});oF.displayName="Form";function sF(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l$(e){let t=w.useContext(rc);return Mt(t,sF(e)),t}function lF(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let h=Sa(),v=Zr(),m=If(e,{relative:o});return w.useCallback(g=>{if(LH(g,t)){g.preventDefault();let b=n!==void 0?n:Fu(v)===Fu(m),O=()=>h(e,{replace:b,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u});d?w.startTransition(()=>O()):O()}},[v,h,m,n,r,t,e,i,o,l,u,d])}function cF(e){Dr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(W1(e)),n=w.useRef(!1),r=Zr(),i=w.useMemo(()=>zH(r.search,n.current?null:t.current),[r.search]),o=Sa(),l=w.useCallback((u,d)=>{const h=W1(typeof u=="function"?u(new URLSearchParams(i)):u);n.current=!0,o("?"+h,d)},[o,i]);return[i,l]}var uF=0,fF=()=>`__${String(++uF)}__`;function dF(){let{router:e}=l$("useSubmit"),{basename:t}=w.useContext(ur),n=NH(),r=e.fetch,i=e.navigate;return w.useCallback(async(o,l={})=>{let{action:u,method:d,encType:h,formData:v,body:m}=UH(o,t);if(l.navigate===!1){let g=l.fetcherKey||fF();await r(g,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await i(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function hF(e,{relative:t}={}){let{basename:n}=w.useContext(ur),r=w.useContext(Qr);Mt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...If(e||".",{relative:t})},l=Zr();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),d=u.getAll("index");if(d.some(v=>v==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let v=u.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Xa([n,o.pathname])),Fu(o)}function mF(e,{relative:t}={}){let n=w.useContext(Z4);Mt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=l$("useViewTransitionState"),i=If(e,{relative:t});if(!n.isTransitioning)return!1;let o=ni(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ni(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jh(i.pathname,l)!=null||Jh(i.pathname,o)!=null}var Lf=G4();const c$=xt(Lf);/**
|
|
60
|
+
Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}/*`}">.`)}let g=Zr(),b;if(t){let _=typeof t=="string"?nc(t):t;Mt(v==="/"||((N=_.pathname)==null?void 0:N.startsWith(v)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${v}" but pathname "${_.pathname}" was given in the \`location\` prop.`),b=_}else b=g;let O=b.pathname||"/",S=O;if(v!=="/"){let _=v.replace(/^\//,"").split("/");S="/"+O.replace(/^\//,"").split("/").slice(_.length).join("/")}let x=V4(e,{pathname:S});Dr(m||x!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Dr(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=jH(x&&x.map(_=>Object.assign({},_,{params:Object.assign({},d,_.params),pathname:Xa([v,o.encodeLocation?o.encodeLocation(_.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?v:Xa([v,o.encodeLocation?o.encodeLocation(_.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:_.pathnameBase])})),l,n,r,i);return t&&E?w.createElement($f.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},E):E}function bH(){let e=AH(),t=oH(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=w.createElement(w.Fragment,null,w.createElement("p",null,"💿 Hey developer 👋"),w.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",w.createElement("code",{style:o},"ErrorBoundary")," or"," ",w.createElement("code",{style:o},"errorElement")," prop on your route.")),w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:i},n):null,l)}var xH=w.createElement(bH,null),r$=class extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=pH(e.digest);n&&(e=n)}let t=e!==void 0?w.createElement(Qr.Provider,{value:this.props.routeContext},w.createElement(Hj.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?w.createElement(wH,{error:e},t):t}};r$.contextType=cH;var bb=new WeakMap;function wH({children:e,error:t}){let{basename:n}=w.useContext(ur);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=mH(t.digest);if(r){let i=bb.get(t);if(i)throw i;let o=X4(r.location,n);if(K4&&!bb.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw bb.set(t,l),l}return w.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function SH({routeContext:e,match:t,children:n}){let r=w.useContext(rc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),w.createElement(Qr.Provider,{value:e},n)}function jH(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let v=o.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);Mt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let u=!1,d=-1;if(n)for(let v=0;v<o.length;v++){let m=o[v];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=v),m.route.id){let{loaderData:g,errors:b}=n,O=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||O){u=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}let h=n&&r?(v,m)=>{var g,b;r(v,{location:n.location,params:((b=(g=n.matches)==null?void 0:g[0])==null?void 0:b.params)??{},unstable_pattern:sH(n.matches),errorInfo:m})}:void 0;return o.reduceRight((v,m,g)=>{let b,O=!1,S=null,x=null;n&&(b=l&&m.route.id?l[m.route.id]:void 0,S=m.route.errorElement||xH,u&&(d<0&&g===0?(a$("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),O=!0,x=null):d===g&&(O=!0,x=m.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,g+1)),N=()=>{let _;return b?_=S:O?_=x:m.route.Component?_=w.createElement(m.route.Component,null):m.route.element?_=m.route.element:_=v,w.createElement(SH,{match:m,routeContext:{outlet:v,matches:E,isDataRoute:n!=null},children:_})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?w.createElement(r$,{location:n.location,revalidation:n.revalidation,component:S,error:b,children:N(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):N()},null)}function Gj(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OH(e){let t=w.useContext(rc);return Mt(t,Gj(e)),t}function EH(e){let t=w.useContext(Mp);return Mt(t,Gj(e)),t}function _H(e){let t=w.useContext(Qr);return Mt(t,Gj(e)),t}function Vj(e){let t=_H(e),n=t.matches[t.matches.length-1];return Mt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function NH(){return Vj("useRouteId")}function AH(){var r;let e=w.useContext(Hj),t=EH("useRouteError"),n=Vj("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function CH(){let{router:e}=OH("useNavigate"),t=Vj("useNavigate"),n=w.useRef(!1);return t$(()=>{n.current=!0}),w.useCallback(async(i,o={})=>{Dr(n.current,e$),n.current&&(typeof i=="number"?await e.navigate(i):await e.navigate(i,{fromRouteId:t,...o}))},[e,t])}var nC={};function a$(e,t,n){!t&&!nC[e]&&(nC[e]=!0,Dr(!1,n))}w.memo(TH);function TH({routes:e,future:t,state:n,onError:r}){return n$(e,void 0,n,r,t)}function MH({to:e,replace:t,state:n,relative:r}){Mt(ac(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=w.useContext(ur);Dr(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=w.useContext(Qr),{pathname:l}=Zr(),u=Sa(),d=Uj(e,qj(o),l,r==="path"),h=JSON.stringify(d);return w.useEffect(()=>{u(JSON.parse(h),{replace:t,state:n,relative:r})},[u,h,r,t,n]),null}function Bn(e){Mt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function RH({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:o=!1,unstable_useTransitions:l}){Mt(!ac(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),d=w.useMemo(()=>({basename:u,navigator:i,static:o,unstable_useTransitions:l,future:{}}),[u,i,o,l]);typeof n=="string"&&(n=nc(n));let{pathname:h="/",search:v="",hash:m="",state:g=null,key:b="default"}=n,O=w.useMemo(()=>{let S=ni(h,u);return S==null?null:{location:{pathname:S,search:v,hash:m,state:g,key:b},navigationType:r}},[u,h,v,m,g,b,r]);return Dr(O!=null,`<Router basename="${u}"> is not able to match the URL "${h}${v}${m}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:w.createElement(ur.Provider,{value:d},w.createElement($f.Provider,{children:t,value:O}))}function DH({children:e,location:t}){return yH(Y1(e),t)}function Y1(e,t=[]){let n=[];return w.Children.forEach(e,(r,i)=>{if(!w.isValidElement(r))return;let o=[...t,i];if(r.type===w.Fragment){n.push.apply(n,Y1(r.props.children,o));return}Mt(r.type===Bn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Mt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Y1(r.props.children,o)),n.push(l)}),n}var Vh="get",Yh="application/x-www-form-urlencoded";function Rp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function PH(e){return Rp(e)&&e.tagName.toLowerCase()==="button"}function kH(e){return Rp(e)&&e.tagName.toLowerCase()==="form"}function $H(e){return Rp(e)&&e.tagName.toLowerCase()==="input"}function IH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LH(e,t){return e.button===0&&(!t||t==="_self")&&!IH(e)}function W1(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function zH(e,t){let n=W1(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(o=>{n.append(i,o)})}),n}var yh=null;function BH(){if(yh===null)try{new FormData(document.createElement("form"),0),yh=!1}catch{yh=!0}return yh}var qH=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function xb(e){return e!=null&&!qH.has(e)?(Dr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Yh}"`),null):e}function UH(e,t){let n,r,i,o,l;if(kH(e)){let u=e.getAttribute("action");r=u?ni(u,t):null,n=e.getAttribute("method")||Vh,i=xb(e.getAttribute("enctype"))||Yh,o=new FormData(e)}else if(PH(e)||$H(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=e.getAttribute("formaction")||u.getAttribute("action");if(r=d?ni(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Vh,i=xb(e.getAttribute("formenctype"))||xb(u.getAttribute("enctype"))||Yh,o=new FormData(u,e),!BH()){let{name:h,type:v,value:m}=e;if(v==="image"){let g=h?`${h}.`:"";o.append(`${g}x`,"0"),o.append(`${g}y`,"0")}else h&&o.append(h,m)}}else{if(Rp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vh,r=null,i=Yh,l=e}return o&&i==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yj(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function HH(e,t,n,r){let i=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname==="/"?i.pathname=`_root.${r}`:t&&ni(i.pathname,t)==="/"?i.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${r}`,i}async function FH(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GH(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function VH(e,t,n){let r=await Promise.all(e.map(async i=>{let o=t.routes[i.route.id];if(o){let l=await FH(o,n);return l.links?l.links():[]}return[]}));return XH(r.flat(1).filter(GH).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function rC(e,t,n,r,i,o){let l=(d,h)=>n[h]?d.route.id!==n[h].route.id:!0,u=(d,h)=>{var v;return n[h].pathname!==d.pathname||((v=n[h].route.path)==null?void 0:v.endsWith("*"))&&n[h].params["*"]!==d.params["*"]};return o==="assets"?t.filter((d,h)=>l(d,h)||u(d,h)):o==="data"?t.filter((d,h)=>{var m;let v=r.routes[d.route.id];if(!v||!v.hasLoader)return!1;if(l(d,h)||u(d,h))return!0;if(d.route.shouldRevalidate){let g=d.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function YH(e,t,{includeHydrateFallback:n}={}){return WH(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function WH(e){return[...new Set(e)]}function KH(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function XH(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let o=JSON.stringify(KH(i));return n.has(o)||(n.add(o),r.push({key:o,link:i})),r},[])}function i$(){let e=w.useContext(rc);return Yj(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function QH(){let e=w.useContext(Mp);return Yj(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Wj=w.createContext(void 0);Wj.displayName="FrameworkContext";function o$(){let e=w.useContext(Wj);return Yj(e,"You must render this element inside a <HydratedRouter> element"),e}function ZH(e,t){let n=w.useContext(Wj),[r,i]=w.useState(!1),[o,l]=w.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:h,onMouseLeave:v,onTouchStart:m}=t,g=w.useRef(null);w.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let S=E=>{E.forEach(N=>{l(N.isIntersecting)})},x=new IntersectionObserver(S,{threshold:.5});return g.current&&x.observe(g.current),()=>{x.disconnect()}}},[e]),w.useEffect(()=>{if(r){let S=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(S)}}},[r]);let b=()=>{i(!0)},O=()=>{i(!1),l(!1)};return n?e!=="intent"?[o,g,{}]:[o,g,{onFocus:bu(u,b),onBlur:bu(d,O),onMouseEnter:bu(h,b),onMouseLeave:bu(v,O),onTouchStart:bu(m,b)}]:[!1,g,{}]}function bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JH({page:e,...t}){let{router:n}=i$(),r=w.useMemo(()=>V4(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?w.createElement(tF,{page:e,matches:r,...t}):null}function eF(e){let{manifest:t,routeModules:n}=o$(),[r,i]=w.useState([]);return w.useEffect(()=>{let o=!1;return VH(e,t,n).then(l=>{o||i(l)}),()=>{o=!0}},[e,t,n]),r}function tF({page:e,matches:t,...n}){let r=Zr(),{future:i,manifest:o,routeModules:l}=o$(),{basename:u}=i$(),{loaderData:d,matches:h}=QH(),v=w.useMemo(()=>rC(e,t,h,o,r,"data"),[e,t,h,o,r]),m=w.useMemo(()=>rC(e,t,h,o,r,"assets"),[e,t,h,o,r]),g=w.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,x=!1;if(t.forEach(N=>{var C;let _=o.routes[N.route.id];!_||!_.hasLoader||(!v.some(A=>A.route.id===N.route.id)&&N.route.id in d&&((C=l[N.route.id])!=null&&C.shouldRevalidate)||_.hasClientLoader?x=!0:S.add(N.route.id))}),S.size===0)return[];let E=HH(e,u,i.unstable_trailingSlashAwareDataRequests,"data");return x&&S.size>0&&E.searchParams.set("_routes",t.filter(N=>S.has(N.route.id)).map(N=>N.route.id).join(",")),[E.pathname+E.search]},[u,i.unstable_trailingSlashAwareDataRequests,d,r,o,v,t,e,l]),b=w.useMemo(()=>YH(m,o),[m,o]),O=eF(m);return w.createElement(w.Fragment,null,g.map(S=>w.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),b.map(S=>w.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),O.map(({key:S,link:x})=>w.createElement("link",{key:S,nonce:n.nonce,...x,crossOrigin:x.crossOrigin??n.crossOrigin})))}function nF(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var rF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{rF&&(window.__reactRouterVersion="7.13.0")}catch{}function aF({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=w.useRef();i.current==null&&(i.current=$U({window:r,v5Compat:!0}));let o=i.current,[l,u]=w.useState({action:o.action,location:o.location}),d=w.useCallback(h=>{n===!1?u(h):w.startTransition(()=>u(h))},[n]);return w.useLayoutEffect(()=>o.listen(d),[o,d]),w.createElement(RH,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var s$=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,em=w.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:o,replace:l,state:u,target:d,to:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...b},O){let{basename:S,unstable_useTransitions:x}=w.useContext(ur),E=typeof h=="string"&&s$.test(h),N=X4(h,S);h=N.to;let _=vH(h,{relative:i}),[C,A,M]=ZH(r,b),R=lF(h,{replace:l,state:u,target:d,preventScrollReset:v,relative:i,viewTransition:m,unstable_defaultShouldRevalidate:g,unstable_useTransitions:x});function D(G){t&&t(G),G.defaultPrevented||R(G)}let z=w.createElement("a",{...b,...M,href:N.absoluteURL||_,onClick:N.isExternal||o?t:D,ref:nF(O,A),target:d,"data-discover":!E&&n==="render"?"true":void 0});return C&&!E?w.createElement(w.Fragment,null,z,w.createElement(JH,{page:_})):z});em.displayName="Link";var iF=w.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:o,to:l,viewTransition:u,children:d,...h},v){let m=If(l,{relative:h.relative}),g=Zr(),b=w.useContext(Mp),{navigator:O,basename:S}=w.useContext(ur),x=b!=null&&mF(m)&&u===!0,E=O.encodeLocation?O.encodeLocation(m).pathname:m.pathname,N=g.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(N=N.toLowerCase(),_=_?_.toLowerCase():null,E=E.toLowerCase()),_&&S&&(_=ni(_,S)||_);const C=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let A=N===E||!i&&N.startsWith(E)&&N.charAt(C)==="/",M=_!=null&&(_===E||!i&&_.startsWith(E)&&_.charAt(E.length)==="/"),R={isActive:A,isPending:M,isTransitioning:x},D=A?t:void 0,z;typeof r=="function"?z=r(R):z=[r,A?"active":null,M?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let G=typeof o=="function"?o(R):o;return w.createElement(em,{...h,"aria-current":D,className:z,ref:v,style:G,to:l,viewTransition:u},typeof d=="function"?d(R):d)});iF.displayName="NavLink";var oF=w.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:o,method:l=Vh,action:u,onSubmit:d,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g,...b},O)=>{let{unstable_useTransitions:S}=w.useContext(ur),x=dF(),E=hF(u,{relative:h}),N=l.toLowerCase()==="get"?"get":"post",_=typeof u=="string"&&s$.test(u),C=A=>{if(d&&d(A),A.defaultPrevented)return;A.preventDefault();let M=A.nativeEvent.submitter,R=(M==null?void 0:M.getAttribute("formmethod"))||l,D=()=>x(M||A.currentTarget,{fetcherKey:t,method:R,navigate:n,replace:i,state:o,relative:h,preventScrollReset:v,viewTransition:m,unstable_defaultShouldRevalidate:g});S&&n!==!1?w.startTransition(()=>D()):D()};return w.createElement("form",{ref:O,method:N,action:E,onSubmit:r?d:C,...b,"data-discover":!_&&e==="render"?"true":void 0})});oF.displayName="Form";function sF(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function l$(e){let t=w.useContext(rc);return Mt(t,sF(e)),t}function lF(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u,unstable_useTransitions:d}={}){let h=Sa(),v=Zr(),m=If(e,{relative:o});return w.useCallback(g=>{if(LH(g,t)){g.preventDefault();let b=n!==void 0?n:Fu(v)===Fu(m),O=()=>h(e,{replace:b,state:r,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:u});d?w.startTransition(()=>O()):O()}},[v,h,m,n,r,t,e,i,o,l,u,d])}function cF(e){Dr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=w.useRef(W1(e)),n=w.useRef(!1),r=Zr(),i=w.useMemo(()=>zH(r.search,n.current?null:t.current),[r.search]),o=Sa(),l=w.useCallback((u,d)=>{const h=W1(typeof u=="function"?u(new URLSearchParams(i)):u);n.current=!0,o("?"+h,d)},[o,i]);return[i,l]}var uF=0,fF=()=>`__${String(++uF)}__`;function dF(){let{router:e}=l$("useSubmit"),{basename:t}=w.useContext(ur),n=NH(),r=e.fetch,i=e.navigate;return w.useCallback(async(o,l={})=>{let{action:u,method:d,encType:h,formData:v,body:m}=UH(o,t);if(l.navigate===!1){let g=l.fetcherKey||fF();await r(g,n,l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,flushSync:l.flushSync})}else await i(l.action||u,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:v,body:m,formMethod:l.method||d,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,i,t,n])}function hF(e,{relative:t}={}){let{basename:n}=w.useContext(ur),r=w.useContext(Qr);Mt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o={...If(e||".",{relative:t})},l=Zr();if(e==null){o.search=l.search;let u=new URLSearchParams(o.search),d=u.getAll("index");if(d.some(v=>v==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let v=u.toString();o.search=v?`?${v}`:""}}return(!e||e===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Xa([n,o.pathname])),Fu(o)}function mF(e,{relative:t}={}){let n=w.useContext(Z4);Mt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=l$("useViewTransitionState"),i=If(e,{relative:t});if(!n.isTransitioning)return!1;let o=ni(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ni(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Jh(i.pathname,l)!=null||Jh(i.pathname,o)!=null}var Lf=G4();const c$=xt(Lf),pF={theme:"system",setTheme:()=>null},u$=w.createContext(pF),f$=()=>{const e=w.useContext(u$);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};/**
|
|
61
61
|
* @license lucide-react v0.462.0 - ISC
|
|
62
62
|
*
|
|
63
63
|
* This source code is licensed under the ISC license.
|
|
64
64
|
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const
|
|
65
|
+
*/const vF=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d$=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
66
66
|
* @license lucide-react v0.462.0 - ISC
|
|
67
67
|
*
|
|
68
68
|
* This source code is licensed under the ISC license.
|
|
69
69
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/var
|
|
70
|
+
*/var gF={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
71
71
|
* @license lucide-react v0.462.0 - ISC
|
|
72
72
|
*
|
|
73
73
|
* This source code is licensed under the ISC license.
|
|
74
74
|
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const
|
|
75
|
+
*/const yF=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:l,...u},d)=>w.createElement("svg",{ref:d,...gF,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:d$("lucide",i),...u},[...l.map(([h,v])=>w.createElement(h,v)),...Array.isArray(o)?o:[o]]));/**
|
|
76
76
|
* @license lucide-react v0.462.0 - ISC
|
|
77
77
|
*
|
|
78
78
|
* This source code is licensed under the ISC license.
|
|
79
79
|
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const _e=(e,t)=>{const n=w.forwardRef(({className:r,...i},o)=>w.createElement(
|
|
80
|
+
*/const _e=(e,t)=>{const n=w.forwardRef(({className:r,...i},o)=>w.createElement(yF,{ref:o,iconNode:t,className:d$(`lucide-${vF(e)}`,r),...i}));return n.displayName=`${e}`,n};/**
|
|
81
81
|
* @license lucide-react v0.462.0 - ISC
|
|
82
82
|
*
|
|
83
83
|
* This source code is licensed under the ISC license.
|
|
@@ -87,7 +87,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
87
87
|
*
|
|
88
88
|
* This source code is licensed under the ISC license.
|
|
89
89
|
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const
|
|
90
|
+
*/const bF=_e("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
|
|
91
91
|
* @license lucide-react v0.462.0 - ISC
|
|
92
92
|
*
|
|
93
93
|
* This source code is licensed under the ISC license.
|
|
@@ -97,17 +97,17 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
97
97
|
*
|
|
98
98
|
* This source code is licensed under the ISC license.
|
|
99
99
|
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const
|
|
100
|
+
*/const xF=_e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
101
101
|
* @license lucide-react v0.462.0 - ISC
|
|
102
102
|
*
|
|
103
103
|
* This source code is licensed under the ISC license.
|
|
104
104
|
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const
|
|
105
|
+
*/const wF=_e("ArrowUpFromLine",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
|
|
106
106
|
* @license lucide-react v0.462.0 - ISC
|
|
107
107
|
*
|
|
108
108
|
* This source code is licensed under the ISC license.
|
|
109
109
|
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const
|
|
110
|
+
*/const SF=_e("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
|
|
111
111
|
* @license lucide-react v0.462.0 - ISC
|
|
112
112
|
*
|
|
113
113
|
* This source code is licensed under the ISC license.
|
|
@@ -127,7 +127,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
127
127
|
*
|
|
128
128
|
* This source code is licensed under the ISC license.
|
|
129
129
|
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const
|
|
130
|
+
*/const jF=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
131
131
|
* @license lucide-react v0.462.0 - ISC
|
|
132
132
|
*
|
|
133
133
|
* This source code is licensed under the ISC license.
|
|
@@ -137,7 +137,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
137
137
|
*
|
|
138
138
|
* This source code is licensed under the ISC license.
|
|
139
139
|
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const
|
|
140
|
+
*/const OF=_e("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/**
|
|
141
141
|
* @license lucide-react v0.462.0 - ISC
|
|
142
142
|
*
|
|
143
143
|
* This source code is licensed under the ISC license.
|
|
@@ -152,7 +152,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
152
152
|
*
|
|
153
153
|
* This source code is licensed under the ISC license.
|
|
154
154
|
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const
|
|
155
|
+
*/const h$=_e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
156
156
|
* @license lucide-react v0.462.0 - ISC
|
|
157
157
|
*
|
|
158
158
|
* This source code is licensed under the ISC license.
|
|
@@ -162,7 +162,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
162
162
|
*
|
|
163
163
|
* This source code is licensed under the ISC license.
|
|
164
164
|
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const
|
|
165
|
+
*/const EF=_e("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
|
|
166
166
|
* @license lucide-react v0.462.0 - ISC
|
|
167
167
|
*
|
|
168
168
|
* This source code is licensed under the ISC license.
|
|
@@ -172,12 +172,12 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
172
172
|
*
|
|
173
173
|
* This source code is licensed under the ISC license.
|
|
174
174
|
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const
|
|
175
|
+
*/const _F=_e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
176
176
|
* @license lucide-react v0.462.0 - ISC
|
|
177
177
|
*
|
|
178
178
|
* This source code is licensed under the ISC license.
|
|
179
179
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const
|
|
180
|
+
*/const NF=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
181
181
|
* @license lucide-react v0.462.0 - ISC
|
|
182
182
|
*
|
|
183
183
|
* This source code is licensed under the ISC license.
|
|
@@ -192,7 +192,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
192
192
|
*
|
|
193
193
|
* This source code is licensed under the ISC license.
|
|
194
194
|
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const
|
|
195
|
+
*/const m$=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
196
196
|
* @license lucide-react v0.462.0 - ISC
|
|
197
197
|
*
|
|
198
198
|
* This source code is licensed under the ISC license.
|
|
@@ -202,12 +202,12 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
202
202
|
*
|
|
203
203
|
* This source code is licensed under the ISC license.
|
|
204
204
|
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const
|
|
205
|
+
*/const AF=_e("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
206
206
|
* @license lucide-react v0.462.0 - ISC
|
|
207
207
|
*
|
|
208
208
|
* This source code is licensed under the ISC license.
|
|
209
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const
|
|
210
|
+
*/const p$=_e("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
211
211
|
* @license lucide-react v0.462.0 - ISC
|
|
212
212
|
*
|
|
213
213
|
* This source code is licensed under the ISC license.
|
|
@@ -217,7 +217,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
217
217
|
*
|
|
218
218
|
* This source code is licensed under the ISC license.
|
|
219
219
|
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const
|
|
220
|
+
*/const CF=_e("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
|
221
221
|
* @license lucide-react v0.462.0 - ISC
|
|
222
222
|
*
|
|
223
223
|
* This source code is licensed under the ISC license.
|
|
@@ -232,12 +232,12 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
232
232
|
*
|
|
233
233
|
* This source code is licensed under the ISC license.
|
|
234
234
|
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const
|
|
235
|
+
*/const TF=_e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
236
236
|
* @license lucide-react v0.462.0 - ISC
|
|
237
237
|
*
|
|
238
238
|
* This source code is licensed under the ISC license.
|
|
239
239
|
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const
|
|
240
|
+
*/const MF=_e("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
|
241
241
|
* @license lucide-react v0.462.0 - ISC
|
|
242
242
|
*
|
|
243
243
|
* This source code is licensed under the ISC license.
|
|
@@ -257,22 +257,22 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
257
257
|
*
|
|
258
258
|
* This source code is licensed under the ISC license.
|
|
259
259
|
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const
|
|
260
|
+
*/const RF=_e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
261
261
|
* @license lucide-react v0.462.0 - ISC
|
|
262
262
|
*
|
|
263
263
|
* This source code is licensed under the ISC license.
|
|
264
264
|
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const
|
|
265
|
+
*/const DF=_e("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
266
266
|
* @license lucide-react v0.462.0 - ISC
|
|
267
267
|
*
|
|
268
268
|
* This source code is licensed under the ISC license.
|
|
269
269
|
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const
|
|
270
|
+
*/const PF=_e("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
271
271
|
* @license lucide-react v0.462.0 - ISC
|
|
272
272
|
*
|
|
273
273
|
* This source code is licensed under the ISC license.
|
|
274
274
|
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const
|
|
275
|
+
*/const v$=_e("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/**
|
|
276
276
|
* @license lucide-react v0.462.0 - ISC
|
|
277
277
|
*
|
|
278
278
|
* This source code is licensed under the ISC license.
|
|
@@ -302,12 +302,12 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
302
302
|
*
|
|
303
303
|
* This source code is licensed under the ISC license.
|
|
304
304
|
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const
|
|
305
|
+
*/const g$=_e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
306
306
|
* @license lucide-react v0.462.0 - ISC
|
|
307
307
|
*
|
|
308
308
|
* This source code is licensed under the ISC license.
|
|
309
309
|
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const
|
|
310
|
+
*/const y$=_e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
311
311
|
* @license lucide-react v0.462.0 - ISC
|
|
312
312
|
*
|
|
313
313
|
* This source code is licensed under the ISC license.
|
|
@@ -317,22 +317,22 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
317
317
|
*
|
|
318
318
|
* This source code is licensed under the ISC license.
|
|
319
319
|
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const
|
|
320
|
+
*/const kF=_e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
321
321
|
* @license lucide-react v0.462.0 - ISC
|
|
322
322
|
*
|
|
323
323
|
* This source code is licensed under the ISC license.
|
|
324
324
|
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const
|
|
325
|
+
*/const b$=_e("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
|
|
326
326
|
* @license lucide-react v0.462.0 - ISC
|
|
327
327
|
*
|
|
328
328
|
* This source code is licensed under the ISC license.
|
|
329
329
|
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const
|
|
330
|
+
*/const $F=_e("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
331
331
|
* @license lucide-react v0.462.0 - ISC
|
|
332
332
|
*
|
|
333
333
|
* This source code is licensed under the ISC license.
|
|
334
334
|
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const
|
|
335
|
+
*/const IF=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
336
336
|
* @license lucide-react v0.462.0 - ISC
|
|
337
337
|
*
|
|
338
338
|
* This source code is licensed under the ISC license.
|
|
@@ -342,7 +342,7 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
342
342
|
*
|
|
343
343
|
* This source code is licensed under the ISC license.
|
|
344
344
|
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const
|
|
345
|
+
*/const LF=_e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
346
346
|
* @license lucide-react v0.462.0 - ISC
|
|
347
347
|
*
|
|
348
348
|
* This source code is licensed under the ISC license.
|
|
@@ -352,17 +352,17 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
352
352
|
*
|
|
353
353
|
* This source code is licensed under the ISC license.
|
|
354
354
|
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const
|
|
355
|
+
*/const zF=_e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
356
356
|
* @license lucide-react v0.462.0 - ISC
|
|
357
357
|
*
|
|
358
358
|
* This source code is licensed under the ISC license.
|
|
359
359
|
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const
|
|
360
|
+
*/const BF=_e("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
361
361
|
* @license lucide-react v0.462.0 - ISC
|
|
362
362
|
*
|
|
363
363
|
* This source code is licensed under the ISC license.
|
|
364
364
|
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const or=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function
|
|
365
|
+
*/const or=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function x$(e,t=[]){let n=[];function r(o,l){const u=w.createContext(l);u.displayName=o+"Context";const d=n.length;n=[...n,l];const h=m=>{var E;const{scope:g,children:b,...O}=m,S=((E=g==null?void 0:g[e])==null?void 0:E[d])||u,x=w.useMemo(()=>O,Object.values(O));return c.jsx(S.Provider,{value:x,children:b})};h.displayName=o+"Provider";function v(m,g){var S;const b=((S=g==null?void 0:g[e])==null?void 0:S[d])||u,O=w.useContext(b);if(O)return O;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,v]}const i=()=>{const o=n.map(l=>w.createContext(l));return function(u){const d=(u==null?void 0:u[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,qF(i,...t)]}function qF(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const m=d(o)[`__scope${h}`];return{...u,...m}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function Wr(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var Wt=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function iC(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function qf(...e){return t=>{let n=!1;const r=e.map(i=>{const o=iC(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():iC(e[i],null)}}}}function Ue(...e){return w.useCallback(qf(...e),e)}var UF=Symbol.for("react.lazy"),rm=Bj[" use ".trim().toString()];function HF(e){return typeof e=="object"&&e!==null&&"then"in e}function w$(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===UF&&"_payload"in e&&HF(e._payload)}function S$(e){const t=FF(e),n=w.forwardRef((r,i)=>{let{children:o,...l}=r;w$(o)&&typeof rm=="function"&&(o=rm(o._payload));const u=w.Children.toArray(o),d=u.find(VF);if(d){const h=d.props.children,v=u.map(m=>m===d?w.Children.count(h)>1?w.Children.only(null):w.isValidElement(h)?h.props.children:null:m);return c.jsx(t,{...l,ref:i,children:w.isValidElement(h)?w.cloneElement(h,void 0,v):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var ss=S$("Slot");function FF(e){const t=w.forwardRef((n,r)=>{let{children:i,...o}=n;if(w$(i)&&typeof rm=="function"&&(i=rm(i._payload)),w.isValidElement(i)){const l=WF(i),u=YF(o,i.props);return i.type!==w.Fragment&&(u.ref=r?qf(r,l):l),w.cloneElement(i,u)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GF=Symbol("radix.slottable");function VF(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GF}function YF(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const d=o(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function WF(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ls=KF.reduce((e,t)=>{const n=S$(`Primitive.${t}`),r=w.forwardRef((i,o)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ob={exports:{}},Eb={};/**
|
|
366
366
|
* @license React
|
|
367
367
|
* use-sync-external-store-shim.production.js
|
|
368
368
|
*
|
|
@@ -370,8 +370,8 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
370
370
|
*
|
|
371
371
|
* This source code is licensed under the MIT license found in the
|
|
372
372
|
* LICENSE file in the root directory of this source tree.
|
|
373
|
-
*/var oC;function KF(){if(oC)return Eb;oC=1;var e=Tp();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var b=g(),O=r({inst:{value:b,getSnapshot:g}}),S=O[0].inst,x=O[1];return o(function(){S.value=b,S.getSnapshot=g,d(S)&&x({inst:S})},[m,b,g]),i(function(){return d(S)&&x({inst:S}),m(function(){d(S)&&x({inst:S})})},[m]),l(b),b}function d(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!n(m,b)}catch{return!0}}function h(m,g){return g()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Eb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Eb}var sC;function XF(){return sC||(sC=1,Ob.exports=KF()),Ob.exports}var QF=XF();function ZF(){return QF.useSyncExternalStore(JF,()=>!0,()=>!1)}function JF(){return()=>{}}var Jj="Avatar",[e7]=y$(Jj),[t7,w$]=e7(Jj),S$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=w.useState("idle");return c.jsx(t7,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:c.jsx(ls.span,{...r,ref:t})})});S$.displayName=Jj;var j$="AvatarImage",O$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,l=w$(j$,n),u=n7(r,o),d=Wr(h=>{i(h),l.onImageLoadingStatusChange(h)});return Wt(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?c.jsx(ls.img,{...o,ref:t,src:r}):null});O$.displayName=j$;var E$="AvatarFallback",_$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=w$(E$,n),[l,u]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?c.jsx(ls.span,{...i,ref:t}):null});_$.displayName=E$;function lC(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function n7(e,{referrerPolicy:t,crossOrigin:n}){const r=ZF(),i=w.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[l,u]=w.useState(()=>lC(o,e));return Wt(()=>{u(lC(o,e))},[o,e]),Wt(()=>{const d=m=>()=>{u(m)};if(!o)return;const h=d("loaded"),v=d("error");return o.addEventListener("load",h),o.addEventListener("error",v),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",h),o.removeEventListener("error",v)}},[o,n,t]),l}var r7=S$,a7=O$,i7=_$;function N$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=N$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=N$(e))&&(r&&(r+=" "),r+=t);return r}const o7=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},s7=(e,t)=>({classGroupId:e,validator:t}),A$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),am="-",cC=[],l7="arbitrary..",c7=e=>{const t=f7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return u7(l);const u=l.split(am),d=u[0]===""&&u.length>1?1:0;return C$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?o7(h,d):d:h||cC}return n[l]||cC}}},C$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const h=C$(e,t+1,o);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(am):e.slice(t).join(am),d=l.length;for(let h=0;h<d;h++){const v=l[h];if(v.validator(u))return v.classGroupId}},u7=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?l7+r:void 0})(),f7=e=>{const{theme:t,classGroups:n}=e;return d7(n,t)},d7=(e,t)=>{const n=A$();for(const r in e){const i=e[r];eO(i,n,r,t)}return n},eO=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const l=e[o];h7(l,t,n,r)}},h7=(e,t,n,r)=>{if(typeof e=="string"){m7(e,t,n);return}if(typeof e=="function"){p7(e,t,n,r);return}v7(e,t,n,r)},m7=(e,t,n)=>{const r=e===""?t:T$(t,e);r.classGroupId=n},p7=(e,t,n,r)=>{if(g7(e)){eO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(s7(n,e))},v7=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let l=0;l<o;l++){const[u,d]=i[l];eO(d,T$(t,u),n,r)}},T$=(e,t)=>{let n=e;const r=t.split(am),i=r.length;for(let o=0;o<i;o++){const l=r[o];let u=n.nextPart.get(l);u||(u=A$(),n.nextPart.set(l,u)),n=u}return n},g7=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,y7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return i(o,l),l},set(o,l){o in n?n[o]=l:i(o,l)}}},K1="!",uC=":",b7=[],fC=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),x7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,u=0,d=0,h;const v=i.length;for(let S=0;S<v;S++){const x=i[S];if(l===0&&u===0){if(x===uC){o.push(i.slice(d,S)),d=S+1;continue}if(x==="/"){h=S;continue}}x==="["?l++:x==="]"?l--:x==="("?u++:x===")"&&u--}const m=o.length===0?i:i.slice(d);let g=m,b=!1;m.endsWith(K1)?(g=m.slice(0,-1),b=!0):m.startsWith(K1)&&(g=m.slice(1),b=!0);const O=h&&h>d?h-d:void 0;return fC(o,b,g,O)};if(t){const i=t+uC,o=r;r=l=>l.startsWith(i)?o(l.slice(i.length)):fC(b7,!1,l,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},w7=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const l=n[o],u=l[0]==="[",d=t.has(l);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},S7=e=>({cache:y7(e.cacheSize),parseClassName:x7(e),sortModifiers:w7(e),...c7(e)}),j7=/\s+/,O7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],u=e.trim().split(j7);let d="";for(let h=u.length-1;h>=0;h-=1){const v=u[h],{isExternal:m,modifiers:g,hasImportantModifier:b,baseClassName:O,maybePostfixModifierPosition:S}=n(v);if(m){d=v+(d.length>0?" "+d:d);continue}let x=!!S,E=r(x?O.substring(0,S):O);if(!E){if(!x){d=v+(d.length>0?" "+d:d);continue}if(E=r(O),!E){d=v+(d.length>0?" "+d:d);continue}x=!1}const N=g.length===0?"":g.length===1?g[0]:o(g).join(":"),_=b?N+K1:N,C=_+E;if(l.indexOf(C)>-1)continue;l.push(C);const A=i(E,x);for(let M=0;M<A.length;++M){const R=A[M];l.push(_+R)}d=v+(d.length>0?" "+d:d)}return d},E7=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=M$(n))&&(i&&(i+=" "),i+=r);return i},M$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=M$(e[r]))&&(n&&(n+=" "),n+=t);return n},_7=(e,...t)=>{let n,r,i,o;const l=d=>{const h=t.reduce((v,m)=>m(v),e());return n=S7(h),r=n.cache.get,i=n.cache.set,o=u,u(d)},u=d=>{const h=r(d);if(h)return h;const v=O7(d,n);return i(d,v),v};return o=l,(...d)=>o(E7(...d))},N7=[],Xt=e=>{const t=n=>n[e]||N7;return t.isThemeGetter=!0,t},R$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,D$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,A7=/^\d+\/\d+$/,C7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,T7=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,M7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,R7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,D7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sl=e=>A7.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),Ui=e=>!!e&&Number.isInteger(Number(e)),_b=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),Fa=e=>C7.test(e),P7=()=>!0,k7=e=>T7.test(e)&&!M7.test(e),P$=()=>!1,$7=e=>R7.test(e),I7=e=>D7.test(e),L7=e=>!je(e)&&!Oe(e),z7=e=>oc(e,I$,P$),je=e=>R$.test(e),Lo=e=>oc(e,L$,k7),Nb=e=>oc(e,F7,Ve),dC=e=>oc(e,k$,P$),B7=e=>oc(e,$$,I7),bh=e=>oc(e,z$,$7),Oe=e=>D$.test(e),xu=e=>sc(e,L$),q7=e=>sc(e,G7),hC=e=>sc(e,k$),U7=e=>sc(e,I$),H7=e=>sc(e,$$),xh=e=>sc(e,z$,!0),oc=(e,t,n)=>{const r=R$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sc=(e,t,n=!1)=>{const r=D$.exec(e);return r?r[1]?t(r[1]):n:!1},k$=e=>e==="position"||e==="percentage",$$=e=>e==="image"||e==="url",I$=e=>e==="length"||e==="size"||e==="bg-size",L$=e=>e==="length",F7=e=>e==="number",G7=e=>e==="family-name",z$=e=>e==="shadow",V7=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),r=Xt("font-weight"),i=Xt("tracking"),o=Xt("leading"),l=Xt("breakpoint"),u=Xt("container"),d=Xt("spacing"),h=Xt("radius"),v=Xt("shadow"),m=Xt("inset-shadow"),g=Xt("text-shadow"),b=Xt("drop-shadow"),O=Xt("blur"),S=Xt("perspective"),x=Xt("aspect"),E=Xt("ease"),N=Xt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...C(),Oe,je],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],D=()=>[Oe,je,d],z=()=>[sl,"full","auto",...D()],G=()=>[Ui,"none","subgrid",Oe,je],L=()=>["auto",{span:["full",Ui,Oe,je]},Ui,Oe,je],F=()=>[Ui,"auto",Oe,je],W=()=>["auto","min","max","fr",Oe,je],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...D()],H=()=>[sl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],B=()=>[e,Oe,je],Z=()=>[...C(),hC,dC,{position:[Oe,je]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",U7,z7,{size:[Oe,je]}],Y=()=>[_b,xu,Lo],q=()=>["","none","full",h,Oe,je],U=()=>["",Ve,xu,Lo],ne=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ve,_b,hC,dC],pe=()=>["","none",O,Oe,je],re=()=>["none",Ve,Oe,je],ve=()=>["none",Ve,Oe,je],ge=()=>[Ve,Oe,je],oe=()=>[sl,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fa],breakpoint:[Fa],color:[P7],container:[Fa],"drop-shadow":[Fa],ease:["in","out","in-out"],font:[L7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fa],shadow:[Fa],spacing:["px",Ve],text:[Fa],"text-shadow":[Fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sl,je,Oe,x]}],container:["container"],columns:[{columns:[Ve,je,Oe,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Ui,"auto",Oe,je]}],basis:[{basis:[sl,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,sl,"auto","initial","none",je]}],grow:[{grow:["",Ve,Oe,je]}],shrink:[{shrink:["",Ve,Oe,je]}],order:[{order:[Ui,"first","last","none",Oe,je]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[u,"screen",...H()]}],"min-w":[{"min-w":[u,"screen","none",...H()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,xu,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oe,Nb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_b,je]}],"font-family":[{font:[q7,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Oe,je]}],"line-clamp":[{"line-clamp":[Ve,"none",Oe,Nb]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Oe,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Oe,Lo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ve,"auto",Oe,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ui,Oe,je],radial:["",Oe,je],conic:[Ui,Oe,je]},H7,B7]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Oe,je]}],"outline-w":[{outline:["",Ve,xu,Lo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",v,xh,bh]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",m,xh,bh]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ve,Lo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",g,xh,bh]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ve,Oe,je]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Oe,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,je]}],filter:[{filter:["","none",Oe,je]}],blur:[{blur:pe()}],brightness:[{brightness:[Ve,Oe,je]}],contrast:[{contrast:[Ve,Oe,je]}],"drop-shadow":[{"drop-shadow":["","none",b,xh,bh]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ve,Oe,je]}],"hue-rotate":[{"hue-rotate":[Ve,Oe,je]}],invert:[{invert:["",Ve,Oe,je]}],saturate:[{saturate:[Ve,Oe,je]}],sepia:[{sepia:["",Ve,Oe,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,je]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Oe,je]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Oe,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Oe,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Oe,je]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Oe,je]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Oe,je]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Oe,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Oe,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Oe,je]}],ease:[{ease:["linear","initial",E,Oe,je]}],delay:[{delay:[Ve,Oe,je]}],animate:[{animate:["none",N,Oe,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Oe,je]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Oe,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,je]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ve,xu,Lo,Nb]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Y7=_7(V7);function me(...e){return Y7(rt(e))}function mC({className:e,...t}){return c.jsx(r7,{className:me("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),"data-slot":"avatar",...t})}function pC({className:e,...t}){return c.jsx(a7,{className:me("aspect-square size-full",e),"data-slot":"avatar-image",...t})}function vC({className:e,...t}){return c.jsx(i7,{className:me("flex size-full items-center justify-center rounded-full bg-muted",e),"data-slot":"avatar-fallback",...t})}function ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function W7(e,t){const n=w.createContext(t),r=o=>{const{children:l,...u}=o,d=w.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(o){const l=w.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function jn(e,t=[]){let n=[];function r(o,l){const u=w.createContext(l),d=n.length;n=[...n,l];const h=m=>{var E;const{scope:g,children:b,...O}=m,S=((E=g==null?void 0:g[e])==null?void 0:E[d])||u,x=w.useMemo(()=>O,Object.values(O));return c.jsx(S.Provider,{value:x,children:b})};h.displayName=o+"Provider";function v(m,g){var S;const b=((S=g==null?void 0:g[e])==null?void 0:S[d])||u,O=w.useContext(b);if(O)return O;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,v]}const i=()=>{const o=n.map(l=>w.createContext(l));return function(u){const d=(u==null?void 0:u[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,K7(i,...t)]}function K7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const m=d(o)[`__scope${h}`];return{...u,...m}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var X7=Bj[" useInsertionEffect ".trim().toString()]||Wt;function Nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=Q7({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const v=w.useRef(e!==void 0);w.useEffect(()=>{const m=v.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=u},[u,r])}const h=w.useCallback(v=>{var m;if(u){const g=Z7(v)?v(e):v;g!==e&&((m=l.current)==null||m.call(l,g))}else o(v)},[u,e,o,l]);return[d,h]}function Q7({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),i=w.useRef(n),o=w.useRef(t);return X7(()=>{o.current=t},[t]),w.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function Z7(e){return typeof e=="function"}function Tl(e){const t=J7(e),n=w.forwardRef((r,i)=>{const{children:o,...l}=r,u=w.Children.toArray(o),d=u.find(e9);if(d){const h=d.props.children,v=u.map(m=>m===d?w.Children.count(h)>1?w.Children.only(null):w.isValidElement(h)?h.props.children:null:m);return c.jsx(t,{...l,ref:i,children:w.isValidElement(h)?w.cloneElement(h,void 0,v):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function J7(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const l=n9(i),u=t9(o,i.props);return i.type!==w.Fragment&&(u.ref=r?qf(r,l):l),w.cloneElement(i,u)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B$=Symbol("radix.slottable");function q$(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=B$,t}function e9(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B$}function t9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const d=o(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function n9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var r9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=r9.reduce((e,t)=>{const n=Tl(`Primitive.${t}`),r=w.forwardRef((i,o)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function U$(e,t){e&&Lf.flushSync(()=>e.dispatchEvent(t))}function kp(e){const t=e+"CollectionProvider",[n,r]=jn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:x,children:E}=S,N=I.useRef(null),_=I.useRef(new Map).current;return c.jsx(i,{scope:x,itemMap:_,collectionRef:N,children:E})};l.displayName=t;const u=e+"CollectionSlot",d=Tl(u),h=I.forwardRef((S,x)=>{const{scope:E,children:N}=S,_=o(u,E),C=Ue(x,_.collectionRef);return c.jsx(d,{ref:C,children:N})});h.displayName=u;const v=e+"CollectionItemSlot",m="data-radix-collection-item",g=Tl(v),b=I.forwardRef((S,x)=>{const{scope:E,children:N,..._}=S,C=I.useRef(null),A=Ue(x,C),M=o(v,E);return I.useEffect(()=>(M.itemMap.set(C,{ref:C,..._}),()=>void M.itemMap.delete(C))),c.jsx(g,{[m]:"",ref:A,children:N})});b.displayName=v;function O(S){const x=o(e+"CollectionConsumer",S);return I.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((M,R)=>_.indexOf(M.ref.current)-_.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:h,ItemSlot:b},O,r]}var a9=w.createContext(void 0);function lc(e){const t=w.useContext(a9);return e||t||"ltr"}function i9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var o9="DismissableLayer",X1="dismissableLayer.update",s9="dismissableLayer.pointerDownOutside",l9="dismissableLayer.focusOutside",gC,H$=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,h=w.useContext(H$),[v,m]=w.useState(null),g=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),O=Ue(t,R=>m(R)),S=Array.from(h.layers),[x]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(x),N=v?S.indexOf(v):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,C=N>=E,A=f9(R=>{const D=R.target,z=[...h.branches].some(G=>G.contains(D));!C||z||(i==null||i(R),l==null||l(R),R.defaultPrevented||u==null||u())},g),M=d9(R=>{const D=R.target;[...h.branches].some(G=>G.contains(D))||(o==null||o(R),l==null||l(R),R.defaultPrevented||u==null||u())},g);return i9(R=>{N===h.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},g),w.useEffect(()=>{if(v)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(gC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(v)),h.layers.add(v),yC(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=gC)}},[v,g,n,h]),w.useEffect(()=>()=>{v&&(h.layers.delete(v),h.layersWithOutsidePointerEventsDisabled.delete(v),yC())},[v,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(X1,R),()=>document.removeEventListener(X1,R)},[]),c.jsx(Ne.div,{...d,ref:O,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,A.onPointerDownCapture)})});cc.displayName=o9;var c9="DismissableLayerBranch",u9=w.forwardRef((e,t)=>{const n=w.useContext(H$),r=w.useRef(null),i=Ue(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(Ne.div,{...e,ref:i})});u9.displayName=c9;function f9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){F$(s9,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function d9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&F$(l9,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yC(){const e=new CustomEvent(X1);document.dispatchEvent(e)}function F$(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?U$(i,o):i.dispatchEvent(o)}var Ab=0;function tO(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bC()),document.body.insertAdjacentElement("beforeend",e[1]??bC()),Ab++,()=>{Ab===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ab--}},[])}function bC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Cb="focusScope.autoFocusOnMount",Tb="focusScope.autoFocusOnUnmount",xC={bubbles:!1,cancelable:!0},h9="FocusScope",$p=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=w.useState(null),h=Wr(i),v=Wr(o),m=w.useRef(null),g=Ue(t,S=>d(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(_){if(b.paused||!u)return;const C=_.target;u.contains(C)?m.current=C:Gi(m.current,{select:!0})},x=function(_){if(b.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||Gi(m.current,{select:!0}))},E=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Gi(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",x);const N=new MutationObserver(E);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",x),N.disconnect()}}},[r,u,b.paused]),w.useEffect(()=>{if(u){SC.add(b);const S=document.activeElement;if(!u.contains(S)){const E=new CustomEvent(Cb,xC);u.addEventListener(Cb,h),u.dispatchEvent(E),E.defaultPrevented||(m9(b9(G$(u)),{select:!0}),document.activeElement===S&&Gi(u))}return()=>{u.removeEventListener(Cb,h),setTimeout(()=>{const E=new CustomEvent(Tb,xC);u.addEventListener(Tb,v),u.dispatchEvent(E),E.defaultPrevented||Gi(S??document.body,{select:!0}),u.removeEventListener(Tb,v),SC.remove(b)},0)}}},[u,h,v,b]);const O=w.useCallback(S=>{if(!n&&!r||b.paused)return;const x=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(x&&E){const N=S.currentTarget,[_,C]=p9(N);_&&C?!S.shiftKey&&E===C?(S.preventDefault(),n&&Gi(_,{select:!0})):S.shiftKey&&E===_&&(S.preventDefault(),n&&Gi(C,{select:!0})):E===N&&S.preventDefault()}},[n,r,b.paused]);return c.jsx(Ne.div,{tabIndex:-1,...l,ref:g,onKeyDown:O})});$p.displayName=h9;function m9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gi(r,{select:t}),document.activeElement!==n)return}function p9(e){const t=G$(e),n=wC(t,e),r=wC(t.reverse(),e);return[n,r]}function G$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wC(e,t){for(const n of e)if(!v9(n,{upTo:t}))return n}function v9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function g9(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&g9(e)&&t&&e.select()}}var SC=y9();function y9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jC(e,t),e.unshift(t)},remove(t){var n;e=jC(e,t),(n=e[0])==null||n.resume()}}}function jC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function b9(e){return e.filter(t=>t.tagName!=="A")}var x9=Bj[" useId ".trim().toString()]||(()=>{}),w9=0;function Cr(e){const[t,n]=w.useState(x9());return Wt(()=>{n(r=>r??String(w9++))},[e]),e||(t?`radix-${t}`:"")}const S9=["top","right","bottom","left"],Ji=Math.min,ar=Math.max,im=Math.round,wh=Math.floor,ha=e=>({x:e,y:e}),j9={left:"right",right:"left",bottom:"top",top:"bottom"},O9={start:"end",end:"start"};function Q1(e,t,n){return ar(e,Ji(t,n))}function ai(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function uc(e){return e.split("-")[1]}function nO(e){return e==="x"?"y":"x"}function rO(e){return e==="y"?"height":"width"}const E9=new Set(["top","bottom"]);function ua(e){return E9.has(ii(e))?"y":"x"}function aO(e){return nO(ua(e))}function _9(e,t,n){n===void 0&&(n=!1);const r=uc(e),i=aO(e),o=rO(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=om(l)),[l,om(l)]}function N9(e){const t=om(e);return[Z1(e),t,Z1(t)]}function Z1(e){return e.replace(/start|end/g,t=>O9[t])}const OC=["left","right"],EC=["right","left"],A9=["top","bottom"],C9=["bottom","top"];function T9(e,t,n){switch(e){case"top":case"bottom":return n?t?EC:OC:t?OC:EC;case"left":case"right":return t?A9:C9;default:return[]}}function M9(e,t,n,r){const i=uc(e);let o=T9(ii(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Z1)))),o}function om(e){return e.replace(/left|right|bottom|top/g,t=>j9[t])}function R9(e){return{top:0,right:0,bottom:0,left:0,...e}}function V$(e){return typeof e!="number"?R9(e):{top:e,right:e,bottom:e,left:e}}function sm(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _C(e,t,n){let{reference:r,floating:i}=e;const o=ua(t),l=aO(t),u=rO(l),d=ii(t),h=o==="y",v=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let b;switch(d){case"top":b={x:v,y:r.y-i.height};break;case"bottom":b={x:v,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}switch(uc(t)){case"start":b[l]-=g*(n&&h?-1:1);break;case"end":b[l]+=g*(n&&h?-1:1);break}return b}const D9=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:m}=_C(h,r,d),g=r,b={},O=0;for(let S=0;S<u.length;S++){const{name:x,fn:E}=u[S],{x:N,y:_,data:C,reset:A}=await E({x:v,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:h,platform:l,elements:{reference:e,floating:t}});v=N??v,m=_??m,b={...b,[x]:{...b[x],...C}},A&&O<=50&&(O++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(h=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:v,y:m}=_C(h,g,d)),S=-1)}return{x:v,y:m,placement:g,strategy:i,middlewareData:b}};async function Wu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=ai(t,e),O=V$(b),x=u[g?m==="floating"?"reference":"floating":m],E=sm(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:h,rootBoundary:v,strategy:d})),N=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),C=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},A=sm(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:N,offsetParent:_,strategy:d}):N);return{top:(E.top-A.top+O.top)/C.y,bottom:(A.bottom-E.bottom+O.bottom)/C.y,left:(E.left-A.left+O.left)/C.x,right:(A.right-E.right+O.right)/C.x}}const P9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:v=0}=ai(e,t)||{};if(h==null)return{};const m=V$(v),g={x:n,y:r},b=aO(i),O=rO(b),S=await l.getDimensions(h),x=b==="y",E=x?"top":"left",N=x?"bottom":"right",_=x?"clientHeight":"clientWidth",C=o.reference[O]+o.reference[b]-g[b]-o.floating[O],A=g[b]-o.reference[b],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let R=M?M[_]:0;(!R||!await(l.isElement==null?void 0:l.isElement(M)))&&(R=u.floating[_]||o.floating[O]);const D=C/2-A/2,z=R/2-S[O]/2-1,G=Ji(m[E],z),L=Ji(m[N],z),F=G,W=R-S[O]-L,Q=R/2-S[O]/2+D,X=Q1(F,Q,W),k=!d.arrow&&uc(i)!=null&&Q!==X&&o.reference[O]/2-(Q<F?G:L)-S[O]/2<0,H=k?Q<F?Q-F:Q-W:0;return{[b]:g[b]+H,data:{[b]:X,centerOffset:Q-X-H,...k&&{alignmentOffset:H}},reset:k}}}),k9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:S=!0,...x}=ai(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=ii(i),N=ua(u),_=ii(u)===u,C=await(d.isRTL==null?void 0:d.isRTL(h.floating)),A=g||(_||!S?[om(u)]:N9(u)),M=O!=="none";!g&&M&&A.push(...M9(u,S,O,C));const R=[u,...A],D=await Wu(t,x),z=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(v&&z.push(D[E]),m){const Q=_9(i,l,C);z.push(D[Q[0]],D[Q[1]])}if(G=[...G,{placement:i,overflows:z}],!z.every(Q=>Q<=0)){var L,F;const Q=(((L=o.flip)==null?void 0:L.index)||0)+1,X=R[Q];if(X&&(!(m==="alignment"?N!==ua(X):!1)||G.every(B=>ua(B.placement)===N?B.overflows[0]>0:!0)))return{data:{index:Q,overflows:G},reset:{placement:X}};let k=(F=G.filter(H=>H.overflows[0]<=0).sort((H,B)=>H.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!k)switch(b){case"bestFit":{var W;const H=(W=G.filter(B=>{if(M){const Z=ua(B.placement);return Z===N||Z==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Z=>Z>0).reduce((Z,le)=>Z+le,0)]).sort((B,Z)=>B[1]-Z[1])[0])==null?void 0:W[0];H&&(k=H);break}case"initialPlacement":k=u;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function NC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AC(e){return S9.some(t=>e[t]>=0)}const $9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ai(e,t);switch(r){case"referenceHidden":{const o=await Wu(t,{...i,elementContext:"reference"}),l=NC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:AC(l)}}}case"escaped":{const o=await Wu(t,{...i,altBoundary:!0}),l=NC(o,n.floating);return{data:{escapedOffsets:l,escaped:AC(l)}}}default:return{}}}}},Y$=new Set(["left","top"]);async function I9(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=ii(n),u=uc(n),d=ua(n)==="y",h=Y$.has(l)?-1:1,v=o&&d?-1:1,m=ai(t,e);let{mainAxis:g,crossAxis:b,alignmentAxis:O}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof O=="number"&&(b=u==="end"?O*-1:O),d?{x:b*v,y:g*h}:{x:g*h,y:b*v}}const L9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:u}=t,d=await I9(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:l}}}}},z9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:x=>{let{x:E,y:N}=x;return{x:E,y:N}}},...d}=ai(e,t),h={x:n,y:r},v=await Wu(t,d),m=ua(ii(i)),g=nO(m);let b=h[g],O=h[m];if(o){const x=g==="y"?"top":"left",E=g==="y"?"bottom":"right",N=b+v[x],_=b-v[E];b=Q1(N,b,_)}if(l){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",N=O+v[x],_=O-v[E];O=Q1(N,O,_)}const S=u.fn({...t,[g]:b,[m]:O});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:o,[m]:l}}}}}},B9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=ai(e,t),v={x:n,y:r},m=ua(i),g=nO(m);let b=v[g],O=v[m];const S=ai(u,t),x=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const _=g==="y"?"height":"width",C=o.reference[g]-o.floating[_]+x.mainAxis,A=o.reference[g]+o.reference[_]-x.mainAxis;b<C?b=C:b>A&&(b=A)}if(h){var E,N;const _=g==="y"?"width":"height",C=Y$.has(ii(i)),A=o.reference[m]-o.floating[_]+(C&&((E=l.offset)==null?void 0:E[m])||0)+(C?0:x.crossAxis),M=o.reference[m]+o.reference[_]+(C?0:((N=l.offset)==null?void 0:N[m])||0)-(C?x.crossAxis:0);O<A?O=A:O>M&&(O=M)}return{[g]:b,[m]:O}}}},q9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...h}=ai(e,t),v=await Wu(t,h),m=ii(i),g=uc(i),b=ua(i)==="y",{width:O,height:S}=o.floating;let x,E;m==="top"||m==="bottom"?(x=m,E=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(E=m,x=g==="end"?"top":"bottom");const N=S-v.top-v.bottom,_=O-v.left-v.right,C=Ji(S-v[x],N),A=Ji(O-v[E],_),M=!t.middlewareData.shift;let R=C,D=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=N),M&&!g){const G=ar(v.left,0),L=ar(v.right,0),F=ar(v.top,0),W=ar(v.bottom,0);b?D=O-2*(G!==0||L!==0?G+L:ar(v.left,v.right)):R=S-2*(F!==0||W!==0?F+W:ar(v.top,v.bottom))}await d({...t,availableWidth:D,availableHeight:R});const z=await l.getDimensions(u.floating);return O!==z.width||S!==z.height?{reset:{rects:!0}}:{}}}};function Ip(){return typeof window<"u"}function fc(e){return W$(e)?(e.nodeName||"").toLowerCase():"#document"}function sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ja(e){var t;return(t=(W$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function W$(e){return Ip()?e instanceof Node||e instanceof sr(e).Node:!1}function Kr(e){return Ip()?e instanceof Element||e instanceof sr(e).Element:!1}function xa(e){return Ip()?e instanceof HTMLElement||e instanceof sr(e).HTMLElement:!1}function CC(e){return!Ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sr(e).ShadowRoot}const U9=new Set(["inline","contents"]);function Uf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!U9.has(i)}const H9=new Set(["table","td","th"]);function F9(e){return H9.has(fc(e))}const G9=[":popover-open",":modal"];function Lp(e){return G9.some(t=>{try{return e.matches(t)}catch{return!1}})}const V9=["transform","translate","scale","rotate","perspective"],Y9=["transform","translate","scale","rotate","perspective","filter"],W9=["paint","layout","strict","content"];function iO(e){const t=oO(),n=Kr(e)?Xr(e):e;return V9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Y9.some(r=>(n.willChange||"").includes(r))||W9.some(r=>(n.contain||"").includes(r))}function K9(e){let t=eo(e);for(;xa(t)&&!Ml(t);){if(iO(t))return t;if(Lp(t))return null;t=eo(t)}return null}function oO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const X9=new Set(["html","body","#document"]);function Ml(e){return X9.has(fc(e))}function Xr(e){return sr(e).getComputedStyle(e)}function zp(e){return Kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eo(e){if(fc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CC(e)&&e.host||ja(e);return CC(t)?t.host:t}function K$(e){const t=eo(e);return Ml(t)?e.ownerDocument?e.ownerDocument.body:e.body:xa(t)&&Uf(t)?t:K$(t)}function Ku(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=K$(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=sr(i);if(o){const u=J1(l);return t.concat(l,l.visualViewport||[],Uf(i)?i:[],u&&n?Ku(u):[])}return t.concat(i,Ku(i,[],n))}function J1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function X$(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xa(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=im(n)!==o||im(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function sO(e){return Kr(e)?e:e.contextElement}function wl(e){const t=sO(e);if(!xa(t))return ha(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=X$(t);let l=(o?im(n.width):n.width)/r,u=(o?im(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Q9=ha(0);function Q$(e){const t=sr(e);return!oO()||!t.visualViewport?Q9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Z9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sr(e)?!1:t}function Zo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=sO(e);let l=ha(1);t&&(r?Kr(r)&&(l=wl(r)):l=wl(e));const u=Z9(o,n,r)?Q$(o):ha(0);let d=(i.left+u.x)/l.x,h=(i.top+u.y)/l.y,v=i.width/l.x,m=i.height/l.y;if(o){const g=sr(o),b=r&&Kr(r)?sr(r):r;let O=g,S=J1(O);for(;S&&r&&b!==O;){const x=wl(S),E=S.getBoundingClientRect(),N=Xr(S),_=E.left+(S.clientLeft+parseFloat(N.paddingLeft))*x.x,C=E.top+(S.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,h*=x.y,v*=x.x,m*=x.y,d+=_,h+=C,O=sr(S),S=J1(O)}}return sm({width:v,height:m,x:d,y:h})}function Bp(e,t){const n=zp(e).scrollLeft;return t?t.left+n:Zo(ja(e)).left+n}function Z$(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function J9(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ja(r),u=t?Lp(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},h=ha(1);const v=ha(0),m=xa(r);if((m||!m&&!o)&&((fc(r)!=="body"||Uf(l))&&(d=zp(r)),xa(r))){const b=Zo(r);h=wl(r),v.x=b.x+r.clientLeft,v.y=b.y+r.clientTop}const g=l&&!m&&!o?Z$(l,d):ha(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+v.x+g.x,y:n.y*h.y-d.scrollTop*h.y+v.y+g.y}}function eG(e){return Array.from(e.getClientRects())}function tG(e){const t=ja(e),n=zp(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Bp(e);const u=-n.scrollTop;return Xr(r).direction==="rtl"&&(l+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const TC=25;function nG(e,t){const n=sr(e),r=ja(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(i){o=i.width,l=i.height;const v=oO();(!v||v&&t==="fixed")&&(u=i.offsetLeft,d=i.offsetTop)}const h=Bp(r);if(h<=0){const v=r.ownerDocument,m=v.body,g=getComputedStyle(m),b=v.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,O=Math.abs(r.clientWidth-m.clientWidth-b);O<=TC&&(o-=O)}else h<=TC&&(o+=h);return{width:o,height:l,x:u,y:d}}const rG=new Set(["absolute","fixed"]);function aG(e,t){const n=Zo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=xa(e)?wl(e):ha(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=i*o.x,h=r*o.y;return{width:l,height:u,x:d,y:h}}function MC(e,t,n){let r;if(t==="viewport")r=nG(e,n);else if(t==="document")r=tG(ja(e));else if(Kr(t))r=aG(t,n);else{const i=Q$(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sm(r)}function J$(e,t){const n=eo(e);return n===t||!Kr(n)||Ml(n)?!1:Xr(n).position==="fixed"||J$(n,t)}function iG(e,t){const n=t.get(e);if(n)return n;let r=Ku(e,[],!1).filter(u=>Kr(u)&&fc(u)!=="body"),i=null;const o=Xr(e).position==="fixed";let l=o?eo(e):e;for(;Kr(l)&&!Ml(l);){const u=Xr(l),d=iO(l);!d&&u.position==="fixed"&&(i=null),(o?!d&&!i:!d&&u.position==="static"&&!!i&&rG.has(i.position)||Uf(l)&&!d&&J$(e,l))?r=r.filter(v=>v!==l):i=u,l=eo(l)}return t.set(e,r),r}function oG(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Lp(t)?[]:iG(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((h,v)=>{const m=MC(t,v,i);return h.top=ar(m.top,h.top),h.right=Ji(m.right,h.right),h.bottom=Ji(m.bottom,h.bottom),h.left=ar(m.left,h.left),h},MC(t,u,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function sG(e){const{width:t,height:n}=X$(e);return{width:t,height:n}}function lG(e,t,n){const r=xa(t),i=ja(t),o=n==="fixed",l=Zo(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=ha(0);function h(){d.x=Bp(i)}if(r||!r&&!o)if((fc(t)!=="body"||Uf(i))&&(u=zp(t)),r){const b=Zo(t,!0,o,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}else i&&h();o&&!r&&i&&h();const v=i&&!r&&!o?Z$(i,u):ha(0),m=l.left+u.scrollLeft-d.x-v.x,g=l.top+u.scrollTop-d.y-v.y;return{x:m,y:g,width:l.width,height:l.height}}function Mb(e){return Xr(e).position==="static"}function RC(e,t){if(!xa(e)||Xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ja(e)===n&&(n=n.ownerDocument.body),n}function e5(e,t){const n=sr(e);if(Lp(e))return n;if(!xa(e)){let i=eo(e);for(;i&&!Ml(i);){if(Kr(i)&&!Mb(i))return i;i=eo(i)}return n}let r=RC(e,t);for(;r&&F9(r)&&Mb(r);)r=RC(r,t);return r&&Ml(r)&&Mb(r)&&!iO(r)?n:r||K9(e)||n}const cG=async function(e){const t=this.getOffsetParent||e5,n=this.getDimensions,r=await n(e.floating);return{reference:lG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uG(e){return Xr(e).direction==="rtl"}const fG={convertOffsetParentRelativeRectToViewportRelativeRect:J9,getDocumentElement:ja,getClippingRect:oG,getOffsetParent:e5,getElementRects:cG,getClientRects:eG,getDimensions:sG,getScale:wl,isElement:Kr,isRTL:uG};function t5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dG(e,t){let n=null,r;const i=ja(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const h=e.getBoundingClientRect(),{left:v,top:m,width:g,height:b}=h;if(u||t(),!g||!b)return;const O=wh(m),S=wh(i.clientWidth-(v+g)),x=wh(i.clientHeight-(m+b)),E=wh(v),_={rootMargin:-O+"px "+-S+"px "+-x+"px "+-E+"px",threshold:ar(0,Ji(1,d))||1};let C=!0;function A(M){const R=M[0].intersectionRatio;if(R!==d){if(!C)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!t5(h,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(A,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return l(!0),o}function hG(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=sO(e),v=i||o?[...h?Ku(h):[],...Ku(t)]:[];v.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=h&&u?dG(h,n):null;let g=-1,b=null;l&&(b=new ResizeObserver(E=>{let[N]=E;N&&N.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),h&&!d&&b.observe(h),b.observe(t));let O,S=d?Zo(e):null;d&&x();function x(){const E=Zo(e);S&&!t5(S,E)&&n(),S=E,O=requestAnimationFrame(x)}return n(),()=>{var E;v.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),m==null||m(),(E=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(O)}}const mG=L9,pG=z9,vG=k9,gG=q9,yG=$9,DC=P9,bG=B9,xG=(e,t,n)=>{const r=new Map,i={platform:fG,...n},o={...i.platform,_c:r};return D9(e,t,{...i,platform:o})};var wG=typeof document<"u",SG=function(){},Wh=wG?w.useLayoutEffect:SG;function lm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!lm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function n5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PC(e,t){const n=n5(e);return Math.round(t*n)/n}function Rb(e){const t=w.useRef(e);return Wh(()=>{t.current=e}),t}function jG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[v,m]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=w.useState(r);lm(g,r)||b(r);const[O,S]=w.useState(null),[x,E]=w.useState(null),N=w.useCallback(B=>{B!==M.current&&(M.current=B,S(B))},[]),_=w.useCallback(B=>{B!==R.current&&(R.current=B,E(B))},[]),C=o||O,A=l||x,M=w.useRef(null),R=w.useRef(null),D=w.useRef(v),z=d!=null,G=Rb(d),L=Rb(i),F=Rb(h),W=w.useCallback(()=>{if(!M.current||!R.current)return;const B={placement:t,strategy:n,middleware:g};L.current&&(B.platform=L.current),xG(M.current,R.current,B).then(Z=>{const le={...Z,isPositioned:F.current!==!1};Q.current&&!lm(D.current,le)&&(D.current=le,Lf.flushSync(()=>{m(le)}))})},[g,t,n,L,F]);Wh(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(B=>({...B,isPositioned:!1})))},[h]);const Q=w.useRef(!1);Wh(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Wh(()=>{if(C&&(M.current=C),A&&(R.current=A),C&&A){if(G.current)return G.current(C,A,W);W()}},[C,A,W,G,z]);const X=w.useMemo(()=>({reference:M,floating:R,setReference:N,setFloating:_}),[N,_]),k=w.useMemo(()=>({reference:C,floating:A}),[C,A]),H=w.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const Z=PC(k.floating,v.x),le=PC(k.floating,v.y);return u?{...B,transform:"translate("+Z+"px, "+le+"px)",...n5(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:le}},[n,u,k.floating,v.x,v.y]);return w.useMemo(()=>({...v,update:W,refs:X,elements:k,floatingStyles:H}),[v,W,X,k,H])}const OG=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?DC({element:r.current,padding:i}).fn(n):{}:r?DC({element:r,padding:i}).fn(n):{}}}},EG=(e,t)=>({...mG(e),options:[e,t]}),_G=(e,t)=>({...pG(e),options:[e,t]}),NG=(e,t)=>({...bG(e),options:[e,t]}),AG=(e,t)=>({...vG(e),options:[e,t]}),CG=(e,t)=>({...gG(e),options:[e,t]}),TG=(e,t)=>({...yG(e),options:[e,t]}),MG=(e,t)=>({...OG(e),options:[e,t]});var RG="Arrow",r5=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(Ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});r5.displayName=RG;var DG=r5;function qp(e){const[t,n]=w.useState(void 0);return Wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lO="Popper",[a5,io]=jn(lO),[PG,i5]=a5(lO),o5=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return c.jsx(PG,{scope:t,anchor:r,onAnchorChange:i,children:n})};o5.displayName=lO;var s5="PopperAnchor",l5=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=i5(s5,n),l=w.useRef(null),u=Ue(t,l),d=w.useRef(null);return w.useEffect(()=>{const h=d.current;d.current=(r==null?void 0:r.current)||l.current,h!==d.current&&o.onAnchorChange(d.current)}),r?null:c.jsx(Ne.div,{...i,ref:u})});l5.displayName=s5;var cO="PopperContent",[kG,$G]=a5(cO),c5=w.forwardRef((e,t)=>{var ie,pe,re,ve,ge,oe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:b="optimized",onPlaced:O,...S}=e,x=i5(cO,n),[E,N]=w.useState(null),_=Ue(t,ke=>N(ke)),[C,A]=w.useState(null),M=qp(C),R=(M==null?void 0:M.width)??0,D=(M==null?void 0:M.height)??0,z=r+(o!=="center"?"-"+o:""),G=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},L=Array.isArray(h)?h:[h],F=L.length>0,W={padding:G,boundary:L.filter(LG),altBoundary:F},{refs:Q,floatingStyles:X,placement:k,isPositioned:H,middlewareData:B}=jG({strategy:"fixed",placement:z,whileElementsMounted:(...ke)=>hG(...ke,{animationFrame:b==="always"}),elements:{reference:x.anchor},middleware:[EG({mainAxis:i+D,alignmentAxis:l}),d&&_G({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?NG():void 0,...W}),d&&AG({...W}),CG({...W,apply:({elements:ke,rects:we,availableWidth:ze,availableHeight:Ze})=>{const{width:lt,height:tn}=we.reference,pt=ke.floating.style;pt.setProperty("--radix-popper-available-width",`${ze}px`),pt.setProperty("--radix-popper-available-height",`${Ze}px`),pt.setProperty("--radix-popper-anchor-width",`${lt}px`),pt.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),C&&MG({element:C,padding:u}),zG({arrowWidth:R,arrowHeight:D}),g&&TG({strategy:"referenceHidden",...W})]}),[Z,le]=d5(k),$=Wr(O);Wt(()=>{H&&($==null||$())},[H,$]);const Y=(ie=B.arrow)==null?void 0:ie.x,q=(pe=B.arrow)==null?void 0:pe.y,U=((re=B.arrow)==null?void 0:re.centerOffset)!==0,[ne,fe]=w.useState();return Wt(()=>{E&&fe(window.getComputedStyle(E).zIndex)},[E]),c.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:H?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(ve=B.transformOrigin)==null?void 0:ve.x,(ge=B.transformOrigin)==null?void 0:ge.y].join(" "),...((oe=B.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(kG,{scope:n,placedSide:Z,onArrowChange:A,arrowX:Y,arrowY:q,shouldHideArrow:U,children:c.jsx(Ne.div,{"data-side":Z,"data-align":le,...S,ref:_,style:{...S.style,animation:H?void 0:"none"}})})})});c5.displayName=cO;var u5="PopperArrow",IG={top:"bottom",right:"left",bottom:"top",left:"right"},f5=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=$G(u5,r),l=IG[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(DG,{...i,ref:n,style:{...i.style,display:"block"}})})});f5.displayName=u5;function LG(e){return e!==null}var zG=e=>({name:"transformOrigin",options:e,fn(t){var x,E,N;const{placement:n,rects:r,middlewareData:i}=t,l=((x=i.arrow)==null?void 0:x.centerOffset)!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,v]=d5(n),m={start:"0%",center:"50%",end:"100%"}[v],g=(((E=i.arrow)==null?void 0:E.x)??0)+u/2,b=(((N=i.arrow)==null?void 0:N.y)??0)+d/2;let O="",S="";return h==="bottom"?(O=l?m:`${g}px`,S=`${-d}px`):h==="top"?(O=l?m:`${g}px`,S=`${r.floating.height+d}px`):h==="right"?(O=`${-d}px`,S=l?m:`${b}px`):h==="left"&&(O=`${r.floating.width+d}px`,S=l?m:`${b}px`),{data:{x:O,y:S}}}});function d5(e){const[t,n="center"]=e.split("-");return[t,n]}var Up=o5,Hp=l5,Fp=c5,Gp=f5,BG="Portal",dc=w.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=w.useState(!1);Wt(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?c$.createPortal(c.jsx(Ne.div,{...r,ref:t}),l):null});dc.displayName=BG;function qG(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var An=e=>{const{present:t,children:n}=e,r=UG(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Ue(r.ref,HG(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};An.displayName="Presence";function UG(e){const[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),o=w.useRef("none"),l=e?"mounted":"unmounted",[u,d]=qG(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Sh(r.current);o.current=u==="mounted"?h:"none"},[u]),Wt(()=>{const h=r.current,v=i.current;if(v!==e){const g=o.current,b=Sh(h);e?d("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(v&&g!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Wt(()=>{if(t){let h;const v=t.ownerDocument.defaultView??window,m=b=>{const S=Sh(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(d("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",h=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=b=>{b.target===t&&(o.current=Sh(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{v.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Sh(e){return(e==null?void 0:e.animationName)||"none"}function HG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Db="rovingFocusGroup.onEntryFocus",FG={bubbles:!1,cancelable:!0},Hf="RovingFocusGroup",[eS,h5,GG]=kp(Hf),[VG,hc]=jn(Hf,[GG]),[YG,WG]=VG(Hf),m5=w.forwardRef((e,t)=>c.jsx(eS.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(eS.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(KG,{...e,ref:t})})}));m5.displayName=Hf;var KG=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:v=!1,...m}=e,g=w.useRef(null),b=Ue(t,g),O=lc(o),[S,x]=Nn({prop:l,defaultProp:u??null,onChange:d,caller:Hf}),[E,N]=w.useState(!1),_=Wr(h),C=h5(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Db,_),()=>D.removeEventListener(Db,_)},[_]),c.jsx(YG,{scope:n,orientation:r,dir:O,loop:i,currentTabStopId:S,onItemFocus:w.useCallback(D=>x(D),[x]),onItemShiftTab:w.useCallback(()=>N(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[]),children:c.jsx(Ne.div,{tabIndex:E||M===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...e.style},onMouseDown:ye(e.onMouseDown,()=>{A.current=!0}),onFocus:ye(e.onFocus,D=>{const z=!A.current;if(D.target===D.currentTarget&&z&&!E){const G=new CustomEvent(Db,FG);if(D.currentTarget.dispatchEvent(G),!G.defaultPrevented){const L=C().filter(k=>k.focusable),F=L.find(k=>k.active),W=L.find(k=>k.id===S),X=[F,W,...L].filter(Boolean).map(k=>k.ref.current);g5(X,v)}}A.current=!1}),onBlur:ye(e.onBlur,()=>N(!1))})})}),p5="RovingFocusGroupItem",v5=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...u}=e,d=Cr(),h=o||d,v=WG(p5,n),m=v.currentTabStopId===h,g=h5(n),{onFocusableItemAdd:b,onFocusableItemRemove:O,currentTabStopId:S}=v;return w.useEffect(()=>{if(r)return b(),()=>O()},[r,b,O]),c.jsx(eS.ItemSlot,{scope:n,id:h,focusable:r,active:i,children:c.jsx(Ne.span,{tabIndex:m?0:-1,"data-orientation":v.orientation,...u,ref:t,onMouseDown:ye(e.onMouseDown,x=>{r?v.onItemFocus(h):x.preventDefault()}),onFocus:ye(e.onFocus,()=>v.onItemFocus(h)),onKeyDown:ye(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){v.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const E=ZG(x,v.orientation,v.dir);if(E!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")_.reverse();else if(E==="prev"||E==="next"){E==="prev"&&_.reverse();const C=_.indexOf(x.currentTarget);_=v.loop?JG(_,C+1):_.slice(C+1)}setTimeout(()=>g5(_))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:S!=null}):l})})});v5.displayName=p5;var XG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function QG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function ZG(e,t,n){const r=QG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return XG[r]}function g5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function JG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uO=m5,fO=v5,eV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ll=new WeakMap,jh=new WeakMap,Oh={},Pb=0,y5=function(e){return e&&(e.host||y5(e.parentNode))},tV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=y5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},nV=function(e,t,n,r){var i=tV(t,Array.isArray(e)?e:[e]);Oh[n]||(Oh[n]=new WeakMap);var o=Oh[n],l=[],u=new Set,d=new Set(i),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};i.forEach(h);var v=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))v(g);else try{var b=g.getAttribute(r),O=b!==null&&b!=="false",S=(ll.get(g)||0)+1,x=(o.get(g)||0)+1;ll.set(g,S),o.set(g,x),l.push(g),S===1&&O&&jh.set(g,!0),x===1&&g.setAttribute(n,"true"),O||g.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return v(t),u.clear(),Pb++,function(){l.forEach(function(m){var g=ll.get(m)-1,b=o.get(m)-1;ll.set(m,g),o.set(m,b),g||(jh.has(m)||m.removeAttribute(r),jh.delete(m)),b||m.removeAttribute(n)}),Pb--,Pb||(ll=new WeakMap,ll=new WeakMap,jh=new WeakMap,Oh={})}},dO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=eV(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),nV(r,i,n,"aria-hidden")):function(){return null}},ca=function(){return ca=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ca.apply(this,arguments)};function b5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function rV(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Kh="right-scroll-bar-position",Xh="width-before-scroll-bar",aV="with-scroll-bars-hidden",iV="--removed-body-scroll-bar-size";function kb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oV(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var sV=typeof window<"u"?w.useLayoutEffect:w.useEffect,kC=new WeakMap;function lV(e,t){var n=oV(null,function(r){return e.forEach(function(i){return kb(i,r)})});return sV(function(){var r=kC.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||kb(u,null)}),o.forEach(function(u){i.has(u)||kb(u,l)})}kC.set(n,e)},[e]),n}function cV(e){return e}function uV(e,t){t===void 0&&(t=cV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var d=function(){var v=l;l=[],v.forEach(o)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(v){l.push(v),h()},filter:function(v){return l=l.filter(v),n}}}};return i}function fV(e){e===void 0&&(e={});var t=uV(null);return t.options=ca({async:!0,ssr:!1},e),t}var x5=function(e){var t=e.sideCar,n=b5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,ca({},n))};x5.isSideCarExport=!0;function dV(e,t){return e.useMedium(t),x5}var w5=fV(),$b=function(){},Vp=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:$b,onWheelCapture:$b,onTouchMoveCapture:$b}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,d=e.className,h=e.removeScrollBar,v=e.enabled,m=e.shards,g=e.sideCar,b=e.noRelative,O=e.noIsolation,S=e.inert,x=e.allowPinchZoom,E=e.as,N=E===void 0?"div":E,_=e.gapMode,C=b5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,M=lV([n,t]),R=ca(ca({},C),i);return w.createElement(w.Fragment,null,v&&w.createElement(A,{sideCar:w5,removeScrollBar:h,shards:m,noRelative:b,noIsolation:O,inert:S,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:_}),l?w.cloneElement(w.Children.only(u),ca(ca({},R),{ref:M})):w.createElement(N,ca({},R,{className:d,ref:M}),u))});Vp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vp.classNames={fullWidth:Xh,zeroRight:Kh};var hV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=hV();return t&&e.setAttribute("nonce",t),e}function pV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mV())&&(pV(t,n),vV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yV=function(){var e=gV();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},S5=function(){var e=yV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},bV={left:0,top:0,right:0,gap:0},Ib=function(e){return parseInt(e||"",10)||0},xV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ib(n),Ib(r),Ib(i)]},wV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return bV;var t=xV(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},SV=S5(),Sl="data-scroll-locked",jV=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
374
|
-
.`.concat(
|
|
373
|
+
*/var oC;function XF(){if(oC)return Eb;oC=1;var e=Tp();function t(m,g){return m===g&&(m!==0||1/m===1/g)||m!==m&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(m,g){var b=g(),O=r({inst:{value:b,getSnapshot:g}}),S=O[0].inst,x=O[1];return o(function(){S.value=b,S.getSnapshot=g,d(S)&&x({inst:S})},[m,b,g]),i(function(){return d(S)&&x({inst:S}),m(function(){d(S)&&x({inst:S})})},[m]),l(b),b}function d(m){var g=m.getSnapshot;m=m.value;try{var b=g();return!n(m,b)}catch{return!0}}function h(m,g){return g()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Eb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Eb}var sC;function QF(){return sC||(sC=1,Ob.exports=XF()),Ob.exports}var ZF=QF();function JF(){return ZF.useSyncExternalStore(e7,()=>!0,()=>!1)}function e7(){return()=>{}}var Jj="Avatar",[t7]=x$(Jj),[n7,j$]=t7(Jj),O$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=w.useState("idle");return c.jsx(n7,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:c.jsx(ls.span,{...r,ref:t})})});O$.displayName=Jj;var E$="AvatarImage",_$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,l=j$(E$,n),u=r7(r,o),d=Wr(h=>{i(h),l.onImageLoadingStatusChange(h)});return Wt(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?c.jsx(ls.img,{...o,ref:t,src:r}):null});_$.displayName=E$;var N$="AvatarFallback",A$=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=j$(N$,n),[l,u]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const d=window.setTimeout(()=>u(!0),r);return()=>window.clearTimeout(d)}},[r]),l&&o.imageLoadingStatus!=="loaded"?c.jsx(ls.span,{...i,ref:t}):null});A$.displayName=N$;function lC(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function r7(e,{referrerPolicy:t,crossOrigin:n}){const r=JF(),i=w.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[l,u]=w.useState(()=>lC(o,e));return Wt(()=>{u(lC(o,e))},[o,e]),Wt(()=>{const d=m=>()=>{u(m)};if(!o)return;const h=d("loaded"),v=d("error");return o.addEventListener("load",h),o.addEventListener("error",v),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",h),o.removeEventListener("error",v)}},[o,n,t]),l}var a7=O$,i7=_$,o7=A$;function C$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=C$(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=C$(e))&&(r&&(r+=" "),r+=t);return r}const s7=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},l7=(e,t)=>({classGroupId:e,validator:t}),T$=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),am="-",cC=[],c7="arbitrary..",u7=e=>{const t=d7(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return f7(l);const u=l.split(am),d=u[0]===""&&u.length>1?1:0;return M$(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?s7(h,d):d:h||cC}return n[l]||cC}}},M$=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const h=M$(e,t+1,o);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(am):e.slice(t).join(am),d=l.length;for(let h=0;h<d;h++){const v=l[h];if(v.validator(u))return v.classGroupId}},f7=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?c7+r:void 0})(),d7=e=>{const{theme:t,classGroups:n}=e;return h7(n,t)},h7=(e,t)=>{const n=T$();for(const r in e){const i=e[r];eO(i,n,r,t)}return n},eO=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const l=e[o];m7(l,t,n,r)}},m7=(e,t,n,r)=>{if(typeof e=="string"){p7(e,t,n);return}if(typeof e=="function"){v7(e,t,n,r);return}g7(e,t,n,r)},p7=(e,t,n)=>{const r=e===""?t:R$(t,e);r.classGroupId=n},v7=(e,t,n,r)=>{if(y7(e)){eO(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(l7(n,e))},g7=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let l=0;l<o;l++){const[u,d]=i[l];eO(d,R$(t,u),n,r)}},R$=(e,t)=>{let n=e;const r=t.split(am),i=r.length;for(let o=0;o<i;o++){const l=r[o];let u=n.nextPart.get(l);u||(u=T$(),n.nextPart.set(l,u)),n=u}return n},y7=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,b7=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return i(o,l),l},set(o,l){o in n?n[o]=l:i(o,l)}}},K1="!",uC=":",x7=[],fC=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),w7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let l=0,u=0,d=0,h;const v=i.length;for(let S=0;S<v;S++){const x=i[S];if(l===0&&u===0){if(x===uC){o.push(i.slice(d,S)),d=S+1;continue}if(x==="/"){h=S;continue}}x==="["?l++:x==="]"?l--:x==="("?u++:x===")"&&u--}const m=o.length===0?i:i.slice(d);let g=m,b=!1;m.endsWith(K1)?(g=m.slice(0,-1),b=!0):m.startsWith(K1)&&(g=m.slice(1),b=!0);const O=h&&h>d?h-d:void 0;return fC(o,b,g,O)};if(t){const i=t+uC,o=r;r=l=>l.startsWith(i)?o(l.slice(i.length)):fC(x7,!1,l,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},S7=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const l=n[o],u=l[0]==="[",d=t.has(l);u||d?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(l)):i.push(l)}return i.length>0&&(i.sort(),r.push(...i)),r}},j7=e=>({cache:b7(e.cacheSize),parseClassName:w7(e),sortModifiers:S7(e),...u7(e)}),O7=/\s+/,E7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,l=[],u=e.trim().split(O7);let d="";for(let h=u.length-1;h>=0;h-=1){const v=u[h],{isExternal:m,modifiers:g,hasImportantModifier:b,baseClassName:O,maybePostfixModifierPosition:S}=n(v);if(m){d=v+(d.length>0?" "+d:d);continue}let x=!!S,E=r(x?O.substring(0,S):O);if(!E){if(!x){d=v+(d.length>0?" "+d:d);continue}if(E=r(O),!E){d=v+(d.length>0?" "+d:d);continue}x=!1}const N=g.length===0?"":g.length===1?g[0]:o(g).join(":"),_=b?N+K1:N,C=_+E;if(l.indexOf(C)>-1)continue;l.push(C);const A=i(E,x);for(let M=0;M<A.length;++M){const R=A[M];l.push(_+R)}d=v+(d.length>0?" "+d:d)}return d},_7=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=D$(n))&&(i&&(i+=" "),i+=r);return i},D$=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=D$(e[r]))&&(n&&(n+=" "),n+=t);return n},N7=(e,...t)=>{let n,r,i,o;const l=d=>{const h=t.reduce((v,m)=>m(v),e());return n=j7(h),r=n.cache.get,i=n.cache.set,o=u,u(d)},u=d=>{const h=r(d);if(h)return h;const v=E7(d,n);return i(d,v),v};return o=l,(...d)=>o(_7(...d))},A7=[],Xt=e=>{const t=n=>n[e]||A7;return t.isThemeGetter=!0,t},P$=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,k$=/^\((?:(\w[\w-]*):)?(.+)\)$/i,C7=/^\d+\/\d+$/,T7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,M7=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,D7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,sl=e=>C7.test(e),Ve=e=>!!e&&!Number.isNaN(Number(e)),Ui=e=>!!e&&Number.isInteger(Number(e)),_b=e=>e.endsWith("%")&&Ve(e.slice(0,-1)),Fa=e=>T7.test(e),k7=()=>!0,$7=e=>M7.test(e)&&!R7.test(e),$$=()=>!1,I7=e=>D7.test(e),L7=e=>P7.test(e),z7=e=>!je(e)&&!Oe(e),B7=e=>oc(e,z$,$$),je=e=>P$.test(e),Lo=e=>oc(e,B$,$7),Nb=e=>oc(e,G7,Ve),dC=e=>oc(e,I$,$$),q7=e=>oc(e,L$,L7),bh=e=>oc(e,q$,I7),Oe=e=>k$.test(e),xu=e=>sc(e,B$),U7=e=>sc(e,V7),hC=e=>sc(e,I$),H7=e=>sc(e,z$),F7=e=>sc(e,L$),xh=e=>sc(e,q$,!0),oc=(e,t,n)=>{const r=P$.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},sc=(e,t,n=!1)=>{const r=k$.exec(e);return r?r[1]?t(r[1]):n:!1},I$=e=>e==="position"||e==="percentage",L$=e=>e==="image"||e==="url",z$=e=>e==="length"||e==="size"||e==="bg-size",B$=e=>e==="length",G7=e=>e==="number",V7=e=>e==="family-name",q$=e=>e==="shadow",Y7=()=>{const e=Xt("color"),t=Xt("font"),n=Xt("text"),r=Xt("font-weight"),i=Xt("tracking"),o=Xt("leading"),l=Xt("breakpoint"),u=Xt("container"),d=Xt("spacing"),h=Xt("radius"),v=Xt("shadow"),m=Xt("inset-shadow"),g=Xt("text-shadow"),b=Xt("drop-shadow"),O=Xt("blur"),S=Xt("perspective"),x=Xt("aspect"),E=Xt("ease"),N=Xt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],C=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...C(),Oe,je],M=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],D=()=>[Oe,je,d],z=()=>[sl,"full","auto",...D()],G=()=>[Ui,"none","subgrid",Oe,je],L=()=>["auto",{span:["full",Ui,Oe,je]},Ui,Oe,je],F=()=>[Ui,"auto",Oe,je],W=()=>["auto","min","max","fr",Oe,je],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...D()],H=()=>[sl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],B=()=>[e,Oe,je],Z=()=>[...C(),hC,dC,{position:[Oe,je]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],$=()=>["auto","cover","contain",H7,B7,{size:[Oe,je]}],Y=()=>[_b,xu,Lo],q=()=>["","none","full",h,Oe,je],U=()=>["",Ve,xu,Lo],ne=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Ve,_b,hC,dC],pe=()=>["","none",O,Oe,je],re=()=>["none",Ve,Oe,je],ve=()=>["none",Ve,Oe,je],ge=()=>[Ve,Oe,je],oe=()=>[sl,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fa],breakpoint:[Fa],color:[k7],container:[Fa],"drop-shadow":[Fa],ease:["in","out","in-out"],font:[z7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fa],shadow:[Fa],spacing:["px",Ve],text:[Fa],"text-shadow":[Fa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",sl,je,Oe,x]}],container:["container"],columns:[{columns:[Ve,je,Oe,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[Ui,"auto",Oe,je]}],basis:[{basis:[sl,"full","auto",u,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ve,sl,"auto","initial","none",je]}],grow:[{grow:["",Ve,Oe,je]}],shrink:[{shrink:["",Ve,Oe,je]}],order:[{order:[Ui,"first","last","none",Oe,je]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[u,"screen",...H()]}],"min-w":[{"min-w":[u,"screen","none",...H()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,xu,Lo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Oe,Nb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_b,je]}],"font-family":[{font:[U7,je,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Oe,je]}],"line-clamp":[{"line-clamp":[Ve,"none",Oe,Nb]}],leading:[{leading:[o,...D()]}],"list-image":[{"list-image":["none",Oe,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Oe,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ve,"from-font","auto",Oe,Lo]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Ve,"auto",Oe,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Oe,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Oe,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:$()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ui,Oe,je],radial:["",Oe,je],conic:[Ui,Oe,je]},F7,q7]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:q()}],"rounded-s":[{"rounded-s":q()}],"rounded-e":[{"rounded-e":q()}],"rounded-t":[{"rounded-t":q()}],"rounded-r":[{"rounded-r":q()}],"rounded-b":[{"rounded-b":q()}],"rounded-l":[{"rounded-l":q()}],"rounded-ss":[{"rounded-ss":q()}],"rounded-se":[{"rounded-se":q()}],"rounded-ee":[{"rounded-ee":q()}],"rounded-es":[{"rounded-es":q()}],"rounded-tl":[{"rounded-tl":q()}],"rounded-tr":[{"rounded-tr":q()}],"rounded-br":[{"rounded-br":q()}],"rounded-bl":[{"rounded-bl":q()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ve,Oe,je]}],"outline-w":[{outline:["",Ve,xu,Lo]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",v,xh,bh]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",m,xh,bh]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Ve,Lo]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",g,xh,bh]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Ve,Oe,je]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ve]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Oe,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":C()}],"mask-image-conic-pos":[{"mask-conic":[Ve]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:$()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Oe,je]}],filter:[{filter:["","none",Oe,je]}],blur:[{blur:pe()}],brightness:[{brightness:[Ve,Oe,je]}],contrast:[{contrast:[Ve,Oe,je]}],"drop-shadow":[{"drop-shadow":["","none",b,xh,bh]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Ve,Oe,je]}],"hue-rotate":[{"hue-rotate":[Ve,Oe,je]}],invert:[{invert:["",Ve,Oe,je]}],saturate:[{saturate:[Ve,Oe,je]}],sepia:[{sepia:["",Ve,Oe,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Oe,je]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ve,Oe,je]}],"backdrop-contrast":[{"backdrop-contrast":[Ve,Oe,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ve,Oe,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ve,Oe,je]}],"backdrop-invert":[{"backdrop-invert":["",Ve,Oe,je]}],"backdrop-opacity":[{"backdrop-opacity":[Ve,Oe,je]}],"backdrop-saturate":[{"backdrop-saturate":[Ve,Oe,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Ve,Oe,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Oe,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ve,"initial",Oe,je]}],ease:[{ease:["linear","initial",E,Oe,je]}],delay:[{delay:[Ve,Oe,je]}],animate:[{animate:["none",N,Oe,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Oe,je]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Oe,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Oe,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Oe,je]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Ve,xu,Lo,Nb]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},W7=N7(Y7);function me(...e){return W7(rt(e))}function mC({className:e,...t}){return c.jsx(a7,{className:me("relative flex size-8 shrink-0 overflow-hidden rounded-full",e),"data-slot":"avatar",...t})}function pC({className:e,...t}){return c.jsx(i7,{className:me("aspect-square size-full",e),"data-slot":"avatar-image",...t})}function vC({className:e,...t}){return c.jsx(o7,{className:me("flex size-full items-center justify-center rounded-full bg-muted",e),"data-slot":"avatar-fallback",...t})}function ye(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function K7(e,t){const n=w.createContext(t),r=o=>{const{children:l,...u}=o,d=w.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function i(o){const l=w.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function jn(e,t=[]){let n=[];function r(o,l){const u=w.createContext(l),d=n.length;n=[...n,l];const h=m=>{var E;const{scope:g,children:b,...O}=m,S=((E=g==null?void 0:g[e])==null?void 0:E[d])||u,x=w.useMemo(()=>O,Object.values(O));return c.jsx(S.Provider,{value:x,children:b})};h.displayName=o+"Provider";function v(m,g){var S;const b=((S=g==null?void 0:g[e])==null?void 0:S[d])||u,O=w.useContext(b);if(O)return O;if(l!==void 0)return l;throw new Error(`\`${m}\` must be used within \`${o}\``)}return[h,v]}const i=()=>{const o=n.map(l=>w.createContext(l));return function(u){const d=(u==null?void 0:u[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return i.scopeName=e,[r,X7(i,...t)]}function X7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const m=d(o)[`__scope${h}`];return{...u,...m}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}var Q7=Bj[" useInsertionEffect ".trim().toString()]||Wt;function Nn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,l]=Z7({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:i;{const v=w.useRef(e!==void 0);w.useEffect(()=>{const m=v.current;m!==u&&console.warn(`${r} is changing from ${m?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=u},[u,r])}const h=w.useCallback(v=>{var m;if(u){const g=J7(v)?v(e):v;g!==e&&((m=l.current)==null||m.call(l,g))}else o(v)},[u,e,o,l]);return[d,h]}function Z7({defaultProp:e,onChange:t}){const[n,r]=w.useState(e),i=w.useRef(n),o=w.useRef(t);return Q7(()=>{o.current=t},[t]),w.useEffect(()=>{var l;i.current!==n&&((l=o.current)==null||l.call(o,n),i.current=n)},[n,i]),[n,r,o]}function J7(e){return typeof e=="function"}function Tl(e){const t=e9(e),n=w.forwardRef((r,i)=>{const{children:o,...l}=r,u=w.Children.toArray(o),d=u.find(t9);if(d){const h=d.props.children,v=u.map(m=>m===d?w.Children.count(h)>1?w.Children.only(null):w.isValidElement(h)?h.props.children:null:m);return c.jsx(t,{...l,ref:i,children:w.isValidElement(h)?w.cloneElement(h,void 0,v):null})}return c.jsx(t,{...l,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function e9(e){const t=w.forwardRef((n,r)=>{const{children:i,...o}=n;if(w.isValidElement(i)){const l=r9(i),u=n9(o,i.props);return i.type!==w.Fragment&&(u.ref=r?qf(r,l):l),w.cloneElement(i,u)}return w.Children.count(i)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var U$=Symbol("radix.slottable");function H$(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=U$,t}function t9(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===U$}function n9(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...u)=>{const d=o(...u);return i(...u),d}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function r9(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var a9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=a9.reduce((e,t)=>{const n=Tl(`Primitive.${t}`),r=w.forwardRef((i,o)=>{const{asChild:l,...u}=i,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function F$(e,t){e&&Lf.flushSync(()=>e.dispatchEvent(t))}function kp(e){const t=e+"CollectionProvider",[n,r]=jn(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:x,children:E}=S,N=I.useRef(null),_=I.useRef(new Map).current;return c.jsx(i,{scope:x,itemMap:_,collectionRef:N,children:E})};l.displayName=t;const u=e+"CollectionSlot",d=Tl(u),h=I.forwardRef((S,x)=>{const{scope:E,children:N}=S,_=o(u,E),C=Ue(x,_.collectionRef);return c.jsx(d,{ref:C,children:N})});h.displayName=u;const v=e+"CollectionItemSlot",m="data-radix-collection-item",g=Tl(v),b=I.forwardRef((S,x)=>{const{scope:E,children:N,..._}=S,C=I.useRef(null),A=Ue(x,C),M=o(v,E);return I.useEffect(()=>(M.itemMap.set(C,{ref:C,..._}),()=>void M.itemMap.delete(C))),c.jsx(g,{[m]:"",ref:A,children:N})});b.displayName=v;function O(S){const x=o(e+"CollectionConsumer",S);return I.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const _=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((M,R)=>_.indexOf(M.ref.current)-_.indexOf(R.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:h,ItemSlot:b},O,r]}var i9=w.createContext(void 0);function lc(e){const t=w.useContext(i9);return e||t||"ltr"}function o9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var s9="DismissableLayer",X1="dismissableLayer.update",l9="dismissableLayer.pointerDownOutside",c9="dismissableLayer.focusOutside",gC,G$=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,h=w.useContext(G$),[v,m]=w.useState(null),g=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=w.useState({}),O=Ue(t,R=>m(R)),S=Array.from(h.layers),[x]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(x),N=v?S.indexOf(v):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,C=N>=E,A=d9(R=>{const D=R.target,z=[...h.branches].some(G=>G.contains(D));!C||z||(i==null||i(R),l==null||l(R),R.defaultPrevented||u==null||u())},g),M=h9(R=>{const D=R.target;[...h.branches].some(G=>G.contains(D))||(o==null||o(R),l==null||l(R),R.defaultPrevented||u==null||u())},g);return o9(R=>{N===h.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},g),w.useEffect(()=>{if(v)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(gC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(v)),h.layers.add(v),yC(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=gC)}},[v,g,n,h]),w.useEffect(()=>()=>{v&&(h.layers.delete(v),h.layersWithOutsidePointerEventsDisabled.delete(v),yC())},[v,h]),w.useEffect(()=>{const R=()=>b({});return document.addEventListener(X1,R),()=>document.removeEventListener(X1,R)},[]),c.jsx(Ne.div,{...d,ref:O,style:{pointerEvents:_?C?"auto":"none":void 0,...e.style},onFocusCapture:ye(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ye(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ye(e.onPointerDownCapture,A.onPointerDownCapture)})});cc.displayName=s9;var u9="DismissableLayerBranch",f9=w.forwardRef((e,t)=>{const n=w.useContext(G$),r=w.useRef(null),i=Ue(t,r);return w.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(Ne.div,{...e,ref:i})});f9.displayName=u9;function d9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){V$(l9,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=d,t.addEventListener("click",i.current,{once:!0})):d()}else t.removeEventListener("click",i.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function h9(e,t=globalThis==null?void 0:globalThis.document){const n=Wr(e),r=w.useRef(!1);return w.useEffect(()=>{const i=o=>{o.target&&!r.current&&V$(c9,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function yC(){const e=new CustomEvent(X1);document.dispatchEvent(e)}function V$(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?F$(i,o):i.dispatchEvent(o)}var Ab=0;function tO(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??bC()),document.body.insertAdjacentElement("beforeend",e[1]??bC()),Ab++,()=>{Ab===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Ab--}},[])}function bC(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Cb="focusScope.autoFocusOnMount",Tb="focusScope.autoFocusOnUnmount",xC={bubbles:!1,cancelable:!0},m9="FocusScope",$p=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...l}=e,[u,d]=w.useState(null),h=Wr(i),v=Wr(o),m=w.useRef(null),g=Ue(t,S=>d(S)),b=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let S=function(_){if(b.paused||!u)return;const C=_.target;u.contains(C)?m.current=C:Gi(m.current,{select:!0})},x=function(_){if(b.paused||!u)return;const C=_.relatedTarget;C!==null&&(u.contains(C)||Gi(m.current,{select:!0}))},E=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&Gi(u)};document.addEventListener("focusin",S),document.addEventListener("focusout",x);const N=new MutationObserver(E);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",x),N.disconnect()}}},[r,u,b.paused]),w.useEffect(()=>{if(u){SC.add(b);const S=document.activeElement;if(!u.contains(S)){const E=new CustomEvent(Cb,xC);u.addEventListener(Cb,h),u.dispatchEvent(E),E.defaultPrevented||(p9(x9(Y$(u)),{select:!0}),document.activeElement===S&&Gi(u))}return()=>{u.removeEventListener(Cb,h),setTimeout(()=>{const E=new CustomEvent(Tb,xC);u.addEventListener(Tb,v),u.dispatchEvent(E),E.defaultPrevented||Gi(S??document.body,{select:!0}),u.removeEventListener(Tb,v),SC.remove(b)},0)}}},[u,h,v,b]);const O=w.useCallback(S=>{if(!n&&!r||b.paused)return;const x=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,E=document.activeElement;if(x&&E){const N=S.currentTarget,[_,C]=v9(N);_&&C?!S.shiftKey&&E===C?(S.preventDefault(),n&&Gi(_,{select:!0})):S.shiftKey&&E===_&&(S.preventDefault(),n&&Gi(C,{select:!0})):E===N&&S.preventDefault()}},[n,r,b.paused]);return c.jsx(Ne.div,{tabIndex:-1,...l,ref:g,onKeyDown:O})});$p.displayName=m9;function p9(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Gi(r,{select:t}),document.activeElement!==n)return}function v9(e){const t=Y$(e),n=wC(t,e),r=wC(t.reverse(),e);return[n,r]}function Y$(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wC(e,t){for(const n of e)if(!g9(n,{upTo:t}))return n}function g9(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function y9(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&y9(e)&&t&&e.select()}}var SC=b9();function b9(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=jC(e,t),e.unshift(t)},remove(t){var n;e=jC(e,t),(n=e[0])==null||n.resume()}}}function jC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function x9(e){return e.filter(t=>t.tagName!=="A")}var w9=Bj[" useId ".trim().toString()]||(()=>{}),S9=0;function Cr(e){const[t,n]=w.useState(w9());return Wt(()=>{n(r=>r??String(S9++))},[e]),e||(t?`radix-${t}`:"")}const j9=["top","right","bottom","left"],Ji=Math.min,ar=Math.max,im=Math.round,wh=Math.floor,ha=e=>({x:e,y:e}),O9={left:"right",right:"left",bottom:"top",top:"bottom"},E9={start:"end",end:"start"};function Q1(e,t,n){return ar(e,Ji(t,n))}function ai(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function uc(e){return e.split("-")[1]}function nO(e){return e==="x"?"y":"x"}function rO(e){return e==="y"?"height":"width"}const _9=new Set(["top","bottom"]);function ua(e){return _9.has(ii(e))?"y":"x"}function aO(e){return nO(ua(e))}function N9(e,t,n){n===void 0&&(n=!1);const r=uc(e),i=aO(e),o=rO(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=om(l)),[l,om(l)]}function A9(e){const t=om(e);return[Z1(e),t,Z1(t)]}function Z1(e){return e.replace(/start|end/g,t=>E9[t])}const OC=["left","right"],EC=["right","left"],C9=["top","bottom"],T9=["bottom","top"];function M9(e,t,n){switch(e){case"top":case"bottom":return n?t?EC:OC:t?OC:EC;case"left":case"right":return t?C9:T9;default:return[]}}function R9(e,t,n,r){const i=uc(e);let o=M9(ii(e),n==="start",r);return i&&(o=o.map(l=>l+"-"+i),t&&(o=o.concat(o.map(Z1)))),o}function om(e){return e.replace(/left|right|bottom|top/g,t=>O9[t])}function D9(e){return{top:0,right:0,bottom:0,left:0,...e}}function W$(e){return typeof e!="number"?D9(e):{top:e,right:e,bottom:e,left:e}}function sm(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _C(e,t,n){let{reference:r,floating:i}=e;const o=ua(t),l=aO(t),u=rO(l),d=ii(t),h=o==="y",v=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,g=r[u]/2-i[u]/2;let b;switch(d){case"top":b={x:v,y:r.y-i.height};break;case"bottom":b={x:v,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:m};break;case"left":b={x:r.x-i.width,y:m};break;default:b={x:r.x,y:r.y}}switch(uc(t)){case"start":b[l]-=g*(n&&h?-1:1);break;case"end":b[l]+=g*(n&&h?-1:1);break}return b}const P9=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:v,y:m}=_C(h,r,d),g=r,b={},O=0;for(let S=0;S<u.length;S++){const{name:x,fn:E}=u[S],{x:N,y:_,data:C,reset:A}=await E({x:v,y:m,initialPlacement:r,placement:g,strategy:i,middlewareData:b,rects:h,platform:l,elements:{reference:e,floating:t}});v=N??v,m=_??m,b={...b,[x]:{...b[x],...C}},A&&O<=50&&(O++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(h=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:v,y:m}=_C(h,g,d)),S=-1)}return{x:v,y:m,placement:g,strategy:i,middlewareData:b}};async function Wu(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:l,elements:u,strategy:d}=e,{boundary:h="clippingAncestors",rootBoundary:v="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=ai(t,e),O=W$(b),x=u[g?m==="floating"?"reference":"floating":m],E=sm(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:h,rootBoundary:v,strategy:d})),N=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),C=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},A=sm(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:N,offsetParent:_,strategy:d}):N);return{top:(E.top-A.top+O.top)/C.y,bottom:(A.bottom-E.bottom+O.bottom)/C.y,left:(E.left-A.left+O.left)/C.x,right:(A.right-E.right+O.right)/C.x}}const k9=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:v=0}=ai(e,t)||{};if(h==null)return{};const m=W$(v),g={x:n,y:r},b=aO(i),O=rO(b),S=await l.getDimensions(h),x=b==="y",E=x?"top":"left",N=x?"bottom":"right",_=x?"clientHeight":"clientWidth",C=o.reference[O]+o.reference[b]-g[b]-o.floating[O],A=g[b]-o.reference[b],M=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let R=M?M[_]:0;(!R||!await(l.isElement==null?void 0:l.isElement(M)))&&(R=u.floating[_]||o.floating[O]);const D=C/2-A/2,z=R/2-S[O]/2-1,G=Ji(m[E],z),L=Ji(m[N],z),F=G,W=R-S[O]-L,Q=R/2-S[O]/2+D,X=Q1(F,Q,W),k=!d.arrow&&uc(i)!=null&&Q!==X&&o.reference[O]/2-(Q<F?G:L)-S[O]/2<0,H=k?Q<F?Q-F:Q-W:0;return{[b]:g[b]+H,data:{[b]:X,centerOffset:Q-X-H,...k&&{alignmentOffset:H}},reset:k}}}),$9=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:l,initialPlacement:u,platform:d,elements:h}=t,{mainAxis:v=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:O="none",flipAlignment:S=!0,...x}=ai(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=ii(i),N=ua(u),_=ii(u)===u,C=await(d.isRTL==null?void 0:d.isRTL(h.floating)),A=g||(_||!S?[om(u)]:A9(u)),M=O!=="none";!g&&M&&A.push(...R9(u,S,O,C));const R=[u,...A],D=await Wu(t,x),z=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(v&&z.push(D[E]),m){const Q=N9(i,l,C);z.push(D[Q[0]],D[Q[1]])}if(G=[...G,{placement:i,overflows:z}],!z.every(Q=>Q<=0)){var L,F;const Q=(((L=o.flip)==null?void 0:L.index)||0)+1,X=R[Q];if(X&&(!(m==="alignment"?N!==ua(X):!1)||G.every(B=>ua(B.placement)===N?B.overflows[0]>0:!0)))return{data:{index:Q,overflows:G},reset:{placement:X}};let k=(F=G.filter(H=>H.overflows[0]<=0).sort((H,B)=>H.overflows[1]-B.overflows[1])[0])==null?void 0:F.placement;if(!k)switch(b){case"bestFit":{var W;const H=(W=G.filter(B=>{if(M){const Z=ua(B.placement);return Z===N||Z==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(Z=>Z>0).reduce((Z,le)=>Z+le,0)]).sort((B,Z)=>B[1]-Z[1])[0])==null?void 0:W[0];H&&(k=H);break}case"initialPlacement":k=u;break}if(i!==k)return{reset:{placement:k}}}return{}}}};function NC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AC(e){return j9.some(t=>e[t]>=0)}const I9=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=ai(e,t);switch(r){case"referenceHidden":{const o=await Wu(t,{...i,elementContext:"reference"}),l=NC(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:AC(l)}}}case"escaped":{const o=await Wu(t,{...i,altBoundary:!0}),l=NC(o,n.floating);return{data:{escapedOffsets:l,escaped:AC(l)}}}default:return{}}}}},K$=new Set(["left","top"]);async function L9(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=ii(n),u=uc(n),d=ua(n)==="y",h=K$.has(l)?-1:1,v=o&&d?-1:1,m=ai(t,e);let{mainAxis:g,crossAxis:b,alignmentAxis:O}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof O=="number"&&(b=u==="end"?O*-1:O),d?{x:b*v,y:g*h}:{x:g*h,y:b*v}}const z9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:l,middlewareData:u}=t,d=await L9(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:o+d.y,data:{...d,placement:l}}}}},B9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:x=>{let{x:E,y:N}=x;return{x:E,y:N}}},...d}=ai(e,t),h={x:n,y:r},v=await Wu(t,d),m=ua(ii(i)),g=nO(m);let b=h[g],O=h[m];if(o){const x=g==="y"?"top":"left",E=g==="y"?"bottom":"right",N=b+v[x],_=b-v[E];b=Q1(N,b,_)}if(l){const x=m==="y"?"top":"left",E=m==="y"?"bottom":"right",N=O+v[x],_=O-v[E];O=Q1(N,O,_)}const S=u.fn({...t,[g]:b,[m]:O});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[g]:o,[m]:l}}}}}},q9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=ai(e,t),v={x:n,y:r},m=ua(i),g=nO(m);let b=v[g],O=v[m];const S=ai(u,t),x=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(d){const _=g==="y"?"height":"width",C=o.reference[g]-o.floating[_]+x.mainAxis,A=o.reference[g]+o.reference[_]-x.mainAxis;b<C?b=C:b>A&&(b=A)}if(h){var E,N;const _=g==="y"?"width":"height",C=K$.has(ii(i)),A=o.reference[m]-o.floating[_]+(C&&((E=l.offset)==null?void 0:E[m])||0)+(C?0:x.crossAxis),M=o.reference[m]+o.reference[_]+(C?0:((N=l.offset)==null?void 0:N[m])||0)-(C?x.crossAxis:0);O<A?O=A:O>M&&(O=M)}return{[g]:b,[m]:O}}}},U9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...h}=ai(e,t),v=await Wu(t,h),m=ii(i),g=uc(i),b=ua(i)==="y",{width:O,height:S}=o.floating;let x,E;m==="top"||m==="bottom"?(x=m,E=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(E=m,x=g==="end"?"top":"bottom");const N=S-v.top-v.bottom,_=O-v.left-v.right,C=Ji(S-v[x],N),A=Ji(O-v[E],_),M=!t.middlewareData.shift;let R=C,D=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=N),M&&!g){const G=ar(v.left,0),L=ar(v.right,0),F=ar(v.top,0),W=ar(v.bottom,0);b?D=O-2*(G!==0||L!==0?G+L:ar(v.left,v.right)):R=S-2*(F!==0||W!==0?F+W:ar(v.top,v.bottom))}await d({...t,availableWidth:D,availableHeight:R});const z=await l.getDimensions(u.floating);return O!==z.width||S!==z.height?{reset:{rects:!0}}:{}}}};function Ip(){return typeof window<"u"}function fc(e){return X$(e)?(e.nodeName||"").toLowerCase():"#document"}function sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ja(e){var t;return(t=(X$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function X$(e){return Ip()?e instanceof Node||e instanceof sr(e).Node:!1}function Kr(e){return Ip()?e instanceof Element||e instanceof sr(e).Element:!1}function xa(e){return Ip()?e instanceof HTMLElement||e instanceof sr(e).HTMLElement:!1}function CC(e){return!Ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof sr(e).ShadowRoot}const H9=new Set(["inline","contents"]);function Uf(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!H9.has(i)}const F9=new Set(["table","td","th"]);function G9(e){return F9.has(fc(e))}const V9=[":popover-open",":modal"];function Lp(e){return V9.some(t=>{try{return e.matches(t)}catch{return!1}})}const Y9=["transform","translate","scale","rotate","perspective"],W9=["transform","translate","scale","rotate","perspective","filter"],K9=["paint","layout","strict","content"];function iO(e){const t=oO(),n=Kr(e)?Xr(e):e;return Y9.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||W9.some(r=>(n.willChange||"").includes(r))||K9.some(r=>(n.contain||"").includes(r))}function X9(e){let t=eo(e);for(;xa(t)&&!Ml(t);){if(iO(t))return t;if(Lp(t))return null;t=eo(t)}return null}function oO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Q9=new Set(["html","body","#document"]);function Ml(e){return Q9.has(fc(e))}function Xr(e){return sr(e).getComputedStyle(e)}function zp(e){return Kr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eo(e){if(fc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||CC(e)&&e.host||ja(e);return CC(t)?t.host:t}function Q$(e){const t=eo(e);return Ml(t)?e.ownerDocument?e.ownerDocument.body:e.body:xa(t)&&Uf(t)?t:Q$(t)}function Ku(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Q$(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),l=sr(i);if(o){const u=J1(l);return t.concat(l,l.visualViewport||[],Uf(i)?i:[],u&&n?Ku(u):[])}return t.concat(i,Ku(i,[],n))}function J1(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Z$(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=xa(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=im(n)!==o||im(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function sO(e){return Kr(e)?e:e.contextElement}function wl(e){const t=sO(e);if(!xa(t))return ha(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Z$(t);let l=(o?im(n.width):n.width)/r,u=(o?im(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const Z9=ha(0);function J$(e){const t=sr(e);return!oO()||!t.visualViewport?Z9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==sr(e)?!1:t}function Zo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=sO(e);let l=ha(1);t&&(r?Kr(r)&&(l=wl(r)):l=wl(e));const u=J9(o,n,r)?J$(o):ha(0);let d=(i.left+u.x)/l.x,h=(i.top+u.y)/l.y,v=i.width/l.x,m=i.height/l.y;if(o){const g=sr(o),b=r&&Kr(r)?sr(r):r;let O=g,S=J1(O);for(;S&&r&&b!==O;){const x=wl(S),E=S.getBoundingClientRect(),N=Xr(S),_=E.left+(S.clientLeft+parseFloat(N.paddingLeft))*x.x,C=E.top+(S.clientTop+parseFloat(N.paddingTop))*x.y;d*=x.x,h*=x.y,v*=x.x,m*=x.y,d+=_,h+=C,O=sr(S),S=J1(O)}}return sm({width:v,height:m,x:d,y:h})}function Bp(e,t){const n=zp(e).scrollLeft;return t?t.left+n:Zo(ja(e)).left+n}function e5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Bp(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function eG(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",l=ja(r),u=t?Lp(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},h=ha(1);const v=ha(0),m=xa(r);if((m||!m&&!o)&&((fc(r)!=="body"||Uf(l))&&(d=zp(r)),xa(r))){const b=Zo(r);h=wl(r),v.x=b.x+r.clientLeft,v.y=b.y+r.clientTop}const g=l&&!m&&!o?e5(l,d):ha(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+v.x+g.x,y:n.y*h.y-d.scrollTop*h.y+v.y+g.y}}function tG(e){return Array.from(e.getClientRects())}function nG(e){const t=ja(e),n=zp(e),r=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Bp(e);const u=-n.scrollTop;return Xr(r).direction==="rtl"&&(l+=ar(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:l,y:u}}const TC=25;function rG(e,t){const n=sr(e),r=ja(e),i=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(i){o=i.width,l=i.height;const v=oO();(!v||v&&t==="fixed")&&(u=i.offsetLeft,d=i.offsetTop)}const h=Bp(r);if(h<=0){const v=r.ownerDocument,m=v.body,g=getComputedStyle(m),b=v.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,O=Math.abs(r.clientWidth-m.clientWidth-b);O<=TC&&(o-=O)}else h<=TC&&(o+=h);return{width:o,height:l,x:u,y:d}}const aG=new Set(["absolute","fixed"]);function iG(e,t){const n=Zo(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=xa(e)?wl(e):ha(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=i*o.x,h=r*o.y;return{width:l,height:u,x:d,y:h}}function MC(e,t,n){let r;if(t==="viewport")r=rG(e,n);else if(t==="document")r=nG(ja(e));else if(Kr(t))r=iG(t,n);else{const i=J$(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return sm(r)}function t5(e,t){const n=eo(e);return n===t||!Kr(n)||Ml(n)?!1:Xr(n).position==="fixed"||t5(n,t)}function oG(e,t){const n=t.get(e);if(n)return n;let r=Ku(e,[],!1).filter(u=>Kr(u)&&fc(u)!=="body"),i=null;const o=Xr(e).position==="fixed";let l=o?eo(e):e;for(;Kr(l)&&!Ml(l);){const u=Xr(l),d=iO(l);!d&&u.position==="fixed"&&(i=null),(o?!d&&!i:!d&&u.position==="static"&&!!i&&aG.has(i.position)||Uf(l)&&!d&&t5(e,l))?r=r.filter(v=>v!==l):i=u,l=eo(l)}return t.set(e,r),r}function sG(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?Lp(t)?[]:oG(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((h,v)=>{const m=MC(t,v,i);return h.top=ar(m.top,h.top),h.right=Ji(m.right,h.right),h.bottom=Ji(m.bottom,h.bottom),h.left=ar(m.left,h.left),h},MC(t,u,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function lG(e){const{width:t,height:n}=Z$(e);return{width:t,height:n}}function cG(e,t,n){const r=xa(t),i=ja(t),o=n==="fixed",l=Zo(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=ha(0);function h(){d.x=Bp(i)}if(r||!r&&!o)if((fc(t)!=="body"||Uf(i))&&(u=zp(t)),r){const b=Zo(t,!0,o,t);d.x=b.x+t.clientLeft,d.y=b.y+t.clientTop}else i&&h();o&&!r&&i&&h();const v=i&&!r&&!o?e5(i,u):ha(0),m=l.left+u.scrollLeft-d.x-v.x,g=l.top+u.scrollTop-d.y-v.y;return{x:m,y:g,width:l.width,height:l.height}}function Mb(e){return Xr(e).position==="static"}function RC(e,t){if(!xa(e)||Xr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ja(e)===n&&(n=n.ownerDocument.body),n}function n5(e,t){const n=sr(e);if(Lp(e))return n;if(!xa(e)){let i=eo(e);for(;i&&!Ml(i);){if(Kr(i)&&!Mb(i))return i;i=eo(i)}return n}let r=RC(e,t);for(;r&&G9(r)&&Mb(r);)r=RC(r,t);return r&&Ml(r)&&Mb(r)&&!iO(r)?n:r||X9(e)||n}const uG=async function(e){const t=this.getOffsetParent||n5,n=this.getDimensions,r=await n(e.floating);return{reference:cG(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fG(e){return Xr(e).direction==="rtl"}const dG={convertOffsetParentRelativeRectToViewportRelativeRect:eG,getDocumentElement:ja,getClippingRect:sG,getOffsetParent:n5,getElementRects:uG,getClientRects:tG,getDimensions:lG,getScale:wl,isElement:Kr,isRTL:fG};function r5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hG(e,t){let n=null,r;const i=ja(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const h=e.getBoundingClientRect(),{left:v,top:m,width:g,height:b}=h;if(u||t(),!g||!b)return;const O=wh(m),S=wh(i.clientWidth-(v+g)),x=wh(i.clientHeight-(m+b)),E=wh(v),_={rootMargin:-O+"px "+-S+"px "+-x+"px "+-E+"px",threshold:ar(0,Ji(1,d))||1};let C=!0;function A(M){const R=M[0].intersectionRatio;if(R!==d){if(!C)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!r5(h,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(A,{..._,root:i.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return l(!0),o}function mG(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=sO(e),v=i||o?[...h?Ku(h):[],...Ku(t)]:[];v.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const m=h&&u?hG(h,n):null;let g=-1,b=null;l&&(b=new ResizeObserver(E=>{let[N]=E;N&&N.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),h&&!d&&b.observe(h),b.observe(t));let O,S=d?Zo(e):null;d&&x();function x(){const E=Zo(e);S&&!r5(S,E)&&n(),S=E,O=requestAnimationFrame(x)}return n(),()=>{var E;v.forEach(N=>{i&&N.removeEventListener("scroll",n),o&&N.removeEventListener("resize",n)}),m==null||m(),(E=b)==null||E.disconnect(),b=null,d&&cancelAnimationFrame(O)}}const pG=z9,vG=B9,gG=$9,yG=U9,bG=I9,DC=k9,xG=q9,wG=(e,t,n)=>{const r=new Map,i={platform:dG,...n},o={...i.platform,_c:r};return P9(e,t,{...i,platform:o})};var SG=typeof document<"u",jG=function(){},Wh=SG?w.useLayoutEffect:jG;function lm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!lm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!lm(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function a5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PC(e,t){const n=a5(e);return Math.round(t*n)/n}function Rb(e){const t=w.useRef(e);return Wh(()=>{t.current=e}),t}function OG(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[v,m]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,b]=w.useState(r);lm(g,r)||b(r);const[O,S]=w.useState(null),[x,E]=w.useState(null),N=w.useCallback(B=>{B!==M.current&&(M.current=B,S(B))},[]),_=w.useCallback(B=>{B!==R.current&&(R.current=B,E(B))},[]),C=o||O,A=l||x,M=w.useRef(null),R=w.useRef(null),D=w.useRef(v),z=d!=null,G=Rb(d),L=Rb(i),F=Rb(h),W=w.useCallback(()=>{if(!M.current||!R.current)return;const B={placement:t,strategy:n,middleware:g};L.current&&(B.platform=L.current),wG(M.current,R.current,B).then(Z=>{const le={...Z,isPositioned:F.current!==!1};Q.current&&!lm(D.current,le)&&(D.current=le,Lf.flushSync(()=>{m(le)}))})},[g,t,n,L,F]);Wh(()=>{h===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,m(B=>({...B,isPositioned:!1})))},[h]);const Q=w.useRef(!1);Wh(()=>(Q.current=!0,()=>{Q.current=!1}),[]),Wh(()=>{if(C&&(M.current=C),A&&(R.current=A),C&&A){if(G.current)return G.current(C,A,W);W()}},[C,A,W,G,z]);const X=w.useMemo(()=>({reference:M,floating:R,setReference:N,setFloating:_}),[N,_]),k=w.useMemo(()=>({reference:C,floating:A}),[C,A]),H=w.useMemo(()=>{const B={position:n,left:0,top:0};if(!k.floating)return B;const Z=PC(k.floating,v.x),le=PC(k.floating,v.y);return u?{...B,transform:"translate("+Z+"px, "+le+"px)",...a5(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:le}},[n,u,k.floating,v.x,v.y]);return w.useMemo(()=>({...v,update:W,refs:X,elements:k,floatingStyles:H}),[v,W,X,k,H])}const EG=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?DC({element:r.current,padding:i}).fn(n):{}:r?DC({element:r,padding:i}).fn(n):{}}}},_G=(e,t)=>({...pG(e),options:[e,t]}),NG=(e,t)=>({...vG(e),options:[e,t]}),AG=(e,t)=>({...xG(e),options:[e,t]}),CG=(e,t)=>({...gG(e),options:[e,t]}),TG=(e,t)=>({...yG(e),options:[e,t]}),MG=(e,t)=>({...bG(e),options:[e,t]}),RG=(e,t)=>({...EG(e),options:[e,t]});var DG="Arrow",i5=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return c.jsx(Ne.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});i5.displayName=DG;var PG=i5;function qp(e){const[t,n]=w.useState(void 0);return Wt(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var lO="Popper",[o5,io]=jn(lO),[kG,s5]=o5(lO),l5=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return c.jsx(kG,{scope:t,anchor:r,onAnchorChange:i,children:n})};l5.displayName=lO;var c5="PopperAnchor",u5=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=s5(c5,n),l=w.useRef(null),u=Ue(t,l),d=w.useRef(null);return w.useEffect(()=>{const h=d.current;d.current=(r==null?void 0:r.current)||l.current,h!==d.current&&o.onAnchorChange(d.current)}),r?null:c.jsx(Ne.div,{...i,ref:u})});u5.displayName=c5;var cO="PopperContent",[$G,IG]=o5(cO),f5=w.forwardRef((e,t)=>{var ie,pe,re,ve,ge,oe;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:v=0,sticky:m="partial",hideWhenDetached:g=!1,updatePositionStrategy:b="optimized",onPlaced:O,...S}=e,x=s5(cO,n),[E,N]=w.useState(null),_=Ue(t,ke=>N(ke)),[C,A]=w.useState(null),M=qp(C),R=(M==null?void 0:M.width)??0,D=(M==null?void 0:M.height)??0,z=r+(o!=="center"?"-"+o:""),G=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},L=Array.isArray(h)?h:[h],F=L.length>0,W={padding:G,boundary:L.filter(zG),altBoundary:F},{refs:Q,floatingStyles:X,placement:k,isPositioned:H,middlewareData:B}=OG({strategy:"fixed",placement:z,whileElementsMounted:(...ke)=>mG(...ke,{animationFrame:b==="always"}),elements:{reference:x.anchor},middleware:[_G({mainAxis:i+D,alignmentAxis:l}),d&&NG({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?AG():void 0,...W}),d&&CG({...W}),TG({...W,apply:({elements:ke,rects:we,availableWidth:ze,availableHeight:Ze})=>{const{width:lt,height:tn}=we.reference,pt=ke.floating.style;pt.setProperty("--radix-popper-available-width",`${ze}px`),pt.setProperty("--radix-popper-available-height",`${Ze}px`),pt.setProperty("--radix-popper-anchor-width",`${lt}px`),pt.setProperty("--radix-popper-anchor-height",`${tn}px`)}}),C&&RG({element:C,padding:u}),BG({arrowWidth:R,arrowHeight:D}),g&&MG({strategy:"referenceHidden",...W})]}),[Z,le]=m5(k),$=Wr(O);Wt(()=>{H&&($==null||$())},[H,$]);const Y=(ie=B.arrow)==null?void 0:ie.x,q=(pe=B.arrow)==null?void 0:pe.y,U=((re=B.arrow)==null?void 0:re.centerOffset)!==0,[ne,fe]=w.useState();return Wt(()=>{E&&fe(window.getComputedStyle(E).zIndex)},[E]),c.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:H?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(ve=B.transformOrigin)==null?void 0:ve.x,(ge=B.transformOrigin)==null?void 0:ge.y].join(" "),...((oe=B.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx($G,{scope:n,placedSide:Z,onArrowChange:A,arrowX:Y,arrowY:q,shouldHideArrow:U,children:c.jsx(Ne.div,{"data-side":Z,"data-align":le,...S,ref:_,style:{...S.style,animation:H?void 0:"none"}})})})});f5.displayName=cO;var d5="PopperArrow",LG={top:"bottom",right:"left",bottom:"top",left:"right"},h5=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,o=IG(d5,r),l=LG[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(PG,{...i,ref:n,style:{...i.style,display:"block"}})})});h5.displayName=d5;function zG(e){return e!==null}var BG=e=>({name:"transformOrigin",options:e,fn(t){var x,E,N;const{placement:n,rects:r,middlewareData:i}=t,l=((x=i.arrow)==null?void 0:x.centerOffset)!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,v]=m5(n),m={start:"0%",center:"50%",end:"100%"}[v],g=(((E=i.arrow)==null?void 0:E.x)??0)+u/2,b=(((N=i.arrow)==null?void 0:N.y)??0)+d/2;let O="",S="";return h==="bottom"?(O=l?m:`${g}px`,S=`${-d}px`):h==="top"?(O=l?m:`${g}px`,S=`${r.floating.height+d}px`):h==="right"?(O=`${-d}px`,S=l?m:`${b}px`):h==="left"&&(O=`${r.floating.width+d}px`,S=l?m:`${b}px`),{data:{x:O,y:S}}}});function m5(e){const[t,n="center"]=e.split("-");return[t,n]}var Up=l5,Hp=u5,Fp=f5,Gp=h5,qG="Portal",dc=w.forwardRef((e,t)=>{var u;const{container:n,...r}=e,[i,o]=w.useState(!1);Wt(()=>o(!0),[]);const l=n||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return l?c$.createPortal(c.jsx(Ne.div,{...r,ref:t}),l):null});dc.displayName=qG;function UG(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var An=e=>{const{present:t,children:n}=e,r=HG(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),o=Ue(r.ref,FG(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:o}):null};An.displayName="Presence";function HG(e){const[t,n]=w.useState(),r=w.useRef(null),i=w.useRef(e),o=w.useRef("none"),l=e?"mounted":"unmounted",[u,d]=UG(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const h=Sh(r.current);o.current=u==="mounted"?h:"none"},[u]),Wt(()=>{const h=r.current,v=i.current;if(v!==e){const g=o.current,b=Sh(h);e?d("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?d("UNMOUNT"):d(v&&g!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,d]),Wt(()=>{if(t){let h;const v=t.ownerDocument.defaultView??window,m=b=>{const S=Sh(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(d("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",h=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},g=b=>{b.target===t&&(o.current=Sh(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{v.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:w.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Sh(e){return(e==null?void 0:e.animationName)||"none"}function FG(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Db="rovingFocusGroup.onEntryFocus",GG={bubbles:!1,cancelable:!0},Hf="RovingFocusGroup",[eS,p5,VG]=kp(Hf),[YG,hc]=jn(Hf,[VG]),[WG,KG]=YG(Hf),v5=w.forwardRef((e,t)=>c.jsx(eS.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(eS.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(XG,{...e,ref:t})})}));v5.displayName=Hf;var XG=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:v=!1,...m}=e,g=w.useRef(null),b=Ue(t,g),O=lc(o),[S,x]=Nn({prop:l,defaultProp:u??null,onChange:d,caller:Hf}),[E,N]=w.useState(!1),_=Wr(h),C=p5(n),A=w.useRef(!1),[M,R]=w.useState(0);return w.useEffect(()=>{const D=g.current;if(D)return D.addEventListener(Db,_),()=>D.removeEventListener(Db,_)},[_]),c.jsx(WG,{scope:n,orientation:r,dir:O,loop:i,currentTabStopId:S,onItemFocus:w.useCallback(D=>x(D),[x]),onItemShiftTab:w.useCallback(()=>N(!0),[]),onFocusableItemAdd:w.useCallback(()=>R(D=>D+1),[]),onFocusableItemRemove:w.useCallback(()=>R(D=>D-1),[]),children:c.jsx(Ne.div,{tabIndex:E||M===0?-1:0,"data-orientation":r,...m,ref:b,style:{outline:"none",...e.style},onMouseDown:ye(e.onMouseDown,()=>{A.current=!0}),onFocus:ye(e.onFocus,D=>{const z=!A.current;if(D.target===D.currentTarget&&z&&!E){const G=new CustomEvent(Db,GG);if(D.currentTarget.dispatchEvent(G),!G.defaultPrevented){const L=C().filter(k=>k.focusable),F=L.find(k=>k.active),W=L.find(k=>k.id===S),X=[F,W,...L].filter(Boolean).map(k=>k.ref.current);b5(X,v)}}A.current=!1}),onBlur:ye(e.onBlur,()=>N(!1))})})}),g5="RovingFocusGroupItem",y5=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:l,...u}=e,d=Cr(),h=o||d,v=KG(g5,n),m=v.currentTabStopId===h,g=p5(n),{onFocusableItemAdd:b,onFocusableItemRemove:O,currentTabStopId:S}=v;return w.useEffect(()=>{if(r)return b(),()=>O()},[r,b,O]),c.jsx(eS.ItemSlot,{scope:n,id:h,focusable:r,active:i,children:c.jsx(Ne.span,{tabIndex:m?0:-1,"data-orientation":v.orientation,...u,ref:t,onMouseDown:ye(e.onMouseDown,x=>{r?v.onItemFocus(h):x.preventDefault()}),onFocus:ye(e.onFocus,()=>v.onItemFocus(h)),onKeyDown:ye(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){v.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const E=JG(x,v.orientation,v.dir);if(E!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let _=g().filter(C=>C.focusable).map(C=>C.ref.current);if(E==="last")_.reverse();else if(E==="prev"||E==="next"){E==="prev"&&_.reverse();const C=_.indexOf(x.currentTarget);_=v.loop?eV(_,C+1):_.slice(C+1)}setTimeout(()=>b5(_))}}),children:typeof l=="function"?l({isCurrentTabStop:m,hasTabStop:S!=null}):l})})});y5.displayName=g5;var QG={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ZG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function JG(e,t,n){const r=ZG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return QG[r]}function b5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function eV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uO=v5,fO=y5,tV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ll=new WeakMap,jh=new WeakMap,Oh={},Pb=0,x5=function(e){return e&&(e.host||x5(e.parentNode))},nV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=x5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},rV=function(e,t,n,r){var i=nV(t,Array.isArray(e)?e:[e]);Oh[n]||(Oh[n]=new WeakMap);var o=Oh[n],l=[],u=new Set,d=new Set(i),h=function(m){!m||u.has(m)||(u.add(m),h(m.parentNode))};i.forEach(h);var v=function(m){!m||d.has(m)||Array.prototype.forEach.call(m.children,function(g){if(u.has(g))v(g);else try{var b=g.getAttribute(r),O=b!==null&&b!=="false",S=(ll.get(g)||0)+1,x=(o.get(g)||0)+1;ll.set(g,S),o.set(g,x),l.push(g),S===1&&O&&jh.set(g,!0),x===1&&g.setAttribute(n,"true"),O||g.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",g,E)}})};return v(t),u.clear(),Pb++,function(){l.forEach(function(m){var g=ll.get(m)-1,b=o.get(m)-1;ll.set(m,g),o.set(m,b),g||(jh.has(m)||m.removeAttribute(r),jh.delete(m)),b||m.removeAttribute(n)}),Pb--,Pb||(ll=new WeakMap,ll=new WeakMap,jh=new WeakMap,Oh={})}},dO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=tV(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),rV(r,i,n,"aria-hidden")):function(){return null}},ca=function(){return ca=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ca.apply(this,arguments)};function w5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function aV(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var Kh="right-scroll-bar-position",Xh="width-before-scroll-bar",iV="with-scroll-bars-hidden",oV="--removed-body-scroll-bar-size";function kb(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function sV(e,t){var n=w.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var lV=typeof window<"u"?w.useLayoutEffect:w.useEffect,kC=new WeakMap;function cV(e,t){var n=sV(null,function(r){return e.forEach(function(i){return kb(i,r)})});return lV(function(){var r=kC.get(n);if(r){var i=new Set(r),o=new Set(e),l=n.current;i.forEach(function(u){o.has(u)||kb(u,null)}),o.forEach(function(u){i.has(u)||kb(u,l)})}kC.set(n,e)},[e]),n}function uV(e){return e}function fV(e,t){t===void 0&&(t=uV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var l=t(o,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(o){for(r=!0;n.length;){var l=n;n=[],l.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(o),l=n}var d=function(){var v=l;l=[],v.forEach(o)},h=function(){return Promise.resolve().then(d)};h(),n={push:function(v){l.push(v),h()},filter:function(v){return l=l.filter(v),n}}}};return i}function dV(e){e===void 0&&(e={});var t=fV(null);return t.options=ca({async:!0,ssr:!1},e),t}var S5=function(e){var t=e.sideCar,n=w5(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return w.createElement(r,ca({},n))};S5.isSideCarExport=!0;function hV(e,t){return e.useMedium(t),S5}var j5=dV(),$b=function(){},Vp=w.forwardRef(function(e,t){var n=w.useRef(null),r=w.useState({onScrollCapture:$b,onWheelCapture:$b,onTouchMoveCapture:$b}),i=r[0],o=r[1],l=e.forwardProps,u=e.children,d=e.className,h=e.removeScrollBar,v=e.enabled,m=e.shards,g=e.sideCar,b=e.noRelative,O=e.noIsolation,S=e.inert,x=e.allowPinchZoom,E=e.as,N=E===void 0?"div":E,_=e.gapMode,C=w5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=g,M=cV([n,t]),R=ca(ca({},C),i);return w.createElement(w.Fragment,null,v&&w.createElement(A,{sideCar:j5,removeScrollBar:h,shards:m,noRelative:b,noIsolation:O,inert:S,setCallbacks:o,allowPinchZoom:!!x,lockRef:n,gapMode:_}),l?w.cloneElement(w.Children.only(u),ca(ca({},R),{ref:M})):w.createElement(N,ca({},R,{className:d,ref:M}),u))});Vp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Vp.classNames={fullWidth:Xh,zeroRight:Kh};var mV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=mV();return t&&e.setAttribute("nonce",t),e}function vV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pV())&&(vV(t,n),gV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bV=function(){var e=yV();return function(t,n){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},O5=function(){var e=bV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},xV={left:0,top:0,right:0,gap:0},Ib=function(e){return parseInt(e||"",10)||0},wV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Ib(n),Ib(r),Ib(i)]},SV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xV;var t=wV(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},jV=O5(),Sl="data-scroll-locked",OV=function(e,t,n,r){var i=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
374
|
+
.`.concat(iV,` {
|
|
375
375
|
overflow: hidden `).concat(r,`;
|
|
376
376
|
padding-right: `).concat(u,"px ").concat(r,`;
|
|
377
377
|
}
|
|
@@ -405,27 +405,27 @@ Please change the parent <Route path="${_}"> to <Route path="${_==="/"?"*":`${_}
|
|
|
405
405
|
}
|
|
406
406
|
|
|
407
407
|
body[`).concat(Sl,`] {
|
|
408
|
-
`).concat(
|
|
408
|
+
`).concat(oV,": ").concat(u,`px;
|
|
409
409
|
}
|
|
410
|
-
`)},$C=function(){var e=parseInt(document.body.getAttribute(Sl)||"0",10);return isFinite(e)?e:0},
|
|
410
|
+
`)},$C=function(){var e=parseInt(document.body.getAttribute(Sl)||"0",10);return isFinite(e)?e:0},EV=function(){w.useEffect(function(){return document.body.setAttribute(Sl,($C()+1).toString()),function(){var e=$C()-1;e<=0?document.body.removeAttribute(Sl):document.body.setAttribute(Sl,e.toString())}},[])},_V=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;EV();var o=w.useMemo(function(){return SV(i)},[i]);return w.createElement(jV,{styles:OV(o,!t,i,n?"":"!important")})},tS=!1;if(typeof window<"u")try{var Eh=Object.defineProperty({},"passive",{get:function(){return tS=!0,!0}});window.addEventListener("test",Eh,Eh),window.removeEventListener("test",Eh,Eh)}catch{tS=!1}var cl=tS?{passive:!1}:!1,NV=function(e){return e.tagName==="TEXTAREA"},E5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!NV(e)&&n[t]==="visible")},AV=function(e){return E5(e,"overflowY")},CV=function(e){return E5(e,"overflowX")},IC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=_5(e,r);if(i){var o=N5(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},MV=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},_5=function(e,t){return e==="v"?AV(t):CV(t)},N5=function(e,t){return e==="v"?TV(t):MV(t)},RV=function(e,t){return e==="h"&&t==="rtl"?-1:1},DV=function(e,t,n,r,i){var o=RV(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),h=!1,v=l>0,m=0,g=0;do{if(!u)break;var b=N5(e,u),O=b[0],S=b[1],x=b[2],E=S-x-o*O;(O||E)&&_5(e,u)&&(m+=E,g+=O);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(v&&Math.abs(m)<1||!v&&Math.abs(g)<1)&&(h=!0),h},_h=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},LC=function(e){return[e.deltaX,e.deltaY]},zC=function(e){return e&&"current"in e?e.current:e},PV=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kV=function(e){return`
|
|
411
411
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
412
412
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
413
|
-
`)},kV=0,ul=[];function $V(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(kV++)[0],o=w.useState(S5)[0],l=w.useRef(e);w.useEffect(function(){l.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=rV([e.lockRef.current],(e.shards||[]).map(zC),!0).filter(Boolean);return S.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(S,x){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var E=_h(S),N=n.current,_="deltaX"in S?S.deltaX:N[0]-E[0],C="deltaY"in S?S.deltaY:N[1]-E[1],A,M=S.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in S&&R==="h"&&M.type==="range")return!1;var D=window.getSelection(),z=D&&D.anchorNode,G=z?z===M||z.contains(M):!1;if(G)return!1;var L=IC(R,M);if(!L)return!0;if(L?A=R:(A=R==="v"?"h":"v",L=IC(R,M)),!L)return!1;if(!r.current&&"changedTouches"in S&&(_||C)&&(r.current=A),!A)return!0;var F=r.current||A;return RV(F,x,S,F==="h"?_:C)},[]),d=w.useCallback(function(S){var x=S;if(!(!ul.length||ul[ul.length-1]!==o)){var E="deltaY"in x?LC(x):_h(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&DV(A.delta,E)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(l.current.shards||[]).map(zC).filter(Boolean).filter(function(A){return A.contains(x.target)}),C=_.length>0?u(x,_[0]):!l.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),h=w.useCallback(function(S,x,E,N){var _={name:S,delta:x,target:E,should:N,shadowParent:IV(E)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),v=w.useCallback(function(S){n.current=_h(S),r.current=void 0},[]),m=w.useCallback(function(S){h(S.type,LC(S),S.target,u(S,e.lockRef.current))},[]),g=w.useCallback(function(S){h(S.type,_h(S),S.target,u(S,e.lockRef.current))},[]);w.useEffect(function(){return ul.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,cl),document.addEventListener("touchmove",d,cl),document.addEventListener("touchstart",v,cl),function(){ul=ul.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,cl),document.removeEventListener("touchmove",d,cl),document.removeEventListener("touchstart",v,cl)}},[]);var b=e.removeScrollBar,O=e.inert;return w.createElement(w.Fragment,null,O?w.createElement(o,{styles:PV(i)}):null,b?w.createElement(EV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function IV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LV=dV(w5,$V);var Yp=w.forwardRef(function(e,t){return w.createElement(Vp,ca({},e,{ref:t,sideCar:LV}))});Yp.classNames=Vp.classNames;var nS=["Enter"," "],zV=["ArrowDown","PageUp","Home"],_5=["ArrowUp","PageDown","End"],BV=[...zV,..._5],qV={ltr:[...nS,"ArrowRight"],rtl:[...nS,"ArrowLeft"]},UV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ff="Menu",[Xu,HV,FV]=kp(Ff),[cs,N5]=jn(Ff,[FV,io,hc]),Wp=io(),A5=hc(),[GV,us]=cs(Ff),[VV,Gf]=cs(Ff),C5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,u=Wp(t),[d,h]=w.useState(null),v=w.useRef(!1),m=Wr(o),g=lc(i);return w.useEffect(()=>{const b=()=>{v.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>v.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),c.jsx(Up,{...u,children:c.jsx(GV,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:c.jsx(VV,{scope:t,onClose:w.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:v,dir:g,modal:l,children:r})})})};C5.displayName=Ff;var YV="MenuAnchor",hO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Wp(n);return c.jsx(Hp,{...i,...r,ref:t})});hO.displayName=YV;var mO="MenuPortal",[WV,T5]=cs(mO,{forceMount:void 0}),M5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=us(mO,t);return c.jsx(WV,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};M5.displayName=mO;var Tr="MenuContent",[KV,pO]=cs(Tr),R5=w.forwardRef((e,t)=>{const n=T5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=us(Tr,e.__scopeMenu),l=Gf(Tr,e.__scopeMenu);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(An,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:l.modal?c.jsx(XV,{...i,ref:t}):c.jsx(QV,{...i,ref:t})})})})}),XV=w.forwardRef((e,t)=>{const n=us(Tr,e.__scopeMenu),r=w.useRef(null),i=Ue(t,r);return w.useEffect(()=>{const o=r.current;if(o)return dO(o)},[]),c.jsx(vO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ye(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),QV=w.forwardRef((e,t)=>{const n=us(Tr,e.__scopeMenu);return c.jsx(vO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),ZV=Tl("MenuContent.ScrollLock"),vO=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:b,disableOutsideScroll:O,...S}=e,x=us(Tr,n),E=Gf(Tr,n),N=Wp(n),_=A5(n),C=HV(n),[A,M]=w.useState(null),R=w.useRef(null),D=Ue(t,R,x.onContentChange),z=w.useRef(0),G=w.useRef(""),L=w.useRef(0),F=w.useRef(null),W=w.useRef("right"),Q=w.useRef(0),X=O?Yp:w.Fragment,k=O?{as:ZV,allowPinchZoom:!0}:void 0,H=Z=>{var ie,pe;const le=G.current+Z,$=C().filter(re=>!re.disabled),Y=document.activeElement,q=(ie=$.find(re=>re.ref.current===Y))==null?void 0:ie.textValue,U=$.map(re=>re.textValue),ne=uY(U,le,q),fe=(pe=$.find(re=>re.textValue===ne))==null?void 0:pe.ref.current;(function re(ve){G.current=ve,window.clearTimeout(z.current),ve!==""&&(z.current=window.setTimeout(()=>re(""),1e3))})(le),fe&&setTimeout(()=>fe.focus())};w.useEffect(()=>()=>window.clearTimeout(z.current),[]),tO();const B=w.useCallback(Z=>{var $,Y;return W.current===(($=F.current)==null?void 0:$.side)&&dY(Z,(Y=F.current)==null?void 0:Y.area)},[]);return c.jsx(KV,{scope:n,searchRef:G,onItemEnter:w.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),onItemLeave:w.useCallback(Z=>{var le;B(Z)||((le=R.current)==null||le.focus(),M(null))},[B]),onTriggerLeave:w.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),pointerGraceTimerRef:L,onPointerGraceIntentChange:w.useCallback(Z=>{F.current=Z},[]),children:c.jsx(X,{...k,children:c.jsx($p,{asChild:!0,trapped:i,onMountAutoFocus:ye(o,Z=>{var le;Z.preventDefault(),(le=R.current)==null||le.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:b,children:c.jsx(uO,{asChild:!0,..._,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:ye(d,Z=>{E.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Fp,{role:"menu","aria-orientation":"vertical","data-state":W5(x.open),"data-radix-menu-content":"",dir:E.dir,...N,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:ye(S.onKeyDown,Z=>{const $=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,Y=Z.ctrlKey||Z.altKey||Z.metaKey,q=Z.key.length===1;$&&(Z.key==="Tab"&&Z.preventDefault(),!Y&&q&&H(Z.key));const U=R.current;if(Z.target!==U||!BV.includes(Z.key))return;Z.preventDefault();const fe=C().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);_5.includes(Z.key)&&fe.reverse(),lY(fe)}),onBlur:ye(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(z.current),G.current="")}),onPointerMove:ye(e.onPointerMove,Qu(Z=>{const le=Z.target,$=Q.current!==Z.clientX;if(Z.currentTarget.contains(le)&&$){const Y=Z.clientX>Q.current?"right":"left";W.current=Y,Q.current=Z.clientX}}))})})})})})})});R5.displayName=Tr;var JV="MenuGroup",gO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{role:"group",...r,ref:t})});gO.displayName=JV;var eY="MenuLabel",D5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{...r,ref:t})});D5.displayName=eY;var cm="MenuItem",BC="menu.itemSelect",Kp=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),l=Gf(cm,e.__scopeMenu),u=pO(cm,e.__scopeMenu),d=Ue(t,o),h=w.useRef(!1),v=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(BC,{bubbles:!0,cancelable:!0});m.addEventListener(BC,b=>r==null?void 0:r(b),{once:!0}),U$(m,g),g.defaultPrevented?h.current=!1:l.onClose()}};return c.jsx(P5,{...i,ref:d,disabled:n,onClick:ye(e.onClick,v),onPointerDown:m=>{var g;(g=e.onPointerDown)==null||g.call(e,m),h.current=!0},onPointerUp:ye(e.onPointerUp,m=>{var g;h.current||(g=m.currentTarget)==null||g.click()}),onKeyDown:ye(e.onKeyDown,m=>{const g=u.searchRef.current!=="";n||g&&m.key===" "||nS.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Kp.displayName=cm;var P5=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=pO(cm,n),u=A5(n),d=w.useRef(null),h=Ue(t,d),[v,m]=w.useState(!1),[g,b]=w.useState("");return w.useEffect(()=>{const O=d.current;O&&b((O.textContent??"").trim())},[o.children]),c.jsx(Xu.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:c.jsx(fO,{asChild:!0,...u,focusable:!r,children:c.jsx(Ne.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:h,onPointerMove:ye(e.onPointerMove,Qu(O=>{r?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(e.onPointerLeave,Qu(O=>l.onItemLeave(O))),onFocus:ye(e.onFocus,()=>m(!0)),onBlur:ye(e.onBlur,()=>m(!1))})})})}),tY="MenuCheckboxItem",k5=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(B5,{scope:e.__scopeMenu,checked:n,children:c.jsx(Kp,{role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n,...i,ref:t,"data-state":bO(n),onSelect:ye(i.onSelect,()=>r==null?void 0:r(um(n)?!0:!n),{checkForDefaultPrevented:!1})})})});k5.displayName=tY;var $5="MenuRadioGroup",[nY,rY]=cs($5,{value:void 0,onValueChange:()=>{}}),I5=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Wr(r);return c.jsx(nY,{scope:e.__scopeMenu,value:n,onValueChange:o,children:c.jsx(gO,{...i,ref:t})})});I5.displayName=$5;var L5="MenuRadioItem",z5=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=rY(L5,e.__scopeMenu),o=n===i.value;return c.jsx(B5,{scope:e.__scopeMenu,checked:o,children:c.jsx(Kp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":bO(o),onSelect:ye(r.onSelect,()=>{var l;return(l=i.onValueChange)==null?void 0:l.call(i,n)},{checkForDefaultPrevented:!1})})})});z5.displayName=L5;var yO="MenuItemIndicator",[B5,aY]=cs(yO,{checked:!1}),q5=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=aY(yO,n);return c.jsx(An,{present:r||um(o.checked)||o.checked===!0,children:c.jsx(Ne.span,{...i,ref:t,"data-state":bO(o.checked)})})});q5.displayName=yO;var iY="MenuSeparator",U5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});U5.displayName=iY;var oY="MenuArrow",H5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Wp(n);return c.jsx(Gp,{...i,...r,ref:t})});H5.displayName=oY;var sY="MenuSub",[cye,F5]=cs(sY),Ru="MenuSubTrigger",G5=w.forwardRef((e,t)=>{const n=us(Ru,e.__scopeMenu),r=Gf(Ru,e.__scopeMenu),i=F5(Ru,e.__scopeMenu),o=pO(Ru,e.__scopeMenu),l=w.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,h={__scopeMenu:e.__scopeMenu},v=w.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return w.useEffect(()=>v,[v]),w.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),c.jsx(hO,{asChild:!0,...h,children:c.jsx(P5,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":W5(n.open),...e,ref:qf(t,i.onTriggerChange),onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ye(e.onPointerMove,Qu(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:ye(e.onPointerLeave,Qu(m=>{var b,O;v();const g=(b=n.content)==null?void 0:b.getBoundingClientRect();if(g){const S=(O=n.content)==null?void 0:O.dataset.side,x=S==="right",E=x?-5:5,N=g[x?"left":"right"],_=g[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+E,y:m.clientY},{x:N,y:g.top},{x:_,y:g.top},{x:_,y:g.bottom},{x:N,y:g.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ye(e.onKeyDown,m=>{var b;const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||qV[r.dir].includes(m.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),m.preventDefault())})})})});G5.displayName=Ru;var V5="MenuSubContent",Y5=w.forwardRef((e,t)=>{const n=T5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=us(Tr,e.__scopeMenu),l=Gf(Tr,e.__scopeMenu),u=F5(V5,e.__scopeMenu),d=w.useRef(null),h=Ue(t,d);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(An,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:c.jsx(vO,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var m;l.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:ye(e.onFocusOutside,v=>{v.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ye(e.onEscapeKeyDown,v=>{l.onClose(),v.preventDefault()}),onKeyDown:ye(e.onKeyDown,v=>{var b;const m=v.currentTarget.contains(v.target),g=UV[l.dir].includes(v.key);m&&g&&(o.onOpenChange(!1),(b=u.trigger)==null||b.focus(),v.preventDefault())})})})})})});Y5.displayName=V5;function W5(e){return e?"open":"closed"}function um(e){return e==="indeterminate"}function bO(e){return um(e)?"indeterminate":e?"checked":"unchecked"}function lY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function cY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uY(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=cY(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function fY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],h=u.x,v=u.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function dY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return fY(n,t)}function Qu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var hY=C5,mY=hO,pY=M5,vY=R5,gY=gO,yY=D5,bY=Kp,xY=k5,wY=I5,SY=z5,jY=q5,OY=U5,EY=H5,_Y=G5,NY=Y5,Xp="DropdownMenu",[AY]=jn(Xp,[N5]),Cn=N5(),[CY,K5]=AY(Xp),X5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=Cn(t),h=w.useRef(null),[v,m]=Nn({prop:i,defaultProp:o??!1,onChange:l,caller:Xp});return c.jsx(CY,{scope:t,triggerId:Cr(),triggerRef:h,contentId:Cr(),open:v,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:u,children:c.jsx(hY,{...d,open:v,onOpenChange:m,dir:r,modal:u,children:n})})};X5.displayName=Xp;var Q5="DropdownMenuTrigger",Z5=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=K5(Q5,n),l=Cn(n);return c.jsx(mY,{asChild:!0,...l,children:c.jsx(Ne.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:qf(t,o.triggerRef),onPointerDown:ye(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:ye(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Z5.displayName=Q5;var TY="DropdownMenuPortal",J5=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Cn(t);return c.jsx(pY,{...r,...n})};J5.displayName=TY;var eI="DropdownMenuContent",tI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=K5(eI,n),o=Cn(n),l=w.useRef(!1);return c.jsx(vY,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:ye(e.onCloseAutoFocus,u=>{var d;l.current||(d=i.triggerRef.current)==null||d.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ye(e.onInteractOutside,u=>{const d=u.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,v=d.button===2||h;(!i.modal||v)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tI.displayName=eI;var MY="DropdownMenuGroup",RY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(gY,{...i,...r,ref:t})});RY.displayName=MY;var DY="DropdownMenuLabel",nI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(yY,{...i,...r,ref:t})});nI.displayName=DY;var PY="DropdownMenuItem",rI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(bY,{...i,...r,ref:t})});rI.displayName=PY;var kY="DropdownMenuCheckboxItem",aI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(xY,{...i,...r,ref:t})});aI.displayName=kY;var $Y="DropdownMenuRadioGroup",IY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(wY,{...i,...r,ref:t})});IY.displayName=$Y;var LY="DropdownMenuRadioItem",zY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(SY,{...i,...r,ref:t})});zY.displayName=LY;var BY="DropdownMenuItemIndicator",iI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(jY,{...i,...r,ref:t})});iI.displayName=BY;var qY="DropdownMenuSeparator",oI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(OY,{...i,...r,ref:t})});oI.displayName=qY;var UY="DropdownMenuArrow",HY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(EY,{...i,...r,ref:t})});HY.displayName=UY;var FY="DropdownMenuSubTrigger",GY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(_Y,{...i,...r,ref:t})});GY.displayName=FY;var VY="DropdownMenuSubContent",YY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(NY,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});YY.displayName=VY;var WY=X5,KY=Z5,XY=J5,QY=tI,ZY=nI,JY=rI,eW=aI,tW=iI,nW=oI;function sI({...e}){return c.jsx(WY,{"data-slot":"dropdown-menu",...e})}function lI({...e}){return c.jsx(KY,{"data-slot":"dropdown-menu-trigger",...e})}function cI({className:e,sideOffset:t=4,...n}){return c.jsx(XY,{children:c.jsx(QY,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-[--radix-dropdown-menu-content-available-height] min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dropdown-menu-content",sideOffset:t,...n})})}function qC({className:e,inset:t,variant:n="default",...r}){return c.jsx(JY,{className:me("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-inset":t,"data-slot":"dropdown-menu-item","data-variant":n,...r})}function rW({className:e,children:t,checked:n,...r}){return c.jsxs(eW,{checked:n,className:me("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"dropdown-menu-checkbox-item",...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(tW,{children:c.jsx(ri,{className:"size-4"})})}),t]})}function uI({className:e,inset:t,...n}){return c.jsx(ZY,{className:me("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),"data-inset":t,"data-slot":"dropdown-menu-label",...n})}function rS({className:e,...t}){return c.jsx(nW,{className:me("-mx-1 my-1 h-px bg-border",e),"data-slot":"dropdown-menu-separator",...t})}const UC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,HC=rt,mc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return HC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(h=>{const v=n==null?void 0:n[h],m=o==null?void 0:o[h];if(v===null)return null;const g=UC(v)||UC(m);return i[h][g]}),u=n&&Object.entries(n).reduce((h,v)=>{let[m,g]=v;return g===void 0||(h[m]=g),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,v)=>{let{class:m,className:g,...b}=v;return Object.entries(b).every(O=>{let[S,x]=O;return Array.isArray(x)?x.includes({...o,...u}[S]):{...o,...u}[S]===x})?[...h,m,g]:h},[]);return HC(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},xO=mc("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:e,variant:t,size:n,asChild:r=!1,...i}){const o=r?ss:"button";return c.jsx(o,{className:me(xO({variant:t,size:n,className:e})),"data-slot":"button",...i})}const oo=w.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{className:me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,type:t,...n}));oo.displayName="Input";var aW="Separator",FC="horizontal",iW=["horizontal","vertical"],fI=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=FC,...i}=e,o=oW(r)?r:FC,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(ls.div,{"data-orientation":o,...u,...i,ref:t})});fI.displayName=aW;function oW(e){return iW.includes(e)}var sW=fI;function qt({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(sW,{className:me("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",e),"data-slot":"separator",decorative:n,orientation:t,...r})}var Qp="Dialog",[dI,hI]=jn(Qp),[lW,Jr]=dI(Qp),mI=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=w.useRef(null),d=w.useRef(null),[h,v]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:Qp});return c.jsx(lW,{scope:t,triggerRef:u,contentRef:d,contentId:Cr(),titleId:Cr(),descriptionId:Cr(),open:h,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(m=>!m),[v]),modal:l,children:n})};mI.displayName=Qp;var pI="DialogTrigger",vI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(pI,n),o=Ue(t,i.triggerRef);return c.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jO(i.open),...r,ref:o,onClick:ye(e.onClick,i.onOpenToggle)})});vI.displayName=pI;var wO="DialogPortal",[cW,gI]=dI(wO,{forceMount:void 0}),yI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Jr(wO,t);return c.jsx(cW,{scope:t,forceMount:n,children:w.Children.map(r,l=>c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:l})}))})};yI.displayName=wO;var fm="DialogOverlay",bI=w.forwardRef((e,t)=>{const n=gI(fm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jr(fm,e.__scopeDialog);return o.modal?c.jsx(An,{present:r||o.open,children:c.jsx(fW,{...i,ref:t})}):null});bI.displayName=fm;var uW=Tl("DialogOverlay.RemoveScroll"),fW=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(fm,n);return c.jsx(Yp,{as:uW,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(Ne.div,{"data-state":jO(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jo="DialogContent",xI=w.forwardRef((e,t)=>{const n=gI(Jo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jr(Jo,e.__scopeDialog);return c.jsx(An,{present:r||o.open,children:o.modal?c.jsx(dW,{...i,ref:t}):c.jsx(hW,{...i,ref:t})})});xI.displayName=Jo;var dW=w.forwardRef((e,t)=>{const n=Jr(Jo,e.__scopeDialog),r=w.useRef(null),i=Ue(t,n.contentRef,r);return w.useEffect(()=>{const o=r.current;if(o)return dO(o)},[]),c.jsx(wI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,o=>o.preventDefault())})}),hW=w.forwardRef((e,t)=>{const n=Jr(Jo,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return c.jsx(wI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),wI=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Jr(Jo,n),d=w.useRef(null),h=Ue(t,d);return tO(),c.jsxs(c.Fragment,{children:[c.jsx($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(cc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":jO(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(pW,{titleId:u.titleId}),c.jsx(gW,{contentRef:d,descriptionId:u.descriptionId})]})]})}),SO="DialogTitle",SI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(SO,n);return c.jsx(Ne.h2,{id:i.titleId,...r,ref:t})});SI.displayName=SO;var jI="DialogDescription",OI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(jI,n);return c.jsx(Ne.p,{id:i.descriptionId,...r,ref:t})});OI.displayName=jI;var EI="DialogClose",_I=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(EI,n);return c.jsx(Ne.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>i.onOpenChange(!1))})});_I.displayName=EI;function jO(e){return e?"open":"closed"}var NI="DialogTitleWarning",[mW,AI]=W7(NI,{contentName:Jo,titleName:SO,docsSlug:"dialog"}),pW=({titleId:e})=>{const t=AI(NI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
413
|
+
`)},$V=0,ul=[];function IV(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState($V++)[0],o=w.useState(O5)[0],l=w.useRef(e);w.useEffect(function(){l.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var S=aV([e.lockRef.current],(e.shards||[]).map(zC),!0).filter(Boolean);return S.forEach(function(x){return x.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),S.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=w.useCallback(function(S,x){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!l.current.allowPinchZoom;var E=_h(S),N=n.current,_="deltaX"in S?S.deltaX:N[0]-E[0],C="deltaY"in S?S.deltaY:N[1]-E[1],A,M=S.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in S&&R==="h"&&M.type==="range")return!1;var D=window.getSelection(),z=D&&D.anchorNode,G=z?z===M||z.contains(M):!1;if(G)return!1;var L=IC(R,M);if(!L)return!0;if(L?A=R:(A=R==="v"?"h":"v",L=IC(R,M)),!L)return!1;if(!r.current&&"changedTouches"in S&&(_||C)&&(r.current=A),!A)return!0;var F=r.current||A;return DV(F,x,S,F==="h"?_:C)},[]),d=w.useCallback(function(S){var x=S;if(!(!ul.length||ul[ul.length-1]!==o)){var E="deltaY"in x?LC(x):_h(x),N=t.current.filter(function(A){return A.name===x.type&&(A.target===x.target||x.target===A.shadowParent)&&PV(A.delta,E)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}if(!N){var _=(l.current.shards||[]).map(zC).filter(Boolean).filter(function(A){return A.contains(x.target)}),C=_.length>0?u(x,_[0]):!l.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),h=w.useCallback(function(S,x,E,N){var _={name:S,delta:x,target:E,should:N,shadowParent:LV(E)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),v=w.useCallback(function(S){n.current=_h(S),r.current=void 0},[]),m=w.useCallback(function(S){h(S.type,LC(S),S.target,u(S,e.lockRef.current))},[]),g=w.useCallback(function(S){h(S.type,_h(S),S.target,u(S,e.lockRef.current))},[]);w.useEffect(function(){return ul.push(o),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:g}),document.addEventListener("wheel",d,cl),document.addEventListener("touchmove",d,cl),document.addEventListener("touchstart",v,cl),function(){ul=ul.filter(function(S){return S!==o}),document.removeEventListener("wheel",d,cl),document.removeEventListener("touchmove",d,cl),document.removeEventListener("touchstart",v,cl)}},[]);var b=e.removeScrollBar,O=e.inert;return w.createElement(w.Fragment,null,O?w.createElement(o,{styles:kV(i)}):null,b?w.createElement(_V,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function LV(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const zV=hV(j5,IV);var Yp=w.forwardRef(function(e,t){return w.createElement(Vp,ca({},e,{ref:t,sideCar:zV}))});Yp.classNames=Vp.classNames;var nS=["Enter"," "],BV=["ArrowDown","PageUp","Home"],A5=["ArrowUp","PageDown","End"],qV=[...BV,...A5],UV={ltr:[...nS,"ArrowRight"],rtl:[...nS,"ArrowLeft"]},HV={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ff="Menu",[Xu,FV,GV]=kp(Ff),[cs,C5]=jn(Ff,[GV,io,hc]),Wp=io(),T5=hc(),[VV,us]=cs(Ff),[YV,Gf]=cs(Ff),M5=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:l=!0}=e,u=Wp(t),[d,h]=w.useState(null),v=w.useRef(!1),m=Wr(o),g=lc(i);return w.useEffect(()=>{const b=()=>{v.current=!0,document.addEventListener("pointerdown",O,{capture:!0,once:!0}),document.addEventListener("pointermove",O,{capture:!0,once:!0})},O=()=>v.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",O,{capture:!0}),document.removeEventListener("pointermove",O,{capture:!0})}},[]),c.jsx(Up,{...u,children:c.jsx(VV,{scope:t,open:n,onOpenChange:m,content:d,onContentChange:h,children:c.jsx(YV,{scope:t,onClose:w.useCallback(()=>m(!1),[m]),isUsingKeyboardRef:v,dir:g,modal:l,children:r})})})};M5.displayName=Ff;var WV="MenuAnchor",hO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Wp(n);return c.jsx(Hp,{...i,...r,ref:t})});hO.displayName=WV;var mO="MenuPortal",[KV,R5]=cs(mO,{forceMount:void 0}),D5=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=us(mO,t);return c.jsx(KV,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};D5.displayName=mO;var Tr="MenuContent",[XV,pO]=cs(Tr),P5=w.forwardRef((e,t)=>{const n=R5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=us(Tr,e.__scopeMenu),l=Gf(Tr,e.__scopeMenu);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(An,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:l.modal?c.jsx(QV,{...i,ref:t}):c.jsx(ZV,{...i,ref:t})})})})}),QV=w.forwardRef((e,t)=>{const n=us(Tr,e.__scopeMenu),r=w.useRef(null),i=Ue(t,r);return w.useEffect(()=>{const o=r.current;if(o)return dO(o)},[]),c.jsx(vO,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ye(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ZV=w.forwardRef((e,t)=>{const n=us(Tr,e.__scopeMenu);return c.jsx(vO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),JV=Tl("MenuContent.ScrollLock"),vO=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:b,disableOutsideScroll:O,...S}=e,x=us(Tr,n),E=Gf(Tr,n),N=Wp(n),_=T5(n),C=FV(n),[A,M]=w.useState(null),R=w.useRef(null),D=Ue(t,R,x.onContentChange),z=w.useRef(0),G=w.useRef(""),L=w.useRef(0),F=w.useRef(null),W=w.useRef("right"),Q=w.useRef(0),X=O?Yp:w.Fragment,k=O?{as:JV,allowPinchZoom:!0}:void 0,H=Z=>{var ie,pe;const le=G.current+Z,$=C().filter(re=>!re.disabled),Y=document.activeElement,q=(ie=$.find(re=>re.ref.current===Y))==null?void 0:ie.textValue,U=$.map(re=>re.textValue),ne=fY(U,le,q),fe=(pe=$.find(re=>re.textValue===ne))==null?void 0:pe.ref.current;(function re(ve){G.current=ve,window.clearTimeout(z.current),ve!==""&&(z.current=window.setTimeout(()=>re(""),1e3))})(le),fe&&setTimeout(()=>fe.focus())};w.useEffect(()=>()=>window.clearTimeout(z.current),[]),tO();const B=w.useCallback(Z=>{var $,Y;return W.current===(($=F.current)==null?void 0:$.side)&&hY(Z,(Y=F.current)==null?void 0:Y.area)},[]);return c.jsx(XV,{scope:n,searchRef:G,onItemEnter:w.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),onItemLeave:w.useCallback(Z=>{var le;B(Z)||((le=R.current)==null||le.focus(),M(null))},[B]),onTriggerLeave:w.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),pointerGraceTimerRef:L,onPointerGraceIntentChange:w.useCallback(Z=>{F.current=Z},[]),children:c.jsx(X,{...k,children:c.jsx($p,{asChild:!0,trapped:i,onMountAutoFocus:ye(o,Z=>{var le;Z.preventDefault(),(le=R.current)==null||le.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:h,onPointerDownOutside:v,onFocusOutside:m,onInteractOutside:g,onDismiss:b,children:c.jsx(uO,{asChild:!0,..._,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:M,onEntryFocus:ye(d,Z=>{E.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:c.jsx(Fp,{role:"menu","aria-orientation":"vertical","data-state":X5(x.open),"data-radix-menu-content":"",dir:E.dir,...N,...S,ref:D,style:{outline:"none",...S.style},onKeyDown:ye(S.onKeyDown,Z=>{const $=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,Y=Z.ctrlKey||Z.altKey||Z.metaKey,q=Z.key.length===1;$&&(Z.key==="Tab"&&Z.preventDefault(),!Y&&q&&H(Z.key));const U=R.current;if(Z.target!==U||!qV.includes(Z.key))return;Z.preventDefault();const fe=C().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);A5.includes(Z.key)&&fe.reverse(),cY(fe)}),onBlur:ye(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(z.current),G.current="")}),onPointerMove:ye(e.onPointerMove,Qu(Z=>{const le=Z.target,$=Q.current!==Z.clientX;if(Z.currentTarget.contains(le)&&$){const Y=Z.clientX>Q.current?"right":"left";W.current=Y,Q.current=Z.clientX}}))})})})})})})});P5.displayName=Tr;var eY="MenuGroup",gO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{role:"group",...r,ref:t})});gO.displayName=eY;var tY="MenuLabel",k5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{...r,ref:t})});k5.displayName=tY;var cm="MenuItem",BC="menu.itemSelect",Kp=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=w.useRef(null),l=Gf(cm,e.__scopeMenu),u=pO(cm,e.__scopeMenu),d=Ue(t,o),h=w.useRef(!1),v=()=>{const m=o.current;if(!n&&m){const g=new CustomEvent(BC,{bubbles:!0,cancelable:!0});m.addEventListener(BC,b=>r==null?void 0:r(b),{once:!0}),F$(m,g),g.defaultPrevented?h.current=!1:l.onClose()}};return c.jsx($5,{...i,ref:d,disabled:n,onClick:ye(e.onClick,v),onPointerDown:m=>{var g;(g=e.onPointerDown)==null||g.call(e,m),h.current=!0},onPointerUp:ye(e.onPointerUp,m=>{var g;h.current||(g=m.currentTarget)==null||g.click()}),onKeyDown:ye(e.onKeyDown,m=>{const g=u.searchRef.current!=="";n||g&&m.key===" "||nS.includes(m.key)&&(m.currentTarget.click(),m.preventDefault())})})});Kp.displayName=cm;var $5=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,l=pO(cm,n),u=T5(n),d=w.useRef(null),h=Ue(t,d),[v,m]=w.useState(!1),[g,b]=w.useState("");return w.useEffect(()=>{const O=d.current;O&&b((O.textContent??"").trim())},[o.children]),c.jsx(Xu.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:c.jsx(fO,{asChild:!0,...u,focusable:!r,children:c.jsx(Ne.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:h,onPointerMove:ye(e.onPointerMove,Qu(O=>{r?l.onItemLeave(O):(l.onItemEnter(O),O.defaultPrevented||O.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ye(e.onPointerLeave,Qu(O=>l.onItemLeave(O))),onFocus:ye(e.onFocus,()=>m(!0)),onBlur:ye(e.onBlur,()=>m(!1))})})})}),nY="MenuCheckboxItem",I5=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return c.jsx(U5,{scope:e.__scopeMenu,checked:n,children:c.jsx(Kp,{role:"menuitemcheckbox","aria-checked":um(n)?"mixed":n,...i,ref:t,"data-state":bO(n),onSelect:ye(i.onSelect,()=>r==null?void 0:r(um(n)?!0:!n),{checkForDefaultPrevented:!1})})})});I5.displayName=nY;var L5="MenuRadioGroup",[rY,aY]=cs(L5,{value:void 0,onValueChange:()=>{}}),z5=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=Wr(r);return c.jsx(rY,{scope:e.__scopeMenu,value:n,onValueChange:o,children:c.jsx(gO,{...i,ref:t})})});z5.displayName=L5;var B5="MenuRadioItem",q5=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=aY(B5,e.__scopeMenu),o=n===i.value;return c.jsx(U5,{scope:e.__scopeMenu,checked:o,children:c.jsx(Kp,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":bO(o),onSelect:ye(r.onSelect,()=>{var l;return(l=i.onValueChange)==null?void 0:l.call(i,n)},{checkForDefaultPrevented:!1})})})});q5.displayName=B5;var yO="MenuItemIndicator",[U5,iY]=cs(yO,{checked:!1}),H5=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=iY(yO,n);return c.jsx(An,{present:r||um(o.checked)||o.checked===!0,children:c.jsx(Ne.span,{...i,ref:t,"data-state":bO(o.checked)})})});H5.displayName=yO;var oY="MenuSeparator",F5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return c.jsx(Ne.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});F5.displayName=oY;var sY="MenuArrow",G5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=Wp(n);return c.jsx(Gp,{...i,...r,ref:t})});G5.displayName=sY;var lY="MenuSub",[cye,V5]=cs(lY),Ru="MenuSubTrigger",Y5=w.forwardRef((e,t)=>{const n=us(Ru,e.__scopeMenu),r=Gf(Ru,e.__scopeMenu),i=V5(Ru,e.__scopeMenu),o=pO(Ru,e.__scopeMenu),l=w.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=o,h={__scopeMenu:e.__scopeMenu},v=w.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return w.useEffect(()=>v,[v]),w.useEffect(()=>{const m=u.current;return()=>{window.clearTimeout(m),d(null)}},[u,d]),c.jsx(hO,{asChild:!0,...h,children:c.jsx($5,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":X5(n.open),...e,ref:qf(t,i.onTriggerChange),onClick:m=>{var g;(g=e.onClick)==null||g.call(e,m),!(e.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ye(e.onPointerMove,Qu(m=>{o.onItemEnter(m),!m.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(o.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),v()},100))})),onPointerLeave:ye(e.onPointerLeave,Qu(m=>{var b,O;v();const g=(b=n.content)==null?void 0:b.getBoundingClientRect();if(g){const S=(O=n.content)==null?void 0:O.dataset.side,x=S==="right",E=x?-5:5,N=g[x?"left":"right"],_=g[x?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+E,y:m.clientY},{x:N,y:g.top},{x:_,y:g.top},{x:_,y:g.bottom},{x:N,y:g.bottom}],side:S}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:ye(e.onKeyDown,m=>{var b;const g=o.searchRef.current!=="";e.disabled||g&&m.key===" "||UV[r.dir].includes(m.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),m.preventDefault())})})})});Y5.displayName=Ru;var W5="MenuSubContent",K5=w.forwardRef((e,t)=>{const n=R5(Tr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=us(Tr,e.__scopeMenu),l=Gf(Tr,e.__scopeMenu),u=V5(W5,e.__scopeMenu),d=w.useRef(null),h=Ue(t,d);return c.jsx(Xu.Provider,{scope:e.__scopeMenu,children:c.jsx(An,{present:r||o.open,children:c.jsx(Xu.Slot,{scope:e.__scopeMenu,children:c.jsx(vO,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:h,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var m;l.isUsingKeyboardRef.current&&((m=d.current)==null||m.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:ye(e.onFocusOutside,v=>{v.target!==u.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:ye(e.onEscapeKeyDown,v=>{l.onClose(),v.preventDefault()}),onKeyDown:ye(e.onKeyDown,v=>{var b;const m=v.currentTarget.contains(v.target),g=HV[l.dir].includes(v.key);m&&g&&(o.onOpenChange(!1),(b=u.trigger)==null||b.focus(),v.preventDefault())})})})})})});K5.displayName=W5;function X5(e){return e?"open":"closed"}function um(e){return e==="indeterminate"}function bO(e){return um(e)?"indeterminate":e?"checked":"unchecked"}function cY(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function uY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function fY(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=uY(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function dY(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],h=u.x,v=u.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function hY(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return dY(n,t)}function Qu(e){return t=>t.pointerType==="mouse"?e(t):void 0}var mY=M5,pY=hO,vY=D5,gY=P5,yY=gO,bY=k5,xY=Kp,wY=I5,SY=z5,jY=q5,OY=H5,EY=F5,_Y=G5,NY=Y5,AY=K5,Xp="DropdownMenu",[CY]=jn(Xp,[C5]),Cn=C5(),[TY,Q5]=CY(Xp),Z5=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,d=Cn(t),h=w.useRef(null),[v,m]=Nn({prop:i,defaultProp:o??!1,onChange:l,caller:Xp});return c.jsx(TY,{scope:t,triggerId:Cr(),triggerRef:h,contentId:Cr(),open:v,onOpenChange:m,onOpenToggle:w.useCallback(()=>m(g=>!g),[m]),modal:u,children:c.jsx(mY,{...d,open:v,onOpenChange:m,dir:r,modal:u,children:n})})};Z5.displayName=Xp;var J5="DropdownMenuTrigger",eI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=Q5(J5,n),l=Cn(n);return c.jsx(pY,{asChild:!0,...l,children:c.jsx(Ne.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:qf(t,o.triggerRef),onPointerDown:ye(e.onPointerDown,u=>{!r&&u.button===0&&u.ctrlKey===!1&&(o.onOpenToggle(),o.open||u.preventDefault())}),onKeyDown:ye(e.onKeyDown,u=>{r||(["Enter"," "].includes(u.key)&&o.onOpenToggle(),u.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});eI.displayName=J5;var MY="DropdownMenuPortal",tI=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Cn(t);return c.jsx(vY,{...r,...n})};tI.displayName=MY;var nI="DropdownMenuContent",rI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Q5(nI,n),o=Cn(n),l=w.useRef(!1);return c.jsx(gY,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:ye(e.onCloseAutoFocus,u=>{var d;l.current||(d=i.triggerRef.current)==null||d.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:ye(e.onInteractOutside,u=>{const d=u.detail.originalEvent,h=d.button===0&&d.ctrlKey===!0,v=d.button===2||h;(!i.modal||v)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});rI.displayName=nI;var RY="DropdownMenuGroup",DY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(yY,{...i,...r,ref:t})});DY.displayName=RY;var PY="DropdownMenuLabel",aI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(bY,{...i,...r,ref:t})});aI.displayName=PY;var kY="DropdownMenuItem",iI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(xY,{...i,...r,ref:t})});iI.displayName=kY;var $Y="DropdownMenuCheckboxItem",oI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(wY,{...i,...r,ref:t})});oI.displayName=$Y;var IY="DropdownMenuRadioGroup",LY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(SY,{...i,...r,ref:t})});LY.displayName=IY;var zY="DropdownMenuRadioItem",BY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(jY,{...i,...r,ref:t})});BY.displayName=zY;var qY="DropdownMenuItemIndicator",sI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(OY,{...i,...r,ref:t})});sI.displayName=qY;var UY="DropdownMenuSeparator",lI=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(EY,{...i,...r,ref:t})});lI.displayName=UY;var HY="DropdownMenuArrow",FY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(_Y,{...i,...r,ref:t})});FY.displayName=HY;var GY="DropdownMenuSubTrigger",VY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(NY,{...i,...r,ref:t})});VY.displayName=GY;var YY="DropdownMenuSubContent",WY=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Cn(n);return c.jsx(AY,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});WY.displayName=YY;var KY=Z5,XY=eI,QY=tI,ZY=rI,JY=aI,eW=iI,tW=oI,nW=sI,rW=lI;function cI({...e}){return c.jsx(KY,{"data-slot":"dropdown-menu",...e})}function uI({...e}){return c.jsx(XY,{"data-slot":"dropdown-menu-trigger",...e})}function fI({className:e,sideOffset:t=4,...n}){return c.jsx(QY,{children:c.jsx(ZY,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-[--radix-dropdown-menu-content-available-height] min-w-[8rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dropdown-menu-content",sideOffset:t,...n})})}function qC({className:e,inset:t,variant:n="default",...r}){return c.jsx(eW,{className:me("data-[variant=destructive]:*:[svg]:!text-destructive relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[disabled]:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-inset":t,"data-slot":"dropdown-menu-item","data-variant":n,...r})}function aW({className:e,children:t,checked:n,...r}){return c.jsxs(tW,{checked:n,className:me("relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"dropdown-menu-checkbox-item",...r,children:[c.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:c.jsx(nW,{children:c.jsx(ri,{className:"size-4"})})}),t]})}function dI({className:e,inset:t,...n}){return c.jsx(JY,{className:me("px-2 py-1.5 font-medium text-sm data-[inset]:pl-8",e),"data-inset":t,"data-slot":"dropdown-menu-label",...n})}function rS({className:e,...t}){return c.jsx(rW,{className:me("-mx-1 my-1 h-px bg-border",e),"data-slot":"dropdown-menu-separator",...t})}const UC=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,HC=rt,mc=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return HC(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,l=Object.keys(i).map(h=>{const v=n==null?void 0:n[h],m=o==null?void 0:o[h];if(v===null)return null;const g=UC(v)||UC(m);return i[h][g]}),u=n&&Object.entries(n).reduce((h,v)=>{let[m,g]=v;return g===void 0||(h[m]=g),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,v)=>{let{class:m,className:g,...b}=v;return Object.entries(b).every(O=>{let[S,x]=O;return Array.isArray(x)?x.includes({...o,...u}[S]):{...o,...u}[S]===x})?[...h,m,g]:h},[]);return HC(e,l,d,n==null?void 0:n.class,n==null?void 0:n.className)},xO=mc("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:e,variant:t,size:n,asChild:r=!1,...i}){const o=r?ss:"button";return c.jsx(o,{className:me(xO({variant:t,size:n,className:e})),"data-slot":"button",...i})}const oo=w.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{className:me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,type:t,...n}));oo.displayName="Input";var iW="Separator",FC="horizontal",oW=["horizontal","vertical"],hI=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=FC,...i}=e,o=sW(r)?r:FC,u=n?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return c.jsx(ls.div,{"data-orientation":o,...u,...i,ref:t})});hI.displayName=iW;function sW(e){return oW.includes(e)}var lW=hI;function qt({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return c.jsx(lW,{className:me("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px",e),"data-slot":"separator",decorative:n,orientation:t,...r})}var Qp="Dialog",[mI,pI]=jn(Qp),[cW,Jr]=mI(Qp),vI=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,u=w.useRef(null),d=w.useRef(null),[h,v]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:Qp});return c.jsx(cW,{scope:t,triggerRef:u,contentRef:d,contentId:Cr(),titleId:Cr(),descriptionId:Cr(),open:h,onOpenChange:v,onOpenToggle:w.useCallback(()=>v(m=>!m),[v]),modal:l,children:n})};vI.displayName=Qp;var gI="DialogTrigger",yI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(gI,n),o=Ue(t,i.triggerRef);return c.jsx(Ne.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":jO(i.open),...r,ref:o,onClick:ye(e.onClick,i.onOpenToggle)})});yI.displayName=gI;var wO="DialogPortal",[uW,bI]=mI(wO,{forceMount:void 0}),xI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,o=Jr(wO,t);return c.jsx(uW,{scope:t,forceMount:n,children:w.Children.map(r,l=>c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:l})}))})};xI.displayName=wO;var fm="DialogOverlay",wI=w.forwardRef((e,t)=>{const n=bI(fm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jr(fm,e.__scopeDialog);return o.modal?c.jsx(An,{present:r||o.open,children:c.jsx(dW,{...i,ref:t})}):null});wI.displayName=fm;var fW=Tl("DialogOverlay.RemoveScroll"),dW=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(fm,n);return c.jsx(Yp,{as:fW,allowPinchZoom:!0,shards:[i.contentRef],children:c.jsx(Ne.div,{"data-state":jO(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Jo="DialogContent",SI=w.forwardRef((e,t)=>{const n=bI(Jo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Jr(Jo,e.__scopeDialog);return c.jsx(An,{present:r||o.open,children:o.modal?c.jsx(hW,{...i,ref:t}):c.jsx(mW,{...i,ref:t})})});SI.displayName=Jo;var hW=w.forwardRef((e,t)=>{const n=Jr(Jo,e.__scopeDialog),r=w.useRef(null),i=Ue(t,n.contentRef,r);return w.useEffect(()=>{const o=r.current;if(o)return dO(o)},[]),c.jsx(jI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ye(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:ye(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:ye(e.onFocusOutside,o=>o.preventDefault())})}),mW=w.forwardRef((e,t)=>{const n=Jr(Jo,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return c.jsx(jI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var l,u;(l=e.onCloseAutoFocus)==null||l.call(e,o),o.defaultPrevented||(r.current||(u=n.triggerRef.current)==null||u.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var d,h;(d=e.onInteractOutside)==null||d.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=o.target;((h=n.triggerRef.current)==null?void 0:h.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),jI=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...l}=e,u=Jr(Jo,n),d=w.useRef(null),h=Ue(t,d);return tO(),c.jsxs(c.Fragment,{children:[c.jsx($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:c.jsx(cc,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":jO(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(vW,{titleId:u.titleId}),c.jsx(yW,{contentRef:d,descriptionId:u.descriptionId})]})]})}),SO="DialogTitle",OI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(SO,n);return c.jsx(Ne.h2,{id:i.titleId,...r,ref:t})});OI.displayName=SO;var EI="DialogDescription",_I=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(EI,n);return c.jsx(Ne.p,{id:i.descriptionId,...r,ref:t})});_I.displayName=EI;var NI="DialogClose",AI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Jr(NI,n);return c.jsx(Ne.button,{type:"button",...r,ref:t,onClick:ye(e.onClick,()=>i.onOpenChange(!1))})});AI.displayName=NI;function jO(e){return e?"open":"closed"}var CI="DialogTitleWarning",[pW,TI]=K7(CI,{contentName:Jo,titleName:SO,docsSlug:"dialog"}),vW=({titleId:e})=>{const t=TI(CI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
414
414
|
|
|
415
415
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
416
416
|
|
|
417
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vW="DialogDescriptionWarning",gW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${AI(vW).contentName}}.`;return w.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},OO=mI,yW=vI,EO=yI,_O=bI,NO=xI,AO=SI,CO=OI,Zp=_I;function bW({...e}){return c.jsx(OO,{"data-slot":"sheet",...e})}function xW({...e}){return c.jsx(EO,{"data-slot":"sheet-portal",...e})}function wW({className:e,...t}){return c.jsx(_O,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"sheet-overlay",...t})}function SW({className:e,children:t,side:n="right",...r}){return c.jsxs(xW,{children:[c.jsx(wW,{}),c.jsxs(NO,{className:me("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),"data-slot":"sheet-content",...r,children:[t,c.jsxs(Zp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(or,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jW({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-1.5 p-4",e),"data-slot":"sheet-header",...t})}function OW({className:e,...t}){return c.jsx(AO,{className:me("font-semibold text-foreground",e),"data-slot":"sheet-title",...t})}function EW({className:e,...t}){return c.jsx(CO,{className:me("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t})}function Re({className:e,...t}){return c.jsx("div",{className:me("animate-pulse rounded-md bg-accent",e),"data-slot":"skeleton",...t})}var CI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),_W="VisuallyHidden",TI=w.forwardRef((e,t)=>c.jsx(Ne.span,{...e,ref:t,style:{...CI,...e.style}}));TI.displayName=_W;var NW=TI,[Jp]=jn("Tooltip",[io]),ev=io(),MI="TooltipProvider",AW=700,aS="tooltip.open",[CW,TO]=Jp(MI),RI=e=>{const{__scopeTooltip:t,delayDuration:n=AW,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=w.useRef(!0),u=w.useRef(!1),d=w.useRef(0);return w.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),c.jsx(CW,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:w.useCallback(h=>{u.current=h},[]),disableHoverableContent:i,children:o})};RI.displayName=MI;var Zu="Tooltip",[TW,Vf]=Jp(Zu),DI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=TO(Zu,e.__scopeTooltip),h=ev(t),[v,m]=w.useState(null),g=Cr(),b=w.useRef(0),O=l??d.disableHoverableContent,S=u??d.delayDuration,x=w.useRef(!1),[E,N]=Nn({prop:r,defaultProp:i??!1,onChange:R=>{R?(d.onOpen(),document.dispatchEvent(new CustomEvent(aS))):d.onClose(),o==null||o(R)},caller:Zu}),_=w.useMemo(()=>E?x.current?"delayed-open":"instant-open":"closed",[E]),C=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,N(!0)},[N]),A=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,N(!0),b.current=0},S)},[S,N]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),c.jsx(Up,{...h,children:c.jsx(TW,{scope:t,contentId:g,open:E,stateAttribute:_,trigger:v,onTriggerChange:m,onTriggerEnter:w.useCallback(()=>{d.isOpenDelayedRef.current?M():C()},[d.isOpenDelayedRef,M,C]),onTriggerLeave:w.useCallback(()=>{O?A():(window.clearTimeout(b.current),b.current=0)},[A,O]),onOpen:C,onClose:A,disableHoverableContent:O,children:n})})};DI.displayName=Zu;var iS="TooltipTrigger",PI=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Vf(iS,n),o=TO(iS,n),l=ev(n),u=w.useRef(null),d=Ue(t,u,i.onTriggerChange),h=w.useRef(!1),v=w.useRef(!1),m=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(Hp,{asChild:!0,...l,children:c.jsx(Ne.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:ye(e.onPointerMove,g=>{g.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ye(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:ye(e.onBlur,i.onClose),onClick:ye(e.onClick,i.onClose)})})});PI.displayName=iS;var MO="TooltipPortal",[MW,RW]=Jp(MO,{forceMount:void 0}),kI=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Vf(MO,t);return c.jsx(MW,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};kI.displayName=MO;var Rl="TooltipContent",$I=w.forwardRef((e,t)=>{const n=RW(Rl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Vf(Rl,e.__scopeTooltip);return c.jsx(An,{present:r||l.open,children:l.disableHoverableContent?c.jsx(II,{side:i,...o,ref:t}):c.jsx(DW,{side:i,...o,ref:t})})}),DW=w.forwardRef((e,t)=>{const n=Vf(Rl,e.__scopeTooltip),r=TO(Rl,e.__scopeTooltip),i=w.useRef(null),o=Ue(t,i),[l,u]=w.useState(null),{trigger:d,onClose:h}=n,v=i.current,{onPointerInTransitChange:m}=r,g=w.useCallback(()=>{u(null),m(!1)},[m]),b=w.useCallback((O,S)=>{const x=O.currentTarget,E={x:O.clientX,y:O.clientY},N=IW(E,x.getBoundingClientRect()),_=LW(E,N),C=zW(S.getBoundingClientRect()),A=qW([..._,...C]);u(A),m(!0)},[m]);return w.useEffect(()=>()=>g(),[g]),w.useEffect(()=>{if(d&&v){const O=x=>b(x,v),S=x=>b(x,d);return d.addEventListener("pointerleave",O),v.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",O),v.removeEventListener("pointerleave",S)}}},[d,v,b,g]),w.useEffect(()=>{if(l){const O=S=>{const x=S.target,E={x:S.clientX,y:S.clientY},N=(d==null?void 0:d.contains(x))||(v==null?void 0:v.contains(x)),_=!BW(E,l);N?g():_&&(g(),h())};return document.addEventListener("pointermove",O),()=>document.removeEventListener("pointermove",O)}},[d,v,l,h,g]),c.jsx(II,{...e,ref:o})}),[PW,kW]=Jp(Zu,{isInside:!1}),$W=q$("TooltipContent"),II=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=Vf(Rl,n),h=ev(n),{onClose:v}=d;return w.useEffect(()=>(document.addEventListener(aS,v),()=>document.removeEventListener(aS,v)),[v]),w.useEffect(()=>{if(d.trigger){const m=g=>{const b=g.target;b!=null&&b.contains(d.trigger)&&v()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,v]),c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:v,children:c.jsxs(Fp,{"data-state":d.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx($W,{children:r}),c.jsx(PW,{scope:n,isInside:!0,children:c.jsx(NW,{id:d.contentId,role:"tooltip",children:i||r})})]})})});$I.displayName=Rl;var LI="TooltipArrow",zI=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ev(n);return kW(LI,n).isInside?null:c.jsx(Gp,{...i,...r,ref:t})});zI.displayName=LI;function IW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function LW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function zW(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function BW(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],h=u.x,v=u.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function qW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),UW(t)}function UW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var HW=RI,FW=DI,GW=PI,VW=kI,YW=$I,WW=zI;function BI({delayDuration:e=0,...t}){return c.jsx(HW,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function tv({...e}){return c.jsx(BI,{children:c.jsx(FW,{"data-slot":"tooltip",...e})})}function nv({...e}){return c.jsx(GW,{"data-slot":"tooltip-trigger",...e})}function rv({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(VW,{children:c.jsxs(YW,{className:me("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out",e),"data-slot":"tooltip-content",sideOffset:t,...r,children:[n,c.jsx(WW,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Lb=768;function KW(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Lb-1}px)`),r=()=>{t(window.innerWidth<Lb)};return n.addEventListener("change",r),t(window.innerWidth<Lb),()=>n.removeEventListener("change",r)},[]),!!e}const XW="sidebar_state",QW=3600*24*7,ZW="16rem",JW="18rem",eK="3rem",tK="b",qI=w.createContext(null);function pc(){const e=w.useContext(qI);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const UI=w.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...l},u)=>{const d=KW(),[h,v]=w.useState(!1),[m,g]=w.useState(e),b=t??m,O=w.useCallback(N=>{const _=typeof N=="function"?N(b):N;n?n(_):g(_),document.cookie=`${XW}=${_}; path=/; max-age=${QW}`},[n,b]),S=w.useCallback(()=>d?v(N=>!N):O(N=>!N),[d,O]);w.useEffect(()=>{const N=_=>{_.key===tK&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),S())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[S]);const x=b?"expanded":"collapsed",E=w.useMemo(()=>({state:x,open:b,setOpen:O,isMobile:d,openMobile:h,setOpenMobile:v,toggleSidebar:S}),[x,b,O,d,h,S]);return c.jsx(qI.Provider,{value:E,children:c.jsx(BI,{delayDuration:0,children:c.jsx("div",{className:me("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:u,style:{"--sidebar-width":ZW,"--sidebar-width-icon":eK,...i},...l,children:o})})})});UI.displayName="SidebarProvider";const Qh=w.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,...o},l)=>{const{isMobile:u,state:d,openMobile:h,setOpenMobile:v}=pc();return n==="none"?c.jsx("div",{className:me("flex h-full w-[calc(var(--sidebar-width)-var(--sidebar-width-icon)+1px)]! flex-col bg-sidebar text-sidebar-foreground",r),ref:l,...o,children:i}):u?c.jsx(bW,{onOpenChange:v,open:h,...o,children:c.jsxs(SW,{className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",side:e,style:{"--sidebar-width":JW},children:[c.jsxs(jW,{className:"sr-only",children:[c.jsx(OW,{children:"Sidebar"}),c.jsx(EW,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":d==="collapsed"?n:"","data-side":e,"data-state":d,"data-variant":t,ref:l,children:[c.jsx("div",{className:me("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),c.jsx("div",{className:me("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...o,children:c.jsx("div",{className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:i})})]})});Qh.displayName="Sidebar";const HI=w.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:i}=pc();return c.jsxs(Ce,{className:me("h-7 w-7",e),"data-sidebar":"trigger",onClick:o=>{t==null||t(o),i()},ref:r,size:"icon",variant:"ghost",...n,children:[c.jsx(DF,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});HI.displayName="SidebarTrigger";const nK=w.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=pc();return c.jsx("button",{"aria-label":"Toggle Sidebar",className:me("-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",onClick:r,ref:n,tabIndex:-1,title:"Toggle Sidebar",...t})});nK.displayName="SidebarRail";const FI=w.forwardRef(({className:e,...t},n)=>c.jsx("main",{className:me("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),ref:n,...t}));FI.displayName="SidebarInset";const GI=w.forwardRef(({className:e,...t},n)=>c.jsx(oo,{className:me("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),"data-sidebar":"input",ref:n,...t}));GI.displayName="SidebarInput";const oS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex flex-col gap-2 p-2",e),"data-sidebar":"header",ref:n,...t}));oS.displayName="SidebarHeader";const VI=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",ref:n,...t}));VI.displayName="SidebarFooter";const rK=w.forwardRef(({className:e,...t},n)=>c.jsx(qt,{className:me("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",ref:n,...t}));rK.displayName="SidebarSeparator";const sS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",ref:n,...t}));sS.displayName="SidebarContent";const lS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",ref:n,...t}));lS.displayName="SidebarGroup";const aK=w.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const i=t?ss:"div";return c.jsx(i,{className:me("flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),"data-sidebar":"group-label",ref:r,...n})});aK.displayName="SidebarGroupLabel";const iK=w.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const i=t?ss:"button";return c.jsx(i,{className:me("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:-inset-2 after:absolute after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",ref:r,...n})});iK.displayName="SidebarGroupAction";const cS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("w-full text-sm",e),"data-sidebar":"group-content",ref:n,...t}));cS.displayName="SidebarGroupContent";const dm=w.forwardRef(({className:e,...t},n)=>c.jsx("ul",{className:me("flex w-full min-w-0 flex-col gap-1",e),"data-sidebar":"menu",ref:n,...t}));dm.displayName="SidebarMenu";const hm=w.forwardRef(({className:e,...t},n)=>c.jsx("li",{className:me("group/menu-item relative",e),"data-sidebar":"menu-item",ref:n,...t}));hm.displayName="SidebarMenuItem";const oK=mc("peer/menu-button group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"group-data-[collapsible=icon]:!p-0 h-12 text-sm"}},defaultVariants:{variant:"default",size:"default"}}),mm=w.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...l},u)=>{const d=e?ss:"button",{isMobile:h,state:v}=pc(),m=c.jsx(d,{className:me(oK({variant:n,size:r}),o),"data-active":t,"data-sidebar":"menu-button","data-size":r,ref:u,...l});return i?(typeof i=="string"&&(i={children:i}),c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:m}),c.jsx(rv,{align:"center",hidden:v!=="collapsed"||h,side:"right",...i})]})):m});mm.displayName="SidebarMenuButton";const sK=w.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>{const o=t?ss:"button";return c.jsx(o,{className:me("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:-inset-2 after:absolute after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",ref:i,...r})});sK.displayName="SidebarMenuAction";const lK=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 font-medium text-sidebar-foreground text-xs tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",ref:n,...t}));lK.displayName="SidebarMenuBadge";const cK=w.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const i=w.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return c.jsxs("div",{className:me("flex h-8 items-center gap-2 rounded-md px-2",e),"data-sidebar":"menu-skeleton",ref:r,...n,children:[t&&c.jsx(Re,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),c.jsx(Re,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});cK.displayName="SidebarMenuSkeleton";const uK=w.forwardRef(({className:e,...t},n)=>c.jsx("ul",{className:me("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",ref:n,...t}));uK.displayName="SidebarMenuSub";const fK=w.forwardRef(({...e},t)=>c.jsx("li",{ref:t,...e}));fK.displayName="SidebarMenuSubItem";const dK=w.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...i},o)=>{const l=e?ss:"a";return c.jsx(l,{className:me("-translate-x-px flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),"data-active":n,"data-sidebar":"menu-sub-button","data-size":t,ref:o,...i})});dK.displayName="SidebarMenuSubButton";const hK={theme:"system",setTheme:()=>null},YI=w.createContext(hK),WI=()=>{const e=w.useContext(YI);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};function mK({user:e}){const{isMobile:t}=pc(),{theme:n,setTheme:r}=WI(),[i,o]=w.useState(null),[l,u]=w.useState(0);w.useEffect(()=>{(async()=>{try{const g=sessionStorage.getItem("wraps-auth-token");if(!g){console.log("No auth token found yet, will retry..."),l<5&&setTimeout(()=>{u(O=>O+1)},200);return}console.log("Fetching user info from /api/user");const b=await fetch(`/api/user?token=${g}`);if(console.log("User API response status:",b.status),b.ok){const O=await b.json();console.log("User info received:",O),o(O)}else{const O=await b.text();console.error("Failed to fetch user info:",b.status,O)}}catch(g){console.error("Error fetching user info:",g)}})().catch(g=>{console.error("Failed to fetch user info:",g)})},[l]);const d=()=>{window.confirm("Are you sure you want to close the console?")&&window.close()},h=(i==null?void 0:i.accountAlias)||(i==null?void 0:i.accountId)||"Loading...",v=(i==null?void 0:i.region)||"...";return c.jsx(dm,{children:c.jsx(hm,{children:c.jsxs(sI,{children:[c.jsx(lI,{asChild:!0,children:c.jsxs(mm,{className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground md:h-8 md:p-0",size:"lg",children:[c.jsxs(mC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(pC,{alt:h,src:e.avatar}),c.jsx(vC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v})]}),c.jsx(jF,{className:"ml-auto size-4"})]})}),c.jsxs(cI,{align:"end",className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",sideOffset:4,children:[c.jsx(uI,{className:"p-0 font-normal",children:c.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[c.jsxs(mC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(pC,{alt:h,src:e.avatar}),c.jsx(vC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v}),(i==null?void 0:i.accountId)&&i.accountId!==i.accountAlias&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:i.accountId})]})]})}),c.jsx(rS,{}),c.jsxs(qC,{onClick:()=>r(n==="dark"?"light":"dark"),children:[n==="dark"?c.jsx(kF,{}):c.jsx(MF,{}),n==="dark"?"Light Mode":"Dark Mode"]}),c.jsx(rS,{}),c.jsxs(qC,{onClick:d,children:[c.jsx(or,{}),"Close Console"]})]})]})})})}const Hi={user:{name:"Wraps Console",email:"admin@wraps.dev",avatar:"/avatars/wraps.jpg"},navMain:[{title:"Dashboard",url:"/",icon:Dp,isActive:!0,isDashboard:!0},{title:"Email",url:"#",icon:xl,isActive:!1,subItems:[{title:"Emails",icon:xl,url:"/email"},{title:"Metrics",icon:wb,url:"/email/metrics"},{title:"Settings",icon:jb,url:"/email/settings"}]},{title:"SMS",url:"#",icon:Zi,isActive:!1,subItems:[{title:"Messages",icon:Zi,url:"/sms"},{title:"Metrics",icon:wb,url:"/sms/metrics"},{title:"Settings",icon:jb,url:"/sms/settings"}]},{title:"CDN",url:"#",icon:zf,isActive:!1,subItems:[{title:"Library",icon:h$,url:"/cdn"},{title:"Metrics",icon:wb,url:"/cdn/metrics"},{title:"Settings",icon:jb,url:"/cdn/settings"}]}]};function pK({...e}){const t=Zr(),n=Sa(),{setOpen:r,state:i}=pc(),{theme:o}=WI(),l=w.useCallback(()=>t.pathname==="/"?Hi.navMain[0]:t.pathname.startsWith("/email")?Hi.navMain[1]:t.pathname.startsWith("/sms")?Hi.navMain[2]:t.pathname.startsWith("/cdn")?Hi.navMain[3]:Hi.navMain[0],[t.pathname]),[u,d]=w.useState(l());return w.useEffect(()=>{d(l())},[l]),c.jsxs(Qh,{className:"overflow-hidden *:data-[sidebar=sidebar]:flex-row",collapsible:"icon",...e,children:[c.jsxs(Qh,{className:"w-[calc(var(--sidebar-width-icon)+1px)]! border-r",collapsible:"none",children:[c.jsx(oS,{children:c.jsx(dm,{children:c.jsx(hm,{children:c.jsx(mm,{asChild:!0,className:"md:h-8 md:p-0",onClick:()=>{d(Hi.navMain[0]),r(!1)},size:"lg",children:c.jsxs(em,{to:"/",children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg",children:c.jsx("img",{alt:"Wraps",className:"size-8 object-contain",src:o==="dark"?"/wraps-dark.png":"/wraps-light.png"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:"Wraps"}),c.jsx("span",{className:"truncate text-xs",children:"Console"})]})]})})})})}),c.jsx(sS,{children:c.jsx(lS,{children:c.jsx(cS,{className:"px-1.5 md:px-0",children:c.jsx(dm,{children:Hi.navMain.filter(h=>!h.isDashboard).map(h=>c.jsx(hm,{children:c.jsxs(mm,{className:"px-2.5 md:px-2",isActive:(u==null?void 0:u.title)===h.title,onClick:()=>{d(h),r(!0),h.subItems&&h.subItems.length>0&&n(h.subItems[0].url)},tooltip:{children:h.title,hidden:!1},children:[c.jsx(h.icon,{}),c.jsx("span",{children:h.title})]})},h.title))})})})}),c.jsx(VI,{children:c.jsx(mK,{user:Hi.user})})]}),i==="expanded"&&c.jsx(Qh,{className:"hidden flex-1 md:flex",collapsible:"none",children:u&&!u.isDashboard&&u.subItems?c.jsxs(c.Fragment,{children:[c.jsxs(oS,{className:"gap-3.5 border-b p-4",children:[c.jsx("div",{className:"flex w-full items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-2 font-medium text-base text-foreground",children:[c.jsx(u.icon,{className:"size-4"}),u.title]})}),c.jsx(GI,{placeholder:"Search..."})]}),c.jsx(sS,{children:c.jsx(lS,{className:"px-0",children:c.jsx(cS,{children:u.subItems.map(h=>{const v=t.pathname===h.url||h.url==="/email"&&t.pathname.startsWith("/email/")&&t.pathname!=="/email/metrics"&&t.pathname!=="/email/settings"||h.url==="/sms"&&t.pathname.startsWith("/sms/")&&t.pathname!=="/sms/metrics"&&t.pathname!=="/sms/settings"||h.url==="/cdn"&&t.pathname.startsWith("/cdn/")&&t.pathname!=="/cdn/metrics"&&t.pathname!=="/cdn/settings";return c.jsxs(em,{className:`flex items-center gap-3 border-b p-4 text-sm leading-tight transition-colors last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground ${v?"bg-sidebar-accent font-semibold text-sidebar-accent-foreground":""}`,to:h.url,children:[c.jsx(h.icon,{className:"size-4 shrink-0"}),c.jsx("span",{className:"font-medium",children:h.title})]},h.title)})})})})]}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"text-muted-foreground",children:[c.jsx(Dp,{className:"mx-auto mb-4 size-12 opacity-50"}),c.jsx("p",{className:"text-sm",children:"Select a product to view options"})]})})})]})}function vK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const gK=e=>{switch(e){case"success":return xK;case"info":return SK;case"warning":return wK;case"error":return jK;default:return null}},yK=Array(12).fill(0),bK=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},yK.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),xK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),SK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),OK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),EK=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let uS=1;class _K{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:uS++,l=this.toasts.find(d=>d.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:u,title:r}):d):this.addToast({title:r,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const u=i.then(async h=>{if(l=["resolve",h],I.isValidElement(h))o=!1,this.create({id:r,type:"default",message:h});else if(AK(h)&&!h.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(h instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(h):n.error,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(h):n.success,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:g,...O})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){o=!1;const v=typeof n.error=="function"?await n.error(h):n.error,m=typeof n.description=="function"?await n.description(h):n.description,b=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:r,type:"error",description:m,...b})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,v)=>u.then(()=>l[0]==="reject"?v(l[1]):h(l[1])).catch(v));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||uS++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qn=new _K,NK=(e,t)=>{const n=(t==null?void 0:t.id)||uS++;return qn.addToast({title:e,...t,id:n}),n},AK=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",CK=NK,TK=()=>qn.toasts,MK=()=>qn.getActiveToasts(),Ot=Object.assign(CK,{success:qn.success,info:qn.info,warning:qn.warning,error:qn.error,custom:qn.custom,message:qn.message,promise:qn.promise,dismiss:qn.dismiss,loading:qn.loading},{getHistory:TK,getToasts:MK});vK("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Nh(e){return e.label!==void 0}const RK=3,DK="24px",PK="16px",GC=4e3,kK=356,$K=14,IK=45,LK=200;function sa(...e){return e.filter(Boolean).join(" ")}function zK(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const BK=e=>{var t,n,r,i,o,l,u,d,h;const{invert:v,toast:m,unstyled:g,interacting:b,setHeights:O,visibleToasts:S,heights:x,index:E,toasts:N,expanded:_,removeToast:C,defaultRichColors:A,closeButton:M,style:R,cancelButtonStyle:D,actionButtonStyle:z,className:G="",descriptionClassName:L="",duration:F,position:W,gap:Q,expandByDefault:X,classNames:k,icons:H,closeButtonAriaLabel:B="Close toast"}=e,[Z,le]=I.useState(null),[$,Y]=I.useState(null),[q,U]=I.useState(!1),[ne,fe]=I.useState(!1),[ie,pe]=I.useState(!1),[re,ve]=I.useState(!1),[ge,oe]=I.useState(!1),[ke,we]=I.useState(0),[ze,Ze]=I.useState(0),lt=I.useRef(m.duration||F||GC),tn=I.useRef(null),pt=I.useRef(null),fr=E===0,Yn=E+1<=S,Rt=m.type,dr=m.dismissible!==!1,nn=m.className||"",bs=m.descriptionClassName||"",vo=I.useMemo(()=>x.findIndex(Ie=>Ie.toastId===m.id)||0,[x,m.id]),rd=I.useMemo(()=>{var Ie;return(Ie=m.closeButton)!=null?Ie:M},[m.closeButton,M]),go=I.useMemo(()=>m.duration||F||GC,[m.duration,F]),_c=I.useRef(0),Ea=I.useRef(0),ad=I.useRef(0),vi=I.useRef(null),[yo,On]=W.split("-"),$r=I.useMemo(()=>x.reduce((Ie,At,rn)=>rn>=vo?Ie:Ie+At.height,0),[x,vo]),gn=EK(),eg=m.invert||v,Nc=Rt==="loading";Ea.current=I.useMemo(()=>vo*Q+$r,[vo,$r]),I.useEffect(()=>{lt.current=go},[go]),I.useEffect(()=>{U(!0)},[]),I.useEffect(()=>{const Ie=pt.current;if(Ie){const At=Ie.getBoundingClientRect().height;return Ze(At),O(rn=>[{toastId:m.id,height:At,position:m.position},...rn]),()=>O(rn=>rn.filter(yn=>yn.toastId!==m.id))}},[O,m.id]),I.useLayoutEffect(()=>{if(!q)return;const Ie=pt.current,At=Ie.style.height;Ie.style.height="auto";const rn=Ie.getBoundingClientRect().height;Ie.style.height=At,Ze(rn),O(yn=>yn.find(Dt=>Dt.toastId===m.id)?yn.map(Dt=>Dt.toastId===m.id?{...Dt,height:rn}:Dt):[{toastId:m.id,height:rn,position:m.position},...yn])},[q,m.title,m.description,O,m.id,m.jsx,m.action,m.cancel]);const ta=I.useCallback(()=>{fe(!0),we(Ea.current),O(Ie=>Ie.filter(At=>At.toastId!==m.id)),setTimeout(()=>{C(m)},LK)},[m,C,O,Ea]);I.useEffect(()=>{if(m.promise&&Rt==="loading"||m.duration===1/0||m.type==="loading")return;let Ie;return _||b||gn?(()=>{if(ad.current<_c.current){const yn=new Date().getTime()-_c.current;lt.current=lt.current-yn}ad.current=new Date().getTime()})():(()=>{lt.current!==1/0&&(_c.current=new Date().getTime(),Ie=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ta()},lt.current))})(),()=>clearTimeout(Ie)},[_,b,m,Rt,gn,ta]),I.useEffect(()=>{m.delete&&(ta(),m.onDismiss==null||m.onDismiss.call(m,m))},[ta,m.delete]);function xs(){var Ie;if(H!=null&&H.loading){var At;return I.createElement("div",{className:sa(k==null?void 0:k.loader,m==null||(At=m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Rt==="loading"},H.loading)}return I.createElement(bK,{className:sa(k==null?void 0:k.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader),visible:Rt==="loading"})}const ws=m.icon||(H==null?void 0:H[Rt])||gK(Rt);var bo,na;return I.createElement("li",{tabIndex:0,ref:pt,className:sa(G,nn,k==null?void 0:k.toast,m==null||(t=m.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[Rt],m==null||(n=m.classNames)==null?void 0:n[Rt]),"data-sonner-toast":"","data-rich-colors":(bo=m.richColors)!=null?bo:A,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":q,"data-promise":!!m.promise,"data-swiped":ge,"data-removed":ne,"data-visible":Yn,"data-y-position":yo,"data-x-position":On,"data-index":E,"data-front":fr,"data-swiping":ie,"data-dismissible":dr,"data-type":Rt,"data-invert":eg,"data-swipe-out":re,"data-swipe-direction":$,"data-expanded":!!(_||X&&q),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":N.length-E,"--offset":`${ne?ke:Ea.current}px`,"--initial-height":X?"auto":`${ze}px`,...R,...m.style},onDragEnd:()=>{pe(!1),le(null),vi.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Nc||!dr||(tn.current=new Date,we(Ea.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),vi.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,At,rn;if(re||!dr)return;vi.current=null;const yn=Number(((Ie=pt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gi=Number(((At=pt.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((rn=tn.current)==null?void 0:rn.getTime()),Tn=Z==="x"?yn:gi,xo=Math.abs(Tn)/Dt;if(Math.abs(Tn)>=IK||xo>.11){we(Ea.current),m.onDismiss==null||m.onDismiss.call(m,m),Y(Z==="x"?yn>0?"right":"left":gi>0?"down":"up"),ta(),ve(!0);return}else{var Mn,Rn;(Mn=pt.current)==null||Mn.style.setProperty("--swipe-amount-x","0px"),(Rn=pt.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}oe(!1),pe(!1),le(null)},onPointerMove:Ie=>{var At,rn,yn;if(!vi.current||!dr||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const Dt=Ie.clientY-vi.current.y,Tn=Ie.clientX-vi.current.x;var xo;const Mn=(xo=e.swipeDirections)!=null?xo:zK(W);!Z&&(Math.abs(Tn)>1||Math.abs(Dt)>1)&&le(Math.abs(Tn)>Math.abs(Dt)?"x":"y");let Rn={x:0,y:0};const Ss=Ir=>1/(1.5+Math.abs(Ir)/20);if(Z==="y"){if(Mn.includes("top")||Mn.includes("bottom"))if(Mn.includes("top")&&Dt<0||Mn.includes("bottom")&&Dt>0)Rn.y=Dt;else{const Ir=Dt*Ss(Dt);Rn.y=Math.abs(Ir)<Math.abs(Dt)?Ir:Dt}}else if(Z==="x"&&(Mn.includes("left")||Mn.includes("right")))if(Mn.includes("left")&&Tn<0||Mn.includes("right")&&Tn>0)Rn.x=Tn;else{const Ir=Tn*Ss(Tn);Rn.x=Math.abs(Ir)<Math.abs(Tn)?Ir:Tn}(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&oe(!0),(rn=pt.current)==null||rn.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(yn=pt.current)==null||yn.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},rd&&!m.jsx&&Rt!=="loading"?I.createElement("button",{"aria-label":B,"data-disabled":Nc,"data-close-button":!0,onClick:Nc||!dr?()=>{}:()=>{ta(),m.onDismiss==null||m.onDismiss.call(m,m)},className:sa(k==null?void 0:k.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(na=H==null?void 0:H.close)!=null?na:OK):null,(Rt||m.icon||m.promise)&&m.icon!==null&&((H==null?void 0:H[Rt])!==null||m.icon)?I.createElement("div",{"data-icon":"",className:sa(k==null?void 0:k.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||xs():null,m.type!=="loading"?ws:null):null,I.createElement("div",{"data-content":"",className:sa(k==null?void 0:k.content,m==null||(o=m.classNames)==null?void 0:o.content)},I.createElement("div",{"data-title":"",className:sa(k==null?void 0:k.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?I.createElement("div",{"data-description":"",className:sa(L,bs,k==null?void 0:k.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),I.isValidElement(m.cancel)?m.cancel:m.cancel&&Nh(m.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Ie=>{Nh(m.cancel)&&dr&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ie),ta())},className:sa(k==null?void 0:k.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,I.isValidElement(m.action)?m.action:m.action&&Nh(m.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||z,onClick:Ie=>{Nh(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ie),!Ie.defaultPrevented&&ta())},className:sa(k==null?void 0:k.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function VC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qK(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",u=o?PK:DK;function d(h){["top","right","bottom","left"].forEach(v=>{n[`${l}-${v}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=u:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(u)}),n}const UK=I.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:v,mobileOffset:m,theme:g="light",richColors:b,duration:O,style:S,visibleToasts:x=RK,toastOptions:E,dir:N=VC(),gap:_=$K,icons:C,containerAriaLabel:A="Notifications"}=t,[M,R]=I.useState([]),D=I.useMemo(()=>r?M.filter(q=>q.toasterId===r):M.filter(q=>!q.toasterId),[M,r]),z=I.useMemo(()=>Array.from(new Set([o].concat(D.filter(q=>q.position).map(q=>q.position)))),[D,o]),[G,L]=I.useState([]),[F,W]=I.useState(!1),[Q,X]=I.useState(!1),[k,H]=I.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=I.useRef(null),Z=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),le=I.useRef(null),$=I.useRef(!1),Y=I.useCallback(q=>{R(U=>{var ne;return(ne=U.find(fe=>fe.id===q.id))!=null&&ne.delete||qn.dismiss(q.id),U.filter(({id:fe})=>fe!==q.id)})},[]);return I.useEffect(()=>qn.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{R(U=>U.map(ne=>ne.id===q.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{c$.flushSync(()=>{R(U=>{const ne=U.findIndex(fe=>fe.id===q.id);return ne!==-1?[...U.slice(0,ne),{...U[ne],...q},...U.slice(ne+1)]:[q,...U]})})})}),[M]),I.useEffect(()=>{if(g!=="system"){H(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:U})=>{H(U?"dark":"light")})}catch{q.addListener(({matches:ne})=>{try{H(ne?"dark":"light")}catch(fe){console.error(fe)}})}},[g]),I.useEffect(()=>{M.length<=1&&W(!1)},[M]),I.useEffect(()=>{const q=U=>{var ne;if(l.every(pe=>U[pe]||U.code===pe)){var ie;W(!0),(ie=B.current)==null||ie.focus()}U.code==="Escape"&&(document.activeElement===B.current||(ne=B.current)!=null&&ne.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[l]),I.useEffect(()=>{if(B.current)return()=>{le.current&&(le.current.focus({preventScroll:!0}),le.current=null,$.current=!1)}},[B.current]),I.createElement("section",{ref:n,"aria-label":`${A} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((q,U)=>{var ne;const[fe,ie]=q.split("-");return D.length?I.createElement("ol",{key:q,dir:N==="auto"?VC():N,tabIndex:-1,ref:B,className:h,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":fe,"data-x-position":ie,style:{"--front-toast-height":`${((ne=G[0])==null?void 0:ne.height)||0}px`,"--width":`${kK}px`,"--gap":`${_}px`,...S,...qK(v,m)},onBlur:pe=>{$.current&&!pe.currentTarget.contains(pe.relatedTarget)&&($.current=!1,le.current&&(le.current.focus({preventScroll:!0}),le.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||$.current||($.current=!0,le.current=pe.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Q||W(!1)},onDragEnd:()=>W(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},D.filter(pe=>!pe.position&&U===0||pe.position===q).map((pe,re)=>{var ve,ge;return I.createElement(BK,{key:pe.id,icons:C,index:re,toast:pe,defaultRichColors:b,duration:(ve=E==null?void 0:E.duration)!=null?ve:O,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:i,visibleToasts:x,closeButton:(ge=E==null?void 0:E.closeButton)!=null?ge:d,interacting:Q,position:q,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:Y,toasts:D.filter(oe=>oe.position==pe.position),heights:G.filter(oe=>oe.position==pe.position),setHeights:L,expandByDefault:u,gap:_,expanded:F,swipeDirections:t.swipeDirections})})):null}))});function fa({value:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=w.useState("idle"),u=async d=>{d.stopPropagation(),l("copying");try{await Promise.all([navigator.clipboard.writeText(e),new Promise(h=>setTimeout(h,150))]),l("copied"),Ot.success("Copied to clipboard"),setTimeout(()=>l("idle"),2e3)}catch{l("idle"),Ot.error("Failed to copy to clipboard")}};return c.jsxs(Ce,{className:me("transition-all",o==="copied"&&"text-green-500",t),disabled:o==="copying",onClick:u,size:r,variant:n,children:[o==="copying"?c.jsx(Va,{className:me("animate-spin",i?"mr-2 h-4 w-4":"h-4 w-4")}):o==="copied"?c.jsx(ri,{className:me(i?"mr-2 h-4 w-4":"h-4 w-4")}):c.jsx(Kj,{className:me(i?"mr-2 h-4 w-4":"h-4 w-4")}),i]})}function KI({onDelete:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=w.useState(!1),u=async d=>{d.stopPropagation(),l(!0);try{await Promise.all([e(),new Promise(h=>setTimeout(h,150))])}finally{l(!1)}};return c.jsxs(Ce,{className:me("text-destructive transition-all hover:text-destructive",t),disabled:o,onClick:u,size:r,variant:n,children:[o?c.jsx(Va,{className:me("animate-spin",i?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx($F,{className:me(i?"mr-1.5 h-4 w-4":"h-4 w-4")}),i]})}const XI=6048e5,HK=864e5,Ah=43200,YC=1440,WC=Symbol.for("constructDateFrom");function oi(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&WC in e?e[WC](t):e instanceof Date?new e.constructor(t):new Date(t)}function ln(e,t){return oi(t||e,e)}let FK={};function Yf(){return FK}function Ju(e,t){var u,d,h,v;const n=Yf(),r=(t==null?void 0:t.weekStartsOn)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((v=(h=n.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??0,i=ln(e,t==null?void 0:t.in),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function pm(e,t){return Ju(e,{...t,weekStartsOn:1})}function QI(e,t){const n=ln(e,t==null?void 0:t.in),r=n.getFullYear(),i=oi(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=pm(i),l=oi(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const u=pm(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function vm(e){const t=ln(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function av(e,...t){const n=oi.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function KC(e,t){const n=ln(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function GK(e,t,n){const[r,i]=av(n==null?void 0:n.in,e,t),o=KC(r),l=KC(i),u=+o-vm(o),d=+l-vm(l);return Math.round((u-d)/HK)}function VK(e,t){const n=QI(e,t),r=oi(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),pm(r)}function Zh(e,t){const n=+ln(e)-+ln(t);return n<0?-1:n>0?1:n}function YK(e){return oi(e,Date.now())}function WK(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function KK(e){return!(!WK(e)&&typeof e!="number"||isNaN(+ln(e)))}function XK(e,t,n){const[r,i]=av(n==null?void 0:n.in,e,t),o=r.getFullYear()-i.getFullYear(),l=r.getMonth()-i.getMonth();return o*12+l}function QK(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function ZK(e,t){return+ln(e)-+ln(t)}function JK(e,t){const n=ln(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function eX(e,t){const n=ln(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function tX(e,t){const n=ln(e,t==null?void 0:t.in);return+JK(n,t)==+eX(n,t)}function nX(e,t,n){const[r,i,o]=av(n==null?void 0:n.in,e,e,t),l=Zh(i,o),u=Math.abs(XK(i,o));if(u<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-l*u);let d=Zh(i,o)===-l;tX(r)&&u===1&&Zh(r,o)===1&&(d=!1);const h=l*(u-+d);return h===0?0:h}function rX(e,t,n){const r=ZK(e,t)/1e3;return QK(n==null?void 0:n.roundingMethod)(r)}function aX(e,t){const n=ln(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const iX={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oX=(e,t,n)=>{let r;const i=iX[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function zb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const sX={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lX={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cX={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uX={date:zb({formats:sX,defaultWidth:"full"}),time:zb({formats:lX,defaultWidth:"full"}),dateTime:zb({formats:cX,defaultWidth:"full"})},fX={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dX=(e,t,n,r)=>fX[e];function wu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n!=null&&n.width?String(n.width):l;i=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[u]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const hX={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mX={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pX={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vX={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},gX={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yX={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bX=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},xX={ordinalNumber:bX,era:wu({values:hX,defaultWidth:"wide"}),quarter:wu({values:mX,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wu({values:pX,defaultWidth:"wide"}),day:wu({values:vX,defaultWidth:"wide"}),dayPeriod:wu({values:gX,defaultWidth:"wide",formattingValues:yX,defaultFormattingWidth:"wide"})};function Su(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?SX(u,m=>m.test(l)):wX(u,m=>m.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const v=t.slice(l.length);return{value:h,rest:v}}}function wX(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function SX(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function jX(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(i.length);return{value:l,rest:u}}}const OX=/^(\d+)(th|st|nd|rd)?/i,EX=/\d+/i,_X={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NX={any:[/^b/i,/^(a|c)/i]},AX={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CX={any:[/1/i,/2/i,/3/i,/4/i]},TX={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},MX={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RX={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},DX={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PX={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kX={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$X={ordinalNumber:jX({matchPattern:OX,parsePattern:EX,valueCallback:e=>parseInt(e,10)}),era:Su({matchPatterns:_X,defaultMatchWidth:"wide",parsePatterns:NX,defaultParseWidth:"any"}),quarter:Su({matchPatterns:AX,defaultMatchWidth:"wide",parsePatterns:CX,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Su({matchPatterns:TX,defaultMatchWidth:"wide",parsePatterns:MX,defaultParseWidth:"any"}),day:Su({matchPatterns:RX,defaultMatchWidth:"wide",parsePatterns:DX,defaultParseWidth:"any"}),dayPeriod:Su({matchPatterns:PX,defaultMatchWidth:"any",parsePatterns:kX,defaultParseWidth:"any"})},ZI={code:"en-US",formatDistance:oX,formatLong:uX,formatRelative:dX,localize:xX,match:$X,options:{weekStartsOn:0,firstWeekContainsDate:1}};function IX(e,t){const n=ln(e,t==null?void 0:t.in);return GK(n,aX(n))+1}function LX(e,t){const n=ln(e,t==null?void 0:t.in),r=+pm(n)-+VK(n);return Math.round(r/XI)+1}function JI(e,t){var v,m,g,b;const n=ln(e,t==null?void 0:t.in),r=n.getFullYear(),i=Yf(),o=(t==null?void 0:t.firstWeekContainsDate)??((m=(v=t==null?void 0:t.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((b=(g=i.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,l=oi((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const u=Ju(l,t),d=oi((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const h=Ju(d,t);return+n>=+u?r+1:+n>=+h?r:r-1}function zX(e,t){var u,d,h,v;const n=Yf(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((v=(h=n.locale)==null?void 0:h.options)==null?void 0:v.firstWeekContainsDate)??1,i=JI(e,t),o=oi((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Ju(o,t)}function BX(e,t){const n=ln(e,t==null?void 0:t.in),r=+Ju(n,t)-+zX(n,t);return Math.round(r/XI)+1}function ht(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Fi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ht(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ht(i,t.length)}},fl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},XC={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Fi.y(e,t)},Y:function(e,t,n,r){const i=JI(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return ht(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ht(o,t.length)},R:function(e,t){const n=QI(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ht(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ht(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ht(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=BX(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},I:function(e,t,n){const r=LX(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ht(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fi.d(e,t)},D:function(e,t,n){const r=IX(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ht(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ht(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ht(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ht(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=fl.noon:r===0?i=fl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=fl.evening:r>=12?i=fl.afternoon:r>=4?i=fl.morning:i=fl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ht(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ht(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fi.s(e,t)},S:function(e,t){return Fi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ZC(r);case"XXXX":case"XX":return Bo(r);case"XXXXX":case"XXX":default:return Bo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ZC(r);case"xxxx":case"xx":return Bo(r);case"xxxxx":case"xxx":default:return Bo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+QC(r,":");case"OOOO":default:return"GMT"+Bo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+QC(r,":");case"zzzz":default:return"GMT"+Bo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ht(r,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function QC(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+ht(o,2)}function ZC(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):Bo(e,t)}function Bo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ht(Math.trunc(r/60),2),o=ht(r%60,2);return n+i+t+o}const JC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},e3=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},qX=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return JC(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",JC(r,t)).replace("{{time}}",e3(i,t))},UX={p:e3,P:qX},HX=/^D+$/,FX=/^Y+$/,GX=["D","DD","YY","YYYY"];function VX(e){return HX.test(e)}function YX(e){return FX.test(e)}function WX(e,t,n){const r=KX(e,t,n);if(console.warn(r),GX.includes(e))throw new RangeError(r)}function KX(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const XX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,QX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZX=/^'([^]*?)'?$/,JX=/''/g,eQ=/[a-zA-Z]/;function fS(e,t,n){var v,m,g,b;const r=Yf(),i=r.locale??ZI,o=r.firstWeekContainsDate??((m=(v=r.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??1,l=r.weekStartsOn??((b=(g=r.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??0,u=ln(e,n==null?void 0:n.in);if(!KK(u))throw new RangeError("Invalid time value");let d=t.match(QX).map(O=>{const S=O[0];if(S==="p"||S==="P"){const x=UX[S];return x(O,i.formatLong)}return O}).join("").match(XX).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const S=O[0];if(S==="'")return{isToken:!1,value:tQ(O)};if(XC[S])return{isToken:!0,value:O};if(S.match(eQ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(d=i.localize.preprocessor(u,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return d.map(O=>{if(!O.isToken)return O.value;const S=O.value;(YX(S)||VX(S))&&WX(S,t,String(e));const x=XC[S[0]];return x(u,S,i.localize,h)}).join("")}function tQ(e){const t=e.match(ZX);return t?t[1].replace(JX,"'"):e}function nQ(e,t,n){const r=Yf(),i=(n==null?void 0:n.locale)??r.locale??ZI,o=2520,l=Zh(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const u=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:l}),[d,h]=av(n==null?void 0:n.in,...l>0?[t,e]:[e,t]),v=rX(h,d),m=(vm(h)-vm(d))/1e3,g=Math.round((v-m)/60);let b;if(g<2)return n!=null&&n.includeSeconds?v<5?i.formatDistance("lessThanXSeconds",5,u):v<10?i.formatDistance("lessThanXSeconds",10,u):v<20?i.formatDistance("lessThanXSeconds",20,u):v<40?i.formatDistance("halfAMinute",0,u):v<60?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",1,u):g===0?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",g,u);if(g<45)return i.formatDistance("xMinutes",g,u);if(g<90)return i.formatDistance("aboutXHours",1,u);if(g<YC){const O=Math.round(g/60);return i.formatDistance("aboutXHours",O,u)}else{if(g<o)return i.formatDistance("xDays",1,u);if(g<Ah){const O=Math.round(g/YC);return i.formatDistance("xDays",O,u)}else if(g<Ah*2)return b=Math.round(g/Ah),i.formatDistance("aboutXMonths",b,u)}if(b=nX(h,d),b<12){const O=Math.round(g/Ah);return i.formatDistance("xMonths",O,u)}else{const O=b%12,S=Math.trunc(b/12);return O<3?i.formatDistance("aboutXYears",S,u):O<9?i.formatDistance("overXYears",S,u):i.formatDistance("almostXYears",S+1,u)}}function rQ(e,t){return nQ(e,YK(e),t)}const aQ=mc("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-full border px-2 py-0.5 font-medium text-xs transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function qe({className:e,variant:t,asChild:n=!1,...r}){const i=n?ss:"span";return c.jsx(i,{className:me(aQ({variant:t}),e),"data-slot":"badge",...r})}function RO({...e}){return c.jsx(OO,{"data-slot":"dialog",...e})}function iQ({...e}){return c.jsx(EO,{"data-slot":"dialog-portal",...e})}function oQ({className:e,...t}){return c.jsx(_O,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dialog-overlay",...t})}function DO({className:e,children:t,showCloseButton:n=!0,...r}){return c.jsxs(iQ,{"data-slot":"dialog-portal",children:[c.jsx(oQ,{}),c.jsxs(NO,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"dialog-content",...r,children:[t,n&&c.jsxs(Zp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-slot":"dialog-close",children:[c.jsx(or,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function t3({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...t})}function n3({className:e,...t}){return c.jsx("div",{className:me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...t})}function r3({className:e,...t}){return c.jsx(AO,{className:me("font-semibold text-lg leading-none",e),"data-slot":"dialog-title",...t})}function sQ({className:e,...t}){return c.jsx(CO,{className:me("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...t})}function iv({starred:e,onToggle:t,className:n,variant:r="ghost",size:i="icon",label:o}){const[l,u]=w.useState(!1),d=async h=>{h.stopPropagation(),u(!0);try{await Promise.all([t(),new Promise(v=>setTimeout(v,150))])}finally{u(!1)}};return c.jsxs(Ce,{className:me("transition-all",n),disabled:l,onClick:d,size:i,variant:r,children:[l?c.jsx(Va,{className:me("animate-spin",o?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(g$,{className:me("transition-colors",o?"mr-1.5 h-4 w-4":"h-4 w-4",e?"fill-yellow-500 text-yellow-500":"text-muted-foreground")}),o,!o&&c.jsx("span",{className:"sr-only",children:e?"Unstar":"Star"})]})}function lQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function a3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function cQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?a3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function uQ({file:e,onClose:t,onToggleStar:n,onDelete:r}){const i=e.key.split("/").pop()||e.key,o=a3(i),l=cQ(e.contentType,i),u=()=>{const d=document.createElement("a");d.href=e.url,d.download=i,d.target="_blank",d.click()};return c.jsx(RO,{onOpenChange:d=>!d&&t(),open:!0,children:c.jsx(DO,{className:"max-h-[90vh] max-w-4xl overflow-y-auto [&>button]:hidden",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-bold text-2xl",children:i}),e.key!==i&&c.jsx("p",{className:"mt-1 text-muted-foreground text-sm",children:e.key})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(iv,{onToggle:()=>n(e.key,!e.starred),starred:e.starred,variant:"outline"}),c.jsx(KI,{onDelete:()=>r(e.key)}),c.jsx(Ce,{onClick:t,size:"icon",variant:"outline",children:c.jsx(or,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"aspect-video overflow-hidden rounded-lg bg-muted",children:l&&e.url.startsWith("https://")?c.jsx("img",{alt:i,className:"h-full w-full object-contain",src:e.url}):c.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[l?c.jsx(Xj,{className:"h-16 w-16 text-muted-foreground/50"}):c.jsx(Qj,{className:"h-16 w-16 text-muted-foreground/50"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not available"})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(fa,{className:"flex-1",label:"Copy CDN URL",size:"default",value:e.url,variant:"default"}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:()=>window.open(e.url,"_blank"),variant:"outline",children:[c.jsx(Gu,{className:"h-4 w-4"}),"Open in New Tab"]}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:u,variant:"outline",children:[c.jsx(_F,{className:"h-4 w-4"}),"Download"]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"File Information"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Format"}),c.jsx("dd",{className:"font-medium",children:c.jsx(qe,{variant:"secondary",children:o.toUpperCase()})})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Size"}),c.jsx("dd",{className:"font-medium",children:lQ(e.size)})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Content Type"}),c.jsx("dd",{className:"font-medium",children:e.contentType||"Unknown"})]})]})]})}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"Metadata"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Last Modified"}),c.jsx("dd",{className:"font-medium",children:fS(new Date(e.lastModified),"MMM d, yyyy 'at' h:mm a")})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Starred"}),c.jsx("dd",{className:"font-medium",children:e.starred?"Yes":"No"})]}),e.tags.length>0&&c.jsxs("div",{children:[c.jsx("dt",{className:"mb-1 text-muted-foreground",children:"Tags"}),c.jsx("dd",{className:"flex flex-wrap gap-1",children:e.tags.filter(d=>d.key!=="starred").map(d=>c.jsxs(qe,{variant:"secondary",children:[d.key,": ",d.value]},d.key))})]})]})]})})]}),c.jsx(qt,{}),c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"CDN URL"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("code",{className:"flex-1 break-all rounded bg-muted px-3 py-2 text-sm",children:e.url}),c.jsx(fa,{size:"sm",value:e.url})]})]})]})})})}function Te({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),"data-slot":"card",...t})}function Me({className:e,...t}){return c.jsx("div",{className:me("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),"data-slot":"card-header",...t})}function Le({className:e,...t}){return c.jsx("div",{className:me("font-semibold leading-none",e),"data-slot":"card-title",...t})}function We({className:e,...t}){return c.jsx("div",{className:me("text-muted-foreground text-sm",e),"data-slot":"card-description",...t})}function $e({className:e,...t}){return c.jsx("div",{className:me("px-6",e),"data-slot":"card-content",...t})}function fQ({className:e,...t}){return c.jsx("div",{className:me("flex items-center px-6 [.border-t]:pt-6",e),"data-slot":"card-footer",...t})}function ov(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sv="Checkbox",[dQ]=jn(sv),[hQ,PO]=dQ(sv);function mQ(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:l,name:u,onCheckedChange:d,required:h,value:v="on",internal_do_not_use_render:m}=e,[g,b]=Nn({prop:n,defaultProp:i??!1,onChange:d,caller:sv}),[O,S]=w.useState(null),[x,E]=w.useState(null),N=w.useRef(!1),_=O?!!l||!!O.closest("form"):!0,C={checked:g,disabled:o,setChecked:b,control:O,setControl:S,name:u,form:l,value:v,hasConsumerStoppedPropagationRef:N,required:h,defaultChecked:Ki(i)?!1:i,isFormControl:_,bubbleInput:x,setBubbleInput:E};return c.jsx(hQ,{scope:t,...C,children:pQ(m)?m(C):r})}var i3="CheckboxTrigger",o3=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:l,disabled:u,checked:d,required:h,setControl:v,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:b,bubbleInput:O}=PO(i3,e),S=Ue(i,v),x=w.useRef(d);return w.useEffect(()=>{const E=o==null?void 0:o.form;if(E){const N=()=>m(x.current);return E.addEventListener("reset",N),()=>E.removeEventListener("reset",N)}},[o,m]),c.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Ki(d)?"mixed":d,"aria-required":h,"data-state":d3(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:S,onKeyDown:ye(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(n,E=>{m(N=>Ki(N)?!0:!N),O&&b&&(g.current=E.isPropagationStopped(),g.current||E.stopPropagation())})})});o3.displayName=i3;var s3=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:h,form:v,...m}=e;return c.jsx(mQ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:u,required:l,onCheckedChange:h,name:r,form:v,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(o3,{...m,ref:t,__scopeCheckbox:n}),g&&c.jsx(f3,{__scopeCheckbox:n})]})})});s3.displayName=sv;var l3="CheckboxIndicator",c3=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=PO(l3,n);return c.jsx(An,{present:r||Ki(o.checked)||o.checked===!0,children:c.jsx(Ne.span,{"data-state":d3(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});c3.displayName=l3;var u3="CheckboxBubbleInput",f3=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:u,disabled:d,name:h,value:v,form:m,bubbleInput:g,setBubbleInput:b}=PO(u3,e),O=Ue(n,b),S=ov(o),x=qp(r);w.useEffect(()=>{const N=g;if(!N)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,M=!i.current;if(S!==o&&A){const R=new Event("click",{bubbles:M});N.indeterminate=Ki(o),A.call(N,Ki(o)?!1:o),N.dispatchEvent(R)}},[g,S,o,i]);const E=w.useRef(Ki(o)?!1:o);return c.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??E.current,required:u,disabled:d,name:h,value:v,form:m,...t,tabIndex:-1,ref:O,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});f3.displayName=u3;function pQ(e){return typeof e=="function"}function Ki(e){return e==="indeterminate"}function d3(e){return Ki(e)?"indeterminate":e?"checked":"unchecked"}function dS({className:e,...t}){return c.jsx(s3,{className:me("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",e),"data-slot":"checkbox",...t,children:c.jsx(c3,{className:"grid place-content-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(ri,{className:"size-3.5"})})})}function vQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function h3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function gQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?h3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function yQ({files:e,selectedFiles:t,onSelectFile:n,onToggleStar:r,onFileClick:i}){const o=(l,u)=>{l.stopPropagation(),window.open(u,"_blank")};return c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:e.map(l=>{const u=l.key.split("/").pop()||l.key,d=h3(u),h=gQ(l.contentType,u),v=t.includes(l.key);return c.jsxs("div",{className:"group relative cursor-pointer overflow-hidden rounded-xl bg-muted shadow-sm transition-shadow hover:shadow-md",onClick:()=>i(l),children:[c.jsx("div",{className:"flex aspect-square items-center justify-center",children:h&&l.url.startsWith("https://")?c.jsx("img",{alt:u,className:"h-full w-full object-cover",src:l.url}):c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h?c.jsx(Xj,{className:"h-12 w-12 text-muted-foreground/50"}):c.jsx(Qj,{className:"h-12 w-12 text-muted-foreground/50"})})}),c.jsx(iv,{className:"absolute top-2 right-2 rounded-full bg-background/80 hover:bg-background/90",onToggle:()=>r(l.key,!l.starred),starred:l.starred}),c.jsxs(Te,{className:"gap-2 rounded-t-none border-none py-3 shadow-none",children:[c.jsxs(Me,{className:"gap-1 px-3 py-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{onClick:m=>m.stopPropagation(),children:c.jsx(dS,{checked:v,onCheckedChange:()=>n(l.key)})}),c.jsx(Le,{className:"min-w-0 flex-1 truncate text-sm",children:u})]}),c.jsxs(We,{className:"flex items-center gap-2 pl-6",children:[c.jsx(qe,{className:"rounded-sm text-[10px]",variant:"outline",children:d.toUpperCase()}),c.jsx("span",{className:"text-xs",children:vQ(l.size)})]})]}),c.jsxs(fQ,{className:"justify-end gap-1 px-3 py-0 opacity-0 transition-opacity group-hover:opacity-100",children:[c.jsx(fa,{className:"h-7 px-2",label:"Copy",size:"sm",value:l.url,variant:"ghost"}),c.jsxs(Ce,{className:"h-7 px-2",onClick:m=>o(m,l.url),size:"sm",variant:"ghost",children:[c.jsx(Gu,{className:"mr-1 h-3 w-3"}),"Open"]})]})]})]},l.key)})})}var Bb,lv="HoverCard",[m3]=jn(lv,[io]),cv=io(),[bQ,uv]=m3(lv),p3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:l=700,closeDelay:u=300}=e,d=cv(t),h=w.useRef(0),v=w.useRef(0),m=w.useRef(!1),g=w.useRef(!1),[b,O]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:lv}),S=w.useCallback(()=>{clearTimeout(v.current),h.current=window.setTimeout(()=>O(!0),l)},[l,O]),x=w.useCallback(()=>{clearTimeout(h.current),!m.current&&!g.current&&(v.current=window.setTimeout(()=>O(!1),u))},[u,O]),E=w.useCallback(()=>O(!1),[O]);return w.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(v.current)},[]),c.jsx(bQ,{scope:t,open:b,onOpenChange:O,onOpen:S,onClose:x,onDismiss:E,hasSelectionRef:m,isPointerDownOnContentRef:g,children:c.jsx(Up,{...d,children:n})})};p3.displayName=lv;var v3="HoverCardTrigger",g3=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=uv(v3,n),o=cv(n);return c.jsx(Hp,{asChild:!0,...o,children:c.jsx(Ne.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:ye(e.onPointerEnter,ym(i.onOpen)),onPointerLeave:ye(e.onPointerLeave,ym(i.onClose)),onFocus:ye(e.onFocus,i.onOpen),onBlur:ye(e.onBlur,i.onClose),onTouchStart:ye(e.onTouchStart,l=>l.preventDefault())})})});g3.displayName=v3;var kO="HoverCardPortal",[xQ,wQ]=m3(kO,{forceMount:void 0}),y3=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=uv(kO,t);return c.jsx(xQ,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};y3.displayName=kO;var gm="HoverCardContent",b3=w.forwardRef((e,t)=>{const n=wQ(gm,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=uv(gm,e.__scopeHoverCard);return c.jsx(An,{present:r||o.open,children:c.jsx(SQ,{"data-state":o.open?"open":"closed",...i,onPointerEnter:ye(e.onPointerEnter,ym(o.onOpen)),onPointerLeave:ye(e.onPointerLeave,ym(o.onClose)),ref:t})})});b3.displayName=gm;var SQ=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,...u}=e,d=uv(gm,n),h=cv(n),v=w.useRef(null),m=Ue(t,v),[g,b]=w.useState(!1);return w.useEffect(()=>{if(g){const O=document.body;return Bb=O.style.userSelect||O.style.webkitUserSelect,O.style.userSelect="none",O.style.webkitUserSelect="none",()=>{O.style.userSelect=Bb,O.style.webkitUserSelect=Bb}}},[g]),w.useEffect(()=>{if(v.current){const O=()=>{b(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var x;((x=document.getSelection())==null?void 0:x.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",O),()=>{document.removeEventListener("pointerup",O),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),w.useEffect(()=>{v.current&&EQ(v.current).forEach(S=>S.setAttribute("tabindex","-1"))}),c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:ye(o,O=>{O.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(Fp,{...h,...u,onPointerDown:ye(u.onPointerDown,O=>{O.currentTarget.contains(O.target)&&b(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:m,style:{...u.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),jQ="HoverCardArrow",OQ=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=cv(n);return c.jsx(Gp,{...i,...r,ref:t})});OQ.displayName=jQ;function ym(e){return t=>t.pointerType==="touch"?void 0:e()}function EQ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var _Q=p3,NQ=g3,AQ=y3,CQ=b3;function TQ({...e}){return c.jsx(_Q,{"data-slot":"hover-card",...e})}function MQ({...e}){return c.jsx(NQ,{"data-slot":"hover-card-trigger",...e})}function RQ({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(AQ,{"data-slot":"hover-card-portal",children:c.jsx(CQ,{align:t,className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"hover-card-content",sideOffset:n,...r})})}function fv({className:e,...t}){return c.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:c.jsx("table",{className:me("w-full caption-bottom text-sm",e),"data-slot":"table",...t})})}function dv({className:e,...t}){return c.jsx("thead",{className:me("[&_tr]:border-b",e),"data-slot":"table-header",...t})}function hv({className:e,...t}){return c.jsx("tbody",{className:me("[&_tr:last-child]:border-0",e),"data-slot":"table-body",...t})}function Fn({className:e,...t}){return c.jsx("tr",{className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),"data-slot":"table-row",...t})}function Pt({className:e,...t}){return c.jsx("th",{className:me("h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-head",...t})}function mt({className:e,...t}){return c.jsx("td",{className:me("whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-cell",...t})}function DQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function x3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function PQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?x3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function kQ({files:e,selectedFiles:t,onSelectFile:n,onSelectAll:r,onToggleStar:i,onFileClick:o}){const l=(u,d)=>{u.stopPropagation(),window.open(d,"_blank")};return c.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{className:"bg-muted/50",children:[c.jsx(Pt,{className:"w-12",children:c.jsx(dS,{checked:t.length===e.length&&e.length>0,onCheckedChange:r})}),c.jsx(Pt,{className:"w-12"}),c.jsx(Pt,{children:"Name"}),c.jsx(Pt,{children:"Format"}),c.jsx(Pt,{children:"Size"}),c.jsx(Pt,{children:"Modified"}),c.jsx(Pt,{className:"w-24",children:"Actions"})]})}),c.jsx(hv,{children:e.map(u=>{const d=u.key.split("/").pop()||u.key,h=x3(d),v=PQ(u.contentType,d);return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>o(u),children:[c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsx(dS,{checked:t.includes(u.key),onCheckedChange:()=>n(u.key)})}),c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsx(iv,{className:"h-8 w-8",onToggle:()=>i(u.key,!u.starred),starred:u.starred})}),c.jsx(mt,{children:c.jsxs("div",{className:"flex items-center gap-3",children:[v&&u.url.startsWith("https://")?c.jsxs(TQ,{closeDelay:200,openDelay:100,children:[c.jsx(MQ,{asChild:!0,children:c.jsx("div",{className:"h-10 w-14 shrink-0 cursor-pointer overflow-hidden rounded border bg-muted",children:c.jsx("img",{alt:d,className:"h-full w-full object-cover",src:u.url})})}),c.jsxs(RQ,{align:"start",className:"w-auto p-3",side:"right",children:[c.jsx("img",{alt:d,className:"max-h-[min(400px,40vh)] max-w-[min(400px,25vw)] rounded object-contain",src:u.url}),c.jsx("p",{className:"mt-2 max-w-[min(400px,25vw)] truncate text-center text-muted-foreground text-sm",children:d})]})]}):c.jsx("div",{className:"flex h-10 w-14 shrink-0 items-center justify-center overflow-hidden rounded border bg-muted",children:v?c.jsx(Xj,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Qj,{className:"h-4 w-4 text-muted-foreground"})}),c.jsx("span",{className:"truncate font-medium",children:d})]})}),c.jsx(mt,{children:c.jsx(qe,{variant:"secondary",children:h.toUpperCase()})}),c.jsx(mt,{className:"text-muted-foreground",children:DQ(u.size)}),c.jsx(mt,{className:"text-muted-foreground text-xs",children:rQ(new Date(u.lastModified),{addSuffix:!0})}),c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsxs("div",{className:"flex gap-1",children:[c.jsx(fa,{className:"h-8 w-8",size:"icon",value:u.url,variant:"ghost"}),c.jsx(Ce,{className:"h-8 w-8",onClick:m=>l(m,u.url),size:"icon",variant:"ghost",children:c.jsx(Gu,{className:"h-3.5 w-3.5"})})]})})]},u.key)})})]})})}var mv="Collapsible",[$Q]=jn(mv),[IQ,$O]=$Q(mv),w3=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,h]=Nn({prop:r,defaultProp:i??!1,onChange:l,caller:mv});return c.jsx(IQ,{scope:n,disabled:o,contentId:Cr(),open:d,onOpenToggle:w.useCallback(()=>h(v=>!v),[h]),children:c.jsx(Ne.div,{"data-state":LO(d),"data-disabled":o?"":void 0,...u,ref:t})})});w3.displayName=mv;var S3="CollapsibleTrigger",j3=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=$O(S3,n);return c.jsx(Ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":LO(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ye(e.onClick,i.onOpenToggle)})});j3.displayName=S3;var IO="CollapsibleContent",O3=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$O(IO,e.__scopeCollapsible);return c.jsx(An,{present:n||i.open,children:({present:o})=>c.jsx(LQ,{...r,ref:t,present:o})})});O3.displayName=IO;var LQ=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=$O(IO,n),[u,d]=w.useState(r),h=w.useRef(null),v=Ue(t,h),m=w.useRef(0),g=m.current,b=w.useRef(0),O=b.current,S=l.open||u,x=w.useRef(S),E=w.useRef(void 0);return w.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Wt(()=>{const N=h.current;if(N){E.current=E.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const _=N.getBoundingClientRect();m.current=_.height,b.current=_.width,x.current||(N.style.transitionDuration=E.current.transitionDuration,N.style.animationName=E.current.animationName),d(r)}},[l.open,r]),c.jsx(Ne.div,{"data-state":LO(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!S,...o,ref:v,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":O?`${O}px`:void 0,...e.style},children:S&&i})});function LO(e){return e?"open":"closed"}var zQ=w3;const fs=zQ,ds=j3,hs=O3;var BQ="Label",E3=w.forwardRef((e,t)=>c.jsx(ls.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));E3.displayName=BQ;var qQ=E3;function qo({className:e,...t}){return c.jsx(qQ,{className:me("flex select-none items-center gap-2 font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",e),"data-slot":"label",...t})}var zO="Progress",BO=100,[UQ]=y$(zO),[HQ,FQ]=UQ(zO),_3=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=GQ,...l}=e;(i||i===0)&&!eT(i)&&console.error(VQ(`${i}`,"Progress"));const u=eT(i)?i:BO;r!==null&&!tT(r,u)&&console.error(YQ(`${r}`,"Progress"));const d=tT(r,u)?r:null,h=bm(d)?o(d,u):void 0;return c.jsx(HQ,{scope:n,value:d,max:u,children:c.jsx(ls.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":bm(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":C3(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});_3.displayName=zO;var N3="ProgressIndicator",A3=w.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=FQ(N3,n);return c.jsx(ls.div,{"data-state":C3(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});A3.displayName=N3;function GQ(e,t){return`${Math.round(e/t*100)}%`}function C3(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bm(e){return typeof e=="number"}function eT(e){return bm(e)&&!isNaN(e)&&e>0}function tT(e,t){return bm(e)&&!isNaN(e)&&e<=t&&e>=0}function VQ(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${BO}\`.`}function YQ(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
417
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gW="DialogDescriptionWarning",yW=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${TI(gW).contentName}}.`;return w.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},OO=vI,bW=yI,EO=xI,_O=wI,NO=SI,AO=OI,CO=_I,Zp=AI;function xW({...e}){return c.jsx(OO,{"data-slot":"sheet",...e})}function wW({...e}){return c.jsx(EO,{"data-slot":"sheet-portal",...e})}function SW({className:e,...t}){return c.jsx(_O,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"sheet-overlay",...t})}function jW({className:e,children:t,side:n="right",...r}){return c.jsxs(wW,{children:[c.jsx(SW,{}),c.jsxs(NO,{className:me("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=open]:animate-in data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),"data-slot":"sheet-content",...r,children:[t,c.jsxs(Zp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[c.jsx(or,{className:"size-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function OW({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-1.5 p-4",e),"data-slot":"sheet-header",...t})}function EW({className:e,...t}){return c.jsx(AO,{className:me("font-semibold text-foreground",e),"data-slot":"sheet-title",...t})}function _W({className:e,...t}){return c.jsx(CO,{className:me("text-muted-foreground text-sm",e),"data-slot":"sheet-description",...t})}function Re({className:e,...t}){return c.jsx("div",{className:me("animate-pulse rounded-md bg-accent",e),"data-slot":"skeleton",...t})}var MI=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),NW="VisuallyHidden",RI=w.forwardRef((e,t)=>c.jsx(Ne.span,{...e,ref:t,style:{...MI,...e.style}}));RI.displayName=NW;var AW=RI,[Jp]=jn("Tooltip",[io]),ev=io(),DI="TooltipProvider",CW=700,aS="tooltip.open",[TW,TO]=Jp(DI),PI=e=>{const{__scopeTooltip:t,delayDuration:n=CW,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:o}=e,l=w.useRef(!0),u=w.useRef(!1),d=w.useRef(0);return w.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),c.jsx(TW,{scope:t,isOpenDelayedRef:l,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:w.useCallback(h=>{u.current=h},[]),disableHoverableContent:i,children:o})};PI.displayName=DI;var Zu="Tooltip",[MW,Vf]=Jp(Zu),kI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:o,disableHoverableContent:l,delayDuration:u}=e,d=TO(Zu,e.__scopeTooltip),h=ev(t),[v,m]=w.useState(null),g=Cr(),b=w.useRef(0),O=l??d.disableHoverableContent,S=u??d.delayDuration,x=w.useRef(!1),[E,N]=Nn({prop:r,defaultProp:i??!1,onChange:R=>{R?(d.onOpen(),document.dispatchEvent(new CustomEvent(aS))):d.onClose(),o==null||o(R)},caller:Zu}),_=w.useMemo(()=>E?x.current?"delayed-open":"instant-open":"closed",[E]),C=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,x.current=!1,N(!0)},[N]),A=w.useCallback(()=>{window.clearTimeout(b.current),b.current=0,N(!1)},[N]),M=w.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{x.current=!0,N(!0),b.current=0},S)},[S,N]);return w.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),c.jsx(Up,{...h,children:c.jsx(MW,{scope:t,contentId:g,open:E,stateAttribute:_,trigger:v,onTriggerChange:m,onTriggerEnter:w.useCallback(()=>{d.isOpenDelayedRef.current?M():C()},[d.isOpenDelayedRef,M,C]),onTriggerLeave:w.useCallback(()=>{O?A():(window.clearTimeout(b.current),b.current=0)},[A,O]),onOpen:C,onClose:A,disableHoverableContent:O,children:n})})};kI.displayName=Zu;var iS="TooltipTrigger",$I=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=Vf(iS,n),o=TO(iS,n),l=ev(n),u=w.useRef(null),d=Ue(t,u,i.onTriggerChange),h=w.useRef(!1),v=w.useRef(!1),m=w.useCallback(()=>h.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),c.jsx(Hp,{asChild:!0,...l,children:c.jsx(Ne.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:d,onPointerMove:ye(e.onPointerMove,g=>{g.pointerType!=="touch"&&!v.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),v.current=!0)}),onPointerLeave:ye(e.onPointerLeave,()=>{i.onTriggerLeave(),v.current=!1}),onPointerDown:ye(e.onPointerDown,()=>{i.open&&i.onClose(),h.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ye(e.onFocus,()=>{h.current||i.onOpen()}),onBlur:ye(e.onBlur,i.onClose),onClick:ye(e.onClick,i.onClose)})})});$I.displayName=iS;var MO="TooltipPortal",[RW,DW]=Jp(MO,{forceMount:void 0}),II=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=Vf(MO,t);return c.jsx(RW,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};II.displayName=MO;var Rl="TooltipContent",LI=w.forwardRef((e,t)=>{const n=DW(Rl,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,l=Vf(Rl,e.__scopeTooltip);return c.jsx(An,{present:r||l.open,children:l.disableHoverableContent?c.jsx(zI,{side:i,...o,ref:t}):c.jsx(PW,{side:i,...o,ref:t})})}),PW=w.forwardRef((e,t)=>{const n=Vf(Rl,e.__scopeTooltip),r=TO(Rl,e.__scopeTooltip),i=w.useRef(null),o=Ue(t,i),[l,u]=w.useState(null),{trigger:d,onClose:h}=n,v=i.current,{onPointerInTransitChange:m}=r,g=w.useCallback(()=>{u(null),m(!1)},[m]),b=w.useCallback((O,S)=>{const x=O.currentTarget,E={x:O.clientX,y:O.clientY},N=LW(E,x.getBoundingClientRect()),_=zW(E,N),C=BW(S.getBoundingClientRect()),A=UW([..._,...C]);u(A),m(!0)},[m]);return w.useEffect(()=>()=>g(),[g]),w.useEffect(()=>{if(d&&v){const O=x=>b(x,v),S=x=>b(x,d);return d.addEventListener("pointerleave",O),v.addEventListener("pointerleave",S),()=>{d.removeEventListener("pointerleave",O),v.removeEventListener("pointerleave",S)}}},[d,v,b,g]),w.useEffect(()=>{if(l){const O=S=>{const x=S.target,E={x:S.clientX,y:S.clientY},N=(d==null?void 0:d.contains(x))||(v==null?void 0:v.contains(x)),_=!qW(E,l);N?g():_&&(g(),h())};return document.addEventListener("pointermove",O),()=>document.removeEventListener("pointermove",O)}},[d,v,l,h,g]),c.jsx(zI,{...e,ref:o})}),[kW,$W]=Jp(Zu,{isInside:!1}),IW=H$("TooltipContent"),zI=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:l,...u}=e,d=Vf(Rl,n),h=ev(n),{onClose:v}=d;return w.useEffect(()=>(document.addEventListener(aS,v),()=>document.removeEventListener(aS,v)),[v]),w.useEffect(()=>{if(d.trigger){const m=g=>{const b=g.target;b!=null&&b.contains(d.trigger)&&v()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[d.trigger,v]),c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:m=>m.preventDefault(),onDismiss:v,children:c.jsxs(Fp,{"data-state":d.stateAttribute,...h,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[c.jsx(IW,{children:r}),c.jsx(kW,{scope:n,isInside:!0,children:c.jsx(AW,{id:d.contentId,role:"tooltip",children:i||r})})]})})});LI.displayName=Rl;var BI="TooltipArrow",qI=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ev(n);return $W(BI,n).isInside?null:c.jsx(Gp,{...i,...r,ref:t})});qI.displayName=BI;function LW(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function zW(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function BW(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function qW(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,l=t.length-1;o<t.length;l=o++){const u=t[o],d=t[l],h=u.x,v=u.y,m=d.x,g=d.y;v>r!=g>r&&n<(m-h)*(r-v)/(g-v)+h&&(i=!i)}return i}function UW(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),HW(t)}function HW(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const o=t[t.length-1],l=t[t.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const o=n[n.length-1],l=n[n.length-2];if((o.x-l.x)*(i.y-l.y)>=(o.y-l.y)*(i.x-l.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var FW=PI,GW=kI,VW=$I,YW=II,WW=LI,KW=qI;function UI({delayDuration:e=0,...t}){return c.jsx(FW,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function tv({...e}){return c.jsx(UI,{children:c.jsx(GW,{"data-slot":"tooltip",...e})})}function nv({...e}){return c.jsx(VW,{"data-slot":"tooltip-trigger",...e})}function rv({className:e,sideOffset:t=0,children:n,...r}){return c.jsx(YW,{children:c.jsxs(WW,{className:me("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] animate-in text-balance rounded-md bg-foreground px-3 py-1.5 text-background text-xs data-[state=closed]:animate-out",e),"data-slot":"tooltip-content",sideOffset:t,...r,children:[n,c.jsx(KW,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground"})]})})}const Lb=768;function XW(){const[e,t]=w.useState(void 0);return w.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Lb-1}px)`),r=()=>{t(window.innerWidth<Lb)};return n.addEventListener("change",r),t(window.innerWidth<Lb),()=>n.removeEventListener("change",r)},[]),!!e}const QW="sidebar_state",ZW=3600*24*7,JW="16rem",eK="18rem",tK="3rem",nK="b",HI=w.createContext(null);function pc(){const e=w.useContext(HI);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const FI=w.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:o,...l},u)=>{const d=XW(),[h,v]=w.useState(!1),[m,g]=w.useState(e),b=t??m,O=w.useCallback(N=>{const _=typeof N=="function"?N(b):N;n?n(_):g(_),document.cookie=`${QW}=${_}; path=/; max-age=${ZW}`},[n,b]),S=w.useCallback(()=>d?v(N=>!N):O(N=>!N),[d,O]);w.useEffect(()=>{const N=_=>{_.key===nK&&(_.metaKey||_.ctrlKey)&&(_.preventDefault(),S())};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[S]);const x=b?"expanded":"collapsed",E=w.useMemo(()=>({state:x,open:b,setOpen:O,isMobile:d,openMobile:h,setOpenMobile:v,toggleSidebar:S}),[x,b,O,d,h,S]);return c.jsx(HI.Provider,{value:E,children:c.jsx(UI,{delayDuration:0,children:c.jsx("div",{className:me("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:u,style:{"--sidebar-width":JW,"--sidebar-width-icon":tK,...i},...l,children:o})})})});FI.displayName="SidebarProvider";const Qh=w.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:i,...o},l)=>{const{isMobile:u,state:d,openMobile:h,setOpenMobile:v}=pc();return n==="none"?c.jsx("div",{className:me("flex h-full w-[calc(var(--sidebar-width)-var(--sidebar-width-icon)+1px)]! flex-col bg-sidebar text-sidebar-foreground",r),ref:l,...o,children:i}):u?c.jsx(xW,{onOpenChange:v,open:h,...o,children:c.jsxs(jW,{className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden","data-mobile":"true","data-sidebar":"sidebar",side:e,style:{"--sidebar-width":eK},children:[c.jsxs(OW,{className:"sr-only",children:[c.jsx(EW,{children:"Sidebar"}),c.jsx(_W,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-collapsible":d==="collapsed"?n:"","data-side":e,"data-state":d,"data-variant":t,ref:l,children:[c.jsx("div",{className:me("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),c.jsx("div",{className:me("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...o,children:c.jsx("div",{className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow","data-sidebar":"sidebar",children:i})})]})});Qh.displayName="Sidebar";const GI=w.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:i}=pc();return c.jsxs(Ce,{className:me("h-7 w-7",e),"data-sidebar":"trigger",onClick:o=>{t==null||t(o),i()},ref:r,size:"icon",variant:"ghost",...n,children:[c.jsx(PF,{}),c.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});GI.displayName="SidebarTrigger";const rK=w.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=pc();return c.jsx("button",{"aria-label":"Toggle Sidebar",className:me("-translate-x-1/2 group-data-[side=left]:-right-4 absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:hover:bg-sidebar group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),"data-sidebar":"rail",onClick:r,ref:n,tabIndex:-1,title:"Toggle Sidebar",...t})});rK.displayName="SidebarRail";const VI=w.forwardRef(({className:e,...t},n)=>c.jsx("main",{className:me("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),ref:n,...t}));VI.displayName="SidebarInset";const YI=w.forwardRef(({className:e,...t},n)=>c.jsx(oo,{className:me("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),"data-sidebar":"input",ref:n,...t}));YI.displayName="SidebarInput";const oS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex flex-col gap-2 p-2",e),"data-sidebar":"header",ref:n,...t}));oS.displayName="SidebarHeader";const WI=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex flex-col gap-2 p-2",e),"data-sidebar":"footer",ref:n,...t}));WI.displayName="SidebarFooter";const aK=w.forwardRef(({className:e,...t},n)=>c.jsx(qt,{className:me("mx-2 w-auto bg-sidebar-border",e),"data-sidebar":"separator",ref:n,...t}));aK.displayName="SidebarSeparator";const sS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),"data-sidebar":"content",ref:n,...t}));sS.displayName="SidebarContent";const lS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("relative flex w-full min-w-0 flex-col p-2",e),"data-sidebar":"group",ref:n,...t}));lS.displayName="SidebarGroup";const iK=w.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const i=t?ss:"div";return c.jsx(i,{className:me("flex h-8 shrink-0 items-center rounded-md px-2 font-medium text-sidebar-foreground/70 text-xs outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),"data-sidebar":"group-label",ref:r,...n})});iK.displayName="SidebarGroupLabel";const oK=w.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const i=t?ss:"button";return c.jsx(i,{className:me("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:-inset-2 after:absolute after:md:hidden","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"group-action",ref:r,...n})});oK.displayName="SidebarGroupAction";const cS=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("w-full text-sm",e),"data-sidebar":"group-content",ref:n,...t}));cS.displayName="SidebarGroupContent";const dm=w.forwardRef(({className:e,...t},n)=>c.jsx("ul",{className:me("flex w-full min-w-0 flex-col gap-1",e),"data-sidebar":"menu",ref:n,...t}));dm.displayName="SidebarMenu";const hm=w.forwardRef(({className:e,...t},n)=>c.jsx("li",{className:me("group/menu-item relative",e),"data-sidebar":"menu-item",ref:n,...t}));hm.displayName="SidebarMenuItem";const sK=mc("peer/menu-button group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"group-data-[collapsible=icon]:!p-0 h-12 text-sm"}},defaultVariants:{variant:"default",size:"default"}}),mm=w.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:i,className:o,...l},u)=>{const d=e?ss:"button",{isMobile:h,state:v}=pc(),m=c.jsx(d,{className:me(sK({variant:n,size:r}),o),"data-active":t,"data-sidebar":"menu-button","data-size":r,ref:u,...l});return i?(typeof i=="string"&&(i={children:i}),c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:m}),c.jsx(rv,{align:"center",hidden:v!=="collapsed"||h,side:"right",...i})]})):m});mm.displayName="SidebarMenuButton";const lK=w.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>{const o=t?ss:"button";return c.jsx(o,{className:me("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:-inset-2 after:absolute after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),"data-sidebar":"menu-action",ref:i,...r})});lK.displayName="SidebarMenuAction";const cK=w.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:me("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 font-medium text-sidebar-foreground text-xs tabular-nums","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-badge",ref:n,...t}));cK.displayName="SidebarMenuBadge";const uK=w.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const i=w.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return c.jsxs("div",{className:me("flex h-8 items-center gap-2 rounded-md px-2",e),"data-sidebar":"menu-skeleton",ref:r,...n,children:[t&&c.jsx(Re,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),c.jsx(Re,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":i}})]})});uK.displayName="SidebarMenuSkeleton";const fK=w.forwardRef(({className:e,...t},n)=>c.jsx("ul",{className:me("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-sidebar-border border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),"data-sidebar":"menu-sub",ref:n,...t}));fK.displayName="SidebarMenuSub";const dK=w.forwardRef(({...e},t)=>c.jsx("li",{ref:t,...e}));dK.displayName="SidebarMenuSubItem";const hK=w.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...i},o)=>{const l=e?ss:"a";return c.jsx(l,{className:me("-translate-x-px flex h-7 min-w-0 items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),"data-active":n,"data-sidebar":"menu-sub-button","data-size":t,ref:o,...i})});hK.displayName="SidebarMenuSubButton";function mK({user:e}){const{isMobile:t}=pc(),{theme:n,setTheme:r}=f$(),[i,o]=w.useState(null),[l,u]=w.useState(0);w.useEffect(()=>{(async()=>{try{const g=sessionStorage.getItem("wraps-auth-token");if(!g){console.log("No auth token found yet, will retry..."),l<5&&setTimeout(()=>{u(O=>O+1)},200);return}console.log("Fetching user info from /api/user");const b=await fetch(`/api/user?token=${g}`);if(console.log("User API response status:",b.status),b.ok){const O=await b.json();console.log("User info received:",O),o(O)}else{const O=await b.text();console.error("Failed to fetch user info:",b.status,O)}}catch(g){console.error("Error fetching user info:",g)}})().catch(g=>{console.error("Failed to fetch user info:",g)})},[l]);const d=()=>{window.confirm("Are you sure you want to close the console?")&&window.close()},h=(i==null?void 0:i.accountAlias)||(i==null?void 0:i.accountId)||"Loading...",v=(i==null?void 0:i.region)||"...";return c.jsx(dm,{children:c.jsx(hm,{children:c.jsxs(cI,{children:[c.jsx(uI,{asChild:!0,children:c.jsxs(mm,{className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground md:h-8 md:p-0",size:"lg",children:[c.jsxs(mC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(pC,{alt:h,src:e.avatar}),c.jsx(vC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v})]}),c.jsx(OF,{className:"ml-auto size-4"})]})}),c.jsxs(fI,{align:"end",className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",side:t?"bottom":"right",sideOffset:4,children:[c.jsx(dI,{className:"p-0 font-normal",children:c.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[c.jsxs(mC,{className:"h-8 w-8 rounded-lg",children:[c.jsx(pC,{alt:h,src:e.avatar}),c.jsx(vC,{className:"rounded-lg bg-orange-500 text-white",children:"AWS"})]}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-medium",children:h}),c.jsx("span",{className:"truncate text-xs",children:v}),(i==null?void 0:i.accountId)&&i.accountId!==i.accountAlias&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:i.accountId})]})]})}),c.jsx(rS,{}),c.jsxs(qC,{onClick:()=>r(n==="dark"?"light":"dark"),children:[n==="dark"?c.jsx($F,{}):c.jsx(RF,{}),n==="dark"?"Light Mode":"Dark Mode"]}),c.jsx(rS,{}),c.jsxs(qC,{onClick:d,children:[c.jsx(or,{}),"Close Console"]})]})]})})})}const Hi={user:{name:"Wraps Console",email:"admin@wraps.dev",avatar:"/avatars/wraps.jpg"},navMain:[{title:"Dashboard",url:"/",icon:Dp,isActive:!0,isDashboard:!0},{title:"Email",url:"#",icon:xl,isActive:!1,subItems:[{title:"Emails",icon:xl,url:"/email"},{title:"Metrics",icon:wb,url:"/email/metrics"},{title:"Settings",icon:jb,url:"/email/settings"}]},{title:"SMS",url:"#",icon:Zi,isActive:!1,subItems:[{title:"Messages",icon:Zi,url:"/sms"},{title:"Metrics",icon:wb,url:"/sms/metrics"},{title:"Settings",icon:jb,url:"/sms/settings"}]},{title:"CDN",url:"#",icon:zf,isActive:!1,subItems:[{title:"Library",icon:p$,url:"/cdn"},{title:"Metrics",icon:wb,url:"/cdn/metrics"},{title:"Settings",icon:jb,url:"/cdn/settings"}]}]};function pK({...e}){const t=Zr(),n=Sa(),{setOpen:r,state:i}=pc(),{theme:o}=f$(),l=w.useCallback(()=>t.pathname==="/"?Hi.navMain[0]:t.pathname.startsWith("/email")?Hi.navMain[1]:t.pathname.startsWith("/sms")?Hi.navMain[2]:t.pathname.startsWith("/cdn")?Hi.navMain[3]:Hi.navMain[0],[t.pathname]),[u,d]=w.useState(l());return w.useEffect(()=>{d(l())},[l]),c.jsxs(Qh,{className:"overflow-hidden *:data-[sidebar=sidebar]:flex-row",collapsible:"icon",...e,children:[c.jsxs(Qh,{className:"w-[calc(var(--sidebar-width-icon)+1px)]! border-r",collapsible:"none",children:[c.jsx(oS,{children:c.jsx(dm,{children:c.jsx(hm,{children:c.jsx(mm,{asChild:!0,className:"md:h-8 md:p-0",onClick:()=>{d(Hi.navMain[0]),r(!1)},size:"lg",children:c.jsxs(em,{to:"/",children:[c.jsx("div",{className:"flex aspect-square size-8 items-center justify-center rounded-lg",children:c.jsx("img",{alt:"Wraps",className:"size-8 object-contain",src:o==="dark"?"/wraps-dark.png":"/wraps-light.png"})}),c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[c.jsx("span",{className:"truncate font-semibold",children:"Wraps"}),c.jsx("span",{className:"truncate text-xs",children:"Console"})]})]})})})})}),c.jsx(sS,{children:c.jsx(lS,{children:c.jsx(cS,{className:"px-1.5 md:px-0",children:c.jsx(dm,{children:Hi.navMain.filter(h=>!h.isDashboard).map(h=>c.jsx(hm,{children:c.jsxs(mm,{className:"px-2.5 md:px-2",isActive:(u==null?void 0:u.title)===h.title,onClick:()=>{d(h),r(!0),h.subItems&&h.subItems.length>0&&n(h.subItems[0].url)},tooltip:{children:h.title,hidden:!1},children:[c.jsx(h.icon,{}),c.jsx("span",{children:h.title})]})},h.title))})})})}),c.jsx(WI,{children:c.jsx(mK,{user:Hi.user})})]}),i==="expanded"&&c.jsx(Qh,{className:"hidden flex-1 md:flex",collapsible:"none",children:u&&!u.isDashboard&&u.subItems?c.jsxs(c.Fragment,{children:[c.jsxs(oS,{className:"gap-3.5 border-b p-4",children:[c.jsx("div",{className:"flex w-full items-center justify-between",children:c.jsxs("div",{className:"flex items-center gap-2 font-medium text-base text-foreground",children:[c.jsx(u.icon,{className:"size-4"}),u.title]})}),c.jsx(YI,{placeholder:"Search..."})]}),c.jsx(sS,{children:c.jsx(lS,{className:"px-0",children:c.jsx(cS,{children:u.subItems.map(h=>{const v=t.pathname===h.url||h.url==="/email"&&t.pathname.startsWith("/email/")&&t.pathname!=="/email/metrics"&&t.pathname!=="/email/settings"||h.url==="/sms"&&t.pathname.startsWith("/sms/")&&t.pathname!=="/sms/metrics"&&t.pathname!=="/sms/settings"||h.url==="/cdn"&&t.pathname.startsWith("/cdn/")&&t.pathname!=="/cdn/metrics"&&t.pathname!=="/cdn/settings";return c.jsxs(em,{className:`flex items-center gap-3 border-b p-4 text-sm leading-tight transition-colors last:border-b-0 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground ${v?"bg-sidebar-accent font-semibold text-sidebar-accent-foreground":""}`,to:h.url,children:[c.jsx(h.icon,{className:"size-4 shrink-0"}),c.jsx("span",{className:"font-medium",children:h.title})]},h.title)})})})})]}):c.jsx("div",{className:"flex h-full items-center justify-center p-8 text-center",children:c.jsxs("div",{className:"text-muted-foreground",children:[c.jsx(Dp,{className:"mx-auto mb-4 size-12 opacity-50"}),c.jsx("p",{className:"text-sm",children:"Select a product to view options"})]})})})]})}function vK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const gK=e=>{switch(e){case"success":return xK;case"info":return SK;case"warning":return wK;case"error":return jK;default:return null}},yK=Array(12).fill(0),bK=({visible:e,className:t})=>I.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},I.createElement("div",{className:"sonner-spinner"},yK.map((n,r)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),xK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),SK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),jK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),OK=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),EK=()=>{const[e,t]=I.useState(document.hidden);return I.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let uS=1;class _K{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...i}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:uS++,l=this.toasts.find(d=>d.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(d=>d.id===o?(this.publish({...d,...t,id:o,title:r}),{...d,...t,id:o,dismissible:u,title:r}):d):this.addToast({title:r,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const u=i.then(async h=>{if(l=["resolve",h],I.isValidElement(h))o=!1,this.create({id:r,type:"default",message:h});else if(AK(h)&&!h.ok){o=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${h.status}`):n.error,g=typeof n.description=="function"?await n.description(`HTTP error! status: ${h.status}`):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(h instanceof Error){o=!1;const m=typeof n.error=="function"?await n.error(h):n.error,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:g,...O})}else if(n.success!==void 0){o=!1;const m=typeof n.success=="function"?await n.success(h):n.success,g=typeof n.description=="function"?await n.description(h):n.description,O=typeof m=="object"&&!I.isValidElement(m)?m:{message:m};this.create({id:r,type:"success",description:g,...O})}}).catch(async h=>{if(l=["reject",h],n.error!==void 0){o=!1;const v=typeof n.error=="function"?await n.error(h):n.error,m=typeof n.description=="function"?await n.description(h):n.description,b=typeof v=="object"&&!I.isValidElement(v)?v:{message:v};this.create({id:r,type:"error",description:m,...b})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),d=()=>new Promise((h,v)=>u.then(()=>l[0]==="reject"?v(l[1]):h(l[1])).catch(v));return typeof r!="string"&&typeof r!="number"?{unwrap:d}:Object.assign(r,{unwrap:d})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||uS++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const qn=new _K,NK=(e,t)=>{const n=(t==null?void 0:t.id)||uS++;return qn.addToast({title:e,...t,id:n}),n},AK=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",CK=NK,TK=()=>qn.toasts,MK=()=>qn.getActiveToasts(),Ot=Object.assign(CK,{success:qn.success,info:qn.info,warning:qn.warning,error:qn.error,custom:qn.custom,message:qn.message,promise:qn.promise,dismiss:qn.dismiss,loading:qn.loading},{getHistory:TK,getToasts:MK});vK("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Nh(e){return e.label!==void 0}const RK=3,DK="24px",PK="16px",GC=4e3,kK=356,$K=14,IK=45,LK=200;function sa(...e){return e.filter(Boolean).join(" ")}function zK(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const BK=e=>{var t,n,r,i,o,l,u,d,h;const{invert:v,toast:m,unstyled:g,interacting:b,setHeights:O,visibleToasts:S,heights:x,index:E,toasts:N,expanded:_,removeToast:C,defaultRichColors:A,closeButton:M,style:R,cancelButtonStyle:D,actionButtonStyle:z,className:G="",descriptionClassName:L="",duration:F,position:W,gap:Q,expandByDefault:X,classNames:k,icons:H,closeButtonAriaLabel:B="Close toast"}=e,[Z,le]=I.useState(null),[$,Y]=I.useState(null),[q,U]=I.useState(!1),[ne,fe]=I.useState(!1),[ie,pe]=I.useState(!1),[re,ve]=I.useState(!1),[ge,oe]=I.useState(!1),[ke,we]=I.useState(0),[ze,Ze]=I.useState(0),lt=I.useRef(m.duration||F||GC),tn=I.useRef(null),pt=I.useRef(null),fr=E===0,Yn=E+1<=S,Rt=m.type,dr=m.dismissible!==!1,nn=m.className||"",bs=m.descriptionClassName||"",vo=I.useMemo(()=>x.findIndex(Ie=>Ie.toastId===m.id)||0,[x,m.id]),rd=I.useMemo(()=>{var Ie;return(Ie=m.closeButton)!=null?Ie:M},[m.closeButton,M]),go=I.useMemo(()=>m.duration||F||GC,[m.duration,F]),_c=I.useRef(0),Ea=I.useRef(0),ad=I.useRef(0),vi=I.useRef(null),[yo,On]=W.split("-"),$r=I.useMemo(()=>x.reduce((Ie,At,rn)=>rn>=vo?Ie:Ie+At.height,0),[x,vo]),gn=EK(),eg=m.invert||v,Nc=Rt==="loading";Ea.current=I.useMemo(()=>vo*Q+$r,[vo,$r]),I.useEffect(()=>{lt.current=go},[go]),I.useEffect(()=>{U(!0)},[]),I.useEffect(()=>{const Ie=pt.current;if(Ie){const At=Ie.getBoundingClientRect().height;return Ze(At),O(rn=>[{toastId:m.id,height:At,position:m.position},...rn]),()=>O(rn=>rn.filter(yn=>yn.toastId!==m.id))}},[O,m.id]),I.useLayoutEffect(()=>{if(!q)return;const Ie=pt.current,At=Ie.style.height;Ie.style.height="auto";const rn=Ie.getBoundingClientRect().height;Ie.style.height=At,Ze(rn),O(yn=>yn.find(Dt=>Dt.toastId===m.id)?yn.map(Dt=>Dt.toastId===m.id?{...Dt,height:rn}:Dt):[{toastId:m.id,height:rn,position:m.position},...yn])},[q,m.title,m.description,O,m.id,m.jsx,m.action,m.cancel]);const ta=I.useCallback(()=>{fe(!0),we(Ea.current),O(Ie=>Ie.filter(At=>At.toastId!==m.id)),setTimeout(()=>{C(m)},LK)},[m,C,O,Ea]);I.useEffect(()=>{if(m.promise&&Rt==="loading"||m.duration===1/0||m.type==="loading")return;let Ie;return _||b||gn?(()=>{if(ad.current<_c.current){const yn=new Date().getTime()-_c.current;lt.current=lt.current-yn}ad.current=new Date().getTime()})():(()=>{lt.current!==1/0&&(_c.current=new Date().getTime(),Ie=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ta()},lt.current))})(),()=>clearTimeout(Ie)},[_,b,m,Rt,gn,ta]),I.useEffect(()=>{m.delete&&(ta(),m.onDismiss==null||m.onDismiss.call(m,m))},[ta,m.delete]);function xs(){var Ie;if(H!=null&&H.loading){var At;return I.createElement("div",{className:sa(k==null?void 0:k.loader,m==null||(At=m.classNames)==null?void 0:At.loader,"sonner-loader"),"data-visible":Rt==="loading"},H.loading)}return I.createElement(bK,{className:sa(k==null?void 0:k.loader,m==null||(Ie=m.classNames)==null?void 0:Ie.loader),visible:Rt==="loading"})}const ws=m.icon||(H==null?void 0:H[Rt])||gK(Rt);var bo,na;return I.createElement("li",{tabIndex:0,ref:pt,className:sa(G,nn,k==null?void 0:k.toast,m==null||(t=m.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[Rt],m==null||(n=m.classNames)==null?void 0:n[Rt]),"data-sonner-toast":"","data-rich-colors":(bo=m.richColors)!=null?bo:A,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":q,"data-promise":!!m.promise,"data-swiped":ge,"data-removed":ne,"data-visible":Yn,"data-y-position":yo,"data-x-position":On,"data-index":E,"data-front":fr,"data-swiping":ie,"data-dismissible":dr,"data-type":Rt,"data-invert":eg,"data-swipe-out":re,"data-swipe-direction":$,"data-expanded":!!(_||X&&q),"data-testid":m.testId,style:{"--index":E,"--toasts-before":E,"--z-index":N.length-E,"--offset":`${ne?ke:Ea.current}px`,"--initial-height":X?"auto":`${ze}px`,...R,...m.style},onDragEnd:()=>{pe(!1),le(null),vi.current=null},onPointerDown:Ie=>{Ie.button!==2&&(Nc||!dr||(tn.current=new Date,we(Ea.current),Ie.target.setPointerCapture(Ie.pointerId),Ie.target.tagName!=="BUTTON"&&(pe(!0),vi.current={x:Ie.clientX,y:Ie.clientY})))},onPointerUp:()=>{var Ie,At,rn;if(re||!dr)return;vi.current=null;const yn=Number(((Ie=pt.current)==null?void 0:Ie.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gi=Number(((At=pt.current)==null?void 0:At.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Dt=new Date().getTime()-((rn=tn.current)==null?void 0:rn.getTime()),Tn=Z==="x"?yn:gi,xo=Math.abs(Tn)/Dt;if(Math.abs(Tn)>=IK||xo>.11){we(Ea.current),m.onDismiss==null||m.onDismiss.call(m,m),Y(Z==="x"?yn>0?"right":"left":gi>0?"down":"up"),ta(),ve(!0);return}else{var Mn,Rn;(Mn=pt.current)==null||Mn.style.setProperty("--swipe-amount-x","0px"),(Rn=pt.current)==null||Rn.style.setProperty("--swipe-amount-y","0px")}oe(!1),pe(!1),le(null)},onPointerMove:Ie=>{var At,rn,yn;if(!vi.current||!dr||((At=window.getSelection())==null?void 0:At.toString().length)>0)return;const Dt=Ie.clientY-vi.current.y,Tn=Ie.clientX-vi.current.x;var xo;const Mn=(xo=e.swipeDirections)!=null?xo:zK(W);!Z&&(Math.abs(Tn)>1||Math.abs(Dt)>1)&&le(Math.abs(Tn)>Math.abs(Dt)?"x":"y");let Rn={x:0,y:0};const Ss=Ir=>1/(1.5+Math.abs(Ir)/20);if(Z==="y"){if(Mn.includes("top")||Mn.includes("bottom"))if(Mn.includes("top")&&Dt<0||Mn.includes("bottom")&&Dt>0)Rn.y=Dt;else{const Ir=Dt*Ss(Dt);Rn.y=Math.abs(Ir)<Math.abs(Dt)?Ir:Dt}}else if(Z==="x"&&(Mn.includes("left")||Mn.includes("right")))if(Mn.includes("left")&&Tn<0||Mn.includes("right")&&Tn>0)Rn.x=Tn;else{const Ir=Tn*Ss(Tn);Rn.x=Math.abs(Ir)<Math.abs(Tn)?Ir:Tn}(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&oe(!0),(rn=pt.current)==null||rn.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(yn=pt.current)==null||yn.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},rd&&!m.jsx&&Rt!=="loading"?I.createElement("button",{"aria-label":B,"data-disabled":Nc,"data-close-button":!0,onClick:Nc||!dr?()=>{}:()=>{ta(),m.onDismiss==null||m.onDismiss.call(m,m)},className:sa(k==null?void 0:k.closeButton,m==null||(r=m.classNames)==null?void 0:r.closeButton)},(na=H==null?void 0:H.close)!=null?na:OK):null,(Rt||m.icon||m.promise)&&m.icon!==null&&((H==null?void 0:H[Rt])!==null||m.icon)?I.createElement("div",{"data-icon":"",className:sa(k==null?void 0:k.icon,m==null||(i=m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||xs():null,m.type!=="loading"?ws:null):null,I.createElement("div",{"data-content":"",className:sa(k==null?void 0:k.content,m==null||(o=m.classNames)==null?void 0:o.content)},I.createElement("div",{"data-title":"",className:sa(k==null?void 0:k.title,m==null||(l=m.classNames)==null?void 0:l.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?I.createElement("div",{"data-description":"",className:sa(L,bs,k==null?void 0:k.description,m==null||(u=m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),I.isValidElement(m.cancel)?m.cancel:m.cancel&&Nh(m.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||D,onClick:Ie=>{Nh(m.cancel)&&dr&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ie),ta())},className:sa(k==null?void 0:k.cancelButton,m==null||(d=m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,I.isValidElement(m.action)?m.action:m.action&&Nh(m.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||z,onClick:Ie=>{Nh(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ie),!Ie.defaultPrevented&&ta())},className:sa(k==null?void 0:k.actionButton,m==null||(h=m.classNames)==null?void 0:h.actionButton)},m.action.label):null)};function VC(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function qK(e,t){const n={};return[e,t].forEach((r,i)=>{const o=i===1,l=o?"--mobile-offset":"--offset",u=o?PK:DK;function d(h){["top","right","bottom","left"].forEach(v=>{n[`${l}-${v}`]=typeof h=="number"?`${h}px`:h})}typeof r=="number"||typeof r=="string"?d(r):typeof r=="object"?["top","right","bottom","left"].forEach(h=>{r[h]===void 0?n[`${l}-${h}`]=u:n[`${l}-${h}`]=typeof r[h]=="number"?`${r[h]}px`:r[h]}):d(u)}),n}const UK=I.forwardRef(function(t,n){const{id:r,invert:i,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:h,offset:v,mobileOffset:m,theme:g="light",richColors:b,duration:O,style:S,visibleToasts:x=RK,toastOptions:E,dir:N=VC(),gap:_=$K,icons:C,containerAriaLabel:A="Notifications"}=t,[M,R]=I.useState([]),D=I.useMemo(()=>r?M.filter(q=>q.toasterId===r):M.filter(q=>!q.toasterId),[M,r]),z=I.useMemo(()=>Array.from(new Set([o].concat(D.filter(q=>q.position).map(q=>q.position)))),[D,o]),[G,L]=I.useState([]),[F,W]=I.useState(!1),[Q,X]=I.useState(!1),[k,H]=I.useState(g!=="system"?g:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),B=I.useRef(null),Z=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),le=I.useRef(null),$=I.useRef(!1),Y=I.useCallback(q=>{R(U=>{var ne;return(ne=U.find(fe=>fe.id===q.id))!=null&&ne.delete||qn.dismiss(q.id),U.filter(({id:fe})=>fe!==q.id)})},[]);return I.useEffect(()=>qn.subscribe(q=>{if(q.dismiss){requestAnimationFrame(()=>{R(U=>U.map(ne=>ne.id===q.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{c$.flushSync(()=>{R(U=>{const ne=U.findIndex(fe=>fe.id===q.id);return ne!==-1?[...U.slice(0,ne),{...U[ne],...q},...U.slice(ne+1)]:[q,...U]})})})}),[M]),I.useEffect(()=>{if(g!=="system"){H(g);return}if(g==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;const q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:U})=>{H(U?"dark":"light")})}catch{q.addListener(({matches:ne})=>{try{H(ne?"dark":"light")}catch(fe){console.error(fe)}})}},[g]),I.useEffect(()=>{M.length<=1&&W(!1)},[M]),I.useEffect(()=>{const q=U=>{var ne;if(l.every(pe=>U[pe]||U.code===pe)){var ie;W(!0),(ie=B.current)==null||ie.focus()}U.code==="Escape"&&(document.activeElement===B.current||(ne=B.current)!=null&&ne.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[l]),I.useEffect(()=>{if(B.current)return()=>{le.current&&(le.current.focus({preventScroll:!0}),le.current=null,$.current=!1)}},[B.current]),I.createElement("section",{ref:n,"aria-label":`${A} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((q,U)=>{var ne;const[fe,ie]=q.split("-");return D.length?I.createElement("ol",{key:q,dir:N==="auto"?VC():N,tabIndex:-1,ref:B,className:h,"data-sonner-toaster":!0,"data-sonner-theme":k,"data-y-position":fe,"data-x-position":ie,style:{"--front-toast-height":`${((ne=G[0])==null?void 0:ne.height)||0}px`,"--width":`${kK}px`,"--gap":`${_}px`,...S,...qK(v,m)},onBlur:pe=>{$.current&&!pe.currentTarget.contains(pe.relatedTarget)&&($.current=!1,le.current&&(le.current.focus({preventScroll:!0}),le.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||$.current||($.current=!0,le.current=pe.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{Q||W(!1)},onDragEnd:()=>W(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||X(!0)},onPointerUp:()=>X(!1)},D.filter(pe=>!pe.position&&U===0||pe.position===q).map((pe,re)=>{var ve,ge;return I.createElement(BK,{key:pe.id,icons:C,index:re,toast:pe,defaultRichColors:b,duration:(ve=E==null?void 0:E.duration)!=null?ve:O,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:i,visibleToasts:x,closeButton:(ge=E==null?void 0:E.closeButton)!=null?ge:d,interacting:Q,position:q,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:Y,toasts:D.filter(oe=>oe.position==pe.position),heights:G.filter(oe=>oe.position==pe.position),setHeights:L,expandByDefault:u,gap:_,expanded:F,swipeDirections:t.swipeDirections})})):null}))});function fa({value:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=w.useState("idle"),u=async d=>{d.stopPropagation(),l("copying");try{await Promise.all([navigator.clipboard.writeText(e),new Promise(h=>setTimeout(h,150))]),l("copied"),Ot.success("Copied to clipboard"),setTimeout(()=>l("idle"),2e3)}catch{l("idle"),Ot.error("Failed to copy to clipboard")}};return c.jsxs(Ce,{className:me("transition-all",o==="copied"&&"text-green-500",t),disabled:o==="copying",onClick:u,size:r,variant:n,children:[o==="copying"?c.jsx(Va,{className:me("animate-spin",i?"mr-2 h-4 w-4":"h-4 w-4")}):o==="copied"?c.jsx(ri,{className:me(i?"mr-2 h-4 w-4":"h-4 w-4")}):c.jsx(Kj,{className:me(i?"mr-2 h-4 w-4":"h-4 w-4")}),i]})}function KI({onDelete:e,className:t,variant:n="outline",size:r="icon",label:i}){const[o,l]=w.useState(!1),u=async d=>{d.stopPropagation(),l(!0);try{await Promise.all([e(),new Promise(h=>setTimeout(h,150))])}finally{l(!1)}};return c.jsxs(Ce,{className:me("text-destructive transition-all hover:text-destructive",t),disabled:o,onClick:u,size:r,variant:n,children:[o?c.jsx(Va,{className:me("animate-spin",i?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(IF,{className:me(i?"mr-1.5 h-4 w-4":"h-4 w-4")}),i]})}const XI=6048e5,HK=864e5,Ah=43200,YC=1440,WC=Symbol.for("constructDateFrom");function oi(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&WC in e?e[WC](t):e instanceof Date?new e.constructor(t):new Date(t)}function ln(e,t){return oi(t||e,e)}let FK={};function Yf(){return FK}function Ju(e,t){var u,d,h,v;const n=Yf(),r=(t==null?void 0:t.weekStartsOn)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((v=(h=n.locale)==null?void 0:h.options)==null?void 0:v.weekStartsOn)??0,i=ln(e,t==null?void 0:t.in),o=i.getDay(),l=(o<r?7:0)+o-r;return i.setDate(i.getDate()-l),i.setHours(0,0,0,0),i}function pm(e,t){return Ju(e,{...t,weekStartsOn:1})}function QI(e,t){const n=ln(e,t==null?void 0:t.in),r=n.getFullYear(),i=oi(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const o=pm(i),l=oi(n,0);l.setFullYear(r,0,4),l.setHours(0,0,0,0);const u=pm(l);return n.getTime()>=o.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function vm(e){const t=ln(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function av(e,...t){const n=oi.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function KC(e,t){const n=ln(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function GK(e,t,n){const[r,i]=av(n==null?void 0:n.in,e,t),o=KC(r),l=KC(i),u=+o-vm(o),d=+l-vm(l);return Math.round((u-d)/HK)}function VK(e,t){const n=QI(e,t),r=oi(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),pm(r)}function Zh(e,t){const n=+ln(e)-+ln(t);return n<0?-1:n>0?1:n}function YK(e){return oi(e,Date.now())}function WK(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function KK(e){return!(!WK(e)&&typeof e!="number"||isNaN(+ln(e)))}function XK(e,t,n){const[r,i]=av(n==null?void 0:n.in,e,t),o=r.getFullYear()-i.getFullYear(),l=r.getMonth()-i.getMonth();return o*12+l}function QK(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function ZK(e,t){return+ln(e)-+ln(t)}function JK(e,t){const n=ln(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function eX(e,t){const n=ln(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function tX(e,t){const n=ln(e,t==null?void 0:t.in);return+JK(n,t)==+eX(n,t)}function nX(e,t,n){const[r,i,o]=av(n==null?void 0:n.in,e,e,t),l=Zh(i,o),u=Math.abs(XK(i,o));if(u<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-l*u);let d=Zh(i,o)===-l;tX(r)&&u===1&&Zh(r,o)===1&&(d=!1);const h=l*(u-+d);return h===0?0:h}function rX(e,t,n){const r=ZK(e,t)/1e3;return QK(n==null?void 0:n.roundingMethod)(r)}function aX(e,t){const n=ln(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const iX={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},oX=(e,t,n)=>{let r;const i=iX[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function zb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const sX={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},lX={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},cX={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},uX={date:zb({formats:sX,defaultWidth:"full"}),time:zb({formats:lX,defaultWidth:"full"}),dateTime:zb({formats:cX,defaultWidth:"full"})},fX={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dX=(e,t,n,r)=>fX[e];function wu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=n!=null&&n.width?String(n.width):l;i=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=n!=null&&n.width?String(n.width):e.defaultWidth;i=e.values[u]||e.values[l]}const o=e.argumentCallback?e.argumentCallback(t):t;return i[o]}}const hX={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},mX={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pX={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},vX={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},gX={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},yX={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},bX=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},xX={ordinalNumber:bX,era:wu({values:hX,defaultWidth:"wide"}),quarter:wu({values:mX,defaultWidth:"wide",argumentCallback:e=>e-1}),month:wu({values:pX,defaultWidth:"wide"}),day:wu({values:vX,defaultWidth:"wide"}),dayPeriod:wu({values:gX,defaultWidth:"wide",formattingValues:yX,defaultFormattingWidth:"wide"})};function Su(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;const l=o[0],u=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?SX(u,m=>m.test(l)):wX(u,m=>m.test(l));let h;h=e.valueCallback?e.valueCallback(d):d,h=n.valueCallback?n.valueCallback(h):h;const v=t.slice(l.length);return{value:h,rest:v}}}function wX(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function SX(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function jX(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],o=t.match(e.parsePattern);if(!o)return null;let l=e.valueCallback?e.valueCallback(o[0]):o[0];l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(i.length);return{value:l,rest:u}}}const OX=/^(\d+)(th|st|nd|rd)?/i,EX=/\d+/i,_X={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},NX={any:[/^b/i,/^(a|c)/i]},AX={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},CX={any:[/1/i,/2/i,/3/i,/4/i]},TX={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},MX={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},RX={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},DX={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},PX={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},kX={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},$X={ordinalNumber:jX({matchPattern:OX,parsePattern:EX,valueCallback:e=>parseInt(e,10)}),era:Su({matchPatterns:_X,defaultMatchWidth:"wide",parsePatterns:NX,defaultParseWidth:"any"}),quarter:Su({matchPatterns:AX,defaultMatchWidth:"wide",parsePatterns:CX,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Su({matchPatterns:TX,defaultMatchWidth:"wide",parsePatterns:MX,defaultParseWidth:"any"}),day:Su({matchPatterns:RX,defaultMatchWidth:"wide",parsePatterns:DX,defaultParseWidth:"any"}),dayPeriod:Su({matchPatterns:PX,defaultMatchWidth:"any",parsePatterns:kX,defaultParseWidth:"any"})},ZI={code:"en-US",formatDistance:oX,formatLong:uX,formatRelative:dX,localize:xX,match:$X,options:{weekStartsOn:0,firstWeekContainsDate:1}};function IX(e,t){const n=ln(e,t==null?void 0:t.in);return GK(n,aX(n))+1}function LX(e,t){const n=ln(e,t==null?void 0:t.in),r=+pm(n)-+VK(n);return Math.round(r/XI)+1}function JI(e,t){var v,m,g,b;const n=ln(e,t==null?void 0:t.in),r=n.getFullYear(),i=Yf(),o=(t==null?void 0:t.firstWeekContainsDate)??((m=(v=t==null?void 0:t.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??i.firstWeekContainsDate??((b=(g=i.locale)==null?void 0:g.options)==null?void 0:b.firstWeekContainsDate)??1,l=oi((t==null?void 0:t.in)||e,0);l.setFullYear(r+1,0,o),l.setHours(0,0,0,0);const u=Ju(l,t),d=oi((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const h=Ju(d,t);return+n>=+u?r+1:+n>=+h?r:r-1}function zX(e,t){var u,d,h,v;const n=Yf(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((v=(h=n.locale)==null?void 0:h.options)==null?void 0:v.firstWeekContainsDate)??1,i=JI(e,t),o=oi((t==null?void 0:t.in)||e,0);return o.setFullYear(i,0,r),o.setHours(0,0,0,0),Ju(o,t)}function BX(e,t){const n=ln(e,t==null?void 0:t.in),r=+Ju(n,t)-+zX(n,t);return Math.round(r/XI)+1}function ht(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Fi={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return ht(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return ht(i,t.length)}},fl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},XC={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Fi.y(e,t)},Y:function(e,t,n,r){const i=JI(e,r),o=i>0?i:1-i;if(t==="YY"){const l=o%100;return ht(l,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ht(o,t.length)},R:function(e,t){const n=QI(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return ht(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return ht(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fi.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return ht(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=BX(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},I:function(e,t,n){const r=LX(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):ht(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fi.d(e,t)},D:function(e,t,n){const r=IX(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):ht(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ht(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ht(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return ht(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=fl.noon:r===0?i=fl.midnight:i=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=fl.evening:r>=12?i=fl.afternoon:r>=4?i=fl.morning:i=fl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fi.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):ht(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):ht(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fi.s(e,t)},S:function(e,t){return Fi.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ZC(r);case"XXXX":case"XX":return Bo(r);case"XXXXX":case"XXX":default:return Bo(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ZC(r);case"xxxx":case"xx":return Bo(r);case"xxxxx":case"xxx":default:return Bo(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+QC(r,":");case"OOOO":default:return"GMT"+Bo(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+QC(r,":");case"zzzz":default:return"GMT"+Bo(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return ht(r,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function QC(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),o=r%60;return o===0?n+String(i):n+String(i)+t+ht(o,2)}function ZC(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):Bo(e,t)}function Bo(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=ht(Math.trunc(r/60),2),o=ht(r%60,2);return n+i+t+o}const JC=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},e3=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},qX=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return JC(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",JC(r,t)).replace("{{time}}",e3(i,t))},UX={p:e3,P:qX},HX=/^D+$/,FX=/^Y+$/,GX=["D","DD","YY","YYYY"];function VX(e){return HX.test(e)}function YX(e){return FX.test(e)}function WX(e,t,n){const r=KX(e,t,n);if(console.warn(r),GX.includes(e))throw new RangeError(r)}function KX(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const XX=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,QX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ZX=/^'([^]*?)'?$/,JX=/''/g,eQ=/[a-zA-Z]/;function fS(e,t,n){var v,m,g,b;const r=Yf(),i=r.locale??ZI,o=r.firstWeekContainsDate??((m=(v=r.locale)==null?void 0:v.options)==null?void 0:m.firstWeekContainsDate)??1,l=r.weekStartsOn??((b=(g=r.locale)==null?void 0:g.options)==null?void 0:b.weekStartsOn)??0,u=ln(e,n==null?void 0:n.in);if(!KK(u))throw new RangeError("Invalid time value");let d=t.match(QX).map(O=>{const S=O[0];if(S==="p"||S==="P"){const x=UX[S];return x(O,i.formatLong)}return O}).join("").match(XX).map(O=>{if(O==="''")return{isToken:!1,value:"'"};const S=O[0];if(S==="'")return{isToken:!1,value:tQ(O)};if(XC[S])return{isToken:!0,value:O};if(S.match(eQ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:O}});i.localize.preprocessor&&(d=i.localize.preprocessor(u,d));const h={firstWeekContainsDate:o,weekStartsOn:l,locale:i};return d.map(O=>{if(!O.isToken)return O.value;const S=O.value;(YX(S)||VX(S))&&WX(S,t,String(e));const x=XC[S[0]];return x(u,S,i.localize,h)}).join("")}function tQ(e){const t=e.match(ZX);return t?t[1].replace(JX,"'"):e}function nQ(e,t,n){const r=Yf(),i=(n==null?void 0:n.locale)??r.locale??ZI,o=2520,l=Zh(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const u=Object.assign({},n,{addSuffix:n==null?void 0:n.addSuffix,comparison:l}),[d,h]=av(n==null?void 0:n.in,...l>0?[t,e]:[e,t]),v=rX(h,d),m=(vm(h)-vm(d))/1e3,g=Math.round((v-m)/60);let b;if(g<2)return n!=null&&n.includeSeconds?v<5?i.formatDistance("lessThanXSeconds",5,u):v<10?i.formatDistance("lessThanXSeconds",10,u):v<20?i.formatDistance("lessThanXSeconds",20,u):v<40?i.formatDistance("halfAMinute",0,u):v<60?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",1,u):g===0?i.formatDistance("lessThanXMinutes",1,u):i.formatDistance("xMinutes",g,u);if(g<45)return i.formatDistance("xMinutes",g,u);if(g<90)return i.formatDistance("aboutXHours",1,u);if(g<YC){const O=Math.round(g/60);return i.formatDistance("aboutXHours",O,u)}else{if(g<o)return i.formatDistance("xDays",1,u);if(g<Ah){const O=Math.round(g/YC);return i.formatDistance("xDays",O,u)}else if(g<Ah*2)return b=Math.round(g/Ah),i.formatDistance("aboutXMonths",b,u)}if(b=nX(h,d),b<12){const O=Math.round(g/Ah);return i.formatDistance("xMonths",O,u)}else{const O=b%12,S=Math.trunc(b/12);return O<3?i.formatDistance("aboutXYears",S,u):O<9?i.formatDistance("overXYears",S,u):i.formatDistance("almostXYears",S+1,u)}}function rQ(e,t){return nQ(e,YK(e),t)}const aQ=mc("inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden whitespace-nowrap rounded-full border px-2 py-0.5 font-medium text-xs transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function qe({className:e,variant:t,asChild:n=!1,...r}){const i=n?ss:"span";return c.jsx(i,{className:me(aQ({variant:t}),e),"data-slot":"badge",...r})}function RO({...e}){return c.jsx(OO,{"data-slot":"dialog",...e})}function iQ({...e}){return c.jsx(EO,{"data-slot":"dialog-portal",...e})}function oQ({className:e,...t}){return c.jsx(_O,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"dialog-overlay",...t})}function DO({className:e,children:t,showCloseButton:n=!0,...r}){return c.jsxs(iQ,{"data-slot":"dialog-portal",children:[c.jsx(oQ,{}),c.jsxs(NO,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"dialog-content",...r,children:[t,n&&c.jsxs(Zp,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-slot":"dialog-close",children:[c.jsx(or,{}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function t3({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"dialog-header",...t})}function n3({className:e,...t}){return c.jsx("div",{className:me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"dialog-footer",...t})}function r3({className:e,...t}){return c.jsx(AO,{className:me("font-semibold text-lg leading-none",e),"data-slot":"dialog-title",...t})}function sQ({className:e,...t}){return c.jsx(CO,{className:me("text-muted-foreground text-sm",e),"data-slot":"dialog-description",...t})}function iv({starred:e,onToggle:t,className:n,variant:r="ghost",size:i="icon",label:o}){const[l,u]=w.useState(!1),d=async h=>{h.stopPropagation(),u(!0);try{await Promise.all([t(),new Promise(v=>setTimeout(v,150))])}finally{u(!1)}};return c.jsxs(Ce,{className:me("transition-all",n),disabled:l,onClick:d,size:i,variant:r,children:[l?c.jsx(Va,{className:me("animate-spin",o?"mr-1.5 h-4 w-4":"h-4 w-4")}):c.jsx(b$,{className:me("transition-colors",o?"mr-1.5 h-4 w-4":"h-4 w-4",e?"fill-yellow-500 text-yellow-500":"text-muted-foreground")}),o,!o&&c.jsx("span",{className:"sr-only",children:e?"Unstar":"Star"})]})}function lQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(2)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function a3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function cQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?a3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function uQ({file:e,onClose:t,onToggleStar:n,onDelete:r}){const i=e.key.split("/").pop()||e.key,o=a3(i),l=cQ(e.contentType,i),u=()=>{const d=document.createElement("a");d.href=e.url,d.download=i,d.target="_blank",d.click()};return c.jsx(RO,{onOpenChange:d=>!d&&t(),open:!0,children:c.jsx(DO,{className:"max-h-[90vh] max-w-4xl overflow-y-auto [&>button]:hidden",children:c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-bold text-2xl",children:i}),e.key!==i&&c.jsx("p",{className:"mt-1 text-muted-foreground text-sm",children:e.key})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(iv,{onToggle:()=>n(e.key,!e.starred),starred:e.starred,variant:"outline"}),c.jsx(KI,{onDelete:()=>r(e.key)}),c.jsx(Ce,{onClick:t,size:"icon",variant:"outline",children:c.jsx(or,{className:"h-4 w-4"})})]})]}),c.jsx("div",{className:"aspect-video overflow-hidden rounded-lg bg-muted",children:l&&e.url.startsWith("https://")?c.jsx("img",{alt:i,className:"h-full w-full object-contain",src:e.url}):c.jsxs("div",{className:"flex h-full w-full flex-col items-center justify-center gap-2",children:[l?c.jsx(Xj,{className:"h-16 w-16 text-muted-foreground/50"}):c.jsx(Qj,{className:"h-16 w-16 text-muted-foreground/50"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Preview not available"})]})}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(fa,{className:"flex-1",label:"Copy CDN URL",size:"default",value:e.url,variant:"default"}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:()=>window.open(e.url,"_blank"),variant:"outline",children:[c.jsx(Gu,{className:"h-4 w-4"}),"Open in New Tab"]}),c.jsxs(Ce,{className:"flex-1 gap-2 bg-transparent",onClick:u,variant:"outline",children:[c.jsx(NF,{className:"h-4 w-4"}),"Download"]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"File Information"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Format"}),c.jsx("dd",{className:"font-medium",children:c.jsx(qe,{variant:"secondary",children:o.toUpperCase()})})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Size"}),c.jsx("dd",{className:"font-medium",children:lQ(e.size)})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Content Type"}),c.jsx("dd",{className:"font-medium",children:e.contentType||"Unknown"})]})]})]})}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"Metadata"}),c.jsxs("dl",{className:"space-y-2 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Last Modified"}),c.jsx("dd",{className:"font-medium",children:fS(new Date(e.lastModified),"MMM d, yyyy 'at' h:mm a")})]}),c.jsxs("div",{className:"flex justify-between",children:[c.jsx("dt",{className:"text-muted-foreground",children:"Starred"}),c.jsx("dd",{className:"font-medium",children:e.starred?"Yes":"No"})]}),e.tags.length>0&&c.jsxs("div",{children:[c.jsx("dt",{className:"mb-1 text-muted-foreground",children:"Tags"}),c.jsx("dd",{className:"flex flex-wrap gap-1",children:e.tags.filter(d=>d.key!=="starred").map(d=>c.jsxs(qe,{variant:"secondary",children:[d.key,": ",d.value]},d.key))})]})]})]})})]}),c.jsx(qt,{}),c.jsxs("div",{children:[c.jsx("h3",{className:"mb-2 font-semibold text-sm",children:"CDN URL"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("code",{className:"flex-1 break-all rounded bg-muted px-3 py-2 text-sm",children:e.url}),c.jsx(fa,{size:"sm",value:e.url})]})]})]})})})}function Te({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),"data-slot":"card",...t})}function Me({className:e,...t}){return c.jsx("div",{className:me("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),"data-slot":"card-header",...t})}function Le({className:e,...t}){return c.jsx("div",{className:me("font-semibold leading-none",e),"data-slot":"card-title",...t})}function We({className:e,...t}){return c.jsx("div",{className:me("text-muted-foreground text-sm",e),"data-slot":"card-description",...t})}function $e({className:e,...t}){return c.jsx("div",{className:me("px-6",e),"data-slot":"card-content",...t})}function fQ({className:e,...t}){return c.jsx("div",{className:me("flex items-center px-6 [.border-t]:pt-6",e),"data-slot":"card-footer",...t})}function ov(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sv="Checkbox",[dQ]=jn(sv),[hQ,PO]=dQ(sv);function mQ(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:o,form:l,name:u,onCheckedChange:d,required:h,value:v="on",internal_do_not_use_render:m}=e,[g,b]=Nn({prop:n,defaultProp:i??!1,onChange:d,caller:sv}),[O,S]=w.useState(null),[x,E]=w.useState(null),N=w.useRef(!1),_=O?!!l||!!O.closest("form"):!0,C={checked:g,disabled:o,setChecked:b,control:O,setControl:S,name:u,form:l,value:v,hasConsumerStoppedPropagationRef:N,required:h,defaultChecked:Ki(i)?!1:i,isFormControl:_,bubbleInput:x,setBubbleInput:E};return c.jsx(hQ,{scope:t,...C,children:pQ(m)?m(C):r})}var i3="CheckboxTrigger",o3=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{const{control:o,value:l,disabled:u,checked:d,required:h,setControl:v,setChecked:m,hasConsumerStoppedPropagationRef:g,isFormControl:b,bubbleInput:O}=PO(i3,e),S=Ue(i,v),x=w.useRef(d);return w.useEffect(()=>{const E=o==null?void 0:o.form;if(E){const N=()=>m(x.current);return E.addEventListener("reset",N),()=>E.removeEventListener("reset",N)}},[o,m]),c.jsx(Ne.button,{type:"button",role:"checkbox","aria-checked":Ki(d)?"mixed":d,"aria-required":h,"data-state":d3(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:S,onKeyDown:ye(t,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:ye(n,E=>{m(N=>Ki(N)?!0:!N),O&&b&&(g.current=E.isPropagationStopped(),g.current||E.stopPropagation())})})});o3.displayName=i3;var s3=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:h,form:v,...m}=e;return c.jsx(mQ,{__scopeCheckbox:n,checked:i,defaultChecked:o,disabled:u,required:l,onCheckedChange:h,name:r,form:v,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(o3,{...m,ref:t,__scopeCheckbox:n}),g&&c.jsx(f3,{__scopeCheckbox:n})]})})});s3.displayName=sv;var l3="CheckboxIndicator",c3=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,o=PO(l3,n);return c.jsx(An,{present:r||Ki(o.checked)||o.checked===!0,children:c.jsx(Ne.span,{"data-state":d3(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});c3.displayName=l3;var u3="CheckboxBubbleInput",f3=w.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:l,required:u,disabled:d,name:h,value:v,form:m,bubbleInput:g,setBubbleInput:b}=PO(u3,e),O=Ue(n,b),S=ov(o),x=qp(r);w.useEffect(()=>{const N=g;if(!N)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,M=!i.current;if(S!==o&&A){const R=new Event("click",{bubbles:M});N.indeterminate=Ki(o),A.call(N,Ki(o)?!1:o),N.dispatchEvent(R)}},[g,S,o,i]);const E=w.useRef(Ki(o)?!1:o);return c.jsx(Ne.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??E.current,required:u,disabled:d,name:h,value:v,form:m,...t,tabIndex:-1,ref:O,style:{...t.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});f3.displayName=u3;function pQ(e){return typeof e=="function"}function Ki(e){return e==="indeterminate"}function d3(e){return Ki(e)?"indeterminate":e?"checked":"unchecked"}function dS({className:e,...t}){return c.jsx(s3,{className:me("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",e),"data-slot":"checkbox",...t,children:c.jsx(c3,{className:"grid place-content-center text-current transition-none","data-slot":"checkbox-indicator",children:c.jsx(ri,{className:"size-3.5"})})})}function vQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function h3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function gQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?h3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function yQ({files:e,selectedFiles:t,onSelectFile:n,onToggleStar:r,onFileClick:i}){const o=(l,u)=>{l.stopPropagation(),window.open(u,"_blank")};return c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:e.map(l=>{const u=l.key.split("/").pop()||l.key,d=h3(u),h=gQ(l.contentType,u),v=t.includes(l.key);return c.jsxs("div",{className:"group relative cursor-pointer overflow-hidden rounded-xl bg-muted shadow-sm transition-shadow hover:shadow-md",onClick:()=>i(l),children:[c.jsx("div",{className:"flex aspect-square items-center justify-center",children:h&&l.url.startsWith("https://")?c.jsx("img",{alt:u,className:"h-full w-full object-cover",src:l.url}):c.jsx("div",{className:"flex h-full w-full items-center justify-center",children:h?c.jsx(Xj,{className:"h-12 w-12 text-muted-foreground/50"}):c.jsx(Qj,{className:"h-12 w-12 text-muted-foreground/50"})})}),c.jsx(iv,{className:"absolute top-2 right-2 rounded-full bg-background/80 hover:bg-background/90",onToggle:()=>r(l.key,!l.starred),starred:l.starred}),c.jsxs(Te,{className:"gap-2 rounded-t-none border-none py-3 shadow-none",children:[c.jsxs(Me,{className:"gap-1 px-3 py-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{onClick:m=>m.stopPropagation(),children:c.jsx(dS,{checked:v,onCheckedChange:()=>n(l.key)})}),c.jsx(Le,{className:"min-w-0 flex-1 truncate text-sm",children:u})]}),c.jsxs(We,{className:"flex items-center gap-2 pl-6",children:[c.jsx(qe,{className:"rounded-sm text-[10px]",variant:"outline",children:d.toUpperCase()}),c.jsx("span",{className:"text-xs",children:vQ(l.size)})]})]}),c.jsxs(fQ,{className:"justify-end gap-1 px-3 py-0 opacity-0 transition-opacity group-hover:opacity-100",children:[c.jsx(fa,{className:"h-7 px-2",label:"Copy",size:"sm",value:l.url,variant:"ghost"}),c.jsxs(Ce,{className:"h-7 px-2",onClick:m=>o(m,l.url),size:"sm",variant:"ghost",children:[c.jsx(Gu,{className:"mr-1 h-3 w-3"}),"Open"]})]})]})]},l.key)})})}var Bb,lv="HoverCard",[m3]=jn(lv,[io]),cv=io(),[bQ,uv]=m3(lv),p3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:o,openDelay:l=700,closeDelay:u=300}=e,d=cv(t),h=w.useRef(0),v=w.useRef(0),m=w.useRef(!1),g=w.useRef(!1),[b,O]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:lv}),S=w.useCallback(()=>{clearTimeout(v.current),h.current=window.setTimeout(()=>O(!0),l)},[l,O]),x=w.useCallback(()=>{clearTimeout(h.current),!m.current&&!g.current&&(v.current=window.setTimeout(()=>O(!1),u))},[u,O]),E=w.useCallback(()=>O(!1),[O]);return w.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(v.current)},[]),c.jsx(bQ,{scope:t,open:b,onOpenChange:O,onOpen:S,onClose:x,onDismiss:E,hasSelectionRef:m,isPointerDownOnContentRef:g,children:c.jsx(Up,{...d,children:n})})};p3.displayName=lv;var v3="HoverCardTrigger",g3=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=uv(v3,n),o=cv(n);return c.jsx(Hp,{asChild:!0,...o,children:c.jsx(Ne.a,{"data-state":i.open?"open":"closed",...r,ref:t,onPointerEnter:ye(e.onPointerEnter,ym(i.onOpen)),onPointerLeave:ye(e.onPointerLeave,ym(i.onClose)),onFocus:ye(e.onFocus,i.onOpen),onBlur:ye(e.onBlur,i.onClose),onTouchStart:ye(e.onTouchStart,l=>l.preventDefault())})})});g3.displayName=v3;var kO="HoverCardPortal",[xQ,wQ]=m3(kO,{forceMount:void 0}),y3=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,o=uv(kO,t);return c.jsx(xQ,{scope:t,forceMount:n,children:c.jsx(An,{present:n||o.open,children:c.jsx(dc,{asChild:!0,container:i,children:r})})})};y3.displayName=kO;var gm="HoverCardContent",b3=w.forwardRef((e,t)=>{const n=wQ(gm,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,o=uv(gm,e.__scopeHoverCard);return c.jsx(An,{present:r||o.open,children:c.jsx(SQ,{"data-state":o.open?"open":"closed",...i,onPointerEnter:ye(e.onPointerEnter,ym(o.onOpen)),onPointerLeave:ye(e.onPointerLeave,ym(o.onClose)),ref:t})})});b3.displayName=gm;var SQ=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:l,...u}=e,d=uv(gm,n),h=cv(n),v=w.useRef(null),m=Ue(t,v),[g,b]=w.useState(!1);return w.useEffect(()=>{if(g){const O=document.body;return Bb=O.style.userSelect||O.style.webkitUserSelect,O.style.userSelect="none",O.style.webkitUserSelect="none",()=>{O.style.userSelect=Bb,O.style.webkitUserSelect=Bb}}},[g]),w.useEffect(()=>{if(v.current){const O=()=>{b(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var x;((x=document.getSelection())==null?void 0:x.toString())!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",O),()=>{document.removeEventListener("pointerup",O),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),w.useEffect(()=>{v.current&&EQ(v.current).forEach(S=>S.setAttribute("tabindex","-1"))}),c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:ye(o,O=>{O.preventDefault()}),onDismiss:d.onDismiss,children:c.jsx(Fp,{...h,...u,onPointerDown:ye(u.onPointerDown,O=>{O.currentTarget.contains(O.target)&&b(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:m,style:{...u.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),jQ="HoverCardArrow",OQ=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,i=cv(n);return c.jsx(Gp,{...i,...r,ref:t})});OQ.displayName=jQ;function ym(e){return t=>t.pointerType==="touch"?void 0:e()}function EQ(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var _Q=p3,NQ=g3,AQ=y3,CQ=b3;function TQ({...e}){return c.jsx(_Q,{"data-slot":"hover-card",...e})}function MQ({...e}){return c.jsx(NQ,{"data-slot":"hover-card-trigger",...e})}function RQ({className:e,align:t="center",sideOffset:n=4,...r}){return c.jsx(AQ,{"data-slot":"hover-card-portal",children:c.jsx(CQ,{align:t,className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-[--radix-hover-card-content-transform-origin] rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"hover-card-content",sideOffset:n,...r})})}function fv({className:e,...t}){return c.jsx("div",{className:"relative w-full overflow-x-auto","data-slot":"table-container",children:c.jsx("table",{className:me("w-full caption-bottom text-sm",e),"data-slot":"table",...t})})}function dv({className:e,...t}){return c.jsx("thead",{className:me("[&_tr]:border-b",e),"data-slot":"table-header",...t})}function hv({className:e,...t}){return c.jsx("tbody",{className:me("[&_tr:last-child]:border-0",e),"data-slot":"table-body",...t})}function Fn({className:e,...t}){return c.jsx("tr",{className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),"data-slot":"table-row",...t})}function Pt({className:e,...t}){return c.jsx("th",{className:me("h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-head",...t})}function mt({className:e,...t}){return c.jsx("td",{className:me("whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),"data-slot":"table-cell",...t})}function DQ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/(1024*1024)).toFixed(2)} MB`}function x3(e){var t;return((t=e.split(".").pop())==null?void 0:t.toLowerCase())||""}function PQ(e,t){if(e!=null&&e.startsWith("image/"))return!0;const n=t?x3(t):"";return["jpg","jpeg","png","gif","webp","avif","svg","bmp","ico"].includes(n)}function kQ({files:e,selectedFiles:t,onSelectFile:n,onSelectAll:r,onToggleStar:i,onFileClick:o}){const l=(u,d)=>{u.stopPropagation(),window.open(d,"_blank")};return c.jsx("div",{className:"overflow-hidden rounded-lg border border-border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{className:"bg-muted/50",children:[c.jsx(Pt,{className:"w-12",children:c.jsx(dS,{checked:t.length===e.length&&e.length>0,onCheckedChange:r})}),c.jsx(Pt,{className:"w-12"}),c.jsx(Pt,{children:"Name"}),c.jsx(Pt,{children:"Format"}),c.jsx(Pt,{children:"Size"}),c.jsx(Pt,{children:"Modified"}),c.jsx(Pt,{className:"w-24",children:"Actions"})]})}),c.jsx(hv,{children:e.map(u=>{const d=u.key.split("/").pop()||u.key,h=x3(d),v=PQ(u.contentType,d);return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>o(u),children:[c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsx(dS,{checked:t.includes(u.key),onCheckedChange:()=>n(u.key)})}),c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsx(iv,{className:"h-8 w-8",onToggle:()=>i(u.key,!u.starred),starred:u.starred})}),c.jsx(mt,{children:c.jsxs("div",{className:"flex items-center gap-3",children:[v&&u.url.startsWith("https://")?c.jsxs(TQ,{closeDelay:200,openDelay:100,children:[c.jsx(MQ,{asChild:!0,children:c.jsx("div",{className:"h-10 w-14 shrink-0 cursor-pointer overflow-hidden rounded border bg-muted",children:c.jsx("img",{alt:d,className:"h-full w-full object-cover",src:u.url})})}),c.jsxs(RQ,{align:"start",className:"w-auto p-3",side:"right",children:[c.jsx("img",{alt:d,className:"max-h-[min(400px,40vh)] max-w-[min(400px,25vw)] rounded object-contain",src:u.url}),c.jsx("p",{className:"mt-2 max-w-[min(400px,25vw)] truncate text-center text-muted-foreground text-sm",children:d})]})]}):c.jsx("div",{className:"flex h-10 w-14 shrink-0 items-center justify-center overflow-hidden rounded border bg-muted",children:v?c.jsx(Xj,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Qj,{className:"h-4 w-4 text-muted-foreground"})}),c.jsx("span",{className:"truncate font-medium",children:d})]})}),c.jsx(mt,{children:c.jsx(qe,{variant:"secondary",children:h.toUpperCase()})}),c.jsx(mt,{className:"text-muted-foreground",children:DQ(u.size)}),c.jsx(mt,{className:"text-muted-foreground text-xs",children:rQ(new Date(u.lastModified),{addSuffix:!0})}),c.jsx(mt,{onClick:m=>m.stopPropagation(),children:c.jsxs("div",{className:"flex gap-1",children:[c.jsx(fa,{className:"h-8 w-8",size:"icon",value:u.url,variant:"ghost"}),c.jsx(Ce,{className:"h-8 w-8",onClick:m=>l(m,u.url),size:"icon",variant:"ghost",children:c.jsx(Gu,{className:"h-3.5 w-3.5"})})]})})]},u.key)})})]})})}var mv="Collapsible",[$Q]=jn(mv),[IQ,$O]=$Q(mv),w3=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:l,...u}=e,[d,h]=Nn({prop:r,defaultProp:i??!1,onChange:l,caller:mv});return c.jsx(IQ,{scope:n,disabled:o,contentId:Cr(),open:d,onOpenToggle:w.useCallback(()=>h(v=>!v),[h]),children:c.jsx(Ne.div,{"data-state":LO(d),"data-disabled":o?"":void 0,...u,ref:t})})});w3.displayName=mv;var S3="CollapsibleTrigger",j3=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=$O(S3,n);return c.jsx(Ne.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":LO(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:ye(e.onClick,i.onOpenToggle)})});j3.displayName=S3;var IO="CollapsibleContent",O3=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=$O(IO,e.__scopeCollapsible);return c.jsx(An,{present:n||i.open,children:({present:o})=>c.jsx(LQ,{...r,ref:t,present:o})})});O3.displayName=IO;var LQ=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,l=$O(IO,n),[u,d]=w.useState(r),h=w.useRef(null),v=Ue(t,h),m=w.useRef(0),g=m.current,b=w.useRef(0),O=b.current,S=l.open||u,x=w.useRef(S),E=w.useRef(void 0);return w.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Wt(()=>{const N=h.current;if(N){E.current=E.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const _=N.getBoundingClientRect();m.current=_.height,b.current=_.width,x.current||(N.style.transitionDuration=E.current.transitionDuration,N.style.animationName=E.current.animationName),d(r)}},[l.open,r]),c.jsx(Ne.div,{"data-state":LO(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!S,...o,ref:v,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":O?`${O}px`:void 0,...e.style},children:S&&i})});function LO(e){return e?"open":"closed"}var zQ=w3;const fs=zQ,ds=j3,hs=O3;var BQ="Label",E3=w.forwardRef((e,t)=>c.jsx(ls.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));E3.displayName=BQ;var qQ=E3;function qo({className:e,...t}){return c.jsx(qQ,{className:me("flex select-none items-center gap-2 font-medium text-sm leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50 group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50",e),"data-slot":"label",...t})}var zO="Progress",BO=100,[UQ]=x$(zO),[HQ,FQ]=UQ(zO),_3=w.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:i,getValueLabel:o=GQ,...l}=e;(i||i===0)&&!eT(i)&&console.error(VQ(`${i}`,"Progress"));const u=eT(i)?i:BO;r!==null&&!tT(r,u)&&console.error(YQ(`${r}`,"Progress"));const d=tT(r,u)?r:null,h=bm(d)?o(d,u):void 0;return c.jsx(HQ,{scope:n,value:d,max:u,children:c.jsx(ls.div,{"aria-valuemax":u,"aria-valuemin":0,"aria-valuenow":bm(d)?d:void 0,"aria-valuetext":h,role:"progressbar","data-state":C3(d,u),"data-value":d??void 0,"data-max":u,...l,ref:t})})});_3.displayName=zO;var N3="ProgressIndicator",A3=w.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,i=FQ(N3,n);return c.jsx(ls.div,{"data-state":C3(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});A3.displayName=N3;function GQ(e,t){return`${Math.round(e/t*100)}%`}function C3(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function bm(e){return typeof e=="number"}function eT(e){return bm(e)&&!isNaN(e)&&e>0}function tT(e,t){return bm(e)&&!isNaN(e)&&e<=t&&e>=0}function VQ(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${BO}\`.`}function YQ(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
418
418
|
- a positive number
|
|
419
419
|
- less than the value passed to \`max\` (or ${BO} if no \`max\` prop is set)
|
|
420
420
|
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
421
421
|
|
|
422
|
-
Defaulting to \`null\`.`}var WQ=_3,KQ=A3;function pv({className:e,value:t,...n}){return c.jsx(WQ,{className:me("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),"data-slot":"progress",...n,children:c.jsx(KQ,{className:"h-full w-full flex-1 bg-primary transition-all","data-slot":"progress-indicator",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function xm(e,[t,n]){return Math.min(n,Math.max(t,e))}var XQ=[" ","Enter","ArrowUp","ArrowDown"],QQ=[" ","Enter"],es="Select",[vv,gv,ZQ]=kp(es),[vc]=jn(es,[ZQ,io]),yv=io(),[JQ,so]=vc(es),[eZ,tZ]=vc(es),T3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:h,name:v,autoComplete:m,disabled:g,required:b,form:O}=e,S=yv(t),[x,E]=w.useState(null),[N,_]=w.useState(null),[C,A]=w.useState(!1),M=lc(h),[R,D]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:es}),[z,G]=Nn({prop:l,defaultProp:u,onChange:d,caller:es}),L=w.useRef(null),F=x?O||!!x.closest("form"):!0,[W,Q]=w.useState(new Set),X=Array.from(W).map(k=>k.props.value).join(";");return c.jsx(Up,{...S,children:c.jsxs(JQ,{required:b,scope:t,trigger:x,onTriggerChange:E,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:Cr(),value:z,onValueChange:G,open:R,onOpenChange:D,dir:M,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(vv.Provider,{scope:t,children:c.jsx(eZ,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(k=>{Q(H=>new Set(H).add(k))},[]),onNativeOptionRemove:w.useCallback(k=>{Q(H=>{const B=new Set(H);return B.delete(k),B})},[]),children:n})}),F?c.jsxs(Z3,{"aria-hidden":!0,required:b,tabIndex:-1,name:v,autoComplete:m,value:z,onChange:k=>G(k.target.value),disabled:g,form:O,children:[z===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},X):null]})})};T3.displayName=es;var M3="SelectTrigger",R3=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=yv(n),l=so(M3,n),u=l.disabled||r,d=Ue(t,l.onTriggerChange),h=gv(n),v=w.useRef("touch"),[m,g,b]=eL(S=>{const x=h().filter(_=>!_.disabled),E=x.find(_=>_.value===l.value),N=tL(x,S,E);N!==void 0&&l.onValueChange(N.value)}),O=S=>{u||(l.onOpenChange(!0),b()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return c.jsx(Hp,{asChild:!0,...o,children:c.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":J3(l.value)?"":void 0,...i,ref:d,onClick:ye(i.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&O(S)}),onPointerDown:ye(i.onPointerDown,S=>{v.current=S.pointerType;const x=S.target;x.hasPointerCapture(S.pointerId)&&x.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(O(S),S.preventDefault())}),onKeyDown:ye(i.onKeyDown,S=>{const x=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&g(S.key),!(x&&S.key===" ")&&XQ.includes(S.key)&&(O(),S.preventDefault())})})})});R3.displayName=M3;var D3="SelectValue",P3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...u}=e,d=so(D3,n),{onValueNodeHasChildrenChange:h}=d,v=o!==void 0,m=Ue(t,d.onValueNodeChange);return Wt(()=>{h(v)},[h,v]),c.jsx(Ne.span,{...u,ref:m,style:{pointerEvents:"none"},children:J3(d.value)?c.jsx(c.Fragment,{children:l}):o})});P3.displayName=D3;var nZ="SelectIcon",k3=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});k3.displayName=nZ;var rZ="SelectPortal",$3=e=>c.jsx(dc,{asChild:!0,...e});$3.displayName=rZ;var ts="SelectContent",I3=w.forwardRef((e,t)=>{const n=so(ts,e.__scopeSelect),[r,i]=w.useState();if(Wt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Lf.createPortal(c.jsx(L3,{scope:e.__scopeSelect,children:c.jsx(vv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(z3,{...e,ref:t})});I3.displayName=ts;var Ur=10,[L3,lo]=vc(ts),aZ="SelectContentImpl",iZ=Tl("SelectContent.RemoveScroll"),z3=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:O,hideWhenDetached:S,avoidCollisions:x,...E}=e,N=so(ts,n),[_,C]=w.useState(null),[A,M]=w.useState(null),R=Ue(t,ie=>C(ie)),[D,z]=w.useState(null),[G,L]=w.useState(null),F=gv(n),[W,Q]=w.useState(!1),X=w.useRef(!1);w.useEffect(()=>{if(_)return dO(_)},[_]),tO();const k=w.useCallback(ie=>{const[pe,...re]=F().map(oe=>oe.ref.current),[ve]=re.slice(-1),ge=document.activeElement;for(const oe of ie)if(oe===ge||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===pe&&A&&(A.scrollTop=0),oe===ve&&A&&(A.scrollTop=A.scrollHeight),oe==null||oe.focus(),document.activeElement!==ge))return},[F,A]),H=w.useCallback(()=>k([D,_]),[k,D,_]);w.useEffect(()=>{W&&H()},[W,H]);const{onOpenChange:B,triggerPointerDownPosRef:Z}=N;w.useEffect(()=>{if(_){let ie={x:0,y:0};const pe=ve=>{var ge,oe;ie={x:Math.abs(Math.round(ve.pageX)-(((ge=Z.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((oe=Z.current)==null?void 0:oe.y)??0))}},re=ve=>{ie.x<=10&&ie.y<=10?ve.preventDefault():_.contains(ve.target)||B(!1),document.removeEventListener("pointermove",pe),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",re,{capture:!0})}}},[_,B,Z]),w.useEffect(()=>{const ie=()=>B(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[B]);const[le,$]=eL(ie=>{const pe=F().filter(ge=>!ge.disabled),re=pe.find(ge=>ge.ref.current===document.activeElement),ve=tL(pe,ie,re);ve&&setTimeout(()=>ve.ref.current.focus())}),Y=w.useCallback((ie,pe,re)=>{const ve=!X.current&&!re;(N.value!==void 0&&N.value===pe||ve)&&(z(ie),ve&&(X.current=!0))},[N.value]),q=w.useCallback(()=>_==null?void 0:_.focus(),[_]),U=w.useCallback((ie,pe,re)=>{const ve=!X.current&&!re;(N.value!==void 0&&N.value===pe||ve)&&L(ie)},[N.value]),ne=r==="popper"?hS:B3,fe=ne===hS?{side:u,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:O,hideWhenDetached:S,avoidCollisions:x}:{};return c.jsx(L3,{scope:n,content:_,viewport:A,onViewportChange:M,itemRefCallback:Y,selectedItem:D,onItemLeave:q,itemTextRefCallback:U,focusSelectedItem:H,selectedItemText:G,position:r,isPositioned:W,searchRef:le,children:c.jsx(Yp,{as:iZ,allowPinchZoom:!0,children:c.jsx($p,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ye(i,ie=>{var pe;(pe=N.trigger)==null||pe.focus({preventScroll:!0}),ie.preventDefault()}),children:c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:c.jsx(ne,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...E,...fe,onPlaced:()=>Q(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ye(E.onKeyDown,ie=>{const pe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!pe&&ie.key.length===1&&$(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ve=F().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ge=ie.target,oe=ve.indexOf(ge);ve=ve.slice(oe+1)}setTimeout(()=>k(ve)),ie.preventDefault()}})})})})})})});z3.displayName=aZ;var oZ="SelectItemAlignedPosition",B3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=so(ts,n),l=lo(ts,n),[u,d]=w.useState(null),[h,v]=w.useState(null),m=Ue(t,R=>v(R)),g=gv(n),b=w.useRef(!1),O=w.useRef(!0),{viewport:S,selectedItem:x,selectedItemText:E,focusSelectedItem:N}=l,_=w.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&h&&S&&x&&E){const R=o.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),G=E.getBoundingClientRect();if(o.dir!=="rtl"){const ge=G.left-D.left,oe=z.left-ge,ke=R.left-oe,we=R.width+ke,ze=Math.max(we,D.width),Ze=window.innerWidth-Ur,lt=xm(oe,[Ur,Math.max(Ur,Ze-ze)]);u.style.minWidth=we+"px",u.style.left=lt+"px"}else{const ge=D.right-G.right,oe=window.innerWidth-z.right-ge,ke=window.innerWidth-R.right-oe,we=R.width+ke,ze=Math.max(we,D.width),Ze=window.innerWidth-Ur,lt=xm(oe,[Ur,Math.max(Ur,Ze-ze)]);u.style.minWidth=we+"px",u.style.right=lt+"px"}const L=g(),F=window.innerHeight-Ur*2,W=S.scrollHeight,Q=window.getComputedStyle(h),X=parseInt(Q.borderTopWidth,10),k=parseInt(Q.paddingTop,10),H=parseInt(Q.borderBottomWidth,10),B=parseInt(Q.paddingBottom,10),Z=X+k+W+B+H,le=Math.min(x.offsetHeight*5,Z),$=window.getComputedStyle(S),Y=parseInt($.paddingTop,10),q=parseInt($.paddingBottom,10),U=R.top+R.height/2-Ur,ne=F-U,fe=x.offsetHeight/2,ie=x.offsetTop+fe,pe=X+k+ie,re=Z-pe;if(pe<=U){const ge=L.length>0&&x===L[L.length-1].ref.current;u.style.bottom="0px";const oe=h.clientHeight-S.offsetTop-S.offsetHeight,ke=Math.max(ne,fe+(ge?q:0)+oe+H),we=pe+ke;u.style.height=we+"px"}else{const ge=L.length>0&&x===L[0].ref.current;u.style.top="0px";const ke=Math.max(U,X+S.offsetTop+(ge?Y:0)+fe)+re;u.style.height=ke+"px",S.scrollTop=pe-U+S.offsetTop}u.style.margin=`${Ur}px 0`,u.style.minHeight=le+"px",u.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[g,o.trigger,o.valueNode,u,h,S,x,E,o.dir,r]);Wt(()=>_(),[_]);const[C,A]=w.useState();Wt(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&O.current===!0&&(_(),N==null||N(),O.current=!1)},[_,N]);return c.jsx(lZ,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ne.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});B3.displayName=oZ;var sZ="SelectPopperPosition",hS=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ur,...o}=e,l=yv(n);return c.jsx(Fp,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});hS.displayName=sZ;var[lZ,qO]=vc(ts,{}),mS="SelectViewport",q3=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=lo(mS,n),l=qO(mS,n),u=Ue(t,o.onViewportChange),d=w.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(vv.Slot,{scope:n,children:c.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ye(i.onScroll,h=>{const v=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&m){const b=Math.abs(d.current-v.scrollTop);if(b>0){const O=window.innerHeight-Ur*2,S=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),E=Math.max(S,x);if(E<O){const N=E+b,_=Math.min(O,N),C=N-_;m.style.height=_+"px",m.style.bottom==="0px"&&(v.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});q3.displayName=mS;var U3="SelectGroup",[cZ,uZ]=vc(U3),fZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Cr();return c.jsx(cZ,{scope:n,id:i,children:c.jsx(Ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});fZ.displayName=U3;var H3="SelectLabel",dZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=uZ(H3,n);return c.jsx(Ne.div,{id:i.id,...r,ref:t})});dZ.displayName=H3;var wm="SelectItem",[hZ,F3]=vc(wm),G3=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,u=so(wm,n),d=lo(wm,n),h=u.value===r,[v,m]=w.useState(o??""),[g,b]=w.useState(!1),O=Ue(t,N=>{var _;return(_=d.itemRefCallback)==null?void 0:_.call(d,N,r,i)}),S=Cr(),x=w.useRef("touch"),E=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(hZ,{scope:n,value:r,disabled:i,textId:S,isSelected:h,onItemTextChange:w.useCallback(N=>{m(_=>_||((N==null?void 0:N.textContent)??"").trim())},[]),children:c.jsx(vv.ItemSlot,{scope:n,value:r,disabled:i,textValue:v,children:c.jsx(Ne.div,{role:"option","aria-labelledby":S,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:O,onFocus:ye(l.onFocus,()=>b(!0)),onBlur:ye(l.onBlur,()=>b(!1)),onClick:ye(l.onClick,()=>{x.current!=="mouse"&&E()}),onPointerUp:ye(l.onPointerUp,()=>{x.current==="mouse"&&E()}),onPointerDown:ye(l.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:ye(l.onPointerMove,N=>{var _;x.current=N.pointerType,i?(_=d.onItemLeave)==null||_.call(d):x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(l.onPointerLeave,N=>{var _;N.currentTarget===document.activeElement&&((_=d.onItemLeave)==null||_.call(d))}),onKeyDown:ye(l.onKeyDown,N=>{var C;((C=d.searchRef)==null?void 0:C.current)!==""&&N.key===" "||(QQ.includes(N.key)&&E(),N.key===" "&&N.preventDefault())})})})})});G3.displayName=wm;var Du="SelectItemText",V3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=so(Du,n),u=lo(Du,n),d=F3(Du,n),h=tZ(Du,n),[v,m]=w.useState(null),g=Ue(t,E=>m(E),d.onItemTextChange,E=>{var N;return(N=u.itemTextRefCallback)==null?void 0:N.call(u,E,d.value,d.disabled)}),b=v==null?void 0:v.textContent,O=w.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:x}=h;return Wt(()=>(S(O),()=>x(O)),[S,x,O]),c.jsxs(c.Fragment,{children:[c.jsx(Ne.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Lf.createPortal(o.children,l.valueNode):null]})});V3.displayName=Du;var Y3="SelectItemIndicator",W3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return F3(Y3,n).isSelected?c.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});W3.displayName=Y3;var pS="SelectScrollUpButton",K3=w.forwardRef((e,t)=>{const n=lo(pS,e.__scopeSelect),r=qO(pS,e.__scopeSelect),[i,o]=w.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollTop>0;o(h)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?c.jsx(Q3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});K3.displayName=pS;var vS="SelectScrollDownButton",X3=w.forwardRef((e,t)=>{const n=lo(vS,e.__scopeSelect),r=qO(vS,e.__scopeSelect),[i,o]=w.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<h;o(v)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?c.jsx(Q3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});X3.displayName=vS;var Q3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=lo("SelectScrollButton",n),l=w.useRef(null),u=gv(n),d=w.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return w.useEffect(()=>()=>d(),[d]),Wt(()=>{var v;const h=u().find(m=>m.ref.current===document.activeElement);(v=h==null?void 0:h.ref.current)==null||v.scrollIntoView({block:"nearest"})},[u]),c.jsx(Ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ye(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ye(i.onPointerMove,()=>{var h;(h=o.onItemLeave)==null||h.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ye(i.onPointerLeave,()=>{d()})})}),mZ="SelectSeparator",pZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});pZ.displayName=mZ;var gS="SelectArrow",vZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yv(n),o=so(gS,n),l=lo(gS,n);return o.open&&l.position==="popper"?c.jsx(Gp,{...i,...r,ref:t}):null});vZ.displayName=gS;var gZ="SelectBubbleInput",Z3=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=w.useRef(null),o=Ue(r,i),l=ov(t);return w.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("change",{bubbles:!0});v.call(u,t),u.dispatchEvent(m)}},[l,t]),c.jsx(Ne.select,{...n,style:{...CI,...n.style},ref:o,defaultValue:t})});Z3.displayName=gZ;function J3(e){return e===""||e===void 0}function eL(e){const t=Wr(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(l=>{const u=n.current+l;t(u),(function d(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function tL(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=yZ(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function yZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bZ=T3,xZ=R3,wZ=P3,SZ=k3,jZ=$3,OZ=I3,EZ=q3,_Z=G3,NZ=V3,AZ=W3,CZ=K3,TZ=X3;function ma({...e}){return c.jsx(bZ,{"data-slot":"select",...e})}function pa({...e}){return c.jsx(wZ,{"data-slot":"select-value",...e})}function va({className:e,size:t="default",children:n,...r}){return c.jsxs(xZ,{className:me("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-size":t,"data-slot":"select-trigger",...r,children:[n,c.jsx(SZ,{asChild:!0,children:c.jsx(ro,{className:"size-4 opacity-50"})})]})}function ga({className:e,children:t,position:n="popper",align:r="center",...i}){return c.jsx(jZ,{children:c.jsxs(OZ,{align:r,className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",n==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),"data-slot":"select-content",position:n,...i,children:[c.jsx(MZ,{}),c.jsx(EZ,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(RZ,{})]})})}function Fe({className:e,children:t,...n}){return c.jsxs(_Z,{className:me("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),"data-slot":"select-item",...n,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(AZ,{children:c.jsx(ri,{className:"size-4"})})}),c.jsx(NZ,{children:t})]})}function MZ({className:e,...t}){return c.jsx(CZ,{className:me("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...t,children:c.jsx(ic,{className:"size-4"})})}function RZ({className:e,...t}){return c.jsx(TZ,{className:me("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...t,children:c.jsx(ro,{className:"size-4"})})}var nL=["PageUp","PageDown"],rL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],aL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},gc="Slider",[yS,DZ,PZ]=kp(gc),[iL]=jn(gc,[PZ]),[kZ,bv]=iL(gc),oL=w.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:v,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:b=!1,form:O,...S}=e,x=w.useRef(new Set),E=w.useRef(0),_=l==="horizontal"?$Z:IZ,[C=[],A]=Nn({prop:v,defaultProp:h,onChange:L=>{var W;(W=[...x.current][E.current])==null||W.focus(),m(L)}}),M=w.useRef(C);function R(L){const F=UZ(C,L);G(L,F)}function D(L){G(L,E.current)}function z(){const L=M.current[E.current];C[E.current]!==L&&g(C)}function G(L,F,{commit:W}={commit:!1}){const Q=VZ(o),X=YZ(Math.round((L-r)/o)*o+r,Q),k=xm(X,[r,i]);A((H=[])=>{const B=BZ(H,k,F);if(GZ(B,d*o)){E.current=B.indexOf(k);const Z=String(B)!==String(H);return Z&&W&&g(B),Z?B:H}else return H})}return c.jsx(kZ,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:i,valueIndexToChangeRef:E,thumbs:x.current,values:C,orientation:l,form:O,children:c.jsx(yS.Provider,{scope:e.__scopeSlider,children:c.jsx(yS.Slot,{scope:e.__scopeSlider,children:c.jsx(_,{"aria-disabled":u,"data-disabled":u?"":void 0,...S,ref:t,onPointerDown:ye(S.onPointerDown,()=>{u||(M.current=C)}),min:r,max:i,inverted:b,onSlideStart:u?void 0:R,onSlideMove:u?void 0:D,onSlideEnd:u?void 0:z,onHomeKeyDown:()=>!u&&G(r,0,{commit:!0}),onEndKeyDown:()=>!u&&G(i,C.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:F})=>{if(!u){const X=nL.includes(L.key)||L.shiftKey&&rL.includes(L.key)?10:1,k=E.current,H=C[k],B=o*X*F;G(H+B,k,{commit:!0})}}})})})})});oL.displayName=gc;var[sL,lL]=iL(gc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$Z=w.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:h,...v}=e,[m,g]=w.useState(null),b=Ue(t,_=>g(_)),O=w.useRef(void 0),S=lc(i),x=S==="ltr",E=x&&!o||!x&&o;function N(_){const C=O.current||m.getBoundingClientRect(),A=[0,C.width],R=UO(A,E?[n,r]:[r,n]);return O.current=C,R(_-C.left)}return c.jsx(sL,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:c.jsx(cL,{dir:S,"data-orientation":"horizontal",...v,ref:b,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const C=N(_.clientX);l==null||l(C)},onSlideMove:_=>{const C=N(_.clientX);u==null||u(C)},onSlideEnd:()=>{O.current=void 0,d==null||d()},onStepKeyDown:_=>{const A=aL[E?"from-left":"from-right"].includes(_.key);h==null||h({event:_,direction:A?-1:1})}})})}),IZ=w.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...h}=e,v=w.useRef(null),m=Ue(t,v),g=w.useRef(void 0),b=!i;function O(S){const x=g.current||v.current.getBoundingClientRect(),E=[0,x.height],_=UO(E,b?[r,n]:[n,r]);return g.current=x,_(S-x.top)}return c.jsx(sL,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:c.jsx(cL,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const x=O(S.clientY);o==null||o(x)},onSlideMove:S=>{const x=O(S.clientY);l==null||l(x)},onSlideEnd:()=>{g.current=void 0,u==null||u()},onStepKeyDown:S=>{const E=aL[b?"from-bottom":"from-top"].includes(S.key);d==null||d({event:S,direction:E?-1:1})}})})}),cL=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...h}=e,v=bv(gc,n);return c.jsx(Ne.span,{...h,ref:t,onKeyDown:ye(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):nL.concat(rL).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:ye(e.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),v.thumbs.has(g)?g.focus():r(m)}),onPointerMove:ye(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:ye(e.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),o(m))})})}),uL="SliderTrack",fL=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=bv(uL,n);return c.jsx(Ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});fL.displayName=uL;var bS="SliderRange",dL=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=bv(bS,n),o=lL(bS,n),l=w.useRef(null),u=Ue(t,l),d=i.values.length,h=i.values.map(g=>pL(g,i.min,i.max)),v=d>1?Math.min(...h):0,m=100-Math.max(...h);return c.jsx(Ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:u,style:{...e.style,[o.startEdge]:v+"%",[o.endEdge]:m+"%"}})});dL.displayName=bS;var xS="SliderThumb",hL=w.forwardRef((e,t)=>{const n=DZ(e.__scopeSlider),[r,i]=w.useState(null),o=Ue(t,u=>i(u)),l=w.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return c.jsx(LZ,{...e,ref:o,index:l})}),LZ=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=bv(xS,n),u=lL(xS,n),[d,h]=w.useState(null),v=Ue(t,N=>h(N)),m=d?l.form||!!d.closest("form"):!0,g=qp(d),b=l.values[r],O=b===void 0?0:pL(b,l.min,l.max),S=qZ(r,l.values.length),x=g==null?void 0:g[u.size],E=x?HZ(x,O,u.direction):0;return w.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${O}% + ${E}px)`},children:[c.jsx(yS.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(Ne.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":l.min,"aria-valuenow":b,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:v,style:b===void 0?{display:"none"}:e.style,onFocus:ye(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),m&&c.jsx(mL,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:b},r)]})});hL.displayName=xS;var zZ="RadioBubbleInput",mL=w.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=w.useRef(null),o=Ue(i,r),l=ov(t);return w.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("input",{bubbles:!0});v.call(u,t),u.dispatchEvent(m)}},[l,t]),c.jsx(Ne.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});mL.displayName=zZ;function BZ(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function pL(e,t,n){const o=100/(n-t)*(e-t);return xm(o,[0,100])}function qZ(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function UZ(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function HZ(e,t,n){const r=e/2,o=UO([0,50],[0,r]);return(r-o(t)*n)*n}function FZ(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function GZ(e,t){if(t>0){const n=FZ(e);return Math.min(...n)>=t}return!0}function UO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VZ(e){return(String(e).split(".")[1]||"").length}function YZ(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var WZ=oL,KZ=fL,XZ=dL,QZ=hL;function ZZ({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){const l=w.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return c.jsxs(WZ,{className:me("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),"data-slot":"slider",defaultValue:t,max:i,min:r,value:n,...o,children:[c.jsx(KZ,{className:me("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:c.jsx(XZ,{className:me("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:l.length},(u,d)=>c.jsx(QZ,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},`thumb-${l[d]}-${d}`))]})}var xv="Switch",[JZ]=jn(xv),[eJ,tJ]=JZ(xv),vL=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:h,form:v,...m}=e,[g,b]=w.useState(null),O=Ue(t,_=>b(_)),S=w.useRef(!1),x=g?v||!!g.closest("form"):!0,[E,N]=Nn({prop:i,defaultProp:o??!1,onChange:h,caller:xv});return c.jsxs(eJ,{scope:n,checked:E,disabled:u,children:[c.jsx(Ne.button,{type:"button",role:"switch","aria-checked":E,"aria-required":l,"data-state":xL(E),"data-disabled":u?"":void 0,disabled:u,value:d,...m,ref:O,onClick:ye(e.onClick,_=>{N(C=>!C),x&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),x&&c.jsx(bL,{control:g,bubbles:!S.current,name:r,value:d,checked:E,required:l,disabled:u,form:v,style:{transform:"translateX(-100%)"}})]})});vL.displayName=xv;var gL="SwitchThumb",yL=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=tJ(gL,n);return c.jsx(Ne.span,{"data-state":xL(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});yL.displayName=gL;var nJ="SwitchBubbleInput",bL=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=w.useRef(null),u=Ue(l,o),d=ov(n),h=qp(t);return w.useEffect(()=>{const v=l.current;if(!v)return;const m=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&b){const O=new Event("click",{bubbles:r});b.call(v,n),v.dispatchEvent(O)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:u,style:{...i.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bL.displayName=nJ;function xL(e){return e?"checked":"unchecked"}var rJ=vL,aJ=yL;function iJ({className:e,...t}){return c.jsx(rJ,{className:me("peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),"data-slot":"switch",...t,children:c.jsx(aJ,{className:me("pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"),"data-slot":"switch-thumb"})})}async function nT(e){try{const t=document.createElement("canvas");return t.width=1,t.height=1,t.toDataURL(e).startsWith(`data:${e}`)}catch{return!1}}async function oJ(){const[e,t]=await Promise.all([nT("image/webp"),nT("image/avif")]);return{webp:e,avif:t,offscreenCanvas:typeof OffscreenCanvas<"u",webWorker:typeof Worker<"u",wasm:typeof WebAssembly<"u"}}let Ch=null;async function sJ(){return Ch||(Ch=await oJ(),Ch)}async function lJ(e){if(e.type!=="image/gif")return{isAnimated:!1,frameCount:1,size:e.size};try{const t=await e.arrayBuffer(),n=new Uint8Array(t);let r=0;for(let i=0;i<n.length-2;i++)n[i]===33&&n[i+1]===249&&r++;return{isAnimated:r>1,frameCount:Math.max(1,r),size:e.size}}catch{return{isAnimated:!1,frameCount:1,size:e.size}}}function cJ(e){return e.type==="image/gif"}function uJ(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Failed to read blob")),r.readAsDataURL(e)})}function wL(e){return uJ(e)}function Th(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function fJ(e){return new Promise((t,n)=>{const r=new Image,i=URL.createObjectURL(e);r.onload=()=>{URL.revokeObjectURL(i),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to load image"))},r.src=i})}class dJ{constructor(){fb(this,"worker",null);fb(this,"pending",new Map)}getWorker(){return this.worker||(this.worker=new Worker(new URL("/assets/optimizer.worker-CeufIUo5.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=this.handleError.bind(this)),this.worker}handleMessage(t){const{id:n,result:r,error:i,progress:o}=t.data,l=this.pending.get(n);if(l){if(o!==void 0&&o<100&&l.onProgress){l.onProgress(o);return}if(i){l.reject(new Error(i)),this.pending.delete(n);return}r&&(l.resolve(r),this.pending.delete(n))}}handleError(t){console.error("Image optimizer worker error:",t);for(const[n,r]of this.pending)r.reject(new Error(`Worker error: ${t.message}`)),this.pending.delete(n);this.terminate()}generateId(){return crypto.randomUUID()}async optimize(t,n,r){const i=this.generateId();return new Promise((o,l)=>{this.pending.set(i,{resolve:o,reject:l,onProgress:r}),this.getWorker().postMessage({id:i,type:"optimize",file:t,options:n})})}async preview(t,n,r){const i=await wL(t);return{...await this.optimize(t,n,r),originalDataUrl:i}}cancelAll(){for(const[t,n]of this.pending)n.reject(new Error("Operation cancelled")),this.pending.delete(t)}terminate(){this.cancelAll(),this.worker&&(this.worker.terminate(),this.worker=null)}get isActive(){return this.worker!==null}get pendingCount(){return this.pending.size}}const hJ=new dJ;async function mJ(e,t,n){return hJ.preview(e,t,n)}const pJ=[{value:"webp",label:"WebP",description:"Best balance of size and quality"},{value:"avif",label:"AVIF",description:"Best compression"},{value:"jpeg",label:"JPEG",description:"Universal compatibility"},{value:"png",label:"PNG",description:"Lossless, supports transparency"},{value:"original",label:"Original",description:"Keep original format"}],vJ=[{value:1,label:"1x",description:"Standard displays"},{value:2,label:"2x",description:"Retina / HiDPI (recommended)"},{value:3,label:"3x",description:"iPhone Pro / flagship phones"}];function wS(e){const t=e/1024,n=t/1024;return n>2?{level:"error",message:"This image will cause delivery issues (>2MB)",suggestion:"Reduce dimensions or increase compression to under 1MB"}:n>1?{level:"warning",message:"Most email clients struggle with images >1MB",suggestion:"Consider reducing to under 500KB for best deliverability"}:t>500?{level:"info",message:"Larger than recommended for email (>500KB)",suggestion:"This may slow load times on mobile devices"}:null}function qb(e){const t=wS(e);if(!t)return{label:"Good",color:"text-green-600"};switch(t.level){case"info":return{label:"OK",color:"text-yellow-600"};case"warning":return{label:"Large",color:"text-orange-600"};case"error":return{label:"Too Large",color:"text-red-600"};default:return{label:"Unknown",color:"text-muted-foreground"}}}const gJ=[{value:"none",label:"Original size",description:"Keep original dimensions"},{value:"600",label:"Email (600px)",description:"Standard email width"},{value:"800",label:"Medium (800px)",description:"Blog posts, cards"},{value:"1200",label:"Large (1200px)",description:"Full-width content"},{value:"1440",label:"Hero (1440px)",description:"Banner images"},{value:"1920",label:"Full HD (1920px)",description:"Desktop screens"}];function yJ({files:e,onComplete:t,onClose:n,open:r}){var q;const[i,o]=w.useState([]),[l,u]=w.useState(null),[d,h]=w.useState(!1),v=i.reduce((U,ne)=>U+ne.file.size,0),m=i.reduce((U,ne)=>{var fe;return U+(((fe=ne.preview)==null?void 0:fe.optimizedSize)??ne.file.size)},0),g=v>0?Math.round((1-m/v)*100):0,b=i.length>0&&i.every(U=>U.status==="ready"||U.status==="done"||U.isAnimatedGif),O=i.some(U=>U.status==="pending"&&!U.isAnimatedGif),S=i.some(U=>U.status==="processing"),[x,E]=w.useState(!0),[N,_]=w.useState(!1),[C,A]=w.useState({format:"webp",quality:85}),[M,R]=w.useState(85),[D,z]=w.useState("none"),[G,L]=w.useState(2),[F,W]=w.useState(!0);w.useEffect(()=>{sJ().then(U=>{W(U.wasm&&U.webWorker&&U.offscreenCanvas)})},[]),w.useEffect(()=>{var ne;if(!r||e.length===0)return;const U=e.map((fe,ie)=>({id:`${fe.name}-${ie}-${Date.now()}`,file:fe,status:"pending"}));o(U),u(((ne=U[0])==null?void 0:ne.id)??null),_(!1),h(!1);for(const fe of U)wL(fe.file).then(ie=>{o(pe=>pe.map(re=>re.id===fe.id?{...re,thumbnailUrl:ie}:re))}),cJ(fe.file)&&lJ(fe.file).then(ie=>{ie.isAnimated&&o(pe=>pe.map(re=>re.id===fe.id?{...re,isAnimatedGif:!0,status:"ready"}:re))})},[r,e]);const Q=w.useCallback(async()=>{const U=i.filter(ne=>ne.status==="pending"&&!ne.isAnimatedGif);if(U.length===0){h(!1);return}for(const ne of U){o(fe=>fe.map(ie=>ie.id===ne.id?{...ie,status:"processing"}:ie));try{let fe;if(D==="none"){if(G>1){const re=await fJ(ne.file);fe=Math.round(re.width/G)}}else fe=Number(D)*G;const ie={...C,maxWidth:fe},pe=await mJ(ne.file,ie);o(re=>re.map(ve=>ve.id===ne.id?{...ve,status:"ready",preview:pe}:ve))}catch{o(fe=>fe.map(ie=>ie.id===ne.id?{...ie,status:"ready"}:ie))}}h(!1)},[i,C,D,G]),X=`${C.format}-${C.quality}-${D}-${G}`,k=w.useRef(X);w.useEffect(()=>{k.current!==X&&(k.current=X,o(U=>U.map(ne=>ne.isAnimatedGif?ne:{...ne,status:"pending",preview:void 0})),h(!1))},[X]);const H=U=>{const ne=U.name.replace(/\.[^/.]+$/,""),fe=C.format==="original"?U.name.split(".").pop():C.format;return`${ne}.${fe}`},B=()=>{h(!0),Q()},Z=()=>{const U=i.map(ne=>!x||ne.isAnimatedGif||!ne.preview?{file:ne.file,cdnFilename:ne.file.name}:{file:ne.preview.blob,cdnFilename:H(ne.file)});t(U),n()},le=()=>{const U=i.map(ne=>({file:ne.file,cdnFilename:ne.file.name}));t(U),n()};if(!r)return null;const $=i.length===1,Y=$?i[0]:null;return c.jsx(RO,{onOpenChange:U=>!U&&n(),open:r,children:c.jsxs(DO,{className:"max-w-lg",children:[c.jsx(t3,{children:c.jsx(r3,{className:"flex items-center gap-2",children:$?c.jsxs(c.Fragment,{children:[c.jsx(Sb,{className:"h-5 w-5 text-muted-foreground"}),c.jsx("span",{className:"truncate",children:Y==null?void 0:Y.file.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(Sb,{className:"h-5 w-5 text-muted-foreground"}),i.length," images selected"]})})}),c.jsxs("div",{className:"space-y-4",children:[!$&&c.jsxs("div",{className:"grid grid-cols-6 gap-2",children:[i.slice(0,11).map(U=>c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsxs("div",{className:`relative aspect-square overflow-hidden rounded-md border bg-muted ${U.id===l?"ring-2 ring-primary":""}`,children:[U.thumbnailUrl?c.jsx("img",{alt:U.file.name,className:"h-full w-full object-cover",src:U.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Sb,{className:"h-4 w-4 text-muted-foreground"})}),U.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(Va,{className:"h-3 w-3 animate-spin"})}),U.status==="ready"&&U.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/20",children:c.jsx(ri,{className:"h-4 w-4 text-green-600"})}),U.isAnimatedGif&&c.jsx(qe,{className:"absolute right-0.5 bottom-0.5 h-4 px-1 text-[10px]",children:"GIF"})]})}),c.jsxs(rv,{side:"bottom",children:[c.jsx("p",{className:"font-medium text-xs",children:U.file.name}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:[Th(U.file.size),U.preview&&` → ${Th(U.preview.optimizedSize)}`]})]})]},U.id)),i.length>11&&c.jsxs("div",{className:"flex aspect-square items-center justify-center rounded-md border bg-muted text-muted-foreground text-xs",children:["+",i.length-11]})]}),$&&Y&&c.jsxs("div",{className:"relative aspect-video overflow-hidden rounded-lg border bg-muted",children:[Y.thumbnailUrl?c.jsx("img",{alt:Y.file.name,className:"h-full w-full object-contain",src:Y.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Va,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),Y.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(Va,{className:"h-6 w-6 animate-spin"})}),Y.status==="ready"&&Y.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/10",children:c.jsx(ri,{className:"h-8 w-8 text-green-600"})})]}),c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-muted-foreground text-sm",children:[c.jsx("span",{className:qb(v).color,children:Th(v)}),x&&b&&g>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2",children:"→"}),c.jsx("span",{className:`font-medium ${qb(m).color}`,children:Th(m)})]})]}),S&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Optimizing..."}),!S&&wS(b?m:v)&&c.jsx("p",{className:`text-xs ${qb(b?m:v).color}`,children:(q=wS(b?m:v))==null?void 0:q.suggestion})]}),x&&b&&g>0&&c.jsxs(qe,{className:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",variant:"secondary",children:[c.jsx(PF,{className:"mr-1 h-3 w-3"}),"Save ",g,"%"]})]}),S&&c.jsx(pv,{className:"mt-3 h-1",value:i.filter(U=>U.status==="ready"||U.isAnimatedGif).length/i.length*100})]}),F&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"cursor-pointer",htmlFor:"optimize-toggle",children:"Optimize before uploading"}),c.jsx(iJ,{checked:x,id:"optimize-toggle",onCheckedChange:E})]}),x&&F&&c.jsxs(fs,{onOpenChange:_,open:N,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-start text-muted-foreground",size:"sm",variant:"ghost",children:[N?c.jsx(ro,{className:"mr-2 h-4 w-4"}):c.jsx(SF,{className:"mr-2 h-4 w-4"}),"Options"]})}),c.jsxs(hs,{className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Format"}),c.jsxs(ma,{onValueChange:U=>A({...C,format:U}),value:C.format||"webp",children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:pJ.map(U=>c.jsx(Fe,{value:U.value,children:U.label},U.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Quality"}),c.jsxs("span",{className:"text-muted-foreground text-xs",children:[M,"%"]})]}),c.jsx(ZZ,{className:"mt-2",max:100,min:50,onValueChange:([U])=>R(U),onValueCommit:([U])=>A({...C,quality:U}),step:5,value:[M]})]})]}),c.jsxs("div",{className:"space-y-3 rounded-lg border bg-muted/20 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"font-medium text-xs",children:"Resize Image"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"Maintains aspect ratio"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Max Width"}),c.jsxs(ma,{onValueChange:z,value:D,children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:gJ.map(U=>c.jsx(Fe,{value:U.value,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:U.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:U.description})]})},U.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Pixel Density"}),c.jsxs(ma,{onValueChange:U=>L(Number(U)),value:String(G),children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:vJ.map(U=>c.jsx(Fe,{value:String(U.value),children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:U.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:U.description})]})},U.value))})]})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:D==="none"?G===1?"Original dimensions preserved":`Scales to 1/${G} original size`:`Output: ${Number(D)*G}px actual width`})]})]})]})]}),c.jsxs(n3,{className:"gap-2 sm:gap-0",children:[c.jsx(Ce,{onClick:n,variant:"ghost",children:"Cancel"}),x&&F?c.jsxs(c.Fragment,{children:[c.jsx(Ce,{onClick:le,variant:"outline",children:"Upload originals"}),b?c.jsxs(Ce,{onClick:Z,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload",g>0&&` (save ${g}%)`]}):c.jsxs(Ce,{disabled:d||!O,onClick:B,children:[d?c.jsx(Va,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(zF,{className:"mr-2 h-4 w-4"}),d?"Optimizing...":"Optimize"]})]}):c.jsxs(Ce,{onClick:le,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})})}const bJ=mc("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[1rem_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Un({className:e,variant:t,...n}){return c.jsx("div",{className:me(bJ({variant:t}),e),"data-slot":"alert",role:"alert",...n})}function to({className:e,...t}){return c.jsx("div",{className:me("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),"data-slot":"alert-title",...t})}function Hn({className:e,...t}){return c.jsx("div",{className:me("col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed",e),"data-slot":"alert-description",...t})}var SL="AlertDialog",[xJ]=jn(SL,[hI]),di=hI(),jL=e=>{const{__scopeAlertDialog:t,...n}=e,r=di(t);return c.jsx(OO,{...r,...n,modal:!0})};jL.displayName=SL;var wJ="AlertDialogTrigger",SJ=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(yW,{...i,...r,ref:t})});SJ.displayName=wJ;var jJ="AlertDialogPortal",OL=e=>{const{__scopeAlertDialog:t,...n}=e,r=di(t);return c.jsx(EO,{...r,...n})};OL.displayName=jJ;var OJ="AlertDialogOverlay",EL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(_O,{...i,...r,ref:t})});EL.displayName=OJ;var jl="AlertDialogContent",[EJ,_J]=xJ(jl),NJ=q$("AlertDialogContent"),_L=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=di(n),l=w.useRef(null),u=Ue(t,l),d=w.useRef(null);return c.jsx(mW,{contentName:jl,titleName:NL,docsSlug:"alert-dialog",children:c.jsx(EJ,{scope:n,cancelRef:d,children:c.jsxs(NO,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:ye(i.onOpenAutoFocus,h=>{var v;h.preventDefault(),(v=d.current)==null||v.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[c.jsx(NJ,{children:r}),c.jsx(CJ,{contentRef:l})]})})})});_L.displayName=jl;var NL="AlertDialogTitle",AL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(AO,{...i,...r,ref:t})});AL.displayName=NL;var CL="AlertDialogDescription",TL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(CO,{...i,...r,ref:t})});TL.displayName=CL;var AJ="AlertDialogAction",ML=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(Zp,{...i,...r,ref:t})});ML.displayName=AJ;var RL="AlertDialogCancel",DL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=_J(RL,n),o=di(n),l=Ue(t,i);return c.jsx(Zp,{...o,...r,ref:l})});DL.displayName=RL;var CJ=({contentRef:e})=>{const t=`\`${jl}\` requires a description for the component to be accessible for screen reader users.
|
|
422
|
+
Defaulting to \`null\`.`}var WQ=_3,KQ=A3;function pv({className:e,value:t,...n}){return c.jsx(WQ,{className:me("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),"data-slot":"progress",...n,children:c.jsx(KQ,{className:"h-full w-full flex-1 bg-primary transition-all","data-slot":"progress-indicator",style:{transform:`translateX(-${100-(t||0)}%)`}})})}function xm(e,[t,n]){return Math.min(n,Math.max(t,e))}var XQ=[" ","Enter","ArrowUp","ArrowDown"],QQ=[" ","Enter"],es="Select",[vv,gv,ZQ]=kp(es),[vc]=jn(es,[ZQ,io]),yv=io(),[JQ,so]=vc(es),[eZ,tZ]=vc(es),T3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:h,name:v,autoComplete:m,disabled:g,required:b,form:O}=e,S=yv(t),[x,E]=w.useState(null),[N,_]=w.useState(null),[C,A]=w.useState(!1),M=lc(h),[R,D]=Nn({prop:r,defaultProp:i??!1,onChange:o,caller:es}),[z,G]=Nn({prop:l,defaultProp:u,onChange:d,caller:es}),L=w.useRef(null),F=x?O||!!x.closest("form"):!0,[W,Q]=w.useState(new Set),X=Array.from(W).map(k=>k.props.value).join(";");return c.jsx(Up,{...S,children:c.jsxs(JQ,{required:b,scope:t,trigger:x,onTriggerChange:E,valueNode:N,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:A,contentId:Cr(),value:z,onValueChange:G,open:R,onOpenChange:D,dir:M,triggerPointerDownPosRef:L,disabled:g,children:[c.jsx(vv.Provider,{scope:t,children:c.jsx(eZ,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(k=>{Q(H=>new Set(H).add(k))},[]),onNativeOptionRemove:w.useCallback(k=>{Q(H=>{const B=new Set(H);return B.delete(k),B})},[]),children:n})}),F?c.jsxs(Z3,{"aria-hidden":!0,required:b,tabIndex:-1,name:v,autoComplete:m,value:z,onChange:k=>G(k.target.value),disabled:g,form:O,children:[z===void 0?c.jsx("option",{value:""}):null,Array.from(W)]},X):null]})})};T3.displayName=es;var M3="SelectTrigger",R3=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,o=yv(n),l=so(M3,n),u=l.disabled||r,d=Ue(t,l.onTriggerChange),h=gv(n),v=w.useRef("touch"),[m,g,b]=eL(S=>{const x=h().filter(_=>!_.disabled),E=x.find(_=>_.value===l.value),N=tL(x,S,E);N!==void 0&&l.onValueChange(N.value)}),O=S=>{u||(l.onOpenChange(!0),b()),S&&(l.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return c.jsx(Hp,{asChild:!0,...o,children:c.jsx(Ne.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":J3(l.value)?"":void 0,...i,ref:d,onClick:ye(i.onClick,S=>{S.currentTarget.focus(),v.current!=="mouse"&&O(S)}),onPointerDown:ye(i.onPointerDown,S=>{v.current=S.pointerType;const x=S.target;x.hasPointerCapture(S.pointerId)&&x.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(O(S),S.preventDefault())}),onKeyDown:ye(i.onKeyDown,S=>{const x=m.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&g(S.key),!(x&&S.key===" ")&&XQ.includes(S.key)&&(O(),S.preventDefault())})})})});R3.displayName=M3;var D3="SelectValue",P3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:o,placeholder:l="",...u}=e,d=so(D3,n),{onValueNodeHasChildrenChange:h}=d,v=o!==void 0,m=Ue(t,d.onValueNodeChange);return Wt(()=>{h(v)},[h,v]),c.jsx(Ne.span,{...u,ref:m,style:{pointerEvents:"none"},children:J3(d.value)?c.jsx(c.Fragment,{children:l}):o})});P3.displayName=D3;var nZ="SelectIcon",k3=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return c.jsx(Ne.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});k3.displayName=nZ;var rZ="SelectPortal",$3=e=>c.jsx(dc,{asChild:!0,...e});$3.displayName=rZ;var ts="SelectContent",I3=w.forwardRef((e,t)=>{const n=so(ts,e.__scopeSelect),[r,i]=w.useState();if(Wt(()=>{i(new DocumentFragment)},[]),!n.open){const o=r;return o?Lf.createPortal(c.jsx(L3,{scope:e.__scopeSelect,children:c.jsx(vv.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(z3,{...e,ref:t})});I3.displayName=ts;var Ur=10,[L3,lo]=vc(ts),aZ="SelectContentImpl",iZ=Tl("SelectContent.RemoveScroll"),z3=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:O,hideWhenDetached:S,avoidCollisions:x,...E}=e,N=so(ts,n),[_,C]=w.useState(null),[A,M]=w.useState(null),R=Ue(t,ie=>C(ie)),[D,z]=w.useState(null),[G,L]=w.useState(null),F=gv(n),[W,Q]=w.useState(!1),X=w.useRef(!1);w.useEffect(()=>{if(_)return dO(_)},[_]),tO();const k=w.useCallback(ie=>{const[pe,...re]=F().map(oe=>oe.ref.current),[ve]=re.slice(-1),ge=document.activeElement;for(const oe of ie)if(oe===ge||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===pe&&A&&(A.scrollTop=0),oe===ve&&A&&(A.scrollTop=A.scrollHeight),oe==null||oe.focus(),document.activeElement!==ge))return},[F,A]),H=w.useCallback(()=>k([D,_]),[k,D,_]);w.useEffect(()=>{W&&H()},[W,H]);const{onOpenChange:B,triggerPointerDownPosRef:Z}=N;w.useEffect(()=>{if(_){let ie={x:0,y:0};const pe=ve=>{var ge,oe;ie={x:Math.abs(Math.round(ve.pageX)-(((ge=Z.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ve.pageY)-(((oe=Z.current)==null?void 0:oe.y)??0))}},re=ve=>{ie.x<=10&&ie.y<=10?ve.preventDefault():_.contains(ve.target)||B(!1),document.removeEventListener("pointermove",pe),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",re,{capture:!0})}}},[_,B,Z]),w.useEffect(()=>{const ie=()=>B(!1);return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[B]);const[le,$]=eL(ie=>{const pe=F().filter(ge=>!ge.disabled),re=pe.find(ge=>ge.ref.current===document.activeElement),ve=tL(pe,ie,re);ve&&setTimeout(()=>ve.ref.current.focus())}),Y=w.useCallback((ie,pe,re)=>{const ve=!X.current&&!re;(N.value!==void 0&&N.value===pe||ve)&&(z(ie),ve&&(X.current=!0))},[N.value]),q=w.useCallback(()=>_==null?void 0:_.focus(),[_]),U=w.useCallback((ie,pe,re)=>{const ve=!X.current&&!re;(N.value!==void 0&&N.value===pe||ve)&&L(ie)},[N.value]),ne=r==="popper"?hS:B3,fe=ne===hS?{side:u,sideOffset:d,align:h,alignOffset:v,arrowPadding:m,collisionBoundary:g,collisionPadding:b,sticky:O,hideWhenDetached:S,avoidCollisions:x}:{};return c.jsx(L3,{scope:n,content:_,viewport:A,onViewportChange:M,itemRefCallback:Y,selectedItem:D,onItemLeave:q,itemTextRefCallback:U,focusSelectedItem:H,selectedItemText:G,position:r,isPositioned:W,searchRef:le,children:c.jsx(Yp,{as:iZ,allowPinchZoom:!0,children:c.jsx($p,{asChild:!0,trapped:N.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:ye(i,ie=>{var pe;(pe=N.trigger)==null||pe.focus({preventScroll:!0}),ie.preventDefault()}),children:c.jsx(cc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:c.jsx(ne,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:ie=>ie.preventDefault(),...E,...fe,onPlaced:()=>Q(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:ye(E.onKeyDown,ie=>{const pe=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!pe&&ie.key.length===1&&$(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let ve=F().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(ve=ve.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const ge=ie.target,oe=ve.indexOf(ge);ve=ve.slice(oe+1)}setTimeout(()=>k(ve)),ie.preventDefault()}})})})})})})});z3.displayName=aZ;var oZ="SelectItemAlignedPosition",B3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,o=so(ts,n),l=lo(ts,n),[u,d]=w.useState(null),[h,v]=w.useState(null),m=Ue(t,R=>v(R)),g=gv(n),b=w.useRef(!1),O=w.useRef(!0),{viewport:S,selectedItem:x,selectedItemText:E,focusSelectedItem:N}=l,_=w.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&h&&S&&x&&E){const R=o.trigger.getBoundingClientRect(),D=h.getBoundingClientRect(),z=o.valueNode.getBoundingClientRect(),G=E.getBoundingClientRect();if(o.dir!=="rtl"){const ge=G.left-D.left,oe=z.left-ge,ke=R.left-oe,we=R.width+ke,ze=Math.max(we,D.width),Ze=window.innerWidth-Ur,lt=xm(oe,[Ur,Math.max(Ur,Ze-ze)]);u.style.minWidth=we+"px",u.style.left=lt+"px"}else{const ge=D.right-G.right,oe=window.innerWidth-z.right-ge,ke=window.innerWidth-R.right-oe,we=R.width+ke,ze=Math.max(we,D.width),Ze=window.innerWidth-Ur,lt=xm(oe,[Ur,Math.max(Ur,Ze-ze)]);u.style.minWidth=we+"px",u.style.right=lt+"px"}const L=g(),F=window.innerHeight-Ur*2,W=S.scrollHeight,Q=window.getComputedStyle(h),X=parseInt(Q.borderTopWidth,10),k=parseInt(Q.paddingTop,10),H=parseInt(Q.borderBottomWidth,10),B=parseInt(Q.paddingBottom,10),Z=X+k+W+B+H,le=Math.min(x.offsetHeight*5,Z),$=window.getComputedStyle(S),Y=parseInt($.paddingTop,10),q=parseInt($.paddingBottom,10),U=R.top+R.height/2-Ur,ne=F-U,fe=x.offsetHeight/2,ie=x.offsetTop+fe,pe=X+k+ie,re=Z-pe;if(pe<=U){const ge=L.length>0&&x===L[L.length-1].ref.current;u.style.bottom="0px";const oe=h.clientHeight-S.offsetTop-S.offsetHeight,ke=Math.max(ne,fe+(ge?q:0)+oe+H),we=pe+ke;u.style.height=we+"px"}else{const ge=L.length>0&&x===L[0].ref.current;u.style.top="0px";const ke=Math.max(U,X+S.offsetTop+(ge?Y:0)+fe)+re;u.style.height=ke+"px",S.scrollTop=pe-U+S.offsetTop}u.style.margin=`${Ur}px 0`,u.style.minHeight=le+"px",u.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[g,o.trigger,o.valueNode,u,h,S,x,E,o.dir,r]);Wt(()=>_(),[_]);const[C,A]=w.useState();Wt(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const M=w.useCallback(R=>{R&&O.current===!0&&(_(),N==null||N(),O.current=!1)},[_,N]);return c.jsx(lZ,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:b,onScrollButtonChange:M,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:c.jsx(Ne.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});B3.displayName=oZ;var sZ="SelectPopperPosition",hS=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=Ur,...o}=e,l=yv(n);return c.jsx(Fp,{...l,...o,ref:t,align:r,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});hS.displayName=sZ;var[lZ,qO]=vc(ts,{}),mS="SelectViewport",q3=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,o=lo(mS,n),l=qO(mS,n),u=Ue(t,o.onViewportChange),d=w.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(vv.Slot,{scope:n,children:c.jsx(Ne.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ye(i.onScroll,h=>{const v=h.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:g}=l;if(g!=null&&g.current&&m){const b=Math.abs(d.current-v.scrollTop);if(b>0){const O=window.innerHeight-Ur*2,S=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),E=Math.max(S,x);if(E<O){const N=E+b,_=Math.min(O,N),C=N-_;m.style.height=_+"px",m.style.bottom==="0px"&&(v.scrollTop=C>0?C:0,m.style.justifyContent="flex-end")}}}d.current=v.scrollTop})})})]})});q3.displayName=mS;var U3="SelectGroup",[cZ,uZ]=vc(U3),fZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Cr();return c.jsx(cZ,{scope:n,id:i,children:c.jsx(Ne.div,{role:"group","aria-labelledby":i,...r,ref:t})})});fZ.displayName=U3;var H3="SelectLabel",dZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=uZ(H3,n);return c.jsx(Ne.div,{id:i.id,...r,ref:t})});dZ.displayName=H3;var wm="SelectItem",[hZ,F3]=vc(wm),G3=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:o,...l}=e,u=so(wm,n),d=lo(wm,n),h=u.value===r,[v,m]=w.useState(o??""),[g,b]=w.useState(!1),O=Ue(t,N=>{var _;return(_=d.itemRefCallback)==null?void 0:_.call(d,N,r,i)}),S=Cr(),x=w.useRef("touch"),E=()=>{i||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(hZ,{scope:n,value:r,disabled:i,textId:S,isSelected:h,onItemTextChange:w.useCallback(N=>{m(_=>_||((N==null?void 0:N.textContent)??"").trim())},[]),children:c.jsx(vv.ItemSlot,{scope:n,value:r,disabled:i,textValue:v,children:c.jsx(Ne.div,{role:"option","aria-labelledby":S,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:O,onFocus:ye(l.onFocus,()=>b(!0)),onBlur:ye(l.onBlur,()=>b(!1)),onClick:ye(l.onClick,()=>{x.current!=="mouse"&&E()}),onPointerUp:ye(l.onPointerUp,()=>{x.current==="mouse"&&E()}),onPointerDown:ye(l.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:ye(l.onPointerMove,N=>{var _;x.current=N.pointerType,i?(_=d.onItemLeave)==null||_.call(d):x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ye(l.onPointerLeave,N=>{var _;N.currentTarget===document.activeElement&&((_=d.onItemLeave)==null||_.call(d))}),onKeyDown:ye(l.onKeyDown,N=>{var C;((C=d.searchRef)==null?void 0:C.current)!==""&&N.key===" "||(QQ.includes(N.key)&&E(),N.key===" "&&N.preventDefault())})})})})});G3.displayName=wm;var Du="SelectItemText",V3=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...o}=e,l=so(Du,n),u=lo(Du,n),d=F3(Du,n),h=tZ(Du,n),[v,m]=w.useState(null),g=Ue(t,E=>m(E),d.onItemTextChange,E=>{var N;return(N=u.itemTextRefCallback)==null?void 0:N.call(u,E,d.value,d.disabled)}),b=v==null?void 0:v.textContent,O=w.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:b},d.value),[d.disabled,d.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:x}=h;return Wt(()=>(S(O),()=>x(O)),[S,x,O]),c.jsxs(c.Fragment,{children:[c.jsx(Ne.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Lf.createPortal(o.children,l.valueNode):null]})});V3.displayName=Du;var Y3="SelectItemIndicator",W3=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return F3(Y3,n).isSelected?c.jsx(Ne.span,{"aria-hidden":!0,...r,ref:t}):null});W3.displayName=Y3;var pS="SelectScrollUpButton",K3=w.forwardRef((e,t)=>{const n=lo(pS,e.__scopeSelect),r=qO(pS,e.__scopeSelect),[i,o]=w.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollTop>0;o(h)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?c.jsx(Q3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});K3.displayName=pS;var vS="SelectScrollDownButton",X3=w.forwardRef((e,t)=>{const n=lo(vS,e.__scopeSelect),r=qO(vS,e.__scopeSelect),[i,o]=w.useState(!1),l=Ue(t,r.onScrollButtonChange);return Wt(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollHeight-d.clientHeight,v=Math.ceil(d.scrollTop)<h;o(v)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),i?c.jsx(Q3,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});X3.displayName=vS;var Q3=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,o=lo("SelectScrollButton",n),l=w.useRef(null),u=gv(n),d=w.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return w.useEffect(()=>()=>d(),[d]),Wt(()=>{var v;const h=u().find(m=>m.ref.current===document.activeElement);(v=h==null?void 0:h.ref.current)==null||v.scrollIntoView({block:"nearest"})},[u]),c.jsx(Ne.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ye(i.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:ye(i.onPointerMove,()=>{var h;(h=o.onItemLeave)==null||h.call(o),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:ye(i.onPointerLeave,()=>{d()})})}),mZ="SelectSeparator",pZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(Ne.div,{"aria-hidden":!0,...r,ref:t})});pZ.displayName=mZ;var gS="SelectArrow",vZ=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=yv(n),o=so(gS,n),l=lo(gS,n);return o.open&&l.position==="popper"?c.jsx(Gp,{...i,...r,ref:t}):null});vZ.displayName=gS;var gZ="SelectBubbleInput",Z3=w.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=w.useRef(null),o=Ue(r,i),l=ov(t);return w.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("change",{bubbles:!0});v.call(u,t),u.dispatchEvent(m)}},[l,t]),c.jsx(Ne.select,{...n,style:{...MI,...n.style},ref:o,defaultValue:t})});Z3.displayName=gZ;function J3(e){return e===""||e===void 0}function eL(e){const t=Wr(e),n=w.useRef(""),r=w.useRef(0),i=w.useCallback(l=>{const u=n.current+l;t(u),(function d(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,o]}function tL(e,t,n){const i=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=yZ(e,Math.max(o,0));i.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.textValue.toLowerCase().startsWith(i.toLowerCase()));return d!==n?d:void 0}function yZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bZ=T3,xZ=R3,wZ=P3,SZ=k3,jZ=$3,OZ=I3,EZ=q3,_Z=G3,NZ=V3,AZ=W3,CZ=K3,TZ=X3;function ma({...e}){return c.jsx(bZ,{"data-slot":"select",...e})}function pa({...e}){return c.jsx(wZ,{"data-slot":"select-value",...e})}function va({className:e,size:t="default",children:n,...r}){return c.jsxs(xZ,{className:me("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs outline-none transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-[placeholder]:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-size":t,"data-slot":"select-trigger",...r,children:[n,c.jsx(SZ,{asChild:!0,children:c.jsx(ro,{className:"size-4 opacity-50"})})]})}function ga({className:e,children:t,position:n="popper",align:r="center",...i}){return c.jsx(jZ,{children:c.jsxs(OZ,{align:r,className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] origin-[--radix-select-content-transform-origin] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",n==="popper"&&"data-[side=left]:-translate-x-1 data-[side=top]:-translate-y-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1",e),"data-slot":"select-content",position:n,...i,children:[c.jsx(MZ,{}),c.jsx(EZ,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),c.jsx(RZ,{})]})})}function Fe({className:e,children:t,...n}){return c.jsxs(_Z,{className:me("relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),"data-slot":"select-item",...n,children:[c.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:c.jsx(AZ,{children:c.jsx(ri,{className:"size-4"})})}),c.jsx(NZ,{children:t})]})}function MZ({className:e,...t}){return c.jsx(CZ,{className:me("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...t,children:c.jsx(ic,{className:"size-4"})})}function RZ({className:e,...t}){return c.jsx(TZ,{className:me("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...t,children:c.jsx(ro,{className:"size-4"})})}var nL=["PageUp","PageDown"],rL=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],aL={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},gc="Slider",[yS,DZ,PZ]=kp(gc),[iL]=jn(gc,[PZ]),[kZ,bv]=iL(gc),oL=w.forwardRef((e,t)=>{const{name:n,min:r=0,max:i=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:v,onValueChange:m=()=>{},onValueCommit:g=()=>{},inverted:b=!1,form:O,...S}=e,x=w.useRef(new Set),E=w.useRef(0),_=l==="horizontal"?$Z:IZ,[C=[],A]=Nn({prop:v,defaultProp:h,onChange:L=>{var W;(W=[...x.current][E.current])==null||W.focus(),m(L)}}),M=w.useRef(C);function R(L){const F=UZ(C,L);G(L,F)}function D(L){G(L,E.current)}function z(){const L=M.current[E.current];C[E.current]!==L&&g(C)}function G(L,F,{commit:W}={commit:!1}){const Q=VZ(o),X=YZ(Math.round((L-r)/o)*o+r,Q),k=xm(X,[r,i]);A((H=[])=>{const B=BZ(H,k,F);if(GZ(B,d*o)){E.current=B.indexOf(k);const Z=String(B)!==String(H);return Z&&W&&g(B),Z?B:H}else return H})}return c.jsx(kZ,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:i,valueIndexToChangeRef:E,thumbs:x.current,values:C,orientation:l,form:O,children:c.jsx(yS.Provider,{scope:e.__scopeSlider,children:c.jsx(yS.Slot,{scope:e.__scopeSlider,children:c.jsx(_,{"aria-disabled":u,"data-disabled":u?"":void 0,...S,ref:t,onPointerDown:ye(S.onPointerDown,()=>{u||(M.current=C)}),min:r,max:i,inverted:b,onSlideStart:u?void 0:R,onSlideMove:u?void 0:D,onSlideEnd:u?void 0:z,onHomeKeyDown:()=>!u&&G(r,0,{commit:!0}),onEndKeyDown:()=>!u&&G(i,C.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:F})=>{if(!u){const X=nL.includes(L.key)||L.shiftKey&&rL.includes(L.key)?10:1,k=E.current,H=C[k],B=o*X*F;G(H+B,k,{commit:!0})}}})})})})});oL.displayName=gc;var[sL,lL]=iL(gc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),$Z=w.forwardRef((e,t)=>{const{min:n,max:r,dir:i,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:h,...v}=e,[m,g]=w.useState(null),b=Ue(t,_=>g(_)),O=w.useRef(void 0),S=lc(i),x=S==="ltr",E=x&&!o||!x&&o;function N(_){const C=O.current||m.getBoundingClientRect(),A=[0,C.width],R=UO(A,E?[n,r]:[r,n]);return O.current=C,R(_-C.left)}return c.jsx(sL,{scope:e.__scopeSlider,startEdge:E?"left":"right",endEdge:E?"right":"left",direction:E?1:-1,size:"width",children:c.jsx(cL,{dir:S,"data-orientation":"horizontal",...v,ref:b,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:_=>{const C=N(_.clientX);l==null||l(C)},onSlideMove:_=>{const C=N(_.clientX);u==null||u(C)},onSlideEnd:()=>{O.current=void 0,d==null||d()},onStepKeyDown:_=>{const A=aL[E?"from-left":"from-right"].includes(_.key);h==null||h({event:_,direction:A?-1:1})}})})}),IZ=w.forwardRef((e,t)=>{const{min:n,max:r,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...h}=e,v=w.useRef(null),m=Ue(t,v),g=w.useRef(void 0),b=!i;function O(S){const x=g.current||v.current.getBoundingClientRect(),E=[0,x.height],_=UO(E,b?[r,n]:[n,r]);return g.current=x,_(S-x.top)}return c.jsx(sL,{scope:e.__scopeSlider,startEdge:b?"bottom":"top",endEdge:b?"top":"bottom",size:"height",direction:b?1:-1,children:c.jsx(cL,{"data-orientation":"vertical",...h,ref:m,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const x=O(S.clientY);o==null||o(x)},onSlideMove:S=>{const x=O(S.clientY);l==null||l(x)},onSlideEnd:()=>{g.current=void 0,u==null||u()},onStepKeyDown:S=>{const E=aL[b?"from-bottom":"from-top"].includes(S.key);d==null||d({event:S,direction:E?-1:1})}})})}),cL=w.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...h}=e,v=bv(gc,n);return c.jsx(Ne.span,{...h,ref:t,onKeyDown:ye(e.onKeyDown,m=>{m.key==="Home"?(l(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):nL.concat(rL).includes(m.key)&&(d(m),m.preventDefault())}),onPointerDown:ye(e.onPointerDown,m=>{const g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),v.thumbs.has(g)?g.focus():r(m)}),onPointerMove:ye(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&i(m)}),onPointerUp:ye(e.onPointerUp,m=>{const g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),o(m))})})}),uL="SliderTrack",fL=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=bv(uL,n);return c.jsx(Ne.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:t})});fL.displayName=uL;var bS="SliderRange",dL=w.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,i=bv(bS,n),o=lL(bS,n),l=w.useRef(null),u=Ue(t,l),d=i.values.length,h=i.values.map(g=>pL(g,i.min,i.max)),v=d>1?Math.min(...h):0,m=100-Math.max(...h);return c.jsx(Ne.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:u,style:{...e.style,[o.startEdge]:v+"%",[o.endEdge]:m+"%"}})});dL.displayName=bS;var xS="SliderThumb",hL=w.forwardRef((e,t)=>{const n=DZ(e.__scopeSlider),[r,i]=w.useState(null),o=Ue(t,u=>i(u)),l=w.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return c.jsx(LZ,{...e,ref:o,index:l})}),LZ=w.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:i,...o}=e,l=bv(xS,n),u=lL(xS,n),[d,h]=w.useState(null),v=Ue(t,N=>h(N)),m=d?l.form||!!d.closest("form"):!0,g=qp(d),b=l.values[r],O=b===void 0?0:pL(b,l.min,l.max),S=qZ(r,l.values.length),x=g==null?void 0:g[u.size],E=x?HZ(x,O,u.direction):0;return w.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${O}% + ${E}px)`},children:[c.jsx(yS.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(Ne.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":l.min,"aria-valuenow":b,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:v,style:b===void 0?{display:"none"}:e.style,onFocus:ye(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),m&&c.jsx(mL,{name:i??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:b},r)]})});hL.displayName=xS;var zZ="RadioBubbleInput",mL=w.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const i=w.useRef(null),o=Ue(i,r),l=ov(t);return w.useEffect(()=>{const u=i.current;if(!u)return;const d=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&v){const m=new Event("input",{bubbles:!0});v.call(u,t),u.dispatchEvent(m)}},[l,t]),c.jsx(Ne.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});mL.displayName=zZ;function BZ(e=[],t,n){const r=[...e];return r[n]=t,r.sort((i,o)=>i-o)}function pL(e,t,n){const o=100/(n-t)*(e-t);return xm(o,[0,100])}function qZ(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function UZ(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),r=Math.min(...n);return n.indexOf(r)}function HZ(e,t,n){const r=e/2,o=UO([0,50],[0,r]);return(r-o(t)*n)*n}function FZ(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function GZ(e,t){if(t>0){const n=FZ(e);return Math.min(...n)>=t}return!0}function UO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function VZ(e){return(String(e).split(".")[1]||"").length}function YZ(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var WZ=oL,KZ=fL,XZ=dL,QZ=hL;function ZZ({className:e,defaultValue:t,value:n,min:r=0,max:i=100,...o}){const l=w.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,i],[n,t,r,i]);return c.jsxs(WZ,{className:me("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col data-[disabled]:opacity-50",e),"data-slot":"slider",defaultValue:t,max:i,min:r,value:n,...o,children:[c.jsx(KZ,{className:me("relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=vertical]:h-full data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-1.5"),"data-slot":"slider-track",children:c.jsx(XZ,{className:me("absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"),"data-slot":"slider-range"})}),Array.from({length:l.length},(u,d)=>c.jsx(QZ,{className:"block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:outline-hidden focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50","data-slot":"slider-thumb"},`thumb-${l[d]}-${d}`))]})}var xv="Switch",[JZ]=jn(xv),[eJ,tJ]=JZ(xv),vL=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:h,form:v,...m}=e,[g,b]=w.useState(null),O=Ue(t,_=>b(_)),S=w.useRef(!1),x=g?v||!!g.closest("form"):!0,[E,N]=Nn({prop:i,defaultProp:o??!1,onChange:h,caller:xv});return c.jsxs(eJ,{scope:n,checked:E,disabled:u,children:[c.jsx(Ne.button,{type:"button",role:"switch","aria-checked":E,"aria-required":l,"data-state":xL(E),"data-disabled":u?"":void 0,disabled:u,value:d,...m,ref:O,onClick:ye(e.onClick,_=>{N(C=>!C),x&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),x&&c.jsx(bL,{control:g,bubbles:!S.current,name:r,value:d,checked:E,required:l,disabled:u,form:v,style:{transform:"translateX(-100%)"}})]})});vL.displayName=xv;var gL="SwitchThumb",yL=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=tJ(gL,n);return c.jsx(Ne.span,{"data-state":xL(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});yL.displayName=gL;var nJ="SwitchBubbleInput",bL=w.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},o)=>{const l=w.useRef(null),u=Ue(l,o),d=ov(n),h=qp(t);return w.useEffect(()=>{const v=l.current;if(!v)return;const m=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(m,"checked").set;if(d!==n&&b){const O=new Event("click",{bubbles:r});b.call(v,n),v.dispatchEvent(O)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:u,style:{...i.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bL.displayName=nJ;function xL(e){return e?"checked":"unchecked"}var rJ=vL,aJ=yL;function iJ({className:e,...t}){return c.jsx(rJ,{className:me("peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs outline-none transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),"data-slot":"switch",...t,children:c.jsx(aJ,{className:me("pointer-events-none block size-4 rounded-full bg-background ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"),"data-slot":"switch-thumb"})})}async function nT(e){try{const t=document.createElement("canvas");return t.width=1,t.height=1,t.toDataURL(e).startsWith(`data:${e}`)}catch{return!1}}async function oJ(){const[e,t]=await Promise.all([nT("image/webp"),nT("image/avif")]);return{webp:e,avif:t,offscreenCanvas:typeof OffscreenCanvas<"u",webWorker:typeof Worker<"u",wasm:typeof WebAssembly<"u"}}let Ch=null;async function sJ(){return Ch||(Ch=await oJ(),Ch)}async function lJ(e){if(e.type!=="image/gif")return{isAnimated:!1,frameCount:1,size:e.size};try{const t=await e.arrayBuffer(),n=new Uint8Array(t);let r=0;for(let i=0;i<n.length-2;i++)n[i]===33&&n[i+1]===249&&r++;return{isAnimated:r>1,frameCount:Math.max(1,r),size:e.size}}catch{return{isAnimated:!1,frameCount:1,size:e.size}}}function cJ(e){return e.type==="image/gif"}function uJ(e){return new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Failed to read blob")),r.readAsDataURL(e)})}function wL(e){return uJ(e)}function Th(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function fJ(e){return new Promise((t,n)=>{const r=new Image,i=URL.createObjectURL(e);r.onload=()=>{URL.revokeObjectURL(i),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{URL.revokeObjectURL(i),n(new Error("Failed to load image"))},r.src=i})}class dJ{constructor(){fb(this,"worker",null);fb(this,"pending",new Map)}getWorker(){return this.worker||(this.worker=new Worker(new URL("/assets/optimizer.worker-CeufIUo5.js",import.meta.url),{type:"module"}),this.worker.onmessage=this.handleMessage.bind(this),this.worker.onerror=this.handleError.bind(this)),this.worker}handleMessage(t){const{id:n,result:r,error:i,progress:o}=t.data,l=this.pending.get(n);if(l){if(o!==void 0&&o<100&&l.onProgress){l.onProgress(o);return}if(i){l.reject(new Error(i)),this.pending.delete(n);return}r&&(l.resolve(r),this.pending.delete(n))}}handleError(t){console.error("Image optimizer worker error:",t);for(const[n,r]of this.pending)r.reject(new Error(`Worker error: ${t.message}`)),this.pending.delete(n);this.terminate()}generateId(){return crypto.randomUUID()}async optimize(t,n,r){const i=this.generateId();return new Promise((o,l)=>{this.pending.set(i,{resolve:o,reject:l,onProgress:r}),this.getWorker().postMessage({id:i,type:"optimize",file:t,options:n})})}async preview(t,n,r){const i=await wL(t);return{...await this.optimize(t,n,r),originalDataUrl:i}}cancelAll(){for(const[t,n]of this.pending)n.reject(new Error("Operation cancelled")),this.pending.delete(t)}terminate(){this.cancelAll(),this.worker&&(this.worker.terminate(),this.worker=null)}get isActive(){return this.worker!==null}get pendingCount(){return this.pending.size}}const hJ=new dJ;async function mJ(e,t,n){return hJ.preview(e,t,n)}const pJ=[{value:"webp",label:"WebP",description:"Best balance of size and quality"},{value:"avif",label:"AVIF",description:"Best compression"},{value:"jpeg",label:"JPEG",description:"Universal compatibility"},{value:"png",label:"PNG",description:"Lossless, supports transparency"},{value:"original",label:"Original",description:"Keep original format"}],vJ=[{value:1,label:"1x",description:"Standard displays"},{value:2,label:"2x",description:"Retina / HiDPI (recommended)"},{value:3,label:"3x",description:"iPhone Pro / flagship phones"}];function wS(e){const t=e/1024,n=t/1024;return n>2?{level:"error",message:"This image will cause delivery issues (>2MB)",suggestion:"Reduce dimensions or increase compression to under 1MB"}:n>1?{level:"warning",message:"Most email clients struggle with images >1MB",suggestion:"Consider reducing to under 500KB for best deliverability"}:t>500?{level:"info",message:"Larger than recommended for email (>500KB)",suggestion:"This may slow load times on mobile devices"}:null}function qb(e){const t=wS(e);if(!t)return{label:"Good",color:"text-green-600"};switch(t.level){case"info":return{label:"OK",color:"text-yellow-600"};case"warning":return{label:"Large",color:"text-orange-600"};case"error":return{label:"Too Large",color:"text-red-600"};default:return{label:"Unknown",color:"text-muted-foreground"}}}const gJ=[{value:"none",label:"Original size",description:"Keep original dimensions"},{value:"600",label:"Email (600px)",description:"Standard email width"},{value:"800",label:"Medium (800px)",description:"Blog posts, cards"},{value:"1200",label:"Large (1200px)",description:"Full-width content"},{value:"1440",label:"Hero (1440px)",description:"Banner images"},{value:"1920",label:"Full HD (1920px)",description:"Desktop screens"}];function yJ({files:e,onComplete:t,onClose:n,open:r}){var q;const[i,o]=w.useState([]),[l,u]=w.useState(null),[d,h]=w.useState(!1),v=i.reduce((U,ne)=>U+ne.file.size,0),m=i.reduce((U,ne)=>{var fe;return U+(((fe=ne.preview)==null?void 0:fe.optimizedSize)??ne.file.size)},0),g=v>0?Math.round((1-m/v)*100):0,b=i.length>0&&i.every(U=>U.status==="ready"||U.status==="done"||U.isAnimatedGif),O=i.some(U=>U.status==="pending"&&!U.isAnimatedGif),S=i.some(U=>U.status==="processing"),[x,E]=w.useState(!0),[N,_]=w.useState(!1),[C,A]=w.useState({format:"webp",quality:85}),[M,R]=w.useState(85),[D,z]=w.useState("none"),[G,L]=w.useState(2),[F,W]=w.useState(!0);w.useEffect(()=>{sJ().then(U=>{W(U.wasm&&U.webWorker&&U.offscreenCanvas)})},[]),w.useEffect(()=>{var ne;if(!r||e.length===0)return;const U=e.map((fe,ie)=>({id:`${fe.name}-${ie}-${Date.now()}`,file:fe,status:"pending"}));o(U),u(((ne=U[0])==null?void 0:ne.id)??null),_(!1),h(!1);for(const fe of U)wL(fe.file).then(ie=>{o(pe=>pe.map(re=>re.id===fe.id?{...re,thumbnailUrl:ie}:re))}),cJ(fe.file)&&lJ(fe.file).then(ie=>{ie.isAnimated&&o(pe=>pe.map(re=>re.id===fe.id?{...re,isAnimatedGif:!0,status:"ready"}:re))})},[r,e]);const Q=w.useCallback(async()=>{const U=i.filter(ne=>ne.status==="pending"&&!ne.isAnimatedGif);if(U.length===0){h(!1);return}for(const ne of U){o(fe=>fe.map(ie=>ie.id===ne.id?{...ie,status:"processing"}:ie));try{let fe;if(D==="none"){if(G>1){const re=await fJ(ne.file);fe=Math.round(re.width/G)}}else fe=Number(D)*G;const ie={...C,maxWidth:fe},pe=await mJ(ne.file,ie);o(re=>re.map(ve=>ve.id===ne.id?{...ve,status:"ready",preview:pe}:ve))}catch{o(fe=>fe.map(ie=>ie.id===ne.id?{...ie,status:"ready"}:ie))}}h(!1)},[i,C,D,G]),X=`${C.format}-${C.quality}-${D}-${G}`,k=w.useRef(X);w.useEffect(()=>{k.current!==X&&(k.current=X,o(U=>U.map(ne=>ne.isAnimatedGif?ne:{...ne,status:"pending",preview:void 0})),h(!1))},[X]);const H=U=>{const ne=U.name.replace(/\.[^/.]+$/,""),fe=C.format==="original"?U.name.split(".").pop():C.format;return`${ne}.${fe}`},B=()=>{h(!0),Q()},Z=()=>{const U=i.map(ne=>!x||ne.isAnimatedGif||!ne.preview?{file:ne.file,cdnFilename:ne.file.name}:{file:ne.preview.blob,cdnFilename:H(ne.file)});t(U),n()},le=()=>{const U=i.map(ne=>({file:ne.file,cdnFilename:ne.file.name}));t(U),n()};if(!r)return null;const $=i.length===1,Y=$?i[0]:null;return c.jsx(RO,{onOpenChange:U=>!U&&n(),open:r,children:c.jsxs(DO,{className:"max-w-lg",children:[c.jsx(t3,{children:c.jsx(r3,{className:"flex items-center gap-2",children:$?c.jsxs(c.Fragment,{children:[c.jsx(Sb,{className:"h-5 w-5 text-muted-foreground"}),c.jsx("span",{className:"truncate",children:Y==null?void 0:Y.file.name})]}):c.jsxs(c.Fragment,{children:[c.jsx(Sb,{className:"h-5 w-5 text-muted-foreground"}),i.length," images selected"]})})}),c.jsxs("div",{className:"space-y-4",children:[!$&&c.jsxs("div",{className:"grid grid-cols-6 gap-2",children:[i.slice(0,11).map(U=>c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsxs("div",{className:`relative aspect-square overflow-hidden rounded-md border bg-muted ${U.id===l?"ring-2 ring-primary":""}`,children:[U.thumbnailUrl?c.jsx("img",{alt:U.file.name,className:"h-full w-full object-cover",src:U.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Sb,{className:"h-4 w-4 text-muted-foreground"})}),U.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(Va,{className:"h-3 w-3 animate-spin"})}),U.status==="ready"&&U.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/20",children:c.jsx(ri,{className:"h-4 w-4 text-green-600"})}),U.isAnimatedGif&&c.jsx(qe,{className:"absolute right-0.5 bottom-0.5 h-4 px-1 text-[10px]",children:"GIF"})]})}),c.jsxs(rv,{side:"bottom",children:[c.jsx("p",{className:"font-medium text-xs",children:U.file.name}),c.jsxs("p",{className:"text-muted-foreground text-xs",children:[Th(U.file.size),U.preview&&` → ${Th(U.preview.optimizedSize)}`]})]})]},U.id)),i.length>11&&c.jsxs("div",{className:"flex aspect-square items-center justify-center rounded-md border bg-muted text-muted-foreground text-xs",children:["+",i.length-11]})]}),$&&Y&&c.jsxs("div",{className:"relative aspect-video overflow-hidden rounded-lg border bg-muted",children:[Y.thumbnailUrl?c.jsx("img",{alt:Y.file.name,className:"h-full w-full object-contain",src:Y.thumbnailUrl}):c.jsx("div",{className:"flex h-full items-center justify-center",children:c.jsx(Va,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),Y.status==="processing"&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50",children:c.jsx(Va,{className:"h-6 w-6 animate-spin"})}),Y.status==="ready"&&Y.preview&&c.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-green-500/10",children:c.jsx(ri,{className:"h-8 w-8 text-green-600"})})]}),c.jsxs("div",{className:"rounded-lg border bg-muted/30 p-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsxs("p",{className:"text-muted-foreground text-sm",children:[c.jsx("span",{className:qb(v).color,children:Th(v)}),x&&b&&g>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"mx-2",children:"→"}),c.jsx("span",{className:`font-medium ${qb(m).color}`,children:Th(m)})]})]}),S&&c.jsx("p",{className:"text-muted-foreground text-xs",children:"Optimizing..."}),!S&&wS(b?m:v)&&c.jsx("p",{className:`text-xs ${qb(b?m:v).color}`,children:(q=wS(b?m:v))==null?void 0:q.suggestion})]}),x&&b&&g>0&&c.jsxs(qe,{className:"bg-green-100 text-green-700 dark:bg-green-900 dark:text-green-300",variant:"secondary",children:[c.jsx(kF,{className:"mr-1 h-3 w-3"}),"Save ",g,"%"]})]}),S&&c.jsx(pv,{className:"mt-3 h-1",value:i.filter(U=>U.status==="ready"||U.isAnimatedGif).length/i.length*100})]}),F&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"cursor-pointer",htmlFor:"optimize-toggle",children:"Optimize before uploading"}),c.jsx(iJ,{checked:x,id:"optimize-toggle",onCheckedChange:E})]}),x&&F&&c.jsxs(fs,{onOpenChange:_,open:N,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-start text-muted-foreground",size:"sm",variant:"ghost",children:[N?c.jsx(ro,{className:"mr-2 h-4 w-4"}):c.jsx(jF,{className:"mr-2 h-4 w-4"}),"Options"]})}),c.jsxs(hs,{className:"space-y-4 pt-2",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Format"}),c.jsxs(ma,{onValueChange:U=>A({...C,format:U}),value:C.format||"webp",children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:pJ.map(U=>c.jsx(Fe,{value:U.value,children:U.label},U.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Quality"}),c.jsxs("span",{className:"text-muted-foreground text-xs",children:[M,"%"]})]}),c.jsx(ZZ,{className:"mt-2",max:100,min:50,onValueChange:([U])=>R(U),onValueCommit:([U])=>A({...C,quality:U}),step:5,value:[M]})]})]}),c.jsxs("div",{className:"space-y-3 rounded-lg border bg-muted/20 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(qo,{className:"font-medium text-xs",children:"Resize Image"}),c.jsx("span",{className:"text-muted-foreground text-xs",children:"Maintains aspect ratio"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Max Width"}),c.jsxs(ma,{onValueChange:z,value:D,children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:gJ.map(U=>c.jsx(Fe,{value:U.value,children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:U.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:U.description})]})},U.value))})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{className:"text-muted-foreground text-xs",children:"Pixel Density"}),c.jsxs(ma,{onValueChange:U=>L(Number(U)),value:String(G),children:[c.jsx(va,{className:"h-9",children:c.jsx(pa,{})}),c.jsx(ga,{children:vJ.map(U=>c.jsx(Fe,{value:String(U.value),children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{children:U.label}),c.jsx("span",{className:"text-muted-foreground text-xs",children:U.description})]})},U.value))})]})]})]}),c.jsx("p",{className:"text-muted-foreground text-xs",children:D==="none"?G===1?"Original dimensions preserved":`Scales to 1/${G} original size`:`Output: ${Number(D)*G}px actual width`})]})]})]})]}),c.jsxs(n3,{className:"gap-2 sm:gap-0",children:[c.jsx(Ce,{onClick:n,variant:"ghost",children:"Cancel"}),x&&F?c.jsxs(c.Fragment,{children:[c.jsx(Ce,{onClick:le,variant:"outline",children:"Upload originals"}),b?c.jsxs(Ce,{onClick:Z,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload",g>0&&` (save ${g}%)`]}):c.jsxs(Ce,{disabled:d||!O,onClick:B,children:[d?c.jsx(Va,{className:"mr-2 h-4 w-4 animate-spin"}):c.jsx(BF,{className:"mr-2 h-4 w-4"}),d?"Optimizing...":"Optimize"]})]}):c.jsxs(Ce,{onClick:le,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})})}const bJ=mc("relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[1rem_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current"}},defaultVariants:{variant:"default"}});function Un({className:e,variant:t,...n}){return c.jsx("div",{className:me(bJ({variant:t}),e),"data-slot":"alert",role:"alert",...n})}function to({className:e,...t}){return c.jsx("div",{className:me("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),"data-slot":"alert-title",...t})}function Hn({className:e,...t}){return c.jsx("div",{className:me("col-start-2 grid justify-items-start gap-1 text-muted-foreground text-sm [&_p]:leading-relaxed",e),"data-slot":"alert-description",...t})}var SL="AlertDialog",[xJ]=jn(SL,[pI]),di=pI(),jL=e=>{const{__scopeAlertDialog:t,...n}=e,r=di(t);return c.jsx(OO,{...r,...n,modal:!0})};jL.displayName=SL;var wJ="AlertDialogTrigger",SJ=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(bW,{...i,...r,ref:t})});SJ.displayName=wJ;var jJ="AlertDialogPortal",OL=e=>{const{__scopeAlertDialog:t,...n}=e,r=di(t);return c.jsx(EO,{...r,...n})};OL.displayName=jJ;var OJ="AlertDialogOverlay",EL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(_O,{...i,...r,ref:t})});EL.displayName=OJ;var jl="AlertDialogContent",[EJ,_J]=xJ(jl),NJ=H$("AlertDialogContent"),_L=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,o=di(n),l=w.useRef(null),u=Ue(t,l),d=w.useRef(null);return c.jsx(pW,{contentName:jl,titleName:NL,docsSlug:"alert-dialog",children:c.jsx(EJ,{scope:n,cancelRef:d,children:c.jsxs(NO,{role:"alertdialog",...o,...i,ref:u,onOpenAutoFocus:ye(i.onOpenAutoFocus,h=>{var v;h.preventDefault(),(v=d.current)==null||v.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[c.jsx(NJ,{children:r}),c.jsx(CJ,{contentRef:l})]})})})});_L.displayName=jl;var NL="AlertDialogTitle",AL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(AO,{...i,...r,ref:t})});AL.displayName=NL;var CL="AlertDialogDescription",TL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(CO,{...i,...r,ref:t})});TL.displayName=CL;var AJ="AlertDialogAction",ML=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=di(n);return c.jsx(Zp,{...i,...r,ref:t})});ML.displayName=AJ;var RL="AlertDialogCancel",DL=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=_J(RL,n),o=di(n),l=Ue(t,i);return c.jsx(Zp,{...o,...r,ref:l})});DL.displayName=RL;var CJ=({contentRef:e})=>{const t=`\`${jl}\` requires a description for the component to be accessible for screen reader users.
|
|
423
423
|
|
|
424
424
|
You can add a description to the \`${jl}\` by passing a \`${CL}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
425
425
|
|
|
426
426
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${jl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
427
427
|
|
|
428
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},TJ=jL,MJ=OL,RJ=EL,DJ=_L,PJ=ML,kJ=DL,$J=AL,IJ=TL;function Sm({...e}){return c.jsx(TJ,{"data-slot":"alert-dialog",...e})}function LJ({...e}){return c.jsx(MJ,{"data-slot":"alert-dialog-portal",...e})}function zJ({className:e,...t}){return c.jsx(RJ,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"alert-dialog-overlay",...t})}function jm({className:e,...t}){return c.jsxs(LJ,{children:[c.jsx(zJ,{}),c.jsx(DJ,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"alert-dialog-content",...t})]})}function Om({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"alert-dialog-header",...t})}function Em({className:e,...t}){return c.jsx("div",{className:me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"alert-dialog-footer",...t})}function _m({className:e,...t}){return c.jsx($J,{className:me("font-semibold text-lg",e),"data-slot":"alert-dialog-title",...t})}function Nm({className:e,...t}){return c.jsx(IJ,{className:me("text-muted-foreground text-sm",e),"data-slot":"alert-dialog-description",...t})}function Am({className:e,...t}){return c.jsx(PJ,{className:me(xO(),e),...t})}function Cm({className:e,...t}){return c.jsx(kJ,{className:me(xO({variant:"outline"}),e),...t})}var PL="Toggle",kL=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[l,u]=Nn({prop:n,onChange:i,defaultProp:r??!1,caller:PL});return c.jsx(Ne.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:ye(e.onClick,()=>{e.disabled||u(!l)})})});kL.displayName=PL;var co="ToggleGroup",[$L]=jn(co,[hc]),IL=hc(),HO=I.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return c.jsx(BJ,{...i,ref:t})}if(n==="multiple"){const i=r;return c.jsx(qJ,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${co}\``)});HO.displayName=co;var[LL,zL]=$L(co),BJ=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,u]=Nn({prop:n,defaultProp:r??"",onChange:i,caller:co});return c.jsx(LL,{scope:e.__scopeToggleGroup,type:"single",value:I.useMemo(()=>l?[l]:[],[l]),onItemActivate:u,onItemDeactivate:I.useCallback(()=>u(""),[u]),children:c.jsx(BL,{...o,ref:t})})}),qJ=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,u]=Nn({prop:n,defaultProp:r??[],onChange:i,caller:co}),d=I.useCallback(v=>u((m=[])=>[...m,v]),[u]),h=I.useCallback(v=>u((m=[])=>m.filter(g=>g!==v)),[u]);return c.jsx(LL,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:d,onItemDeactivate:h,children:c.jsx(BL,{...o,ref:t})})});HO.displayName=co;var[UJ,HJ]=$L(co),BL=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:l,loop:u=!0,...d}=e,h=IL(n),v=lc(l),m={role:"group",dir:v,...d};return c.jsx(UJ,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(uO,{asChild:!0,...h,orientation:o,dir:v,loop:u,children:c.jsx(Ne.div,{...m,ref:t})}):c.jsx(Ne.div,{...m,ref:t})})}),Tm="ToggleGroupItem",qL=I.forwardRef((e,t)=>{const n=zL(Tm,e.__scopeToggleGroup),r=HJ(Tm,e.__scopeToggleGroup),i=IL(e.__scopeToggleGroup),o=n.value.includes(e.value),l=r.disabled||e.disabled,u={...e,pressed:o,disabled:l},d=I.useRef(null);return r.rovingFocus?c.jsx(fO,{asChild:!0,...i,focusable:!l,active:o,ref:d,children:c.jsx(rT,{...u,ref:t})}):c.jsx(rT,{...u,ref:t})});qL.displayName=Tm;var rT=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=zL(Tm,n),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=o.type==="single"?l:void 0;return c.jsx(kL,{...u,...i,ref:t,onPressedChange:d=>{d?o.onItemActivate(r):o.onItemDeactivate(r)}})}),FJ=HO,GJ=qL;const VJ=mc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),UL=w.createContext({size:"default",variant:"default",spacing:0});function YJ({className:e,variant:t,size:n,spacing:r=0,children:i,...o}){return c.jsx(FJ,{className:me("group/toggle-group flex w-fit items-center gap-[var(--gap)] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),"data-size":n,"data-slot":"toggle-group","data-spacing":r,"data-variant":t,style:{"--gap":r},...o,children:c.jsx(UL.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function aT({className:e,children:t,variant:n,size:r,...i}){const o=w.useContext(UL);return c.jsx(GJ,{className:me(VJ({variant:o.variant||n,size:o.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:first:border-l data-[spacing=0]:first:rounded-l-md",e),"data-size":o.size||r,"data-slot":"toggle-group-item","data-spacing":o.spacing,"data-variant":o.variant||n,...i,children:t})}function WJ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function KJ({url:e}){const[t,n]=w.useState(!1),r=async()=>{await navigator.clipboard.writeText(e),n(!0),Ot.success("URL copied to clipboard"),setTimeout(()=>n(!1),2e3)};return c.jsx(Ce,{onClick:r,size:"sm",variant:"outline",children:t?c.jsx(ri,{className:"h-3 w-3 text-green-500"}):c.jsx("span",{className:"text-xs",children:"Copy"})})}function XJ(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Re,{className:"mb-2 h-8 w-36"}),c.jsx(Re,{className:"h-4 w-48"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Re,{className:"h-9 w-9"}),c.jsx(Re,{className:"h-9 w-24"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Re,{className:"h-9 min-w-[200px] flex-1"}),c.jsx(Re,{className:"h-9 w-40"}),c.jsx(Re,{className:"h-9 w-20"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(e=>c.jsxs("div",{className:"overflow-hidden rounded-xl bg-muted shadow-sm",children:[c.jsx(Re,{className:"aspect-square w-full"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Re,{className:"h-4 w-4"}),c.jsx(Re,{className:"h-4 flex-1"})]}),c.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[c.jsx(Re,{className:"h-4 w-10"}),c.jsx(Re,{className:"h-4 w-12"})]})]})]},e))})]})}function QJ(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function ZJ({onUploadClick:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(h$,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h3",{className:"mb-2 font-semibold text-lg",children:"No Files Yet"}),c.jsx("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:"Upload your first file to get started with your CDN library"}),c.jsxs(Ce,{onClick:e,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})}function JJ({upload:e,onRemove:t}){return c.jsx("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/30 p-3",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsx("span",{className:"truncate font-medium text-sm",children:e.filename}),c.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="uploading"&&c.jsx(Va,{className:"h-4 w-4 animate-spin text-primary"}),e.status==="success"&&c.jsx(ao,{className:"h-4 w-4 text-green-500"}),e.status==="error"&&c.jsx(lr,{className:"h-4 w-4 text-red-500"}),c.jsx(Ce,{className:"h-6 w-6",onClick:t,size:"icon",variant:"ghost",children:c.jsx(or,{className:"h-3 w-3"})})]})]}),e.status==="uploading"&&c.jsx(pv,{className:"h-1",value:e.progress}),e.status==="success"&&e.cdnUrl&&c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-muted-foreground text-xs",children:e.cdnUrl}),c.jsx(KJ,{url:e.cdnUrl})]}),e.status==="error"&&c.jsx("span",{className:"text-red-500 text-xs",children:e.error})]})})}function eee({uploads:e,onFilesSelected:t,onRemoveUpload:n}){const[r,i]=w.useState(!1),o=w.useRef(null),l=v=>{v.preventDefault(),i(!0)},u=v=>{v.preventDefault(),i(!1)},d=v=>{v.preventDefault(),i(!1),v.dataTransfer.files.length>0&&t(v.dataTransfer.files)},h=v=>{v.target.files&&v.target.files.length>0&&t(v.target.files)};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Upload Files"}),c.jsx(We,{children:"Drag and drop files or click to browse"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:`cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors ${r?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50"}`,onClick:()=>{var v;return(v=o.current)==null?void 0:v.click()},onDragLeave:u,onDragOver:l,onDrop:d,children:[c.jsx(Yu,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"mb-1 font-medium text-sm",children:"Drop files here or click to upload"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Images will be optimized before uploading"}),c.jsx("input",{accept:"*/*",className:"hidden",multiple:!0,onChange:h,ref:o,type:"file"})]}),e.length>0&&c.jsx("div",{className:"space-y-2",children:e.map((v,m)=>c.jsx(JJ,{onRemove:()=>n(m),upload:v},`${v.filename}-${m}`))})]})]})}function tee(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),[l,u]=w.useState(()=>{if(typeof window<"u"){const q=localStorage.getItem("cdn-library-view-mode");if(q==="grid"||q==="table")return q}return"grid"}),d=w.useCallback(q=>{u(q),localStorage.setItem("cdn-library-view-mode",q)},[]),[h,v]=w.useState(""),[m,g]=w.useState({starred:!1,formats:[]}),[b,O]=w.useState([]),[S,x]=w.useState(null),[E,N]=w.useState(!1),[_,C]=w.useState([]),[A,M]=w.useState({keys:[],isOpen:!1}),[R,D]=w.useState([]),[z,G]=w.useState(!1),L=w.useCallback(async()=>{try{r(!0),o(null);const q=sessionStorage.getItem("wraps-auth-token"),U=await fetch(`/api/cdn/files?token=${q}`);if(!U.ok){if(U.status===404){t(null);return}throw new Error("Failed to fetch storage files")}const ne=await U.json();t(ne)}catch(q){o(q instanceof Error?q.message:"An error occurred")}finally{r(!1)}},[]);w.useEffect(()=>{L()},[L]);const F=w.useCallback(async(q,U)=>{const ne=sessionStorage.getItem("wraps-auth-token");try{if(!(await fetch(`/api/cdn/files/${encodeURIComponent(q)}/star?token=${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred:U})})).ok)throw new Error("Failed to update star status");t(ie=>ie&&{...ie,files:ie.files.map(pe=>pe.key===q?{...pe,starred:U}:pe)}),(S==null?void 0:S.key)===q&&x(ie=>ie?{...ie,starred:U}:null),Ot.success(U?"File starred":"Star removed")}catch{Ot.error("Failed to update star status")}},[S]),W=w.useCallback(async q=>{const U=sessionStorage.getItem("wraps-auth-token");try{await Promise.all(q.map(ne=>fetch(`/api/cdn/files/${encodeURIComponent(ne)}?token=${U}`,{method:"DELETE"}))),Ot.success(q.length===1?"File deleted":`${q.length} files deleted`),O([]),x(null),L()}catch{Ot.error("Failed to delete file(s)")}},[L]),Q=w.useCallback(async(q,U,ne)=>{const fe=sessionStorage.getItem("wraps-auth-token"),ie=q instanceof File,pe=ne||(ie?q.name:"file"),re=q.type||"application/octet-stream";try{C(ke=>ke.map((we,ze)=>ze===U?{...we,status:"uploading",progress:0}:we));const ve=await fetch(`/api/cdn/upload-url?token=${fe}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:pe,contentType:re})});if(!ve.ok)throw new Error("Failed to get upload URL");const{uploadUrl:ge,cdnUrl:oe}=await ve.json();await new Promise((ke,we)=>{const ze=new XMLHttpRequest;ze.upload.addEventListener("progress",Ze=>{if(Ze.lengthComputable){const lt=Math.round(Ze.loaded/Ze.total*100);C(tn=>tn.map((pt,fr)=>fr===U?{...pt,progress:lt}:pt))}}),ze.addEventListener("load",()=>{ze.status>=200&&ze.status<300?ke():we(new Error(`Upload failed with status ${ze.status}`))}),ze.addEventListener("error",()=>we(new Error("Upload failed"))),ze.open("PUT",ge),ze.setRequestHeader("Content-Type",re),ze.send(q)}),C(ke=>ke.map((we,ze)=>ze===U?{...we,status:"success",progress:100,cdnUrl:oe}:we)),Ot.success(`Uploaded ${pe}`),L()}catch(ve){C(ge=>ge.map((oe,ke)=>ke===U?{...oe,status:"error",error:ve instanceof Error?ve.message:"Upload failed"}:oe)),Ot.error(`Failed to upload ${pe}`)}},[L]),X=w.useCallback(q=>{const U=Array.from(q),ne=U.filter(ie=>ie.type.startsWith("image/")),fe=U.filter(ie=>!ie.type.startsWith("image/"));if(fe.length>0){const ie=fe.map(re=>({file:re,filename:re.name,progress:0,status:"pending"}));C(re=>[...re,...ie]),N(!0);const pe=_.length;fe.forEach((re,ve)=>{Q(re,pe+ve,re.name)})}ne.length>0&&(D(ne),G(!0))},[_.length,Q]),k=w.useCallback(q=>{if(!q||q.length===0)return;const U=_.length,ne=q.map(fe=>({file:fe.file,filename:fe.cdnFilename,progress:0,status:"pending"}));C(fe=>[...fe,...ne]),N(!0),q.forEach((fe,ie)=>{Q(fe.file,U+ie,fe.cdnFilename)})},[_.length,Q]),H=w.useMemo(()=>e!=null&&e.files?e.files.filter(q=>{var U;if(h&&!q.key.toLowerCase().includes(h.toLowerCase())||m.starred&&!q.starred)return!1;if(m.formats.length>0){const ne=((U=q.key.split(".").pop())==null?void 0:U.toLowerCase())||"";if(!m.formats.includes(ne))return!1}return!0}):[],[e==null?void 0:e.files,h,m]),B=w.useCallback(q=>{O(U=>U.includes(q)?U.filter(ne=>ne!==q):[...U,q])},[]),Z=w.useCallback(()=>{if(!(e!=null&&e.files))return;const q=H.map(U=>U.key);b.length===q.length?O([]):O(q)},[e==null?void 0:e.files,b.length,H]),le=w.useCallback(async()=>{await Promise.all(b.map(q=>F(q,!0))),O([])},[b,F]),$=w.useCallback(()=>{M({keys:b,isOpen:!0})},[b]),Y=w.useMemo(()=>{if(!(e!=null&&e.files))return[];const q=new Set;return e.files.forEach(U=>{var fe;const ne=(fe=U.key.split(".").pop())==null?void 0:fe.toLowerCase();ne&&q.add(ne)}),Array.from(q).sort()},[e==null?void 0:e.files]);return n?c.jsx(XJ,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"CDN Library"}),c.jsx("p",{className:"text-muted-foreground",children:e.fileCount>0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground",children:e.fileCount})," File",e.fileCount!==1?"s":""," · Total"," ",c.jsx("span",{className:"text-foreground",children:WJ(e.totalSize)})]}):"Manage and organize your files"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ce,{onClick:L,size:"icon",variant:"outline",children:c.jsx(Bf,{className:"h-4 w-4"})}),c.jsxs(Ce,{onClick:()=>N(!E),children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]}),E&&c.jsx(eee,{onFilesSelected:X,onRemoveUpload:q=>C(U=>U.filter((ne,fe)=>fe!==q)),uploads:_}),e.files.length>0&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.length>0&&c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-r px-2.5 py-1.5 font-medium text-sm",children:[b.length," selected"]}),c.jsx(iv,{className:"rounded-none border-0",label:"Star",onToggle:le,size:"sm"}),c.jsx(KI,{className:"rounded-none border-0 border-l",label:"Delete",onDelete:$,size:"sm",variant:"ghost"}),c.jsx(Ce,{className:"rounded-l-none border-0 border-l",onClick:()=>O([]),size:"sm",variant:"ghost",children:c.jsx(or,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"relative min-w-[200px] flex-1",children:[c.jsx(Pp,{className:"-translate-y-1/2 absolute top-1/2 left-3 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-9",onChange:q=>v(q.target.value),placeholder:"Search files...",type:"search",value:h})]}),c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs(Ce,{className:"rounded-r-none border-0",onClick:()=>g({...m,starred:!m.starred}),size:"sm",variant:m.starred?"secondary":"ghost",children:[c.jsx(g$,{className:`mr-1.5 h-4 w-4 ${m.starred?"fill-current":""}`}),"Starred"]}),Y.length>0&&c.jsxs(sI,{children:[c.jsx(lI,{asChild:!0,children:c.jsxs(Ce,{className:"rounded-l-none border-0 border-l",size:"sm",variant:"ghost",children:[c.jsx(NF,{className:"mr-1.5 h-4 w-4"}),"Formats",m.formats.length>0&&c.jsx(qe,{className:"ml-1.5 px-1.5 py-0 text-xs",variant:"secondary",children:m.formats.length})]})}),c.jsxs(cI,{align:"end",className:"w-48",children:[c.jsx(uI,{children:"File Format"}),c.jsx(rS,{}),Y.map(q=>c.jsx(rW,{checked:m.formats.includes(q),onCheckedChange:U=>{g({...m,formats:U?[...m.formats,q]:m.formats.filter(ne=>ne!==q)})},children:q.toUpperCase()},q))]})]})]}),c.jsxs(YJ,{className:"rounded-lg border",onValueChange:q=>q&&d(q),type:"single",value:l,children:[c.jsx(aT,{"aria-label":"Grid view",className:"rounded-r-none border-0",value:"grid",children:c.jsx(AF,{className:"h-4 w-4"})}),c.jsx(aT,{"aria-label":"Table view",className:"rounded-l-none border-0 border-l",value:"table",children:c.jsx(TF,{className:"h-4 w-4"})})]})]}),e.files.length===0?c.jsx(ZJ,{onUploadClick:()=>N(!0)}):H.length===0?c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"No files match your search or filters"}):l==="grid"?c.jsx(yQ,{files:H,onFileClick:x,onSelectFile:B,onToggleStar:F,selectedFiles:b}):c.jsx(kQ,{files:H,onFileClick:x,onSelectAll:Z,onSelectFile:B,onToggleStar:F,selectedFiles:b}),S&&c.jsx(uQ,{file:S,onClose:()=>x(null),onDelete:q=>{M({keys:[q],isOpen:!0})},onToggleStar:F}),c.jsx(Sm,{onOpenChange:q=>M(U=>({...U,isOpen:q})),open:A.isOpen,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsxs(_m,{children:["Delete File",A.keys.length>1?"s":""]}),c.jsxs(Nm,{children:["Are you sure you want to delete"," ",A.keys.length===1?c.jsx("strong",{children:A.keys[0].split("/").pop()}):c.jsxs("strong",{children:[A.keys.length," files"]}),"? This action cannot be undone."]})]}),c.jsxs(Em,{children:[c.jsx(Cm,{children:"Cancel"}),c.jsx(Am,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{W(A.keys),M({keys:[],isOpen:!1})},children:"Delete"})]})]})}),c.jsx(yJ,{files:R,onClose:()=>{G(!1),D([])},onComplete:k,open:z})]}):c.jsx(QJ,{})}var Ub,iT;function Vn(){if(iT)return Ub;iT=1;var e=Array.isArray;return Ub=e,Ub}var Hb,oT;function HL(){if(oT)return Hb;oT=1;var e=typeof gh=="object"&&gh&&gh.Object===Object&&gh;return Hb=e,Hb}var Fb,sT;function Oa(){if(sT)return Fb;sT=1;var e=HL(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Fb=n,Fb}var Gb,lT;function Wf(){if(lT)return Gb;lT=1;var e=Oa(),t=e.Symbol;return Gb=t,Gb}var Vb,cT;function nee(){if(cT)return Vb;cT=1;var e=Wf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(l){var u=n.call(l,i),d=l[i];try{l[i]=void 0;var h=!0}catch{}var v=r.call(l);return h&&(u?l[i]=d:delete l[i]),v}return Vb=o,Vb}var Yb,uT;function ree(){if(uT)return Yb;uT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Yb=n,Yb}var Wb,fT;function hi(){if(fT)return Wb;fT=1;var e=Wf(),t=nee(),n=ree(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?i:r:o&&o in Object(u)?t(u):n(u)}return Wb=l,Wb}var Kb,dT;function mi(){if(dT)return Kb;dT=1;function e(t){return t!=null&&typeof t=="object"}return Kb=e,Kb}var Xb,hT;function yc(){if(hT)return Xb;hT=1;var e=hi(),t=mi(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return Xb=r,Xb}var Qb,mT;function FO(){if(mT)return Qb;mT=1;var e=Vn(),t=yc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return Qb=i,Qb}var Zb,pT;function uo(){if(pT)return Zb;pT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Zb=e,Zb}var Jb,vT;function GO(){if(vT)return Jb;vT=1;var e=hi(),t=uo(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==i||d==n||d==o}return Jb=l,Jb}var ex,gT;function aee(){if(gT)return ex;gT=1;var e=Oa(),t=e["__core-js_shared__"];return ex=t,ex}var tx,yT;function iee(){if(yT)return tx;yT=1;var e=aee(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return tx=n,tx}var nx,bT;function FL(){if(bT)return nx;bT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return nx=n,nx}var rx,xT;function oee(){if(xT)return rx;xT=1;var e=GO(),t=iee(),n=uo(),r=FL(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,v=RegExp("^"+d.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var b=e(g)?v:o;return b.test(r(g))}return rx=m,rx}var ax,wT;function see(){if(wT)return ax;wT=1;function e(t,n){return t==null?void 0:t[n]}return ax=e,ax}var ix,ST;function ms(){if(ST)return ix;ST=1;var e=oee(),t=see();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return ix=n,ix}var ox,jT;function wv(){if(jT)return ox;jT=1;var e=ms(),t=e(Object,"create");return ox=t,ox}var sx,OT;function lee(){if(OT)return sx;OT=1;var e=wv();function t(){this.__data__=e?e(null):{},this.size=0}return sx=t,sx}var lx,ET;function cee(){if(ET)return lx;ET=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return lx=e,lx}var cx,_T;function uee(){if(_T)return cx;_T=1;var e=wv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return r.call(l,o)?l[o]:void 0}return cx=i,cx}var ux,NT;function fee(){if(NT)return ux;NT=1;var e=wv(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return ux=r,ux}var fx,AT;function dee(){if(AT)return fx;AT=1;var e=wv(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return fx=n,fx}var dx,CT;function hee(){if(CT)return dx;CT=1;var e=lee(),t=cee(),n=uee(),r=fee(),i=dee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,dx=o,dx}var hx,TT;function mee(){if(TT)return hx;TT=1;function e(){this.__data__=[],this.size=0}return hx=e,hx}var mx,MT;function VO(){if(MT)return mx;MT=1;function e(t,n){return t===n||t!==t&&n!==n}return mx=e,mx}var px,RT;function Sv(){if(RT)return px;RT=1;var e=VO();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return px=t,px}var vx,DT;function pee(){if(DT)return vx;DT=1;var e=Sv(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,l=e(o,i);if(l<0)return!1;var u=o.length-1;return l==u?o.pop():n.call(o,l,1),--this.size,!0}return vx=r,vx}var gx,PT;function vee(){if(PT)return gx;PT=1;var e=Sv();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return gx=t,gx}var yx,kT;function gee(){if(kT)return yx;kT=1;var e=Sv();function t(n){return e(this.__data__,n)>-1}return yx=t,yx}var bx,$T;function yee(){if($T)return bx;$T=1;var e=Sv();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return bx=t,bx}var xx,IT;function jv(){if(IT)return xx;IT=1;var e=mee(),t=pee(),n=vee(),r=gee(),i=yee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,xx=o,xx}var wx,LT;function YO(){if(LT)return wx;LT=1;var e=ms(),t=Oa(),n=e(t,"Map");return wx=n,wx}var Sx,zT;function bee(){if(zT)return Sx;zT=1;var e=hee(),t=jv(),n=YO();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Sx=r,Sx}var jx,BT;function xee(){if(BT)return jx;BT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return jx=e,jx}var Ox,qT;function Ov(){if(qT)return Ox;qT=1;var e=xee();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Ox=t,Ox}var Ex,UT;function wee(){if(UT)return Ex;UT=1;var e=Ov();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Ex=t,Ex}var _x,HT;function See(){if(HT)return _x;HT=1;var e=Ov();function t(n){return e(this,n).get(n)}return _x=t,_x}var Nx,FT;function jee(){if(FT)return Nx;FT=1;var e=Ov();function t(n){return e(this,n).has(n)}return Nx=t,Nx}var Ax,GT;function Oee(){if(GT)return Ax;GT=1;var e=Ov();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ax=t,Ax}var Cx,VT;function WO(){if(VT)return Cx;VT=1;var e=bee(),t=wee(),n=See(),r=jee(),i=Oee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Cx=o,Cx}var Tx,YT;function GL(){if(YT)return Tx;YT=1;var e=WO(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var l=arguments,u=i?i.apply(this,l):l[0],d=o.cache;if(d.has(u))return d.get(u);var h=r.apply(this,l);return o.cache=d.set(u,h)||d,h};return o.cache=new(n.Cache||e),o}return n.Cache=e,Tx=n,Tx}var Mx,WT;function Eee(){if(WT)return Mx;WT=1;var e=GL(),t=500;function n(r){var i=e(r,function(l){return o.size===t&&o.clear(),l}),o=i.cache;return i}return Mx=n,Mx}var Rx,KT;function _ee(){if(KT)return Rx;KT=1;var e=Eee(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(l,u,d,h){o.push(d?h.replace(n,"$1"):u||l)}),o});return Rx=r,Rx}var Dx,XT;function KO(){if(XT)return Dx;XT=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return Dx=e,Dx}var Px,QT;function Nee(){if(QT)return Px;QT=1;var e=Wf(),t=KO(),n=Vn(),r=yc(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function l(u){if(typeof u=="string")return u;if(n(u))return t(u,l)+"";if(r(u))return o?o.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d}return Px=l,Px}var kx,ZT;function VL(){if(ZT)return kx;ZT=1;var e=Nee();function t(n){return n==null?"":e(n)}return kx=t,kx}var $x,JT;function YL(){if(JT)return $x;JT=1;var e=Vn(),t=FO(),n=_ee(),r=VL();function i(o,l){return e(o)?o:t(o,l)?[o]:n(r(o))}return $x=i,$x}var Ix,eM;function Ev(){if(eM)return Ix;eM=1;var e=yc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Ix=t,Ix}var Lx,tM;function XO(){if(tM)return Lx;tM=1;var e=YL(),t=Ev();function n(r,i){i=e(i,r);for(var o=0,l=i.length;r!=null&&o<l;)r=r[t(i[o++])];return o&&o==l?r:void 0}return Lx=n,Lx}var zx,nM;function WL(){if(nM)return zx;nM=1;var e=XO();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return zx=t,zx}var Aee=WL();const Mr=xt(Aee);var Bx,rM;function Cee(){if(rM)return Bx;rM=1;function e(t){return t==null}return Bx=e,Bx}var Tee=Cee();const Qe=xt(Tee);var qx,aM;function Mee(){if(aM)return qx;aM=1;var e=hi(),t=Vn(),n=mi(),r="[object String]";function i(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return qx=i,qx}var Ree=Mee();const ns=xt(Ree);var Dee=GO();const Ye=xt(Dee);var Pee=uo();const bc=xt(Pee);var Ux={exports:{}},ct={};/**
|
|
428
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},TJ=jL,MJ=OL,RJ=EL,DJ=_L,PJ=ML,kJ=DL,$J=AL,IJ=TL;function Sm({...e}){return c.jsx(TJ,{"data-slot":"alert-dialog",...e})}function LJ({...e}){return c.jsx(MJ,{"data-slot":"alert-dialog-portal",...e})}function zJ({className:e,...t}){return c.jsx(RJ,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),"data-slot":"alert-dialog-overlay",...t})}function jm({className:e,...t}){return c.jsxs(LJ,{children:[c.jsx(zJ,{}),c.jsx(DJ,{className:me("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),"data-slot":"alert-dialog-content",...t})]})}function Om({className:e,...t}){return c.jsx("div",{className:me("flex flex-col gap-2 text-center sm:text-left",e),"data-slot":"alert-dialog-header",...t})}function Em({className:e,...t}){return c.jsx("div",{className:me("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),"data-slot":"alert-dialog-footer",...t})}function _m({className:e,...t}){return c.jsx($J,{className:me("font-semibold text-lg",e),"data-slot":"alert-dialog-title",...t})}function Nm({className:e,...t}){return c.jsx(IJ,{className:me("text-muted-foreground text-sm",e),"data-slot":"alert-dialog-description",...t})}function Am({className:e,...t}){return c.jsx(PJ,{className:me(xO(),e),...t})}function Cm({className:e,...t}){return c.jsx(kJ,{className:me(xO({variant:"outline"}),e),...t})}var PL="Toggle",kL=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...o}=e,[l,u]=Nn({prop:n,onChange:i,defaultProp:r??!1,caller:PL});return c.jsx(Ne.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...o,ref:t,onClick:ye(e.onClick,()=>{e.disabled||u(!l)})})});kL.displayName=PL;var co="ToggleGroup",[$L]=jn(co,[hc]),IL=hc(),HO=I.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const i=r;return c.jsx(BJ,{...i,ref:t})}if(n==="multiple"){const i=r;return c.jsx(qJ,{...i,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${co}\``)});HO.displayName=co;var[LL,zL]=$L(co),BJ=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,u]=Nn({prop:n,defaultProp:r??"",onChange:i,caller:co});return c.jsx(LL,{scope:e.__scopeToggleGroup,type:"single",value:I.useMemo(()=>l?[l]:[],[l]),onItemActivate:u,onItemDeactivate:I.useCallback(()=>u(""),[u]),children:c.jsx(BL,{...o,ref:t})})}),qJ=I.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[l,u]=Nn({prop:n,defaultProp:r??[],onChange:i,caller:co}),d=I.useCallback(v=>u((m=[])=>[...m,v]),[u]),h=I.useCallback(v=>u((m=[])=>m.filter(g=>g!==v)),[u]);return c.jsx(LL,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:d,onItemDeactivate:h,children:c.jsx(BL,{...o,ref:t})})});HO.displayName=co;var[UJ,HJ]=$L(co),BL=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:o,dir:l,loop:u=!0,...d}=e,h=IL(n),v=lc(l),m={role:"group",dir:v,...d};return c.jsx(UJ,{scope:n,rovingFocus:i,disabled:r,children:i?c.jsx(uO,{asChild:!0,...h,orientation:o,dir:v,loop:u,children:c.jsx(Ne.div,{...m,ref:t})}):c.jsx(Ne.div,{...m,ref:t})})}),Tm="ToggleGroupItem",qL=I.forwardRef((e,t)=>{const n=zL(Tm,e.__scopeToggleGroup),r=HJ(Tm,e.__scopeToggleGroup),i=IL(e.__scopeToggleGroup),o=n.value.includes(e.value),l=r.disabled||e.disabled,u={...e,pressed:o,disabled:l},d=I.useRef(null);return r.rovingFocus?c.jsx(fO,{asChild:!0,...i,focusable:!l,active:o,ref:d,children:c.jsx(rT,{...u,ref:t})}):c.jsx(rT,{...u,ref:t})});qL.displayName=Tm;var rT=I.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...i}=e,o=zL(Tm,n),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=o.type==="single"?l:void 0;return c.jsx(kL,{...u,...i,ref:t,onPressedChange:d=>{d?o.onItemActivate(r):o.onItemDeactivate(r)}})}),FJ=HO,GJ=qL;const VJ=mc("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-none transition-[color,box-shadow] hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 min-w-9 px-2",sm:"h-8 min-w-8 px-1.5",lg:"h-10 min-w-10 px-2.5"}},defaultVariants:{variant:"default",size:"default"}}),UL=w.createContext({size:"default",variant:"default",spacing:0});function YJ({className:e,variant:t,size:n,spacing:r=0,children:i,...o}){return c.jsx(FJ,{className:me("group/toggle-group flex w-fit items-center gap-[var(--gap)] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",e),"data-size":n,"data-slot":"toggle-group","data-spacing":r,"data-variant":t,style:{"--gap":r},...o,children:c.jsx(UL.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function aT({className:e,children:t,variant:n,size:r,...i}){const o=w.useContext(UL);return c.jsx(GJ,{className:me(VJ({variant:o.variant||n,size:o.size||r}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:first:border-l data-[spacing=0]:first:rounded-l-md",e),"data-size":o.size||r,"data-slot":"toggle-group-item","data-spacing":o.spacing,"data-variant":o.variant||n,...i,children:t})}function WJ(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function KJ({url:e}){const[t,n]=w.useState(!1),r=async()=>{await navigator.clipboard.writeText(e),n(!0),Ot.success("URL copied to clipboard"),setTimeout(()=>n(!1),2e3)};return c.jsx(Ce,{onClick:r,size:"sm",variant:"outline",children:t?c.jsx(ri,{className:"h-3 w-3 text-green-500"}):c.jsx("span",{className:"text-xs",children:"Copy"})})}function XJ(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Re,{className:"mb-2 h-8 w-36"}),c.jsx(Re,{className:"h-4 w-48"})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Re,{className:"h-9 w-9"}),c.jsx(Re,{className:"h-9 w-24"})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Re,{className:"h-9 min-w-[200px] flex-1"}),c.jsx(Re,{className:"h-9 w-40"}),c.jsx(Re,{className:"h-9 w-20"})]}),c.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:[1,2,3,4,5,6,7,8,9,10,11,12].map(e=>c.jsxs("div",{className:"overflow-hidden rounded-xl bg-muted shadow-sm",children:[c.jsx(Re,{className:"aspect-square w-full"}),c.jsxs("div",{className:"space-y-2 p-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Re,{className:"h-4 w-4"}),c.jsx(Re,{className:"h-4 flex-1"})]}),c.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[c.jsx(Re,{className:"h-4 w-10"}),c.jsx(Re,{className:"h-4 w-12"})]})]})]},e))})]})}function QJ(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function ZJ({onUploadClick:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(p$,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h3",{className:"mb-2 font-semibold text-lg",children:"No Files Yet"}),c.jsx("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:"Upload your first file to get started with your CDN library"}),c.jsxs(Ce,{onClick:e,children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload Files"]})]})}function JJ({upload:e,onRemove:t}){return c.jsx("div",{className:"flex items-center gap-3 rounded-lg border bg-muted/30 p-3",children:c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsx("span",{className:"truncate font-medium text-sm",children:e.filename}),c.jsxs("div",{className:"flex items-center gap-2",children:[e.status==="uploading"&&c.jsx(Va,{className:"h-4 w-4 animate-spin text-primary"}),e.status==="success"&&c.jsx(ao,{className:"h-4 w-4 text-green-500"}),e.status==="error"&&c.jsx(lr,{className:"h-4 w-4 text-red-500"}),c.jsx(Ce,{className:"h-6 w-6",onClick:t,size:"icon",variant:"ghost",children:c.jsx(or,{className:"h-3 w-3"})})]})]}),e.status==="uploading"&&c.jsx(pv,{className:"h-1",value:e.progress}),e.status==="success"&&e.cdnUrl&&c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-muted-foreground text-xs",children:e.cdnUrl}),c.jsx(KJ,{url:e.cdnUrl})]}),e.status==="error"&&c.jsx("span",{className:"text-red-500 text-xs",children:e.error})]})})}function eee({uploads:e,onFilesSelected:t,onRemoveUpload:n}){const[r,i]=w.useState(!1),o=w.useRef(null),l=v=>{v.preventDefault(),i(!0)},u=v=>{v.preventDefault(),i(!1)},d=v=>{v.preventDefault(),i(!1),v.dataTransfer.files.length>0&&t(v.dataTransfer.files)},h=v=>{v.target.files&&v.target.files.length>0&&t(v.target.files)};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Upload Files"}),c.jsx(We,{children:"Drag and drop files or click to browse"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:`cursor-pointer rounded-lg border-2 border-dashed p-8 text-center transition-colors ${r?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-primary/50"}`,onClick:()=>{var v;return(v=o.current)==null?void 0:v.click()},onDragLeave:u,onDragOver:l,onDrop:d,children:[c.jsx(Yu,{className:"mx-auto mb-4 h-10 w-10 text-muted-foreground"}),c.jsx("p",{className:"mb-1 font-medium text-sm",children:"Drop files here or click to upload"}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Images will be optimized before uploading"}),c.jsx("input",{accept:"*/*",className:"hidden",multiple:!0,onChange:h,ref:o,type:"file"})]}),e.length>0&&c.jsx("div",{className:"space-y-2",children:e.map((v,m)=>c.jsx(JJ,{onRemove:()=>n(m),upload:v},`${v.filename}-${m}`))})]})]})}function tee(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),[l,u]=w.useState(()=>{if(typeof window<"u"){const q=localStorage.getItem("cdn-library-view-mode");if(q==="grid"||q==="table")return q}return"grid"}),d=w.useCallback(q=>{u(q),localStorage.setItem("cdn-library-view-mode",q)},[]),[h,v]=w.useState(""),[m,g]=w.useState({starred:!1,formats:[]}),[b,O]=w.useState([]),[S,x]=w.useState(null),[E,N]=w.useState(!1),[_,C]=w.useState([]),[A,M]=w.useState({keys:[],isOpen:!1}),[R,D]=w.useState([]),[z,G]=w.useState(!1),L=w.useCallback(async()=>{try{r(!0),o(null);const q=sessionStorage.getItem("wraps-auth-token"),U=await fetch(`/api/cdn/files?token=${q}`);if(!U.ok){if(U.status===404){t(null);return}throw new Error("Failed to fetch storage files")}const ne=await U.json();t(ne)}catch(q){o(q instanceof Error?q.message:"An error occurred")}finally{r(!1)}},[]);w.useEffect(()=>{L()},[L]);const F=w.useCallback(async(q,U)=>{const ne=sessionStorage.getItem("wraps-auth-token");try{if(!(await fetch(`/api/cdn/files/${encodeURIComponent(q)}/star?token=${ne}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({starred:U})})).ok)throw new Error("Failed to update star status");t(ie=>ie&&{...ie,files:ie.files.map(pe=>pe.key===q?{...pe,starred:U}:pe)}),(S==null?void 0:S.key)===q&&x(ie=>ie?{...ie,starred:U}:null),Ot.success(U?"File starred":"Star removed")}catch{Ot.error("Failed to update star status")}},[S]),W=w.useCallback(async q=>{const U=sessionStorage.getItem("wraps-auth-token");try{await Promise.all(q.map(ne=>fetch(`/api/cdn/files/${encodeURIComponent(ne)}?token=${U}`,{method:"DELETE"}))),Ot.success(q.length===1?"File deleted":`${q.length} files deleted`),O([]),x(null),L()}catch{Ot.error("Failed to delete file(s)")}},[L]),Q=w.useCallback(async(q,U,ne)=>{const fe=sessionStorage.getItem("wraps-auth-token"),ie=q instanceof File,pe=ne||(ie?q.name:"file"),re=q.type||"application/octet-stream";try{C(ke=>ke.map((we,ze)=>ze===U?{...we,status:"uploading",progress:0}:we));const ve=await fetch(`/api/cdn/upload-url?token=${fe}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filename:pe,contentType:re})});if(!ve.ok)throw new Error("Failed to get upload URL");const{uploadUrl:ge,cdnUrl:oe}=await ve.json();await new Promise((ke,we)=>{const ze=new XMLHttpRequest;ze.upload.addEventListener("progress",Ze=>{if(Ze.lengthComputable){const lt=Math.round(Ze.loaded/Ze.total*100);C(tn=>tn.map((pt,fr)=>fr===U?{...pt,progress:lt}:pt))}}),ze.addEventListener("load",()=>{ze.status>=200&&ze.status<300?ke():we(new Error(`Upload failed with status ${ze.status}`))}),ze.addEventListener("error",()=>we(new Error("Upload failed"))),ze.open("PUT",ge),ze.setRequestHeader("Content-Type",re),ze.send(q)}),C(ke=>ke.map((we,ze)=>ze===U?{...we,status:"success",progress:100,cdnUrl:oe}:we)),Ot.success(`Uploaded ${pe}`),L()}catch(ve){C(ge=>ge.map((oe,ke)=>ke===U?{...oe,status:"error",error:ve instanceof Error?ve.message:"Upload failed"}:oe)),Ot.error(`Failed to upload ${pe}`)}},[L]),X=w.useCallback(q=>{const U=Array.from(q),ne=U.filter(ie=>ie.type.startsWith("image/")),fe=U.filter(ie=>!ie.type.startsWith("image/"));if(fe.length>0){const ie=fe.map(re=>({file:re,filename:re.name,progress:0,status:"pending"}));C(re=>[...re,...ie]),N(!0);const pe=_.length;fe.forEach((re,ve)=>{Q(re,pe+ve,re.name)})}ne.length>0&&(D(ne),G(!0))},[_.length,Q]),k=w.useCallback(q=>{if(!q||q.length===0)return;const U=_.length,ne=q.map(fe=>({file:fe.file,filename:fe.cdnFilename,progress:0,status:"pending"}));C(fe=>[...fe,...ne]),N(!0),q.forEach((fe,ie)=>{Q(fe.file,U+ie,fe.cdnFilename)})},[_.length,Q]),H=w.useMemo(()=>e!=null&&e.files?e.files.filter(q=>{var U;if(h&&!q.key.toLowerCase().includes(h.toLowerCase())||m.starred&&!q.starred)return!1;if(m.formats.length>0){const ne=((U=q.key.split(".").pop())==null?void 0:U.toLowerCase())||"";if(!m.formats.includes(ne))return!1}return!0}):[],[e==null?void 0:e.files,h,m]),B=w.useCallback(q=>{O(U=>U.includes(q)?U.filter(ne=>ne!==q):[...U,q])},[]),Z=w.useCallback(()=>{if(!(e!=null&&e.files))return;const q=H.map(U=>U.key);b.length===q.length?O([]):O(q)},[e==null?void 0:e.files,b.length,H]),le=w.useCallback(async()=>{await Promise.all(b.map(q=>F(q,!0))),O([])},[b,F]),$=w.useCallback(()=>{M({keys:b,isOpen:!0})},[b]),Y=w.useMemo(()=>{if(!(e!=null&&e.files))return[];const q=new Set;return e.files.forEach(U=>{var fe;const ne=(fe=U.key.split(".").pop())==null?void 0:fe.toLowerCase();ne&&q.add(ne)}),Array.from(q).sort()},[e==null?void 0:e.files]);return n?c.jsx(XJ,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"CDN Library"}),c.jsx("p",{className:"text-muted-foreground",children:e.fileCount>0?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-foreground",children:e.fileCount})," File",e.fileCount!==1?"s":""," · Total"," ",c.jsx("span",{className:"text-foreground",children:WJ(e.totalSize)})]}):"Manage and organize your files"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ce,{onClick:L,size:"icon",variant:"outline",children:c.jsx(Bf,{className:"h-4 w-4"})}),c.jsxs(Ce,{onClick:()=>N(!E),children:[c.jsx(Yu,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]}),E&&c.jsx(eee,{onFilesSelected:X,onRemoveUpload:q=>C(U=>U.filter((ne,fe)=>fe!==q)),uploads:_}),e.files.length>0&&c.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b.length>0&&c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs("div",{className:"flex items-center gap-1.5 border-r px-2.5 py-1.5 font-medium text-sm",children:[b.length," selected"]}),c.jsx(iv,{className:"rounded-none border-0",label:"Star",onToggle:le,size:"sm"}),c.jsx(KI,{className:"rounded-none border-0 border-l",label:"Delete",onDelete:$,size:"sm",variant:"ghost"}),c.jsx(Ce,{className:"rounded-l-none border-0 border-l",onClick:()=>O([]),size:"sm",variant:"ghost",children:c.jsx(or,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"relative min-w-[200px] flex-1",children:[c.jsx(Pp,{className:"-translate-y-1/2 absolute top-1/2 left-3 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-9",onChange:q=>v(q.target.value),placeholder:"Search files...",type:"search",value:h})]}),c.jsxs("div",{className:"flex items-center rounded-lg border",children:[c.jsxs(Ce,{className:"rounded-r-none border-0",onClick:()=>g({...m,starred:!m.starred}),size:"sm",variant:m.starred?"secondary":"ghost",children:[c.jsx(b$,{className:`mr-1.5 h-4 w-4 ${m.starred?"fill-current":""}`}),"Starred"]}),Y.length>0&&c.jsxs(cI,{children:[c.jsx(uI,{asChild:!0,children:c.jsxs(Ce,{className:"rounded-l-none border-0 border-l",size:"sm",variant:"ghost",children:[c.jsx(AF,{className:"mr-1.5 h-4 w-4"}),"Formats",m.formats.length>0&&c.jsx(qe,{className:"ml-1.5 px-1.5 py-0 text-xs",variant:"secondary",children:m.formats.length})]})}),c.jsxs(fI,{align:"end",className:"w-48",children:[c.jsx(dI,{children:"File Format"}),c.jsx(rS,{}),Y.map(q=>c.jsx(aW,{checked:m.formats.includes(q),onCheckedChange:U=>{g({...m,formats:U?[...m.formats,q]:m.formats.filter(ne=>ne!==q)})},children:q.toUpperCase()},q))]})]})]}),c.jsxs(YJ,{className:"rounded-lg border",onValueChange:q=>q&&d(q),type:"single",value:l,children:[c.jsx(aT,{"aria-label":"Grid view",className:"rounded-r-none border-0",value:"grid",children:c.jsx(CF,{className:"h-4 w-4"})}),c.jsx(aT,{"aria-label":"Table view",className:"rounded-l-none border-0 border-l",value:"table",children:c.jsx(MF,{className:"h-4 w-4"})})]})]}),e.files.length===0?c.jsx(ZJ,{onUploadClick:()=>N(!0)}):H.length===0?c.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"No files match your search or filters"}):l==="grid"?c.jsx(yQ,{files:H,onFileClick:x,onSelectFile:B,onToggleStar:F,selectedFiles:b}):c.jsx(kQ,{files:H,onFileClick:x,onSelectAll:Z,onSelectFile:B,onToggleStar:F,selectedFiles:b}),S&&c.jsx(uQ,{file:S,onClose:()=>x(null),onDelete:q=>{M({keys:[q],isOpen:!0})},onToggleStar:F}),c.jsx(Sm,{onOpenChange:q=>M(U=>({...U,isOpen:q})),open:A.isOpen,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsxs(_m,{children:["Delete File",A.keys.length>1?"s":""]}),c.jsxs(Nm,{children:["Are you sure you want to delete"," ",A.keys.length===1?c.jsx("strong",{children:A.keys[0].split("/").pop()}):c.jsxs("strong",{children:[A.keys.length," files"]}),"? This action cannot be undone."]})]}),c.jsxs(Em,{children:[c.jsx(Cm,{children:"Cancel"}),c.jsx(Am,{className:"bg-red-600 hover:bg-red-700",onClick:()=>{W(A.keys),M({keys:[],isOpen:!1})},children:"Delete"})]})]})}),c.jsx(yJ,{files:R,onClose:()=>{G(!1),D([])},onComplete:k,open:z})]}):c.jsx(QJ,{})}var Ub,iT;function Vn(){if(iT)return Ub;iT=1;var e=Array.isArray;return Ub=e,Ub}var Hb,oT;function HL(){if(oT)return Hb;oT=1;var e=typeof gh=="object"&&gh&&gh.Object===Object&&gh;return Hb=e,Hb}var Fb,sT;function Oa(){if(sT)return Fb;sT=1;var e=HL(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Fb=n,Fb}var Gb,lT;function Wf(){if(lT)return Gb;lT=1;var e=Oa(),t=e.Symbol;return Gb=t,Gb}var Vb,cT;function nee(){if(cT)return Vb;cT=1;var e=Wf(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function o(l){var u=n.call(l,i),d=l[i];try{l[i]=void 0;var h=!0}catch{}var v=r.call(l);return h&&(u?l[i]=d:delete l[i]),v}return Vb=o,Vb}var Yb,uT;function ree(){if(uT)return Yb;uT=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return Yb=n,Yb}var Wb,fT;function hi(){if(fT)return Wb;fT=1;var e=Wf(),t=nee(),n=ree(),r="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?i:r:o&&o in Object(u)?t(u):n(u)}return Wb=l,Wb}var Kb,dT;function mi(){if(dT)return Kb;dT=1;function e(t){return t!=null&&typeof t=="object"}return Kb=e,Kb}var Xb,hT;function yc(){if(hT)return Xb;hT=1;var e=hi(),t=mi(),n="[object Symbol]";function r(i){return typeof i=="symbol"||t(i)&&e(i)==n}return Xb=r,Xb}var Qb,mT;function FO(){if(mT)return Qb;mT=1;var e=Vn(),t=yc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return Qb=i,Qb}var Zb,pT;function uo(){if(pT)return Zb;pT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return Zb=e,Zb}var Jb,vT;function GO(){if(vT)return Jb;vT=1;var e=hi(),t=uo(),n="[object AsyncFunction]",r="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==i||d==n||d==o}return Jb=l,Jb}var ex,gT;function aee(){if(gT)return ex;gT=1;var e=Oa(),t=e["__core-js_shared__"];return ex=t,ex}var tx,yT;function iee(){if(yT)return tx;yT=1;var e=aee(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return tx=n,tx}var nx,bT;function FL(){if(bT)return nx;bT=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return nx=n,nx}var rx,xT;function oee(){if(xT)return rx;xT=1;var e=GO(),t=iee(),n=uo(),r=FL(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,v=RegExp("^"+d.call(h).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(g){if(!n(g)||t(g))return!1;var b=e(g)?v:o;return b.test(r(g))}return rx=m,rx}var ax,wT;function see(){if(wT)return ax;wT=1;function e(t,n){return t==null?void 0:t[n]}return ax=e,ax}var ix,ST;function ms(){if(ST)return ix;ST=1;var e=oee(),t=see();function n(r,i){var o=t(r,i);return e(o)?o:void 0}return ix=n,ix}var ox,jT;function wv(){if(jT)return ox;jT=1;var e=ms(),t=e(Object,"create");return ox=t,ox}var sx,OT;function lee(){if(OT)return sx;OT=1;var e=wv();function t(){this.__data__=e?e(null):{},this.size=0}return sx=t,sx}var lx,ET;function cee(){if(ET)return lx;ET=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return lx=e,lx}var cx,_T;function uee(){if(_T)return cx;_T=1;var e=wv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function i(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return r.call(l,o)?l[o]:void 0}return cx=i,cx}var ux,NT;function fee(){if(NT)return ux;NT=1;var e=wv(),t=Object.prototype,n=t.hasOwnProperty;function r(i){var o=this.__data__;return e?o[i]!==void 0:n.call(o,i)}return ux=r,ux}var fx,AT;function dee(){if(AT)return fx;AT=1;var e=wv(),t="__lodash_hash_undefined__";function n(r,i){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&i===void 0?t:i,this}return fx=n,fx}var dx,CT;function hee(){if(CT)return dx;CT=1;var e=lee(),t=cee(),n=uee(),r=fee(),i=dee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,dx=o,dx}var hx,TT;function mee(){if(TT)return hx;TT=1;function e(){this.__data__=[],this.size=0}return hx=e,hx}var mx,MT;function VO(){if(MT)return mx;MT=1;function e(t,n){return t===n||t!==t&&n!==n}return mx=e,mx}var px,RT;function Sv(){if(RT)return px;RT=1;var e=VO();function t(n,r){for(var i=n.length;i--;)if(e(n[i][0],r))return i;return-1}return px=t,px}var vx,DT;function pee(){if(DT)return vx;DT=1;var e=Sv(),t=Array.prototype,n=t.splice;function r(i){var o=this.__data__,l=e(o,i);if(l<0)return!1;var u=o.length-1;return l==u?o.pop():n.call(o,l,1),--this.size,!0}return vx=r,vx}var gx,PT;function vee(){if(PT)return gx;PT=1;var e=Sv();function t(n){var r=this.__data__,i=e(r,n);return i<0?void 0:r[i][1]}return gx=t,gx}var yx,kT;function gee(){if(kT)return yx;kT=1;var e=Sv();function t(n){return e(this.__data__,n)>-1}return yx=t,yx}var bx,$T;function yee(){if($T)return bx;$T=1;var e=Sv();function t(n,r){var i=this.__data__,o=e(i,n);return o<0?(++this.size,i.push([n,r])):i[o][1]=r,this}return bx=t,bx}var xx,IT;function jv(){if(IT)return xx;IT=1;var e=mee(),t=pee(),n=vee(),r=gee(),i=yee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,xx=o,xx}var wx,LT;function YO(){if(LT)return wx;LT=1;var e=ms(),t=Oa(),n=e(t,"Map");return wx=n,wx}var Sx,zT;function bee(){if(zT)return Sx;zT=1;var e=hee(),t=jv(),n=YO();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return Sx=r,Sx}var jx,BT;function xee(){if(BT)return jx;BT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return jx=e,jx}var Ox,qT;function Ov(){if(qT)return Ox;qT=1;var e=xee();function t(n,r){var i=n.__data__;return e(r)?i[typeof r=="string"?"string":"hash"]:i.map}return Ox=t,Ox}var Ex,UT;function wee(){if(UT)return Ex;UT=1;var e=Ov();function t(n){var r=e(this,n).delete(n);return this.size-=r?1:0,r}return Ex=t,Ex}var _x,HT;function See(){if(HT)return _x;HT=1;var e=Ov();function t(n){return e(this,n).get(n)}return _x=t,_x}var Nx,FT;function jee(){if(FT)return Nx;FT=1;var e=Ov();function t(n){return e(this,n).has(n)}return Nx=t,Nx}var Ax,GT;function Oee(){if(GT)return Ax;GT=1;var e=Ov();function t(n,r){var i=e(this,n),o=i.size;return i.set(n,r),this.size+=i.size==o?0:1,this}return Ax=t,Ax}var Cx,VT;function WO(){if(VT)return Cx;VT=1;var e=bee(),t=wee(),n=See(),r=jee(),i=Oee();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u<d;){var h=l[u];this.set(h[0],h[1])}}return o.prototype.clear=e,o.prototype.delete=t,o.prototype.get=n,o.prototype.has=r,o.prototype.set=i,Cx=o,Cx}var Tx,YT;function GL(){if(YT)return Tx;YT=1;var e=WO(),t="Expected a function";function n(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new TypeError(t);var o=function(){var l=arguments,u=i?i.apply(this,l):l[0],d=o.cache;if(d.has(u))return d.get(u);var h=r.apply(this,l);return o.cache=d.set(u,h)||d,h};return o.cache=new(n.Cache||e),o}return n.Cache=e,Tx=n,Tx}var Mx,WT;function Eee(){if(WT)return Mx;WT=1;var e=GL(),t=500;function n(r){var i=e(r,function(l){return o.size===t&&o.clear(),l}),o=i.cache;return i}return Mx=n,Mx}var Rx,KT;function _ee(){if(KT)return Rx;KT=1;var e=Eee(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,r=e(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(t,function(l,u,d,h){o.push(d?h.replace(n,"$1"):u||l)}),o});return Rx=r,Rx}var Dx,XT;function KO(){if(XT)return Dx;XT=1;function e(t,n){for(var r=-1,i=t==null?0:t.length,o=Array(i);++r<i;)o[r]=n(t[r],r,t);return o}return Dx=e,Dx}var Px,QT;function Nee(){if(QT)return Px;QT=1;var e=Wf(),t=KO(),n=Vn(),r=yc(),i=e?e.prototype:void 0,o=i?i.toString:void 0;function l(u){if(typeof u=="string")return u;if(n(u))return t(u,l)+"";if(r(u))return o?o.call(u):"";var d=u+"";return d=="0"&&1/u==-1/0?"-0":d}return Px=l,Px}var kx,ZT;function VL(){if(ZT)return kx;ZT=1;var e=Nee();function t(n){return n==null?"":e(n)}return kx=t,kx}var $x,JT;function YL(){if(JT)return $x;JT=1;var e=Vn(),t=FO(),n=_ee(),r=VL();function i(o,l){return e(o)?o:t(o,l)?[o]:n(r(o))}return $x=i,$x}var Ix,eM;function Ev(){if(eM)return Ix;eM=1;var e=yc();function t(n){if(typeof n=="string"||e(n))return n;var r=n+"";return r=="0"&&1/n==-1/0?"-0":r}return Ix=t,Ix}var Lx,tM;function XO(){if(tM)return Lx;tM=1;var e=YL(),t=Ev();function n(r,i){i=e(i,r);for(var o=0,l=i.length;r!=null&&o<l;)r=r[t(i[o++])];return o&&o==l?r:void 0}return Lx=n,Lx}var zx,nM;function WL(){if(nM)return zx;nM=1;var e=XO();function t(n,r,i){var o=n==null?void 0:e(n,r);return o===void 0?i:o}return zx=t,zx}var Aee=WL();const Mr=xt(Aee);var Bx,rM;function Cee(){if(rM)return Bx;rM=1;function e(t){return t==null}return Bx=e,Bx}var Tee=Cee();const Qe=xt(Tee);var qx,aM;function Mee(){if(aM)return qx;aM=1;var e=hi(),t=Vn(),n=mi(),r="[object String]";function i(o){return typeof o=="string"||!t(o)&&n(o)&&e(o)==r}return qx=i,qx}var Ree=Mee();const ns=xt(Ree);var Dee=GO();const Ye=xt(Dee);var Pee=uo();const bc=xt(Pee);var Ux={exports:{}},ct={};/**
|
|
429
429
|
* @license React
|
|
430
430
|
* react-is.production.min.js
|
|
431
431
|
*
|
|
@@ -493,5 +493,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
493
493
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tpe(e,t){if(e){if(typeof e=="string")return Cj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Cj(e,t)}}function Mpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Rpe(e){if(Array.isArray(e))return Cj(e)}function Cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,$6(r.key),r)}}function Ppe(e,t,n){return t&&R4(e.prototype,t),n&&R4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function kpe(e,t,n){return t=Op(t),$pe(e,k6()?Reflect.construct(t,n||[],Op(e).constructor):t.apply(e,n))}function $pe(e,t){if(t&&(Xl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ipe(e)}function Ipe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function k6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(k6=function(){return!!e})()}function Op(e){return Op=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Op(e)}function Lpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Tj(e,t)}function Tj(e,t){return Tj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Tj(e,t)}function Fr(e,t,n){return t=$6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $6(e){var t=zpe(e,"string");return Xl(t)=="symbol"?t:t+""}function zpe(e,t){if(Xl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Nr=(function(e){function t(){var n;Dpe(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=kpe(this,t,[].concat(i)),Fr(n,"state",{isAnimationFinished:!0,totalLength:0}),Fr(n,"generateSimpleStrokeDasharray",function(l,u){return"".concat(u,"px ").concat(l-u,"px")}),Fr(n,"getStrokeDasharray",function(l,u,d){var h=d.reduce(function(E,N){return E+N});if(!h)return n.generateSimpleStrokeDasharray(u,l);for(var v=Math.floor(l/h),m=l%h,g=u-l,b=[],O=0,S=0;O<d.length;S+=d[O],++O)if(S+d[O]>m){b=[].concat(pl(d.slice(0,O)),[m-S]);break}var x=b.length%2===0?[0,g]:[g];return[].concat(pl(t.repeat(d,v)),pl(b),x).map(function(E){return"".concat(E,"px")}).join(", ")}),Fr(n,"id",Xf("recharts-line-")),Fr(n,"pathRef",function(l){n.mainCurve=l}),Fr(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Fr(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return Lpe(t,e),Ppe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,u=o.xAxis,d=o.yAxis,h=o.layout,v=o.children,m=Rr(v,nd);if(!m)return null;var g=function(S,x){return{x:S.x,y:S.y,value:S.value,errorVal:cr(S.payload,x)}},b={clipPath:r?"url(#clipPath-".concat(i,")"):null};return I.createElement(Bt,b,m.map(function(O){return I.cloneElement(O,{key:"bar-".concat(O.props.dataKey),data:l,xAxis:u,yAxis:d,layout:h,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,i,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,h=u.points,v=u.dataKey,m=nt(this.props,!1),g=nt(d,!0),b=h.map(function(S,x){var E=tr(tr(tr({key:"dot-".concat(x),r:3},m),g),{},{index:x,cx:S.x,cy:S.y,value:S.value,dataKey:v,payload:S.payload,points:h});return t.renderDotItem(d,E)}),O={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return I.createElement(Bt,qu({className:"recharts-line-dots",key:"dots"},O),b)}},{key:"renderCurveStatically",value:function(r,i,o,l){var u=this.props,d=u.type,h=u.layout,v=u.connectNulls;u.ref;var m=T4(u,_pe),g=tr(tr(tr({},nt(m,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:r},l),{},{type:d,layout:h,connectNulls:v});return I.createElement(sj,qu({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,i){var o=this,l=this.props,u=l.points,d=l.strokeDasharray,h=l.isAnimationActive,v=l.animationBegin,m=l.animationDuration,g=l.animationEasing,b=l.animationId,O=l.animateNewValues,S=l.width,x=l.height,E=this.state,N=E.prevPoints,_=E.totalLength;return I.createElement(ui,{begin:v,duration:m,isActive:h,easing:g,from:{t:0},to:{t:1},key:"line-".concat(b),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(C){var A=C.t;if(N){var M=N.length/u.length,R=u.map(function(F,W){var Q=Math.floor(W*M);if(N[Q]){var X=N[Q],k=Gr(X.x,F.x),H=Gr(X.y,F.y);return tr(tr({},F),{},{x:k(A),y:H(A)})}if(O){var B=Gr(S*2,F.x),Z=Gr(x/2,F.y);return tr(tr({},F),{},{x:B(A),y:Z(A)})}return tr(tr({},F),{},{x:F.x,y:F.y})});return o.renderCurveStatically(R,r,i)}var D=Gr(0,_),z=D(A),G;if(d){var L="".concat(d).split(/[,\s]+/gim).map(function(F){return parseFloat(F)});G=o.getStrokeDasharray(z,_,L)}else G=o.generateSimpleStrokeDasharray(_,z);return o.renderCurveStatically(u,r,i,{strokeDasharray:G})})}},{key:"renderCurve",value:function(r,i){var o=this.props,l=o.points,u=o.isAnimationActive,d=this.state,h=d.prevPoints,v=d.totalLength;return u&&l&&l.length&&(!h&&v>0||!qv(h,l))?this.renderCurveWithAnimation(r,i):this.renderCurveStatically(l,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,l=i.dot,u=i.points,d=i.className,h=i.xAxis,v=i.yAxis,m=i.top,g=i.left,b=i.width,O=i.height,S=i.isAnimationActive,x=i.id;if(o||!u||!u.length)return null;var E=this.state.isAnimationFinished,N=u.length===1,_=rt("recharts-line",d),C=h&&h.allowDataOverflow,A=v&&v.allowDataOverflow,M=C||A,R=Qe(x)?this.id:x,D=(r=nt(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},z=D.r,G=z===void 0?3:z,L=D.strokeWidth,F=L===void 0?2:L,W=ete(l)?l:{},Q=W.clipDot,X=Q===void 0?!0:Q,k=G*2+F;return I.createElement(Bt,{className:_},C||A?I.createElement("defs",null,I.createElement("clipPath",{id:"clipPath-".concat(R)},I.createElement("rect",{x:C?g:g-b/2,y:A?m:m-O/2,width:C?b:b*2,height:A?O:O*2})),!X&&I.createElement("clipPath",{id:"clipPath-dots-".concat(R)},I.createElement("rect",{x:g-k/2,y:m-k/2,width:b+k,height:O+k}))):null,!N&&this.renderCurve(M,R),this.renderErrorBar(M,R),(N||l)&&this.renderDots(M,X,R),(!S||E)&&Qi.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,i){for(var o=r.length%2!==0?[].concat(pl(r),[0]):r,l=[],u=0;u<i;++u)l=[].concat(pl(l),pl(o));return l}},{key:"renderDotItem",value:function(r,i){var o;if(I.isValidElement(r))o=I.cloneElement(r,i);else if(Ye(r))o=r(i);else{var l=i.key,u=T4(i,Npe),d=rt("recharts-line-dot",typeof r!="boolean"?r.className:"");o=I.createElement(zE,qu({key:l},u,{className:d}))}return o}}])})(w.PureComponent);Fr(Nr,"displayName","Line");Fr(Nr,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!wc.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Fr(Nr,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.dataKey,u=e.bandSize,d=e.displayedData,h=e.offset,v=t.layout,m=d.map(function(g,b){var O=cr(g,l);return v==="horizontal"?{x:KP({axis:n,ticks:i,bandSize:u,entry:g,index:b}),y:Qe(O)?null:r.scale(O),value:O,payload:g}:{x:Qe(O)?null:n.scale(O),y:KP({axis:r,ticks:o,bandSize:u,entry:g,index:b}),value:O,payload:g}});return tr({points:m,layout:v},h)});function Ql(e){"@babel/helpers - typeof";return Ql=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ql(e)}function Bpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,z6(r.key),r)}}function Upe(e,t,n){return t&&qpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Hpe(e,t,n){return t=Ep(t),Fpe(e,I6()?Reflect.construct(t,n||[],Ep(e).constructor):t.apply(e,n))}function Fpe(e,t){if(t&&(Ql(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gpe(e)}function Gpe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(I6=function(){return!!e})()}function Ep(e){return Ep=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ep(e)}function Vpe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mj(e,t)}function Mj(e,t){return Mj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Mj(e,t)}function L6(e,t,n){return t=z6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z6(e){var t=Ype(e,"string");return Ql(t)=="symbol"?t:t+""}function Ype(e,t){if(Ql(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ql(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Rj.apply(this,arguments)}function Wpe(e){var t=e.xAxisId,n=HE(),r=FE(),i=j6(t);return i==null?null:w.createElement(Ec,Rj({},i,{className:rt("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(l){return Ka(l,!0)}}))}var ys=(function(e){function t(){return Bpe(this,t),Hpe(this,t,arguments)}return Vpe(t,e),Upe(t,[{key:"render",value:function(){return w.createElement(Wpe,this.props)}}])})(w.Component);L6(ys,"displayName","XAxis");L6(ys,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Zl(e){"@babel/helpers - typeof";return Zl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zl(e)}function Kpe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xpe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,U6(r.key),r)}}function Qpe(e,t,n){return t&&Xpe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zpe(e,t,n){return t=_p(t),Jpe(e,B6()?Reflect.construct(t,n||[],_p(e).constructor):t.apply(e,n))}function Jpe(e,t){if(t&&(Zl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eve(e)}function eve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function B6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(B6=function(){return!!e})()}function _p(e){return _p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_p(e)}function tve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dj(e,t)}function Dj(e,t){return Dj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Dj(e,t)}function q6(e,t,n){return t=U6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U6(e){var t=nve(e,"string");return Zl(t)=="symbol"?t:t+""}function nve(e,t){if(Zl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Zl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function Pj(){return Pj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pj.apply(this,arguments)}var rve=function(t){var n=t.yAxisId,r=HE(),i=FE(),o=O6(n);return o==null?null:w.createElement(Ec,Pj({},o,{className:rt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(u){return Ka(u,!0)}}))},fi=(function(e){function t(){return Kpe(this,t),Zpe(this,t,arguments)}return tve(t,e),Qpe(t,[{key:"render",value:function(){return w.createElement(rve,this.props)}}])})(w.Component);q6(fi,"displayName","YAxis");q6(fi,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function D4(e){return sve(e)||ove(e)||ive(e)||ave()}function ave(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
494
494
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ive(e,t){if(e){if(typeof e=="string")return kj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return kj(e,t)}}function ove(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sve(e){if(Array.isArray(e))return kj(e)}function kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var $j=function(t,n,r,i,o){var l=Rr(t,VE),u=Rr(t,Wv),d=[].concat(D4(l),D4(u)),h=Rr(t,Xv),v="".concat(i,"Id"),m=i[0],g=n;if(d.length&&(g=d.reduce(function(S,x){if(x.props[v]===r&&ba(x.props,"extendDomain")&&be(x.props[m])){var E=x.props[m];return[Math.min(S[0],E),Math.max(S[1],E)]}return S},g)),h.length){var b="".concat(m,"1"),O="".concat(m,"2");g=h.reduce(function(S,x){if(x.props[v]===r&&ba(x.props,"extendDomain")&&be(x.props[b])&&be(x.props[O])){var E=x.props[b],N=x.props[O];return[Math.min(S[0],E,N),Math.max(S[1],E,N)]}return S},g)}return o&&o.length&&(g=o.reduce(function(S,x){return be(x)?[Math.min(S[0],x),Math.max(S[1],x)]:S},g)),g},L1={exports:{}},P4;function lve(){return P4||(P4=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,h,v){this.fn=d,this.context=h,this.once=v||!1}function o(d,h,v,m,g){if(typeof v!="function")throw new TypeError("The listener must be a function");var b=new i(v,m||d,g),O=n?n+h:h;return d._events[O]?d._events[O].fn?d._events[O]=[d._events[O],b]:d._events[O].push(b):(d._events[O]=b,d._eventsCount++),d}function l(d,h){--d._eventsCount===0?d._events=new r:delete d._events[h]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],v,m;if(this._eventsCount===0)return h;for(m in v=this._events)t.call(v,m)&&h.push(n?m.slice(1):m);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(v)):h},u.prototype.listeners=function(h){var v=n?n+h:h,m=this._events[v];if(!m)return[];if(m.fn)return[m.fn];for(var g=0,b=m.length,O=new Array(b);g<b;g++)O[g]=m[g].fn;return O},u.prototype.listenerCount=function(h){var v=n?n+h:h,m=this._events[v];return m?m.fn?1:m.length:0},u.prototype.emit=function(h,v,m,g,b,O){var S=n?n+h:h;if(!this._events[S])return!1;var x=this._events[S],E=arguments.length,N,_;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),E){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,v),!0;case 3:return x.fn.call(x.context,v,m),!0;case 4:return x.fn.call(x.context,v,m,g),!0;case 5:return x.fn.call(x.context,v,m,g,b),!0;case 6:return x.fn.call(x.context,v,m,g,b,O),!0}for(_=1,N=new Array(E-1);_<E;_++)N[_-1]=arguments[_];x.fn.apply(x.context,N)}else{var C=x.length,A;for(_=0;_<C;_++)switch(x[_].once&&this.removeListener(h,x[_].fn,void 0,!0),E){case 1:x[_].fn.call(x[_].context);break;case 2:x[_].fn.call(x[_].context,v);break;case 3:x[_].fn.call(x[_].context,v,m);break;case 4:x[_].fn.call(x[_].context,v,m,g);break;default:if(!N)for(A=1,N=new Array(E-1);A<E;A++)N[A-1]=arguments[A];x[_].fn.apply(x[_].context,N)}}return!0},u.prototype.on=function(h,v,m){return o(this,h,v,m,!1)},u.prototype.once=function(h,v,m){return o(this,h,v,m,!0)},u.prototype.removeListener=function(h,v,m,g){var b=n?n+h:h;if(!this._events[b])return this;if(!v)return l(this,b),this;var O=this._events[b];if(O.fn)O.fn===v&&(!g||O.once)&&(!m||O.context===m)&&l(this,b);else{for(var S=0,x=[],E=O.length;S<E;S++)(O[S].fn!==v||g&&!O[S].once||m&&O[S].context!==m)&&x.push(O[S]);x.length?this._events[b]=x.length===1?x[0]:x:l(this,b)}return this},u.prototype.removeAllListeners=function(h){var v;return h?(v=n?n+h:h,this._events[v]&&l(this,v)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,e.exports=u})(L1)),L1.exports}var cve=lve();const uve=xt(cve);var z1=new uve,B1="recharts.syncMouseEvents";function Pf(e){"@babel/helpers - typeof";return Pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pf(e)}function fve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,H6(r.key),r)}}function hve(e,t,n){return t&&dve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function q1(e,t,n){return t=H6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H6(e){var t=mve(e,"string");return Pf(t)=="symbol"?t:t+""}function mve(e,t){if(Pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pve=(function(){function e(){fve(this,e),q1(this,"activeIndex",0),q1(this,"coordinateList",[]),q1(this,"layout","horizontal")}return hve(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,l=n.container,u=l===void 0?null:l,d=n.layout,h=d===void 0?null:d,v=n.offset,m=v===void 0?null:v,g=n.mouseHandlerCallback,b=g===void 0?null:g;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=u??this.container,this.layout=h??this.layout,this.offset=m??this.offset,this.mouseHandlerCallback=b??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,l=i.y,u=i.height,d=this.coordinateList[this.activeIndex].coordinate,h=((n=window)===null||n===void 0?void 0:n.scrollX)||0,v=((r=window)===null||r===void 0?void 0:r.scrollY)||0,m=o+d+h,g=l+this.offset.top+u/2+v;this.mouseHandlerCallback({pageX:m,pageY:g})}}}])})();function vve(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&be(r)&&be(i))return!0}return!1}function gve(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function F6(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,l=vn(t,n,r,i),u=vn(t,n,r,o);return{points:[l,u],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function yve(e,t,n){var r,i,o,l;if(e==="horizontal")r=t.x,o=r,i=n.top,l=n.top+n.height;else if(e==="vertical")i=t.y,l=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var u=t.cx,d=t.cy,h=t.innerRadius,v=t.outerRadius,m=t.angle,g=vn(u,d,h,m),b=vn(u,d,v,m);r=g.x,i=g.y,o=b.x,l=b.y}else return F6(t);return[{x:r,y:i},{x:o,y:l}]}function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function k4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Uh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?k4(Object(n),!0).forEach(function(r){bve(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bve(e,t,n){return t=xve(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xve(e){var t=wve(e,"string");return kf(t)=="symbol"?t:t+""}function wve(e,t){if(kf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(kf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sve(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,l=e.activeCoordinate,u=e.activePayload,d=e.offset,h=e.activeTooltipIndex,v=e.tooltipAxisBandSize,m=e.layout,g=e.chartName,b=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!b||!o||!l||g!=="ScatterChart"&&i!=="axis")return null;var O,S=sj;if(g==="ScatterChart")O=l,S=xde;else if(g==="BarChart")O=gve(m,l,d,v),S=LE;else if(m==="radial"){var x=F6(l),E=x.cx,N=x.cy,_=x.radius,C=x.startAngle,A=x.endAngle;O={cx:E,cy:N,startAngle:C,endAngle:A,innerRadius:_,outerRadius:_},S=ZB}else O={points:yve(m,l,d)},S=sj;var M=Uh(Uh(Uh(Uh({stroke:"#ccc",pointerEvents:"none"},d),O),nt(b,!1)),{},{payload:u,payloadIndex:h,className:rt("recharts-tooltip-cursor",b.className)});return w.isValidElement(b)?w.cloneElement(b,M):w.createElement(S,M)}var jve=["item"],Ove=["children","className","width","height","style","compact","title","desc"];function Jl(e){"@babel/helpers - typeof";return Jl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jl(e)}function yl(){return yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yl.apply(this,arguments)}function $4(e,t){return Nve(e)||_ve(e,t)||V6(e,t)||Eve()}function Eve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
495
495
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ve(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,l,u=[],d=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(d=(r=o.call(n)).done)&&(u.push(r.value),u.length!==t);d=!0);}catch(v){h=!0,i=v}finally{try{if(!d&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw i}}return u}}function Nve(e){if(Array.isArray(e))return e}function I4(e,t){if(e==null)return{};var n=Ave(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ave(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Cve(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Tve(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Y6(r.key),r)}}function Mve(e,t,n){return t&&Tve(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rve(e,t,n){return t=Np(t),Dve(e,G6()?Reflect.construct(t,n||[],Np(e).constructor):t.apply(e,n))}function Dve(e,t){if(t&&(Jl(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pve(e)}function Pve(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function G6(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(G6=function(){return!!e})()}function Np(e){return Np=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Np(e)}function kve(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ij(e,t)}function Ij(e,t){return Ij=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Ij(e,t)}function ec(e){return Lve(e)||Ive(e)||V6(e)||$ve()}function $ve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
496
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V6(e,t){if(e){if(typeof e=="string")return Lj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lj(e,t)}}function Ive(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lve(e){if(Array.isArray(e))return Lj(e)}function Lj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L4(Object(n),!0).forEach(function(r){Pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pe(e,t,n){return t=Y6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y6(e){var t=zve(e,"string");return Jl(t)=="symbol"?t:t+""}function zve(e,t){if(Jl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bve={xAxis:["bottom","top"],yAxis:["left","right"]},qve={width:"100%",height:"100%"},W6={x:0,y:0};function Hh(e){return e}var Uve=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Hve=function(t,n,r,i){var o=n.find(function(v){return v&&v.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var l=o.coordinate,u=i.radius;return ue(ue(ue({},i),vn(i.cx,i.cy,u,l)),{},{angle:l,radius:u})}var d=o.coordinate,h=i.angle;return ue(ue(ue({},i),vn(i.cx,i.cy,d,h)),{},{angle:h,radius:d})}return W6},Zv=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,l=(r??[]).reduce(function(u,d){var h=d.props.data;return h&&h.length?[].concat(ec(u),ec(h)):u},[]);return l.length>0?l:t&&t.length&&be(i)&&be(o)?t.slice(i,o+1):[]};function K6(e){return e==="number"?[0,"auto"]:void 0}var zj=function(t,n,r,i){var o=t.graphicalItems,l=t.tooltipAxis,u=Zv(n,t);return r<0||!o||!o.length||r>=u.length?null:o.reduce(function(d,h){var v,m=(v=h.props.data)!==null&&v!==void 0?v:n;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var b=m===void 0?u:m;g=Mm(b,l.dataKey,i)}else g=m&&m[r]||u[r];return g?[].concat(ec(d),[KB(h,g)]):d},[])},z4=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},l=Uve(o,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,h=t.tooltipTicks,v=Jle(l,u,h,d);if(v>=0&&h){var m=h[v]&&h[v].value,g=zj(t,n,v,m),b=Hve(r,u,v,o);return{activeTooltipIndex:v,activeLabel:m,activePayload:g,activeCoordinate:b}}return null},Fve=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.layout,m=t.children,g=t.stackOffset,b=VB(v,o);return r.reduce(function(O,S){var x,E=S.type.defaultProps!==void 0?ue(ue({},S.type.defaultProps),S.props):S.props,N=E.type,_=E.dataKey,C=E.allowDataOverflow,A=E.allowDuplicatedCategory,M=E.scale,R=E.ticks,D=E.includeHidden,z=E[l];if(O[z])return O;var G=Zv(t.data,{graphicalItems:i.filter(function(Y){var q,U=l in Y.props?Y.props[l]:(q=Y.type.defaultProps)===null||q===void 0?void 0:q[l];return U===z}),dataStartIndex:d,dataEndIndex:h}),L=G.length,F,W,Q;vve(E.domain,C,N)&&(F=nj(E.domain,null,C),b&&(N==="number"||M!=="auto")&&(Q=zu(G,_,"category")));var X=K6(N);if(!F||F.length===0){var k,H=(k=E.domain)!==null&&k!==void 0?k:X;if(_){if(F=zu(G,_,N),N==="category"&&b){var B=Fee(F);A&&B?(W=F,F=mp(0,L)):A||(F=JP(H,F,S).reduce(function(Y,q){return Y.indexOf(q)>=0?Y:[].concat(ec(Y),[q])},[]))}else if(N==="category")A?F=F.filter(function(Y){return Y!==""&&!Qe(Y)}):F=JP(H,F,S).reduce(function(Y,q){return Y.indexOf(q)>=0||q===""||Qe(q)?Y:[].concat(ec(Y),[q])},[]);else if(N==="number"){var Z=ace(G,i.filter(function(Y){var q,U,ne=l in Y.props?Y.props[l]:(q=Y.type.defaultProps)===null||q===void 0?void 0:q[l],fe="hide"in Y.props?Y.props.hide:(U=Y.type.defaultProps)===null||U===void 0?void 0:U.hide;return ne===z&&(D||!fe)}),_,o,v);Z&&(F=Z)}b&&(N==="number"||M!=="auto")&&(Q=zu(G,_,"category"))}else b?F=mp(0,L):u&&u[z]&&u[z].hasStack&&N==="number"?F=g==="expand"?[0,1]:WB(u[z].stackGroups,d,h):F=GB(G,i.filter(function(Y){var q=l in Y.props?Y.props[l]:Y.type.defaultProps[l],U="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return q===z&&(D||!U)}),N,v,!0);if(N==="number")F=$j(m,F,z,o,R),H&&(F=nj(H,F,C));else if(N==="category"&&H){var le=H,$=F.every(function(Y){return le.indexOf(Y)>=0});$&&(F=le)}}return ue(ue({},O),{},Pe({},z,ue(ue({},E),{},{axisType:o,domain:F,categoricalDomain:Q,duplicateDomain:W,originalDomain:(x=E.domain)!==null&&x!==void 0?x:X,isCategorical:b,layout:v})))},{})},Gve=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.layout,m=t.children,g=Zv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:h}),b=g.length,O=VB(v,o),S=-1;return r.reduce(function(x,E){var N=E.type.defaultProps!==void 0?ue(ue({},E.type.defaultProps),E.props):E.props,_=N[l],C=K6("number");if(!x[_]){S++;var A;return O?A=mp(0,b):u&&u[_]&&u[_].hasStack?(A=WB(u[_].stackGroups,d,h),A=$j(m,A,_,o)):(A=nj(C,GB(g,r.filter(function(M){var R,D,z=l in M.props?M.props[l]:(R=M.type.defaultProps)===null||R===void 0?void 0:R[l],G="hide"in M.props?M.props.hide:(D=M.type.defaultProps)===null||D===void 0?void 0:D.hide;return z===_&&!G}),"number",v),i.defaultProps.allowDataOverflow),A=$j(m,A,_,o)),ue(ue({},x),{},Pe({},_,ue(ue({axisType:o},i.defaultProps),{},{hide:!0,orientation:Mr(Bve,"".concat(o,".").concat(S%2),null),domain:A,originalDomain:C,isCategorical:O,layout:v})))}return x},{})},Vve=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.children,m="".concat(i,"Id"),g=Rr(v,o),b={};return g&&g.length?b=Fve(t,{axes:g,graphicalItems:l,axisType:i,axisIdKey:m,stackGroups:u,dataStartIndex:d,dataEndIndex:h}):l&&l.length&&(b=Gve(t,{Axis:o,graphicalItems:l,axisType:i,axisIdKey:m,stackGroups:u,dataStartIndex:d,dataEndIndex:h})),b},Yve=function(t){var n=Yi(t),r=Ka(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:uE(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ap(n,r)}},B4=function(t){var n=t.children,r=t.defaultShowTooltip,i=rr(n,Fl),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(l=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},Wve=function(t){return!t||!t.length?!1:t.some(function(n){var r=Za(n&&n.type);return r&&r.indexOf("Bar")>=0})},q4=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Kve=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,h=r.width,v=r.height,m=r.children,g=r.margin||{},b=rr(m,Fl),O=rr(m,ei),S=Object.keys(d).reduce(function(A,M){var R=d[M],D=R.orientation;return!R.mirror&&!R.hide?ue(ue({},A),{},Pe({},D,A[D]+R.width)):A},{left:g.left||0,right:g.right||0}),x=Object.keys(l).reduce(function(A,M){var R=l[M],D=R.orientation;return!R.mirror&&!R.hide?ue(ue({},A),{},Pe({},D,Mr(A,"".concat(D))+R.height)):A},{top:g.top||0,bottom:g.bottom||0}),E=ue(ue({},x),S),N=E.bottom;b&&(E.bottom+=b.props.height||Fl.defaultProps.height),O&&n&&(E=nce(E,i,r,n));var _=h-E.left-E.right,C=v-E.top-E.bottom;return ue(ue({brushBottom:N},E),{},{width:Math.max(_,0),height:Math.max(C,0)})},Xve=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},X6=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,h=t.legendContent,v=t.formatAxisMap,m=t.defaultProps,g=function(E,N){var _=N.graphicalItems,C=N.stackGroups,A=N.offset,M=N.updateId,R=N.dataStartIndex,D=N.dataEndIndex,z=E.barSize,G=E.layout,L=E.barGap,F=E.barCategoryGap,W=E.maxBarSize,Q=q4(G),X=Q.numericAxisName,k=Q.cateAxisName,H=Wve(_),B=[];return _.forEach(function(Z,le){var $=Zv(E.data,{graphicalItems:[Z],dataStartIndex:R,dataEndIndex:D}),Y=Z.type.defaultProps!==void 0?ue(ue({},Z.type.defaultProps),Z.props):Z.props,q=Y.dataKey,U=Y.maxBarSize,ne=Y["".concat(X,"Id")],fe=Y["".concat(k,"Id")],ie={},pe=d.reduce(function(Yn,Rt){var dr=N["".concat(Rt.axisType,"Map")],nn=Y["".concat(Rt.axisType,"Id")];dr&&dr[nn]||Rt.axisType==="zAxis"||is();var bs=dr[nn];return ue(ue({},Yn),{},Pe(Pe({},Rt.axisType,bs),"".concat(Rt.axisType,"Ticks"),Ka(bs)))},ie),re=pe[k],ve=pe["".concat(k,"Ticks")],ge=C&&C[ne]&&C[ne].hasStack&&vce(Z,C[ne].stackGroups),oe=Za(Z.type).indexOf("Bar")>=0,ke=ap(re,ve),we=[],ze=H&&ece({barSize:z,stackGroups:C,totalSize:Xve(pe,k)});if(oe){var Ze,lt,tn=Qe(U)?W:U,pt=(Ze=(lt=ap(re,ve,!0))!==null&<!==void 0?lt:tn)!==null&&Ze!==void 0?Ze:0;we=tce({barGap:L,barCategoryGap:F,bandSize:pt!==ke?pt:ke,sizeList:ze[fe],maxBarSize:tn}),pt!==ke&&(we=we.map(function(Yn){return ue(ue({},Yn),{},{position:ue(ue({},Yn.position),{},{offset:Yn.position.offset-pt/2})})}))}var fr=Z&&Z.type&&Z.type.getComposedData;fr&&B.push({props:ue(ue({},fr(ue(ue({},pe),{},{displayedData:$,props:E,dataKey:q,item:Z,bandSize:ke,barPosition:we,offset:A,stackedData:ge,layout:G,dataStartIndex:R,dataEndIndex:D}))),{},Pe(Pe(Pe({key:Z.key||"item-".concat(le)},X,pe[X]),k,pe[k]),"animationId",M)),childIndex:rte(Z,E.children),item:Z})}),B},b=function(E,N){var _=E.props,C=E.dataStartIndex,A=E.dataEndIndex,M=E.updateId;if(!hM({props:_}))return null;var R=_.children,D=_.layout,z=_.stackOffset,G=_.data,L=_.reverseStackOrder,F=q4(D),W=F.numericAxisName,Q=F.cateAxisName,X=Rr(R,r),k=hce(G,X,"".concat(W,"Id"),"".concat(Q,"Id"),z,L),H=d.reduce(function(Y,q){var U="".concat(q.axisType,"Map");return ue(ue({},Y),{},Pe({},U,Vve(_,ue(ue({},q),{},{graphicalItems:X,stackGroups:q.axisType===W&&k,dataStartIndex:C,dataEndIndex:A}))))},{}),B=Kve(ue(ue({},H),{},{props:_,graphicalItems:X}),N==null?void 0:N.legendBBox);Object.keys(H).forEach(function(Y){H[Y]=v(_,H[Y],B,Y.replace("Map",""),n)});var Z=H["".concat(Q,"Map")],le=Yve(Z),$=g(_,ue(ue({},H),{},{dataStartIndex:C,dataEndIndex:A,updateId:M,graphicalItems:X,stackGroups:k,offset:B}));return ue(ue({formattedGraphicalItems:$,graphicalItems:X,offset:B,stackGroups:k},le),H)},O=(function(x){function E(N){var _,C,A;return Cve(this,E),A=Rve(this,E,[N]),Pe(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(A,"accessibilityManager",new pve),Pe(A,"handleLegendBBoxUpdate",function(M){if(M){var R=A.state,D=R.dataStartIndex,z=R.dataEndIndex,G=R.updateId;A.setState(ue({legendBBox:M},b({props:A.props,dataStartIndex:D,dataEndIndex:z,updateId:G},ue(ue({},A.state),{},{legendBBox:M}))))}}),Pe(A,"handleReceiveSyncEvent",function(M,R,D){if(A.props.syncId===M){if(D===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(R)}}),Pe(A,"handleBrushChange",function(M){var R=M.startIndex,D=M.endIndex;if(R!==A.state.dataStartIndex||D!==A.state.dataEndIndex){var z=A.state.updateId;A.setState(function(){return ue({dataStartIndex:R,dataEndIndex:D},b({props:A.props,dataStartIndex:R,dataEndIndex:D,updateId:z},A.state))}),A.triggerSyncEvent({dataStartIndex:R,dataEndIndex:D})}}),Pe(A,"handleMouseEnter",function(M){var R=A.getMouseInfo(M);if(R){var D=ue(ue({},R),{},{isTooltipActive:!0});A.setState(D),A.triggerSyncEvent(D);var z=A.props.onMouseEnter;Ye(z)&&z(D,M)}}),Pe(A,"triggeredAfterMouseMove",function(M){var R=A.getMouseInfo(M),D=R?ue(ue({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(D),A.triggerSyncEvent(D);var z=A.props.onMouseMove;Ye(z)&&z(D,M)}),Pe(A,"handleItemMouseEnter",function(M){A.setState(function(){return{isTooltipActive:!0,activeItem:M,activePayload:M.tooltipPayload,activeCoordinate:M.tooltipPosition||{x:M.cx,y:M.cy}}})}),Pe(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Pe(A,"handleMouseMove",function(M){M.persist(),A.throttleTriggeredAfterMouseMove(M)}),Pe(A,"handleMouseLeave",function(M){A.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var D=A.props.onMouseLeave;Ye(D)&&D(R,M)}),Pe(A,"handleOuterEvent",function(M){var R=nte(M),D=Mr(A.props,"".concat(R));if(R&&Ye(D)){var z,G;/.*touch.*/i.test(R)?G=A.getMouseInfo(M.changedTouches[0]):G=A.getMouseInfo(M),D((z=G)!==null&&z!==void 0?z:{},M)}}),Pe(A,"handleClick",function(M){var R=A.getMouseInfo(M);if(R){var D=ue(ue({},R),{},{isTooltipActive:!0});A.setState(D),A.triggerSyncEvent(D);var z=A.props.onClick;Ye(z)&&z(D,M)}}),Pe(A,"handleMouseDown",function(M){var R=A.props.onMouseDown;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleMouseUp",function(M){var R=A.props.onMouseUp;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleTouchMove",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(M.changedTouches[0])}),Pe(A,"handleTouchStart",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.handleMouseDown(M.changedTouches[0])}),Pe(A,"handleTouchEnd",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.handleMouseUp(M.changedTouches[0])}),Pe(A,"handleDoubleClick",function(M){var R=A.props.onDoubleClick;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleContextMenu",function(M){var R=A.props.onContextMenu;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"triggerSyncEvent",function(M){A.props.syncId!==void 0&&z1.emit(B1,A.props.syncId,M,A.eventEmitterSymbol)}),Pe(A,"applySyncEvent",function(M){var R=A.props,D=R.layout,z=R.syncMethod,G=A.state.updateId,L=M.dataStartIndex,F=M.dataEndIndex;if(M.dataStartIndex!==void 0||M.dataEndIndex!==void 0)A.setState(ue({dataStartIndex:L,dataEndIndex:F},b({props:A.props,dataStartIndex:L,dataEndIndex:F,updateId:G},A.state)));else if(M.activeTooltipIndex!==void 0){var W=M.chartX,Q=M.chartY,X=M.activeTooltipIndex,k=A.state,H=k.offset,B=k.tooltipTicks;if(!H)return;if(typeof z=="function")X=z(B,M);else if(z==="value"){X=-1;for(var Z=0;Z<B.length;Z++)if(B[Z].value===M.activeLabel){X=Z;break}}var le=ue(ue({},H),{},{x:H.left,y:H.top}),$=Math.min(W,le.x+le.width),Y=Math.min(Q,le.y+le.height),q=B[X]&&B[X].value,U=zj(A.state,A.props.data,X),ne=B[X]?{x:D==="horizontal"?B[X].coordinate:$,y:D==="horizontal"?Y:B[X].coordinate}:W6;A.setState(ue(ue({},M),{},{activeLabel:q,activeCoordinate:ne,activePayload:U,activeTooltipIndex:X}))}else A.setState(M)}),Pe(A,"renderCursor",function(M){var R,D=A.state,z=D.isTooltipActive,G=D.activeCoordinate,L=D.activePayload,F=D.offset,W=D.activeTooltipIndex,Q=D.tooltipAxisBandSize,X=A.getTooltipEventType(),k=(R=M.props.active)!==null&&R!==void 0?R:z,H=A.props.layout,B=M.key||"_recharts-cursor";return I.createElement(Sve,{key:B,activeCoordinate:G,activePayload:L,activeTooltipIndex:W,chartName:n,element:M,isActive:k,layout:H,offset:F,tooltipAxisBandSize:Q,tooltipEventType:X})}),Pe(A,"renderPolarAxis",function(M,R,D){var z=Mr(M,"type.axisType"),G=Mr(A.state,"".concat(z,"Map")),L=M.type.defaultProps,F=L!==void 0?ue(ue({},L),M.props):M.props,W=G&&G[F["".concat(z,"Id")]];return w.cloneElement(M,ue(ue({},W),{},{className:rt(z,W.className),key:M.key||"".concat(R,"-").concat(D),ticks:Ka(W,!0)}))}),Pe(A,"renderPolarGrid",function(M){var R=M.props,D=R.radialLines,z=R.polarAngles,G=R.polarRadius,L=A.state,F=L.radiusAxisMap,W=L.angleAxisMap,Q=Yi(F),X=Yi(W),k=X.cx,H=X.cy,B=X.innerRadius,Z=X.outerRadius;return w.cloneElement(M,{polarAngles:Array.isArray(z)?z:Ka(X,!0).map(function(le){return le.coordinate}),polarRadius:Array.isArray(G)?G:Ka(Q,!0).map(function(le){return le.coordinate}),cx:k,cy:H,innerRadius:B,outerRadius:Z,key:M.key||"polar-grid",radialLines:D})}),Pe(A,"renderLegend",function(){var M=A.state.formattedGraphicalItems,R=A.props,D=R.children,z=R.width,G=R.height,L=A.props.margin||{},F=z-(L.left||0)-(L.right||0),W=HB({children:D,formattedGraphicalItems:M,legendWidth:F,legendContent:h});if(!W)return null;var Q=W.item,X=I4(W,jve);return w.cloneElement(Q,ue(ue({},X),{},{chartWidth:z,chartHeight:G,margin:L,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),Pe(A,"renderTooltip",function(){var M,R=A.props,D=R.children,z=R.accessibilityLayer,G=rr(D,_r);if(!G)return null;var L=A.state,F=L.isTooltipActive,W=L.activeCoordinate,Q=L.activePayload,X=L.activeLabel,k=L.offset,H=(M=G.props.active)!==null&&M!==void 0?M:F;return w.cloneElement(G,{viewBox:ue(ue({},k),{},{x:k.left,y:k.top}),active:H,label:X,payload:H?Q:[],coordinate:W,accessibilityLayer:z})}),Pe(A,"renderBrush",function(M){var R=A.props,D=R.margin,z=R.data,G=A.state,L=G.offset,F=G.dataStartIndex,W=G.dataEndIndex,Q=G.updateId;return w.cloneElement(M,{key:M.key||"_recharts-brush",onChange:Lh(A.handleBrushChange,M.props.onChange),data:z,x:be(M.props.x)?M.props.x:L.left,y:be(M.props.y)?M.props.y:L.top+L.height+L.brushBottom-(D.bottom||0),width:be(M.props.width)?M.props.width:L.width,startIndex:F,endIndex:W,updateId:"brush-".concat(Q)})}),Pe(A,"renderReferenceElement",function(M,R,D){if(!M)return null;var z=A,G=z.clipPathId,L=A.state,F=L.xAxisMap,W=L.yAxisMap,Q=L.offset,X=M.type.defaultProps||{},k=M.props,H=k.xAxisId,B=H===void 0?X.xAxisId:H,Z=k.yAxisId,le=Z===void 0?X.yAxisId:Z;return w.cloneElement(M,{key:M.key||"".concat(R,"-").concat(D),xAxis:F[B],yAxis:W[le],viewBox:{x:Q.left,y:Q.top,width:Q.width,height:Q.height},clipPathId:G})}),Pe(A,"renderActivePoints",function(M){var R=M.item,D=M.activePoint,z=M.basePoint,G=M.childIndex,L=M.isRange,F=[],W=R.props.key,Q=R.item.type.defaultProps!==void 0?ue(ue({},R.item.type.defaultProps),R.item.props):R.item.props,X=Q.activeDot,k=Q.dataKey,H=ue(ue({index:G,dataKey:k,cx:D.x,cy:D.y,r:4,fill:IE(R.item),strokeWidth:2,stroke:"#fff",payload:D.payload,value:D.value},nt(X,!1)),Rm(X));return F.push(E.renderActiveDot(X,H,"".concat(W,"-activePoint-").concat(G))),z?F.push(E.renderActiveDot(X,ue(ue({},H),{},{cx:z.x,cy:z.y}),"".concat(W,"-basePoint-").concat(G))):L&&F.push(null),F}),Pe(A,"renderGraphicChild",function(M,R,D){var z=A.filterFormatItem(M,R,D);if(!z)return null;var G=A.getTooltipEventType(),L=A.state,F=L.isTooltipActive,W=L.tooltipAxis,Q=L.activeTooltipIndex,X=L.activeLabel,k=A.props.children,H=rr(k,_r),B=z.props,Z=B.points,le=B.isRange,$=B.baseLine,Y=z.item.type.defaultProps!==void 0?ue(ue({},z.item.type.defaultProps),z.item.props):z.item.props,q=Y.activeDot,U=Y.hide,ne=Y.activeBar,fe=Y.activeShape,ie=!!(!U&&F&&H&&(q||ne||fe)),pe={};G!=="axis"&&H&&H.props.trigger==="click"?pe={onClick:Lh(A.handleItemMouseEnter,M.props.onClick)}:G!=="axis"&&(pe={onMouseLeave:Lh(A.handleItemMouseLeave,M.props.onMouseLeave),onMouseEnter:Lh(A.handleItemMouseEnter,M.props.onMouseEnter)});var re=w.cloneElement(M,ue(ue({},z.props),pe));function ve(Rt){return typeof W.dataKey=="function"?W.dataKey(Rt.payload):null}if(ie)if(Q>=0){var ge,oe;if(W.dataKey&&!W.allowDuplicatedCategory){var ke=typeof W.dataKey=="function"?ve:"payload.".concat(W.dataKey.toString());ge=Mm(Z,ke,X),oe=le&&$&&Mm($,ke,X)}else ge=Z==null?void 0:Z[Q],oe=le&&$&&$[Q];if(fe||ne){var we=M.props.activeIndex!==void 0?M.props.activeIndex:Q;return[w.cloneElement(M,ue(ue(ue({},z.props),pe),{},{activeIndex:we})),null,null]}if(!Qe(ge))return[re].concat(ec(A.renderActivePoints({item:z,activePoint:ge,basePoint:oe,childIndex:Q,isRange:le})))}else{var ze,Ze=(ze=A.getItemByXY(A.state.activeCoordinate))!==null&&ze!==void 0?ze:{graphicalItem:re},lt=Ze.graphicalItem,tn=lt.item,pt=tn===void 0?M:tn,fr=lt.childIndex,Yn=ue(ue(ue({},z.props),pe),{},{activeIndex:fr});return[w.cloneElement(pt,Yn),null,null]}return le?[re,null,null]:[re,null]}),Pe(A,"renderCustomized",function(M,R,D){return w.cloneElement(M,ue(ue({key:"recharts-customized-".concat(D)},A.props),A.state))}),Pe(A,"renderMap",{CartesianGrid:{handler:Hh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Hh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Hh},YAxis:{handler:Hh},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Xf("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=Uz(A.triggeredAfterMouseMove,(C=N.throttleDelay)!==null&&C!==void 0?C:1e3/60),A.state={},A}return kve(E,x),Mve(E,[{key:"componentDidMount",value:function(){var _,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,C=_.children,A=_.data,M=_.height,R=_.layout,D=rr(C,_r);if(D){var z=D.props.defaultIndex;if(!(typeof z!="number"||z<0||z>this.state.tooltipTicks.length-1)){var G=this.state.tooltipTicks[z]&&this.state.tooltipTicks[z].value,L=zj(this.state,A,z,G),F=this.state.tooltipTicks[z].coordinate,W=(this.state.offset.top+M)/2,Q=R==="horizontal",X=Q?{x:F,y:W}:{y:F,x:W},k=this.state.formattedGraphicalItems.find(function(B){var Z=B.item;return Z.type.name==="Scatter"});k&&(X=ue(ue({},X),k.props.points[z].tooltipPosition),L=k.props.points[z].tooltipPayload);var H={activeTooltipIndex:z,isTooltipActive:!0,activeLabel:G,activePayload:L,activeCoordinate:X};this.setState(H),this.renderCursor(D),this.accessibilityManager.setIndex(z)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var A,M;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(M=this.props.margin.top)!==null&&M!==void 0?M:0}})}return null}},{key:"componentDidUpdate",value:function(_){OS([rr(_.children,_r)],[rr(this.props.children,_r)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=rr(this.props.children,_r);if(_&&typeof _.props.shared=="boolean"){var C=_.props.shared?"axis":"item";return u.indexOf(C)>=0?C:o}return o}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var C=this.container,A=C.getBoundingClientRect(),M=Hae(A),R={chartX:Math.round(_.pageX-M.left),chartY:Math.round(_.pageY-M.top)},D=A.width/C.offsetWidth||1,z=this.inRange(R.chartX,R.chartY,D);if(!z)return null;var G=this.state,L=G.xAxisMap,F=G.yAxisMap,W=this.getTooltipEventType(),Q=z4(this.state,this.props.data,this.props.layout,z);if(W!=="axis"&&L&&F){var X=Yi(L).scale,k=Yi(F).scale,H=X&&X.invert?X.invert(R.chartX):null,B=k&&k.invert?k.invert(R.chartY):null;return ue(ue({},R),{},{xValue:H,yValue:B},Q)}return Q?ue(ue({},R),Q):null}},{key:"inRange",value:function(_,C){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=this.props.layout,R=_/A,D=C/A;if(M==="horizontal"||M==="vertical"){var z=this.state.offset,G=R>=z.left&&R<=z.left+z.width&&D>=z.top&&D<=z.top+z.height;return G?{x:R,y:D}:null}var L=this.state,F=L.angleAxisMap,W=L.radiusAxisMap;if(F&&W){var Q=Yi(F);return nk({x:R,y:D},Q)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,C=this.getTooltipEventType(),A=rr(_,_r),M={};A&&C==="axis"&&(A.props.trigger==="click"?M={onClick:this.handleClick}:M={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var R=Rm(this.props,this.handleOuterEvent);return ue(ue({},R),M)}},{key:"addListener",value:function(){z1.on(B1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){z1.removeListener(B1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,C,A){for(var M=this.state.formattedGraphicalItems,R=0,D=M.length;R<D;R++){var z=M[R];if(z.item===_||z.props.key===_.key||C===Za(z.item.type)&&A===z.childIndex)return z}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,C=this.state.offset,A=C.left,M=C.top,R=C.height,D=C.width;return I.createElement("defs",null,I.createElement("clipPath",{id:_},I.createElement("rect",{x:A,y:M,height:R,width:D})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(C,A){var M=$4(A,2),R=M[0],D=M[1];return ue(ue({},C),{},Pe({},R,D.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(C,A){var M=$4(A,2),R=M[0],D=M[1];return ue(ue({},C),{},Pe({},R,D.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[_])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(_){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[_])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(_){var C=this.state,A=C.formattedGraphicalItems,M=C.activeItem;if(A&&A.length)for(var R=0,D=A.length;R<D;R++){var z=A[R],G=z.props,L=z.item,F=L.type.defaultProps!==void 0?ue(ue({},L.type.defaultProps),L.props):L.props,W=Za(L.type);if(W==="Bar"){var Q=(G.data||[]).find(function(B){return ude(_,B)});if(Q)return{graphicalItem:z,payload:Q}}else if(W==="RadialBar"){var X=(G.data||[]).find(function(B){return nk(_,B)});if(X)return{graphicalItem:z,payload:X}}else if(Fv(z,M)||Gv(z,M)||Cf(z,M)){var k=ehe({graphicalItem:z,activeTooltipItem:M,itemData:F.data}),H=F.activeIndex===void 0?k:F.activeIndex;return{graphicalItem:ue(ue({},z),{},{childIndex:H}),payload:Cf(z,M)?F.data[k]:z.props.data[k]}}}return null}},{key:"render",value:function(){var _=this;if(!hM(this))return null;var C=this.props,A=C.children,M=C.className,R=C.width,D=C.height,z=C.style,G=C.compact,L=C.title,F=C.desc,W=I4(C,Ove),Q=nt(W,!1);if(G)return I.createElement(g4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement(_S,yl({},Q,{width:R,height:D,title:L,desc:F}),this.renderClipPath(),pM(A,this.renderMap)));if(this.props.accessibilityLayer){var X,k;Q.tabIndex=(X=this.props.tabIndex)!==null&&X!==void 0?X:0,Q.role=(k=this.props.role)!==null&&k!==void 0?k:"application",Q.onKeyDown=function(B){_.accessibilityManager.keyboardEvent(B)},Q.onFocus=function(){_.accessibilityManager.focus()}}var H=this.parseEventsOfWrapper();return I.createElement(g4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement("div",yl({className:rt("recharts-wrapper",M),style:ue({position:"relative",cursor:"default",width:R,height:D},z)},H,{ref:function(Z){_.container=Z}}),I.createElement(_S,yl({},Q,{width:R,height:D,title:L,desc:F,style:qve}),this.renderClipPath(),pM(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(w.Component);Pe(O,"displayName",n),Pe(O,"defaultProps",ue({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),Pe(O,"getDerivedStateFromProps",function(x,E){var N=x.dataKey,_=x.data,C=x.children,A=x.width,M=x.height,R=x.layout,D=x.stackOffset,z=x.margin,G=E.dataStartIndex,L=E.dataEndIndex;if(E.updateId===void 0){var F=B4(x);return ue(ue(ue({},F),{},{updateId:0},b(ue(ue({props:x},F),{},{updateId:0}),E)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:M,prevLayout:R,prevStackOffset:D,prevMargin:z,prevChildren:C})}if(N!==E.prevDataKey||_!==E.prevData||A!==E.prevWidth||M!==E.prevHeight||R!==E.prevLayout||D!==E.prevStackOffset||!Ol(z,E.prevMargin)){var W=B4(x),Q={chartX:E.chartX,chartY:E.chartY,isTooltipActive:E.isTooltipActive},X=ue(ue({},z4(E,_,R)),{},{updateId:E.updateId+1}),k=ue(ue(ue({},W),Q),X);return ue(ue(ue({},k),b(ue({props:x},k),E)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:M,prevLayout:R,prevStackOffset:D,prevMargin:z,prevChildren:C})}if(!OS(C,E.prevChildren)){var H,B,Z,le,$=rr(C,Fl),Y=$&&(H=(B=$.props)===null||B===void 0?void 0:B.startIndex)!==null&&H!==void 0?H:G,q=$&&(Z=(le=$.props)===null||le===void 0?void 0:le.endIndex)!==null&&Z!==void 0?Z:L,U=Y!==G||q!==L,ne=!Qe(_),fe=ne&&!U?E.updateId:E.updateId+1;return ue(ue({updateId:fe},b(ue(ue({props:x},E),{},{updateId:fe,dataStartIndex:Y,dataEndIndex:q}),E)),{},{prevChildren:C,dataStartIndex:Y,dataEndIndex:q})}return null}),Pe(O,"renderActiveDot",function(x,E,N){var _;return w.isValidElement(x)?_=w.cloneElement(x,E):Ye(x)?_=x(E):_=I.createElement(zE,E),I.createElement(Bt,{className:"recharts-active-dot",key:N},_)});var S=w.forwardRef(function(E,N){return I.createElement(O,yl({},E,{ref:N}))});return S.displayName=O.displayName,S},Q6=X6({chartName:"LineChart",GraphicalChild:Nr,axisComponents:[{axisType:"xAxis",AxisComp:ys},{axisType:"yAxis",AxisComp:fi}],formatAxisMap:p6}),Qve=X6({chartName:"BarChart",GraphicalChild:no,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ys},{axisType:"yAxis",AxisComp:fi}],formatAxisMap:p6});function U1(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function Wo(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Fh({title:e,value:t,description:n,icon:r,trend:i}){return c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between pb-2",children:[c.jsx(Le,{className:"font-medium text-muted-foreground text-sm",children:e}),c.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:t}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"text-muted-foreground text-xs",children:n}),i!==void 0&&i!==0&&c.jsxs("span",{className:`flex items-center text-xs ${i>0?"text-green-500":"text-red-500"}`,children:[c.jsx(Zj,{className:`h-3 w-3 ${i<0?"rotate-180":""}`}),Math.abs(i),"%"]})]})]})]})}function Zve({data:e}){const t=e.map(n=>({date:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),size:n.size/1073741824,files:n.files}));return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Storage Usage"}),c.jsx(We,{children:"Storage size and file count over time"})]}),c.jsx($e,{children:c.jsx(dE,{height:300,width:"100%",children:c.jsxs(Q6,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"date",stroke:"currentColor",tick:{fill:"currentColor"}}),c.jsx(fi,{className:"text-xs",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>`${n} GB`,yAxisId:"left"}),c.jsx(fi,{className:"text-xs",orientation:"right",stroke:"currentColor",tick:{fill:"currentColor"},yAxisId:"right"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},formatter:(n,r)=>[r==="size"?`${n.toFixed(2)} GB`:n,r==="size"?"Storage":"Files"]}),c.jsx(ei,{}),c.jsx(Nr,{dataKey:"size",dot:!1,name:"Storage (GB)",stroke:"hsl(var(--primary))",strokeWidth:2,type:"monotone",yAxisId:"left"}),c.jsx(Nr,{dataKey:"files",dot:!1,name:"File Count",stroke:"hsl(var(--chart-2))",strokeWidth:2,type:"monotone",yAxisId:"right"})]})})})]})}function Jve({data:e}){const t=e.map(n=>({date:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),bandwidth:n.bytes/1048576,requests:n.requests}));return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"CDN Traffic"}),c.jsx(We,{children:"Bandwidth and requests over time"})]}),c.jsx($e,{children:c.jsx(dE,{height:300,width:"100%",children:c.jsxs(Qve,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"date",stroke:"currentColor",tick:{fill:"currentColor"}}),c.jsx(fi,{className:"text-xs",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>`${n} MB`,yAxisId:"left"}),c.jsx(fi,{className:"text-xs",orientation:"right",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>Wo(n),yAxisId:"right"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},formatter:(n,r)=>[r==="bandwidth"?`${n.toFixed(1)} MB`:Wo(n),r==="bandwidth"?"Bandwidth":"Requests"]}),c.jsx(ei,{}),c.jsx(no,{dataKey:"bandwidth",fill:"hsl(var(--primary))",name:"Bandwidth (MB)",radius:[4,4,0,0],yAxisId:"left"}),c.jsx(no,{dataKey:"requests",fill:"hsl(var(--chart-3))",name:"Requests",radius:[4,4,0,0],yAxisId:"right"})]})})})]})}function ege({files:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Top Files"}),c.jsx(We,{children:"Most requested files this month"})]}),c.jsx($e,{children:e.length===0?c.jsx("div",{className:"py-4 text-center text-muted-foreground",children:"No data available"}):c.jsx("div",{className:"space-y-4",children:e.map((t,n)=>{const r=t.key.split("/").pop()||t.key,i=Math.max(...e.map(l=>l.requests)),o=t.requests/i*100;return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between text-sm",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-muted-foreground",children:[n+1,"."]}),c.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r})]}),c.jsxs("span",{className:"text-muted-foreground",children:[Wo(t.requests)," requests"]})]}),c.jsx(pv,{className:"h-2",value:o})]},t.key)})})})]})}function tge(){return c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>c.jsxs(Te,{children:[c.jsx(Me,{className:"pb-2",children:c.jsx(Re,{className:"h-4 w-20"})}),c.jsxs($e,{children:[c.jsx(Re,{className:"h-8 w-24"}),c.jsx(Re,{className:"mt-2 h-3 w-32"})]})]},t))}),c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsx(Re,{className:"h-6 w-32"})}),c.jsx($e,{children:c.jsx(Re,{className:"h-[300px] w-full"})})]})]})}function nge(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function rge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),[l,u]=w.useState("7d"),d=w.useCallback(async()=>{try{r(!0),o(null);const h=sessionStorage.getItem("wraps-auth-token"),v=await fetch(`/api/cdn/metrics?token=${h}&range=${l}`);if(!v.ok){if(v.status===404){t(null);return}throw new Error("Failed to fetch storage metrics")}const m=await v.json();t(m)}catch(h){o(h instanceof Error?h.message:"An error occurred")}finally{r(!1)}},[l]);return w.useEffect(()=>{d()},[d]),n?c.jsx(tge,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"Storage Metrics"}),c.jsx("p",{className:"text-muted-foreground",children:"Monitor your storage usage and CDN traffic"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ma,{onValueChange:u,value:l,children:[c.jsx(va,{className:"w-32",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"7d",children:"Last 7 days"}),c.jsx(Fe,{value:"30d",children:"Last 30 days"}),c.jsx(Fe,{value:"90d",children:"Last 90 days"})]})]}),c.jsxs(Ce,{onClick:d,size:"sm",variant:"outline",children:[c.jsx(Bf,{className:"mr-2 h-4 w-4"}),"Refresh"]})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[c.jsx(Fh,{description:`${Wo(e.summary.fileCount)} files`,icon:EF,title:"Storage Used",value:U1(e.summary.totalSize)}),c.jsx(Fh,{description:`${U1(e.summary.bandwidth.thisMonth)} this month`,icon:yF,title:"Bandwidth Today",value:U1(e.summary.bandwidth.today)}),c.jsx(Fh,{description:`${Wo(e.summary.requests.thisMonth)} this month`,icon:Vu,title:"Requests Today",value:Wo(e.summary.requests.today)}),c.jsx(Fh,{description:"Files in storage",icon:xF,title:"Total Files",value:Wo(e.summary.fileCount)})]}),c.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[c.jsx(Zve,{data:e.usage}),c.jsx(Jve,{data:e.bandwidth})]}),c.jsx(ege,{files:e.topFiles})]}):c.jsx(nge,{})}function Ap({status:e}){const t={SUCCESS:{icon:ao,label:"Active",className:"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20"},PENDING:{icon:Qo,label:"Pending",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20"},FAILED:{icon:f$,label:"Failed",className:"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20"},DISABLED:{icon:lr,label:"Disabled",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20"}},{icon:n,label:r,className:i}=t[e];return c.jsxs(qe,{className:i,variant:"outline",children:[c.jsx(n,{className:"mr-1 h-3 w-3"}),r]})}function bl({text:e}){const t=async()=>{await navigator.clipboard.writeText(e),Ot.success("Copied to clipboard")};return c.jsx(Ce,{onClick:t,size:"sm",variant:"ghost",children:c.jsx(Kj,{className:"h-3 w-3"})})}function age({settings:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zf,{className:"h-5 w-5"}),c.jsx(Le,{children:"S3 Bucket"})]}),c.jsx(Ap,{status:"SUCCESS"})]}),c.jsx(We,{children:"Your storage bucket for uploading files"})]}),c.jsx($e,{className:"space-y-4",children:c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Bucket Name"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.bucketName}),c.jsx(bl,{text:e.bucketName})]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Region"}),c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.region})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Versioning"}),c.jsx(qe,{variant:e.versioning?"default":"secondary",children:e.versioning?"Enabled":"Disabled"})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Encryption"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"text-sm",children:"AES-256"})]})]}),e.retention&&e.retention!=="none"&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Auto-Cleanup"}),c.jsx("span",{className:"text-sm",children:e.retention})]})]})]})})]})}function ige({settings:e}){var i,o;const[t,n]=w.useState(!1);if(!((i=e.cdn)!=null&&i.enabled))return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-5 w-5"}),c.jsx(Le,{children:"CloudFront CDN"})]}),c.jsx(Ap,{status:"DISABLED"})]}),c.jsx(We,{children:"CDN is not enabled for this storage bucket"})]})});const r=e.cdn.status==="Deployed"?"SUCCESS":e.cdn.status==="InProgress"?"PENDING":"FAILED";return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-5 w-5"}),c.jsx(Le,{children:"CloudFront CDN"})]}),c.jsx(Ap,{status:r})]}),c.jsx(We,{children:"Global content delivery network for fast file access"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4",children:[e.cdn.distributionId&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Distribution ID"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.cdn.distributionId}),c.jsx(bl,{text:e.cdn.distributionId})]})]}),c.jsx(qt,{})]}),e.cdn.distributionDomain&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"CloudFront URL"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("a",{className:"text-blue-600 text-sm hover:underline dark:text-blue-400",href:`https://${e.cdn.distributionDomain}`,rel:"noopener noreferrer",target:"_blank",children:[e.cdn.distributionDomain,c.jsx(Gu,{className:"ml-1 inline h-3 w-3"})]}),c.jsx(bl,{text:`https://${e.cdn.distributionDomain}`})]})]}),c.jsx(qt,{})]}),e.cdn.customDomain&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Custom Domain"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("a",{className:"text-blue-600 text-sm hover:underline dark:text-blue-400",href:`https://${e.cdn.customDomain}`,rel:"noopener noreferrer",target:"_blank",children:[e.cdn.customDomain,c.jsx(Gu,{className:"ml-1 inline h-3 w-3"})]}),c.jsx(bl,{text:`https://${e.cdn.customDomain}`})]})]})]}),((o=e.certificate)==null?void 0:o.validationRecords)&&e.certificate.validationRecords.length>0&&e.certificate.status==="PENDING_VALIDATION"&&c.jsxs(fs,{onOpenChange:n,open:t,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-between",variant:"ghost",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(lr,{className:"h-4 w-4 text-yellow-500"}),"Certificate DNS Records Required"]}),t?c.jsx("span",{className:"text-xs",children:"Hide"}):c.jsx("span",{className:"text-xs",children:"Show"})]})}),c.jsxs(hs,{className:"mt-2 space-y-2",children:[c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Action Required"}),c.jsx(Hn,{children:"Add these DNS records to verify your custom domain certificate"})]}),e.certificate.validationRecords.map((l,u)=>c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3 font-mono text-xs",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:l.type}),c.jsx(bl,{text:l.value})]}),c.jsx("div",{className:"mt-1 break-all",children:l.name}),c.jsxs("div",{className:"mt-1 break-all text-muted-foreground",children:["→ ",l.value]})]},u))]})]})]})]})}function oge({settings:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),c.jsx(Le,{children:"IAM Role"})]}),c.jsx(Ap,{status:"SUCCESS"})]}),c.jsx(We,{children:"Role used by your application to access storage"})]}),c.jsx($e,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Role ARN"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"max-w-[300px] truncate rounded bg-muted px-2 py-1 font-mono text-xs",children:e.roleArn}),c.jsx(bl,{text:e.roleArn})]})]})})]})}function sge(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-32"}),c.jsx(Re,{className:"h-4 w-64"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"})]})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-32"}),c.jsx(Re,{className:"h-4 w-64"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"})]})})]})]})}function lge(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function cge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0),o(null);const u=sessionStorage.getItem("wraps-auth-token"),d=await fetch(`/api/cdn/settings?token=${u}`);if(!d.ok){if(d.status===404){t(null);return}throw new Error("Failed to fetch storage settings")}const h=await d.json();t(h)}catch(u){o(u instanceof Error?u.message:"An error occurred")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsx(sge,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"Storage Settings"}),c.jsx("p",{className:"text-muted-foreground",children:"Manage your S3 bucket and CloudFront CDN configuration"})]}),c.jsxs(Ce,{onClick:l,size:"sm",variant:"outline",children:[c.jsx(Bf,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),c.jsx(age,{settings:e}),c.jsx(ige,{settings:e}),c.jsx(oge,{settings:e})]}):c.jsx(lge,{})}function Nl({className:e,...t}){return c.jsx("div",{className:me("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),"data-slot":"input-group",role:"group",...t})}const uge=mc("flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 font-medium text-muted-foreground text-sm group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function la({className:e,align:t="inline-start",...n}){return c.jsx("div",{className:me(uge({align:t}),e),"data-align":t,"data-slot":"input-group-addon",onClick:r=>{var i,o;r.target.closest("button")||(o=(i=r.currentTarget.parentElement)==null?void 0:i.querySelector("input"))==null||o.focus()},role:"group",...n})}function Al({className:e,...t}){return c.jsx("span",{className:me("flex items-center gap-2 text-muted-foreground text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",e),...t})}function Cl({className:e,...t}){return c.jsx(oo,{className:me("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),"data-slot":"input-group-control",...t})}var Jv="Tabs",[fge]=jn(Jv,[hc]),Z6=hc(),[dge,KE]=fge(Jv),J6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...h}=e,v=lc(u),[m,g]=Nn({prop:r,onChange:i,defaultProp:o??"",caller:Jv});return c.jsx(dge,{scope:n,baseId:Cr(),value:m,onValueChange:g,orientation:l,dir:v,activationMode:d,children:c.jsx(Ne.div,{dir:v,"data-orientation":l,...h,ref:t})})});J6.displayName=Jv;var e8="TabsList",t8=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=KE(e8,n),l=Z6(n);return c.jsx(uO,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(Ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});t8.displayName=e8;var n8="TabsTrigger",r8=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=KE(n8,n),u=Z6(n),d=o8(l.baseId,r),h=s8(l.baseId,r),v=r===l.value;return c.jsx(fO,{asChild:!0,...u,focusable:!i,active:v,children:c.jsx(Ne.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":h,"data-state":v?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:ye(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:ye(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:ye(e.onFocus,()=>{const m=l.activationMode!=="manual";!v&&!i&&m&&l.onValueChange(r)})})})});r8.displayName=n8;var a8="TabsContent",i8=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,u=KE(a8,n),d=o8(u.baseId,r),h=s8(u.baseId,r),v=r===u.value,m=w.useRef(v);return w.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),c.jsx(An,{present:i||v,children:({present:g})=>c.jsx(Ne.div,{"data-state":v?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:h,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:g&&o})})});i8.displayName=a8;function o8(e,t){return`${e}-trigger-${t}`}function s8(e,t){return`${e}-content-${t}`}var hge=J6,mge=t8,pge=r8,vge=i8;function l8({className:e,...t}){return c.jsx(hge,{className:me("flex flex-col gap-2",e),"data-slot":"tabs",...t})}function c8({className:e,...t}){return c.jsx(mge,{className:me("inline-flex h-9 w-fit items-center justify-center rounded-lg bg-muted p-[3px] text-muted-foreground",e),"data-slot":"tabs-list",...t})}function Uu({className:e,...t}){return c.jsx(pge,{className:me("inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-1 font-medium text-foreground text-sm transition-[color,box-shadow] focus-visible:border-ring focus-visible:outline-1 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:shadow-sm dark:text-muted-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"tabs-trigger",...t})}function Hu({className:e,...t}){return c.jsx(vge,{className:me("flex-1 outline-none",e),"data-slot":"tabs-content",...t})}function gge({messageId:e,archivingEnabled:t}){const[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);return w.useEffect(()=>{async function d(){if(!t){o(!1);return}try{o(!0),u(null);const h=sessionStorage.getItem("wraps-auth-token");if(!h)throw new Error("Authentication token not found");const v=encodeURIComponent(e),m=await fetch(`/api/emails/${v}/archive?token=${h}`);if(!m.ok){if(m.status===404){r(null),o(!1);return}throw new Error(`Failed to fetch archived email: ${m.statusText}`)}const g=await m.json();r({...g,timestamp:new Date(g.timestamp)})}catch(h){const v=h instanceof Error?h.message:"Unknown error";u(v),console.error("Error fetching archived email:",h)}finally{o(!1)}}d()},[e,t]),t?i?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Loading archived email content..."})]}),c.jsx($e,{className:"space-y-4",children:c.jsx(Re,{className:"h-[400px] w-full"})})]}):l?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Failed to load archived email"})]}),c.jsx($e,{children:c.jsx(Un,{variant:"destructive",children:c.jsx(Hn,{children:l})})})]}):n?c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Full email content stored in AWS SES Mail Manager"})]}),n.attachments.length>0&&c.jsxs(qe,{variant:"secondary",children:[n.attachments.length," attachment",n.attachments.length>1?"s":""]})]})}),c.jsxs($e,{children:[c.jsxs(l8,{className:"w-full",defaultValue:"rendered",children:[c.jsxs(c8,{className:"grid w-full grid-cols-3",children:[c.jsxs(Uu,{className:"gap-2",value:"rendered",children:[c.jsx(Vu,{className:"h-4 w-4"}),"Rendered Email"]}),c.jsxs(Uu,{className:"gap-2",value:"text",children:[c.jsx(d$,{className:"h-4 w-4"}),"Plain Text"]}),c.jsxs(Uu,{className:"gap-2",value:"html",children:[c.jsx(OF,{className:"h-4 w-4"}),"HTML Source"]})]}),c.jsxs(Hu,{className:"space-y-4",value:"rendered",children:[n.html?c.jsx("div",{className:"rounded-md border",children:c.jsx("iframe",{className:"h-[600px] w-full rounded-md",sandbox:"allow-same-origin",srcDoc:n.html,title:"Email preview"})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No HTML content available for this email. View the plain text tab instead."})}),n.attachments.length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"font-medium text-sm",children:"Attachments"}),c.jsx("div",{className:"space-y-2",children:n.attachments.map((d,h)=>c.jsx("div",{className:"flex items-center justify-between rounded-md border p-3",children:c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"font-mono text-sm",children:d.filename||`Attachment ${h+1}`}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:[d.contentType," •"," ",(d.size/1024).toFixed(2)," KB"]})]})},d.filename||`attachment-${h}`))})]})]}),c.jsx(Hu,{className:"space-y-4",value:"text",children:n.text?c.jsx("div",{className:"rounded-md border bg-muted p-4",children:c.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm",children:n.text})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No plain text content available for this email."})})}),c.jsx(Hu,{className:"space-y-4",value:"html",children:n.html?c.jsx("div",{className:"rounded-md border bg-muted p-4",children:c.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap font-mono text-xs",children:n.html})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No HTML content available for this email."})})})]}),n.metadata&&c.jsxs("div",{className:"mt-6 space-y-3 rounded-md border p-4",children:[c.jsx("div",{className:"font-medium text-sm",children:"SMTP Metadata"}),c.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[n.metadata.senderIp&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"Sender IP"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.senderIp})]}),n.metadata.tlsProtocol&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"TLS Protocol"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.tlsProtocol})]}),n.metadata.senderHostname&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"Sender Hostname"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.senderHostname})]})]})]})]})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Email content not available"})]}),c.jsx($e,{children:c.jsx(Un,{children:c.jsx(Hn,{children:"This email was not archived. It may have been sent before email archiving was enabled for this deployment."})})})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Enable email archiving to view full email content"})]}),c.jsx($e,{children:c.jsx(Un,{children:c.jsxs(Hn,{children:["Email archiving is not enabled for this deployment. Run"," ",c.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"wraps upgrade"})," ","to enable archiving and view full email content with HTML rendering."]})})})]})}const yge={sent:xl,delivered:ri,bounced:or,suppressed:wF,complained:or,opened:xl,clicked:xl,failed:or},bge={sent:"text-blue-500",delivered:"text-green-500",bounced:"text-red-500",suppressed:"text-amber-500",complained:"text-red-500",opened:"text-purple-500",clicked:"text-indigo-500",failed:"text-red-500"},xge={delivered:"default",sent:"secondary",bounced:"destructive",suppressed:"destructive",complained:"destructive",failed:"destructive",opened:"default",clicked:"default"};function wge(){const{id:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null),[d,h]=w.useState(!1);w.useEffect(()=>{async function g(){var b,O,S;try{o(!0),u(null);const x=sessionStorage.getItem("wraps-auth-token");if(!x)throw new Error("Authentication token not found");try{const A=await fetch(`/api/settings/deployment?token=${x}`);if(A.ok){const M=await A.json();h(M.archivingEnabled??!1)}}catch(A){console.warn("Failed to fetch deployment config:",A)}const E=encodeURIComponent(e||"");console.log("Fetching email with ID:",e),console.log("Encoded ID:",E),console.log("Full URL:",`/api/emails/${E}?token=${x.substring(0,8)}...`);const N=await fetch(`/api/emails/${E}?token=${x}`);if(!N.ok){let A="Failed to fetch email details";try{A=(await N.json()).error||A}catch{A=`${N.status}: ${N.statusText}`}throw new Error(A)}const _=N.headers.get("content-type");if(!(_!=null&&_.includes("application/json"))){const A=await N.text();throw console.error("Non-JSON response:",A),new Error("Server returned non-JSON response")}const C=await N.json();console.log("Email data received:",{id:C.id,hasHtmlBody:!!C.htmlBody,hasTextBody:!!C.textBody,htmlBodyLength:((b=C.htmlBody)==null?void 0:b.length)||0,textBodyLength:((O=C.textBody)==null?void 0:O.length)||0,events:((S=C.events)==null?void 0:S.length)||0}),r(C)}catch(x){const E=x instanceof Error?x.message:"Unknown error";u(E),console.error("Error fetching email details:",x)}finally{o(!1)}}e&&g()},[e]);const v=g=>new Date(g).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),m=g=>new Date(g).toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});return i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading email details..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back"]})}),c.jsx(Te,{children:c.jsxs(Me,{className:"space-y-1.5",children:[c.jsxs(Le,{className:"flex flex-row items-center gap-2 text-xl",children:[c.jsx("span",{className:"text-xl",children:n.subject||"(no subject)"}),c.jsx(qe,{className:"shrink-0",variant:xge[n.status],children:n.status.charAt(0).toUpperCase()+n.status.slice(1)})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 truncate rounded bg-muted px-2 py-0.5 font-mono text-muted-foreground text-xs",children:n.messageId}),c.jsx(fa,{className:"h-6 w-6 shrink-0",size:"sm",value:n.messageId,variant:"ghost"})]}),c.jsxs("div",{className:"flex flex-col gap-3 pt-2 sm:flex-row sm:flex-wrap",children:[c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"From"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm *:select-all",disabled:!0,readOnly:!0,value:n.from}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.from,variant:"ghost"})})]}),c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"To"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm *:select-all",disabled:!0,readOnly:!0,value:n.to.length>0?n.to.join(", "):"(no recipients)"}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.to.join(", "),variant:"ghost"})})]}),n.replyTo&&c.jsxs(Nl,{className:"w-full sm:w-auto sm:max-w-md",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"Reply-To"})}),c.jsx(Cl,{className:"min-w-0 truncate font-mono text-sm",readOnly:!0,value:n.replyTo}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.replyTo,variant:"ghost"})})]})]})]})}),d&&c.jsx(gge,{archivingEnabled:d,messageId:n.messageId}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Events"}),c.jsx(We,{children:"Lifecycle of this email from send to delivery"})]}),c.jsx($e,{children:c.jsx("div",{className:"space-y-4",children:n.events.length===0?c.jsx("div",{className:"text-muted-foreground text-sm",children:"No events recorded yet"}):n.events.map((g,b)=>{const O=yge[g.type]||Qo,S=b===n.events.length-1;return c.jsx("div",{children:c.jsxs("div",{className:"flex gap-4",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("div",{className:`rounded-full border-2 border-background bg-muted p-2 ${bge[g.type]}`,children:c.jsx(O,{className:"h-4 w-4"})}),!S&&c.jsx("div",{className:"my-1 w-px flex-1 bg-border"})]}),c.jsxs("div",{className:"flex-1 pb-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"font-medium capitalize",children:g.type}),c.jsx("div",{className:"text-muted-foreground text-sm",children:v(g.timestamp)})]}),c.jsx("div",{className:"text-muted-foreground text-sm",children:m(g.timestamp)}),g.metadata&&Object.keys(g.metadata).length>0&&c.jsx("div",{className:"mt-2 rounded-md border bg-muted/50 p-2 font-mono text-xs",children:c.jsx("pre",{className:"overflow-x-auto",children:JSON.stringify(g.metadata,null,2)})})]})]})},`${g.type}-${g.timestamp}`)})})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"Email not found"})]})}function Sge(e){const t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/(1e3*60*60*24));return r===0?t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):r===1?"Yesterday":r<7?`${r} days ago`:t.toLocaleDateString()}function jge(){const e=Sa(),[t,n]=w.useState([]),[r,i]=w.useState(!0),[o,l]=w.useState(null),[u,d]=w.useState("");w.useEffect(()=>{async function v(){try{i(!0),l(null);const m=sessionStorage.getItem("wraps-auth-token");if(!m)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const g=await fetch(`/api/inbound?limit=50&token=${m}`);if(!g.ok){let O="Failed to fetch inbound emails";try{O=(await g.json()).error||O}catch{O=`${g.status}: ${g.statusText}`}throw new Error(O)}const b=await g.json();n(b.emails||[])}catch(m){const g=m instanceof Error?m.message:"Unknown error";l(g),console.error("Error fetching inbound emails:",m)}finally{i(!1)}}v()},[]);const h=t.filter(v=>{if(!u)return!0;const m=u.toLowerCase(),g=v.from.address.toLowerCase().includes(m)||v.from.name.toLowerCase().includes(m),b=v.subject.toLowerCase().includes(m),O=v.to.some(S=>S.address.toLowerCase().includes(m)||S.name.toLowerCase().includes(m));return g||b||O});return c.jsxs("div",{className:"space-y-4",children:[o&&c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:o}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:v=>d(v.target.value),placeholder:"Search inbound emails...",value:u})]})}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"From"}),c.jsx(Pt,{children:"Subject"}),c.jsx(Pt,{children:"Received"}),c.jsx(Pt,{className:"w-[100px]",children:"Attachments"}),c.jsx(Pt,{className:"w-[80px]",children:"Spam"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:r?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:6,children:"Loading inbound emails..."})}):h.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:6,children:t.length===0?"No inbound emails received yet":"No emails match your search"})}):h.map(v=>c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/email/inbound/${v.emailId}`),children:[c.jsxs(mt,{className:"font-mono text-sm",children:[v.from.name||v.from.address,v.from.name&&c.jsxs("span",{className:"ml-1 text-muted-foreground text-xs",children:["<",v.from.address,">"]})]}),c.jsx(mt,{className:"max-w-[300px] truncate",children:v.subject||"(no subject)"}),c.jsx(mt,{className:"text-muted-foreground",children:Sge(v.receivedAt)}),c.jsx(mt,{children:v.hasAttachments&&c.jsxs(qe,{className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20",variant:"outline",children:[c.jsx(m$,{className:"mr-1 h-3 w-3"}),v.attachmentCount]})}),c.jsx(mt,{children:v.spamVerdict==="PASS"?c.jsx(v$,{className:"h-4 w-4 text-green-500"}):v.spamVerdict==="FAIL"?c.jsx(p$,{className:"h-4 w-4 text-red-500"}):null}),c.jsx(mt,{children:c.jsx(bF,{className:"h-4 w-4 text-muted-foreground"})})]},v.emailId))})]})}),h.length>0&&!r&&c.jsx("div",{className:"flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",h.length," of ",t.length," inbound emails"]})})]})}const H1={clicked:{variant:"default",description:"Recipient clicked a link in the email",className:"bg-purple-500/10 text-purple-700 dark:text-purple-400 hover:bg-purple-500/20 border-purple-500/20"},opened:{variant:"default",description:"Recipient opened the email",className:"bg-blue-500/10 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-blue-500/20"},delivered:{variant:"default",description:"Email was successfully delivered to recipient's mailbox",className:"bg-green-500/10 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-green-500/20"},sent:{variant:"secondary",description:"Email was sent but delivery not yet confirmed",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 hover:bg-gray-500/20 border-gray-500/20"},bounced:{variant:"default",description:"Email bounced - recipient's mailbox may not exist or be full",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 hover:bg-orange-500/20 border-orange-500/20"},suppressed:{variant:"default",description:"Email blocked - recipient is on the suppression list",className:"bg-amber-500/10 text-amber-700 dark:text-amber-400 hover:bg-amber-500/20 border-amber-500/20"},complained:{variant:"default",description:"Recipient marked this email as spam",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},failed:{variant:"default",description:"Email failed to send due to an error",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"}};function Oge(){const e=Sa(),[t,n]=w.useState(""),[r,i]=w.useState("15"),[o,l]=w.useState("all"),[u,d]=cF(),[h,v]=w.useState(u.get("tab")==="receiving"?"receiving":"sending"),[m,g]=w.useState([]),[b,O]=w.useState(!0),[S,x]=w.useState(null);w.useEffect(()=>{async function _(){try{O(!0),x(null);let C=sessionStorage.getItem("wraps-auth-token");if(C||(C=new URLSearchParams(window.location.search).get("token"),C&&sessionStorage.setItem("wraps-auth-token",C)),!C)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const A=Number.parseInt(r,10),M=Date.now()-A*24*60*60*1e3,R=Date.now(),D=await fetch(`/api/emails?startTime=${M}&endTime=${R}&limit=100&token=${C}`);if(!D.ok){let G="Failed to fetch email logs";try{G=(await D.json()).error||G}catch{G=`${D.status}: ${D.statusText}`}throw new Error(G)}const z=await D.json();g(z.logs.map(G=>({id:G.messageId,to:G.to,from:G.from,subject:G.subject,status:G.status,timestamp:G.sentAt,messageId:G.messageId})))}catch(C){const A=C instanceof Error?C.message:"Unknown error";x(A),console.error("Error fetching email logs:",C)}finally{O(!1)}}_()},[r]);const E=m.filter(_=>{if(t){const C=t.toLowerCase(),A=_.to.some(R=>R.toLowerCase().includes(C)),M=_.subject.toLowerCase().includes(C);if(!(A||M))return!1}return!(o!=="all"&&_.status!==o)}),N=_=>{const C=new Date(_),M=Math.floor((new Date().getTime()-C.getTime())/(1e3*60*60*24));return M===0?"Today":M===1?"Yesterday":M<7?`${M} days ago`:C.toLocaleDateString()};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Emails"}),c.jsx(We,{children:"View and manage your email sending history"})]}),c.jsx($e,{children:c.jsxs(l8,{onValueChange:_=>{v(_),d(_==="sending"?{}:{tab:_})},value:h,children:[c.jsxs(c8,{children:[c.jsx(Uu,{value:"sending",children:"Sending"}),c.jsx(Uu,{value:"receiving",children:"Receiving"})]}),c.jsxs(Hu,{className:"space-y-4",value:"sending",children:[S&&c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:S}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:_=>n(_.target.value),placeholder:"Search...",value:t})]}),c.jsxs(ma,{onValueChange:i,value:r,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]}),c.jsxs(ma,{onValueChange:l,value:o,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"all",children:"All Statuses"}),c.jsx(Fe,{value:"clicked",children:"Clicked"}),c.jsx(Fe,{value:"opened",children:"Opened"}),c.jsx(Fe,{value:"delivered",children:"Delivered"}),c.jsx(Fe,{value:"sent",children:"Sent"}),c.jsx(Fe,{value:"bounced",children:"Bounced"}),c.jsx(Fe,{value:"suppressed",children:"Suppressed"}),c.jsx(Fe,{value:"complained",children:"Complained"}),c.jsx(Fe,{value:"failed",children:"Failed"})]})]}),c.jsxs(Ce,{size:"icon",variant:"outline",children:[c.jsx("span",{className:"sr-only",children:"Download"}),"↓"]})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"To"}),c.jsx(Pt,{children:"Status"}),c.jsx(Pt,{children:"Subject"}),c.jsx(Pt,{children:"Sent"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:b?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"Loading email logs..."})}):E.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"No emails found"})}):E.map(_=>{var C,A,M;return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/email/${_.id}`),children:[c.jsx(mt,{className:"font-mono text-sm",children:_.to.length>0?c.jsxs(c.Fragment,{children:[_.to[0],_.to.length>1&&c.jsxs("span",{className:"ml-1 text-muted-foreground text-xs",children:["+",_.to.length-1," more"]})]}):c.jsx("span",{className:"text-muted-foreground",children:"(no recipients)"})}),c.jsx(mt,{children:c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsx(qe,{className:(C=H1[_.status])==null?void 0:C.className,variant:((A=H1[_.status])==null?void 0:A.variant)??"default",children:_.status.charAt(0).toUpperCase()+_.status.slice(1)})}),c.jsx(rv,{children:c.jsx("p",{children:((M=H1[_.status])==null?void 0:M.description)??"Unknown status"})})]})}),c.jsx(mt,{className:"max-w-[400px] truncate",children:_.subject}),c.jsx(mt,{className:"text-muted-foreground",children:N(_.timestamp)}),c.jsx(mt,{children:c.jsxs(Ce,{onClick:R=>{R.stopPropagation()},size:"icon",variant:"ghost",children:[c.jsx("span",{className:"sr-only",children:"More options"}),"⋯"]})})]},_.id)})})]})}),E.length>0&&!b&&c.jsx("div",{className:"flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",E.length," of ",m.length," emails"]})})]}),c.jsx(Hu,{className:"space-y-4",value:"receiving",children:c.jsx(jge,{})})]})})]})}function Ege({data:e}){const t=_ge(e);return t.length===0?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Metrics"}),c.jsx(We,{children:"Performance over the last 24 hours"})]}),c.jsx($e,{children:c.jsx("div",{className:"flex h-[400px] items-center justify-center text-muted-foreground",children:"No metrics data available yet"})})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Metrics"}),c.jsx(We,{children:"Performance over the last 24 hours"})]}),c.jsx($e,{children:c.jsx(dE,{height:400,width:"100%",children:c.jsxs(Q6,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"timestamp",tickFormatter:n=>fS(new Date(n),"HH:mm")}),c.jsx(fi,{className:"text-xs"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))"},labelFormatter:n=>fS(new Date(n),"MMM d, HH:mm")}),c.jsx(ei,{}),c.jsx(Nr,{dataKey:"sends",name:"Sends",stroke:"hsl(var(--primary))",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"deliveries",name:"Deliveries",stroke:"#82ca9d",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"opens",name:"Opens",stroke:"#8884d8",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"clicks",name:"Clicks",stroke:"#ffc658",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"bounces",name:"Bounces",stroke:"#ff7300",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"complaints",name:"Complaints",stroke:"hsl(var(--destructive))",strokeWidth:2,type:"monotone"})]})})})]})}function _ge(e){const t=new Map;[...e.sends,...e.bounces,...e.complaints,...e.deliveries,...e.opens,...e.clicks].forEach(n=>{t.has(n.timestamp)||t.set(n.timestamp,{timestamp:n.timestamp,sends:0,bounces:0,complaints:0,deliveries:0,opens:0,clicks:0})});for(const n of e.sends)t.get(n.timestamp).sends=n.value;for(const n of e.bounces)t.get(n.timestamp).bounces=n.value;for(const n of e.complaints)t.get(n.timestamp).complaints=n.value;for(const n of e.deliveries)t.get(n.timestamp).deliveries=n.value;for(const n of e.opens)t.get(n.timestamp).opens=n.value;for(const n of e.clicks)t.get(n.timestamp).clicks=n.value;return Array.from(t.values()).sort((n,r)=>n.timestamp-r.timestamp)}function Nge({quota:e}){const t=e.sentLast24Hours/e.max24HourSend*100,n=t>90?"destructive":t>70?"warning":"default";return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center justify-between",children:["SES Quota",c.jsxs(qe,{variant:n==="destructive"?"destructive":"secondary",children:[t.toFixed(1),"% used"]})]}),c.jsx(We,{children:"24-hour sending limits"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Emails sent"}),c.jsxs("span",{className:"font-medium",children:[e.sentLast24Hours.toLocaleString()," /"," ",e.max24HourSend.toLocaleString()]})]}),c.jsx(pv,{className:"h-2",value:t})]}),c.jsxs("div",{className:"flex items-center justify-between border-t pt-2",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Max send rate"}),c.jsxs("span",{className:"font-medium text-sm",children:[e.maxSendRate," emails/sec"]})]})]})]})}function Age(){const[e,t]=w.useState("1"),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);if(w.useEffect(()=>{async function N(){try{o(!0),u(null);let _=sessionStorage.getItem("wraps-auth-token");if(_||(_=new URLSearchParams(window.location.search).get("token"),_&&sessionStorage.setItem("wraps-auth-token",_)),!_)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const C=Number.parseInt(e,10),A=Date.now()-C*24*60*60*1e3,M=Date.now(),R=await fetch(`/api/metrics?startTime=${A}&endTime=${M}&token=${_}`);if(!R.ok){let z="Failed to fetch email metrics";try{z=(await R.json()).error||z}catch{z=`${R.status}: ${R.statusText}`}throw new Error(z)}const D=await R.json();r(D)}catch(_){const C=_ instanceof Error?_.message:"Unknown error";u(C),console.error("Error fetching email metrics:",_)}finally{o(!1)}}N()},[e]),l)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsx("div",{className:"mt-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]});if(i||!n)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsx("div",{className:"mt-4 flex h-[400px] items-center justify-center text-muted-foreground",children:"Loading metrics..."})]});const d=n.metrics.sends.reduce((N,_)=>N+_.value,0)||0,h=n.metrics.deliveries.reduce((N,_)=>N+_.value,0)||0,v=n.metrics.bounces.reduce((N,_)=>N+_.value,0)||0,m=n.metrics.complaints.reduce((N,_)=>N+_.value,0)||0,g=n.metrics.opens.reduce((N,_)=>N+_.value,0)||0,b=n.metrics.clicks.reduce((N,_)=>N+_.value,0)||0,O=d>0?h/d*100:0,S=h>0?g/h*100:0,x=g>0?b/g*100:0,E=[{title:"Emails Sent",value:d.toLocaleString(),description:`${e==="1"?"Last 24 hours":`Last ${e} days`}`,icon:xl},{title:"Delivery Rate",value:`${O.toFixed(1)}%`,description:`${h.toLocaleString()} delivered`,icon:Zj},{title:"Open Rate",value:`${S.toFixed(1)}%`,description:`${g.toLocaleString()} opened`,icon:Dp},{title:"Click Rate",value:`${x.toFixed(1)}%`,description:`${b.toLocaleString()} clicked`,icon:LF}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsxs(ma,{onValueChange:t,value:e,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:E.map(N=>c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx(Le,{className:"font-medium text-sm",children:N.title}),c.jsx(N.icon,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:N.value}),c.jsx("p",{className:"text-muted-foreground text-xs",children:N.description})]})]},N.title))}),c.jsx(Nge,{quota:n.quota}),c.jsx(Ege,{data:n.metrics}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Metrics Summary"}),c.jsx(We,{children:"Detailed breakdown of your email performance"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Total Emails Sent"}),c.jsx(qe,{variant:"outline",children:d.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Successfully Delivered"}),c.jsx(qe,{variant:"default",children:h.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Opened"}),c.jsx(qe,{variant:"default",children:g.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Clicked"}),c.jsx(qe,{variant:"default",children:b.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Bounced"}),c.jsx(qe,{variant:"destructive",children:v.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Complaints"}),c.jsx(qe,{variant:"destructive",children:m.toLocaleString()})]})]})]})]})}async function Cge(){const e=sessionStorage.getItem("wraps-auth-token");if(!e)throw new Error("Authentication token not found");const t=await fetch(`/api/settings?token=${e}`);if(!t.ok)throw new Error(`Failed to fetch settings: ${t.statusText}`);return await t.json()}const u8="wraps-dns-verification",Tge=1e3*60*60;function f8(){try{const e=localStorage.getItem(u8);return e?JSON.parse(e):{}}catch{return{}}}function Cp(e){try{localStorage.setItem(u8,JSON.stringify(e))}catch(t){console.error("Failed to save DNS verification cache:",t)}}function d8(e){return e?Date.now()-e.lastChecked<Tge:!1}async function U4(e,t){var i;console.log("[DNS Verify] verifyTrackingDomain called",{domain:e,expectedTarget:t});const n=f8(),r=`${e}->${t}`;if((i=n.trackingDomain)!=null&&i[r]&&d8(n.trackingDomain[r]))return console.log("[DNS Verify] Returning cached result"),n.trackingDomain[r];try{const l=`/api/settings/verify-tracking-domain?token=${sessionStorage.getItem("wraps-auth-token")}&domain=${encodeURIComponent(e)}&expectedTarget=${encodeURIComponent(t)}`;console.log("[DNS Verify] Fetching:",l);const u=await fetch(l);if(console.log("[DNS Verify] Response status:",u.status),!u.ok)throw new Error(`HTTP ${u.status}: ${u.statusText}`);const d=await u.json();console.log("[DNS Verify] Response data:",d);const h={verified:d.verified,lastChecked:Date.now(),error:d.error};return n.trackingDomain||(n.trackingDomain={}),n.trackingDomain[r]=h,Cp(n),h}catch(o){console.error("Tracking domain verification request failed:",o);const l={verified:!1,lastChecked:Date.now(),error:o instanceof Error?o.message:"Failed to verify"};return n.trackingDomain||(n.trackingDomain={}),n.trackingDomain[r]=l,Cp(n),l}}async function H4(e){var r;console.log("[DNS Verify] verifyDmarc called",{domain:e});const t=f8(),n=`_dmarc.${e}`;if((r=t.dmarc)!=null&&r[n]&&d8(t.dmarc[n]))return console.log("[DNS Verify] Returning cached DMARC result"),t.dmarc[n];try{const o=`/api/settings/verify-dmarc?token=${sessionStorage.getItem("wraps-auth-token")}&domain=${encodeURIComponent(e)}`;console.log("[DNS Verify] Fetching:",o);const l=await fetch(o);if(console.log("[DNS Verify] Response status:",l.status),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);const u=await l.json();console.log("[DNS Verify] Response data:",u);const d={verified:u.verified,lastChecked:Date.now(),error:u.error};return t.dmarc||(t.dmarc={}),t.dmarc[n]=d,Cp(t),d}catch(i){console.error("DMARC verification request failed:",i);const o={verified:!1,lastChecked:Date.now(),error:i instanceof Error?i.message:"Failed to verify"};return t.dmarc||(t.dmarc={}),t.dmarc[n]=o,Cp(t),o}}function XE({status:e}){const t={SUCCESS:{icon:ao,label:"Verified",variant:"default",className:"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20"},PENDING:{icon:Qo,label:"Pending",variant:"secondary",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20"},FAILED:{icon:f$,label:"Failed",variant:"destructive",className:"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20"},TEMPORARY_FAILURE:{icon:lr,label:"Temporary Failure",variant:"secondary",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 border-orange-500/20"},NOT_STARTED:{icon:Qo,label:"Not Started",variant:"outline",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20"}},{icon:n,label:r,className:i}=t[e];return c.jsxs(qe,{className:i,variant:"outline",children:[c.jsx(n,{className:"mr-1 h-3 w-3"}),r]})}function tc({text:e}){const t=async()=>{await navigator.clipboard.writeText(e),Ot.success("Copied to clipboard",{description:"DNS record value copied successfully"})};return c.jsx(Ce,{onClick:t,size:"sm",variant:"ghost",children:c.jsx(Kj,{className:"h-3 w-3"})})}function Mge({identity:e}){const t=e==null?void 0:e.dkimAttributes,n=(t==null?void 0:t.status)==="SUCCESS",[r,i]=w.useState(!n);return t?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DKIM Authentication"}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:[t.signingEnabled?"Enabled":"Disabled",t.signingKeyLength&&` · ${t.signingKeyLength}`]})]}),c.jsx(XE,{status:t.status})]}),t.tokens&&t.tokens.length>0&&c.jsxs(fs,{onOpenChange:i,open:r,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Records (CNAME)"}),r?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2 space-y-2",children:t.tokens.map(o=>c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:[o,"._domainkey.",e.identityName]}),c.jsx(tc,{text:`${o}._domainkey.${e.identityName}`})]}),c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["CNAME → ",o,".dkim.amazonses.com"]})]},o))})]})]}):c.jsx("div",{className:"space-y-4",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DKIM Authentication"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Not configured"})]})})})}function Rge({identity:e}){const t=e==null?void 0:e.mailFromAttributes,n=(t==null?void 0:t.mailFromDomainStatus)==="SUCCESS",[r,i]=w.useState(!n);return c.jsx("div",{className:"space-y-4",children:t!=null&&t.mailFromDomain?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Mail-From Domain"}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:[t.mailFromDomain,t.behaviorOnMxFailure&&` · ${t.behaviorOnMxFailure==="USE_DEFAULT_VALUE"?"Fallback enabled":"Reject on failure"}`]})]}),t.mailFromDomainStatus&&c.jsx(XE,{status:t.mailFromDomainStatus})]}),c.jsxs(fs,{onOpenChange:i,open:r,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Record (MX)"}),r?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsx("div",{className:"rounded-md border bg-muted/50 p-3",children:c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:["MX ",t.mailFromDomain]}),c.jsx(tc,{text:`10 feedback-smtp.${e==null?void 0:e.identityName.split(".")[0]}.amazonses.com`})]}),c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["Priority 10 → feedback-smtp.",e==null?void 0:e.identityName.split(".")[0],".amazonses.com"]})]})})})]})]}):c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Mail-From Domain"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Using default amazonses.com domain"})]})})})}function Dge({identity:e}){const[t,n]=w.useState(null),[r,i]=w.useState(!1),[o,l]=w.useState(!(t!=null&&t.verified));w.useEffect(()=>{e!=null&&e.identityName&&H4(e.identityName).then(n)},[e==null?void 0:e.identityName]),w.useEffect(()=>{t&&l(!t.verified)},[t]);const u=async()=>{if(e!=null&&e.identityName){i(!0);try{const d=await H4(e.identityName);n(d),d.verified?Ot.success("DMARC record verified",{description:"DNS TXT record found and configured correctly"}):(console.error("DMARC verification failed:",d.error),Ot.error("Verification failed",{description:d.error||"DMARC record not found"}))}catch(d){console.error("DMARC verification error:",d),Ot.error("Verification error",{description:d instanceof Error?d.message:"Unknown error"})}finally{i(!1)}}};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DMARC Policy"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:t!=null&&t.verified?"Configured":"Recommended for better deliverability"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(t==null?void 0:t.verified)&&c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Verified by Wraps"]}),c.jsx(Ce,{className:"h-8 w-8 p-0",disabled:r,onClick:u,size:"sm",variant:"ghost",children:c.jsx(Bf,{className:`h-4 w-4 ${r?"animate-spin":""}`})})]})]}),c.jsxs(fs,{onOpenChange:l,open:o,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Record (TXT)"}),o?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:["_dmarc.",(e==null?void 0:e.identityName)||"yourdomain.com"]}),c.jsx(tc,{text:`_dmarc.${(e==null?void 0:e.identityName)||"yourdomain.com"}`})]}),c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["v=DMARC1; p=quarantine; rua=mailto:dmarc@",(e==null?void 0:e.identityName)||"yourdomain.com"]}),c.jsx(tc,{text:`v=DMARC1; p=quarantine; rua=mailto:dmarc@${(e==null?void 0:e.identityName)||"yourdomain.com"}`})]})]})})]})]})}function Pge({configSet:e,region:t,onRefresh:n}){const r=e==null?void 0:e.trackingOptions,[i,o]=w.useState(null),[l,u]=w.useState(!1),[d,h]=w.useState(!1),[v,m]=w.useState(""),[g,b]=w.useState(!1),[O,S]=w.useState(!(i!=null&&i.verified));w.useEffect(()=>{if(r!=null&&r.customRedirectDomain&&t){const _=`r.${t}.awstrack.me`;U4(r.customRedirectDomain,_).then(o)}},[r==null?void 0:r.customRedirectDomain,t]),w.useEffect(()=>{i&&S(!i.verified)},[i]);const x=async()=>{if(r!=null&&r.customRedirectDomain&&t){u(!0);try{const _=`r.${t}.awstrack.me`,C=await U4(r.customRedirectDomain,_);o(C),C.verified?Ot.success("Tracking domain verified",{description:"DNS records are configured correctly"}):(console.error("Tracking domain verification failed:",C.error),Ot.error("Verification failed",{description:C.error||"DNS records not found"}))}catch(_){console.error("Tracking domain verification error:",_),Ot.error("Verification error",{description:_ instanceof Error?_.message:"Unknown error"})}finally{u(!1)}}},E=()=>{m((r==null?void 0:r.customRedirectDomain)||""),h(!0)},N=async()=>{if(!v.trim()){Ot.error("Invalid domain",{description:"Please enter a valid domain name"});return}b(!0);try{const _=sessionStorage.getItem("wraps-auth-token"),C=await fetch(`/api/settings/config-set/tracking-domain?token=${_}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:v})});if(!C.ok){const A=await C.json();throw new Error(A.error||`Failed to update: ${C.statusText}`)}h(!1),Ot.success("Tracking domain updated",{description:"Don't forget to configure the DNS records"}),n&&await n()}catch(_){console.error("Failed to update tracking domain:",_),Ot.error("Failed to update tracking domain",{description:_ instanceof Error?_.message:"Unknown error"})}finally{b(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Tracking Domain"}),c.jsx(We,{children:"Custom domain for open and click tracking links"})]}),c.jsx($e,{className:"space-y-4",children:r!=null&&r.customRedirectDomain?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"font-medium",children:r.customRedirectDomain}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Custom Tracking Domain"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(i==null?void 0:i.verified)&&c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Verified by Wraps"]}),c.jsx(qe,{variant:"outline",children:r.httpsPolicy==="REQUIRE"?"HTTPS Only":"HTTPS Optional"}),c.jsx(Ce,{className:"h-8 w-8 p-0",disabled:l,onClick:x,size:"sm",variant:"ghost",children:c.jsx(Bf,{className:`h-4 w-4 ${l?"animate-spin":""}`})}),c.jsx(Ce,{className:"h-8 w-8 p-0",onClick:E,size:"sm",variant:"ghost",children:c.jsx(aC,{className:"h-4 w-4"})})]})]}),c.jsxs(fs,{onOpenChange:S,open:O,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"Required DNS Record (CNAME)"}),O?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{className:"font-mono text-xs",children:r.customRedirectDomain}),c.jsx(tc,{text:r.customRedirectDomain})]}),c.jsxs("div",{className:"mt-1 flex items-start justify-between gap-2",children:[c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["CNAME → r.",(e==null?void 0:e.name)||"region",".awstrack.me"]}),c.jsx(tc,{text:`r.${(e==null?void 0:e.name)||"region"}.awstrack.me`})]})]})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"No custom tracking domain configured. Using default awstrack.me domain."}),c.jsxs(Ce,{onClick:E,size:"sm",variant:"outline",children:[c.jsx(aC,{className:"mr-2 h-4 w-4"}),"Configure Tracking Domain"]})]})}),c.jsx(RO,{onOpenChange:h,open:d,children:c.jsxs(DO,{children:[c.jsxs(t3,{children:[c.jsx(r3,{children:"Update Tracking Domain"}),c.jsx(sQ,{children:"Enter the custom domain you want to use for email tracking links. You'll need to configure DNS records after saving."})]}),c.jsx("div",{className:"space-y-4 py-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{htmlFor:"domain",children:"Tracking Domain"}),c.jsx(oo,{disabled:g,id:"domain",onChange:_=>m(_.target.value),placeholder:"track.example.com",value:v}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Example: track.yourdomain.com or email.yourdomain.com"})]})}),c.jsxs(n3,{children:[c.jsx(Ce,{disabled:g,onClick:()=>h(!1),variant:"outline",children:"Cancel"}),c.jsx(Ce,{disabled:g,onClick:N,children:g?"Updating...":"Update Domain"})]})]})})]})}function kge({configSet:e,onRefresh:t}){var v,m;const[n,r]=w.useState(!1),[i,o]=w.useState(!1),[l,u]=w.useState(!1);if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsx(Le,{children:"Configuration Set"}),c.jsx(We,{children:"No configuration set found"})]})});const d=async()=>{var g;u(!0);try{const b=sessionStorage.getItem("wraps-auth-token"),O=!((g=e.sendingOptions)!=null&&g.sendingEnabled),S=await fetch(`/api/settings/config-set/sending?token=${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:O})});if(!S.ok)throw new Error(`Failed to update: ${S.statusText}`);r(!1),Ot.success(O?"Email sending enabled":"Email sending disabled"),t&&await t()}catch(b){console.error("Failed to toggle sending:",b),Ot.error("Failed to update setting",{description:b instanceof Error?b.message:"Unknown error"})}finally{u(!1)}},h=async()=>{var g;u(!0);try{const b=sessionStorage.getItem("wraps-auth-token"),O=!((g=e.reputationOptions)!=null&&g.reputationMetricsEnabled),S=await fetch(`/api/settings/config-set/reputation?token=${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:O})});if(!S.ok)throw new Error(`Failed to update: ${S.statusText}`);o(!1),Ot.success(O?"Reputation metrics enabled":"Reputation metrics disabled"),t&&await t()}catch(b){console.error("Failed to toggle reputation:",b),Ot.error("Failed to update setting",{description:b instanceof Error?b.message:"Unknown error"})}finally{u(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Configuration Set"}),c.jsx(We,{children:"Email sending and tracking configuration"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:e.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Configuration Set Name"})]}),c.jsx(qt,{}),e.sendingOptions&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Email Sending"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.sendingOptions.sendingEnabled?"Emails can be sent":"Email sending is disabled"})]}),c.jsx(Ce,{onClick:()=>r(!0),size:"sm",variant:e.sendingOptions.sendingEnabled?"destructive":"default",children:e.sendingOptions.sendingEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:r,open:n,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.sendingOptions.sendingEnabled?"Disable email sending?":"Enable email sending?"}),c.jsx(Nm,{children:e.sendingOptions.sendingEnabled?"All outgoing emails will be blocked until you re-enable sending. Emails in the queue will not be sent.":"This will allow emails to be sent through this configuration set. Make sure your domain is verified before enabling."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:l,children:"Cancel"}),c.jsx(Am,{disabled:l,onClick:d,children:l?"Updating...":e.sendingOptions.sendingEnabled?"Disable sending":"Enable sending"})]})]})})]}),e.reputationOptions&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Reputation Metrics"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.reputationOptions.reputationMetricsEnabled?"Tracking bounce and complaint rates":"Reputation tracking disabled"})]}),c.jsx(Ce,{onClick:()=>o(!0),size:"sm",variant:"outline",children:e.reputationOptions.reputationMetricsEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:o,open:i,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.reputationOptions.reputationMetricsEnabled?"Disable reputation metrics?":"Enable reputation metrics?"}),c.jsx(Nm,{children:e.reputationOptions.reputationMetricsEnabled?"You will stop collecting bounce and complaint rate data. Historical data will be preserved but no new metrics will be tracked.":"This will start tracking bounce and complaint rates for your sending domain. This helps monitor your email reputation and deliverability."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:l,children:"Cancel"}),c.jsx(Am,{disabled:l,onClick:h,children:l?"Updating...":e.reputationOptions.reputationMetricsEnabled?"Disable metrics":"Enable metrics"})]})]})})]}),((v=e.deliveryOptions)==null?void 0:v.tlsPolicy)&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"TLS Encryption"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.deliveryOptions.tlsPolicy==="REQUIRE"?"Required for all connections":"Optional (opportunistic)"})]}),c.jsx(qe,{variant:"outline",children:e.deliveryOptions.tlsPolicy==="REQUIRE"?"Required":"Optional"})]}),e.suppressionOptions&&c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Suppression List"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Automatically suppress emails to addresses that bounced or complained"})]}),e.suppressionOptions.suppressedReasons&&e.suppressionOptions.suppressedReasons.length>0?c.jsx("div",{className:"flex gap-2",children:e.suppressionOptions.suppressedReasons.map(g=>c.jsx(qe,{variant:"secondary",children:g},g))}):c.jsx("p",{className:"text-muted-foreground text-sm",children:"Not configured"})]}),((m=e.deliveryOptions)==null?void 0:m.sendingPoolName)&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"IP Pool"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.deliveryOptions.sendingPoolName})]})]})]})}function $ge(){var u,d;const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0);const h=await Cge();t(h),o(null)}catch(h){console.error("Failed to fetch email settings:",h),o(h instanceof Error?h.message:"Failed to load settings")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{className:"md:row-span-2",children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-32"}),c.jsx(Re,{className:"h-4 w-24"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-40"}),c.jsx(Re,{className:"h-4 w-28"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-36"}),c.jsx(Re,{className:"h-4 w-32"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-32"}),c.jsx(Re,{className:"h-4 w-44"})]})]})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]})]})]}):i?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs(Un,{className:"mt-6",variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error Loading Settings"}),c.jsx(Hn,{children:i})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{className:"md:row-span-2",children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Sending Domain"}),c.jsx(We,{children:"Email domain configuration and authentication"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"font-medium",children:(u=e==null?void 0:e.identity)==null?void 0:u.identityName}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Domain Identity"})]}),c.jsx(XE,{status:((d=e==null?void 0:e.identity)==null?void 0:d.verificationStatus)||"NOT_STARTED"})]})}),c.jsx(qt,{}),c.jsx(Mge,{identity:e==null?void 0:e.identity}),c.jsx(qt,{}),c.jsx(Rge,{identity:e==null?void 0:e.identity}),c.jsx(qt,{}),c.jsx(Dge,{identity:e==null?void 0:e.identity})]})]}),c.jsx(kge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l}),c.jsx(Pge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l,region:e==null?void 0:e.region})]})]})}function F1(e){return e.name?`${e.name} <${e.address}>`:e.address}function Ige(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Gh({label:e,verdict:t}){if(!t)return null;const n=t==="PASS";return c.jsxs(qe,{className:n?"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20":"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20",variant:"outline",children:[n?c.jsx(v$,{className:"mr-1 h-3 w-3"}):c.jsx(p$,{className:"mr-1 h-3 w-3"}),e,": ",t]})}function Lge(){const{emailId:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null),[d,h]=w.useState(!1);return w.useEffect(()=>{async function v(){try{o(!0),u(null);const m=sessionStorage.getItem("wraps-auth-token");if(!m)throw new Error("Authentication token not found");const g=await fetch(`/api/inbound/${encodeURIComponent(e||"")}?token=${m}`);if(!g.ok){let O="Failed to fetch inbound email";try{O=(await g.json()).error||O}catch{O=`${g.status}: ${g.statusText}`}throw new Error(O)}const b=await g.json();r(b)}catch(m){const g=m instanceof Error?m.message:"Unknown error";u(g),console.error("Error fetching inbound email:",m)}finally{o(!1)}}e&&v()},[e]),i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading inbound email..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back"]})}),c.jsx(Te,{children:c.jsxs(Me,{className:"space-y-1.5",children:[c.jsx(Le,{className:"flex flex-row items-center gap-2 text-xl",children:c.jsx("span",{children:n.subject||"(no subject)"})}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Gh,{label:"Spam",verdict:n.spamVerdict}),c.jsx(Gh,{label:"Virus",verdict:n.virusVerdict}),n.headers["x-ses-dkim-verdict"]&&c.jsx(Gh,{label:"DKIM",verdict:n.headers["x-ses-dkim-verdict"]}),n.headers["x-ses-spf-verdict"]&&c.jsx(Gh,{label:"SPF",verdict:n.headers["x-ses-spf-verdict"]})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 truncate rounded bg-muted px-2 py-0.5 font-mono text-muted-foreground text-xs",children:n.messageId}),c.jsx(fa,{className:"h-6 w-6 shrink-0",size:"sm",value:n.messageId,variant:"ghost"})]}),c.jsxs("div",{className:"flex flex-col gap-3 pt-2 sm:flex-row sm:flex-wrap",children:[c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"From"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:F1(n.from)}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.from.address,variant:"ghost"})})]}),c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"To"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:n.to.length>0?n.to.map(F1).join(", "):"(no recipients)"})]}),n.cc.length>0&&c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"CC"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:n.cc.map(F1).join(", ")})]})]}),c.jsxs("div",{className:"text-muted-foreground text-sm",children:["Received: ",new Date(n.receivedAt).toLocaleString()]})]})}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Body"}),n.htmlTruncated&&c.jsx(We,{className:"text-amber-600",children:"HTML content was truncated due to size limits"})]}),c.jsx($e,{children:n.html?c.jsx("iframe",{className:"h-[500px] w-full rounded-md border bg-white",sandbox:"allow-same-origin",srcDoc:n.html,title:"Email content"}):n.text?c.jsx("pre",{className:"max-h-[500px] overflow-auto whitespace-pre-wrap rounded-md border bg-muted/50 p-4 font-mono text-sm",children:n.text}):c.jsx("div",{className:"text-muted-foreground text-sm",children:"No message body"})})]}),n.attachments.length>0&&c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(m$,{className:"h-4 w-4"}),"Attachments (",n.attachments.length,")"]})}),c.jsx($e,{children:c.jsx("div",{className:"space-y-2",children:n.attachments.map(v=>c.jsx("div",{className:"flex items-center justify-between rounded-md border p-3",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(d$,{className:"h-5 w-5 text-muted-foreground"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-sm",children:v.filename}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:[v.contentType," · ",Ige(v.size),v.contentDisposition==="inline"&&c.jsx(qe,{className:"ml-2 bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20",variant:"outline",children:"inline"})]})]})]})},v.id))})})]}),c.jsx(fs,{onOpenChange:h,open:d,children:c.jsxs(Te,{children:[c.jsx(ds,{asChild:!0,children:c.jsx(Me,{className:"cursor-pointer",children:c.jsxs(Le,{className:"flex items-center justify-between",children:[c.jsx("span",{children:"Raw Headers"}),d?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})})}),c.jsx(hs,{children:c.jsx($e,{children:c.jsx("pre",{className:"max-h-[400px] overflow-auto whitespace-pre-wrap rounded-md border bg-muted/50 p-4 font-mono text-xs",children:Object.entries(n.headers).map(([v,m])=>`${v}: ${m}`).join(`
|
|
497
|
-
`)})})})]})})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"Inbound email not found"})]})}const zge={sent:Zi,delivered:ri,failed:or,queued:Qo,blocked:or,carrier_unreachable:tm,invalid:or,opted_out:or,ttl_expired:Qo},Bge={sent:"text-blue-500",delivered:"text-green-500",failed:"text-red-500",queued:"text-gray-500",blocked:"text-orange-500",carrier_unreachable:"text-red-500",invalid:"text-red-500",opted_out:"text-yellow-500",ttl_expired:"text-gray-500"},qge={delivered:"default",sent:"secondary",queued:"secondary",failed:"destructive",blocked:"destructive",invalid:"destructive",opted_out:"default"};function Uge(){const{id:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);w.useEffect(()=>{async function m(){try{o(!0),u(null);const g=sessionStorage.getItem("wraps-auth-token");if(!g)throw new Error("Authentication token not found");const b=encodeURIComponent(e||""),O=await fetch(`/api/sms/${b}?token=${g}`);if(!O.ok){let E="Failed to fetch SMS details";try{E=(await O.json()).error||E}catch{E=`${O.status}: ${O.statusText}`}throw new Error(E)}const S=O.headers.get("content-type");if(!(S!=null&&S.includes("application/json"))){const E=await O.text();throw console.error("Non-JSON response:",E),new Error("Server returned non-JSON response")}const x=await O.json();r(x)}catch(g){const b=g instanceof Error?g.message:"Unknown error";u(b),console.error("Error fetching SMS details:",g)}finally{o(!1)}}e&&m()},[e]);const d=m=>new Date(m).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),h=m=>new Date(m).toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),v=m=>m.startsWith("+1")&&m.length===12?`(${m.slice(2,5)}) ${m.slice(5,8)}-${m.slice(8)}`:m;return i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading SMS details..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx(qe,{variant:qge[n.status],children:n.status.charAt(0).toUpperCase()+n.status.slice(1).replace("_"," ")})]}),c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsx("div",{className:"flex items-start justify-between",children:c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs(Le,{className:"flex items-center gap-2 text-2xl",children:[c.jsx(Zi,{className:"h-6 w-6"}),"SMS Message"]}),c.jsx(We,{className:"font-mono text-xs",children:n.messageId})]})})}),c.jsx($e,{className:"space-y-4",children:c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"FROM"}),c.jsx("div",{className:"font-mono text-sm",children:v(n.from)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"TO"}),c.jsx("div",{className:"font-mono text-sm",children:v(n.to)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"SEGMENTS"}),c.jsx("div",{className:"font-mono text-sm",children:n.segments})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"ID"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-xs",children:n.id}),c.jsx(Ce,{className:"h-6 w-6",onClick:()=>navigator.clipboard.writeText(n.id),size:"icon",variant:"ghost",children:c.jsx("span",{className:"sr-only",children:"Copy ID"})})]})]})]})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Content"}),c.jsx(We,{children:"The SMS message body"})]}),c.jsx($e,{children:c.jsx("div",{className:"rounded-md border bg-muted/50 p-4",children:c.jsx("p",{className:"whitespace-pre-wrap text-sm",children:n.body})})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Events"}),c.jsx(We,{children:"Lifecycle of this message from send to delivery"})]}),c.jsx($e,{children:c.jsx("div",{className:"space-y-4",children:n.events.length===0?c.jsx("div",{className:"text-muted-foreground text-sm",children:"No events recorded yet"}):n.events.map((m,g)=>{const b=zge[m.type]||Qo,O=g===n.events.length-1;return c.jsx("div",{children:c.jsxs("div",{className:"flex gap-4",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("div",{className:`rounded-full border-2 border-background bg-muted p-2 ${Bge[m.type]}`,children:c.jsx(b,{className:"h-4 w-4"})}),!O&&c.jsx("div",{className:"my-1 w-px flex-1 bg-border"})]}),c.jsxs("div",{className:"flex-1 pb-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"font-medium capitalize",children:m.type.replace("_"," ")}),c.jsx("div",{className:"text-muted-foreground text-sm",children:d(m.timestamp)})]}),c.jsx("div",{className:"text-muted-foreground text-sm",children:h(m.timestamp)}),m.metadata&&Object.keys(m.metadata).length>0&&c.jsx("div",{className:"mt-2 rounded-md border bg-muted/50 p-2 font-mono text-xs",children:c.jsx("pre",{className:"overflow-x-auto",children:JSON.stringify(m.metadata,null,2)})})]})]})},`${m.type}-${m.timestamp}`)})})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"SMS message not found"})]})}const G1={delivered:{variant:"default",description:"Message was delivered to recipient's device",className:"bg-green-500/10 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-green-500/20"},sent:{variant:"secondary",description:"Message was sent but delivery not yet confirmed",className:"bg-blue-500/10 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-blue-500/20"},queued:{variant:"secondary",description:"Message is queued for delivery",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 hover:bg-gray-500/20 border-gray-500/20"},failed:{variant:"destructive",description:"Message failed to deliver",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},blocked:{variant:"destructive",description:"Message was blocked by carrier or filter",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 hover:bg-orange-500/20 border-orange-500/20"},invalid:{variant:"destructive",description:"Invalid phone number or message format",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},opted_out:{variant:"default",description:"Recipient has opted out of receiving messages",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/20 border-yellow-500/20"}};function Hge(){const e=Sa(),[t,n]=w.useState(""),[r,i]=w.useState("15"),[o,l]=w.useState("all"),[u,d]=w.useState([]),[h,v]=w.useState(!0),[m,g]=w.useState(null);w.useEffect(()=>{async function x(){try{v(!0),g(null);let E=sessionStorage.getItem("wraps-auth-token");if(E||(E=new URLSearchParams(window.location.search).get("token"),E&&sessionStorage.setItem("wraps-auth-token",E)),!E)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const N=Number.parseInt(r,10),_=Date.now()-N*24*60*60*1e3,C=Date.now(),A=await fetch(`/api/sms?startTime=${_}&endTime=${C}&limit=100&token=${E}`);if(!A.ok){let R="Failed to fetch SMS logs";try{R=(await A.json()).error||R}catch{R=`${A.status}: ${A.statusText}`}throw new Error(R)}const M=await A.json();d(M.logs.map(R=>({id:R.messageId,to:R.to,from:R.from,body:R.body,status:R.status,timestamp:R.sentAt,messageId:R.messageId,segments:R.segments})))}catch(E){const N=E instanceof Error?E.message:"Unknown error";g(N),console.error("Error fetching SMS logs:",E)}finally{v(!1)}}x()},[r]);const b=u.filter(x=>{if(t){const E=t.toLowerCase(),N=x.to.toLowerCase().includes(E),_=x.body.toLowerCase().includes(E);if(!(N||_))return!1}return!(o!=="all"&&x.status!==o)}),O=x=>{const E=new Date(x),_=Math.floor((new Date().getTime()-E.getTime())/(1e3*60*60*24));return _===0?"Today":_===1?"Yesterday":_<7?`${_} days ago`:E.toLocaleDateString()},S=x=>x.startsWith("+1")&&x.length===12?`(${x.slice(2,5)}) ${x.slice(5,8)}-${x.slice(8)}`:x;return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"SMS Messages"]}),c.jsx(We,{children:"View and manage your SMS sending history"})]}),c.jsxs($e,{children:[m&&c.jsx("div",{className:"mb-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:m}),c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:x=>n(x.target.value),placeholder:"Search by phone or message...",value:t})]}),c.jsxs(ma,{onValueChange:i,value:r,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]}),c.jsxs(ma,{onValueChange:l,value:o,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"all",children:"All Statuses"}),c.jsx(Fe,{value:"delivered",children:"Delivered"}),c.jsx(Fe,{value:"sent",children:"Sent"}),c.jsx(Fe,{value:"queued",children:"Queued"}),c.jsx(Fe,{value:"failed",children:"Failed"}),c.jsx(Fe,{value:"blocked",children:"Blocked"}),c.jsx(Fe,{value:"opted_out",children:"Opted Out"})]})]}),c.jsx(Ce,{size:"icon",variant:"outline",children:c.jsx("span",{className:"sr-only",children:"Download"})})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"To"}),c.jsx(Pt,{children:"Status"}),c.jsx(Pt,{children:"Message"}),c.jsx(Pt,{children:"Sent"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:h?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"Loading SMS logs..."})}):b.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"No SMS messages found"})}):b.map(x=>{var E,N,_;return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/sms/${x.id}`),children:[c.jsx(mt,{className:"font-mono text-sm",children:S(x.to)}),c.jsx(mt,{children:c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsx(qe,{className:(E=G1[x.status])==null?void 0:E.className,variant:((N=G1[x.status])==null?void 0:N.variant)??"default",children:x.status.charAt(0).toUpperCase()+x.status.slice(1).replace("_"," ")})}),c.jsx(rv,{children:c.jsx("p",{children:((_=G1[x.status])==null?void 0:_.description)??"Unknown status"})})]})}),c.jsx(mt,{className:"max-w-[400px] truncate",children:x.body}),c.jsx(mt,{className:"text-muted-foreground",children:O(x.timestamp)}),c.jsx(mt,{children:c.jsx(Ce,{onClick:C=>{C.stopPropagation()},size:"icon",variant:"ghost",children:c.jsx("span",{className:"sr-only",children:"More options"})})})]},x.id)})})]})}),b.length>0&&!h&&c.jsx("div",{className:"mt-4 flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",b.length," of ",u.length," messages"]})})]})]})}function Fge(){const[e,t]=w.useState("7"),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);if(w.useEffect(()=>{async function S(){try{o(!0),u(null);let x=sessionStorage.getItem("wraps-auth-token");if(x||(x=new URLSearchParams(window.location.search).get("token"),x&&sessionStorage.setItem("wraps-auth-token",x)),!x)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const E=Number.parseInt(e,10),N=Date.now()-E*24*60*60*1e3,_=Date.now(),C=await fetch(`/api/sms/metrics?startTime=${N}&endTime=${_}&token=${x}`);if(!C.ok){let M="Failed to fetch SMS metrics";try{M=(await C.json()).error||M}catch{M=`${C.status}: ${C.statusText}`}throw new Error(M)}const A=await C.json();r(A)}catch(x){const E=x instanceof Error?x.message:"Unknown error";u(E),console.error("Error fetching SMS metrics:",x)}finally{o(!1)}}S()},[e]),l)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsx("div",{className:"mt-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]});if(i||!n)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsx("div",{className:"mt-4 flex h-[400px] items-center justify-center text-muted-foreground",children:"Loading metrics..."})]});const d=n.metrics.sends.reduce((S,x)=>S+x.value,0)||0,h=n.metrics.deliveries.reduce((S,x)=>S+x.value,0)||0,v=n.metrics.failures.reduce((S,x)=>S+x.value,0)||0,m=n.metrics.optOuts.reduce((S,x)=>S+x.value,0)||0,g=d>0?h/d*100:0,b=d>0?v/d*100:0,O=[{title:"Messages Sent",value:d.toLocaleString(),description:`${e==="1"?"Last 24 hours":`Last ${e} days`}`,icon:Zi},{title:"Delivery Rate",value:`${g.toFixed(1)}%`,description:`${h.toLocaleString()} delivered`,icon:Zj},{title:"Failure Rate",value:`${b.toFixed(1)}%`,description:`${v.toLocaleString()} failed`,icon:Dp},{title:"Opt Outs",value:m.toLocaleString(),description:"Recipients unsubscribed",icon:tm}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsxs(ma,{onValueChange:t,value:e,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:O.map(S=>c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx(Le,{className:"font-medium text-sm",children:S.title}),c.jsx(S.icon,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:S.value}),c.jsx("p",{className:"text-muted-foreground text-xs",children:S.description})]})]},S.title))}),n.phoneNumber&&c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Phone Number"}),c.jsx(We,{children:"Your SMS sending number"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Number"}),c.jsx("span",{className:"font-mono text-sm",children:n.phoneNumber.number})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Type"}),c.jsx(qe,{variant:"outline",children:n.phoneNumber.type})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Status"}),c.jsx(qe,{variant:n.phoneNumber.status==="ACTIVE"?"default":"secondary",children:n.phoneNumber.status})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Throughput"}),c.jsx("span",{className:"text-muted-foreground text-sm",children:n.phoneNumber.throughput})]})]})]}),n.quota&&c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Spend Limits"}),c.jsx(We,{children:"Your AWS SMS spending limits"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Monthly Spend"}),c.jsxs("span",{className:"font-medium",children:["$",n.quota.spentThisMonth.toFixed(2)," / $",n.quota.spendLimitMonthly.toFixed(2)]})]}),c.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:c.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.min(n.quota.spentThisMonth/n.quota.spendLimitMonthly*100,100)}%`}})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Daily Limit"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:["$",n.quota.spendLimitDaily.toFixed(2)]})]})]})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Metrics Summary"}),c.jsx(We,{children:"Detailed breakdown of your SMS performance"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Total Messages Sent"}),c.jsx(qe,{variant:"outline",children:d.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Successfully Delivered"}),c.jsx(qe,{variant:"default",children:h.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Failed"}),c.jsx(qe,{variant:"destructive",children:v.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Opt Outs"}),c.jsx(qe,{variant:"secondary",children:m.toLocaleString()})]})]})]})]})}function F4({status:e}){const t=e==="ACTIVE"||e==="SUCCESS";return c.jsxs(qe,{className:t?"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400":"border-yellow-500/20 bg-yellow-500/10 text-yellow-700 dark:text-yellow-400",variant:"outline",children:[t?c.jsx(ao,{className:"mr-1 h-3 w-3"}):c.jsx(lr,{className:"mr-1 h-3 w-3"}),e]})}function Gge({phoneNumber:e}){if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(tm,{className:"h-5 w-5"}),"Phone Number"]}),c.jsx(We,{children:"No phone number configured"})]})});const t=r=>r.startsWith("+1")&&r.length===12?`(${r.slice(2,5)}) ${r.slice(5,8)}-${r.slice(8)}`:r,n=r=>{switch(r){case"simulator":return"Simulator";case"toll-free":return"Toll-Free";case"10dlc":return"10DLC";case"short-code":return"Short Code";default:return r}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(tm,{className:"h-5 w-5"}),"Phone Number"]}),c.jsx(We,{children:"Your SMS sending number"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium font-mono text-lg",children:t(e.number)}),c.jsx("p",{className:"text-muted-foreground text-sm",children:n(e.type)})]}),c.jsx(F4,{status:e.status})]}),e.registrationStatus&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Registration Status"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.type==="toll-free"?"Toll-free verification":"Campaign registration"})]}),c.jsx(F4,{status:e.registrationStatus})]})]}),e.capabilities.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"font-medium text-sm",children:"Capabilities"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.capabilities.map(r=>c.jsx(qe,{variant:"secondary",children:r},r))})]})]}),e.monthlyLeasingPrice&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Monthly Cost"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Phone number lease"})]}),c.jsxs("span",{className:"font-mono text-sm",children:["$",e.monthlyLeasingPrice,"/mo"]})]})]}),e.type==="simulator"&&c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Simulator Mode"}),c.jsx(Hn,{children:"This number is for testing only. Messages are simulated and not actually sent. Upgrade to a toll-free number for production use."})]}),e.type==="toll-free"&&e.registrationStatus!=="VERIFIED"&&c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Registration Required"}),c.jsxs(Hn,{children:["Toll-free numbers require registration before they can send messages. Run ",c.jsx("code",{children:"wraps sms register"})," to complete registration."]})]})]})]})}function Vge({protectConfig:e}){return e!=null&&e.enabled?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),"Fraud Protection"]}),c.jsx(We,{children:"Country restrictions and AIT filtering"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Status"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Protect configuration active"})]}),c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Enabled"]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("p",{className:"font-medium text-sm",children:"Allowed Countries"})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.allowedCountries.map(t=>c.jsx(qe,{variant:"secondary",children:t},t))}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Messages can only be sent to these countries. All others are blocked."})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"AIT Filtering"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.aitFiltering?"Enabled - adds per-message cost":"Disabled - no extra cost"})]}),c.jsx(qe,{variant:e.aitFiltering?"default":"secondary",children:e.aitFiltering?"Enabled":"Disabled"})]})]})]}):c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),"Fraud Protection"]}),c.jsx(We,{children:"Not configured"})]})})}function Yge({configSet:e,onRefresh:t}){const[n,r]=w.useState(!1),[i,o]=w.useState(!1);if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"Configuration Set"]}),c.jsx(We,{children:"No configuration set found"})]})});const l=async()=>{o(!0);try{const u=sessionStorage.getItem("wraps-auth-token"),d=!e.sendingEnabled,h=await fetch(`/api/sms/settings/sending?token=${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d})});if(!h.ok)throw new Error(`Failed to update: ${h.statusText}`);r(!1),Ot.success(d?"SMS sending enabled":"SMS sending disabled"),t&&await t()}catch(u){console.error("Failed to toggle sending:",u),Ot.error("Failed to update setting",{description:u instanceof Error?u.message:"Unknown error"})}finally{o(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"Configuration Set"]}),c.jsx(We,{children:"SMS sending configuration"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:e.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Configuration Set Name"})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"SMS Sending"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.sendingEnabled?"Messages can be sent":"Message sending is disabled"})]}),c.jsx(Ce,{onClick:()=>r(!0),size:"sm",variant:e.sendingEnabled?"destructive":"default",children:e.sendingEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:r,open:n,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.sendingEnabled?"Disable SMS sending?":"Enable SMS sending?"}),c.jsx(Nm,{children:e.sendingEnabled?"All outgoing SMS messages will be blocked until you re-enable sending.":"This will allow SMS messages to be sent through this configuration set."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:i,children:"Cancel"}),c.jsx(Am,{disabled:i,onClick:l,children:i?"Updating...":e.sendingEnabled?"Disable sending":"Enable sending"})]})]})})]})]})}function Wge({eventTracking:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Event Tracking"}),c.jsx(We,{children:"Message history and event storage"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Event Tracking"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e!=null&&e.enabled?"Tracking delivery events":"Event tracking disabled"})]}),c.jsx(qe,{variant:e!=null&&e.enabled?"default":"secondary",children:e!=null&&e.enabled?"Enabled":"Disabled"})]}),(e==null?void 0:e.enabled)&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Message History"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.dynamoDBHistory?"Stored in DynamoDB":"Not stored"})]}),c.jsx(qe,{variant:e.dynamoDBHistory?"default":"secondary",children:e.dynamoDBHistory?"Enabled":"Disabled"})]}),e.archiveRetention&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Retention Period"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"How long message history is kept"})]}),c.jsx(qe,{variant:"outline",children:e.archiveRetention})]})]})]})]})}function Kge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0);const u=sessionStorage.getItem("wraps-auth-token");if(!u)throw new Error("Authentication token not found");const d=await fetch(`/api/sms/settings?token=${u}`);if(!d.ok)throw new Error(`Failed to fetch settings: ${d.statusText}`);const h=await d.json();t(h),o(null)}catch(u){console.error("Failed to fetch SMS settings:",u),o(u instanceof Error?u.message:"Failed to load settings")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]})]})]}):i?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs(Un,{className:"mt-6",variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error Loading Settings"}),c.jsx(Hn,{children:i})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsx(Gge,{phoneNumber:e==null?void 0:e.phoneNumber}),c.jsx(Yge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l}),c.jsx(Vge,{protectConfig:e==null?void 0:e.protectConfiguration}),c.jsx(Wge,{eventTracking:e==null?void 0:e.eventTracking})]})]})}function Xge({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=w.useState(()=>localStorage.getItem(n)||t);w.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),i==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d),u.style.colorScheme=d;return}u.classList.add(i),u.style.colorScheme=i},[i]);const l={theme:i,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return c.jsx(YI.Provider,{...r,value:l,children:e})}function Qge({...e}){return c.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Zge({className:e,...t}){return c.jsx("ol",{className:me("flex flex-wrap items-center gap-1.5 break-words text-muted-foreground text-sm sm:gap-2.5",e),"data-slot":"breadcrumb-list",...t})}function Jge({className:e,...t}){return c.jsx("li",{className:me("inline-flex items-center gap-1.5",e),"data-slot":"breadcrumb-item",...t})}function eye({className:e,...t}){return c.jsx("span",{"aria-current":"page","aria-disabled":"true",className:me("font-normal text-foreground",e),"data-slot":"breadcrumb-page",role:"link",...t})}var tye=(e,t,n,r,i,o,l,u)=>{let d=document.documentElement,h=["light","dark"];function v(b){(Array.isArray(e)?e:[e]).forEach(O=>{let S=O==="class",x=S&&o?i.map(E=>o[E]||E):i;S?(d.classList.remove(...x),d.classList.add(o&&o[b]?o[b]:b)):d.setAttribute(O,b)}),m(b)}function m(b){u&&h.includes(b)&&(d.style.colorScheme=b)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)v(r);else try{let b=localStorage.getItem(t)||n,O=l&&b==="system"?g():b;v(O)}catch{}},nye=w.createContext(void 0),rye={setTheme:e=>{},themes:[]},aye=()=>{var e;return(e=w.useContext(nye))!=null?e:rye};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:l,themes:u,nonce:d,scriptProps:h})=>{let v=JSON.stringify([n,t,o,e,u,l,r,i]).slice(1,-1);return w.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${tye.toString()})(${v})`}})});const iye=({...e})=>{const{theme:t="system"}=aye();return c.jsx(UK,{className:"toaster group",icons:{success:c.jsx(ao,{className:"size-4"}),info:c.jsx(CF,{className:"size-4"}),warning:c.jsx(IF,{className:"size-4"}),error:c.jsx(RF,{className:"size-4"}),loading:c.jsx(Va,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},theme:t,...e})};function oye(){const e=Zr(),[t,n]=w.useState(!1);w.useEffect(()=>{let i=sessionStorage.getItem("wraps-auth-token");i||(i=new URLSearchParams(window.location.search).get("token"),i&&sessionStorage.setItem("wraps-auth-token",i)),n(!0)},[]),w.useEffect(()=>{document.cookie="sidebar_state=; path=/; max-age=0"},[]);const r=()=>{if(e.pathname.startsWith("/email/inbound/"))return"Inbound Email Details";if(e.pathname.startsWith("/email/")&&e.pathname!=="/email/metrics"&&e.pathname!=="/email/settings")return"Email Details";if(e.pathname.startsWith("/sms/")&&e.pathname!=="/sms/metrics"&&e.pathname!=="/sms/settings")return"SMS Details";if(e.pathname.startsWith("/cdn/")&&e.pathname!=="/cdn/metrics"&&e.pathname!=="/cdn/settings")return"File Details";switch(e.pathname){case"/":case"/email":return"Emails";case"/email/metrics":return"Email Metrics";case"/email/settings":return"Email Settings";case"/sms":return"SMS Messages";case"/sms/metrics":return"SMS Metrics";case"/sms/settings":return"SMS Settings";case"/cdn":return"CDN";case"/cdn/metrics":return"CDN Metrics";case"/cdn/settings":return"CDN Settings";default:return"Emails"}};return c.jsxs(UI,{defaultOpen:!1,children:[c.jsx(pK,{}),c.jsxs(FI,{children:[c.jsxs("header",{className:"sticky top-0 flex shrink-0 items-center gap-2 border-b bg-background p-4",children:[c.jsx(HI,{className:"-ml-1"}),c.jsx(qt,{className:"mr-2 data-[orientation=vertical]:h-4",orientation:"vertical"}),c.jsx(Qge,{children:c.jsx(Zge,{children:c.jsx(Jge,{children:c.jsx(eye,{children:r()})})})})]}),c.jsx("div",{className:"flex flex-1 flex-col gap-6 p-6",children:t?c.jsxs(DH,{children:[c.jsx(Bn,{element:c.jsx(MH,{replace:!0,to:"/email"}),path:"/"}),c.jsx(Bn,{element:c.jsx(Oge,{}),path:"/email"}),c.jsx(Bn,{element:c.jsx(Lge,{}),path:"/email/inbound/:emailId"}),c.jsx(Bn,{element:c.jsx(wge,{}),path:"/email/:id"}),c.jsx(Bn,{element:c.jsx(Age,{}),path:"/email/metrics"}),c.jsx(Bn,{element:c.jsx($ge,{}),path:"/email/settings"}),c.jsx(Bn,{element:c.jsx(Hge,{}),path:"/sms"}),c.jsx(Bn,{element:c.jsx(Uge,{}),path:"/sms/:id"}),c.jsx(Bn,{element:c.jsx(Fge,{}),path:"/sms/metrics"}),c.jsx(Bn,{element:c.jsx(Kge,{}),path:"/sms/settings"}),c.jsx(Bn,{element:c.jsx(tee,{}),path:"/cdn"}),c.jsx(Bn,{element:c.jsx(rge,{}),path:"/cdn/metrics"}),c.jsx(Bn,{element:c.jsx(cge,{}),path:"/cdn/settings"})]}):c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading..."})})})]})]})}function sye(){return c.jsx(Xge,{defaultTheme:"system",storageKey:"console-ui-theme",children:c.jsxs(aF,{children:[c.jsx(oye,{}),c.jsx(iye,{})]})})}kU.createRoot(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(sye,{})}));
|
|
496
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V6(e,t){if(e){if(typeof e=="string")return Lj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Lj(e,t)}}function Ive(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Lve(e){if(Array.isArray(e))return Lj(e)}function Lj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function L4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L4(Object(n),!0).forEach(function(r){Pe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pe(e,t,n){return t=Y6(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y6(e){var t=zve(e,"string");return Jl(t)=="symbol"?t:t+""}function zve(e,t){if(Jl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Jl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bve={xAxis:["bottom","top"],yAxis:["left","right"]},qve={width:"100%",height:"100%"},W6={x:0,y:0};function Hh(e){return e}var Uve=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Hve=function(t,n,r,i){var o=n.find(function(v){return v&&v.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var l=o.coordinate,u=i.radius;return ue(ue(ue({},i),vn(i.cx,i.cy,u,l)),{},{angle:l,radius:u})}var d=o.coordinate,h=i.angle;return ue(ue(ue({},i),vn(i.cx,i.cy,d,h)),{},{angle:h,radius:d})}return W6},Zv=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,l=(r??[]).reduce(function(u,d){var h=d.props.data;return h&&h.length?[].concat(ec(u),ec(h)):u},[]);return l.length>0?l:t&&t.length&&be(i)&&be(o)?t.slice(i,o+1):[]};function K6(e){return e==="number"?[0,"auto"]:void 0}var zj=function(t,n,r,i){var o=t.graphicalItems,l=t.tooltipAxis,u=Zv(n,t);return r<0||!o||!o.length||r>=u.length?null:o.reduce(function(d,h){var v,m=(v=h.props.data)!==null&&v!==void 0?v:n;m&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(m=m.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var b=m===void 0?u:m;g=Mm(b,l.dataKey,i)}else g=m&&m[r]||u[r];return g?[].concat(ec(d),[KB(h,g)]):d},[])},z4=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},l=Uve(o,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,h=t.tooltipTicks,v=Jle(l,u,h,d);if(v>=0&&h){var m=h[v]&&h[v].value,g=zj(t,n,v,m),b=Hve(r,u,v,o);return{activeTooltipIndex:v,activeLabel:m,activePayload:g,activeCoordinate:b}}return null},Fve=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.layout,m=t.children,g=t.stackOffset,b=VB(v,o);return r.reduce(function(O,S){var x,E=S.type.defaultProps!==void 0?ue(ue({},S.type.defaultProps),S.props):S.props,N=E.type,_=E.dataKey,C=E.allowDataOverflow,A=E.allowDuplicatedCategory,M=E.scale,R=E.ticks,D=E.includeHidden,z=E[l];if(O[z])return O;var G=Zv(t.data,{graphicalItems:i.filter(function(Y){var q,U=l in Y.props?Y.props[l]:(q=Y.type.defaultProps)===null||q===void 0?void 0:q[l];return U===z}),dataStartIndex:d,dataEndIndex:h}),L=G.length,F,W,Q;vve(E.domain,C,N)&&(F=nj(E.domain,null,C),b&&(N==="number"||M!=="auto")&&(Q=zu(G,_,"category")));var X=K6(N);if(!F||F.length===0){var k,H=(k=E.domain)!==null&&k!==void 0?k:X;if(_){if(F=zu(G,_,N),N==="category"&&b){var B=Fee(F);A&&B?(W=F,F=mp(0,L)):A||(F=JP(H,F,S).reduce(function(Y,q){return Y.indexOf(q)>=0?Y:[].concat(ec(Y),[q])},[]))}else if(N==="category")A?F=F.filter(function(Y){return Y!==""&&!Qe(Y)}):F=JP(H,F,S).reduce(function(Y,q){return Y.indexOf(q)>=0||q===""||Qe(q)?Y:[].concat(ec(Y),[q])},[]);else if(N==="number"){var Z=ace(G,i.filter(function(Y){var q,U,ne=l in Y.props?Y.props[l]:(q=Y.type.defaultProps)===null||q===void 0?void 0:q[l],fe="hide"in Y.props?Y.props.hide:(U=Y.type.defaultProps)===null||U===void 0?void 0:U.hide;return ne===z&&(D||!fe)}),_,o,v);Z&&(F=Z)}b&&(N==="number"||M!=="auto")&&(Q=zu(G,_,"category"))}else b?F=mp(0,L):u&&u[z]&&u[z].hasStack&&N==="number"?F=g==="expand"?[0,1]:WB(u[z].stackGroups,d,h):F=GB(G,i.filter(function(Y){var q=l in Y.props?Y.props[l]:Y.type.defaultProps[l],U="hide"in Y.props?Y.props.hide:Y.type.defaultProps.hide;return q===z&&(D||!U)}),N,v,!0);if(N==="number")F=$j(m,F,z,o,R),H&&(F=nj(H,F,C));else if(N==="category"&&H){var le=H,$=F.every(function(Y){return le.indexOf(Y)>=0});$&&(F=le)}}return ue(ue({},O),{},Pe({},z,ue(ue({},E),{},{axisType:o,domain:F,categoricalDomain:Q,duplicateDomain:W,originalDomain:(x=E.domain)!==null&&x!==void 0?x:X,isCategorical:b,layout:v})))},{})},Gve=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.layout,m=t.children,g=Zv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:h}),b=g.length,O=VB(v,o),S=-1;return r.reduce(function(x,E){var N=E.type.defaultProps!==void 0?ue(ue({},E.type.defaultProps),E.props):E.props,_=N[l],C=K6("number");if(!x[_]){S++;var A;return O?A=mp(0,b):u&&u[_]&&u[_].hasStack?(A=WB(u[_].stackGroups,d,h),A=$j(m,A,_,o)):(A=nj(C,GB(g,r.filter(function(M){var R,D,z=l in M.props?M.props[l]:(R=M.type.defaultProps)===null||R===void 0?void 0:R[l],G="hide"in M.props?M.props.hide:(D=M.type.defaultProps)===null||D===void 0?void 0:D.hide;return z===_&&!G}),"number",v),i.defaultProps.allowDataOverflow),A=$j(m,A,_,o)),ue(ue({},x),{},Pe({},_,ue(ue({axisType:o},i.defaultProps),{},{hide:!0,orientation:Mr(Bve,"".concat(o,".").concat(S%2),null),domain:A,originalDomain:C,isCategorical:O,layout:v})))}return x},{})},Vve=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,v=t.children,m="".concat(i,"Id"),g=Rr(v,o),b={};return g&&g.length?b=Fve(t,{axes:g,graphicalItems:l,axisType:i,axisIdKey:m,stackGroups:u,dataStartIndex:d,dataEndIndex:h}):l&&l.length&&(b=Gve(t,{Axis:o,graphicalItems:l,axisType:i,axisIdKey:m,stackGroups:u,dataStartIndex:d,dataEndIndex:h})),b},Yve=function(t){var n=Yi(t),r=Ka(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:uE(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:ap(n,r)}},B4=function(t){var n=t.children,r=t.defaultShowTooltip,i=rr(n,Fl),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(l=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},Wve=function(t){return!t||!t.length?!1:t.some(function(n){var r=Za(n&&n.type);return r&&r.indexOf("Bar")>=0})},q4=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Kve=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,h=r.width,v=r.height,m=r.children,g=r.margin||{},b=rr(m,Fl),O=rr(m,ei),S=Object.keys(d).reduce(function(A,M){var R=d[M],D=R.orientation;return!R.mirror&&!R.hide?ue(ue({},A),{},Pe({},D,A[D]+R.width)):A},{left:g.left||0,right:g.right||0}),x=Object.keys(l).reduce(function(A,M){var R=l[M],D=R.orientation;return!R.mirror&&!R.hide?ue(ue({},A),{},Pe({},D,Mr(A,"".concat(D))+R.height)):A},{top:g.top||0,bottom:g.bottom||0}),E=ue(ue({},x),S),N=E.bottom;b&&(E.bottom+=b.props.height||Fl.defaultProps.height),O&&n&&(E=nce(E,i,r,n));var _=h-E.left-E.right,C=v-E.top-E.bottom;return ue(ue({brushBottom:N},E),{},{width:Math.max(_,0),height:Math.max(C,0)})},Xve=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},X6=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,h=t.legendContent,v=t.formatAxisMap,m=t.defaultProps,g=function(E,N){var _=N.graphicalItems,C=N.stackGroups,A=N.offset,M=N.updateId,R=N.dataStartIndex,D=N.dataEndIndex,z=E.barSize,G=E.layout,L=E.barGap,F=E.barCategoryGap,W=E.maxBarSize,Q=q4(G),X=Q.numericAxisName,k=Q.cateAxisName,H=Wve(_),B=[];return _.forEach(function(Z,le){var $=Zv(E.data,{graphicalItems:[Z],dataStartIndex:R,dataEndIndex:D}),Y=Z.type.defaultProps!==void 0?ue(ue({},Z.type.defaultProps),Z.props):Z.props,q=Y.dataKey,U=Y.maxBarSize,ne=Y["".concat(X,"Id")],fe=Y["".concat(k,"Id")],ie={},pe=d.reduce(function(Yn,Rt){var dr=N["".concat(Rt.axisType,"Map")],nn=Y["".concat(Rt.axisType,"Id")];dr&&dr[nn]||Rt.axisType==="zAxis"||is();var bs=dr[nn];return ue(ue({},Yn),{},Pe(Pe({},Rt.axisType,bs),"".concat(Rt.axisType,"Ticks"),Ka(bs)))},ie),re=pe[k],ve=pe["".concat(k,"Ticks")],ge=C&&C[ne]&&C[ne].hasStack&&vce(Z,C[ne].stackGroups),oe=Za(Z.type).indexOf("Bar")>=0,ke=ap(re,ve),we=[],ze=H&&ece({barSize:z,stackGroups:C,totalSize:Xve(pe,k)});if(oe){var Ze,lt,tn=Qe(U)?W:U,pt=(Ze=(lt=ap(re,ve,!0))!==null&<!==void 0?lt:tn)!==null&&Ze!==void 0?Ze:0;we=tce({barGap:L,barCategoryGap:F,bandSize:pt!==ke?pt:ke,sizeList:ze[fe],maxBarSize:tn}),pt!==ke&&(we=we.map(function(Yn){return ue(ue({},Yn),{},{position:ue(ue({},Yn.position),{},{offset:Yn.position.offset-pt/2})})}))}var fr=Z&&Z.type&&Z.type.getComposedData;fr&&B.push({props:ue(ue({},fr(ue(ue({},pe),{},{displayedData:$,props:E,dataKey:q,item:Z,bandSize:ke,barPosition:we,offset:A,stackedData:ge,layout:G,dataStartIndex:R,dataEndIndex:D}))),{},Pe(Pe(Pe({key:Z.key||"item-".concat(le)},X,pe[X]),k,pe[k]),"animationId",M)),childIndex:rte(Z,E.children),item:Z})}),B},b=function(E,N){var _=E.props,C=E.dataStartIndex,A=E.dataEndIndex,M=E.updateId;if(!hM({props:_}))return null;var R=_.children,D=_.layout,z=_.stackOffset,G=_.data,L=_.reverseStackOrder,F=q4(D),W=F.numericAxisName,Q=F.cateAxisName,X=Rr(R,r),k=hce(G,X,"".concat(W,"Id"),"".concat(Q,"Id"),z,L),H=d.reduce(function(Y,q){var U="".concat(q.axisType,"Map");return ue(ue({},Y),{},Pe({},U,Vve(_,ue(ue({},q),{},{graphicalItems:X,stackGroups:q.axisType===W&&k,dataStartIndex:C,dataEndIndex:A}))))},{}),B=Kve(ue(ue({},H),{},{props:_,graphicalItems:X}),N==null?void 0:N.legendBBox);Object.keys(H).forEach(function(Y){H[Y]=v(_,H[Y],B,Y.replace("Map",""),n)});var Z=H["".concat(Q,"Map")],le=Yve(Z),$=g(_,ue(ue({},H),{},{dataStartIndex:C,dataEndIndex:A,updateId:M,graphicalItems:X,stackGroups:k,offset:B}));return ue(ue({formattedGraphicalItems:$,graphicalItems:X,offset:B,stackGroups:k},le),H)},O=(function(x){function E(N){var _,C,A;return Cve(this,E),A=Rve(this,E,[N]),Pe(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Pe(A,"accessibilityManager",new pve),Pe(A,"handleLegendBBoxUpdate",function(M){if(M){var R=A.state,D=R.dataStartIndex,z=R.dataEndIndex,G=R.updateId;A.setState(ue({legendBBox:M},b({props:A.props,dataStartIndex:D,dataEndIndex:z,updateId:G},ue(ue({},A.state),{},{legendBBox:M}))))}}),Pe(A,"handleReceiveSyncEvent",function(M,R,D){if(A.props.syncId===M){if(D===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(R)}}),Pe(A,"handleBrushChange",function(M){var R=M.startIndex,D=M.endIndex;if(R!==A.state.dataStartIndex||D!==A.state.dataEndIndex){var z=A.state.updateId;A.setState(function(){return ue({dataStartIndex:R,dataEndIndex:D},b({props:A.props,dataStartIndex:R,dataEndIndex:D,updateId:z},A.state))}),A.triggerSyncEvent({dataStartIndex:R,dataEndIndex:D})}}),Pe(A,"handleMouseEnter",function(M){var R=A.getMouseInfo(M);if(R){var D=ue(ue({},R),{},{isTooltipActive:!0});A.setState(D),A.triggerSyncEvent(D);var z=A.props.onMouseEnter;Ye(z)&&z(D,M)}}),Pe(A,"triggeredAfterMouseMove",function(M){var R=A.getMouseInfo(M),D=R?ue(ue({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(D),A.triggerSyncEvent(D);var z=A.props.onMouseMove;Ye(z)&&z(D,M)}),Pe(A,"handleItemMouseEnter",function(M){A.setState(function(){return{isTooltipActive:!0,activeItem:M,activePayload:M.tooltipPayload,activeCoordinate:M.tooltipPosition||{x:M.cx,y:M.cy}}})}),Pe(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Pe(A,"handleMouseMove",function(M){M.persist(),A.throttleTriggeredAfterMouseMove(M)}),Pe(A,"handleMouseLeave",function(M){A.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var D=A.props.onMouseLeave;Ye(D)&&D(R,M)}),Pe(A,"handleOuterEvent",function(M){var R=nte(M),D=Mr(A.props,"".concat(R));if(R&&Ye(D)){var z,G;/.*touch.*/i.test(R)?G=A.getMouseInfo(M.changedTouches[0]):G=A.getMouseInfo(M),D((z=G)!==null&&z!==void 0?z:{},M)}}),Pe(A,"handleClick",function(M){var R=A.getMouseInfo(M);if(R){var D=ue(ue({},R),{},{isTooltipActive:!0});A.setState(D),A.triggerSyncEvent(D);var z=A.props.onClick;Ye(z)&&z(D,M)}}),Pe(A,"handleMouseDown",function(M){var R=A.props.onMouseDown;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleMouseUp",function(M){var R=A.props.onMouseUp;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleTouchMove",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(M.changedTouches[0])}),Pe(A,"handleTouchStart",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.handleMouseDown(M.changedTouches[0])}),Pe(A,"handleTouchEnd",function(M){M.changedTouches!=null&&M.changedTouches.length>0&&A.handleMouseUp(M.changedTouches[0])}),Pe(A,"handleDoubleClick",function(M){var R=A.props.onDoubleClick;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"handleContextMenu",function(M){var R=A.props.onContextMenu;if(Ye(R)){var D=A.getMouseInfo(M);R(D,M)}}),Pe(A,"triggerSyncEvent",function(M){A.props.syncId!==void 0&&z1.emit(B1,A.props.syncId,M,A.eventEmitterSymbol)}),Pe(A,"applySyncEvent",function(M){var R=A.props,D=R.layout,z=R.syncMethod,G=A.state.updateId,L=M.dataStartIndex,F=M.dataEndIndex;if(M.dataStartIndex!==void 0||M.dataEndIndex!==void 0)A.setState(ue({dataStartIndex:L,dataEndIndex:F},b({props:A.props,dataStartIndex:L,dataEndIndex:F,updateId:G},A.state)));else if(M.activeTooltipIndex!==void 0){var W=M.chartX,Q=M.chartY,X=M.activeTooltipIndex,k=A.state,H=k.offset,B=k.tooltipTicks;if(!H)return;if(typeof z=="function")X=z(B,M);else if(z==="value"){X=-1;for(var Z=0;Z<B.length;Z++)if(B[Z].value===M.activeLabel){X=Z;break}}var le=ue(ue({},H),{},{x:H.left,y:H.top}),$=Math.min(W,le.x+le.width),Y=Math.min(Q,le.y+le.height),q=B[X]&&B[X].value,U=zj(A.state,A.props.data,X),ne=B[X]?{x:D==="horizontal"?B[X].coordinate:$,y:D==="horizontal"?Y:B[X].coordinate}:W6;A.setState(ue(ue({},M),{},{activeLabel:q,activeCoordinate:ne,activePayload:U,activeTooltipIndex:X}))}else A.setState(M)}),Pe(A,"renderCursor",function(M){var R,D=A.state,z=D.isTooltipActive,G=D.activeCoordinate,L=D.activePayload,F=D.offset,W=D.activeTooltipIndex,Q=D.tooltipAxisBandSize,X=A.getTooltipEventType(),k=(R=M.props.active)!==null&&R!==void 0?R:z,H=A.props.layout,B=M.key||"_recharts-cursor";return I.createElement(Sve,{key:B,activeCoordinate:G,activePayload:L,activeTooltipIndex:W,chartName:n,element:M,isActive:k,layout:H,offset:F,tooltipAxisBandSize:Q,tooltipEventType:X})}),Pe(A,"renderPolarAxis",function(M,R,D){var z=Mr(M,"type.axisType"),G=Mr(A.state,"".concat(z,"Map")),L=M.type.defaultProps,F=L!==void 0?ue(ue({},L),M.props):M.props,W=G&&G[F["".concat(z,"Id")]];return w.cloneElement(M,ue(ue({},W),{},{className:rt(z,W.className),key:M.key||"".concat(R,"-").concat(D),ticks:Ka(W,!0)}))}),Pe(A,"renderPolarGrid",function(M){var R=M.props,D=R.radialLines,z=R.polarAngles,G=R.polarRadius,L=A.state,F=L.radiusAxisMap,W=L.angleAxisMap,Q=Yi(F),X=Yi(W),k=X.cx,H=X.cy,B=X.innerRadius,Z=X.outerRadius;return w.cloneElement(M,{polarAngles:Array.isArray(z)?z:Ka(X,!0).map(function(le){return le.coordinate}),polarRadius:Array.isArray(G)?G:Ka(Q,!0).map(function(le){return le.coordinate}),cx:k,cy:H,innerRadius:B,outerRadius:Z,key:M.key||"polar-grid",radialLines:D})}),Pe(A,"renderLegend",function(){var M=A.state.formattedGraphicalItems,R=A.props,D=R.children,z=R.width,G=R.height,L=A.props.margin||{},F=z-(L.left||0)-(L.right||0),W=HB({children:D,formattedGraphicalItems:M,legendWidth:F,legendContent:h});if(!W)return null;var Q=W.item,X=I4(W,jve);return w.cloneElement(Q,ue(ue({},X),{},{chartWidth:z,chartHeight:G,margin:L,onBBoxUpdate:A.handleLegendBBoxUpdate}))}),Pe(A,"renderTooltip",function(){var M,R=A.props,D=R.children,z=R.accessibilityLayer,G=rr(D,_r);if(!G)return null;var L=A.state,F=L.isTooltipActive,W=L.activeCoordinate,Q=L.activePayload,X=L.activeLabel,k=L.offset,H=(M=G.props.active)!==null&&M!==void 0?M:F;return w.cloneElement(G,{viewBox:ue(ue({},k),{},{x:k.left,y:k.top}),active:H,label:X,payload:H?Q:[],coordinate:W,accessibilityLayer:z})}),Pe(A,"renderBrush",function(M){var R=A.props,D=R.margin,z=R.data,G=A.state,L=G.offset,F=G.dataStartIndex,W=G.dataEndIndex,Q=G.updateId;return w.cloneElement(M,{key:M.key||"_recharts-brush",onChange:Lh(A.handleBrushChange,M.props.onChange),data:z,x:be(M.props.x)?M.props.x:L.left,y:be(M.props.y)?M.props.y:L.top+L.height+L.brushBottom-(D.bottom||0),width:be(M.props.width)?M.props.width:L.width,startIndex:F,endIndex:W,updateId:"brush-".concat(Q)})}),Pe(A,"renderReferenceElement",function(M,R,D){if(!M)return null;var z=A,G=z.clipPathId,L=A.state,F=L.xAxisMap,W=L.yAxisMap,Q=L.offset,X=M.type.defaultProps||{},k=M.props,H=k.xAxisId,B=H===void 0?X.xAxisId:H,Z=k.yAxisId,le=Z===void 0?X.yAxisId:Z;return w.cloneElement(M,{key:M.key||"".concat(R,"-").concat(D),xAxis:F[B],yAxis:W[le],viewBox:{x:Q.left,y:Q.top,width:Q.width,height:Q.height},clipPathId:G})}),Pe(A,"renderActivePoints",function(M){var R=M.item,D=M.activePoint,z=M.basePoint,G=M.childIndex,L=M.isRange,F=[],W=R.props.key,Q=R.item.type.defaultProps!==void 0?ue(ue({},R.item.type.defaultProps),R.item.props):R.item.props,X=Q.activeDot,k=Q.dataKey,H=ue(ue({index:G,dataKey:k,cx:D.x,cy:D.y,r:4,fill:IE(R.item),strokeWidth:2,stroke:"#fff",payload:D.payload,value:D.value},nt(X,!1)),Rm(X));return F.push(E.renderActiveDot(X,H,"".concat(W,"-activePoint-").concat(G))),z?F.push(E.renderActiveDot(X,ue(ue({},H),{},{cx:z.x,cy:z.y}),"".concat(W,"-basePoint-").concat(G))):L&&F.push(null),F}),Pe(A,"renderGraphicChild",function(M,R,D){var z=A.filterFormatItem(M,R,D);if(!z)return null;var G=A.getTooltipEventType(),L=A.state,F=L.isTooltipActive,W=L.tooltipAxis,Q=L.activeTooltipIndex,X=L.activeLabel,k=A.props.children,H=rr(k,_r),B=z.props,Z=B.points,le=B.isRange,$=B.baseLine,Y=z.item.type.defaultProps!==void 0?ue(ue({},z.item.type.defaultProps),z.item.props):z.item.props,q=Y.activeDot,U=Y.hide,ne=Y.activeBar,fe=Y.activeShape,ie=!!(!U&&F&&H&&(q||ne||fe)),pe={};G!=="axis"&&H&&H.props.trigger==="click"?pe={onClick:Lh(A.handleItemMouseEnter,M.props.onClick)}:G!=="axis"&&(pe={onMouseLeave:Lh(A.handleItemMouseLeave,M.props.onMouseLeave),onMouseEnter:Lh(A.handleItemMouseEnter,M.props.onMouseEnter)});var re=w.cloneElement(M,ue(ue({},z.props),pe));function ve(Rt){return typeof W.dataKey=="function"?W.dataKey(Rt.payload):null}if(ie)if(Q>=0){var ge,oe;if(W.dataKey&&!W.allowDuplicatedCategory){var ke=typeof W.dataKey=="function"?ve:"payload.".concat(W.dataKey.toString());ge=Mm(Z,ke,X),oe=le&&$&&Mm($,ke,X)}else ge=Z==null?void 0:Z[Q],oe=le&&$&&$[Q];if(fe||ne){var we=M.props.activeIndex!==void 0?M.props.activeIndex:Q;return[w.cloneElement(M,ue(ue(ue({},z.props),pe),{},{activeIndex:we})),null,null]}if(!Qe(ge))return[re].concat(ec(A.renderActivePoints({item:z,activePoint:ge,basePoint:oe,childIndex:Q,isRange:le})))}else{var ze,Ze=(ze=A.getItemByXY(A.state.activeCoordinate))!==null&&ze!==void 0?ze:{graphicalItem:re},lt=Ze.graphicalItem,tn=lt.item,pt=tn===void 0?M:tn,fr=lt.childIndex,Yn=ue(ue(ue({},z.props),pe),{},{activeIndex:fr});return[w.cloneElement(pt,Yn),null,null]}return le?[re,null,null]:[re,null]}),Pe(A,"renderCustomized",function(M,R,D){return w.cloneElement(M,ue(ue({key:"recharts-customized-".concat(D)},A.props),A.state))}),Pe(A,"renderMap",{CartesianGrid:{handler:Hh,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Hh},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Hh},YAxis:{handler:Hh},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((_=N.id)!==null&&_!==void 0?_:Xf("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=Uz(A.triggeredAfterMouseMove,(C=N.throttleDelay)!==null&&C!==void 0?C:1e3/60),A.state={},A}return kve(E,x),Mve(E,[{key:"componentDidMount",value:function(){var _,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var _=this.props,C=_.children,A=_.data,M=_.height,R=_.layout,D=rr(C,_r);if(D){var z=D.props.defaultIndex;if(!(typeof z!="number"||z<0||z>this.state.tooltipTicks.length-1)){var G=this.state.tooltipTicks[z]&&this.state.tooltipTicks[z].value,L=zj(this.state,A,z,G),F=this.state.tooltipTicks[z].coordinate,W=(this.state.offset.top+M)/2,Q=R==="horizontal",X=Q?{x:F,y:W}:{y:F,x:W},k=this.state.formattedGraphicalItems.find(function(B){var Z=B.item;return Z.type.name==="Scatter"});k&&(X=ue(ue({},X),k.props.points[z].tooltipPosition),L=k.props.points[z].tooltipPayload);var H={activeTooltipIndex:z,isTooltipActive:!0,activeLabel:G,activePayload:L,activeCoordinate:X};this.setState(H),this.renderCursor(D),this.accessibilityManager.setIndex(z)}}}},{key:"getSnapshotBeforeUpdate",value:function(_,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==_.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==_.margin){var A,M;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(M=this.props.margin.top)!==null&&M!==void 0?M:0}})}return null}},{key:"componentDidUpdate",value:function(_){OS([rr(_.children,_r)],[rr(this.props.children,_r)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var _=rr(this.props.children,_r);if(_&&typeof _.props.shared=="boolean"){var C=_.props.shared?"axis":"item";return u.indexOf(C)>=0?C:o}return o}},{key:"getMouseInfo",value:function(_){if(!this.container)return null;var C=this.container,A=C.getBoundingClientRect(),M=Hae(A),R={chartX:Math.round(_.pageX-M.left),chartY:Math.round(_.pageY-M.top)},D=A.width/C.offsetWidth||1,z=this.inRange(R.chartX,R.chartY,D);if(!z)return null;var G=this.state,L=G.xAxisMap,F=G.yAxisMap,W=this.getTooltipEventType(),Q=z4(this.state,this.props.data,this.props.layout,z);if(W!=="axis"&&L&&F){var X=Yi(L).scale,k=Yi(F).scale,H=X&&X.invert?X.invert(R.chartX):null,B=k&&k.invert?k.invert(R.chartY):null;return ue(ue({},R),{},{xValue:H,yValue:B},Q)}return Q?ue(ue({},R),Q):null}},{key:"inRange",value:function(_,C){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,M=this.props.layout,R=_/A,D=C/A;if(M==="horizontal"||M==="vertical"){var z=this.state.offset,G=R>=z.left&&R<=z.left+z.width&&D>=z.top&&D<=z.top+z.height;return G?{x:R,y:D}:null}var L=this.state,F=L.angleAxisMap,W=L.radiusAxisMap;if(F&&W){var Q=Yi(F);return nk({x:R,y:D},Q)}return null}},{key:"parseEventsOfWrapper",value:function(){var _=this.props.children,C=this.getTooltipEventType(),A=rr(_,_r),M={};A&&C==="axis"&&(A.props.trigger==="click"?M={onClick:this.handleClick}:M={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var R=Rm(this.props,this.handleOuterEvent);return ue(ue({},R),M)}},{key:"addListener",value:function(){z1.on(B1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){z1.removeListener(B1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(_,C,A){for(var M=this.state.formattedGraphicalItems,R=0,D=M.length;R<D;R++){var z=M[R];if(z.item===_||z.props.key===_.key||C===Za(z.item.type)&&A===z.childIndex)return z}return null}},{key:"renderClipPath",value:function(){var _=this.clipPathId,C=this.state.offset,A=C.left,M=C.top,R=C.height,D=C.width;return I.createElement("defs",null,I.createElement("clipPath",{id:_},I.createElement("rect",{x:A,y:M,height:R,width:D})))}},{key:"getXScales",value:function(){var _=this.state.xAxisMap;return _?Object.entries(_).reduce(function(C,A){var M=$4(A,2),R=M[0],D=M[1];return ue(ue({},C),{},Pe({},R,D.scale))},{}):null}},{key:"getYScales",value:function(){var _=this.state.yAxisMap;return _?Object.entries(_).reduce(function(C,A){var M=$4(A,2),R=M[0],D=M[1];return ue(ue({},C),{},Pe({},R,D.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(_){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[_])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(_){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[_])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(_){var C=this.state,A=C.formattedGraphicalItems,M=C.activeItem;if(A&&A.length)for(var R=0,D=A.length;R<D;R++){var z=A[R],G=z.props,L=z.item,F=L.type.defaultProps!==void 0?ue(ue({},L.type.defaultProps),L.props):L.props,W=Za(L.type);if(W==="Bar"){var Q=(G.data||[]).find(function(B){return ude(_,B)});if(Q)return{graphicalItem:z,payload:Q}}else if(W==="RadialBar"){var X=(G.data||[]).find(function(B){return nk(_,B)});if(X)return{graphicalItem:z,payload:X}}else if(Fv(z,M)||Gv(z,M)||Cf(z,M)){var k=ehe({graphicalItem:z,activeTooltipItem:M,itemData:F.data}),H=F.activeIndex===void 0?k:F.activeIndex;return{graphicalItem:ue(ue({},z),{},{childIndex:H}),payload:Cf(z,M)?F.data[k]:z.props.data[k]}}}return null}},{key:"render",value:function(){var _=this;if(!hM(this))return null;var C=this.props,A=C.children,M=C.className,R=C.width,D=C.height,z=C.style,G=C.compact,L=C.title,F=C.desc,W=I4(C,Ove),Q=nt(W,!1);if(G)return I.createElement(g4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement(_S,yl({},Q,{width:R,height:D,title:L,desc:F}),this.renderClipPath(),pM(A,this.renderMap)));if(this.props.accessibilityLayer){var X,k;Q.tabIndex=(X=this.props.tabIndex)!==null&&X!==void 0?X:0,Q.role=(k=this.props.role)!==null&&k!==void 0?k:"application",Q.onKeyDown=function(B){_.accessibilityManager.keyboardEvent(B)},Q.onFocus=function(){_.accessibilityManager.focus()}}var H=this.parseEventsOfWrapper();return I.createElement(g4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},I.createElement("div",yl({className:rt("recharts-wrapper",M),style:ue({position:"relative",cursor:"default",width:R,height:D},z)},H,{ref:function(Z){_.container=Z}}),I.createElement(_S,yl({},Q,{width:R,height:D,title:L,desc:F,style:qve}),this.renderClipPath(),pM(A,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(w.Component);Pe(O,"displayName",n),Pe(O,"defaultProps",ue({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),Pe(O,"getDerivedStateFromProps",function(x,E){var N=x.dataKey,_=x.data,C=x.children,A=x.width,M=x.height,R=x.layout,D=x.stackOffset,z=x.margin,G=E.dataStartIndex,L=E.dataEndIndex;if(E.updateId===void 0){var F=B4(x);return ue(ue(ue({},F),{},{updateId:0},b(ue(ue({props:x},F),{},{updateId:0}),E)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:M,prevLayout:R,prevStackOffset:D,prevMargin:z,prevChildren:C})}if(N!==E.prevDataKey||_!==E.prevData||A!==E.prevWidth||M!==E.prevHeight||R!==E.prevLayout||D!==E.prevStackOffset||!Ol(z,E.prevMargin)){var W=B4(x),Q={chartX:E.chartX,chartY:E.chartY,isTooltipActive:E.isTooltipActive},X=ue(ue({},z4(E,_,R)),{},{updateId:E.updateId+1}),k=ue(ue(ue({},W),Q),X);return ue(ue(ue({},k),b(ue({props:x},k),E)),{},{prevDataKey:N,prevData:_,prevWidth:A,prevHeight:M,prevLayout:R,prevStackOffset:D,prevMargin:z,prevChildren:C})}if(!OS(C,E.prevChildren)){var H,B,Z,le,$=rr(C,Fl),Y=$&&(H=(B=$.props)===null||B===void 0?void 0:B.startIndex)!==null&&H!==void 0?H:G,q=$&&(Z=(le=$.props)===null||le===void 0?void 0:le.endIndex)!==null&&Z!==void 0?Z:L,U=Y!==G||q!==L,ne=!Qe(_),fe=ne&&!U?E.updateId:E.updateId+1;return ue(ue({updateId:fe},b(ue(ue({props:x},E),{},{updateId:fe,dataStartIndex:Y,dataEndIndex:q}),E)),{},{prevChildren:C,dataStartIndex:Y,dataEndIndex:q})}return null}),Pe(O,"renderActiveDot",function(x,E,N){var _;return w.isValidElement(x)?_=w.cloneElement(x,E):Ye(x)?_=x(E):_=I.createElement(zE,E),I.createElement(Bt,{className:"recharts-active-dot",key:N},_)});var S=w.forwardRef(function(E,N){return I.createElement(O,yl({},E,{ref:N}))});return S.displayName=O.displayName,S},Q6=X6({chartName:"LineChart",GraphicalChild:Nr,axisComponents:[{axisType:"xAxis",AxisComp:ys},{axisType:"yAxis",AxisComp:fi}],formatAxisMap:p6}),Qve=X6({chartName:"BarChart",GraphicalChild:no,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ys},{axisType:"yAxis",AxisComp:fi}],formatAxisMap:p6});function U1(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/t**r).toFixed(1))} ${n[r]}`}function Wo(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString()}function Fh({title:e,value:t,description:n,icon:r,trend:i}){return c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between pb-2",children:[c.jsx(Le,{className:"font-medium text-muted-foreground text-sm",children:e}),c.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:t}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("p",{className:"text-muted-foreground text-xs",children:n}),i!==void 0&&i!==0&&c.jsxs("span",{className:`flex items-center text-xs ${i>0?"text-green-500":"text-red-500"}`,children:[c.jsx(Zj,{className:`h-3 w-3 ${i<0?"rotate-180":""}`}),Math.abs(i),"%"]})]})]})]})}function Zve({data:e}){const t=e.map(n=>({date:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),size:n.size/1073741824,files:n.files}));return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Storage Usage"}),c.jsx(We,{children:"Storage size and file count over time"})]}),c.jsx($e,{children:c.jsx(dE,{height:300,width:"100%",children:c.jsxs(Q6,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"date",stroke:"currentColor",tick:{fill:"currentColor"}}),c.jsx(fi,{className:"text-xs",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>`${n} GB`,yAxisId:"left"}),c.jsx(fi,{className:"text-xs",orientation:"right",stroke:"currentColor",tick:{fill:"currentColor"},yAxisId:"right"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},formatter:(n,r)=>[r==="size"?`${n.toFixed(2)} GB`:n,r==="size"?"Storage":"Files"]}),c.jsx(ei,{}),c.jsx(Nr,{dataKey:"size",dot:!1,name:"Storage (GB)",stroke:"hsl(var(--primary))",strokeWidth:2,type:"monotone",yAxisId:"left"}),c.jsx(Nr,{dataKey:"files",dot:!1,name:"File Count",stroke:"hsl(var(--chart-2))",strokeWidth:2,type:"monotone",yAxisId:"right"})]})})})]})}function Jve({data:e}){const t=e.map(n=>({date:new Date(n.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),bandwidth:n.bytes/1048576,requests:n.requests}));return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"CDN Traffic"}),c.jsx(We,{children:"Bandwidth and requests over time"})]}),c.jsx($e,{children:c.jsx(dE,{height:300,width:"100%",children:c.jsxs(Qve,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"date",stroke:"currentColor",tick:{fill:"currentColor"}}),c.jsx(fi,{className:"text-xs",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>`${n} MB`,yAxisId:"left"}),c.jsx(fi,{className:"text-xs",orientation:"right",stroke:"currentColor",tick:{fill:"currentColor"},tickFormatter:n=>Wo(n),yAxisId:"right"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"var(--radius)"},formatter:(n,r)=>[r==="bandwidth"?`${n.toFixed(1)} MB`:Wo(n),r==="bandwidth"?"Bandwidth":"Requests"]}),c.jsx(ei,{}),c.jsx(no,{dataKey:"bandwidth",fill:"hsl(var(--primary))",name:"Bandwidth (MB)",radius:[4,4,0,0],yAxisId:"left"}),c.jsx(no,{dataKey:"requests",fill:"hsl(var(--chart-3))",name:"Requests",radius:[4,4,0,0],yAxisId:"right"})]})})})]})}function ege({files:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Top Files"}),c.jsx(We,{children:"Most requested files this month"})]}),c.jsx($e,{children:e.length===0?c.jsx("div",{className:"py-4 text-center text-muted-foreground",children:"No data available"}):c.jsx("div",{className:"space-y-4",children:e.map((t,n)=>{const r=t.key.split("/").pop()||t.key,i=Math.max(...e.map(l=>l.requests)),o=t.requests/i*100;return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between text-sm",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-muted-foreground",children:[n+1,"."]}),c.jsx("span",{className:"max-w-[200px] truncate font-medium",children:r})]}),c.jsxs("span",{className:"text-muted-foreground",children:[Wo(t.requests)," requests"]})]}),c.jsx(pv,{className:"h-2",value:o})]},t.key)})})})]})}function tge(){return c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>c.jsxs(Te,{children:[c.jsx(Me,{className:"pb-2",children:c.jsx(Re,{className:"h-4 w-20"})}),c.jsxs($e,{children:[c.jsx(Re,{className:"h-8 w-24"}),c.jsx(Re,{className:"mt-2 h-3 w-32"})]})]},t))}),c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsx(Re,{className:"h-6 w-32"})}),c.jsx($e,{children:c.jsx(Re,{className:"h-[300px] w-full"})})]})]})}function nge(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function rge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),[l,u]=w.useState("7d"),d=w.useCallback(async()=>{try{r(!0),o(null);const h=sessionStorage.getItem("wraps-auth-token"),v=await fetch(`/api/cdn/metrics?token=${h}&range=${l}`);if(!v.ok){if(v.status===404){t(null);return}throw new Error("Failed to fetch storage metrics")}const m=await v.json();t(m)}catch(h){o(h instanceof Error?h.message:"An error occurred")}finally{r(!1)}},[l]);return w.useEffect(()=>{d()},[d]),n?c.jsx(tge,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"Storage Metrics"}),c.jsx("p",{className:"text-muted-foreground",children:"Monitor your storage usage and CDN traffic"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(ma,{onValueChange:u,value:l,children:[c.jsx(va,{className:"w-32",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"7d",children:"Last 7 days"}),c.jsx(Fe,{value:"30d",children:"Last 30 days"}),c.jsx(Fe,{value:"90d",children:"Last 90 days"})]})]}),c.jsxs(Ce,{onClick:d,size:"sm",variant:"outline",children:[c.jsx(Bf,{className:"mr-2 h-4 w-4"}),"Refresh"]})]})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[c.jsx(Fh,{description:`${Wo(e.summary.fileCount)} files`,icon:_F,title:"Storage Used",value:U1(e.summary.totalSize)}),c.jsx(Fh,{description:`${U1(e.summary.bandwidth.thisMonth)} this month`,icon:bF,title:"Bandwidth Today",value:U1(e.summary.bandwidth.today)}),c.jsx(Fh,{description:`${Wo(e.summary.requests.thisMonth)} this month`,icon:Vu,title:"Requests Today",value:Wo(e.summary.requests.today)}),c.jsx(Fh,{description:"Files in storage",icon:wF,title:"Total Files",value:Wo(e.summary.fileCount)})]}),c.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[c.jsx(Zve,{data:e.usage}),c.jsx(Jve,{data:e.bandwidth})]}),c.jsx(ege,{files:e.topFiles})]}):c.jsx(nge,{})}function Ap({status:e}){const t={SUCCESS:{icon:ao,label:"Active",className:"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20"},PENDING:{icon:Qo,label:"Pending",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20"},FAILED:{icon:h$,label:"Failed",className:"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20"},DISABLED:{icon:lr,label:"Disabled",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20"}},{icon:n,label:r,className:i}=t[e];return c.jsxs(qe,{className:i,variant:"outline",children:[c.jsx(n,{className:"mr-1 h-3 w-3"}),r]})}function bl({text:e}){const t=async()=>{await navigator.clipboard.writeText(e),Ot.success("Copied to clipboard")};return c.jsx(Ce,{onClick:t,size:"sm",variant:"ghost",children:c.jsx(Kj,{className:"h-3 w-3"})})}function age({settings:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zf,{className:"h-5 w-5"}),c.jsx(Le,{children:"S3 Bucket"})]}),c.jsx(Ap,{status:"SUCCESS"})]}),c.jsx(We,{children:"Your storage bucket for uploading files"})]}),c.jsx($e,{className:"space-y-4",children:c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Bucket Name"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.bucketName}),c.jsx(bl,{text:e.bucketName})]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Region"}),c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.region})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Versioning"}),c.jsx(qe,{variant:e.versioning?"default":"secondary",children:e.versioning?"Enabled":"Disabled"})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Encryption"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-4 w-4 text-green-500"}),c.jsx("span",{className:"text-sm",children:"AES-256"})]})]}),e.retention&&e.retention!=="none"&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Auto-Cleanup"}),c.jsx("span",{className:"text-sm",children:e.retention})]})]})]})})]})}function ige({settings:e}){var i,o;const[t,n]=w.useState(!1);if(!((i=e.cdn)!=null&&i.enabled))return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-5 w-5"}),c.jsx(Le,{children:"CloudFront CDN"})]}),c.jsx(Ap,{status:"DISABLED"})]}),c.jsx(We,{children:"CDN is not enabled for this storage bucket"})]})});const r=e.cdn.status==="Deployed"?"SUCCESS":e.cdn.status==="InProgress"?"PENDING":"FAILED";return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-5 w-5"}),c.jsx(Le,{children:"CloudFront CDN"})]}),c.jsx(Ap,{status:r})]}),c.jsx(We,{children:"Global content delivery network for fast file access"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4",children:[e.cdn.distributionId&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Distribution ID"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:e.cdn.distributionId}),c.jsx(bl,{text:e.cdn.distributionId})]})]}),c.jsx(qt,{})]}),e.cdn.distributionDomain&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"CloudFront URL"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("a",{className:"text-blue-600 text-sm hover:underline dark:text-blue-400",href:`https://${e.cdn.distributionDomain}`,rel:"noopener noreferrer",target:"_blank",children:[e.cdn.distributionDomain,c.jsx(Gu,{className:"ml-1 inline h-3 w-3"})]}),c.jsx(bl,{text:`https://${e.cdn.distributionDomain}`})]})]}),c.jsx(qt,{})]}),e.cdn.customDomain&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Custom Domain"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("a",{className:"text-blue-600 text-sm hover:underline dark:text-blue-400",href:`https://${e.cdn.customDomain}`,rel:"noopener noreferrer",target:"_blank",children:[e.cdn.customDomain,c.jsx(Gu,{className:"ml-1 inline h-3 w-3"})]}),c.jsx(bl,{text:`https://${e.cdn.customDomain}`})]})]})]}),((o=e.certificate)==null?void 0:o.validationRecords)&&e.certificate.validationRecords.length>0&&e.certificate.status==="PENDING_VALIDATION"&&c.jsxs(fs,{onOpenChange:n,open:t,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"w-full justify-between",variant:"ghost",children:[c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx(lr,{className:"h-4 w-4 text-yellow-500"}),"Certificate DNS Records Required"]}),t?c.jsx("span",{className:"text-xs",children:"Hide"}):c.jsx("span",{className:"text-xs",children:"Show"})]})}),c.jsxs(hs,{className:"mt-2 space-y-2",children:[c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Action Required"}),c.jsx(Hn,{children:"Add these DNS records to verify your custom domain certificate"})]}),e.certificate.validationRecords.map((l,u)=>c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3 font-mono text-xs",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:l.type}),c.jsx(bl,{text:l.value})]}),c.jsx("div",{className:"mt-1 break-all",children:l.name}),c.jsxs("div",{className:"mt-1 break-all text-muted-foreground",children:["→ ",l.value]})]},u))]})]})]})]})}function oge({settings:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),c.jsx(Le,{children:"IAM Role"})]}),c.jsx(Ap,{status:"SUCCESS"})]}),c.jsx(We,{children:"Role used by your application to access storage"})]}),c.jsx($e,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Role ARN"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"max-w-[300px] truncate rounded bg-muted px-2 py-1 font-mono text-xs",children:e.roleArn}),c.jsx(bl,{text:e.roleArn})]})]})})]})}function sge(){return c.jsxs("div",{className:"space-y-6",children:[c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-32"}),c.jsx(Re,{className:"h-4 w-64"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"})]})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-32"}),c.jsx(Re,{className:"h-4 w-64"})]}),c.jsx($e,{children:c.jsxs("div",{className:"space-y-4",children:[c.jsx(Re,{className:"h-8 w-full"}),c.jsx(Re,{className:"h-8 w-full"})]})})]})]})}function lge(){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[c.jsx(zf,{className:"mb-4 h-16 w-16 text-muted-foreground opacity-50"}),c.jsx("h2",{className:"mb-2 font-semibold text-xl",children:"No Storage Configured"}),c.jsxs("p",{className:"mb-6 max-w-md text-center text-muted-foreground",children:["Storage infrastructure has not been deployed yet. Run"," ",c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-sm",children:"wraps storage init"})," ","to get started."]})]})}function cge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0),o(null);const u=sessionStorage.getItem("wraps-auth-token"),d=await fetch(`/api/cdn/settings?token=${u}`);if(!d.ok){if(d.status===404){t(null);return}throw new Error("Failed to fetch storage settings")}const h=await d.json();t(h)}catch(u){o(u instanceof Error?u.message:"An error occurred")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsx(sge,{}):i?c.jsxs(Un,{variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error"}),c.jsx(Hn,{children:i})]}):e?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-bold text-2xl",children:"Storage Settings"}),c.jsx("p",{className:"text-muted-foreground",children:"Manage your S3 bucket and CloudFront CDN configuration"})]}),c.jsxs(Ce,{onClick:l,size:"sm",variant:"outline",children:[c.jsx(Bf,{className:"mr-2 h-4 w-4"}),"Refresh"]})]}),c.jsx(age,{settings:e}),c.jsx(ige,{settings:e}),c.jsx(oge,{settings:e})]}):c.jsx(lge,{})}function Nl({className:e,...t}){return c.jsx("div",{className:me("group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs outline-none transition-[color,box-shadow] dark:bg-input/30","h-9 min-w-0 has-[>textarea]:h-auto","has-[>[data-align=inline-start]]:[&>input]:pl-2","has-[>[data-align=inline-end]]:[&>input]:pr-2","has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3","has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3","has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),"data-slot":"input-group",role:"group",...t})}const uge=mc("flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 font-medium text-muted-foreground text-sm group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]","inline-end":"order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]","block-start":"order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3","block-end":"order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}});function la({className:e,align:t="inline-start",...n}){return c.jsx("div",{className:me(uge({align:t}),e),"data-align":t,"data-slot":"input-group-addon",onClick:r=>{var i,o;r.target.closest("button")||(o=(i=r.currentTarget.parentElement)==null?void 0:i.querySelector("input"))==null||o.focus()},role:"group",...n})}function Al({className:e,...t}){return c.jsx("span",{className:me("flex items-center gap-2 text-muted-foreground text-sm [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",e),...t})}function Cl({className:e,...t}){return c.jsx(oo,{className:me("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",e),"data-slot":"input-group-control",...t})}var Jv="Tabs",[fge]=jn(Jv,[hc]),Z6=hc(),[dge,KE]=fge(Jv),J6=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...h}=e,v=lc(u),[m,g]=Nn({prop:r,onChange:i,defaultProp:o??"",caller:Jv});return c.jsx(dge,{scope:n,baseId:Cr(),value:m,onValueChange:g,orientation:l,dir:v,activationMode:d,children:c.jsx(Ne.div,{dir:v,"data-orientation":l,...h,ref:t})})});J6.displayName=Jv;var e8="TabsList",t8=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,o=KE(e8,n),l=Z6(n);return c.jsx(uO,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(Ne.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});t8.displayName=e8;var n8="TabsTrigger",r8=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...o}=e,l=KE(n8,n),u=Z6(n),d=o8(l.baseId,r),h=s8(l.baseId,r),v=r===l.value;return c.jsx(fO,{asChild:!0,...u,focusable:!i,active:v,children:c.jsx(Ne.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":h,"data-state":v?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:d,...o,ref:t,onMouseDown:ye(e.onMouseDown,m=>{!i&&m.button===0&&m.ctrlKey===!1?l.onValueChange(r):m.preventDefault()}),onKeyDown:ye(e.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&l.onValueChange(r)}),onFocus:ye(e.onFocus,()=>{const m=l.activationMode!=="manual";!v&&!i&&m&&l.onValueChange(r)})})})});r8.displayName=n8;var a8="TabsContent",i8=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:o,...l}=e,u=KE(a8,n),d=o8(u.baseId,r),h=s8(u.baseId,r),v=r===u.value,m=w.useRef(v);return w.useEffect(()=>{const g=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(g)},[]),c.jsx(An,{present:i||v,children:({present:g})=>c.jsx(Ne.div,{"data-state":v?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:h,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:g&&o})})});i8.displayName=a8;function o8(e,t){return`${e}-trigger-${t}`}function s8(e,t){return`${e}-content-${t}`}var hge=J6,mge=t8,pge=r8,vge=i8;function l8({className:e,...t}){return c.jsx(hge,{className:me("flex flex-col gap-2",e),"data-slot":"tabs",...t})}function c8({className:e,...t}){return c.jsx(mge,{className:me("inline-flex h-9 w-fit items-center justify-center rounded-lg bg-muted p-[3px] text-muted-foreground",e),"data-slot":"tabs-list",...t})}function Uu({className:e,...t}){return c.jsx(pge,{className:me("inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 py-1 font-medium text-foreground text-sm transition-[color,box-shadow] focus-visible:border-ring focus-visible:outline-1 focus-visible:outline-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:shadow-sm dark:text-muted-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),"data-slot":"tabs-trigger",...t})}function Hu({className:e,...t}){return c.jsx(vge,{className:me("flex-1 outline-none",e),"data-slot":"tabs-content",...t})}function gge({messageId:e,archivingEnabled:t}){const[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);return w.useEffect(()=>{async function d(){if(!t){o(!1);return}try{o(!0),u(null);const h=sessionStorage.getItem("wraps-auth-token");if(!h)throw new Error("Authentication token not found");const v=encodeURIComponent(e),m=await fetch(`/api/emails/${v}/archive?token=${h}`);if(!m.ok){if(m.status===404){r(null),o(!1);return}throw new Error(`Failed to fetch archived email: ${m.statusText}`)}const g=await m.json();r({...g,timestamp:new Date(g.timestamp)})}catch(h){const v=h instanceof Error?h.message:"Unknown error";u(v),console.error("Error fetching archived email:",h)}finally{o(!1)}}d()},[e,t]),t?i?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Loading archived email content..."})]}),c.jsx($e,{className:"space-y-4",children:c.jsx(Re,{className:"h-[400px] w-full"})})]}):l?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Failed to load archived email"})]}),c.jsx($e,{children:c.jsx(Un,{variant:"destructive",children:c.jsx(Hn,{children:l})})})]}):n?c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Full email content stored in AWS SES Mail Manager"})]}),n.attachments.length>0&&c.jsxs(qe,{variant:"secondary",children:[n.attachments.length," attachment",n.attachments.length>1?"s":""]})]})}),c.jsxs($e,{children:[c.jsxs(l8,{className:"w-full",defaultValue:"rendered",children:[c.jsxs(c8,{className:"grid w-full grid-cols-3",children:[c.jsxs(Uu,{className:"gap-2",value:"rendered",children:[c.jsx(Vu,{className:"h-4 w-4"}),"Rendered Email"]}),c.jsxs(Uu,{className:"gap-2",value:"text",children:[c.jsx(m$,{className:"h-4 w-4"}),"Plain Text"]}),c.jsxs(Uu,{className:"gap-2",value:"html",children:[c.jsx(EF,{className:"h-4 w-4"}),"HTML Source"]})]}),c.jsxs(Hu,{className:"space-y-4",value:"rendered",children:[n.html?c.jsx("div",{className:"rounded-md border",children:c.jsx("iframe",{className:"h-[600px] w-full rounded-md",sandbox:"allow-same-origin",srcDoc:n.html,title:"Email preview"})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No HTML content available for this email. View the plain text tab instead."})}),n.attachments.length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx("div",{className:"font-medium text-sm",children:"Attachments"}),c.jsx("div",{className:"space-y-2",children:n.attachments.map((d,h)=>c.jsx("div",{className:"flex items-center justify-between rounded-md border p-3",children:c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"font-mono text-sm",children:d.filename||`Attachment ${h+1}`}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:[d.contentType," •"," ",(d.size/1024).toFixed(2)," KB"]})]})},d.filename||`attachment-${h}`))})]})]}),c.jsx(Hu,{className:"space-y-4",value:"text",children:n.text?c.jsx("div",{className:"rounded-md border bg-muted p-4",children:c.jsx("pre",{className:"whitespace-pre-wrap font-mono text-sm",children:n.text})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No plain text content available for this email."})})}),c.jsx(Hu,{className:"space-y-4",value:"html",children:n.html?c.jsx("div",{className:"rounded-md border bg-muted p-4",children:c.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap font-mono text-xs",children:n.html})}):c.jsx(Un,{children:c.jsx(Hn,{children:"No HTML content available for this email."})})})]}),n.metadata&&c.jsxs("div",{className:"mt-6 space-y-3 rounded-md border p-4",children:[c.jsx("div",{className:"font-medium text-sm",children:"SMTP Metadata"}),c.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[n.metadata.senderIp&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"Sender IP"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.senderIp})]}),n.metadata.tlsProtocol&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"TLS Protocol"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.tlsProtocol})]}),n.metadata.senderHostname&&c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-xs",children:"Sender Hostname"}),c.jsx("div",{className:"font-mono text-sm",children:n.metadata.senderHostname})]})]})]})]})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Email content not available"})]}),c.jsx($e,{children:c.jsx(Un,{children:c.jsx(Hn,{children:"This email was not archived. It may have been sent before email archiving was enabled for this deployment."})})})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Archive"}),c.jsx(We,{children:"Enable email archiving to view full email content"})]}),c.jsx($e,{children:c.jsx(Un,{children:c.jsxs(Hn,{children:["Email archiving is not enabled for this deployment. Run"," ",c.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"wraps upgrade"})," ","to enable archiving and view full email content with HTML rendering."]})})})]})}const yge={sent:xl,delivered:ri,bounced:or,suppressed:SF,complained:or,opened:xl,clicked:xl,failed:or},bge={sent:"text-blue-500",delivered:"text-green-500",bounced:"text-red-500",suppressed:"text-amber-500",complained:"text-red-500",opened:"text-purple-500",clicked:"text-indigo-500",failed:"text-red-500"},xge={delivered:"default",sent:"secondary",bounced:"destructive",suppressed:"destructive",complained:"destructive",failed:"destructive",opened:"default",clicked:"default"};function wge(){const{id:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null),[d,h]=w.useState(!1);w.useEffect(()=>{async function g(){var b,O,S;try{o(!0),u(null);const x=sessionStorage.getItem("wraps-auth-token");if(!x)throw new Error("Authentication token not found");try{const A=await fetch(`/api/settings/deployment?token=${x}`);if(A.ok){const M=await A.json();h(M.archivingEnabled??!1)}}catch(A){console.warn("Failed to fetch deployment config:",A)}const E=encodeURIComponent(e||"");console.log("Fetching email with ID:",e),console.log("Encoded ID:",E),console.log("Full URL:",`/api/emails/${E}?token=${x.substring(0,8)}...`);const N=await fetch(`/api/emails/${E}?token=${x}`);if(!N.ok){let A="Failed to fetch email details";try{A=(await N.json()).error||A}catch{A=`${N.status}: ${N.statusText}`}throw new Error(A)}const _=N.headers.get("content-type");if(!(_!=null&&_.includes("application/json"))){const A=await N.text();throw console.error("Non-JSON response:",A),new Error("Server returned non-JSON response")}const C=await N.json();console.log("Email data received:",{id:C.id,hasHtmlBody:!!C.htmlBody,hasTextBody:!!C.textBody,htmlBodyLength:((b=C.htmlBody)==null?void 0:b.length)||0,textBodyLength:((O=C.textBody)==null?void 0:O.length)||0,events:((S=C.events)==null?void 0:S.length)||0}),r(C)}catch(x){const E=x instanceof Error?x.message:"Unknown error";u(E),console.error("Error fetching email details:",x)}finally{o(!1)}}e&&g()},[e]);const v=g=>new Date(g).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),m=g=>new Date(g).toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0});return i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading email details..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back"]})}),c.jsx(Te,{children:c.jsxs(Me,{className:"space-y-1.5",children:[c.jsxs(Le,{className:"flex flex-row items-center gap-2 text-xl",children:[c.jsx("span",{className:"text-xl",children:n.subject||"(no subject)"}),c.jsx(qe,{className:"shrink-0",variant:xge[n.status],children:n.status.charAt(0).toUpperCase()+n.status.slice(1)})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 truncate rounded bg-muted px-2 py-0.5 font-mono text-muted-foreground text-xs",children:n.messageId}),c.jsx(fa,{className:"h-6 w-6 shrink-0",size:"sm",value:n.messageId,variant:"ghost"})]}),c.jsxs("div",{className:"flex flex-col gap-3 pt-2 sm:flex-row sm:flex-wrap",children:[c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"From"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm *:select-all",disabled:!0,readOnly:!0,value:n.from}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.from,variant:"ghost"})})]}),c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"To"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm *:select-all",disabled:!0,readOnly:!0,value:n.to.length>0?n.to.join(", "):"(no recipients)"}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.to.join(", "),variant:"ghost"})})]}),n.replyTo&&c.jsxs(Nl,{className:"w-full sm:w-auto sm:max-w-md",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"Reply-To"})}),c.jsx(Cl,{className:"min-w-0 truncate font-mono text-sm",readOnly:!0,value:n.replyTo}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.replyTo,variant:"ghost"})})]})]})]})}),d&&c.jsx(gge,{archivingEnabled:d,messageId:n.messageId}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Events"}),c.jsx(We,{children:"Lifecycle of this email from send to delivery"})]}),c.jsx($e,{children:c.jsx("div",{className:"space-y-4",children:n.events.length===0?c.jsx("div",{className:"text-muted-foreground text-sm",children:"No events recorded yet"}):n.events.map((g,b)=>{const O=yge[g.type]||Qo,S=b===n.events.length-1;return c.jsx("div",{children:c.jsxs("div",{className:"flex gap-4",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("div",{className:`rounded-full border-2 border-background bg-muted p-2 ${bge[g.type]}`,children:c.jsx(O,{className:"h-4 w-4"})}),!S&&c.jsx("div",{className:"my-1 w-px flex-1 bg-border"})]}),c.jsxs("div",{className:"flex-1 pb-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"font-medium capitalize",children:g.type}),c.jsx("div",{className:"text-muted-foreground text-sm",children:v(g.timestamp)})]}),c.jsx("div",{className:"text-muted-foreground text-sm",children:m(g.timestamp)}),g.metadata&&Object.keys(g.metadata).length>0&&c.jsx("div",{className:"mt-2 rounded-md border bg-muted/50 p-2 font-mono text-xs",children:c.jsx("pre",{className:"overflow-x-auto",children:JSON.stringify(g.metadata,null,2)})})]})]})},`${g.type}-${g.timestamp}`)})})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"Email not found"})]})}function Sge(e){const t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/(1e3*60*60*24));return r===0?t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}):r===1?"Yesterday":r<7?`${r} days ago`:t.toLocaleDateString()}function jge(){const e=Sa(),[t,n]=w.useState([]),[r,i]=w.useState(!0),[o,l]=w.useState(null),[u,d]=w.useState("");w.useEffect(()=>{async function v(){try{i(!0),l(null);const m=sessionStorage.getItem("wraps-auth-token");if(!m)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const g=await fetch(`/api/inbound?limit=50&token=${m}`);if(!g.ok){let O="Failed to fetch inbound emails";try{O=(await g.json()).error||O}catch{O=`${g.status}: ${g.statusText}`}throw new Error(O)}const b=await g.json();n(b.emails||[])}catch(m){const g=m instanceof Error?m.message:"Unknown error";l(g),console.error("Error fetching inbound emails:",m)}finally{i(!1)}}v()},[]);const h=t.filter(v=>{if(!u)return!0;const m=u.toLowerCase(),g=v.from.address.toLowerCase().includes(m)||v.from.name.toLowerCase().includes(m),b=v.subject.toLowerCase().includes(m),O=v.to.some(S=>S.address.toLowerCase().includes(m)||S.name.toLowerCase().includes(m));return g||b||O});return c.jsxs("div",{className:"space-y-4",children:[o&&c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:o}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:v=>d(v.target.value),placeholder:"Search inbound emails...",value:u})]})}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"From"}),c.jsx(Pt,{children:"Subject"}),c.jsx(Pt,{children:"Received"}),c.jsx(Pt,{className:"w-[100px]",children:"Attachments"}),c.jsx(Pt,{className:"w-[80px]",children:"Spam"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:r?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:6,children:"Loading inbound emails..."})}):h.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:6,children:t.length===0?"No inbound emails received yet":"No emails match your search"})}):h.map(v=>c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/email/inbound/${v.emailId}`),children:[c.jsxs(mt,{className:"font-mono text-sm",children:[v.from.name||v.from.address,v.from.name&&c.jsxs("span",{className:"ml-1 text-muted-foreground text-xs",children:["<",v.from.address,">"]})]}),c.jsx(mt,{className:"max-w-[300px] truncate",children:v.subject||"(no subject)"}),c.jsx(mt,{className:"text-muted-foreground",children:Sge(v.receivedAt)}),c.jsx(mt,{children:v.hasAttachments&&c.jsxs(qe,{className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20",variant:"outline",children:[c.jsx(v$,{className:"mr-1 h-3 w-3"}),v.attachmentCount]})}),c.jsx(mt,{children:v.spamVerdict==="PASS"?c.jsx(y$,{className:"h-4 w-4 text-green-500"}):v.spamVerdict==="FAIL"?c.jsx(g$,{className:"h-4 w-4 text-red-500"}):null}),c.jsx(mt,{children:c.jsx(xF,{className:"h-4 w-4 text-muted-foreground"})})]},v.emailId))})]})}),h.length>0&&!r&&c.jsx("div",{className:"flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",h.length," of ",t.length," inbound emails"]})})]})}const H1={clicked:{variant:"default",description:"Recipient clicked a link in the email",className:"bg-purple-500/10 text-purple-700 dark:text-purple-400 hover:bg-purple-500/20 border-purple-500/20"},opened:{variant:"default",description:"Recipient opened the email",className:"bg-blue-500/10 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-blue-500/20"},delivered:{variant:"default",description:"Email was successfully delivered to recipient's mailbox",className:"bg-green-500/10 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-green-500/20"},sent:{variant:"secondary",description:"Email was sent but delivery not yet confirmed",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 hover:bg-gray-500/20 border-gray-500/20"},bounced:{variant:"default",description:"Email bounced - recipient's mailbox may not exist or be full",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 hover:bg-orange-500/20 border-orange-500/20"},suppressed:{variant:"default",description:"Email blocked - recipient is on the suppression list",className:"bg-amber-500/10 text-amber-700 dark:text-amber-400 hover:bg-amber-500/20 border-amber-500/20"},complained:{variant:"default",description:"Recipient marked this email as spam",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},failed:{variant:"default",description:"Email failed to send due to an error",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"}};function Oge(){const e=Sa(),[t,n]=w.useState(""),[r,i]=w.useState("15"),[o,l]=w.useState("all"),[u,d]=cF(),[h,v]=w.useState(u.get("tab")==="receiving"?"receiving":"sending"),[m,g]=w.useState([]),[b,O]=w.useState(!0),[S,x]=w.useState(null);w.useEffect(()=>{async function _(){try{O(!0),x(null);let C=sessionStorage.getItem("wraps-auth-token");if(C||(C=new URLSearchParams(window.location.search).get("token"),C&&sessionStorage.setItem("wraps-auth-token",C)),!C)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const A=Number.parseInt(r,10),M=Date.now()-A*24*60*60*1e3,R=Date.now(),D=await fetch(`/api/emails?startTime=${M}&endTime=${R}&limit=100&token=${C}`);if(!D.ok){let G="Failed to fetch email logs";try{G=(await D.json()).error||G}catch{G=`${D.status}: ${D.statusText}`}throw new Error(G)}const z=await D.json();g(z.logs.map(G=>({id:G.messageId,to:G.to,from:G.from,subject:G.subject,status:G.status,timestamp:G.sentAt,messageId:G.messageId})))}catch(C){const A=C instanceof Error?C.message:"Unknown error";x(A),console.error("Error fetching email logs:",C)}finally{O(!1)}}_()},[r]);const E=m.filter(_=>{if(t){const C=t.toLowerCase(),A=_.to.some(R=>R.toLowerCase().includes(C)),M=_.subject.toLowerCase().includes(C);if(!(A||M))return!1}return!(o!=="all"&&_.status!==o)}),N=_=>{const C=new Date(_),M=Math.floor((new Date().getTime()-C.getTime())/(1e3*60*60*24));return M===0?"Today":M===1?"Yesterday":M<7?`${M} days ago`:C.toLocaleDateString()};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Emails"}),c.jsx(We,{children:"View and manage your email sending history"})]}),c.jsx($e,{children:c.jsxs(l8,{onValueChange:_=>{v(_),d(_==="sending"?{}:{tab:_})},value:h,children:[c.jsxs(c8,{children:[c.jsx(Uu,{value:"sending",children:"Sending"}),c.jsx(Uu,{value:"receiving",children:"Receiving"})]}),c.jsxs(Hu,{className:"space-y-4",value:"sending",children:[S&&c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:S}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:_=>n(_.target.value),placeholder:"Search...",value:t})]}),c.jsxs(ma,{onValueChange:i,value:r,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]}),c.jsxs(ma,{onValueChange:l,value:o,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"all",children:"All Statuses"}),c.jsx(Fe,{value:"clicked",children:"Clicked"}),c.jsx(Fe,{value:"opened",children:"Opened"}),c.jsx(Fe,{value:"delivered",children:"Delivered"}),c.jsx(Fe,{value:"sent",children:"Sent"}),c.jsx(Fe,{value:"bounced",children:"Bounced"}),c.jsx(Fe,{value:"suppressed",children:"Suppressed"}),c.jsx(Fe,{value:"complained",children:"Complained"}),c.jsx(Fe,{value:"failed",children:"Failed"})]})]}),c.jsxs(Ce,{size:"icon",variant:"outline",children:[c.jsx("span",{className:"sr-only",children:"Download"}),"↓"]})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"To"}),c.jsx(Pt,{children:"Status"}),c.jsx(Pt,{children:"Subject"}),c.jsx(Pt,{children:"Sent"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:b?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"Loading email logs..."})}):E.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"No emails found"})}):E.map(_=>{var C,A,M;return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/email/${_.id}`),children:[c.jsx(mt,{className:"font-mono text-sm",children:_.to.length>0?c.jsxs(c.Fragment,{children:[_.to[0],_.to.length>1&&c.jsxs("span",{className:"ml-1 text-muted-foreground text-xs",children:["+",_.to.length-1," more"]})]}):c.jsx("span",{className:"text-muted-foreground",children:"(no recipients)"})}),c.jsx(mt,{children:c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsx(qe,{className:(C=H1[_.status])==null?void 0:C.className,variant:((A=H1[_.status])==null?void 0:A.variant)??"default",children:_.status.charAt(0).toUpperCase()+_.status.slice(1)})}),c.jsx(rv,{children:c.jsx("p",{children:((M=H1[_.status])==null?void 0:M.description)??"Unknown status"})})]})}),c.jsx(mt,{className:"max-w-[400px] truncate",children:_.subject}),c.jsx(mt,{className:"text-muted-foreground",children:N(_.timestamp)}),c.jsx(mt,{children:c.jsxs(Ce,{onClick:R=>{R.stopPropagation()},size:"icon",variant:"ghost",children:[c.jsx("span",{className:"sr-only",children:"More options"}),"⋯"]})})]},_.id)})})]})}),E.length>0&&!b&&c.jsx("div",{className:"flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",E.length," of ",m.length," emails"]})})]}),c.jsx(Hu,{className:"space-y-4",value:"receiving",children:c.jsx(jge,{})})]})})]})}function Ege({data:e}){const t=_ge(e);return t.length===0?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Metrics"}),c.jsx(We,{children:"Performance over the last 24 hours"})]}),c.jsx($e,{children:c.jsx("div",{className:"flex h-[400px] items-center justify-center text-muted-foreground",children:"No metrics data available yet"})})]}):c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Email Metrics"}),c.jsx(We,{children:"Performance over the last 24 hours"})]}),c.jsx($e,{children:c.jsx(dE,{height:400,width:"100%",children:c.jsxs(Q6,{data:t,children:[c.jsx(Qv,{className:"stroke-muted",strokeDasharray:"3 3"}),c.jsx(ys,{className:"text-xs",dataKey:"timestamp",tickFormatter:n=>fS(new Date(n),"HH:mm")}),c.jsx(fi,{className:"text-xs"}),c.jsx(_r,{contentStyle:{backgroundColor:"hsl(var(--popover))",border:"1px solid hsl(var(--border))"},labelFormatter:n=>fS(new Date(n),"MMM d, HH:mm")}),c.jsx(ei,{}),c.jsx(Nr,{dataKey:"sends",name:"Sends",stroke:"hsl(var(--primary))",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"deliveries",name:"Deliveries",stroke:"#82ca9d",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"opens",name:"Opens",stroke:"#8884d8",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"clicks",name:"Clicks",stroke:"#ffc658",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"bounces",name:"Bounces",stroke:"#ff7300",strokeWidth:2,type:"monotone"}),c.jsx(Nr,{dataKey:"complaints",name:"Complaints",stroke:"hsl(var(--destructive))",strokeWidth:2,type:"monotone"})]})})})]})}function _ge(e){const t=new Map;[...e.sends,...e.bounces,...e.complaints,...e.deliveries,...e.opens,...e.clicks].forEach(n=>{t.has(n.timestamp)||t.set(n.timestamp,{timestamp:n.timestamp,sends:0,bounces:0,complaints:0,deliveries:0,opens:0,clicks:0})});for(const n of e.sends)t.get(n.timestamp).sends=n.value;for(const n of e.bounces)t.get(n.timestamp).bounces=n.value;for(const n of e.complaints)t.get(n.timestamp).complaints=n.value;for(const n of e.deliveries)t.get(n.timestamp).deliveries=n.value;for(const n of e.opens)t.get(n.timestamp).opens=n.value;for(const n of e.clicks)t.get(n.timestamp).clicks=n.value;return Array.from(t.values()).sort((n,r)=>n.timestamp-r.timestamp)}function Nge({quota:e}){const t=e.sentLast24Hours/e.max24HourSend*100,n=t>90?"destructive":t>70?"warning":"default";return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center justify-between",children:["SES Quota",c.jsxs(qe,{variant:n==="destructive"?"destructive":"secondary",children:[t.toFixed(1),"% used"]})]}),c.jsx(We,{children:"24-hour sending limits"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"mb-2 flex justify-between text-sm",children:[c.jsx("span",{className:"text-muted-foreground",children:"Emails sent"}),c.jsxs("span",{className:"font-medium",children:[e.sentLast24Hours.toLocaleString()," /"," ",e.max24HourSend.toLocaleString()]})]}),c.jsx(pv,{className:"h-2",value:t})]}),c.jsxs("div",{className:"flex items-center justify-between border-t pt-2",children:[c.jsx("span",{className:"text-muted-foreground text-sm",children:"Max send rate"}),c.jsxs("span",{className:"font-medium text-sm",children:[e.maxSendRate," emails/sec"]})]})]})]})}function Age(){const[e,t]=w.useState("1"),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);if(w.useEffect(()=>{async function N(){try{o(!0),u(null);let _=sessionStorage.getItem("wraps-auth-token");if(_||(_=new URLSearchParams(window.location.search).get("token"),_&&sessionStorage.setItem("wraps-auth-token",_)),!_)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const C=Number.parseInt(e,10),A=Date.now()-C*24*60*60*1e3,M=Date.now(),R=await fetch(`/api/metrics?startTime=${A}&endTime=${M}&token=${_}`);if(!R.ok){let z="Failed to fetch email metrics";try{z=(await R.json()).error||z}catch{z=`${R.status}: ${R.statusText}`}throw new Error(z)}const D=await R.json();r(D)}catch(_){const C=_ instanceof Error?_.message:"Unknown error";u(C),console.error("Error fetching email metrics:",_)}finally{o(!1)}}N()},[e]),l)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsx("div",{className:"mt-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]});if(i||!n)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsx("div",{className:"mt-4 flex h-[400px] items-center justify-center text-muted-foreground",children:"Loading metrics..."})]});const d=n.metrics.sends.reduce((N,_)=>N+_.value,0)||0,h=n.metrics.deliveries.reduce((N,_)=>N+_.value,0)||0,v=n.metrics.bounces.reduce((N,_)=>N+_.value,0)||0,m=n.metrics.complaints.reduce((N,_)=>N+_.value,0)||0,g=n.metrics.opens.reduce((N,_)=>N+_.value,0)||0,b=n.metrics.clicks.reduce((N,_)=>N+_.value,0)||0,O=d>0?h/d*100:0,S=h>0?g/h*100:0,x=g>0?b/g*100:0,E=[{title:"Emails Sent",value:d.toLocaleString(),description:`${e==="1"?"Last 24 hours":`Last ${e} days`}`,icon:xl},{title:"Delivery Rate",value:`${O.toFixed(1)}%`,description:`${h.toLocaleString()} delivered`,icon:Zj},{title:"Open Rate",value:`${S.toFixed(1)}%`,description:`${g.toLocaleString()} opened`,icon:Dp},{title:"Click Rate",value:`${x.toFixed(1)}%`,description:`${b.toLocaleString()} clicked`,icon:zF}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your email campaigns"})]}),c.jsxs(ma,{onValueChange:t,value:e,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:E.map(N=>c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx(Le,{className:"font-medium text-sm",children:N.title}),c.jsx(N.icon,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:N.value}),c.jsx("p",{className:"text-muted-foreground text-xs",children:N.description})]})]},N.title))}),c.jsx(Nge,{quota:n.quota}),c.jsx(Ege,{data:n.metrics}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Metrics Summary"}),c.jsx(We,{children:"Detailed breakdown of your email performance"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Total Emails Sent"}),c.jsx(qe,{variant:"outline",children:d.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Successfully Delivered"}),c.jsx(qe,{variant:"default",children:h.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Opened"}),c.jsx(qe,{variant:"default",children:g.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Clicked"}),c.jsx(qe,{variant:"default",children:b.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Bounced"}),c.jsx(qe,{variant:"destructive",children:v.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Complaints"}),c.jsx(qe,{variant:"destructive",children:m.toLocaleString()})]})]})]})]})}async function Cge(){const e=sessionStorage.getItem("wraps-auth-token");if(!e)throw new Error("Authentication token not found");const t=await fetch(`/api/settings?token=${e}`);if(!t.ok)throw new Error(`Failed to fetch settings: ${t.statusText}`);return await t.json()}const u8="wraps-dns-verification",Tge=1e3*60*60;function f8(){try{const e=localStorage.getItem(u8);return e?JSON.parse(e):{}}catch{return{}}}function Cp(e){try{localStorage.setItem(u8,JSON.stringify(e))}catch(t){console.error("Failed to save DNS verification cache:",t)}}function d8(e){return e?Date.now()-e.lastChecked<Tge:!1}async function U4(e,t){var i;console.log("[DNS Verify] verifyTrackingDomain called",{domain:e,expectedTarget:t});const n=f8(),r=`${e}->${t}`;if((i=n.trackingDomain)!=null&&i[r]&&d8(n.trackingDomain[r]))return console.log("[DNS Verify] Returning cached result"),n.trackingDomain[r];try{const l=`/api/settings/verify-tracking-domain?token=${sessionStorage.getItem("wraps-auth-token")}&domain=${encodeURIComponent(e)}&expectedTarget=${encodeURIComponent(t)}`;console.log("[DNS Verify] Fetching:",l);const u=await fetch(l);if(console.log("[DNS Verify] Response status:",u.status),!u.ok)throw new Error(`HTTP ${u.status}: ${u.statusText}`);const d=await u.json();console.log("[DNS Verify] Response data:",d);const h={verified:d.verified,lastChecked:Date.now(),error:d.error};return n.trackingDomain||(n.trackingDomain={}),n.trackingDomain[r]=h,Cp(n),h}catch(o){console.error("Tracking domain verification request failed:",o);const l={verified:!1,lastChecked:Date.now(),error:o instanceof Error?o.message:"Failed to verify"};return n.trackingDomain||(n.trackingDomain={}),n.trackingDomain[r]=l,Cp(n),l}}async function H4(e){var r;console.log("[DNS Verify] verifyDmarc called",{domain:e});const t=f8(),n=`_dmarc.${e}`;if((r=t.dmarc)!=null&&r[n]&&d8(t.dmarc[n]))return console.log("[DNS Verify] Returning cached DMARC result"),t.dmarc[n];try{const o=`/api/settings/verify-dmarc?token=${sessionStorage.getItem("wraps-auth-token")}&domain=${encodeURIComponent(e)}`;console.log("[DNS Verify] Fetching:",o);const l=await fetch(o);if(console.log("[DNS Verify] Response status:",l.status),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);const u=await l.json();console.log("[DNS Verify] Response data:",u);const d={verified:u.verified,lastChecked:Date.now(),error:u.error};return t.dmarc||(t.dmarc={}),t.dmarc[n]=d,Cp(t),d}catch(i){console.error("DMARC verification request failed:",i);const o={verified:!1,lastChecked:Date.now(),error:i instanceof Error?i.message:"Failed to verify"};return t.dmarc||(t.dmarc={}),t.dmarc[n]=o,Cp(t),o}}function XE({status:e}){const t={SUCCESS:{icon:ao,label:"Verified",variant:"default",className:"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20"},PENDING:{icon:Qo,label:"Pending",variant:"secondary",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 border-yellow-500/20"},FAILED:{icon:h$,label:"Failed",variant:"destructive",className:"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20"},TEMPORARY_FAILURE:{icon:lr,label:"Temporary Failure",variant:"secondary",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 border-orange-500/20"},NOT_STARTED:{icon:Qo,label:"Not Started",variant:"outline",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 border-gray-500/20"}},{icon:n,label:r,className:i}=t[e];return c.jsxs(qe,{className:i,variant:"outline",children:[c.jsx(n,{className:"mr-1 h-3 w-3"}),r]})}function tc({text:e}){const t=async()=>{await navigator.clipboard.writeText(e),Ot.success("Copied to clipboard",{description:"DNS record value copied successfully"})};return c.jsx(Ce,{onClick:t,size:"sm",variant:"ghost",children:c.jsx(Kj,{className:"h-3 w-3"})})}function Mge({identity:e}){const t=e==null?void 0:e.dkimAttributes,n=(t==null?void 0:t.status)==="SUCCESS",[r,i]=w.useState(!n);return t?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DKIM Authentication"}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:[t.signingEnabled?"Enabled":"Disabled",t.signingKeyLength&&` · ${t.signingKeyLength}`]})]}),c.jsx(XE,{status:t.status})]}),t.tokens&&t.tokens.length>0&&c.jsxs(fs,{onOpenChange:i,open:r,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Records (CNAME)"}),r?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2 space-y-2",children:t.tokens.map(o=>c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:[o,"._domainkey.",e.identityName]}),c.jsx(tc,{text:`${o}._domainkey.${e.identityName}`})]}),c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["CNAME → ",o,".dkim.amazonses.com"]})]},o))})]})]}):c.jsx("div",{className:"space-y-4",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DKIM Authentication"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Not configured"})]})})})}function Rge({identity:e}){const t=e==null?void 0:e.mailFromAttributes,n=(t==null?void 0:t.mailFromDomainStatus)==="SUCCESS",[r,i]=w.useState(!n);return c.jsx("div",{className:"space-y-4",children:t!=null&&t.mailFromDomain?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Mail-From Domain"}),c.jsxs("p",{className:"text-muted-foreground text-sm",children:[t.mailFromDomain,t.behaviorOnMxFailure&&` · ${t.behaviorOnMxFailure==="USE_DEFAULT_VALUE"?"Fallback enabled":"Reject on failure"}`]})]}),t.mailFromDomainStatus&&c.jsx(XE,{status:t.mailFromDomainStatus})]}),c.jsxs(fs,{onOpenChange:i,open:r,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Record (MX)"}),r?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsx("div",{className:"rounded-md border bg-muted/50 p-3",children:c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:["MX ",t.mailFromDomain]}),c.jsx(tc,{text:`10 feedback-smtp.${e==null?void 0:e.identityName.split(".")[0]}.amazonses.com`})]}),c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["Priority 10 → feedback-smtp.",e==null?void 0:e.identityName.split(".")[0],".amazonses.com"]})]})})})]})]}):c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"Mail-From Domain"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Using default amazonses.com domain"})]})})})}function Dge({identity:e}){const[t,n]=w.useState(null),[r,i]=w.useState(!1),[o,l]=w.useState(!(t!=null&&t.verified));w.useEffect(()=>{e!=null&&e.identityName&&H4(e.identityName).then(n)},[e==null?void 0:e.identityName]),w.useEffect(()=>{t&&l(!t.verified)},[t]);const u=async()=>{if(e!=null&&e.identityName){i(!0);try{const d=await H4(e.identityName);n(d),d.verified?Ot.success("DMARC record verified",{description:"DNS TXT record found and configured correctly"}):(console.error("DMARC verification failed:",d.error),Ot.error("Verification failed",{description:d.error||"DMARC record not found"}))}catch(d){console.error("DMARC verification error:",d),Ot.error("Verification error",{description:d instanceof Error?d.message:"Unknown error"})}finally{i(!1)}}};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:"DMARC Policy"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:t!=null&&t.verified?"Configured":"Recommended for better deliverability"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(t==null?void 0:t.verified)&&c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Verified by Wraps"]}),c.jsx(Ce,{className:"h-8 w-8 p-0",disabled:r,onClick:u,size:"sm",variant:"ghost",children:c.jsx(Bf,{className:`h-4 w-4 ${r?"animate-spin":""}`})})]})]}),c.jsxs(fs,{onOpenChange:l,open:o,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"DNS Record (TXT)"}),o?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[c.jsxs("p",{className:"font-mono text-xs",children:["_dmarc.",(e==null?void 0:e.identityName)||"yourdomain.com"]}),c.jsx(tc,{text:`_dmarc.${(e==null?void 0:e.identityName)||"yourdomain.com"}`})]}),c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["v=DMARC1; p=quarantine; rua=mailto:dmarc@",(e==null?void 0:e.identityName)||"yourdomain.com"]}),c.jsx(tc,{text:`v=DMARC1; p=quarantine; rua=mailto:dmarc@${(e==null?void 0:e.identityName)||"yourdomain.com"}`})]})]})})]})]})}function Pge({configSet:e,region:t,onRefresh:n}){const r=e==null?void 0:e.trackingOptions,[i,o]=w.useState(null),[l,u]=w.useState(!1),[d,h]=w.useState(!1),[v,m]=w.useState(""),[g,b]=w.useState(!1),[O,S]=w.useState(!(i!=null&&i.verified));w.useEffect(()=>{if(r!=null&&r.customRedirectDomain&&t){const _=`r.${t}.awstrack.me`;U4(r.customRedirectDomain,_).then(o)}},[r==null?void 0:r.customRedirectDomain,t]),w.useEffect(()=>{i&&S(!i.verified)},[i]);const x=async()=>{if(r!=null&&r.customRedirectDomain&&t){u(!0);try{const _=`r.${t}.awstrack.me`,C=await U4(r.customRedirectDomain,_);o(C),C.verified?Ot.success("Tracking domain verified",{description:"DNS records are configured correctly"}):(console.error("Tracking domain verification failed:",C.error),Ot.error("Verification failed",{description:C.error||"DNS records not found"}))}catch(_){console.error("Tracking domain verification error:",_),Ot.error("Verification error",{description:_ instanceof Error?_.message:"Unknown error"})}finally{u(!1)}}},E=()=>{m((r==null?void 0:r.customRedirectDomain)||""),h(!0)},N=async()=>{if(!v.trim()){Ot.error("Invalid domain",{description:"Please enter a valid domain name"});return}b(!0);try{const _=sessionStorage.getItem("wraps-auth-token"),C=await fetch(`/api/settings/config-set/tracking-domain?token=${_}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:v})});if(!C.ok){const A=await C.json();throw new Error(A.error||`Failed to update: ${C.statusText}`)}h(!1),Ot.success("Tracking domain updated",{description:"Don't forget to configure the DNS records"}),n&&await n()}catch(_){console.error("Failed to update tracking domain:",_),Ot.error("Failed to update tracking domain",{description:_ instanceof Error?_.message:"Unknown error"})}finally{b(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Tracking Domain"}),c.jsx(We,{children:"Custom domain for open and click tracking links"})]}),c.jsx($e,{className:"space-y-4",children:r!=null&&r.customRedirectDomain?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"font-medium",children:r.customRedirectDomain}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Custom Tracking Domain"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[(i==null?void 0:i.verified)&&c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Verified by Wraps"]}),c.jsx(qe,{variant:"outline",children:r.httpsPolicy==="REQUIRE"?"HTTPS Only":"HTTPS Optional"}),c.jsx(Ce,{className:"h-8 w-8 p-0",disabled:l,onClick:x,size:"sm",variant:"ghost",children:c.jsx(Bf,{className:`h-4 w-4 ${l?"animate-spin":""}`})}),c.jsx(Ce,{className:"h-8 w-8 p-0",onClick:E,size:"sm",variant:"ghost",children:c.jsx(aC,{className:"h-4 w-4"})})]})]}),c.jsxs(fs,{onOpenChange:S,open:O,children:[c.jsx(ds,{asChild:!0,children:c.jsxs(Ce,{className:"h-auto w-full justify-between p-0",size:"sm",variant:"ghost",children:[c.jsx("p",{className:"font-medium text-sm",children:"Required DNS Record (CNAME)"}),O?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})}),c.jsx(hs,{className:"mt-2",children:c.jsxs("div",{className:"rounded-md border bg-muted/50 p-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("p",{className:"font-mono text-xs",children:r.customRedirectDomain}),c.jsx(tc,{text:r.customRedirectDomain})]}),c.jsxs("div",{className:"mt-1 flex items-start justify-between gap-2",children:[c.jsxs("p",{className:"font-mono text-muted-foreground text-xs",children:["CNAME → r.",(e==null?void 0:e.name)||"region",".awstrack.me"]}),c.jsx(tc,{text:`r.${(e==null?void 0:e.name)||"region"}.awstrack.me`})]})]})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("p",{className:"text-muted-foreground text-sm",children:"No custom tracking domain configured. Using default awstrack.me domain."}),c.jsxs(Ce,{onClick:E,size:"sm",variant:"outline",children:[c.jsx(aC,{className:"mr-2 h-4 w-4"}),"Configure Tracking Domain"]})]})}),c.jsx(RO,{onOpenChange:h,open:d,children:c.jsxs(DO,{children:[c.jsxs(t3,{children:[c.jsx(r3,{children:"Update Tracking Domain"}),c.jsx(sQ,{children:"Enter the custom domain you want to use for email tracking links. You'll need to configure DNS records after saving."})]}),c.jsx("div",{className:"space-y-4 py-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx(qo,{htmlFor:"domain",children:"Tracking Domain"}),c.jsx(oo,{disabled:g,id:"domain",onChange:_=>m(_.target.value),placeholder:"track.example.com",value:v}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Example: track.yourdomain.com or email.yourdomain.com"})]})}),c.jsxs(n3,{children:[c.jsx(Ce,{disabled:g,onClick:()=>h(!1),variant:"outline",children:"Cancel"}),c.jsx(Ce,{disabled:g,onClick:N,children:g?"Updating...":"Update Domain"})]})]})})]})}function kge({configSet:e,onRefresh:t}){var v,m;const[n,r]=w.useState(!1),[i,o]=w.useState(!1),[l,u]=w.useState(!1);if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsx(Le,{children:"Configuration Set"}),c.jsx(We,{children:"No configuration set found"})]})});const d=async()=>{var g;u(!0);try{const b=sessionStorage.getItem("wraps-auth-token"),O=!((g=e.sendingOptions)!=null&&g.sendingEnabled),S=await fetch(`/api/settings/config-set/sending?token=${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:O})});if(!S.ok)throw new Error(`Failed to update: ${S.statusText}`);r(!1),Ot.success(O?"Email sending enabled":"Email sending disabled"),t&&await t()}catch(b){console.error("Failed to toggle sending:",b),Ot.error("Failed to update setting",{description:b instanceof Error?b.message:"Unknown error"})}finally{u(!1)}},h=async()=>{var g;u(!0);try{const b=sessionStorage.getItem("wraps-auth-token"),O=!((g=e.reputationOptions)!=null&&g.reputationMetricsEnabled),S=await fetch(`/api/settings/config-set/reputation?token=${b}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:O})});if(!S.ok)throw new Error(`Failed to update: ${S.statusText}`);o(!1),Ot.success(O?"Reputation metrics enabled":"Reputation metrics disabled"),t&&await t()}catch(b){console.error("Failed to toggle reputation:",b),Ot.error("Failed to update setting",{description:b instanceof Error?b.message:"Unknown error"})}finally{u(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Configuration Set"}),c.jsx(We,{children:"Email sending and tracking configuration"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:e.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Configuration Set Name"})]}),c.jsx(qt,{}),e.sendingOptions&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Email Sending"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.sendingOptions.sendingEnabled?"Emails can be sent":"Email sending is disabled"})]}),c.jsx(Ce,{onClick:()=>r(!0),size:"sm",variant:e.sendingOptions.sendingEnabled?"destructive":"default",children:e.sendingOptions.sendingEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:r,open:n,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.sendingOptions.sendingEnabled?"Disable email sending?":"Enable email sending?"}),c.jsx(Nm,{children:e.sendingOptions.sendingEnabled?"All outgoing emails will be blocked until you re-enable sending. Emails in the queue will not be sent.":"This will allow emails to be sent through this configuration set. Make sure your domain is verified before enabling."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:l,children:"Cancel"}),c.jsx(Am,{disabled:l,onClick:d,children:l?"Updating...":e.sendingOptions.sendingEnabled?"Disable sending":"Enable sending"})]})]})})]}),e.reputationOptions&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Reputation Metrics"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.reputationOptions.reputationMetricsEnabled?"Tracking bounce and complaint rates":"Reputation tracking disabled"})]}),c.jsx(Ce,{onClick:()=>o(!0),size:"sm",variant:"outline",children:e.reputationOptions.reputationMetricsEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:o,open:i,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.reputationOptions.reputationMetricsEnabled?"Disable reputation metrics?":"Enable reputation metrics?"}),c.jsx(Nm,{children:e.reputationOptions.reputationMetricsEnabled?"You will stop collecting bounce and complaint rate data. Historical data will be preserved but no new metrics will be tracked.":"This will start tracking bounce and complaint rates for your sending domain. This helps monitor your email reputation and deliverability."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:l,children:"Cancel"}),c.jsx(Am,{disabled:l,onClick:h,children:l?"Updating...":e.reputationOptions.reputationMetricsEnabled?"Disable metrics":"Enable metrics"})]})]})})]}),((v=e.deliveryOptions)==null?void 0:v.tlsPolicy)&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"TLS Encryption"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.deliveryOptions.tlsPolicy==="REQUIRE"?"Required for all connections":"Optional (opportunistic)"})]}),c.jsx(qe,{variant:"outline",children:e.deliveryOptions.tlsPolicy==="REQUIRE"?"Required":"Optional"})]}),e.suppressionOptions&&c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"Suppression List"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Automatically suppress emails to addresses that bounced or complained"})]}),e.suppressionOptions.suppressedReasons&&e.suppressionOptions.suppressedReasons.length>0?c.jsx("div",{className:"flex gap-2",children:e.suppressionOptions.suppressedReasons.map(g=>c.jsx(qe,{variant:"secondary",children:g},g))}):c.jsx("p",{className:"text-muted-foreground text-sm",children:"Not configured"})]}),((m=e.deliveryOptions)==null?void 0:m.sendingPoolName)&&c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"IP Pool"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.deliveryOptions.sendingPoolName})]})]})]})}function $ge(){var u,d;const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0);const h=await Cge();t(h),o(null)}catch(h){console.error("Failed to fetch email settings:",h),o(h instanceof Error?h.message:"Failed to load settings")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{className:"md:row-span-2",children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-32"}),c.jsx(Re,{className:"h-4 w-24"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-40"}),c.jsx(Re,{className:"h-4 w-28"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-36"}),c.jsx(Re,{className:"h-4 w-32"})]}),c.jsx(Re,{className:"h-px w-full"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(Re,{className:"h-4 w-32"}),c.jsx(Re,{className:"h-4 w-44"})]})]})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]})]})]}):i?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs(Un,{className:"mt-6",variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error Loading Settings"}),c.jsx(Hn,{children:i})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"Email Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your email settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{className:"md:row-span-2",children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Sending Domain"}),c.jsx(We,{children:"Email domain configuration and authentication"})]}),c.jsxs($e,{className:"space-y-6",children:[c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1",children:[c.jsx("p",{className:"font-medium",children:(u=e==null?void 0:e.identity)==null?void 0:u.identityName}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Domain Identity"})]}),c.jsx(XE,{status:((d=e==null?void 0:e.identity)==null?void 0:d.verificationStatus)||"NOT_STARTED"})]})}),c.jsx(qt,{}),c.jsx(Mge,{identity:e==null?void 0:e.identity}),c.jsx(qt,{}),c.jsx(Rge,{identity:e==null?void 0:e.identity}),c.jsx(qt,{}),c.jsx(Dge,{identity:e==null?void 0:e.identity})]})]}),c.jsx(kge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l}),c.jsx(Pge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l,region:e==null?void 0:e.region})]})]})}function F1(e){return e.name?`${e.name} <${e.address}>`:e.address}function Ige(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Gh({label:e,verdict:t}){if(!t)return null;const n=t==="PASS";return c.jsxs(qe,{className:n?"bg-green-500/10 text-green-700 dark:text-green-400 border-green-500/20":"bg-red-500/10 text-red-700 dark:text-red-400 border-red-500/20",variant:"outline",children:[n?c.jsx(y$,{className:"mr-1 h-3 w-3"}):c.jsx(g$,{className:"mr-1 h-3 w-3"}),e,": ",t]})}function Lge(){const{emailId:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null),[d,h]=w.useState(!1);return w.useEffect(()=>{async function v(){try{o(!0),u(null);const m=sessionStorage.getItem("wraps-auth-token");if(!m)throw new Error("Authentication token not found");const g=await fetch(`/api/inbound/${encodeURIComponent(e||"")}?token=${m}`);if(!g.ok){let O="Failed to fetch inbound email";try{O=(await g.json()).error||O}catch{O=`${g.status}: ${g.statusText}`}throw new Error(O)}const b=await g.json();r(b)}catch(m){const g=m instanceof Error?m.message:"Unknown error";u(g),console.error("Error fetching inbound email:",m)}finally{o(!1)}}e&&v()},[e]),i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading inbound email..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back"]})}),c.jsx(Te,{children:c.jsxs(Me,{className:"space-y-1.5",children:[c.jsx(Le,{className:"flex flex-row items-center gap-2 text-xl",children:c.jsx("span",{children:n.subject||"(no subject)"})}),c.jsxs("div",{className:"flex flex-wrap gap-2",children:[c.jsx(Gh,{label:"Spam",verdict:n.spamVerdict}),c.jsx(Gh,{label:"Virus",verdict:n.virusVerdict}),n.headers["x-ses-dkim-verdict"]&&c.jsx(Gh,{label:"DKIM",verdict:n.headers["x-ses-dkim-verdict"]}),n.headers["x-ses-spf-verdict"]&&c.jsx(Gh,{label:"SPF",verdict:n.headers["x-ses-spf-verdict"]})]}),c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("code",{className:"min-w-0 truncate rounded bg-muted px-2 py-0.5 font-mono text-muted-foreground text-xs",children:n.messageId}),c.jsx(fa,{className:"h-6 w-6 shrink-0",size:"sm",value:n.messageId,variant:"ghost"})]}),c.jsxs("div",{className:"flex flex-col gap-3 pt-2 sm:flex-row sm:flex-wrap",children:[c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"From"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:F1(n.from)}),c.jsx(la,{align:"inline-end",children:c.jsx(fa,{className:"h-6 w-6",size:"sm",value:n.from.address,variant:"ghost"})})]}),c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"To"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:n.to.length>0?n.to.map(F1).join(", "):"(no recipients)"})]}),n.cc.length>0&&c.jsxs(Nl,{className:"w-full cursor-text! sm:w-auto sm:min-w-[518px]",children:[c.jsx(la,{align:"inline-start",children:c.jsx(Al,{children:"CC"})}),c.jsx(Cl,{className:"min-w-0 cursor-text! truncate font-mono text-sm",disabled:!0,readOnly:!0,value:n.cc.map(F1).join(", ")})]})]}),c.jsxs("div",{className:"text-muted-foreground text-sm",children:["Received: ",new Date(n.receivedAt).toLocaleString()]})]})}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Body"}),n.htmlTruncated&&c.jsx(We,{className:"text-amber-600",children:"HTML content was truncated due to size limits"})]}),c.jsx($e,{children:n.html?c.jsx("iframe",{className:"h-[500px] w-full rounded-md border bg-white",sandbox:"allow-same-origin",srcDoc:n.html,title:"Email content"}):n.text?c.jsx("pre",{className:"max-h-[500px] overflow-auto whitespace-pre-wrap rounded-md border bg-muted/50 p-4 font-mono text-sm",children:n.text}):c.jsx("div",{className:"text-muted-foreground text-sm",children:"No message body"})})]}),n.attachments.length>0&&c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(v$,{className:"h-4 w-4"}),"Attachments (",n.attachments.length,")"]})}),c.jsx($e,{children:c.jsx("div",{className:"space-y-2",children:n.attachments.map(v=>c.jsx("div",{className:"flex items-center justify-between rounded-md border p-3",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(m$,{className:"h-5 w-5 text-muted-foreground"}),c.jsxs("div",{children:[c.jsx("div",{className:"font-medium text-sm",children:v.filename}),c.jsxs("div",{className:"text-muted-foreground text-xs",children:[v.contentType," · ",Ige(v.size),v.contentDisposition==="inline"&&c.jsx(qe,{className:"ml-2 bg-blue-500/10 text-blue-700 dark:text-blue-400 border-blue-500/20",variant:"outline",children:"inline"})]})]})]})},v.id))})})]}),c.jsx(fs,{onOpenChange:h,open:d,children:c.jsxs(Te,{children:[c.jsx(ds,{asChild:!0,children:c.jsx(Me,{className:"cursor-pointer",children:c.jsxs(Le,{className:"flex items-center justify-between",children:[c.jsx("span",{children:"Raw Headers"}),d?c.jsx(ic,{className:"h-4 w-4"}):c.jsx(ro,{className:"h-4 w-4"})]})})}),c.jsx(hs,{children:c.jsx($e,{children:c.jsx("pre",{className:"max-h-[400px] overflow-auto whitespace-pre-wrap rounded-md border bg-muted/50 p-4 font-mono text-xs",children:Object.entries(n.headers).map(([v,m])=>`${v}: ${m}`).join(`
|
|
497
|
+
`)})})})]})})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/email?tab=receiving"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to emails"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"Inbound email not found"})]})}const zge={sent:Zi,delivered:ri,failed:or,queued:Qo,blocked:or,carrier_unreachable:tm,invalid:or,opted_out:or,ttl_expired:Qo},Bge={sent:"text-blue-500",delivered:"text-green-500",failed:"text-red-500",queued:"text-gray-500",blocked:"text-orange-500",carrier_unreachable:"text-red-500",invalid:"text-red-500",opted_out:"text-yellow-500",ttl_expired:"text-gray-500"},qge={delivered:"default",sent:"secondary",queued:"secondary",failed:"destructive",blocked:"destructive",invalid:"destructive",opted_out:"default"};function Uge(){const{id:e}=Fj(),t=Sa(),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);w.useEffect(()=>{async function m(){try{o(!0),u(null);const g=sessionStorage.getItem("wraps-auth-token");if(!g)throw new Error("Authentication token not found");const b=encodeURIComponent(e||""),O=await fetch(`/api/sms/${b}?token=${g}`);if(!O.ok){let E="Failed to fetch SMS details";try{E=(await O.json()).error||E}catch{E=`${O.status}: ${O.statusText}`}throw new Error(E)}const S=O.headers.get("content-type");if(!(S!=null&&S.includes("application/json"))){const E=await O.text();throw console.error("Non-JSON response:",E),new Error("Server returned non-JSON response")}const x=await O.json();r(x)}catch(g){const b=g instanceof Error?g.message:"Unknown error";u(b),console.error("Error fetching SMS details:",g)}finally{o(!1)}}e&&m()},[e]);const d=m=>new Date(m).toLocaleString("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),h=m=>new Date(m).toLocaleString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}),v=m=>m.startsWith("+1")&&m.length===12?`(${m.slice(2,5)}) ${m.slice(5,8)}-${m.slice(8)}`:m;return i?c.jsx("div",{className:"flex h-[600px] items-center justify-center",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading SMS details..."})}):l?c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx("div",{className:"rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]}):n?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx(qe,{variant:qge[n.status],children:n.status.charAt(0).toUpperCase()+n.status.slice(1).replace("_"," ")})]}),c.jsxs(Te,{children:[c.jsx(Me,{children:c.jsx("div",{className:"flex items-start justify-between",children:c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs(Le,{className:"flex items-center gap-2 text-2xl",children:[c.jsx(Zi,{className:"h-6 w-6"}),"SMS Message"]}),c.jsx(We,{className:"font-mono text-xs",children:n.messageId})]})})}),c.jsx($e,{className:"space-y-4",children:c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"FROM"}),c.jsx("div",{className:"font-mono text-sm",children:v(n.from)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"TO"}),c.jsx("div",{className:"font-mono text-sm",children:v(n.to)})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"SEGMENTS"}),c.jsx("div",{className:"font-mono text-sm",children:n.segments})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"text-muted-foreground text-sm",children:"ID"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("code",{className:"rounded bg-muted px-2 py-1 font-mono text-xs",children:n.id}),c.jsx(Ce,{className:"h-6 w-6",onClick:()=>navigator.clipboard.writeText(n.id),size:"icon",variant:"ghost",children:c.jsx("span",{className:"sr-only",children:"Copy ID"})})]})]})]})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Content"}),c.jsx(We,{children:"The SMS message body"})]}),c.jsx($e,{children:c.jsx("div",{className:"rounded-md border bg-muted/50 p-4",children:c.jsx("p",{className:"whitespace-pre-wrap text-sm",children:n.body})})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Message Events"}),c.jsx(We,{children:"Lifecycle of this message from send to delivery"})]}),c.jsx($e,{children:c.jsx("div",{className:"space-y-4",children:n.events.length===0?c.jsx("div",{className:"text-muted-foreground text-sm",children:"No events recorded yet"}):n.events.map((m,g)=>{const b=zge[m.type]||Qo,O=g===n.events.length-1;return c.jsx("div",{children:c.jsxs("div",{className:"flex gap-4",children:[c.jsxs("div",{className:"flex flex-col items-center",children:[c.jsx("div",{className:`rounded-full border-2 border-background bg-muted p-2 ${Bge[m.type]}`,children:c.jsx(b,{className:"h-4 w-4"})}),!O&&c.jsx("div",{className:"my-1 w-px flex-1 bg-border"})]}),c.jsxs("div",{className:"flex-1 pb-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"font-medium capitalize",children:m.type.replace("_"," ")}),c.jsx("div",{className:"text-muted-foreground text-sm",children:d(m.timestamp)})]}),c.jsx("div",{className:"text-muted-foreground text-sm",children:h(m.timestamp)}),m.metadata&&Object.keys(m.metadata).length>0&&c.jsx("div",{className:"mt-2 rounded-md border bg-muted/50 p-2 font-mono text-xs",children:c.jsx("pre",{className:"overflow-x-auto",children:JSON.stringify(m.metadata,null,2)})})]})]})},`${m.type}-${m.timestamp}`)})})})]})]}):c.jsxs("div",{className:"space-y-4",children:[c.jsxs(Ce,{onClick:()=>t("/sms"),size:"sm",variant:"ghost",children:[c.jsx(Qa,{className:"mr-2 h-4 w-4"}),"Back to messages"]}),c.jsx("div",{className:"rounded-md border p-4 text-muted-foreground text-sm",children:"SMS message not found"})]})}const G1={delivered:{variant:"default",description:"Message was delivered to recipient's device",className:"bg-green-500/10 text-green-700 dark:text-green-400 hover:bg-green-500/20 border-green-500/20"},sent:{variant:"secondary",description:"Message was sent but delivery not yet confirmed",className:"bg-blue-500/10 text-blue-700 dark:text-blue-400 hover:bg-blue-500/20 border-blue-500/20"},queued:{variant:"secondary",description:"Message is queued for delivery",className:"bg-gray-500/10 text-gray-700 dark:text-gray-400 hover:bg-gray-500/20 border-gray-500/20"},failed:{variant:"destructive",description:"Message failed to deliver",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},blocked:{variant:"destructive",description:"Message was blocked by carrier or filter",className:"bg-orange-500/10 text-orange-700 dark:text-orange-400 hover:bg-orange-500/20 border-orange-500/20"},invalid:{variant:"destructive",description:"Invalid phone number or message format",className:"bg-red-500/10 text-red-700 dark:text-red-400 hover:bg-red-500/20 border-red-500/20"},opted_out:{variant:"default",description:"Recipient has opted out of receiving messages",className:"bg-yellow-500/10 text-yellow-700 dark:text-yellow-400 hover:bg-yellow-500/20 border-yellow-500/20"}};function Hge(){const e=Sa(),[t,n]=w.useState(""),[r,i]=w.useState("15"),[o,l]=w.useState("all"),[u,d]=w.useState([]),[h,v]=w.useState(!0),[m,g]=w.useState(null);w.useEffect(()=>{async function x(){try{v(!0),g(null);let E=sessionStorage.getItem("wraps-auth-token");if(E||(E=new URLSearchParams(window.location.search).get("token"),E&&sessionStorage.setItem("wraps-auth-token",E)),!E)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const N=Number.parseInt(r,10),_=Date.now()-N*24*60*60*1e3,C=Date.now(),A=await fetch(`/api/sms?startTime=${_}&endTime=${C}&limit=100&token=${E}`);if(!A.ok){let R="Failed to fetch SMS logs";try{R=(await A.json()).error||R}catch{R=`${A.status}: ${A.statusText}`}throw new Error(R)}const M=await A.json();d(M.logs.map(R=>({id:R.messageId,to:R.to,from:R.from,body:R.body,status:R.status,timestamp:R.sentAt,messageId:R.messageId,segments:R.segments})))}catch(E){const N=E instanceof Error?E.message:"Unknown error";g(N),console.error("Error fetching SMS logs:",E)}finally{v(!1)}}x()},[r]);const b=u.filter(x=>{if(t){const E=t.toLowerCase(),N=x.to.toLowerCase().includes(E),_=x.body.toLowerCase().includes(E);if(!(N||_))return!1}return!(o!=="all"&&x.status!==o)}),O=x=>{const E=new Date(x),_=Math.floor((new Date().getTime()-E.getTime())/(1e3*60*60*24));return _===0?"Today":_===1?"Yesterday":_<7?`${_} days ago`:E.toLocaleDateString()},S=x=>x.startsWith("+1")&&x.length===12?`(${x.slice(2,5)}) ${x.slice(5,8)}-${x.slice(8)}`:x;return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"SMS Messages"]}),c.jsx(We,{children:"View and manage your SMS sending history"})]}),c.jsxs($e,{children:[m&&c.jsx("div",{className:"mb-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:m}),c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Pp,{className:"absolute top-2.5 left-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(oo,{className:"pl-8",onChange:x=>n(x.target.value),placeholder:"Search by phone or message...",value:t})]}),c.jsxs(ma,{onValueChange:i,value:r,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]}),c.jsxs(ma,{onValueChange:l,value:o,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"all",children:"All Statuses"}),c.jsx(Fe,{value:"delivered",children:"Delivered"}),c.jsx(Fe,{value:"sent",children:"Sent"}),c.jsx(Fe,{value:"queued",children:"Queued"}),c.jsx(Fe,{value:"failed",children:"Failed"}),c.jsx(Fe,{value:"blocked",children:"Blocked"}),c.jsx(Fe,{value:"opted_out",children:"Opted Out"})]})]}),c.jsx(Ce,{size:"icon",variant:"outline",children:c.jsx("span",{className:"sr-only",children:"Download"})})]}),c.jsx("div",{className:"rounded-md border",children:c.jsxs(fv,{children:[c.jsx(dv,{children:c.jsxs(Fn,{children:[c.jsx(Pt,{children:"To"}),c.jsx(Pt,{children:"Status"}),c.jsx(Pt,{children:"Message"}),c.jsx(Pt,{children:"Sent"}),c.jsx(Pt,{className:"w-[50px]"})]})}),c.jsx(hv,{children:h?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"Loading SMS logs..."})}):b.length===0?c.jsx(Fn,{children:c.jsx(mt,{className:"h-24 text-center text-muted-foreground",colSpan:5,children:"No SMS messages found"})}):b.map(x=>{var E,N,_;return c.jsxs(Fn,{className:"cursor-pointer hover:bg-muted/50",onClick:()=>e(`/sms/${x.id}`),children:[c.jsx(mt,{className:"font-mono text-sm",children:S(x.to)}),c.jsx(mt,{children:c.jsxs(tv,{children:[c.jsx(nv,{asChild:!0,children:c.jsx(qe,{className:(E=G1[x.status])==null?void 0:E.className,variant:((N=G1[x.status])==null?void 0:N.variant)??"default",children:x.status.charAt(0).toUpperCase()+x.status.slice(1).replace("_"," ")})}),c.jsx(rv,{children:c.jsx("p",{children:((_=G1[x.status])==null?void 0:_.description)??"Unknown status"})})]})}),c.jsx(mt,{className:"max-w-[400px] truncate",children:x.body}),c.jsx(mt,{className:"text-muted-foreground",children:O(x.timestamp)}),c.jsx(mt,{children:c.jsx(Ce,{onClick:C=>{C.stopPropagation()},size:"icon",variant:"ghost",children:c.jsx("span",{className:"sr-only",children:"More options"})})})]},x.id)})})]})}),b.length>0&&!h&&c.jsx("div",{className:"mt-4 flex items-center justify-between text-muted-foreground text-sm",children:c.jsxs("div",{children:["Showing ",b.length," of ",u.length," messages"]})})]})]})}function Fge(){const[e,t]=w.useState("7"),[n,r]=w.useState(null),[i,o]=w.useState(!0),[l,u]=w.useState(null);if(w.useEffect(()=>{async function S(){try{o(!0),u(null);let x=sessionStorage.getItem("wraps-auth-token");if(x||(x=new URLSearchParams(window.location.search).get("token"),x&&sessionStorage.setItem("wraps-auth-token",x)),!x)throw new Error("Authentication token not found. Please use the URL provided by 'wraps console' command.");const E=Number.parseInt(e,10),N=Date.now()-E*24*60*60*1e3,_=Date.now(),C=await fetch(`/api/sms/metrics?startTime=${N}&endTime=${_}&token=${x}`);if(!C.ok){let M="Failed to fetch SMS metrics";try{M=(await C.json()).error||M}catch{M=`${C.status}: ${C.statusText}`}throw new Error(M)}const A=await C.json();r(A)}catch(x){const E=x instanceof Error?x.message:"Unknown error";u(E),console.error("Error fetching SMS metrics:",x)}finally{o(!1)}}S()},[e]),l)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsx("div",{className:"mt-4 rounded-md border border-destructive bg-destructive/10 p-4 text-destructive text-sm",children:l})]});if(i||!n)return c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsx("div",{className:"mt-4 flex h-[400px] items-center justify-center text-muted-foreground",children:"Loading metrics..."})]});const d=n.metrics.sends.reduce((S,x)=>S+x.value,0)||0,h=n.metrics.deliveries.reduce((S,x)=>S+x.value,0)||0,v=n.metrics.failures.reduce((S,x)=>S+x.value,0)||0,m=n.metrics.optOuts.reduce((S,x)=>S+x.value,0)||0,g=d>0?h/d*100:0,b=d>0?v/d*100:0,O=[{title:"Messages Sent",value:d.toLocaleString(),description:`${e==="1"?"Last 24 hours":`Last ${e} days`}`,icon:Zi},{title:"Delivery Rate",value:`${g.toFixed(1)}%`,description:`${h.toLocaleString()} delivered`,icon:Zj},{title:"Failure Rate",value:`${b.toFixed(1)}%`,description:`${v.toLocaleString()} failed`,icon:Dp},{title:"Opt Outs",value:m.toLocaleString(),description:"Recipients unsubscribed",icon:tm}];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Metrics"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"View detailed metrics and analytics for your SMS messaging"})]}),c.jsxs(ma,{onValueChange:t,value:e,children:[c.jsx(va,{className:"w-[180px]",children:c.jsx(pa,{})}),c.jsxs(ga,{children:[c.jsx(Fe,{value:"1",children:"Last 24 hours"}),c.jsx(Fe,{value:"7",children:"Last 7 days"}),c.jsx(Fe,{value:"15",children:"Last 15 days"}),c.jsx(Fe,{value:"30",children:"Last 30 days"}),c.jsx(Fe,{value:"90",children:"Last 90 days"})]})]})]}),c.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:O.map(S=>c.jsxs(Te,{children:[c.jsxs(Me,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx(Le,{className:"font-medium text-sm",children:S.title}),c.jsx(S.icon,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs($e,{children:[c.jsx("div",{className:"font-bold text-2xl",children:S.value}),c.jsx("p",{className:"text-muted-foreground text-xs",children:S.description})]})]},S.title))}),n.phoneNumber&&c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Phone Number"}),c.jsx(We,{children:"Your SMS sending number"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Number"}),c.jsx("span",{className:"font-mono text-sm",children:n.phoneNumber.number})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Type"}),c.jsx(qe,{variant:"outline",children:n.phoneNumber.type})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Status"}),c.jsx(qe,{variant:n.phoneNumber.status==="ACTIVE"?"default":"secondary",children:n.phoneNumber.status})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Throughput"}),c.jsx("span",{className:"text-muted-foreground text-sm",children:n.phoneNumber.throughput})]})]})]}),n.quota&&c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Spend Limits"}),c.jsx(We,{children:"Your AWS SMS spending limits"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Monthly Spend"}),c.jsxs("span",{className:"font-medium",children:["$",n.quota.spentThisMonth.toFixed(2)," / $",n.quota.spendLimitMonthly.toFixed(2)]})]}),c.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full bg-secondary",children:c.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${Math.min(n.quota.spentThisMonth/n.quota.spendLimitMonthly*100,100)}%`}})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Daily Limit"}),c.jsxs("span",{className:"text-muted-foreground text-sm",children:["$",n.quota.spendLimitDaily.toFixed(2)]})]})]})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Metrics Summary"}),c.jsx(We,{children:"Detailed breakdown of your SMS performance"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Total Messages Sent"}),c.jsx(qe,{variant:"outline",children:d.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Successfully Delivered"}),c.jsx(qe,{variant:"default",children:h.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Failed"}),c.jsx(qe,{variant:"destructive",children:v.toLocaleString()})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm",children:"Opt Outs"}),c.jsx(qe,{variant:"secondary",children:m.toLocaleString()})]})]})]})]})}function F4({status:e}){const t=e==="ACTIVE"||e==="SUCCESS";return c.jsxs(qe,{className:t?"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400":"border-yellow-500/20 bg-yellow-500/10 text-yellow-700 dark:text-yellow-400",variant:"outline",children:[t?c.jsx(ao,{className:"mr-1 h-3 w-3"}):c.jsx(lr,{className:"mr-1 h-3 w-3"}),e]})}function Gge({phoneNumber:e}){if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(tm,{className:"h-5 w-5"}),"Phone Number"]}),c.jsx(We,{children:"No phone number configured"})]})});const t=r=>r.startsWith("+1")&&r.length===12?`(${r.slice(2,5)}) ${r.slice(5,8)}-${r.slice(8)}`:r,n=r=>{switch(r){case"simulator":return"Simulator";case"toll-free":return"Toll-Free";case"10dlc":return"10DLC";case"short-code":return"Short Code";default:return r}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(tm,{className:"h-5 w-5"}),"Phone Number"]}),c.jsx(We,{children:"Your SMS sending number"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium font-mono text-lg",children:t(e.number)}),c.jsx("p",{className:"text-muted-foreground text-sm",children:n(e.type)})]}),c.jsx(F4,{status:e.status})]}),e.registrationStatus&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Registration Status"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.type==="toll-free"?"Toll-free verification":"Campaign registration"})]}),c.jsx(F4,{status:e.registrationStatus})]})]}),e.capabilities.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"space-y-2",children:[c.jsx("p",{className:"font-medium text-sm",children:"Capabilities"}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.capabilities.map(r=>c.jsx(qe,{variant:"secondary",children:r},r))})]})]}),e.monthlyLeasingPrice&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Monthly Cost"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Phone number lease"})]}),c.jsxs("span",{className:"font-mono text-sm",children:["$",e.monthlyLeasingPrice,"/mo"]})]})]}),e.type==="simulator"&&c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Simulator Mode"}),c.jsx(Hn,{children:"This number is for testing only. Messages are simulated and not actually sent. Upgrade to a toll-free number for production use."})]}),e.type==="toll-free"&&e.registrationStatus!=="VERIFIED"&&c.jsxs(Un,{children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Registration Required"}),c.jsxs(Hn,{children:["Toll-free numbers require registration before they can send messages. Run ",c.jsx("code",{children:"wraps sms register"})," to complete registration."]})]})]})]})}function Vge({protectConfig:e}){return e!=null&&e.enabled?c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),"Fraud Protection"]}),c.jsx(We,{children:"Country restrictions and AIT filtering"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Status"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Protect configuration active"})]}),c.jsxs(qe,{className:"border-green-500/20 bg-green-500/10 text-green-700 dark:text-green-400",variant:"outline",children:[c.jsx(ao,{className:"mr-1 h-3 w-3"}),"Enabled"]})]}),c.jsx(qt,{}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Vu,{className:"h-4 w-4 text-muted-foreground"}),c.jsx("p",{className:"font-medium text-sm",children:"Allowed Countries"})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.allowedCountries.map(t=>c.jsx(qe,{variant:"secondary",children:t},t))}),c.jsx("p",{className:"text-muted-foreground text-xs",children:"Messages can only be sent to these countries. All others are blocked."})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"AIT Filtering"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.aitFiltering?"Enabled - adds per-message cost":"Disabled - no extra cost"})]}),c.jsx(qe,{variant:e.aitFiltering?"default":"secondary",children:e.aitFiltering?"Enabled":"Disabled"})]})]})]}):c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(nm,{className:"h-5 w-5"}),"Fraud Protection"]}),c.jsx(We,{children:"Not configured"})]})})}function Yge({configSet:e,onRefresh:t}){const[n,r]=w.useState(!1),[i,o]=w.useState(!1);if(!e)return c.jsx(Te,{children:c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"Configuration Set"]}),c.jsx(We,{children:"No configuration set found"})]})});const l=async()=>{o(!0);try{const u=sessionStorage.getItem("wraps-auth-token"),d=!e.sendingEnabled,h=await fetch(`/api/sms/settings/sending?token=${u}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d})});if(!h.ok)throw new Error(`Failed to update: ${h.statusText}`);r(!1),Ot.success(d?"SMS sending enabled":"SMS sending disabled"),t&&await t()}catch(u){console.error("Failed to toggle sending:",u),Ot.error("Failed to update setting",{description:u instanceof Error?u.message:"Unknown error"})}finally{o(!1)}};return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsxs(Le,{className:"flex items-center gap-2",children:[c.jsx(Zi,{className:"h-5 w-5"}),"Configuration Set"]}),c.jsx(We,{children:"SMS sending configuration"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium",children:e.name}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"Configuration Set Name"})]}),c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 space-y-0.5",children:[c.jsx("p",{className:"font-medium text-sm",children:"SMS Sending"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.sendingEnabled?"Messages can be sent":"Message sending is disabled"})]}),c.jsx(Ce,{onClick:()=>r(!0),size:"sm",variant:e.sendingEnabled?"destructive":"default",children:e.sendingEnabled?"Disable":"Enable"})]}),c.jsx(Sm,{onOpenChange:r,open:n,children:c.jsxs(jm,{children:[c.jsxs(Om,{children:[c.jsx(_m,{children:e.sendingEnabled?"Disable SMS sending?":"Enable SMS sending?"}),c.jsx(Nm,{children:e.sendingEnabled?"All outgoing SMS messages will be blocked until you re-enable sending.":"This will allow SMS messages to be sent through this configuration set."})]}),c.jsxs(Em,{children:[c.jsx(Cm,{disabled:i,children:"Cancel"}),c.jsx(Am,{disabled:i,onClick:l,children:i?"Updating...":e.sendingEnabled?"Disable sending":"Enable sending"})]})]})})]})]})}function Wge({eventTracking:e}){return c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Le,{children:"Event Tracking"}),c.jsx(We,{children:"Message history and event storage"})]}),c.jsxs($e,{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Event Tracking"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e!=null&&e.enabled?"Tracking delivery events":"Event tracking disabled"})]}),c.jsx(qe,{variant:e!=null&&e.enabled?"default":"secondary",children:e!=null&&e.enabled?"Enabled":"Disabled"})]}),(e==null?void 0:e.enabled)&&c.jsxs(c.Fragment,{children:[c.jsx(qt,{}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Message History"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:e.dynamoDBHistory?"Stored in DynamoDB":"Not stored"})]}),c.jsx(qe,{variant:e.dynamoDBHistory?"default":"secondary",children:e.dynamoDBHistory?"Enabled":"Disabled"})]}),e.archiveRetention&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("p",{className:"font-medium text-sm",children:"Retention Period"}),c.jsx("p",{className:"text-muted-foreground text-sm",children:"How long message history is kept"})]}),c.jsx(qe,{variant:"outline",children:e.archiveRetention})]})]})]})]})}function Kge(){const[e,t]=w.useState(null),[n,r]=w.useState(!0),[i,o]=w.useState(null),l=w.useCallback(async()=>{try{r(!0);const u=sessionStorage.getItem("wraps-auth-token");if(!u)throw new Error("Authentication token not found");const d=await fetch(`/api/sms/settings?token=${u}`);if(!d.ok)throw new Error(`Failed to fetch settings: ${d.statusText}`);const h=await d.json();t(h),o(null)}catch(u){console.error("Failed to fetch SMS settings:",u),o(u instanceof Error?u.message:"Failed to load settings")}finally{r(!1)}},[]);return w.useEffect(()=>{l()},[l]),n?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]}),c.jsxs(Te,{children:[c.jsxs(Me,{children:[c.jsx(Re,{className:"h-6 w-48"}),c.jsx(Re,{className:"mt-2 h-4 w-64"})]}),c.jsx($e,{children:c.jsx(Re,{className:"h-20 w-full"})})]})]})]}):i?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs(Un,{className:"mt-6",variant:"destructive",children:[c.jsx(lr,{className:"h-4 w-4"}),c.jsx(to,{children:"Error Loading Settings"}),c.jsx(Hn,{children:i})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-semibold text-3xl tracking-tight",children:"SMS Settings"}),c.jsx("p",{className:"mt-2 text-muted-foreground",children:"Configure your SMS settings and preferences"})]}),c.jsxs("div",{className:"mt-6 grid gap-6 md:grid-cols-2",children:[c.jsx(Gge,{phoneNumber:e==null?void 0:e.phoneNumber}),c.jsx(Yge,{configSet:e==null?void 0:e.configurationSet,onRefresh:l}),c.jsx(Vge,{protectConfig:e==null?void 0:e.protectConfiguration}),c.jsx(Wge,{eventTracking:e==null?void 0:e.eventTracking})]})]})}function Xge({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[i,o]=w.useState(()=>localStorage.getItem(n)||t);w.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),i==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d),u.style.colorScheme=d;return}u.classList.add(i),u.style.colorScheme=i},[i]);const l={theme:i,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return c.jsx(u$.Provider,{...r,value:l,children:e})}function Qge({...e}){return c.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})}function Zge({className:e,...t}){return c.jsx("ol",{className:me("flex flex-wrap items-center gap-1.5 break-words text-muted-foreground text-sm sm:gap-2.5",e),"data-slot":"breadcrumb-list",...t})}function Jge({className:e,...t}){return c.jsx("li",{className:me("inline-flex items-center gap-1.5",e),"data-slot":"breadcrumb-item",...t})}function eye({className:e,...t}){return c.jsx("span",{"aria-current":"page","aria-disabled":"true",className:me("font-normal text-foreground",e),"data-slot":"breadcrumb-page",role:"link",...t})}var tye=(e,t,n,r,i,o,l,u)=>{let d=document.documentElement,h=["light","dark"];function v(b){(Array.isArray(e)?e:[e]).forEach(O=>{let S=O==="class",x=S&&o?i.map(E=>o[E]||E):i;S?(d.classList.remove(...x),d.classList.add(o&&o[b]?o[b]:b)):d.setAttribute(O,b)}),m(b)}function m(b){u&&h.includes(b)&&(d.style.colorScheme=b)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)v(r);else try{let b=localStorage.getItem(t)||n,O=l&&b==="system"?g():b;v(O)}catch{}},nye=w.createContext(void 0),rye={setTheme:e=>{},themes:[]},aye=()=>{var e;return(e=w.useContext(nye))!=null?e:rye};w.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:o,value:l,themes:u,nonce:d,scriptProps:h})=>{let v=JSON.stringify([n,t,o,e,u,l,r,i]).slice(1,-1);return w.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?d:"",dangerouslySetInnerHTML:{__html:`(${tye.toString()})(${v})`}})});const iye=({...e})=>{const{theme:t="system"}=aye();return c.jsx(UK,{className:"toaster group",icons:{success:c.jsx(ao,{className:"size-4"}),info:c.jsx(TF,{className:"size-4"}),warning:c.jsx(LF,{className:"size-4"}),error:c.jsx(DF,{className:"size-4"}),loading:c.jsx(Va,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},theme:t,...e})};function oye(){const e=Zr(),[t,n]=w.useState(!1);w.useEffect(()=>{let i=sessionStorage.getItem("wraps-auth-token");if(!i){const o=new URLSearchParams(window.location.search);if(i=o.get("token"),i){sessionStorage.setItem("wraps-auth-token",i),o.delete("token");const l=o.toString()?`${window.location.pathname}?${o.toString()}`:window.location.pathname;window.history.replaceState({},"",l)}}n(!0)},[]),w.useEffect(()=>{document.cookie="sidebar_state=; path=/; max-age=0"},[]);const r=()=>{if(e.pathname.startsWith("/email/inbound/"))return"Inbound Email Details";if(e.pathname.startsWith("/email/")&&e.pathname!=="/email/metrics"&&e.pathname!=="/email/settings")return"Email Details";if(e.pathname.startsWith("/sms/")&&e.pathname!=="/sms/metrics"&&e.pathname!=="/sms/settings")return"SMS Details";if(e.pathname.startsWith("/cdn/")&&e.pathname!=="/cdn/metrics"&&e.pathname!=="/cdn/settings")return"File Details";switch(e.pathname){case"/":case"/email":return"Emails";case"/email/metrics":return"Email Metrics";case"/email/settings":return"Email Settings";case"/sms":return"SMS Messages";case"/sms/metrics":return"SMS Metrics";case"/sms/settings":return"SMS Settings";case"/cdn":return"CDN";case"/cdn/metrics":return"CDN Metrics";case"/cdn/settings":return"CDN Settings";default:return"Emails"}};return c.jsxs(FI,{defaultOpen:!1,children:[c.jsx(pK,{}),c.jsxs(VI,{children:[c.jsxs("header",{className:"sticky top-0 flex shrink-0 items-center gap-2 border-b bg-background p-4",children:[c.jsx(GI,{className:"-ml-1"}),c.jsx(qt,{className:"mr-2 data-[orientation=vertical]:h-4",orientation:"vertical"}),c.jsx(Qge,{children:c.jsx(Zge,{children:c.jsx(Jge,{children:c.jsx(eye,{children:r()})})})})]}),c.jsx("div",{className:"flex flex-1 flex-col gap-6 p-6",children:t?c.jsxs(DH,{children:[c.jsx(Bn,{element:c.jsx(MH,{replace:!0,to:"/email"}),path:"/"}),c.jsx(Bn,{element:c.jsx(Oge,{}),path:"/email"}),c.jsx(Bn,{element:c.jsx(Lge,{}),path:"/email/inbound/:emailId"}),c.jsx(Bn,{element:c.jsx(wge,{}),path:"/email/:id"}),c.jsx(Bn,{element:c.jsx(Age,{}),path:"/email/metrics"}),c.jsx(Bn,{element:c.jsx($ge,{}),path:"/email/settings"}),c.jsx(Bn,{element:c.jsx(Hge,{}),path:"/sms"}),c.jsx(Bn,{element:c.jsx(Uge,{}),path:"/sms/:id"}),c.jsx(Bn,{element:c.jsx(Fge,{}),path:"/sms/metrics"}),c.jsx(Bn,{element:c.jsx(Kge,{}),path:"/sms/settings"}),c.jsx(Bn,{element:c.jsx(tee,{}),path:"/cdn"}),c.jsx(Bn,{element:c.jsx(rge,{}),path:"/cdn/metrics"}),c.jsx(Bn,{element:c.jsx(cge,{}),path:"/cdn/settings"})]}):c.jsx("div",{className:"flex items-center justify-center p-8",children:c.jsx("div",{className:"text-muted-foreground",children:"Loading..."})})})]})]})}function sye(){return c.jsx(Xge,{defaultTheme:"system",storageKey:"console-ui-theme",children:c.jsxs(aF,{children:[c.jsx(oye,{}),c.jsx(iye,{})]})})}kU.createRoot(document.getElementById("root")).render(c.jsx(w.StrictMode,{children:c.jsx(sye,{})}));
|