@embedreach/components 0.1.85 → 0.1.86

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.
@@ -33132,13 +33132,13 @@ const StatsGrid = ({
33132
33132
  {
33133
33133
  icon: /* @__PURE__ */ jsx(iconDefinitions.OpenRate, { className: "w-4 h-4" }),
33134
33134
  title: "Open Rate",
33135
- value: `${statistics.email.openPercentage.toFixed(2)}%`,
33135
+ value: `${(statistics.email.openPercentage * 100).toFixed(2)}%`,
33136
33136
  tooltipText: "Percentage of recipients who opened the email out of total emails delivered"
33137
33137
  },
33138
33138
  {
33139
33139
  icon: /* @__PURE__ */ jsx(iconDefinitions.TotalBounceRate, { className: "w-4 h-4" }),
33140
33140
  title: "Total Bounce Rate",
33141
- value: `${(statistics.email.softBounceRate + statistics.email.hardBounceRate).toFixed(2)}%`,
33141
+ value: `${((statistics.email.softBounceRate + statistics.email.hardBounceRate) * 100).toFixed(2)}%`,
33142
33142
  tooltipText: "Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"
33143
33143
  },
33144
33144
  {
@@ -33150,13 +33150,13 @@ const StatsGrid = ({
33150
33150
  {
33151
33151
  icon: /* @__PURE__ */ jsx(iconDefinitions.SpamComplies, { className: "w-4 h-4" }),
33152
33152
  title: "Spam Complaints",
33153
- value: `${statistics.email.spamComplaintRate.toFixed(2)}%`,
33153
+ value: `${(statistics.email.spamComplaintRate * 100).toFixed(2)}%`,
33154
33154
  tooltipText: "Percentage of recipients who marked this email as spam"
33155
33155
  },
33156
33156
  {
33157
33157
  icon: /* @__PURE__ */ jsx(iconDefinitions.UnsubscribeRate, { className: "w-4 h-4" }),
33158
33158
  title: "Unsubscribe Rate",
33159
- value: `${statistics.email.unsubscribedRate.toFixed(2)}%`,
33159
+ value: `${(statistics.email.unsubscribedRate * 100).toFixed(2)}%`,
33160
33160
  tooltipText: "Percentage of recipients who unsubscribed after receiving this email"
33161
33161
  }
33162
33162
  ],
package/dist/index.umd.js CHANGED
@@ -40,7 +40,7 @@
40
40
  * LICENSE.md file in the root directory of this source tree.
41
41
  *
42
42
  * @license MIT
43
- */(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);i+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(i+="; HttpOnly");n.secure&&(i+="; Secure");n.partitioned&&(i+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}}return i};const Ck=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,kk=/^[\u0021-\u003A\u003C-\u007E]*$/,Ek=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,_k=/^[\u0020-\u003A\u003D-\u007E]*$/,jk=Object.prototype.toString,Tk=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Nk(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Pk(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Dk(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(PX){return e}}function Mk(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?Ik(t):t,state:n,key:t&&t.key||r||Rk()};return o}(t?c().pathname:"/",e,n,r);return Ok("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:Lk(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?Ik(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function Ak(e,t){if(!1===e||null==e)throw new Error(t)}function Ok(e,t){if(!e)try{throw new Error(t)}catch(PX){}}function Rk(){return Math.random().toString(36).substring(2,10)}function Lk({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 Ik(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 Fk(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?Ik(t):t,i=Jk(o.pathname||"/",n);if(null==i)return null;let s=$k(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let a=null;for(let l=0;null==a&&l<s.length;++l){let e=Xk(i);a=Yk(s[l],e,r)}return a}(e,t,n,!1)}function $k(e,t=[],n=[],r=""){let o=(e,o,i)=>{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(Ak(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let a=nE([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Ak(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),$k(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Gk(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of qk(e.path))o(e,t,n);else o(e,t)})),t}function qk(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let s=qk(r.join("/")),a=[];return a.push(...s.map((e=>""===e?i:[i,e].join("/")))),o&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}var Uk=/^:[\w-]+$/,zk=3,Bk=2,Vk=1,Kk=10,Hk=-2,Wk=e=>"*"===e;function Gk(e,t){let n=e.split("/"),r=n.length;return n.some(Wk)&&(r+=Hk),t&&(r+=Bk),n.filter((e=>!Wk(e))).reduce(((e,t)=>e+(Uk.test(t)?zk:""===t?Vk:Kk)),r)}function Yk(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Qk({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Qk({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:nE([i,u.pathname]),pathnameBase:rE(nE([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=nE([i,u.pathnameBase]))}return s}function Qk(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Ok("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){s=i.slice(0,i.length-(a[r]||"").length).replace(/(.)\/+$/,"$1")}const o=a[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function Xk(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Ok(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Jk(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)||"/"}function Zk(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 eE(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function tE(e,t,n,r=!1){let o;"string"==typeof e?o=Ik(e):(o={...e},Ak(!o.pathname||!o.pathname.includes("?"),Zk("?","pathname","search",o)),Ak(!o.pathname||!o.pathname.includes("#"),Zk("#","pathname","hash",o)),Ak(!o.search||!o.search.includes("#"),Zk("#","search","hash",o)));let i,s=""===e||""===o.pathname,a=s?"/":o.pathname;if(null==a)i=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Ik(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:oE(r),hash:iE(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var nE=e=>e.join("/").replace(/\/\/+/g,"/"),rE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),oE=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",iE=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var sE=["POST","PUT","PATCH","DELETE"];new Set(sE);var aE=["GET",...sE];new Set(aE);var lE=i.createContext(null);lE.displayName="DataRouter";var cE=i.createContext(null);cE.displayName="DataRouterState";var uE=i.createContext({isTransitioning:!1});uE.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var dE=i.createContext(null);dE.displayName="Navigation";var pE=i.createContext(null);pE.displayName="Location";var fE=i.createContext({outlet:null,matches:[],isDataRoute:!1});fE.displayName="Route";var hE=i.createContext(null);function mE(){return null!=i.useContext(pE)}function gE(){return Ak(mE(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(pE).location}hE.displayName="RouteError";var yE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vE(e){i.useContext(dE).static||i.useLayoutEffect(e)}function bE(){let{isDataRoute:e}=i.useContext(fE);return e?function(){let{router:e}=function(e){let t=i.useContext(lE);return Ak(t,_E(e)),t}("useNavigate"),t=jE("useNavigate"),n=i.useRef(!1);return vE((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Ok(n.current,yE),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Ak(mE(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(lE),{basename:t,navigator:n}=i.useContext(dE),{matches:r}=i.useContext(fE),{pathname:o}=gE(),s=JSON.stringify(eE(r)),a=i.useRef(!1);return vE((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Ok(a.current,yE),!a.current)return;if("number"==typeof r)return void n.go(r);let l=tE(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:nE([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function xE(e,{relative:t}={}){let{matches:n}=i.useContext(fE),{pathname:r}=gE(),o=JSON.stringify(eE(n));return i.useMemo((()=>tE(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function wE(e,t,n,r){Ak(mE(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(dE),{matches:a}=i.useContext(fE),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",p=l&&l.route;{let e=p&&p.path||"";NE(u,!p||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) 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.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}o=gE();let f=o.pathname||"/",h=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Fk(e,{pathname:h});Ok(p||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Ok(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.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 g=function(e,t=[],n=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,o=n?.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&void 0!==o?.[e.route.id]));Ak(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let s=!1,a=-1;if(n)for(let i=0;i<r.length;i++){let e=r[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(a=i),e.route.id){let{loaderData:t,errors:o}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!o||void 0===o[e.route.id]);if(e.route.lazy||i){s=!0,r=a>=0?r.slice(0,a+1):[r[0]];break}}}return r.reduceRight(((e,l,c)=>{let u,d=!1,p=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,p=l.route.errorElement||CE,s&&(a<0&&0===c?(NE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):a===c&&(d=!0,f=l.route.hydrateFallbackElement||null)));let h=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?p:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(EE,{match:l,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(kE,{location:n.location,revalidation:n.revalidation,component:p,error:u,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:nE([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:nE([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function SE(){let e=function(){let e=i.useContext(hE),t=function(e){let t=i.useContext(cE);return Ak(t,_E(e)),t}("useRouteError"),n=jE("useRouteError");if(void 0!==e)return e;return t.errors?.[n]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(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)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return a=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,a)}i.createContext(null);var CE=i.createElement(SE,null),kE=class extends i.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(fE.Provider,{value:this.props.routeContext},i.createElement(hE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function EE({routeContext:e,match:t,children:n}){let r=i.useContext(lE);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(fE.Provider,{value:e},n)}function _E(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jE(e){let t=function(e){let t=i.useContext(fE);return Ak(t,_E(e)),t}(e),n=t.matches[t.matches.length-1];return Ak(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var TE={};function NE(e,t,n){t||TE[e]||(TE[e]=!0,Ok(!1,n))}function PE({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Mk({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(DE,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function DE({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Ak(!mE(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=Ik(n));let{pathname:c="/",search:u="",hash:d="",state:p=null,key:f="default"}=n,h=i.useMemo((()=>{let e=Jk(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:p,key:f},navigationType:r}}),[a,c,u,d,p,f,r]);return Ok(null!=h,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==h?null:i.createElement(dE.Provider,{value:l},i.createElement(pE.Provider,{children:t,value:h}))}i.memo((function({routes:e,future:t,state:n}){return wE(e,0,n,t)}));var ME="get",AE="application/x-www-form-urlencoded";function OE(e){return null!=e&&"string"==typeof e.tagName}function RE(e=""){return new URLSearchParams("string"==typeof e||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((e=>[n,e])):[[n,r]])}),[]))}var LE=null;var IE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function FE(e){return null==e||IE.has(e)?e:(Ok(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${AE}"`),null)}function $E(e,t){let n,r,o,i,s;if(function(e){return OE(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?Jk(s,t):null,n=e.getAttribute("method")||ME,o=FE(e.getAttribute("enctype"))||AE,i=new FormData(e)}else if(function(e){return OE(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return OE(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||s.getAttribute("action");if(r=a?Jk(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||ME,o=FE(e.getAttribute("formenctype"))||FE(s.getAttribute("enctype"))||AE,i=new FormData(s,e),!function(){if(null===LE)try{new FormData(document.createElement("form"),0),LE=!1}catch(PX){LE=!0}return LE}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(OE(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ME,r=null,o=AE,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function qE(e,t){if(!1===e||null==e)throw new Error(t)}function UE(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function zE(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce(((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(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 window.__reactRouterContext&&window,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(UE).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function BE(e,t,n,r,o,i){let s=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>s(e,t)||a(e,t))):"data"===i?t.filter(((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,i)||a(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function VE(e,t){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r})).flat(1),[...new Set(n)];var n}var KE=i.createContext(void 0);function HE(){let e=i.useContext(KE);return qE(e,"You must render this element inside a <HydratedRouter> element"),e}function WE(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GE({page:e,...t}){let{router:n}=function(){let e=i.useContext(lE);return qE(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>Fk(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(YE,{page:e,matches:r,...t}):null}function YE({page:e,matches:t,...n}){let r=gE(),{manifest:o,routeModules:s}=HE(),{loaderData:a,matches:l}=function(){let e=i.useContext(cE);return qE(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>BE(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>BE(e,t,l,o,r,"assets")),[e,t,l,o,r]),d=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach((e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in a&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))})),0===n.size)return[];let l=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname="/"===t.pathname?"_root.data":`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return i&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[a,r,o,c,t,e,s]),p=i.useMemo((()=>VE(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=HE(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return zE(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return i.createElement(i.Fragment,null,d.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),p.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}function QE(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}KE.displayName="FrameworkContext";var XE="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{XE&&(window.__reactRouterVersion="7.1.0")}catch(PX){}var JE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ZE=i.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...p},f){let h,{basename:m}=i.useContext(dE),g="string"==typeof c&&JE.test(c),y=!1;if("string"==typeof c&&g&&(h=c,XE))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Jk(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:y=!0}catch(PX){Ok(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=function(e,{relative:t}={}){Ak(mE(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(dE),{hash:o,pathname:s,search:a}=xE(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:nE([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(KE),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=t,f=i.useRef(null);i.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:WE(l,h),onBlur:WE(c,m),onMouseEnter:WE(u,h),onMouseLeave:WE(d,m),onTouchStart:WE(p,h)}]:[!1,f,{}]}(n,p),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=bE(),c=gE(),u=xE(e,{relative:s});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==n?n:Lk(c)===Lk(u);l(e,{replace:t,state:r,preventScrollReset:o,relative:s,viewTransition:a})}}),[c,l,u,n,r,t,e,o,s,a])}(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});let C=i.createElement("a",{...p,...w,href:h||v,onClick:y||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:QE(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(GE,{page:v})):C}));function e_(e){let t=i.useContext(lE);return Ak(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function t_(e){Ok("undefined"!=typeof URLSearchParams,"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=i.useRef(RE(e)),n=i.useRef(!1),r=gE(),o=i.useMemo((()=>function(e,t){let n=RE(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),s=bE(),a=i.useCallback(((e,t)=>{const r=RE("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}ZE.displayName="Link",i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:s,viewTransition:a,children:l,...c},u){let d=xE(s,{relative:c.relative}),p=gE(),f=i.useContext(cE),{navigator:h,basename:m}=i.useContext(dE),g=null!=f&&function(e,t={}){let n=i.useContext(uE);Ak(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=e_("useViewTransitionState"),o=xE(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Jk(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Jk(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Qk(o.pathname,a)||null!=Qk(o.pathname,s)}(d)&&!0===a,y=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,v=p.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&m&&(b=Jk(b,m)||b);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let w,S=v===y||!r&&v.startsWith(y)&&"/"===v.charAt(x),C=null!=b&&(b===y||!r&&b.startsWith(y)&&"/"===b.charAt(y.length)),k={isActive:S,isPending:C,isTransitioning:g},E=S?e:void 0;w="function"==typeof n?n(k):[n,S?"active":null,C?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let _="function"==typeof o?o(k):o;return i.createElement(ZE,{...c,"aria-current":E,className:w,ref:u,style:_,to:s,viewTransition:a},"function"==typeof l?l(k):l)})).displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:a=ME,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,...f},h)=>{let m=function(){let{router:e}=e_("useSubmit"),{basename:t}=i.useContext(dE),n=jE("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=$E(r,t);if(!1===o.navigate){let t=o.fetcherKey||r_();await e.fetch(t,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=i.useContext(dE),r=i.useContext(fE);Ak(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...xE(e||".",{relative:t})},a=gE();if(null==e){s.search=a.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:nE([n,s.pathname]));return Lk(s)}(l,{relative:u}),y="get"===a.toLowerCase()?"get":"post",v="string"==typeof l&&JE.test(l);return i.createElement("form",{ref:h,method:y,action:g,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||a;m(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:p})},...f,"data-discover":v||"render"!==e?void 0:"true"})})).displayName="Form";var n_=0,r_=()=>`__${String(++n_)}__`;new TextEncoder;const o_=({tabs:e,activeTab:r,onTabChange:o,tabsLocation:i="left",secondaryTabs:s=!1})=>{const a=n.useRef([]),[l,c]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=a.current[e.findIndex((e=>e.id===r))];t&&c({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),t.jsxs("div",{className:"flex flex-col gap-4 w-full flex-1",children:[t.jsx("div",{className:"flex items-center justify-between border-b px-4",children:t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===i?"w-full justify-start":"w-full justify-center"),children:[t.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-gray-100/50 rounded-full"}),t.jsx("div",{className:"absolute bottom-0 h-[1px] rounded-full transition-all duration-300 ease-out\n bg-gradient-to-r from-primary to-primary/90\n shadow-[0_0_8px_rgba(var(--primary-rgb),0.3)]",style:{width:`${l.width}px`,left:`${l.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>a.current[n]=e,onClick:()=>o(e.id),className:Rm("relative px-1 py-3 transition-all duration-200",r!==e.id&&"text-muted-foreground",s&&"text-sm"),children:e.label},e.id)))]})}),t.jsx("div",{className:"relative min-h-40",children:e.map((n=>t.jsx("div",{className:"absolute w-full transition-all duration-500 ease-in-out transform \n "+(r===n.id?"translate-x-0 opacity-100 pointer-events-auto":(e.findIndex((e=>e.id===n.id))<e.findIndex((e=>e.id===r))?"translate-x-[-8%]":"translate-x-[8%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})};function i_(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function s_(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const s=i.createContext(o),a=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[a]||s,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[a]||s);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},a_(o,...n)]}function a_(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var l_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(d_);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(c_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(c_,{...o,ref:n,children:r})}));l_.displayName="Slot";var c_=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n);return i.cloneElement(n,{...p_(r,n.props),ref:t?cf(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));c_.displayName="SlotClone";var u_=({children:e})=>t.jsx(t.Fragment,{children:e});function d_(e){return i.isValidElement(e)&&e.type===u_}function p_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var f_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?l_:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});function h_(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}function m_(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function g_(e,t=globalThis?.document){const n=m_(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var y_,v_="dismissableLayer.update",b_="dismissableLayer.pointerDownOutside",x_="dismissableLayer.focusOutside",w_=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S_=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(w_),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){k_(b_,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){k_(x_,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(y_=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),C_(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=y_)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),C_())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(v_,e),()=>document.removeEventListener(v_,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));S_.displayName="DismissableLayer";function C_(){const e=new CustomEvent(v_);document.dispatchEvent(e)}function k_(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(w_),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var E_=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},__=i["useId".toString()]||(()=>{}),j_=0;function T_(e){const[t,n]=i.useState(__());return E_((()=>{n((e=>e??String(j_++)))}),[e]),t?`radix-${t}`:""}const N_=["top","right","bottom","left"],P_=Math.min,D_=Math.max,M_=Math.round,A_=Math.floor,O_=e=>({x:e,y:e}),R_={left:"right",right:"left",bottom:"top",top:"bottom"},L_={start:"end",end:"start"};function I_(e,t,n){return D_(e,P_(t,n))}function F_(e,t){return"function"==typeof e?e(t):e}function $_(e){return e.split("-")[0]}function q_(e){return e.split("-")[1]}function U_(e){return"x"===e?"y":"x"}function z_(e){return"y"===e?"height":"width"}function B_(e){return["top","bottom"].includes($_(e))?"y":"x"}function V_(e){return U_(B_(e))}function K_(e){return e.replace(/start|end/g,(e=>L_[e]))}function H_(e){return e.replace(/left|right|bottom|top/g,(e=>R_[e]))}function W_(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function G_(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Y_(e,t,n){let{reference:r,floating:o}=e;const i=B_(t),s=V_(t),a=z_(s),l=$_(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(q_(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function Q_(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=F_(t,e),h=W_(f),m=a[p?"floating"===d?"reference":"floating":d],g=G_(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=G_(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function X_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function J_(e){return N_.some((t=>e[t]>=0))}function Z_(){return"undefined"!=typeof window}function ej(e){return rj(e)?(e.nodeName||"").toLowerCase():"#document"}function tj(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nj(e){var t;return null==(t=(rj(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rj(e){return!!Z_()&&(e instanceof Node||e instanceof tj(e).Node)}function oj(e){return!!Z_()&&(e instanceof Element||e instanceof tj(e).Element)}function ij(e){return!!Z_()&&(e instanceof HTMLElement||e instanceof tj(e).HTMLElement)}function sj(e){return!(!Z_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tj(e).ShadowRoot)}function aj(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function lj(e){return["table","td","th"].includes(ej(e))}function cj(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(PX){return!1}}))}function uj(e){const t=dj(),n=oj(e)?fj(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function dj(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function pj(e){return["html","body","#document"].includes(ej(e))}function fj(e){return tj(e).getComputedStyle(e)}function hj(e){return oj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mj(e){if("html"===ej(e))return e;const t=e.assignedSlot||e.parentNode||sj(e)&&e.host||nj(e);return sj(t)?t.host:t}function gj(e){const t=mj(e);return pj(t)?e.ownerDocument?e.ownerDocument.body:e.body:ij(t)&&aj(t)?t:gj(t)}function yj(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=gj(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=tj(o);if(i){const e=vj(s);return t.concat(s,s.visualViewport||[],aj(o)?o:[],e&&n?yj(e):[])}return t.concat(o,yj(o,[],n))}function vj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bj(e){const t=fj(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ij(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=M_(n)!==i||M_(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xj(e){return oj(e)?e:e.contextElement}function wj(e){const t=xj(e);if(!ij(t))return O_(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bj(t);let s=(i?M_(n.width):n.width)/r,a=(i?M_(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Sj=O_(0);function Cj(e){const t=tj(e);return dj()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sj}function kj(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=xj(e);let s=O_(1);t&&(r?oj(r)&&(s=wj(r)):s=wj(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==tj(e))&&t}(i,n,r)?Cj(i):O_(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=tj(i),t=r&&oj(r)?tj(r):r;let n=e,o=vj(n);for(;o&&r&&t!==n;){const e=wj(o),t=o.getBoundingClientRect(),r=fj(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=tj(o),o=vj(n)}}return G_({width:u,height:d,x:l,y:c})}function Ej(e,t){const n=hj(e).scrollLeft;return t?t.left+n:kj(nj(e)).left+n}function _j(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ej(e,r)),y:r.top+t.scrollTop}}function jj(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=tj(e),r=nj(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=dj();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=nj(e),n=hj(e),r=e.ownerDocument.body,o=D_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ej(e);const a=-n.scrollTop;return"rtl"===fj(r).direction&&(s+=D_(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(nj(e));else if(oj(t))r=function(e,t){const n=kj(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ij(e)?wj(e):O_(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Cj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return G_(r)}function Tj(e,t){const n=mj(e);return!(n===t||!oj(n)||pj(n))&&("fixed"===fj(n).position||Tj(n,t))}function Nj(e,t,n){const r=ij(t),o=nj(t),i="fixed"===n,s=kj(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=O_(0);if(r||!r&&!i)if(("body"!==ej(t)||aj(o))&&(a=hj(t)),r){const e=kj(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Ej(o));const c=!o||r||i?O_(0):_j(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Pj(e){return"static"===fj(e).position}function Dj(e,t){if(!ij(e)||"fixed"===fj(e).position)return null;if(t)return t(e);let n=e.offsetParent;return nj(e)===n&&(n=n.ownerDocument.body),n}function Mj(e,t){const n=tj(e);if(cj(e))return n;if(!ij(e)){let t=mj(e);for(;t&&!pj(t);){if(oj(t)&&!Pj(t))return t;t=mj(t)}return n}let r=Dj(e,t);for(;r&&lj(r)&&Pj(r);)r=Dj(r,t);return r&&pj(r)&&Pj(r)&&!uj(r)?n:r||function(e){let t=mj(e);for(;ij(t)&&!pj(t);){if(uj(t))return t;if(cj(t))return null;t=mj(t)}return null}(e)||n}const Aj={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=nj(r),a=!!t&&cj(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=O_(1);const u=O_(0),d=ij(r);if((d||!d&&!i)&&(("body"!==ej(r)||aj(s))&&(l=hj(r)),ij(r))){const e=kj(r);c=wj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!s||d||i?O_(0):_j(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:nj,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?cj(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=yj(e,[],!1).filter((e=>oj(e)&&"body"!==ej(e))),o=null;const i="fixed"===fj(e).position;let s=i?mj(e):e;for(;oj(s)&&!pj(s);){const t=fj(s),n=uj(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||aj(s)&&!n&&Tj(e,s))?r=r.filter((e=>e!==s)):o=t,s=mj(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=jj(t,n,o);return e.top=D_(r.top,e.top),e.right=P_(r.right,e.right),e.bottom=P_(r.bottom,e.bottom),e.left=D_(r.left,e.left),e}),jj(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Mj,getElementRects:async function(e){const t=this.getOffsetParent||Mj,n=this.getDimensions,r=await n(e.floating);return{reference:Nj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bj(e);return{width:t,height:n}},getScale:wj,isElement:oj,isRTL:function(e){return"rtl"===fj(e).direction}};function Oj(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=xj(e),u=o||i?[...c?yj(c):[],...yj(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=nj(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-A_(u)+"px "+-A_(o.clientWidth-(c+d))+"px "+-A_(o.clientHeight-(u+p))+"px "+-A_(c)+"px",threshold:D_(0,P_(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(PX){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?kj(e):null;return l&&function t(){const r=kj(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Rj=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=$_(n),a=q_(n),l="y"===B_(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=F_(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Lj=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=F_(e,t),c={x:n,y:r},u=await Q_(t,l),d=B_($_(o)),p=U_(d);let f=c[p],h=c[d];if(i){f=I_(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(s){h=I_(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:s}}}}}},Ij=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=F_(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=$_(o),v=B_(a),b=$_(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[H_(a)]:function(e){const t=H_(e);return[K_(e),t,K_(t)]}(a)),S="none"!==h;!p&&S&&w.push(...function(e,t,n,r){const o=q_(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}($_(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(K_)))),i}(a,m,h,x));const C=[a,...w],k=await Q_(t,g),E=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=q_(e),o=V_(e),i=z_(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=H_(s)),[s,H_(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(_=[..._,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,T;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(T=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=_.filter((e=>{if(S){const t=B_(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Fj=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=F_(e,t),u=await Q_(t,c),d=$_(o),p=q_(o),f="y"===B_(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right;let x=P_(m-u[g],v),w=P_(h-u[y],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=v),!t.middlewareData.shift&&!p){const e=D_(u.left,0),t=D_(u.right,0),n=D_(u.top,0),r=D_(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:D_(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:D_(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return h!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},$j=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=F_(e,t);switch(r){case"referenceHidden":{const e=X_(await Q_(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:J_(e)}}}case"escaped":{const e=X_(await Q_(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:J_(e)}}}default:return{}}}}},qj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=F_(e,t)||{};if(null==c)return{};const d=W_(u),p={x:n,y:r},f=V_(o),h=z_(f),m=await s.getDimensions(c),g="y"===f,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[h]);const k=x/2-w/2,E=C/2-m[h]/2-1,_=P_(d[y],E),j=P_(d[v],E),T=_,N=C-m[h]-j,P=C/2-m[h]/2+k,D=I_(T,P,N),M=!l.arrow&&null!=q_(o)&&P!==D&&i.reference[h]/2-(P<T?_:j)-m[h]/2<0,A=M?P<T?P-T:P-N:0;return{[f]:p[f]+A,data:{[f]:D,centerOffset:P-D-A,...M&&{alignmentOffset:A}},reset:M}}}),Uj=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=F_(e,t),u={x:n,y:r},d=B_(o),p=U_(d);let f=u[p],h=u[d];const m=F_(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var y,v;const e="y"===p?"width":"height",t=["top","left"].includes($_(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=s.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},zj=(e,t,n)=>{const r={platform:Aj,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Y_(c,r,l),p=r,f={},h=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Y_(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var Bj="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Vj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Vj(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Vj(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Kj(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hj(e,t){const n=Kj(e);return Math.round(t*n)/n}function Wj(e){const t=i.useRef(e);return Bj((()=>{t.current=e})),t}function Gj(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(r);Vj(h,r)||m(r);const[g,y]=i.useState(null),[v,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,y(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||v,k=i.useRef(null),E=i.useRef(null),_=i.useRef(p),j=null!=u,T=Wj(u),N=Wj(o),P=Wj(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),zj(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!Vj(_.current,t)&&(_.current=t,s.flushSync((()=>{f(t)})))}))}),[h,t,n,N,P]);Bj((()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);Bj((()=>(M.current=!0,()=>{M.current=!1})),[]),Bj((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(T.current)return T.current(S,C,D);D()}}),[S,C,D,T,j]);const A=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),O=i.useMemo((()=>({reference:S,floating:C})),[S,C]),R=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Hj(O.floating,p.x),r=Hj(O.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Kj(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,O.floating,p.x,p.y]);return i.useMemo((()=>({...p,update:D,refs:A,elements:O,floatingStyles:R})),[p,D,A,O,R])}const Yj=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?qj({element:n.current,padding:r}).fn(t):{}:n?qj({element:n,padding:r}).fn(t):{}}}),Qj=(e,t)=>({...Rj(e),options:[e,t]}),Xj=(e,t)=>({...Lj(e),options:[e,t]}),Jj=(e,t)=>({...Uj(e),options:[e,t]}),Zj=(e,t)=>({...Ij(e),options:[e,t]}),eT=(e,t)=>({...Fj(e),options:[e,t]}),tT=(e,t)=>({...$j(e),options:[e,t]}),nT=(e,t)=>({...Yj(e),options:[e,t]});var rT=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(f_.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));rT.displayName="Arrow";var oT=rT;function iT(e){const[t,n]=i.useState(void 0);return E_((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var sT="Popper",[aT,lT]=s_(sT),[cT,uT]=aT(sT),dT=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(cT,{scope:n,anchor:o,onAnchorChange:s,children:r})};dT.displayName=sT;var pT="PopperAnchor",fT=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=uT(pT,r),l=i.useRef(null),c=uf(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(f_.div,{...s,ref:c})}));fT.displayName=pT;var hT="PopperContent",[mT,gT]=aT(hT),yT=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,v=uT(hT,r),[b,x]=i.useState(null),w=uf(n,(e=>x(e))),[S,C]=i.useState(null),k=iT(S),E=k?.width??0,_=k?.height??0,j=o+("center"!==a?"-"+a:""),T="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],P=N.length>0,D={padding:T,boundary:N.filter(wT),altBoundary:P},{refs:M,floatingStyles:A,placement:O,isPositioned:R,middlewareData:L}=Gj({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Oj(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[Qj({mainAxis:s+_,alignmentAxis:l}),u&&Xj({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Jj():void 0,...D}),u&&Zj({...D}),eT({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&nT({element:S,padding:c}),ST({arrowWidth:E,arrowHeight:_}),h&&tT({strategy:"referenceHidden",...D})]}),[I,F]=CT(O),$=m_(g);E_((()=>{R&&$?.()}),[R,$]);const q=L.arrow?.x,U=L.arrow?.y,z=0!==L.arrow?.centerOffset,[B,V]=i.useState();return E_((()=>{b&&V(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:R?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(mT,{scope:r,placedSide:I,onArrowChange:C,arrowX:q,arrowY:U,shouldHideArrow:z,children:t.jsx(f_.div,{"data-side":I,"data-align":F,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));yT.displayName=hT;var vT="PopperArrow",bT={top:"bottom",right:"left",bottom:"top",left:"right"},xT=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=gT(vT,r),s=bT[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(oT,{...o,ref:n,style:{...o.style,display:"block"}})})}));function wT(e){return null!==e}xT.displayName=vT;var ST=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=CT(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+a/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-a+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+a}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function CT(e){const[t,n="center"]=e.split("-");return[t,n]}var kT=dT,ET=fT,_T=yT,jT=xT,TT=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);E_((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(f_.div,{...s,ref:n}),c):null}));TT.displayName="Portal";var NT=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef({}),o=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect((()=>{const e=PT(r.current);s.current="mounted"===l?e:"none"}),[l]),E_((()=>{const t=r.current,n=o.current;if(n!==e){const r=s.current,i=PT(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),E_((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const s=PT(r.current).includes(i.animationName);if(i.target===t&&s&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(s.current=PT(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),s=uf(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:s}):null};function PT(e){return e?.animationName||"none"}function DT({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,o=i.useRef(r),s=m_(t);return i.useEffect((()=>{o.current!==r&&(s(r),o.current=r)}),[r,o,s]),n}({defaultProp:t,onChange:n}),s=void 0!==e,a=s?e:r,l=m_(n);return[a,i.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[s,e,o,l])]}NT.displayName="Presence";var MT=i.forwardRef(((e,n)=>t.jsx(f_.span,{...e,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));MT.displayName="VisuallyHidden";var AT=MT,[OT,RT]=s_("Tooltip",[lT]),LT=lT(),IT="TooltipProvider",FT=700,$T="tooltip.open",[qT,UT]=OT(IT),zT=e=>{const{__scopeTooltip:n,delayDuration:r=FT,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:a}=e,[l,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),t.jsx(qT,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:i.useCallback((()=>{window.clearTimeout(d.current),c(!1)}),[]),onClose:i.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>c(!0)),o)}),[o]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback((e=>{u.current=e}),[]),disableHoverableContent:s,children:a})};zT.displayName=IT;var BT="Tooltip",[VT,KT]=OT(BT),HT=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=UT(BT,e.__scopeTooltip),d=LT(n),[p,f]=i.useState(null),h=T_(),m=i.useRef(0),g=l??u.disableHoverableContent,y=c??u.delayDuration,v=i.useRef(!1),[b=!1,x]=DT({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent($T))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?v.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,x(!0)}),[x]),C=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,x(!1)}),[x]),k=i.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{v.current=!0,x(!0),m.current=0}),y)}),[y,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(kT,{...d,children:t.jsx(VT,{scope:n,contentId:h,open:b,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:i.useCallback((()=>{u.isOpenDelayed?k():S()}),[u.isOpenDelayed,k,S]),onTriggerLeave:i.useCallback((()=>{g?C():(window.clearTimeout(m.current),m.current=0)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};HT.displayName=BT;var WT="TooltipTrigger",GT=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=KT(WT,r),a=UT(WT,r),l=LT(r),c=uf(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),p=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",p)),[p]),t.jsx(ET,{asChild:!0,...l,children:t.jsx(f_.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:i_(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:i_(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:i_(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",p,{once:!0})})),onFocus:i_(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:i_(e.onBlur,s.onClose),onClick:i_(e.onClick,s.onClose)})})}));GT.displayName=WT;var YT="TooltipPortal",[QT,XT]=OT(YT,{forceMount:void 0}),JT=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=KT(YT,n);return t.jsx(QT,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};JT.displayName=YT;var ZT="TooltipContent",eN=i.forwardRef(((e,n)=>{const r=XT(ZT,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=KT(ZT,e.__scopeTooltip);return t.jsx(NT,{present:o||a.open,children:t.jsx(a.disableHoverableContent?oN:tN,{side:i,...s,ref:n})})})),tN=i.forwardRef(((e,n)=>{const r=KT(ZT,e.__scopeTooltip),o=UT(ZT,e.__scopeTooltip),s=i.useRef(null),a=uf(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,p=s.current,{onPointerInTransitChange:f}=o,h=i.useCallback((()=>{c(null),f(!1)}),[f]),m=i.useCallback(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=function(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})}return r}(n,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(n,e.currentTarget.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(o),f(!0)}),[f]);return i.useEffect((()=>()=>h()),[h]),i.useEffect((()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,m,h]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||p?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,l);r?h():o&&(h(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,l,d,h]),t.jsx(oN,{...e,ref:a})})),[nN,rN]=OT(BT,{isInside:!1}),oN=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=KT(ZT,r),d=LT(r),{onClose:p}=u;return i.useEffect((()=>(document.addEventListener($T,p),()=>document.removeEventListener($T,p))),[p]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),t.jsx(S_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(_T,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.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:[t.jsx(u_,{children:o}),t.jsx(nN,{scope:r,isInside:!0,children:t.jsx(AT,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));eN.displayName=ZT;var iN="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=LT(r);return rN(iN,r).isInside?null:t.jsx(jT,{...i,...o,ref:n})})).displayName=iN;var sN=JT,aN=eN;const lN=zT,cN=HT,uN=GT,dN=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(sN,{children:t.jsx(aN,{ref:o,sideOffset:n,className:_d("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out 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",e),...r})})));dN.displayName=aN.displayName;const pN=({title:e,alertText:n,Icon:r=cu,onClick:o})=>t.jsx(lN,{children:t.jsxs(cN,{children:[t.jsx(uN,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(dN,{className:"text-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-[300px]",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-amber-500/10 p-2 rounded-full",children:t.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),t.jsx("p",{className:"font-semibold text-amber-500",children:n})]}),t.jsx("p",{className:"text-[13px] leading-relaxed text-primary-foreground/90",children:e})]})})]})}),fN=({icon:e,title:n,value:r,tooltipText:o})=>t.jsx("div",{className:"flex items-center bg-white rounded p-3 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md",children:t.jsxs("div",{className:"flex items-start text-sm leading-none gap-3",children:[t.jsx("div",{className:"rounded-lg p-2 bg-gray-100",children:e}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-center text-muted-foreground gap-1",children:[t.jsx("span",{className:"text-[11px]",children:n}),t.jsx(pN,{title:o})]}),t.jsx("span",{children:r})]})]})}),hN=({activeTab:e,statistics:n,iconDefinitions:r})=>{const o={email:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"Emails Sent",value:n.email.numberSent,tooltipText:"Total number of emails that were successfully sent in this campaign"},{icon:t.jsx(r.OpenRate,{className:"w-4 h-4"}),title:"Open Rate",value:`${n.email.openPercentage.toFixed(2)}%`,tooltipText:"Percentage of recipients who opened the email out of total emails delivered"},{icon:t.jsx(r.TotalBounceRate,{className:"w-4 h-4"}),title:"Total Bounce Rate",value:`${(n.email.softBounceRate+n.email.hardBounceRate).toFixed(2)}%`,tooltipText:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"},{icon:t.jsx(r.LinksClicked,{className:"w-4 h-4"}),title:"Links Clicked",value:n.email.linksClicked,tooltipText:"Total number of times recipients clicked on links within the email"},{icon:t.jsx(r.SpamComplies,{className:"w-4 h-4"}),title:"Spam Complaints",value:`${n.email.spamComplaintRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who marked this email as spam"},{icon:t.jsx(r.UnsubscribeRate,{className:"w-4 h-4"}),title:"Unsubscribe Rate",value:`${n.email.unsubscribedRate.toFixed(2)}%`,tooltipText:"Percentage of recipients who unsubscribed after receiving this email"}],sms:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"SMS Sent",value:n.sms.numberSent,tooltipText:"Total number of SMS messages that were successfully sent in this campaign"}]};return t.jsx("div",{className:"grid gap-2 transition-all duration-300 grid-cols-3",children:o[e].map(((e,n)=>t.jsx(fN,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},mN=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=De(e);if(a||!s)return t.jsx("div",{className:"bg-white rounded-2xl w-full p-6 space-y-4 relative h-[14.05rem]",children:t.jsx(XC,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(o_,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(hN,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(hN,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function gN(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function yN(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const vN=6048e5,bN=43200;let xN={};function wN(){return xN}function SN(e,t){const n=wN(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=gN(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function CN(e){return SN(e,{weekStartsOn:1})}function kN(e){const t=gN(e),n=t.getFullYear(),r=yN(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=CN(r),i=yN(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=CN(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function EN(e){const t=gN(e);return t.setHours(0,0,0,0),t}function _N(e){const t=gN(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 jN(e,t){return function(e,t){return yN(e,+gN(e)+t)}(e,6e4*t)}function TN(e,t){const n=gN(e),r=gN(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function NN(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=gN(e);return!isNaN(Number(n))}function PN(e){const t=gN(e);return+function(e){const t=gN(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=gN(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function DN(e,t){const n=gN(e),r=gN(t),o=TN(n,r),i=Math.abs(function(e,t){const n=gN(e),r=gN(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(i<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);let t=TN(n,r)===-o;PN(gN(e))&&1===i&&1===TN(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function MN(e,t,n){const r=function(e,t){return+gN(e)-+gN(t)}(e,t)/1e3;return(o=n?.roundingMethod,e=>{const t=(o?Math[o]:Math.trunc)(e);return 0===t?0:t})(r);var o}const AN={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"}};function ON(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const RN={date:ON({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ON({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ON({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},LN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function IN(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function FN(e){return(t,n={})=>{const r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(i)));let l;l=e.valueCallback?e.valueCallback(a):a,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(i.length)}}}var $N;const qN={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=AN[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:RN,formatRelative:(e,t,n,r)=>LN[e],localize:{ordinalNumber:(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"},era:IN({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:IN({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:IN({values:{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"]},defaultWidth:"wide"}),day:IN({values:{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"]},defaultWidth:"wide"}),dayPeriod:IN({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($N={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match($N.matchPattern);if(!n)return null;const r=n[0],o=e.match($N.parsePattern);if(!o)return null;let i=$N.valueCallback?$N.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:FN({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:FN({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function UN(e){const t=gN(e),n=function(e,t){const n=EN(e),r=EN(t),o=+n-_N(n),i=+r-_N(r);return Math.round((o-i)/864e5)}(t,function(e){const t=gN(e),n=yN(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function zN(e){const t=gN(e),n=+CN(t)-+function(e){const t=kN(e),n=yN(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),CN(n)}(t);return Math.round(n/vN)+1}function BN(e,t){const n=gN(e),r=n.getFullYear(),o=wN(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=yN(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=SN(s,t),l=yN(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=SN(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function VN(e,t){const n=gN(e),r=+SN(n,t)-+function(e,t){const n=wN(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=BN(e,t),i=yN(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),SN(i,t)}(n,t);return Math.round(r/vN)+1}function KN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const HN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return KN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):KN(n+1,2)},d:(e,t)=>KN(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];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>KN(e.getHours()%12||12,t.length),H:(e,t)=>KN(e.getHours(),t.length),m:(e,t)=>KN(e.getMinutes(),t.length),s:(e,t)=>KN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return KN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},WN="midnight",GN="noon",YN="morning",QN="afternoon",XN="evening",JN="night",ZN={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"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return HN.y(e,t)},Y:function(e,t,n,r){const o=BN(e,r),i=o>0?o:1-o;if("YY"===t){return KN(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):KN(i,t.length)},R:function(e,t){return KN(kN(e),t.length)},u:function(e,t){return KN(e.getFullYear(),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 KN(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"});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 KN(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"});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 HN.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"});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 KN(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=VN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):KN(o,t.length)},I:function(e,t,n){const r=zN(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):KN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):HN.d(e,t)},D:function(e,t,n){const r=UN(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):KN(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return KN(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return KN(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return KN(o,t.length);case"io":return n.ordinalNumber(o,{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"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?GN:0===r?WN:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?XN:r>=12?QN:r>=4?YN:JN,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return HN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):HN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):KN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):KN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):HN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):HN.s(e,t)},S:function(e,t){return HN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return tP(r);case"XXXX":case"XX":return nP(r);default:return nP(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tP(r);case"xxxx":case"xx":return nP(r);default:return nP(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(r,":");default:return"GMT"+nP(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(r,":");default:return"GMT"+nP(r,":")}},t:function(e,t,n){return KN(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return KN(e.getTime(),t.length)}};function eP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+KN(i,2)}function tP(e,t){if(e%60==0){return(e>0?"-":"+")+KN(Math.abs(e)/60,2)}return nP(e,t)}function nP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+KN(Math.trunc(r/60),2)+t+KN(r%60,2)}const rP=(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"});default:return t.date({width:"full"})}},oP=(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"});default:return t.time({width:"full"})}},iP={p:oP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return rP(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",rP(r,t)).replace("{{time}}",oP(o,t))}},sP=/^D+$/,aP=/^Y+$/,lP=["D","DD","YY","YYYY"];const cP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dP=/^'([^]*?)'?$/,pP=/''/g,fP=/[a-zA-Z]/;function hP(e,t,n){const r=wN(),o=r.locale??qN,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=gN(e);if(!NN(a))throw new RangeError("Invalid time value");let l=t.match(uP).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,iP[t])(e,o.formatLong)}return e})).join("").match(cP).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:mP(e)};if(ZN[t])return{isToken:!0,value:e};if(t.match(fP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return aP.test(e)}(r)||function(e){return sP.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"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`}(e,t,n);if(lP.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,ZN[r[0]])(a,r,o.localize,c)})).join("")}function mP(e){const t=e.match(dP);return t?t[1].replace(pP,"'"):e}function gP(e,t){return function(e,t,n){const r=wN(),o=n?.locale??r.locale??qN,i=TN(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i});let a,l;i>0?(a=gN(t),l=gN(e)):(a=gN(e),l=gN(t));const c=MN(l,a),u=(_N(l)-_N(a))/1e3,d=Math.round((c-u)/60);let p;if(d<2)return n?.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,s):c<10?o.formatDistance("lessThanXSeconds",10,s):c<20?o.formatDistance("lessThanXSeconds",20,s):c<40?o.formatDistance("halfAMinute",0,s):o.formatDistance(c<60?"lessThanXMinutes":"xMinutes",1,s):0===d?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",d,s);if(d<45)return o.formatDistance("xMinutes",d,s);if(d<90)return o.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return o.formatDistance("aboutXHours",e,s)}if(d<2520)return o.formatDistance("xDays",1,s);if(d<bN){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return p=Math.round(d/bN),o.formatDistance("aboutXMonths",p,s);if(p=DN(l,a),p<12){const e=Math.round(d/bN);return o.formatDistance("xMonths",e,s)}{const e=p%12,t=Math.trunc(p/12);return e<3?o.formatDistance("aboutXYears",t,s):e<9?o.formatDistance("overXYears",t,s):o.formatDistance("almostXYears",t+1,s)}}(e,function(e){return yN(e,Date.now())}(e),t)}const yP=e=>{if(!e)return"$0.00";const t="string"==typeof e?e.replace(/,/g,""):e,n=Number(t);return Number.isNaN(n)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(n)},vP=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:_d("w-full caption-bottom text-sm",e),...n})})));vP.displayName="Table";const bP=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:_d("[&_tr]:border-b",e),...n})));bP.displayName="TableHeader";const xP=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:_d("[&_tr:last-child]:border-0",e),...n})));xP.displayName="TableBody";const wP=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:_d("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));wP.displayName="TableRow";const SP=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:_d("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));SP.displayName="TableHead";const CP=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:_d("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));CP.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:_d("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const kP=({columns:e,fetchData:r,itemsPerPage:o=10,emptyState:i={title:"No Items Found",description:"No items are currently available."},className:s,onRowClick:a})=>{const[l,c]=n.useState([]),[u,d]=n.useState(!1),[p,f]=n.useState(),[h,m]=n.useState(!0),[g,y]=n.useState(null),v=n.useRef(r);n.useEffect((()=>{v.current=r}),[r]);const b=n.useCallback((async e=>{try{d(!0),y(null);const t=await v.current({cursor:e,limit:o});if(!t.items)return;c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(DX){y(DX instanceof Error?DX.message:"An error occurred")}finally{d(!1)}}),[o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),b()}),[b]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):u&&0===l.length?t.jsx("div",{className:"flex items-center justify-center p-8 text-center",children:t.jsx(XC,{text:["Loading data","Please wait"]})}):t.jsxs("div",u||0!==l.length?{className:_d(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(vP,{children:[t.jsx(bP,{children:t.jsx(wP,{children:e.map((e=>t.jsx(SP,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(xP,{children:l.map(((n,r)=>t.jsx(wP,{onClick:()=>a?.(n),className:a?"cursor-pointer hover:bg-gray-50/50 transition-colors":"hover:bg-gray-50/50 transition-colors",children:e.map((e=>t.jsx(CP,{style:{width:e.width},children:e.cell?e.cell(n[e.accessorKey],n):n[e.accessorKey]||t.jsx("span",{className:"text-gray-400",children:"Not provided"})},String(e.accessorKey))))},r)))})]})}),t.jsx("div",{className:"mt-4 flex justify-center",children:h&&t.jsx("button",{onClick:()=>b(p),disabled:u,className:"rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50",children:u?"Loading...":"Load More"})})]}:{className:"flex flex-col items-center justify-center p-8 text-center",children:[i.icon&&t.jsx("div",{className:"mb-4",children:i.icon}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:i.title}),t.jsx("p",{className:"text-gray-500",children:i.description})]})},EP="reach-styles-module__container___6PQqs",_P=Vc(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),jP=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:_d(_P({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));jP.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(EP,e),...n}))).displayName="BadgeContainer";const TP=({status:e})=>{switch(e){case Oe.DRAFT:return t.jsx(jP,{variant:"secondary",children:"Draft"});case Oe.ACTIVE:return t.jsx(jP,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case Oe.RUNNING:return t.jsx(jP,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case Oe.COMPLETED:return t.jsx(jP,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case Oe.FAILED:return t.jsx(jP,{variant:"destructive",children:"Failed"});case Oe.DEACTIVATED:return t.jsx(jP,{variant:"destructive",children:"Cancelled"});default:hk(e,Oe)}},NP=n.memo((({status:e})=>{let n="bg-gray-400";switch(e){case Oe.ACTIVE:n="bg-green-500";break;case Oe.DRAFT:n="bg-gray-400";break;case Oe.DEACTIVATED:n="bg-red-500";break;case Oe.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})})),PP=n.memo((({status:e,searchQuery:n,onViewAutomation:r})=>t.jsx(kP,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(NP,{status:n.status}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-foreground",children:e}),t.jsx(TP,{status:n.status})]})]})},{header:"Stats",accessorKey:"emailsSent",width:"10%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-muted-foreground",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ZC.EmailIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.emailsSent||0})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ZC.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Sales",accessorKey:"derived_revenue",width:"15%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-4 text-muted-foreground",children:t.jsx("div",{className:"flex items-center gap-1",children:t.jsx("span",{children:yP(n.derived_revenue||0)})})})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-muted-foreground",children:r?gP(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:t,limit:r})=>{const o=await(async e=>{const t=new URLSearchParams;return e.cursor&&t.append("cursor",e.cursor),e.limit&&t.append("limit",e.limit.toString()),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search),(await Ee(`${l}?${t.toString()}`,{method:"GET"})).data})({cursor:t,limit:r,status:e,search:n||void 0});return{items:o.results,cursor:o.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-muted-foreground"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:e=>{r(e.id)},className:"rounded-lg bg-background"}))),DP=n.memo((({onCreateClick:e})=>t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(nk,{variant:"outline",onClick:e,children:[t.jsx(bu,{}),"Create New Automation"]})}))),MP=n.memo((({searchQuery:e,setSearchQuery:n})=>t.jsxs("div",{className:"relative",children:[t.jsx(xu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(mk,{placeholder:"Search automations...",value:e,onChange:e=>n(e.target.value),className:"focus-visible:ring-2 pl-9"})]}))),AP=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=wl(),c=bE(),[u,d]=n.useState(!1),p=n.useCallback((()=>{d(!0)}),[]),f=n.useMemo((()=>[{id:"all",label:"All",content:t.jsx(PP,{searchQuery:o,onViewAutomation:e})},{id:"active",label:"Active",content:t.jsx(PP,{status:"active",searchQuery:o,onViewAutomation:e})},{id:"draft",label:"Drafts",content:t.jsx(PP,{status:"draft",searchQuery:o,onViewAutomation:e})}]),[o,e]),h=n.useCallback((e=>{"error"===e?(l({title:"Error creating automation",description:"Please try again",variant:"destructive"}),d(!1)):!1===e?d(!1):c(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)}),[l,c]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(MP,{searchQuery:o,setSearchQuery:i}),t.jsx(DP,{onCreateClick:p})]}),t.jsx(o_,{tabs:f,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(wk,{open:u,setOpen:d,onClose:h,iconDefinitions:r})]})},OP=async e=>{const t=new URLSearchParams;e?.cursor&&t.append("cursor",e.cursor),e?.limit&&t.append("limit",e.limit.toString()),e?.search&&t.append("search",e.search);return(await Ee(`${a}${t.toString()?`?${t.toString()}`:""}`)).data};var RP=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e.Array="array",e.ReachResource="reach-resource",e))(RP||{}),LP=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(LP||{}),IP=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e.EQUALS_MONTH_DAY="equals_month_day",e.EQUALS_MONTH_DAY_YEAR="equals_month_day_year",e))(IP||{});const FP=()=>{const e=ae(),t=ge({mutationFn:e=>(async e=>(await Ee(a,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=me({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ee(`${a}/conditions`,{method:"GET"})).data)()});return{createSegment:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess,segmentsConditions:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchSegmentsConditions:n.refetch}},$P=e=>{const t=ae(),n=me({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ee(`${a}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{data:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchCount:()=>{t.invalidateQueries({queryKey:["automations","recipients","count",e]})}}},qP=e=>{const t=me({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ee(`${a}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},UP=e=>{const t=ae(),n=ge({mutationFn:t=>(async(e,t)=>t?(await Ee(`${a}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data:null)(t,e),onSuccess:()=>{t.invalidateQueries({queryKey:["segments",e]})}});return{updateSegment:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}};function zP(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function BP(e){const n=VP(e),r=i.forwardRef(((e,r)=>{const{children:o,...s}=e,a=i.Children.toArray(o),l=a.find(HP);if(l){const e=l.props.children,o=a.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(n,{...s,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,o):null})}return t.jsx(n,{...s,ref:r,children:o})}));return r.displayName=`${e}.Slot`,r}function VP(e){const t=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?function(...e){return t=>{let n=!1;const r=e.map((e=>{const r=zP(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():zP(e[t],null)}}}}(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var KP=Symbol("radix.slottable");function HP(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===KP}var WP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,n)=>{const r=BP(`Primitive.${n}`),o=i.forwardRef(((e,o)=>{const{asChild:i,...s}=e,a=i?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...s,ref:o})}));return o.displayName=`Primitive.${n}`,{...e,[n]:o}}),{}),GP=i.forwardRef(((e,n)=>t.jsx(WP.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));GP.displayName="Label";var YP=GP;const QP=Vc("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),XP=i.forwardRef((({className:e,...n},r)=>t.jsx(YP,{ref:r,className:_d(QP(),e),...n})));XP.displayName=YP.displayName;const JP={[IP.EQUALS]:"Equals",[IP.NOT_EQUALS]:"Not Equals",[IP.GREATER_THAN]:"Greater Than",[IP.LESS_THAN]:"Less Than",[IP.EXISTS]:"Exists",[IP.EQUALS_MONTH_DAY]:"Month and Day Matches",[IP.EQUALS_MONTH_DAY_YEAR]:"Month, Day, and Year Matches"},ZP={email:"Email",phone:"Phone",firstName:"First Name",lastName:"Last Name"};var eD=.999,tD=/[\\\/_+.#"@\[\(\{&]/,nD=/[\\\/_+.#"@\[\(\{&]/g,rD=/[\s-]/,oD=/[\s-]/g;function iD(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,p=r.charAt(i),f=n.indexOf(p,o),h=0;f>=0;)(l=iD(e,t,n,r,f+1,i+1,s))>h&&(f===o?l*=1:tD.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(nD))&&o>0&&(l*=Math.pow(eD,u.length))):rD.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(oD))&&o>0&&(l*=Math.pow(eD,d.length))):(l*=.17,o>0&&(l*=Math.pow(eD,f-o))),e.charAt(f)!==t.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(.1*(c=iD(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>h&&(h=l),f=n.indexOf(p,f+1);return s[a]=h,h}function sD(e){return e.toLowerCase().replace(oD," ")}function aD(e,t,n){return iD(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,sD(e),sD(t),0,0,{})}var lD,cD={exports:{}},uD={};var dD,pD={};
43
+ */(n.expires)||!Number.isFinite(n.expires.valueOf()))throw new TypeError(`option expires is invalid: ${n.expires}`);i+="; Expires="+n.expires.toUTCString()}n.httpOnly&&(i+="; HttpOnly");n.secure&&(i+="; Secure");n.partitioned&&(i+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():void 0){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${n.priority}`)}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:case"strict":i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"none":i+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${n.sameSite}`)}}return i};const Ck=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,kk=/^[\u0021-\u003A\u003C-\u007E]*$/,Ek=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,_k=/^[\u0020-\u003A\u003D-\u007E]*$/,jk=Object.prototype.toString,Tk=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Nk(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Pk(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Dk(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(PX){return e}}function Mk(e={}){let t,{initialEntries:n=["/"],initialIndex:r,v5Compat:o=!1}=e;t=n.map(((e,t)=>u(e,"string"==typeof e?null:e.state,0===t?"default":void 0)));let i=l(null==r?t.length-1:r),s="POP",a=null;function l(e){return Math.min(Math.max(e,0),t.length-1)}function c(){return t[i]}function u(e,n=null,r){let o=function(e,t,n=null,r){let o={pathname:"string"==typeof e?e:e.pathname,search:"",hash:"",..."string"==typeof t?Ik(t):t,state:n,key:t&&t.key||r||Rk()};return o}(t?c().pathname:"/",e,n,r);return Ok("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:Lk(e)}return{get index(){return i},get action(){return s},get location(){return c()},createHref:d,createURL:e=>new URL(d(e),"http://localhost"),encodeLocation(e){let t="string"==typeof e?Ik(e):e;return{pathname:t.pathname||"",search:t.search||"",hash:t.hash||""}},push(e,n){s="PUSH";let r=u(e,n);i+=1,t.splice(i,t.length,r),o&&a&&a({action:s,location:r,delta:1})},replace(e,n){s="REPLACE";let r=u(e,n);t[i]=r,o&&a&&a({action:s,location:r,delta:0})},go(e){s="POP";let n=l(i+e);i=n,a&&a({action:s,location:t[n],delta:e})},listen:e=>(a=e,()=>{a=null})}}function Ak(e,t){if(!1===e||null==e)throw new Error(t)}function Ok(e,t){if(!e)try{throw new Error(t)}catch(PX){}}function Rk(){return Math.random().toString(36).substring(2,10)}function Lk({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 Ik(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 Fk(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?Ik(t):t,i=Jk(o.pathname||"/",n);if(null==i)return null;let s=$k(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(s);let a=null;for(let l=0;null==a&&l<s.length;++l){let e=Xk(i);a=Yk(s[l],e,r)}return a}(e,t,n,!1)}function $k(e,t=[],n=[],r=""){let o=(e,o,i)=>{let s={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};s.relativePath.startsWith("/")&&(Ak(s.relativePath.startsWith(r),`Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),s.relativePath=s.relativePath.slice(r.length));let a=nE([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Ak(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),$k(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Gk(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of qk(e.path))o(e,t,n);else o(e,t)})),t}function qk(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(0===r.length)return o?[i,""]:[i];let s=qk(r.join("/")),a=[];return a.push(...s.map((e=>""===e?i:[i,e].join("/")))),o&&a.push(...s),a.map((t=>e.startsWith("/")&&""===t?"/":t))}var Uk=/^:[\w-]+$/,zk=3,Bk=2,Vk=1,Kk=10,Hk=-2,Wk=e=>"*"===e;function Gk(e,t){let n=e.split("/"),r=n.length;return n.some(Wk)&&(r+=Hk),t&&(r+=Bk),n.filter((e=>!Wk(e))).reduce(((e,t)=>e+(Uk.test(t)?zk:""===t?Vk:Kk)),r)}function Yk(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a<r.length;++a){let e=r[a],l=a===r.length-1,c="/"===i?t:t.slice(i.length)||"/",u=Qk({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=Qk({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:nE([i,u.pathname]),pathnameBase:rE(nE([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=nE([i,u.pathnameBase]))}return s}function Qk(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Ok("*"===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=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],s=i.replace(/(.)\/+$/,"$1"),a=o.slice(1);return{params:r.reduce(((e,{paramName:t,isOptional:n},r)=>{if("*"===t){s=i.slice(0,i.length-(a[r]||"").length).replace(/(.)\/+$/,"$1")}const o=a[r];return e[t]=n&&!o?void 0:(o||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:s,pattern:e}}function Xk(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Ok(!1,`The URL path "${e}" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Jk(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)||"/"}function Zk(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 eE(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,n)=>n===t.length-1?e.pathname:e.pathnameBase))}function tE(e,t,n,r=!1){let o;"string"==typeof e?o=Ik(e):(o={...e},Ak(!o.pathname||!o.pathname.includes("?"),Zk("?","pathname","search",o)),Ak(!o.pathname||!o.pathname.includes("#"),Zk("#","pathname","hash",o)),Ak(!o.search||!o.search.includes("#"),Zk("#","search","hash",o)));let i,s=""===e||""===o.pathname,a=s?"/":o.pathname;if(null==a)i=n;else{let e=t.length-1;if(!r&&a.startsWith("..")){let t=a.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=function(e,t="/"){let{pathname:n,search:r="",hash:o=""}="string"==typeof e?Ik(e):e,i=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:i,search:oE(r),hash:iE(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var nE=e=>e.join("/").replace(/\/\/+/g,"/"),rE=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),oE=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",iE=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var sE=["POST","PUT","PATCH","DELETE"];new Set(sE);var aE=["GET",...sE];new Set(aE);var lE=i.createContext(null);lE.displayName="DataRouter";var cE=i.createContext(null);cE.displayName="DataRouterState";var uE=i.createContext({isTransitioning:!1});uE.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var dE=i.createContext(null);dE.displayName="Navigation";var pE=i.createContext(null);pE.displayName="Location";var fE=i.createContext({outlet:null,matches:[],isDataRoute:!1});fE.displayName="Route";var hE=i.createContext(null);function mE(){return null!=i.useContext(pE)}function gE(){return Ak(mE(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(pE).location}hE.displayName="RouteError";var yE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function vE(e){i.useContext(dE).static||i.useLayoutEffect(e)}function bE(){let{isDataRoute:e}=i.useContext(fE);return e?function(){let{router:e}=function(e){let t=i.useContext(lE);return Ak(t,_E(e)),t}("useNavigate"),t=jE("useNavigate"),n=i.useRef(!1);return vE((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Ok(n.current,yE),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Ak(mE(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(lE),{basename:t,navigator:n}=i.useContext(dE),{matches:r}=i.useContext(fE),{pathname:o}=gE(),s=JSON.stringify(eE(r)),a=i.useRef(!1);return vE((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Ok(a.current,yE),!a.current)return;if("number"==typeof r)return void n.go(r);let l=tE(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:nE([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function xE(e,{relative:t}={}){let{matches:n}=i.useContext(fE),{pathname:r}=gE(),o=JSON.stringify(eE(n));return i.useMemo((()=>tE(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function wE(e,t,n,r){Ak(mE(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(dE),{matches:a}=i.useContext(fE),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",p=l&&l.route;{let e=p&&p.path||"";NE(u,!p||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${e}">) 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.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}o=gE();let f=o.pathname||"/",h=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Fk(e,{pathname:h});Ok(p||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Ok(null==m||void 0!==m[m.length-1].route.element||void 0!==m[m.length-1].route.Component||void 0!==m[m.length-1].route.lazy,`Matched leaf route at location "${o.pathname}${o.search}${o.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 g=function(e,t=[],n=null){if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,o=n?.errors;if(null!=o){let e=r.findIndex((e=>e.route.id&&void 0!==o?.[e.route.id]));Ak(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),r=r.slice(0,Math.min(r.length,e+1))}let s=!1,a=-1;if(n)for(let i=0;i<r.length;i++){let e=r[i];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(a=i),e.route.id){let{loaderData:t,errors:o}=n,i=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!o||void 0===o[e.route.id]);if(e.route.lazy||i){s=!0,r=a>=0?r.slice(0,a+1):[r[0]];break}}}return r.reduceRight(((e,l,c)=>{let u,d=!1,p=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,p=l.route.errorElement||CE,s&&(a<0&&0===c?(NE("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,f=null):a===c&&(d=!0,f=l.route.hydrateFallbackElement||null)));let h=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?p:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(EE,{match:l,routeContext:{outlet:e,matches:h,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(kE,{location:n.location,revalidation:n.revalidation,component:p,error:u,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:nE([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:nE([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function SE(){let e=function(){let e=i.useContext(hE),t=function(e){let t=i.useContext(cE);return Ak(t,_E(e)),t}("useRouteError"),n=jE("useRouteError");if(void 0!==e)return e;return t.errors?.[n]}(),t=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(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)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},a=null;return a=i.createElement(i.Fragment,null,i.createElement("p",null,"💿 Hey developer 👋"),i.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",i.createElement("code",{style:s},"ErrorBoundary")," or"," ",i.createElement("code",{style:s},"errorElement")," prop on your route.")),i.createElement(i.Fragment,null,i.createElement("h2",null,"Unexpected Application Error!"),i.createElement("h3",{style:{fontStyle:"italic"}},t),n?i.createElement("pre",{style:o},n):null,a)}i.createContext(null);var CE=i.createElement(SE,null),kE=class extends i.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||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){}render(){return void 0!==this.state.error?i.createElement(fE.Provider,{value:this.props.routeContext},i.createElement(hE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function EE({routeContext:e,match:t,children:n}){let r=i.useContext(lE);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(fE.Provider,{value:e},n)}function _E(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function jE(e){let t=function(e){let t=i.useContext(fE);return Ak(t,_E(e)),t}(e),n=t.matches[t.matches.length-1];return Ak(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var TE={};function NE(e,t,n){t||TE[e]||(TE[e]=!0,Ok(!1,n))}function PE({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Mk({initialEntries:n,initialIndex:r,v5Compat:!0}));let s=o.current,[a,l]=i.useState({action:s.action,location:s.location}),c=i.useCallback((e=>{i.startTransition((()=>l(e)))}),[l]);return i.useLayoutEffect((()=>s.listen(c)),[s,c]),i.createElement(DE,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function DE({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Ak(!mE(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let a=e.replace(/^\/*/,"/"),l=i.useMemo((()=>({basename:a,navigator:o,static:s,future:{}})),[a,o,s]);"string"==typeof n&&(n=Ik(n));let{pathname:c="/",search:u="",hash:d="",state:p=null,key:f="default"}=n,h=i.useMemo((()=>{let e=Jk(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:p,key:f},navigationType:r}}),[a,c,u,d,p,f,r]);return Ok(null!=h,`<Router basename="${a}"> is not able to match the URL "${c}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),null==h?null:i.createElement(dE.Provider,{value:l},i.createElement(pE.Provider,{children:t,value:h}))}i.memo((function({routes:e,future:t,state:n}){return wE(e,0,n,t)}));var ME="get",AE="application/x-www-form-urlencoded";function OE(e){return null!=e&&"string"==typeof e.tagName}function RE(e=""){return new URLSearchParams("string"==typeof e||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((e=>[n,e])):[[n,r]])}),[]))}var LE=null;var IE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function FE(e){return null==e||IE.has(e)?e:(Ok(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${AE}"`),null)}function $E(e,t){let n,r,o,i,s;if(function(e){return OE(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?Jk(s,t):null,n=e.getAttribute("method")||ME,o=FE(e.getAttribute("enctype"))||AE,i=new FormData(e)}else if(function(e){return OE(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return OE(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let a=e.getAttribute("formaction")||s.getAttribute("action");if(r=a?Jk(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||ME,o=FE(e.getAttribute("formenctype"))||FE(s.getAttribute("enctype"))||AE,i=new FormData(s,e),!function(){if(null===LE)try{new FormData(document.createElement("form"),0),LE=!1}catch(PX){LE=!0}return LE}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,r)}}else{if(OE(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ME,r=null,o=AE,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function qE(e,t){if(!1===e||null==e)throw new Error(t)}function UE(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function zE(e,t,n){return function(e,t){let n=new Set;return new Set(t),e.reduce(((e,t)=>{let r=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(t));return n.has(r)||(n.add(r),e.push({key:r,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let r=t.routes[e.route.id];if(r){let e=await async function(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 window.__reactRouterContext&&window,window.location.reload(),new Promise((()=>{}))}}(r,n);return e.links?e.links():[]}return[]})))).flat(1).filter(UE).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function BE(e,t,n,r,o,i){let s=(e,t)=>!n[t]||e.route.id!==n[t].route.id,a=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith("*")&&n[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>s(e,t)||a(e,t))):"data"===i?t.filter(((t,i)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(s(t,i)||a(t,i))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof r)return r}return!0})):[]}function VE(e,t){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let r=[n.module];return n.imports&&(r=r.concat(n.imports)),r})).flat(1),[...new Set(n)];var n}var KE=i.createContext(void 0);function HE(){let e=i.useContext(KE);return qE(e,"You must render this element inside a <HydratedRouter> element"),e}function WE(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function GE({page:e,...t}){let{router:n}=function(){let e=i.useContext(lE);return qE(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>Fk(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(YE,{page:e,matches:r,...t}):null}function YE({page:e,matches:t,...n}){let r=gE(),{manifest:o,routeModules:s}=HE(),{loaderData:a,matches:l}=function(){let e=i.useContext(cE);return qE(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>BE(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>BE(e,t,l,o,r,"assets")),[e,t,l,o,r]),d=i.useMemo((()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,i=!1;if(t.forEach((e=>{let t=o.routes[e.route.id];t&&t.hasLoader&&(!c.some((t=>t.route.id===e.route.id))&&e.route.id in a&&s[e.route.id]?.shouldRevalidate||t.hasClientLoader?i=!0:n.add(e.route.id))})),0===n.size)return[];let l=function(e){let t="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return t.pathname="/"===t.pathname?"_root.data":`${t.pathname.replace(/\/$/,"")}.data`,t}(e);return i&&n.size>0&&l.searchParams.set("_routes",t.filter((e=>n.has(e.route.id))).map((e=>e.route.id)).join(",")),[l.pathname+l.search]}),[a,r,o,c,t,e,s]),p=i.useMemo((()=>VE(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=HE(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return zE(e,t,n).then((e=>{r||o(e)})),()=>{r=!0}}),[e,t,n]),r}(u);return i.createElement(i.Fragment,null,d.map((e=>i.createElement("link",{key:e,rel:"prefetch",as:"fetch",href:e,...n}))),p.map((e=>i.createElement("link",{key:e,rel:"modulepreload",href:e,...n}))),f.map((({key:e,link:t})=>i.createElement("link",{key:e,...t}))))}function QE(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}KE.displayName="FrameworkContext";var XE="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{XE&&(window.__reactRouterVersion="7.1.0")}catch(PX){}var JE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ZE=i.forwardRef((function({onClick:e,discover:t="render",prefetch:n="none",relative:r,reloadDocument:o,replace:s,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d,...p},f){let h,{basename:m}=i.useContext(dE),g="string"==typeof c&&JE.test(c),y=!1;if("string"==typeof c&&g&&(h=c,XE))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=Jk(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:y=!0}catch(PX){Ok(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let v=function(e,{relative:t}={}){Ak(mE(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(dE),{hash:o,pathname:s,search:a}=xE(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:nE([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(KE),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:p}=t,f=i.useRef(null);i.useEffect((()=>{if("render"===e&&a(!0),"viewport"===e){let e=new IntersectionObserver((e=>{e.forEach((e=>{a(e.isIntersecting)}))}),{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}}),[e]),i.useEffect((()=>{if(r){let e=setTimeout((()=>{a(!0)}),100);return()=>{clearTimeout(e)}}}),[r]);let h=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:WE(l,h),onBlur:WE(c,m),onMouseEnter:WE(u,h),onMouseLeave:WE(d,m),onTouchStart:WE(p,h)}]:[!1,f,{}]}(n,p),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=bE(),c=gE(),u=xE(e,{relative:s});return i.useCallback((i=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(i,t)){i.preventDefault();let t=void 0!==n?n:Lk(c)===Lk(u);l(e,{replace:t,state:r,preventScrollReset:o,relative:s,viewTransition:a})}}),[c,l,u,n,r,t,e,o,s,a])}(c,{replace:s,state:a,target:l,preventScrollReset:u,relative:r,viewTransition:d});let C=i.createElement("a",{...p,...w,href:h||v,onClick:y||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:QE(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(GE,{page:v})):C}));function e_(e){let t=i.useContext(lE);return Ak(t,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(e)),t}function t_(e){Ok("undefined"!=typeof URLSearchParams,"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=i.useRef(RE(e)),n=i.useRef(!1),r=gE(),o=i.useMemo((()=>function(e,t){let n=RE(e);return t&&t.forEach(((e,r)=>{n.has(r)||t.getAll(r).forEach((e=>{n.append(r,e)}))})),n}(r.search,n.current?null:t.current)),[r.search]),s=bE(),a=i.useCallback(((e,t)=>{const r=RE("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}ZE.displayName="Link",i.forwardRef((function({"aria-current":e="page",caseSensitive:t=!1,className:n="",end:r=!1,style:o,to:s,viewTransition:a,children:l,...c},u){let d=xE(s,{relative:c.relative}),p=gE(),f=i.useContext(cE),{navigator:h,basename:m}=i.useContext(dE),g=null!=f&&function(e,t={}){let n=i.useContext(uE);Ak(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=e_("useViewTransitionState"),o=xE(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=Jk(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=Jk(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=Qk(o.pathname,a)||null!=Qk(o.pathname,s)}(d)&&!0===a,y=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,v=p.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(v=v.toLowerCase(),b=b?b.toLowerCase():null,y=y.toLowerCase()),b&&m&&(b=Jk(b,m)||b);const x="/"!==y&&y.endsWith("/")?y.length-1:y.length;let w,S=v===y||!r&&v.startsWith(y)&&"/"===v.charAt(x),C=null!=b&&(b===y||!r&&b.startsWith(y)&&"/"===b.charAt(y.length)),k={isActive:S,isPending:C,isTransitioning:g},E=S?e:void 0;w="function"==typeof n?n(k):[n,S?"active":null,C?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let _="function"==typeof o?o(k):o;return i.createElement(ZE,{...c,"aria-current":E,className:w,ref:u,style:_,to:s,viewTransition:a},"function"==typeof l?l(k):l)})).displayName="NavLink",i.forwardRef((({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:s,method:a=ME,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:p,...f},h)=>{let m=function(){let{router:e}=e_("useSubmit"),{basename:t}=i.useContext(dE),n=jE("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=$E(r,t);if(!1===o.navigate){let t=o.fetcherKey||r_();await e.fetch(t,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:l,body:c,formMethod:o.method||s,formEncType:o.encType||a,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})}),[e,t,n])}(),g=function(e,{relative:t}={}){let{basename:n}=i.useContext(dE),r=i.useContext(fE);Ak(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...xE(e||".",{relative:t})},a=gE();if(null==e){s.search=a.search;let e=new URLSearchParams(s.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let n=e.toString();s.search=n?`?${n}`:""}}e&&"."!==e||!o.route.index||(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(s.pathname="/"===s.pathname?n:nE([n,s.pathname]));return Lk(s)}(l,{relative:u}),y="get"===a.toLowerCase()?"get":"post",v="string"==typeof l&&JE.test(l);return i.createElement("form",{ref:h,method:y,action:g,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,i=r?.getAttribute("formmethod")||a;m(r||e.currentTarget,{fetcherKey:t,method:i,navigate:n,replace:o,state:s,relative:u,preventScrollReset:d,viewTransition:p})},...f,"data-discover":v||"render"!==e?void 0:"true"})})).displayName="Form";var n_=0,r_=()=>`__${String(++n_)}__`;new TextEncoder;const o_=({tabs:e,activeTab:r,onTabChange:o,tabsLocation:i="left",secondaryTabs:s=!1})=>{const a=n.useRef([]),[l,c]=n.useState({width:0,left:0});return n.useEffect((()=>{const t=a.current[e.findIndex((e=>e.id===r))];t&&c({width:t.offsetWidth,left:t.offsetLeft})}),[r,e]),t.jsxs("div",{className:"flex flex-col gap-4 w-full flex-1",children:[t.jsx("div",{className:"flex items-center justify-between border-b px-4",children:t.jsxs("div",{className:"relative flex items-center gap-8 "+("left"===i?"w-full justify-start":"w-full justify-center"),children:[t.jsx("div",{className:"absolute bottom-0 left-0 w-full h-[1px] bg-gray-100/50 rounded-full"}),t.jsx("div",{className:"absolute bottom-0 h-[1px] rounded-full transition-all duration-300 ease-out\n bg-gradient-to-r from-primary to-primary/90\n shadow-[0_0_8px_rgba(var(--primary-rgb),0.3)]",style:{width:`${l.width}px`,left:`${l.left}px`}}),e.map(((e,n)=>t.jsx("button",{ref:e=>a.current[n]=e,onClick:()=>o(e.id),className:Rm("relative px-1 py-3 transition-all duration-200",r!==e.id&&"text-muted-foreground",s&&"text-sm"),children:e.label},e.id)))]})}),t.jsx("div",{className:"relative min-h-40",children:e.map((n=>t.jsx("div",{className:"absolute w-full transition-all duration-500 ease-in-out transform \n "+(r===n.id?"translate-x-0 opacity-100 pointer-events-auto":(e.findIndex((e=>e.id===n.id))<e.findIndex((e=>e.id===r))?"translate-x-[-8%]":"translate-x-[8%]")+" opacity-0 pointer-events-none"),children:n.content},n.id)))})]})};function i_(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function s_(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const s=i.createContext(o),a=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[a]||s,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[a]||s);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},a_(o,...n)]}function a_(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var l_=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(d_);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(c_,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(c_,{...o,ref:n,children:r})}));l_.displayName="Slot";var c_=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n);return i.cloneElement(n,{...p_(r,n.props),ref:t?cf(t,e):e})}return i.Children.count(n)>1?i.Children.only(null):null}));c_.displayName="SlotClone";var u_=({children:e})=>t.jsx(t.Fragment,{children:e});function d_(e){return i.isValidElement(e)&&e.type===u_}function p_(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}var f_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?l_:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{});function h_(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}function m_(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}function g_(e,t=globalThis?.document){const n=m_(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}var y_,v_="dismissableLayer.update",b_="dismissableLayer.pointerDownOutside",x_="dismissableLayer.focusOutside",w_=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),S_=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(w_),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){k_(b_,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){k_(x_,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(y_=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),C_(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=y_)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),C_())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(v_,e),()=>document.removeEventListener(v_,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));S_.displayName="DismissableLayer";function C_(){const e=new CustomEvent(v_);document.dispatchEvent(e)}function k_(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(w_),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var E_=Boolean(globalThis?.document)?i.useLayoutEffect:()=>{},__=i["useId".toString()]||(()=>{}),j_=0;function T_(e){const[t,n]=i.useState(__());return E_((()=>{n((e=>e??String(j_++)))}),[e]),t?`radix-${t}`:""}const N_=["top","right","bottom","left"],P_=Math.min,D_=Math.max,M_=Math.round,A_=Math.floor,O_=e=>({x:e,y:e}),R_={left:"right",right:"left",bottom:"top",top:"bottom"},L_={start:"end",end:"start"};function I_(e,t,n){return D_(e,P_(t,n))}function F_(e,t){return"function"==typeof e?e(t):e}function $_(e){return e.split("-")[0]}function q_(e){return e.split("-")[1]}function U_(e){return"x"===e?"y":"x"}function z_(e){return"y"===e?"height":"width"}function B_(e){return["top","bottom"].includes($_(e))?"y":"x"}function V_(e){return U_(B_(e))}function K_(e){return e.replace(/start|end/g,(e=>L_[e]))}function H_(e){return e.replace(/left|right|bottom|top/g,(e=>R_[e]))}function W_(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function G_(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Y_(e,t,n){let{reference:r,floating:o}=e;const i=B_(t),s=V_(t),a=z_(s),l=$_(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(q_(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function Q_(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=F_(t,e),h=W_(f),m=a[p?"floating"===d?"reference":"floating":d],g=G_(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=G_(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function X_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function J_(e){return N_.some((t=>e[t]>=0))}function Z_(){return"undefined"!=typeof window}function ej(e){return rj(e)?(e.nodeName||"").toLowerCase():"#document"}function tj(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function nj(e){var t;return null==(t=(rj(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rj(e){return!!Z_()&&(e instanceof Node||e instanceof tj(e).Node)}function oj(e){return!!Z_()&&(e instanceof Element||e instanceof tj(e).Element)}function ij(e){return!!Z_()&&(e instanceof HTMLElement||e instanceof tj(e).HTMLElement)}function sj(e){return!(!Z_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof tj(e).ShadowRoot)}function aj(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function lj(e){return["table","td","th"].includes(ej(e))}function cj(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(PX){return!1}}))}function uj(e){const t=dj(),n=oj(e)?fj(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function dj(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function pj(e){return["html","body","#document"].includes(ej(e))}function fj(e){return tj(e).getComputedStyle(e)}function hj(e){return oj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mj(e){if("html"===ej(e))return e;const t=e.assignedSlot||e.parentNode||sj(e)&&e.host||nj(e);return sj(t)?t.host:t}function gj(e){const t=mj(e);return pj(t)?e.ownerDocument?e.ownerDocument.body:e.body:ij(t)&&aj(t)?t:gj(t)}function yj(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=gj(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=tj(o);if(i){const e=vj(s);return t.concat(s,s.visualViewport||[],aj(o)?o:[],e&&n?yj(e):[])}return t.concat(o,yj(o,[],n))}function vj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bj(e){const t=fj(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ij(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=M_(n)!==i||M_(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function xj(e){return oj(e)?e:e.contextElement}function wj(e){const t=xj(e);if(!ij(t))return O_(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=bj(t);let s=(i?M_(n.width):n.width)/r,a=(i?M_(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Sj=O_(0);function Cj(e){const t=tj(e);return dj()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Sj}function kj(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=xj(e);let s=O_(1);t&&(r?oj(r)&&(s=wj(r)):s=wj(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==tj(e))&&t}(i,n,r)?Cj(i):O_(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=tj(i),t=r&&oj(r)?tj(r):r;let n=e,o=vj(n);for(;o&&r&&t!==n;){const e=wj(o),t=o.getBoundingClientRect(),r=fj(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=tj(o),o=vj(n)}}return G_({width:u,height:d,x:l,y:c})}function Ej(e,t){const n=hj(e).scrollLeft;return t?t.left+n:kj(nj(e)).left+n}function _j(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Ej(e,r)),y:r.top+t.scrollTop}}function jj(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=tj(e),r=nj(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=dj();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=nj(e),n=hj(e),r=e.ownerDocument.body,o=D_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=D_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ej(e);const a=-n.scrollTop;return"rtl"===fj(r).direction&&(s+=D_(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(nj(e));else if(oj(t))r=function(e,t){const n=kj(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ij(e)?wj(e):O_(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Cj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return G_(r)}function Tj(e,t){const n=mj(e);return!(n===t||!oj(n)||pj(n))&&("fixed"===fj(n).position||Tj(n,t))}function Nj(e,t,n){const r=ij(t),o=nj(t),i="fixed"===n,s=kj(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=O_(0);if(r||!r&&!i)if(("body"!==ej(t)||aj(o))&&(a=hj(t)),r){const e=kj(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=Ej(o));const c=!o||r||i?O_(0):_j(o,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Pj(e){return"static"===fj(e).position}function Dj(e,t){if(!ij(e)||"fixed"===fj(e).position)return null;if(t)return t(e);let n=e.offsetParent;return nj(e)===n&&(n=n.ownerDocument.body),n}function Mj(e,t){const n=tj(e);if(cj(e))return n;if(!ij(e)){let t=mj(e);for(;t&&!pj(t);){if(oj(t)&&!Pj(t))return t;t=mj(t)}return n}let r=Dj(e,t);for(;r&&lj(r)&&Pj(r);)r=Dj(r,t);return r&&pj(r)&&Pj(r)&&!uj(r)?n:r||function(e){let t=mj(e);for(;ij(t)&&!pj(t);){if(uj(t))return t;if(cj(t))return null;t=mj(t)}return null}(e)||n}const Aj={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=nj(r),a=!!t&&cj(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=O_(1);const u=O_(0),d=ij(r);if((d||!d&&!i)&&(("body"!==ej(r)||aj(s))&&(l=hj(r)),ij(r))){const e=kj(r);c=wj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const p=!s||d||i?O_(0):_j(s,l,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:nj,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?cj(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=yj(e,[],!1).filter((e=>oj(e)&&"body"!==ej(e))),o=null;const i="fixed"===fj(e).position;let s=i?mj(e):e;for(;oj(s)&&!pj(s);){const t=fj(s),n=uj(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||aj(s)&&!n&&Tj(e,s))?r=r.filter((e=>e!==s)):o=t,s=mj(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=jj(t,n,o);return e.top=D_(r.top,e.top),e.right=P_(r.right,e.right),e.bottom=P_(r.bottom,e.bottom),e.left=D_(r.left,e.left),e}),jj(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Mj,getElementRects:async function(e){const t=this.getOffsetParent||Mj,n=this.getDimensions,r=await n(e.floating);return{reference:Nj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=bj(e);return{width:t,height:n}},getScale:wj,isElement:oj,isRTL:function(e){return"rtl"===fj(e).direction}};function Oj(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=xj(e),u=o||i?[...c?yj(c):[],...yj(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=nj(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-A_(u)+"px "+-A_(o.clientWidth-(c+d))+"px "+-A_(o.clientHeight-(u+p))+"px "+-A_(c)+"px",threshold:D_(0,P_(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(PX){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?kj(e):null;return l&&function t(){const r=kj(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Rj=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=$_(n),a=q_(n),l="y"===B_(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=F_(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Lj=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=F_(e,t),c={x:n,y:r},u=await Q_(t,l),d=B_($_(o)),p=U_(d);let f=c[p],h=c[d];if(i){f=I_(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(s){h=I_(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:i,[d]:s}}}}}},Ij=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=F_(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=$_(o),v=B_(a),b=$_(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[H_(a)]:function(e){const t=H_(e);return[K_(e),t,K_(t)]}(a)),S="none"!==h;!p&&S&&w.push(...function(e,t,n,r){const o=q_(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}($_(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(K_)))),i}(a,m,h,x));const C=[a,...w],k=await Q_(t,g),E=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=q_(e),o=V_(e),i=z_(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=H_(s)),[s,H_(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(_=[..._,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,T;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(T=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=_.filter((e=>{if(S){const t=B_(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Fj=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=F_(e,t),u=await Q_(t,c),d=$_(o),p=q_(o),f="y"===B_(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=p===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,g="end"===p?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right;let x=P_(m-u[g],v),w=P_(h-u[y],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=v),!t.middlewareData.shift&&!p){const e=D_(u.left,0),t=D_(u.right,0),n=D_(u.top,0),r=D_(u.bottom,0);f?w=h-2*(0!==e||0!==t?e+t:D_(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:D_(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return h!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},$j=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=F_(e,t);switch(r){case"referenceHidden":{const e=X_(await Q_(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:J_(e)}}}case"escaped":{const e=X_(await Q_(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:J_(e)}}}default:return{}}}}},qj=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=F_(e,t)||{};if(null==c)return{};const d=W_(u),p={x:n,y:r},f=V_(o),h=z_(f),m=await s.getDimensions(c),g="y"===f,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[h]);const k=x/2-w/2,E=C/2-m[h]/2-1,_=P_(d[y],E),j=P_(d[v],E),T=_,N=C-m[h]-j,P=C/2-m[h]/2+k,D=I_(T,P,N),M=!l.arrow&&null!=q_(o)&&P!==D&&i.reference[h]/2-(P<T?_:j)-m[h]/2<0,A=M?P<T?P-T:P-N:0;return{[f]:p[f]+A,data:{[f]:D,centerOffset:P-D-A,...M&&{alignmentOffset:A}},reset:M}}}),Uj=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=F_(e,t),u={x:n,y:r},d=B_(o),p=U_(d);let f=u[p],h=u[d];const m=F_(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var y,v;const e="y"===p?"width":"height",t=["top","left"].includes($_(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=s.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(v=s.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},zj=(e,t,n)=>{const r={platform:Aj,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Y_(c,r,l),p=r,f={},h=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Y_(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var Bj="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Vj(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Vj(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Vj(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Kj(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hj(e,t){const n=Kj(e);return Math.round(t*n)/n}function Wj(e){const t=i.useRef(e);return Bj((()=>{t.current=e})),t}function Gj(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[p,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=i.useState(r);Vj(h,r)||m(r);const[g,y]=i.useState(null),[v,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,y(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||v,k=i.useRef(null),E=i.useRef(null),_=i.useRef(p),j=null!=u,T=Wj(u),N=Wj(o),P=Wj(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),zj(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};M.current&&!Vj(_.current,t)&&(_.current=t,s.flushSync((()=>{f(t)})))}))}),[h,t,n,N,P]);Bj((()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);Bj((()=>(M.current=!0,()=>{M.current=!1})),[]),Bj((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(T.current)return T.current(S,C,D);D()}}),[S,C,D,T,j]);const A=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),O=i.useMemo((()=>({reference:S,floating:C})),[S,C]),R=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Hj(O.floating,p.x),r=Hj(O.floating,p.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Kj(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,O.floating,p.x,p.y]);return i.useMemo((()=>({...p,update:D,refs:A,elements:O,floatingStyles:R})),[p,D,A,O,R])}const Yj=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&{}.hasOwnProperty.call(n,"current")?null!=n.current?qj({element:n.current,padding:r}).fn(t):{}:n?qj({element:n,padding:r}).fn(t):{}}}),Qj=(e,t)=>({...Rj(e),options:[e,t]}),Xj=(e,t)=>({...Lj(e),options:[e,t]}),Jj=(e,t)=>({...Uj(e),options:[e,t]}),Zj=(e,t)=>({...Ij(e),options:[e,t]}),eT=(e,t)=>({...Fj(e),options:[e,t]}),tT=(e,t)=>({...$j(e),options:[e,t]}),nT=(e,t)=>({...Yj(e),options:[e,t]});var rT=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(f_.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));rT.displayName="Arrow";var oT=rT;function iT(e){const[t,n]=i.useState(void 0);return E_((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var sT="Popper",[aT,lT]=s_(sT),[cT,uT]=aT(sT),dT=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(cT,{scope:n,anchor:o,onAnchorChange:s,children:r})};dT.displayName=sT;var pT="PopperAnchor",fT=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=uT(pT,r),l=i.useRef(null),c=uf(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(f_.div,{...s,ref:c})}));fT.displayName=pT;var hT="PopperContent",[mT,gT]=aT(hT),yT=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,v=uT(hT,r),[b,x]=i.useState(null),w=uf(n,(e=>x(e))),[S,C]=i.useState(null),k=iT(S),E=k?.width??0,_=k?.height??0,j=o+("center"!==a?"-"+a:""),T="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],P=N.length>0,D={padding:T,boundary:N.filter(wT),altBoundary:P},{refs:M,floatingStyles:A,placement:O,isPositioned:R,middlewareData:L}=Gj({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Oj(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[Qj({mainAxis:s+_,alignmentAxis:l}),u&&Xj({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Jj():void 0,...D}),u&&Zj({...D}),eT({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&nT({element:S,padding:c}),ST({arrowWidth:E,arrowHeight:_}),h&&tT({strategy:"referenceHidden",...D})]}),[I,F]=CT(O),$=m_(g);E_((()=>{R&&$?.()}),[R,$]);const q=L.arrow?.x,U=L.arrow?.y,z=0!==L.arrow?.centerOffset,[B,V]=i.useState();return E_((()=>{b&&V(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:R?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(mT,{scope:r,placedSide:I,onArrowChange:C,arrowX:q,arrowY:U,shouldHideArrow:z,children:t.jsx(f_.div,{"data-side":I,"data-align":F,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));yT.displayName=hT;var vT="PopperArrow",bT={top:"bottom",right:"left",bottom:"top",left:"right"},xT=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=gT(vT,r),s=bT[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(oT,{...o,ref:n,style:{...o.style,display:"block"}})})}));function wT(e){return null!==e}xT.displayName=vT;var ST=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=CT(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+a/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-a+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+a}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function CT(e){const[t,n="center"]=e.split("-");return[t,n]}var kT=dT,ET=fT,_T=yT,jT=xT,TT=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);E_((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(f_.div,{...s,ref:n}),c):null}));TT.displayName="Portal";var NT=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=i.useState(),r=i.useRef({}),o=i.useRef(e),s=i.useRef("none"),a=e?"mounted":"unmounted",[l,c]=function(e,t){return i.useReducer(((e,n)=>t[e][n]??e),e)}(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect((()=>{const e=PT(r.current);s.current="mounted"===l?e:"none"}),[l]),E_((()=>{const t=r.current,n=o.current;if(n!==e){const r=s.current,i=PT(t);if(e)c("MOUNT");else if("none"===i||"none"===t?.display)c("UNMOUNT");else{c(n&&r!==i?"ANIMATION_OUT":"UNMOUNT")}o.current=e}}),[e,c]),E_((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,i=i=>{const s=PT(r.current).includes(i.animationName);if(i.target===t&&s&&(c("ANIMATION_END"),!o.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(s.current=PT(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")}),[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback((e=>{e&&(r.current=getComputedStyle(e)),n(e)}),[])}}(t),o="function"==typeof n?n({present:r.isPresent}):i.Children.only(n),s=uf(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(o));return"function"==typeof n||r.isPresent?i.cloneElement(o,{ref:s}):null};function PT(e){return e?.animationName||"none"}function DT({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=function({defaultProp:e,onChange:t}){const n=i.useState(e),[r]=n,o=i.useRef(r),s=m_(t);return i.useEffect((()=>{o.current!==r&&(s(r),o.current=r)}),[r,o,s]),n}({defaultProp:t,onChange:n}),s=void 0!==e,a=s?e:r,l=m_(n);return[a,i.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)}),[s,e,o,l])]}NT.displayName="Presence";var MT=i.forwardRef(((e,n)=>t.jsx(f_.span,{...e,ref:n,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));MT.displayName="VisuallyHidden";var AT=MT,[OT,RT]=s_("Tooltip",[lT]),LT=lT(),IT="TooltipProvider",FT=700,$T="tooltip.open",[qT,UT]=OT(IT),zT=e=>{const{__scopeTooltip:n,delayDuration:r=FT,skipDelayDuration:o=300,disableHoverableContent:s=!1,children:a}=e,[l,c]=i.useState(!0),u=i.useRef(!1),d=i.useRef(0);return i.useEffect((()=>{const e=d.current;return()=>window.clearTimeout(e)}),[]),t.jsx(qT,{scope:n,isOpenDelayed:l,delayDuration:r,onOpen:i.useCallback((()=>{window.clearTimeout(d.current),c(!1)}),[]),onClose:i.useCallback((()=>{window.clearTimeout(d.current),d.current=window.setTimeout((()=>c(!0)),o)}),[o]),isPointerInTransitRef:u,onPointerInTransitChange:i.useCallback((e=>{u.current=e}),[]),disableHoverableContent:s,children:a})};zT.displayName=IT;var BT="Tooltip",[VT,KT]=OT(BT),HT=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=UT(BT,e.__scopeTooltip),d=LT(n),[p,f]=i.useState(null),h=T_(),m=i.useRef(0),g=l??u.disableHoverableContent,y=c??u.delayDuration,v=i.useRef(!1),[b=!1,x]=DT({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent($T))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?v.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,v.current=!1,x(!0)}),[x]),C=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,x(!1)}),[x]),k=i.useCallback((()=>{window.clearTimeout(m.current),m.current=window.setTimeout((()=>{v.current=!0,x(!0),m.current=0}),y)}),[y,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(kT,{...d,children:t.jsx(VT,{scope:n,contentId:h,open:b,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:i.useCallback((()=>{u.isOpenDelayed?k():S()}),[u.isOpenDelayed,k,S]),onTriggerLeave:i.useCallback((()=>{g?C():(window.clearTimeout(m.current),m.current=0)}),[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:r})})};HT.displayName=BT;var WT="TooltipTrigger",GT=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=KT(WT,r),a=UT(WT,r),l=LT(r),c=uf(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),p=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",p)),[p]),t.jsx(ET,{asChild:!0,...l,children:t.jsx(f_.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:i_(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:i_(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:i_(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",p,{once:!0})})),onFocus:i_(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:i_(e.onBlur,s.onClose),onClick:i_(e.onClick,s.onClose)})})}));GT.displayName=WT;var YT="TooltipPortal",[QT,XT]=OT(YT,{forceMount:void 0}),JT=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=KT(YT,n);return t.jsx(QT,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};JT.displayName=YT;var ZT="TooltipContent",eN=i.forwardRef(((e,n)=>{const r=XT(ZT,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=KT(ZT,e.__scopeTooltip);return t.jsx(NT,{present:o||a.open,children:t.jsx(a.disableHoverableContent?oN:tN,{side:i,...s,ref:n})})})),tN=i.forwardRef(((e,n)=>{const r=KT(ZT,e.__scopeTooltip),o=UT(ZT,e.__scopeTooltip),s=i.useRef(null),a=uf(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,p=s.current,{onPointerInTransitChange:f}=o,h=i.useCallback((()=>{c(null),f(!1)}),[f]),m=i.useCallback(((e,t)=>{const n={x:e.clientX,y:e.clientY},r=function(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})}return r}(n,function(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}(n,e.currentTarget.getBoundingClientRect())),o=function(e){const t=e.slice();return t.sort(((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0)),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const t=e[r];for(;n.length>=2;){const e=n[n.length-1],r=n[n.length-2];if(!((e.x-r.x)*(t.y-r.y)>=(e.y-r.y)*(t.x-r.x)))break;n.pop()}n.push(t)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}(t.getBoundingClientRect())]);c(o),f(!0)}),[f]);return i.useEffect((()=>()=>h()),[h]),i.useEffect((()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}}),[u,p,m,h]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||p?.contains(t),o=!function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,l);r?h():o&&(h(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,p,l,d,h]),t.jsx(oN,{...e,ref:a})})),[nN,rN]=OT(BT,{isInside:!1}),oN=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=KT(ZT,r),d=LT(r),{onClose:p}=u;return i.useEffect((()=>(document.addEventListener($T,p),()=>document.removeEventListener($T,p))),[p]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,p]),t.jsx(S_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(_T,{"data-state":u.stateAttribute,...d,...c,ref:n,style:{...c.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:[t.jsx(u_,{children:o}),t.jsx(nN,{scope:r,isInside:!0,children:t.jsx(AT,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));eN.displayName=ZT;var iN="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=LT(r);return rN(iN,r).isInside?null:t.jsx(jT,{...i,...o,ref:n})})).displayName=iN;var sN=JT,aN=eN;const lN=zT,cN=HT,uN=GT,dN=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(sN,{children:t.jsx(aN,{ref:o,sideOffset:n,className:_d("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out 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",e),...r})})));dN.displayName=aN.displayName;const pN=({title:e,alertText:n,Icon:r=cu,onClick:o})=>t.jsx(lN,{children:t.jsxs(cN,{children:[t.jsx(uN,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(dN,{className:"text-center",children:t.jsxs("div",{className:"flex flex-col items-center gap-2 max-w-[300px]",children:[n&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bg-amber-500/10 p-2 rounded-full",children:t.jsx("svg",{className:"w-5 h-5 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),t.jsx("p",{className:"font-semibold text-amber-500",children:n})]}),t.jsx("p",{className:"text-[13px] leading-relaxed text-primary-foreground/90",children:e})]})})]})}),fN=({icon:e,title:n,value:r,tooltipText:o})=>t.jsx("div",{className:"flex items-center bg-white rounded p-3 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md",children:t.jsxs("div",{className:"flex items-start text-sm leading-none gap-3",children:[t.jsx("div",{className:"rounded-lg p-2 bg-gray-100",children:e}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:"flex items-center text-muted-foreground gap-1",children:[t.jsx("span",{className:"text-[11px]",children:n}),t.jsx(pN,{title:o})]}),t.jsx("span",{children:r})]})]})}),hN=({activeTab:e,statistics:n,iconDefinitions:r})=>{const o={email:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"Emails Sent",value:n.email.numberSent,tooltipText:"Total number of emails that were successfully sent in this campaign"},{icon:t.jsx(r.OpenRate,{className:"w-4 h-4"}),title:"Open Rate",value:`${(100*n.email.openPercentage).toFixed(2)}%`,tooltipText:"Percentage of recipients who opened the email out of total emails delivered"},{icon:t.jsx(r.TotalBounceRate,{className:"w-4 h-4"}),title:"Total Bounce Rate",value:`${(100*(n.email.softBounceRate+n.email.hardBounceRate)).toFixed(2)}%`,tooltipText:"Percentage of emails that were not delivered due to permanent (hard) or temporary (soft) delivery failures"},{icon:t.jsx(r.LinksClicked,{className:"w-4 h-4"}),title:"Links Clicked",value:n.email.linksClicked,tooltipText:"Total number of times recipients clicked on links within the email"},{icon:t.jsx(r.SpamComplies,{className:"w-4 h-4"}),title:"Spam Complaints",value:`${(100*n.email.spamComplaintRate).toFixed(2)}%`,tooltipText:"Percentage of recipients who marked this email as spam"},{icon:t.jsx(r.UnsubscribeRate,{className:"w-4 h-4"}),title:"Unsubscribe Rate",value:`${(100*n.email.unsubscribedRate).toFixed(2)}%`,tooltipText:"Percentage of recipients who unsubscribed after receiving this email"}],sms:[{icon:t.jsx(r.MessagesSent,{className:"w-4 h-4"}),title:"SMS Sent",value:n.sms.numberSent,tooltipText:"Total number of SMS messages that were successfully sent in this campaign"}]};return t.jsx("div",{className:"grid gap-2 transition-all duration-300 grid-cols-3",children:o[e].map(((e,n)=>t.jsx(fN,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},mN=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=De(e);if(a||!s)return t.jsx("div",{className:"bg-white rounded-2xl w-full p-6 space-y-4 relative h-[14.05rem]",children:t.jsx(XC,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(o_,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(hN,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(hN,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function gN(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function yN(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const vN=6048e5,bN=43200;let xN={};function wN(){return xN}function SN(e,t){const n=wN(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=gN(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function CN(e){return SN(e,{weekStartsOn:1})}function kN(e){const t=gN(e),n=t.getFullYear(),r=yN(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=CN(r),i=yN(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=CN(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function EN(e){const t=gN(e);return t.setHours(0,0,0,0),t}function _N(e){const t=gN(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 jN(e,t){return function(e,t){return yN(e,+gN(e)+t)}(e,6e4*t)}function TN(e,t){const n=gN(e),r=gN(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function NN(e){if(!(t=e,t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)||"number"==typeof e))return!1;var t;const n=gN(e);return!isNaN(Number(n))}function PN(e){const t=gN(e);return+function(e){const t=gN(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=gN(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function DN(e,t){const n=gN(e),r=gN(t),o=TN(n,r),i=Math.abs(function(e,t){const n=gN(e),r=gN(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}(n,r));let s;if(i<1)s=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-o*i);let t=TN(n,r)===-o;PN(gN(e))&&1===i&&1===TN(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function MN(e,t,n){const r=function(e,t){return+gN(e)-+gN(t)}(e,t)/1e3;return(o=n?.roundingMethod,e=>{const t=(o?Math[o]:Math.trunc)(e);return 0===t?0:t})(r);var o}const AN={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"}};function ON(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const RN={date:ON({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ON({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ON({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},LN={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function IN(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function FN(e){return(t,n={})=>{const r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],a=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,(e=>e.test(i))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,(e=>e.test(i)));let l;l=e.valueCallback?e.valueCallback(a):a,l=n.valueCallback?n.valueCallback(l):l;return{value:l,rest:t.slice(i.length)}}}var $N;const qN={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=AN[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:RN,formatRelative:(e,t,n,r)=>LN[e],localize:{ordinalNumber:(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"},era:IN({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:IN({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:IN({values:{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"]},defaultWidth:"wide"}),day:IN({values:{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"]},defaultWidth:"wide"}),dayPeriod:IN({values:{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"}},defaultWidth:"wide",formattingValues:{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"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:($N={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match($N.matchPattern);if(!n)return null;const r=n[0],o=e.match($N.parsePattern);if(!o)return null;let i=$N.valueCallback?$N.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:FN({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),day:FN({matchPatterns:{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},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:FN({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function UN(e){const t=gN(e),n=function(e,t){const n=EN(e),r=EN(t),o=+n-_N(n),i=+r-_N(r);return Math.round((o-i)/864e5)}(t,function(e){const t=gN(e),n=yN(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function zN(e){const t=gN(e),n=+CN(t)-+function(e){const t=kN(e),n=yN(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),CN(n)}(t);return Math.round(n/vN)+1}function BN(e,t){const n=gN(e),r=n.getFullYear(),o=wN(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=yN(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=SN(s,t),l=yN(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=SN(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function VN(e,t){const n=gN(e),r=+SN(n,t)-+function(e,t){const n=wN(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=BN(e,t),i=yN(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),SN(i,t)}(n,t);return Math.round(r/vN)+1}function KN(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const HN={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return KN("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):KN(n+1,2)},d:(e,t)=>KN(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];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>KN(e.getHours()%12||12,t.length),H:(e,t)=>KN(e.getHours(),t.length),m:(e,t)=>KN(e.getMinutes(),t.length),s:(e,t)=>KN(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return KN(Math.trunc(r*Math.pow(10,n-3)),t.length)}},WN="midnight",GN="noon",YN="morning",QN="afternoon",XN="evening",JN="night",ZN={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"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear();return n.ordinalNumber(t>0?t:1-t,{unit:"year"})}return HN.y(e,t)},Y:function(e,t,n,r){const o=BN(e,r),i=o>0?o:1-o;if("YY"===t){return KN(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):KN(i,t.length)},R:function(e,t){return KN(kN(e),t.length)},u:function(e,t){return KN(e.getFullYear(),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 KN(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"});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 KN(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"});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 HN.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"});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 KN(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"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=VN(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):KN(o,t.length)},I:function(e,t,n){const r=zN(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):KN(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):HN.d(e,t)},D:function(e,t,n){const r=UN(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):KN(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"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return KN(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return KN(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return KN(o,t.length);case"io":return n.ordinalNumber(o,{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"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?GN:0===r?WN:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?XN:r>=12?QN:r>=4?YN:JN,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return HN.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):HN.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):KN(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):KN(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):HN.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):HN.s(e,t)},S:function(e,t){return HN.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return tP(r);case"XXXX":case"XX":return nP(r);default:return nP(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return tP(r);case"xxxx":case"xx":return nP(r);default:return nP(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eP(r,":");default:return"GMT"+nP(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eP(r,":");default:return"GMT"+nP(r,":")}},t:function(e,t,n){return KN(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return KN(e.getTime(),t.length)}};function eP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+KN(i,2)}function tP(e,t){if(e%60==0){return(e>0?"-":"+")+KN(Math.abs(e)/60,2)}return nP(e,t)}function nP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+KN(Math.trunc(r/60),2)+t+KN(r%60,2)}const rP=(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"});default:return t.date({width:"full"})}},oP=(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"});default:return t.time({width:"full"})}},iP={p:oP,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return rP(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",rP(r,t)).replace("{{time}}",oP(o,t))}},sP=/^D+$/,aP=/^Y+$/,lP=["D","DD","YY","YYYY"];const cP=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uP=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dP=/^'([^]*?)'?$/,pP=/''/g,fP=/[a-zA-Z]/;function hP(e,t,n){const r=wN(),o=r.locale??qN,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=gN(e);if(!NN(a))throw new RangeError("Invalid time value");let l=t.match(uP).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,iP[t])(e,o.formatLong)}return e})).join("").match(cP).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:mP(e)};if(ZN[t])return{isToken:!0,value:e};if(t.match(fP))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((n=>{if(!n.isToken)return n.value;const r=n.value;(function(e){return aP.test(e)}(r)||function(e){return sP.test(e)}(r))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"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`}(e,t,n);if(lP.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,ZN[r[0]])(a,r,o.localize,c)})).join("")}function mP(e){const t=e.match(dP);return t?t[1].replace(pP,"'"):e}function gP(e,t){return function(e,t,n){const r=wN(),o=n?.locale??r.locale??qN,i=TN(e,t);if(isNaN(i))throw new RangeError("Invalid time value");const s=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:i});let a,l;i>0?(a=gN(t),l=gN(e)):(a=gN(e),l=gN(t));const c=MN(l,a),u=(_N(l)-_N(a))/1e3,d=Math.round((c-u)/60);let p;if(d<2)return n?.includeSeconds?c<5?o.formatDistance("lessThanXSeconds",5,s):c<10?o.formatDistance("lessThanXSeconds",10,s):c<20?o.formatDistance("lessThanXSeconds",20,s):c<40?o.formatDistance("halfAMinute",0,s):o.formatDistance(c<60?"lessThanXMinutes":"xMinutes",1,s):0===d?o.formatDistance("lessThanXMinutes",1,s):o.formatDistance("xMinutes",d,s);if(d<45)return o.formatDistance("xMinutes",d,s);if(d<90)return o.formatDistance("aboutXHours",1,s);if(d<1440){const e=Math.round(d/60);return o.formatDistance("aboutXHours",e,s)}if(d<2520)return o.formatDistance("xDays",1,s);if(d<bN){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return p=Math.round(d/bN),o.formatDistance("aboutXMonths",p,s);if(p=DN(l,a),p<12){const e=Math.round(d/bN);return o.formatDistance("xMonths",e,s)}{const e=p%12,t=Math.trunc(p/12);return e<3?o.formatDistance("aboutXYears",t,s):e<9?o.formatDistance("overXYears",t,s):o.formatDistance("almostXYears",t+1,s)}}(e,function(e){return yN(e,Date.now())}(e),t)}const yP=e=>{if(!e)return"$0.00";const t="string"==typeof e?e.replace(/,/g,""):e,n=Number(t);return Number.isNaN(n)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(n)},vP=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:_d("w-full caption-bottom text-sm",e),...n})})));vP.displayName="Table";const bP=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:_d("[&_tr]:border-b",e),...n})));bP.displayName="TableHeader";const xP=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:_d("[&_tr:last-child]:border-0",e),...n})));xP.displayName="TableBody";const wP=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:_d("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));wP.displayName="TableRow";const SP=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:_d("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));SP.displayName="TableHead";const CP=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:_d("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));CP.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:_d("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const kP=({columns:e,fetchData:r,itemsPerPage:o=10,emptyState:i={title:"No Items Found",description:"No items are currently available."},className:s,onRowClick:a})=>{const[l,c]=n.useState([]),[u,d]=n.useState(!1),[p,f]=n.useState(),[h,m]=n.useState(!0),[g,y]=n.useState(null),v=n.useRef(r);n.useEffect((()=>{v.current=r}),[r]);const b=n.useCallback((async e=>{try{d(!0),y(null);const t=await v.current({cursor:e,limit:o});if(!t.items)return;c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(DX){y(DX instanceof Error?DX.message:"An error occurred")}finally{d(!1)}}),[o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),b()}),[b]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):u&&0===l.length?t.jsx("div",{className:"flex items-center justify-center p-8 text-center",children:t.jsx(XC,{text:["Loading data","Please wait"]})}):t.jsxs("div",u||0!==l.length?{className:_d(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(vP,{children:[t.jsx(bP,{children:t.jsx(wP,{children:e.map((e=>t.jsx(SP,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(xP,{children:l.map(((n,r)=>t.jsx(wP,{onClick:()=>a?.(n),className:a?"cursor-pointer hover:bg-gray-50/50 transition-colors":"hover:bg-gray-50/50 transition-colors",children:e.map((e=>t.jsx(CP,{style:{width:e.width},children:e.cell?e.cell(n[e.accessorKey],n):n[e.accessorKey]||t.jsx("span",{className:"text-gray-400",children:"Not provided"})},String(e.accessorKey))))},r)))})]})}),t.jsx("div",{className:"mt-4 flex justify-center",children:h&&t.jsx("button",{onClick:()=>b(p),disabled:u,className:"rounded-lg bg-white px-4 py-2 text-sm font-medium text-gray-700 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50 disabled:opacity-50",children:u?"Loading...":"Load More"})})]}:{className:"flex flex-col items-center justify-center p-8 text-center",children:[i.icon&&t.jsx("div",{className:"mb-4",children:i.icon}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:i.title}),t.jsx("p",{className:"text-gray-500",children:i.description})]})},EP="reach-styles-module__container___6PQqs",_P=Vc(["reach-styles-module__base___WFahB"],{variants:{variant:{default:"reach-styles-module__default___zeGU1",secondary:"reach-styles-module__secondary___VQ4iH",destructive:"reach-styles-module__destructive___RLaRD",outline:"reach-styles-module__outline___L2VtW",google:"reach-styles-module__google___HcEij",date:"reach-styles-module__date___-6BC4"},size:{default:"reach-styles-module__sizeDefault___iGTp4",sm:"reach-styles-module__sizeSm___6T2oK"},iconOnly:{true:"reach-styles-module__iconOnly___8vUSp",false:""}},compoundVariants:[{iconOnly:!0,size:"sm",class:"reach-styles-module__iconOnlySm___9ZKv9"}],defaultVariants:{variant:"default",size:"default",iconOnly:!1}}),jP=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:_d(_P({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));jP.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(EP,e),...n}))).displayName="BadgeContainer";const TP=({status:e})=>{switch(e){case Oe.DRAFT:return t.jsx(jP,{variant:"secondary",children:"Draft"});case Oe.ACTIVE:return t.jsx(jP,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case Oe.RUNNING:return t.jsx(jP,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case Oe.COMPLETED:return t.jsx(jP,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case Oe.FAILED:return t.jsx(jP,{variant:"destructive",children:"Failed"});case Oe.DEACTIVATED:return t.jsx(jP,{variant:"destructive",children:"Cancelled"});default:hk(e,Oe)}},NP=n.memo((({status:e})=>{let n="bg-gray-400";switch(e){case Oe.ACTIVE:n="bg-green-500";break;case Oe.DRAFT:n="bg-gray-400";break;case Oe.DEACTIVATED:n="bg-red-500";break;case Oe.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})})),PP=n.memo((({status:e,searchQuery:n,onViewAutomation:r})=>t.jsx(kP,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(NP,{status:n.status}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-foreground",children:e}),t.jsx(TP,{status:n.status})]})]})},{header:"Stats",accessorKey:"emailsSent",width:"10%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-muted-foreground",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ZC.EmailIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.emailsSent||0})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ZC.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Sales",accessorKey:"derived_revenue",width:"15%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-4 text-muted-foreground",children:t.jsx("div",{className:"flex items-center gap-1",children:t.jsx("span",{children:yP(n.derived_revenue||0)})})})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-muted-foreground",children:r?gP(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:t,limit:r})=>{const o=await(async e=>{const t=new URLSearchParams;return e.cursor&&t.append("cursor",e.cursor),e.limit&&t.append("limit",e.limit.toString()),e.status&&t.append("status",e.status),e.search&&t.append("search",e.search),(await Ee(`${l}?${t.toString()}`,{method:"GET"})).data})({cursor:t,limit:r,status:e,search:n||void 0});return{items:o.results,cursor:o.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-muted-foreground"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:e=>{r(e.id)},className:"rounded-lg bg-background"}))),DP=n.memo((({onCreateClick:e})=>t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(nk,{variant:"outline",onClick:e,children:[t.jsx(bu,{}),"Create New Automation"]})}))),MP=n.memo((({searchQuery:e,setSearchQuery:n})=>t.jsxs("div",{className:"relative",children:[t.jsx(xu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(mk,{placeholder:"Search automations...",value:e,onChange:e=>n(e.target.value),className:"focus-visible:ring-2 pl-9"})]}))),AP=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=wl(),c=bE(),[u,d]=n.useState(!1),p=n.useCallback((()=>{d(!0)}),[]),f=n.useMemo((()=>[{id:"all",label:"All",content:t.jsx(PP,{searchQuery:o,onViewAutomation:e})},{id:"active",label:"Active",content:t.jsx(PP,{status:"active",searchQuery:o,onViewAutomation:e})},{id:"draft",label:"Drafts",content:t.jsx(PP,{status:"draft",searchQuery:o,onViewAutomation:e})}]),[o,e]),h=n.useCallback((e=>{"error"===e?(l({title:"Error creating automation",description:"Please try again",variant:"destructive"}),d(!1)):!1===e?d(!1):c(`/automations/view-modal/${e}?autoOpenEditPopup=true&showBackButton=true`)}),[l,c]);return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(MP,{searchQuery:o,setSearchQuery:i}),t.jsx(DP,{onCreateClick:p})]}),t.jsx(o_,{tabs:f,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(wk,{open:u,setOpen:d,onClose:h,iconDefinitions:r})]})},OP=async e=>{const t=new URLSearchParams;e?.cursor&&t.append("cursor",e.cursor),e?.limit&&t.append("limit",e.limit.toString()),e?.search&&t.append("search",e.search);return(await Ee(`${a}${t.toString()?`?${t.toString()}`:""}`)).data};var RP=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e.Array="array",e.ReachResource="reach-resource",e))(RP||{}),LP=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(LP||{}),IP=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e.EQUALS_MONTH_DAY="equals_month_day",e.EQUALS_MONTH_DAY_YEAR="equals_month_day_year",e))(IP||{});const FP=()=>{const e=ae(),t=ge({mutationFn:e=>(async e=>(await Ee(a,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=me({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ee(`${a}/conditions`,{method:"GET"})).data)()});return{createSegment:t.mutate,isCreating:t.isPending,createError:t.error,isCreateSuccess:t.isSuccess,segmentsConditions:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchSegmentsConditions:n.refetch}},$P=e=>{const t=ae(),n=me({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ee(`${a}/count`,{method:"POST",body:JSON.stringify(e)})).data)(e)});return{data:n.data,isFetching:n.isFetching,isLoading:n.isLoading,fetchError:n.error,refetchCount:()=>{t.invalidateQueries({queryKey:["automations","recipients","count",e]})}}},qP=e=>{const t=me({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ee(`${a}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},UP=e=>{const t=ae(),n=ge({mutationFn:t=>(async(e,t)=>t?(await Ee(`${a}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data:null)(t,e),onSuccess:()=>{t.invalidateQueries({queryKey:["segments",e]})}});return{updateSegment:n.mutate,isUpdating:n.isPending,updateError:n.error,isUpdateSuccess:n.isSuccess}};function zP(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function BP(e){const n=VP(e),r=i.forwardRef(((e,r)=>{const{children:o,...s}=e,a=i.Children.toArray(o),l=a.find(HP);if(l){const e=l.props.children,o=a.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(n,{...s,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,o):null})}return t.jsx(n,{...s,ref:r,children:o})}));return r.displayName=`${e}.Slot`,r}function VP(e){const t=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?function(...e){return t=>{let n=!1;const r=e.map((e=>{const r=zP(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():zP(e[t],null)}}}}(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}var KP=Symbol("radix.slottable");function HP(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===KP}var WP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,n)=>{const r=BP(`Primitive.${n}`),o=i.forwardRef(((e,o)=>{const{asChild:i,...s}=e,a=i?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...s,ref:o})}));return o.displayName=`Primitive.${n}`,{...e,[n]:o}}),{}),GP=i.forwardRef(((e,n)=>t.jsx(WP.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));GP.displayName="Label";var YP=GP;const QP=Vc("text-foreground text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),XP=i.forwardRef((({className:e,...n},r)=>t.jsx(YP,{ref:r,className:_d(QP(),e),...n})));XP.displayName=YP.displayName;const JP={[IP.EQUALS]:"Equals",[IP.NOT_EQUALS]:"Not Equals",[IP.GREATER_THAN]:"Greater Than",[IP.LESS_THAN]:"Less Than",[IP.EXISTS]:"Exists",[IP.EQUALS_MONTH_DAY]:"Month and Day Matches",[IP.EQUALS_MONTH_DAY_YEAR]:"Month, Day, and Year Matches"},ZP={email:"Email",phone:"Phone",firstName:"First Name",lastName:"Last Name"};var eD=.999,tD=/[\\\/_+.#"@\[\(\{&]/,nD=/[\\\/_+.#"@\[\(\{&]/g,rD=/[\s-]/,oD=/[\s-]/g;function iD(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?1:.99;var a=`${o},${i}`;if(void 0!==s[a])return s[a];for(var l,c,u,d,p=r.charAt(i),f=n.indexOf(p,o),h=0;f>=0;)(l=iD(e,t,n,r,f+1,i+1,s))>h&&(f===o?l*=1:tD.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(nD))&&o>0&&(l*=Math.pow(eD,u.length))):rD.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(oD))&&o>0&&(l*=Math.pow(eD,d.length))):(l*=.17,o>0&&(l*=Math.pow(eD,f-o))),e.charAt(f)!==t.charAt(i)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(f-1)!==r.charAt(i))&&(.1*(c=iD(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>h&&(h=l),f=n.indexOf(p,f+1);return s[a]=h,h}function sD(e){return e.toLowerCase().replace(oD," ")}function aD(e,t,n){return iD(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,sD(e),sD(t),0,0,{})}var lD,cD={exports:{}},uD={};var dD,pD={};
44
44
  /**
45
45
  * @license React
46
46
  * use-sync-external-store-shim.development.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedreach/components",
3
- "version": "0.1.85",
3
+ "version": "0.1.86",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.js",