@embedreach/components 0.1.53 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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 Tw=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Pw=/^[\u0021-\u003A\u003C-\u007E]*$/,_w=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Nw=/^[\u0020-\u003A\u003D-\u007E]*$/,Dw=Object.prototype.toString,Mw=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Ow(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Rw(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Aw(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(CQ){return e}}function Lw(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?zw(t):t,state:n,key:t&&t.key||r||$w()};return o}(t?c().pathname:"/",e,n,r);return Fw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:qw(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?zw(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 Iw(e,t){if(!1===e||null==e)throw new Error(t)}function Fw(e,t){if(!e)try{throw new Error(t)}catch(CQ){}}function $w(){return Math.random().toString(36).substring(2,10)}function qw({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 zw(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 Uw(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?zw(t):t,i=nS(o.pathname||"/",n);if(null==i)return null;let s=Bw(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=tS(i);a=Zw(s[l],e,r)}return a}(e,t,n,!1)}function Bw(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("/")&&(Iw(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=sS([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Iw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),Bw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Jw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of Vw(e.path))o(e,t,n);else o(e,t)})),t}function Vw(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=Vw(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 Kw=/^:[\w-]+$/,Hw=3,Ww=2,Gw=1,Yw=10,Qw=-2,Xw=e=>"*"===e;function Jw(e,t){let n=e.split("/"),r=n.length;return n.some(Xw)&&(r+=Qw),t&&(r+=Ww),n.filter((e=>!Xw(e))).reduce(((e,t)=>e+(Kw.test(t)?Hw:""===t?Gw:Yw)),r)}function Zw(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=eS({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=eS({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:sS([i,u.pathname]),pathnameBase:aS(sS([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=sS([i,u.pathnameBase]))}return s}function eS(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Fw("*"===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 tS(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Fw(!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 nS(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 rS(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 oS(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 iS(e,t,n,r=!1){let o;"string"==typeof e?o=zw(e):(o={...e},Iw(!o.pathname||!o.pathname.includes("?"),rS("?","pathname","search",o)),Iw(!o.pathname||!o.pathname.includes("#"),rS("#","pathname","hash",o)),Iw(!o.search||!o.search.includes("#"),rS("#","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?zw(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:lS(r),hash:cS(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var sS=e=>e.join("/").replace(/\/\/+/g,"/"),aS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lS=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",cS=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var uS=["POST","PUT","PATCH","DELETE"];new Set(uS);var dS=["GET",...uS];new Set(dS);var hS=i.createContext(null);hS.displayName="DataRouter";var fS=i.createContext(null);fS.displayName="DataRouterState";var pS=i.createContext({isTransitioning:!1});pS.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var mS=i.createContext(null);mS.displayName="Navigation";var gS=i.createContext(null);gS.displayName="Location";var vS=i.createContext({outlet:null,matches:[],isDataRoute:!1});vS.displayName="Route";var yS=i.createContext(null);function bS(){return null!=i.useContext(gS)}function xS(){return Iw(bS(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(gS).location}yS.displayName="RouteError";var wS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function SS(e){i.useContext(mS).static||i.useLayoutEffect(e)}function CS(){let{isDataRoute:e}=i.useContext(vS);return e?function(){let{router:e}=function(e){let t=i.useContext(hS);return Iw(t,NS(e)),t}("useNavigate"),t=DS("useNavigate"),n=i.useRef(!1);return SS((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Fw(n.current,wS),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Iw(bS(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(hS),{basename:t,navigator:n}=i.useContext(mS),{matches:r}=i.useContext(vS),{pathname:o}=xS(),s=JSON.stringify(oS(r)),a=i.useRef(!1);return SS((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Fw(a.current,wS),!a.current)return;if("number"==typeof r)return void n.go(r);let l=iS(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:sS([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function kS(e,{relative:t}={}){let{matches:n}=i.useContext(vS),{pathname:r}=xS(),o=JSON.stringify(oS(n));return i.useMemo((()=>iS(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function ES(e,t,n,r){Iw(bS(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(mS),{matches:a}=i.useContext(vS),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let e=h&&h.path||"";OS(u,!h||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=xS();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Uw(e,{pathname:p});Fw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Fw(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]));Iw(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,h=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||TS,s&&(a<0&&0===c?(OS("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 p=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?h:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(_S,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(PS,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:sS([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:sS([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function jS(){let e=function(){let e=i.useContext(yS),t=function(e){let t=i.useContext(fS);return Iw(t,NS(e)),t}("useRouteError"),n=DS("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 TS=i.createElement(jS,null),PS=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(vS.Provider,{value:this.props.routeContext},i.createElement(yS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function _S({routeContext:e,match:t,children:n}){let r=i.useContext(hS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(vS.Provider,{value:e},n)}function NS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DS(e){let t=function(e){let t=i.useContext(vS);return Iw(t,NS(e)),t}(e),n=t.matches[t.matches.length-1];return Iw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var MS={};function OS(e,t,n){t||MS[e]||(MS[e]=!0,Fw(!1,n))}function RS({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Lw({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(AS,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function AS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Iw(!bS(),"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=zw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=nS(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return Fw(null!=p,`<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==p?null:i.createElement(mS.Provider,{value:l},i.createElement(gS.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return ES(e,0,n,t)}));var LS="get",IS="application/x-www-form-urlencoded";function FS(e){return null!=e&&"string"==typeof e.tagName}function $S(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 qS=null;var zS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function US(e){return null==e||zS.has(e)?e:(Fw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${IS}"`),null)}function BS(e,t){let n,r,o,i,s;if(function(e){return FS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?nS(s,t):null,n=e.getAttribute("method")||LS,o=US(e.getAttribute("enctype"))||IS,i=new FormData(e)}else if(function(e){return FS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return FS(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?nS(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||LS,o=US(e.getAttribute("formenctype"))||US(s.getAttribute("enctype"))||IS,i=new FormData(s,e),!function(){if(null===qS)try{new FormData(document.createElement("form"),0),qS=!1}catch(CQ){qS=!0}return qS}()){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(FS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=LS,r=null,o=IS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function VS(e,t){if(!1===e||null==e)throw new Error(t)}function KS(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 HS(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(KS).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function WS(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 GS(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 YS=i.createContext(void 0);function QS(){let e=i.useContext(YS);return VS(e,"You must render this element inside a <HydratedRouter> element"),e}function XS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JS({page:e,...t}){let{router:n}=function(){let e=i.useContext(hS);return VS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>Uw(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(ZS,{page:e,matches:r,...t}):null}function ZS({page:e,matches:t,...n}){let r=xS(),{manifest:o,routeModules:s}=QS(),{loaderData:a,matches:l}=function(){let e=i.useContext(fS);return VS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>WS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>WS(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]),h=i.useMemo((()=>GS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=QS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return HS(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}))),h.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 eC(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}YS.displayName="FrameworkContext";var tC="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tC&&(window.__reactRouterVersion="7.1.0")}catch(CQ){}var nC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rC=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,...h},f){let p,{basename:m}=i.useContext(mS),g="string"==typeof c&&nC.test(c),v=!1;if("string"==typeof c&&g&&(p=c,tC))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=nS(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(CQ){Fw(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){Iw(bS(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(mS),{hash:o,pathname:s,search:a}=kS(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:sS([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(YS),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=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 p=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:XS(l,p),onBlur:XS(c,m),onMouseEnter:XS(u,p),onMouseLeave:XS(d,m),onTouchStart:XS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=CS(),c=xS(),u=kS(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:qw(c)===qw(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",{...h,...w,href:p||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:eC(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(JS,{page:y})):C}));function oC(e){let t=i.useContext(hS);return Iw(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 iC(e){Fw("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($S(e)),n=i.useRef(!1),r=xS(),o=i.useMemo((()=>function(e,t){let n=$S(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=CS(),a=i.useCallback(((e,t)=>{const r=$S("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}rC.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=kS(s,{relative:c.relative}),h=xS(),f=i.useContext(fS),{navigator:p,basename:m}=i.useContext(mS),g=null!=f&&function(e,t={}){let n=i.useContext(pS);Iw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oC("useViewTransitionState"),o=kS(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=nS(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=nS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=eS(o.pathname,a)||null!=eS(o.pathname,s)}(d)&&!0===a,v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&m&&(b=nS(b,m)||b);const x="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,S=y===v||!r&&y.startsWith(v)&&"/"===y.charAt(x),C=null!=b&&(b===v||!r&&b.startsWith(v)&&"/"===b.charAt(v.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 j="function"==typeof o?o(k):o;return i.createElement(rC,{...c,"aria-current":E,className:w,ref:u,style:j,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=LS,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,...f},p)=>{let m=function(){let{router:e}=oC("useSubmit"),{basename:t}=i.useContext(mS),n=DS("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=BS(r,t);if(!1===o.navigate){let t=o.fetcherKey||aC();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(mS),r=i.useContext(vS);Iw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...kS(e||".",{relative:t})},a=xS();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:sS([n,s.pathname]));return qw(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&nC.test(l);return i.createElement("form",{ref:p,method:v,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:h})},...f,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var sC=0,aC=()=>`__${String(++sC)}__`;function lC(...e){return Oh(Zu(e))}new TextEncoder;const cC=({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",children:[t.jsx("div",{className:"flex items-center justify-between border-b",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:lC("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)))})]})},uC="flex flex-col items-center justify-center h-full";var dC,hC="dismissableLayer.update",fC="dismissableLayer.pointerDownOutside",pC="dismissableLayer.focusOutside",mC=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gC=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(mC),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){yC(fC,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){yC(pC,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(dC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),vC(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=dC)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),vC())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(hC,e),()=>document.removeEventListener(hC,e)}),[]),t.jsx(Vc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));gC.displayName="DismissableLayer";function vC(){const e=new CustomEvent(hC);document.dispatchEvent(e)}function yC(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?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(mC),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Vc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var bC=i["useId".toString()]||(()=>{}),xC=0;function wC(e){const[t,n]=i.useState(bC());return iu((()=>{n((e=>e??String(xC++)))}),[e]),e||(t?`radix-${t}`:"")}const SC=["top","right","bottom","left"],CC=Math.min,kC=Math.max,EC=Math.round,jC=Math.floor,TC=e=>({x:e,y:e}),PC={left:"right",right:"left",bottom:"top",top:"bottom"},_C={start:"end",end:"start"};function NC(e,t,n){return kC(e,CC(t,n))}function DC(e,t){return"function"==typeof e?e(t):e}function MC(e){return e.split("-")[0]}function OC(e){return e.split("-")[1]}function RC(e){return"x"===e?"y":"x"}function AC(e){return"y"===e?"height":"width"}function LC(e){return["top","bottom"].includes(MC(e))?"y":"x"}function IC(e){return RC(LC(e))}function FC(e){return e.replace(/start|end/g,(e=>_C[e]))}function $C(e){return e.replace(/left|right|bottom|top/g,(e=>PC[e]))}function qC(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 zC(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 UC(e,t,n){let{reference:r,floating:o}=e;const i=LC(t),s=IC(t),a=AC(s),l=MC(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=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(OC(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function BC(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:h=!1,padding:f=0}=DC(t,e),p=qC(f),m=a[h?"floating"===d?"reference":"floating":d],g=zC(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})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=zC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function VC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function KC(e){return SC.some((t=>e[t]>=0))}function HC(){return"undefined"!=typeof window}function WC(e){return QC(e)?(e.nodeName||"").toLowerCase():"#document"}function GC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function YC(e){var t;return null==(t=(QC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function QC(e){return!!HC()&&(e instanceof Node||e instanceof GC(e).Node)}function XC(e){return!!HC()&&(e instanceof Element||e instanceof GC(e).Element)}function JC(e){return!!HC()&&(e instanceof HTMLElement||e instanceof GC(e).HTMLElement)}function ZC(e){return!(!HC()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof GC(e).ShadowRoot)}function ek(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=sk(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function tk(e){return["table","td","th"].includes(WC(e))}function nk(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(CQ){return!1}}))}function rk(e){const t=ok(),n=XC(e)?sk(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 ok(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ik(e){return["html","body","#document"].includes(WC(e))}function sk(e){return GC(e).getComputedStyle(e)}function ak(e){return XC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lk(e){if("html"===WC(e))return e;const t=e.assignedSlot||e.parentNode||ZC(e)&&e.host||YC(e);return ZC(t)?t.host:t}function ck(e){const t=lk(e);return ik(t)?e.ownerDocument?e.ownerDocument.body:e.body:JC(t)&&ek(t)?t:ck(t)}function uk(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ck(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=GC(o);if(i){const e=dk(s);return t.concat(s,s.visualViewport||[],ek(o)?o:[],e&&n?uk(e):[])}return t.concat(o,uk(o,[],n))}function dk(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hk(e){const t=sk(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=JC(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=EC(n)!==i||EC(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fk(e){return XC(e)?e:e.contextElement}function pk(e){const t=fk(e);if(!JC(t))return TC(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hk(t);let s=(i?EC(n.width):n.width)/r,a=(i?EC(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const mk=TC(0);function gk(e){const t=GC(e);return ok()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mk}function vk(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=fk(e);let s=TC(1);t&&(r?XC(r)&&(s=pk(r)):s=pk(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==GC(e))&&t}(i,n,r)?gk(i):TC(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=GC(i),t=r&&XC(r)?GC(r):r;let n=e,o=dk(n);for(;o&&r&&t!==n;){const e=pk(o),t=o.getBoundingClientRect(),r=sk(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=GC(o),o=dk(n)}}return zC({width:u,height:d,x:l,y:c})}function yk(e,t){const n=ak(e).scrollLeft;return t?t.left+n:vk(YC(e)).left+n}function bk(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:yk(e,r)),y:r.top+t.scrollTop}}function xk(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=GC(e),r=YC(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=ok();(!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=YC(e),n=ak(e),r=e.ownerDocument.body,o=kC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=kC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yk(e);const a=-n.scrollTop;return"rtl"===sk(r).direction&&(s+=kC(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(YC(e));else if(XC(t))r=function(e,t){const n=vk(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=JC(e)?pk(e):TC(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=gk(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zC(r)}function wk(e,t){const n=lk(e);return!(n===t||!XC(n)||ik(n))&&("fixed"===sk(n).position||wk(n,t))}function Sk(e,t,n){const r=JC(t),o=YC(t),i="fixed"===n,s=vk(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=TC(0);if(r||!r&&!i)if(("body"!==WC(t)||ek(o))&&(a=ak(t)),r){const e=vk(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=yk(o));const c=!o||r||i?TC(0):bk(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 Ck(e){return"static"===sk(e).position}function kk(e,t){if(!JC(e)||"fixed"===sk(e).position)return null;if(t)return t(e);let n=e.offsetParent;return YC(e)===n&&(n=n.ownerDocument.body),n}function Ek(e,t){const n=GC(e);if(nk(e))return n;if(!JC(e)){let t=lk(e);for(;t&&!ik(t);){if(XC(t)&&!Ck(t))return t;t=lk(t)}return n}let r=kk(e,t);for(;r&&tk(r)&&Ck(r);)r=kk(r,t);return r&&ik(r)&&Ck(r)&&!rk(r)?n:r||function(e){let t=lk(e);for(;JC(t)&&!ik(t);){if(rk(t))return t;if(nk(t))return null;t=lk(t)}return null}(e)||n}const jk={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=YC(r),a=!!t&&nk(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=TC(1);const u=TC(0),d=JC(r);if((d||!d&&!i)&&(("body"!==WC(r)||ek(s))&&(l=ak(r)),JC(r))){const e=vk(r);c=pk(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?TC(0):bk(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+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:YC,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?nk(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=uk(e,[],!1).filter((e=>XC(e)&&"body"!==WC(e))),o=null;const i="fixed"===sk(e).position;let s=i?lk(e):e;for(;XC(s)&&!ik(s);){const t=sk(s),n=rk(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ek(s)&&!n&&wk(e,s))?r=r.filter((e=>e!==s)):o=t,s=lk(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=xk(t,n,o);return e.top=kC(r.top,e.top),e.right=CC(r.right,e.right),e.bottom=CC(r.bottom,e.bottom),e.left=kC(r.left,e.left),e}),xk(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ek,getElementRects:async function(e){const t=this.getOffsetParent||Ek,n=this.getDimensions,r=await n(e.floating);return{reference:Sk(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}=hk(e);return{width:t,height:n}},getScale:pk,isElement:XC,isRTL:function(e){return"rtl"===sk(e).direction}};function Tk(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=fk(e),u=o||i?[...c?uk(c):[],...uk(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=YC(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:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-jC(u)+"px "+-jC(o.clientWidth-(c+d))+"px "+-jC(o.clientHeight-(u+h))+"px "+-jC(c)+"px",threshold:kC(0,CC(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(CQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?vk(e):null;return l&&function t(){const r=vk(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const Pk=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=MC(n),a=OC(n),l="y"===LC(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=DC(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*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}}}}},_k=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}=DC(e,t),c={x:n,y:r},u=await BC(t,l),d=LC(MC(o)),h=RC(d);let f=c[h],p=c[d];if(i){f=NC(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=NC(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:s}}}}}},Nk=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:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=DC(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=MC(o),y=LC(a),b=MC(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[$C(a)]:function(e){const t=$C(e);return[FC(e),t,FC(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=OC(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[]}}(MC(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(FC)))),i}(a,m,p,x));const C=[a,...w],k=await BC(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=OC(e),o=IC(e),i=AC(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=$C(s)),[s,$C(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var _;const e=null==(_=j.filter((e=>{if(S){const t=LC(e.placement);return t===y||"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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Dk=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}=DC(e,t),u=await BC(t,c),d=MC(o),h=OC(o),f="y"===LC(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right;let x=CC(m-u[g],y),w=CC(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!h){const e=kC(u.left,0),t=kC(u.right,0),n=kC(u.top,0),r=kC(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:kC(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:kC(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return p!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},Mk=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=DC(e,t);switch(r){case"referenceHidden":{const e=VC(await BC(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:KC(e)}}}case"escaped":{const e=VC(await BC(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:KC(e)}}}default:return{}}}}},Ok=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}=DC(e,t)||{};if(null==c)return{};const d=qC(u),h={x:n,y:r},f=IC(o),p=AC(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[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[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=CC(d[v],E),T=CC(d[y],E),P=j,_=C-m[p]-T,N=C/2-m[p]/2+k,D=NC(P,N,_),M=!l.arrow&&null!=OC(o)&&N!==D&&i.reference[p]/2-(N<P?j:T)-m[p]/2<0,O=M?N<P?N-P:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),Rk=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}=DC(e,t),u={x:n,y:r},d=LC(o),h=RC(d);let f=u[h],p=u[d];const m=DC(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+g.mainAxis,n=i.reference[h]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(MC(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},Ak=(e,t,n)=>{const r={platform:jk,...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}=UC(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=UC(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var Lk="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Ik(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(!Ik(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)&&!Ik(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Fk(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $k(e,t){const n=Fk(e);return Math.round(t*n)/n}function qk(e){const t=i.useRef(e);return Lk((()=>{t.current=e})),t}const zk=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?Ok({element:n.current,padding:r}).fn(t):{}:n?Ok({element:n,padding:r}).fn(t):{}}}),Uk=(e,t)=>({..._k(e),options:[e,t]}),Bk=(e,t)=>({...Rk(e),options:[e,t]}),Vk=(e,t)=>({...Nk(e),options:[e,t]}),Kk=(e,t)=>({...Dk(e),options:[e,t]}),Hk=(e,t)=>({...Mk(e),options:[e,t]}),Wk=(e,t)=>({...zk(e),options:[e,t]});var Gk=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(Vc.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"})})}));Gk.displayName="Arrow";var Yk=Gk;function Qk(e){const[t,n]=i.useState(void 0);return iu((()=>{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 Xk="Popper",[Jk,Zk]=Lc(Xk),[eE,tE]=Jk(Xk),nE=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(eE,{scope:n,anchor:o,onAnchorChange:s,children:r})};nE.displayName=Xk;var rE="PopperAnchor",oE=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=tE(rE,r),l=i.useRef(null),c=Ac(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(Vc.div,{...s,ref:c})}));oE.displayName=rE;var iE="PopperContent",[sE,aE]=Jk(iE),lE=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=tE(iE,r),[x,w]=i.useState(null),S=Ac(n,(e=>w(e))),[C,k]=i.useState(null),E=Qk(C),j=E?.width??0,T=E?.height??0,P=o+("center"!==l?"-"+l:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(h)?h:[h],D=N.length>0,M={padding:_,boundary:N.filter(hE),altBoundary:D},{refs:O,floatingStyles:R,placement:A,isPositioned:L,middlewareData:I}=function(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,[h,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Ik(p,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||y,k=i.useRef(null),E=i.useRef(null),j=i.useRef(h),T=null!=u,P=qk(u),_=qk(o),N=qk(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ak(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!Ik(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,_,N]);Lk((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);Lk((()=>(M.current=!0,()=>{M.current=!1})),[]),Lk((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(P.current)return P.current(S,C,D);D()}}),[S,C,D,P,T]);const O=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),R=i.useMemo((()=>({reference:S,floating:C})),[S,C]),A=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=$k(R.floating,h.x),r=$k(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Fk(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,R.floating,h.x,h.y]);return i.useMemo((()=>({...h,update:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>Tk(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+T,alignmentAxis:c},{...Pk(F),options:[F,$]}),d&&Uk({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Bk():void 0,...M}),d&&Vk({...M}),Kk({...M,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`)}}),C&&Wk({element:C,padding:u}),fE({arrowWidth:j,arrowHeight:T}),m&&Hk({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=pE(A),U=Hc(v);iu((()=>{L&&U?.()}),[L,U]);const B=I.arrow?.x,V=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return iu((()=>{x&&W(window.getComputedStyle(x).zIndex)}),[x]),t.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:L?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(sE,{scope:r,placedSide:q,onArrowChange:k,arrowX:B,arrowY:V,shouldHideArrow:K,children:t.jsx(Vc.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));lE.displayName=iE;var cE="PopperArrow",uE={top:"bottom",right:"left",bottom:"top",left:"right"},dE=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=aE(cE,r),s=uE[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(Yk,{...o,ref:n,style:{...o.style,display:"block"}})})}));function hE(e){return null!==e}dE.displayName=cE;var fE=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]=pE(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=i?u:`${d}px`,p=-a+"px"):"top"===l?(f=i?u:`${d}px`,p=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",p=i?u:`${h}px`):"left"===l&&(f=`${r.floating.width+a}px`,p=i?u:`${h}px`),{data:{x:f,y:p}}}});function pE(e){const[t,n="center"]=e.split("-");return[t,n]}var mE=nE,gE=oE,vE=lE,yE=dE,[bE,xE]=Lc("Tooltip",[Zk]),wE=Zk(),SE="TooltipProvider",CE=700,kE="tooltip.open",[EE,jE]=bE(SE),TE=e=>{const{__scopeTooltip:n,delayDuration:r=CE,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(EE,{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})};TE.displayName=SE;var PE="Tooltip",[_E,NE]=bE(PE),DE=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=jE(PE,e.__scopeTooltip),d=wE(n),[h,f]=i.useState(null),p=wC(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=cu({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(kE))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,y.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((()=>{y.current=!0,x(!0),m.current=0}),v)}),[v,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(mE,{...d,children:t.jsx(_E,{scope:n,contentId:p,open:b,stateAttribute:w,trigger:h,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})})};DE.displayName=PE;var ME="TooltipTrigger",OE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=NE(ME,r),a=jE(ME,r),l=wE(r),c=Ac(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),h=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",h)),[h]),t.jsx(gE,{asChild:!0,...l,children:t.jsx(Vc.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Mc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Mc(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Mc(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Mc(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Mc(e.onBlur,s.onClose),onClick:Mc(e.onClick,s.onClose)})})}));OE.displayName=ME;var RE="TooltipPortal",[AE,LE]=bE(RE,{forceMount:void 0}),IE=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=NE(RE,n);return t.jsx(AE,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};IE.displayName=RE;var FE="TooltipContent",$E=i.forwardRef(((e,n)=>{const r=LE(FE,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=NE(FE,e.__scopeTooltip);return t.jsx(au,{present:o||a.open,children:t.jsx(a.disableHoverableContent?BE:qE,{side:i,...s,ref:n})})})),qE=i.forwardRef(((e,n)=>{const r=NE(FE,e.__scopeTooltip),o=jE(FE,e.__scopeTooltip),s=i.useRef(null),a=Ac(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,h=s.current,{onPointerInTransitChange:f}=o,p=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((()=>()=>p()),[p]),i.useEffect((()=>{if(u&&h){const e=e=>m(e,h),t=e=>m(e,u);return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[u,h,m,p]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||h?.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?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,h,l,d,p]),t.jsx(BE,{...e,ref:a})})),[zE,UE]=bE(PE,{isInside:!1}),BE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=NE(FE,r),d=wE(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(kE,h),()=>document.removeEventListener(kE,h))),[h]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),t.jsx(gC,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(vE,{"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(qc,{children:o}),t.jsx(zE,{scope:r,isInside:!0,children:t.jsx(du,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));$E.displayName=FE;var VE="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=wE(r);return UE(VE,r).isInside?null:t.jsx(yE,{...i,...o,ref:n})})).displayName=VE;var KE=IE,HE=$E;const WE=TE,GE=DE,YE=OE,QE=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(KE,{children:t.jsx(HE,{ref:o,sideOffset:n,className:Rh("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})})));QE.displayName=HE.displayName;const XE=({title:e,alertText:n,Icon:r=xd,onClick:o})=>t.jsx(WE,{children:t.jsxs(GE,{children:[t.jsx(YE,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(QE,{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})]})})]})}),JE=({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(XE,{title:o})]}),t.jsx("span",{children:r})]})]})}),ZE=({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(JE,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},ej=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=tw(e);if(a||!s)return t.jsx("div",{className:uC,children:t.jsx(Vx,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(cC,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(ZE,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(ZE,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function tj(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 nj(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const rj=6048e5,oj=43200;let ij={};function sj(){return ij}function aj(e,t){const n=sj(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=tj(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 lj(e){return aj(e,{weekStartsOn:1})}function cj(e){const t=tj(e),n=t.getFullYear(),r=nj(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=lj(r),i=nj(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=lj(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function uj(e){const t=tj(e);return t.setHours(0,0,0,0),t}function dj(e){const t=tj(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 hj(e,t){return function(e,t){return nj(e,+tj(e)+t)}(e,6e4*t)}function fj(e,t){const n=tj(e),r=tj(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function pj(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=tj(e);return!isNaN(Number(n))}function mj(e){const t=tj(e);return+function(e){const t=tj(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=tj(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function gj(e,t){const n=tj(e),r=tj(t),o=fj(n,r),i=Math.abs(function(e,t){const n=tj(e),r=tj(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=fj(n,r)===-o;mj(tj(e))&&1===i&&1===fj(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function vj(e,t,n){const r=function(e,t){return+tj(e)-+tj(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 yj={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 bj(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xj={date:bj({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:bj({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:bj({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},wj={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Sj(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 Cj(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 kj;const Ej={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=yj[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:xj,formatRelative:(e,t,n,r)=>wj[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:Sj({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Sj({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:Sj({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:Sj({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:Sj({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:(kj={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(kj.matchPattern);if(!n)return null;const r=n[0],o=e.match(kj.parsePattern);if(!o)return null;let i=kj.valueCallback?kj.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:Cj({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:Cj({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:Cj({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:Cj({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:Cj({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 jj(e){const t=tj(e),n=function(e,t){const n=uj(e),r=uj(t),o=+n-dj(n),i=+r-dj(r);return Math.round((o-i)/864e5)}(t,function(e){const t=tj(e),n=nj(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function Tj(e){const t=tj(e),n=+lj(t)-+function(e){const t=cj(e),n=nj(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),lj(n)}(t);return Math.round(n/rj)+1}function Pj(e,t){const n=tj(e),r=n.getFullYear(),o=sj(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=nj(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=aj(s,t),l=nj(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=aj(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function _j(e,t){const n=tj(e),r=+aj(n,t)-+function(e,t){const n=sj(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Pj(e,t),i=nj(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),aj(i,t)}(n,t);return Math.round(r/rj)+1}function Nj(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Dj={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Nj("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Nj(n+1,2)},d:(e,t)=>Nj(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)=>Nj(e.getHours()%12||12,t.length),H:(e,t)=>Nj(e.getHours(),t.length),m:(e,t)=>Nj(e.getMinutes(),t.length),s:(e,t)=>Nj(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return Nj(Math.trunc(r*Math.pow(10,n-3)),t.length)}},Mj="midnight",Oj="noon",Rj="morning",Aj="afternoon",Lj="evening",Ij="night",Fj={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 Dj.y(e,t)},Y:function(e,t,n,r){const o=Pj(e,r),i=o>0?o:1-o;if("YY"===t){return Nj(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Nj(i,t.length)},R:function(e,t){return Nj(cj(e),t.length)},u:function(e,t){return Nj(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 Nj(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 Nj(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 Dj.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 Nj(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=_j(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Nj(o,t.length)},I:function(e,t,n){const r=Tj(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Nj(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Dj.d(e,t)},D:function(e,t,n){const r=jj(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Nj(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 Nj(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 Nj(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 Nj(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?Oj:0===r?Mj: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?Lj:r>=12?Aj:r>=4?Rj:Ij,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 Dj.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Dj.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Nj(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Nj(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Dj.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Dj.s(e,t)},S:function(e,t){return Dj.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return qj(r);case"XXXX":case"XX":return zj(r);default:return zj(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return qj(r);case"xxxx":case"xx":return zj(r);default:return zj(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$j(r,":");default:return"GMT"+zj(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$j(r,":");default:return"GMT"+zj(r,":")}},t:function(e,t,n){return Nj(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Nj(e.getTime(),t.length)}};function $j(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+Nj(i,2)}function qj(e,t){if(e%60==0){return(e>0?"-":"+")+Nj(Math.abs(e)/60,2)}return zj(e,t)}function zj(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+Nj(Math.trunc(r/60),2)+t+Nj(r%60,2)}const Uj=(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"})}},Bj=(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"})}},Vj={p:Bj,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Uj(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}}",Uj(r,t)).replace("{{time}}",Bj(o,t))}},Kj=/^D+$/,Hj=/^Y+$/,Wj=["D","DD","YY","YYYY"];const Gj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qj=/^'([^]*?)'?$/,Xj=/''/g,Jj=/[a-zA-Z]/;function Zj(e,t,n){const r=sj(),o=r.locale??Ej,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=tj(e);if(!pj(a))throw new RangeError("Invalid time value");let l=t.match(Yj).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Vj[t])(e,o.formatLong)}return e})).join("").match(Gj).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:eT(e)};if(Fj[t])return{isToken:!0,value:e};if(t.match(Jj))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 Hj.test(e)}(r)||function(e){return Kj.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(Wj.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,Fj[r[0]])(a,r,o.localize,c)})).join("")}function eT(e){const t=e.match(Qj);return t?t[1].replace(Xj,"'"):e}function tT(e,t){return function(e,t,n){const r=sj(),o=n?.locale??r.locale??Ej,i=fj(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=tj(t),l=tj(e)):(a=tj(e),l=tj(t));const c=vj(l,a),u=(dj(l)-dj(a))/1e3,d=Math.round((c-u)/60);let h;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<oj){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/oj),o.formatDistance("aboutXMonths",h,s);if(h=gj(l,a),h<12){const e=Math.round(d/oj);return o.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/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 nj(e,Date.now())}(e),t)}var nT=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(iT);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(rT,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(rT,{...o,ref:n,children:r})}));nT.displayName="Slot";var rT=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?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));rT.displayName="SlotClone";var oT=({children:e})=>t.jsx(t.Fragment,{children:e});function iT(e){return i.isValidElement(e)&&e.type===oT}var sT=["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?nT: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}}),{});var aT,lT="dismissableLayer.update",cT="dismissableLayer.pointerDownOutside",uT="dismissableLayer.focusOutside",dT=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hT=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(dT),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){pT(cT,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){pT(uT,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(aT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),fT(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=aT)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),fT())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(lT,e),()=>document.removeEventListener(lT,e)}),[]),t.jsx(sT.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));hT.displayName="DismissableLayer";function fT(){const e=new CustomEvent(lT);document.dispatchEvent(e)}function pT(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?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(dT),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(sT.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var mT="focusScope.autoFocusOnMount",gT="focusScope.autoFocusOnUnmount",vT={bubbles:!1,cancelable:!0},yT=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:ST(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ST(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ST(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){CT.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(mT,vT);c.addEventListener(mT,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ST(r,{select:t}),document.activeElement!==n)return}((e=bT(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&ST(c))}return()=>{c.removeEventListener(mT,d),setTimeout((()=>{const e=new CustomEvent(gT,vT);c.addEventListener(gT,h),c.dispatchEvent(e),e.defaultPrevented||ST(t??document.body,{select:!0}),c.removeEventListener(gT,h),CT.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=bT(e),n=xT(t,e),r=xT(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&ST(i,{select:!0})):(e.preventDefault(),r&&ST(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(sT.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function bT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function xT(e,t){for(const n of e)if(!wT(n,{upTo:t}))return n}function wT(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ST(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}yT.displayName="FocusScope";var CT=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kT(e,t),e.unshift(t)},remove(t){e=kT(e,t),e[0]?.resume()}}}();function kT(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var ET=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);iu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(sT.div,{...s,ref:n}),c):null}));ET.displayName="Portal";var jT=0;function TT(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PT()),document.body.insertAdjacentElement("beforeend",e[1]??PT()),jT++,()=>{1===jT&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),jT--}}),[])}function PT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _T=function(){return _T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_T.apply(this,arguments)};function NT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function DT(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MT="right-scroll-bar-position",OT="width-before-scroll-bar";function RT(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var AT="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,LT=new WeakMap;function IT(e,t){var r=function(e,t){var r=n.useState((function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(null,(function(t){return e.forEach((function(e){return RT(e,t)}))}));return AT((function(){var t=LT.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||RT(e,null)})),o.forEach((function(e){n.has(e)||RT(e,i)}))}LT.set(r,e)}),[e]),r}function FT(e){return e}function $T(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=FT);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=_T({async:!0,ssr:!1},e),t}var qT=function(e){var t=e.sideCar,n=NT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,_T({},n))};function zT(e,t){return e.useMedium(t),qT}qT.isSideCarExport=!0;var UT=$T(),BT=function(){},VT=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:BT,onWheelCapture:BT,onTouchMoveCapture:BT}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=NT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=IT([n,t]),C=_T(_T({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:UT,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),_T(_T({},C),{ref:S})):i.createElement(y,_T({},C,{className:c,ref:S}),l))}));VT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},VT.classNames={fullWidth:OT,zeroRight:MT};function KT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var HT=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=KT())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WT=function(){var e,t=(e=HT(),function(t,n){i.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},GT={left:0,top:0,right:0,gap:0},YT=function(e){return parseInt(e||"",10)||0},QT=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return GT;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[YT(t["padding"===e?"paddingLeft":"marginLeft"]),YT(n),YT(r)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XT=WT(),JT="data-scroll-locked",ZT=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(JT,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(MT," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(OT," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(MT," .").concat(MT," {\n right: 0 ").concat(r,";\n }\n \n .").concat(OT," .").concat(OT," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(JT,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},eP=function(){var e=parseInt(document.body.getAttribute(JT)||"0",10);return isFinite(e)?e:0},tP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect((function(){return document.body.setAttribute(JT,(eP()+1).toString()),function(){var e=eP()-1;e<=0?document.body.removeAttribute(JT):document.body.setAttribute(JT,e.toString())}}),[]);var s=i.useMemo((function(){return QT(o)}),[o]);return i.createElement(XT,{styles:ZT(s,!t,o,n?"":"!important")})},nP=!1;if("undefined"!=typeof window)try{var rP=Object.defineProperty({},"passive",{get:function(){return nP=!0,!0}});window.addEventListener("test",rP,rP),window.removeEventListener("test",rP,rP)}catch(EQ){nP=!1}var oP=!!nP&&{passive:!1},iP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},sP=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),aP(e,r)){var o=lP(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aP=function(e,t){return"v"===e?function(e){return iP(e,"overflowY")}(t):function(e){return iP(e,"overflowX")}(t)},lP=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},cP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uP=function(e){return[e.deltaX,e.deltaY]},dP=function(e){return e&&"current"in e?e.current:e},hP=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},fP=0,pP=[];function mP(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gP=zT(UT,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(fP++)[0],s=i.useState(WT)[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DT([e.lockRef.current],(e.shards||[]).map(dP),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=cP(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=sP(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=sP(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=lP(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&aP(e,s)&&(u+=p,d+=f),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(pP.length&&pP[pP.length-1]===s){var r="deltaY"in n?uP(n):cP(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(dP).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:mP(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=cP(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,uP(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,cP(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return pP.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,oP),document.addEventListener("touchmove",c,oP),document.addEventListener("touchstart",d,oP),function(){pP=pP.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,oP),document.removeEventListener("touchmove",c,oP),document.removeEventListener("touchstart",d,oP)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:hP(o)}):null,p?i.createElement(tP,{gapMode:e.gapMode}):null)}));var vP=i.forwardRef((function(e,t){return i.createElement(VT,_T({},e,{ref:t,sideCar:gP}))}));vP.classNames=VT.classNames;var yP=new WeakMap,bP=new WeakMap,xP={},wP=0,SP=function(e){return e&&(e.host||SP(e.parentNode))},CP=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=SP(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);xP[n]||(xP[n]=new WeakMap);var i=xP[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(yP.get(e)||0)+1,c=(i.get(e)||0)+1;yP.set(e,l),i.set(e,c),s.push(e),1===l&&o&&bP.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(CQ){}}))};return u(t),a.clear(),wP++,function(){s.forEach((function(e){var t=yP.get(e)-1,o=i.get(e)-1;yP.set(e,t),i.set(e,o),t||(bP.has(e)||e.removeAttribute(r),bP.delete(e)),o||e.removeAttribute(n)})),--wP||(yP=new WeakMap,yP=new WeakMap,bP=new WeakMap,xP={})}},kP=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),CP(r,o,n,"aria-hidden")):function(){return null}},EP="Dialog",[jP,TP]=Lc(EP),[PP,_P]=jP(EP),NP=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d=!1,h]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(PP,{scope:n,triggerRef:c,contentRef:u,contentId:wC(),titleId:wC(),descriptionId:wC(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};NP.displayName=EP;var DP="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(DP,r),s=Ac(n,i.triggerRef);return t.jsx(sT.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QP(i.open),...o,ref:s,onClick:Mc(e.onClick,i.onOpenToggle)})})).displayName=DP;var MP="DialogPortal",[OP,RP]=jP(MP,{forceMount:void 0}),AP=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=_P(MP,n);return t.jsx(OP,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(au,{present:r||a.open,children:t.jsx(ET,{asChild:!0,container:s,children:e})})))})};AP.displayName=MP;var LP="DialogOverlay",IP=i.forwardRef(((e,n)=>{const r=RP(LP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=_P(LP,e.__scopeDialog);return s.modal?t.jsx(au,{present:o||s.open,children:t.jsx(FP,{...i,ref:n})}):null}));IP.displayName=LP;var FP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(LP,r);return t.jsx(vP,{as:nT,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(sT.div,{"data-state":QP(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),$P="DialogContent",qP=i.forwardRef(((e,n)=>{const r=RP($P,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=_P($P,e.__scopeDialog);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?zP:UP,{...i,ref:n})})}));qP.displayName=$P;var zP=i.forwardRef(((e,n)=>{const r=_P($P,e.__scopeDialog),o=i.useRef(null),s=Ac(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(BP,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()))})})),UP=i.forwardRef(((e,n)=>{const r=_P($P,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(BP,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),BP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=_P($P,r),u=i.useRef(null),d=Ac(n,u);return TT(),t.jsxs(t.Fragment,{children:[t.jsx(yT,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(hT,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":QP(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(e_,{titleId:c.titleId}),t.jsx(t_,{contentRef:u,descriptionId:c.descriptionId})]})]})})),VP="DialogTitle",KP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(VP,r);return t.jsx(sT.h2,{id:i.titleId,...o,ref:n})}));KP.displayName=VP;var HP="DialogDescription",WP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(HP,r);return t.jsx(sT.p,{id:i.descriptionId,...o,ref:n})}));WP.displayName=HP;var GP="DialogClose",YP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(GP,r);return t.jsx(sT.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})}));function QP(e){return e?"open":"closed"}YP.displayName=GP;var XP="DialogTitleWarning",[JP,ZP]=function(e,n){const r=i.createContext(n),o=e=>{const{children:n,...o}=e,s=i.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=i.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(XP,{contentName:$P,titleName:VP,docsSlug:"dialog"}),e_=({titleId:e})=>{const t=ZP(XP);return i.useEffect((()=>{if(e){document.getElementById(e)}}),[`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`,e]),null},t_=({contentRef:e,descriptionId:t})=>{const n=ZP("DialogDescriptionWarning");return i.useEffect((()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},n_=NP,r_=AP,o_=IP,i_=qP,s_=KP,a_=WP,l_=YP,c_=["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?sw: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}}),{}),u_=i.forwardRef(((e,n)=>t.jsx(c_.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}})));u_.displayName="VisuallyHidden";const d_=n_,h_=({...e})=>t.jsx(r_,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),f_=i.forwardRef((({className:e,...n},r)=>t.jsx(o_,{ref:r,className:lC("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));f_.displayName=o_.displayName;const p_=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(h_,{children:[t.jsx(f_,{}),t.jsxs(i_,{ref:i,className:lC("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onInteractOutside:e=>{e.composedPath().some((e=>"classList"in e&&Array.from(e.classList).includes("pac-item")))&&e.preventDefault()},...o,children:[n,!r&&t.jsxs(l_,{className:"absolute right-6 top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(zd,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));p_.displayName=i_.displayName;const m_=({className:e,...n})=>t.jsx("div",{className:lC("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});m_.displayName="DialogHeader";const g_=i.forwardRef((({className:e,...n},r)=>t.jsx(s_,{ref:r,className:lC("text-lg font-semibold leading-none tracking-tight",e),...n})));g_.displayName=s_.displayName;const v_=i.forwardRef((({className:e,...n},r)=>t.jsx(a_,{ref:r,className:lC("text-sm text-muted-foreground",e),...n})));v_.displayName=a_.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(u_,{ref:o,className:lC(e),...r,children:n}))).displayName="DialogVisuallyHidden";const y_=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Rh("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));y_.displayName="Input";const b_=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Rh("w-full caption-bottom text-sm",e),...n})})));b_.displayName="Table";const x_=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Rh("[&_tr]:border-b",e),...n})));x_.displayName="TableHeader";const w_=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Rh("[&_tr:last-child]:border-0",e),...n})));w_.displayName="TableBody";const S_=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Rh("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));S_.displayName="TableRow";const C_=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Rh("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));C_.displayName="TableHead";const k_=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Rh("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));k_.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Rh("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const E_=({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),[h,f]=n.useState(),[p,m]=n.useState(!0),[g,v]=n.useState(null),y=n.useCallback((async e=>{try{d(!0),v(null);const t=await r({cursor:e,limit:o});c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(EQ){v(EQ instanceof Error?EQ.message:"An error occurred")}finally{d(!1)}}),[r,o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),y()}),[y]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):t.jsxs("div",u||0!==l.length?{className:Rh(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(b_,{children:[t.jsx(x_,{children:t.jsx(S_,{children:e.map((e=>t.jsx(C_,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(w_,{children:l.map(((n,r)=>t.jsx(S_,{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(k_,{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)))})]})}),p&&t.jsx("div",{className:"mt-4 flex justify-center",children:t.jsx("button",{onClick:()=>y(h),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})]})},j_="reach-styles-module__container___6PQqs",T_=nd(["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}}),P_=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Rh(T_({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));P_.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(j_,e),...n}))).displayName="BadgeContainer";const __=({status:e})=>{switch(e){case rw.DRAFT:return t.jsx(P_,{variant:"secondary",children:"Draft"});case rw.ACTIVE:return t.jsx(P_,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case rw.RUNNING:return t.jsx(P_,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case rw.COMPLETED:return t.jsx(P_,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case rw.FAILED:return t.jsx(P_,{variant:"destructive",children:"Failed"});case rw.DEACTIVATED:return t.jsx(P_,{variant:"destructive",children:"Cancelled"});default:bw(e,rw)}},N_=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=Dc(),c=CS(),[u,d]=n.useState(!1),h=e=>t.jsx(__,{status:e}),f=e=>{let n="bg-gray-400";switch(e){case rw.ACTIVE:n="bg-green-500";break;case rw.DRAFT:n="bg-gray-400";break;case rw.DEACTIVATED:n="bg-red-500";break;case rw.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},p=n=>t.jsx(E_,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[f(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),h(n.status)]})]})},{header:"Stats",accessorKey:"emailsSent",width:"25%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ow.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(ow.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-gray-600",children:r?tT(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const r=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 Ja(`${Hx}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:o||void 0});return{items:r.automations,cursor:r.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-gray-400"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:t=>{e(t.id)},className:"rounded-lg bg-white"}),m=[{id:"all",label:"All",content:p()},{id:"active",label:"Active",content:p("active")},{id:"draft",label:"Drafts",content:p("draft")}];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Dd,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(y_,{placeholder:"Search automations...",value:o,onChange:e=>i(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(dw,{variant:"outline",onClick:()=>d(!0),children:[t.jsx(Nd,{}),"Create New Automation"]})})]}),t.jsx(cC,{tabs:m,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(d_,{open:u,onOpenChange:d,children:t.jsx(p_,{hideCloseButton:!0,children:t.jsx(Ew,{onClose: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`)},iconDefinitions:r})})})]})},D_=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 Ja(`${Kx}${t.toString()?`?${t.toString()}`:""}`)).data};var M_=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(M_||{}),O_=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(O_||{}),R_=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(R_||{});const A_=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Kx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ja(`${Kx}/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}},L_=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ja(`${Kx}/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]})}}},I_=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ja(`${Kx}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},F_=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await Ja(`${Kx}/${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}};var $_=i.forwardRef(((e,n)=>t.jsx(Vc.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));$_.displayName="Label";var q_=$_;const z_=nd("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),U_=i.forwardRef((({className:e,...n},r)=>t.jsx(q_,{ref:r,className:Rh(z_(),e),...n})));U_.displayName=q_.displayName;const B_={[R_.EQUALS]:"Equals",[R_.NOT_EQUALS]:"Not Equals",[R_.GREATER_THAN]:"Greater Than",[R_.LESS_THAN]:"Less Than",[R_.EXISTS]:"Exists"},V_={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"};var K_=.999,H_=/[\\\/_+.#"@\[\(\{&]/,W_=/[\\\/_+.#"@\[\(\{&]/g,G_=/[\s-]/,Y_=/[\s-]/g;function Q_(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,h=r.charAt(i),f=n.indexOf(h,o),p=0;f>=0;)(l=Q_(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:H_.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(W_))&&o>0&&(l*=Math.pow(K_,u.length))):G_.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(Y_))&&o>0&&(l*=Math.pow(K_,d.length))):(l*=.17,o>0&&(l*=Math.pow(K_,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=Q_(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>p&&(p=l),f=n.indexOf(h,f+1);return s[a]=p,p}function X_(e){return e.toLowerCase().replace(Y_," ")}function J_(e,t,n){return Q_(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,X_(e),X_(t),0,0,{})}function Z_(){return Z_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z_.apply(null,arguments)}function eN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function tN(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function nN(...e){return n.useCallback(tN(...e),e)}function rN(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=r.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return n.useMemo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return r.scopeName=t.scopeName,r}const oN=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{},iN=i["useId".toString()]||(()=>{});let sN=0;function aN(e){const[t,n]=i.useState(iN());return oN((()=>{n((e=>null!=e?e:String(sN++)))}),[e]),e||(t?`radix-${t}`:"")}function lN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function cN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:t}){const r=n.useState(e),[o]=r,i=n.useRef(o),s=lN(t);return n.useEffect((()=>{i.current!==o&&(s(o),i.current=o)}),[o,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:o,l=lN(r);return[a,n.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)}),[s,e,i,l])]}const uN=n.forwardRef(((e,t)=>{const{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(fN);if(s){const e=s.props.children,r=i.map((t=>t===s?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t));return n.createElement(dN,Z_({},o,{ref:t}),n.isValidElement(e)?n.cloneElement(e,void 0,r):null)}return n.createElement(dN,Z_({},o,{ref:t}),r)}));uN.displayName="Slot";const dN=n.forwardRef(((e,t)=>{const{children:r,...o}=e;return n.isValidElement(r)?n.cloneElement(r,{...pN(o,r.props),ref:t?tN(t,r.ref):r.ref}):n.Children.count(r)>1?n.Children.only(null):null}));dN.displayName="SlotClone";const hN=({children:e})=>n.createElement(n.Fragment,null,e);function fN(e){return n.isValidElement(e)&&e.type===hN}function pN(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}}const mN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=n.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?uN:t;return n.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),n.createElement(s,Z_({},i,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function gN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const vN="dismissableLayer.update",yN="dismissableLayer.pointerDownOutside",bN="dismissableLayer.focusOutside";let xN;const wN=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),SN=n.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=n.useContext(wN),[h,f]=n.useState(null),p=null!==(r=null==h?void 0:h.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,m]=n.useState({}),g=nN(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e),o=n.useRef(!1),i=n.useRef((()=>{}));return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let n=function(){kN(yN,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);o.current=!1},n=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e),o=n.useRef(!1);return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){kN(bN,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e);n.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}((e=>{x===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),n.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(xN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),CN(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=xN)}}),[h,p,o,d]),n.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),CN())}),[h,d]),n.useEffect((()=>{const e=()=>m({});return document.addEventListener(vN,e),()=>document.removeEventListener(vN,e)}),[]),n.createElement(mN.div,Z_({},u,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:eN(e.onFocusCapture,k.onFocusCapture),onBlurCapture:eN(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:eN(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function CN(){const e=new CustomEvent(vN);document.dispatchEvent(e)}function kN(e,t,n,{discrete:o}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync((()=>e.dispatchEvent(t)))}(i,s):i.dispatchEvent(s)}function EN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const jN="focusScope.autoFocusOnMount",TN="focusScope.autoFocusOnUnmount",PN={bubbles:!1,cancelable:!0},_N=n.forwardRef(((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=n.useState(null),u=EN(i),d=EN(s),h=n.useRef(null),f=nN(t,(e=>c(e))),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:ON(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ON(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ON(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,l,p.paused]),n.useEffect((()=>{if(l){RN.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(jN,PN);l.addEventListener(jN,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ON(r,{select:t}),document.activeElement!==n)return}((e=NN(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&ON(l))}return()=>{l.removeEventListener(jN,u),setTimeout((()=>{const e=new CustomEvent(TN,PN);l.addEventListener(TN,d),l.dispatchEvent(e),e.defaultPrevented||ON(null!=t?t:document.body,{select:!0}),l.removeEventListener(TN,d),RN.remove(p)}),0)}}var e}),[l,u,d,p]);const m=n.useCallback((e=>{if(!r&&!o)return;if(p.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=NN(e),n=DN(t,e),r=DN(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&ON(i,{select:!0})):(e.preventDefault(),r&&ON(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return n.createElement(mN.div,Z_({tabIndex:-1},a,{ref:f,onKeyDown:m}))}));function NN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function DN(e,t){for(const n of e)if(!MN(n,{upTo:t}))return n}function MN(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ON(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const RN=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=AN(e,t),e.unshift(t)},remove(t){var n;e=AN(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function AN(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const LN=n.forwardRef(((e,t)=>{var o;const{container:i=(null===globalThis||void 0===globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...s}=e;return i?r.createPortal(n.createElement(mN.div,Z_({},s,{ref:t})),i):null})),IN=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{};const FN=e=>{const{present:t,children:o}=e,i=function(e){const[t,o]=n.useState(),i=n.useRef({}),s=n.useRef(e),a=n.useRef("none"),l=e?"mounted":"unmounted",[c,u]=function(e,t){return n.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect((()=>{const e=$N(i.current);a.current="mounted"===c?e:"none"}),[c]),IN((()=>{const t=i.current,n=s.current;if(n!==e){const r=a.current,o=$N(t);if(e)u("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}}),[e,u]),IN((()=>{if(t){const e=e=>{const n=$N(i.current).includes(e.animationName);e.target===t&&n&&r.flushSync((()=>u("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=$N(i.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(t),s="function"==typeof o?o({present:i.isPresent}):n.Children.only(o),a=nN(i.ref,s.ref);return"function"==typeof o||i.isPresent?n.cloneElement(s,{ref:a}):null};function $N(e){return(null==e?void 0:e.animationName)||"none"}FN.displayName="Presence";let qN=0;function zN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var UN=$T(),BN=function(){},VN=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:BN,onWheelCapture:BN,onTouchMoveCapture:BN}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=NT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=IT([n,t]),S=_T(_T({},b),o);return i.createElement(i.Fragment,null,d&&i.createElement(x,{sideCar:UN,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),a?i.cloneElement(i.Children.only(l),_T(_T({},S),{ref:w})):i.createElement(y,_T({},S,{className:c,ref:w}),l))}));VN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},VN.classNames={fullWidth:OT,zeroRight:MT};var KN=!1;if("undefined"!=typeof window)try{var HN=Object.defineProperty({},"passive",{get:function(){return KN=!0,!0}});window.addEventListener("test",HN,HN),window.removeEventListener("test",HN,HN)}catch(EQ){KN=!1}var WN=!!KN&&{passive:!1},GN=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},YN=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),QN(e,n)){var r=XN(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},QN=function(e,t){return"v"===e?function(e){return GN(e,"overflowY")}(t):function(e){return GN(e,"overflowX")}(t)},XN=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},JN=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZN=function(e){return[e.deltaX,e.deltaY]},eD=function(e){return e&&"current"in e?e.current:e},tD=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},nD=0,rD=[];const oD=zT(UN,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(nD++)[0],s=i.useState((function(){return WT()}))[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DT([e.lockRef.current],(e.shards||[]).map(eD),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=JN(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=YN(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=YN(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=XN(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&QN(e,s)&&(u+=p,d+=f),s=s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return c&&0===u?l=!0:c||0!==d||(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(rD.length&&rD[rD.length-1]===s){var r="deltaY"in n?ZN(n):JN(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(eD).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=JN(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,ZN(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,JN(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return rD.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,WN),document.addEventListener("touchmove",c,WN),document.addEventListener("touchstart",d,WN),function(){rD=rD.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,WN),document.removeEventListener("touchmove",c,WN),document.removeEventListener("touchstart",d,WN)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:tD(o)}):null,p?i.createElement(tP,{gapMode:"margin"}):null)}));var iD=i.forwardRef((function(e,t){return i.createElement(VN,_T({},e,{ref:t,sideCar:oD}))}));iD.classNames=VN.classNames;const sD="Dialog",[aD,lD]=function(e,t=[]){let r=[];const o=()=>{const t=r.map((e=>n.createContext(e)));return function(r){const o=(null==r?void 0:r[e])||t;return n.useMemo((()=>({[`__scope${e}`]:{...r,[e]:o}})),[r,o])}};return o.scopeName=e,[function(t,o){const i=n.createContext(o),s=r.length;function a(t){const{scope:r,children:o,...a}=t,l=(null==r?void 0:r[e][s])||i,c=n.useMemo((()=>a),Object.values(a));return n.createElement(l.Provider,{value:c},o)}return r=[...r,o],a.displayName=t+"Provider",[a,function(r,a){const l=n.useContext((null==a?void 0:a[e][s])||i);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},rN(o,...t)]}(sD),[cD,uD]=aD(sD),dD="DialogPortal",[hD,fD]=aD(dD,{forceMount:void 0}),pD="DialogOverlay",mD=n.forwardRef(((e,t)=>{const r=fD(pD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=uD(pD,e.__scopeDialog);return s.modal?n.createElement(FN,{present:o||s.open},n.createElement(gD,Z_({},i,{ref:t}))):null})),gD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,...o}=e,i=uD(pD,r);return n.createElement(iD,{as:uN,allowPinchZoom:!0,shards:[i.contentRef]},n.createElement(mN.div,Z_({"data-state":CD(i.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))})),vD="DialogContent",yD=n.forwardRef(((e,t)=>{const r=fD(vD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=uD(vD,e.__scopeDialog);return n.createElement(FN,{present:o||s.open},n.createElement(s.modal?bD:xD,Z_({},i,{ref:t})))})),bD=n.forwardRef(((e,t)=>{const r=uD(vD,e.__scopeDialog),o=n.useRef(null),i=nN(t,r.contentRef,o);return n.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),n.createElement(wD,Z_({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:eN(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:eN(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:eN(e.onFocusOutside,(e=>e.preventDefault()))}))})),xD=n.forwardRef(((e,t)=>{const r=uD(vD,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return n.createElement(wD,Z_({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented)||(o.current||null===(s=r.triggerRef.current)||void 0===s||s.focus(),t.preventDefault());o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null===(s=r.triggerRef.current)||void 0===s?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}}))})),wD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=uD(vD,r),c=nN(t,n.useRef(null));return n.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:zN()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:zN()),qN++,()=>{1===qN&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),qN--}}),[]),n.createElement(n.Fragment,null,n.createElement(_N,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s},n.createElement(SN,Z_({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":CD(l.open)},a,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)})),SD="DialogTitle";function CD(e){return e?"open":"closed"}!function(e,t){const r=n.createContext(t);function o(e){const{children:t,...o}=e,i=n.useMemo((()=>o),Object.values(o));return n.createElement(r.Provider,{value:i},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:vD,titleName:SD,docsSlug:"dialog"});const kD=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=n.useRef(null),c=n.useRef(null),[u=!1,d]=cN({prop:o,defaultProp:i,onChange:s});return n.createElement(cD,{scope:t,triggerRef:l,contentRef:c,contentId:aN(),titleId:aN(),descriptionId:aN(),open:u,onOpenChange:d,onOpenToggle:n.useCallback((()=>d((e=>!e))),[d]),modal:a},r)},ED=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,s=uD(dD,t);return n.createElement(hD,{scope:t,forceMount:r},n.Children.map(o,(e=>n.createElement(FN,{present:r||s.open},n.createElement(LN,{asChild:!0,container:i},e)))))},jD=mD,TD=yD;var PD='[cmdk-group=""]',_D='[cmdk-group-items=""]',ND='[cmdk-item=""]',DD=`${ND}:not([aria-disabled="true"])`,MD="cmdk-item-select",OD="data-value",RD=(e,t,n)=>J_(e,t,n),AD=i.createContext(void 0),LD=()=>i.useContext(AD),ID=i.createContext(void 0),FD=()=>i.useContext(ID),$D=i.createContext(void 0),qD=i.forwardRef(((e,t)=>{let n=eM((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=eM((()=>new Set)),o=eM((()=>new Map)),s=eM((()=>new Map)),a=eM((()=>new Set)),l=JD(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=i.useId(),x=i.useId(),w=i.useId(),S=i.useRef(null),C=oM();ZD((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),ZD((()=>{C(6,N)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)_(),T(),C(1,P);else if("value"===e&&(r||C(5,N),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,j(t,r)),C(2,(()=>{T(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{_(),T(),n.current.value||P(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&P(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:g,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function j(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:RD;return e?i(e,n.current.search,t):0}function T(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(_D);t?t.appendChild(e.parentElement===t?e:e.closest(`${_D} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${_D} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=S.current.querySelector(`${PD}[${OD}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function P(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(OD);k.setState("value",t||void 0)}function _(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=j(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function N(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(PD))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ND}[aria-selected="true"]`)}function M(){var e;return Array.from(null==(e=S.current)?void 0:e.querySelectorAll(DD))}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(OD))}function R(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(OD))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(PD);for(;r&&!t;)r=e>0?QD(r,PD):XD(r,PD),t=null==r?void 0:r.querySelector(DD);t?k.setState("value",t.getAttribute(OD)):R(e)}let L=()=>O(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):R(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?A(-1):R(-1)};return i.createElement(mN.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(MD);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:sM},c),iM(e,(e=>i.createElement(ID.Provider,{value:k},i.createElement(AD.Provider,{value:E},e)))))})),zD=i.forwardRef(((e,t)=>{var n,r;let o=i.useId(),s=i.useRef(null),a=i.useContext($D),l=LD(),c=JD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;ZD((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=rM(o,s,[e.value,e.children,s],e.keywords),h=FD(),f=nM((e=>e.value&&e.value===d.current)),p=nM((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){h.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(MD,m),()=>t.removeEventListener(MD,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(mN.div,{ref:tM([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.disablePointerSelection?void 0:g,onClick:v?void 0:m},e.children)})),UD=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=i.useId(),l=i.useRef(null),c=i.useRef(null),u=i.useId(),d=LD(),h=nM((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));ZD((()=>d.group(a)),[]),rM(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(mN.div,{ref:tM([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),iM(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement($D.Provider,{value:f},e)))))})),BD=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=nM((e=>!e.search));return n||s?i.createElement(mN.div,{ref:tM([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),VD=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=FD(),a=nM((e=>e.search)),l=nM((e=>e.value)),c=LD(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${ND}[${OD}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(mN.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),KD=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=LD();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(mN.div,{ref:tM([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},iM(e,(e=>i.createElement("div",{ref:tM([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),HD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(kD,{open:n,onOpenChange:r},i.createElement(ED,{container:a},i.createElement(jD,{"cmdk-overlay":"",className:o}),i.createElement(TD,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(qD,{ref:t,...l}))))})),WD=i.forwardRef(((e,t)=>nM((e=>0===e.filtered.count))?i.createElement(mN.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),GD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(mN.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},iM(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),YD=Object.assign(qD,{List:KD,Item:zD,Input:VD,Group:UD,Separator:BD,Dialog:HD,Empty:WD,Loading:GD});function QD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function XD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JD(e){let t=i.useRef(e);return ZD((()=>{t.current=e})),t}var ZD="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function eM(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function tM(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function nM(e){let t=FD(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function rM(e,t,n,r=[]){let o=i.useRef(),s=LD();return ZD((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(OD,a),o.current=a})),o}var oM=()=>{let[e,t]=i.useState(),n=eM((()=>new Map));return ZD((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function iM({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var sM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const aM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD,{ref:r,className:Rh("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));aM.displayName=YD.displayName;const lM=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(Dd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(YD.Input,{ref:o,className:Rh("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));lM.displayName=YD.Input.displayName;const cM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.List,{ref:r,className:Rh("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));cM.displayName=YD.List.displayName;const uM=i.forwardRef(((e,n)=>t.jsx(YD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));uM.displayName=YD.Empty.displayName;const dM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Group,{ref:r,className:Rh("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));dM.displayName=YD.Group.displayName;const hM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Separator,{ref:r,className:Rh("-mx-1 h-px bg-border",e),...n})));hM.displayName=YD.Separator.displayName;const fM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Item,{ref:r,className:Rh("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));fM.displayName=YD.Item.displayName;var pM="focusScope.autoFocusOnMount",mM="focusScope.autoFocusOnUnmount",gM={bubbles:!1,cancelable:!0},vM=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:wM(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||wM(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&wM(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){SM.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(pM,gM);c.addEventListener(pM,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wM(r,{select:t}),document.activeElement!==n)return}((e=yM(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&wM(c))}return()=>{c.removeEventListener(pM,d),setTimeout((()=>{const e=new CustomEvent(mM,gM);c.addEventListener(mM,h),c.dispatchEvent(e),e.defaultPrevented||wM(t??document.body,{select:!0}),c.removeEventListener(mM,h),SM.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=yM(e),n=bM(t,e),r=bM(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&wM(i,{select:!0})):(e.preventDefault(),r&&wM(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(Vc.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function yM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function bM(e,t){for(const n of e)if(!xM(n,{upTo:t}))return n}function xM(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function wM(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}vM.displayName="FocusScope";var SM=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=CM(e,t),e.unshift(t)},remove(t){e=CM(e,t),e[0]?.resume()}}}();function CM(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var kM="Popover",[EM,jM]=Lc(kM,[Zk]),TM=Zk(),[PM,_M]=EM(kM),NM=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=TM(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(mE,{...c,children:t.jsx(PM,{scope:n,contentId:wC(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:i.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>h(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>h(!1)),[]),modal:l,children:r})})};NM.displayName=kM;var DM="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=_M(DM,r),a=TM(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(gE,{...a,...o,ref:n})})).displayName=DM;var MM="PopoverTrigger",OM=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(MM,r),s=TM(r),a=Ac(n,i.triggerRef),l=t.jsx(Vc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":VM(i.open),...o,ref:a,onClick:Mc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(gE,{asChild:!0,...s,children:l})}));OM.displayName=MM;var RM="PopoverPortal",[AM,LM]=EM(RM,{forceMount:void 0}),IM=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=_M(RM,n);return t.jsx(AM,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};IM.displayName=RM;var FM="PopoverContent",$M=i.forwardRef(((e,n)=>{const r=LM(FM,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=_M(FM,e.__scopePopover);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?qM:zM,{...i,ref:n})})}));$M.displayName=FM;var qM=i.forwardRef(((e,n)=>{const r=_M(FM,e.__scopePopover),o=i.useRef(null),s=Ac(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(vP,{as:Fc,allowPinchZoom:!0,children:t.jsx(UM,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),zM=i.forwardRef(((e,n)=>{const r=_M(FM,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(UM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),UM=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=_M(FM,r),p=TM(r);return TT(),t.jsx(vM,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(vE,{"data-state":VM(f.open),role:"dialog",id:f.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),BM="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(BM,r);return t.jsx(Vc.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=BM;function VM(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=TM(r);return t.jsx(yE,{...i,...o,ref:n})})).displayName="PopoverArrow";var KM=IM,HM=$M;const WM=NM,GM=OM,YM=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,usePrimitiveWrapper:o=!0,...i},s)=>o?t.jsx(KM,{children:t.jsx(HM,{ref:s,align:n,sideOffset:r,className:Rh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}):t.jsx(HM,{ref:s,align:n,sideOffset:r,className:Rh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})));YM.displayName=HM.displayName;const QM=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(WM,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{"aria-expanded":s,className:"w-[200px] justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(pd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(YM,{className:"w-[200px] p-0",children:t.jsxs(aM,{children:[t.jsx(lM,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(cM,{children:[t.jsxs(uM,{children:["No ",o.toLowerCase()," found."]}),t.jsx(dM,{children:e.map((e=>t.jsxs(fM,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(cd,{className:Rh("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function XM(e){return(XM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function JM(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ZM(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function eO(e){ZM(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===XM(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function tO(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function nO(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var rO={};function oO(){return rO}function iO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function sO(e){return ZM(1,arguments),iO(e,{weekStartsOn:1})}function aO(e){ZM(1,arguments);var t=function(e){ZM(1,arguments);var t=eO(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=sO(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=sO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),sO(n)}function lO(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function cO(e){ZM(1,arguments);var t=eO(e);return t.setHours(0,0,0,0),t}function uO(e,t){ZM(2,arguments);var n=cO(e),r=cO(t),o=n.getTime()-lO(n),i=r.getTime()-lO(r);return Math.round((o-i)/864e5)}function dO(e,t){return ZM(2,arguments),tO(e,7*JM(t))}function hO(e,t){return ZM(2,arguments),nO(e,12*JM(t))}function fO(e,t){ZM(2,arguments);var n=cO(e),r=cO(t);return n.getTime()===r.getTime()}function pO(e){return ZM(1,arguments),e instanceof Date||"object"===XM(e)&&"[object Date]"===Object.prototype.toString.call(e)}function mO(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function gO(e){ZM(1,arguments);var t=eO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function vO(e){ZM(1,arguments);var t=eO(e);return t.setDate(1),t.setHours(0,0,0,0),t}function yO(e){ZM(1,arguments);var t=eO(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function bO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getDay(),p=6+(f<d?-7:0)-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function xO(e){return ZM(1,arguments),bO(e,{weekStartsOn:1})}function wO(e,t){return ZM(2,arguments),function(e,t){ZM(2,arguments);var n=eO(e).getTime(),r=JM(t);return new Date(n+r)}(e,-JM(t))}function SO(e){ZM(1,arguments);var t=eO(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function CO(e){ZM(1,arguments);var t=eO(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=SO(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=SO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function kO(e){ZM(1,arguments);var t=eO(e),n=SO(t).getTime()-function(e){ZM(1,arguments);var t=CO(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),SO(n)}(t).getTime();return Math.round(n/6048e5)+1}function EO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function jO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=eO(e),d=u.getUTCFullYear(),h=oO(),f=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var m=EO(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=EO(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function TO(e,t){ZM(1,arguments);var n=eO(e),r=EO(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=jO(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),EO(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function PO(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var _O=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return PO("yy"===t?r%100:r,t.length)},NO=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):PO(n+1,2)},DO=function(e,t){return PO(e.getUTCDate(),t.length)},MO=function(e,t){return PO(e.getUTCHours()%12||12,t.length)},OO=function(e,t){return PO(e.getUTCHours(),t.length)},RO=function(e,t){return PO(e.getUTCMinutes(),t.length)},AO=function(e,t){return PO(e.getUTCSeconds(),t.length)},LO=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return PO(Math.floor(r*Math.pow(10,n-3)),t.length)},IO="midnight",FO="noon",$O="morning",qO="afternoon",zO="evening",UO="night",BO={G:function(e,t,n){var r=e.getUTCFullYear()>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){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _O(e,t)},Y:function(e,t,n,r){var o=jO(e,r),i=o>0?o:1-o;return"YY"===t?PO(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):PO(i,t.length)},R:function(e,t){return PO(CO(e),t.length)},u:function(e,t){return PO(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return PO(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){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return PO(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){var r=e.getUTCMonth();switch(t){case"M":case"MM":return NO(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){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return PO(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){var o=TO(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):PO(o,t.length)},I:function(e,t,n){var r=kO(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):PO(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):DO(e,t)},D:function(e,t,n){var r=function(e){ZM(1,arguments);var t=eO(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):PO(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();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){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return PO(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){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return PO(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){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return PO(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){var r=e.getUTCHours()/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){var r,o=e.getUTCHours();switch(r=12===o?FO:0===o?IO:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?zO:o>=12?qO:o>=4?$O:UO,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return MO(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):OO(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):PO(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):PO(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):RO(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):AO(e,t)},S:function(e,t){return LO(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return KO(o);case"XXXX":case"XX":return HO(o);default:return HO(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return KO(o);case"xxxx":case"xx":return HO(o);default:return HO(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+VO(o,":");default:return"GMT"+HO(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+VO(o,":");default:return"GMT"+HO(o,":")}},t:function(e,t,n,r){return PO(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return PO((r._originalDate||e).getTime(),t.length)}};function VO(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+PO(i,2)}function KO(e,t){return e%60==0?(e>0?"-":"+")+PO(Math.abs(e)/60,2):HO(e,t)}function HO(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+PO(Math.floor(o/60),2)+n+PO(o%60,2)}var WO=function(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"})}},GO=function(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"})}},YO={p:GO,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return WO(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",WO(o,t)).replace("{{time}}",GO(i,t))}},QO=["D","DD"],XO=["YY","YYYY"];function JO(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ZO={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 eR(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var tR={date:eR({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eR({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:eR({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rR(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var oR={ordinalNumber:function(e,t){var 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:rR({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rR({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:rR({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:rR({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:rR({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"})};function iR(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var sR={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:iR({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:iR({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:function(e){return e+1}}),month:iR({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:iR({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:iR({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"})},aR={code:"en-US",formatDistance:function(e,t,n){var r,o=ZO[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:tR,formatRelative:function(e,t,n,r){return nR[e]},localize:oR,match:sR,options:{weekStartsOn:0,firstWeekContainsDate:1}},lR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uR=/^'([^]*?)'?$/,dR=/''/g,hR=/[a-zA-Z]/;function fR(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;ZM(2,arguments);var w=String(t),S=oO(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:aR,k=JM(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=JM(null!==(f=null!==(p=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==p?p:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var j=eO(e);if(!function(e){if(ZM(1,arguments),!pO(e)&&"number"!=typeof e)return!1;var t=eO(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var T=wO(j,lO(j)),P={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(cR).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,YO[t])(e,C.formatLong):e})).join("").match(lR).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(uR);if(!t)return e;return t[1].replace(dR,"'")}(r);var i=BO[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===XO.indexOf(r)||JO(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==QO.indexOf(e)}(r)||JO(r,t,String(e)),i(T,r,C.localize,P);if(o.match(hR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function pR(e){return ZM(1,arguments),Math.floor(function(e){return ZM(1,arguments),eO(e).getTime()}(e)/1e3)}function mR(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=function(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=eO(e),d=u.getFullYear(),h=oO(),f=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var m=iO(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=iO(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),iO(f,t)}function gR(e,t){return ZM(1,arguments),function(e,t,n){ZM(2,arguments);var r=iO(e,n),o=iO(t,n),i=r.getTime()-lO(r),s=o.getTime()-lO(o);return Math.round((i-s)/6048e5)}(function(e){ZM(1,arguments);var t=eO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),vO(e),t)+1}function vR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getTime()>r.getTime()}function yR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getTime()<r.getTime()}function bR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function xR(e,t){return ZM(2,arguments),tO(e,-JM(t))}function wR(e,t){ZM(2,arguments);var n=eO(e),r=JM(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){ZM(1,arguments);var t=eO(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function SR(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var CR=function(){return CR=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CR.apply(this,arguments)};function kR(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function ER(e){return"multiple"===e.mode}function jR(e){return"range"===e.mode}function TR(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var PR={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var _R=Object.freeze({__proto__:null,formatCaption:function(e,t){return fR(e,"LLLL y",t)},formatDay:function(e,t){return fR(e,"d",t)},formatMonthCaption:function(e,t){return fR(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return fR(e,"cccccc",t)},formatYearCaption:function(e,t){return fR(e,"yyyy",t)}}),NR=Object.freeze({__proto__:null,labelDay:function(e,t,n){return fR(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return fR(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var DR=n.createContext(void 0);function MR(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:PR,formatters:_R,labels:NR,locale:aR,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=vO(r):t&&(i=new Date(t,0,1)),o?s=gO(o):n&&(s=new Date(n,11,31)),{fromDate:i?cO(i):void 0,toDate:s?cO(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(TR(o)||ER(o)||jR(o))&&(r=o.onSelect);var u=CR(CR(CR({},i),o),{captionLayout:c,classNames:CR(CR({},i.classNames),o.classNames),components:CR({},o.components),formatters:CR(CR({},i.formatters),o.formatters),fromDate:a,labels:CR(CR({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:CR(CR({},i.modifiers),o.modifiers),modifiersClassNames:CR(CR({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:CR(CR({},i.styles),o.styles),toDate:l});return t.jsx(DR.Provider,{value:u,children:e.children})}function OR(){var e=n.useContext(DR);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function RR(e){var n=OR();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function AR(e){return t.jsx("svg",CR({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function LR(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=OR(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:AR;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function IR(e){var n,r=OR(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var h=[];if(function(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=vO(o),p=o.getMonth();p<=i.getMonth();p++)h.push(wR(f,p));else for(f=vO(new Date),p=0;p<=11;p++)h.push(wR(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:LR;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=wR(vO(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:h.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function FR(e){var n,r=e.displayMonth,o=OR(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,h=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var p=i.getFullYear(),m=s.getFullYear(),g=p;g<=m;g++)f.push(SR(yO(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:LR;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=SR(vO(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function $R(){var e=OR(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&mO(n,t)<0&&(t=nO(n,-1*(i-1))),r&&mO(t,r)<0&&(t=r),vO(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=vO(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var qR=n.createContext(void 0);function zR(e){var n=OR(),r=$R(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=vO(e),i=mO(vO(nO(o,r)),o),s=[],a=0;a<i;a++){var l=nO(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=vO(e);if(!n)return nO(s,i);if(!(mO(n,e)<o))return nO(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=vO(e);if(!n)return nO(i,-o);if(!(mO(i,n)<=0))return nO(i,-o)}}(o,n),c=function(e){return s.some((function(t){return bR(e,t)}))};return t.jsx(qR.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&yR(e,t)?i(nO(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function UR(){var e=n.useContext(qR);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function BR(e){var n,r=OR(),o=r.classNames,i=r.styles,s=r.components,a=UR().goToMonth,l=function(t){a(nO(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:RR,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(IR,{onChange:l,displayMonth:e.displayMonth}),t.jsx(FR,{onChange:l,displayMonth:e.displayMonth})]})}function VR(e){return t.jsx("svg",CR({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function KR(e){return t.jsx("svg",CR({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var HR=n.forwardRef((function(e,n){var r=OR(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=CR(CR({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",CR({},e,{ref:n,type:"button",className:a,style:l}))}));function WR(e){var n,r,o=OR(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,h=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),p=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:KR,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:VR;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(HR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(HR,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})})]})}function GR(e){var n=OR().numberOfMonths,r=UR(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return bR(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(WR,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function YR(e){var n,r,o=OR(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:RR;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(BR,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(BR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(GR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(GR,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function QR(e){var n=OR(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function XR(){var e=OR(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?sO(new Date):iO(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=tO(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function JR(){var e,n=OR(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:XR;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function ZR(e){var n=OR();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var eA=n.createContext(void 0);function tA(e){if(!ER(e.initialProps)){return t.jsx(eA.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(nA,{initialProps:e.initialProps,children:e.children})}function nA(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return fO(t,e)}));return Boolean(t&&!n)})),t.jsx(eA.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?kR([],o):[];if(t.selected){var u=c.findIndex((function(t){return fO(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function rA(){var e=n.useContext(eA);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var oA,iA,sA=n.createContext(void 0);function aA(e){if(!jR(e.initialProps)){return t.jsx(sA.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(lA,{initialProps:e.initialProps,children:e.children})}function lA(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],fO(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:xR(s,l-1),before:tO(s,l-1)}),s&&a&&u.disabled.push({after:s,before:tO(s,l-1)}),!s&&a&&u.disabled.push({after:xR(a,l-1),before:tO(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:tO(s,1-c)}),u.disabled.push({after:tO(s,c-1)})),s&&a){var d=c-(uO(a,s)+1);u.disabled.push({before:xR(s,d)}),u.disabled.push({after:tO(a,d)})}!s&&a&&(u.disabled.push({before:tO(a,1-c)}),u.disabled.push({after:tO(a,c-1)}))}return t.jsx(sA.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(fO(o,e)&&fO(r,e))return;if(fO(o,e))return{from:o,to:void 0};if(fO(r,e))return;return vR(r,e)?{from:e,to:o}:{from:r,to:e}}return o?vR(e,o)?{from:o,to:e}:{from:e,to:o}:r?yR(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function cA(){var e=n.useContext(sA);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function uA(e){return Array.isArray(e)?kR([],e):void 0!==e?[e]:[]}(iA=oA||(oA={})).Outside="outside",iA.Disabled="disabled",iA.Selected="selected",iA.Hidden="hidden",iA.Today="today",iA.RangeStart="range_start",iA.RangeEnd="range_end",iA.RangeMiddle="range_middle";var dA=oA.Selected,hA=oA.Disabled,fA=oA.Hidden,pA=oA.Today,mA=oA.RangeEnd,gA=oA.RangeMiddle,vA=oA.RangeStart,yA=oA.Outside;var bA=n.createContext(void 0);function xA(e){var n=OR(),r=function(e,t,n){var r,o=((r={})[dA]=uA(e.selected),r[hA]=uA(e.disabled),r[fA]=uA(e.hidden),r[pA]=[e.today],r[mA]=[],r[gA]=[],r[vA]=[],r[yA]=[],r);return e.fromDate&&o[hA].push({before:e.fromDate}),e.toDate&&o[hA].push({after:e.toDate}),ER(e)?o[hA]=o[hA].concat(t.modifiers[hA]):jR(e)&&(o[hA]=o[hA].concat(n.modifiers[hA]),o[vA]=n.modifiers[vA],o[gA]=n.modifiers[gA],o[mA]=n.modifiers[mA]),o}(n,rA(),cA()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=uA(e[1])})),t}(n.modifiers),i=CR(CR({},r),o);return t.jsx(bA.Provider,{value:i,children:e.children})}function wA(){var e=n.useContext(bA);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function SA(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(pO(t))return fO(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(pO)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(uO(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),uO(n,i)>=0&&uO(s,n)>=0):s?fO(s,n):!!i&&fO(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=uO(t.before,e)>0,l=uO(t.after,e)<0;return vR(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?uO(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?uO(t.before,e)>0:"function"==typeof t&&t(e)}))}function CA(e,t,n){var r=Object.keys(t).reduce((function(n,r){return SA(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!bR(e,n)&&(o.outside=!0),o}function kA(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:tO,week:dO,month:nO,year:hO,startOfWeek:function(e){return o.ISOWeek?sO(e):iO(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?xO(e):bO(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(ZM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==XM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=eO(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,h]):"after"===r&&u&&(h=function(e){var t,n;if(ZM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==XM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=eO(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=CA(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:kA(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:CR(CR({},a),{count:a.count+1})})}var EA=n.createContext(void 0);function jA(e){var r=UR(),o=wA(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=vO(e[0]),i=gO(e[e.length-1]),s=o;s<=i;){var a=CA(s,t);if(a.disabled||a.hidden)s=tO(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=tO(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=OR(),m=function(e,t){if(s){var n=kA(s,{moveBy:e,direction:t,context:p,modifiers:o});fO(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(EA.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function TA(){var e=n.useContext(EA);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var PA=n.createContext(void 0);function _A(e){if(!TR(e.initialProps)){return t.jsx(PA.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(NA,{initialProps:e.initialProps,children:e.children})}function NA(e){var n=e.initialProps;return t.jsx(PA.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function DA(){var e=n.useContext(PA);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function MA(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(oA).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function OA(e,r,o){var i,s,a,l=OR(),c=TA(),u=function(e,t){return CA(e,wA(),t)}(e,r),d=function(e,t){var n=OR(),r=DA(),o=rA(),i=cA(),s=TA(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;TR(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):ER(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):jR(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;h(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),y()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),h=function(){var e=OR(),t=DA(),n=rA(),r=cA();return TR(e)?t.selected:ER(e)?n.selected:jR(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&fO(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=MA(l,u).join(" "),m=function(e,t){var n=CR({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=CR(CR({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),v=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:ZR,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&fO(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&fO(c.focusedDay,e),w=CR(CR(CR({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:h,buttonProps:w,divProps:y}}function RA(e){var r=n.useRef(null),o=OA(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(HR,CR({name:"day",ref:r},o.buttonProps)):t.jsx("div",CR({},o.divProps))}function AA(e){var n=e.number,r=e.dates,o=OR(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(HR,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function LA(e){var n,r,o,i=OR(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:RA,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:AA;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},pR(n))}))]})}function IA(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?xO(t):bO(t,n),o=(null==n?void 0:n.ISOWeek)?sO(e):iO(e,n),i=uO(r,o),s=[],a=0;a<=i;a++)s.push(tO(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){ZM(1,arguments);var t=eO(e),n=sO(t).getTime()-aO(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){ZM(1,arguments);var n=eO(e),r=iO(n,t).getTime()-mR(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function FA(e){var n,r,o,i=OR(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,p=function(e,t){var n=IA(vO(e),gO(e),t);if(null==t?void 0:t.useFixedWeeks){var r=gR(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=dO(i,6-r),a=IA(dO(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:h}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:JR,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:LA,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:QR;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var $A="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,qA=!1,zA=0;function UA(){return"react-day-picker-".concat(++zA)}function BA(e){var r,o,i=OR(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=UR().displayMonths,d=function(e){var t,r=null!=e?e:qA?UA():null,o=n.useState(r),i=o[0],s=o[1];return $A((function(){null===i&&s(UA())}),[]),n.useEffect((function(){!1===qA&&(qA=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),h=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],p=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,v=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),p=CR(CR({},p),l.caption_start)),g&&(f.push(a.caption_end),p=CR(CR({},p),l.caption_end)),v&&(f.push(a.caption_between),p=CR(CR({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:YR;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(FA,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function VA(e){var n=OR();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function KA(e){var r,o,i=e.initialProps,s=OR(),a=TA(),l=UR(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var f=CR(CR({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return CR(CR({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:VA;return t.jsx("div",CR({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(BA,{displayIndex:n,displayMonth:e},n)}))})}))}function HA(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(MR,{initialProps:r,children:t.jsx(zR,{children:t.jsx(_A,{initialProps:r,children:t.jsx(tA,{initialProps:r,children:t.jsx(aA,{initialProps:r,children:t.jsx(xA,{children:t.jsx(jA,{children:n})})})})})})})}function WA(e){return t.jsx(HA,CR({},e,{children:t.jsx(KA,{initialProps:e})}))}function GA({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(WA,{showOutsideDays:r,className:Rh("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Rh(uw({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Rh("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Rh(uw({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(dd,{className:"h-4 w-4"}),IconRight:()=>t.jsx(hd,{className:"h-4 w-4"})},...o})}GA.displayName="Calendar";var YA=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(JA);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(QA,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(QA,{...o,ref:n,children:r})}));YA.displayName="Slot";var QA=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?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));QA.displayName="SlotClone";var XA=({children:e})=>t.jsx(t.Fragment,{children:e});function JA(e){return i.isValidElement(e)&&e.type===XA}var ZA=["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?YA: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}}),{}),eL="horizontal",tL=["horizontal","vertical"],nL=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=eL,...i}=e,s=function(e){return tL.includes(e)}(o)?o:eL;return t.jsx(ZA.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));nL.displayName="Separator";var rL=nL;const oL=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(rL,{ref:i,decorative:r,orientation:n,className:Rh("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));oL.displayName=rL.displayName;const iL=nd("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),sL=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:h,emptyMessage:f="No results found.",searchIcon:p=t.jsx(Dd,{className:"h-4 w-4"}),selectedValues:m,setSelectedValues:g,...v},y)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(WM,{open:b,onOpenChange:x,modal:l,children:[t.jsx(GM,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Rh("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(P_,{className:Rh(w?"animate-bounce":"",iL({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(P_,{className:Rh("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",iL({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(zd,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(oL,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(ud,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(ud,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(YM,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),usePrimitiveWrapper:!1,children:t.jsxs(aM,{children:[t.jsx(lM,{searchIcon:p,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),h&&(h(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(cM,{children:[t.jsx(uM,{children:f}),t.jsxs(dM,{children:[t.jsxs(fM,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:Rh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(fM,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Rh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(hM,{}),t.jsx(dM,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(fM,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(oL,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(fM,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(qd,{className:Rh("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function aL(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}sL.displayName="MultiSelect";var lL="Switch",[cL,uL]=Lc(lL),[dL,hL]=cL(lL),fL=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:h,...f}=e,[p,m]=i.useState(null),g=Ac(n,(e=>m(e))),v=i.useRef(!1),y=!p||(h||!!p.closest("form")),[b=!1,x]=cu({prop:s,defaultProp:a,onChange:d});return t.jsxs(dL,{scope:r,checked:b,disabled:c,children:[t.jsx(Vc.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":vL(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:Mc(e.onClick,(e=>{x((e=>!e)),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())}))}),y&&t.jsx(gL,{control:p,bubbles:!v.current,name:o,value:u,checked:b,required:l,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})}));fL.displayName=lL;var pL="SwitchThumb",mL=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=hL(pL,r);return t.jsx(Vc.span,{"data-state":vL(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));mL.displayName=pL;var gL=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=aL(r),c=Qk(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vL(e){return e?"checked":"unchecked"}var yL=fL,bL=mL;const xL=i.forwardRef((({className:e,...n},r)=>t.jsx(yL,{className:Rh("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:r,children:t.jsx(bL,{className:Rh("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));xL.displayName=yL.displayName;const wL=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const[c,u]=i.useState(e===M_.Date&&r.length>0&&r[0]instanceof Date?r[0]:void 0);if(e===M_.String)return n===R_.EXISTS?null:t.jsx(sL,{maxCount:2,options:(s||[]).map((e=>({label:e,value:e}))),value:r.map((e=>e)),onValueChange:e=>{o(e.map((e=>e)))},selectedValues:r.map((e=>e)),setSelectedValues:e=>{o(e.map((e=>e)))},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case M_.String:return t.length>0;case M_.Number:return!isNaN(Number(t));case M_.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case M_.Boolean:return"true"===t||"false"===t;case M_.Date:case M_.DateTime:return!isNaN(new Date(t).getTime());default:throw bw(n,M_)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===M_.Date)return t.jsx("div",{className:"grid gap-2",children:t.jsxs(WM,{modal:!0,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",className:Rh("w-[200px] justify-start text-left font-normal",!c&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),c?Zj(c,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(YM,{className:"w-auto p-0",align:"start",children:t.jsx(GA,{mode:"single",selected:c,onSelect:e=>{u(e),e&&o([e])},initialFocus:!0})})]})});if(e===M_.Number)return n===R_.EXISTS?null:t.jsx(y_,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===M_.Boolean){if(n===R_.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(xL,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(y_,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]"})},SL=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=Dc(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:M_.String,options:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:V_[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(QM,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:B_[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case M_.Boolean:l=[!1];break;case M_.Number:l=[0];break;case M_.Date:l=[new Date];break;case M_.String:l=o.options?.length?[o.options[0]]:[""];break;default:l=[""]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(QM,{options:l.map((e=>({value:e,label:B_[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx(wL,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...new Set([...e.value,...a.options])]:a.options,value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c}})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(dw,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(yd,{className:"h-4 w-4"})}),t.jsx(dw,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Rd,{className:"h-4 w-4"})})]})]})};function CL({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=Dc(),[s,a]=i.useState(!1),[l,c]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:u,isLoading:d}=I_(e||""),{updateSegment:h}=F_(e),{createSegment:f,isCreating:p,segmentsConditions:m}=A_();i.useEffect((()=>{m&&c(u?{version:"1.0",id:u.id,name:u.name,description:u.description,logic:"AND",conditions:u.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})}),[u,m]);if(!m||d)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Vx,{})});return t.jsxs("div",{children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8",children:t.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-hidden",children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(U_,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(y_,{placeholder:"Segment name",value:l.name,onChange:e=>c({...l,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(U_,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(y_,{placeholder:"Segment description",value:l.description,onChange:e=>c({...l,description:e.target.value})})]})]}),l.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(nf,{mode:"popLayout",children:l.conditions.map(((e,n)=>t.jsxs(zx.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(zx.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(zx.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(zx.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(zx.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(SL,{condition:e,onUpdate:e=>((e,t)=>{const n=[...l.conditions];n[e]=t,c({...l,conditions:n})})(n,e),segmentsConditions:m,onDuplicate:()=>(e=>{const t=[...l.conditions];t.splice(e+1,0,{...l.conditions[e]}),c({...l,conditions:t})})(n),onDelete:()=>(e=>{const t=l.conditions.filter(((t,n)=>n!==e));c({...l,conditions:t})})(n)})]},n)))})})})]})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(dw,{variant:"secondary",onClick:()=>{c({...l,conditions:[...l.conditions,{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})},children:[t.jsx(Nd,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(dw,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(dw,{variant:"secondary",onClick:async()=>{if(!l.name||!l.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==R_.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===R_.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"}}return{valid:!0,error:void 0}})(l.conditions);if(t){a(!0);try{e&&u?h({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):f({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{a(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:s||p,children:s||p?t.jsxs(t.Fragment,{children:[t.jsx(Sd,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})}function kL({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(d_,{open:e,onOpenChange:n,children:t.jsxs(p_,{className:"flex max-h-[90dvh] flex-col gap-0 p-0 max-w-4xl overflow-visible",hideCloseButton:!0,children:[t.jsx(m_,{className:"p-8 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(g_,{className:"text-3xl font-normal",children:r?"Edit Segment":"Create Segment"}),t.jsx(dw,{variant:"ghost",size:"icon",onClick:()=>n(!1),className:"h-8 w-8",children:t.jsx(zd,{className:"h-4 w-4"})})]})}),t.jsx(CL,{segmentId:r,setOpen:n,onSegmentUpdated:o})]})})}const EL=()=>{const[e,r]=n.useState(""),{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[O_.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[O_.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[O_.CUSTOM];return t.jsx(P_,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Dd,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(y_,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:a&&t.jsx(kL,{open:i,setOpen:s,segmentId:a})})]}),t.jsx(E_,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),c(n.type)]}),t.jsx("span",{className:"text-sm text-gray-500 truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-gray-600",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-gray-600",children:e?tT(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await D_({cursor:t,limit:n,search:e||void 0});return{items:r.segments,cursor:r.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-gray-400"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:e=>{e.type===O_.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},jL=({iconDefinitionsPassed:e})=>{const r=CS(),[o,i]=n.useState("automations"),s=iw(e),a=[{id:"automations",label:"Automations",content:t.jsx(N_,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:s})},{id:"segments",label:"Segments",content:t.jsx(EL,{})}];return t.jsx("div",{className:"h-full container max-w-screen-xl mx-auto",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ej,{iconDefinitions:s}),t.jsx("div",{className:"flex-1",children:t.jsx(cC,{tabs:a,activeTab:o,onTabChange:e=>i(e)})})]})})};var TL=i.createContext(void 0);function PL(e){const t=i.useContext(TL);return e||t||"ltr"}var _L="rovingFocusGroup.onEntryFocus",NL={bubbles:!1,cancelable:!0},DL="RovingFocusGroup",[ML,OL,RL]=Bc(DL),[AL,LL]=Lc(DL,[RL]),[IL,FL]=AL(DL),$L=i.forwardRef(((e,n)=>t.jsx(ML.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(ML.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(qL,{...e,ref:n})})})));$L.displayName=DL;var qL=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=i.useRef(null),m=Ac(n,p),g=PL(a),[v=null,y]=cu({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=Hc(d),S=OL(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(_L,w),()=>e.removeEventListener(_L,w)}),[w]),t.jsx(IL,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(Vc.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Mc(e.onMouseDown,(()=>{C.current=!0})),onFocus:Mc(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(_L,NL);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));VL([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Mc(e.onBlur,(()=>x(!1)))})})})),zL="RovingFocusGroupItem",UL=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=wC(),u=a||c,d=FL(zL,r),h=d.currentTabStopId===u,f=OL(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(ML.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(Vc.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Mc(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Mc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:BL[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>VL(o)))}var n,r}))})})}));UL.displayName=zL;var BL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VL(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var KL=$L,HL=UL,WL="Tabs",[GL,YL]=Lc(WL,[LL]),QL=LL(),[XL,JL]=GL(WL),ZL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=PL(l),[h,f]=cu({prop:o,onChange:i,defaultProp:s});return t.jsx(XL,{scope:r,baseId:wC(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(Vc.div,{dir:d,"data-orientation":a,...u,ref:n})})}));ZL.displayName=WL;var eI="TabsList",tI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=JL(eI,r),a=QL(r);return t.jsx(KL,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(Vc.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));tI.displayName=eI;var nI="TabsTrigger",rI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=JL(nI,r),l=QL(r),c=sI(a.baseId,o),u=aI(a.baseId,o),d=o===a.value;return t.jsx(HL,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(Vc.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Mc(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Mc(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));rI.displayName=nI;var oI="TabsContent",iI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=JL(oI,r),u=sI(c.baseId,o),d=aI(c.baseId,o),h=o===c.value,f=i.useRef(h);return i.useEffect((()=>{const e=requestAnimationFrame((()=>f.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(au,{present:s||h,children:({present:r})=>t.jsx(Vc.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&a})})}));function sI(e,t){return`${e}-trigger-${t}`}function aI(e,t){return`${e}-content-${t}`}iI.displayName=oI;var lI=tI,cI=rI,uI=iI;const dI=ZL,hI=i.forwardRef((({className:e,...n},r)=>t.jsx(lI,{ref:r,className:Rh("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));hI.displayName=lI.displayName;const fI=i.forwardRef((({className:e,...n},r)=>t.jsx(cI,{ref:r,className:Rh("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n})));fI.displayName=cI.displayName;const pI=i.forwardRef((({className:e,...n},r)=>t.jsx(uI,{ref:r,className:Rh("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));pI.displayName=uI.displayName;const mI=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ja(`${Wx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},gI=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await Ja(`${Wx}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},vI=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(`${Gx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},yI=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await Ja(`${Gx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Qx(e,{action:[...t.action_data||[],{action_type:"send_communication",action_metadata:{action_type:"send_communication",communication_group_id:r.id}}]}),n.invalidateQueries({queryKey:["automations"]}),n.invalidateQueries({queryKey:["communicationGroups"]}),r)});return{createCommunicationForAutomation:r.mutate,isCreating:r.isPending}},bI=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ja(`${Gx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},xI=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await Ja(`${Gx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},wI=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ja(`${Gx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},SI=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",CI=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),kI=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(CI,{type:"email"})}),EI=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(kI,{html:i,height:a.height,width:a.width})})]})},jI=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[400px] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap",children:n})})})})]}),TI=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(zx.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(dw,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(zx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(dw,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(zx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(nf,{mode:"wait",children:["email"===i&&e&&t.jsx(zx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(EI,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(zx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(jI,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},PI=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=Xx(e),{getCommunicationGroup:s}=vI(),{channelSenders:a}=mI(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=n.useMemo((()=>{const e=o?.action_data?.map((e=>e.action_metadata.communication_group_id));if(e&&0!==e.length&&!(e.length>1))return e[0]}),[o]);return n.useEffect((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.channel_senders.find((e=>e.id===t));n&&e.email_html_body&&c({emailHtml:e.email_html_body,emailSubject:e.email_subject,emailBaseDomain:n.channel_sender_metadata.baseDomain,emailFromName:n.channel_sender_metadata.emailFromName,emailFromEmail:`${n.channel_sender_metadata.userPart}@${n.channel_sender_metadata.baseDomain}`,emailPreviewText:e.email_preview_text});const r=e.sms_channel_sender_id,o=a.channel_senders.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:SI(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(Vx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(TI,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},_I=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=Jx(e),{isLoading:s}=tw(e);if(o||s)return t.jsx("div",{className:uC,children:t.jsx(Vx,{text:["Fetching Recipients","Finishing up"]})});if(i)return t.jsxs("div",{children:["Error: ",i.message]});if(!r||0===r.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(ow.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const a="30%",l="35%",c="35%";return t.jsxs("div",{className:"relative",children:[t.jsx("div",{children:t.jsx(ej,{automationId:e,iconDefinitions:n})}),t.jsx(oL,{className:"my-4"}),t.jsxs(b_,{children:[t.jsx(x_,{children:t.jsxs(S_,{children:[t.jsx(C_,{style:{width:a},children:"Name"}),t.jsx(C_,{style:{width:l},children:"Email"}),t.jsx(C_,{style:{width:c},children:"Phone"})]})}),t.jsx(w_,{children:r.recipients.map((e=>t.jsxs(S_,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(k_,{style:{width:a},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(k_,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(k_,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var NI,DI="dismissableLayer.update",MI="dismissableLayer.pointerDownOutside",OI="dismissableLayer.focusOutside",RI=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),AI=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(RI),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){II(MI,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){II(OI,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(NI=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),LI(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=NI)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),LI())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(DI,e),()=>document.removeEventListener(DI,e)}),[]),t.jsx(Vc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));AI.displayName="DismissableLayer";function LI(){const e=new CustomEvent(DI);document.dispatchEvent(e)}function II(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?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(RI),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Vc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var FI=["Enter"," "],$I=["ArrowUp","PageDown","End"],qI=["ArrowDown","PageUp","Home",...$I],zI={ltr:[...FI,"ArrowRight"],rtl:[...FI,"ArrowLeft"]},UI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},BI="Menu",[VI,KI,HI]=Bc(BI),[WI,GI]=Lc(BI,[HI,Zk,LL]),YI=Zk(),QI=LL(),[XI,JI]=WI(BI),[ZI,eF]=WI(BI),tF=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=YI(n),[u,d]=i.useState(null),h=i.useRef(!1),f=Hc(a),p=PL(s);return i.useEffect((()=>{const e=()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>h.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(mE,{...c,children:t.jsx(XI,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(ZI,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};tF.displayName=BI;var nF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YI(r);return t.jsx(gE,{...i,...o,ref:n})}));nF.displayName="MenuAnchor";var rF="MenuPortal",[oF,iF]=WI(rF,{forceMount:void 0}),sF=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=JI(rF,n);return t.jsx(oF,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};sF.displayName=rF;var aF="MenuContent",[lF,cF]=WI(aF),uF=i.forwardRef(((e,n)=>{const r=iF(aF,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=JI(aF,e.__scopeMenu),a=eF(aF,e.__scopeMenu);return t.jsx(VI.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||s.open,children:t.jsx(VI.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?dF:hF,{...i,ref:n})})})})})),dF=i.forwardRef(((e,n)=>{const r=JI(aF,e.__scopeMenu),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(fF,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),hF=i.forwardRef(((e,n)=>{const r=JI(aF,e.__scopeMenu);return t.jsx(fF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),fF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,y=JI(aF,r),b=eF(aF,r),x=YI(r),w=QI(r),S=KI(r),[C,k]=i.useState(null),E=i.useRef(null),j=Ac(n,E,y.onContentChange),T=i.useRef(0),P=i.useRef(""),_=i.useRef(0),N=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?vP:i.Fragment,R=g?{as:Fc,allowPinchZoom:!0}:void 0,A=e=>{const t=P.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){P.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(T.current)),[]),TT();const L=i.useCallback((e=>D.current===N.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return 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,t)}(e,N.current?.area)),[]);return t.jsx(lF,{scope:r,searchRef:P,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:_,onPointerGraceIntentChange:i.useCallback((e=>{N.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(vM,{asChild:!0,trapped:s,onMountAutoFocus:Mc(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(AI,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(KL,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Mc(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(vE,{role:"menu","aria-orientation":"vertical","data-state":$F(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Mc(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&A(e.key));if(e.target!==E.current)return;if(!qI.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));$I.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Mc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),P.current="")})),onPointerMove:Mc(e.onPointerMove,UF((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));uF.displayName=aF;var pF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{role:"group",...o,ref:n})}));pF.displayName="MenuGroup";var mF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{...o,ref:n})}));mF.displayName="MenuLabel";var gF="MenuItem",vF="menu.itemSelect",yF=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=eF(gF,e.__scopeMenu),c=cF(gF,e.__scopeMenu),u=Ac(n,a),d=i.useRef(!1);return t.jsx(bF,{...s,ref:u,disabled:r,onClick:Mc(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(vF,{bubbles:!0,cancelable:!0});e.addEventListener(vF,(e=>o?.(e)),{once:!0}),Kc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Mc(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Mc(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||FI.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));yF.displayName=gF;var bF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=cF(gF,r),c=QI(r),u=i.useRef(null),d=Ac(n,u),[h,f]=i.useState(!1),[p,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(VI.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(HL,{asChild:!0,...c,focusable:!o,children:t.jsx(Vc.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Mc(e.onPointerMove,UF((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Mc(e.onPointerLeave,UF((e=>l.onItemLeave(e)))),onFocus:Mc(e.onFocus,(()=>f(!0))),onBlur:Mc(e.onBlur,(()=>f(!1)))})})})})),xF=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(PF,{scope:e.__scopeMenu,checked:r,children:t.jsx(yF,{role:"menuitemcheckbox","aria-checked":qF(r)?"mixed":r,...i,ref:n,"data-state":zF(r),onSelect:Mc(i.onSelect,(()=>o?.(!!qF(r)||!r)),{checkForDefaultPrevented:!1})})})}));xF.displayName="MenuCheckboxItem";var wF="MenuRadioGroup",[SF,CF]=WI(wF,{value:void 0,onValueChange:()=>{}}),kF=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Hc(o);return t.jsx(SF,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(pF,{...i,ref:n})})}));kF.displayName=wF;var EF="MenuRadioItem",jF=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=CF(EF,e.__scopeMenu),s=r===i.value;return t.jsx(PF,{scope:e.__scopeMenu,checked:s,children:t.jsx(yF,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":zF(s),onSelect:Mc(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));jF.displayName=EF;var TF="MenuItemIndicator",[PF,_F]=WI(TF,{checked:!1}),NF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=_F(TF,r);return t.jsx(au,{present:o||qF(s.checked)||!0===s.checked,children:t.jsx(Vc.span,{...i,ref:n,"data-state":zF(s.checked)})})}));NF.displayName=TF;var DF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));DF.displayName="MenuSeparator";var MF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YI(r);return t.jsx(yE,{...i,...o,ref:n})}));MF.displayName="MenuArrow";var[OF,RF]=WI("MenuSub"),AF="MenuSubTrigger",LF=i.forwardRef(((e,n)=>{const r=JI(AF,e.__scopeMenu),o=eF(AF,e.__scopeMenu),s=RF(AF,e.__scopeMenu),a=cF(AF,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},h=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>h),[h]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(nF,{asChild:!0,...d,children:t.jsx(bF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":$F(r.open),...e,ref:Rc(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Mc(e.onPointerMove,UF((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),h()}),100))}))),onPointerLeave:Mc(e.onPointerLeave,UF((e=>{h();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Mc(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||zI[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));LF.displayName=AF;var IF="MenuSubContent",FF=i.forwardRef(((e,n)=>{const r=iF(aF,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=JI(aF,e.__scopeMenu),l=eF(aF,e.__scopeMenu),c=RF(IF,e.__scopeMenu),u=i.useRef(null),d=Ac(n,u);return t.jsx(VI.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||a.open,children:t.jsx(VI.Slot,{scope:e.__scopeMenu,children:t.jsx(fF,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Mc(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Mc(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Mc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=UI[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function $F(e){return e?"open":"closed"}function qF(e){return"indeterminate"===e}function zF(e){return qF(e)?"indeterminate":e?"checked":"unchecked"}function UF(e){return t=>"mouse"===t.pointerType?e(t):void 0}FF.displayName=IF;var BF=tF,VF=nF,KF=sF,HF=uF,WF=pF,GF=mF,YF=yF,QF=xF,XF=kF,JF=jF,ZF=NF,e$=DF,t$=MF,n$=LF,r$=FF,o$="DropdownMenu",[i$,s$]=Lc(o$,[GI]),a$=GI(),[l$,c$]=i$(o$),u$=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=a$(n),d=i.useRef(null),[h=!1,f]=cu({prop:s,defaultProp:a,onChange:l});return t.jsx(l$,{scope:n,triggerId:wC(),triggerRef:d,contentId:wC(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(BF,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};u$.displayName=o$;var d$="DropdownMenuTrigger",h$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=c$(d$,r),a=a$(r);return t.jsx(VF,{asChild:!0,...a,children:t.jsx(Vc.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:Rc(n,s.triggerRef),onPointerDown:Mc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Mc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));h$.displayName=d$;var f$=e=>{const{__scopeDropdownMenu:n,...r}=e,o=a$(n);return t.jsx(KF,{...o,...r})};f$.displayName="DropdownMenuPortal";var p$="DropdownMenuContent",m$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=c$(p$,r),a=a$(r),l=i.useRef(!1);return t.jsx(HF,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Mc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));m$.displayName=p$;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(WF,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var g$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(GF,{...i,...o,ref:n})}));g$.displayName="DropdownMenuLabel";var v$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(YF,{...i,...o,ref:n})}));v$.displayName="DropdownMenuItem";var y$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(QF,{...i,...o,ref:n})}));y$.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(XF,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var b$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(JF,{...i,...o,ref:n})}));b$.displayName="DropdownMenuRadioItem";var x$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(ZF,{...i,...o,ref:n})}));x$.displayName="DropdownMenuItemIndicator";var w$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(e$,{...i,...o,ref:n})}));w$.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(t$,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var S$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(n$,{...i,...o,ref:n})}));S$.displayName="DropdownMenuSubTrigger";var C$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(r$,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));C$.displayName="DropdownMenuSubContent";var k$=f$,E$=m$,j$=g$,T$=v$,P$=y$,_$=b$,N$=x$,D$=w$,M$=S$,O$=C$;const R$=u$,A$=h$;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(M$,{ref:i,className:Rh("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(hd,{className:"ml-auto"})]}))).displayName=M$.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(O$,{ref:r,className:Rh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=O$.displayName;const L$=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(k$,{children:t.jsx(E$,{ref:o,sideOffset:n,className:Rh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));L$.displayName=E$.displayName;const I$=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(T$,{ref:o,className:Rh("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));I$.displayName=T$.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(P$,{ref:i,className:Rh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(N$,{children:t.jsx(cd,{className:"h-4 w-4"})})}),n]}))).displayName=P$.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(_$,{ref:o,className:Rh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(N$,{children:t.jsx(vd,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=_$.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(j$,{ref:o,className:Rh("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=j$.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(D$,{ref:r,className:Rh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=D$.displayName;const F$="reach-styles-module__stepIndicatorContainer___FoKXB",$$="reach-styles-module__iconContainer___Ki-1n",q$="reach-styles-module__checkIcon___-krUS",z$="reach-styles-module__minusIcon___r5cKs",U$="reach-styles-module__minusIconActive___-4JHM",B$="reach-styles-module__minusIconInactive___JtvVB",V$="reach-styles-module__label___tiCMA",K$="reach-styles-module__labelActive___EXydD",H$="reach-styles-module__labelInactive___g-J3r",W$=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:F$,children:[t.jsx("div",n?{className:$$,children:t.jsx(cd,{className:q$})}:{className:$$,children:t.jsx(Pd,{className:Rh(z$,r?U$:B$)})}),t.jsx("span",{className:Rh(V$,r?K$:H$),children:e})]}),G$=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4",children:[!l&&t.jsxs(dw,{onClick:n,disabled:s,variant:"secondary",className:Rh("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(dw,{onClick:u,variant:"secondary",className:Rh("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(dw,{onClick:r,disabled:a,className:Rh("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),Y$="reach-styles-module__header___-izE2",Q$="reach-styles-module__title___n1hA9",X$="reach-styles-module__description___EvXM-",J$="reach-styles-module__content___okv68",Z$="reach-styles-module__footer___YA4U4",eq=nd("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),tq=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Rh(eq({variant:n}),e),...r})));tq.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Y$,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Q$,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(X$,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(J$,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Z$,e),...n}))).displayName="CardFooter";const nq=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},rq=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ja("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var oq=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(oq||{});function iq(e,[t,n]){return Math.min(n,Math.max(t,e))}var sq=[" ","Enter","ArrowUp","ArrowDown"],aq=[" ","Enter"],lq="Select",[cq,uq,dq]=Bc(lq),[hq,fq]=Lc(lq,[dq,Zk]),pq=Zk(),[mq,gq]=hq(lq),[vq,yq]=hq(lq),bq=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:p,required:m,form:g}=e,v=pq(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=PL(d),[E=!1,j]=cu({prop:o,defaultProp:s,onChange:a}),[T,P]=cu({prop:l,defaultProp:c,onChange:u}),_=i.useRef(null),N=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(mE,{...v,children:t.jsxs(mq,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:wC(),value:T,onValueChange:P,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:_,disabled:p,children:[t.jsx(cq.Provider,{scope:n,children:t.jsx(vq,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),N?t.jsxs(iz,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:T,onChange:e=>P(e.target.value),disabled:p,form:g,children:[void 0===T?t.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};bq.displayName=lq;var xq="SelectTrigger",wq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=pq(r),l=gq(xq,r),c=l.disabled||o,u=Ac(n,l.onTriggerChange),d=uq(r),h=i.useRef("touch"),[f,p,m]=sz((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=az(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(gE,{asChild:!0,...a,children:t.jsx(Vc.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":oz(l.value)?"":void 0,...s,ref:u,onClick:Mc(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Mc(s.onPointerDown,(e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:Mc(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||sq.includes(e.key)&&(g(),e.preventDefault())}))})})}));wq.displayName=xq;var Sq="SelectValue",Cq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=gq(Sq,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Ac(n,c.onValueNodeChange);return iu((()=>{u(d)}),[u,d]),t.jsx(Vc.span,{...l,ref:h,style:{pointerEvents:"none"},children:oz(c.value)?t.jsx(t.Fragment,{children:a}):s})}));Cq.displayName=Sq;var kq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(Vc.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));kq.displayName="SelectIcon";var Eq=e=>t.jsx(su,{asChild:!0,...e});Eq.displayName="SelectPortal";var jq="SelectContent",Tq=i.forwardRef(((e,n)=>{const r=gq(jq,e.__scopeSelect),[o,a]=i.useState();if(iu((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(_q,{scope:e.__scopeSelect,children:t.jsx(cq.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(Dq,{...e,ref:n})}));Tq.displayName=jq;var Pq=10,[_q,Nq]=hq(jq),Dq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=gq(jq,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Ac(n,(e=>S(e))),[j,T]=i.useState(null),[P,_]=i.useState(null),N=uq(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return kP(w)}),[w]),TT();const R=i.useCallback((e=>{const[t,...n]=N().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[N,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,A]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=sz((e=>{const t=N().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=az(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(T(e),r&&(O.current=!0))}),[x.value]),z=i.useCallback((()=>w?.focus()),[w]),U=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!O.current&&!n)&&_(e)}),[x.value]),B="popper"===o?Oq:Mq,V=B===Oq?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(_q,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:P,position:o,isPositioned:D,searchRef:F,children:t.jsx(vP,{as:Fc,allowPinchZoom:!0,children:t.jsx(vM,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Mc(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Mc(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))})})})})})}));Dq.displayName="SelectContentImpl";var Mq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=gq(jq,r),l=Nq(jq,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Ac(n,(e=>h(e))),p=uq(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-Pq,l=iq(o,[Pq,Math.max(Pq,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-Pq,u=iq(o,[Pq,Math.max(Pq,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*Pq,l=v.scrollHeight,u=window.getComputedStyle(d),h=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=h+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-Pq,j=s-E,T=y.offsetHeight/2,P=h+f+(y.offsetTop+T),_=x-P;if(P<=E){const e=i.length>0&&y===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(j,T+(e?k:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+g);c.style.height=P+t+"px"}else{const e=i.length>0&&y===i[0].ref.current;c.style.top="0px";const t=Math.max(E,h+v.offsetTop+(e?C:0)+T);c.style.height=t+_+"px",v.scrollTop=P-E+v.offsetTop}c.style.margin=`${Pq}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[p,a.trigger,a.valueNode,c,d,v,y,b,a.dir,o]);iu((()=>w()),[w]);const[S,C]=i.useState();iu((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(Rq,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(Vc.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));Mq.displayName="SelectItemAlignedPosition";var Oq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=Pq,...s}=e,a=pq(r);return t.jsx(vE,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));Oq.displayName="SelectPopperPosition";var[Rq,Aq]=hq(jq,{}),Lq="SelectViewport",Iq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=Nq(Lq,r),l=Aq(Lq,r),c=Ac(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(cq.Slot,{scope:r,children:t.jsx(Vc.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Mc(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Pq,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));Iq.displayName=Lq;var Fq="SelectGroup",[$q,qq]=hq(Fq);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=wC();return t.jsx($q,{scope:r,id:i,children:t.jsx(Vc.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=Fq;var zq="SelectLabel",Uq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=qq(zq,r);return t.jsx(Vc.div,{id:i.id,...o,ref:n})}));Uq.displayName=zq;var Bq="SelectItem",[Vq,Kq]=hq(Bq),Hq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=gq(Bq,r),u=Nq(Bq,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Ac(n,(e=>u.itemRefCallback?.(e,o,s))),v=wC(),y=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Vq,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(cq.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(Vc.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Mc(l.onFocus,(()=>m(!0))),onBlur:Mc(l.onBlur,(()=>m(!1))),onClick:Mc(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Mc(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Mc(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Mc(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Mc(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Mc(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(aq.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));Hq.displayName=Bq;var Wq="SelectItemText",Gq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=gq(Wq,r),u=Nq(Wq,r),d=Kq(Wq,r),h=yq(Wq,r),[f,p]=i.useState(null),m=Ac(n,(e=>p(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,v=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=h;return iu((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Vc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));Gq.displayName=Wq;var Yq="SelectItemIndicator",Qq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return Kq(Yq,r).isSelected?t.jsx(Vc.span,{"aria-hidden":!0,...o,ref:n}):null}));Qq.displayName=Yq;var Xq="SelectScrollUpButton",Jq=i.forwardRef(((e,n)=>{const r=Nq(Xq,e.__scopeSelect),o=Aq(Xq,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(tz,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Jq.displayName=Xq;var Zq="SelectScrollDownButton",ez=i.forwardRef(((e,n)=>{const r=Nq(Zq,e.__scopeSelect),o=Aq(Zq,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(tz,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));ez.displayName=Zq;var tz=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=Nq("SelectScrollButton",r),l=i.useRef(null),c=uq(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),iu((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(Vc.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Mc(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Mc(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Mc(s.onPointerLeave,(()=>{u()}))})})),nz=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(Vc.div,{"aria-hidden":!0,...o,ref:n})}));nz.displayName="SelectSeparator";var rz="SelectArrow";function oz(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=pq(r),s=gq(rz,r),a=Nq(rz,r);return s.open&&"popper"===a.position?t.jsx(yE,{...i,...o,ref:n}):null})).displayName=rz;var iz=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Ac(n,s),l=aL(r);return i.useEffect((()=>{const e=s.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[l,r]),t.jsx(uu,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function sz(e){const t=Hc(e),n=i.useRef(""),r=i.useRef(0),o=i.useCallback((e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(o)}),[t]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function az(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}iz.displayName="BubbleSelect";var lz=wq,cz=kq,uz=Eq,dz=Tq,hz=Iq,fz=Uq,pz=Hq,mz=Gq,gz=Qq,vz=Jq,yz=ez,bz=nz;const xz=bq,wz=Cq,Sz=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(lz,{ref:o,className:Rh("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(cz,{asChild:!0,children:t.jsx(ud,{className:"h-4 w-4 opacity-50"})})]})));Sz.displayName=lz.displayName;const Cz=i.forwardRef((({className:e,...n},r)=>t.jsx(vz,{ref:r,className:Rh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(fd,{className:"h-4 w-4"})})));Cz.displayName=vz.displayName;const kz=i.forwardRef((({className:e,...n},r)=>t.jsx(yz,{ref:r,className:Rh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ud,{className:"h-4 w-4"})})));kz.displayName=yz.displayName;const Ez=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(uz,{children:t.jsxs(dz,{ref:i,className:Rh("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(Cz,{}),t.jsx(hz,{className:Rh("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(kz,{})]})})));Ez.displayName=dz.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(fz,{ref:r,className:Rh("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=fz.displayName;const jz=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(pz,{ref:o,className:Rh("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(gz,{children:t.jsx(cd,{className:"h-4 w-4"})})}),t.jsx(mz,{children:n})]})));jz.displayName=pz.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(bz,{ref:r,className:Rh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=bz.displayName;const Tz=()=>t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsx("div",{className:"space-y-8",children:t.jsxs("div",{className:"bg-white rounded-xl border shadow-sm p-6",children:[t.jsx("h3",{className:"text-lg font-medium mb-4",children:"Using Dynamic Content"}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://cdn.embedreach.com/assets/engage/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx(pw,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(Ed,{}),selected:!0})]})]})})]}),Pz=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",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.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),_z={all:["stripo"],token:()=>[..._z.all,"token"],editorData:()=>[..._z.all,"editorData"],templates:()=>[..._z.all,"templates"],demoTemplate:()=>[..._z.templates(),"demo"]},Nz=async()=>(await Ja(`${Yx}/editor-data`)).data,Dz=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await Ja(`${Yx}/template/${e}`)).data)(e),...Wa}),Mz=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(Vx,{textColor:"white",color:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),Oz="UiEditorScript",Rz=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ja(`${Yx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(Oz))r();else{const e=document.createElement("script");e.id=Oz,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),Az=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=Dz(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:_z.editorData(),queryFn:Nz,...Wa}),invalidateEditorData:()=>e.invalidateQueries({queryKey:_z.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=bI();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||m(!0)}))}}),[o,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(Rz({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(Vx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(Mz,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},Lz=({automation:e})=>{const r=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[o,i]=n.useState(r()??null),[s,a]=n.useState(!1),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(null),[p,m]=n.useState(null),[g,v]=n.useState(!1),[y,b]=n.useState(!1),[x,w]=n.useState(null),[S,C]=n.useState(null),[k,E]=n.useState(null),[j,T]=n.useState(!1),{refetchAutomation:P}=Xx(e.id),[_,N]=n.useState(!1),D=nq(x,500),M=nq(S,500),{channelSenders:O}=mI(),{channelAccounts:R}=rq(),{getCommunicationGroup:A}=vI(),{createCommunicationForAutomation:L}=yI(e.id,e),{updateCommunicationGroup:I}=bI(),{updateChannelSender:F}=gI(),{updateAutomation:$}=ew(e.id),[q,z]=n.useState({width:0,height:0}),[U,B]=n.useState({width:0,height:0}),V=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{V.current&&requestAnimationFrame((()=>{B({width:V.current?V.current.offsetWidth-100:0,height:V.current?V.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[V]),n.useEffect((()=>{const e=()=>{z({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{l&&u&&p&&!s&&(a(!0),o?I({groupId:o,params:{email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}}}):L({email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}},{onSuccess:e=>{i(e.id)}}),a(!1))}),[l,u,h,p,e.action_data,I,$,r,o,s,L]),n.useEffect((()=>{o&&A(o,{onSuccess:e=>{K(e)}})}),[r,A,e.action_data,e,o,O?.channel_senders]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.channel_senders?.filter((e=>e.channel_sender_metadata.userPart));if(e?.[0]){const t=e[0];c(t.id),t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}}T(!0)}}),[j,O?.channel_senders,o,O]),n.useEffect((()=>{if(l){const e=O?.channel_senders?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.channel_senders,l,F]),n.useEffect((()=>{if(M){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M))return void E("Please enter a valid email address");E(null)}if(M){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.channel_senders,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),V.current&&B({width:V.current.offsetWidth,height:V.current.offsetHeight})}}),P())}),[g,o,A,P,O?.channel_senders]),!R||!O)return t.jsx("div",{children:t.jsx(Vx,{text:["Loading..."]})});const H=O.channel_senders?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.channel_accounts?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case oq.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case oq.TWILLIO:return null;default:throw bw(t.channel_account_metadata.type,oq)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(d_,{open:_,onOpenChange:N,children:t.jsxs(p_,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Email Preview Help"}),t.jsx(v_,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(Tz,{})]})}),t.jsx(d_,{open:g,onOpenChange:v,children:t.jsxs(p_,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Email Editor"}),t.jsx(v_,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(XE,{title:"Click to learn more about email template ",onClick:()=>N(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(Az,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(U_,{children:"From Email"}),t.jsxs(xz,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(Sz,{children:t.jsx(wz,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(Ez,{children:W?.map((e=>t.jsx(jz,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(U_,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(XE,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(y_,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(U_,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(XE,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(y_,{placeholder:"Enter reply to email",value:S??"",onChange:e=>C(e.target.value),disabled:!l}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(U_,{children:"Subject"}),t.jsx(y_,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(U_,{children:"Preview Text"}),t.jsx(XE,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(y_,{placeholder:"Enter preview text",value:h??"",onChange:e=>f(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(dw,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(Pz,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:V,children:t.jsx(kI,{html:p??"",height:U.height,width:U.width})})]})]})]})},Iz=async()=>(await Ja("/businesses/me")).data,Fz=["me"],$z=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Rh("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n})));$z.displayName="Textarea";const qz=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(!1),s=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(""),[c,u]=n.useState(null),[d,h]=n.useState(!1),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(s()??null),[b,x]=n.useState(!1),[w,S]=n.useState(!1),{channelSenders:C}=mI(),{data:k,isLoading:E}=ue({queryKey:Fz,queryFn:Iz,...Wa}),{channelAccounts:j}=rq(),{createCommunicationForAutomation:T}=yI(e.id,e),{updateCommunicationGroup:P}=bI(),{getCommunicationGroup:_}=vI(),{getMergeFields:N,isGetting:D}=xI(),M=n.useRef(null),O=nq(m,1e3),R=nq(c,1e3),A=nq(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?P({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):T({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,P,T]),n.useEffect((()=>{v&&_(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,_,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));e?.[0]&&u(e[0].id),x(!0)}}),[C,b]),n.useEffect((()=>{f||!k?.name||d||(h(!0),p(k.name))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(Vx,{text:["Loading..."]})});const I=C.channel_senders?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(d_,{open:w,onOpenChange:S,children:t.jsxs(p_,{children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"SMS Editor"}),t.jsx(v_,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx($z,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(xz,{value:a,onValueChange:e=>{const t=M.current,n=m||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);g(i),l(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(Sz,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(Ez,{children:N?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(jz,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(XE,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(m&&m.length>1400?m.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[m?m.length:0,"/",1600-(f?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(U_,{children:"From Number"}),t.jsxs(xz,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(Sz,{children:t.jsx(wz,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(Ez,{children:I?.map((e=>t.jsx(jz,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(U_,{children:"Company Name"}),t.jsx(XE,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(y_,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(e.target.value??null)},disabled:!c})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(dw,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(jI,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(CI,{type:"sms"})}):t.jsx(Pz,{type:"sms"})})]})]})]})},zz=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Dc(),a="flex items-center gap-2 px-3 py-1.5 rounded-md transition-all duration-200";return t.jsxs("div",{className:"",children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2",children:"Select the channels you want to use in this automation"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(dw,{variant:e.includes("email")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("email")?e.includes("sms")?n(["sms"]):s({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"email"]),o([...r||[],"email"]))},children:[t.jsx("span",{children:t.jsx(i.EmailIcon,{size:15})}),"Email"]}),t.jsxs(dw,{variant:e.includes("sms")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("sms")?e.includes("email")?n(["email"]):s({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"sms"]),o([...r||[],"sms"]))},children:[t.jsx("span",{children:t.jsx(i.SmsIcon,{size:15})}),"SMS"]})]})]})},Uz=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=vI(),{updateCommunicationGroup:c}=bI(),u=n.useMemo((()=>{const t=e.action_data?.map((e=>e.action_metadata.communication_group_id));if(t&&0!==t.length&&!(t.length>1))return t[0]}),[e]);n.useEffect((()=>{const e=u;if(!e)return i(["email"]),void a(["email"]);l(e,{onSuccess:e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),i(t),a(t)}})}),[e,l,u]),n.useEffect((()=>{const e=u;e&&o&&(o.includes("email")||c({groupId:e,params:{email_channel_sender_id:null}}),o.includes("sms")||c({groupId:e,params:{sms_channel_sender_id:null}}))}),[o,u,c]);const d=e=>{a((t=>t?.includes(e)?t?.filter((t=>t!==e)):[...t||[],e]))};return o&&s?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(tq,{className:"p-4 rounded-xl shadow-none",children:t.jsx(zz,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(tq,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("email"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(zx.div,{animate:{rotate:s?.includes("email")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Email Campaign"})]}),t.jsx(nf,{children:s?.includes("email")&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(Lz,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(tq,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("sms"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(zx.div,{animate:{rotate:s?.includes("sms")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"SMS Campaign"})]}),t.jsx(nf,{children:s?.includes("sms")&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(qz,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(Vx,{text:["Loading..."]})})},Bz=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=L_({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(zx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(zx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})},Vz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(WM,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(pd,{className:"opacity-50"})]})}),t.jsx(YM,{className:"w-[200px] p-0",children:t.jsxs(aM,{children:[t.jsx(lM,{placeholder:r,className:"h-9"}),t.jsxs(cM,{children:[t.jsx(uM,{children:o}),t.jsx(dM,{children:e.map((e=>t.jsxs(fM,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(cd,{className:Rh("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Kz=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):hj(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(Zj(o,"HH:mm")),{updateAutomation:d}=ew(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=hj(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:h}))<new Date(t.toLocaleString("en-US",{timeZone:h}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:h})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:nw.ONE_TIME,scheduled_at:s,timezone:h}})}),[o,h,d]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(WM,{children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",className:Rh("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),o?Zj(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(YM,{className:"w-auto p-0",children:t.jsx(GA,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:Rh("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Vz,{data:p,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:h,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=hj(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Hz=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(zx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(pw,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:nw.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(pw,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(nf,{children:"schedule"===i&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(Kz,{automation:r})})})})]}),r.trigger_metadata.scheduled_at&&t.jsxs(zx.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(zx.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(zx.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},Wz=({automation:e,iconDefinitions:r,loading:o})=>{const i=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),{updateAutomation:s}=ew(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=vI(),{channelSenders:d}=mI(),{channelAccounts:h}=rq(),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(null),[b,x]=n.useState(null);return n.useEffect((()=>{d&&y(d),h&&x(h)}),[d,h]),n.useEffect((()=>{c?u(c,{onSuccess:e=>{const t=e.email_channel_sender_id,n=e.sms_channel_sender_id,r=v?.channel_senders.find((e=>e.id===t)),o=v?.channel_senders.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.channel_accounts.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case oq.REACH_MANAGED:p({fromEmail:`${t}@${n.channel_account_metadata.baseDomain}.embedreach.com`,fromName:r.channel_sender_metadata.emailFromName,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case oq.TWILLIO:break;default:throw bw(n.channel_account_metadata.type,oq)}}if(o){const t=v?.channel_senders.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:SI(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.channel_accounts,v?.channel_senders,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Vx,{text:["Loading..."]})}):f||m?t.jsxs("div",{className:"max-w-8xl mx-auto p-6 gap-4 grid",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx(TI,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(Bz,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(tq,{className:"p-4 shadow-sm border-none",children:t.jsx(Hz,{automation:e,iconDefinitions:r,updateAutomation:s})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Gz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx(pw,{onClick:()=>a("all"),title:"All patrons",subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(pw,{onClick:()=>a("segments"),title:"Select patrons",subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Yz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(sL,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(fM,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Qz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Yz,{segments:r,allSegments:l?.segments||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(dw,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(zx.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(nf,{children:u&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Yz,{segments:o,allSegments:l?.segments||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},Xz=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>D_()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=ew(r.id),[d,h]=n.useState(r.includeSegmentIds||[]),[f,p]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.segments?.find((e=>e.type===O_.ALL_USERS&&e.id===d[0])),[g,v]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u]);const y=n.useCallback((()=>l?.segments?.find((e=>e.type===O_.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=y();e&&h([e.id]),p([])}}),[g,l,y]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){v("all");const e=y();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}v(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,y,u,r.includeSegmentIds,r.excludeSegmentIds]),!c&&l&&s?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(d_,{open:o,modal:!0,onOpenChange:i,children:t.jsxs(p_,{hideCloseButton:!0,children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Create Segment"}),t.jsx(v_,{children:"Create a new segment to use in your automation."})]}),t.jsx(kL,{open:o,setOpen:i})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(zx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Gz,{iconDefinitions:e,onSelectionChange:e=>{v(e)},defaultValue:g}),t.jsx(nf,{mode:"wait",children:"segments"===g&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 w-full",children:t.jsx(Qz,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?h((t=>[...t,e])):p((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?h((t=>t.filter((t=>t!==e)))):p((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(zx.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg p-8 flex flex-col justify-start h-full shadow-sm",children:t.jsx(Bz,{iconDefinitions:e,includeSegments:d,excludeSegments:f,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]})})]}):t.jsx("div",{children:t.jsx(Vx,{text:["Fetching segments","Finishing up"]})})},Jz=({title:e,subtitle:n,content:r})=>t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 ",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),Zz=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i,onBeforeSchedule:s})=>{const{toast:a}=Dc(),[l,c]=n.useState(0),{automation:u}=Xx(e),[d,h]=n.useState(!1),{updateAutomation:f}=ew(e),{getCommunicationGroup:p}=vI(),m=()=>{h(!0),f({status:rw.ACTIVE}),i(!1),a({title:"Automation scheduled!"})},{data:g}=L_({include_segments:u?.includeSegmentIds??[],exclude_segments:u?.excludeSegmentIds??[]}),v=n.useMemo((()=>g?.recipients?g.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[g?.recipients]);if(!u)return t.jsx("div",{children:t.jsx(Vx,{text:["Fetching Automation data","Finishing up"]})});const y=[{id:"audience",title:"Choose Audience",isValid:()=>!!(u&&u.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!u.action_data?.length&&null!==u.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"w-full px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:t.jsx("div",{className:"flex-shrink-0",children:o&&t.jsx("img",{src:o,alt:"Logo",className:"w-6 h-6"})})}),t.jsxs("div",{className:"flex-1 flex flex-col px-6 pt-0",children:[t.jsxs("div",{className:"flex gap-8 flex-1",children:[t.jsxs("nav",{className:"hidden lg:block space-y-0 w-50 self-start",children:[t.jsx("div",{className:"mb-5 mt-4",children:t.jsxs("button",{onClick:()=>i(!1),className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 rounded-full text-gray-700 hover:bg-gray-200 text-sm",children:[t.jsx("span",{children:"←"})," Go back"]})}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Automations"}),t.jsx("p",{className:"text-gray-600 text-sm",children:"Configure your automations"})]}),y.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===l?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<l?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(W$,{label:e.title,isActive:n===l,isCompleted:e.isValid()})},e.id)))]}),t.jsx("div",{className:"hidden lg:block h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-[calc(100vh-10rem)] overflow-y-auto overflow-visible",children:t.jsx("div",{className:"min-h-full flex items-center justify-center",children:t.jsxs(nf,{mode:"wait",children:[0===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Choose Audience",content:t.jsx(Xz,{iconDefinitions:r,automation:u})})},"audience"),1===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Edit Content",content:t.jsx(Uz,{automation:u,iconDefinitions:r})})},"content"),2===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Preview and Schedule",content:t.jsx(Wz,{automation:u,iconDefinitions:r,loading:d})})},"preview")]})})})})]}),t.jsx("div",{className:"absolute bottom-5 right-5 z-5 bg-white/30 backdrop-blur-xl p-2 rounded-xl border border-gray-200/50 shadow-lg",children:t.jsx(G$,{iconDefinitions:r,handleBack:()=>{c(l-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===l)return{canMove:u.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===l){const e=u.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};const t=e.action_metadata.communication_group_id,n=await new Promise(((e,n)=>{p(t,{onSuccess:t=>{e(t)},onError:()=>{n("Error fetching communication group")}})}));if(!n||!n.sms_channel_sender_id&&!n.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();if(e)if(2===l)if(s)try{g||await new Promise((e=>setTimeout(e,50)));const e=await s({estimatedEmailRecipients:v.emails,estimatedSmsRecipients:v.phones});!0===e?m():a({title:"Oops!",description:e,variant:"destructive"})}catch(n){a({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else m();else c(l+1);else a({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===l,backText:0===l?"Cancel":"Back",nextText:2===l?"Schedule":"Next",backDisabled:0===l,nextDisabled:2===l&&!(u.trigger_metadata.scheduled_at&&new Date(u.trigger_metadata.scheduled_at)>new Date&&Boolean(u.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===l?"Save as Draft":void 0,thirdOptionOnClick:()=>{f({status:rw.DRAFT}),i(!1),a({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},eU=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),tU=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},nU=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=vI(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=wI(),{toast:y}=Dc(),b=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;return n?new Promise(((e,t)=>{u(n,{onSuccess:n=>{switch(r){case"email":e(n.email_channel_sender_id);break;case"sms":e(n.sms_channel_sender_id);break;default:t(new Error(`Unsupported type: ${r}`))}},onError:e=>{t(e||new Error("Error fetching communication group"))}})})):Promise.resolve(null)}),[e.action_data,u,r]);n.useEffect((()=>{(async()=>{try{const e=await b();h(e)}catch(e){h(null)}finally{p(!0)}})()}),[b]),n.useEffect((()=>{v&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[v,r,o,y]),n.useEffect((()=>{g&&(y({title:"Error",description:`Failed to send preview: ${g.message}`,variant:"destructive"}),o(!1))}),[g,y,o]);return f?d?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(y_,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(dw,{onClick:()=>{if(!("email"===r?eU(s):tU(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!d)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);m({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Vx,{text:["Fetching sender id","Finishing up"]})})},rU=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s,onBeforeSchedule:a})=>{const l=CS(),[c,u]=n.useState(!1),[d,h]=n.useState(!1),[f,p]=n.useState(!1),[m,g]=n.useState(!1),{updateAutomation:v}=ew(e.id),{invalidateAutomation:y}=Xx(e.id);n.useEffect((()=>{o&&u(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(d_,{open:c,onOpenChange:e=>{u(e),!1===e&&y()},children:t.jsxs(p_,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Edit Automation"}),t.jsx(v_,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Zz,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:u,logoUrl:s,onBeforeSchedule:a})]})}),t.jsx(d_,{open:f,onOpenChange:p,children:t.jsxs(p_,{className:"sm:max-w-[425px]",children:[t.jsx(g_,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(v_,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(dw,{variant:"outline",onClick:()=>p(!1),children:"Keep Running"}),t.jsx(dw,{variant:"destructive",onClick:()=>{v({status:rw.DEACTIVATED}),p(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(d_,{open:d,onOpenChange:h,children:t.jsxs(p_,{className:"",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Send Preview SMS"}),t.jsx(v_,{children:"Send a preview SMS to the automation."})]}),t.jsx(nU,{automation:e,type:"sms",setOpenSendPreviewPopup:h,iconDefinitions:r})]})}),t.jsx(d_,{open:m,onOpenChange:g,children:t.jsxs(p_,{className:"",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Send Preview Email"}),t.jsx(v_,{children:"Send a preview email to the automation."})]}),t.jsx(nU,{automation:e,type:"email",setOpenSendPreviewPopup:g,iconDefinitions:r})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[i&&t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(dw,{onClick:()=>l(-1),children:"Back"})})}),t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(__,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(R$,{modal:!1,children:[t.jsx(A$,{asChild:!0,children:t.jsxs(dw,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(L$,{children:[e.status===rw.DRAFT&&t.jsx(I$,{onClick:()=>u(!0),children:"Edit"}),e.status===rw.ACTIVE&&t.jsx(I$,{onClick:()=>{v({status:rw.DRAFT})},children:"Convert to Draft"}),e.status!==rw.COMPLETED&&e.status!==rw.FAILED&&e.status!==rw.DEACTIVATED&&t.jsx(I$,{onClick:()=>p(!0),children:"Cancel"}),t.jsx(I$,{onClick:()=>h(!0),children:"Send Preview SMS"}),t.jsx(I$,{onClick:()=>g(!0),children:"Send Preview Email"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Name"}),t.jsx("div",{className:"font-medium",children:e.name})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:Zj(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===nw.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]})}),t.jsx("div",{children:e.trigger_type===nw.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:Zj(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},oU=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s,onBeforeSchedule:a})=>{const l=iw(e),c=function(){let{matches:e}=i.useContext(vS),t=e[e.length-1];return t?t.params:{}}(),[u]=iC(),d=r||c?.automationId||u.get("automationId"),h=n||u.get("autoOpenEditPopup"),f="true"===u.get("showBackButton")||o,p=iw(l),{automation:m,isFetching:g,isLoading:v,fetchError:y}=Xx(d||"");return d?m||!g&&!v?y?t.jsxs("div",{children:["Error: ",y.message]}):m?t.jsxs("div",{className:vw,children:[t.jsx(rU,{automation:m,iconDefinitions:p,autoOpenEditPopup:h,showBackButton:f,logoUrl:s,onBeforeSchedule:a}),t.jsx("div",{className:"pt-4",children:t.jsxs(dI,{defaultValue:"content",children:[t.jsxs(hI,{children:[t.jsx(fI,{value:"content",children:"Content"}),t.jsx(fI,{value:"recipients",children:"Recipients"})]}),t.jsx(pI,{value:"recipients",children:t.jsx(_I,{automationId:d,iconDefinitions:p})}),t.jsx(pI,{value:"content",children:t.jsx(PI,{automationId:d,iconDefinitions:p})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:vw,children:t.jsx(Vx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var iU=e=>null!=e;var sU=e=>"function"!=typeof e||e.length?e:e(),aU=e=>Array.isArray(e)?e:e?[e]:[];var lU=$e;var cU,uU=function(e){const[t,n]=Ne(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=Ne(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(EQ){return r(EQ,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&Fe((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(EQ){r(EQ,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),$e((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),$e((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(EQ){r(EQ,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(EQ){r(EQ,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(EQ){r(EQ,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(EQ){r(EQ,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(EQ){r(EQ,`Error getting all values from ${e.name}`)}}})),t}}]},dU=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},hU=("function"==typeof(cU={_cookies:[globalThis.document,"cookie"],getItem:e=>hU._cookies[0][hU._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=hU.getItem(e);hU._cookies[0][hU._cookies[1]]=`${e}=${t}${dU(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:hU});window.dispatchEvent(o)},removeItem:e=>{hU._cookies[0][hU._cookies[1]]=`${e}=deleted${dU({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return hU._cookies[0][hU._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return hU._cookies[0][hU._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(cU.clear=()=>{let e;for(;e=cU.key(0);)cU.removeItem(e)}),cU),fU=796,pU="bottom",mU="system",gU=Object.keys(Jn)[0],vU=Object.keys(tr)[0],yU=Ve({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function bU(){return Ke(yU)}var xU=Ve(void 0),wU=e=>{const[t,n]=Ne(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[Ot]){for(let t of e[Ot].keys())e.removeEventListener(t,Wt);delete e[Ot]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(bU().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(CQ){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),Lt(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};Oe((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),Oe((()=>{const e=(bU().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(bU().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),$e((()=>{t.disconnect()}))}}));const i=Re((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return ut(xU.Provider,{value:i,get children(){return e.children}})},SU=()=>Re((()=>{const e=Ke(xU);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),CU=Ve((()=>"dark"));function kU(){return Ke(CU)}var EU={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},jU=Object.keys(EU).join("|"),TU=new RegExp(jU,"g");var PU=7,_U=6,NU=5,DU=4,MU=3,OU=2,RU=1,AU=0;function LU(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:RU,!n.accessors){const r=IU(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=zU(o),s=$U(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:AU,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=IU(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=RU?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function IU(e,t,n){return e=FU(e,n),(t=FU(t,n)).length>e.length?AU:e===t?PU:(e=e.toLowerCase())===(t=t.toLowerCase())?_U:e.startsWith(t)?NU:e.includes(` ${t}`)?DU:e.includes(t)?MU:1===t.length?AU:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?OU:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return RU+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return AU;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return AU}return i(r-s)}(e,t)}function FU(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(TU,(e=>EU[e]))),e}function $U(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var qU={maxRanking:1/0,minRanking:-1/0};function zU(e){return"function"==typeof e?qU:{...qU,...e}}var UU={data:""},BU=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,VU=/\/\*[^]*?\*\/| +/g,KU=/\n+/g,HU=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?HU(s,i):i+"{"+HU(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=HU(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=HU.p?HU.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},WU={},GU=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+GU(e[n]);return t}return e};function YU(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=GU(e),s=WU[i]||(WU[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!WU[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=BU.exec(e.replace(VU,""));)t[4]?r.shift():t[3]?(n=t[3].replace(KU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(KU," ").trim();return r[0]})(e);WU[s]=HU(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&WU.g?WU.g:null;return n&&(WU.g=WU[s]),l=WU[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":HU(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||UU),t.g,t.o,t.k);var r}function QU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=QU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XU(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=QU(e))&&(r&&(r+=" "),r+=t);return r}function JU(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ne([],{equals:!1}),[l]=[Ue,ze],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return Re((t=>{const n=s(),a=e();if(Le(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return Le((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let h=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),h&&o!==n[r]&&(h=!1)}return!l.length&&h?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function ZU(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}YU.bind({g:1}),YU.bind({k:1});var eB=e=>e instanceof Element;function tB(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return tB(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=tB(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function nB(e,t=eB,n=eB){const r=Re(e),o=Re((()=>tB(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function rB(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function oB(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),rB((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function iB(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),rB((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var sB=e=>{const t=function(e){return Re((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return JU(nB((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)oB(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)iB(s,e,t,(()=>o([t])))}})},aB=Symbol("fallback");function lB(e){for(const t of e)t.dispose()}function cB(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>lB(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return lB(o.values()),o.clear(),r.fallback?[_e((e=>(o.set(aB,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(aB);if(!o.size||s){s?.dispose(),o.delete(aB);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){_e((s=>{const[a,l]=Ne(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ne(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function uB(e,t,n,r){const o=()=>{aU(sU(e)).forEach((e=>{e&&aU(sU(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),lU(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function dB(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return $e(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);Oe((t=>{const n=aU(sU(e)).filter(iU);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var hB=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function fB(e){const t={};let n;for(;n=hB.exec(e);)t[n[1]]=n[2];return t}function pB(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=fB(e)}else"string"==typeof t&&(t=fB(t));return{...e,...t}}function mB(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function gB(e){return"[object String]"===Object.prototype.toString.call(e)}function vB(e){return t=>`${e()}-${t}`}function yB(e,t){return!!e&&(e===t||e.contains(t))}function bB(e,t=!1){const{activeElement:n}=xB(e);if(!n?.nodeName)return null;if(wB(n)&&n.contentDocument)return bB(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=xB(n).getElementById(e);if(t)return t}}return n}function xB(e){return e?e.ownerDocument||e:document}function wB(e){return"IFRAME"===e.tagName}var SB=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(SB||{});function CB(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function kB(){return CB(/^Mac/i)}function EB(){return CB(/^iPhone/i)||CB(/^iPad/i)||kB()&&navigator.maxTouchPoints>1}function jB(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function TB(e){return t=>{for(const n of e)jB(t,n)}}function PB(e){return kB()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function _B(e){if(e)if(function(){if(null==NB){NB=!1;try{document.createElement("div").focus({get preventScroll(){return NB=!0,!0}})}catch(CQ){}}return NB}())e.focus({preventScroll:!0});else{const t=function(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var NB=null;var DB=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],MB=[...DB,'[tabindex]:not([tabindex="-1"]):not([disabled])'],OB=DB.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",RB=MB.join(':not([hidden]):not([tabindex="-1"]),');function AB(e,t){const n=Array.from(e.querySelectorAll(OB)).filter(LB);return t&&LB(e)&&n.unshift(e),n.forEach(((e,t)=>{if(wB(e)&&e.contentDocument){const r=AB(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function LB(e){return IB(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function IB(e){return e.matches(OB)&&FB(e)}function FB(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||FB(e.parentElement,e))}function $B(e){for(;e&&!qB(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function qB(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function zB(){}function UB(e,t){return mt(e,t)}var BB=new Map,VB=new Set;function KB(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=BB.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),BB.delete(t.target)),0===BB.size)){for(const e of VB)e();VB.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=BB.get(t.target);n||(n=new Set,BB.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function HB(e,t){const n=WB(e,t,"left"),r=WB(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function WB(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}"undefined"!=typeof document&&("loading"!==document.readyState?KB():document.addEventListener("DOMContentLoaded",KB));var GB={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function YB(e){return t=>(e(t),()=>e(void 0))}function QB(e,t){const[n,r]=Ne(XB(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||XB(t?.()))})),n}function XB(e){return gB(e)?e:void 0}function JB(e){const[t,n]=gt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return ut(en,mt(n,{get component(){return t.as}}))}var ZB=["id","name","validationState","required","disabled","readOnly"];var eV=Ve();function tV(){const e=Ke(eV);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function nV(e){const t=tV(),n=UB({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(JB,mt({as:"div"},(()=>t.dataset()),n))}function rV(e){const t=tV(),n=UB({id:t.generateId("error-message")},e),[r,o]=gt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),ut(Ct,{get when(){return r.forceMount||i()},get children(){return ut(JB,mt({as:"div"},(()=>t.dataset()),o))}})}function oV(e){let t;const n=tV(),r=UB({id:n.generateId("label")},e),[o,i]=gt(r,["ref"]),s=QB((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),ut(JB,mt({as:"label",ref(e){const n=ZU((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function iV(e,t){Oe(Ie(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),$e((()=>{n.removeEventListener("reset",t)})))})))}function sV(e){const[t,n]=Ne(e.defaultValue?.()),r=Re((()=>void 0!==e.value?.())),o=Re((()=>r()?e.value?.():t()));return[o,t=>{Le((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function aV(e){const[t,n]=sV(e);return[()=>t()??!1,n]}var lV=Object.defineProperty,cV=(e,t)=>{for(var n in t)lV(e,n,{get:t[n],enumerable:!0})},uV=Ve();function dV(){return Ke(uV)}function hV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function fV(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?hV(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function pV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{fV(e(),t)}));$e((()=>clearTimeout(n)))}))}(e,t);let n=[];Oe((()=>{const r=function(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return xB(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&fV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function mV(e={}){const[t,n]=function(e){const[t,n]=sV(e);return[()=>t()??[],n]}({value:()=>sU(e.items),onChange:t=>e.onItemsChange?.(t)});pV(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&hV(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>ut(uV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function gV(e){const t=function(){const e=dV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=UB({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function vV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=gB(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=gB(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(gB(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return gB(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(gB(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=vV({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function yV(e,t=[]){return Re((()=>{const n=vV({dataSource:sU(e.dataSource),getKey:sU(e.getKey),getTextValue:sU(e.getTextValue),getDisabled:sU(e.getDisabled),getSectionChildren:sU(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var bV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),xV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function wV(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return bV.has(t)}const t=e.split("-")[0];return xV.has(t)}(e)?"rtl":"ltr"}function SV(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:wV(e)}}var CV=SV(),kV=new Set;function EV(){CV=SV();for(const e of kV)e(CV)}var jV=Ve();function TV(){const e=function(){const[e,t]=Ne(CV),n=Re((()=>e()));return Fe((()=>{0===kV.size&&window.addEventListener("languagechange",EV),kV.add(t),$e((()=>{kV.delete(t),0===kV.size&&window.removeEventListener("languagechange",EV)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Ke(jV)||e}var PV=new Map;var _V=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function NV(e){return kB()||EB()?e.altKey:e.ctrlKey}function DV(e){return kB()?e.metaKey:e.ctrlKey}function MV(e){return new _V(e)}function OV(e){const t=UB({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ne(!1),[o,i]=Ne(),s=Re((()=>{const e=sU(t.selectedKeys);return null!=e?MV(e):e})),a=Re((()=>{const e=sU(t.defaultSelectedKeys);return null!=e?MV(e):new _V})),[l,c]=function(e){const[t,n]=sV(e);return[()=>t()??new _V,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ne(sU(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===sU(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d(sU(t.selectionBehavior)??"toggle")})),{selectionMode:()=>sU(t.selectionMode),disallowEmptySelection:()=>sU(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!sU(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function RV(e,t,n){const r=mt({selectOnFocus:()=>"replace"===sU(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=TV();let s={top:0,left:0};uB((()=>sU(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=Ne(""),[r,o]=Ne(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(sU(e.isDisabled))return;const s=sU(e.keyboardDelegate),a=sU(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>sU(r.disallowTypeAhead),keyboardDelegate:()=>sU(r.keyboardDelegate),selectionManager:()=>sU(r.selectionManager)}),l=()=>sU(r.orientation)??"vertical",c=()=>{const e=sU(r.autoFocus);if(!e)return;const n=sU(r.selectionManager),o=sU(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!sU(r.shouldUseVirtualFocus)&&_B(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>sU(r.isVirtualized),()=>sU(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&HB(t,e)}})));return{tabIndex:Re((()=>{if(!sU(r.shouldUseVirtualFocus))return null==sU(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{jB(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=sU(r.selectionManager),s=sU(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!NV(e)&&o.replaceSelection(t))},u=sU(r.keyboardDelegate),d=sU(r.shouldFocusWrap),h=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=h?u.getKeyBelow(h):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=h?u.getKeyAbove(h):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyLeftOf(h):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyRightOf(h):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(h,DV(e));null!=t&&(o.setFocusedKey(t),DV(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(h,DV(e));null!=t&&(o.setFocusedKey(t),DV(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=h){e.preventDefault();c(u.getKeyPageBelow(h))}break;case"PageUp":if(u.getKeyPageAbove&&null!=h){e.preventDefault();c(u.getKeyPageAbove(h))}break;case"a":DV(e)&&"multiple"===o.selectionMode()&&!0!==sU(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),sU(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!sU(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?RB:OB,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&FB(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&_B(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=sU(r.selectionManager),n=sU(r.keyboardDelegate),i=sU(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!sU(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(_B(n),HB(e,n))}}},onFocusOut:e=>{const t=sU(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function AV(e,t){const n=()=>sU(e.selectionManager),r=()=>sU(e.key),o=()=>sU(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||DV(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>sU(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Re((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Re((()=>sU(e.virtualized)?void 0:r()));return Oe(Ie([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():_B(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||sU(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&sU(e.shouldSelectOnPressUp)&&sU(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(sU(e.shouldSelectOnPressUp)&&!sU(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(NV(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var LV=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new _V(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new _V(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new _V([t],t,t):new _V;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new _V;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new _V)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},IV=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var FV,$V=e=>"function"==typeof e?e():e,qV=e=>{const t=Re((()=>{const t=$V(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ne($V(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=$V(e.show);return Le((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),Oe((()=>{const t=$V(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),$e((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},zV="data-kb-top-layer",UV=!1,BV=[];function VV(e){return BV.findIndex((t=>t.node===e))}function KV(){return BV.filter((e=>e.isPointerBlocking))}function HV(){return KV().length>0}function WV(e){const t=VV([...KV()].slice(-1)[0]?.node);return VV(e)<t}var GV={layers:BV,isTopMostLayer:function(e){return BV[BV.length-1].node===e},hasPointerBlockingLayer:HV,isBelowPointerBlockingLayer:WV,addLayer:function(e){BV.push(e)},removeLayer:function(e){const t=VV(e);t<0||BV.splice(t,1)},indexOf:VV,find:function(e){return BV[VV(e)]},assignPointerEventToLayers:function(){for(const{node:e}of BV)e.style.pointerEvents=WV(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(HV()&&!UV){const t=xB(e);FV=document.body.style.pointerEvents,t.body.style.pointerEvents="none",UV=!0}},restoreBodyPointerEvents:function(e){if(HV())return;const t=xB(e);t.body.style.pointerEvents=FV,0===t.body.style.length&&t.body.removeAttribute("style"),UV=!1}};cV({},{Button:()=>XV,Root:()=>QV});var YV=["button","color","file","image","reset","submit"];function QV(e){let t;const n=UB({type:"button"},e),[r,o]=gt(n,["ref","type","disabled"]),i=QB((()=>t),(()=>"button")),s=Re((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==YV.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return ut(JB,mt({as:"button",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var XV=QV,JV=["top","right","bottom","left"],ZV=Math.min,eK=Math.max,tK=Math.round,nK=Math.floor,rK=e=>({x:e,y:e}),oK={left:"right",right:"left",bottom:"top",top:"bottom"},iK={start:"end",end:"start"};function sK(e,t,n){return eK(e,ZV(t,n))}function aK(e,t){return"function"==typeof e?e(t):e}function lK(e){return e.split("-")[0]}function cK(e){return e.split("-")[1]}function uK(e){return"x"===e?"y":"x"}function dK(e){return"y"===e?"height":"width"}function hK(e){return["top","bottom"].includes(lK(e))?"y":"x"}function fK(e){return uK(hK(e))}function pK(e){return e.replace(/start|end/g,(e=>iK[e]))}function mK(e){return e.replace(/left|right|bottom|top/g,(e=>oK[e]))}function gK(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 vK(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 yK(e,t,n){let{reference:r,floating:o}=e;const i=hK(t),s=fK(t),a=dK(s),l=lK(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=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(cK(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function bK(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:h=!1,padding:f=0}=aK(t,e),p=gK(f),m=a[h?"floating"===d?"reference":"floating":d],g=vK(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})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=vK(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function xK(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wK(e){return JV.some((t=>e[t]>=0))}function SK(e){return EK(e)?(e.nodeName||"").toLowerCase():"#document"}function CK(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function kK(e){var t;return null==(t=(EK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function EK(e){return e instanceof Node||e instanceof CK(e).Node}function jK(e){return e instanceof Element||e instanceof CK(e).Element}function TK(e){return e instanceof HTMLElement||e instanceof CK(e).HTMLElement}function PK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof CK(e).ShadowRoot)}function _K(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=AK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function NK(e){return["table","td","th"].includes(SK(e))}function DK(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(CQ){return!1}}))}function MK(e){const t=OK(),n=jK(e)?AK(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 OK(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function RK(e){return["html","body","#document"].includes(SK(e))}function AK(e){return CK(e).getComputedStyle(e)}function LK(e){return jK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function IK(e){if("html"===SK(e))return e;const t=e.assignedSlot||e.parentNode||PK(e)&&e.host||kK(e);return PK(t)?t.host:t}function FK(e){const t=IK(e);return RK(t)?e.ownerDocument?e.ownerDocument.body:e.body:TK(t)&&_K(t)?t:FK(t)}function $K(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=FK(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=CK(o);return i?t.concat(s,s.visualViewport||[],_K(o)?o:[],s.frameElement&&n?$K(s.frameElement):[]):t.concat(o,$K(o,[],n))}function qK(e){const t=AK(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=TK(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=tK(n)!==i||tK(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zK(e){return jK(e)?e:e.contextElement}function UK(e){const t=zK(e);if(!TK(t))return rK(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qK(t);let s=(i?tK(n.width):n.width)/r,a=(i?tK(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var BK=rK(0);function VK(e){const t=CK(e);return OK()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:BK}function KK(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=zK(e);let s=rK(1);t&&(r?jK(r)&&(s=UK(r)):s=UK(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==CK(e))&&t}(i,n,r)?VK(i):rK(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=CK(i),t=r&&jK(r)?CK(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=UK(o),t=o.getBoundingClientRect(),r=AK(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=CK(o),o=n.frameElement}}return vK({width:u,height:d,x:l,y:c})}function HK(e){return KK(kK(e)).left+LK(e).scrollLeft}function WK(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=CK(e),r=kK(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=OK();(!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=kK(e),n=LK(e),r=e.ownerDocument.body,o=eK(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=eK(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+HK(e);const a=-n.scrollTop;return"rtl"===AK(r).direction&&(s+=eK(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(kK(e));else if(jK(t))r=function(e,t){const n=KK(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=TK(e)?UK(e):rK(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=VK(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return vK(r)}function GK(e,t){const n=IK(e);return!(n===t||!jK(n)||RK(n))&&("fixed"===AK(n).position||GK(n,t))}function YK(e,t,n){const r=TK(t),o=kK(t),i="fixed"===n,s=KK(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=rK(0);if(r||!r&&!i)if(("body"!==SK(t)||_K(o))&&(a=LK(t)),r){const e=KK(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=HK(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function QK(e){return"static"===AK(e).position}function XK(e,t){return TK(e)&&"fixed"!==AK(e).position?t?t(e):e.offsetParent:null}function JK(e,t){const n=CK(e);if(DK(e))return n;if(!TK(e)){let t=IK(e);for(;t&&!RK(t);){if(jK(t)&&!QK(t))return t;t=IK(t)}return n}let r=XK(e,t);for(;r&&NK(r)&&QK(r);)r=XK(r,t);return r&&RK(r)&&QK(r)&&!MK(r)?n:r||function(e){let t=IK(e);for(;TK(t)&&!RK(t);){if(MK(t))return t;if(DK(t))return null;t=IK(t)}return null}(e)||n}var ZK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=kK(r),a=!!t&&DK(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=rK(1);const u=rK(0),d=TK(r);if((d||!d&&!i)&&(("body"!==SK(r)||_K(s))&&(l=LK(r)),TK(r))){const e=KK(r);c=UK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:kK,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?DK(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=$K(e,[],!1).filter((e=>jK(e)&&"body"!==SK(e))),o=null;const i="fixed"===AK(e).position;let s=i?IK(e):e;for(;jK(s)&&!RK(s);){const t=AK(s),n=MK(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||_K(s)&&!n&&GK(e,s))?r=r.filter((e=>e!==s)):o=t,s=IK(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=WK(t,n,o);return e.top=eK(r.top,e.top),e.right=ZV(r.right,e.right),e.bottom=ZV(r.bottom,e.bottom),e.left=eK(r.left,e.left),e}),WK(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:JK,getElementRects:async function(e){const t=this.getOffsetParent||JK,n=this.getDimensions,r=await n(e.floating);return{reference:YK(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}=qK(e);return{width:t,height:n}},getScale:UK,isElement:jK,isRTL:function(e){return"rtl"===AK(e).direction}};function eH(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=zK(e),u=o||i?[...c?$K(c):[],...$K(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=kK(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:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-nK(u)+"px "+-nK(o.clientWidth-(c+d))+"px "+-nK(o.clientHeight-(u+h))+"px "+-nK(c)+"px",threshold:eK(0,ZV(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(CQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?KK(e):null;return l&&function t(){const r=KK(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var tH=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=lK(n),a=cK(n),l="y"===hK(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=aK(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*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}}}}},nH=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}=aK(e,t),c={x:n,y:r},u=await bK(t,l),d=hK(lK(o)),h=uK(d);let f=c[h],p=c[d];if(i){f=sK(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=sK(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},rH=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:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=aK(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=lK(o),y=hK(a),b=lK(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[mK(a)]:function(e){const t=mK(e);return[pK(e),t,pK(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=cK(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[]}}(lK(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(pK)))),i}(a,m,p,x));const C=[a,...w],k=await bK(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=cK(e),o=fK(e),i=dK(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=mK(s)),[s,mK(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var _;const e=null==(_=j.filter((e=>{if(S){const t=hK(e.placement);return t===y||"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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},oH=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=aK(e,t),l=await bK(t,a),c=lK(n),u=cK(n),d="y"===hK(n),{width:h,height:f}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=f-l.top-l.bottom,v=h-l.left-l.right,y=ZV(f-l[p],g),b=ZV(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?ZV(b,v):v:w=u||x?ZV(y,g):g,x&&!u){const e=eK(l.left,0),t=eK(l.right,0),n=eK(l.top,0),r=eK(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:eK(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:eK(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},iH=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=aK(e,t);switch(r){case"referenceHidden":{const e=xK(await bK(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wK(e)}}}case"escaped":{const e=xK(await bK(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wK(e)}}}default:return{}}}}},sH=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}=aK(e,t)||{};if(null==c)return{};const d=gK(u),h={x:n,y:r},f=fK(o),p=dK(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[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[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=ZV(d[v],E),T=ZV(d[y],E),P=j,_=C-m[p]-T,N=C/2-m[p]/2+k,D=sK(P,N,_),M=!l.arrow&&null!=cK(o)&&N!==D&&i.reference[p]/2-(N<P?j:T)-m[p]/2<0,O=M?N<P?N-P:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),aH=(e,t,n)=>{const r={platform:ZK,...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}=yK(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=yK(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},lH=Ve();function cH(){const e=Ke(lH);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var uH=At('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),dH={top:180,right:-90,bottom:0,left:90};function hH(e){const t=cH(),n=UB({size:30},e),[r,o]=gt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ne();return Oe((()=>{const t=e();var r;t&&n((r=t,xB(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return ut(JB,mt({as:"div",ref(e){const n=ZU(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return pB({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=uH(),t=e.firstChild;return Me((()=>It(t,"transform",`rotate(${dH[i()]} 15 15) translate(0 2)`))),e}}))}function fH(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function pH(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var mH={top:"bottom",right:"left",bottom:"top",left:"right"};var gH=Object.assign((function(e){const t=UB({getAnchorRect:e=>e?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?fH(t):e?e.getBoundingClientRect():fH()}};var e,n},{direction:c}=TV();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[tH((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(pH))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(rH({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(nH({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(oH({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(iH({padding:t.detachedPadding})),i&&d.push(sH({element:i,padding:t.arrowPadding}));const h=await aH(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...ZK,isRTL:()=>"rtl"===c()}});if(a(h.placement),t.onCurrentPlacementChange?.(h.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=mH[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(h.placement,c()));const f=Math.round(h.x),p=Math.round(h.y);let m;if(t.hideWhenDetached&&(m=h.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${p}px, 0)`,visibility:m}),i&&h.middlewareData.arrow){const{x:e,y:t}=h.middlewareData.arrow,n=h.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return Oe((()=>{const e=l(),t=n();if(!e||!t)return;$e(eH(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),ut(lH.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:hH,Context:lH,usePopperContext:cH,Positioner:function(e){const t=cH(),[n,r]=gt(e,["ref","style"]);return ut(JB,mt({as:"div",ref(e){const r=ZU(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return pB({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var vH="interactOutside.pointerDownOutside",yH="interactOutside.focusOutside";var bH=Ve();function xH(e){let t;const n=Ke(bH),[r,o]=gt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=zB;const o=()=>xB(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${zV}]`)&&!!yB(o(),r)&&!yB(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=TB([i,a]);r.addEventListener(vH,o,{once:!0});const s=new CustomEvent(vH,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||PB(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=TB([s,a]);r.addEventListener(yH,o,{once:!0});const i=new CustomEvent(yH,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{sU(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),$e((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>yB(t(),e)))||[...i].some((t=>yB(t,e)))),onPointerDownOutside:e=>{t&&!GV.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||GV.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===SB.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if(sU(e.isDisabled))return;const n=e.ownerDocument?.()??xB();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>xB(t),onEscapeKeyDown:e=>{t&&GV.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;GV.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);GV.assignPointerEventToLayers(),GV.disableBodyPointerEvents(t),$e((()=>{t&&(GV.removeLayer(t),e?.(),GV.assignPointerEventToLayers(),GV.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=GV.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,GV.assignPointerEventToLayers()),t&&GV.disableBodyPointerEvents(e),$e((()=>{GV.restoreBodyPointerEvents(e)}))}),{defer:!0}));return ut(bH.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function wH(e={}){const[t,n]=aV({value:()=>sU(e.open),defaultValue:()=>!!sU(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var SH={};cV(SH,{Description:()=>nV,ErrorMessage:()=>rV,Item:()=>TH,ItemControl:()=>PH,ItemDescription:()=>_H,ItemIndicator:()=>NH,ItemInput:()=>DH,ItemLabel:()=>MH,Label:()=>OH,RadioGroup:()=>AH,Root:()=>RH});var CH=Ve();function kH(){const e=Ke(CH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var EH=Ve();function jH(){const e=Ke(EH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function TH(e){const t=tV(),n=kH(),r=UB({id:`${t.generateId("item")}-${bt()}`},e),[o,i]=gt(r,["value","disabled","onPointerDown"]),[s,a]=Ne(),[l,c]=Ne(),[u,d]=Ne(),[h,f]=Ne(),[p,m]=Ne(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{jB(e,o.onPointerDown),p()&&e.preventDefault()},b=Re((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:vB((()=>i.id)),registerInput:YB(a),registerLabel:YB(c),registerDescription:YB(d),setIsFocused:m,setInputRef:f};return ut(EH.Provider,{value:x,get children(){return ut(JB,mt({as:"div",role:"group",onPointerDown:y},b,i))}})}function PH(e){const t=jH(),n=UB({id:t.generateId("control")},e),[r,o]=gt(n,["onClick","onKeyDown"]);return ut(JB,mt({as:"div",onClick:e=>{jB(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{jB(e,r.onKeyDown),e.key===SB.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function _H(e){const t=jH(),n=UB({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(JB,mt({as:"div"},(()=>t.dataset()),n))}function NH(e){const t=jH(),n=UB({id:t.generateId("indicator")},e),[r,o]=gt(n,["ref","forceMount"]),[i,s]=Ne(),{present:a}=qV({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return ut(Ct,{get when(){return a()},get children(){return ut(JB,mt({as:"div",ref(e){const t=ZU(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function DH(e){const t=tV(),n=kH(),r=jH(),o=UB({id:r.generateId("input")},e),[i,s]=gt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ne(!1);return Oe(Ie([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),Oe((()=>$e(r.registerInput(s.id)))),ut(JB,mt({as:"input",ref(e){const t=ZU(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return pB({...GB},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(jB(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{jB(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{jB(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function MH(e){const t=jH(),n=UB({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),ut(JB,mt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function OH(e){return ut(oV,mt({as:"span"},e))}function RH(e){let t;const n=UB({id:`radiogroup-${bt()}`,orientation:"vertical"},e),[r,o,i]=gt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],ZB),[s,a]=sV({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=UB({id:`form-control-${bt()}`},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(),[l,c]=Ne();return{formControlContext:{name:()=>sU(t.name)??sU(t.id),dataset:Re((()=>({"data-valid":"valid"===sU(t.validationState)?"":void 0,"data-invalid":"invalid"===sU(t.validationState)?"":void 0,"data-required":sU(t.required)?"":void 0,"data-disabled":sU(t.disabled)?"":void 0,"data-readonly":sU(t.readOnly)?"":void 0}))),validationState:()=>sU(t.validationState),isRequired:()=>sU(t.required),isDisabled:()=>sU(t.disabled),isReadOnly:()=>sU(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:vB((()=>sU(t.id))),registerLabel:YB(r),registerField:YB(i),registerDescription:YB(a),registerErrorMessage:YB(c)}}}(o);iV((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return ut(eV.Provider,{value:l,get children(){return ut(CH.Provider,{value:d,get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return sU(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy(sU(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var AH=Object.assign(RH,{Description:nV,ErrorMessage:rV,Item:TH,ItemControl:PH,ItemDescription:_H,ItemIndicator:NH,ItemInput:DH,ItemLabel:MH,Label:OH}),LH=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function IH(e,t,n){const r=function(e){const{locale:t}=TV(),n=Re((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Re((()=>{const r=n();let o;return PV.has(r)&&(o=PV.get(r)),o||(o=new Intl.Collator(t(),e),PV.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return RV({selectionManager:()=>sU(e.selectionManager),keyboardDelegate:Re((()=>{const n=sU(e.keyboardDelegate);return n||new LH(e.collection,t,r)})),autoFocus:()=>sU(e.autoFocus),deferAutoFocus:()=>sU(e.deferAutoFocus),shouldFocusWrap:()=>sU(e.shouldFocusWrap),disallowEmptySelection:()=>sU(e.disallowEmptySelection),selectOnFocus:()=>sU(e.selectOnFocus),disallowTypeAhead:()=>sU(e.disallowTypeAhead),shouldUseVirtualFocus:()=>sU(e.shouldUseVirtualFocus),allowsTabNavigation:()=>sU(e.allowsTabNavigation),isVirtualized:()=>sU(e.isVirtualized),scrollToKey:t=>sU(e.scrollToKey)?.(t),orientation:()=>sU(e.orientation)},t)}var FH="focusScope.autoFocusOnMount",$H="focusScope.autoFocusOnUnmount",qH={bubbles:!1,cancelable:!0},zH={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=mB(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=mB(this.stack,e),this.active()?.resume()}};function UH(e,t){const[n,r]=Ne(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>xB(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,GB),e},u=()=>{const e=t();return e?AB(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};Oe((()=>{const e=t();if(!e)return;zH.add(o);const n=bB(e);if(!yB(e,n)){const t=new CustomEvent(FH,qH);e.addEventListener(FH,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{_B(d()),bB(e)===n&&_B(e)}),0)}$e((()=>{e.removeEventListener(FH,s),setTimeout((()=>{const r=new CustomEvent($H,qH);(()=>{const e=t();if(!e)return!1;const n=bB(e);return!!n&&!yB(e,n)&&IB(n)})()&&r.preventDefault(),e.addEventListener($H,a),e.dispatchEvent(r),r.defaultPrevented||_B(n??l().body),e.removeEventListener($H,a),zH.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!sU(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${zV}]`)||(yB(r,t)?i=t:_B(i))},s=e=>{const t=e.relatedTarget??bB(r);t?.closest(`[${zV}]`)||yB(r,t)||_B(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!sU(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();_B(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),$e((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var BH="data-live-announcer";function VH(e){Oe((()=>{sU(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${BH}], [${zV}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=KH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),KH.set(e,t+1))};HH.length&&HH[HH.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return HH.push(a),()=>{s.disconnect();for(const e of r){const t=KH.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),KH.delete(e)):KH.set(e,t-1)}a===HH[HH.length-1]?(HH.pop(),HH.length&&HH[HH.length-1].observe()):HH.splice(HH.indexOf(a),1)}}(sU(e.targets),sU(e.root)))}))}var KH=new WeakMap,HH=[];var WH=new Map,GH=e=>{Oe((()=>{const t=$V(e.style)??{},n=$V(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=WH.get(e.key);o?o.activeCount++:WH.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);$e((()=>{const t=WH.get(e.key);if(t)if(1===t.activeCount){WH.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},YH=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},QH=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[XH,JH]=Ne([]),ZH=e=>[e.deltaX,e.deltaY],eW=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],tW=(e,t,n,r)=>{const o=null!==r&&nW(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=YH(o,t),u=c-e-r*l;0===l&&0===u||!QH(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},nW=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},rW=e=>{const t=mt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=bt();let r=[0,0],o=null,i=null;Oe((()=>{$V(t.enabled)&&(JH((e=>[...e,n])),$e((()=>{JH((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!$V(t.enabled)||!$V(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if($V(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===$V(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;GH({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{$V(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else GH({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,XH().indexOf(e)===XH().length-1&&$V(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),$e((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=eW(e),o=null,i=null},a=e=>{const n=e.target,r=$V(t.element),o=ZH(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=tW(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!nW(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=$V(t.element),s=e.target;let a;if(2===e.touches.length)a=!$V(t.allowPinchZoom);else{if(null==o||null===i){const t=eW(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=tW(s,o,i,n);a=!n||!nW(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},oW=Ve();function iW(){return Ke(oW)}function sW(){const e=iW();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var aW=Ve();function lW(){const e=Ke(aW);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var cW=Ve();function uW(){const e=Ke(cW);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function dW(e){let t;const n=uW(),r=sW(),o=UB({id:n.generateId(`item-${bt()}`)},e),[i,s]=gt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ne(),[c,u]=Ne(),[d,h]=Ne(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};gV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=AV({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{jB(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(_B(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{jB(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{jB(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(jB(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=Re((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=Re((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===p()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:h,generateId:vB((()=>s.id)),registerLabel:YB(l),registerDescription:YB(u)};return ut(aW.Provider,{value:C,get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return TB([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return TB([b,g.onPointerUp])},get onClick(){return TB([i.onClick,g.onClick])},get onKeyDown(){return TB([x,g.onKeyDown])},get onMouseDown(){return TB([i.onMouseDown,g.onMouseDown])},get onFocus(){return TB([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function hW(e){const t=UB({closeOnSelect:!1},e),[n,r]=gt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=aV({value:()=>sU(e.isSelected),defaultValue:()=>!!sU(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{sU(e.isReadOnly)||sU(e.isDisabled)||n(t)},toggle:()=>{sU(e.isReadOnly)||sU(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return ut(dW,mt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var fW=Ve();function pW(){return Ke(fW)}var mW={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>mW.next("ltr"===e?"rtl":"ltr",t)},gW=e=>"horizontal"===e?"ArrowDown":"ArrowRight",vW=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function yW(e){const t=uW(),n=sW(),r=pW(),{direction:o}=TV(),i=UB({id:t.generateId("trigger")},e),[s,a]=gt(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=QB((()=>n.triggerRef()),(()=>"button")),u=Re((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));Oe(Ie((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return Oe((()=>$e(n.registerTriggerId(s.id)))),ut(QV,mt({ref(e){const t=ZU(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Re((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{jB(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{jB(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{jB(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(jB(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case gW(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=$B(e);for(;e&&n&&e!==t&&n!==t;)HB(n,e),n=$B(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case vW(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case mW.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case mW.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{jB(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var bW=Ve();function xW(){return Ke(bW)}function wW(e){let t;const n=uW(),r=sW(),o=pW(),i=xW(),{direction:s}=TV(),a=UB({id:n.generateId(`content-${bt()}`)},e),[l,c]=gt(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),h=IH({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));UH({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},p=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};Oe((()=>$e(r.registerContentId(l.id))));const m={ref:ZU((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:TB([l.onKeyDown,h.onKeyDown,e=>{if(yB(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case mW.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case mW.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:TB([l.onMouseDown,h.onMouseDown]),onFocusIn:TB([l.onFocusIn,h.onFocusIn]),onFocusOut:TB([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{jB(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(jB(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;yB(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return ut(Ct,{get when(){return r.contentPresent()},get children(){return ut(Ct,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return ut(JB,mt({as:"div"},(()=>r.dataset()),m,c))},get children(){return ut(gH.Positioner,{get children(){return ut(xH,mt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return pB({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:p,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function SW(e){let t;const n=uW(),r=sW(),[o,i]=gt(e,["ref"]);return rW({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),ut(wW,mt({ref(e){const n=ZU((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var CW=Ve();function kW(e){const t=UB({id:uW().generateId(`group-${bt()}`)},e),[n,r]=Ne(),o={generateId:vB((()=>t.id)),registerLabelId:YB(r)};return ut(CW.Provider,{value:o,get children(){return ut(JB,mt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function EW(e){const t=function(){const e=Ke(CW);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=UB({id:t.generateId("label")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),ut(JB,mt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function jW(e){const t=sW();return ut(JB,mt({as:"span","aria-hidden":"true"},(()=>t.dataset()),UB({children:"▼"},e)))}function TW(e){return ut(dW,mt({role:"menuitem",closeOnSelect:!0},e))}function PW(e){const t=lW(),n=UB({id:t.generateId("description")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),ut(JB,mt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function _W(e){const t=lW(),n=UB({id:t.generateId("indicator")},e),[r,o]=gt(n,["forceMount"]);return ut(Ct,{get when(){return r.forceMount||t.isChecked()},get children(){return ut(JB,mt({as:"div"},(()=>t.dataset()),o))}})}function NW(e){const t=lW(),n=UB({id:t.generateId("label")},e),[r,o]=gt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),ut(JB,mt({as:"div",ref(e){const n=ZU(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function DW(e){const t=sW();return ut(Ct,{get when(){return t.contentPresent()},get children(){return ut(Zt,e)}})}var MW=Ve();function OW(e){const t=UB({id:uW().generateId(`radiogroup-${bt()}`)},e),[n,r]=gt(t,["value","defaultValue","onChange","disabled"]),[o,i]=sV({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return ut(MW.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return ut(kW,r)}})}function RW(e){const t=function(){const e=Ke(MW);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=UB({closeOnSelect:!1},e),[r,o]=gt(n,["value","onSelect"]);return ut(dW,mt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function AW(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function LW(e){const t=uW(),n=dV(),r=iW(),o=pW(),i=xW(),s=UB({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=gt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=Ne(),[p,m]=Ne(),[g,v]=Ne(),[y,b]=Ne(),[x,w]=Ne(!0),[S,C]=Ne(l.placement),[k,E]=Ne([]),[j,T]=Ne([]),{DomCollectionProvider:P}=mV({items:j,onItemsChange:T}),_=wH({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:N}=qV({show:()=>t.forceMount()||_.isOpen(),element:()=>y()??null}),D=function(e){const t=OV(e),n=yV({dataSource:()=>sU(e.dataSource),getKey:()=>sU(e.getKey),getTextValue:()=>sU(e.getTextValue),getDisabled:()=>sU(e.getDisabled),getSectionChildren:()=>sU(e.getSectionChildren),factory:t=>new IV(e.filter?e.filter(t):t)},[()=>e.filter]),r=new LV(n,t);return De((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:j}),M=e=>{w(e),_.open()},O=(e=!1)=>{_.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(_B(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},A=()=>{null!=i?setTimeout((()=>R())):R()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],h=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};VH({isDisabled:()=>!(null==r&&_.isOpen()&&t.isModal()),targets:()=>[y(),...k()].filter(Boolean)}),Oe((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);$e((()=>{t()}))})),Oe((()=>{void 0===r&&o?.registerMenu(t.value(),[y(),...k()])})),Oe((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):O())})),Oe((()=>{void 0===r&&void 0!==o&&_.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":_.isOpen()?"":void 0,"data-closed":_.isOpen()?void 0:""}))),isOpen:_.isOpen,contentPresent:N,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),_.toggle()},focusContent:A,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||A()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>mB(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:YB(f),registerContentId:YB(m)};return ut(P,{get children(){return ut(oW.Provider,{value:I,get children(){return ut(Ct,{when:void 0===i,get fallback(){return l.children},get children(){return ut(gH,mt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function IW(e){const{direction:t}=TV();return ut(LW,mt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var FW=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function $W(e){const t=sW(),n=uW(),[r,o]=gt(e,["onFocusOutside","onKeyDown"]),{direction:i}=TV();return ut(wW,mt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;yB(t.triggerRef(),n)||t.close()},onKeyDown:e=>{jB(e,r.onKeyDown);const o=yB(e.currentTarget,e.target),s=FW(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),_B(t.triggerRef()))}},o))}var qW=["Enter"," "],zW=(e,t)=>"ltr"===e?[...qW,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...qW,"horizontal"===t?"ArrowLeft":"ArrowUp"];function UW(e){let t;const n=uW(),r=sW(),o=UB({id:n.generateId(`sub-trigger-${bt()}`)},e),[i,s]=gt(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=TV(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},h=AV({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{jB(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{jB(e,i.onKeyDown),e.repeat||i.disabled||zW(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return Oe((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");$e(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),Oe(Ie((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{$e((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),Oe((()=>$e(r.registerTriggerId(i.id)))),$e((()=>{l()})),ut(JB,mt({as:"div",ref(e){const n=ZU((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Re((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return TB([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return TB([i.onPointerUp,h.onPointerUp])},get onClick(){return TB([f,h.onClick])},get onKeyDown(){return TB([p,h.onKeyDown])},get onMouseDown(){return TB([i.onMouseDown,h.onMouseDown])},get onFocus(){return TB([i.onFocus,h.onFocus])},onPointerMove:e=>{if(jB(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),_B(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(jB(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:AW(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function BW(e){const t=pW(),n=UB({id:`menu-${bt()}`,modal:!0},e),[r,o]=gt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=wH({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:vB((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return ut(cW.Provider,{value:s,get children(){return ut(LW,mt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function VW(e){let t;const n=UB({orientation:"horizontal"},e),[r,o]=gt(n,["ref","orientation"]),i=QB((()=>t),(()=>"hr"));return ut(JB,mt({as:"hr",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}cV({},{Root:()=>VW,Separator:()=>KW});var KW=VW,HW={};function WW(e){const t=uW(),n=sW(),[r,o]=gt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return ut(SW,mt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||_B(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function GW(e){return ut(BW,UB({id:`dropdownmenu-${bt()}`},e))}cV(HW,{Arrow:()=>hH,CheckboxItem:()=>hW,Content:()=>WW,DropdownMenu:()=>YW,Group:()=>kW,GroupLabel:()=>EW,Icon:()=>jW,Item:()=>TW,ItemDescription:()=>PW,ItemIndicator:()=>_W,ItemLabel:()=>NW,Portal:()=>DW,RadioGroup:()=>OW,RadioItem:()=>RW,Root:()=>GW,Separator:()=>VW,Sub:()=>IW,SubContent:()=>$W,SubTrigger:()=>UW,Trigger:()=>yW});var YW=Object.assign(GW,{Arrow:hH,CheckboxItem:hW,Content:WW,Group:kW,GroupLabel:EW,Icon:jW,Item:TW,ItemDescription:PW,ItemIndicator:_W,ItemLabel:NW,Portal:DW,RadioGroup:OW,RadioItem:RW,Separator:VW,Sub:IW,SubContent:$W,SubTrigger:UW,Trigger:yW}),QW={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},XW=At('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),JW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),ZW=At('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),eG=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),tG=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),nG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),rG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),oG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),iG=At('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),sG=At('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),aG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),lG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),cG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),uG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),hG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),fG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),pG=At('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),vG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),yG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bG=At('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function xG(){return XW()}function wG(){return JW()}function SG(){return ZW()}function CG(){return eG()}function kG(){return tG()}function EG(){return(e=tG()).style.setProperty("transform","rotate(90deg)"),e;var e}function jG(){return(e=tG()).style.setProperty("transform","rotate(-90deg)"),e;var e}function TG(){return nG()}function PG(){return rG()}function _G(){return oG()}function NG(){return iG()}function DG(){return sG()}function MG(){return aG()}function OG(){return lG()}function RG(){return cG()}function AG(){return uG()}function LG(e){return t=dG(),n=t.firstChild,Me((()=>It(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function IG(){return hG()}function FG(){return fG()}function $G(e){return[ut(Ct,{get when(){return e.checked},get children(){var t=dG(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),ut(Ct,{get when(){return!e.checked},get children(){var t=pG(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function qG(){return mG()}function zG(){return gG()}function UG(){return vG()}function BG(){return yG()}function VG(){const e=bt();return t=bG(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,h=(d=c.nextSibling).firstChild,m=(p=(f=d.nextSibling).nextSibling).firstChild,v=(g=p.nextSibling).firstChild,x=(b=(y=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,T=(j=k.nextSibling).firstChild,N=(_=(P=j.nextSibling).nextSibling).firstChild,M=(D=_.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,V=(B=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=B.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,he=(de=(ue=le.nextSibling).firstChild).nextSibling,pe=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Ae=(Re=(Oe=(Me=(De=(Ne=(_e=(Pe=(Te=(je=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ye=(ve=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,It(n,"id",`a-${e}`),It(r,"fill",`url(#a-${e})`),It(i,"id",`am-${e}`),It(s,"id",`b-${e}`),It(a,"filter",`url(#am-${e})`),It(l,"mask",`url(#b-${e})`),It(u,"id",`ah-${e}`),It(d,"id",`k-${e}`),It(h,"filter",`url(#ah-${e})`),It(f,"mask",`url(#k-${e})`),It(m,"id",`ae-${e}`),It(g,"id",`j-${e}`),It(v,"filter",`url(#ae-${e})`),It(y,"mask",`url(#j-${e})`),It(x,"id",`ai-${e}`),It(w,"id",`i-${e}`),It(S,"filter",`url(#ai-${e})`),It(C,"mask",`url(#i-${e})`),It(E,"id",`aj-${e}`),It(j,"id",`h-${e}`),It(T,"filter",`url(#aj-${e})`),It(P,"mask",`url(#h-${e})`),It(N,"id",`ag-${e}`),It(D,"id",`g-${e}`),It(M,"filter",`url(#ag-${e})`),It(O,"mask",`url(#g-${e})`),It(A,"id",`af-${e}`),It(L,"id",`f-${e}`),It(I,"filter",`url(#af-${e})`),It(F,"mask",`url(#f-${e})`),It($,"id",`m-${e}`),It(q,"fill",`url(#m-${e})`),It(U,"id",`ak-${e}`),It(B,"id",`e-${e}`),It(V,"filter",`url(#ak-${e})`),It(K,"mask",`url(#e-${e})`),It(H,"id",`n-${e}`),It(W,"fill",`url(#n-${e})`),It(G,"id",`r-${e}`),It(Y,"fill",`url(#r-${e})`),It(Q,"id",`s-${e}`),It(X,"fill",`url(#s-${e})`),It(J,"id",`q-${e}`),It(Z,"fill",`url(#q-${e})`),It(ee,"id",`p-${e}`),It(te,"fill",`url(#p-${e})`),It(ne,"id",`o-${e}`),It(re,"fill",`url(#o-${e})`),It(oe,"id",`l-${e}`),It(ie,"fill",`url(#l-${e})`),It(ae,"id",`al-${e}`),It(le,"id",`d-${e}`),It(ce,"filter",`url(#al-${e})`),It(ue,"mask",`url(#d-${e})`),It(de,"id",`u-${e}`),It(he,"fill",`url(#u-${e})`),It(pe,"id",`ad-${e}`),It(me,"id",`c-${e}`),It(ge,"filter",`url(#ad-${e})`),It(ve,"mask",`url(#c-${e})`),It(ye,"id",`t-${e}`),It(be,"fill",`url(#t-${e})`),It(xe,"id",`v-${e}`),It(we,"stroke",`url(#v-${e})`),It(Se,"id",`aa-${e}`),It(Ce,"stroke",`url(#aa-${e})`),It(ke,"id",`w-${e}`),It(Ee,"stroke",`url(#w-${e})`),It(je,"id",`ac-${e}`),It(Te,"stroke",`url(#ac-${e})`),It(Pe,"id",`ab-${e}`),It(_e,"stroke",`url(#ab-${e})`),It(Ne,"id",`y-${e}`),It(De,"stroke",`url(#y-${e})`),It(Me,"id",`x-${e}`),It(Oe,"stroke",`url(#x-${e})`),It(Re,"id",`z-${e}`),It(Ae,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x,w,S,C,k,E,j,T,P,_,N,D,M,O,R,A,L,I,F,$,q,z,U,B,V,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be,xe,we,Se,Ce,ke,Ee,je,Te,Pe,_e,Ne,De,Me,Oe,Re,Ae}var KG=At('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),HG=At('<button title="Copy object to clipboard">'),WG=At('<button title="Remove all items"aria-label="Remove all items">'),GG=At('<button title="Delete item"aria-label="Delete item">'),YG=At('<button title="Toggle value"aria-label="Toggle value">'),QG=At('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),XG=At("<div>"),JG=At("<div><button> <span></span> <span> "),ZG=At("<input>"),eY=At("<span>"),tY=At("<div><span>:"),nY=At("<div><div><button> [<!>...<!>]");var rY=e=>{const t=kU(),n=bU().shadowDOMTarget?YU.bind({target:bU().shadowDOMTarget}):YU,r=Re((()=>"dark"===t()?hY(n):dY(n)));return o=KG(),Me((()=>Ft(o,XU(r().expander,n`
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 Tw=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,Pw=/^[\u0021-\u003A\u003C-\u007E]*$/,_w=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Nw=/^[\u0020-\u003A\u003D-\u007E]*$/,Dw=Object.prototype.toString,Mw=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function Ow(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function Rw(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function Aw(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(CQ){return e}}function Lw(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?zw(t):t,state:n,key:t&&t.key||r||$w()};return o}(t?c().pathname:"/",e,n,r);return Fw("/"===o.pathname.charAt(0),`relative pathnames are not supported in memory history: ${JSON.stringify(e)}`),o}function d(e){return"string"==typeof e?e:qw(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?zw(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 Iw(e,t){if(!1===e||null==e)throw new Error(t)}function Fw(e,t){if(!e)try{throw new Error(t)}catch(CQ){}}function $w(){return Math.random().toString(36).substring(2,10)}function qw({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 zw(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 Uw(e,t,n="/"){return function(e,t,n,r){let o="string"==typeof t?zw(t):t,i=nS(o.pathname||"/",n);if(null==i)return null;let s=Bw(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=tS(i);a=Zw(s[l],e,r)}return a}(e,t,n,!1)}function Bw(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("/")&&(Iw(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=sS([r,s.relativePath]),l=n.concat(s);e.children&&e.children.length>0&&(Iw(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${a}".`),Bw(e.children,t,l,a)),(null!=e.path||e.index)&&t.push({path:a,score:Jw(a,e.index),routesMeta:l})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let n of Vw(e.path))o(e,t,n);else o(e,t)})),t}function Vw(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=Vw(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 Kw=/^:[\w-]+$/,Hw=3,Ww=2,Gw=1,Yw=10,Qw=-2,Xw=e=>"*"===e;function Jw(e,t){let n=e.split("/"),r=n.length;return n.some(Xw)&&(r+=Qw),t&&(r+=Ww),n.filter((e=>!Xw(e))).reduce(((e,t)=>e+(Kw.test(t)?Hw:""===t?Gw:Yw)),r)}function Zw(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=eS({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=eS({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;Object.assign(o,u.params),s.push({params:o,pathname:sS([i,u.pathname]),pathnameBase:aS(sS([i,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(i=sS([i,u.pathnameBase]))}return s}function eS(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t=!1,n=!0){Fw("*"===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 tS(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return Fw(!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 nS(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 rS(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 oS(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 iS(e,t,n,r=!1){let o;"string"==typeof e?o=zw(e):(o={...e},Iw(!o.pathname||!o.pathname.includes("?"),rS("?","pathname","search",o)),Iw(!o.pathname||!o.pathname.includes("#"),rS("#","pathname","hash",o)),Iw(!o.search||!o.search.includes("#"),rS("#","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?zw(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:lS(r),hash:cS(o)}}(o,i),c=a&&"/"!==a&&a.endsWith("/"),u=(s||"."===a)&&n.endsWith("/");return l.pathname.endsWith("/")||!c&&!u||(l.pathname+="/"),l}var sS=e=>e.join("/").replace(/\/\/+/g,"/"),aS=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),lS=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",cS=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var uS=["POST","PUT","PATCH","DELETE"];new Set(uS);var dS=["GET",...uS];new Set(dS);var hS=i.createContext(null);hS.displayName="DataRouter";var fS=i.createContext(null);fS.displayName="DataRouterState";var pS=i.createContext({isTransitioning:!1});pS.displayName="ViewTransition",i.createContext(new Map).displayName="Fetchers",i.createContext(null).displayName="Await";var mS=i.createContext(null);mS.displayName="Navigation";var gS=i.createContext(null);gS.displayName="Location";var vS=i.createContext({outlet:null,matches:[],isDataRoute:!1});vS.displayName="Route";var yS=i.createContext(null);function bS(){return null!=i.useContext(gS)}function xS(){return Iw(bS(),"useLocation() may be used only in the context of a <Router> component."),i.useContext(gS).location}yS.displayName="RouteError";var wS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function SS(e){i.useContext(mS).static||i.useLayoutEffect(e)}function CS(){let{isDataRoute:e}=i.useContext(vS);return e?function(){let{router:e}=function(e){let t=i.useContext(hS);return Iw(t,NS(e)),t}("useNavigate"),t=DS("useNavigate"),n=i.useRef(!1);return SS((()=>{n.current=!0})),i.useCallback((async(r,o={})=>{Fw(n.current,wS),n.current&&("number"==typeof r?e.navigate(r):await e.navigate(r,{fromRouteId:t,...o}))}),[e,t])}():function(){Iw(bS(),"useNavigate() may be used only in the context of a <Router> component.");let e=i.useContext(hS),{basename:t,navigator:n}=i.useContext(mS),{matches:r}=i.useContext(vS),{pathname:o}=xS(),s=JSON.stringify(oS(r)),a=i.useRef(!1);return SS((()=>{a.current=!0})),i.useCallback(((r,i={})=>{if(Fw(a.current,wS),!a.current)return;if("number"==typeof r)return void n.go(r);let l=iS(r,JSON.parse(s),o,"path"===i.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:sS([t,l.pathname])),(i.replace?n.replace:n.push)(l,i.state,i)}),[t,n,s,o,e])}()}function kS(e,{relative:t}={}){let{matches:n}=i.useContext(vS),{pathname:r}=xS(),o=JSON.stringify(oS(n));return i.useMemo((()=>iS(e,JSON.parse(o),r,"path"===t)),[e,o,r,t])}function ES(e,t,n,r){Iw(bS(),"useRoutes() may be used only in the context of a <Router> component.");let o,{navigator:s}=i.useContext(mS),{matches:a}=i.useContext(vS),l=a[a.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;{let e=h&&h.path||"";OS(u,!h||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=xS();let f=o.pathname||"/",p=f;if("/"!==d){let e=d.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(e.length).join("/")}let m=Uw(e,{pathname:p});Fw(h||null!=m,`No routes matched location "${o.pathname}${o.search}${o.hash}" `),Fw(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]));Iw(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,h=null,f=null;n&&(u=o&&l.route.id?o[l.route.id]:void 0,h=l.route.errorElement||TS,s&&(a<0&&0===c?(OS("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 p=t.concat(r.slice(0,c+1)),m=()=>{let t;return t=u?h:d?f:l.route.Component?i.createElement(l.route.Component,null):l.route.element?l.route.element:e,i.createElement(_S,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?i.createElement(PS,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:m(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):m()}),null)}(m&&m.map((e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:sS([d,s.encodeLocation?s.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:sS([d,s.encodeLocation?s.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),a,n,r);return g}function jS(){let e=function(){let e=i.useContext(yS),t=function(e){let t=i.useContext(fS);return Iw(t,NS(e)),t}("useRouteError"),n=DS("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 TS=i.createElement(jS,null),PS=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(vS.Provider,{value:this.props.routeContext},i.createElement(yS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function _S({routeContext:e,match:t,children:n}){let r=i.useContext(hS);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),i.createElement(vS.Provider,{value:e},n)}function NS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function DS(e){let t=function(e){let t=i.useContext(vS);return Iw(t,NS(e)),t}(e),n=t.matches[t.matches.length-1];return Iw(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}var MS={};function OS(e,t,n){t||MS[e]||(MS[e]=!0,Fw(!1,n))}function RS({basename:e,children:t,initialEntries:n,initialIndex:r}){let o=i.useRef();null==o.current&&(o.current=Lw({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(AS,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:s})}function AS({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:s=!1}){Iw(!bS(),"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=zw(n));let{pathname:c="/",search:u="",hash:d="",state:h=null,key:f="default"}=n,p=i.useMemo((()=>{let e=nS(c,a);return null==e?null:{location:{pathname:e,search:u,hash:d,state:h,key:f},navigationType:r}}),[a,c,u,d,h,f,r]);return Fw(null!=p,`<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==p?null:i.createElement(mS.Provider,{value:l},i.createElement(gS.Provider,{children:t,value:p}))}i.memo((function({routes:e,future:t,state:n}){return ES(e,0,n,t)}));var LS="get",IS="application/x-www-form-urlencoded";function FS(e){return null!=e&&"string"==typeof e.tagName}function $S(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 qS=null;var zS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function US(e){return null==e||zS.has(e)?e:(Fw(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${IS}"`),null)}function BS(e,t){let n,r,o,i,s;if(function(e){return FS(e)&&"form"===e.tagName.toLowerCase()}(e)){let s=e.getAttribute("action");r=s?nS(s,t):null,n=e.getAttribute("method")||LS,o=US(e.getAttribute("enctype"))||IS,i=new FormData(e)}else if(function(e){return FS(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return FS(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?nS(a,t):null,n=e.getAttribute("formmethod")||s.getAttribute("method")||LS,o=US(e.getAttribute("formenctype"))||US(s.getAttribute("enctype"))||IS,i=new FormData(s,e),!function(){if(null===qS)try{new FormData(document.createElement("form"),0),qS=!1}catch(CQ){qS=!0}return qS}()){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(FS(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=LS,r=null,o=IS,s=e}return i&&"text/plain"===o&&(s=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:s}}function VS(e,t){if(!1===e||null==e)throw new Error(t)}function KS(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 HS(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(KS).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function WS(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 GS(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 YS=i.createContext(void 0);function QS(){let e=i.useContext(YS);return VS(e,"You must render this element inside a <HydratedRouter> element"),e}function XS(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function JS({page:e,...t}){let{router:n}=function(){let e=i.useContext(hS);return VS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}(),r=i.useMemo((()=>Uw(n.routes,e,n.basename)),[n.routes,e,n.basename]);return r?i.createElement(ZS,{page:e,matches:r,...t}):null}function ZS({page:e,matches:t,...n}){let r=xS(),{manifest:o,routeModules:s}=QS(),{loaderData:a,matches:l}=function(){let e=i.useContext(fS);return VS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}(),c=i.useMemo((()=>WS(e,t,l,o,r,"data")),[e,t,l,o,r]),u=i.useMemo((()=>WS(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]),h=i.useMemo((()=>GS(u,o)),[u,o]),f=function(e){let{manifest:t,routeModules:n}=QS(),[r,o]=i.useState([]);return i.useEffect((()=>{let r=!1;return HS(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}))),h.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 eC(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}YS.displayName="FrameworkContext";var tC="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{tC&&(window.__reactRouterVersion="7.1.0")}catch(CQ){}var nC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rC=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,...h},f){let p,{basename:m}=i.useContext(mS),g="string"==typeof c&&nC.test(c),v=!1;if("string"==typeof c&&g&&(p=c,tC))try{let e=new URL(window.location.href),t=c.startsWith("//")?new URL(e.protocol+c):new URL(c),n=nS(t.pathname,m);t.origin===e.origin&&null!=n?c=n+t.search+t.hash:v=!0}catch(CQ){Fw(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let y=function(e,{relative:t}={}){Iw(bS(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=i.useContext(mS),{hash:o,pathname:s,search:a}=kS(e,{relative:t}),l=s;return"/"!==n&&(l="/"===s?n:sS([n,s])),r.createHref({pathname:l,search:a,hash:o})}(c,{relative:r}),[b,x,w]=function(e,t){let n=i.useContext(YS),[r,o]=i.useState(!1),[s,a]=i.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=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 p=()=>{o(!0)},m=()=>{o(!1),a(!1)};return n?"intent"!==e?[s,f,{}]:[s,f,{onFocus:XS(l,p),onBlur:XS(c,m),onMouseEnter:XS(u,p),onMouseLeave:XS(d,m),onTouchStart:XS(h,p)}]:[!1,f,{}]}(n,h),S=function(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:s,viewTransition:a}={}){let l=CS(),c=xS(),u=kS(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:qw(c)===qw(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",{...h,...w,href:p||y,onClick:v||o?e:function(t){e&&e(t),t.defaultPrevented||S(t)},ref:eC(f,x),target:l,"data-discover":g||"render"!==t?void 0:"true"});return b&&!g?i.createElement(i.Fragment,null,C,i.createElement(JS,{page:y})):C}));function oC(e){let t=i.useContext(hS);return Iw(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 iC(e){Fw("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($S(e)),n=i.useRef(!1),r=xS(),o=i.useMemo((()=>function(e,t){let n=$S(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=CS(),a=i.useCallback(((e,t)=>{const r=$S("function"==typeof e?e(o):e);n.current=!0,s("?"+r,t)}),[s,o]);return[o,a]}rC.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=kS(s,{relative:c.relative}),h=xS(),f=i.useContext(fS),{navigator:p,basename:m}=i.useContext(mS),g=null!=f&&function(e,t={}){let n=i.useContext(pS);Iw(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=oC("useViewTransitionState"),o=kS(e,{relative:t.relative});if(!n.isTransitioning)return!1;let s=nS(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=nS(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=eS(o.pathname,a)||null!=eS(o.pathname,s)}(d)&&!0===a,v=p.encodeLocation?p.encodeLocation(d).pathname:d.pathname,y=h.pathname,b=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(y=y.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&m&&(b=nS(b,m)||b);const x="/"!==v&&v.endsWith("/")?v.length-1:v.length;let w,S=y===v||!r&&y.startsWith(v)&&"/"===y.charAt(x),C=null!=b&&(b===v||!r&&b.startsWith(v)&&"/"===b.charAt(v.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 j="function"==typeof o?o(k):o;return i.createElement(rC,{...c,"aria-current":E,className:w,ref:u,style:j,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=LS,action:l,onSubmit:c,relative:u,preventScrollReset:d,viewTransition:h,...f},p)=>{let m=function(){let{router:e}=oC("useSubmit"),{basename:t}=i.useContext(mS),n=DS("useRouteId");return i.useCallback((async(r,o={})=>{let{action:i,method:s,encType:a,formData:l,body:c}=BS(r,t);if(!1===o.navigate){let t=o.fetcherKey||aC();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(mS),r=i.useContext(vS);Iw(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...kS(e||".",{relative:t})},a=xS();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:sS([n,s.pathname]));return qw(s)}(l,{relative:u}),v="get"===a.toLowerCase()?"get":"post",y="string"==typeof l&&nC.test(l);return i.createElement("form",{ref:p,method:v,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:h})},...f,"data-discover":y||"render"!==e?void 0:"true"})})).displayName="Form";var sC=0,aC=()=>`__${String(++sC)}__`;function lC(...e){return Oh(Zu(e))}new TextEncoder;const cC=({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",children:[t.jsx("div",{className:"flex items-center justify-between border-b",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:lC("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)))})]})},uC="flex flex-col items-center justify-center h-full";var dC,hC="dismissableLayer.update",fC="dismissableLayer.pointerDownOutside",pC="dismissableLayer.focusOutside",mC=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gC=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(mC),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){yC(fC,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){yC(pC,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(dC=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),vC(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=dC)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),vC())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(hC,e),()=>document.removeEventListener(hC,e)}),[]),t.jsx(Vc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));gC.displayName="DismissableLayer";function vC(){const e=new CustomEvent(hC);document.dispatchEvent(e)}function yC(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?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(mC),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Vc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var bC=i["useId".toString()]||(()=>{}),xC=0;function wC(e){const[t,n]=i.useState(bC());return iu((()=>{n((e=>e??String(xC++)))}),[e]),e||(t?`radix-${t}`:"")}const SC=["top","right","bottom","left"],CC=Math.min,kC=Math.max,EC=Math.round,jC=Math.floor,TC=e=>({x:e,y:e}),PC={left:"right",right:"left",bottom:"top",top:"bottom"},_C={start:"end",end:"start"};function NC(e,t,n){return kC(e,CC(t,n))}function DC(e,t){return"function"==typeof e?e(t):e}function MC(e){return e.split("-")[0]}function OC(e){return e.split("-")[1]}function RC(e){return"x"===e?"y":"x"}function AC(e){return"y"===e?"height":"width"}function LC(e){return["top","bottom"].includes(MC(e))?"y":"x"}function IC(e){return RC(LC(e))}function FC(e){return e.replace(/start|end/g,(e=>_C[e]))}function $C(e){return e.replace(/left|right|bottom|top/g,(e=>PC[e]))}function qC(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 zC(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 UC(e,t,n){let{reference:r,floating:o}=e;const i=LC(t),s=IC(t),a=AC(s),l=MC(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=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(OC(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function BC(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:h=!1,padding:f=0}=DC(t,e),p=qC(f),m=a[h?"floating"===d?"reference":"floating":d],g=zC(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})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=zC(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function VC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function KC(e){return SC.some((t=>e[t]>=0))}function HC(){return"undefined"!=typeof window}function WC(e){return QC(e)?(e.nodeName||"").toLowerCase():"#document"}function GC(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function YC(e){var t;return null==(t=(QC(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function QC(e){return!!HC()&&(e instanceof Node||e instanceof GC(e).Node)}function XC(e){return!!HC()&&(e instanceof Element||e instanceof GC(e).Element)}function JC(e){return!!HC()&&(e instanceof HTMLElement||e instanceof GC(e).HTMLElement)}function ZC(e){return!(!HC()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof GC(e).ShadowRoot)}function ek(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=sk(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function tk(e){return["table","td","th"].includes(WC(e))}function nk(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(CQ){return!1}}))}function rk(e){const t=ok(),n=XC(e)?sk(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 ok(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ik(e){return["html","body","#document"].includes(WC(e))}function sk(e){return GC(e).getComputedStyle(e)}function ak(e){return XC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lk(e){if("html"===WC(e))return e;const t=e.assignedSlot||e.parentNode||ZC(e)&&e.host||YC(e);return ZC(t)?t.host:t}function ck(e){const t=lk(e);return ik(t)?e.ownerDocument?e.ownerDocument.body:e.body:JC(t)&&ek(t)?t:ck(t)}function uk(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ck(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=GC(o);if(i){const e=dk(s);return t.concat(s,s.visualViewport||[],ek(o)?o:[],e&&n?uk(e):[])}return t.concat(o,uk(o,[],n))}function dk(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hk(e){const t=sk(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=JC(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=EC(n)!==i||EC(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fk(e){return XC(e)?e:e.contextElement}function pk(e){const t=fk(e);if(!JC(t))return TC(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=hk(t);let s=(i?EC(n.width):n.width)/r,a=(i?EC(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const mk=TC(0);function gk(e){const t=GC(e);return ok()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mk}function vk(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=fk(e);let s=TC(1);t&&(r?XC(r)&&(s=pk(r)):s=pk(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==GC(e))&&t}(i,n,r)?gk(i):TC(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=GC(i),t=r&&XC(r)?GC(r):r;let n=e,o=dk(n);for(;o&&r&&t!==n;){const e=pk(o),t=o.getBoundingClientRect(),r=sk(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=GC(o),o=dk(n)}}return zC({width:u,height:d,x:l,y:c})}function yk(e,t){const n=ak(e).scrollLeft;return t?t.left+n:vk(YC(e)).left+n}function bk(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:yk(e,r)),y:r.top+t.scrollTop}}function xk(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=GC(e),r=YC(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=ok();(!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=YC(e),n=ak(e),r=e.ownerDocument.body,o=kC(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=kC(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yk(e);const a=-n.scrollTop;return"rtl"===sk(r).direction&&(s+=kC(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(YC(e));else if(XC(t))r=function(e,t){const n=vk(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=JC(e)?pk(e):TC(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=gk(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zC(r)}function wk(e,t){const n=lk(e);return!(n===t||!XC(n)||ik(n))&&("fixed"===sk(n).position||wk(n,t))}function Sk(e,t,n){const r=JC(t),o=YC(t),i="fixed"===n,s=vk(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=TC(0);if(r||!r&&!i)if(("body"!==WC(t)||ek(o))&&(a=ak(t)),r){const e=vk(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=yk(o));const c=!o||r||i?TC(0):bk(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 Ck(e){return"static"===sk(e).position}function kk(e,t){if(!JC(e)||"fixed"===sk(e).position)return null;if(t)return t(e);let n=e.offsetParent;return YC(e)===n&&(n=n.ownerDocument.body),n}function Ek(e,t){const n=GC(e);if(nk(e))return n;if(!JC(e)){let t=lk(e);for(;t&&!ik(t);){if(XC(t)&&!Ck(t))return t;t=lk(t)}return n}let r=kk(e,t);for(;r&&tk(r)&&Ck(r);)r=kk(r,t);return r&&ik(r)&&Ck(r)&&!rk(r)?n:r||function(e){let t=lk(e);for(;JC(t)&&!ik(t);){if(rk(t))return t;if(nk(t))return null;t=lk(t)}return null}(e)||n}const jk={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=YC(r),a=!!t&&nk(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=TC(1);const u=TC(0),d=JC(r);if((d||!d&&!i)&&(("body"!==WC(r)||ek(s))&&(l=ak(r)),JC(r))){const e=vk(r);c=pk(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const h=!s||d||i?TC(0):bk(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+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}},getDocumentElement:YC,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?nk(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=uk(e,[],!1).filter((e=>XC(e)&&"body"!==WC(e))),o=null;const i="fixed"===sk(e).position;let s=i?lk(e):e;for(;XC(s)&&!ik(s);){const t=sk(s),n=rk(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ek(s)&&!n&&wk(e,s))?r=r.filter((e=>e!==s)):o=t,s=lk(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=xk(t,n,o);return e.top=kC(r.top,e.top),e.right=CC(r.right,e.right),e.bottom=CC(r.bottom,e.bottom),e.left=kC(r.left,e.left),e}),xk(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ek,getElementRects:async function(e){const t=this.getOffsetParent||Ek,n=this.getDimensions,r=await n(e.floating);return{reference:Sk(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}=hk(e);return{width:t,height:n}},getScale:pk,isElement:XC,isRTL:function(e){return"rtl"===sk(e).direction}};function Tk(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=fk(e),u=o||i?[...c?uk(c):[],...uk(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=YC(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:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-jC(u)+"px "+-jC(o.clientWidth-(c+d))+"px "+-jC(o.clientHeight-(u+h))+"px "+-jC(c)+"px",threshold:kC(0,CC(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(CQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?vk(e):null;return l&&function t(){const r=vk(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const Pk=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=MC(n),a=OC(n),l="y"===LC(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=DC(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*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}}}}},_k=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}=DC(e,t),c={x:n,y:r},u=await BC(t,l),d=LC(MC(o)),h=RC(d);let f=c[h],p=c[d];if(i){f=NC(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=NC(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:i,[d]:s}}}}}},Nk=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:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=DC(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=MC(o),y=LC(a),b=MC(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[$C(a)]:function(e){const t=$C(e);return[FC(e),t,FC(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=OC(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[]}}(MC(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(FC)))),i}(a,m,p,x));const C=[a,...w],k=await BC(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=OC(e),o=IC(e),i=AC(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=$C(s)),[s,$C(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var _;const e=null==(_=j.filter((e=>{if(S){const t=LC(e.placement);return t===y||"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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Dk=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}=DC(e,t),u=await BC(t,c),d=MC(o),h=OC(o),f="y"===LC(o),{width:p,height:m}=i.floating;let g,v;"top"===d||"bottom"===d?(g=d,v=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,g="end"===h?"top":"bottom");const y=m-u.top-u.bottom,b=p-u.left-u.right;let x=CC(m-u[g],y),w=CC(p-u[v],b);if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(w=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),!t.middlewareData.shift&&!h){const e=kC(u.left,0),t=kC(u.right,0),n=kC(u.top,0),r=kC(u.bottom,0);f?w=p-2*(0!==e||0!==t?e+t:kC(u.left,u.right)):x=m-2*(0!==n||0!==r?n+r:kC(u.top,u.bottom))}await l({...t,availableWidth:w,availableHeight:x});const S=await s.getDimensions(a.floating);return p!==S.width||m!==S.height?{reset:{rects:!0}}:{}}}},Mk=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=DC(e,t);switch(r){case"referenceHidden":{const e=VC(await BC(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:KC(e)}}}case"escaped":{const e=VC(await BC(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:KC(e)}}}default:return{}}}}},Ok=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}=DC(e,t)||{};if(null==c)return{};const d=qC(u),h={x:n,y:r},f=IC(o),p=AC(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[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[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=CC(d[v],E),T=CC(d[y],E),P=j,_=C-m[p]-T,N=C/2-m[p]/2+k,D=NC(P,N,_),M=!l.arrow&&null!=OC(o)&&N!==D&&i.reference[p]/2-(N<P?j:T)-m[p]/2<0,O=M?N<P?N-P:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),Rk=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}=DC(e,t),u={x:n,y:r},d=LC(o),h=RC(d);let f=u[h],p=u[d];const m=DC(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===h?"height":"width",t=i.reference[h]-i.floating[e]+g.mainAxis,n=i.reference[h]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,y;const e="y"===h?"width":"height",t=["top","left"].includes(MC(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[d])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[h]:f,[d]:p}}}},Ak=(e,t,n)=>{const r={platform:jk,...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}=UC(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=UC(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})};var Lk="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function Ik(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(!Ik(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)&&!Ik(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Fk(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $k(e,t){const n=Fk(e);return Math.round(t*n)/n}function qk(e){const t=i.useRef(e);return Lk((()=>{t.current=e})),t}const zk=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?Ok({element:n.current,padding:r}).fn(t):{}:n?Ok({element:n,padding:r}).fn(t):{}}}),Uk=(e,t)=>({..._k(e),options:[e,t]}),Bk=(e,t)=>({...Rk(e),options:[e,t]}),Vk=(e,t)=>({...Nk(e),options:[e,t]}),Kk=(e,t)=>({...Dk(e),options:[e,t]}),Hk=(e,t)=>({...Mk(e),options:[e,t]}),Wk=(e,t)=>({...zk(e),options:[e,t]});var Gk=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(Vc.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"})})}));Gk.displayName="Arrow";var Yk=Gk;function Qk(e){const[t,n]=i.useState(void 0);return iu((()=>{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 Xk="Popper",[Jk,Zk]=Lc(Xk),[eE,tE]=Jk(Xk),nE=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(eE,{scope:n,anchor:o,onAnchorChange:s,children:r})};nE.displayName=Xk;var rE="PopperAnchor",oE=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=tE(rE,r),l=i.useRef(null),c=Ac(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(Vc.div,{...s,ref:c})}));oE.displayName=rE;var iE="PopperContent",[sE,aE]=Jk(iE),lE=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:l="center",alignOffset:c=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,b=tE(iE,r),[x,w]=i.useState(null),S=Ac(n,(e=>w(e))),[C,k]=i.useState(null),E=Qk(C),j=E?.width??0,T=E?.height??0,P=o+("center"!==l?"-"+l:""),_="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},N=Array.isArray(h)?h:[h],D=N.length>0,M={padding:_,boundary:N.filter(hE),altBoundary:D},{refs:O,floatingStyles:R,placement:A,isPositioned:L,middlewareData:I}=function(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,[h,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Ik(p,r)||m(r);const[g,v]=i.useState(null),[y,b]=i.useState(null),x=i.useCallback((e=>{e!==k.current&&(k.current=e,v(e))}),[]),w=i.useCallback((e=>{e!==E.current&&(E.current=e,b(e))}),[]),S=a||g,C=l||y,k=i.useRef(null),E=i.useRef(null),j=i.useRef(h),T=null!=u,P=qk(u),_=qk(o),N=qk(d),D=i.useCallback((()=>{if(!k.current||!E.current)return;const e={placement:t,strategy:n,middleware:p};_.current&&(e.platform=_.current),Ak(k.current,E.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!Ik(j.current,t)&&(j.current=t,s.flushSync((()=>{f(t)})))}))}),[p,t,n,_,N]);Lk((()=>{!1===d&&j.current.isPositioned&&(j.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))))}),[d]);const M=i.useRef(!1);Lk((()=>(M.current=!0,()=>{M.current=!1})),[]),Lk((()=>{if(S&&(k.current=S),C&&(E.current=C),S&&C){if(P.current)return P.current(S,C,D);D()}}),[S,C,D,P,T]);const O=i.useMemo((()=>({reference:k,floating:E,setReference:x,setFloating:w})),[x,w]),R=i.useMemo((()=>({reference:S,floating:C})),[S,C]),A=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!R.floating)return e;const t=$k(R.floating,h.x),r=$k(R.floating,h.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...Fk(R.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,c,R.floating,h.x,h.y]);return i.useMemo((()=>({...h,update:D,refs:O,elements:R,floatingStyles:A})),[h,D,O,R,A])}({strategy:"fixed",placement:P,whileElementsMounted:(...e)=>Tk(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[(F={mainAxis:a+T,alignmentAxis:c},{...Pk(F),options:[F,$]}),d&&Uk({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?Bk():void 0,...M}),d&&Vk({...M}),Kk({...M,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`)}}),C&&Wk({element:C,padding:u}),fE({arrowWidth:j,arrowHeight:T}),m&&Hk({strategy:"referenceHidden",...M})]});var F,$;const[q,z]=pE(A),U=Hc(v);iu((()=>{L&&U?.()}),[L,U]);const B=I.arrow?.x,V=I.arrow?.y,K=0!==I.arrow?.centerOffset,[H,W]=i.useState();return iu((()=>{x&&W(window.getComputedStyle(x).zIndex)}),[x]),t.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:L?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(sE,{scope:r,placedSide:q,onArrowChange:k,arrowX:B,arrowY:V,shouldHideArrow:K,children:t.jsx(Vc.div,{"data-side":q,"data-align":z,...y,ref:S,style:{...y.style,animation:L?void 0:"none"}})})})}));lE.displayName=iE;var cE="PopperArrow",uE={top:"bottom",right:"left",bottom:"top",left:"right"},dE=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=aE(cE,r),s=uE[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(Yk,{...o,ref:n,style:{...o.style,display:"block"}})})}));function hE(e){return null!==e}dE.displayName=cE;var fE=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]=pE(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,h=(o.arrow?.y??0)+a/2;let f="",p="";return"bottom"===l?(f=i?u:`${d}px`,p=-a+"px"):"top"===l?(f=i?u:`${d}px`,p=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",p=i?u:`${h}px`):"left"===l&&(f=`${r.floating.width+a}px`,p=i?u:`${h}px`),{data:{x:f,y:p}}}});function pE(e){const[t,n="center"]=e.split("-");return[t,n]}var mE=nE,gE=oE,vE=lE,yE=dE,[bE,xE]=Lc("Tooltip",[Zk]),wE=Zk(),SE="TooltipProvider",CE=700,kE="tooltip.open",[EE,jE]=bE(SE),TE=e=>{const{__scopeTooltip:n,delayDuration:r=CE,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(EE,{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})};TE.displayName=SE;var PE="Tooltip",[_E,NE]=bE(PE),DE=e=>{const{__scopeTooltip:n,children:r,open:o,defaultOpen:s=!1,onOpenChange:a,disableHoverableContent:l,delayDuration:c}=e,u=jE(PE,e.__scopeTooltip),d=wE(n),[h,f]=i.useState(null),p=wC(),m=i.useRef(0),g=l??u.disableHoverableContent,v=c??u.delayDuration,y=i.useRef(!1),[b=!1,x]=cu({prop:o,defaultProp:s,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(kE))):u.onClose(),a?.(e)}}),w=i.useMemo((()=>b?y.current?"delayed-open":"instant-open":"closed"),[b]),S=i.useCallback((()=>{window.clearTimeout(m.current),m.current=0,y.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((()=>{y.current=!0,x(!0),m.current=0}),v)}),[v,x]);return i.useEffect((()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)}),[]),t.jsx(mE,{...d,children:t.jsx(_E,{scope:n,contentId:p,open:b,stateAttribute:w,trigger:h,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})})};DE.displayName=PE;var ME="TooltipTrigger",OE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,s=NE(ME,r),a=jE(ME,r),l=wE(r),c=Ac(n,i.useRef(null),s.onTriggerChange),u=i.useRef(!1),d=i.useRef(!1),h=i.useCallback((()=>u.current=!1),[]);return i.useEffect((()=>()=>document.removeEventListener("pointerup",h)),[h]),t.jsx(gE,{asChild:!0,...l,children:t.jsx(Vc.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...o,ref:c,onPointerMove:Mc(e.onPointerMove,(e=>{"touch"!==e.pointerType&&(d.current||a.isPointerInTransitRef.current||(s.onTriggerEnter(),d.current=!0))})),onPointerLeave:Mc(e.onPointerLeave,(()=>{s.onTriggerLeave(),d.current=!1})),onPointerDown:Mc(e.onPointerDown,(()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})})),onFocus:Mc(e.onFocus,(()=>{u.current||s.onOpen()})),onBlur:Mc(e.onBlur,s.onClose),onClick:Mc(e.onClick,s.onClose)})})}));OE.displayName=ME;var RE="TooltipPortal",[AE,LE]=bE(RE,{forceMount:void 0}),IE=e=>{const{__scopeTooltip:n,forceMount:r,children:o,container:i}=e,s=NE(RE,n);return t.jsx(AE,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};IE.displayName=RE;var FE="TooltipContent",$E=i.forwardRef(((e,n)=>{const r=LE(FE,e.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=e,a=NE(FE,e.__scopeTooltip);return t.jsx(au,{present:o||a.open,children:t.jsx(a.disableHoverableContent?BE:qE,{side:i,...s,ref:n})})})),qE=i.forwardRef(((e,n)=>{const r=NE(FE,e.__scopeTooltip),o=jE(FE,e.__scopeTooltip),s=i.useRef(null),a=Ac(n,s),[l,c]=i.useState(null),{trigger:u,onClose:d}=r,h=s.current,{onPointerInTransitChange:f}=o,p=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((()=>()=>p()),[p]),i.useEffect((()=>{if(u&&h){const e=e=>m(e,h),t=e=>m(e,u);return u.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}}),[u,h,m,p]),i.useEffect((()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},r=u?.contains(t)||h?.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?p():o&&(p(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}}),[u,h,l,d,p]),t.jsx(BE,{...e,ref:a})})),[zE,UE]=bE(PE,{isInside:!1}),BE=i.forwardRef(((e,n)=>{const{__scopeTooltip:r,children:o,"aria-label":s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=e,u=NE(FE,r),d=wE(r),{onClose:h}=u;return i.useEffect((()=>(document.addEventListener(kE,h),()=>document.removeEventListener(kE,h))),[h]),i.useEffect((()=>{if(u.trigger){const e=e=>{const t=e.target;t?.contains(u.trigger)&&h()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}}),[u.trigger,h]),t.jsx(gC,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:h,children:t.jsxs(vE,{"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(qc,{children:o}),t.jsx(zE,{scope:r,isInside:!0,children:t.jsx(du,{id:u.contentId,role:"tooltip",children:s||o})})]})})}));$E.displayName=FE;var VE="TooltipArrow";i.forwardRef(((e,n)=>{const{__scopeTooltip:r,...o}=e,i=wE(r);return UE(VE,r).isInside?null:t.jsx(yE,{...i,...o,ref:n})})).displayName=VE;var KE=IE,HE=$E;const WE=TE,GE=DE,YE=OE,QE=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(KE,{children:t.jsx(HE,{ref:o,sideOffset:n,className:Rh("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})})));QE.displayName=HE.displayName;const XE=({title:e,alertText:n,Icon:r=xd,onClick:o})=>t.jsx(WE,{children:t.jsxs(GE,{children:[t.jsx(YE,{asChild:!0,children:t.jsx(r,{className:"h-3.5 w-3.5 cursor-pointer transition-colors",onClick:o})}),t.jsx(QE,{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})]})})]})}),JE=({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(XE,{title:o})]}),t.jsx("span",{children:r})]})]})}),ZE=({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(JE,{icon:e.icon,title:e.title,value:e.value,tooltipText:e.tooltipText},n)))})},ej=({automationId:e,iconDefinitions:r})=>{const[o,i]=n.useState("email"),{statistics:s,isLoading:a}=tw(e);if(a||!s)return t.jsx("div",{className:uC,children:t.jsx(Vx,{text:["Fetching Statistics","Finishing up"]})});return t.jsx(cC,{tabs:[{id:"email",label:"Email Stats",content:t.jsx(ZE,{activeTab:"email",statistics:s,iconDefinitions:r})},{id:"sms",label:"SMS Stats",content:t.jsx(ZE,{activeTab:"sms",statistics:s,iconDefinitions:r})}],activeTab:o,onTabChange:e=>i(e),tabsLocation:"left"})};function tj(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 nj(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const rj=6048e5,oj=43200;let ij={};function sj(){return ij}function aj(e,t){const n=sj(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=tj(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 lj(e){return aj(e,{weekStartsOn:1})}function cj(e){const t=tj(e),n=t.getFullYear(),r=nj(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=lj(r),i=nj(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=lj(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function uj(e){const t=tj(e);return t.setHours(0,0,0,0),t}function dj(e){const t=tj(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 hj(e,t){return function(e,t){return nj(e,+tj(e)+t)}(e,6e4*t)}function fj(e,t){const n=tj(e),r=tj(t),o=n.getTime()-r.getTime();return o<0?-1:o>0?1:o}function pj(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=tj(e);return!isNaN(Number(n))}function mj(e){const t=tj(e);return+function(e){const t=tj(e);return t.setHours(23,59,59,999),t}(t)==+function(e){const t=tj(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}(t)}function gj(e,t){const n=tj(e),r=tj(t),o=fj(n,r),i=Math.abs(function(e,t){const n=tj(e),r=tj(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=fj(n,r)===-o;mj(tj(e))&&1===i&&1===fj(e,r)&&(t=!1),s=o*(i-Number(t))}return 0===s?0:s}function vj(e,t,n){const r=function(e,t){return+tj(e)-+tj(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 yj={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 bj(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xj={date:bj({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:bj({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:bj({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},wj={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Sj(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 Cj(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 kj;const Ej={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=yj[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:xj,formatRelative:(e,t,n,r)=>wj[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:Sj({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Sj({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:Sj({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:Sj({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:Sj({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:(kj={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(kj.matchPattern);if(!n)return null;const r=n[0],o=e.match(kj.parsePattern);if(!o)return null;let i=kj.valueCallback?kj.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:Cj({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:Cj({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:Cj({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:Cj({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:Cj({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 jj(e){const t=tj(e),n=function(e,t){const n=uj(e),r=uj(t),o=+n-dj(n),i=+r-dj(r);return Math.round((o-i)/864e5)}(t,function(e){const t=tj(e),n=nj(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t));return n+1}function Tj(e){const t=tj(e),n=+lj(t)-+function(e){const t=cj(e),n=nj(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),lj(n)}(t);return Math.round(n/rj)+1}function Pj(e,t){const n=tj(e),r=n.getFullYear(),o=sj(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=nj(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=aj(s,t),l=nj(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=aj(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function _j(e,t){const n=tj(e),r=+aj(n,t)-+function(e,t){const n=sj(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=Pj(e,t),i=nj(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),aj(i,t)}(n,t);return Math.round(r/rj)+1}function Nj(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Dj={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Nj("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Nj(n+1,2)},d:(e,t)=>Nj(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)=>Nj(e.getHours()%12||12,t.length),H:(e,t)=>Nj(e.getHours(),t.length),m:(e,t)=>Nj(e.getMinutes(),t.length),s:(e,t)=>Nj(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return Nj(Math.trunc(r*Math.pow(10,n-3)),t.length)}},Mj="midnight",Oj="noon",Rj="morning",Aj="afternoon",Lj="evening",Ij="night",Fj={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 Dj.y(e,t)},Y:function(e,t,n,r){const o=Pj(e,r),i=o>0?o:1-o;if("YY"===t){return Nj(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):Nj(i,t.length)},R:function(e,t){return Nj(cj(e),t.length)},u:function(e,t){return Nj(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 Nj(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 Nj(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 Dj.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 Nj(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=_j(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Nj(o,t.length)},I:function(e,t,n){const r=Tj(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Nj(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Dj.d(e,t)},D:function(e,t,n){const r=jj(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Nj(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 Nj(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 Nj(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 Nj(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?Oj:0===r?Mj: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?Lj:r>=12?Aj:r>=4?Rj:Ij,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 Dj.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Dj.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Nj(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Nj(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Dj.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Dj.s(e,t)},S:function(e,t){return Dj.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return qj(r);case"XXXX":case"XX":return zj(r);default:return zj(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return qj(r);case"xxxx":case"xx":return zj(r);default:return zj(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+$j(r,":");default:return"GMT"+zj(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+$j(r,":");default:return"GMT"+zj(r,":")}},t:function(e,t,n){return Nj(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return Nj(e.getTime(),t.length)}};function $j(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+Nj(i,2)}function qj(e,t){if(e%60==0){return(e>0?"-":"+")+Nj(Math.abs(e)/60,2)}return zj(e,t)}function zj(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+Nj(Math.trunc(r/60),2)+t+Nj(r%60,2)}const Uj=(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"})}},Bj=(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"})}},Vj={p:Bj,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Uj(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}}",Uj(r,t)).replace("{{time}}",Bj(o,t))}},Kj=/^D+$/,Hj=/^Y+$/,Wj=["D","DD","YY","YYYY"];const Gj=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yj=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qj=/^'([^]*?)'?$/,Xj=/''/g,Jj=/[a-zA-Z]/;function Zj(e,t,n){const r=sj(),o=r.locale??Ej,i=r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=tj(e);if(!pj(a))throw new RangeError("Invalid time value");let l=t.match(Yj).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,Vj[t])(e,o.formatLong)}return e})).join("").match(Gj).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:eT(e)};if(Fj[t])return{isToken:!0,value:e};if(t.match(Jj))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 Hj.test(e)}(r)||function(e){return Kj.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(Wj.includes(e))throw new RangeError(r)}(r,t,String(e));return(0,Fj[r[0]])(a,r,o.localize,c)})).join("")}function eT(e){const t=e.match(Qj);return t?t[1].replace(Xj,"'"):e}function tT(e,t){return function(e,t,n){const r=sj(),o=n?.locale??r.locale??Ej,i=fj(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=tj(t),l=tj(e)):(a=tj(e),l=tj(t));const c=vj(l,a),u=(dj(l)-dj(a))/1e3,d=Math.round((c-u)/60);let h;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<oj){const e=Math.round(d/1440);return o.formatDistance("xDays",e,s)}if(d<86400)return h=Math.round(d/oj),o.formatDistance("aboutXMonths",h,s);if(h=gj(l,a),h<12){const e=Math.round(d/oj);return o.formatDistance("xMonths",e,s)}{const e=h%12,t=Math.trunc(h/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 nj(e,Date.now())}(e),t)}var nT=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(iT);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(rT,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(rT,{...o,ref:n,children:r})}));nT.displayName="Slot";var rT=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?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));rT.displayName="SlotClone";var oT=({children:e})=>t.jsx(t.Fragment,{children:e});function iT(e){return i.isValidElement(e)&&e.type===oT}var sT=["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?nT: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}}),{});var aT,lT="dismissableLayer.update",cT="dismissableLayer.pointerDownOutside",uT="dismissableLayer.focusOutside",dT=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hT=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(dT),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){pT(cT,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){pT(uT,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(aT=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),fT(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=aT)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),fT())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(lT,e),()=>document.removeEventListener(lT,e)}),[]),t.jsx(sT.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));hT.displayName="DismissableLayer";function fT(){const e=new CustomEvent(lT);document.dispatchEvent(e)}function pT(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?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(dT),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(sT.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var mT="focusScope.autoFocusOnMount",gT="focusScope.autoFocusOnUnmount",vT={bubbles:!1,cancelable:!0},yT=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:ST(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||ST(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ST(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){CT.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(mT,vT);c.addEventListener(mT,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ST(r,{select:t}),document.activeElement!==n)return}((e=bT(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&ST(c))}return()=>{c.removeEventListener(mT,d),setTimeout((()=>{const e=new CustomEvent(gT,vT);c.addEventListener(gT,h),c.dispatchEvent(e),e.defaultPrevented||ST(t??document.body,{select:!0}),c.removeEventListener(gT,h),CT.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=bT(e),n=xT(t,e),r=xT(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&ST(i,{select:!0})):(e.preventDefault(),r&&ST(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(sT.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function bT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function xT(e,t){for(const n of e)if(!wT(n,{upTo:t}))return n}function wT(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ST(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}yT.displayName="FocusScope";var CT=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kT(e,t),e.unshift(t)},remove(t){e=kT(e,t),e[0]?.resume()}}}();function kT(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var ET=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);iu((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(sT.div,{...s,ref:n}),c):null}));ET.displayName="Portal";var jT=0;function TT(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??PT()),document.body.insertAdjacentElement("beforeend",e[1]??PT()),jT++,()=>{1===jT&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),jT--}}),[])}function PT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var _T=function(){return _T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_T.apply(this,arguments)};function NT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function DT(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var MT="right-scroll-bar-position",OT="width-before-scroll-bar";function RT(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var AT="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,LT=new WeakMap;function IT(e,t){var r=function(e,t){var r=n.useState((function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(e){var t=r.value;t!==e&&(r.value=e,r.callback(e,t))}}}}))[0];return r.callback=t,r.facade}(null,(function(t){return e.forEach((function(e){return RT(e,t)}))}));return AT((function(){var t=LT.get(r);if(t){var n=new Set(t),o=new Set(e),i=r.current;n.forEach((function(e){o.has(e)||RT(e,null)})),o.forEach((function(e){n.has(e)||RT(e,i)}))}LT.set(r,e)}),[e]),r}function FT(e){return e}function $T(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=FT);var n=[],r=!1;return{read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var o=t(e,r);return n.push(o),function(){n=n.filter((function(e){return e!==o}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(i)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}}}(null);return t.options=_T({async:!0,ssr:!1},e),t}var qT=function(e){var t=e.sideCar,n=NT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return i.createElement(r,_T({},n))};function zT(e,t){return e.useMedium(t),qT}qT.isSideCarExport=!0;var UT=$T(),BT=function(){},VT=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:BT,onWheelCapture:BT,onTouchMoveCapture:BT}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=e.gapMode,x=NT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=f,S=IT([n,t]),C=_T(_T({},x),o);return i.createElement(i.Fragment,null,d&&i.createElement(w,{sideCar:UT,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n,gapMode:b}),a?i.cloneElement(i.Children.only(l),_T(_T({},C),{ref:S})):i.createElement(y,_T({},C,{className:c,ref:S}),l))}));VT.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},VT.classNames={fullWidth:OT,zeroRight:MT};function KT(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var HT=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=KT())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},WT=function(){var e,t=(e=HT(),function(t,n){i.useEffect((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){return t(e.styles,e.dynamic),null}},GT={left:0,top:0,right:0,gap:0},YT=function(e){return parseInt(e||"",10)||0},QT=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return GT;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingTop":"marginTop"],r=t["padding"===e?"paddingRight":"marginRight"];return[YT(t["padding"===e?"paddingLeft":"marginLeft"]),YT(n),YT(r)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},XT=WT(),JT="data-scroll-locked",ZT=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(JT,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(MT," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(OT," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(MT," .").concat(MT," {\n right: 0 ").concat(r,";\n }\n \n .").concat(OT," .").concat(OT," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(JT,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},eP=function(){var e=parseInt(document.body.getAttribute(JT)||"0",10);return isFinite(e)?e:0},tP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;i.useEffect((function(){return document.body.setAttribute(JT,(eP()+1).toString()),function(){var e=eP()-1;e<=0?document.body.removeAttribute(JT):document.body.setAttribute(JT,e.toString())}}),[]);var s=i.useMemo((function(){return QT(o)}),[o]);return i.createElement(XT,{styles:ZT(s,!t,o,n?"":"!important")})},nP=!1;if("undefined"!=typeof window)try{var rP=Object.defineProperty({},"passive",{get:function(){return nP=!0,!0}});window.addEventListener("test",rP,rP),window.removeEventListener("test",rP,rP)}catch(EQ){nP=!1}var oP=!!nP&&{passive:!1},iP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},sP=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),aP(e,r)){var o=lP(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aP=function(e,t){return"v"===e?function(e){return iP(e,"overflowY")}(t):function(e){return iP(e,"overflowX")}(t)},lP=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},cP=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uP=function(e){return[e.deltaX,e.deltaY]},dP=function(e){return e&&"current"in e?e.current:e},hP=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},fP=0,pP=[];function mP(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gP=zT(UT,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(fP++)[0],s=i.useState(WT)[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DT([e.lockRef.current],(e.shards||[]).map(dP),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=cP(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=sP(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=sP(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=lP(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&aP(e,s)&&(u+=p,d+=f),s=s instanceof ShadowRoot?s.host:s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(pP.length&&pP[pP.length-1]===s){var r="deltaY"in n?uP(n):cP(n),o=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(dP).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:mP(r)};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=cP(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,uP(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,cP(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return pP.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,oP),document.addEventListener("touchmove",c,oP),document.addEventListener("touchstart",d,oP),function(){pP=pP.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,oP),document.removeEventListener("touchmove",c,oP),document.removeEventListener("touchstart",d,oP)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:hP(o)}):null,p?i.createElement(tP,{gapMode:e.gapMode}):null)}));var vP=i.forwardRef((function(e,t){return i.createElement(VT,_T({},e,{ref:t,sideCar:gP}))}));vP.classNames=VT.classNames;var yP=new WeakMap,bP=new WeakMap,xP={},wP=0,SP=function(e){return e&&(e.host||SP(e.parentNode))},CP=function(e,t,n,r){var o=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=SP(t);return n&&e.contains(n)?n:null})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);xP[n]||(xP[n]=new WeakMap);var i=xP[n],s=[],a=new Set,l=new Set(o),c=function(e){e&&!a.has(e)&&(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(yP.get(e)||0)+1,c=(i.get(e)||0)+1;yP.set(e,l),i.set(e,c),s.push(e),1===l&&o&&bP.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(CQ){}}))};return u(t),a.clear(),wP++,function(){s.forEach((function(e){var t=yP.get(e)-1,o=i.get(e)-1;yP.set(e,t),i.set(e,o),t||(bP.has(e)||e.removeAttribute(r),bP.delete(e)),o||e.removeAttribute(n)})),--wP||(yP=new WeakMap,yP=new WeakMap,bP=new WeakMap,xP={})}},kP=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),CP(r,o,n,"aria-hidden")):function(){return null}},EP="Dialog",[jP,TP]=Lc(EP),[PP,_P]=jP(EP),NP=e=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!0}=e,c=i.useRef(null),u=i.useRef(null),[d=!1,h]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(PP,{scope:n,triggerRef:c,contentRef:u,contentId:wC(),titleId:wC(),descriptionId:wC(),open:d,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),modal:l,children:r})};NP.displayName=EP;var DP="DialogTrigger";i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(DP,r),s=Ac(n,i.triggerRef);return t.jsx(sT.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":QP(i.open),...o,ref:s,onClick:Mc(e.onClick,i.onOpenToggle)})})).displayName=DP;var MP="DialogPortal",[OP,RP]=jP(MP,{forceMount:void 0}),AP=e=>{const{__scopeDialog:n,forceMount:r,children:o,container:s}=e,a=_P(MP,n);return t.jsx(OP,{scope:n,forceMount:r,children:i.Children.map(o,(e=>t.jsx(au,{present:r||a.open,children:t.jsx(ET,{asChild:!0,container:s,children:e})})))})};AP.displayName=MP;var LP="DialogOverlay",IP=i.forwardRef(((e,n)=>{const r=RP(LP,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=_P(LP,e.__scopeDialog);return s.modal?t.jsx(au,{present:o||s.open,children:t.jsx(FP,{...i,ref:n})}):null}));IP.displayName=LP;var FP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(LP,r);return t.jsx(vP,{as:nT,allowPinchZoom:!0,shards:[i.contentRef],children:t.jsx(sT.div,{"data-state":QP(i.open),...o,ref:n,style:{pointerEvents:"auto",...o.style}})})})),$P="DialogContent",qP=i.forwardRef(((e,n)=>{const r=RP($P,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=_P($P,e.__scopeDialog);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?zP:UP,{...i,ref:n})})}));qP.displayName=$P;var zP=i.forwardRef(((e,n)=>{const r=_P($P,e.__scopeDialog),o=i.useRef(null),s=Ac(n,r.contentRef,o);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(BP,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()))})})),UP=i.forwardRef(((e,n)=>{const r=_P($P,e.__scopeDialog),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(BP,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),BP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:a,...l}=e,c=_P($P,r),u=i.useRef(null),d=Ac(n,u);return TT(),t.jsxs(t.Fragment,{children:[t.jsx(yT,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:a,children:t.jsx(hT,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":QP(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(e_,{titleId:c.titleId}),t.jsx(t_,{contentRef:u,descriptionId:c.descriptionId})]})]})})),VP="DialogTitle",KP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(VP,r);return t.jsx(sT.h2,{id:i.titleId,...o,ref:n})}));KP.displayName=VP;var HP="DialogDescription",WP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(HP,r);return t.jsx(sT.p,{id:i.descriptionId,...o,ref:n})}));WP.displayName=HP;var GP="DialogClose",YP=i.forwardRef(((e,n)=>{const{__scopeDialog:r,...o}=e,i=_P(GP,r);return t.jsx(sT.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})}));function QP(e){return e?"open":"closed"}YP.displayName=GP;var XP="DialogTitleWarning",[JP,ZP]=function(e,n){const r=i.createContext(n),o=e=>{const{children:n,...o}=e,s=i.useMemo((()=>o),Object.values(o));return t.jsx(r.Provider,{value:s,children:n})};return o.displayName=e+"Provider",[o,function(t){const o=i.useContext(r);if(o)return o;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(XP,{contentName:$P,titleName:VP,docsSlug:"dialog"}),e_=({titleId:e})=>{const t=ZP(XP);return i.useEffect((()=>{if(e){document.getElementById(e)}}),[`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`,e]),null},t_=({contentRef:e,descriptionId:t})=>{const n=ZP("DialogDescriptionWarning");return i.useEffect((()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)}}),[`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${n.contentName}}.`,e,t]),null},n_=NP,r_=AP,o_=IP,i_=qP,s_=KP,a_=WP,l_=YP,c_=["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?sw: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}}),{}),u_=i.forwardRef(((e,n)=>t.jsx(c_.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}})));u_.displayName="VisuallyHidden";const d_=n_,h_=({...e})=>t.jsx(r_,{children:t.jsx("div",{"data-reach-root":!0,children:e.children})}),f_=i.forwardRef((({className:e,...n},r)=>t.jsx(o_,{ref:r,className:lC("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})));f_.displayName=o_.displayName;const p_=i.forwardRef((({className:e,children:n,hideCloseButton:r=!1,...o},i)=>t.jsxs(h_,{children:[t.jsx(f_,{}),t.jsxs(i_,{ref:i,className:lC("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),onInteractOutside:e=>{e.composedPath().some((e=>"classList"in e&&Array.from(e.classList).includes("pac-item")))&&e.preventDefault()},...o,children:[n,!r&&t.jsxs(l_,{className:"absolute right-6 top-6 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(zd,{className:"h-6 w-6"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]})));p_.displayName=i_.displayName;const m_=({className:e,...n})=>t.jsx("div",{className:lC("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});m_.displayName="DialogHeader";const g_=i.forwardRef((({className:e,...n},r)=>t.jsx(s_,{ref:r,className:lC("text-lg font-semibold leading-none tracking-tight",e),...n})));g_.displayName=s_.displayName;const v_=i.forwardRef((({className:e,...n},r)=>t.jsx(a_,{ref:r,className:lC("text-sm text-muted-foreground",e),...n})));v_.displayName=a_.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsx(u_,{ref:o,className:lC(e),...r,children:n}))).displayName="DialogVisuallyHidden";const y_=i.forwardRef((({className:e,type:n,...r},o)=>t.jsx("input",{type:n,className:Rh("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...r})));y_.displayName="Input";const b_=i.forwardRef((({className:e,...n},r)=>t.jsx("div",{className:"relative w-full overflow-auto",children:t.jsx("table",{ref:r,className:Rh("w-full caption-bottom text-sm",e),...n})})));b_.displayName="Table";const x_=i.forwardRef((({className:e,...n},r)=>t.jsx("thead",{ref:r,className:Rh("[&_tr]:border-b",e),...n})));x_.displayName="TableHeader";const w_=i.forwardRef((({className:e,...n},r)=>t.jsx("tbody",{ref:r,className:Rh("[&_tr:last-child]:border-0",e),...n})));w_.displayName="TableBody";const S_=i.forwardRef((({className:e,...n},r)=>t.jsx("tr",{ref:r,className:Rh("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n})));S_.displayName="TableRow";const C_=i.forwardRef((({className:e,...n},r)=>t.jsx("th",{ref:r,className:Rh("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...n})));C_.displayName="TableHead";const k_=i.forwardRef((({className:e,...n},r)=>t.jsx("td",{ref:r,className:Rh("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...n})));k_.displayName="TableCell";i.forwardRef((({className:e,...n},r)=>t.jsx("tfoot",{ref:r,className:Rh("[&_tr]:border-t",e),...n}))).displayName="TableFooter";const E_=({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),[h,f]=n.useState(),[p,m]=n.useState(!0),[g,v]=n.useState(null),y=n.useCallback((async e=>{try{d(!0),v(null);const t=await r({cursor:e,limit:o});c(e?e=>[...e,...t.items]:t.items),m(!!t.cursor),f(t.cursor)}catch(EQ){v(EQ instanceof Error?EQ.message:"An error occurred")}finally{d(!1)}}),[r,o]);return n.useEffect((()=>{c([]),f(void 0),m(!0),y()}),[y]),g?t.jsx("div",{className:"flex items-center justify-center p-8 text-center text-red-600",children:t.jsx("p",{children:g})}):t.jsxs("div",u||0!==l.length?{className:Rh(s,"mb-4"),children:[t.jsx("div",{className:"rounded-lg border border-gray-200 bg-white",children:t.jsxs(b_,{children:[t.jsx(x_,{children:t.jsx(S_,{children:e.map((e=>t.jsx(C_,{style:{width:e.width},children:e.header},String(e.accessorKey))))})}),t.jsx(w_,{children:l.map(((n,r)=>t.jsx(S_,{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(k_,{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)))})]})}),p&&t.jsx("div",{className:"mt-4 flex justify-center",children:t.jsx("button",{onClick:()=>y(h),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})]})},j_="reach-styles-module__container___6PQqs",T_=nd(["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}}),P_=i.forwardRef((({className:e,variant:n,size:r,iconOnly:o,truncate:i,...s},a)=>t.jsx("div",{ref:a,className:Rh(T_({variant:n,size:r,iconOnly:o}),i&&"max-w-[90px]",e),...s})));P_.displayName="Badge";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(j_,e),...n}))).displayName="BadgeContainer";const __=({status:e})=>{switch(e){case rw.DRAFT:return t.jsx(P_,{variant:"secondary",children:"Draft"});case rw.ACTIVE:return t.jsx(P_,{variant:"default",className:"bg-green-600 hover:bg-green-700",children:"Active"});case rw.RUNNING:return t.jsx(P_,{variant:"default",className:"bg-blue-500 hover:bg-blue-600",children:"Running"});case rw.COMPLETED:return t.jsx(P_,{variant:"default",className:"bg-gray-500 hover:bg-gray-600",children:"Completed"});case rw.FAILED:return t.jsx(P_,{variant:"destructive",children:"Failed"});case rw.DEACTIVATED:return t.jsx(P_,{variant:"destructive",children:"Cancelled"});default:bw(e,rw)}},N_=({onViewAutomation:e,iconDefinitions:r})=>{const[o,i]=n.useState(""),[s,a]=n.useState("all"),{toast:l}=Dc(),c=CS(),[u,d]=n.useState(!1),h=e=>t.jsx(__,{status:e}),f=e=>{let n="bg-gray-400";switch(e){case rw.ACTIVE:n="bg-green-500";break;case rw.DRAFT:n="bg-gray-400";break;case rw.DEACTIVATED:n="bg-red-500";break;case rw.RUNNING:n="bg-yellow-400";break;default:n="bg-gray-400"}return t.jsx("div",{className:`w-2 h-2 rounded-full ${n}`})},p=n=>t.jsx(E_,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-3",children:[f(n.status),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),h(n.status)]})]})},{header:"Stats",accessorKey:"emailsSent",width:"25%",cell:(e,n)=>t.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(ow.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(ow.SmsIcon,{className:"h-4 w-4"}),t.jsx("span",{children:n.smsSent||0})]})]})},{header:"Modified",accessorKey:"updated_at",width:"25%",cell:(e,n)=>{const r=e||n.created_at;return t.jsx("div",{className:"text-gray-600",children:r?tT(new Date(r),{addSuffix:!0}):"Not available"})}}],fetchData:async({cursor:e,limit:t})=>{const r=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 Ja(`${Hx}?${t.toString()}`,{method:"GET"})).data})({cursor:e,limit:t,status:n,search:o||void 0});return{items:r.automations,cursor:r.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-document-text h-12 w-12 text-gray-400"}),title:"No Automations Found",description:"Create your first automation to get started."},onRowClick:t=>{e(t.id)},className:"rounded-lg bg-white"}),m=[{id:"all",label:"All",content:p()},{id:"active",label:"Active",content:p("active")},{id:"draft",label:"Drafts",content:p("draft")}];return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Dd,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(y_,{placeholder:"Search automations...",value:o,onChange:e=>i(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(dw,{variant:"outline",onClick:()=>d(!0),children:[t.jsx(Nd,{}),"Create New Automation"]})})]}),t.jsx(cC,{tabs:m,activeTab:s,onTabChange:a,secondaryTabs:!0}),t.jsx(d_,{open:u,onOpenChange:d,children:t.jsx(p_,{hideCloseButton:!0,children:t.jsx(Ew,{onClose: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`)},iconDefinitions:r})})})]})},D_=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 Ja(`${Kx}${t.toString()?`?${t.toString()}`:""}`)).data};var M_=(e=>(e.String="string",e.Number="number",e.Integer="integer",e.Boolean="boolean",e.Date="date",e.DateTime="date-time",e))(M_||{}),O_=(e=>(e.ALL_USERS="all_users",e.CUSTOM="custom",e))(O_||{}),R_=(e=>(e.EQUALS="equals",e.NOT_EQUALS="not_equals",e.GREATER_THAN="greater_than",e.LESS_THAN="less_than",e.EXISTS="exists",e))(R_||{});const A_=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(Kx,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["segments"]})}}),n=ue({queryKey:["segments-conditions"],queryFn:()=>(async()=>(await Ja(`${Kx}/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}},L_=e=>{const t=ne(),n=ue({queryKey:["automations","recipients","count",e],queryFn:()=>(async e=>(await Ja(`${Kx}/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]})}}},I_=e=>{const t=ue({queryKey:["segments",e],queryFn:()=>(async e=>e?(await Ja(`${Kx}/${e}`)).data:null)(e)});return{segment:t.data,isFetching:t.isFetching,isLoading:t.isLoading}},F_=e=>{const t=ne(),n=de({mutationFn:t=>(async(e,t)=>t?(await Ja(`${Kx}/${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}};var $_=i.forwardRef(((e,n)=>t.jsx(Vc.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})));$_.displayName="Label";var q_=$_;const z_=nd("text-[var(--reach-foreground)] text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),U_=i.forwardRef((({className:e,...n},r)=>t.jsx(q_,{ref:r,className:Rh(z_(),e),...n})));U_.displayName=q_.displayName;const B_={[R_.EQUALS]:"Equals",[R_.NOT_EQUALS]:"Not Equals",[R_.GREATER_THAN]:"Greater Than",[R_.LESS_THAN]:"Less Than",[R_.EXISTS]:"Exists"},V_={email:"Email",phone:"Phone",first_name:"First Name",last_name:"Last Name"};var K_=.999,H_=/[\\\/_+.#"@\[\(\{&]/,W_=/[\\\/_+.#"@\[\(\{&]/g,G_=/[\s-]/,Y_=/[\s-]/g;function Q_(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,h=r.charAt(i),f=n.indexOf(h,o),p=0;f>=0;)(l=Q_(e,t,n,r,f+1,i+1,s))>p&&(f===o?l*=1:H_.test(e.charAt(f-1))?(l*=.8,(u=e.slice(o,f-1).match(W_))&&o>0&&(l*=Math.pow(K_,u.length))):G_.test(e.charAt(f-1))?(l*=.9,(d=e.slice(o,f-1).match(Y_))&&o>0&&(l*=Math.pow(K_,d.length))):(l*=.17,o>0&&(l*=Math.pow(K_,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=Q_(e,t,n,r,f+1,i+2,s))>l&&(l=.1*c)),l>p&&(p=l),f=n.indexOf(h,f+1);return s[a]=p,p}function X_(e){return e.toLowerCase().replace(Y_," ")}function J_(e,t,n){return Q_(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,X_(e),X_(t),0,0,{})}function Z_(){return Z_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z_.apply(null,arguments)}function eN(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function tN(...e){return t=>e.forEach((e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t)))}function nN(...e){return n.useCallback(tN(...e),e)}function rN(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const o=r.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return n.useMemo((()=>({[`__scope${t.scopeName}`]:o})),[o])}};return r.scopeName=t.scopeName,r}const oN=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{},iN=i["useId".toString()]||(()=>{});let sN=0;function aN(e){const[t,n]=i.useState(iN());return oN((()=>{n((e=>null!=e?e:String(sN++)))}),[e]),e||(t?`radix-${t}`:"")}function lN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}function cN({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:t}){const r=n.useState(e),[o]=r,i=n.useRef(o),s=lN(t);return n.useEffect((()=>{i.current!==o&&(s(o),i.current=o)}),[o,i,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:o,l=lN(r);return[a,n.useCallback((t=>{if(s){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)}),[s,e,i,l])]}const uN=n.forwardRef(((e,t)=>{const{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(fN);if(s){const e=s.props.children,r=i.map((t=>t===s?n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null:t));return n.createElement(dN,Z_({},o,{ref:t}),n.isValidElement(e)?n.cloneElement(e,void 0,r):null)}return n.createElement(dN,Z_({},o,{ref:t}),r)}));uN.displayName="Slot";const dN=n.forwardRef(((e,t)=>{const{children:r,...o}=e;return n.isValidElement(r)?n.cloneElement(r,{...pN(o,r.props),ref:t?tN(t,r.ref):r.ref}):n.Children.count(r)>1?n.Children.only(null):null}));dN.displayName="SlotClone";const hN=({children:e})=>n.createElement(n.Fragment,null,e);function fN(e){return n.isValidElement(e)&&e.type===hN}function pN(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}}const mN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,t)=>{const r=n.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?uN:t;return n.useEffect((()=>{window[Symbol.for("radix-ui")]=!0}),[]),n.createElement(s,Z_({},i,{ref:r}))}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function gN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const vN="dismissableLayer.update",yN="dismissableLayer.pointerDownOutside",bN="dismissableLayer.focusOutside";let xN;const wN=n.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),SN=n.forwardRef(((e,t)=>{var r;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=n.useContext(wN),[h,f]=n.useState(null),p=null!==(r=null==h?void 0:h.ownerDocument)&&void 0!==r?r:null===globalThis||void 0===globalThis?void 0:globalThis.document,[,m]=n.useState({}),g=nN(t,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e),o=n.useRef(!1),i=n.useRef((()=>{}));return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){let n=function(){kN(yN,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=n,t.addEventListener("click",i.current,{once:!0})):n()}else t.removeEventListener("click",i.current);o.current=!1},n=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(n),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,r]),{onPointerDownCapture:()=>o.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p),k=function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e),o=n.useRef(!1);return n.useEffect((()=>{const e=e=>{if(e.target&&!o.current){kN(bN,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())}),p);return function(e,t=(null===globalThis||void 0===globalThis?void 0:globalThis.document)){const r=gN(e);n.useEffect((()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}),[r,t])}((e=>{x===d.layers.size-1&&(null==i||i(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),n.useEffect((()=>{if(h)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(xN=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),CN(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=xN)}}),[h,p,o,d]),n.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),CN())}),[h,d]),n.useEffect((()=>{const e=()=>m({});return document.addEventListener(vN,e),()=>document.removeEventListener(vN,e)}),[]),n.createElement(mN.div,Z_({},u,{ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:eN(e.onFocusCapture,k.onFocusCapture),onBlurCapture:eN(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:eN(e.onPointerDownCapture,C.onPointerDownCapture)}))}));function CN(){const e=new CustomEvent(vN);document.dispatchEvent(e)}function kN(e,t,n,{discrete:o}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync((()=>e.dispatchEvent(t)))}(i,s):i.dispatchEvent(s)}function EN(e){const t=n.useRef(e);return n.useEffect((()=>{t.current=e})),n.useMemo((()=>(...e)=>{var n;return null===(n=t.current)||void 0===n?void 0:n.call(t,...e)}),[])}const jN="focusScope.autoFocusOnMount",TN="focusScope.autoFocusOnUnmount",PN={bubbles:!1,cancelable:!0},_N=n.forwardRef(((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[l,c]=n.useState(null),u=EN(i),d=EN(s),h=n.useRef(null),f=nN(t,(e=>c(e))),p=n.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;n.useEffect((()=>{if(o){let e=function(e){if(p.paused||!l)return;const t=e.target;l.contains(t)?h.current=t:ON(h.current,{select:!0})},t=function(e){if(p.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||ON(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&ON(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,l,p.paused]),n.useEffect((()=>{if(l){RN.add(p);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(jN,PN);l.addEventListener(jN,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ON(r,{select:t}),document.activeElement!==n)return}((e=NN(l),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&ON(l))}return()=>{l.removeEventListener(jN,u),setTimeout((()=>{const e=new CustomEvent(TN,PN);l.addEventListener(TN,d),l.dispatchEvent(e),e.defaultPrevented||ON(null!=t?t:document.body,{select:!0}),l.removeEventListener(TN,d),RN.remove(p)}),0)}}var e}),[l,u,d,p]);const m=n.useCallback((e=>{if(!r&&!o)return;if(p.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=NN(e),n=DN(t,e),r=DN(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&ON(i,{select:!0})):(e.preventDefault(),r&&ON(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,p.paused]);return n.createElement(mN.div,Z_({tabIndex:-1},a,{ref:f,onKeyDown:m}))}));function NN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function DN(e,t){for(const n of e)if(!MN(n,{upTo:t}))return n}function MN(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ON(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const RN=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=AN(e,t),e.unshift(t)},remove(t){var n;e=AN(e,t),null===(n=e[0])||void 0===n||n.resume()}}}();function AN(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}const LN=n.forwardRef(((e,t)=>{var o;const{container:i=(null===globalThis||void 0===globalThis||null===(o=globalThis.document)||void 0===o?void 0:o.body),...s}=e;return i?r.createPortal(n.createElement(mN.div,Z_({},s,{ref:t})),i):null})),IN=Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)?n.useLayoutEffect:()=>{};const FN=e=>{const{present:t,children:o}=e,i=function(e){const[t,o]=n.useState(),i=n.useRef({}),s=n.useRef(e),a=n.useRef("none"),l=e?"mounted":"unmounted",[c,u]=function(e,t){return n.useReducer(((e,n)=>{const r=t[e][n];return null!=r?r:e}),e)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return n.useEffect((()=>{const e=$N(i.current);a.current="mounted"===c?e:"none"}),[c]),IN((()=>{const t=i.current,n=s.current;if(n!==e){const r=a.current,o=$N(t);if(e)u("MOUNT");else if("none"===o||"none"===(null==t?void 0:t.display))u("UNMOUNT");else{u(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}s.current=e}}),[e,u]),IN((()=>{if(t){const e=e=>{const n=$N(i.current).includes(e.animationName);e.target===t&&n&&r.flushSync((()=>u("ANIMATION_END")))},n=e=>{e.target===t&&(a.current=$N(i.current))};return t.addEventListener("animationstart",n),t.addEventListener("animationcancel",e),t.addEventListener("animationend",e),()=>{t.removeEventListener("animationstart",n),t.removeEventListener("animationcancel",e),t.removeEventListener("animationend",e)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:n.useCallback((e=>{e&&(i.current=getComputedStyle(e)),o(e)}),[])}}(t),s="function"==typeof o?o({present:i.isPresent}):n.Children.only(o),a=nN(i.ref,s.ref);return"function"==typeof o||i.isPresent?n.cloneElement(s,{ref:a}):null};function $N(e){return(null==e?void 0:e.animationName)||"none"}FN.displayName="Presence";let qN=0;function zN(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var UN=$T(),BN=function(){},VN=i.forwardRef((function(e,t){var n=i.useRef(null),r=i.useState({onScrollCapture:BN,onWheelCapture:BN,onTouchMoveCapture:BN}),o=r[0],s=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,g=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,b=NT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=f,w=IT([n,t]),S=_T(_T({},b),o);return i.createElement(i.Fragment,null,d&&i.createElement(x,{sideCar:UN,removeScrollBar:u,shards:h,noIsolation:p,inert:m,setCallbacks:s,allowPinchZoom:!!g,lockRef:n}),a?i.cloneElement(i.Children.only(l),_T(_T({},S),{ref:w})):i.createElement(y,_T({},S,{className:c,ref:w}),l))}));VN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},VN.classNames={fullWidth:OT,zeroRight:MT};var KN=!1;if("undefined"!=typeof window)try{var HN=Object.defineProperty({},"passive",{get:function(){return KN=!0,!0}});window.addEventListener("test",HN,HN),window.removeEventListener("test",HN,HN)}catch(EQ){KN=!1}var WN=!!KN&&{passive:!1},GN=function(e,t){var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},YN=function(e,t){var n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),QN(e,n)){var r=XN(e,n);if(r[1]>r[2])return!0}n=n.parentNode}while(n&&n!==document.body);return!1},QN=function(e,t){return"v"===e?function(e){return GN(e,"overflowY")}(t):function(e){return GN(e,"overflowX")}(t)},XN=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},JN=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ZN=function(e){return[e.deltaX,e.deltaY]},eD=function(e){return e&&"current"in e?e.current:e},tD=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},nD=0,rD=[];const oD=zT(UN,(function(e){var t=i.useRef([]),n=i.useRef([0,0]),r=i.useRef(),o=i.useState(nD++)[0],s=i.useState((function(){return WT()}))[0],a=i.useRef(e);i.useEffect((function(){a.current=e}),[e]),i.useEffect((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=DT([e.lockRef.current],(e.shards||[]).map(eD),!0).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(o))})),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(o))}))}}}),[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback((function(e,t){if("touches"in e&&2===e.touches.length)return!a.current.allowPinchZoom;var o,i=JN(e),s=n.current,l="deltaX"in e?e.deltaX:s[0]-i[0],c="deltaY"in e?e.deltaY:s[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var h=YN(d,u);if(!h)return!0;if(h?o=d:(o="v"===d?"h":"v",h=YN(d,u)),!h)return!1;if(!r.current&&"changedTouches"in e&&(l||c)&&(r.current=o),!o)return!0;var f=r.current||o;return function(e,t,n,r){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=o*r,s=n.target,a=t.contains(s),l=!1,c=i>0,u=0,d=0;do{var h=XN(e,s),f=h[0],p=h[1]-h[2]-o*f;(f||p)&&QN(e,s)&&(u+=p,d+=f),s=s.parentNode}while(!a&&s!==document.body||a&&(t.contains(s)||t===s));return c&&0===u?l=!0:c||0!==d||(l=!0),l}(f,t,e,"h"===f?l:c)}),[]),c=i.useCallback((function(e){var n=e;if(rD.length&&rD[rD.length-1]===s){var r="deltaY"in n?ZN(n):JN(n),o=t.current.filter((function(e){return e.name===n.type&&e.target===n.target&&((t=e.delta)[0]===(o=r)[0]&&t[1]===o[1]);var t,o}))[0];if(o&&o.should)n.cancelable&&n.preventDefault();else if(!o){var i=(a.current.shards||[]).map(eD).filter(Boolean).filter((function(e){return e.contains(n.target)}));(i.length>0?l(n,i[0]):!a.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),u=i.useCallback((function(e,n,r,o){var i={name:e,delta:n,target:r,should:o};t.current.push(i),setTimeout((function(){t.current=t.current.filter((function(e){return e!==i}))}),1)}),[]),d=i.useCallback((function(e){n.current=JN(e),r.current=void 0}),[]),h=i.useCallback((function(t){u(t.type,ZN(t),t.target,l(t,e.lockRef.current))}),[]),f=i.useCallback((function(t){u(t.type,JN(t),t.target,l(t,e.lockRef.current))}),[]);i.useEffect((function(){return rD.push(s),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,WN),document.addEventListener("touchmove",c,WN),document.addEventListener("touchstart",d,WN),function(){rD=rD.filter((function(e){return e!==s})),document.removeEventListener("wheel",c,WN),document.removeEventListener("touchmove",c,WN),document.removeEventListener("touchstart",d,WN)}}),[]);var p=e.removeScrollBar;return i.createElement(i.Fragment,null,e.inert?i.createElement(s,{styles:tD(o)}):null,p?i.createElement(tP,{gapMode:"margin"}):null)}));var iD=i.forwardRef((function(e,t){return i.createElement(VN,_T({},e,{ref:t,sideCar:oD}))}));iD.classNames=VN.classNames;const sD="Dialog",[aD,lD]=function(e,t=[]){let r=[];const o=()=>{const t=r.map((e=>n.createContext(e)));return function(r){const o=(null==r?void 0:r[e])||t;return n.useMemo((()=>({[`__scope${e}`]:{...r,[e]:o}})),[r,o])}};return o.scopeName=e,[function(t,o){const i=n.createContext(o),s=r.length;function a(t){const{scope:r,children:o,...a}=t,l=(null==r?void 0:r[e][s])||i,c=n.useMemo((()=>a),Object.values(a));return n.createElement(l.Provider,{value:c},o)}return r=[...r,o],a.displayName=t+"Provider",[a,function(r,a){const l=n.useContext((null==a?void 0:a[e][s])||i);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${t}\``)}]},rN(o,...t)]}(sD),[cD,uD]=aD(sD),dD="DialogPortal",[hD,fD]=aD(dD,{forceMount:void 0}),pD="DialogOverlay",mD=n.forwardRef(((e,t)=>{const r=fD(pD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=uD(pD,e.__scopeDialog);return s.modal?n.createElement(FN,{present:o||s.open},n.createElement(gD,Z_({},i,{ref:t}))):null})),gD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,...o}=e,i=uD(pD,r);return n.createElement(iD,{as:uN,allowPinchZoom:!0,shards:[i.contentRef]},n.createElement(mN.div,Z_({"data-state":CD(i.open)},o,{ref:t,style:{pointerEvents:"auto",...o.style}})))})),vD="DialogContent",yD=n.forwardRef(((e,t)=>{const r=fD(vD,e.__scopeDialog),{forceMount:o=r.forceMount,...i}=e,s=uD(vD,e.__scopeDialog);return n.createElement(FN,{present:o||s.open},n.createElement(s.modal?bD:xD,Z_({},i,{ref:t})))})),bD=n.forwardRef(((e,t)=>{const r=uD(vD,e.__scopeDialog),o=n.useRef(null),i=nN(t,r.contentRef,o);return n.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),n.createElement(wD,Z_({},e,{ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:eN(e.onCloseAutoFocus,(e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()})),onPointerDownOutside:eN(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;(2===t.button||0===t.button&&!0===t.ctrlKey)&&e.preventDefault()})),onFocusOutside:eN(e.onFocusOutside,(e=>e.preventDefault()))}))})),xD=n.forwardRef(((e,t)=>{const r=uD(vD,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return n.createElement(wD,Z_({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,s;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented)||(o.current||null===(s=r.triggerRef.current)||void 0===s||s.focus(),t.preventDefault());o.current=!1,i.current=!1},onInteractOutside:t=>{var n,s;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));(null===(s=r.triggerRef.current)||void 0===s?void 0:s.contains(t.target))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}}))})),wD=n.forwardRef(((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,l=uD(vD,r),c=nN(t,n.useRef(null));return n.useEffect((()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=n[0])&&void 0!==e?e:zN()),document.body.insertAdjacentElement("beforeend",null!==(t=n[1])&&void 0!==t?t:zN()),qN++,()=>{1===qN&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),qN--}}),[]),n.createElement(n.Fragment,null,n.createElement(_N,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s},n.createElement(SN,Z_({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":CD(l.open)},a,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)})),SD="DialogTitle";function CD(e){return e?"open":"closed"}!function(e,t){const r=n.createContext(t);function o(e){const{children:t,...o}=e,i=n.useMemo((()=>o),Object.values(o));return n.createElement(r.Provider,{value:i},t)}o.displayName=e+"Provider"}("DialogTitleWarning",{contentName:vD,titleName:SD,docsSlug:"dialog"});const kD=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=n.useRef(null),c=n.useRef(null),[u=!1,d]=cN({prop:o,defaultProp:i,onChange:s});return n.createElement(cD,{scope:t,triggerRef:l,contentRef:c,contentId:aN(),titleId:aN(),descriptionId:aN(),open:u,onOpenChange:d,onOpenToggle:n.useCallback((()=>d((e=>!e))),[d]),modal:a},r)},ED=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:i}=e,s=uD(dD,t);return n.createElement(hD,{scope:t,forceMount:r},n.Children.map(o,(e=>n.createElement(FN,{present:r||s.open},n.createElement(LN,{asChild:!0,container:i},e)))))},jD=mD,TD=yD;var PD='[cmdk-group=""]',_D='[cmdk-group-items=""]',ND='[cmdk-item=""]',DD=`${ND}:not([aria-disabled="true"])`,MD="cmdk-item-select",OD="data-value",RD=(e,t,n)=>J_(e,t,n),AD=i.createContext(void 0),LD=()=>i.useContext(AD),ID=i.createContext(void 0),FD=()=>i.useContext(ID),$D=i.createContext(void 0),qD=i.forwardRef(((e,t)=>{let n=eM((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=eM((()=>new Set)),o=eM((()=>new Map)),s=eM((()=>new Map)),a=eM((()=>new Set)),l=JD(e),{label:c,children:u,value:d,onValueChange:h,filter:f,shouldFilter:p,loop:m,disablePointerSelection:g=!1,vimBindings:v=!0,...y}=e,b=i.useId(),x=i.useId(),w=i.useId(),S=i.useRef(null),C=oM();ZD((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),ZD((()=>{C(6,N)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)_(),T(),C(1,P);else if("value"===e&&(r||C(5,N),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,j(t,r)),C(2,(()=>{T(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{_(),T(),n.current.value||P(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&P(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:g,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function j(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:RD;return e?i(e,n.current.search,t):0}function T(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(_D);t?t.appendChild(e.parentElement===t?e:e.closest(`${_D} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${_D} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{let t=S.current.querySelector(`${PD}[${OD}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)}))}function P(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(OD);k.setState("value",t||void 0)}function _(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=j(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function N(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(PD))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ND}[aria-selected="true"]`)}function M(){var e;return Array.from(null==(e=S.current)?void 0:e.querySelectorAll(DD))}function O(e){let t=M()[e];t&&k.setState("value",t.getAttribute(OD))}function R(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(OD))}function A(e){let t,n=D(),r=null==n?void 0:n.closest(PD);for(;r&&!t;)r=e>0?QD(r,PD):XD(r,PD),t=null==r?void 0:r.querySelector(DD);t?k.setState("value",t.getAttribute(OD)):R(e)}let L=()=>O(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?A(1):R(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?A(-1):R(-1)};return i.createElement(mN.div,{ref:t,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=y.onKeyDown)||t.call(y,e),!e.defaultPrevented)switch(e.key){case"n":case"j":v&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":v&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(MD);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:sM},c),iM(e,(e=>i.createElement(ID.Provider,{value:k},i.createElement(AD.Provider,{value:E},e)))))})),zD=i.forwardRef(((e,t)=>{var n,r;let o=i.useId(),s=i.useRef(null),a=i.useContext($D),l=LD(),c=JD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;ZD((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=rM(o,s,[e.value,e.children,s],e.keywords),h=FD(),f=nM((e=>e.value&&e.value===d.current)),p=nM((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){h.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(MD,m),()=>t.removeEventListener(MD,m)}),[p,e.onSelect,e.disabled]),!p)return null;let{disabled:v,value:y,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(mN.div,{ref:tM([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!f,"data-disabled":!!v,"data-selected":!!f,onPointerMove:v||l.disablePointerSelection?void 0:g,onClick:v?void 0:m},e.children)})),UD=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=i.useId(),l=i.useRef(null),c=i.useRef(null),u=i.useId(),d=LD(),h=nM((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));ZD((()=>d.group(a)),[]),rM(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(mN.div,{ref:tM([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!h||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),iM(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement($D.Provider,{value:f},e)))))})),BD=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=nM((e=>!e.search));return n||s?i.createElement(mN.div,{ref:tM([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),VD=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=FD(),a=nM((e=>e.search)),l=nM((e=>e.value)),c=LD(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${ND}[${OD}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(mN.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),KD=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=LD();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(mN.div,{ref:tM([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},iM(e,(e=>i.createElement("div",{ref:tM([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),HD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(kD,{open:n,onOpenChange:r},i.createElement(ED,{container:a},i.createElement(jD,{"cmdk-overlay":"",className:o}),i.createElement(TD,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(qD,{ref:t,...l}))))})),WD=i.forwardRef(((e,t)=>nM((e=>0===e.filtered.count))?i.createElement(mN.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),GD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(mN.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},iM(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),YD=Object.assign(qD,{List:KD,Item:zD,Input:VD,Group:UD,Separator:BD,Dialog:HD,Empty:WD,Loading:GD});function QD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function XD(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function JD(e){let t=i.useRef(e);return ZD((()=>{t.current=e})),t}var ZD="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function eM(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function tM(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function nM(e){let t=FD(),n=()=>e(t.snapshot());return i.useSyncExternalStore(t.subscribe,n,n)}function rM(e,t,n,r=[]){let o=i.useRef(),s=LD();return ZD((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(OD,a),o.current=a})),o}var oM=()=>{let[e,t]=i.useState(),n=eM((()=>new Map));return ZD((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function iM({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var sM={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const aM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD,{ref:r,className:Rh("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));aM.displayName=YD.displayName;const lM=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(Dd,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(YD.Input,{ref:o,className:Rh("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));lM.displayName=YD.Input.displayName;const cM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.List,{ref:r,className:Rh("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));cM.displayName=YD.List.displayName;const uM=i.forwardRef(((e,n)=>t.jsx(YD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));uM.displayName=YD.Empty.displayName;const dM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Group,{ref:r,className:Rh("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));dM.displayName=YD.Group.displayName;const hM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Separator,{ref:r,className:Rh("-mx-1 h-px bg-border",e),...n})));hM.displayName=YD.Separator.displayName;const fM=i.forwardRef((({className:e,...n},r)=>t.jsx(YD.Item,{ref:r,className:Rh("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));fM.displayName=YD.Item.displayName;var pM="focusScope.autoFocusOnMount",mM="focusScope.autoFocusOnUnmount",gM={bubbles:!1,cancelable:!0},vM=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=Hc(s),h=Hc(a),f=i.useRef(null),p=Ac(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:wM(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||wM(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&wM(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){SM.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(pM,gM);c.addEventListener(pM,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wM(r,{select:t}),document.activeElement!==n)return}((e=yM(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&wM(c))}return()=>{c.removeEventListener(pM,d),setTimeout((()=>{const e=new CustomEvent(mM,gM);c.addEventListener(mM,h),c.dispatchEvent(e),e.defaultPrevented||wM(t??document.body,{select:!0}),c.removeEventListener(mM,h),SM.remove(m)}),0)}}var e}),[c,d,h,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=yM(e),n=bM(t,e),r=bM(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&wM(i,{select:!0})):(e.preventDefault(),r&&wM(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(Vc.div,{tabIndex:-1,...l,ref:p,onKeyDown:g})}));function yM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function bM(e,t){for(const n of e)if(!xM(n,{upTo:t}))return n}function xM(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function wM(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}vM.displayName="FocusScope";var SM=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=CM(e,t),e.unshift(t)},remove(t){e=CM(e,t),e[0]?.resume()}}}();function CM(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var kM="Popover",[EM,jM]=Lc(kM,[Zk]),TM=Zk(),[PM,_M]=EM(kM),NM=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=TM(n),u=i.useRef(null),[d,h]=i.useState(!1),[f=!1,p]=cu({prop:o,defaultProp:s,onChange:a});return t.jsx(mE,{...c,children:t.jsx(PM,{scope:n,contentId:wC(),triggerRef:u,open:f,onOpenChange:p,onOpenToggle:i.useCallback((()=>p((e=>!e))),[p]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>h(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>h(!1)),[]),modal:l,children:r})})};NM.displayName=kM;var DM="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=_M(DM,r),a=TM(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(gE,{...a,...o,ref:n})})).displayName=DM;var MM="PopoverTrigger",OM=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(MM,r),s=TM(r),a=Ac(n,i.triggerRef),l=t.jsx(Vc.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":VM(i.open),...o,ref:a,onClick:Mc(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(gE,{asChild:!0,...s,children:l})}));OM.displayName=MM;var RM="PopoverPortal",[AM,LM]=EM(RM,{forceMount:void 0}),IM=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=_M(RM,n);return t.jsx(AM,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};IM.displayName=RM;var FM="PopoverContent",$M=i.forwardRef(((e,n)=>{const r=LM(FM,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=_M(FM,e.__scopePopover);return t.jsx(au,{present:o||s.open,children:t.jsx(s.modal?qM:zM,{...i,ref:n})})}));$M.displayName=FM;var qM=i.forwardRef(((e,n)=>{const r=_M(FM,e.__scopePopover),o=i.useRef(null),s=Ac(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(vP,{as:Fc,allowPinchZoom:!0,children:t.jsx(UM,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:Mc(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),zM=i.forwardRef(((e,n)=>{const r=_M(FM,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx(UM,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),UM=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...h}=e,f=_M(FM,r),p=TM(r);return TT(),t.jsx(vM,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(vE,{"data-state":VM(f.open),role:"dialog",id:f.contentId,...p,...h,ref:n,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),BM="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(BM,r);return t.jsx(Vc.button,{type:"button",...o,ref:n,onClick:Mc(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=BM;function VM(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=TM(r);return t.jsx(yE,{...i,...o,ref:n})})).displayName="PopoverArrow";var KM=IM,HM=$M;const WM=NM,GM=OM,YM=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,usePrimitiveWrapper:o=!0,...i},s)=>o?t.jsx(KM,{children:t.jsx(HM,{ref:s,align:n,sideOffset:r,className:Rh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})}):t.jsx(HM,{ref:s,align:n,sideOffset:r,className:Rh("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...i})));YM.displayName=HM.displayName;const QM=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(WM,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{"aria-expanded":s,className:"w-[200px] justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(pd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(YM,{className:"w-[200px] p-0",children:t.jsxs(aM,{children:[t.jsx(lM,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(cM,{children:[t.jsxs(uM,{children:["No ",o.toLowerCase()," found."]}),t.jsx(dM,{children:e.map((e=>t.jsxs(fM,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(cd,{className:Rh("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function XM(e){return(XM="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function JM(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ZM(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function eO(e){ZM(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===XM(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function tO(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function nO(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var rO={};function oO(){return rO}function iO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function sO(e){return ZM(1,arguments),iO(e,{weekStartsOn:1})}function aO(e){ZM(1,arguments);var t=function(e){ZM(1,arguments);var t=eO(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=sO(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=sO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),sO(n)}function lO(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function cO(e){ZM(1,arguments);var t=eO(e);return t.setHours(0,0,0,0),t}function uO(e,t){ZM(2,arguments);var n=cO(e),r=cO(t),o=n.getTime()-lO(n),i=r.getTime()-lO(r);return Math.round((o-i)/864e5)}function dO(e,t){return ZM(2,arguments),tO(e,7*JM(t))}function hO(e,t){return ZM(2,arguments),nO(e,12*JM(t))}function fO(e,t){ZM(2,arguments);var n=cO(e),r=cO(t);return n.getTime()===r.getTime()}function pO(e){return ZM(1,arguments),e instanceof Date||"object"===XM(e)&&"[object Date]"===Object.prototype.toString.call(e)}function mO(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function gO(e){ZM(1,arguments);var t=eO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function vO(e){ZM(1,arguments);var t=eO(e);return t.setDate(1),t.setHours(0,0,0,0),t}function yO(e){ZM(1,arguments);var t=eO(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function bO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getDay(),p=6+(f<d?-7:0)-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function xO(e){return ZM(1,arguments),bO(e,{weekStartsOn:1})}function wO(e,t){return ZM(2,arguments),function(e,t){ZM(2,arguments);var n=eO(e).getTime(),r=JM(t);return new Date(n+r)}(e,-JM(t))}function SO(e){ZM(1,arguments);var t=eO(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function CO(e){ZM(1,arguments);var t=eO(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=SO(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=SO(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function kO(e){ZM(1,arguments);var t=eO(e),n=SO(t).getTime()-function(e){ZM(1,arguments);var t=CO(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),SO(n)}(t).getTime();return Math.round(n/6048e5)+1}function EO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=eO(e),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function jO(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=eO(e),d=u.getUTCFullYear(),h=oO(),f=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var m=EO(p,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var v=EO(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}function TO(e,t){ZM(1,arguments);var n=eO(e),r=EO(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=jO(e,t),f=new Date(0);return f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0),EO(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function PO(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var _O=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return PO("yy"===t?r%100:r,t.length)},NO=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):PO(n+1,2)},DO=function(e,t){return PO(e.getUTCDate(),t.length)},MO=function(e,t){return PO(e.getUTCHours()%12||12,t.length)},OO=function(e,t){return PO(e.getUTCHours(),t.length)},RO=function(e,t){return PO(e.getUTCMinutes(),t.length)},AO=function(e,t){return PO(e.getUTCSeconds(),t.length)},LO=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return PO(Math.floor(r*Math.pow(10,n-3)),t.length)},IO="midnight",FO="noon",$O="morning",qO="afternoon",zO="evening",UO="night",BO={G:function(e,t,n){var r=e.getUTCFullYear()>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){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _O(e,t)},Y:function(e,t,n,r){var o=jO(e,r),i=o>0?o:1-o;return"YY"===t?PO(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):PO(i,t.length)},R:function(e,t){return PO(CO(e),t.length)},u:function(e,t){return PO(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return PO(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){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return PO(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){var r=e.getUTCMonth();switch(t){case"M":case"MM":return NO(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){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return PO(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){var o=TO(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):PO(o,t.length)},I:function(e,t,n){var r=kO(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):PO(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):DO(e,t)},D:function(e,t,n){var r=function(e){ZM(1,arguments);var t=eO(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):PO(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();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){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return PO(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){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return PO(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){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return PO(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){var r=e.getUTCHours()/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){var r,o=e.getUTCHours();switch(r=12===o?FO:0===o?IO:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?zO:o>=12?qO:o>=4?$O:UO,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return MO(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):OO(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):PO(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):PO(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):RO(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):AO(e,t)},S:function(e,t){return LO(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return KO(o);case"XXXX":case"XX":return HO(o);default:return HO(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return KO(o);case"xxxx":case"xx":return HO(o);default:return HO(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+VO(o,":");default:return"GMT"+HO(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+VO(o,":");default:return"GMT"+HO(o,":")}},t:function(e,t,n,r){return PO(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return PO((r._originalDate||e).getTime(),t.length)}};function VO(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+PO(i,2)}function KO(e,t){return e%60==0?(e>0?"-":"+")+PO(Math.abs(e)/60,2):HO(e,t)}function HO(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+PO(Math.floor(o/60),2)+n+PO(o%60,2)}var WO=function(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"})}},GO=function(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"})}},YO={p:GO,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return WO(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",WO(o,t)).replace("{{time}}",GO(i,t))}},QO=["D","DD"],XO=["YY","YYYY"];function JO(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var ZO={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 eR(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var tR={date:eR({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:eR({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:eR({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nR={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rR(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var oR={ordinalNumber:function(e,t){var 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:rR({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rR({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:rR({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:rR({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:rR({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"})};function iR(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var sR={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:iR({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:iR({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:function(e){return e+1}}),month:iR({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:iR({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:iR({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"})},aR={code:"en-US",formatDistance:function(e,t,n){var r,o=ZO[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:tR,formatRelative:function(e,t,n,r){return nR[e]},localize:oR,match:sR,options:{weekStartsOn:0,firstWeekContainsDate:1}},lR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uR=/^'([^]*?)'?$/,dR=/''/g,hR=/[a-zA-Z]/;function fR(e,t,n){var r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x;ZM(2,arguments);var w=String(t),S=oO(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:aR,k=JM(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(h=d.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=JM(null!==(f=null!==(p=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(v=n.locale)||void 0===v||null===(y=v.options)||void 0===y?void 0:y.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==p?p:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var j=eO(e);if(!function(e){if(ZM(1,arguments),!pO(e)&&"number"!=typeof e)return!1;var t=eO(e);return!isNaN(Number(t))}(j))throw new RangeError("Invalid time value");var T=wO(j,lO(j)),P={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:j};return w.match(cR).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,YO[t])(e,C.formatLong):e})).join("").match(lR).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(uR);if(!t)return e;return t[1].replace(dR,"'")}(r);var i=BO[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===XO.indexOf(r)||JO(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==QO.indexOf(e)}(r)||JO(r,t,String(e)),i(T,r,C.localize,P);if(o.match(hR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function pR(e){return ZM(1,arguments),Math.floor(function(e){return ZM(1,arguments),eO(e).getTime()}(e)/1e3)}function mR(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=oO(),d=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),h=function(e,t){var n,r,o,i,s,a,l,c;ZM(1,arguments);var u=eO(e),d=u.getFullYear(),h=oO(),f=JM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:h.firstWeekContainsDate)&&void 0!==r?r:null===(l=h.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setFullYear(d+1,0,f),p.setHours(0,0,0,0);var m=iO(p,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var v=iO(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=v.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(h,0,d),f.setHours(0,0,0,0),iO(f,t)}function gR(e,t){return ZM(1,arguments),function(e,t,n){ZM(2,arguments);var r=iO(e,n),o=iO(t,n),i=r.getTime()-lO(r),s=o.getTime()-lO(o);return Math.round((i-s)/6048e5)}(function(e){ZM(1,arguments);var t=eO(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),vO(e),t)+1}function vR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getTime()>r.getTime()}function yR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getTime()<r.getTime()}function bR(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function xR(e,t){return ZM(2,arguments),tO(e,-JM(t))}function wR(e,t){ZM(2,arguments);var n=eO(e),r=JM(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){ZM(1,arguments);var t=eO(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function SR(e,t){ZM(2,arguments);var n=eO(e),r=JM(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var CR=function(){return CR=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},CR.apply(this,arguments)};function kR(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function ER(e){return"multiple"===e.mode}function jR(e){return"range"===e.mode}function TR(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var PR={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var _R=Object.freeze({__proto__:null,formatCaption:function(e,t){return fR(e,"LLLL y",t)},formatDay:function(e,t){return fR(e,"d",t)},formatMonthCaption:function(e,t){return fR(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return fR(e,"cccccc",t)},formatYearCaption:function(e,t){return fR(e,"yyyy",t)}}),NR=Object.freeze({__proto__:null,labelDay:function(e,t,n){return fR(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return fR(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var DR=n.createContext(void 0);function MR(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:PR,formatters:_R,labels:NR,locale:aR,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=vO(r):t&&(i=new Date(t,0,1)),o?s=gO(o):n&&(s=new Date(n,11,31)),{fromDate:i?cO(i):void 0,toDate:s?cO(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(TR(o)||ER(o)||jR(o))&&(r=o.onSelect);var u=CR(CR(CR({},i),o),{captionLayout:c,classNames:CR(CR({},i.classNames),o.classNames),components:CR({},o.components),formatters:CR(CR({},i.formatters),o.formatters),fromDate:a,labels:CR(CR({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:CR(CR({},i.modifiers),o.modifiers),modifiersClassNames:CR(CR({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:CR(CR({},i.styles),o.styles),toDate:l});return t.jsx(DR.Provider,{value:u,children:e.children})}function OR(){var e=n.useContext(DR);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function RR(e){var n=OR();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function AR(e){return t.jsx("svg",CR({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function LR(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=OR(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:AR;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function IR(e){var n,r=OR(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var h=[];if(function(e,t){ZM(2,arguments);var n=eO(e),r=eO(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=vO(o),p=o.getMonth();p<=i.getMonth();p++)h.push(wR(f,p));else for(f=vO(new Date),p=0;p<=11;p++)h.push(wR(f,p));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:LR;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=wR(vO(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:h.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function FR(e){var n,r=e.displayMonth,o=OR(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,h=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var p=i.getFullYear(),m=s.getFullYear(),g=p;g<=m;g++)f.push(SR(yO(new Date),g));var v=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:LR;return t.jsx(v,{name:"years","aria-label":h(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=SR(vO(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function $R(){var e=OR(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&mO(n,t)<0&&(t=nO(n,-1*(i-1))),r&&mO(t,r)<0&&(t=r),vO(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=vO(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var qR=n.createContext(void 0);function zR(e){var n=OR(),r=$R(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=vO(e),i=mO(vO(nO(o,r)),o),s=[],a=0;a<i;a++){var l=nO(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=vO(e);if(!n)return nO(s,i);if(!(mO(n,e)<o))return nO(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=vO(e);if(!n)return nO(i,-o);if(!(mO(i,n)<=0))return nO(i,-o)}}(o,n),c=function(e){return s.some((function(t){return bR(e,t)}))};return t.jsx(qR.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&yR(e,t)?i(nO(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function UR(){var e=n.useContext(qR);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function BR(e){var n,r=OR(),o=r.classNames,i=r.styles,s=r.components,a=UR().goToMonth,l=function(t){a(nO(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:RR,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(IR,{onChange:l,displayMonth:e.displayMonth}),t.jsx(FR,{onChange:l,displayMonth:e.displayMonth})]})}function VR(e){return t.jsx("svg",CR({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function KR(e){return t.jsx("svg",CR({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var HR=n.forwardRef((function(e,n){var r=OR(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=CR(CR({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",CR({},e,{ref:n,type:"button",className:a,style:l}))}));function WR(e){var n,r,o=OR(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,h=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),p=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),v=null!==(n=null==h?void 0:h.IconRight)&&void 0!==n?n:KR,y=null!==(r=null==h?void 0:h.IconLeft)&&void 0!==r?r:VR;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(HR,{name:"previous-month","aria-label":f,className:p,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(HR,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})})]})}function GR(e){var n=OR().numberOfMonths,r=UR(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return bR(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(WR,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function YR(e){var n,r,o=OR(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:RR;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(BR,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(BR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(GR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(GR,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function QR(e){var n=OR(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function XR(){var e=OR(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?sO(new Date):iO(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=tO(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function JR(){var e,n=OR(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:XR;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function ZR(e){var n=OR();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var eA=n.createContext(void 0);function tA(e){if(!ER(e.initialProps)){return t.jsx(eA.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(nA,{initialProps:e.initialProps,children:e.children})}function nA(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return fO(t,e)}));return Boolean(t&&!n)})),t.jsx(eA.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?kR([],o):[];if(t.selected){var u=c.findIndex((function(t){return fO(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function rA(){var e=n.useContext(eA);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var oA,iA,sA=n.createContext(void 0);function aA(e){if(!jR(e.initialProps)){return t.jsx(sA.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(lA,{initialProps:e.initialProps,children:e.children})}function lA(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],fO(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:xR(s,l-1),before:tO(s,l-1)}),s&&a&&u.disabled.push({after:s,before:tO(s,l-1)}),!s&&a&&u.disabled.push({after:xR(a,l-1),before:tO(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:tO(s,1-c)}),u.disabled.push({after:tO(s,c-1)})),s&&a){var d=c-(uO(a,s)+1);u.disabled.push({before:xR(s,d)}),u.disabled.push({after:tO(a,d)})}!s&&a&&(u.disabled.push({before:tO(a,1-c)}),u.disabled.push({after:tO(a,c-1)}))}return t.jsx(sA.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(fO(o,e)&&fO(r,e))return;if(fO(o,e))return{from:o,to:void 0};if(fO(r,e))return;return vR(r,e)?{from:e,to:o}:{from:r,to:e}}return o?vR(e,o)?{from:o,to:e}:{from:e,to:o}:r?yR(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function cA(){var e=n.useContext(sA);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function uA(e){return Array.isArray(e)?kR([],e):void 0!==e?[e]:[]}(iA=oA||(oA={})).Outside="outside",iA.Disabled="disabled",iA.Selected="selected",iA.Hidden="hidden",iA.Today="today",iA.RangeStart="range_start",iA.RangeEnd="range_end",iA.RangeMiddle="range_middle";var dA=oA.Selected,hA=oA.Disabled,fA=oA.Hidden,pA=oA.Today,mA=oA.RangeEnd,gA=oA.RangeMiddle,vA=oA.RangeStart,yA=oA.Outside;var bA=n.createContext(void 0);function xA(e){var n=OR(),r=function(e,t,n){var r,o=((r={})[dA]=uA(e.selected),r[hA]=uA(e.disabled),r[fA]=uA(e.hidden),r[pA]=[e.today],r[mA]=[],r[gA]=[],r[vA]=[],r[yA]=[],r);return e.fromDate&&o[hA].push({before:e.fromDate}),e.toDate&&o[hA].push({after:e.toDate}),ER(e)?o[hA]=o[hA].concat(t.modifiers[hA]):jR(e)&&(o[hA]=o[hA].concat(n.modifiers[hA]),o[vA]=n.modifiers[vA],o[gA]=n.modifiers[gA],o[mA]=n.modifiers[mA]),o}(n,rA(),cA()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=uA(e[1])})),t}(n.modifiers),i=CR(CR({},r),o);return t.jsx(bA.Provider,{value:i,children:e.children})}function wA(){var e=n.useContext(bA);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function SA(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(pO(t))return fO(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(pO)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(uO(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),uO(n,i)>=0&&uO(s,n)>=0):s?fO(s,n):!!i&&fO(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=uO(t.before,e)>0,l=uO(t.after,e)<0;return vR(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?uO(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?uO(t.before,e)>0:"function"==typeof t&&t(e)}))}function CA(e,t,n){var r=Object.keys(t).reduce((function(n,r){return SA(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!bR(e,n)&&(o.outside=!0),o}function kA(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,h={day:tO,week:dO,month:nO,year:hO,startOfWeek:function(e){return o.ISOWeek?sO(e):iO(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?xO(e):bO(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?h=function(e){var t,n;if(ZM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==XM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=eO(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,h]):"after"===r&&u&&(h=function(e){var t,n;if(ZM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==XM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=eO(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,h]));var f=!0;if(i){var p=CA(h,i);f=!p.disabled&&!p.hidden}return f?h:a.count>365?a.lastFocused:kA(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:CR(CR({},a),{count:a.count+1})})}var EA=n.createContext(void 0);function jA(e){var r=UR(),o=wA(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=vO(e[0]),i=gO(e[e.length-1]),s=o;s<=i;){var a=CA(s,t);if(a.disabled||a.hidden)s=tO(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=tO(s,1)}}return r||n}(r.displayMonths,o),h=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},p=OR(),m=function(e,t){if(s){var n=kA(s,{moveBy:e,direction:t,context:p,modifiers:o});fO(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(EA.Provider,{value:{focusedDay:s,focusTarget:h,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function TA(){var e=n.useContext(EA);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var PA=n.createContext(void 0);function _A(e){if(!TR(e.initialProps)){return t.jsx(PA.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(NA,{initialProps:e.initialProps,children:e.children})}function NA(e){var n=e.initialProps;return t.jsx(PA.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function DA(){var e=n.useContext(PA);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function MA(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(oA).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function OA(e,r,o){var i,s,a,l=OR(),c=TA(),u=function(e,t){return CA(e,wA(),t)}(e,r),d=function(e,t){var n=OR(),r=DA(),o=rA(),i=cA(),s=TA(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,h=s.focus,f=s.focusMonthBefore,p=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,v=s.focusStartOfWeek,y=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;TR(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):ER(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):jR(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;h(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():p();break;case"Home":r.preventDefault(),r.stopPropagation(),v();break;case"End":r.preventDefault(),r.stopPropagation(),y()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),h=function(){var e=OR(),t=DA(),n=rA(),r=cA();return TR(e)?t.selected:ER(e)?n.selected:jR(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&fO(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var p=MA(l,u).join(" "),m=function(e,t){var n=CR({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=CR(CR({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),v=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:ZR,y={style:m,className:p,children:t.jsx(v,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&fO(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&fO(c.focusedDay,e),w=CR(CR(CR({},y),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:h,buttonProps:w,divProps:y}}function RA(e){var r=n.useRef(null),o=OA(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(HR,CR({name:"day",ref:r},o.buttonProps)):t.jsx("div",CR({},o.divProps))}function AA(e){var n=e.number,r=e.dates,o=OR(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(HR,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function LA(e){var n,r,o,i=OR(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:RA,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:AA;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},pR(n))}))]})}function IA(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?xO(t):bO(t,n),o=(null==n?void 0:n.ISOWeek)?sO(e):iO(e,n),i=uO(r,o),s=[],a=0;a<=i;a++)s.push(tO(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){ZM(1,arguments);var t=eO(e),n=sO(t).getTime()-aO(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){ZM(1,arguments);var n=eO(e),r=iO(n,t).getTime()-mR(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function FA(e){var n,r,o,i=OR(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,h=i.firstWeekContainsDate,f=i.ISOWeek,p=function(e,t){var n=IA(vO(e),gO(e),t);if(null==t?void 0:t.useFixedWeeks){var r=gR(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=dO(i,6-r),a=IA(dO(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:h}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:JR,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:LA,v=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:QR;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:p.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(v,{displayMonth:e.displayMonth})]})}var $A="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,qA=!1,zA=0;function UA(){return"react-day-picker-".concat(++zA)}function BA(e){var r,o,i=OR(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=UR().displayMonths,d=function(e){var t,r=null!=e?e:qA?UA():null,o=n.useState(r),i=o[0],s=o[1];return $A((function(){null===i&&s(UA())}),[]),n.useEffect((function(){!1===qA&&(qA=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),h=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],p=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,v=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),p=CR(CR({},p),l.caption_start)),g&&(f.push(a.caption_end),p=CR(CR({},p),l.caption_end)),v&&(f.push(a.caption_between),p=CR(CR({},p),l.caption_between));var y=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:YR;return t.jsxs("div",{className:f.join(" "),style:p,children:[t.jsx(y,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(FA,{id:h,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function VA(e){var n=OR();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function KA(e){var r,o,i=e.initialProps,s=OR(),a=TA(),l=UR(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var h=[s.classNames.root,s.className];s.numberOfMonths>1&&h.push(s.classNames.multiple_months),s.showWeekNumber&&h.push(s.classNames.with_weeknumber);var f=CR(CR({},s.styles.root),s.style),p=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return CR(CR({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:VA;return t.jsx("div",CR({className:h.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},p,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(BA,{displayIndex:n,displayMonth:e},n)}))})}))}function HA(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(MR,{initialProps:r,children:t.jsx(zR,{children:t.jsx(_A,{initialProps:r,children:t.jsx(tA,{initialProps:r,children:t.jsx(aA,{initialProps:r,children:t.jsx(xA,{children:t.jsx(jA,{children:n})})})})})})})}function WA(e){return t.jsx(HA,CR({},e,{children:t.jsx(KA,{initialProps:e})}))}function GA({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(WA,{showOutsideDays:r,className:Rh("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Rh(uw({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:Rh("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:Rh(uw({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(dd,{className:"h-4 w-4"}),IconRight:()=>t.jsx(hd,{className:"h-4 w-4"})},...o})}GA.displayName="Calendar";var YA=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(JA);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(QA,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(QA,{...o,ref:n,children:r})}));YA.displayName="Slot";var QA=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?Rc(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));QA.displayName="SlotClone";var XA=({children:e})=>t.jsx(t.Fragment,{children:e});function JA(e){return i.isValidElement(e)&&e.type===XA}var ZA=["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?YA: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}}),{}),eL="horizontal",tL=["horizontal","vertical"],nL=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=eL,...i}=e,s=function(e){return tL.includes(e)}(o)?o:eL;return t.jsx(ZA.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));nL.displayName="Separator";var rL=nL;const oL=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(rL,{ref:i,decorative:r,orientation:n,className:Rh("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));oL.displayName=rL.displayName;const iL=nd("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),sL=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:h,emptyMessage:f="No results found.",searchIcon:p=t.jsx(Dd,{className:"h-4 w-4"}),selectedValues:m,setSelectedValues:g,...v},y)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(WM,{open:b,onOpenChange:x,modal:l,children:[t.jsx(GM,{asChild:!0,children:t.jsx("button",{type:"button",ref:y,...v,onClick:()=>{x((e=>!e))},className:Rh("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(P_,{className:Rh(w?"animate-bounce":"",iL({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(P_,{className:Rh("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",iL({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(gd,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(zd,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(oL,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(ud,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(ud,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(YM,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),usePrimitiveWrapper:!1,children:t.jsxs(aM,{children:[t.jsx(lM,{searchIcon:p,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),h&&(h(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(cM,{children:[t.jsx(uM,{children:f}),t.jsxs(dM,{children:[t.jsxs(fM,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:Rh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(fM,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:Rh("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(cd,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(hM,{}),t.jsx(dM,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(fM,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(oL,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(fM,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(qd,{className:Rh("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function aL(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}sL.displayName="MultiSelect";var lL="Switch",[cL,uL]=Lc(lL),[dL,hL]=cL(lL),fL=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:h,...f}=e,[p,m]=i.useState(null),g=Ac(n,(e=>m(e))),v=i.useRef(!1),y=!p||(h||!!p.closest("form")),[b=!1,x]=cu({prop:s,defaultProp:a,onChange:d});return t.jsxs(dL,{scope:r,checked:b,disabled:c,children:[t.jsx(Vc.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":vL(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:Mc(e.onClick,(e=>{x((e=>!e)),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())}))}),y&&t.jsx(gL,{control:p,bubbles:!v.current,name:o,value:u,checked:b,required:l,disabled:c,form:h,style:{transform:"translateX(-100%)"}})]})}));fL.displayName=lL;var pL="SwitchThumb",mL=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=hL(pL,r);return t.jsx(Vc.span,{"data-state":vL(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));mL.displayName=pL;var gL=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=aL(r),c=Qk(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vL(e){return e?"checked":"unchecked"}var yL=fL,bL=mL;const xL=i.forwardRef((({className:e,...n},r)=>t.jsx(yL,{className:Rh("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...n,ref:r,children:t.jsx(bL,{className:Rh("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));xL.displayName=yL.displayName;const wL=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const[c,u]=i.useState(e===M_.Date&&r.length>0&&r[0]instanceof Date?r[0]:void 0);if(e===M_.String)return n===R_.EXISTS?null:t.jsx(sL,{maxCount:2,options:(s||[]).map((e=>({label:e,value:e}))),value:r.map((e=>e)),onValueChange:e=>{o(e.map((e=>e)))},selectedValues:r.map((e=>e)),setSelectedValues:e=>{o(e.map((e=>e)))},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case M_.String:return t.length>0;case M_.Number:return!isNaN(Number(t));case M_.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case M_.Boolean:return"true"===t||"false"===t;case M_.Date:case M_.DateTime:return!isNaN(new Date(t).getTime());default:throw bw(n,M_)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===M_.Date)return t.jsx("div",{className:"grid gap-2",children:t.jsxs(WM,{modal:!0,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",className:Rh("w-[200px] justify-start text-left font-normal",!c&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),c?Zj(c,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(YM,{className:"w-auto p-0",align:"start",children:t.jsx(GA,{mode:"single",selected:c,onSelect:e=>{u(e),e&&o([e])},initialFocus:!0})})]})});if(e===M_.Number)return n===R_.EXISTS?null:t.jsx(y_,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===M_.Boolean){if(n===R_.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(xL,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(y_,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]"})},SL=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=Dc(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:M_.String,options:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:V_[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(QM,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:B_[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case M_.Boolean:l=[!1];break;case M_.Number:l=[0];break;case M_.Date:l=[new Date];break;case M_.String:l=o.options?.length?[o.options[0]]:[""];break;default:l=[""]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(QM,{options:l.map((e=>({value:e,label:B_[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx(wL,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...new Set([...e.value,...a.options])]:a.options,value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c}})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(dw,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(yd,{className:"h-4 w-4"})}),t.jsx(dw,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Rd,{className:"h-4 w-4"})})]})]})};function CL({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=Dc(),[s,a]=i.useState(!1),[l,c]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:u,isLoading:d}=I_(e||""),{updateSegment:h}=F_(e),{createSegment:f,isCreating:p,segmentsConditions:m}=A_();i.useEffect((()=>{m&&c(u?{version:"1.0",id:u.id,name:u.name,description:u.description,logic:"AND",conditions:u.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})}),[u,m]);if(!m||d)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Vx,{})});return t.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8",children:t.jsxs("div",{className:"flex flex-1 flex-col gap-4 overflow-hidden",children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(U_,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(y_,{placeholder:"Segment name",value:l.name,onChange:e=>c({...l,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(U_,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(y_,{placeholder:"Segment description",value:l.description,onChange:e=>c({...l,description:e.target.value})})]})]}),l.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(nf,{mode:"popLayout",children:l.conditions.map(((e,n)=>t.jsxs(zx.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(zx.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(zx.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(zx.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(zx.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(SL,{condition:e,onUpdate:e=>((e,t)=>{const n=[...l.conditions];n[e]=t,c({...l,conditions:n})})(n,e),segmentsConditions:m,onDuplicate:()=>(e=>{const t=[...l.conditions];t.splice(e+1,0,{...l.conditions[e]}),c({...l,conditions:t})})(n),onDelete:()=>(e=>{const t=l.conditions.filter(((t,n)=>n!==e));c({...l,conditions:t})})(n)})]},n)))})})})]})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(dw,{variant:"secondary",onClick:()=>{c({...l,conditions:[...l.conditions,{field:m.conditions[0].field,operator:m.conditions[0].operators[0],value:[]}]})},children:[t.jsx(Nd,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(dw,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(dw,{variant:"secondary",onClick:async()=>{if(!l.name||!l.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==R_.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===R_.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"}}return{valid:!0,error:void 0}})(l.conditions);if(t){a(!0);try{e&&u?h({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):f({name:l.name,description:l.description,conditions:l.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(l.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{a(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:s||p,children:s||p?t.jsxs(t.Fragment,{children:[t.jsx(Sd,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})}function kL({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(d_,{open:e,onOpenChange:n,children:t.jsxs(p_,{className:"flex max-h-[86vh] flex-col gap-0 p-0 overflow-visible max-w-[800px] w-full",hideCloseButton:!0,children:[t.jsx(m_,{className:"p-8 pb-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(g_,{className:"text-3xl font-normal",children:r?"Edit Segment":"Create Segment"}),t.jsx(dw,{variant:"ghost",size:"icon",onClick:()=>n(!1),className:"h-8 w-8",children:t.jsx(zd,{className:"h-4 w-4"})})]})}),t.jsx(CL,{segmentId:r,setOpen:e=>{n(e),o?.(!1)},onSegmentUpdated:o})]})})}const EL=()=>{const[e,r]=n.useState(""),{toast:o}=Dc(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[O_.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[O_.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[O_.CUSTOM];return t.jsx(P_,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(Dd,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(y_,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:a&&t.jsx(kL,{open:i,setOpen:s,segmentId:a})})]}),t.jsx(E_,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900",children:e}),c(n.type)]}),t.jsx("span",{className:"text-sm text-gray-500 truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-gray-600",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-gray-600",children:e?tT(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await D_({cursor:t,limit:n,search:e||void 0});return{items:r.segments,cursor:r.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-gray-400"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:e=>{e.type===O_.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},jL=({iconDefinitionsPassed:e})=>{const r=CS(),[o,i]=n.useState("automations"),s=iw(e),a=[{id:"automations",label:"Automations",content:t.jsx(N_,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:s})},{id:"segments",label:"Segments",content:t.jsx(EL,{})}];return t.jsx("div",{className:"h-full container max-w-screen-xl mx-auto",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsx(ej,{iconDefinitions:s}),t.jsx("div",{className:"flex-1",children:t.jsx(cC,{tabs:a,activeTab:o,onTabChange:e=>i(e)})})]})})};var TL=i.createContext(void 0);function PL(e){const t=i.useContext(TL);return e||t||"ltr"}var _L="rovingFocusGroup.onEntryFocus",NL={bubbles:!1,cancelable:!0},DL="RovingFocusGroup",[ML,OL,RL]=Bc(DL),[AL,LL]=Lc(DL,[RL]),[IL,FL]=AL(DL),$L=i.forwardRef(((e,n)=>t.jsx(ML.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(ML.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(qL,{...e,ref:n})})})));$L.displayName=DL;var qL=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...f}=e,p=i.useRef(null),m=Ac(n,p),g=PL(a),[v=null,y]=cu({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=Hc(d),S=OL(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=p.current;if(e)return e.addEventListener(_L,w),()=>e.removeEventListener(_L,w)}),[w]),t.jsx(IL,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:v,onItemFocus:i.useCallback((e=>y(e)),[y]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(Vc.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:Mc(e.onMouseDown,(()=>{C.current=!0})),onFocus:Mc(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(_L,NL);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));VL([e.find((e=>e.active)),e.find((e=>e.id===v)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}C.current=!1})),onBlur:Mc(e.onBlur,(()=>x(!1)))})})})),zL="RovingFocusGroupItem",UL=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=wC(),u=a||c,d=FL(zL,r),h=d.currentTabStopId===u,f=OL(r),{onFocusableItemAdd:p,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return p(),()=>m()}),[o,p,m]),t.jsx(ML.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(Vc.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:Mc(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:Mc(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:BL[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>VL(o)))}var n,r}))})})}));UL.displayName=zL;var BL={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VL(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var KL=$L,HL=UL,WL="Tabs",[GL,YL]=Lc(WL,[LL]),QL=LL(),[XL,JL]=GL(WL),ZL=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=PL(l),[h,f]=cu({prop:o,onChange:i,defaultProp:s});return t.jsx(XL,{scope:r,baseId:wC(),value:h,onValueChange:f,orientation:a,dir:d,activationMode:c,children:t.jsx(Vc.div,{dir:d,"data-orientation":a,...u,ref:n})})}));ZL.displayName=WL;var eI="TabsList",tI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,loop:o=!0,...i}=e,s=JL(eI,r),a=QL(r);return t.jsx(KL,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:o,children:t.jsx(Vc.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:n})})}));tI.displayName=eI;var nI="TabsTrigger",rI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,disabled:i=!1,...s}=e,a=JL(nI,r),l=QL(r),c=sI(a.baseId,o),u=aI(a.baseId,o),d=o===a.value;return t.jsx(HL,{asChild:!0,...l,focusable:!i,active:d,children:t.jsx(Vc.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:c,...s,ref:n,onMouseDown:Mc(e.onMouseDown,(e=>{i||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(o)})),onKeyDown:Mc(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(o)})),onFocus:Mc(e.onFocus,(()=>{d||i||!("manual"!==a.activationMode)||a.onValueChange(o)}))})})}));rI.displayName=nI;var oI="TabsContent",iI=i.forwardRef(((e,n)=>{const{__scopeTabs:r,value:o,forceMount:s,children:a,...l}=e,c=JL(oI,r),u=sI(c.baseId,o),d=aI(c.baseId,o),h=o===c.value,f=i.useRef(h);return i.useEffect((()=>{const e=requestAnimationFrame((()=>f.current=!1));return()=>cancelAnimationFrame(e)}),[]),t.jsx(au,{present:s||h,children:({present:r})=>t.jsx(Vc.div,{"data-state":h?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!r,id:d,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:r&&a})})}));function sI(e,t){return`${e}-trigger-${t}`}function aI(e,t){return`${e}-content-${t}`}iI.displayName=oI;var lI=tI,cI=rI,uI=iI;const dI=ZL,hI=i.forwardRef((({className:e,...n},r)=>t.jsx(lI,{ref:r,className:Rh("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...n})));hI.displayName=lI.displayName;const fI=i.forwardRef((({className:e,...n},r)=>t.jsx(cI,{ref:r,className:Rh("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...n})));fI.displayName=cI.displayName;const pI=i.forwardRef((({className:e,...n},r)=>t.jsx(uI,{ref:r,className:Rh("ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n})));pI.displayName=uI.displayName;const mI=()=>{const e=ue({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ja(`${Wx}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},gI=()=>{const e=ne(),t=de({mutationFn:e=>(async(e,t)=>(await Ja(`${Wx}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},vI=()=>{const e=ne(),t=de({mutationFn:e=>(async e=>(await Ja(`${Gx}/${e}`)).data)(e),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{getCommunicationGroup:t.mutate,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},yI=(e,t)=>{const n=ne(),r=de({mutationFn:e=>(async e=>(await Ja(`${Gx}`,{method:"POST",body:JSON.stringify(e)})).data)(e),onSuccess:r=>(Qx(e,{action:[...t.action_data||[],{action_type:"send_communication",action_metadata:{action_type:"send_communication",communication_group_id:r.id}}]}),n.invalidateQueries({queryKey:["automations"]}),n.invalidateQueries({queryKey:["communicationGroups"]}),r)});return{createCommunicationForAutomation:r.mutate,isCreating:r.isPending}},bI=()=>{const e=ne(),t=de({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ja(`${Gx}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},xI=()=>{const e=ue({queryKey:["merge-fields"],queryFn:()=>(async()=>(await Ja(`${Gx}/merge-fields`)).data)()});return{getMergeFields:e.data,isGetting:e.isPending,getError:e.error,isGetSuccess:e.isSuccess}},wI=()=>{const e=de({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ja(`${Gx}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}},SI=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",CI=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),kI=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(CI,{type:"email"})}),EI=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(kI,{html:i,height:a.height,width:a.width})})]})},jI=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[400px] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap",children:n})})})})]}),TI=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(zx.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(dw,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(zx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(dw,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(zx.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(nf,{mode:"wait",children:["email"===i&&e&&t.jsx(zx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(EI,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(zx.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(jI,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},PI=({automationId:e,iconDefinitions:r})=>{const{automation:o,isFetching:i}=Xx(e),{getCommunicationGroup:s}=vI(),{channelSenders:a}=mI(),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(!1),p=n.useMemo((()=>{const e=o?.action_data?.map((e=>e.action_metadata.communication_group_id));if(e&&0!==e.length&&!(e.length>1))return e[0]}),[o]);return n.useEffect((()=>{const e=p;e&&a?(f(!0),s(e,{onSuccess:e=>{try{const t=e.email_channel_sender_id,n=a.channel_senders.find((e=>e.id===t));n&&e.email_html_body&&c({emailHtml:e.email_html_body,emailSubject:e.email_subject,emailBaseDomain:n.channel_sender_metadata.baseDomain,emailFromName:n.channel_sender_metadata.emailFromName,emailFromEmail:`${n.channel_sender_metadata.userPart}@${n.channel_sender_metadata.baseDomain}`,emailPreviewText:e.email_preview_text});const r=e.sms_channel_sender_id,o=a.channel_senders.find((e=>e.id===r));o&&(o.channel_sender_metadata.from||o.channel_sender_metadata.messageServiceSid)&&e.sms_message_body&&d({fromPhone:SI(o.channel_sender_metadata),smsBody:e.sms_message_body,companyName:e.text_message_company_name})}finally{f(!1)}}})):f(!1)}),[o,s,p,a,i]),t.jsx("div",h||i?{className:"min-h-[500px] flex items-center justify-center",children:t.jsx(Vx,{text:["Fetching Automation","Finishing up"]})}:{className:"p-6 bg-white",children:t.jsxs("div",l||u?{className:"space-y-4",children:[t.jsx(TI,{iconDefinitions:r,emailPreview:l&&l.emailFromEmail&&l.emailSubject&&l.emailHtml?{fromEmail:l?.emailFromEmail,fromName:l?.emailFromName??null,subject:l?.emailSubject,previewText:l?.emailPreviewText??null,body:l?.emailHtml}:null,smsPreview:u&&u.fromPhone&&u.smsBody?{fromPhone:u?.fromPhone,body:u?.smsBody,companyName:u?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},_I=({automationId:e,iconDefinitions:n})=>{const{recipients:r,isLoading:o,fetchError:i}=Jx(e),{isLoading:s}=tw(e);if(o||s)return t.jsx("div",{className:uC,children:t.jsx(Vx,{text:["Fetching Recipients","Finishing up"]})});if(i)return t.jsxs("div",{children:["Error: ",i.message]});if(!r||0===r.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(ow.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const a="30%",l="35%",c="35%";return t.jsxs("div",{className:"relative",children:[t.jsx("div",{children:t.jsx(ej,{automationId:e,iconDefinitions:n})}),t.jsx(oL,{className:"my-4"}),t.jsxs(b_,{children:[t.jsx(x_,{children:t.jsxs(S_,{children:[t.jsx(C_,{style:{width:a},children:"Name"}),t.jsx(C_,{style:{width:l},children:"Email"}),t.jsx(C_,{style:{width:c},children:"Phone"})]})}),t.jsx(w_,{children:r.recipients.map((e=>t.jsxs(S_,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(k_,{style:{width:a},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(k_,{style:{width:l},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(k_,{style:{width:c},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};var NI,DI="dismissableLayer.update",MI="dismissableLayer.pointerDownOutside",OI="dismissableLayer.focusOutside",RI=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),AI=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(RI),[h,f]=i.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=Ac(n,(e=>f(e))),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){II(MI,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?.())}),p),k=function(e,t=globalThis?.document){const n=Hc(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){II(OI,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?.())}),p);return Wc((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),p),i.useEffect((()=>{if(h)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(NI=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),LI(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=NI)}}),[h,p,r,d]),i.useEffect((()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),LI())}),[h,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(DI,e),()=>document.removeEventListener(DI,e)}),[]),t.jsx(Vc.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Mc(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Mc(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Mc(e.onPointerDownCapture,C.onPointerDownCapture)})}));AI.displayName="DismissableLayer";function LI(){const e=new CustomEvent(DI);document.dispatchEvent(e)}function II(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?Kc(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(RI),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(Vc.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var FI=["Enter"," "],$I=["ArrowUp","PageDown","End"],qI=["ArrowDown","PageUp","Home",...$I],zI={ltr:[...FI,"ArrowRight"],rtl:[...FI,"ArrowLeft"]},UI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},BI="Menu",[VI,KI,HI]=Bc(BI),[WI,GI]=Lc(BI,[HI,Zk,LL]),YI=Zk(),QI=LL(),[XI,JI]=WI(BI),[ZI,eF]=WI(BI),tF=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=YI(n),[u,d]=i.useState(null),h=i.useRef(!1),f=Hc(a),p=PL(s);return i.useEffect((()=>{const e=()=>{h.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>h.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(mE,{...c,children:t.jsx(XI,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(ZI,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:h,dir:p,modal:l,children:o})})})};tF.displayName=BI;var nF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YI(r);return t.jsx(gE,{...i,...o,ref:n})}));nF.displayName="MenuAnchor";var rF="MenuPortal",[oF,iF]=WI(rF,{forceMount:void 0}),sF=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=JI(rF,n);return t.jsx(oF,{scope:n,forceMount:r,children:t.jsx(au,{present:r||s.open,children:t.jsx(su,{asChild:!0,container:i,children:o})})})};sF.displayName=rF;var aF="MenuContent",[lF,cF]=WI(aF),uF=i.forwardRef(((e,n)=>{const r=iF(aF,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=JI(aF,e.__scopeMenu),a=eF(aF,e.__scopeMenu);return t.jsx(VI.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||s.open,children:t.jsx(VI.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?dF:hF,{...i,ref:n})})})})})),dF=i.forwardRef(((e,n)=>{const r=JI(aF,e.__scopeMenu),o=i.useRef(null),s=Ac(n,o);return i.useEffect((()=>{const e=o.current;if(e)return kP(e)}),[]),t.jsx(fF,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Mc(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),hF=i.forwardRef(((e,n)=>{const r=JI(aF,e.__scopeMenu);return t.jsx(fF,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),fF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:g,...v}=e,y=JI(aF,r),b=eF(aF,r),x=YI(r),w=QI(r),S=KI(r),[C,k]=i.useState(null),E=i.useRef(null),j=Ac(n,E,y.onContentChange),T=i.useRef(0),P=i.useRef(""),_=i.useRef(0),N=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),O=g?vP:i.Fragment,R=g?{as:Fc,allowPinchZoom:!0}:void 0,A=e=>{const t=P.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){P.current=t,window.clearTimeout(T.current),""!==t&&(T.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(T.current)),[]),TT();const L=i.useCallback((e=>D.current===N.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return 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,t)}(e,N.current?.area)),[]);return t.jsx(lF,{scope:r,searchRef:P,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:_,onPointerGraceIntentChange:i.useCallback((e=>{N.current=e}),[]),children:t.jsx(O,{...R,children:t.jsx(vM,{asChild:!0,trapped:s,onMountAutoFocus:Mc(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(AI,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:t.jsx(KL,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:Mc(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(vE,{role:"menu","aria-orientation":"vertical","data-state":$F(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:j,style:{outline:"none",...v.style},onKeyDown:Mc(v.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&A(e.key));if(e.target!==E.current)return;if(!qI.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));$I.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Mc(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),P.current="")})),onPointerMove:Mc(e.onPointerMove,UF((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));uF.displayName=aF;var pF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{role:"group",...o,ref:n})}));pF.displayName="MenuGroup";var mF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{...o,ref:n})}));mF.displayName="MenuLabel";var gF="MenuItem",vF="menu.itemSelect",yF=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=eF(gF,e.__scopeMenu),c=cF(gF,e.__scopeMenu),u=Ac(n,a),d=i.useRef(!1);return t.jsx(bF,{...s,ref:u,disabled:r,onClick:Mc(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(vF,{bubbles:!0,cancelable:!0});e.addEventListener(vF,(e=>o?.(e)),{once:!0}),Kc(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Mc(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:Mc(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||FI.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));yF.displayName=gF;var bF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=cF(gF,r),c=QI(r),u=i.useRef(null),d=Ac(n,u),[h,f]=i.useState(!1),[p,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(VI.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:t.jsx(HL,{asChild:!0,...c,focusable:!o,children:t.jsx(Vc.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:Mc(e.onPointerMove,UF((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:Mc(e.onPointerLeave,UF((e=>l.onItemLeave(e)))),onFocus:Mc(e.onFocus,(()=>f(!0))),onBlur:Mc(e.onBlur,(()=>f(!1)))})})})})),xF=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(PF,{scope:e.__scopeMenu,checked:r,children:t.jsx(yF,{role:"menuitemcheckbox","aria-checked":qF(r)?"mixed":r,...i,ref:n,"data-state":zF(r),onSelect:Mc(i.onSelect,(()=>o?.(!!qF(r)||!r)),{checkForDefaultPrevented:!1})})})}));xF.displayName="MenuCheckboxItem";var wF="MenuRadioGroup",[SF,CF]=WI(wF,{value:void 0,onValueChange:()=>{}}),kF=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=Hc(o);return t.jsx(SF,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(pF,{...i,ref:n})})}));kF.displayName=wF;var EF="MenuRadioItem",jF=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=CF(EF,e.__scopeMenu),s=r===i.value;return t.jsx(PF,{scope:e.__scopeMenu,checked:s,children:t.jsx(yF,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":zF(s),onSelect:Mc(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));jF.displayName=EF;var TF="MenuItemIndicator",[PF,_F]=WI(TF,{checked:!1}),NF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=_F(TF,r);return t.jsx(au,{present:o||qF(s.checked)||!0===s.checked,children:t.jsx(Vc.span,{...i,ref:n,"data-state":zF(s.checked)})})}));NF.displayName=TF;var DF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(Vc.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));DF.displayName="MenuSeparator";var MF=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=YI(r);return t.jsx(yE,{...i,...o,ref:n})}));MF.displayName="MenuArrow";var[OF,RF]=WI("MenuSub"),AF="MenuSubTrigger",LF=i.forwardRef(((e,n)=>{const r=JI(AF,e.__scopeMenu),o=eF(AF,e.__scopeMenu),s=RF(AF,e.__scopeMenu),a=cF(AF,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},h=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>h),[h]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(nF,{asChild:!0,...d,children:t.jsx(bF,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":$F(r.open),...e,ref:Rc(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Mc(e.onPointerMove,UF((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),h()}),100))}))),onPointerLeave:Mc(e.onPointerLeave,UF((e=>{h();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:Mc(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||zI[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));LF.displayName=AF;var IF="MenuSubContent",FF=i.forwardRef(((e,n)=>{const r=iF(aF,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=JI(aF,e.__scopeMenu),l=eF(aF,e.__scopeMenu),c=RF(IF,e.__scopeMenu),u=i.useRef(null),d=Ac(n,u);return t.jsx(VI.Provider,{scope:e.__scopeMenu,children:t.jsx(au,{present:o||a.open,children:t.jsx(VI.Slot,{scope:e.__scopeMenu,children:t.jsx(fF,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Mc(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:Mc(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:Mc(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=UI[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function $F(e){return e?"open":"closed"}function qF(e){return"indeterminate"===e}function zF(e){return qF(e)?"indeterminate":e?"checked":"unchecked"}function UF(e){return t=>"mouse"===t.pointerType?e(t):void 0}FF.displayName=IF;var BF=tF,VF=nF,KF=sF,HF=uF,WF=pF,GF=mF,YF=yF,QF=xF,XF=kF,JF=jF,ZF=NF,e$=DF,t$=MF,n$=LF,r$=FF,o$="DropdownMenu",[i$,s$]=Lc(o$,[GI]),a$=GI(),[l$,c$]=i$(o$),u$=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=a$(n),d=i.useRef(null),[h=!1,f]=cu({prop:s,defaultProp:a,onChange:l});return t.jsx(l$,{scope:n,triggerId:wC(),triggerRef:d,contentId:wC(),open:h,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(BF,{...u,open:h,onOpenChange:f,dir:o,modal:c,children:r})})};u$.displayName=o$;var d$="DropdownMenuTrigger",h$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=c$(d$,r),a=a$(r);return t.jsx(VF,{asChild:!0,...a,children:t.jsx(Vc.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:Rc(n,s.triggerRef),onPointerDown:Mc(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:Mc(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));h$.displayName=d$;var f$=e=>{const{__scopeDropdownMenu:n,...r}=e,o=a$(n);return t.jsx(KF,{...o,...r})};f$.displayName="DropdownMenuPortal";var p$="DropdownMenuContent",m$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=c$(p$,r),a=a$(r),l=i.useRef(!1);return t.jsx(HF,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:Mc(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:Mc(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));m$.displayName=p$;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(WF,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var g$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(GF,{...i,...o,ref:n})}));g$.displayName="DropdownMenuLabel";var v$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(YF,{...i,...o,ref:n})}));v$.displayName="DropdownMenuItem";var y$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(QF,{...i,...o,ref:n})}));y$.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(XF,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var b$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(JF,{...i,...o,ref:n})}));b$.displayName="DropdownMenuRadioItem";var x$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(ZF,{...i,...o,ref:n})}));x$.displayName="DropdownMenuItemIndicator";var w$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(e$,{...i,...o,ref:n})}));w$.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(t$,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var S$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(n$,{...i,...o,ref:n})}));S$.displayName="DropdownMenuSubTrigger";var C$=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=a$(r);return t.jsx(r$,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));C$.displayName="DropdownMenuSubContent";var k$=f$,E$=m$,j$=g$,T$=v$,P$=y$,_$=b$,N$=x$,D$=w$,M$=S$,O$=C$;const R$=u$,A$=h$;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(M$,{ref:i,className:Rh("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(hd,{className:"ml-auto"})]}))).displayName=M$.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(O$,{ref:r,className:Rh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}))).displayName=O$.displayName;const L$=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(k$,{children:t.jsx(E$,{ref:o,sideOffset:n,className:Rh("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})})));L$.displayName=E$.displayName;const I$=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(T$,{ref:o,className:Rh("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));I$.displayName=T$.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(P$,{ref:i,className:Rh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(N$,{children:t.jsx(cd,{className:"h-4 w-4"})})}),n]}))).displayName=P$.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(_$,{ref:o,className:Rh("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(N$,{children:t.jsx(vd,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=_$.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(j$,{ref:o,className:Rh("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=j$.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(D$,{ref:r,className:Rh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=D$.displayName;const F$="reach-styles-module__stepIndicatorContainer___FoKXB",$$="reach-styles-module__iconContainer___Ki-1n",q$="reach-styles-module__checkIcon___-krUS",z$="reach-styles-module__minusIcon___r5cKs",U$="reach-styles-module__minusIconActive___-4JHM",B$="reach-styles-module__minusIconInactive___JtvVB",V$="reach-styles-module__label___tiCMA",K$="reach-styles-module__labelActive___EXydD",H$="reach-styles-module__labelInactive___g-J3r",W$=({label:e,isCompleted:n,isActive:r})=>t.jsxs("div",{className:F$,children:[t.jsx("div",n?{className:$$,children:t.jsx(cd,{className:q$})}:{className:$$,children:t.jsx(Pd,{className:Rh(z$,r?U$:B$)})}),t.jsx("span",{className:Rh(V$,r?K$:H$),children:e})]}),G$=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4",children:[!l&&t.jsxs(dw,{onClick:n,disabled:s,variant:"secondary",className:Rh("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(dw,{onClick:u,variant:"secondary",className:Rh("flex items-center gap-2"),children:t.jsx("span",{children:c})}),t.jsxs(dw,{onClick:r,disabled:a,className:Rh("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),Y$="reach-styles-module__header___-izE2",Q$="reach-styles-module__title___n1hA9",X$="reach-styles-module__description___EvXM-",J$="reach-styles-module__content___okv68",Z$="reach-styles-module__footer___YA4U4",eq=nd("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),tq=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:Rh(eq({variant:n}),e),...r})));tq.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Y$,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Q$,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(X$,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(J$,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:Rh(Z$,e),...n}))).displayName="CardFooter";const nq=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},rq=()=>{const e=ue({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ja("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var oq=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(oq||{});function iq(e,[t,n]){return Math.min(n,Math.max(t,e))}var sq=[" ","Enter","ArrowUp","ArrowDown"],aq=[" ","Enter"],lq="Select",[cq,uq,dq]=Bc(lq),[hq,fq]=Lc(lq,[dq,Zk]),pq=Zk(),[mq,gq]=hq(lq),[vq,yq]=hq(lq),bq=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:h,autoComplete:f,disabled:p,required:m,form:g}=e,v=pq(n),[y,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=PL(d),[E=!1,j]=cu({prop:o,defaultProp:s,onChange:a}),[T,P]=cu({prop:l,defaultProp:c,onChange:u}),_=i.useRef(null),N=!y||(g||!!y.closest("form")),[D,M]=i.useState(new Set),O=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(mE,{...v,children:t.jsxs(mq,{required:m,scope:n,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:wC(),value:T,onValueChange:P,open:E,onOpenChange:j,dir:k,triggerPointerDownPosRef:_,disabled:p,children:[t.jsx(cq.Provider,{scope:n,children:t.jsx(vq,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),N?t.jsxs(iz,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:f,value:T,onChange:e=>P(e.target.value),disabled:p,form:g,children:[void 0===T?t.jsx("option",{value:""}):null,Array.from(D)]},O):null]})})};bq.displayName=lq;var xq="SelectTrigger",wq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=pq(r),l=gq(xq,r),c=l.disabled||o,u=Ac(n,l.onTriggerChange),d=uq(r),h=i.useRef("touch"),[f,p,m]=sz((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=az(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(gE,{asChild:!0,...a,children:t.jsx(Vc.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":oz(l.value)?"":void 0,...s,ref:u,onClick:Mc(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==h.current&&g(e)})),onPointerDown:Mc(s.onPointerDown,(e=>{h.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:Mc(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||sq.includes(e.key)&&(g(),e.preventDefault())}))})})}));wq.displayName=xq;var Sq="SelectValue",Cq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=gq(Sq,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,h=Ac(n,c.onValueNodeChange);return iu((()=>{u(d)}),[u,d]),t.jsx(Vc.span,{...l,ref:h,style:{pointerEvents:"none"},children:oz(c.value)?t.jsx(t.Fragment,{children:a}):s})}));Cq.displayName=Sq;var kq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(Vc.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));kq.displayName="SelectIcon";var Eq=e=>t.jsx(su,{asChild:!0,...e});Eq.displayName="SelectPortal";var jq="SelectContent",Tq=i.forwardRef(((e,n)=>{const r=gq(jq,e.__scopeSelect),[o,a]=i.useState();if(iu((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx(_q,{scope:e.__scopeSelect,children:t.jsx(cq.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(Dq,{...e,ref:n})}));Tq.displayName=jq;var Pq=10,[_q,Nq]=hq(jq),Dq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=gq(jq,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=Ac(n,(e=>S(e))),[j,T]=i.useState(null),[P,_]=i.useState(null),N=uq(r),[D,M]=i.useState(!1),O=i.useRef(!1);i.useEffect((()=>{if(w)return kP(w)}),[w]),TT();const R=i.useCallback((e=>{const[t,...n]=N().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[N,C]),A=i.useCallback((()=>R([j,w])),[R,j,w]);i.useEffect((()=>{D&&A()}),[D,A]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=sz((e=>{const t=N().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=az(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!O.current&&!n;(void 0!==x.value&&x.value===t||r)&&(T(e),r&&(O.current=!0))}),[x.value]),z=i.useCallback((()=>w?.focus()),[w]),U=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!O.current&&!n)&&_(e)}),[x.value]),B="popper"===o?Oq:Mq,V=B===Oq?{side:c,sideOffset:u,align:d,alignOffset:h,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:g,hideWhenDetached:v,avoidCollisions:y}:{};return t.jsx(_q,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:j,onItemLeave:z,itemTextRefCallback:U,focusSelectedItem:A,selectedItemText:P,position:o,isPositioned:D,searchRef:F,children:t.jsx(vP,{as:Fc,allowPinchZoom:!0,children:t.jsx(vM,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Mc(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(Zc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Mc(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>R(t))),e.preventDefault()}}))})})})})})}));Dq.displayName="SelectContentImpl";var Mq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=gq(jq,r),l=Nq(jq,r),[c,u]=i.useState(null),[d,h]=i.useState(null),f=Ac(n,(e=>h(e))),p=uq(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&y&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-Pq,l=iq(o,[Pq,Math.max(Pq,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-Pq,u=iq(o,[Pq,Math.max(Pq,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=p(),s=window.innerHeight-2*Pq,l=v.scrollHeight,u=window.getComputedStyle(d),h=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=h+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*y.offsetHeight,x),S=window.getComputedStyle(v),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-Pq,j=s-E,T=y.offsetHeight/2,P=h+f+(y.offsetTop+T),_=x-P;if(P<=E){const e=i.length>0&&y===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(j,T+(e?k:0)+(d.clientHeight-v.offsetTop-v.offsetHeight)+g);c.style.height=P+t+"px"}else{const e=i.length>0&&y===i[0].ref.current;c.style.top="0px";const t=Math.max(E,h+v.offsetTop+(e?C:0)+T);c.style.height=t+_+"px",v.scrollTop=P-E+v.offsetTop}c.style.margin=`${Pq}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[p,a.trigger,a.valueNode,c,d,v,y,b,a.dir,o]);iu((()=>w()),[w]);const[S,C]=i.useState();iu((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(Rq,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(Vc.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));Mq.displayName="SelectItemAlignedPosition";var Oq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=Pq,...s}=e,a=pq(r);return t.jsx(vE,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));Oq.displayName="SelectPopperPosition";var[Rq,Aq]=hq(jq,{}),Lq="SelectViewport",Iq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=Nq(Lq,r),l=Aq(Lq,r),c=Ac(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(cq.Slot,{scope:r,children:t.jsx(Vc.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Mc(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Pq,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));Iq.displayName=Lq;var Fq="SelectGroup",[$q,qq]=hq(Fq);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=wC();return t.jsx($q,{scope:r,id:i,children:t.jsx(Vc.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=Fq;var zq="SelectLabel",Uq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=qq(zq,r);return t.jsx(Vc.div,{id:i.id,...o,ref:n})}));Uq.displayName=zq;var Bq="SelectItem",[Vq,Kq]=hq(Bq),Hq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=gq(Bq,r),u=Nq(Bq,r),d=c.value===o,[h,f]=i.useState(a??""),[p,m]=i.useState(!1),g=Ac(n,(e=>u.itemRefCallback?.(e,o,s))),v=wC(),y=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(Vq,{scope:r,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(cq.ItemSlot,{scope:r,value:o,disabled:s,textValue:h,children:t.jsx(Vc.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:Mc(l.onFocus,(()=>m(!0))),onBlur:Mc(l.onBlur,(()=>m(!1))),onClick:Mc(l.onClick,(()=>{"mouse"!==y.current&&b()})),onPointerUp:Mc(l.onPointerUp,(()=>{"mouse"===y.current&&b()})),onPointerDown:Mc(l.onPointerDown,(e=>{y.current=e.pointerType})),onPointerMove:Mc(l.onPointerMove,(e=>{y.current=e.pointerType,s?u.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Mc(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:Mc(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(aq.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));Hq.displayName=Bq;var Wq="SelectItemText",Gq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=gq(Wq,r),u=Nq(Wq,r),d=Kq(Wq,r),h=yq(Wq,r),[f,p]=i.useState(null),m=Ac(n,(e=>p(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,v=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=h;return iu((()=>(y(v),()=>b(v))),[y,b,v]),t.jsxs(t.Fragment,{children:[t.jsx(Vc.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));Gq.displayName=Wq;var Yq="SelectItemIndicator",Qq=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return Kq(Yq,r).isSelected?t.jsx(Vc.span,{"aria-hidden":!0,...o,ref:n}):null}));Qq.displayName=Yq;var Xq="SelectScrollUpButton",Jq=i.forwardRef(((e,n)=>{const r=Nq(Xq,e.__scopeSelect),o=Aq(Xq,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(tz,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Jq.displayName=Xq;var Zq="SelectScrollDownButton",ez=i.forwardRef(((e,n)=>{const r=Nq(Zq,e.__scopeSelect),o=Aq(Zq,e.__scopeSelect),[s,a]=i.useState(!1),l=Ac(n,o.onScrollButtonChange);return iu((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(tz,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));ez.displayName=Zq;var tz=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=Nq("SelectScrollButton",r),l=i.useRef(null),c=uq(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),iu((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(Vc.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Mc(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:Mc(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:Mc(s.onPointerLeave,(()=>{u()}))})})),nz=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(Vc.div,{"aria-hidden":!0,...o,ref:n})}));nz.displayName="SelectSeparator";var rz="SelectArrow";function oz(e){return""===e||void 0===e}i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=pq(r),s=gq(rz,r),a=Nq(rz,r);return s.open&&"popper"===a.position?t.jsx(yE,{...i,...o,ref:n}):null})).displayName=rz;var iz=i.forwardRef(((e,n)=>{const{value:r,...o}=e,s=i.useRef(null),a=Ac(n,s),l=aL(r);return i.useEffect((()=>{const e=s.current,t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}}),[l,r]),t.jsx(uu,{asChild:!0,children:t.jsx("select",{...o,ref:a,defaultValue:r})})}));function sz(e){const t=Hc(e),n=i.useRef(""),r=i.useRef(0),o=i.useCallback((e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout((()=>e("")),1e3))}(o)}),[t]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function az(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}iz.displayName="BubbleSelect";var lz=wq,cz=kq,uz=Eq,dz=Tq,hz=Iq,fz=Uq,pz=Hq,mz=Gq,gz=Qq,vz=Jq,yz=ez,bz=nz;const xz=bq,wz=Cq,Sz=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(lz,{ref:o,className:Rh("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(cz,{asChild:!0,children:t.jsx(ud,{className:"h-4 w-4 opacity-50"})})]})));Sz.displayName=lz.displayName;const Cz=i.forwardRef((({className:e,...n},r)=>t.jsx(vz,{ref:r,className:Rh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(fd,{className:"h-4 w-4"})})));Cz.displayName=vz.displayName;const kz=i.forwardRef((({className:e,...n},r)=>t.jsx(yz,{ref:r,className:Rh("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(ud,{className:"h-4 w-4"})})));kz.displayName=yz.displayName;const Ez=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(uz,{children:t.jsxs(dz,{ref:i,className:Rh("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o,children:[t.jsx(Cz,{}),t.jsx(hz,{className:Rh("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(kz,{})]})})));Ez.displayName=dz.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(fz,{ref:r,className:Rh("px-2 py-1.5 text-sm font-semibold",e),...n}))).displayName=fz.displayName;const jz=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(pz,{ref:o,className:Rh("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(gz,{children:t.jsx(cd,{className:"h-4 w-4"})})}),t.jsx(mz,{children:n})]})));jz.displayName=pz.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(bz,{ref:r,className:Rh("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=bz.displayName;const Tz=()=>t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsx("div",{className:"space-y-8",children:t.jsxs("div",{className:"bg-white rounded-xl border shadow-sm p-6",children:[t.jsx("h3",{className:"text-lg font-medium mb-4",children:"Using Dynamic Content"}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://cdn.embedreach.com/assets/engage/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx(pw,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(Ed,{}),selected:!0})]})]})})]}),Pz=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",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.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),_z={all:["stripo"],token:()=>[..._z.all,"token"],editorData:()=>[..._z.all,"editorData"],templates:()=>[..._z.all,"templates"],demoTemplate:()=>[..._z.templates(),"demo"]},Nz=async()=>(await Ja(`${Yx}/editor-data`)).data,Dz=e=>ue({queryKey:["stripo","templates",e],queryFn:()=>(async e=>(await Ja(`${Yx}/template/${e}`)).data)(e),...Wa}),Mz=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(Vx,{textColor:"white",color:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),Oz="UiEditorScript",Rz=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{forceRecreate:!0,metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ja(`${Yx}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(Oz))r();else{const e=document.createElement("script");e.id=Oz,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),Az=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a})=>{const l=n.useRef(!1),c=n.useRef(null),{data:u,isLoading:d}=Dz(e.id),{data:h,isLoading:f}=(()=>{const e=ne();return{...ue({queryKey:_z.editorData(),queryFn:Nz,...Wa}),invalidateEditorData:()=>e.invalidateQueries({queryKey:_z.editorData()})}})(),[p,m]=n.useState(!1),[g,v]=n.useState(!1),{updateCommunicationGroup:y}=bI();return n.useEffect((()=>{if(o&&window.UIEditor&&u?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(u.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(y({groupId:u.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||m(!0)}))}}),[o,c,i,r,u,y,a]),n.useEffect((()=>{(async()=>{p&&g&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),m(!1),v(!1),r(!1))})()}),[p,g,r,i]),n.useEffect((()=>{h?.businessId&&c.current&&u&&(l.current||(Rz({emailId:u.communicationGroupId,html:u.html||"<div></div>",css:u.css||"",container:c.current,businessId:h.businessId,mergeFields:h.mergeFields||[]}).catch((e=>{})),l.current=!0))}),[h,u]),t.jsx("div",d||f||!h||!u?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(Vx,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(Mz,{containerRef:c,stripoDialogDimensions:s,showSaving:o})})},Lz=({automation:e})=>{const r=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[o,i]=n.useState(r()??null),[s,a]=n.useState(!1),[l,c]=n.useState(null),[u,d]=n.useState(null),[h,f]=n.useState(null),[p,m]=n.useState(null),[g,v]=n.useState(!1),[y,b]=n.useState(!1),[x,w]=n.useState(null),[S,C]=n.useState(null),[k,E]=n.useState(null),[j,T]=n.useState(!1),{refetchAutomation:P}=Xx(e.id),[_,N]=n.useState(!1),D=nq(x,500),M=nq(S,500),{channelSenders:O}=mI(),{channelAccounts:R}=rq(),{getCommunicationGroup:A}=vI(),{createCommunicationForAutomation:L}=yI(e.id,e),{updateCommunicationGroup:I}=bI(),{updateChannelSender:F}=gI(),{updateAutomation:$}=ew(e.id),[q,z]=n.useState({width:0,height:0}),[U,B]=n.useState({width:0,height:0}),V=n.useRef(null),K=e=>{c(e.email_channel_sender_id),d(e.email_subject),f(e.email_preview_text),m(e.email_html_body)};if(n.useEffect((()=>{const e=()=>{V.current&&requestAnimationFrame((()=>{B({width:V.current?V.current.offsetWidth-100:0,height:V.current?V.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[V]),n.useEffect((()=>{const e=()=>{z({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{l&&u&&p&&!s&&(a(!0),o?I({groupId:o,params:{email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}}}):L({email_channel_sender_id:l,email_html_body:p,email_subject:u,...h&&{email_preview_text:h}},{onSuccess:e=>{i(e.id)}}),a(!1))}),[l,u,h,p,e.action_data,I,$,r,o,s,L]),n.useEffect((()=>{o&&A(o,{onSuccess:e=>{K(e)}})}),[r,A,e.action_data,e,o,O?.channel_senders]),n.useEffect((()=>{if(void 0!==O&&!1===j){if(!o){const e=O?.channel_senders?.filter((e=>e.channel_sender_metadata.userPart));if(e?.[0]){const t=e[0];c(t.id),t&&(w(t.channel_sender_metadata.emailFromName),C(t.channel_sender_metadata.emailReplyTo))}}T(!0)}}),[j,O?.channel_senders,o,O]),n.useEffect((()=>{if(l){const e=O?.channel_senders?.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),C(e.channel_sender_metadata.emailReplyTo))}}),[l,O]),n.useEffect((()=>{if(D){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:D}}})}}),[D,O?.channel_senders,l,F]),n.useEffect((()=>{if(M){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(M))return void E("Please enter a valid email address");E(null)}if(M){const e=O?.channel_senders?.find((e=>e.id===l));e&&F({id:l??"",toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:M}}})}}),[M,O?.channel_senders,l,F,S]),n.useEffect((()=>{!1===g&&o&&(A(o,{onSuccess:e=>{K(e),V.current&&B({width:V.current.offsetWidth,height:V.current.offsetHeight})}}),P())}),[g,o,A,P,O?.channel_senders]),!R||!O)return t.jsx("div",{children:t.jsx(Vx,{text:["Loading..."]})});const H=O.channel_senders?.filter((e=>e.channel_sender_metadata.userPart)),W=H?.map((e=>{const t=R.channel_accounts?.find((t=>t.id===e.channel_account_id));if(!t)return null;switch(t.channel_account_metadata.type){case oq.REACH_MANAGED:return{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`};case oq.TWILLIO:return null;default:throw bw(t.channel_account_metadata.type,oq)}})).filter((e=>null!==e));return t.jsxs("div",{className:"relative",children:[t.jsx(d_,{open:_,onOpenChange:N,children:t.jsxs(p_,{className:"min-w-[50vw] min-h-[50vh]",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Email Preview Help"}),t.jsx(v_,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(Tz,{})]})}),t.jsx(d_,{open:g,onOpenChange:v,children:t.jsxs(p_,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Email Editor"}),t.jsx(v_,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(XE,{title:"Click to learn more about email template ",onClick:()=>N(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(Az,{showStripoEditor:g,automation:e,setShowStripoEditor:v,saveClicked:y,setSaveClicked:b,stripoDialogDimensions:q,setCommunicationGroupId:i})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(U_,{children:"From Email"}),t.jsxs(xz,{onValueChange:e=>{c(e)},value:l??void 0,children:[t.jsx(Sz,{children:t.jsx(wz,{placeholder:"Select email",children:l?W?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(Ez,{children:W?.map((e=>t.jsx(jz,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(U_,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(XE,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(y_,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:!l})]}),t.jsxs("div",{children:[t.jsx(U_,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(XE,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(y_,{placeholder:"Enter reply to email",value:S??"",onChange:e=>C(e.target.value),disabled:!l}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(U_,{children:"Subject"}),t.jsx(y_,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value)})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(U_,{children:"Preview Text"}),t.jsx(XE,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(y_,{placeholder:"Enter preview text",value:h??"",onChange:e=>f(e.target.value)})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(dw,{onClick:()=>v(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(W?.length??0),children:"Edit"}),0===(W?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(Pz,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 h-full w-full",ref:V,children:t.jsx(kI,{html:p??"",height:U.height,width:U.width})})]})]})]})},Iz=async()=>(await Ja("/businesses/me")).data,Fz=["me"],$z=i.forwardRef((({className:e,...n},r)=>t.jsx("textarea",{className:Rh("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n})));$z.displayName="Textarea";const qz=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(!1),s=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[a,l]=n.useState(""),[c,u]=n.useState(null),[d,h]=n.useState(!1),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(s()??null),[b,x]=n.useState(!1),[w,S]=n.useState(!1),{channelSenders:C}=mI(),{data:k,isLoading:E}=ue({queryKey:Fz,queryFn:Iz,...Wa}),{channelAccounts:j}=rq(),{createCommunicationForAutomation:T}=yI(e.id,e),{updateCommunicationGroup:P}=bI(),{getCommunicationGroup:_}=vI(),{getMergeFields:N,isGetting:D}=xI(),M=n.useRef(null),O=nq(m,1e3),R=nq(c,1e3),A=nq(f,1e3),L=e=>I?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??I?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{null===R||null===O||o||(i(!0),v?P({groupId:v,params:{sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A}}):T({sms_channel_sender_id:R,sms_message_body:O,text_message_company_name:A},{onSuccess:e=>{y(e.id)}}),i(!1))}),[R,O,A,o,v,P,T]),n.useEffect((()=>{v&&_(v,{onSuccess:e=>{u(e.sms_channel_sender_id),g(e.sms_message_body),e.text_message_company_name&&p(e.text_message_company_name)}})}),[e.action_data,v,_,k]);if(n.useEffect((()=>{if(void 0!==C&&!1===b){const e=C.channel_senders?.filter((e=>e.channel_sender_metadata.from));e?.[0]&&u(e[0].id),x(!0)}}),[C,b]),n.useEffect((()=>{f||!k?.name||d||(h(!0),p(k.name))}),[f,k?.name,d]),!j||!C||D||E)return t.jsx("div",{children:t.jsx(Vx,{text:["Loading..."]})});const I=C.channel_senders?.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(d_,{open:w,onOpenChange:S,children:t.jsxs(p_,{children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"SMS Editor"}),t.jsx(v_,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx($z,{ref:M,className:"min-h-[300px]",placeholder:"Text message content...",value:m??"",onChange:e=>{g(e.target.value)},maxLength:1600-(f?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(xz,{value:a,onValueChange:e=>{const t=M.current,n=m||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);g(i),l(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(Sz,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(Ez,{children:N?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(jz,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(XE,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(m&&m.length>1400?m.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[m?m.length:0,"/",1600-(f?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(U_,{children:"From Number"}),t.jsxs(xz,{onValueChange:e=>{u(e)},value:c??void 0,children:[t.jsx(Sz,{children:t.jsx(wz,{placeholder:"Select number",children:c?L(c):"Select number"})}),t.jsx(Ez,{children:I?.map((e=>t.jsx(jz,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(U_,{children:"Company Name"}),t.jsx(XE,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(y_,{placeholder:"Enter company name",value:f??"",onChange:e=>{p(e.target.value??null)},disabled:!c})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(dw,{onClick:()=>S(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(I?.length??0),children:"Edit"})})]}),t.jsx("div",{children:c?t.jsx(t.Fragment,{children:c&&m?t.jsx(jI,{fromPhone:L(c),body:f?`${f}:\n${m}`:m}):t.jsx(CI,{type:"sms"})}):t.jsx(Pz,{type:"sms"})})]})]})]})},zz=({selectedChannels:e,setSelectedChannels:n,expandedChannels:r,setExpandedChannels:o,iconDefinitions:i})=>{const{toast:s}=Dc(),a="flex items-center gap-2 px-3 py-1.5 rounded-md transition-all duration-200";return t.jsxs("div",{className:"",children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2",children:"Select the channels you want to use in this automation"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs(dw,{variant:e.includes("email")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("email")?e.includes("sms")?n(["sms"]):s({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"email"]),o([...r||[],"email"]))},children:[t.jsx("span",{children:t.jsx(i.EmailIcon,{size:15})}),"Email"]}),t.jsxs(dw,{variant:e.includes("sms")?"default":"outline",className:`${a}`,onClick:()=>{e.includes("sms")?e.includes("email")?n(["email"]):s({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):(n([...e,"sms"]),o([...r||[],"sms"]))},children:[t.jsx("span",{children:t.jsx(i.SmsIcon,{size:15})}),"SMS"]})]})]})},Uz=({automation:e,iconDefinitions:r})=>{const[o,i]=n.useState(null),[s,a]=n.useState(null),{getCommunicationGroup:l}=vI(),{updateCommunicationGroup:c}=bI(),u=n.useMemo((()=>{const t=e.action_data?.map((e=>e.action_metadata.communication_group_id));if(t&&0!==t.length&&!(t.length>1))return t[0]}),[e]);n.useEffect((()=>{const e=u;if(!e)return i(["email"]),void a(["email"]);l(e,{onSuccess:e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),i(t),a(t)}})}),[e,l,u]),n.useEffect((()=>{const e=u;e&&o&&(o.includes("email")||c({groupId:e,params:{email_channel_sender_id:null}}),o.includes("sms")||c({groupId:e,params:{sms_channel_sender_id:null}}))}),[o,u,c]);const d=e=>{a((t=>t?.includes(e)?t?.filter((t=>t!==e)):[...t||[],e]))};return o&&s?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(tq,{className:"p-4 rounded-xl shadow-none",children:t.jsx(zz,{selectedChannels:o,setSelectedChannels:i,expandedChannels:s,setExpandedChannels:a,iconDefinitions:r})}),o.includes("email")&&t.jsxs(tq,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("email"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(zx.div,{animate:{rotate:s?.includes("email")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"Email Campaign"})]}),t.jsx(nf,{children:s?.includes("email")&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(Lz,{automation:e})})})})]}),o.includes("sms")&&t.jsxs(tq,{className:"overflow-hidden rounded-xl shadow-none",children:[t.jsxs("button",{onClick:()=>d("sms"),className:"w-full flex items-center gap-2 p-4 text-gray-700 hover:text-gray-900 transition-colors",children:[t.jsx(zx.div,{animate:{rotate:s?.includes("sms")?0:-90},transition:{duration:.2},children:t.jsx(r.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{className:"text-lg font-medium",children:"SMS Campaign"})]}),t.jsx(nf,{children:s?.includes("sms")&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},children:t.jsx("div",{className:"p-4 pt-0",children:t.jsx(qz,{automation:e,iconDefinitions:r})})})})]})]}):t.jsx("div",{className:"py-4 flex justify-center items-center",children:t.jsx(Vx,{text:["Loading..."]})})},Bz=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=L_({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(zx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(zx.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(zx.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})},Vz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(WM,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(pd,{className:"opacity-50"})]})}),t.jsx(YM,{className:"w-[200px] p-0",children:t.jsxs(aM,{children:[t.jsx(lM,{placeholder:r,className:"h-9"}),t.jsxs(cM,{children:[t.jsx(uM,{children:o}),t.jsx(dM,{children:e.map((e=>t.jsxs(fM,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(cd,{className:Rh("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Kz=({automation:e})=>{const r=()=>e.trigger_metadata?.scheduled_at?new Date(e.trigger_metadata.scheduled_at):hj(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(Zj(o,"HH:mm")),{updateAutomation:d}=ew(e.id),[h,f]=i.useState(Intl.DateTimeFormat().resolvedOptions().timeZone),p=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=hj(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:h}))<new Date(t.toLocaleString("en-US",{timeZone:h}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:h})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:nw.ONE_TIME,scheduled_at:s,timezone:h}})}),[o,h,d]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(WM,{children:[t.jsx(GM,{asChild:!0,children:t.jsxs(dw,{variant:"outline",className:Rh("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(ld,{className:"mr-2 h-4 w-4"}),o?Zj(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(YM,{className:"w-auto p-0",children:t.jsx(GA,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:Rh("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Vz,{data:p,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:h,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=hj(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Hz=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(zx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(pw,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:nw.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(pw,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(nf,{children:"schedule"===i&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(Kz,{automation:r})})})})]}),r.trigger_metadata.scheduled_at&&t.jsxs(zx.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(zx.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(zx.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},Wz=({automation:e,iconDefinitions:r,loading:o})=>{const i=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),{updateAutomation:s}=ew(e.id),[a,l]=n.useState(!1),c=i(),{getCommunicationGroup:u}=vI(),{channelSenders:d}=mI(),{channelAccounts:h}=rq(),[f,p]=n.useState(null),[m,g]=n.useState(null),[v,y]=n.useState(null),[b,x]=n.useState(null);return n.useEffect((()=>{d&&y(d),h&&x(h)}),[d,h]),n.useEffect((()=>{c?u(c,{onSuccess:e=>{const t=e.email_channel_sender_id,n=e.sms_channel_sender_id,r=v?.channel_senders.find((e=>e.id===t)),o=v?.channel_senders.find((e=>e.id===n));if(r&&e.email_subject&&e.email_html_body){const t=r.channel_sender_metadata?.userPart,n=b?.channel_accounts.find((e=>e.id===r.channel_account_id));if(n)switch(n.channel_account_metadata.type){case oq.REACH_MANAGED:p({fromEmail:`${t}@${n.channel_account_metadata.baseDomain}.embedreach.com`,fromName:r.channel_sender_metadata.emailFromName,subject:e.email_subject,previewText:e.email_preview_text,body:e.email_html_body});break;case oq.TWILLIO:break;default:throw bw(n.channel_account_metadata.type,oq)}}if(o){const t=v?.channel_senders.find((e=>e.id===n));t&&e.sms_message_body&&(t.channel_sender_metadata?.from||t.channel_sender_metadata?.messageServiceSid)&&g({fromPhone:SI(t.channel_sender_metadata),body:e.sms_message_body,companyName:e.text_message_company_name})}l(!0)},onError:()=>{l(!0)}}):l(!0)}),[b?.channel_accounts,v?.channel_senders,c,u]),o||!a?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Vx,{text:["Loading..."]})}):f||m?t.jsxs("div",{className:"max-w-8xl mx-auto p-6 gap-4 grid",children:[t.jsxs("div",{className:"flex gap-4",children:[t.jsx(TI,{emailPreview:f,smsPreview:m,iconDefinitions:r}),t.jsx(Bz,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),t.jsx(tq,{className:"p-4 shadow-sm border-none",children:t.jsx(Hz,{automation:e,iconDefinitions:r,updateAutomation:s})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Gz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[t.jsx(pw,{onClick:()=>a("all"),title:"All patrons",subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(pw,{onClick:()=>a("segments"),title:"Select patrons",subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Yz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(sL,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(fM,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Qz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Yz,{segments:r,allSegments:l?.segments||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(dw,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(zx.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(nf,{children:u&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Yz,{segments:o,allSegments:l?.segments||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},Xz=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=ue({queryKey:["segments"],queryFn:()=>D_()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=ew(r.id),[d,h]=n.useState(r.includeSegmentIds||[]),[f,p]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.segments?.find((e=>e.type===O_.ALL_USERS&&e.id===d[0])),[g,v]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u]);const y=n.useCallback((()=>l?.segments?.find((e=>e.type===O_.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=y();e&&h([e.id]),p([])}}),[g,l,y]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){v("all");const e=y();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}v(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,y,u,r.includeSegmentIds,r.excludeSegmentIds]),!c&&l&&s?t.jsxs("div",{className:"p-3 w-full h-full flex items-center justify-center",children:[t.jsx(d_,{open:o,modal:!0,onOpenChange:i,children:t.jsxs(p_,{hideCloseButton:!0,children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Create Segment"}),t.jsx(v_,{children:"Create a new segment to use in your automation."})]}),t.jsx(kL,{open:o,setOpen:i})]})}),t.jsx("div",{className:" w-full",children:t.jsxs("div",{className:"grid grid-cols-2 gap-8",children:[t.jsxs(zx.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:" flex flex-col items-center justify-center",children:[t.jsx(Gz,{iconDefinitions:e,onSelectionChange:e=>{v(e)},defaultValue:g}),t.jsx(nf,{mode:"wait",children:"segments"===g&&t.jsx(zx.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"mt-4 w-full",children:t.jsx(Qz,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?h((t=>[...t,e])):p((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?h((t=>t.filter((t=>t!==e)))):p((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(zx.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg p-8 flex flex-col justify-start h-full shadow-sm",children:t.jsx(Bz,{iconDefinitions:e,includeSegments:d,excludeSegments:f,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]})})]}):t.jsx("div",{children:t.jsx(Vx,{text:["Fetching segments","Finishing up"]})})},Jz=({title:e,subtitle:n,content:r})=>t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 ",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),Zz=({automationId:e,iconDefinitions:r,logoUrl:o,setOpenEditAutomationPopup:i,onBeforeSchedule:s})=>{const{toast:a}=Dc(),[l,c]=n.useState(0),{automation:u}=Xx(e),[d,h]=n.useState(!1),{updateAutomation:f}=ew(e),{getCommunicationGroup:p}=vI(),m=()=>{h(!0),f({status:rw.ACTIVE}),i(!1),a({title:"Automation scheduled!"})},{data:g}=L_({include_segments:u?.includeSegmentIds??[],exclude_segments:u?.excludeSegmentIds??[]}),v=n.useMemo((()=>g?.recipients?g.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[g?.recipients]);if(!u)return t.jsx("div",{children:t.jsx(Vx,{text:["Fetching Automation data","Finishing up"]})});const y=[{id:"audience",title:"Choose Audience",isValid:()=>!!(u&&u.includeSegmentIds.length>0)},{id:"content",title:"Edit Content",isValid:()=>!!u.action_data?.length&&null!==u.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id},{id:"preview",title:"Preview and Schedule",isValid:()=>!1}];return t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsx("div",{className:"w-full px-6 py-4 border-b border-gray-200 flex items-center gap-4",children:t.jsx("div",{className:"flex-shrink-0",children:o&&t.jsx("img",{src:o,alt:"Logo",className:"w-6 h-6"})})}),t.jsxs("div",{className:"flex-1 flex flex-col px-6 pt-0",children:[t.jsxs("div",{className:"flex gap-8 flex-1",children:[t.jsxs("nav",{className:"hidden lg:block space-y-0 w-50 self-start",children:[t.jsx("div",{className:"mb-5 mt-4",children:t.jsxs("button",{onClick:()=>i(!1),className:"flex items-center gap-1 px-2 py-1.5 bg-gray-100 rounded-full text-gray-700 hover:bg-gray-200 text-sm",children:[t.jsx("span",{children:"←"})," Go back"]})}),t.jsxs("div",{className:"pb-4",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Automations"}),t.jsx("p",{className:"text-gray-600 text-sm",children:"Configure your automations"})]}),y.map(((e,n)=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n===l?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n<l?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(W$,{label:e.title,isActive:n===l,isCompleted:e.isValid()})},e.id)))]}),t.jsx("div",{className:"hidden lg:block h-[100%] w-px bg-gray-200 dark:bg-gray-700"}),t.jsx("div",{className:"flex-1 relative",children:t.jsx("div",{className:"h-[calc(100vh-10rem)] overflow-y-auto overflow-visible",children:t.jsx("div",{className:"min-h-full flex items-center justify-center",children:t.jsxs(nf,{mode:"wait",children:[0===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Choose Audience",content:t.jsx(Xz,{iconDefinitions:r,automation:u})})},"audience"),1===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Edit Content",content:t.jsx(Uz,{automation:u,iconDefinitions:r})})},"content"),2===l&&t.jsx(Ux,{className:"w-full max-w-8xl py-8",children:t.jsx(Jz,{title:"Preview and Schedule",content:t.jsx(Wz,{automation:u,iconDefinitions:r,loading:d})})},"preview")]})})})})]}),t.jsx("div",{className:"absolute bottom-5 right-5 z-5 bg-white/30 backdrop-blur-xl p-2 rounded-xl border border-gray-200/50 shadow-lg",children:t.jsx(G$,{iconDefinitions:r,handleBack:()=>{c(l-1)},handleNext:async()=>{const{canMove:e,errorMessage:t}=await(async()=>{if(0===l)return{canMove:u.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(1===l){const e=u.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};const t=e.action_metadata.communication_group_id,n=await new Promise(((e,n)=>{p(t,{onSuccess:t=>{e(t)},onError:()=>{n("Error fetching communication group")}})}));if(!n||!n.sms_channel_sender_id&&!n.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(n.email_channel_sender_id&&(!n.email_html_body||!n.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(n.sms_channel_sender_id&&!n.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}return{canMove:!0,errorMessage:null}})();if(e)if(2===l)if(s)try{g||await new Promise((e=>setTimeout(e,50)));const e=await s({estimatedEmailRecipients:v.emails,estimatedSmsRecipients:v.phones});!0===e?m():a({title:"Oops!",description:e,variant:"destructive"})}catch(n){a({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else m();else c(l+1);else a({title:"Oops!",description:t??"Please fill out all required fields",variant:"destructive"})},hideBack:0===l,backText:0===l?"Cancel":"Back",nextText:2===l?"Schedule":"Next",backDisabled:0===l,nextDisabled:2===l&&!(u.trigger_metadata.scheduled_at&&new Date(u.trigger_metadata.scheduled_at)>new Date&&Boolean(u.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:2===l?"Save as Draft":void 0,thirdOptionOnClick:()=>{f({status:rw.DRAFT}),i(!1),a({title:"Automation saved as draft",description:"You can continue editing it later"})}})})]})]})},eU=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),tU=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},nU=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),{getCommunicationGroup:u}=vI(),[d,h]=n.useState(null),[f,p]=n.useState(!1),{sendTestCommunication:m,sendError:g,isSendSuccess:v}=wI(),{toast:y}=Dc(),b=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;return n?new Promise(((e,t)=>{u(n,{onSuccess:n=>{switch(r){case"email":e(n.email_channel_sender_id);break;case"sms":e(n.sms_channel_sender_id);break;default:t(new Error(`Unsupported type: ${r}`))}},onError:e=>{t(e||new Error("Error fetching communication group"))}})})):Promise.resolve(null)}),[e.action_data,u,r]);n.useEffect((()=>{(async()=>{try{const e=await b();h(e)}catch(e){h(null)}finally{p(!0)}})()}),[b]),n.useEffect((()=>{v&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[v,r,o,y]),n.useEffect((()=>{g&&(y({title:"Error",description:`Failed to send preview: ${g.message}`,variant:"destructive"}),o(!1))}),[g,y,o]);return f?d?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(y_,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(dw,{onClick:()=>{if(!("email"===r?eU(s):tU(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!d)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);m({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(Vx,{text:["Fetching sender id","Finishing up"]})})},rU=({automation:e,iconDefinitions:r,autoOpenEditPopup:o,showBackButton:i=!1,logoUrl:s,onBeforeSchedule:a})=>{const l=CS(),[c,u]=n.useState(!1),[d,h]=n.useState(!1),[f,p]=n.useState(!1),[m,g]=n.useState(!1),{updateAutomation:v}=ew(e.id),{invalidateAutomation:y}=Xx(e.id);n.useEffect((()=>{o&&u(!0)}),[o]);return t.jsxs(t.Fragment,{children:[t.jsx(d_,{open:c,onOpenChange:e=>{u(e),!1===e&&y()},children:t.jsxs(p_,{className:"max-w-screen min-h-screen max-h-screen overflow-hidden rounded-none sm:rounded-none",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Edit Automation"}),t.jsx(v_,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(Zz,{automationId:e.id,iconDefinitions:r,setOpenEditAutomationPopup:u,logoUrl:s,onBeforeSchedule:a})]})}),t.jsx(d_,{open:f,onOpenChange:p,children:t.jsxs(p_,{className:"sm:max-w-[425px]",children:[t.jsx(g_,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(v_,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(dw,{variant:"outline",onClick:()=>p(!1),children:"Keep Running"}),t.jsx(dw,{variant:"destructive",onClick:()=>{v({status:rw.DEACTIVATED}),p(!1)},children:"Yes, Cancel Automation"})]})]})}),t.jsx(d_,{open:d,onOpenChange:h,children:t.jsxs(p_,{className:"",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Send Preview SMS"}),t.jsx(v_,{children:"Send a preview SMS to the automation."})]}),t.jsx(nU,{automation:e,type:"sms",setOpenSendPreviewPopup:h,iconDefinitions:r})]})}),t.jsx(d_,{open:m,onOpenChange:g,children:t.jsxs(p_,{className:"",children:[t.jsxs(u_,{children:[t.jsx(g_,{children:"Send Preview Email"}),t.jsx(v_,{children:"Send a preview email to the automation."})]}),t.jsx(nU,{automation:e,type:"email",setOpenSendPreviewPopup:g,iconDefinitions:r})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200",children:[i&&t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(dw,{onClick:()=>l(-1),children:"Back"})})}),t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(__,{status:e.status})]}),t.jsx("div",{className:"text-sm text-gray-600",children:"View and edit this email campaign"})]}),t.jsxs(R$,{modal:!1,children:[t.jsx(A$,{asChild:!0,children:t.jsxs(dw,{children:["Actions",t.jsx(r.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(L$,{children:[e.status===rw.DRAFT&&t.jsx(I$,{onClick:()=>u(!0),children:"Edit"}),e.status===rw.ACTIVE&&t.jsx(I$,{onClick:()=>{v({status:rw.DRAFT})},children:"Convert to Draft"}),e.status!==rw.COMPLETED&&e.status!==rw.FAILED&&e.status!==rw.DEACTIVATED&&t.jsx(I$,{onClick:()=>p(!0),children:"Cancel"}),t.jsx(I$,{onClick:()=>h(!0),children:"Send Preview SMS"}),t.jsx(I$,{onClick:()=>g(!0),children:"Send Preview Email"})]})]})]}),t.jsxs("div",{className:"grid grid-cols-2 gap-x-8 gap-y-4",children:[t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Name"}),t.jsx("div",{className:"font-medium",children:e.name})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:Zj(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsx("div",{children:e.trigger_type===nw.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]})}),t.jsx("div",{children:e.trigger_type===nw.ONE_TIME&&e.trigger_metadata?.scheduled_at&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:Zj(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})})]})]})]})},oU=({iconDefinitions:e,autoOpenEditPopup:n,automationId:r,showBackButton:o=!1,logoUrl:s,onBeforeSchedule:a})=>{const l=iw(e),c=function(){let{matches:e}=i.useContext(vS),t=e[e.length-1];return t?t.params:{}}(),[u]=iC(),d=r||c?.automationId||u.get("automationId"),h=n||u.get("autoOpenEditPopup"),f="true"===u.get("showBackButton")||o,p=iw(l),{automation:m,isFetching:g,isLoading:v,fetchError:y}=Xx(d||"");return d?m||!g&&!v?y?t.jsxs("div",{children:["Error: ",y.message]}):m?t.jsxs("div",{className:vw,children:[t.jsx(rU,{automation:m,iconDefinitions:p,autoOpenEditPopup:h,showBackButton:f,logoUrl:s,onBeforeSchedule:a}),t.jsx("div",{className:"pt-4",children:t.jsxs(dI,{defaultValue:"content",children:[t.jsxs(hI,{children:[t.jsx(fI,{value:"content",children:"Content"}),t.jsx(fI,{value:"recipients",children:"Recipients"})]}),t.jsx(pI,{value:"recipients",children:t.jsx(_I,{automationId:d,iconDefinitions:p})}),t.jsx(pI,{value:"content",children:t.jsx(PI,{automationId:d,iconDefinitions:p})})]})})]}):t.jsx("div",{children:"No automation found"}):t.jsx("div",{className:vw,children:t.jsx(Vx,{text:["Fetching Automation data","Finishing up"]})}):t.jsx("div",{children:"Invalid automation ID"})};Object.values(Object.assign({}));var iU=e=>null!=e;var sU=e=>"function"!=typeof e||e.length?e:e(),aU=e=>Array.isArray(e)?e:e?[e]:[];var lU=$e;var cU,uU=function(e){const[t,n]=Ne(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=Ne(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(EQ){return r(EQ,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&Fe((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(EQ){r(EQ,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),$e((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),$e((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(EQ){r(EQ,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(EQ){r(EQ,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(EQ){r(EQ,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(EQ){r(EQ,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(EQ){r(EQ,`Error getting all values from ${e.name}`)}}})),t}}]},dU=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},hU=("function"==typeof(cU={_cookies:[globalThis.document,"cookie"],getItem:e=>hU._cookies[0][hU._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=hU.getItem(e);hU._cookies[0][hU._cookies[1]]=`${e}=${t}${dU(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:hU});window.dispatchEvent(o)},removeItem:e=>{hU._cookies[0][hU._cookies[1]]=`${e}=deleted${dU({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return hU._cookies[0][hU._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return hU._cookies[0][hU._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(cU.clear=()=>{let e;for(;e=cU.key(0);)cU.removeItem(e)}),cU),fU=796,pU="bottom",mU="system",gU=Object.keys(Jn)[0],vU=Object.keys(tr)[0],yU=Ve({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function bU(){return Ke(yU)}var xU=Ve(void 0),wU=e=>{const[t,n]=Ne(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[Ot]){for(let t of e[Ot].keys())e.removeEventListener(t,Wt);delete e[Ot]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(bU().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(CQ){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),Lt(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};Oe((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),Oe((()=>{const e=(bU().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(bU().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),$e((()=>{t.disconnect()}))}}));const i=Re((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return ut(xU.Provider,{value:i,get children(){return e.children}})},SU=()=>Re((()=>{const e=Ke(xU);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),CU=Ve((()=>"dark"));function kU(){return Ke(CU)}var EU={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},jU=Object.keys(EU).join("|"),TU=new RegExp(jU,"g");var PU=7,_U=6,NU=5,DU=4,MU=3,OU=2,RU=1,AU=0;function LU(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:RU,!n.accessors){const r=IU(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=zU(o),s=$U(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:AU,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=IU(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=RU?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function IU(e,t,n){return e=FU(e,n),(t=FU(t,n)).length>e.length?AU:e===t?PU:(e=e.toLowerCase())===(t=t.toLowerCase())?_U:e.startsWith(t)?NU:e.includes(` ${t}`)?DU:e.includes(t)?MU:1===t.length?AU:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?OU:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return RU+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return AU;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return AU}return i(r-s)}(e,t)}function FU(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(TU,(e=>EU[e]))),e}function $U(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var qU={maxRanking:1/0,minRanking:-1/0};function zU(e){return"function"==typeof e?qU:{...qU,...e}}var UU={data:""},BU=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,VU=/\/\*[^]*?\*\/| +/g,KU=/\n+/g,HU=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?HU(s,i):i+"{"+HU(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=HU(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=HU.p?HU.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},WU={},GU=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+GU(e[n]);return t}return e};function YU(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=GU(e),s=WU[i]||(WU[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!WU[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=BU.exec(e.replace(VU,""));)t[4]?r.shift():t[3]?(n=t[3].replace(KU," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(KU," ").trim();return r[0]})(e);WU[s]=HU(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&WU.g?WU.g:null;return n&&(WU.g=WU[s]),l=WU[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":HU(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||UU),t.g,t.o,t.k);var r}function QU(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=QU(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function XU(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=QU(e))&&(r&&(r+=" "),r+=t);return r}function JU(e,t){const n=Le(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ne([],{equals:!1}),[l]=[Ue,ze],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return Re((t=>{const n=s(),a=e();if(Le(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return Le((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let h=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),h&&o!==n[r]&&(h=!1)}return!l.length&&h?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function ZU(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}YU.bind({g:1}),YU.bind({k:1});var eB=e=>e instanceof Element;function tB(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return tB(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=tB(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function nB(e,t=eB,n=eB){const r=Re(e),o=Re((()=>tB(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function rB(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function oB(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),rB((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function iB(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),rB((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var sB=e=>{const t=function(e){return Re((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return JU(nB((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)oB(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)iB(s,e,t,(()=>o([t])))}})},aB=Symbol("fallback");function lB(e){for(const t of e)t.dispose()}function cB(e){const{by:t}=e;return Re(function(e,t,n,r={}){const o=new Map;return $e((()=>lB(o.values()))),()=>{const n=e()||[];return Le((()=>{if(!n.length)return lB(o.values()),o.clear(),r.fallback?[_e((e=>(o.set(aB,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(aB);if(!o.size||s){s?.dispose(),o.delete(aB);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){_e((s=>{const[a,l]=Ne(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ne(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function uB(e,t,n,r){const o=()=>{aU(sU(e)).forEach((e=>{e&&aU(sU(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),lU(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?Oe(o):Me(o)}function dB(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return $e(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);Oe((t=>{const n=aU(sU(e)).filter(iU);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var hB=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function fB(e){const t={};let n;for(;n=hB.exec(e);)t[n[1]]=n[2];return t}function pB(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=fB(e)}else"string"==typeof t&&(t=fB(t));return{...e,...t}}function mB(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function gB(e){return"[object String]"===Object.prototype.toString.call(e)}function vB(e){return t=>`${e()}-${t}`}function yB(e,t){return!!e&&(e===t||e.contains(t))}function bB(e,t=!1){const{activeElement:n}=xB(e);if(!n?.nodeName)return null;if(wB(n)&&n.contentDocument)return bB(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=xB(n).getElementById(e);if(t)return t}}return n}function xB(e){return e?e.ownerDocument||e:document}function wB(e){return"IFRAME"===e.tagName}var SB=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(SB||{});function CB(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function kB(){return CB(/^Mac/i)}function EB(){return CB(/^iPhone/i)||CB(/^iPad/i)||kB()&&navigator.maxTouchPoints>1}function jB(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function TB(e){return t=>{for(const n of e)jB(t,n)}}function PB(e){return kB()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function _B(e){if(e)if(function(){if(null==NB){NB=!1;try{document.createElement("div").focus({get preventScroll(){return NB=!0,!0}})}catch(CQ){}}return NB}())e.focus({preventScroll:!0});else{const t=function(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var NB=null;var DB=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],MB=[...DB,'[tabindex]:not([tabindex="-1"]):not([disabled])'],OB=DB.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",RB=MB.join(':not([hidden]):not([tabindex="-1"]),');function AB(e,t){const n=Array.from(e.querySelectorAll(OB)).filter(LB);return t&&LB(e)&&n.unshift(e),n.forEach(((e,t)=>{if(wB(e)&&e.contentDocument){const r=AB(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function LB(e){return IB(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function IB(e){return e.matches(OB)&&FB(e)}function FB(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||FB(e.parentElement,e))}function $B(e){for(;e&&!qB(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function qB(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function zB(){}function UB(e,t){return mt(e,t)}var BB=new Map,VB=new Set;function KB(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=BB.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),BB.delete(t.target)),0===BB.size)){for(const e of VB)e();VB.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=BB.get(t.target);n||(n=new Set,BB.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function HB(e,t){const n=WB(e,t,"left"),r=WB(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function WB(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}"undefined"!=typeof document&&("loading"!==document.readyState?KB():document.addEventListener("DOMContentLoaded",KB));var GB={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function YB(e){return t=>(e(t),()=>e(void 0))}function QB(e,t){const[n,r]=Ne(XB(t?.()));return Oe((()=>{r(e()?.tagName.toLowerCase()||XB(t?.()))})),n}function XB(e){return gB(e)?e:void 0}function JB(e){const[t,n]=gt(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return ut(en,mt(n,{get component(){return t.as}}))}var ZB=["id","name","validationState","required","disabled","readOnly"];var eV=Ve();function tV(){const e=Ke(eV);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function nV(e){const t=tV(),n=UB({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(JB,mt({as:"div"},(()=>t.dataset()),n))}function rV(e){const t=tV(),n=UB({id:t.generateId("error-message")},e),[r,o]=gt(n,["forceMount"]),i=()=>"invalid"===t.validationState();return Oe((()=>{i()&&$e(t.registerErrorMessage(o.id))})),ut(Ct,{get when(){return r.forceMount||i()},get children(){return ut(JB,mt({as:"div"},(()=>t.dataset()),o))}})}function oV(e){let t;const n=tV(),r=UB({id:n.generateId("label")},e),[o,i]=gt(r,["ref"]),s=QB((()=>t),(()=>"label"));return Oe((()=>$e(n.registerLabel(i.id)))),ut(JB,mt({as:"label",ref(e){const n=ZU((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return Re((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function iV(e,t){Oe(Ie(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),$e((()=>{n.removeEventListener("reset",t)})))})))}function sV(e){const[t,n]=Ne(e.defaultValue?.()),r=Re((()=>void 0!==e.value?.())),o=Re((()=>r()?e.value?.():t()));return[o,t=>{Le((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function aV(e){const[t,n]=sV(e);return[()=>t()??!1,n]}var lV=Object.defineProperty,cV=(e,t)=>{for(var n in t)lV(e,n,{get:t[n],enumerable:!0})},uV=Ve();function dV(){return Ke(uV)}function hV(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function fV(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?hV(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function pV(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){Oe((()=>{const n=setTimeout((()=>{fV(e(),t)}));$e((()=>clearTimeout(n)))}))}(e,t);let n=[];Oe((()=>{const r=function(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return xB(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&fV(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}$e((()=>o.disconnect()))}))}function mV(e={}){const[t,n]=function(e){const[t,n]=sV(e);return[()=>t()??[],n]}({value:()=>sU(e.items),onChange:t=>e.onItemsChange?.(t)});pV(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&hV(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>ut(uV.Provider,{value:{registerItem:r},get children(){return e.children}})}}function gV(e){const t=function(){const e=dV();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=UB({shouldRegisterItem:!0},e);Oe((()=>{if(!n.shouldRegisterItem)return;$e(t.registerItem(n.getItem()))}))}function vV(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=gB(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=gB(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(gB(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return gB(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(gB(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=vV({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function yV(e,t=[]){return Re((()=>{const n=vV({dataSource:sU(e.dataSource),getKey:sU(e.getKey),getTextValue:sU(e.getTextValue),getDisabled:sU(e.getDisabled),getSectionChildren:sU(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var bV=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),xV=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function wV(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return bV.has(t)}const t=e.split("-")[0];return xV.has(t)}(e)?"rtl":"ltr"}function SV(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:wV(e)}}var CV=SV(),kV=new Set;function EV(){CV=SV();for(const e of kV)e(CV)}var jV=Ve();function TV(){const e=function(){const[e,t]=Ne(CV),n=Re((()=>e()));return Fe((()=>{0===kV.size&&window.addEventListener("languagechange",EV),kV.add(t),$e((()=>{kV.delete(t),0===kV.size&&window.removeEventListener("languagechange",EV)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return Ke(jV)||e}var PV=new Map;var _V=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function NV(e){return kB()||EB()?e.altKey:e.ctrlKey}function DV(e){return kB()?e.metaKey:e.ctrlKey}function MV(e){return new _V(e)}function OV(e){const t=UB({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ne(!1),[o,i]=Ne(),s=Re((()=>{const e=sU(t.selectedKeys);return null!=e?MV(e):e})),a=Re((()=>{const e=sU(t.defaultSelectedKeys);return null!=e?MV(e):new _V})),[l,c]=function(e){const[t,n]=sV(e);return[()=>t()??new _V,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ne(sU(t.selectionBehavior));return Oe((()=>{const e=l();"replace"===sU(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),Oe((()=>{d(sU(t.selectionBehavior)??"toggle")})),{selectionMode:()=>sU(t.selectionMode),disallowEmptySelection:()=>sU(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!sU(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function RV(e,t,n){const r=mt({selectOnFocus:()=>"replace"===sU(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=TV();let s={top:0,left:0};uB((()=>sU(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=Ne(""),[r,o]=Ne(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(sU(e.isDisabled))return;const s=sU(e.keyboardDelegate),a=sU(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>sU(r.disallowTypeAhead),keyboardDelegate:()=>sU(r.keyboardDelegate),selectionManager:()=>sU(r.selectionManager)}),l=()=>sU(r.orientation)??"vertical",c=()=>{const e=sU(r.autoFocus);if(!e)return;const n=sU(r.selectionManager),o=sU(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!sU(r.shouldUseVirtualFocus)&&_B(a)};Fe((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),Oe(Ie([o,()=>sU(r.isVirtualized),()=>sU(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&HB(t,e)}})));return{tabIndex:Re((()=>{if(!sU(r.shouldUseVirtualFocus))return null==sU(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{jB(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=sU(r.selectionManager),s=sU(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!NV(e)&&o.replaceSelection(t))},u=sU(r.keyboardDelegate),d=sU(r.shouldFocusWrap),h=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=h?u.getKeyBelow(h):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=h?u.getKeyAbove(h):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(h)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyLeftOf(h):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=h?u.getKeyRightOf(h):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(h,DV(e));null!=t&&(o.setFocusedKey(t),DV(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(h,DV(e));null!=t&&(o.setFocusedKey(t),DV(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=h){e.preventDefault();c(u.getKeyPageBelow(h))}break;case"PageUp":if(u.getKeyPageAbove&&null!=h){e.preventDefault();c(u.getKeyPageAbove(h))}break;case"a":DV(e)&&"multiple"===o.selectionMode()&&!0!==sU(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),sU(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!sU(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?RB:OB,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&FB(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&_B(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=sU(r.selectionManager),n=sU(r.keyboardDelegate),i=sU(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!sU(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(_B(n),HB(e,n))}}},onFocusOut:e=>{const t=sU(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function AV(e,t){const n=()=>sU(e.selectionManager),r=()=>sU(e.key),o=()=>sU(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||DV(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>sU(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=Re((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=Re((()=>sU(e.virtualized)?void 0:r()));return Oe(Ie([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():_B(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||sU(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&sU(e.shouldSelectOnPressUp)&&sU(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(sU(e.shouldSelectOnPressUp)&&!sU(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(NV(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var LV=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new _V(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new _V(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new _V([t],t,t):new _V;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new _V;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new _V)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},IV=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var FV,$V=e=>"function"==typeof e?e():e,qV=e=>{const t=Re((()=>{const t=$V(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ne($V(e.show)?"present":"hidden");let i="none";return Oe((r=>{const s=$V(e.show);return Le((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),Oe((()=>{const t=$V(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),$e((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},zV="data-kb-top-layer",UV=!1,BV=[];function VV(e){return BV.findIndex((t=>t.node===e))}function KV(){return BV.filter((e=>e.isPointerBlocking))}function HV(){return KV().length>0}function WV(e){const t=VV([...KV()].slice(-1)[0]?.node);return VV(e)<t}var GV={layers:BV,isTopMostLayer:function(e){return BV[BV.length-1].node===e},hasPointerBlockingLayer:HV,isBelowPointerBlockingLayer:WV,addLayer:function(e){BV.push(e)},removeLayer:function(e){const t=VV(e);t<0||BV.splice(t,1)},indexOf:VV,find:function(e){return BV[VV(e)]},assignPointerEventToLayers:function(){for(const{node:e}of BV)e.style.pointerEvents=WV(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(HV()&&!UV){const t=xB(e);FV=document.body.style.pointerEvents,t.body.style.pointerEvents="none",UV=!0}},restoreBodyPointerEvents:function(e){if(HV())return;const t=xB(e);t.body.style.pointerEvents=FV,0===t.body.style.length&&t.body.removeAttribute("style"),UV=!1}};cV({},{Button:()=>XV,Root:()=>QV});var YV=["button","color","file","image","reset","submit"];function QV(e){let t;const n=UB({type:"button"},e),[r,o]=gt(n,["ref","type","disabled"]),i=QB((()=>t),(()=>"button")),s=Re((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==YV.indexOf(e.type)}({tagName:e,type:r.type})})),a=Re((()=>"input"===i())),l=Re((()=>"a"===i()&&null!=t?.getAttribute("href")));return ut(JB,mt({as:"button",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var XV=QV,JV=["top","right","bottom","left"],ZV=Math.min,eK=Math.max,tK=Math.round,nK=Math.floor,rK=e=>({x:e,y:e}),oK={left:"right",right:"left",bottom:"top",top:"bottom"},iK={start:"end",end:"start"};function sK(e,t,n){return eK(e,ZV(t,n))}function aK(e,t){return"function"==typeof e?e(t):e}function lK(e){return e.split("-")[0]}function cK(e){return e.split("-")[1]}function uK(e){return"x"===e?"y":"x"}function dK(e){return"y"===e?"height":"width"}function hK(e){return["top","bottom"].includes(lK(e))?"y":"x"}function fK(e){return uK(hK(e))}function pK(e){return e.replace(/start|end/g,(e=>iK[e]))}function mK(e){return e.replace(/left|right|bottom|top/g,(e=>oK[e]))}function gK(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 vK(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 yK(e,t,n){let{reference:r,floating:o}=e;const i=hK(t),s=fK(t),a=dK(s),l=lK(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=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(cK(t)){case"start":f[s]-=h*(n&&c?-1:1);break;case"end":f[s]+=h*(n&&c?-1:1)}return f}async function bK(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:h=!1,padding:f=0}=aK(t,e),p=gK(f),m=a[h?"floating"===d?"reference":"floating":d],g=vK(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})),v="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=vK(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:y,strategy:l}):v);return{top:(g.top-x.top+p.top)/b.y,bottom:(x.bottom-g.bottom+p.bottom)/b.y,left:(g.left-x.left+p.left)/b.x,right:(x.right-g.right+p.right)/b.x}}function xK(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wK(e){return JV.some((t=>e[t]>=0))}function SK(e){return EK(e)?(e.nodeName||"").toLowerCase():"#document"}function CK(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function kK(e){var t;return null==(t=(EK(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function EK(e){return e instanceof Node||e instanceof CK(e).Node}function jK(e){return e instanceof Element||e instanceof CK(e).Element}function TK(e){return e instanceof HTMLElement||e instanceof CK(e).HTMLElement}function PK(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof CK(e).ShadowRoot)}function _K(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=AK(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function NK(e){return["table","td","th"].includes(SK(e))}function DK(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(CQ){return!1}}))}function MK(e){const t=OK(),n=jK(e)?AK(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 OK(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function RK(e){return["html","body","#document"].includes(SK(e))}function AK(e){return CK(e).getComputedStyle(e)}function LK(e){return jK(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function IK(e){if("html"===SK(e))return e;const t=e.assignedSlot||e.parentNode||PK(e)&&e.host||kK(e);return PK(t)?t.host:t}function FK(e){const t=IK(e);return RK(t)?e.ownerDocument?e.ownerDocument.body:e.body:TK(t)&&_K(t)?t:FK(t)}function $K(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=FK(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=CK(o);return i?t.concat(s,s.visualViewport||[],_K(o)?o:[],s.frameElement&&n?$K(s.frameElement):[]):t.concat(o,$K(o,[],n))}function qK(e){const t=AK(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=TK(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=tK(n)!==i||tK(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function zK(e){return jK(e)?e:e.contextElement}function UK(e){const t=zK(e);if(!TK(t))return rK(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qK(t);let s=(i?tK(n.width):n.width)/r,a=(i?tK(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var BK=rK(0);function VK(e){const t=CK(e);return OK()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:BK}function KK(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=zK(e);let s=rK(1);t&&(r?jK(r)&&(s=UK(r)):s=UK(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==CK(e))&&t}(i,n,r)?VK(i):rK(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=CK(i),t=r&&jK(r)?CK(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=UK(o),t=o.getBoundingClientRect(),r=AK(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=CK(o),o=n.frameElement}}return vK({width:u,height:d,x:l,y:c})}function HK(e){return KK(kK(e)).left+LK(e).scrollLeft}function WK(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=CK(e),r=kK(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=OK();(!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=kK(e),n=LK(e),r=e.ownerDocument.body,o=eK(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=eK(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+HK(e);const a=-n.scrollTop;return"rtl"===AK(r).direction&&(s+=eK(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(kK(e));else if(jK(t))r=function(e,t){const n=KK(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=TK(e)?UK(e):rK(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=VK(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return vK(r)}function GK(e,t){const n=IK(e);return!(n===t||!jK(n)||RK(n))&&("fixed"===AK(n).position||GK(n,t))}function YK(e,t,n){const r=TK(t),o=kK(t),i="fixed"===n,s=KK(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=rK(0);if(r||!r&&!i)if(("body"!==SK(t)||_K(o))&&(a=LK(t)),r){const e=KK(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=HK(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function QK(e){return"static"===AK(e).position}function XK(e,t){return TK(e)&&"fixed"!==AK(e).position?t?t(e):e.offsetParent:null}function JK(e,t){const n=CK(e);if(DK(e))return n;if(!TK(e)){let t=IK(e);for(;t&&!RK(t);){if(jK(t)&&!QK(t))return t;t=IK(t)}return n}let r=XK(e,t);for(;r&&NK(r)&&QK(r);)r=XK(r,t);return r&&RK(r)&&QK(r)&&!MK(r)?n:r||function(e){let t=IK(e);for(;TK(t)&&!RK(t);){if(MK(t))return t;if(DK(t))return null;t=IK(t)}return null}(e)||n}var ZK={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=kK(r),a=!!t&&DK(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=rK(1);const u=rK(0),d=TK(r);if((d||!d&&!i)&&(("body"!==SK(r)||_K(s))&&(l=LK(r)),TK(r))){const e=KK(r);c=UK(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:kK,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?DK(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=$K(e,[],!1).filter((e=>jK(e)&&"body"!==SK(e))),o=null;const i="fixed"===AK(e).position;let s=i?IK(e):e;for(;jK(s)&&!RK(s);){const t=AK(s),n=MK(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||_K(s)&&!n&&GK(e,s))?r=r.filter((e=>e!==s)):o=t,s=IK(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=WK(t,n,o);return e.top=eK(r.top,e.top),e.right=ZV(r.right,e.right),e.bottom=ZV(r.bottom,e.bottom),e.left=eK(r.left,e.left),e}),WK(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:JK,getElementRects:async function(e){const t=this.getOffsetParent||JK,n=this.getDimensions,r=await n(e.floating);return{reference:YK(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}=qK(e);return{width:t,height:n}},getScale:UK,isElement:jK,isRTL:function(e){return"rtl"===AK(e).direction}};function eH(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=zK(e),u=o||i?[...c?$K(c):[],...$K(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=kK(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:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f={rootMargin:-nK(u)+"px "+-nK(o.clientWidth-(c+d))+"px "+-nK(o.clientHeight-(u+h))+"px "+-nK(c)+"px",threshold:eK(0,ZV(1,l))||1};let p=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!p)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(CQ){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let h,f=-1,p=null;s&&(p=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=p)||e.observe(t)}))),n()})),c&&!l&&p.observe(c),p.observe(t));let m=l?KK(e):null;return l&&function t(){const r=KK(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var tH=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=lK(n),a=cK(n),l="y"===hK(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=aK(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof p&&(f="end"===a?-1*p:p),l?{x:f*u,y:h*c}:{x:h*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}}}}},nH=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}=aK(e,t),c={x:n,y:r},u=await bK(t,l),d=hK(lK(o)),h=uK(d);let f=c[h],p=c[d];if(i){f=sK(f+u["y"===h?"top":"left"],f,f-u["y"===h?"bottom":"right"])}if(s){p=sK(p+u["y"===d?"top":"left"],p,p-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[h]:f,[d]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},rH=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:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=aK(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=lK(o),y=hK(a),b=lK(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=h||(b||!m?[mK(a)]:function(e){const t=mK(e);return[pK(e),t,pK(t)]}(a)),S="none"!==p;!h&&S&&w.push(...function(e,t,n,r){const o=cK(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[]}}(lK(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(pK)))),i}(a,m,p,x));const C=[a,...w],k=await bK(t,g),E=[];let j=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=cK(e),o=fK(e),i=dK(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=mK(s)),[s,mK(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let n=null==(P=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(f){case"bestFit":{var _;const e=null==(_=j.filter((e=>{if(S){const t=hK(e.placement);return t===y||"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:_[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},oH=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=aK(e,t),l=await bK(t,a),c=lK(n),u=cK(n),d="y"===hK(n),{width:h,height:f}=r.floating;let p,m;"top"===c||"bottom"===c?(p=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,p="end"===u?"top":"bottom");const g=f-l.top-l.bottom,v=h-l.left-l.right,y=ZV(f-l[p],g),b=ZV(h-l[m],v),x=!t.middlewareData.shift;let w=y,S=b;if(d?S=u||x?ZV(b,v):v:w=u||x?ZV(y,g):g,x&&!u){const e=eK(l.left,0),t=eK(l.right,0),n=eK(l.top,0),r=eK(l.bottom,0);d?S=h-2*(0!==e||0!==t?e+t:eK(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:eK(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},iH=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=aK(e,t);switch(r){case"referenceHidden":{const e=xK(await bK(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:wK(e)}}}case"escaped":{const e=xK(await bK(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:wK(e)}}}default:return{}}}}},sH=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}=aK(e,t)||{};if(null==c)return{};const d=gK(u),h={x:n,y:r},f=fK(o),p=dK(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[f]-h[f]-i.floating[p],w=h[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[p]);const k=x/2-w/2,E=C/2-m[p]/2-1,j=ZV(d[v],E),T=ZV(d[y],E),P=j,_=C-m[p]-T,N=C/2-m[p]/2+k,D=sK(P,N,_),M=!l.arrow&&null!=cK(o)&&N!==D&&i.reference[p]/2-(N<P?j:T)-m[p]/2<0,O=M?N<P?N-P:N-_:0;return{[f]:h[f]+O,data:{[f]:D,centerOffset:N-D-O,...M&&{alignmentOffset:O}},reset:M}}}),aH=(e,t,n)=>{const r={platform:ZK,...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}=yK(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:v,data:y,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[n]:{...f[n],...y}},b&&p<=50&&(p++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=yK(c,h,l))),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},lH=Ve();function cH(){const e=Ke(lH);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var uH=At('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),dH={top:180,right:-90,bottom:0,left:90};function hH(e){const t=cH(),n=UB({size:30},e),[r,o]=gt(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ne();return Oe((()=>{const t=e();var r;t&&n((r=t,xB(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return ut(JB,mt({as:"div",ref(e){const n=ZU(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return pB({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=uH(),t=e.firstChild;return Me((()=>It(t,"transform",`rotate(${dH[i()]} 15 15) translate(0 2)`))),e}}))}function fH(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function pH(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var mH={top:"bottom",right:"left",bottom:"top",left:"right"};var gH=Object.assign((function(e){const t=UB({getAnchorRect:e=>e?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?fH(t):e?e.getBoundingClientRect():fH()}};var e,n},{direction:c}=TV();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[tH((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(pH))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(rH({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(nH({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(oH({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(iH({padding:t.detachedPadding})),i&&d.push(sH({element:i,padding:t.arrowPadding}));const h=await aH(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...ZK,isRTL:()=>"rtl"===c()}});if(a(h.placement),t.onCurrentPlacementChange?.(h.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=mH[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(h.placement,c()));const f=Math.round(h.x),p=Math.round(h.y);let m;if(t.hideWhenDetached&&(m=h.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${p}px, 0)`,visibility:m}),i&&h.middlewareData.arrow){const{x:e,y:t}=h.middlewareData.arrow,n=h.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return Oe((()=>{const e=l(),t=n();if(!e||!t)return;$e(eH(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),Oe((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),ut(lH.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:hH,Context:lH,usePopperContext:cH,Positioner:function(e){const t=cH(),[n,r]=gt(e,["ref","style"]);return ut(JB,mt({as:"div",ref(e){const r=ZU(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return pB({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var vH="interactOutside.pointerDownOutside",yH="interactOutside.focusOutside";var bH=Ve();function xH(e){let t;const n=Ke(bH),[r,o]=gt(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=zB;const o=()=>xB(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${zV}]`)&&!!yB(o(),r)&&!yB(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=TB([i,a]);r.addEventListener(vH,o,{once:!0});const s=new CustomEvent(vH,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||PB(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=TB([s,a]);r.addEventListener(yH,o,{once:!0});const i=new CustomEvent(yH,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};Oe((()=>{sU(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),$e((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>yB(t(),e)))||[...i].some((t=>yB(t,e)))),onPointerDownOutside:e=>{t&&!GV.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||GV.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===SB.Escape&&e.onEscapeKeyDown?.(t)};Oe((()=>{if(sU(e.isDisabled))return;const n=e.ownerDocument?.()??xB();n.addEventListener("keydown",t),$e((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>xB(t),onEscapeKeyDown:e=>{t&&GV.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),Fe((()=>{if(!t)return;GV.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);GV.assignPointerEventToLayers(),GV.disableBodyPointerEvents(t),$e((()=>{t&&(GV.removeLayer(t),e?.(),GV.assignPointerEventToLayers(),GV.restoreBodyPointerEvents(t))}))})),Oe(Ie([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=GV.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,GV.assignPointerEventToLayers()),t&&GV.disableBodyPointerEvents(e),$e((()=>{GV.restoreBodyPointerEvents(e)}))}),{defer:!0}));return ut(bH.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function wH(e={}){const[t,n]=aV({value:()=>sU(e.open),defaultValue:()=>!!sU(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var SH={};cV(SH,{Description:()=>nV,ErrorMessage:()=>rV,Item:()=>TH,ItemControl:()=>PH,ItemDescription:()=>_H,ItemIndicator:()=>NH,ItemInput:()=>DH,ItemLabel:()=>MH,Label:()=>OH,RadioGroup:()=>AH,Root:()=>RH});var CH=Ve();function kH(){const e=Ke(CH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var EH=Ve();function jH(){const e=Ke(EH);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function TH(e){const t=tV(),n=kH(),r=UB({id:`${t.generateId("item")}-${bt()}`},e),[o,i]=gt(r,["value","disabled","onPointerDown"]),[s,a]=Ne(),[l,c]=Ne(),[u,d]=Ne(),[h,f]=Ne(),[p,m]=Ne(!1),g=Re((()=>n.isSelectedValue(o.value))),v=Re((()=>o.disabled||t.isDisabled()||!1)),y=e=>{jB(e,o.onPointerDown),p()&&e.preventDefault()},b=Re((()=>({...t.dataset(),"data-disabled":v()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:v,inputId:s,labelId:l,descriptionId:u,inputRef:h,select:()=>n.setSelectedValue(o.value),generateId:vB((()=>i.id)),registerInput:YB(a),registerLabel:YB(c),registerDescription:YB(d),setIsFocused:m,setInputRef:f};return ut(EH.Provider,{value:x,get children(){return ut(JB,mt({as:"div",role:"group",onPointerDown:y},b,i))}})}function PH(e){const t=jH(),n=UB({id:t.generateId("control")},e),[r,o]=gt(n,["onClick","onKeyDown"]);return ut(JB,mt({as:"div",onClick:e=>{jB(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{jB(e,r.onKeyDown),e.key===SB.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function _H(e){const t=jH(),n=UB({id:t.generateId("description")},e);return Oe((()=>$e(t.registerDescription(n.id)))),ut(JB,mt({as:"div"},(()=>t.dataset()),n))}function NH(e){const t=jH(),n=UB({id:t.generateId("indicator")},e),[r,o]=gt(n,["ref","forceMount"]),[i,s]=Ne(),{present:a}=qV({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return ut(Ct,{get when(){return a()},get children(){return ut(JB,mt({as:"div",ref(e){const t=ZU(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function DH(e){const t=tV(),n=kH(),r=jH(),o=UB({id:r.generateId("input")},e),[i,s]=gt(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ne(!1);return Oe(Ie([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),Oe((()=>$e(r.registerInput(s.id)))),ut(JB,mt({as:"input",ref(e){const t=ZU(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return pB({...GB},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(jB(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{jB(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{jB(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function MH(e){const t=jH(),n=UB({id:t.generateId("label")},e);return Oe((()=>$e(t.registerLabel(n.id)))),ut(JB,mt({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function OH(e){return ut(oV,mt({as:"span"},e))}function RH(e){let t;const n=UB({id:`radiogroup-${bt()}`,orientation:"vertical"},e),[r,o,i]=gt(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],ZB),[s,a]=sV({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=UB({id:`form-control-${bt()}`},e),[n,r]=Ne(),[o,i]=Ne(),[s,a]=Ne(),[l,c]=Ne();return{formControlContext:{name:()=>sU(t.name)??sU(t.id),dataset:Re((()=>({"data-valid":"valid"===sU(t.validationState)?"":void 0,"data-invalid":"invalid"===sU(t.validationState)?"":void 0,"data-required":sU(t.required)?"":void 0,"data-disabled":sU(t.disabled)?"":void 0,"data-readonly":sU(t.readOnly)?"":void 0}))),validationState:()=>sU(t.validationState),isRequired:()=>sU(t.required),isDisabled:()=>sU(t.disabled),isReadOnly:()=>sU(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:vB((()=>sU(t.id))),registerLabel:YB(r),registerField:YB(i),registerDescription:YB(a),registerErrorMessage:YB(c)}}}(o);iV((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return ut(eV.Provider,{value:l,get children(){return ut(CH.Provider,{value:d,get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return sU(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy(sU(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var AH=Object.assign(RH,{Description:nV,ErrorMessage:rV,Item:TH,ItemControl:PH,ItemDescription:_H,ItemIndicator:NH,ItemInput:DH,ItemLabel:MH,Label:OH}),LH=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function IH(e,t,n){const r=function(e){const{locale:t}=TV(),n=Re((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return Re((()=>{const r=n();let o;return PV.has(r)&&(o=PV.get(r)),o||(o=new Intl.Collator(t(),e),PV.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return RV({selectionManager:()=>sU(e.selectionManager),keyboardDelegate:Re((()=>{const n=sU(e.keyboardDelegate);return n||new LH(e.collection,t,r)})),autoFocus:()=>sU(e.autoFocus),deferAutoFocus:()=>sU(e.deferAutoFocus),shouldFocusWrap:()=>sU(e.shouldFocusWrap),disallowEmptySelection:()=>sU(e.disallowEmptySelection),selectOnFocus:()=>sU(e.selectOnFocus),disallowTypeAhead:()=>sU(e.disallowTypeAhead),shouldUseVirtualFocus:()=>sU(e.shouldUseVirtualFocus),allowsTabNavigation:()=>sU(e.allowsTabNavigation),isVirtualized:()=>sU(e.isVirtualized),scrollToKey:t=>sU(e.scrollToKey)?.(t),orientation:()=>sU(e.orientation)},t)}var FH="focusScope.autoFocusOnMount",$H="focusScope.autoFocusOnUnmount",qH={bubbles:!1,cancelable:!0},zH={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=mB(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=mB(this.stack,e),this.active()?.resume()}};function UH(e,t){const[n,r]=Ne(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>xB(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,GB),e},u=()=>{const e=t();return e?AB(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};Oe((()=>{const e=t();if(!e)return;zH.add(o);const n=bB(e);if(!yB(e,n)){const t=new CustomEvent(FH,qH);e.addEventListener(FH,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{_B(d()),bB(e)===n&&_B(e)}),0)}$e((()=>{e.removeEventListener(FH,s),setTimeout((()=>{const r=new CustomEvent($H,qH);(()=>{const e=t();if(!e)return!1;const n=bB(e);return!!n&&!yB(e,n)&&IB(n)})()&&r.preventDefault(),e.addEventListener($H,a),e.dispatchEvent(r),r.defaultPrevented||_B(n??l().body),e.removeEventListener($H,a),zH.remove(o)}),0)}))})),Oe((()=>{const r=t();if(!r||!sU(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${zV}]`)||(yB(r,t)?i=t:_B(i))},s=e=>{const t=e.relatedTarget??bB(r);t?.closest(`[${zV}]`)||yB(r,t)||_B(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),$e((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),Oe((()=>{const r=t();if(!r||!sU(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();_B(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),$e((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var BH="data-live-announcer";function VH(e){Oe((()=>{sU(e.isDisabled)||$e(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${BH}], [${zV}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=KH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),KH.set(e,t+1))};HH.length&&HH[HH.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return HH.push(a),()=>{s.disconnect();for(const e of r){const t=KH.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),KH.delete(e)):KH.set(e,t-1)}a===HH[HH.length-1]?(HH.pop(),HH.length&&HH[HH.length-1].observe()):HH.splice(HH.indexOf(a),1)}}(sU(e.targets),sU(e.root)))}))}var KH=new WeakMap,HH=[];var WH=new Map,GH=e=>{Oe((()=>{const t=$V(e.style)??{},n=$V(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=WH.get(e.key);o?o.activeCount++:WH.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);$e((()=>{const t=WH.get(e.key);if(t)if(1===t.activeCount){WH.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},YH=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},QH=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[XH,JH]=Ne([]),ZH=e=>[e.deltaX,e.deltaY],eW=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],tW=(e,t,n,r)=>{const o=null!==r&&nW(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=YH(o,t),u=c-e-r*l;0===l&&0===u||!QH(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},nW=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},rW=e=>{const t=mt({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=bt();let r=[0,0],o=null,i=null;Oe((()=>{$V(t.enabled)&&(JH((e=>[...e,n])),$e((()=>{JH((e=>e.filter((e=>e!==n))))})))})),Oe((()=>{if(!$V(t.enabled)||!$V(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if($V(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===$V(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;GH({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{$V(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else GH({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),Oe((()=>{var e;(e=n,XH().indexOf(e)===XH().length-1&&$V(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),$e((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=eW(e),o=null,i=null},a=e=>{const n=e.target,r=$V(t.element),o=ZH(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=tW(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!nW(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=$V(t.element),s=e.target;let a;if(2===e.touches.length)a=!$V(t.allowPinchZoom);else{if(null==o||null===i){const t=eW(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=tW(s,o,i,n);a=!n||!nW(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},oW=Ve();function iW(){return Ke(oW)}function sW(){const e=iW();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var aW=Ve();function lW(){const e=Ke(aW);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var cW=Ve();function uW(){const e=Ke(cW);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function dW(e){let t;const n=uW(),r=sW(),o=UB({id:n.generateId(`item-${bt()}`)},e),[i,s]=gt(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ne(),[c,u]=Ne(),[d,h]=Ne(),f=()=>r.listState().selectionManager(),p=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};gV({getItem:()=>({ref:()=>t,type:"item",key:p(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=AV({key:p,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),v=e=>{jB(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(_B(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(p()))))},y=e=>{jB(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{jB(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(jB(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=Re((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=Re((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===p()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:h,generateId:vB((()=>s.id)),registerLabel:YB(l),registerDescription:YB(u)};return ut(aW.Provider,{value:C,get children(){return ut(JB,mt({as:"div",ref(e){const n=ZU((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return TB([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return TB([b,g.onPointerUp])},get onClick(){return TB([i.onClick,g.onClick])},get onKeyDown(){return TB([x,g.onKeyDown])},get onMouseDown(){return TB([i.onMouseDown,g.onMouseDown])},get onFocus(){return TB([i.onFocus,g.onFocus])},onPointerMove:v,onPointerLeave:y},S,s))}})}function hW(e){const t=UB({closeOnSelect:!1},e),[n,r]=gt(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=aV({value:()=>sU(e.isSelected),defaultValue:()=>!!sU(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{sU(e.isReadOnly)||sU(e.isDisabled)||n(t)},toggle:()=>{sU(e.isReadOnly)||sU(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return ut(dW,mt({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var fW=Ve();function pW(){return Ke(fW)}var mW={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>mW.next("ltr"===e?"rtl":"ltr",t)},gW=e=>"horizontal"===e?"ArrowDown":"ArrowRight",vW=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function yW(e){const t=uW(),n=sW(),r=pW(),{direction:o}=TV(),i=UB({id:t.generateId("trigger")},e),[s,a]=gt(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=QB((()=>n.triggerRef()),(()=>"button")),u=Re((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));Oe(Ie((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return Oe((()=>$e(n.registerTriggerId(s.id)))),ut(QV,mt({ref(e){const t=ZU(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return Re((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{jB(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{jB(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{jB(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(jB(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case gW(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=$B(e);for(;e&&n&&e!==t&&n!==t;)HB(n,e),n=$B(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case vW(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case mW.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case mW.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{jB(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var bW=Ve();function xW(){return Ke(bW)}function wW(e){let t;const n=uW(),r=sW(),o=pW(),i=xW(),{direction:s}=TV(),a=UB({id:n.generateId(`content-${bt()}`)},e),[l,c]=gt(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),h=IH({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));UH({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},p=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};Oe((()=>$e(r.registerContentId(l.id))));const m={ref:ZU((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return h.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:TB([l.onKeyDown,h.onKeyDown,e=>{if(yB(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case mW.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case mW.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:TB([l.onMouseDown,h.onMouseDown]),onFocusIn:TB([l.onFocusIn,h.onFocusIn]),onFocusOut:TB([l.onFocusOut,h.onFocusOut]),onPointerEnter:e=>{jB(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(jB(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;yB(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return ut(Ct,{get when(){return r.contentPresent()},get children(){return ut(Ct,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return ut(JB,mt({as:"div"},(()=>r.dataset()),m,c))},get children(){return ut(gH.Positioner,{get children(){return ut(xH,mt({get disableOutsidePointerEvents(){return Re((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return pB({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:p,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function SW(e){let t;const n=uW(),r=sW(),[o,i]=gt(e,["ref"]);return rW({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),ut(wW,mt({ref(e){const n=ZU((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var CW=Ve();function kW(e){const t=UB({id:uW().generateId(`group-${bt()}`)},e),[n,r]=Ne(),o={generateId:vB((()=>t.id)),registerLabelId:YB(r)};return ut(CW.Provider,{value:o,get children(){return ut(JB,mt({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function EW(e){const t=function(){const e=Ke(CW);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=UB({id:t.generateId("label")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerLabelId(r.id)))),ut(JB,mt({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function jW(e){const t=sW();return ut(JB,mt({as:"span","aria-hidden":"true"},(()=>t.dataset()),UB({children:"▼"},e)))}function TW(e){return ut(dW,mt({role:"menuitem",closeOnSelect:!0},e))}function PW(e){const t=lW(),n=UB({id:t.generateId("description")},e),[r,o]=gt(n,["id"]);return Oe((()=>$e(t.registerDescription(r.id)))),ut(JB,mt({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function _W(e){const t=lW(),n=UB({id:t.generateId("indicator")},e),[r,o]=gt(n,["forceMount"]);return ut(Ct,{get when(){return r.forceMount||t.isChecked()},get children(){return ut(JB,mt({as:"div"},(()=>t.dataset()),o))}})}function NW(e){const t=lW(),n=UB({id:t.generateId("label")},e),[r,o]=gt(n,["ref","id"]);return Oe((()=>$e(t.registerLabel(r.id)))),ut(JB,mt({as:"div",ref(e){const n=ZU(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function DW(e){const t=sW();return ut(Ct,{get when(){return t.contentPresent()},get children(){return ut(Zt,e)}})}var MW=Ve();function OW(e){const t=UB({id:uW().generateId(`radiogroup-${bt()}`)},e),[n,r]=gt(t,["value","defaultValue","onChange","disabled"]),[o,i]=sV({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return ut(MW.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return ut(kW,r)}})}function RW(e){const t=function(){const e=Ke(MW);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=UB({closeOnSelect:!1},e),[r,o]=gt(n,["value","onSelect"]);return ut(dW,mt({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function AW(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function LW(e){const t=uW(),n=dV(),r=iW(),o=pW(),i=xW(),s=UB({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=gt(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[h,f]=Ne(),[p,m]=Ne(),[g,v]=Ne(),[y,b]=Ne(),[x,w]=Ne(!0),[S,C]=Ne(l.placement),[k,E]=Ne([]),[j,T]=Ne([]),{DomCollectionProvider:P}=mV({items:j,onItemsChange:T}),_=wH({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:N}=qV({show:()=>t.forceMount()||_.isOpen(),element:()=>y()??null}),D=function(e){const t=OV(e),n=yV({dataSource:()=>sU(e.dataSource),getKey:()=>sU(e.getKey),getTextValue:()=>sU(e.getTextValue),getDisabled:()=>sU(e.getDisabled),getSectionChildren:()=>sU(e.getSectionChildren),factory:t=>new IV(e.filter?e.filter(t):t)},[()=>e.filter]),r=new LV(n,t);return De((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:j}),M=e=>{w(e),_.open()},O=(e=!1)=>{_.close(),e&&r&&r.close(!0)},R=()=>{const e=y();e&&(_B(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},A=()=>{null!=i?setTimeout((()=>R())):R()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],h=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===h)return!0;h>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===h)return!0;h<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};VH({isDisabled:()=>!(null==r&&_.isOpen()&&t.isModal()),targets:()=>[y(),...k()].filter(Boolean)}),Oe((()=>{const e=y();if(!e||!r)return;const t=r.registerNestedMenu(e);$e((()=>{t()}))})),Oe((()=>{void 0===r&&o?.registerMenu(t.value(),[y(),...k()])})),Oe((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):O())})),Oe((()=>{void 0===r&&void 0!==o&&_.isOpen()&&o.setValue(t.value())})),$e((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:Re((()=>({"data-expanded":_.isOpen()?"":void 0,"data-closed":_.isOpen()?void 0:""}))),isOpen:_.isOpen,contentPresent:N,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:y,triggerId:h,contentId:p,setTriggerRef:v,setContentRef:b,open:M,close:O,toggle:e=>{w(e),_.toggle()},focusContent:A,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||A()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>mB(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:YB(f),registerContentId:YB(m)};return ut(P,{get children(){return ut(oW.Provider,{value:I,get children(){return ut(Ct,{when:void 0===i,get fallback(){return l.children},get children(){return ut(gH,mt({anchorRef:g,contentRef:y,onCurrentPlacementChange:C},l))}})}})}})}function IW(e){const{direction:t}=TV();return ut(LW,mt({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var FW=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function $W(e){const t=sW(),n=uW(),[r,o]=gt(e,["onFocusOutside","onKeyDown"]),{direction:i}=TV();return ut(wW,mt({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;yB(t.triggerRef(),n)||t.close()},onKeyDown:e=>{jB(e,r.onKeyDown);const o=yB(e.currentTarget,e.target),s=FW(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),_B(t.triggerRef()))}},o))}var qW=["Enter"," "],zW=(e,t)=>"ltr"===e?[...qW,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...qW,"horizontal"===t?"ArrowLeft":"ArrowUp"];function UW(e){let t;const n=uW(),r=sW(),o=UB({id:n.generateId(`sub-trigger-${bt()}`)},e),[i,s]=gt(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=TV(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},h=AV({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{jB(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},p=e=>{jB(e,i.onKeyDown),e.repeat||i.disabled||zW(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return Oe((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");$e(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),Oe(Ie((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{$e((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),Oe((()=>$e(r.registerTriggerId(i.id)))),$e((()=>{l()})),ut(JB,mt({as:"div",ref(e){const n=ZU((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return h.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return Re((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return h.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return TB([i.onPointerDown,h.onPointerDown])},get onPointerUp(){return TB([i.onPointerUp,h.onPointerUp])},get onClick(){return TB([f,h.onClick])},get onKeyDown(){return TB([p,h.onKeyDown])},get onMouseDown(){return TB([i.onMouseDown,h.onMouseDown])},get onFocus(){return TB([i.onFocus,h.onFocus])},onPointerMove:e=>{if(jB(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),_B(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(jB(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:AW(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function BW(e){const t=pW(),n=UB({id:`menu-${bt()}`,modal:!0},e),[r,o]=gt(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=wH({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:vB((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return ut(cW.Provider,{value:s,get children(){return ut(LW,mt({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function VW(e){let t;const n=UB({orientation:"horizontal"},e),[r,o]=gt(n,["ref","orientation"]),i=QB((()=>t),(()=>"hr"));return ut(JB,mt({as:"hr",ref(e){const n=ZU((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}cV({},{Root:()=>VW,Separator:()=>KW});var KW=VW,HW={};function WW(e){const t=uW(),n=sW(),[r,o]=gt(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return ut(SW,mt({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||_B(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function GW(e){return ut(BW,UB({id:`dropdownmenu-${bt()}`},e))}cV(HW,{Arrow:()=>hH,CheckboxItem:()=>hW,Content:()=>WW,DropdownMenu:()=>YW,Group:()=>kW,GroupLabel:()=>EW,Icon:()=>jW,Item:()=>TW,ItemDescription:()=>PW,ItemIndicator:()=>_W,ItemLabel:()=>NW,Portal:()=>DW,RadioGroup:()=>OW,RadioItem:()=>RW,Root:()=>GW,Separator:()=>VW,Sub:()=>IW,SubContent:()=>$W,SubTrigger:()=>UW,Trigger:()=>yW});var YW=Object.assign(GW,{Arrow:hH,CheckboxItem:hW,Content:WW,Group:kW,GroupLabel:EW,Icon:jW,Item:TW,ItemDescription:PW,ItemIndicator:_W,ItemLabel:NW,Portal:DW,RadioGroup:OW,RadioItem:RW,Separator:VW,Sub:IW,SubContent:$W,SubTrigger:UW,Trigger:yW}),QW={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},XW=At('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),JW=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),ZW=At('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),eG=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),tG=At('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),nG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),rG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),oG=At('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),iG=At('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),sG=At('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),aG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),lG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),cG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),uG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),hG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),fG=At('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),pG=At('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),vG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),yG=At('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bG=At('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function xG(){return XW()}function wG(){return JW()}function SG(){return ZW()}function CG(){return eG()}function kG(){return tG()}function EG(){return(e=tG()).style.setProperty("transform","rotate(90deg)"),e;var e}function jG(){return(e=tG()).style.setProperty("transform","rotate(-90deg)"),e;var e}function TG(){return nG()}function PG(){return rG()}function _G(){return oG()}function NG(){return iG()}function DG(){return sG()}function MG(){return aG()}function OG(){return lG()}function RG(){return cG()}function AG(){return uG()}function LG(e){return t=dG(),n=t.firstChild,Me((()=>It(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function IG(){return hG()}function FG(){return fG()}function $G(e){return[ut(Ct,{get when(){return e.checked},get children(){var t=dG(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),ut(Ct,{get when(){return!e.checked},get children(){var t=pG(),n=t.firstChild;return Me((()=>It(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function qG(){return mG()}function zG(){return gG()}function UG(){return vG()}function BG(){return yG()}function VG(){const e=bt();return t=bG(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,h=(d=c.nextSibling).firstChild,m=(p=(f=d.nextSibling).nextSibling).firstChild,v=(g=p.nextSibling).firstChild,x=(b=(y=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,T=(j=k.nextSibling).firstChild,N=(_=(P=j.nextSibling).nextSibling).firstChild,M=(D=_.nextSibling).firstChild,A=(R=(O=D.nextSibling).nextSibling).firstChild,I=(L=R.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,U=(z=F.nextSibling).firstChild,V=(B=z.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=B.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,he=(de=(ue=le.nextSibling).firstChild).nextSibling,pe=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Ae=(Re=(Oe=(Me=(De=(Ne=(_e=(Pe=(Te=(je=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ye=(ve=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,It(n,"id",`a-${e}`),It(r,"fill",`url(#a-${e})`),It(i,"id",`am-${e}`),It(s,"id",`b-${e}`),It(a,"filter",`url(#am-${e})`),It(l,"mask",`url(#b-${e})`),It(u,"id",`ah-${e}`),It(d,"id",`k-${e}`),It(h,"filter",`url(#ah-${e})`),It(f,"mask",`url(#k-${e})`),It(m,"id",`ae-${e}`),It(g,"id",`j-${e}`),It(v,"filter",`url(#ae-${e})`),It(y,"mask",`url(#j-${e})`),It(x,"id",`ai-${e}`),It(w,"id",`i-${e}`),It(S,"filter",`url(#ai-${e})`),It(C,"mask",`url(#i-${e})`),It(E,"id",`aj-${e}`),It(j,"id",`h-${e}`),It(T,"filter",`url(#aj-${e})`),It(P,"mask",`url(#h-${e})`),It(N,"id",`ag-${e}`),It(D,"id",`g-${e}`),It(M,"filter",`url(#ag-${e})`),It(O,"mask",`url(#g-${e})`),It(A,"id",`af-${e}`),It(L,"id",`f-${e}`),It(I,"filter",`url(#af-${e})`),It(F,"mask",`url(#f-${e})`),It($,"id",`m-${e}`),It(q,"fill",`url(#m-${e})`),It(U,"id",`ak-${e}`),It(B,"id",`e-${e}`),It(V,"filter",`url(#ak-${e})`),It(K,"mask",`url(#e-${e})`),It(H,"id",`n-${e}`),It(W,"fill",`url(#n-${e})`),It(G,"id",`r-${e}`),It(Y,"fill",`url(#r-${e})`),It(Q,"id",`s-${e}`),It(X,"fill",`url(#s-${e})`),It(J,"id",`q-${e}`),It(Z,"fill",`url(#q-${e})`),It(ee,"id",`p-${e}`),It(te,"fill",`url(#p-${e})`),It(ne,"id",`o-${e}`),It(re,"fill",`url(#o-${e})`),It(oe,"id",`l-${e}`),It(ie,"fill",`url(#l-${e})`),It(ae,"id",`al-${e}`),It(le,"id",`d-${e}`),It(ce,"filter",`url(#al-${e})`),It(ue,"mask",`url(#d-${e})`),It(de,"id",`u-${e}`),It(he,"fill",`url(#u-${e})`),It(pe,"id",`ad-${e}`),It(me,"id",`c-${e}`),It(ge,"filter",`url(#ad-${e})`),It(ve,"mask",`url(#c-${e})`),It(ye,"id",`t-${e}`),It(be,"fill",`url(#t-${e})`),It(xe,"id",`v-${e}`),It(we,"stroke",`url(#v-${e})`),It(Se,"id",`aa-${e}`),It(Ce,"stroke",`url(#aa-${e})`),It(ke,"id",`w-${e}`),It(Ee,"stroke",`url(#w-${e})`),It(je,"id",`ac-${e}`),It(Te,"stroke",`url(#ac-${e})`),It(Pe,"id",`ab-${e}`),It(_e,"stroke",`url(#ab-${e})`),It(Ne,"id",`y-${e}`),It(De,"stroke",`url(#y-${e})`),It(Me,"id",`x-${e}`),It(Oe,"stroke",`url(#x-${e})`),It(Re,"id",`z-${e}`),It(Ae,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,h,f,p,m,g,v,y,b,x,w,S,C,k,E,j,T,P,_,N,D,M,O,R,A,L,I,F,$,q,z,U,B,V,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,he,fe,pe,me,ge,ve,ye,be,xe,we,Se,Ce,ke,Ee,je,Te,Pe,_e,Ne,De,Me,Oe,Re,Ae}var KG=At('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),HG=At('<button title="Copy object to clipboard">'),WG=At('<button title="Remove all items"aria-label="Remove all items">'),GG=At('<button title="Delete item"aria-label="Delete item">'),YG=At('<button title="Toggle value"aria-label="Toggle value">'),QG=At('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),XG=At("<div>"),JG=At("<div><button> <span></span> <span> "),ZG=At("<input>"),eY=At("<span>"),tY=At("<div><span>:"),nY=At("<div><div><button> [<!>...<!>]");var rY=e=>{const t=kU(),n=bU().shadowDOMTarget?YU.bind({target:bU().shadowDOMTarget}):YU,r=Re((()=>"dark"===t()?hY(n):dY(n)));return o=KG(),Me((()=>Ft(o,XU(r().expander,n`
44
44
  transform: rotate(${e.expanded?90:0}deg);
45
45
  `,e.expanded&&n`
46
46
  & svg {