/*! For license information please see main.e1bcd346.js.LICENSE.txt */ (()=>{var e={1201(e,t,r){"use strict";var n,o=r(5043),i=r.t(o,2),a=r(7950);n=a.createRoot,a.hydrateRoot;var s=r(5544),l=r(3145),c=r(6369);var d,u=r(7800),h=r(6562);function p(e){return(0,c.A)(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||(0,u.A)(e)||(0,h.A)()}function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function S(e,t,r,n){void 0===n&&(n={});let o=n,i=o.window,a=void 0===i?document.defaultView:i,s=o.v5Compat,l=void 0!==s&&s,c=a.history,u=d.Pop,h=null,p=g();function g(){return(c.state||{idx:null}).idx}function w(){u=d.Pop;let e=g(),t=null==e?null:e-p;p=e,h&&h({action:u,location:k.location,delta:t})}function S(e){let t="null"!==a.location.origin?a.location.origin:a.location.href,r="string"===typeof e?e:x(e);return r=r.replace(/ $/,"%20"),m(t,"No window.location.(origin|href) available to create URL for href: "+r),new URL(r,t)}null==p&&(p=0,c.replaceState(v({},c.state,{idx:p}),""));let k={get action(){return u},get location(){return e(a,c)},listen(e){if(h)throw new Error("A history only accepts one active listener");return a.addEventListener(f,w),h=e,()=>{a.removeEventListener(f,w),h=null}},createHref:e=>t(a,e),createURL:S,encodeLocation(e){let t=S(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){u=d.Push;let n=b(k.location,e,t);r&&r(n,e),p=g()+1;let o=y(n,p),i=k.createHref(n);try{c.pushState(o,"",i)}catch(s){if(s instanceof DOMException&&"DataCloneError"===s.name)throw s;a.location.assign(i)}l&&h&&h({action:u,location:k.location,delta:1})},replace:function(e,t){u=d.Replace;let n=b(k.location,e,t);r&&r(n,e),p=g();let o=y(n,p),i=k.createHref(n);c.replaceState(o,"",i),l&&h&&h({action:u,location:k.location,delta:0})},go:e=>c.go(e)};return k}var k;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(k||(k={}));new Set(["lazy","caseSensitive","path","id","index","children"]);function _(e,t,r){return void 0===r&&(r="/"),C(e,t,r,!1)}function C(e,t,r,n){let o=z(("string"===typeof t?w(t):t).pathname||"/",r);if(null==o)return null;let i=A(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every((e,r)=>e===t[r]);return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(i);let a=null,s=function(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return g(!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}}(o);for(let l=0;null==a&&l{let a={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};a.relativePath.startsWith("/")&&(m(a.relativePath.startsWith(n),'Absolute route path "'+a.relativePath+'" nested under path "'+n+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),a.relativePath=a.relativePath.slice(n.length));let s=W([n,a.relativePath]),l=r.concat(a);e.children&&e.children.length>0&&(m(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+s+'".'),A(e.children,t,l,s)),(null!=e.path||e.index)&&t.push({path:s,score:R(s,e.index),routesMeta:l})};return e.forEach((e,t)=>{var r;if(""!==e.path&&null!=(r=e.path)&&r.includes("?"))for(let n of j(e.path))o(e,t,n);else o(e,t)}),t}function j(e){let t=e.split("/");if(0===t.length)return[];let r=p(t),n=r[0],o=(0,l.A)(r).slice(1),i=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===o.length)return i?[a,""]:[a];let s=j(o.join("/")),c=[];return c.push(...s.map(e=>""===e?a:[a,e].join("/"))),i&&c.push(...s),c.map(t=>e.startsWith("/")&&""===t?"/":t)}const I=/^:[\w-]+$/,P=e=>"*"===e;function R(e,t){let r=e.split("/"),n=r.length;return r.some(P)&&(n+=-2),t&&(n+=2),r.filter(e=>!P(e)).reduce((e,t)=>e+(I.test(t)?3:""===t?1:10),n)}function T(e,t,r){void 0===r&&(r=!1);let n=e.routesMeta,o={},i="/",a=[];for(let s=0;s(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)"));e.endsWith("*")?(n.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))");let i=new RegExp(o,t?void 0:"i");return[i,n]}(e.path,e.caseSensitive,e.end),n=(0,s.A)(r,2),o=n[0],i=n[1],a=t.match(o);if(!a)return null;let l=a[0],c=l.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:i.reduce((e,t,r)=>{let n=t.paramName,o=t.isOptional;if("*"===n){let e=d[r]||"";c=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}const i=d[r];return e[n]=o&&!i?void 0:(i||"").replace(/%2F/g,"/"),e},{}),pathname:l,pathnameBase:c,pattern:e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}const D=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function M(e,t){void 0===t&&(t="/");let r,n="string"===typeof e?w(e):e,o=n.pathname,i=n.search,a=void 0===i?"":i,s=n.hash,l=void 0===s?"":s;if(o)if(c=o,D.test(c))r=o;else{if(o.includes("//")){let e=o;o=H(o),g(!1,"Pathnames cannot have embedded double slashes - normalizing "+e+" -> "+o)}r=o.startsWith("/")?L(o.substring(1),"/"):L(o,t)}else r=t;var c;return{pathname:r,search:$(a),hash:U(l)}}function L(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)}),r.length>1?r.join("/"):"/"}function O(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the `to."+r+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function F(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function N(e,t){let r=F(e);return t?r.map((e,t)=>t===r.length-1?e.pathname:e.pathnameBase):r.map(e=>e.pathnameBase)}function B(e,t,r,n){let o;void 0===n&&(n=!1),"string"===typeof e?o=w(e):(o=v({},e),m(!o.pathname||!o.pathname.includes("?"),O("?","pathname","search",o)),m(!o.pathname||!o.pathname.includes("#"),O("#","pathname","hash",o)),m(!o.search||!o.search.includes("#"),O("#","search","hash",o)));let i,a=""===e||""===o.pathname,s=a?"/":o.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}i=e>=0?t[e]:"/"}let l=M(o,i),c=s&&"/"!==s&&s.endsWith("/"),d=(a||"."===s)&&r.endsWith("/");return l.pathname.endsWith("/")||!c&&!d||(l.pathname+="/"),l}const H=e=>e.replace(/\/\/+/g,"/"),W=e=>H(e.join("/")),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),$=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",U=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;function q(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const K=["post","put","patch","delete"],G=(new Set(K),["get",...K]);new Set(G),new Set([301,302,303,307,308]),new Set([307,308]);Symbol("deferred");function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0});let n=o.useCallback(function(n,o){void 0===o&&(o={}),r.current&&("number"===typeof n?e.navigate(n):e.navigate(n,J({fromRouteId:t},o)))},[e,t]);return n}():function(){re()||m(!1);let e=o.useContext(Q),t=o.useContext(X),r=t.basename,n=t.future,i=t.navigator,a=o.useContext(ee).matches,s=ne().pathname,l=JSON.stringify(N(a,n.v7_relativeSplatPath)),c=o.useRef(!1);oe(()=>{c.current=!0});let d=o.useCallback(function(t,n){if(void 0===n&&(n={}),!c.current)return;if("number"===typeof t)return void i.go(t);let o=B(t,JSON.parse(l),s,"path"===n.relative);null==e&&"/"!==r&&(o.pathname="/"===o.pathname?r:W([r,o.pathname])),(n.replace?i.replace:i.push)(o,n.state,n)},[r,i,l,s,e]);return d}()}function ae(){let e=o.useContext(ee).matches,t=e[e.length-1];return t?t.params:{}}function se(e,t){let r=(void 0===t?{}:t).relative,n=o.useContext(X).future,i=o.useContext(ee).matches,a=ne().pathname,s=JSON.stringify(N(i,n.v7_relativeSplatPath));return o.useMemo(()=>B(e,JSON.parse(s),a,"path"===r),[e,s,a,r])}function le(e,t,r,n){re()||m(!1);let i=o.useContext(X).navigator,a=o.useContext(ee).matches,s=a[a.length-1],l=s?s.params:{},c=(s&&s.pathname,s?s.pathnameBase:"/");s&&s.route;let u,h=ne();if(t){var p;let e="string"===typeof t?w(t):t;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||m(!1),u=e}else u=h;let v=u.pathname||"/",f=v;if("/"!==c){let e=c.replace(/^\//,"").split("/");f="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=_(e,{pathname:f});let y=pe(g&&g.map(e=>Object.assign({},e,{params:Object.assign({},l,e.params),pathname:W([c,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:W([c,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),a,r,n);return t&&y?o.createElement(Z.Provider,{value:{location:J({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:d.Pop}},y):y}function ce(){let e=function(){var e;let t=o.useContext(te),r=ge(fe.UseRouteError),n=ye(fe.UseRouteError);if(void 0!==t)return t;return null==(e=r.errors)?void 0:e[n]}(),t=q(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:n};return o.createElement(o.Fragment,null,o.createElement("h2",null,"Unexpected Application Error!"),o.createElement("h3",{style:{fontStyle:"italic"}},t),r?o.createElement("pre",{style:i},r):null,null)}const de=o.createElement(ce,null);class ue extends o.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){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?o.createElement(ee.Provider,{value:this.props.routeContext},o.createElement(te.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function he(e){let t=e.routeContext,r=e.match,n=e.children,i=o.useContext(Q);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),o.createElement(ee.Provider,{value:t},n)}function pe(e,t,r,n){var i;if(void 0===t&&(t=[]),void 0===r&&(r=null),void 0===n&&(n=null),null==e){var a;if(!r)return null;if(r.errors)e=r.matches;else{if(!(null!=(a=n)&&a.v7_partialHydration&&0===t.length&&!r.initialized&&r.matches.length>0))return null;e=r.matches}}let s=e,l=null==(i=r)?void 0:i.errors;if(null!=l){let e=s.findIndex(e=>e.route.id&&void 0!==(null==l?void 0:l[e.route.id]));e>=0||m(!1),s=s.slice(0,Math.min(s.length,e+1))}let c=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let o=0;o=0?s.slice(0,d+1):[s[0]];break}}}return s.reduceRight((e,n,i)=>{let a,u=!1,h=null,p=null;r&&(a=l&&n.route.id?l[n.route.id]:void 0,h=n.route.errorElement||de,c&&(d<0&&0===i?(!function(e,t){t||be[e]||(be[e]=!0)}("route-fallback",!1),u=!0,p=null):d===i&&(u=!0,p=n.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,i+1)),f=()=>{let t;return t=a?h:u?p:n.route.Component?o.createElement(n.route.Component,null):n.route.element?n.route.element:e,o.createElement(he,{match:n,routeContext:{outlet:e,matches:v,isDataRoute:null!=r},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||0===i)?o.createElement(ue,{location:r.location,revalidation:r.revalidation,component:h,error:a,children:f(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):f()},null)}var ve=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(ve||{}),fe=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(fe||{});function me(e){let t=o.useContext(Q);return t||m(!1),t}function ge(e){let t=o.useContext(Y);return t||m(!1),t}function ye(e){let t=function(){let e=o.useContext(ee);return e||m(!1),e}(),r=t.matches[t.matches.length-1];return r.route.id||m(!1),r.route.id}const be={};function xe(e,t){null==e||e.v7_startTransition,void 0===(null==e?void 0:e.v7_relativeSplatPath)&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}i.startTransition;function we(e){let t=e.to,r=e.replace,n=e.state,i=e.relative;re()||m(!1);let a=o.useContext(X),s=a.future,l=(a.static,o.useContext(ee).matches),c=ne().pathname,d=ie(),u=B(t,N(l,s.v7_relativeSplatPath),c,"path"===i),h=JSON.stringify(u);return o.useEffect(()=>d(JSON.parse(h),{replace:r,state:n,relative:i}),[d,h,i,r,n]),null}function Se(e){m(!1)}function ke(e){let t=e.basename,r=void 0===t?"/":t,n=e.children,i=void 0===n?null:n,a=e.location,s=e.navigationType,l=void 0===s?d.Pop:s,c=e.navigator,u=e.static,h=void 0!==u&&u,p=e.future;re()&&m(!1);let v=r.replace(/^\/*/,"/"),f=o.useMemo(()=>({basename:v,navigator:c,static:h,future:J({v7_relativeSplatPath:!1},p)}),[v,p,c,h]);"string"===typeof a&&(a=w(a));let g=a,y=g.pathname,b=void 0===y?"/":y,x=g.search,S=void 0===x?"":x,k=g.hash,_=void 0===k?"":k,C=g.state,A=void 0===C?null:C,j=g.key,I=void 0===j?"default":j,P=o.useMemo(()=>{let e=z(b,v);return null==e?null:{location:{pathname:e,search:S,hash:_,state:A,key:I},navigationType:l}},[v,b,S,_,A,I,l]);return null==P?null:o.createElement(X.Provider,{value:f},o.createElement(Z.Provider,{children:i,value:P}))}function _e(e){let t=e.children,r=e.location;return le(Ce(t),r)}new Promise(()=>{});o.Component;function Ce(e,t){void 0===t&&(t=[]);let r=[];return o.Children.forEach(e,(e,n)=>{if(!o.isValidElement(e))return;let i=[...t,n];if(e.type===o.Fragment)return void r.push.apply(r,Ce(e.props.children,i));e.type!==Se&&m(!1),e.props.index&&e.props.children&&m(!1);let a={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ce(e.props.children,i)),r.push(a)}),r}var Ae=r(9379),je=r(8168),Ie=r(8587),Pe=r(8387),Re=r(5903),Te=r(6598);function Ee(e,t){return(0,Re.A)(e,t)}const ze=[];function De(e){return ze[0]=e,(0,Te.J)(ze)}function Me(e){let t="https://mui.com/production-error/?code="+e;for(let r=1;r{t[r]=Fe(e[r])}),t}function Ne(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const n=r.clone?(0,je.A)({},e):e;return Oe(e)&&Oe(t)&&Object.keys(t).forEach(i=>{o.isValidElement(t[i])?n[i]=t[i]:Oe(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Oe(e[i])?n[i]=Ne(e[i],t[i],r):r.clone?n[i]=Oe(t[i])?Fe(t[i]):t[i]:n[i]=t[i]}),n}const Be=function(e,t){return t?Ne(e,t,{clone:!1}):e};const He={xs:0,sm:600,md:900,lg:1200,xl:1536},We={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(He[e],"px)")};function Ve(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||We;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"===typeof t){const e=n.breakpoints||We;return Object.keys(t).reduce((n,o)=>{if(-1!==Object.keys(e.values||He).indexOf(o)){n[e.up(o)]=r(t[o],o)}else{const e=o;n[e]=t[e]}return n},{})}return r(t)}function $e(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t;const r=null==(t=e.keys)?void 0:t.reduce((t,r)=>(t[e.up(r)]={},t),{});return r||{}}function Ue(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function qe(e){let t=e.values,r=e.breakpoints;const n=e.base||function(e,t){if("object"!==typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((t,n)=>{n{null!=e[t]&&(r[t]=!0)}),r}(t,r),o=Object.keys(n);if(0===o.length)return t;let i;return o.reduce((e,r,n)=>(Array.isArray(t)?(e[r]=null!=t[n]?t[n]:t[i],i=n):"object"===typeof t?(e[r]=null!=t[r]?t[r]:t[i],i=r):e[r]=t,e),{})}function Ke(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r="vars.".concat(t).split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function Ge(e,t,r){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||o:Ke(e,r)||o,t&&(n=t(n,o,e)),n}const Je=function(e){const t=e.prop,r=e.cssProperty,n=void 0===r?e.prop:r,o=e.themeKey,i=e.transform,a=e=>{if(null==e[t])return null;const r=e[t],a=Ke(e.theme,o)||{};return Ve(e,r,e=>{let r=Ge(a,i,e);return e===r&&"string"===typeof e&&(r=Ge(a,i,"".concat(t).concat("default"===e?"":Le(e)),e)),!1===n?r:{[n]:r}})};return a.propTypes={},a.filterProps=[t],a};const Qe={m:"margin",p:"padding"},Ye={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Xe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Ze=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}(e=>{if(e.length>2){if(!Xe[e])return[e];e=Xe[e]}const t=e.split(""),r=(0,s.A)(t,2),n=r[0],o=r[1],i=Qe[n],a=Ye[o]||"";return Array.isArray(a)?a.map(e=>i+e):[i+a]}),et=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],tt=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],rt=[...et,...tt];function nt(e,t,r,n){var o;const i=null!=(o=Ke(e,t,!1))?o:r;return"number"===typeof i?e=>"string"===typeof e?e:i*e:Array.isArray(i)?e=>"string"===typeof e?e:i[e]:"function"===typeof i?i:()=>{}}function ot(e){return nt(e,"spacing",8)}function it(e,t){if("string"===typeof t||null==t)return t;const r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}function at(e,t,r,n){if(-1===t.indexOf(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=it(t,r),e),{})}(Ze(r),n);return Ve(e,e[r],o)}function st(e,t){const r=ot(e.theme);return Object.keys(e).map(n=>at(e,t,n,r)).reduce(Be,{})}function lt(e){return st(e,et)}function ct(e){return st(e,tt)}function dt(e){return st(e,rt)}lt.propTypes={},lt.filterProps=et,ct.propTypes={},ct.filterProps=tt,dt.propTypes={},dt.filterProps=rt;const ut=function(){for(var e=arguments.length,t=new Array(e),r=0;r(t.filterProps.forEach(r=>{e[r]=t}),e),{}),o=e=>Object.keys(e).reduce((t,r)=>n[r]?Be(t,n[r](e)):t,{});return o.propTypes={},o.filterProps=t.reduce((e,t)=>e.concat(t.filterProps),[]),o};function ht(e){return"number"!==typeof e?e:"".concat(e,"px solid")}function pt(e,t){return Je({prop:e,themeKey:"borders",transform:t})}const vt=pt("border",ht),ft=pt("borderTop",ht),mt=pt("borderRight",ht),gt=pt("borderBottom",ht),yt=pt("borderLeft",ht),bt=pt("borderColor"),xt=pt("borderTopColor"),wt=pt("borderRightColor"),St=pt("borderBottomColor"),kt=pt("borderLeftColor"),_t=pt("outline",ht),Ct=pt("outlineColor"),At=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=nt(e.theme,"shape.borderRadius",4),r=e=>({borderRadius:it(t,e)});return Ve(e,e.borderRadius,r)}return null};At.propTypes={},At.filterProps=["borderRadius"];ut(vt,ft,mt,gt,yt,bt,xt,wt,St,kt,At,_t,Ct);const jt=e=>{if(void 0!==e.gap&&null!==e.gap){const t=nt(e.theme,"spacing",8),r=e=>({gap:it(t,e)});return Ve(e,e.gap,r)}return null};jt.propTypes={},jt.filterProps=["gap"];const It=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=nt(e.theme,"spacing",8),r=e=>({columnGap:it(t,e)});return Ve(e,e.columnGap,r)}return null};It.propTypes={},It.filterProps=["columnGap"];const Pt=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=nt(e.theme,"spacing",8),r=e=>({rowGap:it(t,e)});return Ve(e,e.rowGap,r)}return null};Pt.propTypes={},Pt.filterProps=["rowGap"];ut(jt,It,Pt,Je({prop:"gridColumn"}),Je({prop:"gridRow"}),Je({prop:"gridAutoFlow"}),Je({prop:"gridAutoColumns"}),Je({prop:"gridAutoRows"}),Je({prop:"gridTemplateColumns"}),Je({prop:"gridTemplateRows"}),Je({prop:"gridTemplateAreas"}),Je({prop:"gridArea"}));function Rt(e,t){return"grey"===t?t:e}ut(Je({prop:"color",themeKey:"palette",transform:Rt}),Je({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Rt}),Je({prop:"backgroundColor",themeKey:"palette",transform:Rt}));function Tt(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}const Et=Je({prop:"width",transform:Tt}),zt=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var r,n;const o=(null==(r=e.theme)||null==(r=r.breakpoints)||null==(r=r.values)?void 0:r[t])||He[t];return o?"px"!==(null==(n=e.theme)||null==(n=n.breakpoints)?void 0:n.unit)?{maxWidth:"".concat(o).concat(e.theme.breakpoints.unit)}:{maxWidth:o}:{maxWidth:Tt(t)}};return Ve(e,e.maxWidth,t)}return null};zt.filterProps=["maxWidth"];const Dt=Je({prop:"minWidth",transform:Tt}),Mt=Je({prop:"height",transform:Tt}),Lt=Je({prop:"maxHeight",transform:Tt}),Ot=Je({prop:"minHeight",transform:Tt}),Ft=(Je({prop:"size",cssProperty:"width",transform:Tt}),Je({prop:"size",cssProperty:"height",transform:Tt}),ut(Et,zt,Dt,Mt,Lt,Ot,Je({prop:"boxSizing"})),{border:{themeKey:"borders",transform:ht},borderTop:{themeKey:"borders",transform:ht},borderRight:{themeKey:"borders",transform:ht},borderBottom:{themeKey:"borders",transform:ht},borderLeft:{themeKey:"borders",transform:ht},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:ht},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:At},color:{themeKey:"palette",transform:Rt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Rt},backgroundColor:{themeKey:"palette",transform:Rt},p:{style:ct},pt:{style:ct},pr:{style:ct},pb:{style:ct},pl:{style:ct},px:{style:ct},py:{style:ct},padding:{style:ct},paddingTop:{style:ct},paddingRight:{style:ct},paddingBottom:{style:ct},paddingLeft:{style:ct},paddingX:{style:ct},paddingY:{style:ct},paddingInline:{style:ct},paddingInlineStart:{style:ct},paddingInlineEnd:{style:ct},paddingBlock:{style:ct},paddingBlockStart:{style:ct},paddingBlockEnd:{style:ct},m:{style:lt},mt:{style:lt},mr:{style:lt},mb:{style:lt},ml:{style:lt},mx:{style:lt},my:{style:lt},margin:{style:lt},marginTop:{style:lt},marginRight:{style:lt},marginBottom:{style:lt},marginLeft:{style:lt},marginX:{style:lt},marginY:{style:lt},marginInline:{style:lt},marginInlineStart:{style:lt},marginInlineEnd:{style:lt},marginBlock:{style:lt},marginBlockStart:{style:lt},marginBlockEnd:{style:lt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:jt},rowGap:{style:Pt},columnGap:{style:It},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Tt},maxWidth:{style:zt},minWidth:{transform:Tt},height:{transform:Tt},maxHeight:{transform:Tt},minHeight:{transform:Tt},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}}),Nt=Ft;const Bt=function(){function e(e,t,r,n){const o={[e]:t,theme:r},i=n[e];if(!i)return{[e]:t};const a=i.cssProperty,s=void 0===a?e:a,l=i.themeKey,c=i.transform,d=i.style;if(null==t)return null;if("typography"===l&&"inherit"===t)return{[e]:t};const u=Ke(r,l)||{};if(d)return d(o);return Ve(o,t,t=>{let r=Ge(u,c,t);return t===r&&"string"===typeof t&&(r=Ge(u,c,"".concat(e).concat("default"===t?"":Le(t)),t)),!1===s?r:{[s]:r}})}return function t(r){var n;const o=r||{},i=o.sx,a=o.theme,s=void 0===a?{}:a,l=o.nested;if(!i)return null;const c=null!=(n=s.unstable_sxConfig)?n:Nt;function d(r){let n=r;if("function"===typeof r)n=r(s);else if("object"!==typeof r)return r;if(!n)return null;const o=$e(s.breakpoints),i=Object.keys(o);let a=o;return Object.keys(n).forEach(r=>{const o=(i=n[r],l=s,"function"===typeof i?i(l):i);var i,l;if(null!==o&&void 0!==o)if("object"===typeof o)if(c[r])a=Be(a,e(r,o,s,c));else{const e=Ve({theme:s},o,e=>({[r]:e}));!function(){for(var e=arguments.length,t=new Array(e),r=0;re.concat(Object.keys(t)),[]),o=new Set(n);return t.every(e=>o.size===Object.keys(e).length)}(e,o)?a=Be(a,e):a[r]=t({sx:o,theme:s,nested:!0})}else a=Be(a,e(r,o,s,c))}),!l&&s.modularCssLayers?{"@layer sx":Ue(i,a)}:Ue(i,a)}return Array.isArray(i)?i.map(d):d(i)}}();Bt.filterProps=["sx"];const Ht=Bt,Wt=["sx"];function Vt(e){const t=e.sx,r=(e=>{var t,r;const n={systemProps:{},otherProps:{}},o=null!=(t=null==e||null==(r=e.theme)?void 0:r.unstable_sxConfig)?t:Nt;return Object.keys(e).forEach(t=>{o[t]?n.systemProps[t]=e[t]:n.otherProps[t]=e[t]}),n})((0,Ie.A)(e,Wt)),n=r.systemProps,o=r.otherProps;let i;return i=Array.isArray(t)?[n,...t]:"function"===typeof t?function(){const e=t(...arguments);return Oe(e)?(0,je.A)({},n,e):n}:(0,je.A)({},n,t),(0,je.A)({},o,{sx:i})}const $t=["values","unit","step"];function Ut(e){const t=e.values,r=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,n=e.unit,o=void 0===n?"px":n,i=e.step,a=void 0===i?5:i,s=(0,Ie.A)(e,$t),l=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>(0,je.A)({},e,{[t.key]:t.val}),{})})(r),c=Object.keys(l);function d(e){const t="number"===typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function u(e){const t="number"===typeof r[e]?r[e]:e;return"@media (max-width:".concat(t-a/100).concat(o,")")}function h(e,t){const n=c.indexOf(t);return"@media (min-width:".concat("number"===typeof r[e]?r[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[c[n]]?r[c[n]]:t)-a/100).concat(o,")")}return(0,je.A)({keys:c,values:l,up:d,down:u,between:h,only:function(e){return c.indexOf(e)+10&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;const t=ot({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n{const r=t(e);return"number"===typeof r?"".concat(r,"px"):r}).join(" ")};return r.mui=!0,r}function Gt(e,t){const r=this;if(r.vars&&"function"===typeof r.getColorSchemeSelector){const n=r.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[n]:t}}return r.palette.mode===e?t:{}}const Jt=["breakpoints","palette","spacing","shape"];const Qt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.breakpoints,r=void 0===t?{}:t,n=e.palette,o=void 0===n?{}:n,i=e.spacing,a=e.shape,s=void 0===a?{}:a,l=(0,Ie.A)(e,Jt),c=Ut(r),d=Kt(i);let u=Ne({breakpoints:c,direction:"ltr",components:{},palette:(0,je.A)({mode:"light"},o),spacing:d,shape:(0,je.A)({},qt,s)},l);u.applyStyles=Gt;for(var h=arguments.length,p=new Array(h>1?h-1:0),v=1;vNe(e,t),u),u.unstable_sxConfig=(0,je.A)({},Nt,null==l?void 0:l.unstable_sxConfig),u.unstable_sx=function(e){return Ht({sx:e,theme:this})},u};var Yt=r(581);const Xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const t=o.useContext(Yt.T);return t&&(r=t,0!==Object.keys(r).length)?t:e;var r},Zt=Qt();const er=function(){return Xt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zt)};var tr=r(579);const rr=["className","component"];const nr=e=>e,or=(()=>{let e=nr;return{configure(t){e=t},generate:t=>e(t),reset(){e=nr}}})();function ir(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";function t(){for(var r=arguments.length,n=new Array(r),o=0;o1?n-1:0),i=1;i=6?2:1,"}"),"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map(e=>e+e)),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", "),")"):""}(e));const t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error(Me(9,e));let n,o=e.substring(t+1,e.length-1);if("color"===r){if(o=o.split(" "),n=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error(Me(10,n))}else o=o.split(",");return o=o.map(e=>parseFloat(e)),{type:r,values:o,colorSpace:n}}const sr=e=>{const t=ar(e);return t.values.slice(0,3).map((e,r)=>-1!==t.type.indexOf("hsl")&&0!==r?"".concat(e,"%"):e).join(" ")};var lr=r(9526);const cr=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=e;t.forEach((e,i)=>{i===t.length-1?Array.isArray(o)?o[Number(e)]=r:o&&"object"===typeof o&&(o[e]=r):o&&"object"===typeof o&&(o[e]||(o[e]=n.includes(e)?[]:{}),o=o[e])})},dr=(e,t)=>{if("number"===typeof t){if(["lineHeight","fontWeight","opacity","zIndex"].some(t=>e.includes(t)))return t;return e[e.length-1].toLowerCase().indexOf("opacity")>=0?t:"".concat(t,"px")}return t};function ur(e,t){const r=t||{},n=r.prefix,o=r.shouldSkipGeneratingVar,i={},a={},l={};var c,d;return c=(e,t,r)=>{if(("string"===typeof t||"number"===typeof t)&&(!o||!o(e,t))){const o="--".concat(n?"".concat(n,"-"):"").concat(e.join("-"));Object.assign(i,{[o]:dr(e,t)}),cr(a,e,"var(".concat(o,")"),r),cr(l,e,"var(".concat(o,", ").concat(t,")"),r)}},d=e=>"vars"===e[0],function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Object.entries(t).forEach(t=>{let o=(0,s.A)(t,2),i=o[0],a=o[1];(!d||d&&!d([...r,i]))&&void 0!==a&&null!==a&&("object"===typeof a&&Object.keys(a).length>0?e(a,[...r,i],Array.isArray(a)?[...n,i]:n):c([...r,i],a,n))})}(e),{css:i,vars:a,varsWithDefaults:l}}const hr=["colorSchemes","components","defaultColorScheme"];const pr=function(e,t){const r=e.colorSchemes,n=void 0===r?{}:r,o=e.defaultColorScheme,i=void 0===o?"light":o,a=ur((0,Ie.A)(e,hr),t),l=a.vars,c=a.css;let d=a.varsWithDefaults;const u={},h=n[i],p=(0,Ie.A)(n,[i].map(lr.A));if(Object.entries(p||{}).forEach(e=>{let r=(0,s.A)(e,2),n=r[0];const o=ur(r[1],t),i=o.vars,a=o.css,l=o.varsWithDefaults;d=Ne(d,l),u[n]={css:a,vars:i}}),h){const e=ur(h,t),r=e.css,n=e.vars,o=e.varsWithDefaults;d=Ne(d,o),u[i]={css:r,vars:n}}return{vars:d,generateCssVars:e=>{var r;if(!e){var n;const r=(0,je.A)({},c);return{css:r,vars:l,selector:(null==t||null==(n=t.getSelector)?void 0:n.call(t,e,r))||":root"}}const o=(0,je.A)({},u[e].css);return{css:o,vars:u[e].vars,selector:(null==t||null==(r=t.getSelector)?void 0:r.call(t,e,o))||":root"}}}},vr=(0,je.A)({},Nt,{borderRadius:{themeKey:"radius"},boxShadow:{themeKey:"shadow"},fontFamily:{themeKey:"fontFamily"},fontSize:{themeKey:"fontSize"},fontWeight:{themeKey:"fontWeight"},letterSpacing:{themeKey:"letterSpacing"},lineHeight:{themeKey:"lineHeight"}}),fr={grey:{50:"#FBFCFE",100:"#F0F4F8",200:"#DDE7EE",300:"#CDD7E1",400:"#9FA6AD",500:"#636B74",600:"#555E68",700:"#32383E",800:"#171A1C",900:"#0B0D0E"},blue:{50:"#EDF5FD",100:"#E3EFFB",200:"#C7DFF7",300:"#97C3F0",400:"#4393E4",500:"#0B6BCB",600:"#185EA5",700:"#12467B",800:"#0A2744",900:"#051423"},yellow:{50:"#FEFAF6",100:"#FDF0E1",200:"#FCE1C2",300:"#F3C896",400:"#EA9A3E",500:"#9A5B13",600:"#72430D",700:"#492B08",800:"#2E1B05",900:"#1D1002"},red:{50:"#FEF6F6",100:"#FCE4E4",200:"#F7C5C5",300:"#F09898",400:"#E47474",500:"#C41C1C",600:"#A51818",700:"#7D1212",800:"#430A0A",900:"#240505"},green:{50:"#F6FEF6",100:"#E3FBE3",200:"#C7F7C7",300:"#A1E8A1",400:"#51BC51",500:"#1F7A1F",600:"#136C13",700:"#0A470A",800:"#042F04",900:"#021D02"}};function mr(e){var t;return!!e[0].match(/^(typography|variants|breakpoints)$/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!(null==(t=e[1])||!t.match(/^(mode)$/))||"focus"===e[0]&&"thickness"!==e[1]}const gr={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function yr(e,t){const r=gr[t];return r?"".concat(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui","-").concat(r):"".concat(or.generate(e),"-").concat(t)}function br(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const n={};return t.forEach(t=>{n[t]=yr(e,t,r)}),n}const xr=(e,t)=>yr(e,t,"Mui"),wr=(e,t)=>br(e,t,"Mui"),Sr=(e,t,r)=>{t.includes("Color")&&(e.color=r),t.includes("Bg")&&(e.backgroundColor=r),t.includes("Border")&&(e.borderColor=r)},kr=(e,t,r)=>{const n={};return Object.entries(t||{}).forEach(t=>{let o=(0,s.A)(t,2),i=o[0],a=o[1];if(i.match(new RegExp("".concat(e,"(color|bg|border)"),"i"))&&a){const e=r?r(i):a;i.includes("Disabled")&&(n.pointerEvents="none",n.cursor="default",n["--Icon-color"]="currentColor"),i.match(/(Hover|Active|Disabled)/)||(n["--variant-borderWidth"]||(n["--variant-borderWidth"]="0px"),i.includes("Border")&&(n["--variant-borderWidth"]="1px",n.border="var(--variant-borderWidth) solid")),Sr(n,i,e)}}),n},_r=(e,t)=>{let r={};if(t){const n=t.getCssVar,o=t.palette;Object.entries(o).forEach(t=>{const i=(0,s.A)(t,2),a=i[0],l=i[1];(e=>e&&"object"===typeof e&&Object.keys(e).some(e=>{var t;return null==(t=e.match)?void 0:t.call(e,/^(plain(Hover|Active|Disabled)?(Color|Bg)|outlined(Hover|Active|Disabled)?(Color|Border|Bg)|soft(Hover|Active|Disabled)?(Color|Bg)|solid(Hover|Active|Disabled)?(Color|Bg))$/)}))(l)&&"object"===typeof l&&(r=(0,je.A)({},r,{[a]:kr(e,l,e=>"var(--variant-".concat(e,", ").concat(n("palette-".concat(a,"-").concat(e),o[a][e]),")"))}))})}return r.context=kr(e,{plainColor:"var(--variant-plainColor)",plainHoverColor:"var(--variant-plainHoverColor)",plainHoverBg:"var(--variant-plainHoverBg)",plainActiveBg:"var(--variant-plainActiveBg)",plainDisabledColor:"var(--variant-plainDisabledColor)",outlinedColor:"var(--variant-outlinedColor)",outlinedBorder:"var(--variant-outlinedBorder)",outlinedHoverColor:"var(--variant-outlinedHoverColor)",outlinedHoverBorder:"var(--variant-outlinedHoverBorder)",outlinedHoverBg:"var(--variant-outlinedHoverBg)",outlinedActiveBg:"var(--variant-outlinedActiveBg)",outlinedDisabledColor:"var(--variant-outlinedDisabledColor)",outlinedDisabledBorder:"var(--variant-outlinedDisabledBorder)",softColor:"var(--variant-softColor)",softBg:"var(--variant-softBg)",softHoverColor:"var(--variant-softHoverColor)",softHoverBg:"var(--variant-softHoverBg)",softActiveBg:"var(--variant-softActiveBg)",softDisabledColor:"var(--variant-softDisabledColor)",softDisabledBg:"var(--variant-softDisabledBg)",solidColor:"var(--variant-solidColor)",solidBg:"var(--variant-solidBg)",solidHoverBg:"var(--variant-solidHoverBg)",solidActiveBg:"var(--variant-solidActiveBg)",solidDisabledColor:"var(--variant-solidDisabledColor)",solidDisabledBg:"var(--variant-solidDisabledBg)"}),r},Cr=["cssVarPrefix","breakpoints","spacing","components","variants","shouldSkipGeneratingVar"],Ar=["colorSchemes"];function jr(e){var t,r,n,o,i,a,l,c,d,u;const h=e||{},p=h.cssVarPrefix,v=void 0===p?"joy":p,f=h.breakpoints,m=h.spacing,g=h.components,y=h.variants,b=h.shouldSkipGeneratingVar,x=void 0===b?mr:b,w=(0,Ie.A)(h,Cr),S=function(){return ir(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"joy")}(v),k={primary:fr.blue,neutral:fr.grey,danger:fr.red,success:fr.green,warning:fr.yellow,common:{white:"#FFF",black:"#000"}},_=e=>{var t;const r=e.split("-"),n=r[1],o=r[2];return S(e,null==(t=k[n])?void 0:t[o])},C=e=>({plainColor:_("palette-".concat(e,"-500")),plainHoverBg:_("palette-".concat(e,"-100")),plainActiveBg:_("palette-".concat(e,"-200")),plainDisabledColor:_("palette-neutral-400"),outlinedColor:_("palette-".concat(e,"-500")),outlinedBorder:_("palette-".concat(e,"-300")),outlinedHoverBg:_("palette-".concat(e,"-100")),outlinedActiveBg:_("palette-".concat(e,"-200")),outlinedDisabledColor:_("palette-neutral-400"),outlinedDisabledBorder:_("palette-neutral-200"),softColor:_("palette-".concat(e,"-700")),softBg:_("palette-".concat(e,"-100")),softHoverBg:_("palette-".concat(e,"-200")),softActiveColor:_("palette-".concat(e,"-800")),softActiveBg:_("palette-".concat(e,"-300")),softDisabledColor:_("palette-neutral-400"),softDisabledBg:_("palette-neutral-50"),solidColor:_("palette-common-white"),solidBg:_("palette-".concat(e,"-500")),solidHoverBg:_("palette-".concat(e,"-600")),solidActiveBg:_("palette-".concat(e,"-700")),solidDisabledColor:_("palette-neutral-400"),solidDisabledBg:_("palette-neutral-100")}),A=e=>({plainColor:_("palette-".concat(e,"-300")),plainHoverBg:_("palette-".concat(e,"-800")),plainActiveBg:_("palette-".concat(e,"-700")),plainDisabledColor:_("palette-neutral-500"),outlinedColor:_("palette-".concat(e,"-200")),outlinedBorder:_("palette-".concat(e,"-700")),outlinedHoverBg:_("palette-".concat(e,"-800")),outlinedActiveBg:_("palette-".concat(e,"-700")),outlinedDisabledColor:_("palette-neutral-500"),outlinedDisabledBorder:_("palette-neutral-800"),softColor:_("palette-".concat(e,"-200")),softBg:_("palette-".concat(e,"-800")),softHoverBg:_("palette-".concat(e,"-700")),softActiveColor:_("palette-".concat(e,"-100")),softActiveBg:_("palette-".concat(e,"-600")),softDisabledColor:_("palette-neutral-500"),softDisabledBg:_("palette-neutral-800"),solidColor:_("palette-common-white"),solidBg:_("palette-".concat(e,"-500")),solidHoverBg:_("palette-".concat(e,"-600")),solidActiveBg:_("palette-".concat(e,"-700")),solidDisabledColor:_("palette-neutral-500"),solidDisabledBg:_("palette-neutral-800")}),j={palette:{mode:"light",primary:(0,je.A)({},k.primary,C("primary")),neutral:(0,je.A)({},k.neutral,C("neutral"),{plainColor:_("palette-neutral-700"),plainHoverColor:_("palette-neutral-900"),outlinedColor:_("palette-neutral-700")}),danger:(0,je.A)({},k.danger,C("danger")),success:(0,je.A)({},k.success,C("success")),warning:(0,je.A)({},k.warning,C("warning")),common:{white:"#FFF",black:"#000"},text:{primary:_("palette-neutral-800"),secondary:_("palette-neutral-700"),tertiary:_("palette-neutral-600"),icon:_("palette-neutral-500")},background:{body:_("palette-common-white"),surface:_("palette-neutral-50"),popup:_("palette-common-white"),level1:_("palette-neutral-100"),level2:_("palette-neutral-200"),level3:_("palette-neutral-300"),tooltip:_("palette-neutral-500"),backdrop:"rgba(".concat(S("palette-neutral-darkChannel",sr(k.neutral[900]))," / 0.25)")},divider:"rgba(".concat(S("palette-neutral-mainChannel",sr(k.neutral[500]))," / 0.2)"),focusVisible:_("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"21 21 21",shadowOpacity:"0.08"},I={palette:{mode:"dark",primary:(0,je.A)({},k.primary,A("primary")),neutral:(0,je.A)({},k.neutral,A("neutral"),{plainColor:_("palette-neutral-300"),plainHoverColor:_("palette-neutral-300")}),danger:(0,je.A)({},k.danger,A("danger")),success:(0,je.A)({},k.success,A("success")),warning:(0,je.A)({},k.warning,A("warning")),common:{white:"#FFF",black:"#000"},text:{primary:_("palette-neutral-100"),secondary:_("palette-neutral-300"),tertiary:_("palette-neutral-400"),icon:_("palette-neutral-400")},background:{body:_("palette-common-black"),surface:_("palette-neutral-900"),popup:_("palette-common-black"),level1:_("palette-neutral-800"),level2:_("palette-neutral-700"),level3:_("palette-neutral-600"),tooltip:_("palette-neutral-600"),backdrop:"rgba(".concat(S("palette-neutral-darkChannel",sr(k.neutral[50]))," / 0.25)")},divider:"rgba(".concat(S("palette-neutral-mainChannel",sr(k.neutral[500]))," / 0.16)"),focusVisible:_("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"0 0 0",shadowOpacity:"0.6"},P='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',R=(0,je.A)({body:'"Inter", '.concat(S("fontFamily-fallback, ".concat(P))),display:'"Inter", '.concat(S("fontFamily-fallback, ".concat(P))),code:"Source Code Pro,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",fallback:P},w.fontFamily),T=(0,je.A)({sm:300,md:500,lg:600,xl:700},w.fontWeight),E=(0,je.A)({xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem"},w.fontSize),z=(0,je.A)({xs:"1.33334",sm:"1.42858",md:"1.5",lg:"1.55556",xl:"1.66667"},w.lineHeight),D=null!=(t=null==(r=w.colorSchemes)||null==(r=r.light)?void 0:r.shadowRing)?t:j.shadowRing,M=null!=(n=null==(o=w.colorSchemes)||null==(o=o.light)?void 0:o.shadowChannel)?n:j.shadowChannel,L=null!=(i=null==(a=w.colorSchemes)||null==(a=a.light)?void 0:a.shadowOpacity)?i:j.shadowOpacity,O={colorSchemes:{light:j,dark:I},fontSize:E,fontFamily:R,fontWeight:T,focus:{thickness:"2px",selector:"&.".concat(xr("","focusVisible"),", &:focus-visible"),default:{outlineOffset:"var(--focus-outline-offset, ".concat(S("focus-thickness",null!=(l=null==(c=w.focus)?void 0:c.thickness)?l:"2px"),")"),outline:"".concat(S("focus-thickness",null!=(d=null==(u=w.focus)?void 0:u.thickness)?d:"2px")," solid ").concat(S("palette-focusVisible",k.primary[500]))}},lineHeight:z,radius:{xs:"2px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},shadow:{xs:"".concat(S("shadowRing",D),", 0px 1px 2px 0px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),")"),sm:"".concat(S("shadowRing",D),", 0px 1px 2px 0px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),"), 0px 2px 4px 0px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),")"),md:"".concat(S("shadowRing",D),", 0px 2px 8px -2px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),"), 0px 6px 12px -2px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),")"),lg:"".concat(S("shadowRing",D),", 0px 2px 8px -2px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),"), 0px 12px 16px -4px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),")"),xl:"".concat(S("shadowRing",D),", 0px 2px 8px -2px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),"), 0px 20px 24px -4px rgba(").concat(S("shadowChannel",M)," / ").concat(S("shadowOpacity",L),")")},zIndex:{badge:1,table:10,popup:1e3,modal:1300,snackbar:1400,tooltip:1500},typography:{h1:{fontFamily:S("fontFamily-display, ".concat(R.display)),fontWeight:S("fontWeight-xl, ".concat(T.xl)),fontSize:S("fontSize-xl4, ".concat(E.xl4)),lineHeight:S("lineHeight-xs, ".concat(z.xs)),letterSpacing:"-0.025em",color:S("palette-text-primary, ".concat(j.palette.text.primary))},h2:{fontFamily:S("fontFamily-display, ".concat(R.display)),fontWeight:S("fontWeight-xl, ".concat(T.xl)),fontSize:S("fontSize-xl3, ".concat(E.xl3)),lineHeight:S("lineHeight-xs, ".concat(z.xs)),letterSpacing:"-0.025em",color:S("palette-text-primary, ".concat(j.palette.text.primary))},h3:{fontFamily:S("fontFamily-display, ".concat(R.display)),fontWeight:S("fontWeight-lg, ".concat(T.lg)),fontSize:S("fontSize-xl2, ".concat(E.xl2)),lineHeight:S("lineHeight-xs, ".concat(z.xs)),letterSpacing:"-0.025em",color:S("palette-text-primary, ".concat(j.palette.text.primary))},h4:{fontFamily:S("fontFamily-display, ".concat(R.display)),fontWeight:S("fontWeight-lg, ".concat(T.lg)),fontSize:S("fontSize-xl, ".concat(E.xl)),lineHeight:S("lineHeight-md, ".concat(z.md)),letterSpacing:"-0.025em",color:S("palette-text-primary, ".concat(j.palette.text.primary))},"title-lg":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontWeight:S("fontWeight-lg, ".concat(T.lg)),fontSize:S("fontSize-lg, ".concat(E.lg)),lineHeight:S("lineHeight-xs, ".concat(z.xs)),color:S("palette-text-primary, ".concat(j.palette.text.primary))},"title-md":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontWeight:S("fontWeight-md, ".concat(T.md)),fontSize:S("fontSize-md, ".concat(E.md)),lineHeight:S("lineHeight-md, ".concat(z.md)),color:S("palette-text-primary, ".concat(j.palette.text.primary))},"title-sm":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontWeight:S("fontWeight-md, ".concat(T.md)),fontSize:S("fontSize-sm, ".concat(E.sm)),lineHeight:S("lineHeight-sm, ".concat(z.sm)),color:S("palette-text-primary, ".concat(j.palette.text.primary))},"body-lg":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontSize:S("fontSize-lg, ".concat(E.lg)),lineHeight:S("lineHeight-md, ".concat(z.md)),color:S("palette-text-secondary, ".concat(j.palette.text.secondary))},"body-md":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontSize:S("fontSize-md, ".concat(E.md)),lineHeight:S("lineHeight-md, ".concat(z.md)),color:S("palette-text-secondary, ".concat(j.palette.text.secondary))},"body-sm":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontSize:S("fontSize-sm, ".concat(E.sm)),lineHeight:S("lineHeight-md, ".concat(z.md)),color:S("palette-text-tertiary, ".concat(j.palette.text.tertiary))},"body-xs":{fontFamily:S("fontFamily-body, ".concat(R.body)),fontWeight:S("fontWeight-md, ".concat(T.md)),fontSize:S("fontSize-xs, ".concat(E.xs)),lineHeight:S("lineHeight-md, ".concat(z.md)),color:S("palette-text-tertiary, ".concat(j.palette.text.tertiary))}}},F=w?Ne(O,w):O,N=F.colorSchemes,B=(0,Ie.A)(F,Ar),H=(0,je.A)({colorSchemes:N},B,{breakpoints:Ut(null!=f?f:{}),components:Ne({MuiSvgIcon:{defaultProps:{fontSize:"xl2"},styleOverrides:{root:e=>{let t=e.ownerState,r=e.theme;var n;const o=t.instanceFontSize;return(0,je.A)({margin:"var(--Icon-margin)"},t.fontSize&&"inherit"!==t.fontSize&&{fontSize:"var(--Icon-fontSize, ".concat(r.vars.fontSize[t.fontSize],")")},!t.htmlColor&&(0,je.A)({color:"var(--Icon-color, ".concat(H.vars.palette.text.icon,")")},t.color&&"inherit"!==t.color&&r.vars.palette[t.color]&&{color:"rgba(".concat(null==(n=r.vars.palette[t.color])?void 0:n.mainChannel," / 1)")}),o&&"inherit"!==o&&{"--Icon-fontSize":r.vars.fontSize[o]})}}}},g),cssVarPrefix:v,getCssVar:S,spacing:Kt(m)});Object.entries(H.colorSchemes).forEach(e=>{let t=(0,s.A)(e,2);!function(e,t){Object.keys(t).forEach(r=>{const n={main:"500",light:"200",dark:"700"};"dark"===e&&(n.main=400),!t[r].mainChannel&&t[r][n.main]&&(t[r].mainChannel=sr(t[r][n.main])),!t[r].lightChannel&&t[r][n.light]&&(t[r].lightChannel=sr(t[r][n.light])),!t[r].darkChannel&&t[r][n.dark]&&(t[r].darkChannel=sr(t[r][n.dark]))})}(t[0],t[1].palette)});const W={prefix:v,shouldSkipGeneratingVar:x},V=pr((0,je.A)({colorSchemes:N},B),W),$=V.vars,U=V.generateCssVars;H.vars=$,H.generateCssVars=U,H.unstable_sxConfig=(0,je.A)({},vr,null==e?void 0:e.unstable_sxConfig),H.unstable_sx=function(e){return Ht({sx:e,theme:this})},H.getColorSchemeSelector=e=>"light"===e?"&":'&[data-joy-color-scheme="'.concat(e,'"], [data-joy-color-scheme="').concat(e,'"] &');const q={getCssVar:S,palette:H.colorSchemes.light.palette};return H.variants=Ne({plain:_r("plain",q),plainHover:_r("plainHover",q),plainActive:_r("plainActive",q),plainDisabled:_r("plainDisabled",q),outlined:_r("outlined",q),outlinedHover:_r("outlinedHover",q),outlinedActive:_r("outlinedActive",q),outlinedDisabled:_r("outlinedDisabled",q),soft:_r("soft",q),softHover:_r("softHover",q),softActive:_r("softActive",q),softDisabled:_r("softDisabled",q),solid:_r("solid",q),solidHover:_r("solidHover",q),solidActive:_r("solidActive",q),solidDisabled:_r("solidDisabled",q)},y),H.palette=(0,je.A)({},H.colorSchemes.light.palette,{colorScheme:"light"}),H.shouldSkipGeneratingVar=x,H.applyStyles=Gt,H}const Ir=jr(),Pr=br("MuiBox",["root"]),Rr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.themeId,r=e.defaultTheme,n=e.defaultClassName,i=void 0===n?"MuiBox-root":n,a=e.generateClassName,s=Ee("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(Ht),l=o.forwardRef(function(e,n){const o=er(r),l=Vt(e),c=l.className,d=l.component,u=void 0===d?"div":d,h=(0,Ie.A)(l,rr);return(0,tr.jsx)(s,(0,je.A)({as:u,ref:n,className:(0,Pe.A)(c,a?a(i):i),theme:t&&o[t]||o},h))});return l}({themeId:"$$joy",defaultTheme:Ir,defaultClassName:Pr.root,generateClassName:or.generate}),Tr=Rr;const Er={Header:function(e){return(0,tr.jsx)(Tr,(0,Ae.A)((0,Ae.A)({component:"header",className:"Header"},e),{},{sx:[{p:2,gap:2,bgcolor:"background.surface",display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gridColumn:"1 / -1",borderBottom:"1px solid",borderColor:"divider",position:"sticky",top:0,zIndex:1100},...Array.isArray(e.sx)?e.sx:[e.sx]]}))},Main:function(e){return(0,tr.jsx)(Tr,(0,Ae.A)((0,Ae.A)({component:"main",className:"Main"},e),{},{sx:[{bgcolor:"background.body"},...Array.isArray(e.sx)?e.sx:[e.sx]]}))},SideNav:function(e){return(0,tr.jsx)(Tr,(0,Ae.A)((0,Ae.A)({component:"nav",className:"Navigation"},e),{},{sx:[{p:2,bgcolor:"background.surface",borderRight:"1px solid",borderColor:"divider",display:{xs:"none",sm:"initial"}},...Array.isArray(e.sx)?e.sx:[e.sx]]}))},Root:function(e){return(0,tr.jsx)(Tr,(0,Ae.A)((0,Ae.A)({},e),{},{sx:[{bgcolor:"background.body",display:"grid",gridTemplateColumns:{xs:"1fr",sm:"minmax(64px, 200px) minmax(0, 1fr)",md:"minmax(160px, 300px) minmax(0, 1fr)"},gridTemplateRows:"64px 1fr",minHeight:"100vh"},...Array.isArray(e.sx)?e.sx:[e.sx]]}))}};function zr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Dr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};return Object.keys(e).forEach(o=>{n[o]=e[o].reduce((e,n)=>{if(n){const o=t(n);""!==o&&e.push(o),r&&r[n]&&e.push(r[n])}return e},[]).join(" ")}),n}var Mr=r(1722),Lr=r(9436),Or=(r(219),function(e,t){var r=arguments;if(null==t||!Yt.h.call(t,"css"))return o.createElement.apply(void 0,r);var n=r.length,i=new Array(n);i[0]=Yt.E,i[1]=(0,Yt.c)(e,t);for(var a=2;aGr(e,(0,je.A)({ownerState:n},o),r));if(i&&"object"===typeof i&&Array.isArray(i.variants)){const e=i.variants,t=void 0===e?[]:e;let a=(0,Ie.A)(i,Wr);return t.forEach(e=>{let t=!0;if("function"===typeof e.props?t=e.props((0,je.A)({ownerState:n},o,n)):Object.keys(e.props).forEach(r=>{(null==n?void 0:n[r])!==e.props[r]&&o[r]!==e.props[r]&&(t=!1)}),t){Array.isArray(a)||(a=[a]);const t="function"===typeof e.style?e.style((0,je.A)({ownerState:n},o,n)):e.style;a.push(r?Ur(De(t),r):t)}}),a}return r?Ur(De(i),r):i}function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.themeId,r=e.defaultTheme,n=void 0===r?qr:r,o=e.rootShouldForwardProp,i=void 0===o?$r:o,a=e.slotShouldForwardProp,l=void 0===a?$r:a,c=e=>Ht((0,je.A)({},e,{theme:Kr((0,je.A)({},e,{defaultTheme:n,themeId:t}))}));return c.__mui_systemSx=!0,function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};((e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))})(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const o=r.name,a=r.slot,d=r.skipVariantsResolver,u=r.skipSx,h=r.overridesResolver,p=void 0===h?(f=(m=a)?m.charAt(0).toLowerCase()+m.slice(1):m)?(e,t)=>t[f]:null:h,v=(0,Ie.A)(r,Vr);var f,m;const g=o&&o.startsWith("Mui")||a?"components":"custom",y=void 0!==d?d:a&&"Root"!==a&&"root"!==a||!1,b=u||!1;let x=$r;"Root"===a||"root"===a?x=i:a?x=l:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(x=void 0);const w=Ee(e,(0,je.A)({shouldForwardProp:x,label:void 0},v)),S=e=>"function"===typeof e&&e.__emotion_real!==e||Oe(e)?r=>{const o=Kr({theme:r.theme,defaultTheme:n,themeId:t});return Gr(e,(0,je.A)({},r,{theme:o}),o.modularCssLayers?g:void 0)}:e,k=function(r){let i=S(r);for(var a=arguments.length,l=new Array(a>1?a-1:0),d=1;d{const r=Kr((0,je.A)({},e,{defaultTheme:n,themeId:t}));if(!r.components||!r.components[o]||!r.components[o].styleOverrides)return null;const i=r.components[o].styleOverrides,a={};return Object.entries(i).forEach(t=>{let n=(0,s.A)(t,2),o=n[0],i=n[1];a[o]=Gr(i,(0,je.A)({},e,{theme:r}),r.modularCssLayers?"theme":void 0)}),p(e,a)}),o&&!y&&u.push(e=>{var r;const i=Kr((0,je.A)({},e,{defaultTheme:n,themeId:t}));return Gr({variants:null==i||null==(r=i.components)||null==(r=r[o])?void 0:r.variants},(0,je.A)({},e,{theme:i}),i.modularCssLayers?"theme":void 0)}),b||u.push(c);const h=u.length-l.length;if(Array.isArray(r)&&h>0){const e=new Array(h).fill("");i=[...r,...e],i.raw=[...r.raw,...e]}const v=w(i,...u);return e.muiName&&(v.muiName=e.muiName),v};return w.withConfig&&(k.withConfig=w.withConfig),k}}const Qr=Jr({defaultTheme:Ir,themeId:"$$joy"});function Yr(e,t){const r=(0,je.A)({},t);return Object.keys(e).forEach(n=>{if(n.toString().match(/^(components|slots)$/))r[n]=(0,je.A)({},e[n],r[n]);else if(n.toString().match(/^(componentsProps|slotProps)$/)){const o=e[n]||{},i=t[n];r[n]={},i&&Object.keys(i)?o&&Object.keys(o)?(r[n]=(0,je.A)({},i),Object.keys(o).forEach(e=>{r[n][e]=Yr(o[e],i[e])})):r[n]=i:r[n]=o}else void 0===r[n]&&(r[n]=e[n])}),r}function Xr(e){const t=e.theme,r=e.name,n=e.props;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Yr(t.components[r].defaultProps,n):n}function Zr(e){let t=e.props,r=e.name,n=e.defaultTheme,o=e.themeId,i=er(n);o&&(i=i[o]||i);return Xr({theme:i,name:r,props:t})}function en(e){return Zr({props:e.props,name:e.name,defaultTheme:(0,je.A)({},Ir,{components:{}}),themeId:"$$joy"})}function tn(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function rn(){for(var e=arguments.length,t=new Array(e),r=0;rt.every(e=>null==e)?null:e=>{t.forEach(t=>{tn(t,e)})},t)}const nn=function(e,t,r){return"function"===typeof e?e(t,r):e};const on=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};const r={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&"function"===typeof e[r]&&!t.includes(r)).forEach(t=>{r[t]=e[t]}),r};const an=function(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"===typeof e[t])).forEach(r=>{t[r]=e[r]}),t};const sn=function(e){const t=e.getSlotProps,r=e.additionalProps,n=e.externalSlotProps,o=e.externalForwardedProps,i=e.className;if(!t){const e=(0,Pe.A)(null==r?void 0:r.className,i,null==o?void 0:o.className,null==n?void 0:n.className),t=(0,je.A)({},null==r?void 0:r.style,null==o?void 0:o.style,null==n?void 0:n.style),a=(0,je.A)({},r,o,n);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=on((0,je.A)({},o,n)),s=an(n),l=an(o),c=t(a),d=(0,Pe.A)(null==c?void 0:c.className,null==r?void 0:r.className,i,null==o?void 0:o.className,null==n?void 0:n.className),u=(0,je.A)({},null==c?void 0:c.style,null==r?void 0:r.style,null==o?void 0:o.style,null==n?void 0:n.style),h=(0,je.A)({},c,r,l,s);return d.length>0&&(h.className=d),Object.keys(u).length>0&&(h.style=u),{props:h,internalRef:c.ref}};const ln=function(e){return"string"===typeof e};const cn=function(e,t,r){return void 0===e||ln(e)?t:(0,je.A)({},t,{ownerState:(0,je.A)({},t.ownerState,r)})},dn=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],un=["component","slots","slotProps"],hn=["component"];function pn(e,t){const r=t.className,n=t.elementType,o=t.ownerState,i=t.externalForwardedProps,a=t.getSlotOwnerState,s=t.internalForwardedProps,l=(0,Ie.A)(t,dn),c=i.component,d=i.slots,u=void 0===d?{[e]:void 0}:d,h=i.slotProps,p=void 0===h?{[e]:void 0}:h,v=(0,Ie.A)(i,un),f=u[e]||n,m=nn(p[e],o),g=sn((0,je.A)({className:r},l,{externalForwardedProps:"root"===e?v:void 0,externalSlotProps:m})),y=g.props.component,b=g.internalRef,x=(0,Ie.A)(g.props,hn),w=rn(b,null==m?void 0:m.ref,t.ref),S=a?a(x):{},k=(0,je.A)({},o,S),_="root"===e?y||c:y,C=cn(f,(0,je.A)({},"root"===e&&!c&&!u[e]&&s,"root"!==e&&!u[e]&&s,x,_&&{as:_},{ref:w}),k);return Object.keys(S).forEach(e=>{delete C[e]}),[f,C]}function vn(e){return xr("MuiCircularProgress",e)}wr("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);var fn;let mn;const gn=["color","backgroundColor"],yn=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],bn=Br({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}});function xn(e,t){return"var(--CircularProgress-".concat(e,"Thickness, var(--CircularProgress-thickness, ").concat(t,"))")}const wn=Qr("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o,i,a;const s=(null==(n=r.variants[t.variant])?void 0:n[t.color])||{},l=s.color,c=s.backgroundColor,d=(0,Ie.A)(s,gn);return(0,je.A)({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":c,"--CircularProgress-progressColor":l,"--CircularProgress-percent":t.value,"--CircularProgress-linecap":"round"},"sm"===t.size&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":xn("track","3px"),"--_progress-thickness":xn("progress","3px")},"sm"===t.instanceSize&&{"--CircularProgress-size":"24px"},"md"===t.size&&{"--_track-thickness":xn("track","6px"),"--_progress-thickness":xn("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},"md"===t.instanceSize&&{"--CircularProgress-size":"40px"},"lg"===t.size&&{"--_track-thickness":xn("track","8px"),"--_progress-thickness":xn("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},"lg"===t.instanceSize&&{"--CircularProgress-size":"64px"},t.thickness&&{"--_track-thickness":"".concat(t.thickness,"px"),"--_progress-thickness":"".concat(t.thickness,"px")},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:l},t.children&&{fontFamily:r.vars.fontFamily.body,fontWeight:r.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},d,"outlined"===t.variant&&{"&::before":(0,je.A)({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},d)},"soft"===t.variant&&{"--CircularProgress-trackColor":r.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":null==(o=r.variants.solid)?void 0:o[t.color].backgroundColor},"solid"===t.variant&&{"--CircularProgress-trackColor":null==(i=r.variants.softHover)?void 0:i[t.color].backgroundColor,"--CircularProgress-progressColor":null==(a=r.variants.solid)?void 0:a[t.color].backgroundColor})}),Sn=Qr("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),kn=Qr("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(e,t)=>t.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),_n=Qr("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(e,t)=>t.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},e=>!e.ownerState.determinate&&Nr(mn||(mn=fn||(fn=zr(["\n animation: var(--CircularProgress-circulation, 0.8s linear 0s infinite normal none running)\n ",";\n "]))),bn)),Cn=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyCircularProgress"}),n=r.children,o=r.className,i=r.color,a=void 0===i?"primary":i,l=r.size,c=void 0===l?"md":l,d=r.variant,u=void 0===d?"soft":d,h=r.thickness,p=r.determinate,v=void 0!==p&&p,f=r.value,m=void 0===f?v?0:25:f,g=r.component,y=r.slots,b=void 0===y?{}:y,x=r.slotProps,w=void 0===x?{}:x,S=(0,Ie.A)(r,yn),k=(0,je.A)({},r,{color:a,size:c,variant:u,thickness:h,value:m,determinate:v,instanceSize:e.size}),_=(e=>{const t=e.determinate,r=e.color,n=e.variant,o=e.size;return Dr({root:["root",t&&"determinate",r&&"color".concat(Le(r)),n&&"variant".concat(Le(n)),o&&"size".concat(Le(o))],svg:["svg"],track:["track"],progress:["progress"]},vn,{})})(k),C=(0,je.A)({},S,{component:g,slots:b,slotProps:w}),A=pn("root",{ref:t,className:(0,Pe.A)(_.root,o),elementType:wn,externalForwardedProps:C,ownerState:k,additionalProps:(0,je.A)({role:"progressbar",style:{"--CircularProgress-percent":m}},m&&v&&{"aria-valuenow":"number"===typeof m?Math.round(m):Math.round(Number(m||0))})}),j=(0,s.A)(A,2),I=j[0],P=j[1],R=pn("svg",{className:_.svg,elementType:Sn,externalForwardedProps:C,ownerState:k}),T=(0,s.A)(R,2),E=T[0],z=T[1],D=pn("track",{className:_.track,elementType:kn,externalForwardedProps:C,ownerState:k}),M=(0,s.A)(D,2),L=M[0],O=M[1],F=pn("progress",{className:_.progress,elementType:_n,externalForwardedProps:C,ownerState:k}),N=(0,s.A)(F,2),B=N[0],H=N[1];return(0,tr.jsxs)(I,(0,je.A)({},P,{children:[(0,tr.jsxs)(E,(0,je.A)({},z,{children:[(0,tr.jsx)(L,(0,je.A)({},O)),(0,tr.jsx)(B,(0,je.A)({},H))]})),n]}))}),An=Cn,jn=Jr(),In=["component","direction","spacing","divider","children","className","useFlexGap"],Pn=Qt(),Rn=jn("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function Tn(e){return Zr({props:e,name:"MuiStack",defaultTheme:Pn})}function En(e,t){const r=o.Children.toArray(e).filter(Boolean);return r.reduce((e,n,i)=>(e.push(n),i{let t=e.ownerState,r=e.theme,n=(0,je.A)({display:"flex",flexDirection:"column"},Ve({theme:r},qe({values:t.direction,breakpoints:r.breakpoints.values}),e=>({flexDirection:e})));if(t.spacing){const e=ot(r),o=Object.keys(r.breakpoints.values).reduce((e,r)=>(("object"===typeof t.spacing&&null!=t.spacing[r]||"object"===typeof t.direction&&null!=t.direction[r])&&(e[r]=!0),e),{}),i=qe({values:t.direction,base:o}),a=qe({values:t.spacing,base:o});"object"===typeof i&&Object.keys(i).forEach((e,t,r)=>{if(!i[e]){const n=t>0?i[r[t-1]]:"column";i[e]=n}});n=Ne(n,Ve({theme:r},a,(r,n)=>{return t.useFlexGap?{gap:it(e,r)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{["margin".concat((o=n?i[n]:t.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[o]))]:it(e,r)}};var o}))}return n=function(e){const t=$e(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;oNe(e,t),{});return Ue(Object.keys(t),i)}(r.breakpoints,n),n};const Dn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.createStyledComponent,r=void 0===t?Rn:t,n=e.useThemeProps,i=void 0===n?Tn:n,a=e.componentName,s=void 0===a?"MuiStack":a,l=r(zn),c=o.forwardRef(function(e,t){const r=Vt(i(e)),n=r.component,o=void 0===n?"div":n,a=r.direction,c=void 0===a?"column":a,d=r.spacing,u=void 0===d?0:d,h=r.divider,p=r.children,v=r.className,f=r.useFlexGap,m=void 0!==f&&f,g=(0,Ie.A)(r,In),y={direction:c,spacing:u,useFlexGap:m},b=Dr({root:["root"]},e=>yr(s,e),{});return(0,tr.jsx)(l,(0,je.A)({as:o,ownerState:y,ref:t,className:(0,Pe.A)(b.root,v)},g,{children:h?En(p,h):p}))});return c}({createStyledComponent:Qr("div",{name:"JoyStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>en({props:e,name:"JoyStack"})}),Mn=Dn;function Ln(e,t){var r,n;return o.isValidElement(e)&&-1!==t.indexOf(null!=(r=e.type.muiName)?r:null==(n=e.type)||null==(n=n._payload)||null==(n=n.value)?void 0:n.muiName)}function On(e){return xr("MuiTypography",e)}const Fn=wr("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),Nn=["color","textColor"],Bn=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],Hn=o.createContext(!1);const Wn=o.createContext(!1);const Vn=Qr("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),$n=Qr("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),Un=Qr("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s;const l="inherit"!==r.level?null==(n=t.typography[r.level])?void 0:n.lineHeight:"1";return(0,je.A)({"--Icon-fontSize":"calc(1em * ".concat(l,")")},r.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},r.nesting?{display:"inline"}:(0,je.A)({display:"block"},r.unstable_hasSkeleton&&{position:"relative"}),(r.startDecorator||r.endDecorator)&&(0,je.A)({display:"flex",alignItems:"center"},r.nesting&&(0,je.A)({display:"inline-flex"},r.startDecorator&&{verticalAlign:"bottom"})),r.level&&"inherit"!==r.level&&t.typography[r.level],{fontSize:"var(--Typography-fontSize, ".concat(r.level&&"inherit"!==r.level&&null!=(o=null==(i=t.typography[r.level])?void 0:i.fontSize)?o:"inherit",")")},r.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r.gutterBottom&&{marginBottom:"0.35em"},r.color&&{color:"var(--variant-plainColor, rgba(".concat(null==(a=t.vars.palette[r.color])?void 0:a.mainChannel," / 1))")},r.variant&&(0,je.A)({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!r.nesting&&{marginInline:"-0.25em"},null==(s=t.variants[r.variant])?void 0:s[r.color]))}),qn={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},Kn=o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyTypography"}),i=n.color,a=n.textColor,l=(0,Ie.A)(n,Nn),c=o.useContext(Hn),d=o.useContext(Wn),u=Vt((0,je.A)({},l,{color:a})),h=u.component,p=u.gutterBottom,v=void 0!==p&&p,f=u.noWrap,m=void 0!==f&&f,g=u.level,y=void 0===g?"body-md":g,b=u.levelMapping,x=void 0===b?qn:b,w=u.children,S=u.endDecorator,k=u.startDecorator,_=u.variant,C=u.slots,A=void 0===C?{}:C,j=u.slotProps,I=void 0===j?{}:j,P=(0,Ie.A)(u,Bn),R=null!=(r=e.color)?r:_?null!=i?i:"neutral":i,T=c||d?e.level||"inherit":y,E=Ln(w,["Skeleton"]),z=h||(c?"span":x[T]||qn[T]||"span"),D=(0,je.A)({},u,{level:T,component:z,color:R,gutterBottom:v,noWrap:m,nesting:c,variant:_,unstable_hasSkeleton:E}),M=(e=>{const t=e.gutterBottom,r=e.noWrap,n=e.level,o=e.color,i=e.variant;return Dr({root:["root",n,t&&"gutterBottom",r&&"noWrap",o&&"color".concat(Le(o)),i&&"variant".concat(Le(i))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},On,{})})(D),L=(0,je.A)({},P,{component:z,slots:A,slotProps:I}),O=pn("root",{ref:t,className:M.root,elementType:Un,externalForwardedProps:L,ownerState:D}),F=(0,s.A)(O,2),N=F[0],B=F[1],H=pn("startDecorator",{className:M.startDecorator,elementType:Vn,externalForwardedProps:L,ownerState:D}),W=(0,s.A)(H,2),V=W[0],$=W[1],U=pn("endDecorator",{className:M.endDecorator,elementType:$n,externalForwardedProps:L,ownerState:D}),q=(0,s.A)(U,2),K=q[0],G=q[1];return(0,tr.jsx)(Hn.Provider,{value:!0,children:(0,tr.jsxs)(N,(0,je.A)({},B,{children:[k&&(0,tr.jsx)(V,(0,je.A)({},$,{children:k})),E?o.cloneElement(w,{variant:w.props.variant||"inline"}):w,S&&(0,tr.jsx)(K,(0,je.A)({},G,{children:S}))]}))})});Kn.muiName="Typography";const Gn=Kn,Jn={};const Qn=[];class Yn{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Yn}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function Xn(){const e=function(e,t){const r=o.useRef(Jn);return r.current===Jn&&(r.current=e(t)),r}(Yn.create).current;return function(e){o.useEffect(e,Qn)}(e.disposeEffect),e}let Zn=!0,eo=!1;const to=new Yn,ro={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function no(e){e.metaKey||e.altKey||e.ctrlKey||(Zn=!0)}function oo(){Zn=!1}function io(){"hidden"===this.visibilityState&&eo&&(Zn=!0)}function ao(e){const t=e.target;try{return t.matches(":focus-visible")}catch(r){}return Zn||function(e){const t=e.type,r=e.tagName;return!("INPUT"!==r||!ro[t]||e.readOnly)||"TEXTAREA"===r&&!e.readOnly||!!e.isContentEditable}(t)}function so(){const e=o.useCallback(e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",no,!0),t.addEventListener("mousedown",oo,!0),t.addEventListener("pointerdown",oo,!0),t.addEventListener("touchstart",oo,!0),t.addEventListener("visibilitychange",io,!0))},[]),t=o.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!ao(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(eo=!0,to.start(100,()=>{eo=!1}),t.current=!1,!0)},ref:e}}function lo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.disabled,r=void 0!==t&&t,n=e.focusableWhenDisabled,i=e.href,a=e.rootRef,l=e.tabIndex,c=e.to,d=e.type,u=e.rootElementName,h=o.useRef(null),p=o.useState(!1),v=(0,s.A)(p,2),f=v[0],m=v[1],g=so(),y=g.isFocusVisibleRef,b=g.onFocus,x=g.onBlur,w=g.ref,S=o.useState(!1),k=(0,s.A)(S,2),_=k[0],C=k[1];r&&!n&&_&&C(!1),o.useEffect(()=>{y.current=_},[_,y]);const A=function(e){const t=e.rootElementName,r=void 0===t?"":t,n=(e.componentName,o.useState(r.toUpperCase())),i=(0,s.A)(n,2),a=i[0],l=i[1];return[a,o.useCallback(e=>{var t;l(null!=(t=null==e?void 0:e.tagName)?t:"")},[])]}({rootElementName:null!=u?u:i||c?"a":void 0,componentName:"Button"}),j=(0,s.A)(A,2),I=j[0],P=j[1],R=e=>t=>{var r;_&&t.preventDefault(),null==(r=e.onMouseLeave)||r.call(e,t)},T=e=>t=>{var r,n;(h.current||(h.current=t.currentTarget),b(t),!0===y.current)&&(C(!0),null==(n=e.onFocusVisible)||n.call(e,t));null==(r=e.onFocus)||r.call(e,t)},E=()=>{const e=h.current;return"BUTTON"===I||"INPUT"===I&&["button","submit","reset"].includes(null==e?void 0:e.type)||"A"===I&&(null==e?void 0:e.href)},z=e=>t=>{var n;r||(null==(n=e.onClick)||n.call(e,t))},D=e=>t=>{var n;r||(m(!0),document.addEventListener("mouseup",()=>{m(!1)},{once:!0})),null==(n=e.onMouseDown)||n.call(e,t)},M=e=>t=>{var n,o;(null==(n=e.onKeyDown)||n.call(e,t),t.defaultMuiPrevented)||(t.target!==t.currentTarget||E()||" "!==t.key||t.preventDefault(),t.target!==t.currentTarget||" "!==t.key||r||m(!0),t.target!==t.currentTarget||E()||"Enter"!==t.key||r||(null==(o=e.onClick)||o.call(e,t),t.preventDefault()))},L=e=>t=>{var n,o;(t.target===t.currentTarget&&m(!1),null==(n=e.onKeyUp)||n.call(e,t),t.target!==t.currentTarget||E()||r||" "!==t.key||t.defaultMuiPrevented)||(null==(o=e.onClick)||o.call(e,t))},O=rn(P,a,w,h),F={};void 0!==l&&(F.tabIndex=l),"BUTTON"===I?(F.type=null!=d?d:"button",n?F["aria-disabled"]=r:F.disabled=r):"INPUT"===I?d&&["button","submit","reset"].includes(d)&&(n?F["aria-disabled"]=r:F.disabled=r):""!==I&&(i||c||(F.role="button",F.tabIndex=null!=l?l:0),r&&(F["aria-disabled"]=r,F.tabIndex=n?null!=l?l:0:-1));return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,je.A)({},on(e),on(t)),n=(0,je.A)({type:d},r,F,t,{onBlur:(o=r,e=>{var t;x(e),!1===y.current&&C(!1),null==(t=o.onBlur)||t.call(o,e)}),onClick:z(r),onFocus:T(r),onKeyDown:M(r),onKeyUp:L(r),onMouseDown:D(r),onMouseLeave:R(r),ref:O});var o;return delete n.onFocusVisible,n},focusVisible:_,setFocusVisible:C,active:f,rootRef:O}}function co(e){return xr("MuiButton",e)}const uo=wr("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);const ho=o.createContext({});const po=o.createContext(void 0),vo=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],fo=Qr("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),mo=Qr("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),go=Qr("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(e=>{let t=e.theme,r=e.ownerState;var n,o;return(0,je.A)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(n=t.variants[r.variant])||null==(n=n[r.color])?void 0:n.color},r.disabled&&{color:null==(o=t.variants["".concat(r.variant,"Disabled")])||null==(o=o[r.color])?void 0:o.color})}),yo=e=>{let t=e.theme,r=e.ownerState;var n,o,i,a;return[(0,je.A)({"--Icon-margin":"initial","--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon},"sm"===r.size&&{"--Icon-fontSize":t.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},"md"===r.size&&{"--Icon-fontSize":t.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:t.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},"lg"===r.size&&{"--Icon-fontSize":t.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:t.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:"var(--Button-radius, ".concat(t.vars.radius.sm,")"),margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.lg,lineHeight:t.vars.lineHeight.md},r.fullWidth&&{width:"100%"},{[t.focus.selector]:t.focus.default}),(0,je.A)({},null==(n=t.variants[r.variant])?void 0:n[r.color],{"&:hover":{"@media (hover: hover)":null==(o=t.variants["".concat(r.variant,"Hover")])?void 0:o[r.color]},'&:active, &[aria-pressed="true"]':null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color],["&.".concat(uo.disabled)]:null==(a=t.variants["".concat(r.variant,"Disabled")])?void 0:a[r.color]},"center"===r.loadingPosition&&{["&.".concat(uo.loading)]:{color:"transparent"}})]},bo=Qr("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})(yo),xo=o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyButton"}),i=n.children,a=n.action,l=n.color,c=void 0===l?"primary":l,d=n.variant,u=void 0===d?"solid":d,h=n.size,p=void 0===h?"md":h,v=n.fullWidth,f=void 0!==v&&v,m=n.startDecorator,g=n.endDecorator,y=n.loading,b=void 0!==y&&y,x=n.loadingPosition,w=void 0===x?"center":x,S=n.loadingIndicator,k=n.disabled,_=n.component,C=n.slots,A=void 0===C?{}:C,j=n.slotProps,I=void 0===j?{}:j,P=(0,Ie.A)(n,vo),R=o.useContext(ho),T=o.useContext(po),E=e.variant||R.variant||u,z=e.size||R.size||p,D=e.color||R.color||c,M=null!=(r=e.loading||e.disabled)?r:R.disabled||b||k,L=o.useRef(null),O=rn(L,t),F=lo((0,je.A)({},n,{disabled:M,rootRef:O})),N=F.focusVisible,B=F.setFocusVisible,H=F.getRootProps,W=null!=S?S:(0,tr.jsx)(An,{color:D,thickness:{sm:2,md:3,lg:4}[z]||3});o.useImperativeHandle(a,()=>({focusVisible:()=>{var e;B(!0),null==(e=L.current)||e.focus()}}),[B]);const V=(0,je.A)({},n,{color:D,fullWidth:f,variant:E,size:z,focusVisible:N,loading:b,loadingPosition:w,disabled:M}),$=(e=>{const t=e.color,r=e.disabled,n=e.focusVisible,o=e.focusVisibleClassName,i=e.fullWidth,a=e.size,s=e.variant,l=e.loading,c=Dr({root:["root",r&&"disabled",n&&"focusVisible",i&&"fullWidth",s&&"variant".concat(Le(s)),t&&"color".concat(Le(t)),a&&"size".concat(Le(a)),l&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},co,{});return n&&o&&(c.root+=" ".concat(o)),c})(V);let U=n["aria-pressed"];"function"===typeof I.root?U=I.root(V)["aria-pressed"]:I.root&&(U=I.root["aria-pressed"]),null!=T&&T.value&&(U=Array.isArray(T.value)?-1!==T.value.indexOf(n.value):T.value===n.value);const q=(0,je.A)({},P,{component:_,slots:A,slotProps:I}),K=pn("root",{ref:t,className:$.root,elementType:bo,externalForwardedProps:q,getSlotProps:H,ownerState:V,additionalProps:{onClick:e=>{var t;let r=n.onClick;var o;("function"===typeof I.root?r=I.root(V).onClick:I.root&&(r=I.root.onClick),null==(t=r)||t(e),T)&&(null==(o=T.onClick)||o.call(T,e,n.value))},"aria-pressed":U}}),G=(0,s.A)(K,2),J=G[0],Q=G[1],Y=pn("startDecorator",{className:$.startDecorator,elementType:fo,externalForwardedProps:q,ownerState:V}),X=(0,s.A)(Y,2),Z=X[0],ee=X[1],te=pn("endDecorator",{className:$.endDecorator,elementType:mo,externalForwardedProps:q,ownerState:V}),re=(0,s.A)(te,2),ne=re[0],oe=re[1],ie=pn("loadingIndicatorCenter",{className:$.loadingIndicatorCenter,elementType:go,externalForwardedProps:q,ownerState:V}),ae=(0,s.A)(ie,2),se=ae[0],le=ae[1];return(0,tr.jsxs)(J,(0,je.A)({},Q,{children:[(m||b&&"start"===w)&&(0,tr.jsx)(Z,(0,je.A)({},ee,{children:b&&"start"===w?W:m})),i,b&&"center"===w&&(0,tr.jsx)(se,(0,je.A)({},le,{children:W})),(g||b&&"end"===w)&&(0,tr.jsx)(ne,(0,je.A)({},oe,{children:b&&"end"===w?W:g}))]}))});xo.muiName="Button";const wo=xo;var So=r(6502);function ko(e){return xr("MuiAspectRatio",e)}wr("MuiAspectRatio",["root","content","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const _o=["children","ratio","minHeight","maxHeight","objectFit","color","variant","component","flex","slots","slotProps"],Co=Qr("div",{name:"JoyAspectRatio",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;const n="number"===typeof t.minHeight?"".concat(t.minHeight,"px"):t.minHeight,o="number"===typeof t.maxHeight?"".concat(t.maxHeight,"px"):t.maxHeight;return{"--AspectRatio-paddingBottom":"clamp(var(--AspectRatio-minHeight), calc(100% / (".concat(t.ratio,")), var(--AspectRatio-maxHeight))"),"--AspectRatio-maxHeight":o||"9999px","--AspectRatio-minHeight":n||"0px","--Icon-color":"neutral"!==t.color||"solid"===t.variant?"currentColor":r.vars.palette.text.icon,borderRadius:"var(--AspectRatio-radius)",display:t.flex?"flex":"block",flex:t.flex?1:"initial",flexDirection:"column",margin:"var(--AspectRatio-margin)"}}),Ao=Qr("div",{name:"JoyAspectRatio",slot:"Content",overridesResolver:(e,t)=>t.content})(e=>{let t=e.theme,r=e.ownerState;var n;return(0,je.A)({flex:1,position:"relative",borderRadius:"inherit",height:0,paddingBottom:"calc(var(--AspectRatio-paddingBottom) - 2 * var(--variant-borderWidth, 0px))",overflow:"hidden",transition:"inherit","& [data-first-child]":{display:"flex",justifyContent:"center",alignItems:"center",boxSizing:"border-box",position:"absolute",width:"100%",height:"100%",objectFit:r.objectFit,margin:0,padding:0,"& > img":{width:"100%",height:"100%",objectFit:r.objectFit}}},t.typography["body-md"],null==(n=t.variants[r.variant])?void 0:n[r.color])}),jo=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAspectRatio"}),n=r.children,i=r.ratio,a=void 0===i?"16 / 9":i,l=r.minHeight,c=r.maxHeight,d=r.objectFit,u=void 0===d?"cover":d,h=r.color,p=void 0===h?"neutral":h,v=r.variant,f=void 0===v?"soft":v,m=r.component,g=r.flex,y=void 0!==g&&g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,_o),_=(0,je.A)({},r,{flex:y,minHeight:l,maxHeight:c,objectFit:u,ratio:a,color:p,variant:f}),C=(e=>{const t=e.variant,r=e.color;return Dr({root:["root"],content:["content",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r))]},ko,{})})(_),A=(0,je.A)({},k,{component:m,slots:x,slotProps:S}),j=pn("root",{ref:t,className:C.root,elementType:Co,externalForwardedProps:A,ownerState:_}),I=(0,s.A)(j,2),P=I[0],R=I[1],T=pn("content",{className:C.content,elementType:Ao,externalForwardedProps:A,ownerState:_}),E=(0,s.A)(T,2),z=E[0],D=E[1];return(0,tr.jsx)(P,(0,je.A)({},R,{children:(0,tr.jsx)(z,(0,je.A)({},D,{children:o.Children.map(n,(e,t)=>0===t&&o.isValidElement(e)?o.cloneElement(e,{"data-first-child":""}):e)}))}))}),Io=jo,Po=["className","component","disableGutters","fixed","maxWidth","classes"],Ro=Qt(),To=jn("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const r=e.ownerState;return[t.root,t["maxWidth".concat(Le(String(r.maxWidth)))],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),Eo=e=>Zr({props:e,name:"MuiContainer",defaultTheme:Ro});const zo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.createStyledComponent,r=void 0===t?To:t,n=e.useThemeProps,i=void 0===n?Eo:n,a=e.componentName,s=void 0===a?"MuiContainer":a,l=r(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block"},!r.disableGutters&&{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}})},e=>{let t=e.theme;return e.ownerState.fixed&&Object.keys(t.breakpoints.values).reduce((e,r)=>{const n=r,o=t.breakpoints.values[n];return 0!==o&&(e[t.breakpoints.up(n)]={maxWidth:"".concat(o).concat(t.breakpoints.unit)}),e},{})},e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({},"xs"===r.maxWidth&&{[t.breakpoints.up("xs")]:{maxWidth:Math.max(t.breakpoints.values.xs,444)}},r.maxWidth&&"xs"!==r.maxWidth&&{[t.breakpoints.up(r.maxWidth)]:{maxWidth:"".concat(t.breakpoints.values[r.maxWidth]).concat(t.breakpoints.unit)}})}),c=o.forwardRef(function(e,t){const r=i(e),n=r.className,o=r.component,a=void 0===o?"div":o,c=r.disableGutters,d=void 0!==c&&c,u=r.fixed,h=void 0!==u&&u,p=r.maxWidth,v=void 0===p?"lg":p,f=(0,Ie.A)(r,Po),m=(0,je.A)({},r,{component:a,disableGutters:d,fixed:h,maxWidth:v}),g=((e,t)=>{const r=e.classes,n=e.fixed,o=e.disableGutters,i=e.maxWidth;return Dr({root:["root",i&&"maxWidth".concat(Le(String(i))),n&&"fixed",o&&"disableGutters"]},e=>yr(t,e),r)})(m,s);return(0,tr.jsx)(l,(0,je.A)({as:a,ownerState:m,className:(0,Pe.A)(g.root,n),ref:t},f))});return c}({createStyledComponent:Qr("div",{name:"JoyContainer",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>en({props:e,name:"JoyContainer"})}),Do=zo;function Mo(e){let t=e.children,r=e.reversed;return(0,tr.jsxs)(Do,{sx:e=>({position:"relative",minHeight:"100vh",display:"flex",flexDirection:r?"column-reverse":"column",alignItems:"center",py:10,gap:4,[e.breakpoints.up(834)]:{flexDirection:"row",gap:6},[e.breakpoints.up(1199)]:{gap:12}}),children:[(0,tr.jsx)(Tr,{sx:e=>({display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem",maxWidth:"50ch",textAlign:"center",flexShrink:999,[e.breakpoints.up(834)]:{minWidth:420,alignItems:"flex-start",textAlign:"initial"},["& .".concat(Fn.root)]:{textWrap:"balance"}}),children:t}),(0,tr.jsx)(Io,{ratio:600/520,variant:"outlined",maxHeight:300,sx:e=>({minWidth:300,alignSelf:"stretch",[e.breakpoints.up(834)]:{alignSelf:"initial",flexGrow:1,"--AspectRatio-maxHeight":"520px","--AspectRatio-minHeight":"400px"},borderRadius:"sm",bgcolor:"background.level2",flexBasis:"50%"}),children:(0,tr.jsx)("img",{src:"https://images.unsplash.com/photo-1493146165056-bb822d9422dd?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80",alt:"A charming row of colourful terraced houses \u2014 example property surfaced by Toppi"})})]})}function Lo(e){let t=e.login,r=e.isAuthenticated;const n=ie();return(0,tr.jsxs)(Mo,{children:[(0,tr.jsx)(Gn,{color:"primary",level:"h1",fontWeight:"xl",fontSize:"clamp(1.875rem, 1.3636rem + 2.1818vw, 3rem)",children:"Toppi"}),(0,tr.jsx)(Gn,{level:"h1",fontWeight:"xl",fontSize:"clamp(1.875rem, 1.3636rem + 2.1818vw, 3rem)",children:"A simple tracker to keep on top of your home search."}),(0,tr.jsx)(Gn,{fontSize:"lg",textColor:"text.secondary",lineHeight:"lg",children:"Save and compare your favourite properties, set up alerts for new properties, and make direct contact with local agents."}),(0,tr.jsx)(wo,{size:"lg",endDecorator:(0,tr.jsx)(So.A,{fontSize:"large"}),onClick:r?()=>{n("/dashboard")}:t,children:"Get started"}),(0,tr.jsxs)(Gn,{children:["Already a member? ",(0,tr.jsx)(wo,{variant:"plain",onClick:t,children:"Log in"})]})]})}function Oo(e){return xr("MuiSvgIcon",e)}wr("MuiSvgIcon",["root","colorInherit","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","fontSizeInherit","fontSizeXs","fontSizeSm","fontSizeMd","fontSizeLg","fontSizeXl","fontSizeXl2","fontSizeXl3","fontSizeXl4","sizeSm","sizeMd","sizeLg"]);const Fo=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox","size","slots","slotProps"],No={sm:"xl",md:"xl2",lg:"xl3"},Bo=Qr("svg",{name:"JoySvgIcon",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;return(0,je.A)({},r.instanceSize&&{"--Icon-fontSize":t.vars.fontSize[No[r.instanceSize]]},r.instanceFontSize&&"inherit"!==r.instanceFontSize&&{"--Icon-fontSize":t.vars.fontSize[r.instanceFontSize]},{userSelect:"none",margin:"var(--Icon-margin)",width:"1em",height:"1em",display:"inline-block",fill:r.hasSvgAsChild?void 0:"currentColor",flexShrink:0,fontSize:"var(--Icon-fontSize, ".concat(t.vars.fontSize[No[r.size]]||"unset",")")},r.fontSize&&"inherit"!==r.fontSize&&{fontSize:"var(--Icon-fontSize, ".concat(t.fontSize[r.fontSize],")")},!r.htmlColor&&(0,je.A)({color:"var(--Icon-color, ".concat(t.vars.palette.text.icon,")")},"inherit"===r.color&&{color:"inherit"},"inherit"!==r.color&&t.vars.palette[r.color]&&{color:"rgba(".concat(null==(n=t.vars.palette[r.color])?void 0:n.mainChannel," / 1)")}))}),Ho=o.forwardRef(function(e,t){const r=en({props:e,name:"JoySvgIcon"}),n=r.children,i=r.className,a=r.color,l=r.component,c=void 0===l?"svg":l,d=r.fontSize,u=r.htmlColor,h=r.inheritViewBox,p=void 0!==h&&h,v=r.titleAccess,f=r.viewBox,m=void 0===f?"0 0 24 24":f,g=r.size,y=void 0===g?"md":g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,Fo),_=o.isValidElement(n)&&"svg"===n.type,C=(0,je.A)({},r,{color:a,component:c,size:y,instanceSize:e.size,fontSize:d,instanceFontSize:e.fontSize,inheritViewBox:p,viewBox:m,hasSvgAsChild:_}),A=(e=>{const t=e.color,r=e.size,n=e.fontSize;return Dr({root:["root",t&&"inherit"!==t&&"color".concat(Le(t)),r&&"size".concat(Le(r)),n&&"fontSize".concat(Le(n))]},Oo,{})})(C),j=(0,je.A)({},k,{component:c,slots:x,slotProps:S}),I=pn("root",{ref:t,className:(0,Pe.A)(A.root,i),elementType:Bo,externalForwardedProps:j,ownerState:C,additionalProps:(0,je.A)({color:u,focusable:!1},v&&{role:"img"},!v&&{"aria-hidden":!0},!p&&{viewBox:m},_&&n.props)}),P=(0,s.A)(I,2),R=P[0],T=P[1];return(0,tr.jsxs)(R,(0,je.A)({},T,{children:[_?n.props.children:n,v?(0,tr.jsx)("title",{children:v}):null]}))}),Wo=Ho;function Vo(e,t){function r(r,n){return(0,tr.jsx)(Wo,(0,je.A)({"data-testid":"".concat(t,"Icon"),ref:n},r,{children:e}))}return r.muiName=Wo.muiName,o.memo(o.forwardRef(r))}const $o=Vo((0,tr.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}),"Person");function Uo(e){return xr("MuiAvatar",e)}wr("MuiAvatar",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","fallback","sizeSm","sizeMd","sizeLg","img","variantOutlined","variantSoft","variantSolid"]);const qo=o.createContext(void 0);Qr("div",{name:"JoyAvatarGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;return(0,je.A)({},"sm"===t.size&&{"--AvatarGroup-gap":"-0.375rem","--Avatar-ringSize":"2px"},"md"===t.size&&{"--AvatarGroup-gap":"-0.5rem","--Avatar-ringSize":"2px"},"lg"===t.size&&{"--AvatarGroup-gap":"-0.625rem","--Avatar-ringSize":"4px"},{"--Avatar-ring":"0 0 0 var(--Avatar-ringSize) var(--Avatar-ringColor, ".concat(r.vars.palette.background.surface,")"),"--Avatar-marginInlineStart":"var(--AvatarGroup-gap)",display:"flex",marginInlineStart:"calc(-1 * var(--AvatarGroup-gap))"})});const Ko=["alt","color","size","variant","src","srcSet","children","component","slots","slotProps"],Go=Qr("div",{name:"JoyAvatar",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;return(0,je.A)({"--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon},t.typography["title-".concat(r.size)],"sm"===r.size&&{width:"var(--Avatar-size, 2rem)",height:"var(--Avatar-size, 2rem)",fontSize:"calc(var(--Avatar-size, 2rem) * 0.4375)"},"md"===r.size&&{width:"var(--Avatar-size, 2.5rem)",height:"var(--Avatar-size, 2.5rem)",fontSize:"calc(var(--Avatar-size, 2.5rem) * 0.4)"},"lg"===r.size&&{width:"var(--Avatar-size, 3rem)",height:"var(--Avatar-size, 3rem)",fontSize:"calc(var(--Avatar-size, 3rem) * 0.375)"},{marginInlineStart:"var(--Avatar-marginInlineStart)",boxShadow:"var(--Avatar-ring)",position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:1,overflow:"hidden",borderRadius:"var(--Avatar-radius, 50%)",userSelect:"none"},null==(n=t.variants[r.variant])?void 0:n[r.color])}),Jo=Qr("img",{name:"JoyAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Qo=Qr($o,{name:"JoyAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"64%",height:"64%"});const Yo=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAvatar"}),n=o.useContext(qo),i=r.alt,a=r.color,l=void 0===a?"neutral":a,c=r.size,d=void 0===c?"md":c,u=r.variant,h=void 0===u?"soft":u,p=r.src,v=r.srcSet,f=r.children,m=r.component,g=r.slots,y=void 0===g?{}:g,b=r.slotProps,x=void 0===b?{}:b,w=(0,Ie.A)(r,Ko),S=e.variant||(null==n?void 0:n.variant)||h,k=e.color||(null==n?void 0:n.color)||l,_=e.size||(null==n?void 0:n.size)||d;let C=null;const A=(0,je.A)({},r,{color:k,size:_,variant:S,grouped:!!n}),j=(e=>{const t=e.size,r=e.variant,n=e.color,o=e.src,i=e.srcSet;return Dr({root:["root",r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),t&&"size".concat(Le(t))],img:[(o||i)&&"img"],fallback:["fallback"]},Uo,{})})(A),I=(0,je.A)({},w,{component:m,slots:y,slotProps:x}),P=pn("root",{ref:t,className:j.root,elementType:Go,externalForwardedProps:I,ownerState:A}),R=(0,s.A)(P,2),T=R[0],E=R[1],z=pn("img",{additionalProps:{alt:i,src:p,srcSet:v},className:j.img,elementType:Jo,externalForwardedProps:I,ownerState:A}),D=(0,s.A)(z,2),M=D[0],L=D[1],O=pn("fallback",{className:j.fallback,elementType:Qo,externalForwardedProps:I,ownerState:A}),F=(0,s.A)(O,2),N=F[0],B=F[1],H=function(e){let t=e.crossOrigin,r=e.referrerPolicy,n=e.src,i=e.srcSet;const a=o.useState(!1),l=(0,s.A)(a,2),c=l[0],d=l[1];return o.useEffect(()=>{if(!n&&!i)return;d(!1);let e=!0;const o=new Image;return o.onload=()=>{e&&d("loaded")},o.onerror=()=>{e&&d("error")},o.crossOrigin=t,o.referrerPolicy=r,n&&(o.src=n),i&&(o.srcset=i),()=>{e=!1}},[t,r,n,i]),c}((0,je.A)({},L,{src:p,srcSet:v}));return C=(p||v)&&"error"!==H?(0,tr.jsx)(M,(0,je.A)({},L)):null!=f?f:i?i[0]:(0,tr.jsx)(N,(0,je.A)({},B)),(0,tr.jsx)(T,(0,je.A)({},E,{children:C}))}),Xo=Yo,Zo=e=>t=>"--".concat(e?"".concat(e,"-"):"").concat(t.replace(/^--/,"")),ei="data-skip-inverted-colors",ti="& :not([".concat(ei,"], [").concat(ei,"] *)"),ri=e=>{var t,r,n,o,i,a,s,l,c,d,u,h,p,v,f,m,g,y,b,x,w,S;const k=Zo(e.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[e.getColorSchemeSelector("light")]:{[k("--palette-focusVisible")]:"".concat(null==(t=e.colorSchemes.light)?void 0:t.palette.focusVisible," !important"),[k("--palette-background-body")]:"".concat(null==(r=e.colorSchemes.light)?void 0:r.palette.background.body," !important"),[k("--palette-background-surface")]:"".concat(null==(n=e.colorSchemes.light)?void 0:n.palette.background.surface," !important"),[k("--palette-background-popup")]:"".concat(null==(o=e.colorSchemes.light)?void 0:o.palette.background.popup," !important"),[k("--palette-background-level1")]:"".concat(null==(i=e.colorSchemes.light)?void 0:i.palette.background.level1," !important"),[k("--palette-background-level2")]:"".concat(null==(a=e.colorSchemes.light)?void 0:a.palette.background.level2," !important"),[k("--palette-background-level3")]:"".concat(null==(s=e.colorSchemes.light)?void 0:s.palette.background.level3," !important"),[k("--palette-text-primary")]:"".concat(null==(l=e.colorSchemes.light)?void 0:l.palette.text.primary," !important"),[k("--palette-text-secondary")]:"".concat(null==(c=e.colorSchemes.light)?void 0:c.palette.text.secondary," !important"),[k("--palette-text-tertiary")]:"".concat(null==(d=e.colorSchemes.light)?void 0:d.palette.text.tertiary," !important"),[k("--palette-divider")]:"".concat(null==(u=e.colorSchemes.light)?void 0:u.palette.divider," !important")},[e.getColorSchemeSelector("dark")]:{[k("--palette-focusVisible")]:"".concat(null==(h=e.colorSchemes.dark)?void 0:h.palette.focusVisible," !important"),[k("--palette-background-body")]:"".concat(null==(p=e.colorSchemes.dark)?void 0:p.palette.background.body," !important"),[k("--palette-background-surface")]:"".concat(null==(v=e.colorSchemes.dark)?void 0:v.palette.background.surface," !important"),[k("--palette-background-popup")]:"".concat(null==(f=e.colorSchemes.dark)?void 0:f.palette.background.popup," !important"),[k("--palette-background-level1")]:"".concat(null==(m=e.colorSchemes.dark)?void 0:m.palette.background.level1," !important"),[k("--palette-background-level2")]:"".concat(null==(g=e.colorSchemes.dark)?void 0:g.palette.background.level2," !important"),[k("--palette-background-level3")]:"".concat(null==(y=e.colorSchemes.dark)?void 0:y.palette.background.level3," !important"),[k("--palette-text-primary")]:"".concat(null==(b=e.colorSchemes.dark)?void 0:b.palette.text.primary," !important"),[k("--palette-text-secondary")]:"".concat(null==(x=e.colorSchemes.dark)?void 0:x.palette.text.secondary," !important"),[k("--palette-text-tertiary")]:"".concat(null==(w=e.colorSchemes.dark)?void 0:w.palette.text.tertiary," !important"),[k("--palette-divider")]:"".concat(null==(S=e.colorSchemes.dark)?void 0:S.palette.divider," !important")}}};const ni=e=>t=>{const r=void 0!==t.theme?t.theme:t;const n=ir(r.cssVarPrefix),o=Zo(r.cssVarPrefix),i=e=>{const t=e.split("-");return n(e,r.palette[t[1]][t[2]])};return{[ti]:{"--Badge-ringColor":i("palette-".concat(e,"-solidBg")),"--Icon-color":"currentColor",["".concat(r.getColorSchemeSelector("light"),", ").concat(r.getColorSchemeSelector("dark"))]:{colorScheme:"dark",[o("--palette-focusVisible")]:i("palette-".concat(e,"-200")),[o("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[o("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[o("--palette-background-popup")]:i("palette-".concat(e,"-700")),[o("--palette-background-level1")]:"rgba(".concat(i("palette-".concat(e,"-darkChannel"))," / 0.2)"),[o("--palette-background-level2")]:"rgba(".concat(i("palette-".concat(e,"-darkChannel"))," / 0.36)"),[o("--palette-background-level3")]:"rgba(".concat(i("palette-".concat(e,"-darkChannel"))," / 0.6)"),[o("--palette-text-primary")]:i("palette-common-white"),[o("--palette-text-secondary")]:i("palette-".concat(e,"-200")),[o("--palette-text-tertiary")]:i("palette-".concat(e,"-300")),[o("--palette-text-icon")]:i("palette-".concat(e,"-200")),[o("--palette-divider")]:"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.32)"),"--variant-plainColor":i("palette-".concat(e,"-50")),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.12)"),"--variant-plainActiveBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.32)"),"--variant-plainDisabledColor":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.72)"),"--variant-outlinedColor":i("palette-".concat(e,"-50")),"--variant-outlinedBorder":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.5)"),"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":i("palette-".concat(e,"-300")),"--variant-outlinedHoverBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.12)"),"--variant-outlinedActiveBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.32)"),"--variant-outlinedDisabledColor":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.72)"),"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":i("palette-common-white"),"--variant-softHoverColor":i("palette-common-white"),"--variant-softBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.24)"),"--variant-softHoverBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.36)"),"--variant-softActiveBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.16)"),"--variant-softActiveColor":"#fff","--variant-softDisabledColor":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.72)"),"--variant-softDisabledBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.1)"),"--variant-solidColor":i("palette-".concat(e,"-").concat("neutral"===e?"600":"500")),"--variant-solidBg":i("palette-common-white"),"--variant-solidHoverBg":i("palette-common-white"),"--variant-solidActiveBg":i("palette-".concat(e,"-100")),"--variant-solidDisabledColor":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.72)"),"--variant-solidDisabledBg":"rgba(".concat(i("palette-".concat(e,"-lightChannel"))," / 0.1)")}},["&, & [".concat(ei,"]")]:ri(r)}},oi=e=>t=>{const r=t.theme,n=void 0===r?t:r,o=ir(n.cssVarPrefix),i=Zo(n.cssVarPrefix),a=e=>{const t=e.split("-");return o(e,n.palette[t[1]][t[2]])};return{[ti]:{"--Badge-ringColor":a("palette-".concat(e,"-softBg")),"--Icon-color":"currentColor",[n.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:a("palette-".concat(e,"-300")),[i("--palette-background-body")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.1)"),[i("--palette-background-surface")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.08)"),[i("--palette-background-level1")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.2)"),[i("--palette-background-level2")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.4)"),[i("--palette-background-level3")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.6)"),[i("--palette-text-primary")]:a("palette-".concat(e,"-100")),[i("--palette-text-secondary")]:"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 0.72)"),[i("--palette-text-tertiary")]:"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 0.6)"),[i("--palette-text-icon")]:"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 0.6)"),[i("--palette-divider")]:"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 0.2)"),"--variant-plainColor":"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 1)"),"--variant-plainHoverColor":a("palette-".concat(e,"-50")),"--variant-plainHoverBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.16)"),"--variant-plainActiveBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.32)"),"--variant-plainDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.72)"),"--variant-outlinedColor":"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 1)"),"--variant-outlinedHoverColor":a("palette-".concat(e,"-50")),"--variant-outlinedBg":"initial","--variant-outlinedBorder":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.4)"),"--variant-outlinedHoverBorder":a("palette-".concat(e,"-600")),"--variant-outlinedHoverBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.16)"),"--variant-outlinedActiveBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.32)"),"--variant-outlinedDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.72)"),"--variant-outlinedDisabledBorder":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.2)"),"--variant-softColor":a("palette-".concat(e,"-200")),"--variant-softBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.24)"),"--variant-softHoverColor":"#fff","--variant-softHoverBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.32)"),"--variant-softActiveBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.48)"),"--variant-softDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.72)"),"--variant-softDisabledBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.12)"),"--variant-solidColor":"#fff","--variant-solidBg":a("palette-".concat(e,"-500")),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":a("palette-".concat(e,"-600")),"--variant-solidActiveBg":a("palette-".concat(e,"-600")),"--variant-solidDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.72)"),"--variant-solidDisabledBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.12)")},[n.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:a("palette-".concat(e,"-500")),[i("--palette-background-body")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.1)"),[i("--palette-background-surface")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.08)"),[i("--palette-background-level1")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.2)"),[i("--palette-background-level2")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.32)"),[i("--palette-background-level3")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.48)"),[i("--palette-text-primary")]:a("palette-".concat(e,"-700")),[i("--palette-text-secondary")]:"rgba(".concat(a("palette-".concat(e,"-darkChannel"))," / 0.8)"),[i("--palette-text-tertiary")]:"rgba(".concat(a("palette-".concat(e,"-darkChannel"))," / 0.68)"),[i("--palette-text-icon")]:a("palette-".concat(e,"-500")),[i("--palette-divider")]:"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.32)"),"--variant-plainColor":"rgba(".concat(a("palette-".concat(e,"-darkChannel"))," / 0.8)"),"--variant-plainHoverColor":"rgba(".concat(a("palette-".concat(e,"-darkChannel"))," / 1)"),"--variant-plainHoverBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.12)"),"--variant-plainActiveBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.24)"),"--variant-plainDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.6)"),"--variant-outlinedColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 1)"),"--variant-outlinedBorder":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.4)"),"--variant-outlinedHoverColor":a("palette-".concat(e,"-600")),"--variant-outlinedHoverBorder":a("palette-".concat(e,"-300")),"--variant-outlinedHoverBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.12)"),"--variant-outlinedActiveBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.24)"),"--variant-outlinedDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.6)"),"--variant-outlinedDisabledBorder":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.12)"),"--variant-softColor":a("palette-".concat(e,"-600")),"--variant-softBg":"rgba(".concat(a("palette-".concat(e,"-lightChannel"))," / 0.8)"),"--variant-softHoverColor":a("palette-".concat(e,"-700")),"--variant-softHoverBg":a("palette-".concat(e,"-200")),"--variant-softActiveBg":a("palette-".concat(e,"-300")),"--variant-softDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.6)"),"--variant-softDisabledBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.08)"),"--variant-solidColor":a("palette-common-white"),"--variant-solidBg":a("palette-".concat(e,"-").concat("neutral"===e?"700":"500")),"--variant-solidHoverColor":a("palette-common-white"),"--variant-solidHoverBg":a("palette-".concat(e,"-").concat("600")),"--variant-solidActiveBg":a("palette-".concat(e,"-").concat("600")),"--variant-solidDisabledColor":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.6)"),"--variant-solidDisabledBg":"rgba(".concat(a("palette-".concat(e,"-mainChannel"))," / 0.08)")}},["&, & [".concat(ei,"]")]:ri(n)}};function ii(e){return xr("MuiCard",e)}const ai=wr("MuiCard",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),si=(e,t)=>{let r=e.theme,n=e.ownerState,o={};return n.sx&&(!function e(t){"function"===typeof t?e(t(r)):Array.isArray(t)?t.forEach(t=>{"boolean"!==typeof t&&e(t)}):"object"===typeof t&&(o=(0,je.A)({},o,t))}(n.sx),t.forEach(e=>{const t=o[e];var n;"string"===typeof t||"number"===typeof t?"borderRadius"===e?o[e]="number"===typeof t?"".concat(t,"px"):(null==(n=r.vars)?void 0:n.radius[t])||t:-1!==["p","padding","m","margin"].indexOf(e)&&"number"===typeof t?o[e]=r.spacing(t):o[e]=t:o[e]="function"===typeof t?t(r):void 0})),o},li=["className","color","component","invertedColors","size","variant","children","orientation","slots","slotProps"],ci=Qr("div")(e=>{let t=e.theme,r=e.ownerState;var n;const o=si({theme:t,ownerState:r},["p","padding","borderRadius"]),i=o.p,a=o.padding,s=o.borderRadius;return[(0,je.A)({"--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon,"--Card-childRadius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--Card-padding), min(var(--Card-padding) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))","--AspectRatio-radius":"var(--Card-childRadius)","--unstable_actionMargin":"calc(-1 * var(--variant-borderWidth, 0px))","--unstable_actionRadius":"var(--Card-radius)","--CardCover-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--CardOverflow-offset":"calc(-1 * var(--Card-padding))","--CardOverflow-radius":"calc(var(--Card-radius) - var(--variant-borderWidth, 0px))","--Divider-inset":"calc(-1 * var(--Card-padding))"},"sm"===r.size&&{"--Card-radius":t.vars.radius.sm,"--Card-padding":"0.625rem",gap:"0.5rem"},"md"===r.size&&{"--Card-radius":t.vars.radius.md,"--Card-padding":"1rem",gap:"0.75rem 1rem"},"lg"===r.size&&{"--Card-radius":t.vars.radius.lg,"--Card-padding":"1.5rem",gap:"1rem 1.5rem"},{padding:"var(--Card-padding)",borderRadius:"var(--Card-radius)",backgroundColor:t.vars.palette.background.surface,position:"relative",display:"flex",flexDirection:"horizontal"===r.orientation?"row":"column"},t.typography["body-".concat(r.size)],"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(n=t.variants[r.variant])?void 0:n[r.color]),void 0!==i&&{"--Card-padding":i},void 0!==a&&{"--Card-padding":a},void 0!==s&&{"--Card-radius":s}]}),di=Qr(ci,{name:"JoyCard",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ui=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyCard"}),n=r.className,i=r.color,a=void 0===i?"neutral":i,l=r.component,c=void 0===l?"div":l,d=r.invertedColors,u=void 0!==d&&d,h=r.size,p=void 0===h?"md":h,v=r.variant,f=void 0===v?"outlined":v,m=r.children,g=r.orientation,y=void 0===g?"vertical":g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,li),_=(0,je.A)({},r,{color:a,component:c,orientation:y,size:p,variant:f,invertedColors:u}),C=(e=>{const t=e.size,r=e.variant,n=e.color;return Dr({root:["root",e.orientation,r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),t&&"size".concat(Le(t))]},ii,{})})(_),A=(0,je.A)({},k,{component:c,slots:x,slotProps:S}),j=pn("root",{ref:t,className:(0,Pe.A)(C.root,n),elementType:di,externalForwardedProps:A,ownerState:_}),I=(0,s.A)(j,2),P=I[0],R=I[1];return(0,tr.jsx)(P,(0,je.A)({},R,{children:o.Children.map(m,(e,t)=>{if(!o.isValidElement(e))return e;const r={};if(Ln(e,["Divider"])){var n,i;const t=e.props;r.inset=null!=(n=null==t?void 0:t.inset)?n:"context";const o="vertical"===y?"horizontal":"vertical";r.orientation=null!=(i=null==t?void 0:t.orientation)?i:o}return 0===t&&(r["data-first-child"]=""),t===o.Children.count(m)-1&&(r["data-last-child"]=""),o.cloneElement(e,r)})}))}),hi=ui,pi=[{quote:"I was checking Rightmove five times a day. Toppi just... told me when something matched. Found our place in two weeks.",name:"Sarah M.",location:"London",initials:"SM"},{quote:"The commute score alone saved us from making a terrible mistake. It actually calculated the journey to both our offices.",name:"James K.",location:"Bristol",initials:"JK"},{quote:"We shared the board with my mum. She could scroll through everything we'd shortlisted without needing to sign up.",name:"Priya S.",location:"Manchester",initials:"PS"}];function vi(){const e=(0,o.useState)(0),t=(0,s.A)(e,2),r=t[0],n=t[1];return(0,o.useEffect)(()=>{const e=setInterval(()=>{n(e=>(e+1)%pi.length)},4e3);return()=>clearInterval(e)},[]),(0,tr.jsx)(Tr,{component:"section",sx:{py:8,bgcolor:"background.level1",textAlign:"center"},children:(0,tr.jsxs)(Do,{maxWidth:"md",children:[(0,tr.jsxs)(Mn,{spacing:1,alignItems:"center",sx:{mb:4},children:[(0,tr.jsx)(Gn,{level:"h4",children:"What house-hunters say"}),(0,tr.jsx)(Gn,{level:"body-md",textColor:"neutral.500",children:"Real people, real searches, real homes found."})]}),(0,tr.jsx)(Tr,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2},children:pi.map((e,t)=>{const o=t===r;return(0,tr.jsxs)(hi,{variant:o?"soft":"outlined",color:o?"primary":void 0,onClick:()=>n(t),sx:{cursor:"pointer",p:3,transition:"transform 0.3s ease, box-shadow 0.3s ease",transform:o?"translateY(-4px)":"none",boxShadow:o?"md":"none"},children:[(0,tr.jsxs)(Gn,{level:"body-md",sx:{fontStyle:"italic",mb:2},children:['"',e.quote,'"']}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"center",children:[(0,tr.jsx)(Xo,{size:"sm",variant:"soft",color:"primary",children:e.initials}),(0,tr.jsxs)(Mn,{alignItems:"flex-start",children:[(0,tr.jsx)(Gn,{level:"title-sm",children:e.name}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"neutral.500",children:e.location})]})]})]},e.name)})}),(0,tr.jsx)(Mn,{direction:"row",spacing:1,justifyContent:"center",sx:{mt:3},children:pi.map((e,t)=>{const o=t===r;return(0,tr.jsx)(Tr,{onClick:()=>n(t),sx:{width:o?20:8,height:8,borderRadius:4,bgcolor:o?"primary.500":"neutral.300",cursor:"pointer",transition:"width 0.3s ease, background-color 0.3s ease"}},t)})})]})})}let fi=0;const mi=i["useId".toString()];function gi(e){if(void 0!==mi){const t=mi();return null!=e?e:t}return function(e){const t=o.useState(e),r=(0,s.A)(t,2),n=r[0],i=r[1],a=e||n;return o.useEffect(()=>{null==n&&(fi+=1,i("mui-".concat(fi)))},[n]),a}(e)}const yi=o.createContext(void 0);function bi(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=o.useContext(yi),i="string"===typeof n?n.split(":"):[],a=(0,s.A)(i,2),l=a[0],c=a[1],d=function(e,t){let r=t,n=e;return"outlined"===e&&(r="neutral",n="plain"),"plain"===e&&(r="neutral"),{variant:n,color:r}}(l||void 0,c||void 0);return d.variant=e||d.variant,d.color=t||(r?c:d.color),d}function xi(e){let t=e.children,r=e.color,n=e.variant;return(0,tr.jsx)(yi.Provider,{value:"".concat(n||"",":").concat(r||""),children:t})}function wi(e){return xr("MuiChip",e)}const Si=wr("MuiChip",["root","clickable","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","disabled","endDecorator","focusVisible","label","labelSm","labelMd","labelLg","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantSolid","variantSoft","variantOutlined"]);const ki=o.createContext({disabled:void 0,variant:void 0,color:void 0}),_i=["children","className","color","onClick","disabled","size","variant","startDecorator","endDecorator","component","slots","slotProps"],Ci=Qr("div",{name:"JoyChip",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i;const a=null==(n=t.variants[r.variant])?void 0:n[r.color],s=si({theme:t,ownerState:r},["borderRadius"]).borderRadius;return[(0,je.A)({"--Chip-decoratorChildOffset":"min(calc(var(--Chip-paddingInline) - (var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2), var(--Chip-paddingInline))","--Chip-decoratorChildRadius":"max(var(--_Chip-radius) - var(--variant-borderWidth, 0px) - var(--_Chip-paddingBlock), min(var(--_Chip-paddingBlock) + var(--variant-borderWidth, 0px), var(--_Chip-radius) / 2))","--Chip-deleteRadius":"var(--Chip-decoratorChildRadius)","--Chip-deleteSize":"var(--Chip-decoratorChildHeight)","--Avatar-radius":"var(--Chip-decoratorChildRadius)","--Avatar-size":"var(--Chip-decoratorChildHeight)","--Icon-margin":"initial","--Icon-color":"currentColor","--unstable_actionRadius":"var(--_Chip-radius)"},"sm"===r.size&&{"--Chip-paddingInline":"0.375rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.sm,"--_Chip-minHeight":"var(--Chip-minHeight, 1.25rem)",gap:"3px"},"md"===r.size&&{"--Chip-paddingInline":"0.5rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.25rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.md,"--_Chip-minHeight":"var(--Chip-minHeight, 1.5rem)",gap:"0.25rem"},"lg"===r.size&&{"--Chip-paddingInline":"0.75rem","--Chip-decoratorChildHeight":"calc(var(--_Chip-minHeight) - 0.375rem - 2 * var(--variant-borderWidth))","--Icon-fontSize":t.vars.fontSize.lg,"--_Chip-minHeight":"var(--Chip-minHeight, 1.75rem)",gap:"0.375rem"},{"--_Chip-radius":"var(--Chip-radius, 1.5rem)","--_Chip-paddingBlock":"max((var(--_Chip-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Chip-decoratorChildHeight)) / 2, 0px)",minHeight:"var(--_Chip-minHeight)",maxWidth:"max-content",paddingInline:"var(--Chip-paddingInline)",borderRadius:"var(--_Chip-radius)",position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",textDecoration:"none",verticalAlign:"middle",boxSizing:"border-box"},t.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[r.size])],{fontWeight:t.vars.fontWeight.md,["&.".concat(Si.disabled)]:{color:null==(o=t.variants["".concat(r.variant,"Disabled")])||null==(o=o[r.color])?void 0:o.color}}),...r.clickable?[{"--variant-borderWidth":"0px",color:null==a?void 0:a.color}]:[(0,je.A)({backgroundColor:t.vars.palette.background.surface},a,{["&.".concat(Si.disabled)]:null==(i=t.variants["".concat(r.variant,"Disabled")])?void 0:i[r.color]})],void 0!==s&&{"--_Chip-radius":s}]}),Ai=Qr("span",{name:"JoyChip",slot:"Label",overridesResolver:(e,t)=>t.label})(e=>{let t=e.ownerState;return(0,je.A)({display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",order:1,minInlineSize:0,flexGrow:1},t.clickable&&{zIndex:1,pointerEvents:"none"})}),ji=Qr("button",{name:"JoyChip",slot:"Action",overridesResolver:(e,t)=>t.action})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a;return[{"--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon,position:"absolute",zIndex:0,top:0,left:0,bottom:0,right:0,width:"100%",border:"none",cursor:"pointer",padding:"initial",margin:"initial",backgroundColor:"initial",textDecoration:"none",borderRadius:"inherit",[t.focus.selector]:t.focus.default},(0,je.A)({backgroundColor:t.vars.palette.background.surface},null==(n=t.variants[r.variant])?void 0:n[r.color]),{"&:hover":{"@media (hover: hover)":null==(o=t.variants["".concat(r.variant,"Hover")])?void 0:o[r.color]}},{"&:active":null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color]},{["&.".concat(Si.disabled)]:null==(a=t.variants["".concat(r.variant,"Disabled")])?void 0:a[r.color]}]}),Ii=Qr("span",{name:"JoyChip",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Avatar-marginInlineStart":"calc(var(--Chip-decoratorChildOffset) * -1)","--IconButton-margin":"0 calc(-1 * var(--Chip-paddingInline) / 3) 0 calc(var(--Chip-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Chip-paddingInline) / -4)",display:"inherit",order:0,zIndex:1,pointerEvents:"none"}),Pi=Qr("span",{name:"JoyChip",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--IconButton-margin":"0 calc(var(--Chip-decoratorChildOffset) * -1) 0 calc(-1 * var(--Chip-paddingInline) / 3)","--Icon-margin":"0 calc(var(--Chip-paddingInline) / -4) 0 0",display:"inherit",order:2,zIndex:1,pointerEvents:"none"}),Ri=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyChip"}),n=r.children,i=r.className,a=r.color,l=void 0===a?"neutral":a,c=r.onClick,d=r.disabled,u=void 0!==d&&d,h=r.size,p=void 0===h?"md":h,v=r.variant,f=void 0===v?"soft":v,m=r.startDecorator,g=r.endDecorator,y=r.component,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,_i),_=!!c||!!S.action,C=(0,je.A)({},r,{disabled:u,size:p,color:l,variant:f,clickable:_,focusVisible:!1}),A="function"===typeof S.action?S.action(C):S.action,j=o.useRef(null),I=lo((0,je.A)({},A,{disabled:u,rootRef:j})),P=I.focusVisible,R=I.getRootProps;C.focusVisible=P;const T=(e=>{const t=e.disabled,r=e.size,n=e.color,o=e.clickable,i=e.variant,a=e.focusVisible;return Dr({root:["root",t&&"disabled",n&&"color".concat(Le(n)),r&&"size".concat(Le(r)),i&&"variant".concat(Le(i)),o&&"clickable"],action:["action",t&&"disabled",a&&"focusVisible"],label:["label",r&&"label".concat(Le(r))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},wi,{})})(C),E=(0,je.A)({},k,{component:y,slots:x,slotProps:S}),z=pn("root",{ref:t,className:(0,Pe.A)(T.root,i),elementType:Ci,externalForwardedProps:E,ownerState:C}),D=(0,s.A)(z,2),M=D[0],L=D[1],O=pn("label",{className:T.label,elementType:Ai,externalForwardedProps:E,ownerState:C}),F=(0,s.A)(O,2),N=F[0],B=F[1],H=gi(B.id),W=pn("action",{className:T.action,elementType:ji,externalForwardedProps:E,ownerState:C,getSlotProps:R,additionalProps:{"aria-labelledby":H,as:null==A?void 0:A.component,onClick:c}}),V=(0,s.A)(W,2),$=V[0],U=V[1],q=pn("startDecorator",{className:T.startDecorator,elementType:Ii,externalForwardedProps:E,ownerState:C}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=pn("endDecorator",{className:T.endDecorator,elementType:Pi,externalForwardedProps:E,ownerState:C}),Y=(0,s.A)(Q,2),X=Y[0],Z=Y[1],ee=o.useMemo(()=>({disabled:u}),[u]);return(0,tr.jsx)(ki.Provider,{value:ee,children:(0,tr.jsx)(xi,{variant:f,color:l,children:(0,tr.jsxs)(M,(0,je.A)({},L,{children:[_&&(0,tr.jsx)($,(0,je.A)({},U)),(0,tr.jsx)(N,(0,je.A)({},B,{id:H,children:n})),m&&(0,tr.jsx)(G,(0,je.A)({},J,{children:m})),g&&(0,tr.jsx)(X,(0,je.A)({},Z,{children:g}))]}))})})}),Ti=Ri;function Ei(e){return xr("MuiList",e)}wr("MuiList",["root","nesting","scoped","sizeSm","sizeMd","sizeLg","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]);const zi=o.createContext(!1);const Di=o.createContext(void 0);const Mi=o.createContext(void 0);const Li=o.createContext(!1);const Oi=o.createContext(!1),Fi={"--NestedList-marginRight":"0px","--NestedList-marginLeft":"0px","--NestedListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px"};const Ni=function(e){const t=e.children,r=e.nested,n=e.row,i=void 0!==n&&n,a=e.wrap,s=void 0!==a&&a,l=(0,tr.jsx)(Li.Provider,{value:i,children:(0,tr.jsx)(Oi.Provider,{value:s,children:o.Children.map(t,(e,r)=>o.isValidElement(e)?o.cloneElement(e,(0,je.A)({},0===r&&{"data-first-child":""},r===o.Children.count(t)-1&&{"data-last-child":""})):e)})});return void 0===r?l:(0,tr.jsx)(zi.Provider,{value:r,children:l})};const Bi=o.createContext(void 0),Hi=["component","className","children","size","orientation","wrap","variant","color","role","slots","slotProps"],Wi=Qr("ul")(e=>{let t=e.theme,r=e.ownerState;var n;const o=si({theme:t,ownerState:r},["p","padding","borderRadius"]),i=o.p,a=o.padding,s=o.borderRadius;function l(e){return"sm"===e?{"--ListDivider-gap":"0.25rem","--ListItem-minHeight":"2rem","--ListItem-paddingY":"3px","--ListItem-paddingX":r.marker?"3px":"0.5rem","--ListItem-gap":"0.5rem","--ListItemDecorator-size":"horizontal"===r.orientation?"1.5rem":"2rem","--Icon-fontSize":t.vars.fontSize.lg}:"md"===e?{"--ListDivider-gap":"0.375rem","--ListItem-minHeight":"2.25rem","--ListItem-paddingY":"0.25rem","--ListItem-paddingX":r.marker?"0.25rem":"0.75rem","--ListItem-gap":"0.625rem","--ListItemDecorator-size":"horizontal"===r.orientation?"1.75rem":"2.5rem","--Icon-fontSize":t.vars.fontSize.xl}:"lg"===e?{"--ListDivider-gap":"0.5rem","--ListItem-minHeight":"2.75rem","--ListItem-paddingY":"0.375rem","--ListItem-paddingX":r.marker?"0.5rem":"1rem","--ListItem-gap":"0.75rem","--ListItemDecorator-size":"horizontal"===r.orientation?"2.25rem":"3rem","--Icon-fontSize":t.vars.fontSize.xl2}:{}}return[r.nesting&&(0,je.A)({},l(r.instanceSize),{"--ListItem-paddingRight":"var(--ListItem-paddingX)","--ListItem-paddingLeft":"var(--NestedListItem-paddingLeft)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px",padding:0},r.marker&&{paddingInlineStart:"calc(3ch - var(--_List-markerDeduct, 0px))"},{marginInlineStart:"var(--NestedList-marginLeft)",marginInlineEnd:"var(--NestedList-marginRight)",marginBlockStart:"var(--List-gap)",marginBlockEnd:"initial"}),!r.nesting&&(0,je.A)({},l(r.size),{"--List-gap":"0px","--List-nestedInsetStart":"0px","--ListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItem-paddingRight":"var(--ListItem-paddingX)"},r.marker&&{"--_List-markerDeduct":"1ch"},{"--unstable_List-childRadius":"calc(max(var(--List-radius) - var(--List-padding), min(var(--List-padding) / 2, var(--List-radius) / 2)) - var(--variant-borderWidth, 0px))","--ListItem-radius":"var(--unstable_List-childRadius)","--ListItem-startActionTranslateX":"calc(0.5 * var(--ListItem-paddingLeft))","--ListItem-endActionTranslateX":"calc(-0.5 * var(--ListItem-paddingRight))",margin:"initial"},t.typography["body-".concat(r.size)],"horizontal"===r.orientation?(0,je.A)({},r.wrap?{padding:"var(--List-padding)",marginInlineStart:"calc(-1 * var(--List-gap))",marginBlockStart:"calc(-1 * var(--List-gap))"}:{paddingInline:"var(--List-padding, var(--ListDivider-gap))",paddingBlock:"var(--List-padding)"}):{paddingBlock:"var(--List-padding, var(--ListDivider-gap))",paddingInline:"var(--List-padding)"},r.marker&&{paddingInlineStart:"3ch"}),(0,je.A)({boxSizing:"border-box",borderRadius:"var(--List-radius)",listStyle:"none",display:"flex",flexDirection:"horizontal"===r.orientation?"row":"column"},r.wrap&&{flexWrap:"wrap"},r.marker&&{"--_List-markerDisplay":"list-item","--_List-markerType":r.marker,lineHeight:"calc(var(--ListItem-minHeight) - 2 * var(--ListItem-paddingY))"},{flexGrow:1,position:"relative"},null==(n=t.variants[r.variant])?void 0:n[r.color],{"--unstable_List-borderWidth":"var(--variant-borderWidth, 0px)"},void 0!==s&&{"--List-radius":s},void 0!==i&&{"--List-padding":i},void 0!==a&&{"--List-padding":a})]}),Vi=Qr(Wi,{name:"JoyList",slot:"Root",overridesResolver:(e,t)=>t.root})({}),$i=o.forwardRef(function(e,t){var r;const n=o.useContext(zi),i=o.useContext(Mi),a=o.useContext(Bi),l=en({props:e,name:"JoyList"}),c=l.component,d=l.className,u=l.children,h=l.size,p=l.orientation,v=void 0===p?"vertical":p,f=l.wrap,m=void 0!==f&&f,g=l.variant,y=void 0===g?"plain":g,b=l.color,x=void 0===b?"neutral":b,w=l.role,S=l.slots,k=void 0===S?{}:S,_=l.slotProps,C=void 0===_?{}:_,A=(0,Ie.A)(l,Hi),j=h||(null!=(r=e.size)?r:"md");let I;i&&(I="group"),a&&(I="presentation"),w&&(I=w);const P=(0,je.A)({},l,{instanceSize:e.size,size:j,nesting:n,orientation:v,wrap:m,variant:y,color:x,role:I}),R=(e=>{const t=e.variant,r=e.color,n=e.size,o=e.nesting,i=e.orientation,a=e.instanceSize;return Dr({root:["root",i,t&&"variant".concat(Le(t)),r&&"color".concat(Le(r)),!a&&!o&&n&&"size".concat(Le(n)),a&&"size".concat(Le(a)),o&&"nesting"]},Ei,{})})(P),T=(0,je.A)({},A,{component:c,slots:k,slotProps:C}),E=pn("root",{ref:t,className:(0,Pe.A)(R.root,d),elementType:Vi,externalForwardedProps:T,ownerState:P,additionalProps:{as:c,role:I,"aria-labelledby":"string"===typeof n?n:void 0}}),z=(0,s.A)(E,2),D=z[0],M=z[1];return(0,tr.jsx)(D,(0,je.A)({},M,{children:(0,tr.jsx)(Di.Provider,{value:"".concat("string"===typeof c?c:"",":").concat(I||""),children:(0,tr.jsx)(Ni,{row:"horizontal"===v,wrap:m,children:u})})}))}),Ui=$i;function qi(e){return xr("MuiListItem",e)}const Ki=wr("MuiListItem",["root","startAction","endAction","nested","nesting","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const Gi=o.createContext(void 0),Ji=["component","className","children","nested","sticky","variant","color","startAction","endAction","role","slots","slotProps"],Qi=Qr("li")(e=>{let t=e.theme,r=e.ownerState;var n;return[!r.nested&&{"--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItemButton-marginBlock":"calc(-1 * var(--ListItem-paddingY))",alignItems:"center",gap:"var(--ListItem-gap)",marginInline:"var(--ListItem-marginInline)"},r.nested&&{"--NestedList-marginRight":"calc(-1 * var(--ListItem-paddingRight))","--NestedList-marginLeft":"calc(-1 * var(--ListItem-paddingLeft))","--NestedListItem-paddingLeft":"calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItem-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",flexDirection:"column"},(0,je.A)({"--unstable_actionRadius":"calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"},r.startAction&&{"--unstable_startActionWidth":"2rem"},r.endAction&&{"--unstable_endActionWidth":"2.5rem"},{boxSizing:"border-box",borderRadius:"var(--ListItem-radius)",display:"var(--_ListItem-display)","&:not([hidden])":{"--_ListItem-display":"var(--_List-markerDisplay, flex)"},flex:"none",listStyleType:"var(--_List-markerType, disc)",position:"relative",paddingBlockStart:r.nested?0:"var(--ListItem-paddingY)",paddingBlockEnd:r.nested?0:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)"},void 0===r["data-first-child"]&&(0,je.A)({},r.row?{marginInlineStart:"var(--List-gap)"}:{marginBlockStart:"var(--List-gap)"}),r.row&&r.wrap&&{marginInlineStart:"var(--List-gap)",marginBlockStart:"var(--List-gap)"},{minBlockSize:"var(--ListItem-minHeight)"},r.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:"var(--ListItem-stickyBackground, ".concat(t.vars.palette.background.body,")")},{[".".concat(Ki.nested," > &")]:{"--_ListItem-display":"flex"}}),null==(n=t.variants[r.variant])?void 0:n[r.color]]}),Yi=Qr(Qi,{name:"JoyListItem",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Xi=Qr("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(e=>({display:"inherit",position:"absolute",top:e.ownerState.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",left:0,transform:"translate(var(--ListItem-startActionTranslateX), -50%)",zIndex:1})),Zi=Qr("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(e=>({display:"inherit",position:"absolute",top:e.ownerState.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",right:0,transform:"translate(var(--ListItem-endActionTranslateX), -50%)"})),ea=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListItem"}),n=o.useContext(Mi),i=o.useContext(Di),a=o.useContext(Li),l=o.useContext(Oi),c=o.useContext(zi),d=r.component,u=r.className,h=r.children,p=r.nested,v=void 0!==p&&p,f=r.sticky,m=void 0!==f&&f,g=r.variant,y=void 0===g?"plain":g,b=r.color,x=void 0===b?"neutral":b,w=r.startAction,S=r.endAction,k=r.role,_=r.slots,C=void 0===_?{}:_,A=r.slotProps,j=void 0===A?{}:A,I=(0,Ie.A)(r,Ji),P=o.useState(""),R=(0,s.A)(P,2),T=R[0],E=R[1],z=(null==i?void 0:i.split(":"))||["",""],D=(0,s.A)(z,2),M=D[0],L=D[1],O=d||(M&&!M.match(/^(ul|ol|menu)$/)?"div":void 0);let F="menu"===n?"none":void 0;i&&(F={menu:"none",menubar:"none",group:"presentation"}[L]),k&&(F=k);const N=(0,je.A)({},r,{sticky:m,startAction:w,endAction:S,row:a,wrap:l,variant:y,color:x,nesting:c,nested:v,component:O,role:F}),B=(e=>{const t=e.sticky,r=e.nested,n=e.nesting,o=e.variant,i=e.color;return Dr({root:["root",r&&"nested",n&&"nesting",t&&"sticky",i&&"color".concat(Le(i)),o&&"variant".concat(Le(o))],startAction:["startAction"],endAction:["endAction"]},qi,{})})(N),H=(0,je.A)({},I,{component:O,slots:C,slotProps:j}),W=pn("root",{additionalProps:{role:F},ref:t,className:(0,Pe.A)(B.root,u),elementType:Yi,externalForwardedProps:H,ownerState:N}),V=(0,s.A)(W,2),$=V[0],U=V[1],q=pn("startAction",{className:B.startAction,elementType:Xi,externalForwardedProps:H,ownerState:N}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=pn("endAction",{className:B.endAction,elementType:Zi,externalForwardedProps:H,ownerState:N}),Y=(0,s.A)(Q,2),X=Y[0],Z=Y[1];return(0,tr.jsx)(Gi.Provider,{value:E,children:(0,tr.jsx)(zi.Provider,{value:!!v&&(T||!0),children:(0,tr.jsxs)($,(0,je.A)({},U,{children:[w&&(0,tr.jsx)(G,(0,je.A)({},J,{children:w})),o.Children.map(h,(e,t)=>{var r;return o.isValidElement(e)?o.cloneElement(e,(0,je.A)({},0===t&&{"data-first-child":""},Ln(e,["ListItem"])&&{component:(null==(r=e.props)?void 0:r.component)||"div"})):e}),S&&(0,tr.jsx)(X,(0,je.A)({},Z,{children:S}))]}))})})});ea.muiName="ListItem";const ta=ea;function ra(e){return xr("MuiListItemDecorator",e)}wr("MuiListItemDecorator",["root"]);const na=o.createContext("horizontal"),oa=["component","className","children","slots","slotProps"],ia=Qr("span",{name:"JoyListItemDecorator",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState;return(0,je.A)({boxSizing:"border-box",display:"inline-flex",alignItems:"var(--unstable_ListItemDecorator-alignItems, ".concat("horizontal"===t.parentOrientation?"center":"initial",")")},"horizontal"===t.parentOrientation?{minInlineSize:"var(--ListItemDecorator-size)",marginInlineEnd:"calc(-1 * var(--ListItem-gap))"}:{minBlockSize:"var(--ListItemDecorator-size)",justifyContent:"center",marginBlockEnd:"calc(-1 * var(--ListItem-gap))"})}),aa=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListItemDecorator"}),n=r.component,i=r.className,a=r.children,l=r.slots,c=void 0===l?{}:l,d=r.slotProps,u=void 0===d?{}:d,h=(0,Ie.A)(r,oa),p=o.useContext(na),v=(0,je.A)({parentOrientation:p},r),f=Dr({root:["root"]},ra,{}),m=(0,je.A)({},h,{component:n,slots:c,slotProps:u}),g=pn("root",{ref:t,className:(0,Pe.A)(f.root,i),elementType:ia,externalForwardedProps:m,ownerState:v}),y=(0,s.A)(g,2),b=y[0],x=y[1];return(0,tr.jsx)(b,(0,je.A)({},x,{children:a}))});var sa=r(3525),la=r(3529);const ca="3.1.0",da="pkce-code-verifier";var ua,ha;!function(e){e.s="string",e.i="integer",e.b="boolean"}(ua||(ua={})),function(e){e.token_bundle="kinde_token",e.access_token="kinde_access_token",e.id_token="kinde_id_token",e.user="user",e.refresh_token="kinde_refresh_token"}(ha||(ha={}));class pa extends Error{}function va(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}(t)}catch(r){return atob(t)}}function fa(e,t){if("string"!==typeof e)throw new pa("Invalid token specified: must be a string");t||(t={});const r=!0===t.header?0:1,n=e.split(".")[r];if("string"!==typeof n)throw new pa("Invalid token specified: missing part #".concat(r+1));let o;try{o=va(n)}catch(Mp){throw new pa("Invalid token specified: invalid base64 for part #".concat(r+1," (").concat(Mp.message,")"))}try{return JSON.parse(o)}catch(Mp){throw new pa("Invalid token specified: invalid json for part #".concat(r+1," (").concat(Mp.message,")"))}}async function ma(e){const t=await function(e){const t=(new TextEncoder).encode(e);return window.crypto.subtle.digest("SHA-256",t)}(e);return function(e){const t=Array.from(new Uint8Array(e));return btoa(String.fromCharCode.apply(null,t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}(t)}function ga(){const e=new Uint32Array(28);return window.crypto.getRandomValues(e),Array.from(e,e=>("0"+e.toString(16)).substr(-2)).join("")}pa.prototype.name="InvalidTokenError";const ya=e=>{const t=Math.floor(Date.now()/1e3);return e.exp+60>t},ba=(()=>{let e={};return{reset:()=>{e={}},getItem:t=>e[t],removeItem:t=>{delete e[t]},setItem:(t,r)=>{e[t]=r}}})(),xa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"access_token";const r=ba.getItem("kinde_".concat(t));return r?{name:e,value:r[e]}:null},wa=function(e){const t=xa(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"access_token");return t&&t.value},Sa=(e,t,r)=>{const n=wa("feature_flags"),o=n&&n[e]?n[e]:{};if(null==o.v&&null==t)throw Error("Flag ".concat(e," was not found, and no default value has been provided"));if(r&&o.t&&r!==o.t)throw Error("Flag ".concat(e," is of type ").concat(ua[o.t]," - requested type ").concat(ua[r]));return{code:e,type:ua[o.t||r],value:null==o.v?t:o.v,is_default:null==o.v}},ka=(e,t)=>{try{return Sa(e,t,"b").value}catch(r){return console.error(r),r}},_a=(e,t)=>{try{return Sa(e,t,"i").value}catch(r){return console.error(r),r}},Ca=(e,t)=>{try{return Sa(e,t,"s").value}catch(r){return console.error(r),r}},Aa=()=>{var e;return{orgCodes:null!==(e=wa("org_codes","id_token"))&&void 0!==e?e:[]}},ja=["iss","azp"],Ia=(e,t)=>{if(!e)throw new Error("ID token is required");if(ja.forEach(r=>{if(!e.payload[r])throw new Error("(".concat(r,") claim is required."));if(e.payload[r]!==t[r])throw new Error("".concat(r,' claim mismatch. Expected: "').concat(t[r],'", Received: "').concat(e.payload[r],'"'))}),"RS256"!==e.header.alg)throw new Error('Unsupported signature alg. Expected: "RS256", Received: "'.concat(e.header.alg,'"'));if(t.aud){if(!Array.isArray(e.payload.aud))throw new Error("(aud) claim must be an array");if(!e.payload.aud.includes(t.aud))throw new Error('(aud) claim mismatch. Expected: "'.concat(t.aud,'", Received: "').concat(e.payload.aud.join(", "),'"'))}if(!ya(e.payload))throw new Error("Token expired");return!0},Pa=async e=>{if(!e)throw Error("Please provide your Kinde credentials");if(e!==Object(e))throw Error("The Kinde SDK must be initiated with an object");const t=e.audience,r=e.client_id,n=e.domain,o=e.is_dangerously_use_local_storage,i=void 0!==o&&o,a=e.redirect_uri,s=e.logout_uri,l=void 0===s?a:s,c=e.on_redirect_callback,d=e.scope,u=void 0===d?"openid profile email offline":d,h=e.proxy_redirect_uri,p=e._framework,v=e._frameworkVersion;if(t&&"string"!==typeof t)throw Error("Please supply a valid audience for your api");if(u&&"string"!==typeof u)throw Error("Please supply a valid scope");if(!a||"string"!==typeof e.redirect_uri)throw Error("Please supply a valid redirect_uri for your users to be redirected after successful authentication");if(!n||"string"!==typeof n)throw Error("Please supply a valid Kinde domain so we can connect to your account");if("boolean"!==typeof i)throw TypeError("Please supply a boolean value for is_dangerously_use_local_storage");const f=r||"spa@live",m="localhost"===location.hostname||"127.0.0.1"===location.hostname,g=!m&&!i&&"kinde.com"!==new URL(n).hostname.split(".").slice(-2).join(".");const y=m||i,b={audience:t,client_id:f,redirect_uri:a,authorization_endpoint:"".concat(n,"/oauth2/auth"),token_endpoint:"".concat(n,"/oauth2/token"),requested_scopes:u,domain:n,_framework:p,_frameworkVersion:v},x=e=>{if(!e||e.error)return;const o=fa(e.id_token),i=fa(e.id_token,{header:!0}),a=fa(e.access_token),s=fa(e.access_token,{header:!0}),l={iss:n,azp:r,aud:t};Ia({payload:o,header:i},(0,Ae.A)((0,Ae.A)({},l),{},{aud:r})),Ia({payload:a,header:s},l),ba.setItem(ha.token_bundle,e),ba.setItem(ha.access_token,a),ba.setItem(ha.id_token,o),ba.setItem(ha.user,{id:o.sub,given_name:o.given_name,family_name:o.family_name,email:o.email,picture:o.picture}),y?localStorage.setItem(ha.refresh_token,e.refresh_token):ba.setItem(ha.refresh_token,e.refresh_token)},w=async function(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tokenType:ha.access_token}).tokenType;const t=y?localStorage.getItem(ha.refresh_token):ba.getItem(ha.refresh_token);if(t||g)try{const r=await fetch(b.token_endpoint,(0,Ae.A)((0,Ae.A)({method:"POST"},g&&{credentials:"include"}),{},{headers:new Headers({"Content-type":"application/x-www-form-urlencoded; charset=UTF-8","Kinde-SDK":"\n ".concat(b._framework||"JavaScript","/").concat(b._frameworkVersion||ca)}),body:new URLSearchParams((0,Ae.A)({client_id:b.client_id,grant_type:"refresh_token"},!g&&t&&{refresh_token:t}))})),n=await r.json();return x(n),e===ha.id_token?n.id_token:n.access_token}catch(r){console.error(r)}},S=async e=>{const t=ba.getItem(ha.token_bundle);if(!t)return await w({tokenType:e});const r=ba.getItem(e);return ya(r)?e===ha.access_token?t.access_token:t.id_token:await w({tokenType:e})},k=async()=>await S(ha.access_token),_=async e=>{const r=e.app_state,n=e.prompt,o=e.is_create_org,i=e.org_name,s=void 0===i?"":i,l=e.org_code,c=e.authUrlParams,d=void 0===c?{}:c,u=await(async(e,t)=>{const r=ga(),n=ga(),o=await ma(n);return sessionStorage.setItem("".concat(da,"-").concat(r),JSON.stringify({codeVerifier:n,appState:t})),{state:r,code_challenge:o,url:new URL(e)}})(b.authorization_endpoint,r),h=u.state,p=u.code_challenge,v=u.url,m={redirect_uri:a,client_id:f,response_type:"code",scope:b.requested_scopes,code_challenge:p,code_challenge_method:"S256",state:h};n&&(m.prompt=n),l&&(m.org_code=l),o&&(m.is_create_org=String(o),m.org_name=s);const g=new URLSearchParams(Object.assign(d,m));t&&t.trim().split(/\s+/).forEach(e=>{g.append("audience",e)}),v.search=String(g),window.location.href=v.toString()},C=()=>ba.getItem(ha.user),A=e=>{if(!e.has("code"))return!1;const t=window.location,r=t.protocol,n=t.host,o=t.pathname,i=h||"".concat(r,"//").concat(n).concat(o);return i===a||i==="".concat(a,"/")};return await(async()=>{const e=new URLSearchParams(window.location.search);A(e)?await(async e=>{const t=e.get("code"),r=e.get("state"),n=e.get("error");n&&console.error("Error returned from authorization server: ".concat(n));const o=sessionStorage.getItem("".concat(da,"-").concat(r));if(o){const e=JSON.parse(o),n=e.appState,a=e.codeVerifier;try{const e=await fetch(b.token_endpoint,(0,Ae.A)((0,Ae.A)({method:"POST"},g&&{credentials:"include"}),{},{headers:new Headers({"Content-type":"application/x-www-form-urlencoded; charset=UTF-8","Kinde-SDK":"".concat(b._framework||"JavaScript","/").concat(b._frameworkVersion||ca)}),body:new URLSearchParams({client_id:b.client_id,code:t,code_verifier:a,grant_type:"authorization_code",redirect_uri:b.redirect_uri})})),o=await e.json();x(o);const i=new URL(window.location.toString());i.search="",sessionStorage.removeItem("".concat(da,"-").concat(r));const s=C();window.history.pushState({},"",i),c&&c(s,n)}catch(i){console.error(i),sessionStorage.removeItem("".concat(da,"-").concat(r))}}else console.error("Invalid state")})(e):(g||y)&&await w()})(),{getToken:k,getIdToken:async()=>await S(ha.id_token),getUser:C,getUserProfile:async()=>{const e=await k(),t={Accept:"application/json",Authorization:"Bearer ".concat(e)};try{const e=await fetch("".concat(b.domain,"/oauth2/v2/user_profile"),{method:"GET",headers:t}),r=await e.json();return ba.setItem(ha.user,{id:r.sub,given_name:r.given_name,family_name:r.family_name,email:r.email,picture:r.picture}),ba.getItem(ha.user)}catch(r){console.error(r)}},login:async e=>{await _((0,Ae.A)({},e))},logout:async()=>{const e=new URL("".concat(b.domain,"/logout"));try{ba.reset(),y&&localStorage.removeItem(ha.refresh_token);const t=new URLSearchParams({redirect:l});e.search=String(t),window.location.href=e.toString()}catch(t){console.error(t)}},register:async e=>{await _((0,Ae.A)((0,Ae.A)({},e),{},{prompt:"create"}))},isAuthenticated:async()=>{const e=ba.getItem(ha.access_token);if(!e)return!1;return ya(e)||await w(),!0},createOrg:async e=>{await _((0,Ae.A)((0,Ae.A)({},e),{},{prompt:"create",is_create_org:!0}))},getClaim:xa,getFlag:Sa,getBooleanFlag:ka,getStringFlag:Ca,getIntegerFlag:_a,getPermissions:()=>{var e;const t=wa("org_code");return{permissions:null!==(e=wa("permissions"))&&void 0!==e?e:[],orgCode:t}},getPermission:e=>{var t;const r=wa("org_code");return{isGranted:(null!==(t=wa("permissions"))&&void 0!==t?t:[]).some(t=>t===e),orgCode:r}},getOrganization:()=>({orgCode:wa("org_code")}),getUserOrganizations:Aa}};var Ra=function(){return Ra=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Xa=new(qa=new WeakMap,Ka=new WeakMap,Ga=new WeakMap,class extends Ya{constructor(){super(),Wa(this,qa,void 0),Wa(this,Ka,void 0),Wa(this,Ga,void 0),Ua(Ga,this,e=>{if("undefined"!==typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){$a(Ka,this)||this.setEventListener($a(Ga,this))}onUnsubscribe(){var e;this.hasListeners()||(null===(e=$a(Ka,this))||void 0===e||e.call(this),Ua(Ka,this,void 0))}setEventListener(e){var t;Ua(Ga,this,e),null===(t=$a(Ka,this))||void 0===t||t.call(this),Ua(Ka,this,e(e=>{"boolean"===typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){$a(qa,this)!==e&&(Ua(qa,this,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return"boolean"===typeof $a(qa,this)?$a(qa,this):"hidden"!==(null===(e=globalThis.document)||void 0===e?void 0:e.visibilityState)}}),Za={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},es=new(Ja=new WeakMap,Qa=new WeakMap,class{constructor(){Wa(this,Ja,Za),Wa(this,Qa,!1)}setTimeoutProvider(e){Ua(Ja,this,e)}setTimeout(e,t){return $a(Ja,this).setTimeout(e,t)}clearTimeout(e){$a(Ja,this).clearTimeout(e)}setInterval(e,t){return $a(Ja,this).setInterval(e,t)}clearInterval(e){$a(Ja,this).clearInterval(e)}});var ts="undefined"===typeof window||"Deno"in globalThis;function rs(){}function ns(e){return"number"===typeof e&&e>=0&&e!==1/0}function os(e,t){return Math.max(e+(t||0)-Date.now(),0)}function is(e,t){return"function"===typeof e?e(t):e}function as(e,t){return"function"===typeof e?e(t):e}function ss(e,t){const r=e.type,n=void 0===r?"all":r,o=e.exact,i=e.fetchStatus,a=e.predicate,s=e.queryKey,l=e.stale;if(s)if(o){if(t.queryHash!==cs(s,t.options))return!1}else if(!us(t.queryKey,s))return!1;if("all"!==n){const e=t.isActive();if("active"===n&&!e)return!1;if("inactive"===n&&e)return!1}return("boolean"!==typeof l||t.isStale()===l)&&((!i||i===t.state.fetchStatus)&&!(a&&!a(t)))}function ls(e,t){const r=e.exact,n=e.status,o=e.predicate,i=e.mutationKey;if(i){if(!t.options.mutationKey)return!1;if(r){if(ds(t.options.mutationKey)!==ds(i))return!1}else if(!us(t.options.mutationKey,i))return!1}return(!n||t.state.status===n)&&!(o&&!o(t))}function cs(e,t){return((null===t||void 0===t?void 0:t.queryKeyHashFn)||ds)(e)}function ds(e){return JSON.stringify(e,(e,t)=>ms(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function us(e,t){if(e===t)return!0;if(typeof e!==typeof t)return!1;if(e&&t&&"object"===typeof e&&"object"===typeof t){if(Array.isArray(e)&&Array.isArray(t)){for(let r=0;r2&&void 0!==arguments[2]?arguments[2]:0;if(e===t)return e;if(r>500)return t;const n=fs(e)&&fs(t);if(!n&&(!ms(e)||!ms(t)))return t;const o=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,s=n?new Array(a):{};let l=0;for(let c=0;c2&&void 0!==arguments[2]?arguments[2]:0;const n=[...e,t];return r&&n.length>r?n.slice(1):n}function xs(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var ws=Symbol();function Ss(e,t){return!e.queryFn&&null!==t&&void 0!==t&&t.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==ws?e.queryFn:()=>Promise.reject(new Error("Missing queryFn: '".concat(e.queryHash,"'")))}function ks(e,t){return"function"===typeof e?e(...t):!!e}var _s=(()=>{let e=()=>ts;return{isServer:()=>e(),setIsServer(t){e=t}}})(),Cs=function(e){setTimeout(e,0)};var As,js,Is,Ps=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},o=Cs;const i=n=>{t?e.push(n):o(()=>{r(n)})};return{batch:i=>{let a;t++;try{a=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return a},batchCalls:e=>function(){for(var t=arguments.length,r=new Array(t),n=0;n{e(...r)})},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{o=e}}}(),Rs=new(As=new WeakMap,js=new WeakMap,Is=new WeakMap,class extends Ya{constructor(){super(),Wa(this,As,!0),Wa(this,js,void 0),Wa(this,Is,void 0),Ua(Is,this,e=>{if("undefined"!==typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}})}onSubscribe(){$a(js,this)||this.setEventListener($a(Is,this))}onUnsubscribe(){var e;this.hasListeners()||(null===(e=$a(js,this))||void 0===e||e.call(this),Ua(js,this,void 0))}setEventListener(e){var t;Ua(Is,this,e),null===(t=$a(js,this))||void 0===t||t.call(this),Ua(js,this,e(this.setOnline.bind(this)))}setOnline(e){$a(As,this)!==e&&(Ua(As,this,e),this.listeners.forEach(t=>{t(e)}))}isOnline(){return $a(As,this)}});function Ts(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function Es(e){return Math.min(1e3*2**e,3e4)}function zs(e){return"online"!==(null!==e&&void 0!==e?e:"online")||Rs.isOnline()}var Ds,Ms=class extends Error{constructor(e){super("CancelledError"),this.revert=null===e||void 0===e?void 0:e.revert,this.silent=null===e||void 0===e?void 0:e.silent}};function Ls(e){let t,r=!1,n=0;const o=Ts(),i=()=>"pending"!==o.status,a=()=>Xa.isFocused()&&("always"===e.networkMode||Rs.isOnline())&&e.canRun(),s=()=>zs(e.networkMode)&&e.canRun(),l=e=>{var r;i()||(null===(r=t)||void 0===r||r(),o.resolve(e))},c=e=>{var r;i()||(null===(r=t)||void 0===r||r(),o.reject(e))},d=()=>new Promise(r=>{var n;t=e=>{(i()||a())&&r(e)},null===(n=e.onPause)||void 0===n||n.call(e)}).then(()=>{var r;(t=void 0,i())||(null===(r=e.onContinue)||void 0===r||r.call(e))}),u=()=>{if(i())return;let t;const o=0===n?e.initialPromise:void 0;try{t=null!==o&&void 0!==o?o:e.fn()}catch(s){t=Promise.reject(s)}Promise.resolve(t).then(l).catch(t=>{var o,s,l;if(i())return;const h=null!==(o=e.retry)&&void 0!==o?o:_s.isServer()?0:3,p=null!==(s=e.retryDelay)&&void 0!==s?s:Es,v="function"===typeof p?p(n,t):p,f=!0===h||"number"===typeof h&&n{es.setTimeout(e,m)})).then(()=>a()?void 0:d()).then(()=>{r?c(t):u()})):c(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!i()){var r;const n=new Ms(t);c(n),null===(r=e.onCancel)||void 0===r||r.call(e,n)}},continue:()=>{var e;return null===(e=t)||void 0===e||e(),o},cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:s,start:()=>(s()?u():d().then(u),o)}}var Os,Fs,Ns,Bs,Hs,Ws,Vs,$s,Us,qs=(Ds=new WeakMap,class{constructor(){Wa(this,Ds,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ns(this.gcTime)&&Ua(Ds,this,es.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,null!==e&&void 0!==e?e:_s.isServer()?1/0:3e5)}clearGcTimeout(){void 0!==$a(Ds,this)&&(es.clearTimeout($a(Ds,this)),Ua(Ds,this,void 0))}});function Ks(e){return{onFetch:(t,r)=>{var n,o,i;const a=t.options,s=null===(n=t.fetchOptions)||void 0===n||null===(n=n.meta)||void 0===n||null===(n=n.fetchMore)||void 0===n?void 0:n.direction,l=(null===(o=t.state.data)||void 0===o?void 0:o.pages)||[],c=(null===(i=t.state.data)||void 0===i?void 0:i.pageParams)||[];let d={pages:[],pageParams:[]},u=0;const h=async()=>{let r=!1;const n=e=>{!function(e,t,r){let n,o=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(null!==n&&void 0!==n||(n=t()),o||(o=!0,n.aborted?r():n.addEventListener("abort",r,{once:!0})),n)})}(e,()=>t.signal,()=>r=!0)},o=Ss(t.options,t.fetchOptions),i=async(e,i,a)=>{if(r)return Promise.reject(t.signal.reason);if(null==i&&e.pages.length)return Promise.resolve(e);const s=(()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:i,direction:a?"backward":"forward",meta:t.options.meta};return n(e),e})(),l=await o(s),c=t.options.maxPages,d=a?xs:bs;return{pages:d(e.pages,l,c),pageParams:d(e.pageParams,i,c)}};if(s&&l.length){const e="backward"===s,t={pages:l,pageParams:c},r=(e?Js:Gs)(a,t);d=await i(t,r,e)}else{const t=null!==e&&void 0!==e?e:l.length;do{var h;const e=0===u?null!==(h=c[0])&&void 0!==h?h:a.initialPageParam:Gs(a,d);if(u>0&&null==e)break;d=await i(d,e),u++}while(u{var e,n;return null===(e=(n=t.options).persister)||void 0===e?void 0:e.call(n,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function Gs(e,t){let r=t.pages,n=t.pageParams;const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,n[o],n):void 0}function Js(e,t){var r;let n=t.pages,o=t.pageParams;return n.length>0?null===(r=e.getPreviousPageParam)||void 0===r?void 0:r.call(e,n[0],n,o[0],o):void 0}var Qs,Ys,Xs,Zs,el,tl,rl,nl,ol,il,al,sl,ll,cl,dl,ul,hl=(Os=new WeakMap,Fs=new WeakMap,Ns=new WeakMap,Bs=new WeakMap,Hs=new WeakMap,Ws=new WeakMap,Vs=new WeakMap,$s=new WeakMap,Us=new WeakSet,class extends qs{constructor(e){var t;super(),Ha(this,Us),Wa(this,Os,void 0),Wa(this,Fs,void 0),Wa(this,Ns,void 0),Wa(this,Bs,void 0),Wa(this,Hs,void 0),Wa(this,Ws,void 0),Wa(this,Vs,void 0),Wa(this,$s,void 0),Ua($s,this,!1),Ua(Vs,this,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ua(Hs,this,e.client),Ua(Bs,this,$a(Hs,this).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ua(Fs,this,gl(this.options)),this.state=null!==(t=e.state)&&void 0!==t?t:$a(Fs,this),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return $a(Os,this)}get promise(){var e;return null===(e=$a(Ws,this))||void 0===e?void 0:e.promise}setOptions(e){if(this.options=(0,Ae.A)((0,Ae.A)({},$a(Vs,this)),e),null!==e&&void 0!==e&&e._type&&Ua(Os,this,e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=gl(this.options);void 0!==e.data&&(this.setState(ml(e.data,e.dataUpdatedAt)),Ua(Fs,this,e))}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||$a(Bs,this).remove(this)}setData(e,t){const r=ys(this.state.data,e,this.options);return Va(Us,this,vl).call(this,{data:r,type:"success",dataUpdatedAt:null===t||void 0===t?void 0:t.updatedAt,manual:null===t||void 0===t?void 0:t.manual}),r}setState(e){Va(Us,this,vl).call(this,{type:"setState",state:e})}cancel(e){var t,r;const n=null===(t=$a(Ws,this))||void 0===t?void 0:t.promise;return null===(r=$a(Ws,this))||void 0===r||r.cancel(e),n?n.then(rs).catch(rs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return $a(Fs,this)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==as(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ws||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===is(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!os(this.state.dataUpdatedAt,e))}onFocus(){var e;const t=this.observers.find(e=>e.shouldFetchOnWindowFocus());null===t||void 0===t||t.refetch({cancelRefetch:!1}),null===(e=$a(Ws,this))||void 0===e||e.continue()}onOnline(){var e;const t=this.observers.find(e=>e.shouldFetchOnReconnect());null===t||void 0===t||t.refetch({cancelRefetch:!1}),null===(e=$a(Ws,this))||void 0===e||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),$a(Bs,this).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||($a(Ws,this)&&($a($s,this)||Va(Us,this,pl).call(this)?$a(Ws,this).cancel({revert:!0}):$a(Ws,this).cancelRetry()),this.scheduleGc()),$a(Bs,this).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Va(Us,this,vl).call(this,{type:"invalidate"})}async fetch(e,t){var r,n;if("idle"!==this.state.fetchStatus&&"rejected"!==(null===(r=$a(Ws,this))||void 0===r?void 0:r.status()))if(void 0!==this.state.data&&null!==t&&void 0!==t&&t.cancelRefetch)this.cancel({silent:!0});else if($a(Ws,this))return $a(Ws,this).continueRetry(),$a(Ws,this).promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const o=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(Ua($s,this,!0),o.signal)})},a=()=>{const e=Ss(this.options,t),r=(()=>{const e={client:$a(Hs,this),queryKey:this.queryKey,meta:this.meta};return i(e),e})();return Ua($s,this,!1),this.options.persister?this.options.persister(e,r,this):e(r)},s=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:$a(Hs,this),state:this.state,fetchFn:a};return i(e),e})(),l="infinite"===$a(Os,this)?Ks(this.options.pages):this.options.behavior;var c;(null===l||void 0===l||l.onFetch(s,this),Ua(Ns,this,this.state),"idle"===this.state.fetchStatus||this.state.fetchMeta!==(null===(n=s.fetchOptions)||void 0===n?void 0:n.meta))&&Va(Us,this,vl).call(this,{type:"fetch",meta:null===(c=s.fetchOptions)||void 0===c?void 0:c.meta});Ua(Ws,this,Ls({initialPromise:null===t||void 0===t?void 0:t.initialPromise,fn:s.fetchFn,onCancel:e=>{e instanceof Ms&&e.revert&&this.setState((0,Ae.A)((0,Ae.A)({},$a(Ns,this)),{},{fetchStatus:"idle"})),o.abort()},onFail:(e,t)=>{Va(Us,this,vl).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Va(Us,this,vl).call(this,{type:"pause"})},onContinue:()=>{Va(Us,this,vl).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{var d,u,h,p;const e=await $a(Ws,this).start();if(void 0===e)throw new Error("".concat(this.queryHash," data is undefined"));return this.setData(e),null===(d=(u=$a(Bs,this).config).onSuccess)||void 0===d||d.call(u,e,this),null===(h=(p=$a(Bs,this).config).onSettled)||void 0===h||h.call(p,e,this.state.error,this),e}catch(y){var v,f,m,g;if(y instanceof Ms){if(y.silent)return $a(Ws,this).promise;if(y.revert){if(void 0===this.state.data)throw y;return this.state.data}}throw Va(Us,this,vl).call(this,{type:"error",error:y}),null===(v=(f=$a(Bs,this).config).onError)||void 0===v||v.call(f,y,this),null===(m=(g=$a(Bs,this).config).onSettled)||void 0===m||m.call(g,this.state.data,y,this),y}finally{this.scheduleGc()}}});function pl(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}function vl(e){this.state=(t=>{var r;switch(e.type){case"failed":return(0,Ae.A)((0,Ae.A)({},t),{},{fetchFailureCount:e.failureCount,fetchFailureReason:e.error});case"pause":return(0,Ae.A)((0,Ae.A)({},t),{},{fetchStatus:"paused"});case"continue":return(0,Ae.A)((0,Ae.A)({},t),{},{fetchStatus:"fetching"});case"fetch":return(0,Ae.A)((0,Ae.A)((0,Ae.A)({},t),fl(t.data,this.options)),{},{fetchMeta:null!==(r=e.meta)&&void 0!==r?r:null});case"success":const n=(0,Ae.A)((0,Ae.A)((0,Ae.A)({},t),ml(e.data,e.dataUpdatedAt)),{},{dataUpdateCount:t.dataUpdateCount+1},!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});return Ua(Ns,this,e.manual?n:void 0),n;case"error":const o=e.error;return(0,Ae.A)((0,Ae.A)({},t),{},{error:o,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0});case"invalidate":return(0,Ae.A)((0,Ae.A)({},t),{},{isInvalidated:!0});case"setState":return(0,Ae.A)((0,Ae.A)({},t),e.state)}})(this.state),Ps.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),$a(Bs,this).notify({query:this,type:"updated",action:e})})}function fl(e,t){return(0,Ae.A)({fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zs(t.networkMode)?"fetching":"paused"},void 0===e&&{error:null,status:"pending"})}function ml(e,t){return{data:e,dataUpdatedAt:null!==t&&void 0!==t?t:Date.now(),error:null,isInvalidated:!1,status:"success"}}function gl(e){const t="function"===typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"===typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?null!==n&&void 0!==n?n:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var yl=(Qs=new WeakMap,Ys=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,el=new WeakMap,tl=new WeakMap,rl=new WeakMap,nl=new WeakMap,ol=new WeakMap,il=new WeakMap,al=new WeakMap,sl=new WeakMap,ll=new WeakMap,cl=new WeakMap,dl=new WeakMap,ul=new WeakSet,class extends Ya{constructor(e,t){super(),Ha(this,ul),Wa(this,Qs,void 0),Wa(this,Ys,void 0),Wa(this,Xs,void 0),Wa(this,Zs,void 0),Wa(this,el,void 0),Wa(this,tl,void 0),Wa(this,rl,void 0),Wa(this,nl,void 0),Wa(this,ol,void 0),Wa(this,il,void 0),Wa(this,al,void 0),Wa(this,sl,void 0),Wa(this,ll,void 0),Wa(this,cl,void 0),Wa(this,dl,new Set),this.options=t,Ua(Qs,this,e),Ua(nl,this,null),Ua(rl,this,Ts()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&($a(Ys,this).addObserver(this),Il($a(Ys,this),this.options)?Va(ul,this,bl).call(this):this.updateResult(),Va(ul,this,kl).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Pl($a(Ys,this),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Pl($a(Ys,this),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Va(ul,this,_l).call(this),Va(ul,this,Cl).call(this),$a(Ys,this).removeObserver(this)}setOptions(e){const t=this.options,r=$a(Ys,this);if(this.options=$a(Qs,this).defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!==typeof this.options.enabled&&"function"!==typeof this.options.enabled&&"boolean"!==typeof as(this.options.enabled,$a(Ys,this)))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Va(ul,this,Al).call(this),$a(Ys,this).setOptions(this.options),t._defaulted&&!vs(this.options,t)&&$a(Qs,this).getQueryCache().notify({type:"observerOptionsUpdated",query:$a(Ys,this),observer:this});const n=this.hasListeners();n&&Rl($a(Ys,this),r,this.options,t)&&Va(ul,this,bl).call(this),this.updateResult(),!n||$a(Ys,this)===r&&as(this.options.enabled,$a(Ys,this))===as(t.enabled,$a(Ys,this))&&is(this.options.staleTime,$a(Ys,this))===is(t.staleTime,$a(Ys,this))||Va(ul,this,xl).call(this);const o=Va(ul,this,wl).call(this);!n||$a(Ys,this)===r&&as(this.options.enabled,$a(Ys,this))===as(t.enabled,$a(Ys,this))&&o===$a(cl,this)||Va(ul,this,Sl).call(this,o)}getOptimisticResult(e){const t=$a(Qs,this).getQueryCache().build($a(Qs,this),e),r=this.createResult(t,e);return function(e,t){if(!vs(e.getCurrentResult(),t))return!0;return!1}(this,r)&&(Ua(Zs,this,r),Ua(tl,this,this.options),Ua(el,this,$a(Ys,this).state)),r}getCurrentResult(){return $a(Zs,this)}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),null===t||void 0===t||t(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==$a(rl,this).status||$a(rl,this).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){$a(dl,this).add(e)}getCurrentQuery(){return $a(Ys,this)}refetch(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e));return this.fetch((0,Ae.A)({},t))}fetchOptimistic(e){const t=$a(Qs,this).defaultQueryOptions(e),r=$a(Qs,this).getQueryCache().build($a(Qs,this),t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){var t;return Va(ul,this,bl).call(this,(0,Ae.A)((0,Ae.A)({},e),{},{cancelRefetch:null===(t=e.cancelRefetch)||void 0===t||t})).then(()=>(this.updateResult(),$a(Zs,this)))}createResult(e,t){const r=$a(Ys,this),n=this.options,o=$a(Zs,this),i=$a(el,this),a=$a(tl,this),s=e!==r?e.state:$a(Xs,this),l=e.state;let c,d=(0,Ae.A)({},l),u=!1;if(t._optimisticResults){const o=this.hasListeners(),i=!o&&Il(e,t),a=o&&Rl(e,r,t,n);(i||a)&&(d=(0,Ae.A)((0,Ae.A)({},d),fl(l.data,e.options))),"isRestoring"===t._optimisticResults&&(d.fetchStatus="idle")}let h=d,p=h.error,v=h.errorUpdatedAt,f=h.status;c=d.data;let m=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===f){let e;var g;if(null!==o&&void 0!==o&&o.isPlaceholderData&&t.placeholderData===(null===a||void 0===a?void 0:a.placeholderData))e=o.data,m=!0;else e="function"===typeof t.placeholderData?t.placeholderData(null===(g=$a(al,this))||void 0===g?void 0:g.state.data,$a(al,this)):t.placeholderData;void 0!==e&&(f="success",c=ys(null===o||void 0===o?void 0:o.data,e,t),u=!0)}if(t.select&&void 0!==c&&!m)if(o&&c===(null===i||void 0===i?void 0:i.data)&&t.select===$a(ol,this))c=$a(il,this);else try{Ua(ol,this,t.select),c=t.select(c),c=ys(null===o||void 0===o?void 0:o.data,c,t),Ua(il,this,c),Ua(nl,this,null)}catch(_){Ua(nl,this,_)}$a(nl,this)&&(p=$a(nl,this),c=$a(il,this),v=Date.now(),f="error");const y="fetching"===d.fetchStatus,b="pending"===f,x="error"===f,w=b&&y,S=void 0!==c,k={status:f,fetchStatus:d.fetchStatus,isPending:b,isSuccess:"success"===f,isError:x,isInitialLoading:w,isLoading:w,data:c,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:d.dataUpdateCount>s.dataUpdateCount||d.errorUpdateCount>s.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!S,isPaused:"paused"===d.fetchStatus,isPlaceholderData:u,isRefetchError:x&&S,isStale:Tl(e,t),refetch:this.refetch,promise:$a(rl,this),isEnabled:!1!==as(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==k.data,n="error"===k.status&&!t,o=e=>{n?e.reject(k.error):t&&e.resolve(k.data)},i=()=>{const e=Ua(rl,this,k.promise=Ts());o(e)},a=$a(rl,this);switch(a.status){case"pending":e.queryHash===r.queryHash&&o(a);break;case"fulfilled":(n||k.data!==a.value)&&i();break;case"rejected":n&&k.error===a.reason||i()}}return k}updateResult(){const e=$a(Zs,this),t=this.createResult($a(Ys,this),this.options);if(Ua(el,this,$a(Ys,this).state),Ua(tl,this,this.options),void 0!==$a(el,this).data&&Ua(al,this,$a(Ys,this)),vs(t,e))return;Ua(Zs,this,t);Va(ul,this,jl).call(this,{listeners:(()=>{if(!e)return!0;const t=this.options.notifyOnChangeProps,r="function"===typeof t?t():t;if("all"===r||!r&&!$a(dl,this).size)return!0;const n=new Set(null!==r&&void 0!==r?r:$a(dl,this));return this.options.throwOnError&&n.add("error"),Object.keys($a(Zs,this)).some(t=>{const r=t;return $a(Zs,this)[r]!==e[r]&&n.has(r)})})()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Va(ul,this,kl).call(this)}});function bl(e){Va(ul,this,Al).call(this);let t=$a(Ys,this).fetch(this.options,e);return null!==e&&void 0!==e&&e.throwOnError||(t=t.catch(rs)),t}function xl(){Va(ul,this,_l).call(this);const e=is(this.options.staleTime,$a(Ys,this));if(_s.isServer()||$a(Zs,this).isStale||!ns(e))return;const t=os($a(Zs,this).dataUpdatedAt,e)+1;Ua(sl,this,es.setTimeout(()=>{$a(Zs,this).isStale||this.updateResult()},t))}function wl(){var e;return null!==(e="function"===typeof this.options.refetchInterval?this.options.refetchInterval($a(Ys,this)):this.options.refetchInterval)&&void 0!==e&&e}function Sl(e){Va(ul,this,Cl).call(this),Ua(cl,this,e),!_s.isServer()&&!1!==as(this.options.enabled,$a(Ys,this))&&ns($a(cl,this))&&0!==$a(cl,this)&&Ua(ll,this,es.setInterval(()=>{(this.options.refetchIntervalInBackground||Xa.isFocused())&&Va(ul,this,bl).call(this)},$a(cl,this)))}function kl(){Va(ul,this,xl).call(this),Va(ul,this,Sl).call(this,Va(ul,this,wl).call(this))}function _l(){void 0!==$a(sl,this)&&(es.clearTimeout($a(sl,this)),Ua(sl,this,void 0))}function Cl(){void 0!==$a(ll,this)&&(es.clearInterval($a(ll,this)),Ua(ll,this,void 0))}function Al(){const e=$a(Qs,this).getQueryCache().build($a(Qs,this),this.options);if(e===$a(Ys,this))return;const t=$a(Ys,this);Ua(Ys,this,e),Ua(Xs,this,e.state),this.hasListeners()&&(null===t||void 0===t||t.removeObserver(this),e.addObserver(this))}function jl(e){Ps.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e($a(Zs,this))}),$a(Qs,this).getQueryCache().notify({query:$a(Ys,this),type:"observerResultsUpdated"})})}function Il(e,t){return function(e,t){return!1!==as(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===as(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&Pl(e,t,t.refetchOnMount)}function Pl(e,t,r){if(!1!==as(t.enabled,e)&&"static"!==is(t.staleTime,e)){const n="function"===typeof r?r(e):r;return"always"===n||!1!==n&&Tl(e,t)}return!1}function Rl(e,t,r,n){return(e!==t||!1===as(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&Tl(e,r)}function Tl(e,t){return!1!==as(t.enabled,e)&&e.isStaleByTime(is(t.staleTime,e))}var El=o.createContext(void 0),zl=e=>{const t=o.useContext(El);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Dl=e=>{let t=e.client,r=e.children;return o.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,tr.jsx)(El.Provider,{value:t,children:r})};function Ml(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ll=o.createContext(Ml()),Ol=()=>o.useContext(Ll),Fl=(e,t,r)=>{const n=null!==r&&void 0!==r&&r.state.error&&"function"===typeof e.throwOnError?ks(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},Nl=e=>{o.useEffect(()=>{e.clearReset()},[e])},Bl=e=>{let t=e.result,r=e.errorResetBoundary,n=e.throwOnError,o=e.query,i=e.suspense;return t.isError&&!r.isReset()&&!t.isFetching&&o&&(i&&void 0===t.data||ks(n,[t.error,o]))},Hl=o.createContext(!1),Wl=()=>o.useContext(Hl),Vl=(Hl.Provider,e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(null!==e&&void 0!==e?e:t,t),n=e.staleTime;e.staleTime="function"===typeof n?function(){return r(n(...arguments))}:r(n),"number"===typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}}),$l=(e,t)=>(null===e||void 0===e?void 0:e.suspense)&&t.isPending,Ul=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function ql(e,t){return function(e,t,r){var n,i,a,l;const c=Wl(),d=Ol(),u=zl(r),h=u.defaultQueryOptions(e);null===(n=u.getDefaultOptions().queries)||void 0===n||null===(i=n._experimental_beforeQuery)||void 0===i||i.call(n,h);const p=u.getQueryCache().get(h.queryHash),v=!1!==e.subscribed;h._optimisticResults=c?"isRestoring":v?"optimistic":void 0,Vl(h),Fl(h,d,p),Nl(d);const f=!u.getQueryCache().get(h.queryHash),m=o.useState(()=>new t(u,h)),g=(0,s.A)(m,1)[0],y=g.getOptimisticResult(h),b=!c&&v;if(o.useSyncExternalStore(o.useCallback(e=>{const t=b?g.subscribe(Ps.batchCalls(e)):rs;return g.updateResult(),t},[g,b]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),o.useEffect(()=>{g.setOptions(h)},[h,g]),$l(h,y))throw Ul(h,g,d);if(Bl({result:y,errorResetBoundary:d,throwOnError:h.throwOnError,query:p,suspense:h.suspense}))throw y.error;if(null===(a=u.getDefaultOptions().queries)||void 0===a||null===(l=a._experimental_afterQuery)||void 0===l||l.call(a,h,y),h.experimental_prefetchInRender&&!_s.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(y,c)){const e=f?Ul(h,g,d):null===p||void 0===p?void 0:p.promise;null===e||void 0===e||e.catch(rs).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?y:g.trackResult(y)}(e,yl,t)}function Kl(e){if(!e)return"\u2014";const t=new Date(e).getTime();if(Number.isNaN(t))return"\u2014";const r=Date.now()-t;if(r<0)return"just now";if(r<6e4)return"just now";if(r<36e5){const e=Math.floor(r/6e4);return 1===e?"1 min ago":"".concat(e," min ago")}if(r<864e5){const e=Math.floor(r/36e5);return 1===e?"1 hour ago":"".concat(e," hours ago")}return r<1728e5?"yesterday":new Date(e).toLocaleDateString("en-GB",{day:"numeric",month:"short"})}async function Gl(e){const t=await e.text();return t?JSON.parse(t):null}async function Jl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;const n=new AbortController,o=setTimeout(()=>n.abort(),r);try{return await fetch(e,(0,Ae.A)((0,Ae.A)({},t),{},{signal:n.signal}))}finally{clearTimeout(o)}}function Ql(){var e;const t=Ma(),r=t.getIdToken,n=ql({queryKey:["subscription"],queryFn:async()=>{const e=await r();return e?await async function(e){const t=await fetch("".concat(IW,"/api/subscription"),{headers:{Authorization:e}});if(!t.ok)throw new Error("HTTP ".concat(t.status));return Gl(t)}(e):null},enabled:!0===t.isAuthenticated});return{subscription:null!==(e=n.data)&&void 0!==e?e:null,isLoading:n.isLoading,isError:n.isError,refetch:n.refetch,startCheckout:async()=>{const e=await r();if(!e)return;const t="".concat(window.location.origin,"/subscription/success"),n=window.location.href,o=await async function(e,t,r){const n=await fetch("".concat(IW,"/api/subscription/checkout"),{method:"POST",headers:{Authorization:e,"Content-Type":"application/json"},body:JSON.stringify({successUrl:t,cancelUrl:r})});if(!n.ok)throw new Error("HTTP ".concat(n.status));return n.json()}(e,t,n),i=o.checkoutUrl;window.location.href=i},openPortal:async()=>{const e=await r();if(!e)return;const t=window.location.href,n=await async function(e,t){const r=await fetch("".concat(IW,"/api/subscription/portal"),{method:"POST",headers:{Authorization:e,"Content-Type":"application/json"},body:JSON.stringify({returnUrl:t})});if(!r.ok){const e=await r.text()||"HTTP ".concat(r.status);throw new Error(e)}return r.json()}(e,t),o=n.portalUrl;window.location.href=o}}}function Yl(){const e=Ma(),t=e.isAuthenticated,r=e.login,n=Ql(),o=n.subscription,i=n.startCheckout,a=!0===t,s="pro"===(null===o||void 0===o?void 0:o.planTier),l=["Property board & kanban workspace","".concat(1," AI search per month")];return(0,tr.jsxs)(Tr,{component:"section",sx:{py:{xs:6,md:10},px:{xs:2,md:4},backgroundColor:"background.body"},children:[(0,tr.jsxs)(Mn,{spacing:1,alignItems:"center",sx:{mb:{xs:4,md:6},textAlign:"center"},children:[(0,tr.jsx)(Gn,{level:"h2",children:"Simple, honest pricing"}),(0,tr.jsx)(Gn,{level:"body-lg",textColor:"neutral.500",sx:{maxWidth:560},children:"Start free. Upgrade when you're ready to find your home faster."})]}),(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},spacing:3,justifyContent:"center",alignItems:{xs:"stretch",sm:"flex-start"},sx:{maxWidth:720,mx:"auto"},children:[(0,tr.jsxs)(hi,{variant:"outlined",sx:{maxWidth:300,p:3,width:"100%"},children:[(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",sx:{alignSelf:"flex-start"},children:"Free"}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"h1",children:"\xa30"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"neutral.500",children:"Forever"})]}),(0,tr.jsxs)(Ui,{size:"sm",sx:{"--ListItem-paddingY":"6px"},children:[l.map(e=>(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(aa,{sx:{color:"success.500"},children:(0,tr.jsx)(sa.A,{fontSize:"small"})}),e]},e)),["Scheduled monitoring","Email alerts","Enrichment data"].map(e=>(0,tr.jsxs)(ta,{sx:{color:"neutral.500"},children:[(0,tr.jsx)(aa,{sx:{color:"neutral.400"},children:(0,tr.jsx)(la.A,{fontSize:"small"})}),e]},e))]}),!a&&(0,tr.jsx)(wo,{fullWidth:!0,variant:"soft",color:"neutral",onClick:()=>r(),children:"Get started"}),a&&!s&&(0,tr.jsx)(wo,{fullWidth:!0,variant:"soft",color:"neutral",disabled:!0,children:"You're on Free"})]}),(0,tr.jsxs)(hi,{variant:"outlined",sx:{maxWidth:300,p:3,width:"100%",border:"2px solid",borderColor:"primary.500",position:"relative"},children:[(0,tr.jsx)(Ti,{size:"sm",variant:"solid",color:"primary",sx:{position:"absolute",top:-12,right:16},children:"Most popular"}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"baseline",spacing:.5,children:[(0,tr.jsxs)(Gn,{level:"h1",children:["\xa3",15]}),(0,tr.jsx)(Gn,{component:"span",level:"body-lg",textColor:"neutral.500",children:"/mo"})]}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"neutral.500",children:"Billed monthly"})]}),(0,tr.jsx)(Ui,{size:"sm",sx:{"--ListItem-paddingY":"6px"},children:["Everything in Free","Unlimited AI searches","Daily & weekly scheduled monitoring","Email alerts for new matches & price drops","Enrichment data \u2014 sold prices, flood risk, broadband & more","Collaborate with a partner"].map(e=>(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(aa,{sx:{color:"success.500"},children:(0,tr.jsx)(sa.A,{fontSize:"small"})}),e]},e))}),!a&&(0,tr.jsx)(wo,{fullWidth:!0,size:"lg",variant:"solid",color:"primary",onClick:()=>r(),children:"Start with Pro"}),a&&!s&&(0,tr.jsx)(wo,{fullWidth:!0,size:"lg",variant:"solid",color:"primary",onClick:()=>{i()},children:"Upgrade to Pro"}),a&&s&&(0,tr.jsx)(wo,{fullWidth:!0,size:"lg",variant:"soft",color:"primary",disabled:!0,children:"You're on Pro \u2713"})]})]}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"neutral.500",sx:{textAlign:"center",mt:4},children:"Cancel anytime. No lock-in."})]})}function Xl(e){return xr("MuiDivider",e)}const Zl=wr("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]),ec=["className","children","component","inset","orientation","role","slots","slotProps"],tc=Qr("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({"--Divider-thickness":"1px","--Divider-lineColor":t.vars.palette.divider},"none"===r.inset&&{"--_Divider-inset":"0px"},"context"===r.inset&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:"vertical"===r.orientation?"initial":"var(--_Divider-inset)",marginBlock:"vertical"===r.orientation?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},r.children?(0,je.A)({"--Divider-gap":t.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:"vertical"===r.orientation?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},t.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:"vertical"===r.orientation?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:"vertical"===r.orientation?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:"vertical"===r.orientation?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:"vertical"===r.orientation?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:"vertical"===r.orientation?"var(--Divider-thickness)":"initial",blockSize:"vertical"===r.orientation?"initial":"var(--Divider-thickness)"})}),rc=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyDivider"}),n=r.className,o=r.children,i=r.component,a=void 0===i?void 0!==o&&null!==o?"div":"hr":i,l=r.inset,c=r.orientation,d=void 0===c?"horizontal":c,u=r.role,h=void 0===u?"hr"!==a?"separator":void 0:u,p=r.slots,v=void 0===p?{}:p,f=r.slotProps,m=void 0===f?{}:f,g=(0,Ie.A)(r,ec),y=(0,je.A)({},r,{inset:l,role:h,orientation:d,component:a}),b=(e=>{const t=e.orientation,r=e.inset;return Dr({root:["root",t,r&&"inset".concat(Le(r))]},Xl,{})})(y),x=(0,je.A)({},g,{component:a,slots:v,slotProps:m}),w=pn("root",{ref:t,className:(0,Pe.A)(b.root,n),elementType:tc,externalForwardedProps:x,ownerState:y,additionalProps:(0,je.A)({as:a,role:h},"separator"===h&&"vertical"===d&&{"aria-orientation":"vertical"})}),S=(0,s.A)(w,2),k=S[0],_=S[1];return(0,tr.jsx)(k,(0,je.A)({},_,{children:o}))});rc.muiName="Divider";const nc=rc;function oc(e){return xr("MuiLink",e)}const ic=wr("MuiLink",["root","disabled","focusVisible","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","variantPlain","variantOutlined","variantSoft","variantSolid","underlineNone","underlineHover","underlineAlways","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","startDecorator","endDecorator"]),ac=["color","textColor","variant"],sc=["children","disabled","onBlur","onFocus","level","overlay","underline","endDecorator","startDecorator","component","slots","slotProps"],lc=Qr("span",{name:"JoyLink",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})(e=>{let t=e.ownerState;var r;return(0,je.A)({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Link-gap, 0.375em), 0.75rem)"},"string"!==typeof t.startDecorator&&("flex-start"===t.alignItems||"flex-start"===(null==(r=t.sx)?void 0:r.alignItems))&&{marginTop:"2px"})}),cc=Qr("span",{name:"JoyLink",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})(e=>{let t=e.ownerState;var r;return(0,je.A)({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Link-gap, 0.25em), 0.5rem)"},"string"!==typeof t.startDecorator&&("flex-start"===t.alignItems||"flex-start"===(null==(r=t.sx)?void 0:r.alignItems))&&{marginTop:"2px"})}),dc=Qr("a",{name:"JoyLink",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l,c;return[(0,je.A)({"--Icon-fontSize":"1.25em","--Icon-color":"currentColor","--CircularProgress-size":"1.25em","--CircularProgress-thickness":"3px"},r.level&&"inherit"!==r.level&&t.typography[r.level],"inherit"===r.level&&{font:"inherit"},"none"===r.underline&&{textDecoration:"none"},"hover"===r.underline&&{textDecoration:"none","&:hover":{"@media (hover: hover)":{textDecorationLine:"underline"}}},"always"===r.underline&&{textDecoration:"underline"},r.startDecorator&&{verticalAlign:"bottom"},{textDecorationThickness:"max(0.08em, 1px)",textUnderlineOffset:"0.15em",display:"inline-flex",alignItems:"center",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:t.vars.radius.xs,padding:0,cursor:"pointer",textDecorationColor:"var(--variant-outlinedBorder, rgba(".concat(null==(n=t.vars.palette[r.color])?void 0:n.mainChannel," / var(--Link-underlineOpacity, 0.72)))")},r.variant?(0,je.A)({paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!r.nesting&&{marginInline:"-0.25em"}):{color:"var(--variant-plainColor, rgba(".concat(null==(o=t.vars.palette[r.color])?void 0:o.mainChannel," / 1))"),["&.".concat(ic.disabled)]:{pointerEvents:"none",color:"var(--variant-plainDisabledColor, rgba(".concat(null==(i=t.vars.palette[r.color])?void 0:i.mainChannel," / 0.6))")}},{userSelect:"button"===r.component?"none":void 0,MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"}},r.overlay?{position:"initial","&::after":{content:'""',display:"block",position:"absolute",top:0,left:0,bottom:0,right:0,borderRadius:"var(--unstable_actionRadius, inherit)",margin:"var(--unstable_actionMargin)"},["".concat(t.focus.selector)]:{"&::after":t.focus.default}}:{position:"relative",[t.focus.selector]:t.focus.default}),r.variant&&(0,je.A)({},null==(a=t.variants[r.variant])?void 0:a[r.color],{"&:hover":{"@media (hover: hover)":null==(s=t.variants["".concat(r.variant,"Hover")])?void 0:s[r.color]},"&:active":null==(l=t.variants["".concat(r.variant,"Active")])?void 0:l[r.color],["&.".concat(ic.disabled)]:null==(c=t.variants["".concat(r.variant,"Disabled")])?void 0:c[r.color]})]}),uc=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyLink"}),n=r.color,i=void 0===n?"primary":n,a=r.textColor,l=r.variant,c=(0,Ie.A)(r,ac),d=o.useContext(Hn),u=o.useContext(Wn),h=Vt((0,je.A)({},c,{color:a})),p=h.children,v=h.disabled,f=void 0!==v&&v,m=h.onBlur,g=h.onFocus,y=h.level,b=void 0===y?"body-md":y,x=h.overlay,w=void 0!==x&&x,S=h.underline,k=void 0===S?"hover":S,_=h.endDecorator,C=h.startDecorator,A=h.component,j=h.slots,I=void 0===j?{}:j,P=h.slotProps,R=void 0===P?{}:P,T=(0,Ie.A)(h,sc),E=d||u?e.level||"inherit":b,z=so(),D=z.isFocusVisibleRef,M=z.onBlur,L=z.onFocus,O=z.ref,F=o.useState(!1),N=(0,s.A)(F,2),B=N[0],H=N[1],W=rn(t,O),V=(0,je.A)({},h,{color:i,disabled:f,focusVisible:B,underline:k,variant:l,level:E,overlay:w,nesting:d}),$=(e=>{const t=e.level,r=e.color,n=e.variant,o=e.underline,i=e.focusVisible,a=e.disabled;return Dr({root:["root",r&&"color".concat(Le(r)),a&&"disabled",i&&"focusVisible",t,o&&"underline".concat(Le(o)),n&&"variant".concat(Le(n))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},oc,{})})(V),U=(0,je.A)({},T,{component:A,slots:I,slotProps:R}),q=pn("root",{additionalProps:{onBlur:e=>{M(e),!1===D.current&&H(!1),m&&m(e)},onFocus:e=>{L(e),!0===D.current&&H(!0),g&&g(e)}},ref:W,className:$.root,elementType:dc,externalForwardedProps:U,ownerState:V}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=pn("startDecorator",{className:$.startDecorator,elementType:lc,externalForwardedProps:U,ownerState:V}),Y=(0,s.A)(Q,2),X=Y[0],Z=Y[1],ee=pn("endDecorator",{className:$.endDecorator,elementType:cc,externalForwardedProps:U,ownerState:V}),te=(0,s.A)(ee,2),re=te[0],ne=te[1];return(0,tr.jsx)(Hn.Provider,{value:!0,children:(0,tr.jsxs)(G,(0,je.A)({},J,{children:[C&&(0,tr.jsx)(X,(0,je.A)({},Z,{children:C})),Ln(p,["Skeleton"])?o.cloneElement(p,{variant:p.props.variant||"inline"}):p,_&&(0,tr.jsx)(re,(0,je.A)({},ne,{children:_}))]}))})}),hc=uc;var pc=r(7950),vc=r.t(pc,2);function fc(){return fc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=e[r];return t.concat(Array.isArray(n)?n.map(e=>[r,e]):[[r,n]])},[]))}new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const yc=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"];try{window.__reactRouterVersion="6"}catch(Mp){}new Map;const bc=i.startTransition;vc.flushSync,i.useId;function xc(e){let t=e.basename,r=e.children,n=e.future,i=e.window,a=o.useRef();var l;null==a.current&&(a.current=(void 0===(l={window:i,v5Compat:!0})&&(l={}),S(function(e,t){let r=e.location;return b("",{pathname:r.pathname,search:r.search,hash:r.hash},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:x(t)},null,l)));let c=a.current,d=o.useState({action:c.action,location:c.location}),u=(0,s.A)(d,2),h=u[0],p=u[1],v=(n||{}).v7_startTransition,f=o.useCallback(e=>{v&&bc?bc(()=>p(e)):p(e)},[p,v]);return o.useLayoutEffect(()=>c.listen(f),[c,f]),o.useEffect(()=>xe(n),[n]),o.createElement(ke,{basename:t,children:r,location:h.location,navigationType:h.action,navigator:c,future:n})}const wc="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,Sc=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kc=o.forwardRef(function(e,t){let r,n=e.onClick,i=e.relative,a=e.reloadDocument,s=e.replace,l=e.state,c=e.target,d=e.to,u=e.preventScrollReset,h=e.viewTransition,p=mc(e,yc),v=o.useContext(X).basename,f=!1;if("string"===typeof d&&Sc.test(d)&&(r=d,wc))try{let e=new URL(window.location.href),t=d.startsWith("//")?new URL(e.protocol+d):new URL(d),r=z(t.pathname,v);t.origin===e.origin&&null!=r?d=r+t.search+t.hash:f=!0}catch(Mp){}let g=function(e,t){let r=(void 0===t?{}:t).relative;re()||m(!1);let n=o.useContext(X),i=n.basename,a=n.navigator,s=se(e,{relative:r}),l=s.hash,c=s.pathname,d=s.search,u=c;return"/"!==i&&(u="/"===c?i:W([i,c])),a.createHref({pathname:u,search:d,hash:l})}(d,{relative:i}),y=function(e,t){let r=void 0===t?{}:t,n=r.target,i=r.replace,a=r.state,s=r.preventScrollReset,l=r.relative,c=r.viewTransition,d=ie(),u=ne(),h=se(e,{relative:l});return o.useCallback(t=>{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(t,n)){t.preventDefault();let r=void 0!==i?i:x(u)===x(h);d(e,{replace:r,state:a,preventScrollReset:s,relative:l,viewTransition:c})}},[u,d,h,i,a,n,e,s,l,c])}(d,{replace:s,state:l,target:c,preventScrollReset:u,relative:i,viewTransition:h});return o.createElement("a",fc({},p,{href:r||g,onClick:f||a?n:function(e){n&&n(e),e.defaultPrevented||y(e)},ref:t,target:c}))});var _c,Cc;function Ac(e){let t=o.useRef(gc(e)),r=o.useRef(!1),n=ne(),i=o.useMemo(()=>function(e,t){let r=gc(e);return t&&t.forEach((e,n)=>{r.has(n)||t.getAll(n).forEach(e=>{r.append(n,e)})}),r}(n.search,r.current?null:t.current),[n.search]),a=ie(),s=o.useCallback((e,t)=>{const n=gc("function"===typeof e?e(i):e);r.current=!0,a("?"+n,t)},[a,i]);return[i,s]}(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(_c||(_c={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(Cc||(Cc={}));function jc(){const e=(new Date).getFullYear();return(0,tr.jsx)(Tr,{component:"footer",sx:{py:{xs:4,md:5},px:{xs:2,md:4},backgroundColor:"background.level1",borderTop:"1px solid",borderColor:"divider"},children:(0,tr.jsxs)(Do,{maxWidth:"lg",children:[(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:2,children:[(0,tr.jsxs)(Mn,{spacing:.5,children:[(0,tr.jsx)(Gn,{level:"title-md",children:"Toppi"}),(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"neutral.500",children:["\xa9 ",e," Toppi. All rights reserved."]})]}),(0,tr.jsxs)(Mn,{direction:"row",spacing:{xs:2,sm:3},flexWrap:"wrap",useFlexGap:!0,alignItems:"center",children:[(0,tr.jsx)(hc,{component:kc,to:"/terms",level:"body-sm",underline:"hover",textColor:"neutral.700",children:"Terms of Service"}),(0,tr.jsx)(hc,{component:kc,to:"/privacy",level:"body-sm",underline:"hover",textColor:"neutral.700",children:"Privacy Policy"}),(0,tr.jsx)(hc,{component:kc,to:"/cookies",level:"body-sm",underline:"hover",textColor:"neutral.700",children:"Cookie Policy"}),(0,tr.jsx)(hc,{href:"mailto:hello@toppi.app",level:"body-sm",underline:"hover",textColor:"neutral.700",children:"Contact"})]})]}),(0,tr.jsx)(nc,{sx:{my:3}}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"neutral.500",sx:{textAlign:{xs:"left",sm:"center"}},children:"Toppi is a UK-based property search assistant. Listing data is sourced from public portals; pricing and availability are not guaranteed and may change without notice."})]})})}var Ic=r(45),Pc=r(4467),Rc=r(7844),Tc=r.n(Rc),Ec=r.cjs(function(e,t){e.exports=function(e,t,r,n,o,i,a,s){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[r,n,o,i,a,s],d=0;(l=new Error(t.replace(/%s/g,function(){return c[d++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}}),zc=r.n(Ec),Dc=r(7324),Mc=r.n(Dc);const Lc=["children"],Oc=["children"];var Fc,Nc,Bc=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Bc||{}),Hc={rel:["amphtml","canonical","alternate"]},Wc={type:["application/ld+json"]},Vc={charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]},$c=Object.values(Bc),Uc={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},qc=Object.entries(Uc).reduce((e,t)=>{let r=(0,s.A)(t,2),n=r[0];return e[r[1]]=n,e},{}),Kc="data-rh",Gc="defaultTitle",Jc="defer",Qc="encodeSpecialCharacters",Yc="onChangeClientState",Xc="titleTemplate",Zc="prioritizeSeoTags",ed=(e,t)=>{for(let r=e.length-1;r>=0;r-=1){const n=e[r];if(Object.prototype.hasOwnProperty.call(n,t))return n[t]}return null},td=e=>{let t=ed(e,"title");const r=ed(e,Xc);if(Array.isArray(t)&&(t=t.join("")),r&&t)return r.replace(/%s/g,()=>t);const n=ed(e,Gc);return t||n||void 0},rd=e=>ed(e,Yc)||(()=>{}),nd=(e,t)=>t.filter(t=>"undefined"!==typeof t[e]).map(t=>t[e]).reduce((e,t)=>(0,Ae.A)((0,Ae.A)({},e),t),{}),od=(e,t)=>t.filter(e=>"undefined"!==typeof e.base).map(e=>e.base).reverse().reduce((t,r)=>{if(!t.length){const n=Object.keys(r);for(let o=0;o{const n={};return r.filter(t=>{return!!Array.isArray(t[e])||("undefined"!==typeof t[e]&&(r="Helmet: ".concat(e,' should be of type "Array". Instead found type "').concat(typeof t[e],'"'),console&&"function"===typeof console.warn&&console.warn(r)),!1);var r}).map(t=>t[e]).reverse().reduce((e,r)=>{const o={};r.filter(e=>{let r;const i=Object.keys(e);for(let n=0;ne.push(t));const i=Object.keys(o);for(let t=0;t{if(Array.isArray(e)&&e.length)for(let r=0;rArray.isArray(e)?e.join(""):e,ld=(e,t)=>Array.isArray(e)?e.reduce((e,r)=>(((e,t)=>{const r=Object.keys(e);for(let n=0;n(0,Ae.A)((0,Ae.A)({},e),{},{[t]:void 0}),dd=["noscript","script","style"],ud=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},hd=e=>Object.keys(e).reduce((t,r)=>{const n="undefined"!==typeof e[r]?"".concat(r,'="').concat(e[r],'"'):"".concat(r);return t?"".concat(t," ").concat(n):n},""),pd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((t,r)=>(t[Uc[r]||r]=e[r],t),t)},vd=(e,t)=>t.map((t,r)=>{const n={key:r,[Kc]:!0};return Object.keys(t).forEach(e=>{const r=Uc[e]||e;if("innerHTML"===r||"cssText"===r){const e=t.innerHTML||t.cssText;n.dangerouslySetInnerHTML={__html:e}}else n[r]=t[e]}),o.createElement(e,n)}),fd=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(e){case"title":return{toComponent:()=>((e,t,r)=>{const n=pd(r,{key:t,[Kc]:!0});return[o.createElement("title",n,t)]})(0,t.title,t.titleAttributes),toString:()=>((e,t,r,n)=>{const o=hd(r),i=sd(t);return o?"<".concat(e," ").concat(Kc,'="true" ').concat(o,">").concat(ud(i,n),""):"<".concat(e," ").concat(Kc,'="true">').concat(ud(i,n),"")})(e,t.title,t.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>pd(t),toString:()=>hd(t)};default:return{toComponent:()=>vd(e,t),toString:()=>function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t.reduce((t,n)=>{const o=n,i=Object.keys(o).filter(e=>!("innerHTML"===e||"cssText"===e)).reduce((e,t)=>{const n="undefined"===typeof o[t]?t:"".concat(t,'="').concat(ud(o[t],r),'"');return e?"".concat(e," ").concat(n):n},""),a=o.innerHTML||o.cssText||"",s=-1===dd.indexOf(e);return"".concat(t,"<").concat(e," ").concat(Kc,'="true" ').concat(i).concat(s?"/>":">".concat(a,""))},"")}(e,t,r)}}},md=e=>{const t=e.baseTag,r=e.bodyAttributes,n=e.encode,o=void 0===n||n,i=e.htmlAttributes,a=e.noscriptTags,s=e.styleTags,l=e.title,c=void 0===l?"":l,d=e.titleAttributes,u=e.prioritizeSeoTags;let h=e.linkTags,p=e.metaTags,v=e.scriptTags,f={toComponent:()=>{},toString:()=>""};if(u){var m=(e=>{let t=e.metaTags,r=e.linkTags,n=e.scriptTags,o=e.encode;const i=ld(t,Vc),a=ld(r,Hc),s=ld(n,Wc);return{priorityMethods:{toComponent:()=>[...vd("meta",i.priority),...vd("link",a.priority),...vd("script",s.priority)],toString:()=>"".concat(fd("meta",i.priority,o)," ").concat(fd("link",a.priority,o)," ").concat(fd("script",s.priority,o))},metaTags:i.default,linkTags:a.default,scriptTags:s.default}})(e);f=m.priorityMethods,h=m.linkTags,p=m.metaTags,v=m.scriptTags}return{priority:f,base:fd("base",t,o),bodyAttributes:fd("bodyAttributes",r,o),htmlAttributes:fd("htmlAttributes",i,o),link:fd("link",h,o),meta:fd("meta",p,o),noscript:fd("noscript",a,o),script:fd("script",v,o),style:fd("style",s,o),title:fd("title",{title:c,titleAttributes:d},o)}},gd=[],yd=!("undefined"===typeof window||!window.document||!window.document.createElement),bd=class{constructor(e,t){(0,Pc.A)(this,"instances",[]),(0,Pc.A)(this,"canUseDOM",yd),(0,Pc.A)(this,"context",void 0),(0,Pc.A)(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?gd:this.instances,add:e=>{(this.canUseDOM?gd:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?gd:this.instances).indexOf(e);(this.canUseDOM?gd:this.instances).splice(t,1)}}}),this.context=e,this.canUseDOM=t||!1,t||(e.helmet=md({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},xd=o.createContext({}),wd=(Fc=class e extends o.Component{constructor(t){super(t),(0,Pc.A)(this,"helmetData",void 0),this.helmetData=new bd(this.props.context||{},e.canUseDOM)}render(){return o.createElement(xd.Provider,{value:this.helmetData.value},this.props.children)}},(0,Pc.A)(Fc,"canUseDOM",yd),Fc),Sd=(e,t)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll("".concat(e,"[").concat(Kc,"]")),o=[].slice.call(n),i=[];let a;return t&&t.length&&t.forEach(t=>{const r=document.createElement(e);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))if("innerHTML"===e)r.innerHTML=t.innerHTML;else if("cssText"===e)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{const n=e,o="undefined"===typeof t[n]?"":t[n];r.setAttribute(e,o)}r.setAttribute(Kc,"true"),o.some((e,t)=>(a=t,r.isEqualNode(e)))?o.splice(a,1):i.push(r)}),o.forEach(e=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)}),i.forEach(e=>r.appendChild(e)),{oldTags:o,newTags:i}},kd=(e,t)=>{const r=document.getElementsByTagName(e)[0];if(!r)return;const n=r.getAttribute(Kc),o=n?n.split(","):[],i=[...o],a=Object.keys(t);for(const s of a){const e=t[s]||"";r.getAttribute(s)!==e&&r.setAttribute(s,e),-1===o.indexOf(s)&&o.push(s);const n=i.indexOf(s);-1!==n&&i.splice(n,1)}for(let s=i.length-1;s>=0;s-=1)r.removeAttribute(i[s]);o.length===i.length?r.removeAttribute(Kc):r.getAttribute(Kc)!==a.join(",")&&r.setAttribute(Kc,a.join(","))},_d=(e,t)=>{const r=e.baseTag,n=e.bodyAttributes,o=e.htmlAttributes,i=e.linkTags,a=e.metaTags,s=e.noscriptTags,l=e.onChangeClientState,c=e.scriptTags,d=e.styleTags,u=e.title,h=e.titleAttributes;kd("body",n),kd("html",o),((e,t)=>{"undefined"!==typeof e&&document.title!==e&&(document.title=sd(e)),kd("title",t)})(u,h);const p={baseTag:Sd("base",r),linkTags:Sd("link",i),metaTags:Sd("meta",a),noscriptTags:Sd("noscript",s),scriptTags:Sd("script",c),styleTags:Sd("style",d)},v={},f={};Object.keys(p).forEach(e=>{const t=p[e],r=t.newTags,n=t.oldTags;r.length&&(v[e]=r),n.length&&(f[e]=p[e].oldTags)}),t&&t(),l(e,v,f)},Cd=null,Ad=e=>{Cd&&cancelAnimationFrame(Cd),e.defer?Cd=requestAnimationFrame(()=>{_d(e,()=>{Cd=null})}):(_d(e),Cd=null)},jd=class extends o.Component{constructor(){super(...arguments),(0,Pc.A)(this,"rendered",!1)}shouldComponentUpdate(e){return!Mc()(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){this.props.context.helmetInstances.remove(this),this.emitChange()}emitChange(){const e=this.props.context,t=e.helmetInstances,r=e.setHelmet;let n=null;const o=(i=t.get().map(e=>{const t=(0,Ae.A)({},e.props);return delete t.context,t}),{baseTag:od(["href"],i),bodyAttributes:nd("bodyAttributes",i),defer:ed(i,Jc),encode:ed(i,Qc),htmlAttributes:nd("htmlAttributes",i),linkTags:id("link",["rel","href"],i),metaTags:id("meta",["name","charset","http-equiv","property","itemprop"],i),noscriptTags:id("noscript",["innerHTML"],i),onChangeClientState:rd(i),scriptTags:id("script",["src","innerHTML"],i),styleTags:id("style",["cssText"],i),title:td(i),titleAttributes:nd("titleAttributes",i),prioritizeSeoTags:ad(i,Zc)});var i;wd.canUseDOM?Ad(o):md&&(n=md(o)),r(n)}init(){if(this.rendered)return;this.rendered=!0;this.props.context.helmetInstances.add(this),this.emitChange()}render(){return this.init(),null}},Id=(Nc=class extends o.Component{shouldComponentUpdate(e){return!Tc()(cd(this.props,"helmetData"),cd(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error("<".concat(e.type," /> elements are self-closing and can not contain children. Refer to our API for more information."))}}flattenArrayTypeChildren(e,t,r,n){return(0,Ae.A)((0,Ae.A)({},t),{},{[e.type]:[...t[e.type]||[],(0,Ae.A)((0,Ae.A)({},r),this.mapNestedChildrenToProps(e,n))]})}mapObjectTypeChildren(e,t,r,n){switch(e.type){case"title":return(0,Ae.A)((0,Ae.A)({},t),{},{[e.type]:n,titleAttributes:(0,Ae.A)({},r)});case"body":return(0,Ae.A)((0,Ae.A)({},t),{},{bodyAttributes:(0,Ae.A)({},r)});case"html":return(0,Ae.A)((0,Ae.A)({},t),{},{htmlAttributes:(0,Ae.A)({},r)});default:return(0,Ae.A)((0,Ae.A)({},t),{},{[e.type]:(0,Ae.A)({},r)})}}mapArrayTypeChildrenToProps(e,t){let r=(0,Ae.A)({},t);return Object.keys(e).forEach(t=>{r=(0,Ae.A)((0,Ae.A)({},r),{},{[t]:e[t]})}),r}warnOnInvalidChildren(e,t){return zc()($c.some(t=>e.type===t),"function"===typeof e.type?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":"Only elements types ".concat($c.join(", ")," are allowed. Helmet does not support rendering <").concat(e.type,"> elements. Refer to our API for more information.")),zc()(!t||"string"===typeof t||Array.isArray(t)&&!t.some(e=>"string"!==typeof e),"Helmet expects a string as a child of <".concat(e.type,">. Did you forget to wrap your children in braces? ( <").concat(e.type,">{``} ) Refer to our API for more information.")),!0}mapChildrenToProps(e,t){let r={};return o.Children.forEach(e,e=>{if(!e||!e.props)return;const n=e.props,o=n.children,i=(0,Ic.A)(n,Lc),a=Object.keys(i).reduce((e,t)=>(e[qc[t]||t]=i[t],e),{});let s=e.type;switch("symbol"===typeof s?s=s.toString():this.warnOnInvalidChildren(e,o),s){case"Symbol(react.fragment)":t=this.mapChildrenToProps(o,t);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(e,r,a,o);break;default:t=this.mapObjectTypeChildren(e,t,a,o)}}),this.mapArrayTypeChildrenToProps(r,t)}render(){const e=this.props,t=e.children,r=(0,Ic.A)(e,Oc);let n=(0,Ae.A)({},r),i=r.helmetData;if(t&&(n=this.mapChildrenToProps(t,n)),i&&!(i instanceof bd)){i=new bd(i.context,!0),delete n.helmetData}return i?o.createElement(jd,(0,Ae.A)((0,Ae.A)({},n),{},{context:i.value})):o.createElement(xd.Consumer,null,e=>o.createElement(jd,(0,Ae.A)((0,Ae.A)({},n),{},{context:e})))}},(0,Pc.A)(Nc,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Nc);const Pd="https://www.toppi.app",Rd="".concat(Pd,"/og-image.png");function Td(e){let t=e.title,r=e.description,n=e.ogImage,o=e.canonicalPath,i=e.noIndex;const a=null!==n&&void 0!==n?n:Rd,s=o?"".concat(Pd).concat(o):void 0;return(0,tr.jsxs)(Id,{children:[(0,tr.jsx)("title",{children:t}),r&&(0,tr.jsx)("meta",{name:"description",content:r}),s&&(0,tr.jsx)("link",{rel:"canonical",href:s}),(0,tr.jsx)("meta",{property:"og:site_name",content:"Toppi"}),(0,tr.jsx)("meta",{property:"og:title",content:t}),r&&(0,tr.jsx)("meta",{property:"og:description",content:r}),(0,tr.jsx)("meta",{property:"og:image",content:a}),(0,tr.jsx)("meta",{property:"og:type",content:"website"}),s&&(0,tr.jsx)("meta",{property:"og:url",content:s}),(0,tr.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,tr.jsx)("meta",{name:"twitter:title",content:t}),r&&(0,tr.jsx)("meta",{name:"twitter:description",content:r}),(0,tr.jsx)("meta",{name:"twitter:image",content:a}),i&&(0,tr.jsx)("meta",{name:"robots",content:"noindex,nofollow"})]})}const Ed=o.createContext(null);function zd(e,t){return e===t}const Dd={},Md=()=>{};function Ld(e,t){const r=(0,je.A)({},e);return Object.keys(t).forEach(e=>{void 0!==t[e]&&(r[e]=t[e])}),r}function Od(e){const t=o.useRef(null),r=e.reducer,n=e.initialState,i=e.controlledProps,a=void 0===i?Dd:i,l=e.stateComparers,c=void 0===l?Dd:l,d=e.onStateChange,u=void 0===d?Md:d,h=e.actionContext;e.componentName,o.useRef(a);const p=o.useCallback((e,n)=>{t.current=n;const o=Ld(e,a);return r(o,n)},[a,r]),v=o.useReducer(p,n),f=(0,s.A)(v,2),m=f[0],g=f[1],y=o.useCallback(e=>{g((0,je.A)({},e,{context:h}))},[h]);return function(e){const t=e.nextState,r=e.initialState,n=e.stateComparers,i=e.onStateChange,a=e.controlledProps,s=e.lastActionRef,l=o.useRef(r);o.useEffect(()=>{if(null===s.current)return;const e=Ld(l.current,a);Object.keys(t).forEach(r=>{var o;const a=null!=(o=n[r])?o:zd,l=t[r],c=e[r];var d,u;(null==c&&null!=l||null!=c&&null==l||null!=c&&null!=l&&!a(l,c))&&(null==i||i(null!=(d=s.current.event)?d:null,r,l,null!=(u=s.current.type)?u:"",t))}),l.current=t,s.current=null},[l,t,s,i,n,a])}({nextState:m,initialState:n,stateComparers:null!=c?c:Dd,onStateChange:null!=u?u:Md,controlledProps:a,lastActionRef:t}),[Ld(m,a),y]}const Fd="dropdown:blur",Nd="dropdown:escapeKeyDown",Bd="dropdown:toggle",Hd="dropdown:open",Wd="dropdown:close";function Vd(e,t){switch(t.type){case Fd:case Nd:return{open:!1,changeReason:t.event};case Bd:return{open:!e.open,changeReason:t.event};case Hd:return{open:!0,changeReason:t.event};case Wd:return{open:!1,changeReason:t.event};default:throw new Error("Unhandled action")}}function $d(e){const t=e.children,r=e.open,n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.defaultOpen,r=e.onOpenChange,n=e.open,i=e.componentName,a=void 0===i?"useDropdown":i,l=o.useState(""),c=(0,s.A)(l,2),d=c[0],u=c[1],h=o.useState(null),p=(0,s.A)(h,2),v=p[0],f=p[1],m=o.useRef(null),g=o.useCallback((e,t,n,o)=>{"open"===t&&(null==r||r(e,n)),m.current=o},[r]),y=Od({controlledProps:o.useMemo(()=>void 0!==n?{open:n}:{},[n]),initialState:t?{open:!0,changeReason:null}:{open:!1,changeReason:null},onStateChange:g,reducer:Vd,componentName:a}),b=(0,s.A)(y,2),x=b[0],w=b[1];return o.useEffect(()=>{x.open||null===m.current||m.current===Fd||null==v||v.focus()},[x.open,v]),{contextValue:{state:x,dispatch:w,popupId:d,registerPopup:u,registerTrigger:f,triggerElement:v},open:x.open}}({defaultOpen:e.defaultOpen,onOpenChange:e.onOpenChange,open:r}),i=n.contextValue;return(0,tr.jsx)(Ed.Provider,{value:i,children:t})}function Ud(e,t){return function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=(0,je.A)({},r,e(r));return(0,je.A)({},n,t(n))}}function qd(e){return xr("MuiMenuButton",e)}wr("MuiMenuButton",["root","colorPrimary","colorNeutral","colorDanger","colorInfo","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]);const Kd=["children","color","component","disabled","endDecorator","loading","loadingPosition","loadingIndicator","size","slotProps","slots","startDecorator","variant"],Gd=Qr("button",{name:"JoyMenuButton",slot:"Root",overridesResolver:(e,t)=>t.root})(yo),Jd=Qr("span",{name:"JoyMenuButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),Qd=Qr("span",{name:"JoyMenuButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),Yd=Qr("span",{name:"JoyMenuButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(e=>{let t=e.theme,r=e.ownerState;var n,o;return(0,je.A)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(n=t.variants[r.variant])||null==(n=n[r.color])?void 0:n.color},r.disabled&&{color:null==(o=t.variants["".concat(r.variant,"Disabled")])||null==(o=o[r.color])?void 0:o.color})}),Xd=o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyMenuButton"}),i=n.children,a=n.color,l=void 0===a?"neutral":a,c=n.component,d=n.disabled,u=void 0!==d&&d,h=n.endDecorator,p=n.loading,v=void 0!==p&&p,f=n.loadingPosition,m=void 0===f?"center":f,g=n.loadingIndicator,y=n.size,b=void 0===y?"md":y,x=n.slotProps,w=void 0===x?{}:x,S=n.slots,k=void 0===S?{}:S,_=n.startDecorator,C=n.variant,A=void 0===C?"outlined":C,j=(0,Ie.A)(n,Kd),I=o.useContext(ho),P=e.variant||I.variant||A,R=e.size||I.size||b,T=null!=(r=e.disabled)?r:I.disabled||u||v,E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.disabled,r=void 0!==t&&t,n=e.focusableWhenDisabled,i=e.rootRef,a=o.useContext(Ed);if(null===a)throw new Error("useMenuButton: no menu context available.");const s=a.state,l=a.dispatch,c=a.registerTrigger,d=a.popupId,u=lo({disabled:r,focusableWhenDisabled:n,rootRef:i}),h=u.getRootProps,p=u.rootRef,v=u.active,f=rn(p,c),m=e=>t=>{var r;null==(r=e.onClick)||r.call(e,t),t.defaultMuiPrevented||l({type:Bd,event:t})},g=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),t.defaultMuiPrevented||"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),l({type:Hd,event:t}))},y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{onClick:m(e),onKeyDown:g(e)}};return{active:v,getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(y,h);return(0,je.A)({"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":d},e,t,r(t),{tabIndex:0,ref:f})},open:s.open,rootRef:f}}({rootRef:t,disabled:T}),z=E.getRootProps,D=E.open,M=E.active,L=null!=g?g:(0,tr.jsx)(An,{color:l,thickness:{sm:2,md:3,lg:4}[R]||3}),O=(0,je.A)({},n,{active:M,color:l,disabled:T,open:D,size:R,variant:P}),F=(e=>{const t=e.color,r=e.disabled,n=e.fullWidth,o=e.size,i=e.variant,a=e.loading;return Dr({root:["root",r&&"disabled",n&&"fullWidth",i&&"variant".concat(Le(i)),t&&"color".concat(Le(t)),o&&"size".concat(Le(o)),a&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},qd,{})})(O),N=(0,je.A)({},j,{component:c,slots:k,slotProps:w}),B=pn("root",{elementType:Gd,getSlotProps:z,externalForwardedProps:N,ref:t,ownerState:O,className:F.root}),H=(0,s.A)(B,2),W=H[0],V=H[1],$=pn("startDecorator",{className:F.startDecorator,elementType:Jd,externalForwardedProps:N,ownerState:O}),U=(0,s.A)($,2),q=U[0],K=U[1],G=pn("endDecorator",{className:F.endDecorator,elementType:Qd,externalForwardedProps:N,ownerState:O}),J=(0,s.A)(G,2),Q=J[0],Y=J[1],X=pn("loadingIndicatorCenter",{className:F.loadingIndicatorCenter,elementType:Yd,externalForwardedProps:N,ownerState:O}),Z=(0,s.A)(X,2),ee=Z[0],te=Z[1];return(0,tr.jsxs)(W,(0,je.A)({},V,{children:[(_||v&&"start"===m)&&(0,tr.jsx)(q,(0,je.A)({},K,{children:v&&"start"===m?L:_})),i,v&&"center"===m&&(0,tr.jsx)(ee,(0,je.A)({},te,{children:L})),(h||v&&"end"===m)&&(0,tr.jsx)(Q,(0,je.A)({},Y,{children:v&&"end"===m?L:h}))]}))}),Zd=Xd,eu="undefined"!==typeof window?o.useLayoutEffect:o.useEffect,tu="list:blur",ru="list:itemClick",nu="list:itemHover",ou="list:itemsChange",iu="list:keyDown",au="list:resetHighlight",su="list:highlightLast",lu="list:textNavigation",cu="list:clearSelection";function du(e,t,r){var n;const o=r.items,i=r.isItemDisabled,a=r.disableListWrap,s=r.disabledItemsFocusable,l=r.itemComparer,c="DOM"===r.focusManagement?0:-1,d=o.length-1,u=null==e?-1:o.findIndex(t=>l(t,e));let h,p,v=!a;switch(t){case"reset":if(-1===c)return null;h=0,p="next",v=!1;break;case"start":h=0,p="next",v=!1;break;case"end":h=d,p="previous",v=!1;break;default:{const e=u+t;e<0?!v&&-1!==u||Math.abs(t)>1?(h=0,p="next"):(h=d,p="previous"):e>d?!v||Math.abs(t)>1?(h=d,p="previous"):(h=0,p="next"):(h=e,p=t>=0?"next":"previous")}}const f=function(e,t,r,n,o,i){if(0===r.length||!n&&r.every((e,t)=>o(e,t)))return-1;let a=e;for(;;){if(!i&&"next"===t&&a===r.length||!i&&"previous"===t&&-1===a)return-1;if(n||!o(r[a],a))return a;a+="next"===t?1:-1,i&&(a=(a+r.length)%r.length)}}(h,p,o,s,i,v);return-1!==f||null===e||i(e,u)?null!=(n=o[f])?n:null:e}function uu(e,t,r){const n=r.itemComparer,o=r.isItemDisabled,i=r.selectionMode,a=r.items,s=t.selectedValues,l=a.findIndex(t=>n(e,t));if(o(e,l))return t;const c=function(e,t,r,n){return"none"===r?[]:"single"===r?n(t[0],e)?t:[e]:t.some(t=>n(t,e))?t.filter(t=>!n(t,e)):[...t,e]}(e,s,i,n);return(0,je.A)({},t,{selectedValues:c,highlightedValue:e})}function hu(e,t,r){var n;const o=null==(n=r(e))?void 0:n.trim().toLowerCase();return!(!o||0===o.length)&&0===o.indexOf(t)}function pu(e,t){const r=t.type,n=t.context;switch(r){case iu:return function(e,t,r){const n=t.highlightedValue,o=r.orientation,i=r.pageSize;switch(e){case"Home":return(0,je.A)({},t,{highlightedValue:du(n,"start",r)});case"End":return(0,je.A)({},t,{highlightedValue:du(n,"end",r)});case"PageUp":return(0,je.A)({},t,{highlightedValue:du(n,-i,r)});case"PageDown":return(0,je.A)({},t,{highlightedValue:du(n,i,r)});case"ArrowUp":if("vertical"!==o)break;return(0,je.A)({},t,{highlightedValue:du(n,-1,r)});case"ArrowDown":if("vertical"!==o)break;return(0,je.A)({},t,{highlightedValue:du(n,1,r)});case"ArrowLeft":{if("vertical"===o)break;const e="horizontal-ltr"===o?-1:1;return(0,je.A)({},t,{highlightedValue:du(n,e,r)})}case"ArrowRight":{if("vertical"===o)break;const e="horizontal-ltr"===o?1:-1;return(0,je.A)({},t,{highlightedValue:du(n,e,r)})}case"Enter":case" ":return null===t.highlightedValue?t:uu(t.highlightedValue,t,r)}return t}(t.key,e,n);case ru:return uu(t.item,e,n);case tu:return function(e,t){return"DOM"===t.focusManagement?e:(0,je.A)({},e,{highlightedValue:null})}(e,n);case lu:return function(e,t,r){const n=r.items,o=r.isItemDisabled,i=r.disabledItemsFocusable,a=r.getItemAsString,s=t.length>1;let l=s?e.highlightedValue:du(e.highlightedValue,1,r);for(let c=0;ci(e,r.highlightedValue)))?l:null:"DOM"===a&&0===t.length&&(s=du(null,"reset",n));const c=(null!=(o=r.selectedValues)?o:[]).filter(t=>e.some(e=>i(e,t)));return(0,je.A)({},r,{highlightedValue:s,selectedValues:c})}(t.items,t.previousItems,e,n);case au:return function(e,t){return(0,je.A)({},e,{highlightedValue:du(null,"reset",t)})}(e,n);case su:return function(e,t){return(0,je.A)({},e,{highlightedValue:du(null,"end",t)})}(e,n);case cu:return function(e,t){return(0,je.A)({},e,{selectedValues:[],highlightedValue:du(null,"reset",t)})}(e,n);default:return e}}function vu(e,t){if(t.type===nu)return(0,je.A)({},e,{highlightedValue:t.item});const r=pu(e,t);if(null===r.highlightedValue&&t.context.items.length>0)return(0,je.A)({},r,{highlightedValue:t.context.items[0]});if(t.type===iu&&"Escape"===t.event.key)return(0,je.A)({},r,{open:!1});var n;if(t.type===tu&&(null==(n=t.context.listboxRef.current)||!n.contains(t.event.relatedTarget))){var o,i;const e=null==(o=t.context.listboxRef.current)?void 0:o.getAttribute("id"),n=null==(i=t.event.relatedTarget)?void 0:i.getAttribute("aria-controls");return e&&n&&e===n?r:(0,je.A)({},r,{open:!1,highlightedValue:t.context.items[0]})}return r}function fu(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;return e.length===t.length&&e.every((e,n)=>r(e,t[n]))}const mu={},gu=()=>{},yu=(e,t)=>e===t,bu=()=>!1,xu=e=>"string"===typeof e?e:String(e),wu=()=>({highlightedValue:null,selectedValues:[]});function Su(e){const t=e.controlledProps,r=void 0===t?mu:t,n=e.disabledItemsFocusable,i=void 0!==n&&n,a=e.disableListWrap,l=void 0!==a&&a,c=e.focusManagement,d=void 0===c?"activeDescendant":c,u=e.getInitialState,h=void 0===u?wu:u,p=e.getItemDomElement,v=e.getItemId,f=e.isItemDisabled,m=void 0===f?bu:f,g=e.rootRef,y=e.onStateChange,b=void 0===y?gu:y,x=e.items,w=e.itemComparer,S=void 0===w?yu:w,k=e.getItemAsString,_=void 0===k?xu:k,C=e.onChange,A=e.onHighlightChange,j=e.onItemsChange,I=e.orientation,P=void 0===I?"vertical":I,R=e.pageSize,T=void 0===R?5:R,E=e.reducerActionContext,z=void 0===E?mu:E,D=e.selectionMode,M=void 0===D?"single":D,L=e.stateReducer,O=e.componentName,F=void 0===O?"useList":O;const N=o.useRef(null),B=rn(g,N),H=o.useCallback((e,t,r)=>{var n;(null==A||A(e,t,r),"DOM"!==d||null==t||r!==ru&&r!==iu&&r!==lu)||(null==p||null==(n=p(t))||n.focus())},[p,A,d]),W=o.useMemo(()=>({highlightedValue:S,selectedValues:(e,t)=>fu(e,t,S)}),[S]),V=o.useCallback((e,t,r,n,o)=>{switch(null==b||b(e,t,r,n,o),t){case"highlightedValue":H(e,r,n);break;case"selectedValues":null==C||C(e,r,n)}},[H,C,b]),$=o.useMemo(()=>({disabledItemsFocusable:i,disableListWrap:l,focusManagement:d,isItemDisabled:m,itemComparer:S,items:x,getItemAsString:_,onHighlightChange:H,orientation:P,pageSize:T,selectionMode:M,stateComparers:W}),[i,l,d,m,S,x,_,H,P,T,M,W]),U=h(),q=Od({reducer:null!=L?L:pu,actionContext:o.useMemo(()=>(0,je.A)({},z,$),[z,$]),initialState:U,controlledProps:r,stateComparers:W,onStateChange:V,componentName:F}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=G.highlightedValue,Y=G.selectedValues,X=function(e){const t=o.useRef({searchString:"",lastTime:null});return o.useCallback(r=>{if(1===r.key.length&&" "!==r.key){const n=t.current,o=r.key.toLowerCase(),i=performance.now();n.searchString.length>0&&n.lastTime&&i-n.lastTime>500?n.searchString=o:1===n.searchString.length&&o===n.searchString||(n.searchString+=o),n.lastTime=i,e(n.searchString,r)}},[e])}((e,t)=>J({type:lu,event:t,searchString:e})),Z=o.useRef([]);o.useEffect(()=>{fu(Z.current,x,S)||(J({type:ou,event:null,items:x,previousItems:Z.current}),Z.current=x,null==j||j(x))},[x,S,J,j]);const ee=e=>t=>{var r;if(null==(r=e.onKeyDown)||r.call(e,t),t.defaultMuiPrevented)return;const n=["Home","End","PageUp","PageDown"];"vertical"===P?n.push("ArrowUp","ArrowDown"):n.push("ArrowLeft","ArrowRight"),"activeDescendant"===d&&n.push(" ","Enter"),n.includes(t.key)&&t.preventDefault(),J({type:iu,key:t.key,event:t}),X(t)},te=o.useCallback(e=>{const t=(null!=Y?Y:[]).some(t=>null!=t&&S(e,t)),r=null!=Q&&S(e,Q);return{focusable:"DOM"===d,highlighted:r,selected:t}},[S,Y,Q,d]),re=o.useMemo(()=>({dispatch:J,getItemState:te}),[J,te]);return o.useDebugValue({state:G}),{contextValue:re,dispatch:J,getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e);return(0,je.A)({},e,{"aria-activedescendant":"activeDescendant"===d&&null!=Q?v(Q):void 0,tabIndex:"DOM"===d?-1:0,ref:B},t,{onBlur:(r=t,e=>{var t,n;null==(t=r.onBlur)||t.call(r,e),e.defaultMuiPrevented||null!=(n=N.current)&&n.contains(e.relatedTarget)||J({type:tu,event:e})}),onKeyDown:ee(t)});var r},rootRef:B,state:G}}const ku=o.createContext(null);function _u(){const e=o.useState(new Map),t=(0,s.A)(e,2),r=t[0],n=t[1],i=o.useRef(new Set),a=o.useCallback(function(e){i.current.delete(e),n(t=>{const r=new Map(t);return r.delete(e),r})},[]),l=o.useCallback(function(e,t){let r;return r="function"===typeof e?e(i.current):e,i.current.add(r),n(e=>{const n=new Map(e);return n.set(r,t),n}),{id:r,deregister:()=>a(r)}},[a]),c=o.useMemo(()=>function(e){const t=Array.from(e.keys()).map(t=>({key:t,subitem:e.get(t)}));return t.sort((e,t)=>{const r=e.subitem.ref.current,n=t.subitem.ref.current;return null===r||null===n||r===n?0:r.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING?1:-1}),new Map(t.map(e=>[e.key,e.subitem]))}(r),[r]),d=o.useCallback(function(e){return Array.from(c.keys()).indexOf(e)},[c]);return{contextValue:o.useMemo(()=>({getItemIndex:d,registerItem:l,totalSubitemCount:r.size}),[d,l,r.size]),subitems:c}}const Cu={dispatch:()=>{},popupId:"",registerPopup:()=>{},registerTrigger:()=>{},state:{open:!0,changeReason:null},triggerElement:null};const Au=o.createContext(null);function ju(e){const t=e.value,r=e.children,n=t.dispatch,i=t.getItemIndex,a=t.getItemState,s=t.registerItem,l=t.totalSubitemCount,c=o.useMemo(()=>({dispatch:n,getItemState:a,getItemIndex:i}),[n,i,a]),d=o.useMemo(()=>({getItemIndex:i,registerItem:s,totalSubitemCount:l}),[s,i,l]);return(0,tr.jsx)(ku.Provider,{value:d,children:(0,tr.jsx)(Au.Provider,{value:c,children:r})})}function Iu(e){return e&&e.ownerDocument||document}function Pu(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ru(e){return e instanceof Pu(e).Element||e instanceof Element}function Tu(e){return e instanceof Pu(e).HTMLElement||e instanceof HTMLElement}function Eu(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Pu(e).ShadowRoot||e instanceof ShadowRoot)}var zu=Math.max,Du=Math.min,Mu=Math.round;function Lu(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Ou(){return!/^((?!chrome|android).)*safari/i.test(Lu())}function Fu(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&Tu(e)&&(o=e.offsetWidth>0&&Mu(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Mu(n.height)/e.offsetHeight||1);var a=(Ru(e)?Pu(e):window).visualViewport,s=!Ou()&&r,l=(n.left+(s&&a?a.offsetLeft:0))/o,c=(n.top+(s&&a?a.offsetTop:0))/i,d=n.width/o,u=n.height/i;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l,x:l,y:c}}function Nu(e){var t=Pu(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Bu(e){return e?(e.nodeName||"").toLowerCase():null}function Hu(e){return((Ru(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wu(e){return Fu(Hu(e)).left+Nu(e).scrollLeft}function Vu(e){return Pu(e).getComputedStyle(e)}function $u(e){var t=Vu(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function Uu(e,t,r){void 0===r&&(r=!1);var n=Tu(t),o=Tu(t)&&function(e){var t=e.getBoundingClientRect(),r=Mu(t.width)/e.offsetWidth||1,n=Mu(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),i=Hu(t),a=Fu(e,o,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&(("body"!==Bu(t)||$u(i))&&(s=function(e){return e!==Pu(e)&&Tu(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:Nu(e);var t}(t)),Tu(t)?((l=Fu(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Wu(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function qu(e){var t=Fu(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Ku(e){return"html"===Bu(e)?e:e.assignedSlot||e.parentNode||(Eu(e)?e.host:null)||Hu(e)}function Gu(e){return["html","body","#document"].indexOf(Bu(e))>=0?e.ownerDocument.body:Tu(e)&&$u(e)?e:Gu(Ku(e))}function Ju(e,t){var r;void 0===t&&(t=[]);var n=Gu(e),o=n===(null==(r=e.ownerDocument)?void 0:r.body),i=Pu(n),a=o?[i].concat(i.visualViewport||[],$u(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(Ju(Ku(a)))}function Qu(e){return["table","td","th"].indexOf(Bu(e))>=0}function Yu(e){return Tu(e)&&"fixed"!==Vu(e).position?e.offsetParent:null}function Xu(e){for(var t=Pu(e),r=Yu(e);r&&Qu(r)&&"static"===Vu(r).position;)r=Yu(r);return r&&("html"===Bu(r)||"body"===Bu(r)&&"static"===Vu(r).position)?t:r||function(e){var t=/firefox/i.test(Lu());if(/Trident/i.test(Lu())&&Tu(e)&&"fixed"===Vu(e).position)return null;var r=Ku(e);for(Eu(r)&&(r=r.host);Tu(r)&&["html","body"].indexOf(Bu(r))<0;){var n=Vu(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var Zu="top",eh="bottom",th="right",rh="left",nh="auto",oh=[Zu,eh,th,rh],ih="start",ah="end",sh="viewport",lh="popper",ch=oh.reduce(function(e,t){return e.concat([t+"-"+ih,t+"-"+ah])},[]),dh=[].concat(oh,[nh]).reduce(function(e,t){return e.concat([t,t+"-"+ih,t+"-"+ah])},[]),uh=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function hh(e){var t=new Map,r=new Set,n=[];function o(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!r.has(e)){var n=t.get(e);n&&o(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){r.has(e.name)||o(e)}),n}function ph(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}var vh={placement:"bottom",modifiers:[],strategy:"absolute"};function fh(){for(var e=arguments.length,t=new Array(e),r=0;r=0?"x":"y"}function wh(e){var t,r=e.reference,n=e.element,o=e.placement,i=o?yh(o):null,a=o?bh(o):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(i){case Zu:t={x:s,y:r.y-n.height};break;case eh:t={x:s,y:r.y+r.height};break;case th:t={x:r.x+r.width,y:l};break;case rh:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=i?xh(i):null;if(null!=c){var d="y"===c?"height":"width";switch(a){case ih:t[c]=t[c]-(r[d]/2-n[d]/2);break;case ah:t[c]=t[c]+(r[d]/2-n[d]/2)}}return t}var Sh={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kh(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,u=e.isFixed,h=a.x,p=void 0===h?0:h,v=a.y,f=void 0===v?0:v,m="function"===typeof d?d({x:p,y:f}):{x:p,y:f};p=m.x,f=m.y;var g=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=rh,x=Zu,w=window;if(c){var S=Xu(r),k="clientHeight",_="clientWidth";if(S===Pu(r)&&"static"!==Vu(S=Hu(r)).position&&"absolute"===s&&(k="scrollHeight",_="scrollWidth"),o===Zu||(o===rh||o===th)&&i===ah)x=eh,f-=(u&&S===w&&w.visualViewport?w.visualViewport.height:S[k])-n.height,f*=l?1:-1;if(o===rh||(o===Zu||o===eh)&&i===ah)b=th,p-=(u&&S===w&&w.visualViewport?w.visualViewport.width:S[_])-n.width,p*=l?1:-1}var C,A=Object.assign({position:s},c&&Sh),j=!0===d?function(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:Mu(r*o)/o||0,y:Mu(n*o)/o||0}}({x:p,y:f},Pu(r)):{x:p,y:f};return p=j.x,f=j.y,l?Object.assign({},A,((C={})[x]=y?"0":"",C[b]=g?"0":"",C.transform=(w.devicePixelRatio||1)<=1?"translate("+p+"px, "+f+"px)":"translate3d("+p+"px, "+f+"px, 0)",C)):Object.assign({},A,((t={})[x]=y?f+"px":"",t[b]=g?p+"px":"",t.transform="",t))}const _h={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},o=t.elements[e];Tu(o)&&Bu(o)&&(Object.assign(o.style,r),Object.keys(n).forEach(function(e){var t=n[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],o=t.attributes[e]||{},i=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce(function(e,t){return e[t]="",e},{});Tu(n)&&Bu(n)&&(Object.assign(n.style,i),Object.keys(o).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};const Ch={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=void 0===o?[0,0]:o,a=dh.reduce(function(e,r){return e[r]=function(e,t,r){var n=yh(e),o=[rh,Zu].indexOf(n)>=0?-1:1,i="function"===typeof r?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[rh,th].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}(r,t.rects,i),e},{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=a}};var Ah={left:"right",right:"left",bottom:"top",top:"bottom"};function jh(e){return e.replace(/left|right|bottom|top/g,function(e){return Ah[e]})}var Ih={start:"end",end:"start"};function Ph(e){return e.replace(/start|end/g,function(e){return Ih[e]})}function Rh(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Eu(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Th(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Eh(e,t,r){return t===sh?Th(function(e,t){var r=Pu(e),n=Hu(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=Ou();(c||!c&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+Wu(e),y:l}}(e,r)):Ru(t)?function(e,t){var r=Fu(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):Th(function(e){var t,r=Hu(e),n=Nu(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=zu(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=zu(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+Wu(e),l=-n.scrollTop;return"rtl"===Vu(o||r).direction&&(s+=zu(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}(Hu(e)))}function zh(e,t,r,n){var o="clippingParents"===t?function(e){var t=Ju(Ku(e)),r=["absolute","fixed"].indexOf(Vu(e).position)>=0&&Tu(e)?Xu(e):e;return Ru(r)?t.filter(function(e){return Ru(e)&&Rh(e,r)&&"body"!==Bu(e)}):[]}(e):[].concat(t),i=[].concat(o,[r]),a=i[0],s=i.reduce(function(t,r){var o=Eh(e,r,n);return t.top=zu(o.top,t.top),t.right=Du(o.right,t.right),t.bottom=Du(o.bottom,t.bottom),t.left=zu(o.left,t.left),t},Eh(e,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Dh(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Mh(e,t){return t.reduce(function(t,r){return t[r]=e,t},{})}function Lh(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=void 0===n?e.placement:n,i=r.strategy,a=void 0===i?e.strategy:i,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,d=void 0===c?sh:c,u=r.elementContext,h=void 0===u?lh:u,p=r.altBoundary,v=void 0!==p&&p,f=r.padding,m=void 0===f?0:f,g=Dh("number"!==typeof m?m:Mh(m,oh)),y=h===lh?"reference":lh,b=e.rects.popper,x=e.elements[v?y:h],w=zh(Ru(x)?x:x.contextElement||Hu(e.elements.popper),l,d,a),S=Fu(e.elements.reference),k=wh({reference:S,element:b,strategy:"absolute",placement:o}),_=Th(Object.assign({},b,k)),C=h===lh?_:S,A={top:w.top-C.top+g.top,bottom:C.bottom-w.bottom+g.bottom,left:w.left-C.left+g.left,right:C.right-w.right+g.right},j=e.modifiersData.offset;if(h===lh&&j){var I=j[o];Object.keys(A).forEach(function(e){var t=[th,eh].indexOf(e)>=0?1:-1,r=[Zu,eh].indexOf(e)>=0?"y":"x";A[e]+=I[r]*t})}return A}const Oh={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0===a||a,l=r.fallbackPlacements,c=r.padding,d=r.boundary,u=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,v=void 0===p||p,f=r.allowedAutoPlacements,m=t.options.placement,g=yh(m),y=l||(g===m||!v?[jh(m)]:function(e){if(yh(e)===nh)return[];var t=jh(e);return[Ph(e),t,Ph(t)]}(m)),b=[m].concat(y).reduce(function(e,r){return e.concat(yh(r)===nh?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?dh:l,d=bh(n),u=d?s?ch:ch.filter(function(e){return bh(e)===d}):oh,h=u.filter(function(e){return c.indexOf(e)>=0});0===h.length&&(h=u);var p=h.reduce(function(t,r){return t[r]=Lh(e,{placement:r,boundary:o,rootBoundary:i,padding:a})[yh(r)],t},{});return Object.keys(p).sort(function(e,t){return p[e]-p[t]})}(t,{placement:r,boundary:d,rootBoundary:u,padding:c,flipVariations:v,allowedAutoPlacements:f}):r)},[]),x=t.rects.reference,w=t.rects.popper,S=new Map,k=!0,_=b[0],C=0;C=0,R=P?"width":"height",T=Lh(t,{placement:A,boundary:d,rootBoundary:u,altBoundary:h,padding:c}),E=P?I?th:rh:I?eh:Zu;x[R]>w[R]&&(E=jh(E));var z=jh(E),D=[];if(i&&D.push(T[j]<=0),s&&D.push(T[E]<=0,T[z]<=0),D.every(function(e){return e})){_=A,k=!1;break}S.set(A,D)}if(k)for(var M=function(e){var t=b.find(function(t){var r=S.get(t);if(r)return r.slice(0,e).every(function(e){return e})});if(t)return _=t,"break"},L=v?3:1;L>0;L--){if("break"===M(L))break}t.placement!==_&&(t.modifiersData[n]._skip=!0,t.placement=_,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function Fh(e,t,r){return zu(e,Du(t,r))}const Nh={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=void 0===o||o,a=r.altAxis,s=void 0!==a&&a,l=r.boundary,c=r.rootBoundary,d=r.altBoundary,u=r.padding,h=r.tether,p=void 0===h||h,v=r.tetherOffset,f=void 0===v?0:v,m=Lh(t,{boundary:l,rootBoundary:c,padding:u,altBoundary:d}),g=yh(t.placement),y=bh(t.placement),b=!y,x=xh(g),w="x"===x?"y":"x",S=t.modifiersData.popperOffsets,k=t.rects.reference,_=t.rects.popper,C="function"===typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,A="number"===typeof C?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,I={x:0,y:0};if(S){if(i){var P,R="y"===x?Zu:rh,T="y"===x?eh:th,E="y"===x?"height":"width",z=S[x],D=z+m[R],M=z-m[T],L=p?-_[E]/2:0,O=y===ih?k[E]:_[E],F=y===ih?-_[E]:-k[E],N=t.elements.arrow,B=p&&N?qu(N):{width:0,height:0},H=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},W=H[R],V=H[T],$=Fh(0,k[E],B[E]),U=b?k[E]/2-L-$-W-A.mainAxis:O-$-W-A.mainAxis,q=b?-k[E]/2+L+$+V+A.mainAxis:F+$+V+A.mainAxis,K=t.elements.arrow&&Xu(t.elements.arrow),G=K?"y"===x?K.clientTop||0:K.clientLeft||0:0,J=null!=(P=null==j?void 0:j[x])?P:0,Q=z+q-J,Y=Fh(p?Du(D,z+U-J-G):D,z,p?zu(M,Q):M);S[x]=Y,I[x]=Y-z}if(s){var X,Z="x"===x?Zu:rh,ee="x"===x?eh:th,te=S[w],re="y"===w?"height":"width",ne=te+m[Z],oe=te-m[ee],ie=-1!==[Zu,rh].indexOf(g),ae=null!=(X=null==j?void 0:j[w])?X:0,se=ie?ne:te-k[re]-_[re]-ae+A.altAxis,le=ie?te+k[re]+_[re]-ae-A.altAxis:oe,ce=p&&ie?function(e,t,r){var n=Fh(e,t,r);return n>r?r:n}(se,te,le):Fh(p?se:ne,te,p?le:oe);S[w]=ce,I[w]=ce-te}t.modifiersData[n]=I}},requiresIfExists:["offset"]};const Bh={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=yh(r.placement),l=xh(s),c=[rh,th].indexOf(s)>=0?"height":"width";if(i&&a){var d=function(e,t){return Dh("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Mh(e,oh))}(o.padding,r),u=qu(i),h="y"===l?Zu:rh,p="y"===l?eh:th,v=r.rects.reference[c]+r.rects.reference[l]-a[l]-r.rects.popper[c],f=a[l]-r.rects.reference[l],m=Xu(i),g=m?"y"===l?m.clientHeight||0:m.clientWidth||0:0,y=v/2-f/2,b=d[h],x=g-u[c]-d[p],w=g/2-u[c]/2+y,S=Fh(b,w,x),k=l;r.modifiersData[n]=((t={})[k]=S,t.centerOffset=S-w,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!==typeof n||(n=t.elements.popper.querySelector(n)))&&Rh(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Hh(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Wh(e){return[Zu,th,eh,rh].some(function(t){return e[t]>=0})}var Vh=mh({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=void 0===o||o,a=n.resize,s=void 0===a||a,l=Pu(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(e){e.addEventListener("scroll",r.update,gh)}),s&&l.addEventListener("resize",r.update,gh),function(){i&&c.forEach(function(e){e.removeEventListener("scroll",r.update,gh)}),s&&l.removeEventListener("resize",r.update,gh)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=wh({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=void 0===n||n,i=r.adaptive,a=void 0===i||i,s=r.roundOffsets,l=void 0===s||s,c={placement:yh(t.placement),variation:bh(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,kh(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,kh(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},_h,Ch,Oh,Nh,Bh,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=Lh(t,{elementContext:"reference"}),s=Lh(t,{altBoundary:!0}),l=Hh(a,n),c=Hh(s,o,i),d=Wh(l),u=Wh(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function $h(e){var t;return parseInt(o.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}const Uh=o.forwardRef(function(e,t){const r=e.children,n=e.container,i=e.disablePortal,a=void 0!==i&&i,l=o.useState(null),c=(0,s.A)(l,2),d=c[0],u=c[1],h=rn(o.isValidElement(r)?$h(r):null,t);if(eu(()=>{a||u(function(e){return"function"===typeof e?e():e}(n)||document.body)},[n,a]),eu(()=>{if(d&&!a)return tn(t,d),()=>{tn(t,null)}},[t,d,a]),a){if(o.isValidElement(r)){const e={ref:h};return o.cloneElement(r,e)}return(0,tr.jsx)(o.Fragment,{children:r})}return(0,tr.jsx)(o.Fragment,{children:d?pc.createPortal(r,d):d})});const qh="base";function Kh(e,t){const r=gr[t];return r?(n=r,"".concat(qh,"--").concat(n)):function(e,t){return"".concat(qh,"-").concat(e,"-").concat(t)}(e,t);var n}const Gh="Popper";function Jh(e){return Kh(Gh,e)}!function(e,t){const r={};t.forEach(t=>{r[t]=Kh(e,t)})}(Gh,["root"]);const Qh=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];const Yh=function(e){var t;const r=e.elementType,n=e.externalSlotProps,o=e.ownerState,i=e.skipResolvingSlotProps,a=void 0!==i&&i,s=(0,Ie.A)(e,Qh),l=a?{}:nn(n,o),c=sn((0,je.A)({},s,{externalSlotProps:l})),d=c.props,u=rn(c.internalRef,null==l?void 0:l.ref,null==(t=e.additionalProps)?void 0:t.ref);return cn(r,(0,je.A)({},d,{ref:u}),o)};const Xh={disableDefaultClasses:!1},Zh=o.createContext(Xh);const ep=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],tp=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function rp(e){return"function"===typeof e?e():e}function np(e){return void 0!==e.nodeType}const op=()=>Dr({root:["root"]},function(e){const t=o.useContext(Zh).disableDefaultClasses;return r=>t?"":e(r)}(Jh)),ip={},ap=o.forwardRef(function(e,t){var r;const n=e.anchorEl,i=e.children,a=e.direction,l=e.disablePortal,c=e.modifiers,d=e.open,u=e.placement,h=e.popperOptions,p=e.popperRef,v=e.slotProps,f=void 0===v?{}:v,m=e.slots,g=void 0===m?{}:m,y=e.TransitionProps,b=(0,Ie.A)(e,ep),x=o.useRef(null),w=rn(x,t),S=o.useRef(null),k=rn(S,p),_=o.useRef(k);eu(()=>{_.current=k},[k]),o.useImperativeHandle(p,()=>S.current,[]);const C=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(u,a),A=o.useState(C),j=(0,s.A)(A,2),I=j[0],P=j[1],R=o.useState(rp(n)),T=(0,s.A)(R,2),E=T[0],z=T[1];o.useEffect(()=>{S.current&&S.current.forceUpdate()}),o.useEffect(()=>{n&&z(rp(n))},[n]),eu(()=>{if(!E||!d)return;let e=[{name:"preventOverflow",options:{altBoundary:l}},{name:"flip",options:{altBoundary:l}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:e=>{(e=>{P(e.placement)})(e.state)}}];null!=c&&(e=e.concat(c)),h&&null!=h.modifiers&&(e=e.concat(h.modifiers));const t=Vh(E,x.current,(0,je.A)({placement:C},h,{modifiers:e}));return _.current(t),()=>{t.destroy(),_.current(null)}},[E,l,c,d,h,C]);const D={placement:I};null!==y&&(D.TransitionProps=y);const M=op(),L=null!=(r=g.root)?r:"div",O=Yh({elementType:L,externalSlotProps:f.root,externalForwardedProps:b,additionalProps:{role:"tooltip",ref:w},ownerState:e,className:M.root});return(0,tr.jsx)(L,(0,je.A)({},O,{children:"function"===typeof i?i(D):i}))}),sp=o.forwardRef(function(e,t){const r=e.anchorEl,n=e.children,i=e.container,a=e.direction,l=void 0===a?"ltr":a,c=e.disablePortal,d=void 0!==c&&c,u=e.keepMounted,h=void 0!==u&&u,p=e.modifiers,v=e.open,f=e.placement,m=void 0===f?"bottom":f,g=e.popperOptions,y=void 0===g?ip:g,b=e.popperRef,x=e.style,w=e.transition,S=void 0!==w&&w,k=e.slotProps,_=void 0===k?{}:k,C=e.slots,A=void 0===C?{}:C,j=(0,Ie.A)(e,tp),I=o.useState(!0),P=(0,s.A)(I,2),R=P[0],T=P[1];if(!h&&!v&&(!S||R))return null;let E;if(i)E=i;else if(r){const e=rp(r);E=e&&np(e)?Iu(e).body:Iu(null).body}const z=v||!h||S&&!R?void 0:"none",D=S?{in:v,onEnter:()=>{T(!1)},onExited:()=>{T(!0)}}:void 0;return(0,tr.jsx)(Uh,{disablePortal:d,container:E,children:(0,tr.jsx)(ap,(0,je.A)({anchorEl:r,direction:l,disablePortal:d,modifiers:p,ref:t,open:S?!R:v,placement:m,popperOptions:y,popperRef:b,slotProps:_,slots:A},j,{style:(0,je.A)({position:"fixed",top:0,left:0,display:z},x),TransitionProps:D,children:n}))})});function lp(e){return xr("MuiMenu",e)}wr("MuiMenu",["root","listbox","expanded","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const cp=["actions","children","color","component","disablePortal","keepMounted","id","invertedColors","onItemsChange","modifiers","variant","size","slots","slotProps"],dp=Qr(Wi,{name:"JoyMenu",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o;const i=null==(n=t.variants[r.variant])?void 0:n[r.color];return[(0,je.A)({"--focus-outline-offset":"calc(".concat(t.vars.focus.thickness," * -1)"),"--ListItem-stickyBackground":(null==i?void 0:i.backgroundColor)||(null==i?void 0:i.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Fi,{borderRadius:"var(--List-radius, ".concat(t.vars.radius.sm,")"),boxShadow:t.shadow.md,overflow:"auto",zIndex:"var(--unstable_popup-zIndex, ".concat(t.vars.zIndex.popup,")")},!(null!=i&&i.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup},"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(o=t.variants[r.variant])?void 0:o[r.color])]}),up=o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyMenu"}),i=n.actions,a=n.children,s=n.color,l=void 0===s?"neutral":s,c=n.component,d=n.disablePortal,u=void 0!==d&&d,h=n.keepMounted,p=void 0!==h&&h,v=n.id,f=n.invertedColors,m=void 0!==f&&f,g=n.onItemsChange,y=n.modifiers,b=n.variant,x=void 0===b?"outlined":b,w=n.size,S=void 0===w?"md":w,k=n.slots,_=void 0===k?{}:k,C=n.slotProps,A=void 0===C?{}:C,j=(0,Ie.A)(n,cp),I=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var t,r;const n=e.listboxRef,i=e.onItemsChange,a=e.id,s=e.disabledItemsFocusable,l=void 0===s||s,c=e.disableListWrap,d=void 0!==c&&c,u=e.autoFocus,h=void 0===u||u,p=e.componentName,v=void 0===p?"useMenu":p,f=o.useRef(null),m=rn(f,n),g=null!=(t=gi(a))?t:"",y=null!=(r=o.useContext(Ed))?r:Cu,b=y.state,x=b.open,w=b.changeReason,S=y.dispatch,k=y.triggerElement,_=y.registerPopup,C=o.useRef(x),A=_u(),j=A.subitems,I=A.contextValue,P=o.useMemo(()=>Array.from(j.keys()),[j]),R=Su({disabledItemsFocusable:l,disableListWrap:d,focusManagement:"DOM",getItemDomElement:o.useCallback(e=>{var t,r;return null==e?null:null!=(t=null==(r=j.get(e))?void 0:r.ref.current)?t:null},[j]),getInitialState:()=>({selectedValues:[],highlightedValue:null}),isItemDisabled:o.useCallback(e=>{var t;return(null==j||null==(t=j.get(e))?void 0:t.disabled)||!1},[j]),items:P,getItemAsString:o.useCallback(e=>{var t,r;return(null==(t=j.get(e))?void 0:t.label)||(null==(r=j.get(e))||null==(r=r.ref.current)?void 0:r.innerText)},[j]),rootRef:m,onItemsChange:i,reducerActionContext:o.useMemo(()=>({listboxRef:f}),[f]),selectionMode:"none",stateReducer:vu,componentName:v}),T=R.dispatch,E=R.getRootProps,z=R.contextValue,D=R.state.highlightedValue,M=R.rootRef;eu(()=>{_(g)},[g,_]),eu(()=>{x&&"keydown"===(null==w?void 0:w.type)&&"ArrowUp"===w.key&&T({type:su,event:w})},[x,w,T]),o.useEffect(()=>{var e;x&&h&&D&&!C.current&&(null==(e=j.get(D))||null==(e=e.ref)||null==(e=e.current)||e.focus())},[x,h,D,j,P]),o.useEffect(()=>{var e,t;null!=(e=f.current)&&e.contains(document.activeElement)&&null!==D&&(null==j||null==(t=j.get(D))||null==(t=t.ref.current)||t.focus())},[D,j]);const L=e=>t=>{var r,n;null==(r=e.onBlur)||r.call(e,t),t.defaultMuiPrevented||null!=(n=f.current)&&n.contains(t.relatedTarget)||t.relatedTarget===k||S({type:Fd,event:t})},O=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),t.defaultMuiPrevented||"Escape"===t.key&&S({type:Nd,event:t})},F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{onBlur:L(e),onKeyDown:O(e)}};return o.useDebugValue({subitems:j,highlightedValue:D}),{contextValue:(0,je.A)({},I,z),dispatch:T,getListboxProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Ud(F,E),r=on(e);return(0,je.A)({},e,r,t(r),{id:g,role:"menu"})},highlightedValue:D,listboxRef:M,menuItems:j,open:x,triggerElement:k}}({onItemsChange:g,id:v,listboxRef:t}),P=I.contextValue,R=I.getListboxProps,T=I.dispatch,E=I.open,z=I.triggerElement;o.useImperativeHandle(i,()=>({dispatch:T,resetHighlight:()=>T({type:au,event:null})}),[T]);const D=(0,je.A)({},n,{disablePortal:u,invertedColors:m,color:l,variant:x,size:S,open:E,nesting:!1,row:!1}),M=(e=>{const t=e.open,r=e.variant,n=e.color,o=e.size;return Dr({root:["root",t&&"expanded",r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),o&&"size".concat(Le(o))],listbox:["listbox"]},lp,{})})(D),L=(0,je.A)({},j,{component:c,slots:_,slotProps:A}),O=o.useMemo(()=>[{name:"offset",options:{offset:[0,4]}},...y||[]],[y]),F=Yh({elementType:dp,getSlotProps:R,externalForwardedProps:L,externalSlotProps:{},ownerState:D,additionalProps:{anchorEl:z,open:E&&null!==z,disablePortal:u,keepMounted:p,modifiers:O},className:M.root});return(0,tr.jsx)(dp,(0,je.A)({},F,!(null!=(r=n.slots)&&r.root)&&{as:sp,slots:{root:c||"ul"}},{children:(0,tr.jsx)(ju,{value:P,children:(0,tr.jsx)(xi,{variant:m?void 0:x,color:l,children:(0,tr.jsx)(Mi.Provider,{value:"menu",children:(0,tr.jsx)(Ni,{nested:!0,children:a})})})})}))}),hp=up;function pp(e){const t=e.handlePointerOverEvents,r=void 0!==t&&t,n=e.item,i=o.useContext(Au);if(!i)throw new Error("useListItem must be used within a ListProvider");const a=i.dispatch,s=(0,i.getItemState)(n),l=s.highlighted,c=s.selected,d=s.focusable,u=o.useCallback(e=>t=>{var r;null==(r=e.onClick)||r.call(e,t),t.defaultPrevented||a({type:ru,item:n,event:t})},[a,n]),h=o.useCallback(e=>t=>{var r;null==(r=e.onMouseOver)||r.call(e,t),t.defaultPrevented||a({type:nu,item:n,event:t})},[a,n]);let p;d&&(p=l?0:-1);return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e);return(0,je.A)({},e,{onClick:u(t),onPointerOver:r?h(t):void 0,tabIndex:p})},highlighted:l,selected:c}}function vp(e,t){const r=o.useContext(ku);if(null===r)throw new Error("useCompoundItem must be used within a useCompoundParent");const n=r.registerItem,i=o.useState("function"===typeof e?void 0:e),a=(0,s.A)(i,2),l=a[0],c=a[1];return eu(()=>{const r=n(e,t),o=r.id,i=r.deregister;return c(o),i},[n,t,e]),{id:l,index:void 0!==l?r.getItemIndex(l):-1,totalItemCount:r.totalSubitemCount}}function fp(e){return"menu-item-".concat(e.size)}const mp={dispatch:()=>{},popupId:"",registerPopup:()=>{},registerTrigger:()=>{},state:{open:!0,changeReason:null},triggerElement:null};function gp(e){return xr("MuiListItemButton",e)}const yp=wr("MuiListItemButton",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","variantPlain","variantSoft","variantOutlined","variantSolid"]),bp=["children","className","action","component","orientation","role","selected","color","variant","slots","slotProps"],xp=Qr("div")(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l;return(0,je.A)({"--Icon-margin":"initial","--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon,WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",font:"inherit",display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:"var(--ListItem-gap)"},"vertical"===r.orientation&&{flexDirection:"column",justifyContent:"center"},{textAlign:"initial",textDecoration:"initial",backgroundColor:"initial",cursor:"pointer",marginInline:"var(--ListItemButton-marginInline)",marginBlock:"var(--ListItemButton-marginBlock)"},void 0===r["data-first-child"]&&{marginInlineStart:r.row?"var(--List-gap)":void 0,marginBlockStart:r.row?void 0:"var(--List-gap)"},{paddingBlock:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px))",paddingInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItem-startActionWidth, var(--unstable_startActionWidth, 0px)))",paddingInlineEnd:"calc(var(--ListItem-paddingRight) + var(--ListItem-endActionWidth, var(--unstable_endActionWidth, 0px)))",minBlockSize:"var(--ListItem-minHeight)",border:"1px solid transparent",borderRadius:"var(--ListItem-radius)",flex:"var(--unstable_ListItem-flex, none)",fontSize:"inherit",lineHeight:"inherit",minInlineSize:0,[t.focus.selector]:(0,je.A)({},t.focus.default,{zIndex:1})},null==(n=t.variants[r.variant])?void 0:n[r.color],{"&:active":null==(o=t.variants["".concat(r.variant,"Active")])?void 0:o[r.color],[".".concat(Ki.root," > &")]:{"--unstable_ListItem-flex":"1 0 0%"},["&.".concat(yp.selected)]:(0,je.A)({},null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color],{"--Icon-color":"currentColor"}),["&:not(.".concat(yp.selected,', [aria-selected="true"])')]:{"&:hover":null==(a=t.variants["".concat(r.variant,"Hover")])?void 0:a[r.color],"&:active":null==(s=t.variants["".concat(r.variant,"Active")])?void 0:s[r.color]},["&.".concat(yp.disabled)]:(0,je.A)({},null==(l=t.variants["".concat(r.variant,"Disabled")])?void 0:l[r.color])})}),wp=Qr(xp,{name:"JoyListItemButton",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;return(0,je.A)({},!t.row&&{["&.".concat(yp.selected)]:{fontWeight:r.vars.fontWeight.md}})}),Sp=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListItemButton"}),n=o.useContext(Li),i=r.children,a=r.className,l=r.action,c=r.component,d=void 0===c?"div":c,u=r.orientation,h=void 0===u?"horizontal":u,p=r.role,v=r.selected,f=void 0!==v&&v,m=r.color,g=void 0===m?"neutral":m,y=r.variant,b=void 0===y?"plain":y,x=r.slots,w=void 0===x?{}:x,S=r.slotProps,k=void 0===S?{}:S,_=(0,Ie.A)(r,bp),C=o.useRef(null),A=rn(C,t),j=lo((0,je.A)({},r,{rootRef:A})),I=j.focusVisible,P=j.setFocusVisible,R=j.getRootProps;o.useImperativeHandle(l,()=>({focusVisible:()=>{var e;P(!0),null==(e=C.current)||e.focus()}}),[P]);const T=(0,je.A)({},r,{component:d,color:g,focusVisible:I,orientation:h,row:n,selected:f,variant:b}),E=(e=>{const t=e.color,r=e.disabled,n=e.focusVisible,o=e.focusVisibleClassName,i=e.selected,a=e.variant,s=Dr({root:["root",r&&"disabled",n&&"focusVisible",t&&"color".concat(Le(t)),i&&"selected",a&&"variant".concat(Le(a))]},gp,{});return n&&o&&(s.root+=" ".concat(o)),s})(T),z=(0,je.A)({},_,{component:d,slots:w,slotProps:k}),D=pn("root",{ref:t,className:(0,Pe.A)(E.root,a),elementType:wp,externalForwardedProps:z,ownerState:T,getSlotProps:R}),M=(0,s.A)(D,2),L=M[0],O=M[1];return(0,tr.jsx)(na.Provider,{value:h,children:(0,tr.jsx)(L,(0,je.A)({},O,{role:null!=p?p:O.role,children:i}))})}),kp=Sp;function _p(e){return xr("MuiMenuItem",e)}wr("MuiMenuItem",["root","focusVisible","disabled","selected","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const Cp=["children","disabled","component","selected","color","orientation","variant","slots","slotProps","id"],Ap=Qr(xp,{name:"JoyMenuItem",slot:"Root",overridesResolver:(e,t)=>t.root})({}),jp=o.memo(o.forwardRef(function(e,t){const r=en({props:e,name:"JoyMenuItem"}),n=o.useContext(Li),i=r.children,a=r.disabled,l=void 0!==a&&a,c=r.component,d=void 0===c?"li":c,u=r.selected,h=void 0!==u&&u,p=r.color,v=void 0===p?"neutral":p,f=r.orientation,m=void 0===f?"horizontal":f,g=r.variant,y=void 0===g?"plain":g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=r.id,_=(0,Ie.A)(r,Cp),C=bi(e.variant,e.color),A=C.variant,j=void 0===A?y:A,I=C.color,P=void 0===I?v:I,R=function(e){var t;const r=e.disabled,n=void 0!==r&&r,i=e.id,a=e.rootRef,s=e.label,l=e.disableFocusOnHover,c=void 0!==l&&l,d=gi(i),u=o.useRef(null),h=o.useMemo(()=>({disabled:n,id:null!=d?d:"",label:s,ref:u}),[n,d,s]),p=(null!=(t=o.useContext(Ed))?t:mp).dispatch,v=pp({item:d,handlePointerOverEvents:!c}),f=v.getRootProps,m=v.highlighted,g=vp(null!=d?d:fp,h),y=g.index,b=g.totalItemCount,x=lo({disabled:n,focusableWhenDisabled:!0}),w=x.getRootProps,S=x.focusVisible,k=rn(x.rootRef,a,u);o.useDebugValue({id:d,highlighted:m,disabled:n,label:s});const _=e=>t=>{var r;null==(r=e.onClick)||r.call(e,t),t.defaultMuiPrevented||p({type:Wd,event:t})},C=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({},e,{onClick:_(e)})};function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(C,Ud(w,f));return(0,je.A)({},e,t,r(t),{id:d,ref:k,role:"menuitem"})}return void 0===d?{getRootProps:A,disabled:!1,focusVisible:S,highlighted:!1,index:-1,totalItemCount:0,rootRef:k}:{getRootProps:A,disabled:n,focusVisible:S,highlighted:m,index:y,totalItemCount:b,rootRef:k}}({id:k,disabled:l,rootRef:t}),T=R.getRootProps,E=R.disabled,z=R.focusVisible,D=(0,je.A)({},r,{component:d,color:P,disabled:E,focusVisible:z,orientation:m,selected:h,row:n,variant:j}),M=(e=>{const t=e.focusVisible,r=e.disabled,n=e.selected,o=e.color,i=e.variant;return Dr({root:["root",t&&"focusVisible",r&&"disabled",n&&"selected",o&&"color".concat(Le(o)),i&&"variant".concat(Le(i))]},_p,{})})(D),L=(0,je.A)({},_,{component:d,slots:x,slotProps:S}),O=pn("root",{ref:t,elementType:Ap,getSlotProps:T,externalForwardedProps:L,className:M.root,ownerState:D}),F=(0,s.A)(O,2),N=F[0],B=F[1];return(0,tr.jsx)(na.Provider,{value:m,children:(0,tr.jsx)(N,(0,je.A)({},B,{children:i}))})})),Ip=o.forwardRef(function(e,t){const r=function(e){const t=o.useContext(Au);if(!t)throw new Error("MenuItem: ListContext was not found.");const r=gi(e),n=t.getItemState,i=t.dispatch;let a;a=null!=r?n(r):{focusable:!0,highlighted:!1,selected:!1};const s=a,l=s.highlighted,c=s.selected,d=s.focusable,u=o.useCallback(e=>{if(e!==r)throw new Error(["Base UI MenuItem: Tried to access the state of another MenuItem.","itemValue: ".concat(e," | id: ").concat(r),"This is unsupported when the MenuItem uses the MenuItemContextStabilizer as a performance optimization."].join("/n"));return{highlighted:l,selected:c,focusable:d}},[l,c,d,r]);return{contextValue:o.useMemo(()=>({dispatch:i,getItemState:u}),[i,u]),id:r}}(e.id),n=r.contextValue,i=r.id;return(0,tr.jsx)(Au.Provider,{value:n,children:(0,tr.jsx)(jp,(0,je.A)({},e,{id:i,ref:t}))})});function Pp(e){return xr("MuiListDivider",e)}wr("MuiListDivider",["root","insetGutter","insetStartDecorator","insetStartContent","horizontal","vertical"]);const Rp=["component","role","className","children","inset","orientation","slots","slotProps"],Tp=Qr(tc,{name:"JoyListDivider",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState;return(0,je.A)({},"context"===t.inset&&{"--Divider-inset":"calc(-1 * var(--List-padding))"},t.row&&(0,je.A)({marginInline:"var(--ListDivider-gap)"},"gutter"===t.inset&&{marginBlock:"var(--ListItem-paddingY)"},void 0===t["data-first-child"]&&{marginInlineStart:"calc(var(--List-gap) + var(--ListDivider-gap))"}),!t.row&&(0,je.A)({},void 0===t["data-first-child"]&&{marginBlockStart:"calc(var(--List-gap) + var(--ListDivider-gap))"},{marginBlockEnd:"var(--ListDivider-gap)"},"gutter"===t.inset&&{marginInlineStart:"var(--ListItem-paddingLeft)",marginInlineEnd:"var(--ListItem-paddingRight)"},"startDecorator"===t.inset&&{marginInlineStart:"var(--ListItem-paddingLeft)"},"startContent"===t.inset&&{marginInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItemDecorator-size))"}))}),Ep=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListDivider"}),n=o.useContext(Li),i=o.useContext(Di),a=r.component,l=r.role,c=r.className,d=r.children,u=r.inset,h=void 0===u?"context":u,p=r.orientation,v=r.slots,f=void 0===v?{}:v,m=r.slotProps,g=void 0===m?{}:m,y=(0,Ie.A)(r,Rp),b=(null==i?void 0:i.split(":"))||["",""],x=(0,s.A)(b,1)[0],w=a||(x&&!x.match(/^(ul|ol|menu)$/)?"div":"li"),S=l||("li"===w?"separator":void 0),k=p||(n?"vertical":"horizontal"),_=(0,je.A)({},r,{inset:h,row:n,orientation:k,component:w,role:S}),C=(e=>{const t=e.orientation,r=e.inset;return Dr({root:["root",t,r&&"context"!==r&&"inset".concat(Le(r))]},Pp,{})})(_),A=(0,je.A)({},y,{component:w,slots:f,slotProps:g}),j=pn("root",{ref:t,className:(0,Pe.A)(C.root,c),elementType:Tp,externalForwardedProps:A,ownerState:_,additionalProps:(0,je.A)({as:w,role:S},"separator"===S&&"vertical"===k&&{"aria-orientation":"vertical"})}),I=(0,s.A)(j,2),P=I[0],R=I[1];return(0,tr.jsx)(P,(0,je.A)({},R,{children:d}))});var zp=r(1157),Dp="undefined"!=typeof window?window:void 0,Mp="undefined"!=typeof globalThis?globalThis:Dp,Lp=null==Mp?void 0:Mp.navigator,Op=null==Mp?void 0:Mp.document,Fp=null==Mp?void 0:Mp.location,Np=null==Mp?void 0:Mp.fetch,Bp=null!=Mp&&Mp.XMLHttpRequest&&"withCredentials"in new Mp.XMLHttpRequest?Mp.XMLHttpRequest:void 0,Hp=null==Mp?void 0:Mp.AbortController,Wp=null==Mp?void 0:Mp.CompressionStream,Vp=null==Lp?void 0:Lp.userAgent;function $p(){return!(!Dp||!1===Dp.navigator.onLine)}var Up="undefined"!=typeof globalThis?globalThis:Dp;Up&&"undefined"==typeof self&&(Up.self=Up),Up&&"undefined"==typeof File&&(Up.File=function(){});var qp=null!=Dp?Dp:{},Kp="0.2.0",Gp={DEBUG:!1,LIB_VERSION:Kp,LIB_NAME:"browser-common",JS_SDK_VERSION:Kp};function Jp(e,t,r,n,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function Qp(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){Jp(i,n,o,a,s,"next",e)}function s(e){Jp(i,n,o,a,s,"throw",e)}a(void 0)})}}function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yp.apply(null,arguments)}function Xp(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}var Zp=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(Mp){return e}};function ev(e){return"string"==typeof e||e}function tv(e){return"string"==typeof e?e:void 0}var rv,nv=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],ov=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),iv=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),av=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],sv=["token"],lv="NativeGzipValidationError",cv=e=>e.length>=2&&31===e[0]&&139===e[1],dv=(e,t)=>e===iv.GZipJS||t===iv.GZipJS||"gzip"===t,uv=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),hv=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=lv,t},pv=function(){var e=Qp(function*(e,t){18>e.size&&hv("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());cv(r)&&8===r[2]||hv("invalid-header");var n=new DataView(yield e.slice(e.size-8).arrayBuffer());n.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(rv)return rv;rv=[];for(var e=0;256>e;e++){for(var t=e,r=0;8>r;r++)t=1&t?3988292384^t>>>1:t>>>1;rv[e]=t>>>0}return rv})(),r=4294967295,n=0;e.length>n;n++)r=t[255&(r^e[n])]^r>>>8;return(4294967295^r)>>>0})(t)&&hv("invalid-crc");var o=t.length>>>0;n.getUint32(4,!0)!==o&&hv("invalid-size")});return function(t,r){return e.apply(this,arguments)}}();function vv(){return vv=Qp(function*(e,t,r){void 0===t&&(t=!0);try{var n=(new TextEncoder).encode(e),o=new globalThis.CompressionStream("gzip"),i=o.writable.getWriter(),a=i.write(n).then(()=>i.close()).catch(function(){var e=Qp(function*(e){try{yield i.abort(e)}catch(e){}throw e});return function(t){return e.apply(this,arguments)}}()),s=new Response(o.readable).blob(),l=(yield Promise.all([s,a]))[0];return yield pv(l,n),l}catch(e){if(null!=r&&r.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}),vv.apply(this,arguments)}var fv=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],mv=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var r=e.toLowerCase();return fv.concat(t).some(e=>{var t=e.toLowerCase();return-1!==r.indexOf(t)})};function gv(e,t){return-1!==e.indexOf(t)}var yv=function(e){return e.trim()},bv=function(e){return e.replace(/^\$/,"")};function xv(e){var t,r=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}}))&&void 0!==t?t:"null"}var wv=Object.prototype,Sv=wv.hasOwnProperty,kv=wv.toString,_v=Array.isArray||function(e){return"[object Array]"===kv.call(e)},Cv=e=>"function"==typeof e,Av=e=>e===Object(e)&&!_v(e),jv=e=>{if(Av(e)){for(var t in e)if(Sv.call(e,t))return!1;return!0}return!1},Iv=e=>void 0===e,Pv=e=>"[object String]"==kv.call(e),Rv=e=>Pv(e)&&0===e.trim().length,Tv=e=>null===e,Ev=e=>Iv(e)||Tv(e),zv=e=>"[object Number]"==kv.call(e)&&e==e,Dv=e=>zv(e)&&e>0,Mv=e=>"[object Boolean]"===kv.call(e),Lv=e=>gv(av,e),Ov=e=>gv(sv,e);function Fv(e){return null===e||"object"!=typeof e}function Nv(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Bv(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var Hv=[!0,"true",1,"1","yes"],Wv=e=>gv(Hv,e),Vv=[!1,"false",0,"0","no"];function $v(e,t,r,n,o){return t>r&&(n.warn("min cannot be greater than max."),t=r),zv(e)?e>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+o),$v(o||r,t,r,n))}class Uv{constructor(e){this.tt={},this.et=e.et,this.rt=$v(e.bucketSize,0,100,e.it),this.nt=$v(e.refillRate,0,this.rt,e.it),this.st=$v(e.refillInterval,0,864e5,e.it)}ot(e,t){var r=Math.floor((t-e.lastAccess)/this.st);r>0&&(e.tokens=Math.min(e.tokens+r*this.nt,this.rt),e.lastAccess=e.lastAccess+r*this.st)}consumeRateLimit(e){var t,r=Date.now(),n=String(e),o=this.tt[n];return o?this.ot(o,r):this.tt[n]=o={tokens:this.rt,lastAccess:r},0===o.tokens||(o.tokens--,0===o.tokens&&(null==(t=this.et)||t.call(this,e)),0===o.tokens)}stop(){this.tt={}}}var qv="Mobile",Kv="iOS",Gv="Android",Jv="Tablet",Qv=Gv+" "+Jv,Yv="iPad",Xv="Apple",Zv=Xv+" Watch",ef="Safari",tf="BlackBerry",rf="Samsung",nf=rf+"Browser",of=rf+" Internet",af="Chrome",sf=af+" OS",lf=af+" "+Kv,cf="Internet Explorer",df=cf+" "+qv,uf="Opera",hf=uf+" Mini",pf="Edge",vf="Microsoft "+pf,ff="Firefox",mf=ff+" "+Kv,gf="Nintendo",yf="PlayStation",bf="Xbox",xf=Gv+" "+qv,wf=qv+" "+ef,Sf="Windows",kf=Sf+" Phone",_f="Nokia",Cf="Ouya",Af="Generic",jf=Af+" "+qv.toLowerCase(),If=Af+" "+Jv.toLowerCase(),Pf="Konqueror",Rf="Oculus Browser",Tf="Vivaldi",Ef="Yandex",zf="Whale",Df="DuckDuckGo",Mf="Pale Moon",Lf="Waterfox",Of="Brave",Ff="Google Search App",Nf="(\\d+(\\.\\d+)?)",Bf=new RegExp("Version/"+Nf),Hf=new RegExp(bf,"i"),Wf=new RegExp(yf+" \\w+","i"),Vf=new RegExp(gf+" \\w+","i"),$f=new RegExp(tf+"|PlayBook|BB10","i"),Uf={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},qf=function(e,t,r,n){t=t||"";var o=function(e){return null!=e&&e.brave?Of:null}(r);return o||(null!=n&&n.detectGoogleSearchApp&&gv(e,"GSA/")?Ff:gv(e," OPR/")&&gv(e,"Mini")?hf:gv(e," OPR/")?uf:$f.test(e)?tf:gv(e,"IE"+qv)||gv(e,"WPDesktop")?df:gv(e,"OculusBrowser")?Rf:gv(e,nf)?of:gv(e,pf)||gv(e,"Edg/")?vf:gv(e,Tf+"/")?Tf:gv(e,"YaBrowser/")?Ef:gv(e,zf+"/")?zf:gv(e,Df+"/")||gv(e,"Ddg/")?Df:gv(e,"FBIOS")?"Facebook "+qv:gv(e,"UCWEB")||gv(e,"UCBrowser")?"UC Browser":gv(e,"CriOS")?lf:gv(e,"CrMo")||gv(e,af)?af:gv(e,Gv)&&gv(e,ef)?xf:gv(e,"FxiOS")?mf:gv(e.toLowerCase(),Pf.toLowerCase())?Pf:gv(e,Of+"/")?Of:((e,t)=>t&&gv(t,Xv)||function(e){return gv(e,ef)&&!gv(e,af)&&!gv(e,Gv)}(e))(e,t)?gv(e,qv)?wf:ef:gv(e,"PaleMoon/")?Mf:gv(e,Lf+"/")?Lf:gv(e,ff)?ff:gv(e,"MSIE")||gv(e,"Trident/")?cf:gv(e,"Gecko")?ff:"")},Kf={[df]:[new RegExp("rv:"+Nf)],[vf]:[new RegExp(pf+"?\\/"+Nf)],[af]:[new RegExp("("+af+"|CrMo)\\/"+Nf)],[lf]:[new RegExp("CriOS\\/"+Nf)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Nf)],[ef]:[Bf],[wf]:[Bf],[uf]:[new RegExp("(Opera|OPR)\\/"+Nf)],[ff]:[new RegExp(ff+"\\/"+Nf)],[mf]:[new RegExp("FxiOS\\/"+Nf)],[Pf]:[new RegExp("Konqueror[:/]?"+Nf,"i")],[tf]:[new RegExp(tf+" "+Nf),Bf],[xf]:[new RegExp("android\\s"+Nf,"i")],[of]:[new RegExp(nf+"\\/"+Nf)],[Rf]:[new RegExp("OculusBrowser\\/"+Nf)],[Tf]:[new RegExp(Tf+"\\/"+Nf)],[Ef]:[new RegExp("YaBrowser\\/"+Nf)],[zf]:[new RegExp(zf+"\\/"+Nf)],[Of]:[new RegExp(Of+"\\/"+Nf)],[Df]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Nf)],[Mf]:[new RegExp("PaleMoon\\/"+Nf)],[Lf]:[new RegExp(Lf+"\\/"+Nf)],[Ff]:[new RegExp("GSA\\/"+Nf)],[cf]:[new RegExp("(rv:|MSIE )"+Nf)],Mozilla:[new RegExp("rv:"+Nf)]},Gf=function(e,t,r,n){var o=qf(e,t,r,n),i=Kf[o];if(Iv(i))return null;for(var a=0;i.length>a;a++){var s=e.match(i[a]);if(s)return parseFloat(s[s.length-2])}return null},Jf=[[new RegExp(bf+"; "+bf+" (.*?)[);]","i"),e=>[bf,e&&e[1]||""]],[new RegExp(gf,"i"),[gf,""]],[new RegExp(yf,"i"),[yf,""]],[$f,[tf,""]],[new RegExp(Sf,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[kf,""];if(new RegExp(qv).test(t)&&!/IEMobile\b/.test(t))return[Sf+" "+qv,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=Uf[r[1]]||"";return/arm/i.test(t)&&(n="RT"),[Sf,n]}return[Sf,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[Kv,[e[3],e[4],e[5]||"0"].join(".")]:[Kv,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Iv(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+Gv+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Gv+")","i"),e=>e&&e[2]?[Gv,[e[2],e[3],e[4]||"0"].join(".")]:[Gv,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[sf,""]],[/Linux|debian/i,["Linux",""]]],Qf=function(e){return Vf.test(e)?gf:Wf.test(e)?yf:Hf.test(e)?bf:new RegExp(Cf,"i").test(e)?Cf:new RegExp("("+kf+"|WPDesktop)","i").test(e)?kf:/iPad/.test(e)?Yv:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Zv:$f.test(e)?tf:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(_f,"i").test(e)?_f:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(qv).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Gv:Qv:new RegExp("(pda|"+qv+")","i").test(e)?jf:new RegExp(Jv,"i").test(e)&&!new RegExp(Jv+" pc","i").test(e)?If:""},Yf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xf(e,t){return"string"==typeof(r=e)&&Yf.test(r)?e:t();var r}function Zf(e){return e?e.split("#")[0]:e}function em(e,t){var r=setTimeout(e,t);return(null==r?void 0:r.unref)&&(null==r||r.unref()),r}var tm=e=>e instanceof Error,rm={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},nm=rm.info;function om(e){if(Mv(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(_v(e))return{arrayValue:{values:e.map(e=>om(e))}};try{return{stringValue:JSON.stringify(e)}}catch(Mp){return{stringValue:String(e)}}}function im(e){var t=[];for(var r in e){var n=e[r];Tv(n)||Iv(n)||t.push({key:r,value:om(n)})}return t}function am(e,t){var r=rm[e.level||"info"]||nm,n=r.text,o=r.number,i=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),Ev(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),Ev(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var s=Yp({},a,e.attributes||{}),l={timeUnixNano:i,observedTimeUnixNano:i,severityNumber:o,severityText:n,body:{stringValue:e.body},attributes:im(s)};return e.trace_id&&(l.traceId=e.trace_id),e.span_id&&(l.spanId=e.span_id),Iv(e.trace_flags)||(l.flags=e.trace_flags),l}function sm(e,t,r){return Yp({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}function lm(e,t,r,n){return{resourceLogs:[{resource:{attributes:im(t)},scopeLogs:[{scope:{name:r,version:n},logRecords:e}]}]}}let cm=class{constructor(e,t,r,n,o,i,a){var s;void 0===i&&(i=()=>Promise.resolve()),this._instance=e,this.Te=t,this.it=r,this.ut=n,this.ht=o,this.dt=i,this.ct=a,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=t.maxBufferSize,this.kt=Math.max(null!==(s=t.maxQueueSize)&&void 0!==s?s:t.maxBufferSize,t.maxBufferSize),this.St=t.flushIntervalMs,this.Ct=t.maxBatchRecordsPerPost,this.It=t.rateCapWindowMs,this.Tt=t.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.Rt(e);if(null!==t)if(t.body){if(this.Pt()){var r={record:am(t,this.ut())};this.ht(()=>this.Ot(r))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(e){var t=this.Te.beforeSend;if(!t)return e;var r=_v(t)?t:[t],n=e;for(var o of r)try{var i=o(n);if(!i)return this.it.info("Log was rejected in beforeSend function"),null;n=i}catch(e){return this.it.error("Error in beforeSend function for log:",e),null}return n}Pt(){if(void 0===this.Tt)return!0;var e=Date.now(),t=e-this.bt;return this.It>t&&t>=0||(this.bt=e,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var e=this;return Qp(function*(){if(!e._instance.isDisabled)return e.vt||(e.vt=e.Ft().finally(()=>{e.vt=null})),e.vt})()}Ft(){var e=this;return Qp(function*(){var t;e.Mt();var r=null!==(t=e._instance.getPersistedProperty(ov.LogsQueue))&&void 0!==t?t:[];if(0!==r.length)for(var n=r.length,o=0;r.length>0&&n>o;){var i,a;e.ft=0;var s=Math.min(r.length,e.Ct),l=r.slice(0,s),c=lm(l.map(e=>e.record),e.Lt(),null!==(i=e.ct)&&void 0!==i?i:e._instance.getLibraryId(),e._instance.getLibraryVersion()),d=yield e._instance.$t(c);if("too-large"===d.kind&&l.length>1)e.Ct=Math.max(1,Math.floor(l.length/2)),e.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ct);else{if("retry-later"===d.kind)throw d.error;if("too-large"===d.kind?e.it.warn("Dropping a single log record after 413 with batch size 1 \u2014 the record is larger than the server cap and cannot be split further."):"ok"===d.kind&&e.Te.maxBatchRecordsPerPost>e.Ct&&(e.Ct=Math.min(e.Te.maxBatchRecordsPerPost,e.Ct+1)),yield e.At(l.length),r=null!==(a=e._instance.getPersistedProperty(ov.LogsQueue))&&void 0!==a?a:[],o+=l.length,"fatal"===d.kind)throw d.error}}})()}At(e){var t=this;return Qp(function*(){var r,n=Math.max(0,e-t.ft),o=null!==(r=t._instance.getPersistedProperty(ov.LogsQueue))&&void 0!==r?r:[];t._instance.setPersistedProperty(ov.LogsQueue,o.slice(n)),yield t.dt()})()}Lt(){return sm(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(e){var t;if(!this._instance.optedOut){var r=null!==(t=this._instance.getPersistedProperty(ov.LogsQueue))&&void 0!==t?t:[];this.kt>r.length||(r.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),r.push(e),this._instance.setPersistedProperty(ov.LogsQueue,r),this.xt>r.length?this.Nt():this.Et()}}Nt(e){void 0===e&&(e=this.St),this.Dt||(this.Dt=em(()=>{this.Dt=void 0,this.Et()},e))}qt(){var e=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,e)}jt(){var e=this._instance.getPersistedProperty(ov.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return Qp(function*(){t.Mt();var r=t.flush().catch(()=>{});void 0!==e?yield Promise.race([r,new Promise(t=>em(t,e))]):yield r})()}flushWithTimeout(e){var t=this;return Qp(function*(){var r=!1,n=t.flush(),o=new Promise(t=>em(()=>{r=!0,t()},e));try{yield Promise.race([n,o])}finally{r&&n.catch(()=>{})}})()}Et(){this.flush().then(()=>{this.yt=0},e=>{this.yt++,this.it.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())})}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var dm=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function um(e){return String(e)+"000000"}function hm(e,t,r,n){var o="";return n&&(o=Object.keys(n).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(n[e])).join(",")),e+"\0"+t+"\0"+(null!=r?r:"")+"\0"+o}let pm=class{constructor(e,t,r){this._instance=e,this.Te=t,this.it=r,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(e,t,r){void 0===t&&(t=1),this.Wt({name:e,type:"count",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}gauge(e,t,r){this.Wt({name:e,type:"gauge",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}histogram(e,t,r){this.Wt({name:e,type:"histogram",value:t,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes})}flush(){var e=this,t=this.vt,r=function(){var r=Qp(function*(){t&&(yield t.catch(()=>{})),yield e.Zt()});return function(){return r.apply(this,arguments)}}(),n=r().finally(()=>{this.vt===n&&(this.vt=null)});return this.vt=n,n}drainWindow(){if(0===this.Ht.size)return null;var e=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(e)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Rt(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.it.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var r,n;try{r=t.attributes?Yp({},t.attributes):void 0,n=hm(t.type,t.name,t.unit,r)}catch(e){return void this.it.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var o=this.Ht.get(n);if(!o){if(!this.Qt())return;o={name:t.name,type:t.type,unit:t.unit,attributes:r,windowStartMs:Date.now()},this.Ht.set(n,o)}var i=this.Ut.get(t.name);void 0===i?this.Ut.set(t.name,t.type):i===t.type||this.zt.has(t.name)||(this.zt.add(t.name),this.it.warn("Metric name '"+t.name+"' is already used as a "+i+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(o,t.value),this.Nt()}else this.it.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(e,t){var r;switch(e.type){case"count":e.total=(null!==(r=e.total)&&void 0!==r?r:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(dm.length+1).fill(0)});var n=e.hist;n.count+=1,n.sum+=t,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.bucketCounts[function(e,t){for(var r=0;t.length>r;r++)if(t[r]>=e)return r;return t.length}(t,dm)]+=1}}Rt(e){var t=this.Te.beforeSend;if(!t)return e;var r=_v(t)?t:[t],n=e;for(var o of r)try{var i=o(n);if(!i)return this.it.info("Metric was rejected in beforeSend function"),null;n=i}catch(e){return this.it.error("Error in beforeSend function for metric:",e),null}return n}Nt(){this.Dt||(this.Dt=em(()=>{this.Dt=void 0,this.flush().catch(e=>{this.it.error("Metrics flush failed:",e)})},this.Te.flushIntervalMs))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var e=this;return Qp(function*(){if(0!==e.Ht.size){var t=e.Ht;e.Ht=new Map,e.Bt=!1,e.Ut=new Map,e.zt=new Set;var r=e.Vt,n=yield e._instance.Kt(e.Gt(t));if(r===e.Vt)switch(n.kind){case"ok":return;case"retry-later":return e.Yt(t),void e.Nt();case"too-large":return void e.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.it.error("Failed to send metrics batch:",n.error)}}})()}Gt(e){return t=this.Xt(e),r=function(e,t,r){return Yp({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":r})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),n=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:im(r)},scopeMetrics:[{scope:{name:n,version:o},metrics:t}]}]};var t,r,n,o}Xt(e){var t=um(Date.now()),r=new Map;for(var n of e.values()){var o,i=hm(n.type,n.name,n.unit,void 0),a=r.get(i);a||(a=Yp({name:n.name},n.unit&&{unit:n.unit}),"count"===n.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===n.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},r.set(i,a));var s=im(null!==(o=n.attributes)&&void 0!==o?o:{}),l=um(n.windowStartMs);if("count"===n.type){var c,d={attributes:s,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!==(c=n.total)&&void 0!==c?c:0};a.sum.dataPoints.push(d)}else if("gauge"===n.type){var u,h={attributes:s,timeUnixNano:t,asDouble:null!==(u=n.last)&&void 0!==u?u:0};a.gauge.dataPoints.push(h)}else n.hist&&a.histogram.dataPoints.push({attributes:s,startTimeUnixNano:l,timeUnixNano:t,count:n.hist.count,sum:n.hist.sum,min:n.hist.min,max:n.hist.max,bucketCounts:n.hist.bucketCounts,explicitBounds:dm})}return Array.from(r.values())}Yt(e){var t,r;for(var n of e){var o=n[0],i=n[1],a=this.Ht.get(o);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,i.windowStartMs),a.type){case"count":a.total=(null!==(t=a.total)&&void 0!==t?t:0)+(null!==(r=i.total)&&void 0!==r?r:0);break;case"gauge":break;case"histogram":if(i.hist)if(a.hist){a.hist.count+=i.hist.count,a.hist.sum+=i.hist.sum,a.hist.min=Math.min(a.hist.min,i.hist.min),a.hist.max=Math.max(a.hist.max,i.hist.max);for(var s=0;a.hist.bucketCounts.length>s;s++)a.hist.bucketCounts[s]+=i.hist.bucketCounts[s]}else a.hist=i.hist}else this.Qt()&&this.Ht.set(o,i)}}};var vm,fm,mm;function gm(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return mm&&r.length===fm||(fm=r.length,mm=r.reduce((r,n)=>{vm||(vm={});var o=vm[n];if(o)r[o[0]]=o[1];else for(var i=e(n),a=i.length-1;a>=0;a--){var s=i[a],l=null==s?void 0:s.filename,c=t[n];if(l&&c){r[l]=c,vm[n]=[l,c];break}}return r},{})),mm}}class ym{constructor(e,t,r){void 0===r&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){void 0===t&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),o=this.buildParsingContext(t),i=this.parseStacktrace(n,o);return{$exception_list:this.convertToExceptionList(i,r),$exception_level:"error"}}modifyFrames(e){var t=this;return Qp(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&_v(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,n;return null!=e.cause&&(r=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),Yp({},e,{cause:r,stack:n})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return Qp(function*(){var r=e;for(var n of t.modifiers)r=yield n(r);return r})()}convertToExceptionList(e,t){var r,n,o,i={type:e.type,value:e.value,mechanism:{type:null!==(r=t.type)&&void 0!==r?r:"generic",handled:null===(n=t.handled)||void 0===n||n,synthetic:null!==(o=e.synthetic)&&void 0!==o&&o}};e.stack&&(i.stacktrace={type:"raw",frames:e.stack});var a=[i];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,Yp({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:gm(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,r){void 0===r&&(r=0);var n=(r,n)=>{if(4>=n){var o=this.buildCoercingContext(e,t,n);return this.applyCoercers(r,o)}};return Yp({},t,{syntheticException:0==r?t.syntheticException:void 0,mechanism:e,apply:e=>n(e,r),next:e=>n(e,r+1)})}}var bm="?";function xm(e,t,r,n,o){var i={platform:e,filename:t,function:""===r?bm:r,in_app:!0};return Iv(n)||(i.lineno=n),Iv(o)||(i.colno=o),i}var wm=(e,t)=>{var r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:bm,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Sm=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,km=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_m=/\((\S*)(?::(\d+))(?::(\d+))\)/,Cm=(e,t)=>{var r=Sm.exec(e);if(r)return xm(t,r[1],bm,+r[2],+r[3]);var n=km.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){var o=_m.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}var i=wm(n[1]||bm,n[2]);return xm(t,i[1],i[0],n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Am=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Im=(e,t)=>{var r=Am.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=jm.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var o=r[3],i=r[1]||bm,a=wm(i,o);return xm(t,o=a[1],i=a[0],r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pm=/\(error: (.*)\)/;class Rm{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=Pv(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Nv(e,"DOMException")}isDOMError(e){return Nv(e,"DOMError")}}class Tm{match(e){return(e=>e instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&"string"==typeof r.error.message?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class Em{constructor(){}match(e){return Nv(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}var zm=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Dm{match(e){return"string"==typeof e}coerce(e,t){var r,n=this.getInfos(e),o=n[0],i=n[1];return{type:null!=o?o:"Error",value:null!=i?i:e,stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(zm);return n&&(t=n[1],r=n[2]),[t,r]}}var Mm=["fatal","error","warning","log","info","debug"];function Lm(e,t){void 0===t&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var o=r.slice(0,n).join(", ");if(t>=o.length)return n===r.length?o:o.length>t?o.slice(0,t)+"...":o}return""}class Om{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Bv(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var r=this.getObjectClassName(e);return(r&&"Object"!==r?"'"+r+"'":"Object")+" captured as exception with keys: "+Lm(e)}isSeverityLevel(e){return Pv(e)&&!Rv(e)&&Mm.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(tm(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class Fm{match(e){return Bv(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+Lm(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Nm{match(e){return Fv(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}}}class Bm{match(e){return Nv(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Bv(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return Fv(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:null==(r=t.syntheticException)?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var Hm="$message",Wm="$timestamp",Vm=new Set([Hm,Wm]),$m={enabled:!0,max_bytes:32768};function Um(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:$m.enabled,max_bytes:Km(e.max_bytes,$m.max_bytes)}:Yp({},$m)}class qm{constructor(e){this.$e=[],this.ze=0,this.Te=Um(e)}setConfig(e){this.Te=Um(e),this.Ze()}add(e){var t=function(e){var t;try{t=xv(e)}catch(e){return}try{var r=JSON.parse(t);if(!Av(r))return;var n=r,o=n[Hm],i=n[Wm];if(!Pv(o)||0===o.trim().length)return;if(!Pv(i)&&!zv(i))return;return{step:n,json:t}}catch(e){return}}(e);if(t){var r=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),r=0,n=0;t.length>n;n++)"%"===t[n]?(r+=1,n+=2):r+=1;return r}(t.json);r>this.Te.max_bytes||(this.$e.push({step:t.step,bytes:r}),this.ze+=r,this.Ze())}}getAttachable(){return this.$e.map(e=>e.step)}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function Km(e,t){if(!zv(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var Gm=function(e,t){var r=(void 0===t?{}:t).debugEnabled,n={k(t){if(Dp&&(Gp.DEBUG||Dp.POSTHOG_DEBUG||r)&&!Iv(Dp.console)&&Dp.console){for(var n=("__rrweb_original__"in Dp.console[t]?Dp.console[t].__rrweb_original__:Dp.console[t]),o=arguments.length,i=new Array(o>1?o-1:0),a=1;o>a;a++)i[a-1]=arguments[a];n(e,...i)}},debug(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];n.k("error",...t)},critical(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];console.error(e,...r)},uninitializedWarning(e){n.error("You must initialize PostHog before calling "+e)},createLogger:(t,r)=>Gm(e+" "+t,r)};return n},Jm=Gm("[PostHog.js]"),Qm=Jm.createLogger,Ym=Qm("[ExternalScriptsLoader]"),Xm=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Ym.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=null==Op?void 0:Op.querySelectorAll("script");if(n)for(var o,i=function(){if(n[a].src===t){var e=n[a];return e.__posthog_loading_callback_fired?{v:r()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,r(void 0,t)}),e.onerror=e=>r(e),{v:void 0})}},a=0;n.length>a;a++)if(o=i())return o.v;var s=()=>{if(!Op)return r("document not found");var n=Op.createElement("script");if(n.type="text/javascript",n.crossOrigin="anonymous",n.src=t,n.onload=e=>{n.__posthog_loading_callback_fired=!0,r(void 0,e)},n.onerror=e=>r(e),e.config.prepare_external_dependency_script&&(n=e.config.prepare_external_dependency_script(n)),!n)return r("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)Op.head.appendChild(n);else{var o,i=Op.querySelectorAll("body > script");i.length>0?null==(o=i[0].parentNode)||o.insertBefore(n,i[0]):Op.body.appendChild(n)}};null!=Op&&Op.body?s():null==Op||Op.addEventListener("DOMContentLoaded",s)};qp.__PosthogExtensions__=qp.__PosthogExtensions__||{},qp.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if("remote-config"!==t){var n;if(e.config.strict_script_versioning)n=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var o="/static/"+t+".js?v="+e.version;if("toolbar"===t){var i=3e5;o=o+"&t="+Math.floor(Date.now()/i)*i}n=e.requestRouter.endpointFor("assets",o)}Xm(e,n,r)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Xm(e,a,r)}},qp.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{var n=e.requestRouter.endpointFor("api",t);Xm(e,n,r)};var Zm="1.407.2";Gp.DEBUG=!1,Gp.LIB_VERSION=Zm,Gp.LIB_NAME="web",Gp.JS_SDK_VERSION=Zm;var eg="$people_distinct_id",tg="$device_id",rg="$device_model",ng="__alias",og="__timers",ig="$autocapture_disabled_server_side",ag="$heatmaps_enabled_server_side",sg="$exception_capture_enabled_server_side",lg="$error_tracking_suppression_rules",cg="$error_tracking_capture_extension_exceptions",dg="$web_vitals_enabled_server_side",ug="$dead_clicks_enabled_server_side",hg="$product_tours_enabled_server_side",pg="$web_vitals_allowed_metrics",vg="$session_recording_remote_config",fg="$replay_sample_rate",mg="$replay_override_sampling",gg="$replay_override_linked_flag",yg="$replay_override_url_trigger",bg="$replay_override_event_trigger",xg="$sesid",wg="$session_is_sampled",Sg="$enabled_feature_flags",kg="$active_feature_flags",_g="$early_access_features",Cg="$feature_flag_details",Ag="$feature_flag_payloads",jg="$feature_flag_request_id",Ig="$minimal_flag_called_events",Pg="$override_feature_flags",Rg="$override_feature_flag_payloads",Tg="$stored_person_properties",Eg="$stored_group_properties",zg="$surveys",Dg="$surveys_loaded_at",Mg="$surveys_activated",Lg="$surveys_activated_session",Og="ph_product_tours",Fg="$flag_call_reported",Ng="$flag_call_reported_session_id",Bg="$feature_flag_errors",Hg="$feature_flag_evaluated_at",Wg="$user_state",Vg="$client_session_props",$g="$capture_rate_limit",Ug="$initial_campaign_params",qg="$initial_referrer_info",Kg="$initial_person_info",Gg="$epp",Jg="$posthog_cookieless",Qg="$cookieless_mode",Yg="$sdk_debug_extensions_init_method",Xg="$sdk_debug_extensions_init_time_ms",Zg="$sdk_debug_recording_script_not_loaded",ey="PostHog loadExternalDependency extension not found.",ty="on_reject",ry="always",ny="anonymous",oy="identified",iy="identified_only",ay="visibilitychange",sy="beforeunload",ly="$pageview",cy="$pageleave",dy="$identify",uy="$groupidentify";function hy(e,t){_v(e)&&e.forEach(t)}function py(e,t){if(!Ev(e))if(_v(e))e.forEach(t);else if((e=>e instanceof FormData)(e))e.forEach((e,r)=>t(e,r));else for(var r in e)Sv.call(e,r)&&t(e[r],r)}var vy=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var o of r)for(var i in o)void 0!==o[i]&&(e[i]=o[i]);return e};function fy(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}var my=function(e){try{return e()}catch(e){return}},gy=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,r)}catch(e){Jm.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Jm.critical(e)}}},yy=function(e){var t={};return py(e,function(e,r){(Pv(e)&&e.length>0||zv(e))&&(t[r]=e)}),t},by=["herokuapp.com","vercel.app","netlify.app"];function xy(e){var t=null==e?void 0:e.hostname;if(!Pv(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of by)if(r===n)return!1;return!0}function wy(e,t,r,n){var o=null!=n?n:{},i=o.capture,a=o.passive;null==e||e.addEventListener(t,r,{capture:void 0!==i&&i,passive:void 0===a||a})}function Sy(e){return"ph_toolbar_internal"===e.name}var ky=e=>{if(Op){try{for(var t=e+"=",r=Op.cookie.split(";").filter(e=>e.length),n=0;r.length>n;n++){for(var o=r[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return zv(e)&&isFinite(e)&&Math.floor(e)===e});class _y{constructor(e){if(this.bytes=e,16!==e.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,n){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||0>e||0>t||0>r||0>n||e>0xffffffffffff||t>4095||r>1073741823||n>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/256,o[5]=e,o[6]=112|t>>>8,o[7]=t,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=n>>>24,o[13]=n>>>16,o[14]=n>>>8,o[15]=n,new _y(o)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new _y(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(0!==r)return Math.sign(r)}return 0}}class Cy{generate(){var e=this.generateOrAbort();if(!Iv(e))return e;this.S=0;var t=this.generateOrAbort();if(Iv(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return _y.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new Iy}}var Ay,jy=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};Dp&&!Iv(Dp.crypto)&&crypto.getRandomValues&&(jy=e=>crypto.getRandomValues(e));class Iy{nextUint32(){return this.R.length>this.O||(jy(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Py=()=>Ry().toString(),Ry=()=>(Ay||(Ay=new Cy)).generate(),Ty="",Ey=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,zy={N:()=>!!Op,D(e){Jm.error("cookieStore error: "+e)},A:ky,F(e){var t;try{t=JSON.parse(zy.A(e))||{}}catch(e){}return t},q(e,t,r,n,o){if(!Op)return!1;try{var i="",a="",s=function(e,t){if(t){var r=function(e,t){if(void 0===t&&(t=Op),Ty)return Ty;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var r=e.split("."),n=Math.min(r.length,8),o="dmn_chk_"+Py();!Ty&&n--;){var i=r.slice(n).join("."),a=o+"=1;domain=."+i+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(o)&&(t.cookie=a+";max-age=0",Ty=i)}return Ty}(e);if(!r){var n=(e=>{var t=e.match(Ey);return t?t[0]:""})(e);n!==r&&Jm.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}(Op.location.hostname,n);if(r){var l=new Date;l.setTime(l.getTime()+864e5*r),i="; expires="+l.toUTCString()}o&&(a="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+s+a;return c.length>3686.4&&Jm.warn("cookieStore warning: large cookie, len="+c.length),Op.cookie=c,!0}catch(e){return!1}},P(e,t){if(null!=Op&&Op.cookie)try{zy.q(e,"",-1,t)}catch(e){return}}},Dy=null,My={N(){if(!Tv(Dy))return Dy;var e=!0;if(Iv(Dp))e=!1;else try{var t="__mplssupport__";My.q(t,"xyz"),'"xyz"'!==My.A(t)&&(e=!1),My.P(t)}catch(Dp){e=!1}return e||Jm.error("localStorage unsupported; falling back to cookie store"),Dy=e,e},D(e){Jm.error("localStorage error: "+e)},A(e){try{return null==Dp?void 0:Dp.localStorage.getItem(e)}catch(Dp){My.D(Dp)}return null},F(e){try{return JSON.parse(My.A(e))||{}}catch(e){}return null},q(e,t){try{return null==Dp||Dp.localStorage.setItem(e,JSON.stringify(t)),!0}catch(Dp){My.D(Dp)}return!1},P(e){try{null==Dp||Dp.localStorage.removeItem(e)}catch(Dp){My.D(Dp)}}},Ly=[tg,"distinct_id",xg,wg,Gg,Kg,Wg],Oy={},Fy={N:()=>!0,D(e){Jm.error("memoryStorage error: "+e)},A:e=>Oy[e]||null,F:e=>Oy[e]||null,q:(e,t)=>(Oy[e]=t,!0),P(e){delete Oy[e]}},Ny=null,By={N(){if(!Tv(Ny))return Ny;if(Ny=!0,Iv(Dp))Ny=!1;else try{var e="__support__";By.q(e,"xyz"),'"xyz"'!==By.A(e)&&(Ny=!1),By.P(e)}catch(Dp){Ny=!1}return Ny},D(e){Jm.error("sessionStorage error: ",e)},A(e){try{return null==Dp?void 0:Dp.sessionStorage.getItem(e)}catch(Dp){By.D(Dp)}return null},F(e){try{return JSON.parse(By.A(e))||null}catch(e){}return null},q(e,t){try{return null==Dp||Dp.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(Dp){By.D(Dp)}return!1},P(e){try{null==Dp||Dp.sessionStorage.removeItem(e)}catch(Dp){By.D(Dp)}}};class Hy{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===ry||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===ty}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Je.q(this.Ke,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.P(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var e=this._instance.config,t=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+t:"__ph_opt_in_out_"+t)}get Qe(){var e=this.Je.A(this.Ke);return Wv(e)?1:gv(Vv,e)?0:-1}get Je(){var e=this.Te.opt_out_capturing_persistence_type,t="localStorage"===e?My:zy;if(!this.Ye||this.Ye!==t){this.Ye=t;var r="localStorage"===e?zy:My;r.A(this.Ke)&&(this.Ye.A(this.Ke)||this.optInOut(Wv(r.A(this.Ke))),r.P(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[null==Lp?void 0:Lp.doNotTrack,null==Lp?void 0:Lp.msDoNotTrack,qp.doNotTrack].some(e=>Wv(e))}}function Wy(e,t){var r,n=null==e||null==(r=e.config)?void 0:r.get_current_url;if(!Cv(n))return t;try{var o=n(t);return Pv(o)&&o?o:t}catch(e){return Jm.error("Error in get_current_url, falling back to window.location.href",e),t}}var Vy="__POSTHOG_TOOLBAR__";function $y(e){return e instanceof Element&&(e.id===Vy||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function Uy(e){return!!e&&1===e.nodeType}function qy(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Ky(e){return!!e&&3===e.nodeType}function Gy(e){return!!e&&11===e.nodeType&&Uy(e.host)}function Jy(e){return e?yv(e).split(/\s+/):[]}function Qy(e,t){var r=function(e){var t,r=null==Dp||null==(t=Dp.location)?void 0:t.href;return Iv(r)?void 0:Wy(e,r)}(t);return!!(r&&e&&e.some(e=>r.match(e)))}function Yy(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Jy(t)}function Xy(e){return Ev(e)?null:yv(e).split(/(\s+)/).filter(e=>wb(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zy(e){var t="";return pb(e)&&!vb(e)&&e.childNodes&&e.childNodes.length&&py(e.childNodes,function(e){var r;Ky(e)&&e.textContent&&(t+=null!==(r=Xy(e.textContent))&&void 0!==r?r:"")}),yv(t)}function eb(e){var t;return Iv(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var tb=["a","button","form","input","select","textarea","label"];function rb(e,t){if(Iv(t))return!0;var r,n=function(e){if(t.some(t=>function(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!r&&r.call(e,t)}catch(e){return!1}}(e,t)))return{v:!0}};for(var o of e)if(r=n(o))return r.v;return!1}function nb(e){var t=e.parentNode;return!(!t||!Uy(t))&&t}var ob=[".ph-no-autocapture","[data-ph-no-autocapture]"],ib=["next","previous","prev",">","<"],ab=[...ib,"+","-","\u2212","\u2013"],sb=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,lb=[".ph-no-rageclick",".ph-no-capture"],cb=["","text","search","email","password","url","tel","number"];function db(e,t){if(!Dp||ub(e))return!1;var r,n,o,i,a;if(Mv(t)?(r=!!t&&lb,n=void 0,o=!1):(r=null!==(i=null==t?void 0:t.css_selector_ignorelist)&&void 0!==i?i:lb,n=null==t?void 0:t.content_ignorelist,o=null!==(a=null==t?void 0:t.ignore_text_selection)&&void 0!==a&&a),!1===r)return!1;if(o&&function(e){return!(!e||!Uy(e))&&(!!qy(e,"textarea")||(qy(e,"input")?gv(cb,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var s=hb(e,!1).targetElementList;return!function(e,t){if(!1===e||Iv(e))return!1;var r;if(!0===e)r=ib;else{if(!_v(e))return!1;if(e.length>10)return Jm.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;r=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,n=e.ariaLabel;return r.some(e=>sb(t,e)||sb(n,e))})}(n,s.map(e=>{var t;return{safeText:Zy(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rb(s,r)}var ub=e=>!e||qy(e,"html")||!Uy(e),hb=(e,t)=>{if(!Dp||ub(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],o=e;o.parentNode&&!qy(o,"body");)if(Gy(o.parentNode))n.push(o.parentNode.host),o=o.parentNode.host;else{var i=nb(o);if(!i)break;if(t||tb.indexOf(i.tagName.toLowerCase())>-1)r=!0;else try{var a=Dp.getComputedStyle(i);a&&"pointer"===a.getPropertyValue("cursor")&&(r=!0)}catch(Dp){}n.push(i),o=i}return{parentIsUsefulElement:r,targetElementList:n}};function pb(e){for(var t=new Set,r=0,n=e;n.parentNode&&!qy(n,"body");n=n.parentNode){if(r++>=1e3||t.has(n))return!1;t.add(n);var o=Yy(n);if(gv(o,"ph-sensitive")||gv(o,"ph-no-capture"))return!1}if(gv(Yy(e),"ph-include"))return!0;var i=e.type||"";if(Pv(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!Pv(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function vb(e){return!!(qy(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||qy(e,"select")||qy(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var fb="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",mb=new RegExp("^(?:"+fb+")$"),gb=new RegExp(fb),yb="\\d{3}-?\\d{2}-?\\d{4}",bb=new RegExp("^("+yb+")$"),xb=new RegExp("("+yb+")");function wb(e,t){if(void 0===t&&(t=!0),Ev(e))return!1;if(Pv(e)){if(e=yv(e),(t?mb:gb).test((e||"").replace(/[- ]/g,"")))return!1;if((t?bb:xb).test(e))return!1}return!0}function Sb(e){var t=Zy(e);return wb(t=(t+" "+kb(e)).trim())?t:""}function kb(e){var t="";return e&&e.childNodes&&e.childNodes.length&&py(e.childNodes,function(e){var r;if(e&&"span"===(null==(r=e.tagName)?void 0:r.toLowerCase()))try{var n=Zy(e);t=(t+" "+n).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+kb(e)).trim())}catch(e){Jm.error("[AutoCapture]",e)}}),t}function _b(e){return e.replace(/"|\\"/g,'\\"')}function Cb(e){var t=e.attr__class;if(t)return _v(t)?t:Jy(t)}var Ab=Qm("[Dead Clicks]"),jb=()=>!0,Ib=e=>{var t,r=!(null==(t=e.instance.persistence)||!t.get_property(ug)),n=e.instance.config.capture_dead_clicks;return Mv(n)?n:!!Av(n)||r};class Pb{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[ug]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr(()=>{this.er()}):this.stop()}tr(e){var t,r;null!=(t=qp.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?Ab.error("failed to load script",t):e()})}er(){var e;if(Op){if(!this.Xe&&null!=(e=qp.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Av(this.instance.config.capture_dead_clicks)?Yp({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Xe=qp.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Xe.start(Op),Ab.info("starting...")}}else Ab.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,Ab.info("stopping..."))}}var Rb=Qm("[SegmentIntegration]"),Tb="posthog-js";function Eb(e,t){var r=void 0===t?{}:t,n=r.organization,o=r.projectId,i=r.prefix,a=r.severityAllowList,s=void 0===a?["error"]:a,l=r.sendExceptionsToPostHog,c=void 0===l||l;return t=>{var r,a,l,d,u;if("*"!==s&&!s.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var h=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=h,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p,v=(null==(r=t.exception)?void 0:r.values)||[],f=v.map(e=>Yp({},e,{stacktrace:e.stacktrace?Yp({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>Yp({},e,{platform:"web:javascript"}))}):void 0})),m={$exception_message:(null==(a=v[0])?void 0:a.value)||t.message,$exception_type:null==(l=v[0])?void 0:l.type,$exception_level:t.level,$exception_list:f,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(d=v[0])?void 0:d.value)||t.message,$sentry_exception_type:null==(u=v[0])?void 0:u.type,$sentry_tags:t.tags};return n&&o&&(m.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+o+"&query="+t.event_id),c&&(null==(p=e.exceptions)||p.sendExceptionEvent(m)),t}}class zb{constructor(e,t,r,n,o,i){this.name=Tb,this.setupOnce=function(a){a(Eb(e,{organization:t,projectId:r,prefix:n,severityAllowList:o,sendExceptionsToPostHog:null==i||i}))}}}class Db{constructor(e){this.rr=(e,t,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(Jm.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:r}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.rr)}destroy(){var e;null==(e=this.sr)||e.call(this),this.sr=void 0}doPageView(e,t){var r,n=this.ar(e,t);return this.ir={pathname:null!==(r=null==Dp?void 0:Dp.location.pathname)&&void 0!==r?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this.ar(e,null==(t=this.ir)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ir)?void 0:e.pageViewId}}ar(e,t){var r=this.ir;if(!r)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var i=o.maxScrollHeight,a=o.lastScrollY,s=o.maxScrollY,l=o.maxContentHeight,c=o.lastContentY,d=o.maxContentY;if(!(Iv(i)||Iv(a)||Iv(s)||Iv(l)||Iv(c)||Iv(d))){i=Math.ceil(i),a=Math.ceil(a),s=Math.ceil(s),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d);var u=i>1?$v(a/i,0,1,Jm):1,h=i>1?$v(s/i,0,1,Jm):1,p=l>1?$v(c/l,0,1,Jm):1,v=l>1?$v(d/l,0,1,Jm):1;n=vy(n,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:u,$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:h,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:v})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}}var Mb=["flags","surveys"],Lb={[eg]:{exposure:"hidden"},[ng]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[og]:{exposure:"hidden"},[ig]:{exposure:"event"},[ag]:{exposure:"hidden"},[sg]:{exposure:"event"},[lg]:{exposure:"hidden"},[cg]:{exposure:"event"},[dg]:{exposure:"event"},[ug]:{exposure:"event"},[hg]:{exposure:"hidden"},[pg]:{exposure:"event"},[vg]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[xg]:{exposure:"hidden"},[wg]:{exposure:"event"},[fg]:{exposure:"event",shouldSkipFromEventProperties:e=>Tv(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[Sg]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Av(e))return{};for(var t={},r=Object.keys(e),n=0;r.length>n;n++)t["$feature/"+r[n]]=e[r[n]];return t}},[kg]:{exposure:"event",storageGroup:"flags"},[_g]:{exposure:"hidden"},[Cg]:{exposure:"hidden",storageGroup:"flags"},[Ag]:{exposure:"event",storageGroup:"flags"},[jg]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ig]:{exposure:"hidden",storageGroup:"flags"},[Pg]:{exposure:"event"},[Rg]:{exposure:"hidden"},[Tg]:{exposure:"hidden"},[Eg]:{exposure:"hidden"},[zg]:{exposure:"hidden",storageGroup:"surveys"},[Dg]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Mg]:{exposure:"event"},[Lg]:{exposure:"hidden"},[Og]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Fg]:{exposure:"hidden"},[Ng]:{exposure:"hidden"},[Bg]:{exposure:"hidden"},[Hg]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Wg]:{exposure:"hidden"},[Vg]:{exposure:"hidden"},[$g]:{exposure:"hidden"},[Ug]:{exposure:"hidden"},[qg]:{exposure:"hidden"},[Kg]:{exposure:"hidden"},[Gg]:{exposure:"hidden"},[mg]:{exposure:"event"},[gg]:{exposure:"event"},[yg]:{exposure:"event"},[bg]:{exposure:"event"},[Yg]:{exposure:"event"},[Xg]:{exposure:"event"},[Zg]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ob=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Fb=e=>{var t=Lb[e];if(t)return t;for(var r of Ob){var n=r[1];if(0===e.indexOf(r[0]))return n}},Nb=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return xv(e)}},Bb=e=>{var t=null==Op?void 0:Op.createElement("a");return Iv(t)?null:(t.href=e,t)},Hb=function(e,t){for(var r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),o=0;n.length>o;o++){var i=n[o].split("=");if(i[0]===t){r=i;break}}if(!_v(r)||2>r.length)return"";var a=r[1];try{a=decodeURIComponent(a)}catch(e){Jm.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Wb=function(e,t,r){if(!e||!t||!t.length)return e;for(var n=e.split("#"),o=n[1],i=(n[0]||"").split("?"),a=i[1],s=i[0],l=(a||"").split("&"),c=[],d=0;l.length>d;d++){var u=l[d].split("=");_v(u)&&(t.includes(u[0])?c.push(u[0]+"="+r):c.push(l[d]))}var h=s;return null!=a&&(h+="?"+c.join("&")),null!=o&&(h+="#"+o),h},Vb=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},$b=(e,t)=>e>=t&&$p(),Ub=(e,t,r,n)=>{if(0===e){if($p()){var o=t+1;return o===r&&n(),o}return t}return 0},qb="https?://(.*)",Kb=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Gb=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Kb],Jb="",Qb=["li_fat_id"];function Yb(e,t,r){if(!Op)return{};var n,o=t?[...Kb,...r||[]]:[],i=Xb(Wb(Op.URL,o,Jb),e),a=(n={},py(Qb,function(e){var t=ky(e);n[e]=t||null}),n);return vy(a,i)}function Xb(e,t){var r=Gb.concat(t||[]),n={};return py(r,function(t){var r=Hb(e,t);n[t]=r||null}),n}function Zb(e){var t=function(e){return e?0===e.search(qb+"google.([^/?]*)")?"google":0===e.search(qb+"bing.com")?"bing":0===e.search(qb+"yahoo.com")?"yahoo":0===e.search(qb+"duckduckgo.com")?"duckduckgo":null:null}(e),r="yahoo"!=t?"q":"p",n={};if(!Tv(t)){n.$search_engine=t;var o=Op?Hb(Op.referrer,r):"";o.length&&(n.ph_keyword=o)}return n}function ex(){return navigator.language||navigator.userLanguage}var tx="$direct";function rx(){return(null==Op?void 0:Op.referrer)||tx}function nx(e,t,r){void 0===r&&(r=!1);var n=e?[...Kb,...t||[]]:[],o=r?Zf(null==Fp?void 0:Fp.href):null==Fp?void 0:Fp.href,i=null==o?void 0:o.substring(0,1e3);return{r:rx().substring(0,1e3),u:i?Wb(i,n,Jb):void 0}}function ox(e,t){var r;void 0===t&&(t=!1);var n=e.r,o=e.u,i=t?Zf(o):o,a={$referrer:n,$referring_domain:null==n?void 0:n==tx?tx:null==(r=Bb(n))?void 0:r.host};if(i){a.$current_url=i;var s=Bb(i);a.$host=null==s?void 0:s.host,a.$pathname=null==s?void 0:s.pathname;var l=Xb(i);vy(a,l)}if(n){var c=Zb(n);vy(a,c)}return a}function ix(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(Dp){return}}function ax(){try{return(new Date).getTimezoneOffset()}catch(Dp){return}}var sx={flags:Hg,surveys:Dg},lx=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],cx="main";class dx{constructor(e,t,r){if(void 0===r&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Je=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&Jm.info("Persistence loaded",e.persistence,Yp({},this.props)),this.update_config(e,e,t),this.save(),Dp){var n=()=>this.flush();wy(Dp,"beforeunload",n,{capture:!1}),wy(Dp,"pagehide",n,{capture:!1})}}mr(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return zv(t)&&t>0?t:0}isDisabled(){return!!this.yr}pr(e){-1===lx.indexOf(e.persistence.toLowerCase())&&(Jm.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,r=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var r=[...Ly,...e];return Yp({},My,{F(e){try{var r={};try{r=zy.F(e)||{}}catch(e){}var n,o=JSON.parse(My.A(e)||"{}");if(t){var i={};for(var a in r){var s=r[a];Tv(s)||""===s||(i[a]=s)}n=vy(o,i)}else n=vy(r,o);return My.q(e,n),n}catch(e){}return null},q(e,t,n,o,i,a){var s=My.q(e,t,void 0,void 0,a);try{var l={};r.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&zy.q(e,l,n,o,i,a)}catch(e){My.D(e)}return s},P(e,t){try{null==Dp||Dp.localStorage.removeItem(e),zy.P(e,t)}catch(Dp){My.D(Dp)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),n=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&My.N()?(t=My,n=!0):"localstorage+cookie"===o&&r.N()?(t=r,n=!0):"sessionstorage"===o&&By.N()?t=By:"memory"===o?t=Fy:"cookie"===o?t=zy:r.N()?(t=r,n=!0):t=zy,this.ur=n,t}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var t=null!=e?e:this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[Hg];return!r||"number"!=typeof r||Date.now()-r>t}properties(){var e={};return py(this.props,(t,r)=>{var n=Fb(r);if("derived"===(null==n?void 0:n.exposure)){if(null!=n.shouldSkipFromEventProperties&&n.shouldSkipFromEventProperties(t,r===Sg?()=>this._r():()=>!1))return;n.transformToEventProperties&&vy(e,n.transformToEventProperties(t))}else if(!n||"event"===n.exposure){if(null!=n&&null!=n.shouldSkipFromEventProperties&&n.shouldSkipFromEventProperties(t,()=>!1))return;e[r]=t}}),e}load(){if(!this.yr){var e=this.Je.F(this.vr);e&&(this.props=vy({},e)),this.hr&&this.wr()}}wr(){for(var e of Mb){var t=My.F(this.br(e));if(t&&!jv(t)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(t,e)),this.Ir(e,t)||vy(this.props,t)}}}Sr(e){return Object.keys(this.props).some(t=>{var r;return(null==(r=Fb(t))?void 0:r.storageGroup)===e})}Ir(e,t){var r=sx[e];if(!r)return!1;var n=t[r],o=this.props[r];return zv(n)&&zv(o)&&o>n}refreshKey(e){var t;if(!this.yr){var r=this.hr?null==(t=Fb(e))?void 0:t.storageGroup:void 0,n=r?My.F(this.br(r)):this.Je.F(this.vr);if(n&&e in n)this.Tr(e,n[e]);else{if(r){var o=this.Je.F(this.vr);if(o&&e in o)return void this.Tr(e,o[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Iv(this.Er)&&(this.Er=setTimeout(()=>{this.Er=void 0,this.Rr()},e)):this.Rr()}}flush(){Iv(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,cx))}Pr(){var e=this.Fr(),t=e.main,r=e.groups;for(var n of(this.Or(this.Je,this.vr,t,cx),Mb)){var o,i=r[n];(!jv(i)||null!=(o=this.lr[n])&&o.persisted)&&this.Or(My,this.br(n),i,n)}}Fr(){var e={},t={flags:{},surveys:{}};return py(this.props,(r,n)=>{var o,i=null==(o=Fb(n))?void 0:o.storageGroup;i?t[i][n]=r:e[n]=r}),{main:e,groups:t}}Cr(e,t){if(t===cx)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return py(e,(e,t)=>{var n;r[t]=null!=(n=Fb(t))&&n.volatile?"__volatile__":e}),JSON.stringify(r)}Or(e,t,r,n){var o=this.kr(n);if(n===cx||o.dirty||Iv(o.fingerprint)){var i;try{if((i=this.Cr(r,n))===o.fingerprint)return void(o.dirty=!1)}catch(e){i=void 0}e.q(t,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(o.dirty=!1,n!==cx&&(o.persisted=!0),Iv(i)||(o.fingerprint=i)):this.Te.debug&&Jm.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,r=void 0!==t&&t;if(Iv(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.P(this.vr,!1),this.Je.P(this.vr,!0),!r&&this.dr)for(var n of Mb)My.P(this.br(n));r?delete this.lr[cx]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Av(e)){Iv(t)&&(t="None"),this.Lr=Iv(r)?this.Nr:r;var n=!1;if(py(e,(e,r)=>{this.props.hasOwnProperty(r)&&this.props[r]!==t||(this.Tr(r,e),n=!0)}),n)return this.save(),!0}return!1}register(e,t){if(Av(e)){this.Lr=Iv(t)?this.Nr:t;var r=!1;if(py(e,(t,n)=>{e.hasOwnProperty(n)&&this.props[n]!==t&&(this.Tr(n,t),r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=Yb(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);jv(yy(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=null==Op?void 0:Op.referrer)?Zb(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rx(),$referring_domain:null!=Op&&Op.referrer&&(null==(e=Bb(Op.referrer))?void 0:e.host)||tx},void 0)}set_initial_person_info(){this.props[Ug]||this.props[qg]||this.register_once({[Kg]:nx(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};py([qg,Ug],t=>{var r=this.props[t];r&&py(r,function(t,r){e["$initial_"+bv(r)]=t})});var t=this.props[Kg];if(t){var r=function(e,t){void 0===t&&(t=!1);var r=ox(e,t),n={};return py(r,function(e,t){n["$initial_"+bv(t)]=e}),n}(t,this.Te.disable_capture_url_hashes);vy(e,r)}return e}safe_merge(e){return py(this.props,function(t,r){r in e||(e[r]=t)}),e}update_config(e,t,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var n=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var r=[...e].sort(),n=[...t].sort();return r.every((e,t)=>e===n[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),o=n?this.pr(e):this.Je,i=this.gr(e);if(n||i!==this.hr){var a=this.props;this.clear(),this.Je=o,this.hr=i,this.props=a,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[og]||{};r[e]=t,this.Tr(og,r),this.save()}remove_event_timer(e){var t=this.props[og]||{},r=t[e];return Iv(r)||(delete t[e],this.Tr(og,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){var r;this.props[e]=t,null!=(r=Fb(e))&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var t,r=null==(t=Fb(e))?void 0:t.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var ux="events",hx="cancelEvents",px="popover",vx="api",fx="widget",mx="survey shown",gx="survey dismissed",yx="survey sent",bx="$survey_id",xx="$survey_iteration",wx="$survey_last_seen_date",Sx="popover",kx="inline",_x="product tour shown",Cx="$product_tour_last_seen_date",Ax="$product_tour_type",jx=Qm("[RateLimiter]");class Ix{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{jx.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void jx.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,n;void 0===e&&(e=!1);var o=this.captureEventsBurstLimit,i=this.captureEventsPerSecond,a=(new Date).getTime(),s=null!==(t=null==(r=this.instance.persistence)?void 0:r.get_property($g))&&void 0!==t?t:{tokens:o,last:a};s.tokens+=(a-s.last)/1e3*i,s.last=a,s.tokens>o&&(s.tokens=o);var l=1>s.tokens;return l||e||(s.tokens=Math.max(0,s.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+i+" events per second and "+o+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(n=this.instance.persistence)||n.set_property($g,s),{isRateLimited:l,remainingTokens:s.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()e(this.remoteConfig)):e()}jr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return Px.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Px.warn("Remote config is disabled. Falling back to local config.");this.qr(e=>{if(!e)return Px.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr(e=>{this.Hr(e),this.Br()});this.Hr(e),this.Br()})}catch(Dp){Px.error("Error loading remote config",Dp)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&Op&&"hidden"!==Op.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.zr=setInterval(()=>{this.refresh()},t))}}Hr(e){var t;e||Px.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var Tx="gzip-js",Ex="base64",zx=Uint8Array,Dx=Uint16Array,Mx=Uint32Array,Lx=new zx([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Ox=new zx([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Fx=new zx([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nx=function(e,t){for(var r=new Dx(31),n=0;31>n;++n)r[n]=t+=1<n;++n)for(var i=r[n];r[n+1]>i;++i)o[i]=i-r[n]<<5|n;return[r,o]},Bx=Nx(Lx,2),Hx=Bx[1];Bx[0][28]=258,Hx[258]=28;for(var Wx=Nx(Ox,0)[1],Vx=new Dx(32768),$x=0;32768>$x;++$x){var Ux=(43690&$x)>>>1|(21845&$x)<<1;Vx[$x]=((65280&(Ux=(61680&(Ux=(52428&Ux)>>>2|(13107&Ux)<<2))>>>4|(3855&Ux)<<4))>>>8|(255&Ux)<<8)>>>1}var qx=function(e,t,r){for(var n=e.length,o=0,i=new Dx(t);n>o;++o)++i[e[o]-1];var a,s=new Dx(t);for(o=0;t>o;++o)s[o]=s[o-1]+i[o-1]<<1;if(r){a=new Dx(1<o;++o)if(e[o])for(var c=o<<4|e[o],d=t-e[o],u=s[e[o]-1]++<=u;++u)a[Vx[u]>>>l]=c}else for(a=new Dx(n),o=0;n>o;++o)a[o]=Vx[s[e[o]-1]++]>>>15-e[o];return a},Kx=new zx(288);for($x=0;144>$x;++$x)Kx[$x]=8;for($x=144;256>$x;++$x)Kx[$x]=9;for($x=256;280>$x;++$x)Kx[$x]=7;for($x=280;288>$x;++$x)Kx[$x]=8;var Gx=new zx(32);for($x=0;32>$x;++$x)Gx[$x]=5;var Jx=qx(Kx,9,0),Qx=qx(Gx,5,0),Yx=function(e){return(e/8|0)+(7&e&&1)},Xx=function(e,t,r){(null==r||r>e.length)&&(r=e.length);var n=new(e instanceof Dx?Dx:e instanceof Mx?Mx:zx)(r-t);return n.set(e.subarray(t,r)),n},Zx=function(e,t,r){var n=t/8|0;e[n]|=r<<=7&t,e[n+1]|=r>>>8},ew=function(e,t,r){var n=t/8|0;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16},tw=function(e,t){for(var r=[],n=0;e.length>n;++n)e[n]&&r.push({s:n,f:e[n]});var o=r.length,i=r.slice();if(!o)return[new zx(0),0];if(1==o){var a=new zx(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort(function(e,t){return e.f-t.f}),r.push({s:-1,f:25001});var s=r[0],l=r[1],c=0,d=1,u=2;for(r[0]={s:-1,f:s.f+l.f,l:s,r:l};d!=o-1;)s=r[r[u].f>r[c].f?c++:u++],l=r[c!=d&&r[u].f>r[c].f?c++:u++],r[d++]={s:-1,f:s.f+l.f,l:s,r:l};var h=i[0].s;for(n=1;o>n;++n)i[n].s>h&&(h=i[n].s);var p=new Dx(h+1),v=rw(r[d-1],p,0);if(v>t){n=0;var f=0,m=v-t,g=1<n;++n){var y=i[n].s;if(t>=p[y])break;f+=g-(1<>>=m;f>0;){var b=i[n].s;t>p[b]?f-=1<=0&&f;--n){var x=i[n].s;p[x]==t&&(--p[x],++f)}v=t}return[new zx(p),v]},rw=function(e,t,r){return-1==e.s?Math.max(rw(e.l,t,r+1),rw(e.r,t,r+1)):t[e.s]=r},nw=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Dx(++t),n=0,o=e[0],i=1,a=function(e){r[n++]=e},s=1;t>=s;++s)if(e[s]==o&&s!=t)++i;else{if(!o&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(o),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(o);i=1,o=e[s]}return[r.subarray(0,n),t]},ow=function(e,t){for(var r=0,n=0;t.length>n;++n)r+=e[n]*t[n];return r},iw=function(e,t,r){var n=r.length,o=Yx(t+2);e[o]=255&n,e[o+1]=n>>>8,e[o+2]=255^e[o],e[o+3]=255^e[o+1];for(var i=0;n>i;++i)e[o+i+4]=r[i];return 8*(o+4+n)},aw=function(e,t,r,n,o,i,a,s,l,c,d){Zx(t,d++,r),++o[256];for(var u=tw(o,15),h=u[0],p=u[1],v=tw(i,15),f=v[0],m=v[1],g=nw(h),y=g[0],b=g[1],x=nw(f),w=x[0],S=x[1],k=new Dx(19),_=0;y.length>_;++_)k[31&y[_]]++;for(_=0;w.length>_;++_)k[31&w[_]]++;for(var C=tw(k,7),A=C[0],j=C[1],I=19;I>4&&!A[Fx[I-1]];--I);var P,R,T,E,z=c+5<<3,D=ow(o,Kx)+ow(i,Gx)+a,M=ow(o,h)+ow(i,f)+a+14+3*I+ow(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(D>=z&&M>=z)return iw(t,d,e.subarray(l,l+c));if(Zx(t,d,1+(D>M)),d+=2,D>M){P=qx(h,p,0),R=h,T=qx(f,m,0),E=f;var L=qx(A,j,0);for(Zx(t,d,b-257),Zx(t,d+5,S-1),Zx(t,d+10,I-4),d+=14,_=0;I>_;++_)Zx(t,d+3*_,A[Fx[_]]);d+=3*I;for(var O=[y,w],F=0;2>F;++F){var N=O[F];for(_=0;N.length>_;++_)Zx(t,d,L[B=31&N[_]]),d+=A[B],B>15&&(Zx(t,d,N[_]>>>5&127),d+=N[_]>>>12)}}else P=Jx,R=Kx,T=Qx,E=Gx;for(_=0;s>_;++_)if(n[_]>255){var B;ew(t,d,P[257+(B=n[_]>>>18&31)]),d+=R[B+257],B>7&&(Zx(t,d,n[_]>>>23&31),d+=Lx[B]);var H=31&n[_];ew(t,d,T[H]),d+=E[H],H>3&&(ew(t,d,n[_]>>>5&8191),d+=Ox[H])}else ew(t,d,P[n[_]]),d+=R[n[_]];return ew(t,d,P[256]),d+R[256]},sw=new Mx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lw=function(){for(var e=new Mx(256),t=0;256>t;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e}(),cw=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};var dw=!!Bp||!!Np,uw="text/plain",hw=!1,pw=(e,t)=>{var r=e.split("#"),n=r[1],o=r[0].split("?"),i=o[0],a=o[1];if(!a)return e;var s=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return i+(s?"?"+s:"")+(n?"#"+n:"")},vw=function(e,t,r){var n;void 0===r&&(r=!0);var o=e.split("?"),i=o[0],a=o[1],s=Yp({},t),l=null!==(n=null==a?void 0:a.split("&").map(e=>{var t,n=e.split("="),o=n[0],i=r&&null!==(t=s[o])&&void 0!==t?t:n[1];return delete s[o],o+"="+i}))&&void 0!==n?n:[],c=function(e,t){var r,n;void 0===t&&(t="&");var o=[];return py(e,function(e,t){Iv(e)||Iv(t)||"undefined"===t||(r=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r)}),o.join(t)}(s);return c&&l.push(c),l.length>0?i+"?"+l.join("&"):i},fw=e=>{if(e.Vr)return e.Vr;var t=e.data,r=e.compression;if(t){if(r===Tx){var n=function(e,t){void 0===t&&(t={});var r=function(){var e=4294967295;return{p(t){for(var r=e,n=0;t.length>n;++n)r=lw[255&r^t[n]]^r>>>8;e=r},d:()=>4294967295^e}}(),n=e.length;r.p(e);var o,i,a,s,l=(s=10+((o=t).filename&&o.filename.length+1||0),function(e,t,r,n){var o=e.length,i=new zx(n+o+5*(1+Math.floor(o/7e3))+8),a=i.subarray(n,i.length-8),s=0;if(!t||8>o)for(var l=0;o>=l;l+=65535){var c=l+65535;o>c?s=iw(a,s,e.subarray(l,c)):(a[l]=!0,s=iw(a,s,e.subarray(l,o)))}else{for(var d=sw[t-1],u=d>>>13,h=8191&d,p=(1<l;++l){var j=y(l),I=32767&l,P=f[j];if(v[I]=P,f[j]=I,l>=C){var R=o-l;if((S>7e3||_>24576)&&R>423){s=aw(e,a,0,b,x,w,k,_,A,l-A,s),_=S=k=0,A=l;for(var T=0;286>T;++T)x[T]=0;for(T=0;30>T;++T)w[T]=0}var E=2,z=0,D=h,M=I-P&32767;if(R>2&&j==y(l-M))for(var L=Math.min(u,R)-1,O=Math.min(32767,l),F=Math.min(258,R);O>=M&&--D&&I!=P;){if(e[l+E]==e[l+E-M]){for(var N=0;F>N&&e[l+N]==e[l+N-M];++N);if(N>E){if(E=N,z=M,N>L)break;var B=Math.min(M,N-2),H=0;for(T=0;B>T;++T){var W=l-M+T+32768&32767,V=W-v[W]+32768&32767;V>H&&(H=V,P=W)}}}M+=(I=P)-(P=v[I])+32768&32767}if(z){b[_++]=268435456|Hx[E]<<18|Wx[z];var $=31&Hx[E],U=31&Wx[z];k+=Lx[$]+Ox[U],++x[257+$],++w[U],C=l+E,++S}else b[_++]=e[l],++x[e[l]]}}s=aw(e,a,!0,b,x,w,k,_,A,l-A,s)}return Xx(i,0,n+Yx(s)+8)}(i=e,null==(a=t).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(i.length)))):12+a.mem,s)),c=l.length;return function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&cw(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;r.length>=n;++n)e[n+10]=r.charCodeAt(n)}}(l,t),cw(l,c-8,r.d()),cw(l,c-4,n),l}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new zx(e.length+(e.length>>>1)),n=0,o=function(e){r[n++]=e},i=0;t>i;++i){if(n+5>r.length){var a=new zx(n+8+(t-i<<1));a.set(r),r=a}var s=e.charCodeAt(i);128>s?o(s):2048>s?(o(192|s>>>6),o(128|63&s)):s>55295&&57344>s?(o(240|(s=65536+(1047552&s)|1023&e.charCodeAt(++i))>>>18),o(128|s>>>12&63),o(128|s>>>6&63),o(128|63&s)):(o(224|s>>>12),o(128|s>>>6&63),o(128|63&s))}return Xx(r,0,n)}(Nb(t)),{mtime:0});return{contentType:uw,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(r===Ex){var o=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(Nb(t)),i=(e=>"data="+encodeURIComponent("string"==typeof e?e:Nb(e)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=Nb(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},mw=e=>{var t,r,n=()=>"sendBeacon"===e.transport?{url:vw(e.url,{compression:Ex}),encodedBody:fw(Yp({},e,{compression:Ex,Vr:void 0}))}:{url:pw(e.url,"compression"),encodedBody:fw(Yp({},e,{compression:void 0,Vr:void 0}))};try{t=fw(e)}catch(t){if(dv(e.compression,Hb(e.url,"compression")))return Jm.error("Failed to gzip request body, sending uncompressed payload",t),n();throw t}return t&&dv(e.compression,Hb(e.url,"compression"))&&!((r=t.body)instanceof ArrayBuffer?cv(new Uint8Array(r)):ArrayBuffer.isView(r)&&cv(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(hw=!0,n()):{url:e.url,encodedBody:t}},gw=e=>{try{return mw(e)}catch(Mp){return Jm.error(Mp),void(null==e.callback||e.callback({statusCode:0,error:Mp}))}},yw=function(){var e=Qp(function*(e){var t=Nb(e.data),r=yield function(e,t,r){return vv.apply(this,arguments)}(t,Gp.DEBUG,{rethrow:!0});if(!r)return e;var n=yield r.arrayBuffer();return Yp({},e,{Vr:{contentType:uw,body:n,estimatedSize:n.byteLength}})});return function(t){return e.apply(this,arguments)}}(),bw=/Failed to fetch|NetworkError|Load failed/i,xw=e=>{var t=gw(e);if(t){var r=t.url,n=t.encodedBody,o=null!=n?n:{},i=o.contentType,a=o.body,s=o.estimatedSize,l=new Headers;py(e.headers,function(e,t){l.append(t,e)}),i&&l.append("Content-Type",i);var c=null,d=!1;if(Hp){var u=new Hp;c={signal:u.signal,timeout:setTimeout(()=>{var t,r;d=!0,u.abort((t=e.timeout,(r=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",r))},e.timeout)}}var h=t=>{d&&"AbortError"===(null==t?void 0:t.name)||(e=>"TypeError"===(null==e?void 0:e.name)&&bw.test((null==e?void 0:e.message)||""))(t)?Jm.warn(t):Jm.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var p;Np(r,Yp({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&!e.Wr&&52428.8>(s||0),body:a,signal:null==(p=c)?void 0:p.signal},e.fetchOptions)).then(t=>t.text().then(r=>{var n={statusCode:t.status,text:r};if(200===t.status)try{n.json=JSON.parse(r)}catch(e){Jm.error(e)}null==e.callback||e.callback(n)})).catch(h).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),h(e)}}},ww=e=>{try{var t=mw(e),r=t.url,n=t.encodedBody,o=null!=n?n:{},i=o.body,a=o.estimatedSize;if(!i)return;var s=i instanceof Blob?i:new Blob([i],{type:o.contentType});if(Lp.sendBeacon(r,s))return;if(_v(e.data)&&e.data.length>1&&(null!=a?a:0)>16384){var l=Math.ceil(e.data.length/2);return ww(Yp({},e,{data:e.data.slice(0,l)})),void ww(Yp({},e,{data:e.data.slice(l)}))}Jm.warn("Beacon of ~"+(null!=a?a:0)+" bytes was rejected by the browser, falling back to fetch"),xw(Yp({},e,{Wr:!0}))}catch(e){Jm.warn("Beacon send failed",e)}},Sw=["/e/","/s/"],kw=(e,t,r,n)=>{var o=(e=>{var t=(e=>{var t=Bb(e),r=(null==t?void 0:t.pathname)||e.split(/[?#]/)[0];return r?"/"===r[0]?r:"/"+r:"/"})(e);return Sw.some(e=>((e,t)=>e.slice(e.length-t.length)===t)(t,e))})(e),i=o?pw(e,"ver"):e,a="query"===n?"POST"===t?"sent_at":"_":void 0;return vw(r===Tx?pw(i,"compression"):i,Yp({},a?{[a]:Date.now().toString()}:{},o?{}:{ver:Gp.JS_SDK_VERSION},r===Tx?{}:{compression:r}))},_w=[];Np&&_w.push({transport:"fetch",method:xw}),Bp&&_w.push({transport:"XHR",method(e){var t=gw(e);if(t){var r=new Bp,n=t.encodedBody;r.open(e.method||"GET",t.url,!0);var o=null!=n?n:{},i=o.contentType,a=o.body;py(e.headers,function(e,t){r.setRequestHeader(t,e)}),i&&r.setRequestHeader("Content-Type",i),e.timeout&&(r.timeout=e.timeout),r.onreadystatechange=()=>{if(4===r.readyState){var t={statusCode:r.status,text:r.responseText};if(200===r.status)try{t.json=JSON.parse(r.responseText)}catch(e){}null==e.callback||e.callback(t)}},r.send(a)}}}),null!=Lp&&Lp.sendBeacon&&_w.push({transport:"sendBeacon",method:ww});var Cw=3e3;class Aw{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=$v((null==t?void 0:t.flush_interval_ms)||Cw,250,5e3,Jm.createLogger("flush interval"),Cw),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ei(Yp({},e,{transport:"sendBeacon"}))})}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout(()=>{if(this.Xr(),this.Gr.length>0){var t=this.ti(),r=function(){var r=t[n],o=(new Date).getTime();r.data&&_v(r.data)&&py(r.data,e=>{e.offset=Math.abs(e.timestamp-o),delete e.timestamp}),e.ei(r)};for(var n in t)r()}},this.Qr))}ei(e){try{this.Jr(e)}catch(e){Jm.error(e)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return py(this.Gr,t=>{var r,n=t,o=(n?n.batchKey:null)||n.url;Iv(e[o])&&(e[o]=Yp({},n,{data:[]})),null==(r=e[o].data)||r.push(n.data)}),this.Gr=[],e}}var jw=["retriesPerformedSoFar"];class Iw{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Iv(Dp)&&"onLine"in Dp.navigator&&(this.ni=Dp.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},wy(Dp,"online",this.si),wy(Dp,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,r=Xp(e,jw);Dv(t)&&(r.url=vw(r.url,{retry_count:t})),this._instance._send_request(Yp({},r,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.Ot(Yp({retriesPerformedSoFar:t},r));0===e.statusCode&&Jm.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==r.callback||r.callback(e)}}))}Ot(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(e){var t=3e3*Math.pow(2,e),r=t/2,n=Math.min(18e5,t),o=Math.random()-.5;return Math.ceil(n+o*(n-r))}(t),n=Date.now()+r;this.Gr.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),Jm.warn(o),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout(()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()},this.ii)}oi(){var e=Date.now(),t=[],r=this.Gr.filter(r=>e>r.retryAt||(t.push(r),!1));if(this.Gr=t,r.length>0)for(var n of r)this.retriableRequest(n.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Iv(Dp)||(this.si&&(Dp.removeEventListener("online",this.si),this.si=void 0),this.ai&&(Dp.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(Yp({},t,{transport:"sendBeacon"}))}catch(Dp){Jm.error(Dp)}}this.Gr=[]}}class Pw{constructor(e){this.hi=()=>{var e,t,r,n;this.di||(this.di={});var o=this.scrollElement(),i=this.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,s=i+((null==o?void 0:o.clientHeight)||0),l=(null==o?void 0:o.scrollHeight)||0;this.di.lastScrollY=Math.ceil(i),this.di.maxScrollY=Math.max(i,null!==(e=this.di.maxScrollY)&&void 0!==e?e:0),this.di.maxScrollHeight=Math.max(a,null!==(t=this.di.maxScrollHeight)&&void 0!==t?t:0),this.di.lastContentY=s,this.di.maxContentY=Math.max(s,null!==(r=this.di.maxContentY)&&void 0!==r?r:0),this.di.maxContentHeight=Math.max(l,null!==(n=this.di.maxContentHeight)&&void 0!==n?n:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){wy(Dp,"scroll",this.hi,{capture:!0}),wy(Dp,"scrollend",this.hi,{capture:!0}),wy(Dp,"resize",this.hi)}scrollElement(){if(!this.ci)return null==Dp?void 0:Dp.document.documentElement;var e=_v(this.ci)?this.ci:[this.ci];for(var t of e){var r=null==Dp?void 0:Dp.document.querySelector(t);if(r)return r}}vi(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[t]||0}return Dp?"y"===e?Dp.scrollY||Dp.pageYOffset||Dp.document.documentElement.scrollTop||0:Dp.scrollX||Dp.pageXOffset||Dp.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var Rw=e=>nx(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class Tw{constructor(e,t,r,n){this.fi=e=>{var t=this.pi();if(!t||t.sessionId!==e){var r={sessionId:e,props:this.gi(this._instance)};this.mi.register({[Vg]:r})}},this._instance=e,this.yi=t,this.mi=r,this.gi=n||Rw,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Vg]}getSetOnceProps(){var e,t=null==(e=this.pi())?void 0:e.props;return t?"r"in t?ox(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return py(yy(this.getSetOnceProps()),(t,r)=>{"$current_url"===r&&(r="url"),e["$session_entry_"+bv(r)]=t}),e}}class Ew{on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter(e=>e!==t)}}emit(e,t){for(var r of this.bi[e]||[])r(t);for(var n of this.bi["*"]||[])n(e,t)}constructor(){this.bi={}}}var zw=Qm("[SessionId]");class Dw{on(e,t){return this.wi.on(e,t)}constructor(e,t,r){var n;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new Ew,this.Ii=(e,t)=>!(!Dv(e)||!Dv(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===ry)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||Py,this.Ri=r||Py;var o=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*$v(this.Te.session_idle_timeout_seconds||1800,60,36e3,zw.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+o+"_window_id",this.Fi="ph_"+o+"_primary_window_exists",this.Li()){var i=By.F(this.Oi),a=By.F(this.Fi);i&&!a?this.Ti=i:By.P(this.Oi),By.q(this.Fi,!0)}if(null!=(n=this.Te.bootstrap)&&n.sessionID)try{var s=(()=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),s)}catch(e){zw.error("Invalid sessionID in bootstrap",e)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Iv(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter(t=>t!==e)}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&By.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&By.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?By.F(this.Oi):null}qi(e){var t=this.xi;return!Tv(t)&&!Tv(e)&&5e3>Math.abs(e-t)}$i(e,t,r){var n=t!==this._sessionActivityTimestamp,o=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Mi=e,o&&!n||o&&this.qi(t)||(this.xi=t,this.mi.register({[xg]:[t,e,r]}))}ji(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return Dv(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(xg):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!Tv(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[xg]:[this._sessionActivityTimestamp,null!==(e=this.Mi)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=Dv(e)?e:0,r=Dv(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[xg];return _v(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&Dp&&(Dp.removeEventListener(sy,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&By.P(this.Fi)},wy(Dp,sy,this.Si,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Te.cookieless_mode===ry)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||(new Date).getTime(),n=this.Ui(),o=n[1],i=n[2],a=this.zi(),s=this.Di(),l=Dv(i)&&Math.abs(r-i)>864e5,c=!1,d=!1,u=!o,h=o,p=!u&&!e&&this.Ii(r,a);if(p){(p=this.Vi(r))||zw.info("cross-tab refresh kept the session alive",{sessionId:o});var v=this.Ui();o=v[1],i=v[2]}u||p||l?(o=this.Ei(),s=this.Ri(),zw.info("new session ID generated",{sessionId:o,windowId:s,changeReason:{noSessionId:u,activityTimeout:p,sessionPastMaximumLength:l}}),i=r,c=!0):(s||(s=this.Ri(),c=!0),(d=o!==h)&&(zw.info("adopted cross-tab session id",{sessionId:o,windowId:s}),c=!0));var f=Dv(a)&&e&&!l?a:r,m=Dv(i)?i:(new Date).getTime();this.Ni(s),this.$i(o,f,m),e||this.Pi();var g={noSessionId:u,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:d};return c&&this.ki.forEach(e=>e(o,s,g)),{sessionId:o,windowId:s,sessionStartTimestamp:m,changeReason:c?g:void 0,lastActivityTimestamp:a}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout(()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()},1.1*this.sessionTimeoutMs))}}var Mw=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&mv(r,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some(e=>mv(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function Lw(){return(Lw=Qp(function*(){var e=null==Lp?void 0:Lp.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),r=null==t?void 0:t.model;return Pv(r)&&r.length>0?r:void 0}catch(e){return void Jm.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var Ow=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function Fw(e,t,r){return Nb({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Nw={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>Ow(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Ow(t,e))),icontains:(e,t)=>t.map(Bw).some(t=>e.map(Bw).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Bw).every(t=>e.map(Bw).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>r>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var r=parseFloat(t);return!isNaN(r)&&e.some(e=>re.toLowerCase();function Hw(e,t){return!e||Object.entries(e).every(e=>{var r=e[1],n=null==t?void 0:t[e[0]];if(Iv(n)||Tv(n))return!1;var o=[String(n)],i=Nw[r.operator];return!!i&&i(r.values,o)})}var Ww="custom",Vw="i.posthog.com",$w=/^\/static\//;class Uw{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Vw,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ww),this.Zi[this.apiHost]}Gi(e){if($w.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var r=this.Gi(t);if(r)return""+r+t}if(this.region===Ww)return this.apiHost+t;var n=Vw+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}}function qw(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var Kw=Qm("[Surveys]"),Gw="seenSurvey_",Jw=e=>{try{var t=(e=>((e,t)=>""+Gw+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){Kw.error("Failed to persist survey seen state",e)}},Qw=[px,fx,vx],Yw={ignoreConditions:!1,ignoreDelay:!1,displayType:Sx},Xw=Qm("[PostHog ExternalIntegrations]"),Zw={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class eS{constructor(e){this._instance=e}tr(e,t){var r;null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,e,e=>{if(e)return Xw.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(){var t,n,o,i=r[0],a=r[1];!a||null!=(t=qp.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[i]||e.tr(Zw[i],()=>{var t;null==(t=qp.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[i])||t.start(e._instance)}),!a&&null!=(n=qp.__PosthogExtensions__)&&null!=(n=n.integrations)&&n[i]&&(null==(o=qp.__PosthogExtensions__)||null==(o=o.integrations)||null==(o=o[i])||o.stop())};for(var r of Object.entries(null!==(n=this._instance.config.integrations)&&void 0!==n?n:{})){var n;t()}}}var tS={},rS=0,nS=()=>{},oS='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',iS="Surveys module not available",aS="sanitize_properties is deprecated. Use before_send instead",sS="Invalid value for property_denylist config: ",lS=["token","distinct_id",Qg],cS="posthog",dS=!dw&&-1===(null==Vp?void 0:Vp.indexOf("MSIE"))&&-1===(null==Vp?void 0:Vp.indexOf("Mozilla")),uS=e=>{var t;return Yp({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:xy(null==Op?void 0:Op.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nS,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:Fp&&Pv(null==Fp?void 0:Fp.search)&&-1!==Fp.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==Dp||null==(t=Dp.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){Jm.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:iy,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Cw},error_tracking:{},_onCapture:nS},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:ab,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},hS=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],pS=e=>{var t={};for(var r of hS){var n=r[0],o=r[1];Iv(e[n])||(t[o]=e[n])}var i=vy({},t,e),a=e.__preview_external_dependency_versioned_paths;return Iv(a)||(Iv(e.strict_script_versioning)&&(i.strict_script_versioning=!!a),Pv(a)&&Iv(e.asset_host)&&(i.asset_host=a)),_v(e.property_blacklist)&&(Iv(e.property_denylist)?i.property_denylist=e.property_blacklist:_v(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:Jm.error(sS+e.property_denylist)),i};class vS{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){Jm.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class fS{Ji(e,t){if(e){var r=this.Ki.indexOf(e);-1!==r&&this.Ki.splice(r,1)}return this.Ki.push(t),null==t.initialize||t.initialize(),t}Yi(){return this.config.cookieless_mode===ry||this.config.cookieless_mode===ty&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){var e;this.webPerformance=new vS,this.Xi=!1,this.version=Gp.LIB_VERSION,this.tn=new Ew,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=uS(),this.SentryIntegration=zb,this.sentryIntegration=e=>function(e,t){var r=Eb(e,t);return{name:Tb,processEvent:e=>r(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Pw(this),this.pageViewManager=new Db(this),this.rateLimiter=new Ix(this),this.requestRouter=new Uw(this),this.consent=new Hy(this),this.externalIntegrations=new eS(this);var t=null!==(e=fS.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,r)=>{var n=Pv(e)?{[e]:t}:e;this.setPersonProperties(n),null==r||r({})},set_once:(e,t,r)=>{var n=Pv(e)?{[e]:t}:e;this.setPersonProperties(void 0,n),null==r||r({})}},this.on("eventCaptured",e=>Jm.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,r){if(r&&r!==cS){var n,o=null!==(n=tS[r])&&void 0!==n?n:new fS;return o._init(e,t,r),tS[r]=o,tS[cS][r]=o,o}return this._init(e,t,r)}_init(e,t,r){var n,o;void 0===t&&(t={});var i=Pv(e)?e.trim():"";if(!i)return Jm.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=uS(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var a=uS(t.defaults),s=pS(t),l=vy({},a,s,{name:r,token:i});Av(a.rageclick)&&Av(s.rageclick)&&(l.rageclick=vy({},a.rageclick,s.rageclick)),Av(a.session_recording)&&Av(s.session_recording)&&(l.session_recording=vy({},a.session_recording,s.session_recording)),this.set_config(l),this.config.on_xhr_error&&Jm.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Tx;var c=this.hn();this.persistence=new dx(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dx(Yp({},this.config,{persistence:"sessionStorage"}),c,!1);var d=Yp({},this.persistence.props),u=Yp({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.dn=new Aw(e=>this.cn(e),this.config.request_queue_config),this.vn=new Iw(this),this.__request_queue=[];var h=this.Yi();if(h||(this.sessionManager=new Dw(this),this.sessionPropsManager=new Tw(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(Jm.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.fn(h)},0)):(Jm.info("Initializing extensions synchronously"),this.fn(h)),Gp.DEBUG=Gp.DEBUG||this.config.debug,Gp.DEBUG&&Jm.info("Starting in debug mode",{this:this,config:t,thisC:Yp({},this.config),p:d,s:u}),!this.config.identity_distinct_id||null!=(n=t.bootstrap)&&n.distinctID||(t.bootstrap=Yp({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var p=t.bootstrap.distinctID,v=this.get_distinct_id(),f=this.persistence.get_property(Wg);if(t.bootstrap.isIdentifiedID&&null!=v&&v!==p&&f===ny)this.identify(p);else if(t.bootstrap.isIdentifiedID&&null!=v&&v!==p&&f===oy)Jm.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(Py()),g=t.bootstrap.isIdentifiedID?m:p;this.persistence.set_property(Wg,t.bootstrap.isIdentifiedID?oy:ny),this.register({distinct_id:p,$device_id:g})}}if(h)this.register_once({distinct_id:Jg,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(Py());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(Wg,ny)}return wy(Dp,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var r=e.config.segment;if(!r)return t();!function(e,t){var r=e.config.segment;if(!r)return t();var n=r=>{var n=()=>r.anonymousId()||Py();e.config.get_device_id=n,r.id()&&(e.register({distinct_id:r.id(),$device_id:n()}),e.persistence.set_property(Wg,oy)),t()},o=r.user();"then"in o&&Cv(o.then)?o.then(n):n(o)}(e,()=>{r.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Rb.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,r)=>{if(!r)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Rb.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Rb.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var n=e.calculateEventProperties(r,t.event.properties);return t.event.properties=Object.assign({},n,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,ly),identify:e=>t(e,dy),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.pn()):this.pn(),Cv(this.config._onCapture)&&this.config._onCapture!==nS&&(Jm.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&Jm.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Lw.apply(this,arguments)}().then(e=>{e&&this.register({[rg]:e})}).catch(nS),this}fn(e){var t,r,n,o,i,a,s,l,c=performance.now(),d=Yp({},fS.__defaultExtensionClasses,this.config.__extensionClasses),u=[];d.featureFlags&&this.Ki.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new d.featureFlags(this)),d.exceptions&&this.Ki.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new d.exceptions(this)),d.historyAutocapture&&this.Ki.push(this.historyAutocapture=new d.historyAutocapture(this)),d.tracingHeaders&&this.Ki.push(this.tracingHeaders=new d.tracingHeaders(this)),d.siteApps&&this.Ki.push(this.siteApps=new d.siteApps(this)),d.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new d.sessionRecording(this)),this.config.disable_scroll_properties||u.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),d.autocapture&&this.Ki.push(this.autocapture=new d.autocapture(this)),d.surveys&&this.Ki.push(this.surveys=null!==(n=this.surveys)&&void 0!==n?n:new d.surveys(this)),d.logs&&this.Ki.push(this.logs=null!==(o=this.logs)&&void 0!==o?o:new d.logs(this)),d.metrics&&this.Ki.push(this.metrics=null!==(i=this.metrics)&&void 0!==i?i:new d.metrics(this)),d.conversations&&this.Ki.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new d.conversations(this)),d.productTours&&this.Ki.push(this.productTours=new d.productTours(this)),d.heatmaps&&this.Ki.push(this.heatmaps=new d.heatmaps(this)),d.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new d.webVitalsAutocapture(this)),d.exceptionObserver&&this.Ki.push(this.exceptionObserver=new d.exceptionObserver(this)),d.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new d.deadClicksAutocapture(this,Ib)),d.toolbar&&this.Ki.push(this.toolbar=null!==(s=this.toolbar)&&void 0!==s?s:new d.toolbar(this)),d.experiments&&this.Ki.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new d.experiments(this)),this.Ki.forEach(e=>{e.initialize&&u.push(()=>{null==e.initialize||e.initialize()})}),u.push(()=>{if(this.gn){var e=this.gn;this.gn=void 0,this.Hr(e)}}),this.mn(u,c)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.mn(e,t)},0);var r=e.shift();if(r)try{r()}catch(e){Jm.error("Error initializing extension:",e)}}var n=Math.round(performance.now()-t);this.register_for_session({[Yg]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Xg]:n}),this.config.__preview_deferred_init_extensions&&Jm.info("PostHog extensions initialized ("+n+"ms)")}Hr(e){if(!Op||!Op.body)return Jm.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Hr(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var t,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=gv(r.supportedCompression,Tx)?Tx:gv(r.supportedCompression,Ex)?Ex:void 0),null!=(t=r.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:iy}),this.Ki.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}pn(){try{this.config.loaded(this)}catch(e){Jm.critical("`loaded` function failed",e)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=Fp&&Fp.hostname){var e=Fp.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()},1),this.wn=new Rx(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.dn)||e.enable())}_dom_loaded(){this.is_capturing()&&hy(this.__request_queue,e=>this.cn(e)),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,r,n,o;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(cy),null==(r=this.logs)||r.flushLogs("sendBeacon"),null==(n=this.dn)||n.unload(),null==(o=this.vn)||o.unload()):this.xn()&&this.capture(cy,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?dS?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=Yp({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Iv(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,r,n,o=Yp({},e);o.timeout=o.timeout||6e4;var i=null!==(t=o.transport)&&void 0!==t?t:"fetch";"sendBeacon"===i&&Iv(o.compression)&&o.data&&(o.compression=Ex),"body"===o.timestampMode&&"POST"===o.method&&o.data&&!_v(o.data)&&(o.data=Yp({},o.data,{sent_at:(new Date).toISOString()})),o.url=kw(o.url,o.method,o.compression,o.timestampMode);var a=_w.filter(e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)),s=null!==(r=null==(n=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===i)return e[t]}(a))?void 0:n.method)&&void 0!==r?r:a[0].method;if(!s)throw new Error("No available transport method");"sendBeacon"!==i&&o.data&&o.compression===Tx&&Wp&&"undefined"!=typeof Promise&&!hw?yw(o).then(e=>{s(e)}).catch(t=>{if(uv(t))return hw=!0,void s(Yp({},o,{compression:void 0,url:kw(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return uv(e)||t===lv})(t)&&(hw=!0),s(o)}):s(o)})(Yp({},e,{callback:t=>{var r,n;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(r=(n=this.config).on_request_error)||r.call(n,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){rS++;try{var t,r=[],n=[],o=[];hy(e,e=>{if(e)if(_v(t=e[0]))o.push(e);else if(Cv(e))try{e.call(this)}catch(t){Jm.error("Error executing queued PostHog call",e,t)}else _v(e)&&"alias"===t?r.push(e):_v(e)&&-1!==t.indexOf("capture")&&Cv(this[t])?o.push(e):n.push(e)});var i=function(e,t){hy(e,function(e){try{if(_v(e[0])){var r=t;py(e,function(e){r=r[e[0]].apply(r,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){Jm.error("Error executing queued PostHog call",e,t)}})};i(r,this),i(n,this),i(o,this)}finally{rS--}}push(e){if(rS>0&&_v(e)&&Pv(e[0])){var t=fS.prototype[e[0]];Cv(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,r){var n,o,i,a,s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Iv(e)&&Pv(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var c=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==c||!c.isRateLimited){null!=t&&t.$current_url&&!Pv(null==t?void 0:t.$current_url)&&(Jm.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=r&&r.kn||Jm.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,u=(null==r?void 0:r.timestamp)||d,h=Xf(null==r?void 0:r.uuid,Py),p={uuid:h,event:e,properties:this.calculateEventProperties(e,t||{},u,h)};e===ly&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),c&&(p.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var v="$feature_flag_called"===e&&!1===p.properties.$feature_flag_has_experiment&&!0===this.get_property(Ig);(null==r?void 0:r.$set)&&!v&&(p.$set=null==r?void 0:r.$set);var f=null==r?void 0:r.$unset;f&&(p.$unset=f);var m,g,y,b=v?void 0:this.Sn(null==r?void 0:r.$set_once,e!==uy,e===dy);if(b&&(p.$set_once=b),null!=r&&r._noTruncate||(o=this.config.properties_string_max_length,i=p,a=e=>Pv(e)?e.slice(0,o):e,s=new Set,p=function e(t,r){if(t!==Object(t))return a?a(t):t;if(!s.has(t)){var n;if(s.add(t),_v(t))n=[],hy(t,t=>{n.push(e(t))});else{var o={};py(t,(t,r)=>{s.has(t)||(o[r]=e(t,r))}),n=o}return n}}(i)),p.timestamp=u,Iv(null==r?void 0:r.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=d),v&&(p.properties=function(e,t){void 0===t&&(t=[]);var r={},n=t=>{void 0!==e[t]&&(r[t]=e[t])};return nv.forEach(n),t.forEach(n),r}(p.properties,lS)),e===gx||e===yx){var x=null==t?void 0:t[bx],w=null==t?void 0:t[xx];Jw({id:x,current_iteration:w}),p.$set=Yp({},p.$set,{[(m={id:x,current_iteration:w},g=e===yx?"responded":"dismissed",y="$survey_"+g+"/"+m.id,m.current_iteration&&m.current_iteration>0&&(y="$survey_"+g+"/"+m.id+"/"+m.current_iteration),y)]:!0})}else e===mx&&(p.$set=Yp({},p.$set,{[wx]:(new Date).toISOString()}));if(e===_x){var S=null==t?void 0:t[Ax];S&&(p.$set=Yp({},p.$set,{[Cx+"/"+S]:(new Date).toISOString()}))}var k=Yp({},p.properties.$set,p.$set);if(jv(k)||this.setPersonPropertiesForFlags(k),!Ev(this.config.before_send)){var _=this.Rt(p);if(!_)return;(p=_).uuid=Xf(p.uuid,Py)}this.tn.emit("eventCaptured",p);var C={method:"POST",url:null!==(n=null==r?void 0:r._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",timestampMode:"query",batchKey:null==r?void 0:r._batchKey,transport:null==r?void 0:r.transport};return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?this.cn(C):this.dn.enqueue(C),p}Jm.critical("This capture call is ignored due to client rate limiting.")}}else Jm.error("No event name provided to posthog.capture")}else Jm.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,n,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var i=o?void 0:this.persistence.remove_event_timer(e),a=Yp({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Yi()&&(a[Qg]=!0),"$snapshot"===e){var s=Yp({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=s.distinct_id,(!Pv(a.distinct_id)&&!zv(a.distinct_id)||Rv(a.distinct_id))&&Jm.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var l,c=function(e,t,r,n){var o,i,a,s;if(void 0===n&&(n=!1),!Vp)return{};var l,c=e?[...Kb,...t||[]]:[],d=function(e){for(var t=0;Jf.length>t;t++){var r=Jf[t],n=r[1],o=r[0].exec(e),i=o&&(Cv(n)?n(o,e):n);if(i)return i}return["",""]}(Vp),u=d[0],h=d[1],p=null!=(l="undefined"!=typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},v={};Iv(r)||(v.detectGoogleSearchApp=r);var f={},m=null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,g=null==(i=navigator)?void 0:i.maxTouchPoints,y=null==Dp||null==(a=Dp.screen)?void 0:a.width,b=null==Dp||null==(s=Dp.screen)?void 0:s.height,x=null==Dp?void 0:Dp.devicePixelRatio;Iv(m)||(f.userAgentDataPlatform=m),Iv(g)||(f.maxTouchPoints=g),Iv(y)||(f.screenWidth=y),Iv(b)||(f.screenHeight=b),Iv(x)||(f.devicePixelRatio=x);var w,S,k,_,C,A,j,I,P=vy(yy({$os:u,$os_version:h,$browser:qf(Vp,navigator.vendor,p,v),$device:Qf(Vp),$device_type:(S=Vp,k=f,I=Qf(S),I===Yv||I===Qv||"Kobo"===I||"Kindle Fire"===I||I===If?Jv:I===gf||I===bf||I===yf||I===Cf?"Console":I===Zv?"Wearable":I?qv:"Android"===(null==k?void 0:k.userAgentDataPlatform)&&(null!==(_=null==k?void 0:k.maxTouchPoints)&&void 0!==_?_:0)>0?600>Math.min(null!==(C=null==k?void 0:k.screenWidth)&&void 0!==C?C:0,null!==(A=null==k?void 0:k.screenHeight)&&void 0!==A?A:0)/(null!==(j=null==k?void 0:k.devicePixelRatio)&&void 0!==j?j:1)?qv:Jv:"Desktop"),$timezone:ix(),$timezone_offset:ax()}),{$current_url:Wb(n?Zf(null==Fp?void 0:Fp.href):null==Fp?void 0:Fp.href,c,Jb),$host:null==Fp?void 0:Fp.host,$pathname:null==Fp?void 0:Fp.pathname,$raw_user_agent:Vp.length>1e3?Vp.substring(0,997)+"...":Vp,$browser_version:Gf(Vp,navigator.vendor,p,v),$browser_language:ex(),$browser_language_prefix:(w=ex(),"string"==typeof w?w.split("-")[0]:void 0),$screen_height:null==Dp?void 0:Dp.screen.height,$screen_width:null==Dp?void 0:Dp.screen.width,$viewport_height:null==Dp?void 0:Dp.innerHeight,$viewport_width:null==Dp?void 0:Dp.innerWidth,$lib:Gp.LIB_NAME,$lib_version:Gp.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return Gp.SDK_DIST_CHANNEL&&(P.$sdk_dist_channel=Gp.SDK_DIST_CHANNEL),P}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var d=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime()),u=d.windowId;a.$session_id=d.sessionId,a.$window_id=u}this.sessionPropsManager&&vy(a,this.sessionPropsManager.getSessionProps());try{var h;this.sessionRecording&&vy(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=null==(h=this.vn)?void 0:h.length}catch(Dp){a.$sdk_debug_error_capturing_properties=String(Dp)}if(this.requestRouter.region===Ww&&(a.$lib_custom_api_host=this.config.api_host),l=e!==ly||o?e!==cy||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,n),a=vy(a,l),e===ly&&Op&&(a.title=Op.title),!Iv(i)){var p=r.getTime()-i;a.$duration=parseFloat((p/1e3).toFixed(3))}Vp&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");var v=this.persistence.properties(),f=this.sessionPersistence.properties();py(["$referrer","$referring_domain"],e=>{e in v&&delete f[e]}),(a=vy({},c,v,f,a)).$is_identified=this._isIdentified(),_v(this.config.property_denylist)?py(this.config.property_denylist,function(e){delete a[e]}):Jm.error(sS+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Jm.error(aS),a=m(a,e));var g=this.Cn();return a.$process_person_profile=g,g&&!o&&this.In("_calculate_event_properties"),a}Sn(e,t,r){var n;if(void 0===t&&(t=!0),void 0===r&&(r=!1),!this.persistence||!this.Cn())return e;if(this.Xi&&!r)return e;var o=this.persistence.get_initial_props(),i=null==(n=this.sessionPropsManager)?void 0:n.getSetOnceProps(),a=vy({},o,i||{},e||{}),s=this.config.sanitize_properties;return s&&(Jm.error(aS),a=s(a,"$set_once")),t&&(this.Xi=!0),jv(a)?void 0:a}register(e,t){var r;null==(r=this.persistence)||r.register(e,t)}register_once(e,t,r){var n;null==(n=this.persistence)||n.register_once(e,t,r)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Tn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return null==(r=this.featureFlags)?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var r,n;return null!==(r=null==(n=this.featureFlags)?void 0:n.isFeatureEnabled(e,t))&&void 0!==r?r:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,r){var n;null==(n=this.featureFlags)||n.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var n;null==(n=this.featureFlags)||n.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var n;return void 0===t&&(t=!1),null==(n=this.featureFlags)?void 0:n.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.tn.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:iS}),()=>{})}onSessionId(e){var t,r;return null!==(t=null==(r=this.sessionManager)?void 0:r.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:iS})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:iS})}renderSurvey(e,t){var r;null==(r=this.surveys)||r.renderSurvey(e,t)}displaySurvey(e,t){var r;void 0===t&&(t=Yw),null==(r=this.surveys)||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return null!==(t=null==(r=this.surveys)?void 0:r.canRenderSurvey(e))&&void 0!==t?t:{visible:!1,disabledReason:iS}}canRenderSurveyAsync(e,t){var r,n;return void 0===t&&(t=!1),null!==(r=null==(n=this.surveys)?void 0:n.canRenderSurveyAsync(e,t))&&void 0!==r?r:Promise.resolve({visible:!1,disabledReason:iS})}Mn(e){return!e||Rv(e)?(Jm.critical("Unique user id has not been set in posthog.identify"),!1):e===Jg?(Jm.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(Jm.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return Jm.uninitializedWarning("posthog.identify");if(zv(e)&&(e=e.toString(),Jm.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var n=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tg)||this.register_once({$had_persisted_distinct_id:!0,$device_id:n},""),e!==n&&e!==this.get_property(ng)&&(this.unregister(ng),this.register({distinct_id:e}));var o,i=(this.persistence.get_property(Wg)||ny)===ny;e!==n&&i?(this.persistence.set_property(Wg,oy),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(dy,{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:r||{}}),this.sn=Fw(e,t,r),null==(o=this.featureFlags)||o.setAnonymousDistinctId(n)):(t||r)&&this.setPersonProperties(t,r),e!==n&&(this.reloadFeatureFlags(),this.unregister(Fg))}}setPersonProperties(e,t){if((e||t)&&this.In("posthog.setPersonProperties")){var r=Fw(this.get_distinct_id(),e,t);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=r):Jm.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(_v(e)?e:[e]).filter(e=>Pv(e)&&e.length>0);0!==r.length&&this.In("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,t,r){if(e&&t){var n=this.getGroups(),o=n[e]!==t;if(o&&this.resetGroupPropertiesForFlags(e),this.register({$groups:Yp({},n,{[e]:t})}),o||r){var i={$group_type:e,$group_key:t};r&&(i.$group_set=r),this.capture(uy,i)}r&&this.setGroupPropertiesForFlags({[e]:r}),o&&!r&&this.reloadFeatureFlags()}else Jm.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),null==(r=this.featureFlags)||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;void 0===t&&(t=!0),this.In("posthog.setGroupPropertiesForFlags")&&(null==(r=this.featureFlags)||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,n,o,i,a,s,l,c,d;if(Jm.info("reset"),!this.__loaded)return Jm.uninitializedWarning("posthog.reset");var u,h=this.get_property(tg),p=this.get_property(rg),v=this.get_property(vg);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(r=this.sessionPersistence)||r.clear(),Iv(v)||null==(u=this.persistence)||u.register({[vg]:v}),null==(n=this.surveys)||n.reset(),null==(o=this.wn)||o.stop(),null==(i=this.featureFlags)||i.reset(),null==(a=this.conversations)||a.reset(),null==(s=this.logs)||s.reset(),null==(l=this.metrics)||l.reset(),null==(c=this.persistence)||c.set_property(Wg,ny),null==(d=this.sessionManager)||d.resetSessionId(),this.sn=null,this.config.cookieless_mode===ry)this.register_once({distinct_id:Jg,$device_id:null},"");else{var f=this.config.get_device_id(Py());this.register_once({distinct_id:f,$device_id:e?f:h},""),e||Iv(p)||this.register({[rg]:p})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return Qp(function*(){var e,r,n,o,i;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(r=t.metrics)||r.flush("sendBeacon"),null==(n=t.dn)||n.unload(),null==(o=t.vn)||o.unload(),null==(i=t.featureFlags)||i.destroy()):Jm.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(r=this.conversations)||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!==(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.sessionStartTimestamp,n=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&r){var o,i=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return n;n+="?t="+Math.max(Math.floor(((new Date).getTime()-r)/1e3)-i,0)}return n}alias(e,t){return e===this.get_property(eg)?(Jm.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(Iv(t)&&(t=this.get_distinct_id()),e!==t?(this.Tn(ng,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(Jm.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=Yp({},this.config);if(Av(e)){var r,n,o,i,a,s,l,c,d,u,h;vy(this.config,pS(e));var p=this.hn();null==(r=this.persistence)||r.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new dx(Yp({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.an(this.config.debug);Mv(v)&&(this.config.debug=v),Mv(this.config.debug)&&(this.config.debug?(Gp.DEBUG=!0,My.N()&&My.q("ph_debug",!0),Jm.info("set_config",{config:e,oldConfig:t,newConfig:Yp({},this.config)})):(Gp.DEBUG=!1,My.N()&&My.P("ph_debug"))),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(s=this.autocapture)||s.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(u=this.surveys)||u.loadIfEnabled(),this.Pn(),null==(h=this.externalIntegrations)||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){Gp.LIB_NAME=e,Gp.LIB_VERSION=t}startSessionRecording(e){var t,r,n,o,i,a=!0===e,s={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(s).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),s.sampling&&(null==(r=this.sessionRecording)||r.overrideSampling()),s.linked_flag&&(null==(n=this.sessionRecording)||n.overrideLinkedFlag()),s.url_trigger&&(null==(o=this.sessionRecording)||o.overrideTrigger("url")),s.event_trigger&&(null==(i=this.sessionRecording)||i.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var r=new Error("PostHog syntheticException"),n=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(Yp({},n,t))}}addExceptionStep(e,t){var r;null==(r=this.exceptions)||r.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:fS.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return null!==(t=null==(r=this.toolbar)?void 0:r.loadToolbar(e))&&void 0!==t&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:cS;return t!==cS&&(t=cS+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(Wg))===oy||(null==(t=this.sessionPersistence)?void 0:t.get_property(Wg))===oy}Cn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iy&&!this._isIdentified()&&jv(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ng])&&(null==(t=this.persistence)||null==(t=t.props)||!t[Gg]))}xn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Cn()||this.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return"never"===this.config.person_profiles?(Jm.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(Gg,!0),!0)}hn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ty)}Pn(){var e,t,r,n,o=this.hn();return(null==(e=this.persistence)?void 0:e.yr)!==o&&(null==(r=this.persistence)||r.set_disabled(o)),(null==(t=this.sessionPersistence)?void 0:t.yr)!==o&&(null==(n=this.sessionPersistence)||n.set_disabled(o)),o}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==ry){if(this.Yi()){var r,n,o,i,a;this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new Dw(this),this.pageViewManager=new Db(this),this.persistence&&(this.sessionPropsManager=new Tw(this,this.sessionManager,this.persistence));var s,l=null!==(o=null==(i=this.config.__extensionClasses)?void 0:i.sessionRecording)&&void 0!==o?o:null==(a=fS.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.Ji(this.sessionRecording,new l(this)),this.yn&&(null==(s=this.sessionRecording)||null==s.onRemoteConfig||s.onRemoteConfig(this.yn)))}var c,d;this.consent.optInOut(!0),this.Pn(),this.bn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==ty&&(null==(c=this.surveys)||c.loadIfEnabled()),(Iv(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(d=null==e?void 0:e.captureEventName)&&void 0!==d?d:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else Jm.warn(oS)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==ry?(this.config.cookieless_mode===ty&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===ty&&(this.register({distinct_id:Jg,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):Jm.warn(oS)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===ry||(this.config.cookieless_mode===ty?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return Lp?Mw(Lp,this.config.custom_blocked_useragents):void 0}_n(){Op&&("visible"===Op.visibilityState?this.en||(this.en=!0,this.capture(ly,{title:Op.title},{send_instantly:!0}),this.rn&&(Op.removeEventListener(ay,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),wy(Op,ay,this.rn)))}debug(e){!1===e?(null==Dp||Dp.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==Dp||Dp.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(Jm.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,r,n,o){var i=t in e&&!Ev(e[t]),a=r in e&&!Ev(e[r]);return i?e[t]:!!a&&(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[r])}(e,"advanced_disable_flags","advanced_disable_decide",0,Jm)}Rt(e){var t;if(Ev(this.config.before_send))return e;var r=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(Ov),n=_v(this.config.before_send)?this.config.before_send:[this.config.before_send],o=e;for(var i of n){if(o=i(o),Ev(o)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Lv(e.event)?Jm.warn(a+". This can cause unexpected behavior."):Jm.info(a),null}o.properties&&!jv(o.properties)||Jm.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var s of r)if(o.properties&&Ev(o.properties[s]))return Jm.warn("Event '"+e.event+"' had its '"+s+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return o}getPageViewId(){var e;return null==(e=this.pageViewManager.ir)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}an(e){var t=Mv(e)&&!e,r=My.N()&&"true"===My.A("ph_debug");return!t&&(!!r||e)}}fS.__defaultExtensionClasses={},fS.On=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=gy(e.prototype[t[r]])}(fS,["identify"]);class mS{constructor(e){this.disabled=!1===e;var t=Av(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)r-n.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var gS="$copy_autocapture",yS=Qm("[AutoCapture]");function bS(e,t){return t.length>e?t.slice(0,e)+"...":t}function xS(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!Uy(t));return t}var wS=Qm("[ExceptionAutocapture]"),SS=()=>{},kS=Qm("[TracingHeaders]"),_S=Qm("[Web Vitals]"),CS=9e5,AS="disabled",jS="lazy_loading",IS="awaiting_config",PS="missing_config";Qm("[SessionRecording]"),Qm("[SessionRecording]");var RS="[SessionRecording]",TS=Qm(RS),ES=Qm("[Heatmaps]");function zS(e){return Av(e)&&"clientX"in e&&"clientY"in e&&zv(e.clientX)&&zv(e.clientY)}var DS=Qm("[Product Tours]"),MS=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(hg))},LS=["$set_once","$set"],OS=Qm("[SiteApps]"),FS="Error while initializing PostHog app with config id ";function NS(e,t,r){if(Ev(e))return!1;switch(r){case"exact":return e===t;case"contains":var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class BS{constructor(e){this.Fn=new Ew,this.Ln=(e,t)=>this.$n(e,t)&&this.An(e,t)&&this.Nn(e,t)&&this.Dn(e,t),this.$n=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;Iv(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,r;if(!Iv(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,r;null==(t=this.jn)||t.add(e),null==(r=e.steps)||r.forEach(e=>{var t;null==(t=this.qn)||t.add((null==e?void 0:e.event)||"")})}),null!=(r=this._instance)&&r.autocapture)){var n,o=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&o.add(null==e?void 0:e.selector)})}),null==(n=this._instance)||n.autocapture.setElementSelectors(o)}}on(e,t){var r;null!=t&&0!=e.length&&(this.qn.has(e)||this.qn.has(t.event))&&this.jn&&(null==(r=this.jn)?void 0:r.size)>0&&this.jn.forEach(e=>{this.Hn(t,e)&&this.Fn.emit("actionCaptured",e.name)})}Bn(e){this.onAction("actionCaptured",t=>e(t))}Hn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var r of t.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}An(e,t){if(null!=t&&t.url){var r,n=null==e||null==(r=e.properties)?void 0:r.$current_url;if(!n||"string"!=typeof n)return!1;if(!NS(n,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var r;if(null==t||!t.href)return!0;var n=this.Wn(e);if(n.length>0)return n.some(e=>NS(e.href,t.href,t.href_matching||"exact"));var o,i=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!i&&NS((o=i.match(/(?::|")href="(.*?)"/))?o[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var r;if(null==t||!t.text)return!0;var n=this.Wn(e);if(n.length>0)return n.some(e=>NS(e.text,t.text,t.text_matching||"exact")||NS(e.$el_text,t.text,t.text_matching||"exact"));var o,i,a,s=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!s&&(o=function(e){for(var t,r=[],n=/(?::|")text="(.*?)"/g;!Ev(t=n.exec(e));)r.includes(t[1])||r.push(t[1]);return r}(s),i=t.text,a=t.text_matching||"exact",o.some(e=>NS(e,i,a)))}Vn(e,t){var r,n;if(null==t||!t.selector)return!0;var o=null==e||null==(r=e.properties)?void 0:r.$element_selectors;if(null!=o&&o.includes(t.selector))return!0;var i=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";if(t.selector_regex&&i)try{return new RegExp(t.selector_regex).test(i)}catch(e){return!1}return!1}Wn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Dn(e,t){return null==t||!t.properties||0===t.properties.length||Hw(t.properties.reduce((e,t)=>{var r=_v(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:r,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class HS{constructor(e){var t;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.Kn(e))}Yn(e,t){return!!e&&Hw(e.propertyFilters,null==t?void 0:t.properties)}Xn(e,t){var r=new Map;return e.forEach(e=>{var n;null==(n=e.conditions)||null==(n=n[t])||null==(n=n.values)||n.forEach(t=>{if(null!=t&&t.name){var n=r.get(t.name)||[];n.push(e.id),r.set(t.name,n)}})}),r}ts(e,t,r){var n=(r===ux?this.Gn:this.Qn).get(e),o=[];return this.es(e=>{o=e.filter(e=>null==n?void 0:n.includes(e.id))}),o.filter(n=>{var o,i=null==(o=n.conditions)||null==(o=o[r])||null==(o=o.values)?void 0:o.find(t=>t.name===e);return this.Yn(i,t)})}register(e){var t;Iv(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var t=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0});0!==t.length&&(null==this.ss&&(this.ss=new BS(this._instance),this.ss.init(),this.ss.Bn(e=>{this.onAction(e)})),t.forEach(e=>{var t,r,n,o,i;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(r=e.conditions)&&null!=(r=r.actions)&&r.values&&(null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)?void 0:n.length)>0&&(null==(o=this.ss)||o.register(e.conditions.actions.values),null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||i.forEach(t=>{if(t&&t.name){var r=this.Jn.get(t.name);r&&r.push(e.id),this.Jn.set(t.name,r||[e.id])}}))}))}rs(e){var t,r=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.events)&&(null==(r=e.conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)>0}),n=e.filter(e=>{var t,r;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(r=e.conditions)||null==(r=r.cancelEvents)||null==(r=r.values)?void 0:r.length)>0});0===r.length&&0===n.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Gn=this.Xn(e,ux),this.Qn=this.Xn(e,hx))}onEvent(e,t){var r,n,o=this.os(),i=(null==t||null==(r=t.properties)?void 0:r.$survey_id)||(null==t||null==(n=t.properties)?void 0:n.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){var a=this.ls(e,i);if("consume"===a)return o.info("event consumed activated item, removing it",{event:e,itemId:i}),void this.us([i]);if("persist"===a)return o.info("shown item promoted to persisted activation",{event:e,itemId:i}),void this.hs(i)}if(this.Qn.has(e)){var s=this.ts(e,t,hx);s.length>0&&(o.info("cancel event matched, cancelling items",{event:e,itemsToCancel:s.map(e=>e.id)}),this.us(s.map(e=>e.id)),s.forEach(e=>this.ds(e.id)))}if(this.Gn.has(e)){o.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var l=this.ts(e,t,ux);this.cs(l.map(e=>e.id))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){0!==e.length&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter(t=>t!==e);var t=this.vs();t.includes(e)||(this.fs([...t,e]),this.ps())}us(e){var t=new Set(e);this.Zn=this.Zn.filter(e=>!t.has(e));var r=this.gs(),n=r.filter(e=>!t.has(e));n.length!==r.length&&(this.fs(n),0===n.length&&this.ys())}gs(){var e,t=this.bs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}vs(){var e,t,r=this.gs();if(0===r.length)return[];var n=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()],o=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return o&&n===o?r:[]}ps(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ws(t)}ys(){this.xs()}Kn(e){var t,r=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter(e=>!this.ks(e))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class WS extends HS{constructor(e){super(e)}bs(){return Mg}_s(){return Lg}Cs(){return mx}es(e){var t;null==(t=this._instance)||t.getSurveys(e)}ds(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}os(){return Kw}fs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Mg]:e})}ws(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[Lg]:e})}xs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(Lg)}ks(){return!1}ls(e,t){var r;this.es(e=>{r=e.find(e=>e.id===t)});var n=!r||function(e){var t;return qw(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(r);return n?e===mx?"consume":"ignore":e===mx?"persist":e===gx||e===yx?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var VS="SDK is not enabled or survey functionality is not yet loaded",$S="Disabled. Not loading surveys.",US=null!=Dp&&Dp.location?Vb(Dp.location.hash,"__posthog")||Vb(location.hash,"state"):null,qS="_postHogToolbarParams",KS=Qm("[Toolbar]"),GS=Qm("[FeatureFlags]"),JS=Qm("[FeatureFlags]",{debugEnabled:!0}),QS="\" failed. Feature flags didn't load in time.",YS=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},XS=e=>{var t={};for(var r of fy(e||{})){var n=r[1];n&&(t[r[0]]=n)}return t},ZS=Qm("[Error tracking]"),ek="Refusing to render web experiment since the viewer is a likely bot",tk={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>Ow(t,e),not_regex:(e,t)=>!Ow(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class rk{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{rk.Is("retrieved web experiments from the server"),t.Ts=new Map,e.forEach(e=>{if(e.feature_flag_key){var r;t.Ts&&(rk.Is("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(r=t.Ts)||r.set(e.feature_flag_key,e));var n=t._instance.getFeatureFlag(e.feature_flag_key);Pv(n)&&e.variants[n]&&t.Ms(e.name,n,e.variants[n].transforms)}else if(e.variants)for(var o in e.variants){var i=e.variants[o];rk.Es(i,t._instance)&&t.Ms(e.name,o,i.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())rk.Is(ek);else if(!this.Te.disable_web_experiments){if(Ev(this.Ts))return this.Ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();rk.Is("applying feature flags",e),e.forEach(e=>{var t;if(this.Ts&&null!=(t=this.Ts)&&t.has(e)){var r,n=this._instance.getFeatureFlag(e),o=null==(r=this.Ts)?void 0:r.get(e);n&&null!=o&&o.variants[n]&&this.Ms(o.name,n,o.variants[n].transforms)}})}}previewWebExperiment(){var e=rk.getWindowLocation();if(null!=e&&e.search){var t=Hb(null==e?void 0:e.search,"__experiment_id"),r=Hb(null==e?void 0:e.search,"__experiment_variant");t&&r&&(rk.Is("previewing web experiments "+t+" && "+r),this.getWebExperiments(e=>{this.Rs(parseInt(t),r,e)},!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Te.disable_web_experiments&&!r)return e([]);var n=this._instance.get_property("$web_experiments");if(n&&!t)return e(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Rs(e,t,r){var n=r.filter(t=>t.id===e);n&&n.length>0&&(rk.Is("Previewing web experiment ["+n[0].name+"] with variant ["+t+"]"),this.Ms(n[0].name,t,n[0].variants[t].transforms))}static Es(e,t){return!Ev(e.conditions)&&rk.Ps(e,t)&&rk.Os(e)}static Ps(e,t){var r;if(Ev(e.conditions)||Ev(null==(r=e.conditions)?void 0:r.url))return!0;var n=rk.getWindowLocation();if(n){var o,i,a,s=Wy(t,n.href);return null==(o=e.conditions)||!o.url||tk[null!==(i=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url,s)}return!1}static getWindowLocation(){return null==Dp?void 0:Dp.location}static Os(e){var t;if(Ev(e.conditions)||Ev(null==(t=e.conditions)?void 0:t.utm))return!0;var r=Yb();if(r.utm_source){var n,o,i,a,s,l,c,d,u=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_campaign||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_campaign)==r.utm_campaign,h=null==(i=e.conditions)||null==(i=i.utm)||!i.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==r.utm_source,p=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==r.utm_medium,v=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(d=e.conditions)||null==(d=d.utm)?void 0:d.utm_term)==r.utm_term;return u&&p&&v&&h}return!1}static Is(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];Jm.info("[WebExperiments] "+e,r)}Ms(e,t,r){this._is_bot()?rk.Is(ek):"control"!==t?r.forEach(r=>{if(r.selector){var n;rk.Is("applying transform of variant "+t+" for experiment "+e+" ",r);var o=null==(n=document)?void 0:n.querySelectorAll(r.selector);null==o||o.forEach(e=>{var t=e;r.html&&(t.innerHTML=r.html),r.css&&t.setAttribute("style",r.css)})}}):rk.Is("Control variants leave the page unmodified.")}_is_bot(){return Lp&&this._instance?Mw(Lp,this.Te.custom_blocked_useragents):void 0}}var nk=Qm("[Conversations]"),ok="Conversations not available yet.",ik="console",ak={featureFlags:class{constructor(e){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],Dp&&wy(Dp,"online",this.Bs)}destroy(){null==Dp||Dp.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(e){return this._instance.get_property(e)}Vs(){var e,t;return null!==(e=null==(t=this.mi)?void 0:t._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==e&&e}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,GS.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var e,t=null!==(e=this.Te.evaluation_contexts)&&void 0!==e?e:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(GS.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||GS.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Gs(){return this.Zs().length>0}Qs(){var e=this.Te.flag_keys;if(!Iv(e)){if(_v(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||GS.error("Invalid flag key found:",e,"Expected non-empty string"),t});GS.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,r=this._instance.config,n=null!==(e=null==(t=r.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(n).length){var o,i,a=null!==(o=null==(i=r.bootstrap)?void 0:i.featureFlagPayloads)&&void 0!==o?o:{},s=Object.keys(n).filter(e=>!!n[e]).reduce((e,t)=>(e[t]=n[t]||!1,e),{}),l=Object.keys(a).filter(e=>s[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:s,featureFlagPayloads:l})}}updateFlags(e,t,r){var n,o,i=null!=r&&r.merge&&null!==(n=this.zs(Sg))&&void 0!==n?n:{},a=null!=r&&r.merge&&null!==(o=this.zs(Ag))&&void 0!==o?o:{},s=Yp({},i,e),l=Yp({},a,t),c={};for(var d of Object.entries(s)){var u=d[0],h=d[1];c[u]={key:u,enabled:ev(h),variant:tv(h),reason:void 0,metadata:Iv(null==l?void 0:l[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}}}this.receivedFeatureFlags({flags:c})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.zs(Cg),t=this.zs(Pg),r=this.zs(Rg);if(!r&&!t)return e||{};var n=vy({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])];for(var i of o){var a,s,l=n[i],c=null==t?void 0:t[i],d=Iv(c)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!c,u=Iv(c)?l.variant:"string"==typeof c?c:void 0,h=null==r?void 0:r[i],p=Yp({},l,{enabled:d,variant:d?null!=u?u:null==l?void 0:l.variant:void 0});d!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),u!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),h&&(p.metadata=Yp({},null==l?void 0:l.metadata,{payload:h,original_payload:null==l||null==(s=l.metadata)?void 0:s.payload})),n[i]=p}return this.Fs||(GS.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.Fs=!0),n}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(r=>{var n=e[r];return{key:r,enabled:ev(n),variant:tv(n),payload:Zp(t[r])}})}getFlagVariants(){var e=this.zs(Sg),t=this.zs(Pg);if(!t)return e||{};for(var r=vy({},e),n=Object.keys(t),o=0;n.length>o;o++)r[n[o]]=t[n[o]];return this.Fs||(GS.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Fs=!0),r}getFlagPayloads(){var e=this.zs(Ag),t=this.zs(Rg);if(!t)return e||{};for(var r=vy({},e||{}),n=Object.keys(t),o=0;n.length>o;o++)r[n[o]]=t[n[o]];return this.Fs||(GS.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Fs=!0),r}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.tn.emit("featureFlagsReloading",!0),this.Js=setTimeout(()=>{this.Ks()},5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.As=e}Ks(e){var t;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var r=this.Te.token,n=this.zs(tg),o={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:Yp({},(null==(t=this.mi)?void 0:t.get_initial_props())||{},this.zs(Tg)||{}),group_properties:this.zs(Eg),timezone:ix()};Tv(n)||Iv(n)||(o.$device_id=n),(null!=e&&e.disableFlags||this.Te.advanced_disable_feature_flags)&&(o.disable_flags=!0),this.Gs()&&(o.evaluation_contexts=this.Zs());var i=this.Qs();Iv(i)||(o.flag_keys=i);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:s,data:o,compression:this.Te.disable_compression?void 0:Ex,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:e=>{var t,r,n,i=!0;if(this.Xs(e.statusCode),200===e.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),i=!1),this.$s=!1,!o.disable_flags||this.Ns){this.Ds=!i;var s=[];e.error?e.error instanceof Error?s.push("AbortError"===e.error.name?"timeout":"connection_error"):s.push("unknown_error"):200!==e.statusCode&&s.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&s.push("errors_while_computing_flags");var l,c=!(null==(r=e.json)||null==(r=r.quotaLimited)||!r.includes("feature_flags"));c&&s.push("quota_limited"),null==(n=this.mi)||n.register({[Bg]:s}),c?GS.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(o.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},i,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return $b(this.Hs,3)}Xs(e){this.Hs=Ub(e,this.Hs,3,()=>GS.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var r;if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var n=this.getFeatureFlagResult(e,t);return null!==(r=null==n?void 0:n.variant)&&void 0!==r?r:null==n?void 0:n.enabled}}else GS.warn('getFeatureFlag for key "'+e+QS)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFlagVariants(),n=e in r,o=r[e],i=this.getFlagPayloads()[e],a=String(o),s=this.zs(jg)||void 0,l=this.zs(Hg)||void 0,c=this.zs(Fg)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var d,u=this._instance.get_session_id(),h=this.zs(Ng);u&&u!==h&&(c={},null==(d=this.mi)||d.register({[Fg]:c,[Ng]:u}))}if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(a))){var p,v,f,m,g,y,b,x,w,S,k;_v(c[e])?c[e].push(a):c[e]=[a],null==(p=this.mi)||p.register({[Fg]:c});var _=this.getFeatureFlagDetails(e),C=[...null!==(v=this.zs(Bg))&&void 0!==v?v:[]];Iv(o)&&C.push("flag_missing");var A={$feature_flag:e,$feature_flag_response:o,$feature_flag_payload:i||null,$feature_flag_request_id:s,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(f=this.Te.bootstrap)||null==(f=f.featureFlags)?void 0:f[e])||null,$feature_flag_bootstrapped_payload:(null==(m=this.Te.bootstrap)||null==(m=m.featureFlagPayloads)?void 0:m[e])||null,$used_bootstrap_value:!this.Ds};Iv(null==_||null==(g=_.metadata)?void 0:g.has_experiment)||(A.$feature_flag_has_experiment=_.metadata.has_experiment),Iv(null==_||null==(y=_.metadata)?void 0:y.version)||(A.$feature_flag_version=_.metadata.version);var j,I=null!==(b=null==_||null==(x=_.reason)?void 0:x.description)&&void 0!==b?b:null==_||null==(w=_.reason)?void 0:w.code;I&&(A.$feature_flag_reason=I),null!=_&&null!=(S=_.metadata)&&S.id&&(A.$feature_flag_id=_.metadata.id),Iv(null==_?void 0:_.original_variant)&&Iv(null==_?void 0:_.original_enabled)||(A.$feature_flag_original_response=Iv(_.original_variant)?_.original_enabled:_.original_variant),null!=_&&null!=(k=_.metadata)&&k.original_payload&&(A.$feature_flag_original_payload=null==_||null==(j=_.metadata)?void 0:j.original_payload),C.length&&(A.$feature_flag_error=C.join(",")),this._instance.capture("$feature_flag_called",A)}if(n)return{key:e,enabled:!!o,variant:"string"==typeof o?o:void 0,payload:Zp(i)}}}else GS.warn('getFeatureFlagResult for key "'+e+QS)}getRemoteConfigPayload(e,t){var r=this.Te.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.Gs()&&(n.evaluation_contexts=this.Zs());var o=this.Qs();Iv(o)||(n.flag_keys=o),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:n,compression:this.Te.disable_compression?void 0:Ex,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(r){var n,o=null==(n=r.json)?void 0:n.featureFlagPayloads;t((null==o?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Ds)return t.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return GS.warn('isFeatureEnabled for key "'+e+QS),t.defaultValue;var r=this.getFeatureFlag(e,t);return Iv(r)?t.defaultValue:!!r}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,r){if(this.mi){this.Ls=!0;var n=this.getFlagVariants(),o=this.getFlagPayloads(),i=this.getFlagsWithDetails();!function(e,t,r,n,o,i){void 0===r&&(r={}),void 0===n&&(n={}),void 0===o&&(o={});var a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var r;return[e,null!==(r=t[e].variant)&&void 0!==r?r:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var r;return null==(r=t[e].metadata)?void 0:r.payload}).map(e=>{var r;return[e,null==(r=t[e].metadata)?void 0:r.payload]}))):e.featureFlags&&GS.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),s=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var d=e.requestId,u=e.evaluatedAt;if(_v(l)){GS.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var h={};if(l)for(var p=0;l.length>p;p++)h[l[p]]=!0;t&&t.register({[kg]:l,[Sg]:h,[Ig]:!1})}else{var v=l,f=c,m=s;if(null!=i&&i.partialResponse)v=Yp({},r,v),f=Yp({},n,f),m=Yp({},o,m);else if(e.errorsWhileComputingFlags)if(s){var g=new Set(Object.keys(s).filter(e=>{var t;return!(null!=(t=s[e])&&t.failed)}));v=Yp({},r,Object.fromEntries(Object.entries(v).filter(e=>g.has(e[0])))),f=Yp({},n,Object.fromEntries(Object.entries(f||{}).filter(e=>g.has(e[0])))),m=Yp({},o,Object.fromEntries(Object.entries(m||{}).filter(e=>g.has(e[0]))))}else v=Yp({},r,v),f=Yp({},n,f),m=Yp({},o,m);t&&t.register(Yp({[kg]:Object.keys(XS(v)),[Sg]:v||{},[Ag]:f||{},[Cg]:m||{},[Ig]:!0===e.minimalFlagCalledEvents},d?{[jg]:d}:{},u?{[Hg]:u}:{}))}}}(e,this.mi,n,o,i,r),t||(this.js=!1),this.eo(t)}}override(e,t){void 0===t&&(t=!1),GS.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.mi)return GS.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.mi.unregister(Pg),this.mi.unregister(Rg),this.eo(),JS.info("All overrides cleared");if(_v(e)){var t=YS(e);return this.mi.register({[Pg]:t}),this.eo(),JS.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var r,n=e;if(this.Fs=Boolean(null!==(r=n.suppressWarning)&&void 0!==r&&r),"flags"in n)if(!1===n.flags)this.mi.unregister(Pg),JS.info("Flag overrides cleared");else if(n.flags){if(_v(n.flags)){var o=YS(n.flags);this.mi.register({[Pg]:o})}else this.mi.register({[Pg]:n.flags});JS.info("Flag overrides set",{flags:n.flags})}return"payloads"in n&&(!1===n.payloads?(this.mi.unregister(Rg),JS.info("Payload overrides cleared")):n.payloads&&(this.mi.register({[Rg]:n.payloads}),JS.info("Payload overrides set",{payloads:n.payloads}))),void this.eo()}if(e&&"object"==typeof e)return this.mi.register({[Pg]:e}),this.eo(),JS.info("Flag overrides set",{flags:e});GS.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ls){var t=this.ro(),r=t.flags,n=t.flagVariants;try{e(r,n)}catch(e){GS.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var n,o=(this.zs(_g)||[]).find(t=>t.flagKey===e),i={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:i};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(i,!1);var s=Yp({},this.getFlagVariants(),{[e]:t});null==(n=this.mi)||n.register({[kg]:Object.keys(XS(s)),[Sg]:s}),this.eo()}getEarlyAccessFeatures(e,t,r){void 0===t&&(t=!1);var n=this.zs(_g),o=r?"&"+r.map(e=>"stage="+e).join("&"):"";if(n&&!t)return e(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+o),method:"GET",timestampMode:"query",callback:t=>{var r,n;if(t.json){var o=t.json.earlyAccessFeatures;return null==(r=this.mi)||r.unregister(_g),null==(n=this.mi)||n.register({[_g]:o}),e(o)}}})}ro(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,r)=>(e[r]=t[r],e),{})}}eo(e){var t=this.ro(),r=t.flags,n=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(r,n,{errorsLoading:e})}catch(e){GS.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this.zs(Tg)||{},n=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),o=null==e?void 0:e.$set_once,i={};if(o)for(var a in o)({}).hasOwnProperty.call(o,a)&&(a in r||(i[a]=o[a]));this._instance.register({[Tg]:Yp({},r,i,n)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=Yp({},this.zs(Tg)||{});e.forEach(e=>{delete r[e]}),this._instance.register({[Tg]:r}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Tg),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var r=this.zs(Eg)||{};0!==Object.keys(r).length&&Object.keys(r).forEach(t=>{r[t]=Yp({},r[t],e[t]),delete e[t]}),this._instance.register({[Eg]:Yp({},r,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.zs(Eg)||{};this._instance.register({[Eg]:Yp({},t,{[e]:{}})})}else this._instance.unregister(Eg)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},sk={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var e;return!(null==(e=this.io)||!e.isStarted)}get status(){var e,t;return this.no===IS||this.no===PS?this.no:null!==(e=null==(t=this.io)?void 0:t.status)&&void 0!==e?e:this.no}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=AS,this.so=void 0,this._instance=e,!this._instance.sessionManager)throw TS.error("started without valid sessionManager"),new Error(RS+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===ry)throw new Error(RS+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var e,t=!(null==(e=this._instance.get_property(vg))||!e.enabled),r=!this.Te.disable_session_recording,n=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return Dp&&t&&r&&!n}startIfEnabledOrStop(e){var t;if(!this.oo||null==(t=this.io)||!t.isStarted){var r=!Iv(Object.assign)&&!Iv(Array.from);this.oo&&r?(this.ao(e),TS.info("starting")):(this.no=AS,this.stopRecording())}}ao(e){var t,r,n;this.oo&&(this.no!==IS&&this.no!==PS&&(this.no=jS),null!=qp&&null!=(t=qp.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(r=qp.__PosthogExtensions__)&&r.initSessionRecording?this.lo(e):null==(n=qp.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this._instance,this.uo,t=>{if(t)return TS.error("could not load recorder",t);this.lo(e)}))}stopRecording(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.stop()}ho(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.discard()}do(){var e,t;null==(e=this.mi)||e.unregister(wg),null==(t=this.mi)||t.unregister(fg)}co(e,t){if(Ev(e))return null;var r,n=zv(e)?e:parseFloat(e);return"number"!=typeof(r=n)||!Number.isFinite(r)||0>r||r>1?(TS.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):n}vo(e){if(this.mi){var t,r,n=this.mi,o=()=>{var t,r=!1===e.sessionRecording?void 0:e.sessionRecording,o=this.co(null==(t=this.Te.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),i=this.co(null==r?void 0:r.sampleRate,"remote config sampleRate"),a=null!=o?o:i;Ev(a)&&this.do();var s=null==r?void 0:r.minimumDurationMilliseconds;n.register({[vg]:Yp({cache_timestamp:Date.now(),enabled:!!r},r,{networkPayloadCapture:Yp({capturePerformance:e.capturePerformance},null==r?void 0:r.networkPayloadCapture),canvasRecording:{enabled:null==r?void 0:r.recordCanvas,fps:null==r?void 0:r.canvasFps,quality:null==r?void 0:r.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Iv(s)?null:s,endpoint:null==r?void 0:r.endpoint,triggerMatchType:null==r?void 0:r.triggerMatchType,masking:null==r?void 0:r.masking,urlTriggers:null==r?void 0:r.urlTriggers,version:null==r?void 0:r.version,triggerGroups:null==r?void 0:r.triggerGroups})})};o(),null==(t=this.so)||t.call(this),this.so=null==(r=this._instance.sessionManager)?void 0:r.onSessionId(o)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.vo(t),void this.ho()):(this.vo(t),void this.startIfEnabledOrStop()):(this.no===IS&&(this.no=PS,TS.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var r;void 0===t&&(t="log"),null!=(r=this.io)&&r.log?this.io.log(e,t):TS.warn("log called before recorder was ready")}get uo(){var e,t,r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(vg);return(null==r||null==(t=r.scriptConfig)?void 0:t.script)||"lazy-recorder"}fo(){var e,t,r=this._instance.get_property(vg);if(!r)return!1;try{t="object"==typeof r?r:JSON.parse(r)}catch(e){return TS.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var n=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-n}lo(e){var t,r;if(null==(t=qp.__PosthogExtensions__)||!t.initSessionRecording)return TS.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Zg]:!0});if(this.io||(this.io=null==(r=qp.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===PS||this.no===IS)return;return this.no=IS,TS.info("persisted remote config is stale, requesting fresh config before starting"),void new Rx(this._instance).load()}this.no=jS,this.io.start(e)}onRRwebEmit(e){var t;null==(t=this.io)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.io||null==(t=this.mi)||t.register({[gg]:!0}),null==(e=this.io)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.io||null==(t=this.mi)||t.register({[mg]:!0}),null==(e=this.io)||e.overrideSampling()}overrideTrigger(e){var t,r;this.io||null==(r=this.mi)||r.register({["url"===e?yg:bg]:!0}),null==(t=this.io)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.io)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!(null==(r=this.io)||!r.tryAddCustomEvent(e,t))}}},lk={autocapture:class{constructor(e){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=e,this.rageclicks=new mS(e.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var e,t,r=Av(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=null==(e=r.url_allowlist)?void 0:e.map(e=>new RegExp(e)),r.url_ignorelist=null==(t=r.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),r}wo(){if(this.isBrowserSupported()){if(Dp&&Op){var e=e=>{e=e||(null==Dp?void 0:Dp.event);try{this.xo(e)}catch(Dp){yS.error("Failed to capture event",Dp)}};if(wy(Op,"submit",e,{capture:!0}),wy(Op,"change",e,{capture:!0}),wy(Op,"click",e,{capture:!0}),this.Te.capture_copied_text){var t=e=>{e=e||(null==Dp?void 0:Dp.event);try{this.xo(e,gS)}catch(Dp){yS.error("Failed to capture copy/cut event",Dp)}};wy(Op,"copy",t,{capture:!0}),wy(Op,"cut",t,{capture:!0})}}}else yS.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(e){if(this.yo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.bo=t.elementsChainAsString);var r=t.autocapture_opt_out;Mv(r)&&(this.instance.persistence&&this.instance.persistence.register({[ig]:r}),this.mo=r),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this._o=e}getElementSelectors(e){var t,r=[];return null==(t=this._o)||t.forEach(t=>{var n=null==Op?void 0:Op.querySelectorAll(t);null==n||n.forEach(n=>{e===n&&r.push(t)})}),r}get isEnabled(){var e,t,r=null==(e=this.instance.persistence)?void 0:e.props[ig],n=this.mo,o=this.instance.Ur()&&!this.yo;if(Tv(n)&&!Mv(r)&&!o)return!1;var i=null!==(t=this.mo)&&void 0!==t?t:!!r;return!!this.instance.config.autocapture&&!i}xo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var r,n=eb(e);Ky(n)&&(n=n.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&db(n,this.instance.config.rageclick)&&this.xo(e,"$rageclick");var o=t===gS;if(n&&function(e,t,r,n,o,i){var a;if(!Dp||ub(e))return!1;if(null!=r&&r.url_allowlist&&!Qy(r.url_allowlist,i))return!1;if(null!=r&&r.url_ignorelist&&Qy(r.url_ignorelist,i))return!1;if(null!=r&&r.dom_event_allowlist){var s=r.dom_event_allowlist;if(s&&!s.some(e=>t.type===e))return!1}var l=hb(e,n),c=l.parentIsUsefulElement,d=l.targetElementList;if(!function(e,t){var r=null==t?void 0:t.element_allowlist;if(Iv(r))return!0;var n,o=function(e){if(r.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var i of e)if(n=o(i))return n.v;return!1}(d,r))return!1;if(!rb(d,null==r?void 0:r.css_selector_allowlist))return!1;if(rb(d,null!==(a=null==r?void 0:r.css_selector_ignorelist)&&void 0!==a?a:ob))return!1;try{var u=Dp.getComputedStyle(e);if(u&&"pointer"===u.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(Dp){}var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return(o||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(o||["change","click"]).indexOf(t.type)>=0;default:return c?(o||["click"]).indexOf(t.type)>=0:(o||["click"]).indexOf(t.type)>=0&&(tb.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(n,e,this.Te,o,o?["copy","cut"]:void 0,this.instance)){var i=function(e,t){var r,n,o=t.e,i=t.maskAllElementAttributes,a=t.maskAllText,s=t.elementAttributeIgnoreList,l=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!Uy(e))return{props:{}};for(var d=[e],u=new Set([e]),h=e;h.parentNode&&!qy(h,"body")&&1e3>d.length;)if(Gy(h.parentNode)){var p=h.parentNode.host;if(u.has(p))break;u.add(p),d.push(p),h=p}else{if(!Uy(h.parentNode))break;if(u.has(h.parentNode))break;u.add(h.parentNode),d.push(h.parentNode),h=h.parentNode}var v,f,m=[],g={},y=!1,b=!1;if(py(d,e=>{var t=pb(e);if(qy(e,"a")){var r=e.getAttribute("href");y=!!(t&&r&&wb(r))&&(c?Zf(r):r)}gv(Yy(e),"ph-no-capture")&&(b=!0),m.push(function(e,t,r,n,o){void 0===o&&(o=!1);var i=e.tagName.toLowerCase(),a={tag_name:i};tb.indexOf(i)>-1&&!r&&(a.$el_text="a"===i.toLowerCase()||"button"===i.toLowerCase()?bS(1024,Sb(e)):bS(1024,Zy(e)));var s=Yy(e);s.length>0&&(a.classes=s.filter(function(e){return""!==e})),py(e.attributes,function(r){var i;if((!vb(e)||-1!==["name","id","class","aria-label"].indexOf(r.name))&&(null==n||!n.includes(r.name))&&!t&&wb(r.value)&&(!Pv(i=r.name)||"_ngcontent"!==i.substring(0,10)&&"_nghost"!==i.substring(0,7))){var s=r.value;"class"===r.name&&(s=Jy(s).join(" ")),a["attr__"+r.name]=bS(1024,"href"===r.name&&o?Zf(s):s)}});for(var l=1,c=1,d=e;d=xS(d);)l++,d.tagName===e.tagName&&c++;return a.nth_child=l,a.nth_of_type=c,a}(e,i,a,s,c));var n=function(e){if(!pb(e))return{};var t={};return py(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var r=e.name.replace("data-ph-capture-attribute-",""),n=e.value;r&&n&&wb(n)&&(t[r]=n)}}),t}(e);vy(g,n)}),b)return{props:{},explicitNoCapture:b};if(a||(m[0].$el_text=qy(e,"a")||qy(e,"button")?Sb(e):Zy(e)),y){var x,w;m[0].attr__href=y;var S=null==(x=Bb(y))?void 0:x.host,k=null==Dp||null==(w=Dp.location)?void 0:w.host;S&&k&&S!==k&&(v=y)}return{props:vy({$event_type:o.type,$ce_version:1},l?{}:{$elements:m},{$elements_chain:(f=m,function(e){return e.map(e=>{var t,r,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class)for(var o of(e.attr_class.sort(),e.attr_class))n+="."+o.replace(/"/g,"");var i=Yp({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(r=e.nth_of_type)&&void 0!==r?r:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return fy(i).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[_b(e[0].toString())]=_b(t.toString())}),(n+=":")+fy(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")}(function(e){return e.map(e=>{var t,r,n={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:Cb(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return fy(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>n.attributes[e[0]]=e[1]),n})}(f)))},null!=(r=m[0])&&r.$el_text?{$el_text:null==(n=m[0])?void 0:n.$el_text}:{},v&&"click"===o.type?{$external_click_url:v}:{},g)}}(n,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=i.props;if(i.explicitNoCapture)return!1;var s=this.getElementSelectors(n);if(s&&s.length>0&&(a.$element_selectors=s),t===gS){var l,c=Xy(null==Dp||null==(l=Dp.getSelection())?void 0:l.toString()),d=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=d}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Cv(null==Op?void 0:Op.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ko=(null==Dp||null==(t=Dp.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(Jm.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,Jm.info("History API monitoring stopped")}monitorHistoryChanges(){Dp&&Dp.history&&(this.Co("pushState"),this.Co("replaceState"),this.Io())}Co(e){var t;if(Dp&&(null==(t=Dp.history[e])||!t.__posthog_wrapped__)){var r=this;!function(e,t,r){try{if(!(t in e))return SS;var n={next:e[t]},o=r(function(){for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return n.next.apply(this,t)});return Cv(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:n}})),e[t]=o,()=>{if(e[t]!==o)for(var r=e[t];Cv(r)&&r.__posthog_layer__;){var i=r.__posthog_layer__;if(i.next===o)return void(i.next=n.next);r=i.next}else e[t]=n.next}}catch(e){return SS}}(Dp.history,e,t=>function(n,o,i){t.call(this,n,o,i),r.To(e)})}}To(e){try{var t,r=null==Dp||null==(t=Dp.location)?void 0:t.pathname;if(!r)return;r!==this.ko&&this.isEnabled&&this._instance.capture(ly,{navigation_type:e}),this.ko=r}catch(Dp){Jm.error("Error capturing "+e+" pageview",Dp)}}Io(){if(!this.So){var e=()=>{this.To("popstate")};wy(Dp,"popstate",e),this.So=()=>{Dp&&Dp.removeEventListener("popstate",e)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(e){var t;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=e,this.Mo=!(null==(t=this.instance.persistence)||!t.props[ag]),this.rageclicks=new mS(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Av(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(e=this.Te.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return Ev(this.Te.capture_heatmaps)?Ev(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;ES.info("starting..."),this.Ro(),this.ke()}else{var e;clearInterval(null!==(e=this.Eo)&&void 0!==e?e:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var r=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ag]:r}),this.Mo=r,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Oo(e){zS(e.originalEvent)&&this.pe(e.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo="visible"===(null==Op?void 0:Op.visibilityState)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){Dp&&Op&&(this.Fo=this.oi.bind(this),wy(Dp,sy,this.Fo),this.Lo=e=>this.pe(e||(null==Dp?void 0:Dp.event)),wy(Op,"click",this.Lo,{capture:!0}),this.$o=e=>this.Ao(e||(null==Dp?void 0:Dp.event)),wy(Op,"mousemove",this.$o,{capture:!0}),this.No=new Pb(this.instance,jb,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),wy(Op,ay,this.Do),this.po=!0)}Po(){var e;Dp&&Op&&(this.Fo&&Dp.removeEventListener(sy,this.Fo),this.Lo&&Op.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&Op.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&Op.removeEventListener(ay,this.Do),clearTimeout(this.qo),null==(e=this.No)||e.stop(),this.po=!1)}jo(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=function(e,t,r){for(var n=e;n&&Uy(n)&&!qy(n,"body");){if(n===r)return!1;var o=void 0;try{var i,a,s;o=null==(i=null!==(a=null==(s=n.ownerDocument)?void 0:s.defaultView)&&void 0!==a?a:Dp)?void 0:i.getComputedStyle(n).position}catch(Dp){return!1}if(gv(t,o))return!0;n=nb(n)}return!1}(eb(e),["fixed","sticky"],o);return{x:e.clientX+(i?0:n),y:e.clientY+(i?0:r),target_fixed:i,type:t}}pe(e,t){var r;if(void 0===t&&(t="click"),!$y(e.target)&&zS(e)){var n=this.jo(e,t);null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&db(eb(e),this.instance.config.rageclick)&&this.Wt(Yp({},n,{type:"rageclick"})),this.Wt(n)}}Ao(e){!$y(e.target)&&zS(e)&&(clearTimeout(this.qo),this.qo=setTimeout(()=>{this.Wt(this.jo(e,"mousemove"))},500))}Wt(e){if(Dp){var t=this.Te.disable_capture_url_hashes?Zf(Dp.location.href):Dp.location.href,r=this.Te.custom_personal_data_properties,n=this.Te.mask_personal_data_properties?[...Kb,...r||[]]:[],o=Wb(t,n,Jb);this.R=this.R||{},this.R[o]||(this.R[o]=[]),this.R[o].push(e)}}oi(){this.R&&!jv(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Pb,webVitalsAutocapture:class{constructor(e){var t;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>Yp({},e,{["$web_vitals_"+t.name+"_event"]:Yp({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.zo();if(!Iv(r))if(Ev(null==e?void 0:e.name)||Ev(null==e?void 0:e.value))_S.error("Invalid metric received",e);else if(!this.Vo||this.Vo>e.value){this.R.url!==r&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Iv(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=Iv(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=Yp({},e,{$current_url:r,timestamp:Date.now()});Iv(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.R.metrics.push(o),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else _S.error("Ignoring metric with value >= "+this.Vo,e)},this.Wo=()=>{if(!this.po){var e,t,r,n,o=qp.__PosthogExtensions__;if(!Iv(o)&&!Iv(o.postHogWebVitalsCallbacks)){var i=o.postHogWebVitalsCallbacks;e=i.onLCP,t=i.onCLS,r=i.onFCP,n=i.onINP}e&&t&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Uo.bind(this)),this.po=!0):_S.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[dg]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=Av(this.Zo)?null==(e=this.Zo)?void 0:e.web_vitals_allowed_metrics:void 0;return Ev(r)?(null==(t=this._instance.persistence)?void 0:t.props[pg])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Av(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Av(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=e&&e}get Vo(){var e=Av(this.Zo)&&zv(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:CS;return e>0&&6e4>=e?CS:e}get isEnabled(){var e=null==Fp?void 0:Fp.protocol;if("http:"!==e&&"https:"!==e)return _S.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Av(this.Zo)?this.Zo.web_vitals:Mv(this.Zo)?this.Zo:void 0;return Mv(t)?t:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(_S.info("enabled, starting..."),this.tr(this.Wo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var r=Av(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Av(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[dg]:r}),this._instance.persistence.register({[pg]:n})),this.Mo=r,this.startIfEnabled()}}}tr(e){var t,r;null!=(t=qp.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?_S.error("failed to load script",t):e()})}zo(){var e=Dp?this._instance.config.disable_capture_url_hashes?Zf(Dp.location.href):Dp.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,r=this._instance.config.mask_personal_data_properties?[...Kb,...t||[]]:[];return Wb(e,r,Jb)}_S.error("Could not determine current URL")}}},ck={exceptionObserver:class{constructor(e){var t;this.Wo=()=>{var e;if(Dp&&this.isEnabled&&null!=(e=qp.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=qp.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,r=qp.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=qp.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=t(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=r(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=n(this.captureException.bind(this)))}catch(Dp){wS.error("failed to start",Dp),this.Ko()}}},this._instance=e,this.Yo=!(null==(t=this._instance.persistence)||!t.props[sg]),this.Xo=new Uv(Yp({},function(e){var t,r,n,o;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(r=e.exceptionRateLimiterRefillRate)&&void 0!==r?r:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(n=null!==(o=e.exceptionRateLimiterBucketSize)&&void 0!==o?o:e.__exceptionRateLimiterBucketSize)&&void 0!==n?n:10}}(this._instance.config.error_tracking),{refillInterval:1e4,it:wS})),this.Te=this.ta(),this.startIfEnabledOrStop()}ta(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Av(e)?t=Yp({},t,e):(Iv(e)?this.Yo:e)&&(t=Yp({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(wS.info("enabled"),this.Ko(),this.tr(this.Wo)):this.Ko()}tr(e){var t,r;null!=(t=qp.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return wS.error("failed to load script",t);e()})}Ko(){var e,t,r;null==(e=this.Go)||e.call(this),this.Go=void 0,null==(t=this.Qo)||t.call(this),this.Qo=void 0,null==(r=this.Jo)||r.call(this),this.Jo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Yo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[sg]:this.Yo}),this.Te=this.ta(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ta()}captureException(e){var t,r,n,o=null!==(t=null==e||null==(r=e.$exception_list)||null==(r=r[0])?void 0:r.type)&&void 0!==t?t:"Exception";this.Xo.consumeRateLimit(o)?wS.info("Skipping exception capture because of client rate limiting.",{exception:o}):null==(n=this._instance.exceptions)||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.ea=[],this.ra=new ym([new Rm,new Bm,new Em,new Tm,new Fm,new Om,new Dm,new Nm],function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];return function(t,n){void 0===n&&(n=0);for(var o=[],i=t.split("\n"),a=n;i.length>a;a++){var s=i[a];if(1024>=s.length){var l=Pm.test(s)?s.replace(Pm,"$1"):s;if(!l.match(/\S*Error: /)){for(var c of r){var d=c(l,e);if(d){o.push(d);break}}if(o.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>{return Yp({},e,{filename:e.filename||(r=t,r[r.length-1]||{}).filename,function:e.function||bm});var r})}(o)}}("web:javascript",Cm,Im)),this._instance=e,this.ea=null!==(t=null==(r=this._instance.persistence)?void 0:r.get_property(lg))&&void 0!==t?t:[],this.ia=Um(this.na()),this.sa=new qm(this.ia)}onConfigChange(){this.ia=Um(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(e){var t,r,n;if(e.ok){var o=e.config;if("errorTracking"in o){var i=null!==(t=null==(r=o.errorTracking)?void 0:r.suppressionRules)&&void 0!==t?t:[],a=null==(n=o.errorTracking)?void 0:n.captureExtensionExceptions;this.ea=i,this._instance.persistence&&this._instance.persistence.register({[lg]:this.ea,[cg]:a})}}}get oa(){var e,t=!!this._instance.get_property(cg),r=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=r?r:t)&&void 0!==e&&e}buildProperties(e,t){return this.ra.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ia.enabled)try{if(!Pv(e)||0===e.trim().length)return void ZS.warn("Ignoring exception step because message must be a non-empty string");var r=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((r,n)=>Vm.has(n)?(t.push(n),r):(r[n]=e[n],r),{}),droppedKeys:t}}(this.aa(t)),n=r.sanitizedProperties,o=r.droppedKeys;o.length>0&&ZS.warn("Ignoring reserved exception step fields",{droppedKeys:o}),this.sa.add(Yp({[Hm]:e,[Wm]:(new Date).toISOString()},n))}catch(e){ZS.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.la(t)){if(this.ua(t))return this.ha("Exception dropped: matched a suppression rule"),void ZS.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(t))return this.ha("Exception dropped: thrown by a browser extension"),void ZS.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(t))return this.ha("Exception dropped: thrown by the PostHog SDK"),void ZS.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.ia.enabled&&Ev(e.$exception_steps)?this.va(e):e;try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return n&&this.sa.clear(),n}catch(e){return ZS.error("Failed to capture exception event. Dropping this exception.",e),void this.sa.clear()}}catch(e){return void ZS.error("Failed to process exception event. Ignoring this exception.",e)}}va(e){try{var t=this.sa.getAttachable();return 0===t.length?e:Yp({},e,{$exception_steps:t})}catch(t){return ZS.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ha(e){this.ia.enabled&&this.sa.add({[Hm]:e,[Wm]:(new Date).toISOString()})}aa(e){return Av(e)?Yp({},e):{}}na(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}ua(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>{var r=t.type,n=t.value;return Pv(r)&&r.length>0&&e.$exception_types.push(r),Pv(n)&&n.length>0&&e.$exception_values.push(n),e},{$exception_types:[],$exception_values:[]});return this.ea.some(e=>{var r=e.values.map(e=>{var r,n=Nw[e.operator],o=_v(e.value)?e.value:[e.value],i=null!==(r=t[e.key])&&void 0!==r?r:[];return o.length>0&&n(o,i)});return"OR"===e.type?r.some(Boolean):r.every(Boolean)})}da(e){return e.flatMap(e=>{var t,r;return null!==(t=null==(r=e.stacktrace)?void 0:r.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ca(e){if(e.length>0){var t,r,n,o,i=null!==(t=null==(r=e[0].stacktrace)?void 0:r.frames)&&void 0!==t?t:[],a=i[i.length-1];return null!==(n=null==a||null==(o=a.filename)?void 0:o.includes("posthog.com/static"))&&void 0!==n&&n}return!1}la(e){return!Ev(e)&&_v(e)}}},dk=Yp({productTours:class{get mi(){return this._instance.persistence}constructor(e){this.fa=null,this.pa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var r,n;if(this.mi&&this.mi.register({[hg]:!!t.productTours}),!MS(this._instance))return!this.fa&&Ev(null==(r=this.mi)?void 0:r.props[Og])||DS.info("product tours disabled; stopping and clearing cached tours"),null==(n=this.fa)||n.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&MS(this._instance)&&this.tr(()=>this.ga())}tr(e){var t,r;null!=(t=qp.__PosthogExtensions__)&&t.generateProductTours?e():null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"product-tours",t=>{t?DS.error("Could not load product tours script",t):e()})}ga(){var e;!this.fa&&null!=(e=qp.__PosthogExtensions__)&&e.generateProductTours&&(this.fa=qp.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!_v(this.pa)||t){var r=this.mi;if(r){var n=r.props[Og];if(_v(n)&&!t)return this.pa=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(MS(this._instance)){var n=t.statusCode;if(200!==n||!t.json){var o="Product Tours API could not be loaded, status: "+n;return DS.error(o),void e([],{isLoaded:!1,error:o})}var i=_v(t.json.product_tours)?t.json.product_tours:[];this.pa=i,r&&r.register({[Og]:i}),e(i,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.pa,{isLoaded:!0})}getActiveProductTours(e){Ev(this.fa)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.fa)||t.showTourById(e)}previewTour(e){this.fa?this.fa.previewTour(e):this.tr(()=>{var t;this.ga(),null==(t=this.fa)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.fa)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.fa)||e.nextStep()}previousStep(){var e;null==(e=this.fa)||e.previousStep()}clearCache(){var e;this.pa=null,null==(e=this.mi)||e.unregister(Og)}resetTour(e){var t;null==(t=this.fa)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.fa)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.fa)||t.cancelPendingTour(e)}}},ak),uk={siteApps:class{constructor(e){this.ma=0,this._instance=e,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(e,t){if(t){var r=this.globalsForEvent(t);this.ya.push(r),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var e;return null==(e=qp._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{e(),this.ya=[],this._a=void 0}}}globalsForEvent(e){var t,r,n,o,i,a,s;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var u of Object.entries(d)){var h=u[0];l[h]={id:c[h],type:h,properties:u[1]}}var p=e.$set_once,v=e.$set;return{event:Yp({},Xp(e,LS),{properties:Yp({},e.properties,v?{$set:Yp({},null!==(t=null==(r=e.properties)?void 0:r.$set)&&void 0!==t?t:{},v)}:{},p?{$set_once:Yp({},null!==(n=null==(o=e.properties)?void 0:o.$set_once)&&void 0!==n?n:{},p)}:{}),elements_chain:null!==(i=null==(a=e.properties)?void 0:a.$elements_chain)&&void 0!==i?i:"",distinct_id:null==(s=e.properties)?void 0:s.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}wa(e){var t,r=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===r&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(OS.error("prepare_external_dependency_stylesheet returned null"),null):"script"===r&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(OS.error("prepare_external_dependency_script returned null"),null):e}xa(){var e,t,r,n,o,i,a,s;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=null==Op?void 0:Op.defaultView,c=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!c)return()=>{};if(this.ma++,this.ka)return this.Sa();var d=[],u=this,h=new WeakSet,p=(e,t,r)=>{if(null!=e&&e[t]){var n=e[t];e[t]=r(n),d.push(()=>{e[t]=n})}},v=e=>{if(h.has(e))return e;var t=u.wa(e);return t&&h.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:v(e)).filter(e=>!Tv(e));return p(c,"appendChild",e=>function(t){var r=v(t);return r?e.call(this,r):t}),p(c,"insertBefore",e=>function(t,r){var n=v(t);return n?e.call(this,n,r):t}),p(c,"replaceChild",e=>function(t,r){var n=v(t);return n?e.call(this,n,r):r}),[null==(t=l.Element)?void 0:t.prototype,null==(r=l.Document)?void 0:r.prototype,null==(n=l.DocumentFragment)?void 0:n.prototype].forEach(e=>{p(e,"append",e=>function(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,f(r))}),p(e,"prepend",e=>function(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,f(r))})}),[null==(o=l.Element)?void 0:o.prototype,null==(i=l.CharacterData)?void 0:i.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,f(r))}),p(e,"after",e=>function(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,f(r))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];var o=f(r);return r.length&&!o.length?void 0:e.apply(this,o)})}),p(null==(s=l.Element)?void 0:s.prototype,"insertAdjacentElement",e=>function(t,r){var n=v(r);return n?e.call(this,t,n):null}),this.ka=()=>{d.forEach(e=>e()),this.ka=void 0},this.Sa()}Sa(){var e=!1;return()=>{var t;e||(e=!0,this.ma--,0===this.ma&&(null==(t=this.ka)||t.call(this)))}}Ca(e,t){void 0===t&&(t=!0);var r=this.xa();try{var n=e(r);return t&&r(),n}catch(e){throw r(),e}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var r;!t.errored&&this.ya.length&&(OS.info("Processing "+this.ya.length+" events for site app with id "+e.id),this.ya.forEach(e=>this.Ca(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(r=this._a)||r.call(this))},n=!1,o=o=>{t.errored=!o,t.loaded=!0,OS.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),n&&r()};try{var i=this.Ca(t=>e.init({posthog:this._instance,callback(e){t(),o(e)}}),!1).processEvent;i&&(t.processEvent=i),n=!0}catch(t){OS.error(FS+e.id,t),o(!1)}if(n&&t.loaded)try{r()}catch(r){OS.error("Error while processing buffered events PostHog app with config id "+e.id,r),t.errored=!0}}Ia(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Ta(e){var t=this;if(0!==Object.keys(this.apps).length){var r=this.globalsForEvent(e),n=function(n){try{t.Ca(()=>null==n.processEvent?void 0:n.processEvent(r))}catch(t){OS.error("Error while processing event "+e.event+" for site app "+n.id,t)}};for(var o of Object.values(this.apps))n(o)}}onRemoteConfig(e){var t,r,n,o=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Ia(),void this._instance.on("eventCaptured",e=>this.Ta(e))):void OS.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(r=this._a)||r.call(this),e.ok){var i=e.config;if(null!=(n=i.siteApps)&&n.length)if(this.isEnabled){var a=function(){var e,t=s.id,r=s.url;qp["__$$ph_site_app_"+t]=o._instance,null==(e=qp.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(o._instance,r,e=>{if(e)return OS.error(FS+t,e)})};for(var s of i.siteApps)a()}else OS.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},hk={tracingHeaders:class{constructor(e){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,t,r=this.Pa();r?(Iv(this.Ma)&&(this.Ma=null==(e=qp.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Iv(this.Ea)&&(this.Ea=null==(t=qp.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ko()},this._instance=e}initialize(){this.startIfEnabledOrStop()}tr(e){var t,r;null!=(t=qp.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(r=qp.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return kS.error("failed to load script",t);e()})}Oa(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Pa(){var e=this.Oa();return _v(e)?(_v(this.Ra)?this.Ra.splice(0,this.Ra.length,...e):this.Ra=[...e],e.length>0?this.Ra:void 0):(_v(this.Ra)&&this.Ra.splice(0),this.Ra=e||void 0,this.Ra)}Ko(){var e,t;null==(e=this.Ma)||e.call(this),null==(t=this.Ea)||t.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.tr(this.Wo):this.Ko()}}},pk=Yp({surveys:class{get Te(){return this._instance.config}constructor(e){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Te.disable_surveys){if(!e.ok)return Kw.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(Ev(t))return Kw.warn("Flags not loaded yet. Not loading surveys.");var r=_v(t);this.Fa=r?t.length>0:t,Kw.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],r=0;rlocalStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)Kw.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)Kw.info($S);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())Kw.info("Not loading surveys in cookieless mode without consent.");else{var e=null==qp?void 0:qp.__PosthogExtensions__;if(e){if(!Iv(this.Fa)||this.Te.advanced_enable_surveys){var t=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var r=e.generateSurveys;if(r)return void this.Da(r,t);var n=e.loadExternalDependency;if(!n)return void this.qa(ey);n(this._instance,"surveys",r=>{r||!e.generateSurveys?this.qa("Could not load surveys script",r):this.Da(e.generateSurveys,t)})}catch(e){throw this.qa("Error initializing surveys",e),e}finally{this.La=!1}}}else Kw.error("PostHog Extensions not found.")}}Da(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new WS(this._instance),Kw.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(e,t){Kw.error(e,t),this.ja({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$a.push(e),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Te.disable_surveys)return Kw.info($S),e([]);var r,n=this._instance.get_property(zg);if(n&&!t)return e(n,{isLoaded:!0}),void(this.Ha()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then(t=>e(t.surveys,t.context)):("undefined"!=typeof Promise&&(this.Aa=new Promise(e=>{r=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:t=>{var n;this.Aa=null;var o=t.statusCode;if(200!==o||!t.json){var i="Surveys API could not be loaded, status: "+o;Kw.error(i),this.Na=Date.now();var a={isLoaded:!1,error:i};return e([],a),void(null==r||r({surveys:[],context:a}))}this.Na=null;var s,l=t.json.surveys||[],c=l.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(qw(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));c.length>0&&(null==(s=this._surveyEventReceiver)||s.register(c)),null==(n=this._instance.persistence)||n.register({[zg]:l,[Dg]:Date.now()});var d={isLoaded:!0};e(l,d),null==r||r({surveys:l,context:d})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var e=this._instance.get_property(Dg);return zv(e)&&Date.now()-e>3e5}Ua(){return zv(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(e,t){var r,n={id:e,current_iteration:null!==(r=null==t?void 0:t.iteration)&&void 0!==r?r:null};Jw(n);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ja(e){for(var t of this.$a)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){Kw.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!Ev(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);Kw.warn("init was not called")}za(e){var t=null;return this.getSurveys(r=>{var n;t=null!==(n=r.find(t=>t.id===e))&&void 0!==n?n:null}),t}Va(e){if(Ev(this._surveyManager))return{eligible:!1,reason:VS};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(Ev(this._surveyManager))return Kw.warn("init was not called"),{visible:!1,disabledReason:VS};var t=this.Va(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return Ev(this._surveyManager)?(Kw.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:VS})):new Promise(r=>{this.getSurveys(t=>{var n,o=null!==(n=t.find(t=>t.id===e))&&void 0!==n?n:null;if(o){var i=this.Va(o);r({visible:i.eligible,disabledReason:i.reason})}else r({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,r){var n;if(Ev(this._surveyManager))Kw.warn("init was not called");else{var o="string"==typeof e?this.za(e):e;if(null!=o&&o.id)if(Qw.includes(o.type)){var i=null==Op?void 0:Op.querySelector(t);if(i)return null!=(n=o.appearance)&&n.surveyPopupDelaySeconds?(Kw.info("Rendering survey "+o.id+" with delay of "+o.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;Kw.info("Rendering survey "+o.id+" with delay of "+(null==(e=o.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(o,i,r),Kw.info("Survey "+o.id+" rendered")},1e3*o.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(o,i,r);Kw.warn("Survey element not found")}else Kw.warn("Surveys of type "+o.type+" cannot be rendered in the app");else Kw.warn("Survey not found")}}displaySurvey(e,t){var r;if(Ev(this._surveyManager))Kw.warn("init was not called");else{var n=this.za(e);if(n){var o=n;if(null!=(r=n.appearance)&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(o=Yp({},n,{appearance:Yp({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Sx&&t.initialResponses&&Kw.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var i=this.canRenderSurvey(n);if(!i.visible)return void Kw.warn("Survey is not eligible to be displayed: ",i.disabledReason)}t.displayType!==kx?this._surveyManager.handlePopoverSurvey(o,t):this.renderSurvey(o,t.selector,t.properties)}else Kw.warn("Survey not found")}}cancelPendingSurvey(e){Ev(this._surveyManager)?Kw.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},ak),vk={toolbar:class{constructor(e){this.instance=e}Wa(e){qp.ph_toolbar_state=e}Za(){var e;return null!==(e=qp.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),Sy(this.instance.config))return!1;if(!Dp||!Op)return!1;e=null!=e?e:Dp.location,r=null!=r?r:Dp.history;try{if(!t){try{Dp.localStorage.setItem("test","test"),Dp.localStorage.removeItem("test")}catch(Dp){return!1}t=null==Dp?void 0:Dp.localStorage}var n,o=US||Vb(e.hash,"__posthog")||Vb(e.hash,"state"),i=o?my(()=>JSON.parse(atob(decodeURIComponent(o))))||my(()=>JSON.parse(decodeURIComponent(o))):null;return i&&"ph_authorize"===i.action?((n=i).source="url",n&&Object.keys(n).length>0&&(i.desiredHash?e.hash=i.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(t.getItem(qS)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch(Dp){return!1}}Ga(e){var t=qp.ph_load_toolbar||qp.ph_load_editor;!Ev(t)&&Cv(t)?t(e,this.instance):KS.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==Op||!Op.getElementById(Vy));if(!Dp||t)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=Yp({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(Dp.localStorage.setItem(qS,JSON.stringify(Yp({},n,{source:void 0}))),2===this.Za())this.Ga(n);else if(0===this.Za()){var o;this.Wa(1),null==(o=qp.__PosthogExtensions__)||null==o.loadExternalDependency||o.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return KS.error("[Toolbar] Failed to load",e),void this.Wa(0);this.Wa(2),this.Ga(n)}),wy(Dp,"turbolinks:load",()=>{this.Wa(0),this.loadToolbar(n)})}return!0}Qa(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===r&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},fk=Yp({experiments:rk},ak),mk={conversations:class{constructor(e){this.Ja=void 0,this._conversationsManager=null,this.Ka=!1,this.Ya=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&e.ok){var t=e.config.conversations;Ev(t)||(Mv(t)?this.Ja=t:(this.Ja=t.enabled,this.Ya=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ja=void 0,this.Ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ka||this._instance.config.disable_conversations||Sy(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==qp?void 0:qp.__PosthogExtensions__;if(e&&!Iv(this.Ja)&&this.Ja)if(this.Ya&&this.Ya.token){this.Ka=!0;try{var t=e.initConversations;if(t)return this.Xa(t),void(this.Ka=!1);var r=e.loadExternalDependency;if(!r)return void this.tl(ey);r(this._instance,"conversations",t=>{t||!e.initConversations?this.tl("Could not load conversations script",t):this.Xa(e.initConversations),this.Ka=!1})}catch(e){this.tl("Error initializing conversations",e),this.Ka=!1}}else nk.error("Conversations enabled but missing token in remote config.")}}Xa(e){if(this.Ya)try{this._conversationsManager=e(this.Ya,this._instance),nk.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else nk.error("Cannot complete initialization: remote config is null")}tl(e,t){nk.error(e,t),this._conversationsManager=null,this.Ka=!1}show(){this._conversationsManager?this._conversationsManager.show():nk.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ja&&!Tv(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}sendMessage(e,t,r){var n=this;return Qp(function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,t,r):(nk.warn(ok),null)})()}getMessages(e,t){var r=this;return Qp(function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(nk.warn(ok),null)})()}markAsRead(e){var t=this;return Qp(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(nk.warn(ok),null)})()}getTickets(e){var t=this;return Qp(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(nk.warn(ok),null)})()}requestRestoreLink(e){var t=this;return Qp(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(nk.warn(ok),null)})()}restoreFromToken(e){var t=this;return Qp(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(nk.warn(ok),null)})()}restoreFromUrlToken(){var e=this;return Qp(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(nk.warn(ok),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}En(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Rn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},gk={logs:class{constructor(e){var t;this.el=!1,this.rl=!1,this.it=Qm("[logs]"),this.Gr=[],this.il=[],this.Hs=0,this.nl=()=>{var e,t;this.Hs=0,null==(e=this.sl)||e.onReconnect(),null==(t=this.ol)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.el=!0),Dp&&wy(Dp,"online",this.nl)}al(e,t,r,n){var o,i=function(e,t){var r,n,o,i,a,s,l,c=null!==(r=null==e?void 0:e.flushIntervalMs)&&void 0!==r?r:3e3,d=null!==(n=null==e?void 0:e.maxBufferSize)&&void 0!==n?n:100,u=null!=t&&t.consoleCapture?void 0:null!==(o=null==e?void 0:e.maxLogsPerInterval)&&void 0!==o?o:1e3,h=Iv(u)?Math.max(d,2048):Math.max(d,u),p=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(i=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==e?void 0:e.serviceName)&&void 0!==i?i:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(s=null==p?void 0:p["service.version"])&&void 0!==s?s:null==e?void 0:e.serviceVersion,environment:null!==(l=null==p?void 0:p["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:c,maxBufferSize:d,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:c,maxLogsPerInterval:u,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(o=this._instance)||null==(o=o.config)?void 0:o.logs,r);return[new cm(this.ll(e,t),i,this.it,()=>this.ul(),e=>e(),void 0,n),i]}hl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.sl||this.dl!==t){var r;null==(r=this.sl)||r.reset(),this.dl=t;var n=this.al(()=>this.Gr,e=>{this.Gr=e});this.sl=n[0],this.cl=n[1]}return this.sl}vl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.ol||this.fl!==t){var r;null==(r=this.ol)||r.reset(),this.fl=t;var n=this.al(()=>this.il,e=>{this.il=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ik);this.ol=n[0],this.pl=n[1]}return this.ol}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var r=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!Ev(r)&&r&&(this.el=!0,this.loadIfEnabled())}}reset(){var e,t;this.Gr=[],null==(e=this.sl)||e.reset(),this.il=[],null==(t=this.ol)||t.reset(),this.Hs=0}captureLog(e){this.hl().captureLog(e)}le(e){this.vl().captureLog(e)}get logger(){return this.gl||(this.gl={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.gl}flushLogs(e){e?this.ml(e):(this.sl&&this.sl.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)),this.ol&&this.ol.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.el&&!this.rl){var e=null==qp?void 0:qp.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var r;t||null==(r=e.logs)||!r.initializeLogs?this.it.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.rl=!0)}):this.it.error(ey)}else this.it.error("PostHog Extensions not found.")}}ll(e,t){var r=this._instance;return{get isDisabled(){return!1},get optedOut(){return!r.is_capturing()},getPersistedProperty:t=>t===ov.LogsQueue?e():void 0,setPersistedProperty(e,r){var n;e===ov.LogsQueue&&t(null!==(n=r)&&void 0!==n?n:[])},$t:e=>this.$t(e),getLibraryId:()=>Gp.LIB_NAME,getLibraryVersion:()=>Gp.LIB_VERSION}}$t(e){return new Promise(t=>{if($b(this.Hs,3))t({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var r=!1,n=e=>{r||(r=!0,clearTimeout(o),t(e))},o=setTimeout(()=>n({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.yl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;if(this.bl(t),t>=200&&300>t)n({kind:"ok"});else if(413===t)n({kind:"too-large"});else if(0!==t&&429!==t&&500>t)n({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var r;n({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("logs request failed with status "+t)})}}})}})}bl(e){(0!==e||this._instance.__loaded)&&(this.Hs=Ub(e,this.Hs,3,()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}ml(e){this.Gr.length>0&&this._l(e,this.Gr,this.cl,Gp.LIB_NAME,e=>{this.Gr=e}),this.il.length>0&&this._l(e,this.il,this.pl,ik,e=>{this.il=e})}_l(e,t,r,n,o){if(0!==t.length){var i=t.map(e=>e.record);o([]);var a=lm(i,sm(r,Gp.LIB_NAME,Gp.LIB_VERSION),n,Gp.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yl(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ul(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var r=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.windowId,o=r.sessionStartTimestamp,i=r.lastActivityTimestamp;t.sessionId=r.sessionId,t.windowId=n,Ev(o)||(t.sessionStartTimestamp=o),Ev(i)||(t.lastActivityTimestamp=i)}if(null!=qp&&null!=(e=qp.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?Zf(qp.location.href):qp.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},yk={metrics:class{constructor(e){this.it=Qm("[metrics]"),this._instance=e}initialize(){}hl(){var e,t,r=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.sl&&this.dl===r||(null==(t=this.sl)||t.reset(),this.dl=r,this.sl=new pm(this.ll(),function(e){var t,r,n,o,i,a=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==a?void 0:a["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(r=null==a?void 0:a["service.version"])&&void 0!==r?r:null==e?void 0:e.serviceVersion,environment:null!==(n=null==a?void 0:a["deployment.environment"])&&void 0!==n?n:null==e?void 0:e.environment,resourceAttributes:a,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(o=null==e?void 0:e.flushIntervalMs)&&void 0!==o?o:1e4,maxSeriesPerFlush:null!==(i=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==i?i:1e3}}(r),this.it)),this.sl}count(e,t,r){void 0===t&&(t=1),this.hl().count(e,t,r)}gauge(e,t,r){this.hl().gauge(e,t,r)}histogram(e,t,r){this.hl().histogram(e,t,r)}flush(e){if(!this.sl)return Promise.resolve();if(e){var t=this.sl.drainWindow();return t&&this.Kt(t,e),Promise.resolve()}return this.sl.flush().catch(e=>this.it.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.sl)||e.reset()}ll(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Kt:e=>t.Kt(e),getLibraryId:()=>Gp.LIB_NAME,getLibraryVersion:()=>Gp.LIB_VERSION}}Kt(e,t){return new Promise(r=>{var n=!1,o=e=>{n||(n=!0,clearTimeout(i),r(e))},i=setTimeout(()=>o({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(Yp({method:"POST",url:this.wl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)o({kind:"ok"});else if(413===t)o({kind:"too-large"});else if(0!==t&&429!==t&&500>t)o({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var r;o({kind:"retry-later",error:null!==(r=e.error)&&void 0!==r?r:new Error("metrics request failed with status "+t)})}}}))})}wl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},bk=Yp({},ak,sk,lk,ck,dk,uk,pk,hk,vk,fk,mk,gk,yk);fS.__defaultExtensionClasses=Yp({},bk);var xk,wk,Sk,kk,_k,Ck,Ak,jk,Ik,Pk,Rk=function(){Gp.SDK_DIST_CHANNEL="npm";var e=tS[cS]=new fS;return function(){function e(){e.done||(e.done=!0,dS=!1,py(tS,function(e){e._dom_loaded()}))}null!=Op&&Op.addEventListener?"complete"===Op.readyState?e():wy(Op,"DOMContentLoaded",e,{capture:!1}):Dp&&Jm.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}(),Tk=(xk=new WeakMap,wk=new WeakMap,Sk=new WeakMap,kk=new WeakMap,_k=new WeakSet,class extends qs{constructor(e){super(),Ha(this,_k),Wa(this,xk,void 0),Wa(this,wk,void 0),Wa(this,Sk,void 0),Wa(this,kk,void 0),Ua(xk,this,e.client),this.mutationId=e.mutationId,Ua(Sk,this,e.mutationCache),Ua(wk,this,[]),this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){$a(wk,this).includes(e)||($a(wk,this).push(e),this.clearGcTimeout(),$a(Sk,this).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ua(wk,this,$a(wk,this).filter(t=>t!==e)),this.scheduleGc(),$a(Sk,this).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){$a(wk,this).length||("pending"===this.state.status?this.scheduleGc():$a(Sk,this).remove(this))}continue(){var e,t;return null!==(e=null===(t=$a(kk,this))||void 0===t?void 0:t.continue())&&void 0!==e?e:this.execute(this.state.variables)}async execute(e){var t;const r=()=>{Va(_k,this,Ek).call(this,{type:"continue"})},n={client:$a(xk,this),meta:this.options.meta,mutationKey:this.options.mutationKey};Ua(kk,this,Ls({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{Va(_k,this,Ek).call(this,{type:"failed",failureCount:e,error:t})},onPause:()=>{Va(_k,this,Ek).call(this,{type:"pause"})},onContinue:r,retry:null!==(t=this.options.retry)&&void 0!==t?t:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$a(Sk,this).canRun(this)}));const o="pending"===this.state.status,i=!$a(kk,this).canStart();try{var a,s,l,c,d,u,h,p;if(o)r();else{var v,f;Va(_k,this,Ek).call(this,{type:"pending",variables:e,isPaused:i}),$a(Sk,this).config.onMutate&&await $a(Sk,this).config.onMutate(e,this,n);const t=await(null===(v=(f=this.options).onMutate)||void 0===v?void 0:v.call(f,e,n));t!==this.state.context&&Va(_k,this,Ek).call(this,{type:"pending",context:t,variables:e,isPaused:i})}const t=await $a(kk,this).start();return await(null===(a=(s=$a(Sk,this).config).onSuccess)||void 0===a?void 0:a.call(s,t,e,this.state.context,this,n)),await(null===(l=(c=this.options).onSuccess)||void 0===l?void 0:l.call(c,t,e,this.state.context,n)),await(null===(d=(u=$a(Sk,this).config).onSettled)||void 0===d?void 0:d.call(u,t,null,this.state.variables,this.state.context,this,n)),await(null===(h=(p=this.options).onSettled)||void 0===h?void 0:h.call(p,t,null,e,this.state.context,n)),Va(_k,this,Ek).call(this,{type:"success",data:t}),t}catch(_){try{var m,g;await(null===(m=(g=$a(Sk,this).config).onError)||void 0===m?void 0:m.call(g,_,e,this.state.context,this,n))}catch(Mp){Promise.reject(Mp)}try{var y,b;await(null===(y=(b=this.options).onError)||void 0===y?void 0:y.call(b,_,e,this.state.context,n))}catch(Mp){Promise.reject(Mp)}try{var x,w;await(null===(x=(w=$a(Sk,this).config).onSettled)||void 0===x?void 0:x.call(w,void 0,_,this.state.variables,this.state.context,this,n))}catch(Mp){Promise.reject(Mp)}try{var S,k;await(null===(S=(k=this.options).onSettled)||void 0===S?void 0:S.call(k,void 0,_,e,this.state.context,n))}catch(Mp){Promise.reject(Mp)}throw Va(_k,this,Ek).call(this,{type:"error",error:_}),_}finally{$a(Sk,this).runNext(this)}}});function Ek(e){this.state=(t=>{switch(e.type){case"failed":return(0,Ae.A)((0,Ae.A)({},t),{},{failureCount:e.failureCount,failureReason:e.error});case"pause":return(0,Ae.A)((0,Ae.A)({},t),{},{isPaused:!0});case"continue":return(0,Ae.A)((0,Ae.A)({},t),{},{isPaused:!1});case"pending":return(0,Ae.A)((0,Ae.A)({},t),{},{context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()});case"success":return(0,Ae.A)((0,Ae.A)({},t),{},{data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return(0,Ae.A)((0,Ae.A)({},t),{},{data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"})}})(this.state),Ps.batch(()=>{$a(wk,this).forEach(t=>{t.onMutationUpdate(e)}),$a(Sk,this).notify({mutation:this,type:"updated",action:e})})}var zk=(Ck=new WeakMap,Ak=new WeakMap,jk=new WeakMap,Ik=new WeakMap,Pk=new WeakSet,class extends Ya{constructor(e,t){super(),Ha(this,Pk),Wa(this,Ck,void 0),Wa(this,Ak,void 0),Wa(this,jk,void 0),Wa(this,Ik,void 0),Ua(Ck,this,e),this.setOptions(t),this.bindMethods(),Va(Pk,this,Dk).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var t;const r=this.options;this.options=$a(Ck,this).defaultMutationOptions(e),vs(this.options,r)||$a(Ck,this).getMutationCache().notify({type:"observerOptionsUpdated",mutation:$a(jk,this),observer:this}),null!==r&&void 0!==r&&r.mutationKey&&this.options.mutationKey&&ds(r.mutationKey)!==ds(this.options.mutationKey)?this.reset():"pending"===(null===(t=$a(jk,this))||void 0===t?void 0:t.state.status)&&$a(jk,this).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(null===(e=$a(jk,this))||void 0===e||e.removeObserver(this))}onMutationUpdate(e){Va(Pk,this,Dk).call(this),Va(Pk,this,Mk).call(this,e)}getCurrentResult(){return $a(Ak,this)}reset(){var e;null===(e=$a(jk,this))||void 0===e||e.removeObserver(this),Ua(jk,this,void 0),Va(Pk,this,Dk).call(this),Va(Pk,this,Mk).call(this)}mutate(e,t){var r;return Ua(Ik,this,t),null===(r=$a(jk,this))||void 0===r||r.removeObserver(this),Ua(jk,this,$a(Ck,this).getMutationCache().build($a(Ck,this),this.options)),$a(jk,this).addObserver(this),$a(jk,this).execute(e)}});function Dk(){var e,t;const r=null!==(e=null===(t=$a(jk,this))||void 0===t?void 0:t.state)&&void 0!==e?e:{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0};Ua(Ak,this,(0,Ae.A)((0,Ae.A)({},r),{},{isPending:"pending"===r.status,isSuccess:"success"===r.status,isError:"error"===r.status,isIdle:"idle"===r.status,mutate:this.mutate,reset:this.reset}))}function Mk(e){Ps.batch(()=>{if($a(Ik,this)&&this.hasListeners()){const c=$a(Ak,this).variables,d=$a(Ak,this).context,u={client:$a(Ck,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===(null===e||void 0===e?void 0:e.type)){try{var t,r;null===(t=(r=$a(Ik,this)).onSuccess)||void 0===t||t.call(r,e.data,c,d,u)}catch(Mp){Promise.reject(Mp)}try{var n,o;null===(n=(o=$a(Ik,this)).onSettled)||void 0===n||n.call(o,e.data,null,c,d,u)}catch(Mp){Promise.reject(Mp)}}else if("error"===(null===e||void 0===e?void 0:e.type)){try{var i,a;null===(i=(a=$a(Ik,this)).onError)||void 0===i||i.call(a,e.error,c,d,u)}catch(Mp){Promise.reject(Mp)}try{var s,l;null===(s=(l=$a(Ik,this)).onSettled)||void 0===s||s.call(l,void 0,e.error,c,d,u)}catch(Mp){Promise.reject(Mp)}}}this.listeners.forEach(e=>{e($a(Ak,this))})})}function Lk(e,t){const r=zl(t),n=o.useState(()=>new zk(r,e)),i=(0,s.A)(n,1)[0];o.useEffect(()=>{i.setOptions(e)},[i,e]);const a=o.useSyncExternalStore(o.useCallback(e=>i.subscribe(Ps.batchCalls(e)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=o.useCallback((e,t)=>{i.mutate(e,t).catch(rs)},[i]);if(a.error&&ks(i.options.throwOnError,[a.error]))throw a.error;return(0,Ae.A)((0,Ae.A)({},a),{},{mutate:l,mutateAsync:a.mutate})}const Ok=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],Fk="toppi_utm";const Nk="toppi_referral_code",Bk=async e=>{const t=await e(),r=localStorage.getItem(Nk),n=function(){try{const e=localStorage.getItem(Fk);if(!e)return null;const t=JSON.parse(e);return t&&"object"===typeof t?t:null}catch(e){return null}}(),o={Authorization:null!==t&&void 0!==t?t:"","Content-Type":"application/json"};if(r&&(o["X-Referral-Code"]=r),n){const e=JSON.stringify(n);(e=>{for(let t=0;t255||0===r||10===r||13===r)return!1}return!0})(e)&&(o["X-Utm-Data"]=e)}const i=await fetch("".concat(IW,"/api/me"),{headers:o});if(!i.ok)throw new Error("HTTP ".concat(i.status));r&&localStorage.removeItem(Nk),n&&localStorage.removeItem(Fk);const a=await i.text();return a?JSON.parse(a):null},Hk=()=>{const e=Ma(),t=e.getIdToken,r=ql({queryKey:["userProfile"],queryFn:()=>Bk(t),enabled:e.isAuthenticated,staleTime:3e5}),n=Ql().subscription,i=r.data;return(0,o.useEffect)(()=>{i&&(function(e){var t;if(!Jk)return;if(!Qk)return void(Yk=e);Rk.identify(e.userId,{email:e.email,plan:null!==(t=e.plan)&&void 0!==t?t:"unknown"})}({userId:i.id,email:i.email,plan:null===n||void 0===n?void 0:n.planTier}),i.onboardingCompleted||function(){const e=function(){var e;return null!==(e=Vk)&&void 0!==e?e:$k()}();t_("user_signed_up",{referredBy:e.referredBy,utmSource:e.utmSource,utmMedium:e.utmMedium,utmCampaign:e.utmCampaign})}())},[i,null===n||void 0===n?void 0:n.planTier]),r},Wk=()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=await e(),o=await fetch("".concat(IW,"/api").concat(t),(0,Ae.A)((0,Ae.A)({},r),{},{headers:(0,Ae.A)({Authorization:null!==n&&void 0!==n?n:"","Content-Type":"application/json"},r.headers||{})}));if(!o.ok)throw new Error("HTTP ".concat(o.status));const i=await o.text();return i?JSON.parse(i):null}(e,"/me",{method:"PATCH",body:JSON.stringify({onboardingCompleted:!0})}),onSuccess:(e,r)=>{Zk("onboarding_completed",r?{skipped:r.skipped,use_case:r.useCase}:void 0),t.invalidateQueries({queryKey:["userProfile"]})}})};let Vk=null;function $k(){return Vk||(Vk=function(){let e=!1;try{e=!!window.localStorage.getItem(Nk)}catch(r){}const t=new URLSearchParams(window.location.search);return{referredBy:e,utmSource:t.get("utm_source"),utmMedium:t.get("utm_medium"),utmCampaign:t.get("utm_campaign"),utmContent:t.get("utm_content"),utmTerm:t.get("utm_term")}}(),Vk)}const Uk="toppi_analytics_consent";function qk(){try{const e=window.localStorage.getItem(Uk);return"accepted"===e||"declined"===e?e:null}catch(e){return null}}const Kk=new Set;function Gk(e){!function(e){try{window.localStorage.setItem(Uk,e)}catch(t){}}(e),Kk.forEach(t=>t(e))}const Jk=!1;let Qk=!1;let Yk=null;function Xk(){Yk=null,Qk&&Rk.reset()}function Zk(e,t){Qk&&Rk.capture(e,t)}const e_="toppi_analytics_fired:";function t_(e,t){(function(e){try{return!!window.localStorage.getItem(e_+e)}catch(t){return!1}})(e)||Qk&&(!function(e){try{window.localStorage.setItem(e_+e,"1")}catch(t){}}(e),Rk.capture(e,t))}function r_(){var e,t,r,n,o,i;const a=Ma(),s=a.logout,l=a.login,c=a.isAuthenticated,d=a.isLoading,u=Ma(),h=u.user,p=null!==(e=null!==(t=null===h||void 0===h||null===(r=h.given_name)||void 0===r||null===(n=r[0])||void 0===n?void 0:n.toUpperCase())&&void 0!==t?t:null===h||void 0===h||null===(o=h.email)||void 0===o||null===(i=o[0])||void 0===i?void 0:i.toUpperCase())&&void 0!==e?e:null;return d?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,tr.jsx)(An,{})}):c?(0,tr.jsx)(we,{to:"/dashboard",replace:!0}):(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Td,{title:"Toppi \u2014 AI Property Search UK",description:"Toppi searches Rightmove, Zoopla & OnTheMarket, ranks every listing by your requirements, and alerts you the moment the right home appears.",canonicalPath:"/"}),(0,tr.jsx)(Er.Header,{children:(0,tr.jsxs)(Tr,{sx:{display:"flex",flexGrow:1,justifyContent:"space-between",backgroundColor:"background.surface"},children:[(0,tr.jsx)(Mn,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,children:(0,tr.jsx)(Gn,{level:"h3",children:"Toppi"})}),u.isAuthenticated?(0,tr.jsxs)($d,{children:[(0,tr.jsx)(Zd,{variant:"plain",size:"sm",sx:{maxWidth:"32px",maxHeight:"32px",borderRadius:"9999999px"},children:(0,tr.jsx)(Xo,{sx:{maxWidth:"32px",maxHeight:"32px"},children:p})}),(0,tr.jsxs)(hp,{placement:"bottom-end",size:"sm",sx:{zIndex:"99999",p:1,gap:1,"--ListItem-radius":"var(--joy-radius-sm)"},children:[(0,tr.jsx)(Ip,{children:(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center"},children:[(0,tr.jsx)(Xo,{sx:{borderRadius:"50%"},children:p}),(0,tr.jsxs)(Tr,{sx:{ml:1.5},children:[(0,tr.jsx)(Gn,{level:"title-sm",textColor:"text.primary",children:"".concat(null===h||void 0===h?void 0:h.given_name," ").concat(null===h||void 0===h?void 0:h.family_name)}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:null===h||void 0===h?void 0:h.email})]})]})}),(0,tr.jsx)(Ep,{}),(0,tr.jsxs)(Ip,{onClick:()=>{Xk(),s()},children:[(0,tr.jsx)(zp.A,{}),"Log out"]})]})]}):(0,tr.jsx)(wo,{color:"neutral",onClick:()=>l(),variant:"soft",children:"Login"})]})}),(0,tr.jsx)(Lo,{login:async()=>{try{await l()}catch(e){console.error("Login failed:",e)}},isAuthenticated:c}),(0,tr.jsx)(vi,{}),(0,tr.jsx)(Yl,{}),(0,tr.jsx)(jc,{})]})}var n_=r(4676),o_=r(3602),i_=r(71);const a_=new Uint8Array(16);const s_=[];for(let FW=0;FW<256;++FW)s_.push((FW+256).toString(16).slice(1));function l_(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(s_[e[t+0]]+s_[e[t+1]]+s_[e[t+2]]+s_[e[t+3]]+"-"+s_[e[t+4]]+s_[e[t+5]]+"-"+s_[e[t+6]]+s_[e[t+7]]+"-"+s_[e[t+8]]+s_[e[t+9]]+"-"+s_[e[t+10]]+s_[e[t+11]]+s_[e[t+12]]+s_[e[t+13]]+s_[e[t+14]]+s_[e[t+15]]).toLowerCase()}const c_=function(e,t,r){return t||e||!crypto.randomUUID?function(e,t,r){var n,o,i,a;e=e||{};const s=null!==(n=null!==(o=e.random)&&void 0!==o?o:null===(i=(a=e).rng)||void 0===i?void 0:i.call(a))&&void 0!==n?n:crypto.getRandomValues(a_);if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError("UUID byte range ".concat(r,":").concat(r+15," is out of buffer bounds"));for(let e=0;e<16;++e)t[r+e]=s[e];return t}return l_(s)}(e,t,r):crypto.randomUUID()};function d_(e){return xr("MuiListSubheader",e)}wr("MuiListSubheader",["root","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]);const u_=["component","className","children","id","sticky","variant","color","slots","slotProps"],h_=Qr("div",{name:"JoyListSubheader",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o;return(0,je.A)({boxSizing:"border-box",display:"flex",alignItems:"center",marginInline:"var(--ListItem-marginInline)",paddingBlock:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",minBlockSize:"var(--ListItem-minHeight)"},t.typography["body-xs"],{fontSize:"max(0.75em, 0.625rem)",textTransform:"uppercase",letterSpacing:"0.1em"},r.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:"var(--ListItem-stickyBackground)"},{color:r.color?"var(--_Link-color, rgba(".concat(null==(n=t.vars.palette[r.color])?void 0:n.mainChannel," / 1))"):t.vars.palette.text.tertiary},r.instanceColor&&{["&:not([".concat(ei,"])")]:{"--_Link-color":t.vars.palette.text.secondary}},null==(o=t.variants[r.variant])?void 0:o[r.color])}),p_=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListSubheader"}),n=r.component,i=r.className,a=r.children,l=r.id,c=r.sticky,d=void 0!==c&&c,u=r.variant,h=r.color,p=r.slots,v=void 0===p?{}:p,f=r.slotProps,m=void 0===f?{}:f,g=(0,Ie.A)(r,u_),y=gi(l),b=o.useContext(Gi);o.useEffect(()=>{b&&b(y||"")},[b,y]);const x=(0,je.A)({instanceColor:e.color},r,{id:y,sticky:d,variant:u,color:u?null!=h?h:"neutral":h}),w=(e=>{const t=e.variant,r=e.color;return Dr({root:["root",e.sticky&&"sticky",r&&"color".concat(Le(r)),t&&"variant".concat(Le(t))]},d_,{})})(x),S=(0,je.A)({},g,{component:n,slots:v,slotProps:m}),k=pn("root",{ref:t,className:(0,Pe.A)(w.root,i),elementType:h_,externalForwardedProps:S,ownerState:x,additionalProps:{as:n,id:y}}),_=(0,s.A)(k,2),C=_[0],A=_[1];return(0,tr.jsx)(C,(0,je.A)({},A,{children:a}))}),v_=p_,f_=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function m_(e){const t=[],r=[];return Array.from(e.querySelectorAll(f_)).forEach((e,n)=>{const o=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==o&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector('input[type="radio"]'.concat(t));let r=t('[name="'.concat(e.name,'"]:checked'));return r||(r=t('[name="'.concat(e.name,'"]'))),r!==e}(e))}(e)&&(0===o?t.push(e):r.push({documentOrder:n,tabIndex:o,node:e}))}),r.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function g_(){return!0}function y_(e){const t=e.children,r=e.disableAutoFocus,n=void 0!==r&&r,i=e.disableEnforceFocus,a=void 0!==i&&i,s=e.disableRestoreFocus,l=void 0!==s&&s,c=e.getTabbable,d=void 0===c?m_:c,u=e.isEnabled,h=void 0===u?g_:u,p=e.open,v=o.useRef(!1),f=o.useRef(null),m=o.useRef(null),g=o.useRef(null),y=o.useRef(null),b=o.useRef(!1),x=o.useRef(null),w=rn($h(t),x),S=o.useRef(null);o.useEffect(()=>{p&&x.current&&(b.current=!n)},[n,p]),o.useEffect(()=>{if(!p||!x.current)return;const e=Iu(x.current);return x.current.contains(e.activeElement)||(x.current.hasAttribute("tabIndex")||x.current.setAttribute("tabIndex","-1"),b.current&&x.current.focus()),()=>{l||(g.current&&g.current.focus&&(v.current=!0,g.current.focus()),g.current=null)}},[p]),o.useEffect(()=>{if(!p||!x.current)return;const e=Iu(x.current),t=t=>{S.current=t,!a&&h()&&"Tab"===t.key&&e.activeElement===x.current&&t.shiftKey&&(v.current=!0,m.current&&m.current.focus())},r=()=>{const t=x.current;if(null===t)return;if(!e.hasFocus()||!h()||v.current)return void(v.current=!1);if(t.contains(e.activeElement))return;if(a&&e.activeElement!==f.current&&e.activeElement!==m.current)return;if(e.activeElement!==y.current)y.current=null;else if(null!==y.current)return;if(!b.current)return;let r=[];if(e.activeElement!==f.current&&e.activeElement!==m.current||(r=d(x.current)),r.length>0){var n,o;const e=Boolean((null==(n=S.current)?void 0:n.shiftKey)&&"Tab"===(null==(o=S.current)?void 0:o.key)),t=r[0],i=r[r.length-1];"string"!==typeof t&&"string"!==typeof i&&(e?i.focus():t.focus())}else t.focus()};e.addEventListener("focusin",r),e.addEventListener("keydown",t,!0);const n=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&r()},50);return()=>{clearInterval(n),e.removeEventListener("focusin",r),e.removeEventListener("keydown",t,!0)}},[n,a,l,h,p,d]);const k=e=>{null===g.current&&(g.current=e.relatedTarget),b.current=!0};return(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)("div",{tabIndex:p?0:-1,onFocus:k,ref:f,"data-testid":"sentinelStart"}),o.cloneElement(t,{ref:w,onFocus:e=>{null===g.current&&(g.current=e.relatedTarget),b.current=!0,y.current=e.target;const r=t.props.onFocus;r&&r(e)}}),(0,tr.jsx)("div",{tabIndex:p?0:-1,onFocus:k,ref:m,"data-testid":"sentinelEnd"})]})}const b_=function(e){const t=o.useRef(e);return eu(()=>{t.current=e}),o.useRef(function(){return(0,t.current)(...arguments)}).current};function x_(){for(var e=arguments.length,t=new Array(e),r=0;rnull==t?e:function(){for(var r=arguments.length,n=new Array(r),o=0;o{})}function w_(e){return Iu(e).defaultView||window}function S_(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function k_(e){return parseInt(w_(e).getComputedStyle(e).paddingRight,10)||0}function __(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,e=>{const t=-1===i.indexOf(e),r=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),r="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||r}(e);t&&r&&S_(e,o)})}function C_(e,t){let r=-1;return e.some((e,n)=>!!t(e)&&(r=n,!0)),r}function A_(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(function(e){const t=Iu(e);return t.body===e?w_(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(n)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(Iu(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight="".concat(k_(n)+e,"px");const t=Iu(n).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{r.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight="".concat(k_(t)+e,"px")})}let e;if(n.parentNode instanceof DocumentFragment)e=Iu(n).body;else{const t=n.parentElement,r=w_(n);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===r.getComputedStyle(t).overflowY?t:n}r.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{r.forEach(e=>{let t=e.value,r=e.el,n=e.property;t?r.style.setProperty(n,t):r.style.removeProperty(n)})}}const j_=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&S_(e.modalRef,!1);const n=function(e){const t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);__(t,e.mount,e.modalRef,n,!0);const o=C_(this.containers,e=>e.container===t);return-1!==o?(this.containers[o].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:n}),r)}mount(e,t){const r=C_(this.containers,t=>-1!==t.modals.indexOf(e)),n=this.containers[r];n.restore||(n.restore=A_(n,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(e);if(-1===r)return r;const n=C_(this.containers,t=>-1!==t.modals.indexOf(e)),o=this.containers[n];if(o.modals.splice(o.modals.indexOf(e),1),this.modals.splice(r,1),0===o.modals.length)o.restore&&o.restore(),e.modalRef&&S_(e.modalRef,t),__(o.container,e.mount,e.modalRef,o.hiddenSiblings,!1),this.containers.splice(n,1);else{const e=o.modals[o.modals.length-1];e.modalRef&&S_(e.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function I_(e){const t=e.container,r=e.disableEscapeKeyDown,n=void 0!==r&&r,i=e.disableScrollLock,a=void 0!==i&&i,l=e.manager,c=void 0===l?j_:l,d=e.closeAfterTransition,u=void 0!==d&&d,h=e.onTransitionEnter,p=e.onTransitionExited,v=e.children,f=e.onClose,m=e.open,g=e.rootRef,y=o.useRef({}),b=o.useRef(null),x=o.useRef(null),w=rn(x,g),S=o.useState(!m),k=(0,s.A)(S,2),_=k[0],C=k[1],A=function(e){return!!e&&e.props.hasOwnProperty("in")}(v);let j=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(j=!1);const I=()=>(y.current.modalRef=x.current,y.current.mount=b.current,y.current),P=()=>{c.mount(I(),{disableScrollLock:a}),x.current&&(x.current.scrollTop=0)},R=b_(()=>{const e=function(e){return"function"===typeof e?e():e}(t)||Iu(b.current).body;c.add(I(),e),x.current&&P()}),T=o.useCallback(()=>c.isTopModal(I()),[c]),E=b_(e=>{b.current=e,e&&(m&&T()?P():x.current&&S_(x.current,j))}),z=o.useCallback(()=>{c.remove(I(),j)},[j,c]);o.useEffect(()=>()=>{z()},[z]),o.useEffect(()=>{m?R():A&&u||z()},[m,z,A,u,R]);const D=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&T()&&(n||(t.stopPropagation(),f&&f(t,"escapeKeyDown")))},M=e=>t=>{var r;null==(r=e.onClick)||r.call(e,t),t.target===t.currentTarget&&f&&f(t,"backdropClick")};return{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=on(e);delete r.onTransitionEnter,delete r.onTransitionExited;const n=(0,je.A)({},r,t);return(0,je.A)({role:"presentation"},n,{onKeyDown:D(n),ref:w})},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({"aria-hidden":!0},e,{onClick:M(e),open:m})},getTransitionProps:()=>({onEnter:x_(()=>{C(!1),h&&h()},null==v?void 0:v.props.onEnter),onExited:x_(()=>{C(!0),p&&p(),u&&z()},null==v?void 0:v.props.onExited)}),rootRef:w,portalRef:E,isTopModal:T,exited:_,hasTransition:A}}function P_(e){return xr("MuiModal",e)}wr("MuiModal",["root","hidden","backdrop"]);const R_=o.createContext(void 0),T_=["children","container","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onClose","onKeyDown","open","component","slots","slotProps"],E_=Qr("div")(e=>{let t=e.ownerState,r=e.theme;return(0,je.A)({"--unstable_popup-zIndex":"calc(".concat(r.vars.zIndex.modal," + 1)"),'& ~ [role="listbox"]':{"--unstable_popup-zIndex":"calc(".concat(r.vars.zIndex.modal," + 1)")},position:"fixed",zIndex:r.vars.zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&{visibility:"hidden"})}),z_=Qr(E_,{name:"JoyModal",slot:"Root",overridesResolver:(e,t)=>t.root})({}),D_=Qr("div")(e=>({zIndex:-1,position:"fixed",right:0,bottom:0,top:0,left:0,backgroundColor:e.theme.vars.palette.background.backdrop,WebkitTapHighlightColor:"transparent",backdropFilter:"blur(8px)"})),M_=Qr(D_,{name:"JoyModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({}),L_=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyModal"}),n=r.children,i=r.container,a=r.disableAutoFocus,l=void 0!==a&&a,c=r.disableEnforceFocus,d=void 0!==c&&c,u=r.disableEscapeKeyDown,h=void 0!==u&&u,p=r.disablePortal,v=void 0!==p&&p,f=r.disableRestoreFocus,m=void 0!==f&&f,g=r.disableScrollLock,y=void 0!==g&&g,b=r.hideBackdrop,x=void 0!==b&&b,w=r.keepMounted,S=void 0!==w&&w,k=r.onClose,_=r.open,C=r.component,A=r.slots,j=void 0===A?{}:A,I=r.slotProps,P=void 0===I?{}:I,R=(0,Ie.A)(r,T_),T=(0,je.A)({},r,{disableAutoFocus:l,disableEnforceFocus:d,disableEscapeKeyDown:h,disablePortal:v,disableRestoreFocus:m,disableScrollLock:y,hideBackdrop:x,keepMounted:S}),E=I_((0,je.A)({},T,{rootRef:t})),z=E.getRootProps,D=E.getBackdropProps,M=E.rootRef,L=E.portalRef,O=E.isTopModal,F=(e=>Dr({root:["root",!e.open&&"hidden"],backdrop:["backdrop"]},P_,{}))(T),N=(0,je.A)({},R,{component:C,slots:j,slotProps:P}),B=pn("root",{ref:M,className:F.root,elementType:z_,externalForwardedProps:N,getSlotProps:z,ownerState:T}),H=(0,s.A)(B,2),W=H[0],V=H[1],$=pn("backdrop",{className:F.backdrop,elementType:M_,externalForwardedProps:N,getSlotProps:D,ownerState:T}),U=(0,s.A)($,2),q=U[0],K=U[1];return S||_?(0,tr.jsx)(R_.Provider,{value:k,children:(0,tr.jsx)(Uh,{ref:L,container:i,disablePortal:v,children:(0,tr.jsxs)(W,(0,je.A)({},V,{children:[x?null:(0,tr.jsx)(q,(0,je.A)({},K)),(0,tr.jsx)(y_,{disableEnforceFocus:d,disableAutoFocus:l,disableRestoreFocus:m,isEnabled:O,open:_,children:o.Children.only(n)&&o.cloneElement(n,(0,je.A)({},void 0===n.props.tabIndex&&{tabIndex:-1}))})]}))})}):null});function O_(e){return xr("MuiModalDialog",e)}const F_=wr("MuiModalDialog",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","layoutCenter","layoutFullscreen"]);const N_=o.createContext(void 0);const B_=o.createContext(void 0),H_=["className","children","invertedColors","orientation","color","component","variant","size","layout","maxWidth","minWidth","slots","slotProps"];function W_(e,t){var r,n;return t&&null!=(r=e.breakpoints)&&r.values[t]?"".concat(null==(n=e.breakpoints)?void 0:n.values[t],"px"):t}const V_=Qr(ci,{name:"JoyModalDialog",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({"--ModalDialog-minWidth":"number"===typeof r.minWidth?"".concat(r.minWidth,"px"):W_(t,r.minWidth),"--ModalDialog-maxWidth":"number"===typeof r.maxWidth?"".concat(r.maxWidth,"px"):W_(t,r.maxWidth),"--ModalClose-radius":"max((var(--Card-radius) - var(--variant-borderWidth, 0px)) - var(--ModalClose-inset), min(var(--ModalClose-inset) / 2, (var(--Card-radius) - var(--variant-borderWidth, 0px)) / 2))"},"solid"===r.variant&&{"--DialogContent-color":"currentColor"},"sm"===r.size&&{"--Card-padding":"1rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.25),"--ModalClose-inset":"0.375rem"},"md"===r.size&&{"--Card-padding":"1.25rem","--ModalDialog-titleOffset":t.spacing(.25),"--ModalDialog-descriptionOffset":t.spacing(.75),"--ModalClose-inset":"0.5rem"},"lg"===r.size&&{"--Card-padding":"1.5rem","--ModalDialog-titleOffset":t.spacing(.5),"--ModalDialog-descriptionOffset":t.spacing(1),"--ModalClose-inset":"0.625rem"},{boxSizing:"border-box",boxShadow:t.shadow.md,minWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-minWidth, 300px))",outline:0,position:"absolute"},"fullscreen"===r.layout&&{top:0,left:0,right:0,bottom:0,border:0,borderRadius:0},"center"===r.layout&&{top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"min(calc(100vw - 2 * var(--Card-padding)), var(--ModalDialog-maxWidth, 100vw))",maxHeight:"calc(100% - 2 * var(--Card-padding))"},{['& [id="'.concat(r["aria-labelledby"],'"]')]:{"--Typography-margin":"calc(-1 * var(--ModalDialog-titleOffset)) 0 var(--ModalDialog-gap) 0","--Typography-fontSize":"1.125em",['& + [id="'.concat(r["aria-describedby"],'"]')]:{"--unstable_ModalDialog-descriptionOffset":"calc(-1 * var(--ModalDialog-descriptionOffset))"}},['& [id="'.concat(r["aria-describedby"],'"]')]:{"--Typography-fontSize":"1em","--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 0 0","&:not(:last-child)":{"--Typography-margin":"var(--unstable_ModalDialog-descriptionOffset, var(--ModalDialog-gap)) 0 var(--ModalDialog-gap) 0"}}})}),$_=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyModalDialog"}),n=r.className,i=r.children,a=r.invertedColors,l=void 0!==a&&a,c=r.orientation,d=void 0===c?"vertical":c,u=r.color,h=void 0===u?"neutral":u,p=r.component,v=void 0===p?"div":p,f=r.variant,m=void 0===f?"outlined":f,g=r.size,y=void 0===g?"md":g,b=r.layout,x=void 0===b?"center":b,w=r.maxWidth,S=r.minWidth,k=r.slots,_=void 0===k?{}:k,C=r.slotProps,A=void 0===C?{}:C,j=(0,Ie.A)(r,H_),I=(0,je.A)({},r,{color:h,component:v,maxWidth:w,minWidth:S,layout:x,size:y,variant:m,invertedColors:l}),P=(e=>{const t=e.variant,r=e.color,n=e.size,o=e.layout;return Dr({root:["root",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r)),n&&"size".concat(Le(n)),o&&"layout".concat(Le(o))]},O_,{})})(I),R=(0,je.A)({},j,{component:v,slots:_,slotProps:A}),T=gi(),E=gi(),z=o.useMemo(()=>({variant:m,color:h,labelledBy:T,describedBy:E}),[h,m,T,E]),D=pn("root",{ref:t,className:(0,Pe.A)(P.root,n),elementType:V_,externalForwardedProps:R,ownerState:I,additionalProps:{as:v,role:"dialog","aria-modal":"true","aria-labelledby":T,"aria-describedby":E}}),M=(0,s.A)(D,2),L=M[0],O=M[1];return(0,tr.jsx)(N_.Provider,{value:y,children:(0,tr.jsx)(B_.Provider,{value:z,children:(0,tr.jsx)(L,(0,je.A)({},O,{children:o.Children.map(i,(e,t)=>{if(!o.isValidElement(e))return e;const r={};if(Ln(e,["Divider"])){var n,a;const t=e.props;r.inset=null!=(n=null==t?void 0:t.inset)?n:"context";const o="vertical"===d?"horizontal":"vertical";r.orientation=null!=(a=null==t?void 0:t.orientation)?a:o}return 0===t&&(r["data-first-child"]=""),t===o.Children.count(i)-1&&(r["data-last-child"]=""),o.cloneElement(e,r)})}))})})}),U_=$_;function q_(e){return xr("MuiIconButton",e)}const K_=wr("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]),G_=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],J_=Qr("button")(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a;return[(0,je.A)({"--Icon-margin":"initial","--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon},r.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[r.instanceSize]},"sm"===r.size&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:t.vars.fontSize.sm,paddingInline:"2px"},"md"===r.size&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:t.vars.fontSize.md,paddingInline:"0.25rem"},"lg"===r.size&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:t.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:"var(--IconButton-radius, ".concat(t.vars.radius.sm,")"),border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[t.focus.selector]:(0,je.A)({"--Icon-color":"currentColor"},t.focus.default)}),(0,je.A)({},null==(n=t.variants[r.variant])?void 0:n[r.color],{"&:hover":{"@media (hover: hover)":(0,je.A)({"--Icon-color":"currentColor"},null==(o=t.variants["".concat(r.variant,"Hover")])?void 0:o[r.color])},'&:active, &[aria-pressed="true"]':(0,je.A)({"--Icon-color":"currentColor"},null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color]),"&:disabled":null==(a=t.variants["".concat(r.variant,"Disabled")])?void 0:a[r.color]})]}),Q_=Qr(J_,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Y_=Qr("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(e=>{let t=e.theme,r=e.ownerState;var n,o;return(0,je.A)({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:null==(n=t.variants[r.variant])||null==(n=n[r.color])?void 0:n.color},r.disabled&&{color:null==(o=t.variants["".concat(r.variant,"Disabled")])||null==(o=o[r.color])?void 0:o.color})}),X_=o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyIconButton"}),i=n.children,a=n.action,l=n.component,c=void 0===l?"button":l,d=n.color,u=void 0===d?"neutral":d,h=n.disabled,p=n.variant,v=void 0===p?"plain":p,f=n.loading,m=void 0!==f&&f,g=n.loadingIndicator,y=n.size,b=void 0===y?"md":y,x=n.slots,w=void 0===x?{}:x,S=n.slotProps,k=void 0===S?{}:S,_=(0,Ie.A)(n,G_),C=o.useContext(ho),A=o.useContext(po),j=e.variant||C.variant||v,I=e.size||C.size||b,P=e.color||C.color||u,R=null!=(r=e.loading||e.disabled)?r:C.disabled||m||h,T=o.useRef(null),E=rn(T,t),z=lo((0,je.A)({},n,{disabled:R,rootRef:E})),D=z.focusVisible,M=z.setFocusVisible,L=z.getRootProps,O=null!=g?g:(0,tr.jsx)(An,{color:P,thickness:{sm:2,md:3,lg:4}[I]||3});o.useImperativeHandle(a,()=>({focusVisible:()=>{var e;M(!0),null==(e=T.current)||e.focus()}}),[M]);const F=(0,je.A)({},n,{component:c,color:P,disabled:R,variant:j,loading:m,size:I,focusVisible:D,instanceSize:e.size}),N=(e=>{const t=e.color,r=e.disabled,n=e.focusVisible,o=e.focusVisibleClassName,i=e.size,a=e.variant,s=e.loading,l=Dr({root:["root",r&&"disabled",n&&"focusVisible",a&&"variant".concat(Le(a)),t&&"color".concat(Le(t)),i&&"size".concat(Le(i)),s&&"loading"],loadingIndicator:["loadingIndicator"]},q_,{});return n&&o&&(l.root+=" ".concat(o)),l})(F);let B=n["aria-pressed"];"function"===typeof k.root?B=k.root(F)["aria-pressed"]:k.root&&(B=k.root["aria-pressed"]),null!=A&&A.value&&(B=Array.isArray(A.value)?-1!==A.value.indexOf(n.value):A.value===n.value);const H=(0,je.A)({},_,{component:c,slots:w,slotProps:k}),W=pn("root",{ref:t,className:N.root,elementType:Q_,getSlotProps:L,externalForwardedProps:H,ownerState:F,additionalProps:{onClick:e=>{var t;let r=n.onClick;var o;("function"===typeof k.root?r=k.root(F).onClick:k.root&&(r=k.root.onClick),null==(t=r)||t(e),A)&&(null==(o=A.onClick)||o.call(A,e,n.value))},"aria-pressed":B}}),V=(0,s.A)(W,2),$=V[0],U=V[1],q=pn("loadingIndicator",{className:N.loadingIndicator,elementType:Y_,externalForwardedProps:H,ownerState:F}),K=(0,s.A)(q,2),G=K[0],J=K[1];return(0,tr.jsx)($,(0,je.A)({},U,{children:m?(0,tr.jsx)(G,(0,je.A)({},J,{children:O})):i}))});X_.muiName="IconButton";const Z_=X_;function eC(e){return xr("MuiModalClose",e)}wr("MuiModalClose",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const tC=Vo((0,tr.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var rC;const nC=["component","color","variant","size","onClick","slots","slotProps"],oC=Qr(J_,{name:"JoyModalClose",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n;return(0,je.A)({},"sm"===t.size&&{"--IconButton-size":"1.75rem"},"md"===t.size&&{"--IconButton-size":"2rem"},"lg"===t.size&&{"--IconButton-size":"2.25rem"},{position:"absolute",zIndex:1,top:"var(--ModalClose-inset, 0.625rem)",right:"var(--ModalClose-inset, 0.625rem)",borderRadius:"var(--ModalClose-radius, ".concat(r.vars.radius.sm,")")},!(null!=(n=r.variants[t.variant])&&null!=(n=n[t.color])&&n.backgroundColor)&&{color:r.vars.palette.text.secondary})}),iC={plain:"plain",outlined:"plain",soft:"soft",solid:"solid"},aC=o.forwardRef(function(e,t){var r,n,i,a,l,c;const d=en({props:e,name:"JoyModalClose"}),u=d.component,h=void 0===u?"button":u,p=d.color,v=void 0===p?"neutral":p,f=d.variant,m=void 0===f?"plain":f,g=d.size,y=void 0===g?"md":g,b=d.onClick,x=d.slots,w=void 0===x?{}:x,S=d.slotProps,k=void 0===S?{}:S,_=(0,Ie.A)(d,nC),C=o.useContext(R_),A=o.useContext(B_),j=null!=(r=null!=(n=e.variant)?n:iC[null==A?void 0:A.variant])?r:m,I=null!=(i=null!=(a=e.color)?a:null==A?void 0:A.color)?i:v,P=o.useContext(N_),R=null!=(l=null!=(c=e.size)?c:P)?l:y,T=lo((0,je.A)({},d,{rootRef:t})),E=T.focusVisible,z=T.getRootProps,D=(0,je.A)({},d,{color:I,component:h,variant:j,size:R,focusVisible:E}),M=(e=>{const t=e.variant,r=e.color,n=e.disabled,o=e.focusVisible,i=e.size;return Dr({root:["root",n&&"disabled",o&&"focusVisible",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r)),i&&"size".concat(Le(i))]},eC,{})})(D),L=pn("root",{ref:t,elementType:oC,getSlotProps:z,externalForwardedProps:(0,je.A)({onClick:e=>{null==C||C(e,"closeClick"),null==b||b(e)}},_,{component:h,slots:w,slotProps:k}),className:M.root,ownerState:D}),O=(0,s.A)(L,2),F=O[0],N=O[1];return(0,tr.jsx)(F,(0,je.A)({},N,{children:rC||(rC=(0,tr.jsx)(tC,{}))}))}),sC=aC;const lC=o.createContext(void 0);function cC(e){return xr("MuiFormControl",e)}const dC=wr("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);function uC(e){return xr("MuiSwitch",e)}const hC=wr("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),pC=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],vC=Qr("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i;return(0,je.A)({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":"horizontal"===r.orientation?"align-items":"flex-start","--FormLabel-asteriskColor":t.vars.palette.danger[500]},"sm"===r.size&&{"--FormLabel-fontSize":t.vars.fontSize.xs,"--FormLabel-lineHeight":t.vars.lineHeight.xl,"--FormLabel-margin":"horizontal"===r.orientation?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":t.vars.fontSize.xs,"--FormHelperText-lineHeight":t.vars.lineHeight.xl},"md"===r.size&&{"--FormLabel-fontSize":t.vars.fontSize.sm,"--FormLabel-lineHeight":t.vars.lineHeight.sm,"--FormLabel-margin":"horizontal"===r.orientation?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},"lg"===r.size&&{"--FormLabel-fontSize":t.vars.fontSize.md,"--FormLabel-lineHeight":t.vars.lineHeight.md,"--FormLabel-margin":"horizontal"===r.orientation?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":t.vars.fontSize.sm,"--FormHelperText-lineHeight":t.vars.lineHeight.sm},r.color&&{"--FormHelperText-color":null==(n=t.vars.palette[r.color])?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",["&.".concat(dC.error)]:{"--FormHelperText-color":t.vars.palette.danger[500]},["&.".concat(dC.disabled)]:{"--FormLabel-color":null==(o=t.variants.plainDisabled)||null==(o=o[r.color||"neutral"])?void 0:o.color,"--FormHelperText-color":null==(i=t.variants.plainDisabled)||null==(i=i[r.color||"neutral"])?void 0:i.color},display:"flex",position:"relative",flexDirection:"horizontal"===r.orientation?"row":"column"},"horizontal"===r.orientation&&{["& > label ~ .".concat(hC.root)]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),fC=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyFormControl"}),n=r.id,i=r.className,a=r.component,l=void 0===a?"div":a,c=r.disabled,d=void 0!==c&&c,u=r.required,h=void 0!==u&&u,p=r.error,v=void 0!==p&&p,f=r.color,m=r.size,g=void 0===m?"md":m,y=r.orientation,b=void 0===y?"vertical":y,x=r.slots,w=void 0===x?{}:x,S=r.slotProps,k=void 0===S?{}:S,_=(0,Ie.A)(r,pC),C=gi(n),A=o.useState(null),j=(0,s.A)(A,2),I=j[0],P=j[1],R=(0,je.A)({},r,{id:C,component:l,color:f,disabled:d,error:v,required:h,size:g,orientation:b});let T;const E=(e=>{const t=e.disabled,r=e.error,n=e.size,o=e.color;return Dr({root:["root",e.orientation,t&&"disabled",r&&"error",o&&"color".concat(Le(o)),n&&"size".concat(Le(n))]},cC,{})})(R),z=pn("root",{ref:t,className:(0,Pe.A)(E.root,i),elementType:vC,externalForwardedProps:(0,je.A)({},_,{component:l,slots:w,slotProps:k}),ownerState:R}),D=(0,s.A)(z,2),M=D[0],L=D[1],O=o.useMemo(()=>({disabled:d,required:h,error:v,color:f,size:g,htmlFor:C,labelId:"".concat(C,"-label"),"aria-describedby":I?"".concat(C,"-helper-text"):void 0,setHelperText:P,registerEffect:T}),[f,d,v,I,C,T,h,g]);return(0,tr.jsx)(lC.Provider,{value:O,children:(0,tr.jsx)(M,(0,je.A)({},L))})}),mC=fC;function gC(e){return xr("MuiFormLabel",e)}const yC=wr("MuiFormLabel",["root","asterisk"]),bC=["children","component","htmlFor","id","slots","slotProps"],xC=Qr("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme;return{"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:t.vars.fontFamily.body,fontSize:"var(--FormLabel-fontSize, ".concat(t.vars.fontSize.sm,")"),fontWeight:t.vars.fontWeight.md,lineHeight:"var(--FormLabel-lineHeight, ".concat(t.vars.lineHeight.sm,")"),color:"var(--FormLabel-color, ".concat(t.vars.palette.text.primary,")"),margin:"var(--FormLabel-margin, 0px)"}}),wC=Qr("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),SC=o.forwardRef(function(e,t){var r,n;const i=en({props:e,name:"JoyFormLabel"}),a=i.children,l=i.component,c=void 0===l?"label":l,d=i.htmlFor,u=i.id,h=i.slots,p=void 0===h?{}:h,v=i.slotProps,f=void 0===v?{}:v,m=(0,Ie.A)(i,bC),g=o.useContext(lC),y=null!=(r=null!=(n=e.required)?n:null==g?void 0:g.required)&&r,b=(0,je.A)({},i,{required:y}),x=Dr({root:["root"],asterisk:["asterisk"]},gC,{}),w=(0,je.A)({},m,{component:c,slots:p,slotProps:f}),S=pn("root",{additionalProps:{htmlFor:null!=d?d:null==g?void 0:g.htmlFor,id:null!=u?u:null==g?void 0:g.labelId},ref:t,className:x.root,elementType:xC,externalForwardedProps:w,ownerState:b}),k=(0,s.A)(S,2),_=k[0],C=k[1],A=pn("asterisk",{additionalProps:{"aria-hidden":!0},className:x.asterisk,elementType:wC,externalForwardedProps:w,ownerState:b}),j=(0,s.A)(A,2),I=j[0],P=j[1];return(0,tr.jsxs)(_,(0,je.A)({},C,{children:[a,y&&(0,tr.jsxs)(I,(0,je.A)({},P,{children:["\u2009","*"]}))]}))});function kC(e){return xr("MuiInput",e)}const _C=wr("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),CC=o.createContext(void 0);function AC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.defaultValue,r=e.disabled,n=void 0!==r&&r,i=e.error,a=void 0!==i&&i,l=e.onBlur,c=e.onChange,d=e.onFocus,u=e.required,h=void 0!==u&&u,p=e.value,v=e.inputRef,f=o.useContext(CC);let m,g,y,b,x;var w,S,k;f?(m=void 0,g=null!=(w=f.disabled)&&w,y=null!=(S=f.error)&&S,b=null!=(k=f.required)&&k,x=f.value):(m=t,g=n,y=a,b=h,x=p);const _=o.useRef(null!=x).current,C=o.useCallback(e=>{0},[]),A=o.useRef(null),j=rn(A,v,C),I=o.useState(!1),P=(0,s.A)(I,2),R=P[0],T=P[1];o.useEffect(()=>{!f&&g&&R&&(T(!1),null==l||l())},[f,g,R,l]);const E=e=>t=>{var r,n;null!=f&&f.disabled?t.stopPropagation():(null==(r=e.onFocus)||r.call(e,t),f&&f.onFocus?null==f||null==(n=f.onFocus)||n.call(f):T(!0))},z=e=>function(t){var r,n;if(!_){if(null==(t.target||A.current))throw new Error(Me(17))}null==f||null==(r=f.onChange)||r.call(f,t);for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a0&&void 0!==arguments[0]?arguments[0]:{};const t={onBlur:l,onChange:c,onFocus:d},r=(0,je.A)({},t,on(e)),n=(0,je.A)({},r,{onBlur:(o=r,e=>{var t;null==(t=o.onBlur)||t.call(o,e),f&&f.onBlur?f.onBlur():T(!1)}),onChange:z(r),onFocus:E(r)});var o;return(0,je.A)({},n,{"aria-invalid":y||void 0,defaultValue:m,value:x,required:b,disabled:g},e,{ref:j},n)},getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=on(e,["onBlur","onChange","onFocus"]),n=(0,je.A)({},r,on(t));return(0,je.A)({},t,n,{onClick:(o=n,e=>{var t;A.current&&e.currentTarget===e.target&&A.current.focus(),null==(t=o.onClick)||t.call(o,e)})});var o},inputRef:j,required:b,value:x}}const jC=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function IC(e,t){var r;const n=o.useContext(lC),i=e["aria-describedby"],a=e["aria-label"],s=e["aria-labelledby"],l=e.autoComplete,c=e.autoFocus,d=e.className,u=e.defaultValue,h=e.disabled,p=e.disabledInProp,v=e.error,f=e.id,m=e.name,g=e.onClick,y=e.onChange,b=e.onKeyDown,x=e.onKeyUp,w=e.onFocus,S=e.onBlur,k=e.placeholder,_=e.readOnly,C=e.required,A=e.type,j=e.value,I=(0,Ie.A)(e,jC),P=AC({disabled:null!=(r=null!=p?p:null==n?void 0:n.disabled)?r:h,defaultValue:u,error:v,onBlur:S,onClick:g,onChange:y,onFocus:w,required:null!=C?C:null==n?void 0:n.required,value:j}),R=P.getRootProps,T=P.getInputProps,E=P.focused,z=P.error,D=P.disabled,M={[t.disabled]:D,[t.error]:z,[t.focused]:E,[t.formControl]:Boolean(n),[d]:d},L={[t.disabled]:D},O={"aria-describedby":i,"aria-label":a,"aria-labelledby":s,autoComplete:l,autoFocus:c,disabled:D,id:f,onKeyDown:b,onKeyUp:x,name:m,placeholder:k,readOnly:_,type:A};return(0,je.A)({formControl:n,propsToForward:O,rootStateClasses:M,inputStateClasses:L,getRootProps:R,getInputProps:T,focused:E,error:z,disabled:D},I)}const PC=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],RC=Qr("div")(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l;const c=null==(n=t.variants["".concat(r.variant)])?void 0:n[r.color];return[(0,je.A)({"--Input-radius":t.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":t.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":t.vars.focus.thickness,"--Input-focusedHighlight":null==(o=t.vars.palette["neutral"===r.color?"primary":r.color])?void 0:o[500],["&:not([".concat(ei,"])")]:(0,je.A)({},r.instanceColor&&{"--_Input-focusedHighlight":null==(i=t.vars.palette["neutral"===r.instanceColor?"primary":r.instanceColor])?void 0:i[500]},{"--Input-focusedHighlight":"var(--_Input-focusedHighlight, ".concat(t.vars.palette.focusVisible,")")})},"sm"===r.size&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},"md"===r.size&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},"lg"===r.size&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},"plain"!==r.variant&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},r.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},t.typography["body-".concat(r.size)],c,{backgroundColor:null!=(a=null==c?void 0:c.backgroundColor)?a:t.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":(0,je.A)({},null==(s=t.variants["".concat(r.variant,"Hover")])?void 0:s[r.color],{backgroundColor:null}),["&.".concat(_C.disabled)]:null==(l=t.variants["".concat(r.variant,"Disabled")])?void 0:l[r.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),TC=Qr("input")(e=>{let t=e.ownerState;return{border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":(0,je.A)({paddingInline:"var(--Input-paddingInline)"},!t.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!t.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}}}),EC=Qr("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),zC=Qr("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),DC=Qr(RC,{name:"JoyInput",slot:"Root",overridesResolver:(e,t)=>t.root})({}),MC=Qr(TC,{name:"JoyInput",slot:"Input",overridesResolver:(e,t)=>t.input})({}),LC=Qr(EC,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({}),OC=Qr(zC,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({}),FC=o.forwardRef(function(e,t){var r,n,o,i,a,l;const c=en({props:e,name:"JoyInput"}),d=IC((0,je.A)({},c,{disabledInProp:e.disabled}),_C),u=d.propsToForward,h=d.rootStateClasses,p=d.inputStateClasses,v=d.getRootProps,f=d.getInputProps,m=d.formControl,g=d.focused,y=d.error,b=void 0!==y&&y,x=d.disabled,w=d.fullWidth,S=void 0!==w&&w,k=d.size,_=void 0===k?"md":k,C=d.color,A=void 0===C?"neutral":C,j=d.variant,I=void 0===j?"outlined":j,P=d.startDecorator,R=d.endDecorator,T=d.component,E=d.slots,z=void 0===E?{}:E,D=d.slotProps,M=void 0===D?{}:D,L=(0,Ie.A)(d,PC);const O=null!=(r=null!=(n=e.error)?n:null==m?void 0:m.error)?r:b,F=null!=(o=null!=(i=e.size)?i:null==m?void 0:m.size)?o:_,N=null!=(a=e.color)?a:O?"danger":null!=(l=null==m?void 0:m.color)?l:A,B=(0,je.A)({instanceColor:O?"danger":e.color},c,{fullWidth:S,color:N,disabled:x,error:O,focused:g,size:F,variant:I}),H=(e=>{const t=e.disabled,r=e.fullWidth,n=e.variant,o=e.color,i=e.size;return Dr({root:["root",t&&"disabled",r&&"fullWidth",n&&"variant".concat(Le(n)),o&&"color".concat(Le(o)),i&&"size".concat(Le(i))],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},kC,{})})(B),W=(0,je.A)({},L,{component:T,slots:z,slotProps:M}),V=pn("root",{ref:t,className:[H.root,h],elementType:DC,getSlotProps:v,externalForwardedProps:W,ownerState:B}),$=(0,s.A)(V,2),U=$[0],q=$[1],K=pn("input",(0,je.A)({},m&&{additionalProps:{id:m.htmlFor,"aria-describedby":m["aria-describedby"]}},{className:[H.input,p],elementType:MC,getSlotProps:f,internalForwardedProps:u,externalForwardedProps:W,ownerState:B})),G=(0,s.A)(K,2),J=G[0],Q=G[1],Y=pn("startDecorator",{className:H.startDecorator,elementType:LC,externalForwardedProps:W,ownerState:B}),X=(0,s.A)(Y,2),Z=X[0],ee=X[1],te=pn("endDecorator",{className:H.endDecorator,elementType:OC,externalForwardedProps:W,ownerState:B}),re=(0,s.A)(te,2),ne=re[0],oe=re[1];return(0,tr.jsxs)(U,(0,je.A)({},q,{children:[P&&(0,tr.jsx)(Z,(0,je.A)({},ee,{children:P})),(0,tr.jsx)(J,(0,je.A)({},Q)),R&&(0,tr.jsx)(ne,(0,je.A)({},oe,{children:R}))]}))}),NC=FC;function BC(e){return xr("MuiCardContent",e)}wr("MuiCardContent",["root"]);function HC(e){return xr("MuiCardOverflow",e)}const WC=wr("MuiCardOverflow",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),VC=["className","component","children","orientation","slots","slotProps"],$C=Qr("div")(e=>({display:"flex",flexDirection:"horizontal"===e.ownerState.orientation?"row":"column",flex:9999,zIndex:1,columnGap:"var(--Card-padding)",rowGap:"max(2px, calc(0.1875 * var(--Card-padding)))",padding:"var(--unstable_padding)",[".".concat(WC.root," > &")]:{"--unstable_padding":"calc(var(--Card-padding) * 0.75) 0px"}})),UC=Qr($C,{name:"JoyCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})({}),qC=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyCardContent"}),n=r.className,o=r.component,i=void 0===o?"div":o,a=r.children,l=r.orientation,c=void 0===l?"vertical":l,d=r.slots,u=void 0===d?{}:d,h=r.slotProps,p=void 0===h?{}:h,v=(0,Ie.A)(r,VC),f=(0,je.A)({},v,{component:i,slots:u,slotProps:p}),m=(0,je.A)({},r,{component:i,orientation:c}),g=Dr({root:["root"]},BC,{}),y=pn("root",{ref:t,className:(0,Pe.A)(g.root,n),elementType:UC,externalForwardedProps:f,ownerState:m}),b=(0,s.A)(y,2),x=b[0],w=b[1];return(0,tr.jsx)(x,(0,je.A)({},w,{children:a}))});function KC(e){let t=e.controlled,r=e.default;e.name,e.state;const n=o.useRef(void 0!==t).current,i=o.useState(r),a=(0,s.A)(i,2),l=a[0],c=a[1];return[n?t:l,o.useCallback(e=>{n||c(e)},[])]}function GC(e){const t=e.checked,r=e.defaultChecked,n=e.disabled,i=e.onBlur,a=e.onChange,l=e.onFocus,c=e.onFocusVisible,d=e.readOnly,u=e.required,h=KC({controlled:t,default:Boolean(r),name:"Switch",state:"checked"}),p=(0,s.A)(h,2),v=p[0],f=p[1],m=e=>t=>{var r;t.nativeEvent.defaultPrevented||(f(t.target.checked),null==a||a(t),null==(r=e.onChange)||r.call(e,t))},g=so(),y=g.isFocusVisibleRef,b=g.onBlur,x=g.onFocus,w=g.ref,S=o.useState(!1),k=(0,s.A)(S,2),_=k[0],C=k[1];n&&_&&C(!1),o.useEffect(()=>{y.current=_},[_,y]);const A=o.useRef(null),j=e=>t=>{var r;A.current||(A.current=t.currentTarget),x(t),!0===y.current&&(C(!0),null==c||c(t)),null==l||l(t),null==(r=e.onFocus)||r.call(e,t)},I=e=>t=>{var r;b(t),!1===y.current&&C(!1),null==i||i(t),null==(r=e.onBlur)||r.call(e,t)},P=rn(w,A);return{checked:v,disabled:Boolean(n),focusVisible:_,getInputProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({checked:t,defaultChecked:r,disabled:n,readOnly:d,ref:P,required:u,type:"checkbox",role:"switch","aria-checked":t},e,{onChange:m(e),onFocus:j(e),onBlur:I(e)})},inputRef:P,readOnly:Boolean(d)}}function JC(e){return xr("MuiCheckbox",e)}const QC=wr("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),YC=Vo((0,tr.jsx)("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),XC=Vo((0,tr.jsx)("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),ZC=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],eA=Qr("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o,i;return(0,je.A)({"--Icon-fontSize":"var(--Checkbox-size)"},"sm"===t.size&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:r.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},"md"===t.size&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:r.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},"lg"===t.size&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:r.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:t.overlay?"initial":"relative",display:"inline-flex",fontFamily:r.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:r.vars.palette.text.primary,["&.".concat(QC.disabled)]:{color:null==(n=r.variants.plainDisabled)||null==(n=n[t.color])?void 0:n.color}},t.disableIcon&&{color:null==(o=r.variants[t.variant])||null==(o=o[t.color])?void 0:o.color,["&.".concat(QC.disabled)]:{color:null==(i=r.variants["".concat(t.variant,"Disabled")])||null==(i=i[t.color])?void 0:i.color}})}),tA=Qr("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s;const l=null==(n=t.variants["".concat(r.variant)])?void 0:n[r.color];return[(0,je.A)({"--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon,boxSizing:"border-box",borderRadius:"min(".concat(t.vars.radius.sm,", 0.25rem)"),width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},r.disableIcon&&{display:"contents"},{["&.".concat(QC.checked,", &.").concat(QC.indeterminate)]:{"--Icon-color":"currentColor"}}),...r.disableIcon?[]:[(0,je.A)({},l,{backgroundColor:null!=(o=null==l?void 0:l.backgroundColor)?o:t.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":null==(i=t.variants["".concat(r.variant,"Hover")])?void 0:i[r.color]}},{"&:active":null==(a=t.variants["".concat(r.variant,"Active")])?void 0:a[r.color]},{["&.".concat(QC.disabled)]:null==(s=t.variants["".concat(r.variant,"Disabled")])?void 0:s[r.color]}]]}),rA=Qr("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a;return[{borderRadius:"var(--Checkbox-actionRadius, ".concat(r.overlay?"var(--unstable_actionRadius, inherit)":"inherit",")"),textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[t.focus.selector]:t.focus.default},...r.disableIcon?[null==(n=t.variants[r.variant])?void 0:n[r.color],{"&:hover":null==(o=t.variants["".concat(r.variant,"Hover")])?void 0:o[r.color]},{"&:active":null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color]},{["&.".concat(QC.disabled)]:null==(a=t.variants["".concat(r.variant,"Disabled")])?void 0:a[r.color]}]:[]]}),nA=Qr("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),oA=Qr("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(e=>{let t=e.ownerState;return(0,je.A)({flex:1,minWidth:0},t.disableIcon&&{zIndex:1,pointerEvents:"none"})}),iA=(0,tr.jsx)(YC,{}),aA=(0,tr.jsx)(XC,{}),sA=o.forwardRef(function(e,t){var r,n,i,a,l;const c=en({props:e,name:"JoyCheckbox"}),d=c.checked,u=c.uncheckedIcon,h=c.checkedIcon,p=void 0===h?iA:h,v=c.label,f=c.defaultChecked,m=c.disabled,g=c.disableIcon,y=void 0!==g&&g,b=c.overlay,x=c.id,w=c.indeterminate,S=void 0!==w&&w,k=c.indeterminateIcon,_=void 0===k?aA:k,C=c.name,A=c.onBlur,j=c.onChange,I=c.onFocus,P=c.onFocusVisible,R=c.readOnly,T=c.required,E=c.value,z=c.color,D=c.variant,M=c.size,L=void 0===M?"md":M,O=c.component,F=c.slots,N=void 0===F?{}:F,B=c.slotProps,H=void 0===B?{}:B,W=(0,Ie.A)(c,ZC),V=o.useContext(lC),$=null!=(r=null!=(n=e.disabled)?n:null==V?void 0:V.disabled)?r:m,U=null!=(i=null!=(a=e.size)?a:null==V?void 0:V.size)?i:L;const q=gi(null!=x?x:null==V?void 0:V.htmlFor),K=GC({checked:d,defaultChecked:f,disabled:$,onBlur:A,onChange:j,onFocus:I,onFocusVisible:P}),G=K.getInputProps,J=K.checked,Q=K.disabled,Y=K.focusVisible,X=J||S,Z=X?D||"solid":D||"outlined",ee=e.color||(null!=V&&V.error?"danger":null!=(l=null==V?void 0:V.color)?l:z),te=ee||"primary",re=ee||"neutral",ne=(0,je.A)({},c,{checked:J,disabled:Q,disableIcon:y,overlay:b,focusVisible:Y,color:X?te:re,variant:Z,size:U}),oe=(e=>{const t=e.checked,r=e.disabled,n=e.disableIcon,o=e.focusVisible,i=e.color,a=e.variant,s=e.size,l=e.indeterminate;return Dr({root:["root",t&&"checked",r&&"disabled",o&&"focusVisible",a&&"variant".concat(Le(a)),i&&"color".concat(Le(i)),s&&"size".concat(Le(s))],checkbox:["checkbox",t&&"checked",l&&"indeterminate",r&&"disabled"],action:["action",t&&"checked",n&&r&&"disabled",o&&"focusVisible"],input:["input"],label:["label"]},JC,{})})(ne),ie=(0,je.A)({},W,{component:O,slots:N,slotProps:H}),ae=pn("root",{ref:t,className:oe.root,elementType:eA,externalForwardedProps:ie,ownerState:ne}),se=(0,s.A)(ae,2),le=se[0],ce=se[1],de=pn("checkbox",{className:oe.checkbox,elementType:tA,externalForwardedProps:ie,ownerState:ne}),ue=(0,s.A)(de,2),he=ue[0],pe=ue[1],ve=pn("action",{className:oe.action,elementType:rA,externalForwardedProps:ie,ownerState:ne}),fe=(0,s.A)(ve,2),me=fe[0],ge=fe[1],ye=pn("input",{additionalProps:(0,je.A)({id:q,name:C,value:E,readOnly:R,role:void 0,required:null!=T?T:null==V?void 0:V.required,"aria-describedby":null==V?void 0:V["aria-describedby"]},S&&{"aria-checked":"mixed"}),className:oe.input,elementType:nA,externalForwardedProps:ie,getSlotProps:G,ownerState:ne}),be=(0,s.A)(ye,2),xe=be[0],we=be[1],Se=pn("label",{additionalProps:{htmlFor:q},className:oe.label,elementType:oA,externalForwardedProps:ie,ownerState:ne}),ke=(0,s.A)(Se,2),_e=ke[0],Ce=ke[1];let Ae=u;return y?Ae=null:S?Ae=_:J&&(Ae=p),(0,tr.jsxs)(le,(0,je.A)({},ce,{children:[(0,tr.jsxs)(he,(0,je.A)({},pe,{children:[(0,tr.jsx)(me,(0,je.A)({},ge,{children:(0,tr.jsx)(xe,(0,je.A)({},we))})),Ae]})),v&&(0,tr.jsx)(Hn.Provider,{value:!0,children:(0,tr.jsx)(_e,(0,je.A)({},Ce,{children:v}))})]}))}),lA=sA;function cA(e){return xr("MuiTooltip",e)}wr("MuiTooltip",["root","tooltipArrow","arrow","touch","placementLeft","placementRight","placementTop","placementBottom","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);const dA=["children","className","component","arrow","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","disablePortal","direction","keepMounted","modifiers","placement","title","color","variant","size","slots","slotProps"],uA=Qr("div",{name:"JoyTooltip",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o,i;const a=null==(n=r.variants[t.variant])?void 0:n[t.color];return(0,je.A)({},"sm"===t.size&&{"--Icon-fontSize":r.vars.fontSize.md,"--Tooltip-arrowSize":"8px",padding:r.spacing(.25,.625)},"md"===t.size&&{"--Icon-fontSize":r.vars.fontSize.lg,"--Tooltip-arrowSize":"10px",padding:r.spacing(.5,.75)},"lg"===t.size&&{"--Icon-fontSize":r.vars.fontSize.xl,"--Tooltip-arrowSize":"12px",padding:r.spacing(.75,1)},{zIndex:r.vars.zIndex.tooltip,borderRadius:r.vars.radius.sm,boxShadow:r.shadow.sm,wordWrap:"break-word",position:"relative"},t.disableInteractive&&{pointerEvents:"none"},r.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[t.size])],a,!a.backgroundColor&&{backgroundColor:r.vars.palette.background.surface},{"&::before":{content:'""',display:"block",position:"absolute",width:null!=(o=t.placement)&&o.match(/(top|bottom)/)?"100%":"calc(10px + var(--variant-borderWidth, 0px))",height:null!=(i=t.placement)&&i.match(/(top|bottom)/)?"calc(10px + var(--variant-borderWidth, 0px))":"100%"},'&[data-popper-placement*="bottom"]::before':{top:0,left:0,transform:"translateY(-100%)"},'&[data-popper-placement*="left"]::before':{top:0,right:0,transform:"translateX(100%)"},'&[data-popper-placement*="right"]::before':{top:0,left:0,transform:"translateX(-100%)"},'&[data-popper-placement*="top"]::before':{bottom:0,left:0,transform:"translateY(100%)"}})}),hA=Qr("span",{name:"JoyTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(e=>{let t=e.theme,r=e.ownerState;var n,o,i;const a=null==(n=t.variants[r.variant])?void 0:n[r.color];return{"--unstable_Tooltip-arrowRotation":0,width:"var(--Tooltip-arrowSize)",height:"var(--Tooltip-arrowSize)",boxSizing:"border-box","&::before":{content:'""',display:"block",position:"absolute",width:0,height:0,border:"calc(var(--Tooltip-arrowSize) / 2) solid",borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:null!=(o=null==a?void 0:a.backgroundColor)?o:t.vars.palette.background.surface,borderRightColor:null!=(i=null==a?void 0:a.backgroundColor)?i:t.vars.palette.background.surface,borderRadius:"0px 2px 0px 0px",boxShadow:"var(--variant-borderWidth, 0px) calc(-1 * var(--variant-borderWidth, 0px)) 0px 0px ".concat(a.borderColor),transformOrigin:"center center",transform:"rotate(calc(-45deg + 90deg * var(--unstable_Tooltip-arrowRotation)))"},'[data-popper-placement*="bottom"] &':{top:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="top"] &':{"--unstable_Tooltip-arrowRotation":2,bottom:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="left"] &':{"--unstable_Tooltip-arrowRotation":1,right:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"},'[data-popper-placement*="right"] &':{"--unstable_Tooltip-arrowRotation":3,left:"calc(0.5px + var(--Tooltip-arrowSize) * -1 / 2)"}}});let pA=!1;const vA=new Yn;let fA={x:0,y:0};function mA(e,t){return r=>{t&&t(r),e(r)}}function gA(e,t){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i{void 0!==we.current&&(document.body.style.WebkitUserSelect=we.current,we.current=void 0),ve.clear()});o.useEffect(()=>Se,[Se]);const ke=e=>{vA.clear(),pA=!0,ye(!0),M&&!be&&M(e)},_e=b_(e=>{vA.start(800+T,()=>{pA=!1}),ye(!1),D&&be&&D(e),ue.start(150,()=>{ce.current=!1})}),Ce=e=>{ce.current&&"touchstart"!==e.type||(ne&&ne.removeAttribute("title"),he.clear(),pe.clear(),S||pA&&_?he.start(pA?_:S,()=>{ke(e)}):ke(e))},Ae=e=>{he.clear(),pe.start(T,()=>{_e(e)})},Re=so(),Te=Re.isFocusVisibleRef,Ee=Re.onBlur,ze=Re.onFocus,De=Re.ref,Me=o.useState(!1),Oe=(0,s.A)(Me,2)[1],Fe=e=>{Ee(e),!1===Te.current&&(Oe(!1),Ae(e))},Ne=e=>{ne||oe(e.currentTarget),ze(e),!0===Te.current&&(Oe(!0),Ce(e))},Be=e=>{ce.current=!0;const t=i.props;t.onTouchStart&&t.onTouchStart(e)},He=e=>{Be(e),pe.clear(),ue.clear(),Se(),we.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ve.start(A,()=>{document.body.style.WebkitUserSelect=we.current,Ce(e)})},We=e=>{i.props.onTouchEnd&&i.props.onTouchEnd(e),Se(),pe.start(z,()=>{_e(e)})};o.useEffect(()=>{if(be)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"!==e.key&&"Esc"!==e.key||_e(e)}},[_e,be]);const Ve=rn(oe,t),$e=rn(De,Ve),Ue=rn($h(i),$e);"number"===typeof V||V||(be=!1);const qe=o.useRef(null),Ke={},Ge="string"===typeof V;h?(Ke.title=be||!Ge||m?null:V,Ke["aria-describedby"]=be?xe:null):(Ke["aria-label"]=Ge?V:null,Ke["aria-labelledby"]=be&&!Ge?xe:null);const Je=(0,je.A)({},Ke,ee,{component:l},i.props,{className:(0,Pe.A)(a,i.props.className),onTouchStart:Be,ref:Ue},I?{onMouseMove:e=>{const t=i.props;t.onMouseMove&&t.onMouseMove(e),fA={x:e.clientX,y:e.clientY},qe.current&&qe.current.update()}}:{}),Qe={};x||(Je.onTouchStart=He,Je.onTouchEnd=We),m||(Je.onMouseOver=mA(Ce,Je.onMouseOver),Je.onMouseLeave=mA(Ae,Je.onMouseLeave),de||(Qe.onMouseOver=Ce,Qe.onMouseLeave=Ae)),v||(Je.onFocus=gA(Ne,Je.onFocus),Je.onBlur=gA(Fe,Je.onBlur),de||(Qe.onFocus=Ne,Qe.onBlur=Fe));const Ye=(0,je.A)({},n,{arrow:d,disableInteractive:de,placement:W,touch:ce.current,color:U,variant:K,size:J}),Xe=(e=>{const t=e.arrow,r=e.variant,n=e.color,o=e.size,i=e.placement;return Dr({root:["root",t&&"tooltipArrow",e.touch&&"touch",o&&"size".concat(Le(o)),n&&"color".concat(Le(n)),r&&"variant".concat(Le(r)),"tooltipPlacement".concat(Le(i.split("-")[0]))],arrow:["arrow"]},cA,{})})(Ye),Ze=(0,je.A)({},ee,{component:l,slots:Y,slotProps:Z}),et=o.useMemo(()=>[{name:"arrow",enabled:Boolean(se),options:{element:se,padding:6}},{name:"offset",options:{offset:[0,10]}},...B||[]],[se,B]),tt=pn("root",{additionalProps:(0,je.A)({id:xe,popperRef:qe,placement:W,anchorEl:I?{getBoundingClientRect:()=>({top:fA.y,left:fA.x,right:fA.x,bottom:fA.y,width:0,height:0})}:ne,open:!!ne&&be,disablePortal:O,keepMounted:N,direction:F,modifiers:et},Qe),ref:null,className:Xe.root,elementType:uA,externalForwardedProps:Ze,ownerState:Ye}),rt=(0,s.A)(tt,2),nt=rt[0],ot=rt[1],it=pn("arrow",{ref:le,className:Xe.arrow,elementType:hA,externalForwardedProps:Ze,ownerState:Ye}),at=(0,s.A)(it,2),st=at[0],lt=at[1];return(0,tr.jsxs)(o.Fragment,{children:[o.isValidElement(i)&&o.cloneElement(i,Je),(0,tr.jsxs)(nt,(0,je.A)({},ot,!(null!=(r=n.slots)&&r.root)&&{as:sp,slots:{root:l||"div"}},{children:[V,d?(0,tr.jsx)(st,(0,je.A)({},lt)):null]}))]})}),bA=yA;var xA=r(3932),wA=r(1007),SA=r(127),kA=r(9278),_A=r(4909),CA=r(3881),AA=r(6300),jA=r(7030),IA=r(6541),PA=r(8846),RA=r(1359),TA=r(5371);function EA(e){return xr("MuiAlert",e)}wr("MuiAlert",["root","startDecorator","endDecorator","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);const zA=["children","className","color","invertedColors","role","variant","size","startDecorator","endDecorator","component","slots","slotProps"],DA=Qr("div",{name:"JoyAlert",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;const o=si({theme:t,ownerState:r},["p","padding","borderRadius"]),i=o.p,a=o.padding,s=o.borderRadius;return[(0,je.A)({"--Alert-radius":t.vars.radius.sm,"--Alert-decoratorChildRadius":"max((var(--Alert-radius) - var(--variant-borderWidth, 0px)) - var(--Alert-padding), min(var(--Alert-padding) + var(--variant-borderWidth, 0px), var(--Alert-radius) / 2))","--Button-minHeight":"var(--Alert-decoratorChildHeight)","--IconButton-size":"var(--Alert-decoratorChildHeight)","--Button-radius":"var(--Alert-decoratorChildRadius)","--IconButton-radius":"var(--Alert-decoratorChildRadius)","--Icon-color":"currentColor"},"sm"===r.size&&{"--Alert-padding":"0.5rem","--Alert-decoratorChildHeight":"1.5rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.5rem"},"md"===r.size&&{"--Alert-padding":"0.75rem","--Alert-decoratorChildHeight":"2rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.625rem"},"lg"===r.size&&{"--Alert-padding":"1rem","--Alert-decoratorChildHeight":"2.375rem","--Icon-fontSize":t.vars.fontSize.xl2,gap:"0.875rem"},{backgroundColor:t.vars.palette.background.surface,display:"flex",position:"relative",alignItems:"center",padding:"var(--Alert-padding)",borderRadius:"var(--Alert-radius)"},t.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[r.size])],{fontWeight:t.vars.fontWeight.md},"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(n=t.variants[r.variant])?void 0:n[r.color]),void 0!==i&&{"--Alert-padding":i},void 0!==a&&{"--Alert-padding":a},void 0!==s&&{"--Alert-radius":s}]}),MA=Qr("span",{name:"JoyAlert",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inherit",flex:"none"}),LA=Qr("span",{name:"JoyAlert",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inherit",flex:"none",marginLeft:"auto"}),OA=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAlert"}),n=r.children,o=r.className,i=r.color,a=void 0===i?"neutral":i,l=r.invertedColors,c=void 0!==l&&l,d=r.role,u=void 0===d?"alert":d,h=r.variant,p=void 0===h?"soft":h,v=r.size,f=void 0===v?"md":v,m=r.startDecorator,g=r.endDecorator,y=r.component,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,zA),_=(0,je.A)({},r,{color:a,invertedColors:c,variant:p,size:f}),C=(e=>{const t=e.variant,r=e.color,n=e.size;return Dr({root:["root",n&&"size".concat(Le(n)),r&&"color".concat(Le(r)),t&&"variant".concat(Le(t))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},EA,{})})(_),A=(0,je.A)({},k,{component:y,slots:x,slotProps:S}),j=pn("root",{ref:t,className:(0,Pe.A)(C.root,o),elementType:DA,externalForwardedProps:A,ownerState:_,additionalProps:{role:u}}),I=(0,s.A)(j,2),P=I[0],R=I[1],T=pn("startDecorator",{className:C.startDecorator,elementType:MA,externalForwardedProps:A,ownerState:_}),E=(0,s.A)(T,2),z=E[0],D=E[1],M=pn("endDecorator",{className:C.endDecorator,elementType:LA,externalForwardedProps:A,ownerState:_}),L=(0,s.A)(M,2),O=L[0],F=L[1];return(0,tr.jsxs)(P,(0,je.A)({},R,{children:[m&&(0,tr.jsx)(z,(0,je.A)({},D,{children:m})),n,g&&(0,tr.jsx)(O,(0,je.A)({},F,{children:g}))]}))}),FA=OA,NA=(0,o.createContext)(null);function BA(e){let t=e.children;const r=(0,o.useState)(!1),n=(0,s.A)(r,2),i=n[0],a=n[1],l=(0,o.useState)(new Set),c=(0,s.A)(l,2),d=c[0],u=c[1],h=(0,o.useCallback)(()=>a(!0),[]),p=(0,o.useCallback)(()=>{a(!1),u(new Set)},[]),v=(0,o.useCallback)(e=>{u(t=>{const r=new Set(t);return r.has(e)?r.delete(e):r.size<3&&r.add(e),r})},[]),f=(0,o.useCallback)(e=>d.has(e),[d]),m=(0,o.useCallback)(e=>d.has(e)||d.size<3,[d]),g=(0,o.useMemo)(()=>({selectionMode:i,selectedIds:d,enterSelectionMode:h,exitSelectionMode:p,toggle:v,isSelected:f,canSelect:m}),[i,d,h,p,v,f,m]);return(0,tr.jsx)(NA.Provider,{value:g,children:t})}function HA(){return(0,o.useContext)(NA)}const WA=e=>{const t=Ma().getIdToken;return ql({queryKey:["getHouseEnrichment",e],queryFn:async()=>{const r=await t();if(!r)return null;const n=await fetch("".concat(IW,"/api/house/").concat(e,"/enrichment"),{headers:{Authorization:r}});return n.ok?await n.json():null},enabled:!!e})},VA=["destinations"],$A=()=>{const e=Ma().getIdToken;return ql({queryKey:VA,queryFn:async()=>{var t;const r=await e();if(!r)return[];const n=await fetch("".concat(IW,"/api/destinations"),{headers:{Authorization:r}});return n.ok&&null!==(t=await Gl(n))&&void 0!==t?t:[]}})},UA=(e,t)=>["houseReaction",e,t],qA=e=>["aiSearchPreferences",e],KA=e=>{const t=Ma().getIdToken;return ql({queryKey:qA(e),queryFn:async()=>{const r=await t();if(!r||!e)return null;const n=await fetch("".concat(IW,"/api/ai-search/").concat(e,"/preferences"),{headers:{Authorization:r}});if(!n.ok)throw new Error("Failed to load preferences: ".concat(n.status));return await Gl(n)},enabled:!!e})};var GA=r(2843),JA=r(4624),QA=r(338),YA=r(6191),XA=r(8415);const ZA={TUBE_BUS:{label:"Tube / Bus",emoji:"\ud83d\ude87",Icon:GA.A},NATIONAL_RAIL:{label:"National Rail",emoji:"\ud83d\ude86",Icon:JA.A},DRIVING:{label:"Driving",emoji:"\ud83d\ude97",Icon:QA.A},WALKING:{label:"Walking",emoji:"\ud83d\udeb6",Icon:YA.A},CYCLING:{label:"Cycling",emoji:"\ud83d\udeb2",Icon:XA.A}};function ej(e){var t;return null!==(t=ZA[e])&&void 0!==t?t:ZA.TUBE_BUS}function tj(e){var t,r;return null!==(t=null===(r=ZA[e])||void 0===r?void 0:r.label)&&void 0!==t?t:e}function rj(e){return ej(e).emoji}function nj(e){let t=e.results,r=e.max,n=void 0===r?2:r,o=e.size,i=void 0===o?"sm":o,a=e.destinations;if(!t||0===t.length)return null;const s=t.slice(0,n),l=t.length-s.length,c=(()=>{if(!a||0===a.length)return null;if(s.every(e=>null==e.durationMinutes))return null;const e=new Set;for(const r of s){const t=a.find(e=>e.id===r.destinationId);null!==t&&void 0!==t&&t.departureTime&&e.add(t.departureTime)}if(1!==e.size)return null;const t=Array.from(e)[0];return"Based on ".concat(t," departure")})();return(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:"column",gap:.25},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:[s.map(e=>{const t=rj(e.transportMode);return null==e.durationMinutes?(0,tr.jsx)(bA,{title:"".concat(e.destinationName," \u2014 commute unavailable"),children:(0,tr.jsxs)(Ti,{size:i,variant:"soft",color:"warning",children:[t," ",e.destinationName,": n/a"]})},e.destinationId):(0,tr.jsx)(bA,{title:"".concat(e.durationMinutes," min to ").concat(e.destinationName),children:(0,tr.jsxs)(Ti,{size:i,variant:"soft",color:"neutral",children:[t," ",e.durationMinutes," min \xb7 ",e.destinationName]})},e.destinationId)}),l>0&&(0,tr.jsxs)(Ti,{size:i,variant:"outlined",color:"neutral",children:["+",l]})]}),c&&(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:c})]})}var oj=r(8965),ij=r(3972);const aj={saved:{label:"Saved",color:"neutral"},viewing:{label:"Viewing",color:"warning"},offer:{label:"Offer",color:"success"},rejected:{label:"Rejected",color:"danger"}},sj={under_offer:{label:"Under Offer",color:"warning"},sold:{label:"Sold",color:"danger"},removed:{label:"Listing removed",color:"neutral"}};function lj(e){var t;return e&&"active"!==e&&null!==(t=sj[e])&&void 0!==t?t:null}function cj(e){return e>=80?"success":e>=60?"warning":"neutral"}const dj={under_offer:(0,tr.jsx)(oj.A,{sx:{fontSize:14}}),sold:(0,tr.jsx)(ij.A,{sx:{fontSize:14}}),removed:(0,tr.jsx)(jA.A,{sx:{fontSize:14}})};function uj(e){let t=e.status,r=e.sx;const n=lj(t);if(!n)return null;const o=n.color,i=n.label;return(0,tr.jsxs)(Tr,{sx:(0,Ae.A)({bgcolor:"".concat(o,".200"),color:"".concat(o,".800"),px:1.5,py:.5,display:"flex",alignItems:"center",gap:.75},r),children:[dj[t],(0,tr.jsx)(Gn,{level:"body-xs",fontWeight:"lg",sx:{color:"inherit"},children:i})]})}function hj(e){return e.includes("rightmove")?{label:"RM",color:"primary",url:e}:e.includes("zoopla")?{label:"Zoopla",color:"warning",url:e}:e.includes("onthemarket")?{label:"OTM",color:"success",url:e}:null}function pj(e){const t=e.match(/^(.*?)\s+(?:for sale|to rent|for rent)\s+in\s+.+$/i);return t?t[1].trim():e}function vj(e){let t=e.bestSchoolOfsted,r=e.crimeRatePer1000;const n=(t||"").toLowerCase(),o="outstanding"===n,i="good"===n,a=null!=r&&r<30,s=null!=r&&r>70;return o||i||a||s?(0,tr.jsxs)(Mn,{direction:"row",flexWrap:"wrap",gap:.5,children:[o&&(0,tr.jsx)(Ti,{size:"sm",color:"success",variant:"soft",startDecorator:(0,tr.jsx)(AA.A,{sx:{fontSize:12}}),children:"Outstanding school"}),i&&(0,tr.jsx)(Ti,{size:"sm",color:"primary",variant:"soft",startDecorator:(0,tr.jsx)(AA.A,{sx:{fontSize:12}}),children:"Good school"}),a&&(0,tr.jsx)(Ti,{size:"sm",color:"success",variant:"soft",children:"Low crime"}),s&&(0,tr.jsx)(Ti,{size:"sm",color:"danger",variant:"soft",children:"High crime"})]}):null}function fj(e){var t,r,n,o,i,a;let s=e.house,l=e.aiSearchId;const c=HA(),d=ie(),u=null!=s.matchScore?Math.round(100*s.matchScore):null,h=null!==(t=s.sourceUrls)&&void 0!==t?t:[],p=h.length>1?h.map(hj).filter(e=>null!==e):[],v=null!==(r=s.listingStatus)&&void 0!==r?r:"active",f="under_offer"===v,m="sold"===v,g="removed"===v,y=(f||m)&&null!==(n=null===(o=lj(v))||void 0===o?void 0:o.color)&&void 0!==n?n:null,b=null!=s.priceReducedPct&&s.priceReducedPct>0&&null!=s.priceReducedAt&&new Date(s.priceReducedAt).getTime()>Date.now()-2592e6,x=b&&null!=s.priceGbp&&null!=s.priceReducedPct&&s.priceReducedPct<100?Math.round(s.priceGbp*(s.priceReducedPct/(100-s.priceReducedPct))):null,w=null!=x?x>=1e3?"\u2212\xa3".concat(Math.round(x/1e3),"k"):"\u2212\xa3".concat(x):"\u2212".concat(s.priceReducedPct,"%"),S=!(null===c||void 0===c||!c.selectionMode),k=S&&c.isSelected(s.id),_=S&&!k&&!c.canSelect(s.id),C=WA(s.id).data,A=null!==(i=null===C||void 0===C?void 0:C.commuteResults)&&void 0!==i?i:[],j=$A().data,I=((e,t)=>{const r=Ma().getIdToken;return ql({queryKey:UA(e,t),queryFn:async()=>{var n;const o=await r();if(!o||!e||!t)return{reactionType:null};const i=await fetch("".concat(IW,"/api/house/").concat(e,"/reactions?aiSearchId=").concat(t),{headers:{Authorization:o}});if(!i.ok)throw new Error("Failed to load reaction: ".concat(i.status));return null!==(n=await Gl(i))&&void 0!==n?n:{reactionType:null}},enabled:!!e&&!!t})})(s.id,null!==l&&void 0!==l?l:null),P=I.data,R=((e,t)=>{const r=Ma().getIdToken,n=zl();return Lk({mutationFn:async n=>{const o=await r();if(!o||!e||!t)throw new Error("Missing auth/ids");const i=await fetch("".concat(IW,"/api/house/").concat(e,"/react"),{method:"POST",headers:{Authorization:o,"Content-Type":"application/json"},body:JSON.stringify({aiSearchId:t,reaction:n})});if(!i.ok)throw new Error("Failed to react: ".concat(i.status));return await i.json()},onMutate:async r=>{await n.cancelQueries({queryKey:UA(e,t)});const o=n.getQueryData(UA(e,t));return n.setQueryData(UA(e,t),{reactionType:r}),{previous:o}},onError:(r,o,i)=>{void 0!==(null===i||void 0===i?void 0:i.previous)&&n.setQueryData(UA(e,t),i.previous)},onSettled:()=>{n.invalidateQueries({queryKey:UA(e,t)}),n.invalidateQueries({queryKey:qA(null!==t&&void 0!==t?t:void 0)})}})})(s.id,null!==l&&void 0!==l?l:null),T=!!l,E=null!==(a=null===P||void 0===P?void 0:P.reactionType)&&void 0!==a?a:null,z=e=>t=>{t.stopPropagation(),R.mutate(e)};return(0,tr.jsxs)(Tr,{onClick:e=>{S&&(e.stopPropagation(),_||c.toggle(s.id))},sx:{opacity:g?.6:m?.75:1,filter:g?"grayscale(0.25)":"none",position:"relative",width:"100%",cursor:S?"pointer":"default",outline:k?"2px solid":"none",outlineColor:"primary.500",outlineOffset:"-2px",borderRadius:"sm",bgcolor:y?"".concat(y,".50"):"background.surface",overflow:"hidden"},children:[(f||m)&&(0,tr.jsx)(uj,{status:v}),S&&(0,tr.jsx)(Tr,{onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),_||c.toggle(s.id)},sx:{position:"absolute",top:8,left:8,zIndex:2,bgcolor:"background.surface",borderRadius:"sm",boxShadow:"sm",p:.25},children:(0,tr.jsx)(lA,{size:"sm",checked:k,disabled:_,onChange:()=>c.toggle(s.id)})}),(0,tr.jsxs)(qC,{sx:{gap:1,p:2},children:[(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",spacing:.75,sx:{minWidth:0},children:[null==s.priceGbp?(0,tr.jsx)(Ti,{variant:"soft",color:"neutral",size:"sm",children:"Price N/A"}):0===s.priceGbp?(0,tr.jsx)(Gn,{level:"title-lg",children:"Price on application"}):(0,tr.jsx)(Gn,{level:"title-lg",children:s.priceGbp.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0})}),s.extractionFlags&&s.extractionFlags.length>0&&(0,tr.jsx)(bA,{title:"Some data could not be extracted from the listing page.",placement:"top",children:(0,tr.jsx)(_A.A,{color:"warning",fontSize:"small"})})]}),b&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"success",startDecorator:(0,tr.jsx)(CA.A,{sx:{fontSize:12}}),children:w})]}),(0,tr.jsx)(bA,{title:s.title,placement:"top",enterDelay:400,children:(0,tr.jsx)(Gn,{level:"title-sm",sx:{minWidth:0,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:pj(s.title)})}),(0,tr.jsx)(bA,{title:s.address,placement:"top",enterDelay:400,children:(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.address})}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,sx:{color:"text.tertiary",flexWrap:"wrap",rowGap:.5},children:[null!=s.bedrooms&&(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(IA.A,{sx:{fontSize:16}}),(0,tr.jsx)(Gn,{level:"body-xs",children:s.bedrooms})]}),null!=s.bathrooms&&(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(PA.A,{sx:{fontSize:16}}),(0,tr.jsx)(Gn,{level:"body-xs",children:s.bathrooms})]}),Number(s.floorSpaceFt)>0&&(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(RA.A,{sx:{fontSize:16}}),(0,tr.jsxs)(Gn,{level:"body-xs",children:[s.floorSpaceFt," sqft"]})]})]}),(0,tr.jsx)(nc,{sx:{my:1}}),(0,tr.jsx)(nj,{results:A,max:2,destinations:j}),(0,tr.jsx)(vj,{bestSchoolOfsted:s.bestSchoolOfsted,crimeRatePer1000:s.crimeRatePer1000}),p.length>0&&(0,tr.jsx)(Tr,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:p.map(e=>(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:e.color,component:"a",href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:e.label},e.url))}),g&&(0,tr.jsx)(FA,{size:"sm",variant:"soft",color:"neutral",startDecorator:(0,tr.jsx)(jA.A,{}),sx:{fontSize:"xs",mt:.5},children:(0,tr.jsxs)(Tr,{children:["Listing removed \u2014 may be under offer or sold.",s.link&&(0,tr.jsx)(hc,{href:s.link,target:"_blank",rel:"noopener noreferrer",level:"body-xs",ml:.5,onClick:e=>e.stopPropagation(),children:"Check original listing \u2192"})]})}),(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,tr.jsx)(Tr,{sx:{minWidth:0,display:"flex",alignItems:"center",gap:.75},children:null!=u?(0,tr.jsx)(bA,{title:s.matchRationale||"",placement:"top",children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:cj(u),startDecorator:(0,tr.jsx)(TA.A,{sx:{fontSize:14}}),children:[u,"% match"]})}):s.addedOn?(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:["Added ",s.addedOn]}):null}),(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:.25},children:[T&&(0,tr.jsxs)(Tr,{onPointerDown:e=>e.stopPropagation(),sx:{display:"flex",gap:0},children:[(0,tr.jsx)(bA,{title:"thumbs_up"===E?"You liked this":"Like",placement:"top",children:(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"thumbs_up"===E?"success":"neutral",onClick:z("thumbs_up"),"aria-label":"thumbs up",children:"thumbs_up"===E?(0,tr.jsx)(xA.A,{fontSize:"small"}):(0,tr.jsx)(wA.A,{fontSize:"small"})})}),(0,tr.jsx)(bA,{title:"thumbs_down"===E?"You disliked this":"Not my type",placement:"top",children:(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"thumbs_down"===E?"danger":"neutral",onClick:z("thumbs_down"),"aria-label":"thumbs down",children:"thumbs_down"===E?(0,tr.jsx)(SA.A,{fontSize:"small"}):(0,tr.jsx)(kA.A,{fontSize:"small"})})})]}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"primary",onClick:()=>{d("/house/"+s.id)},"aria-label":"Open property page",children:"View"})]})]})]})]})}const mj=function(){const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();if(!r)return console.log("No token found"),{data:[]};const n=await fetch("".concat(IW,"/api/house"),{method:"POST",headers:{Authorization:r},body:JSON.stringify(t)});return n.ok?n.json():{data:[]}},onSuccess:()=>{t.invalidateQueries({queryKey:["board"]})}})};const gj="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;function yj(e){const t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function bj(e){return"nodeType"in e}function xj(e){var t,r;return e?yj(e)?e:bj(e)&&null!=(t=null==(r=e.ownerDocument)?void 0:r.defaultView)?t:window:window}function wj(e){return e instanceof xj(e).Document}function Sj(e){return!yj(e)&&e instanceof xj(e).HTMLElement}function kj(e){return e instanceof xj(e).SVGElement}function _j(e){return e?yj(e)?e.document:bj(e)?wj(e)?e:Sj(e)||kj(e)?e.ownerDocument:document:document:document}const Cj=gj?o.useLayoutEffect:o.useEffect;function Aj(e){const t=(0,o.useRef)(e);return Cj(()=>{t.current=e}),(0,o.useCallback)(function(){for(var e=arguments.length,r=new Array(e),n=0;n{r.current!==e&&(r.current=e)},t),r}function Ij(e,t){const r=(0,o.useRef)();return(0,o.useMemo)(()=>{const t=e(r.current);return r.current=t,t},[...t])}function Pj(e){const t=Aj(e),r=(0,o.useRef)(null),n=(0,o.useCallback)(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,n]}function Rj(e){const t=(0,o.useRef)();return(0,o.useEffect)(()=>{t.current=e},[e]),t.current}let Tj={};function Ej(e,t){return(0,o.useMemo)(()=>{if(t)return t;const r=null==Tj[e]?0:Tj[e]+1;return Tj[e]=r,e+"-"+r},[e,t])}function zj(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o{const n=Object.entries(r);for(const i of n){var o=(0,s.A)(i,2);const r=o[0],n=o[1],a=t[r];null!=a&&(t[r]=a+e*n)}return t},(0,Ae.A)({},t))}}const Dj=zj(1),Mj=zj(-1);function Lj(e){if(!e)return!1;const t=xj(e.target).KeyboardEvent;return t&&e instanceof t}function Oj(e){if(function(e){if(!e)return!1;const t=xj(e.target).TouchEvent;return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){const t=e.touches[0];return{x:t.clientX,y:t.clientY}}if(e.changedTouches&&e.changedTouches.length){const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}}return function(e){return"clientX"in e&&"clientY"in e}(e)?{x:e.clientX,y:e.clientY}:null}const Fj=Object.freeze({Translate:{toString(e){if(!e)return;const t=e.x,r=e.y;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;return"scaleX("+e.scaleX+") scaleY("+e.scaleY+")"}},Transform:{toString(e){if(e)return[Fj.Translate.toString(e),Fj.Scale.toString(e)].join(" ")}},Transition:{toString:e=>e.property+" "+e.duration+"ms "+e.easing}}),Nj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Bj(e){return e.matches(Nj)?e:e.querySelector(Nj)}const Hj={display:"none"};function Wj(e){let t=e.id,r=e.value;return o.createElement("div",{id:t,style:Hj},r)}function Vj(e){let t=e.id,r=e.announcement,n=e.ariaLiveType,i=void 0===n?"assertive":n;return o.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":i,"aria-atomic":!0},r)}const $j=["transform"],Uj=["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"],qj=["active","dragOverlay","transform"],Kj=(0,o.createContext)(null);const Gj={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},Jj={onDragStart:e=>"Picked up draggable item "+e.active.id+".",onDragOver(e){let t=e.active,r=e.over;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let t=e.active,r=e.over;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel:e=>"Dragging was cancelled. Draggable item "+e.active.id+" was dropped."};function Qj(e){let t=e.announcements,r=void 0===t?Jj:t,n=e.container,i=e.hiddenTextDescribedById,a=e.screenReaderInstructions,l=void 0===a?Gj:a;const c=function(){const e=(0,o.useState)(""),t=(0,s.A)(e,2),r=t[0],n=t[1];return{announce:(0,o.useCallback)(e=>{null!=e&&n(e)},[]),announcement:r}}(),d=c.announce,u=c.announcement,h=Ej("DndLiveRegion"),p=(0,o.useState)(!1),v=(0,s.A)(p,2),f=v[0],m=v[1];if((0,o.useEffect)(()=>{m(!0)},[]),function(e){const t=(0,o.useContext)(Kj);(0,o.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}((0,o.useMemo)(()=>({onDragStart(e){let t=e.active;d(r.onDragStart({active:t}))},onDragMove(e){let t=e.active,n=e.over;r.onDragMove&&d(r.onDragMove({active:t,over:n}))},onDragOver(e){let t=e.active,n=e.over;d(r.onDragOver({active:t,over:n}))},onDragEnd(e){let t=e.active,n=e.over;d(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let t=e.active,n=e.over;d(r.onDragCancel({active:t,over:n}))}}),[d,r])),!f)return null;const g=o.createElement(o.Fragment,null,o.createElement(Wj,{id:i,value:l.draggable}),o.createElement(Vj,{id:h,announcement:u}));return n?(0,pc.createPortal)(g,n):g}var Yj;function Xj(){}function Zj(e,t){return(0,o.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}!function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"}(Yj||(Yj={}));const eI=Object.freeze({x:0,y:0});function tI(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function rI(e,t){const r=Oj(e);if(!r)return"0 0";return(r.x-t.left)/t.width*100+"% "+(r.y-t.top)/t.height*100+"%"}function nI(e,t){return e.data.value-t.data.value}function oI(e,t){let r=e.data.value;return t.data.value-r}function iI(e){let t=e.left,r=e.top,n=e.height,o=e.width;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function aI(e,t){if(!e||0===e.length)return null;const r=(0,s.A)(e,1)[0];return t?r[t]:r}const sI=e=>{let t=e.collisionRect,r=e.droppableRects,n=e.droppableContainers;const o=iI(t),i=[];for(const a of n){const e=a.id,t=r.get(e);if(t){const r=iI(t),n=o.reduce((e,t,n)=>e+tI(r[n],t),0),s=Number((n/4).toFixed(4));i.push({id:e,data:{droppableContainer:a,value:s}})}}return i.sort(nI)};function lI(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=o-n,s=i-r;if(n{let t=e.collisionRect,r=e.droppableRects,n=e.droppableContainers;const o=[];for(const i of n){const e=i.id,n=r.get(e);if(n){const r=lI(n,t);r>0&&o.push({id:e,data:{droppableContainer:i,value:r}})}}return o.sort(oI)};function dI(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:eI}function uI(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o(0,Ae.A)((0,Ae.A)({},t),{},{top:t.top+e*r.y,bottom:t.bottom+e*r.y,left:t.left+e*r.x,right:t.right+e*r.x}),(0,Ae.A)({},t))}}const hI=uI(1);function pI(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}const vI={ignoreTransform:!1};function fI(e,t){void 0===t&&(t=vI);let r=e.getBoundingClientRect();if(t.ignoreTransform){const t=xj(e).getComputedStyle(e),n=t.transform,o=t.transformOrigin;n&&(r=function(e,t,r){const n=pI(t);if(!n)return e;const o=n.scaleX,i=n.scaleY,a=n.x,s=n.y,l=e.left-a-(1-o)*parseFloat(r),c=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}(r,n,o))}const n=r;return{top:n.top,left:n.left,width:n.width,height:n.height,bottom:n.bottom,right:n.right}}function mI(e){return fI(e,{ignoreTransform:!0})}function gI(e,t){const r=[];return e?function n(o){if(null!=t&&r.length>=t)return r;if(!o)return r;if(wj(o)&&null!=o.scrollingElement&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Sj(o)||kj(o))return r;if(r.includes(o))return r;const i=xj(e).getComputedStyle(o);return o!==e&&function(e,t){void 0===t&&(t=xj(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(e=>{const n=t[e];return"string"===typeof n&&r.test(n)})}(o,i)&&r.push(o),function(e,t){return void 0===t&&(t=xj(e).getComputedStyle(e)),"fixed"===t.position}(o,i)?r:n(o.parentNode)}(e):r}function yI(e){const t=gI(e,1),r=(0,s.A)(t,1)[0];return null!=r?r:null}function bI(e){return gj&&e?yj(e)?e:bj(e)?wj(e)||e===_j(e).scrollingElement?window:Sj(e)?e:null:null:null}function xI(e){return yj(e)?e.scrollX:e.scrollLeft}function wI(e){return yj(e)?e.scrollY:e.scrollTop}function SI(e){return{x:xI(e),y:wI(e)}}var kI;function _I(e){return!(!gj||!e)&&e===document.scrollingElement}function CI(e){const t={x:0,y:0},r=_I(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}!function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"}(kI||(kI={}));const AI={x:.2,y:.2};function jI(e,t,r,n,o){let i=r.top,a=r.left,s=r.right,l=r.bottom;void 0===n&&(n=10),void 0===o&&(o=AI);const c=CI(e),d=c.isTop,u=c.isBottom,h=c.isLeft,p=c.isRight,v={x:0,y:0},f={x:0,y:0},m=t.height*o.y,g=t.width*o.x;return!d&&i<=t.top+m?(v.y=kI.Backward,f.y=n*Math.abs((t.top+m-i)/m)):!u&&l>=t.bottom-m&&(v.y=kI.Forward,f.y=n*Math.abs((t.bottom-m-l)/m)),!p&&s>=t.right-g?(v.x=kI.Forward,f.x=n*Math.abs((t.right-g-s)/g)):!h&&a<=t.left+g&&(v.x=kI.Backward,f.x=n*Math.abs((t.left+g-a)/g)),{direction:v,speed:f}}function II(e){if(e===document.scrollingElement){const e=window,t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}const t=e.getBoundingClientRect();return{top:t.top,left:t.left,right:t.right,bottom:t.bottom,width:e.clientWidth,height:e.clientHeight}}function PI(e){return e.reduce((e,t)=>Dj(e,SI(t)),eI)}function RI(e,t){if(void 0===t&&(t=fI),!e)return;const r=t(e),n=r.top,o=r.left,i=r.bottom,a=r.right;yI(e)&&(i<=0||a<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const TI=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+xI(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+wI(t),0)}]];class EI{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=gI(t),n=PI(r);this.rect=(0,Ae.A)({},e),this.width=e.width,this.height=e.height;for(const i of TI){var o=(0,s.A)(i,3);const e=o[0],t=o[1],a=o[2];for(const o of t)Object.defineProperty(this,o,{get:()=>{const t=a(r),i=n[e]-t;return this.rect[o]+i},enumerable:!0})}Object.defineProperty(this,"rect",{enumerable:!1})}}class zI{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,r){var n;null==(n=this.target)||n.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function DI(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return"number"===typeof t?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t&&n>t.y}var MI,LI;function OI(e){e.preventDefault()}function FI(e){e.stopPropagation()}!function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"}(MI||(MI={})),function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"}(LI||(LI={}));const NI={start:[LI.Space,LI.Enter],cancel:[LI.Esc],end:[LI.Space,LI.Enter,LI.Tab]},BI=(e,t)=>{let r=t.currentCoordinates;switch(e.code){case LI.Right:return(0,Ae.A)((0,Ae.A)({},r),{},{x:r.x+25});case LI.Left:return(0,Ae.A)((0,Ae.A)({},r),{},{x:r.x-25});case LI.Down:return(0,Ae.A)((0,Ae.A)({},r),{},{y:r.y+25});case LI.Up:return(0,Ae.A)((0,Ae.A)({},r),{},{y:r.y-25})}};class HI{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const t=e.event.target;this.props=e,this.listeners=new zI(_j(t)),this.windowListeners=new zI(xj(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(MI.Resize,this.handleCancel),this.windowListeners.add(MI.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(MI.Keydown,this.handleKeyDown))}handleStart(){const e=this.props,t=e.activeNode,r=e.onStart,n=t.node.current;n&&RI(n),r(eI)}handleKeyDown(e){if(Lj(e)){const t=this.props,r=t.active,n=t.context,o=t.options,i=o.keyboardCodes,a=void 0===i?NI:i,s=o.coordinateGetter,l=void 0===s?BI:s,c=o.scrollBehavior,d=void 0===c?"smooth":c,u=e.code;if(a.end.includes(u))return void this.handleEnd(e);if(a.cancel.includes(u))return void this.handleCancel(e);const h=n.current.collisionRect,p=h?{x:h.left,y:h.top}:eI;this.referenceCoordinates||(this.referenceCoordinates=p);const v=l(e,{active:r,context:n.current,currentCoordinates:p});if(v){const t=Mj(v,p),r={x:0,y:0},o=n.current.scrollableAncestors;for(const n of o){const o=e.code,i=CI(n),a=i.isTop,s=i.isRight,l=i.isLeft,c=i.isBottom,u=i.maxScroll,h=i.minScroll,p=II(n),f={x:Math.min(o===LI.Right?p.right-p.width/2:p.right,Math.max(o===LI.Right?p.left:p.left+p.width/2,v.x)),y:Math.min(o===LI.Down?p.bottom-p.height/2:p.bottom,Math.max(o===LI.Down?p.top:p.top+p.height/2,v.y))},m=o===LI.Right&&!s||o===LI.Left&&!l,g=o===LI.Down&&!c||o===LI.Up&&!a;if(m&&f.x!==v.x){const e=n.scrollLeft+t.x,i=o===LI.Right&&e<=u.x||o===LI.Left&&e>=h.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:d});r.x=i?n.scrollLeft-e:o===LI.Right?n.scrollLeft-u.x:n.scrollLeft-h.x,r.x&&n.scrollBy({left:-r.x,behavior:d});break}if(g&&f.y!==v.y){const e=n.scrollTop+t.y,i=o===LI.Down&&e<=u.y||o===LI.Up&&e>=h.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:d});r.y=i?n.scrollTop-e:o===LI.Down?n.scrollTop-u.y:n.scrollTop-h.y,r.y&&n.scrollBy({top:-r.y,behavior:d});break}}this.handleMove(e,Dj(Mj(v,this.referenceCoordinates),r))}}}handleMove(e,t){const r=this.props.onMove;e.preventDefault(),r(t)}handleEnd(e){const t=this.props.onEnd;e.preventDefault(),this.detach(),t()}handleCancel(e){const t=this.props.onCancel;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function WI(e){return Boolean(e&&"distance"in e)}function VI(e){return Boolean(e&&"delay"in e)}HI.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let n=t.keyboardCodes,o=void 0===n?NI:n,i=t.onActivation,a=r.active;const s=e.nativeEvent.code;if(o.start.includes(s)){const t=a.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==i||i({event:e.nativeEvent}),!0)}return!1}}];class $I{constructor(e,t,r){var n;void 0===r&&(r=function(e){return e instanceof xj(e).EventTarget?e:_j(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const o=e.event,i=o.target;this.props=e,this.events=t,this.document=_j(i),this.documentListeners=new zI(this.document),this.listeners=new zI(r),this.windowListeners=new zI(xj(i)),this.initialCoordinates=null!=(n=Oj(o))?n:eI,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const e=this.events,t=this.props.options,r=t.activationConstraint,n=t.bypassActivationConstraint;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(MI.Resize,this.handleCancel),this.windowListeners.add(MI.DragStart,OI),this.windowListeners.add(MI.VisibilityChange,this.handleCancel),this.windowListeners.add(MI.ContextMenu,OI),this.documentListeners.add(MI.Keydown,this.handleKeydown),r){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(VI(r))return this.timeoutId=setTimeout(this.handleStart,r.delay),void this.handlePending(r);if(WI(r))return void this.handlePending(r)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){const r=this.props,n=r.active;(0,r.onPending)(n,e,this.initialCoordinates,t)}handleStart(){const e=this.initialCoordinates,t=this.props.onStart;e&&(this.activated=!0,this.documentListeners.add(MI.Click,FI,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(MI.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;const r=this.activated,n=this.initialCoordinates,o=this.props,i=o.onMove,a=o.options.activationConstraint;if(!n)return;const s=null!=(t=Oj(e))?t:eI,l=Mj(n,s);if(!r&&a){if(WI(a)){if(null!=a.tolerance&&DI(l,a.tolerance))return this.handleCancel();if(DI(l,a.distance))return this.handleStart()}return VI(a)&&DI(l,a.tolerance)?this.handleCancel():void this.handlePending(a,l)}e.cancelable&&e.preventDefault(),i(s)}handleEnd(){const e=this.props,t=e.onAbort,r=e.onEnd;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const e=this.props,t=e.onAbort,r=e.onCancel;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(e){e.code===LI.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}const UI={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qI extends $I{constructor(e){const t=_j(e.event.target);super(e,UI,t)}}qI.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let r=e.nativeEvent,n=t.onActivation;return!(!r.isPrimary||0!==r.button)&&(null==n||n({event:r}),!0)}}];const KI={move:{name:"mousemove"},end:{name:"mouseup"}};var GI;!function(e){e[e.RightClick=2]="RightClick"}(GI||(GI={}));(class extends $I{constructor(e){super(e,KI,_j(e.event.target))}}).activators=[{eventName:"onMouseDown",handler:(e,t)=>{let r=e.nativeEvent,n=t.onActivation;return r.button!==GI.RightClick&&(null==n||n({event:r}),!0)}}];const JI={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};var QI,YI;function XI(e){let t=e.acceleration,r=e.activator,n=void 0===r?QI.Pointer:r,i=e.canScroll,a=e.draggingRect,l=e.enabled,c=e.interval,d=void 0===c?5:c,u=e.order,h=void 0===u?YI.TreeOrder:u,p=e.pointerCoordinates,v=e.scrollableAncestors,f=e.scrollableAncestorRects,m=e.delta,g=e.threshold;const y=function(e){let t=e.delta,r=e.disabled;const n=Rj(t);return Ij(e=>{if(r||!n||!e)return ZI;const o={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[kI.Backward]:e.x[kI.Backward]||-1===o.x,[kI.Forward]:e.x[kI.Forward]||1===o.x},y:{[kI.Backward]:e.y[kI.Backward]||-1===o.y,[kI.Forward]:e.y[kI.Forward]||1===o.y}}},[r,t,n])}({delta:m,disabled:!l}),b=function(){const e=(0,o.useRef)(null);return[(0,o.useCallback)((t,r)=>{e.current=setInterval(t,r)},[]),(0,o.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}(),x=(0,s.A)(b,2),w=x[0],S=x[1],k=(0,o.useRef)({x:0,y:0}),_=(0,o.useRef)({x:0,y:0}),C=(0,o.useMemo)(()=>{switch(n){case QI.Pointer:return p?{top:p.y,bottom:p.y,left:p.x,right:p.x}:null;case QI.DraggableRect:return a}},[n,a,p]),A=(0,o.useRef)(null),j=(0,o.useCallback)(()=>{const e=A.current;if(!e)return;const t=k.current.x*_.current.x,r=k.current.y*_.current.y;e.scrollBy(t,r)},[]),I=(0,o.useMemo)(()=>h===YI.TreeOrder?[...v].reverse():v,[h,v]);(0,o.useEffect)(()=>{if(l&&v.length&&C){for(const e of I){if(!1===(null==i?void 0:i(e)))continue;const r=v.indexOf(e),n=f[r];if(!n)continue;const o=jI(e,n,C,t,g),a=o.direction,s=o.speed;for(const e of["x","y"])y[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0)return S(),A.current=e,w(j,d),k.current=s,void(_.current=a)}k.current={x:0,y:0},_.current={x:0,y:0},S()}else S()},[t,j,i,S,l,d,JSON.stringify(C),JSON.stringify(y),w,v,I,f,JSON.stringify(g)])}(class extends $I{constructor(e){super(e,JI)}static setup(){return window.addEventListener(JI.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(JI.move.name,e)};function e(){}}}).activators=[{eventName:"onTouchStart",handler:(e,t)=>{let r=e.nativeEvent,n=t.onActivation;return!(r.touches.length>1)&&(null==n||n({event:r}),!0)}}],function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"}(QI||(QI={})),function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"}(YI||(YI={}));const ZI={x:{[kI.Backward]:!1,[kI.Forward]:!1},y:{[kI.Backward]:!1,[kI.Forward]:!1}};var eP,tP;!function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"}(eP||(eP={})),function(e){e.Optimized="optimized"}(tP||(tP={}));const rP=new Map;function nP(e,t){return Ij(r=>e?r||("function"===typeof t?t(e):e):null,[t,e])}function oP(e){let t=e.callback,r=e.disabled;const n=Aj(t),i=(0,o.useMemo)(()=>{if(r||"undefined"===typeof window||"undefined"===typeof window.ResizeObserver)return;return new(0,window.ResizeObserver)(n)},[r]);return(0,o.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}function iP(e){return new EI(fI(e),e)}function aP(e,t,r){void 0===t&&(t=iP);const n=(0,o.useState)(null),i=(0,s.A)(n,2),a=i[0],l=i[1];function c(){l(n=>{if(!e)return null;var o;if(!1===e.isConnected)return null!=(o=null!=n?n:r)?o:null;const i=t(e);return JSON.stringify(n)===JSON.stringify(i)?n:i})}const d=function(e){let t=e.callback,r=e.disabled;const n=Aj(t),i=(0,o.useMemo)(()=>{if(!r&&"undefined"!==typeof window&&"undefined"!==typeof window.MutationObserver)return new(0,window.MutationObserver)(n)},[n,r]);return(0,o.useEffect)(()=>()=>null==i?void 0:i.disconnect(),[i]),i}({callback(t){if(e)for(const r of t){const t=r.type,n=r.target;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){c();break}}}}),u=oP({callback:c});return Cj(()=>{c(),e?(null==u||u.observe(e),null==d||d.observe(document.body,{childList:!0,subtree:!0})):(null==u||u.disconnect(),null==d||d.disconnect())},[e]),a}const sP=[];function lP(e,t){void 0===t&&(t=[]);const r=(0,o.useRef)(null);return(0,o.useEffect)(()=>{r.current=null},t),(0,o.useEffect)(()=>{const t=e!==eI;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?Mj(e,r.current):eI}function cP(e){return(0,o.useMemo)(()=>e?function(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}(e):null,[e])}const dP=[];function uP(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Sj(t)?t:e}const hP=[{sensor:qI,options:{}},{sensor:HI,options:{}}],pP={current:{}},vP={draggable:{measure:mI},droppable:{measure:mI,strategy:eP.WhileDragging,frequency:tP.Optimized},dragOverlay:{measure:fI}};class fP extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>!e.disabled)}getNodeFor(e){var t,r;return null!=(t=null==(r=this.get(e))?void 0:r.node.current)?t:void 0}}const mP={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fP,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Xj},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:vP,measureDroppableContainers:Xj,windowRect:null,measuringScheduled:!1},gP={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Xj,draggableNodes:new Map,over:null,measureDroppableContainers:Xj},yP=(0,o.createContext)(gP),bP=(0,o.createContext)(mP);function xP(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fP}}}function wP(e,t){switch(t.type){case Yj.DragStart:return(0,Ae.A)((0,Ae.A)({},e),{},{draggable:(0,Ae.A)((0,Ae.A)({},e.draggable),{},{initialCoordinates:t.initialCoordinates,active:t.active})});case Yj.DragMove:return null==e.draggable.active?e:(0,Ae.A)((0,Ae.A)({},e),{},{draggable:(0,Ae.A)((0,Ae.A)({},e.draggable),{},{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case Yj.DragEnd:case Yj.DragCancel:return(0,Ae.A)((0,Ae.A)({},e),{},{draggable:(0,Ae.A)((0,Ae.A)({},e.draggable),{},{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case Yj.RegisterDroppable:{const r=t.element,n=r.id,o=new fP(e.droppable.containers);return o.set(n,r),(0,Ae.A)((0,Ae.A)({},e),{},{droppable:(0,Ae.A)((0,Ae.A)({},e.droppable),{},{containers:o})})}case Yj.SetDroppableDisabled:{const r=t.id,n=t.key,o=t.disabled,i=e.droppable.containers.get(r);if(!i||n!==i.key)return e;const a=new fP(e.droppable.containers);return a.set(r,(0,Ae.A)((0,Ae.A)({},i),{},{disabled:o})),(0,Ae.A)((0,Ae.A)({},e),{},{droppable:(0,Ae.A)((0,Ae.A)({},e.droppable),{},{containers:a})})}case Yj.UnregisterDroppable:{const r=t.id,n=t.key,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const i=new fP(e.droppable.containers);return i.delete(r),(0,Ae.A)((0,Ae.A)({},e),{},{droppable:(0,Ae.A)((0,Ae.A)({},e.droppable),{},{containers:i})})}default:return e}}function SP(e){let t=e.disabled;const r=(0,o.useContext)(yP),n=r.active,i=r.activatorEvent,a=r.draggableNodes,s=Rj(i),l=Rj(null==n?void 0:n.id);return(0,o.useEffect)(()=>{if(!t&&!i&&s&&null!=l){if(!Lj(s))return;if(document.activeElement===s.target)return;const e=a.get(l);if(!e)return;const t=e.activatorNode,r=e.node;if(!t.current&&!r.current)return;requestAnimationFrame(()=>{for(const e of[t.current,r.current]){if(!e)continue;const t=Bj(e);if(t){t.focus();break}}})}},[i,t,a,l,s]),null}function kP(e,t){let r=t.transform,n=(0,Ic.A)(t,$j);return null!=e&&e.length?e.reduce((e,t)=>t((0,Ae.A)({transform:e},n)),r):r}const _P=(0,o.createContext)((0,Ae.A)((0,Ae.A)({},eI),{},{scaleX:1,scaleY:1}));var CP;!function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"}(CP||(CP={}));const AP=(0,o.memo)(function(e){var t,r,n,i;let a=e.id,l=e.accessibility,c=e.autoScroll,d=void 0===c||c,u=e.children,h=e.sensors,p=void 0===h?hP:h,v=e.collisionDetection,f=void 0===v?cI:v,m=e.measuring,g=e.modifiers,y=(0,Ic.A)(e,Uj);const b=(0,o.useReducer)(wP,void 0,xP),x=(0,s.A)(b,2),w=x[0],S=x[1],k=function(){const e=(0,o.useState)(()=>new Set),t=(0,s.A)(e,1)[0],r=(0,o.useCallback)(e=>(t.add(e),()=>t.delete(e)),[t]);return[(0,o.useCallback)(e=>{let r=e.type,n=e.event;t.forEach(e=>{var t;return null==(t=e[r])?void 0:t.call(e,n)})},[t]),r]}(),_=(0,s.A)(k,2),C=_[0],A=_[1],j=(0,o.useState)(CP.Uninitialized),I=(0,s.A)(j,2),P=I[0],R=I[1],T=P===CP.Initialized,E=w.draggable,z=E.active,D=E.nodes,M=E.translate,L=w.droppable.containers,O=null!=z?D.get(z):null,F=(0,o.useRef)({initial:null,translated:null}),N=(0,o.useMemo)(()=>{var e;return null!=z?{id:z,data:null!=(e=null==O?void 0:O.data)?e:pP,rect:F}:null},[z,O]),B=(0,o.useRef)(null),H=(0,o.useState)(null),W=(0,s.A)(H,2),V=W[0],$=W[1],U=(0,o.useState)(null),q=(0,s.A)(U,2),K=q[0],G=q[1],J=jj(y,Object.values(y)),Q=Ej("DndDescribedBy",a),Y=(0,o.useMemo)(()=>L.getEnabled(),[L]),X=(Z=m,(0,o.useMemo)(()=>({draggable:(0,Ae.A)((0,Ae.A)({},vP.draggable),null==Z?void 0:Z.draggable),droppable:(0,Ae.A)((0,Ae.A)({},vP.droppable),null==Z?void 0:Z.droppable),dragOverlay:(0,Ae.A)((0,Ae.A)({},vP.dragOverlay),null==Z?void 0:Z.dragOverlay)}),[null==Z?void 0:Z.draggable,null==Z?void 0:Z.droppable,null==Z?void 0:Z.dragOverlay]));var Z;const ee=function(e,t){let r=t.dragging,n=t.dependencies,i=t.config;const a=(0,o.useState)(null),l=(0,s.A)(a,2),c=l[0],d=l[1],u=i.frequency,h=i.measure,p=i.strategy,v=(0,o.useRef)(e),f=function(){switch(p){case eP.Always:return!1;case eP.BeforeDragging:return r;default:return!r}}(),m=jj(f),g=(0,o.useCallback)(function(e){void 0===e&&(e=[]),m.current||d(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[m]),y=(0,o.useRef)(null),b=Ij(t=>{if(f&&!r)return rP;if(!t||t===rP||v.current!==e||null!=c){const t=new Map;for(let r of e){if(!r)continue;if(c&&c.length>0&&!c.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}const e=r.node.current,n=e?new EI(h(e),e):null;r.rect.current=n,n&&t.set(r.id,n)}return t}return t},[e,c,r,f,h]);return(0,o.useEffect)(()=>{v.current=e},[e]),(0,o.useEffect)(()=>{f||g()},[r,f]),(0,o.useEffect)(()=>{c&&c.length>0&&d(null)},[JSON.stringify(c)]),(0,o.useEffect)(()=>{f||"number"!==typeof u||null!==y.current||(y.current=setTimeout(()=>{g(),y.current=null},u))},[u,f,g,...n]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:null!=c}}(Y,{dragging:T,dependencies:[M.x,M.y],config:X.droppable}),te=ee.droppableRects,re=ee.measureDroppableContainers,ne=ee.measuringScheduled,oe=function(e,t){const r=null!=t?e.get(t):void 0,n=r?r.node.current:null;return Ij(e=>{var r;return null==t?null:null!=(r=null!=n?n:e)?r:null},[n,t])}(D,z),ie=(0,o.useMemo)(()=>K?Oj(K):null,[K]),ae=function(){const e=!1===(null==V?void 0:V.autoScrollEnabled),t="object"===typeof d?!1===d.enabled:!1===d,r=T&&!e&&!t;if("object"===typeof d)return(0,Ae.A)((0,Ae.A)({},d),{},{enabled:r});return{enabled:r}}(),se=function(e,t){return nP(e,t)}(oe,X.draggable.measure);!function(e){let t=e.activeNode,r=e.measure,n=e.initialRect,i=e.config,a=void 0===i||i;const s=(0,o.useRef)(!1),l="boolean"===typeof a?{x:a,y:a}:a,c=l.x,d=l.y;Cj(()=>{if(!c&&!d||!t)return void(s.current=!1);if(s.current||!n)return;const e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;const o=dI(r(e),n);if(c||(o.x=0),d||(o.y=0),s.current=!0,Math.abs(o.x)>0||Math.abs(o.y)>0){const t=yI(e);t&&t.scrollBy({top:o.y,left:o.x})}},[t,c,d,n,r])}({activeNode:null!=z?D.get(z):null,config:ae.layoutShiftCompensation,initialRect:se,measure:X.draggable.measure});const le=aP(oe,X.draggable.measure,se),ce=aP(oe?oe.parentElement:null),de=(0,o.useRef)({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:te,draggableNodes:D,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ue=L.getNodeFor(null==(t=de.current.over)?void 0:t.id),he=function(e){let t=e.measure;const r=(0,o.useState)(null),n=(0,s.A)(r,2),i=n[0],a=n[1],l=oP({callback:(0,o.useCallback)(e=>{for(const r of e){const e=r.target;if(Sj(e)){a(r=>{const n=t(e);return r?(0,Ae.A)((0,Ae.A)({},r),{},{width:n.width,height:n.height}):n});break}}},[t])}),c=Pj((0,o.useCallback)(e=>{const r=uP(e);null==l||l.disconnect(),r&&(null==l||l.observe(r)),a(r?t(r):null)},[t,l])),d=(0,s.A)(c,2),u=d[0],h=d[1];return(0,o.useMemo)(()=>({nodeRef:u,rect:i,setRef:h}),[i,u,h])}({measure:X.dragOverlay.measure}),pe=null!=(r=he.nodeRef.current)?r:oe,ve=T?null!=(n=he.rect)?n:le:null,fe=Boolean(he.nodeRef.current&&he.rect),me=dI(ge=fe?null:le,nP(ge));var ge;const ye=cP(pe?xj(pe):null),be=function(e){const t=(0,o.useRef)(e),r=Ij(r=>e?r&&r!==sP&&e&&t.current&&e.parentNode===t.current.parentNode?r:gI(e):sP,[e]);return(0,o.useEffect)(()=>{t.current=e},[e]),r}(T?null!=ue?ue:oe:null),xe=function(e,t){void 0===t&&(t=fI);const r=(0,s.A)(e,1)[0],n=cP(r?xj(r):null),i=(0,o.useState)(dP),a=(0,s.A)(i,2),l=a[0],c=a[1];function d(){c(()=>e.length?e.map(e=>_I(e)?n:new EI(t(e),e)):dP)}const u=oP({callback:d});return Cj(()=>{null==u||u.disconnect(),d(),e.forEach(e=>null==u?void 0:u.observe(e))},[e]),l}(be),we=kP(g,{transform:{x:M.x-me.x,y:M.y-me.y,scaleX:1,scaleY:1},activatorEvent:K,active:N,activeNodeRect:le,containerNodeRect:ce,draggingNodeRect:ve,over:de.current.over,overlayNodeRect:he.rect,scrollableAncestors:be,scrollableAncestorRects:xe,windowRect:ye}),Se=ie?Dj(ie,M):null,ke=function(e){const t=(0,o.useState)(null),r=(0,s.A)(t,2),n=r[0],i=r[1],a=(0,o.useRef)(e),l=(0,o.useCallback)(e=>{const t=bI(e.target);t&&i(e=>e?(e.set(t,SI(t)),new Map(e)):null)},[]);return(0,o.useEffect)(()=>{const t=a.current;if(e!==t){r(t);const n=e.map(e=>{const t=bI(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,SI(t)]):null}).filter(e=>null!=e);i(n.length?new Map(n):null),a.current=e}return()=>{r(e),r(t)};function r(e){e.forEach(e=>{const t=bI(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),(0,o.useMemo)(()=>e.length?n?Array.from(n.values()).reduce((e,t)=>Dj(e,t),eI):PI(e):eI,[e,n])}(be),_e=lP(ke),Ce=lP(ke,[le]),je=Dj(we,_e),Ie=ve?hI(ve,we):null,Pe=N&&Ie?f({active:N,collisionRect:Ie,droppableRects:te,droppableContainers:Y,pointerCoordinates:Se}):null,Re=aI(Pe,"id"),Te=(0,o.useState)(null),Ee=(0,s.A)(Te,2),ze=Ee[0],De=Ee[1],Me=function(e,t,r){return(0,Ae.A)((0,Ae.A)({},e),{},{scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1})}(fe?we:Dj(we,Ce),null!=(i=null==ze?void 0:ze.rect)?i:null,le),Le=(0,o.useRef)(null),Oe=(0,o.useCallback)((e,t)=>{let r=t.sensor,n=t.options;if(null==B.current)return;const o=D.get(B.current);if(!o)return;const i=e.nativeEvent,a=new r({active:B.current,activeNode:o,event:i,options:n,context:de,onAbort(e){if(!D.get(e))return;const t=J.current.onDragAbort,r={id:e};null==t||t(r),C({type:"onDragAbort",event:r})},onPending(e,t,r,n){if(!D.get(e))return;const o=J.current.onDragPending,i={id:e,constraint:t,initialCoordinates:r,offset:n};null==o||o(i),C({type:"onDragPending",event:i})},onStart(e){const t=B.current;if(null==t)return;const r=D.get(t);if(!r)return;const n=J.current.onDragStart,o={activatorEvent:i,active:{id:t,data:r.data,rect:F}};(0,pc.unstable_batchedUpdates)(()=>{null==n||n(o),R(CP.Initializing),S({type:Yj.DragStart,initialCoordinates:e,active:t}),C({type:"onDragStart",event:o}),$(Le.current),G(i)})},onMove(e){S({type:Yj.DragMove,coordinates:e})},onEnd:s(Yj.DragEnd),onCancel:s(Yj.DragCancel)});function s(e){return async function(){const t=de.current,r=t.active,n=t.collisions,o=t.over,a=t.scrollAdjustedTranslate;let s=null;if(r&&a){const t=J.current.cancelDrop;if(s={activatorEvent:i,active:r,collisions:n,delta:a,over:o},e===Yj.DragEnd&&"function"===typeof t){await Promise.resolve(t(s))&&(e=Yj.DragCancel)}}B.current=null,(0,pc.unstable_batchedUpdates)(()=>{S({type:e}),R(CP.Uninitialized),De(null),$(null),G(null),Le.current=null;const t=e===Yj.DragEnd?"onDragEnd":"onDragCancel";if(s){const e=J.current[t];null==e||e(s),C({type:t,event:s})}})}}Le.current=a},[D]),Fe=(0,o.useCallback)((e,t)=>(r,n)=>{const o=r.nativeEvent,i=D.get(n);if(null!==B.current||!i||o.dndKit||o.defaultPrevented)return;const a={active:i};!0===e(r,t.options,a)&&(o.dndKit={capturedBy:t.sensor},B.current=n,Oe(r,t))},[D,Oe]),Ne=function(e,t){return(0,o.useMemo)(()=>e.reduce((e,r)=>[...e,...r.sensor.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,r)}))],[]),[e,t])}(p,Fe);!function(e){(0,o.useEffect)(()=>{if(!gj)return;const t=e.map(e=>{let t=e.sensor;return null==t.setup?void 0:t.setup()});return()=>{for(const e of t)null==e||e()}},e.map(e=>e.sensor))}(p),Cj(()=>{le&&P===CP.Initializing&&R(CP.Initialized)},[le,P]),(0,o.useEffect)(()=>{const e=J.current.onDragMove,t=de.current,r=t.active,n=t.activatorEvent,o=t.collisions,i=t.over;if(!r||!n)return;const a={active:r,activatorEvent:n,collisions:o,delta:{x:je.x,y:je.y},over:i};(0,pc.unstable_batchedUpdates)(()=>{null==e||e(a),C({type:"onDragMove",event:a})})},[je.x,je.y]),(0,o.useEffect)(()=>{const e=de.current,t=e.active,r=e.activatorEvent,n=e.collisions,o=e.droppableContainers,i=e.scrollAdjustedTranslate;if(!t||null==B.current||!r||!i)return;const a=J.current.onDragOver,s=o.get(Re),l=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,c={active:t,activatorEvent:r,collisions:n,delta:{x:i.x,y:i.y},over:l};(0,pc.unstable_batchedUpdates)(()=>{De(l),null==a||a(c),C({type:"onDragOver",event:c})})},[Re]),Cj(()=>{de.current={activatorEvent:K,active:N,activeNode:oe,collisionRect:Ie,collisions:Pe,droppableRects:te,draggableNodes:D,draggingNode:pe,draggingNodeRect:ve,droppableContainers:L,over:ze,scrollableAncestors:be,scrollAdjustedTranslate:je},F.current={initial:ve,translated:Ie}},[N,oe,Pe,Ie,D,pe,ve,te,L,ze,be,je]),XI((0,Ae.A)((0,Ae.A)({},ae),{},{delta:M,draggingRect:Ie,pointerCoordinates:Se,scrollableAncestors:be,scrollableAncestorRects:xe}));const Be=(0,o.useMemo)(()=>({active:N,activeNode:oe,activeNodeRect:le,activatorEvent:K,collisions:Pe,containerNodeRect:ce,dragOverlay:he,draggableNodes:D,droppableContainers:L,droppableRects:te,over:ze,measureDroppableContainers:re,scrollableAncestors:be,scrollableAncestorRects:xe,measuringConfiguration:X,measuringScheduled:ne,windowRect:ye}),[N,oe,le,K,Pe,ce,he,D,L,te,ze,re,be,xe,X,ne,ye]),He=(0,o.useMemo)(()=>({activatorEvent:K,activators:Ne,active:N,activeNodeRect:le,ariaDescribedById:{draggable:Q},dispatch:S,draggableNodes:D,over:ze,measureDroppableContainers:re}),[K,Ne,N,le,S,Q,D,ze,re]);return o.createElement(Kj.Provider,{value:A},o.createElement(yP.Provider,{value:He},o.createElement(bP.Provider,{value:Be},o.createElement(_P.Provider,{value:Me},u)),o.createElement(SP,{disabled:!1===(null==l?void 0:l.restoreFocus)})),o.createElement(Qj,(0,Ae.A)((0,Ae.A)({},l),{},{hiddenTextDescribedById:Q})))}),jP=(0,o.createContext)(null),IP="button";function PP(e){let t=e.id,r=e.data,n=e.disabled,i=void 0!==n&&n,a=e.attributes;const l=Ej("Draggable"),c=(0,o.useContext)(yP),d=c.activators,u=c.activatorEvent,h=c.active,p=c.activeNodeRect,v=c.ariaDescribedById,f=c.draggableNodes,m=c.over,g=null!=a?a:{},y=g.role,b=void 0===y?IP:y,x=g.roleDescription,w=void 0===x?"draggable":x,S=g.tabIndex,k=void 0===S?0:S,_=(null==h?void 0:h.id)===t,C=(0,o.useContext)(_?_P:jP),A=Pj(),j=(0,s.A)(A,2),I=j[0],P=j[1],R=Pj(),T=(0,s.A)(R,2),E=T[0],z=T[1],D=function(e,t){return(0,o.useMemo)(()=>e.reduce((e,r)=>{let n=r.eventName,o=r.handler;return e[n]=e=>{o(e,t)},e},{}),[e,t])}(d,t),M=jj(r);Cj(()=>(f.set(t,{id:t,key:l,node:I,activatorNode:E,data:M}),()=>{const e=f.get(t);e&&e.key===l&&f.delete(t)}),[f,t]);return{active:h,activatorEvent:u,activeNodeRect:p,attributes:(0,o.useMemo)(()=>({role:b,tabIndex:k,"aria-disabled":i,"aria-pressed":!(!_||b!==IP)||void 0,"aria-roledescription":w,"aria-describedby":v.draggable}),[i,b,k,_,w,v.draggable]),isDragging:_,listeners:i?void 0:D,node:I,over:m,setNodeRef:P,setActivatorNodeRef:z,transform:C}}function RP(){return(0,o.useContext)(bP)}const TP={timeout:25};function EP(e){let t=e.data,r=e.disabled,n=void 0!==r&&r,i=e.id,a=e.resizeObserverConfig;const l=Ej("Droppable"),c=(0,o.useContext)(yP),d=c.active,u=c.dispatch,h=c.over,p=c.measureDroppableContainers,v=(0,o.useRef)({disabled:n}),f=(0,o.useRef)(!1),m=(0,o.useRef)(null),g=(0,o.useRef)(null),y=(0,Ae.A)((0,Ae.A)({},TP),a),b=y.disabled,x=y.updateMeasurementsFor,w=y.timeout,S=jj(null!=x?x:i),k=oP({callback:(0,o.useCallback)(()=>{f.current?(null!=g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{p(Array.isArray(S.current)?S.current:[S.current]),g.current=null},w)):f.current=!0},[w]),disabled:b||!d}),_=Pj((0,o.useCallback)((e,t)=>{k&&(t&&(k.unobserve(t),f.current=!1),e&&k.observe(e))},[k])),C=(0,s.A)(_,2),A=C[0],j=C[1],I=jj(t);return(0,o.useEffect)(()=>{k&&A.current&&(k.disconnect(),f.current=!1,k.observe(A.current))},[A,k]),(0,o.useEffect)(()=>(u({type:Yj.RegisterDroppable,element:{id:i,key:l,disabled:n,node:A,rect:m,data:I}}),()=>u({type:Yj.UnregisterDroppable,key:l,id:i})),[i]),(0,o.useEffect)(()=>{n!==v.current.disabled&&(u({type:Yj.SetDroppableDisabled,id:i,key:l,disabled:n}),v.current.disabled=n)},[i,l,n,u]),{active:d,rect:m,isOver:(null==h?void 0:h.id)===i,node:A,over:h,setNodeRef:j}}function zP(e){let t=e.animation,r=e.children;const n=(0,o.useState)(null),i=(0,s.A)(n,2),a=i[0],l=i[1],c=(0,o.useState)(null),d=(0,s.A)(c,2),u=d[0],h=d[1],p=Rj(r);return r||a||!p||l(p),Cj(()=>{if(!u)return;const e=null==a?void 0:a.key,r=null==a?void 0:a.props.id;null!=e&&null!=r?Promise.resolve(t(r,u)).then(()=>{l(null)}):l(null)},[t,a,u]),o.createElement(o.Fragment,null,r,a?(0,o.cloneElement)(a,{ref:h}):null)}const DP={x:0,y:0,scaleX:1,scaleY:1};function MP(e){let t=e.children;return o.createElement(yP.Provider,{value:gP},o.createElement(_P.Provider,{value:DP},t))}const LP={position:"fixed",touchAction:"none"},OP=e=>Lj(e)?"transform 250ms ease":void 0,FP=(0,o.forwardRef)((e,t)=>{let r=e.as,n=e.activatorEvent,i=e.adjustScale,a=e.children,s=e.className,l=e.rect,c=e.style,d=e.transform,u=e.transition,h=void 0===u?OP:u;if(!l)return null;const p=i?d:(0,Ae.A)((0,Ae.A)({},d),{},{scaleX:1,scaleY:1}),v=(0,Ae.A)((0,Ae.A)({},LP),{},{width:l.width,height:l.height,top:l.top,left:l.left,transform:Fj.Transform.toString(p),transformOrigin:i&&n?rI(n,l):void 0,transition:"function"===typeof h?h(n):h},c);return o.createElement(r,{className:s,style:v,ref:t},a)}),NP=e=>t=>{let r=t.active,n=t.dragOverlay;const o={},i=e.styles,a=e.className;if(null!=i&&i.active)for(const e of Object.entries(i.active)){var l=(0,s.A)(e,2);const t=l[0],n=l[1];void 0!==n&&(o[t]=r.node.style.getPropertyValue(t),r.node.style.setProperty(t,n))}if(null!=i&&i.dragOverlay)for(const e of Object.entries(i.dragOverlay)){var c=(0,s.A)(e,2);const t=c[0],r=c[1];void 0!==r&&n.node.style.setProperty(t,r)}return null!=a&&a.active&&r.node.classList.add(a.active),null!=a&&a.dragOverlay&&n.node.classList.add(a.dragOverlay),function(){for(const t of Object.entries(o)){var e=(0,s.A)(t,2);const n=e[0],o=e[1];r.node.style.setProperty(n,o)}null!=a&&a.active&&r.node.classList.remove(a.active)}},BP={duration:250,easing:"ease",keyframes:e=>{let t=e.transform,r=t.initial,n=t.final;return[{transform:Fj.Transform.toString(r)},{transform:Fj.Transform.toString(n)}]},sideEffects:NP({styles:{active:{opacity:"0"}}})};function HP(e){let t=e.config,r=e.draggableNodes,n=e.droppableContainers,o=e.measuringConfiguration;return Aj((e,i)=>{if(null===t)return;const a=r.get(e);if(!a)return;const l=a.node.current;if(!l)return;const c=uP(i);if(!c)return;const d=pI(xj(i).getComputedStyle(i).transform);if(!d)return;const u="function"===typeof t?t:function(e){const t=(0,Ae.A)((0,Ae.A)({},BP),e),r=t.duration,n=t.easing,o=t.sideEffects,i=t.keyframes;return e=>{let t=e.active,a=e.dragOverlay,l=e.transform,c=(0,Ic.A)(e,qj);if(!r)return;const d={x:a.rect.left-t.rect.left,y:a.rect.top-t.rect.top},u={scaleX:1!==l.scaleX?t.rect.width*l.scaleX/a.rect.width:1,scaleY:1!==l.scaleY?t.rect.height*l.scaleY/a.rect.height:1},h=(0,Ae.A)({x:l.x-d.x,y:l.y-d.y},u),p=i((0,Ae.A)((0,Ae.A)({},c),{},{active:t,dragOverlay:a,transform:{initial:l,final:h}})),v=(0,s.A)(p,1)[0],f=p[p.length-1];if(JSON.stringify(v)===JSON.stringify(f))return;const m=null==o?void 0:o((0,Ae.A)({active:t,dragOverlay:a},c)),g=a.node.animate(p,{duration:r,easing:n,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{null==m||m(),e()}})}}(t);return RI(l,o.draggable.measure),u({active:{id:e,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:r,dragOverlay:{node:i,rect:o.dragOverlay.measure(c)},droppableContainers:n,measuringConfiguration:o,transform:d})})}let WP=0;function VP(e){return(0,o.useMemo)(()=>{if(null!=e)return WP++,WP},[e])}const $P=o.memo(e=>{let t=e.adjustScale,r=void 0!==t&&t,n=e.children,i=e.dropAnimation,a=e.style,s=e.transition,l=e.modifiers,c=e.wrapperElement,d=void 0===c?"div":c,u=e.className,h=e.zIndex,p=void 0===h?999:h;const v=RP(),f=v.activatorEvent,m=v.active,g=v.activeNodeRect,y=v.containerNodeRect,b=v.draggableNodes,x=v.droppableContainers,w=v.dragOverlay,S=v.over,k=v.measuringConfiguration,_=v.scrollableAncestors,C=v.scrollableAncestorRects,A=v.windowRect,j=(0,o.useContext)(_P),I=VP(null==m?void 0:m.id),P=kP(l,{activatorEvent:f,active:m,activeNodeRect:g,containerNodeRect:y,draggingNodeRect:w.rect,over:S,overlayNodeRect:w.rect,scrollableAncestors:_,scrollableAncestorRects:C,transform:j,windowRect:A}),R=nP(g),T=HP({config:i,draggableNodes:b,droppableContainers:x,measuringConfiguration:k}),E=R?w.setRef:void 0;return o.createElement(MP,null,o.createElement(zP,{animation:T},m&&I?o.createElement(FP,{key:I,id:m.id,ref:E,as:d,activatorEvent:f,adjustScale:r,className:u,transition:s,rect:R,style:(0,Ae.A)({zIndex:p},a),transform:P},n):null))});function UP(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function qP(e,t){return e.reduce((e,r,n)=>{const o=t.get(r);return o&&(e[n]=o),e},Array(e.length))}function KP(e){return null!==e&&e>=0}const GP=e=>{let t=e.rects,r=e.activeIndex,n=e.overIndex,o=e.index;const i=UP(t,n,r),a=t[o],s=i[o];return s&&a?{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}:null},JP={scaleX:1,scaleY:1},QP=e=>{var t;let r=e.activeIndex,n=e.activeNodeRect,o=e.index,i=e.rects,a=e.overIndex;const s=null!=(t=i[r])?t:n;if(!s)return null;if(o===r){const e=i[a];return e?(0,Ae.A)({x:0,y:rr&&o<=a?(0,Ae.A)({x:0,y:-s.height-l},JP):o=a?(0,Ae.A)({x:0,y:s.height+l},JP):(0,Ae.A)({x:0,y:0},JP)};const YP="Sortable",XP=o.createContext({activeIndex:-1,containerId:YP,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:GP,disabled:{draggable:!1,droppable:!1}});function ZP(e){let t=e.children,r=e.id,n=e.items,i=e.strategy,a=void 0===i?GP:i,s=e.disabled,l=void 0!==s&&s;const c=RP(),d=c.active,u=c.dragOverlay,h=c.droppableRects,p=c.over,v=c.measureDroppableContainers,f=Ej(YP,r),m=Boolean(null!==u.rect),g=(0,o.useMemo)(()=>n.map(e=>"object"===typeof e&&"id"in e?e.id:e),[n]),y=null!=d,b=d?g.indexOf(d.id):-1,x=p?g.indexOf(p.id):-1,w=(0,o.useRef)(g),S=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{S&&y&&v(g)},[S,g,y,v]),(0,o.useEffect)(()=>{w.current=g},[g]);const C=(0,o.useMemo)(()=>({activeIndex:b,containerId:f,disabled:_,disableTransforms:k,items:g,overIndex:x,useDragOverlay:m,sortedRects:qP(g,h),strategy:a}),[b,f,_.draggable,_.droppable,k,g,x,h,m,a]);return o.createElement(XP.Provider,{value:C},t)}const eR=e=>{let t=e.id;return UP(e.items,e.activeIndex,e.overIndex).indexOf(t)},tR=e=>{let t=e.containerId,r=e.isSorting,n=e.wasDragging,o=e.index,i=e.items,a=e.newIndex,s=e.previousItems,l=e.previousContainerId;return!(!e.transition||!n)&&((s===i||o!==a)&&(!!r||a!==o&&t===l))},rR={duration:200,easing:"ease"},nR="transform",oR=Fj.Transition.toString({property:nR,duration:0,easing:"linear"}),iR={roleDescription:"sortable"};function aR(e){let t=e.animateLayoutChanges,r=void 0===t?tR:t,n=e.attributes,i=e.disabled,a=e.data,l=e.getNewIndex,c=void 0===l?eR:l,d=e.id,u=e.strategy,h=e.resizeObserverConfig,p=e.transition,v=void 0===p?rR:p;const f=(0,o.useContext)(XP),m=f.items,g=f.containerId,y=f.activeIndex,b=f.disabled,x=f.disableTransforms,w=f.sortedRects,S=f.overIndex,k=f.useDragOverlay,_=f.strategy,C=function(e,t){var r,n;if("boolean"===typeof e)return{draggable:e,droppable:!1};return{draggable:null!=(r=null==e?void 0:e.draggable)?r:t.draggable,droppable:null!=(n=null==e?void 0:e.droppable)?n:t.droppable}}(i,b),A=m.indexOf(d),j=(0,o.useMemo)(()=>(0,Ae.A)({sortable:{containerId:g,index:A,items:m}},a),[g,a,A,m]),I=(0,o.useMemo)(()=>m.slice(m.indexOf(d)),[m,d]),P=EP({id:d,data:j,disabled:C.droppable,resizeObserverConfig:(0,Ae.A)({updateMeasurementsFor:I},h)}),R=P.rect,T=P.node,E=P.isOver,z=P.setNodeRef,D=PP({id:d,data:j,attributes:(0,Ae.A)((0,Ae.A)({},iR),n),disabled:C.draggable}),M=D.active,L=D.activatorEvent,O=D.activeNodeRect,F=D.attributes,N=D.setNodeRef,B=D.listeners,H=D.isDragging,W=D.over,V=D.setActivatorNodeRef,$=D.transform,U=function(){for(var e=arguments.length,t=new Array(e),r=0;re=>{t.forEach(t=>t(e))},t)}(z,N),q=Boolean(M),K=q&&!x&&KP(y)&&KP(S),G=!k&&H,J=G&&K?$:null,Q=K?null!=J?J:(null!=u?u:_)({rects:w,activeNodeRect:O,activeIndex:y,overIndex:S,index:A}):null,Y=KP(y)&&KP(S)?c({id:d,items:m,activeIndex:y,overIndex:S}):A,X=null==M?void 0:M.id,Z=(0,o.useRef)({activeId:X,items:m,newIndex:Y,containerId:g}),ee=m!==Z.current.items,te=r({active:M,containerId:g,isDragging:H,isSorting:q,id:d,index:A,items:m,newIndex:Z.current.newIndex,previousItems:Z.current.items,previousContainerId:Z.current.containerId,transition:v,wasDragging:null!=Z.current.activeId}),re=function(e){let t=e.disabled,r=e.index,n=e.node,i=e.rect;const a=(0,o.useState)(null),l=(0,s.A)(a,2),c=l[0],d=l[1],u=(0,o.useRef)(r);return Cj(()=>{if(!t&&r!==u.current&&n.current){const e=i.current;if(e){const t=fI(n.current,{ignoreTransform:!0}),r={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(r.x||r.y)&&d(r)}}r!==u.current&&(u.current=r)},[t,r,n,i]),(0,o.useEffect)(()=>{c&&d(null)},[c]),c}({disabled:!te,index:A,node:T,rect:R});return(0,o.useEffect)(()=>{q&&Z.current.newIndex!==Y&&(Z.current.newIndex=Y),g!==Z.current.containerId&&(Z.current.containerId=g),m!==Z.current.items&&(Z.current.items=m)},[q,Y,g,m]),(0,o.useEffect)(()=>{if(X===Z.current.activeId)return;if(X&&!Z.current.activeId)return void(Z.current.activeId=X);const e=setTimeout(()=>{Z.current.activeId=X},50);return()=>clearTimeout(e)},[X]),{active:M,activeIndex:y,attributes:F,data:j,rect:R,index:A,newIndex:Y,items:m,isOver:E,isSorting:q,isDragging:H,listeners:B,node:T,overIndex:S,over:W,setNodeRef:U,setActivatorNodeRef:V,setDroppableNodeRef:z,setDraggableNodeRef:N,transform:null!=re?re:Q,transition:function(){if(re||ee&&Z.current.newIndex===A)return oR;if(G&&!Lj(L)||!v)return;if(q||te)return Fj.Transition.toString((0,Ae.A)((0,Ae.A)({},v),{},{property:nR}));return}()}}function sR(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&"object"===typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const lR=[LI.Down,LI.Right,LI.Up,LI.Left],cR=(e,t)=>{let r=t.context,n=r.active,o=r.collisionRect,i=r.droppableRects,a=r.droppableContainers,s=r.over,l=r.scrollableAncestors;if(lR.includes(e.code)){if(e.preventDefault(),!n||!o)return;const t=[];a.getEnabled().forEach(r=>{if(!r||null!=r&&r.disabled)return;const n=i.get(r.id);if(n)switch(e.code){case LI.Down:o.topn.top&&t.push(r);break;case LI.Left:o.left>n.left&&t.push(r);break;case LI.Right:o.left1&&(c=r[1].id),null!=c){const e=a.get(n.id),t=a.get(c),r=t?i.get(t.id):null,s=null==t?void 0:t.node.current;if(s&&r&&e&&t){const n=gI(s).some((e,t)=>l[t]!==e),i=dR(e,t),a=function(e,t){if(!sR(e)||!sR(t))return!1;if(!dR(e,t))return!1;return e.data.current.sortable.indext.root})(e=>{let t=e.theme,r=e.ownerState;var n;const o="calc(var(--CardOverflow-radius) - var(--variant-borderWidth, 0px))";return(0,je.A)({alignSelf:"stretch",position:"relative",display:"flex",flexDirection:"var(--_CardOverflow-flexDirection)",margin:"var(--_CardOverflow-margin)",borderRadius:"var(--_CardOverflow-radius)",padding:"var(--_CardOverflow-padding)",[".".concat(ai.vertical," &, .").concat(ai.horizontal," .").concat(ai.vertical," &, .").concat(F_.root," &")]:{"--_CardOverflow-flexDirection":"column","--AspectRatio-margin":"0 calc(-1 * var(--Card-padding))","--_CardOverflow-margin":"0 var(--CardOverflow-offset)","--_CardOverflow-padding":"0 var(--Card-padding)","&[data-first-child]":{"--AspectRatio-radius":"".concat(o," ").concat(o," 0 0"),"--_CardOverflow-radius":"var(--CardOverflow-radius) var(--CardOverflow-radius) 0 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) 0"},"&[data-last-child]":{"--AspectRatio-radius":"0 0 ".concat(o," ").concat(o),"--_CardOverflow-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)","--_CardOverflow-margin":"0 var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":o,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},["& > .".concat(uo.root,":only-child")]:{zIndex:1,width:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"0 var(--CardOverflow-offset)","--Button-radius":"0 0 var(--CardOverflow-radius) var(--CardOverflow-radius)"}},[".".concat(ai.horizontal," &, .").concat(ai.vertical," .").concat(ai.horizontal," &")]:{"--_CardOverflow-flexDirection":"row","--AspectRatio-margin":"calc(-1 * var(--Card-padding)) 0px","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px","--_CardOverflow-padding":"var(--Card-padding) 0px","&[data-first-child]":{"--AspectRatio-radius":"".concat(o," 0 0 ").concat(o),"--_CardOverflow-radius":"var(--CardOverflow-radius) 0 0 var(--CardOverflow-radius)","--_CardOverflow-margin":"var(--CardOverflow-offset) 0px var(--CardOverflow-offset) var(--CardOverflow-offset)"},"&[data-last-child]":{"--AspectRatio-radius":"0 ".concat(o," ").concat(o," 0"),"--_CardOverflow-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0","--_CardOverflow-margin":"var(--CardOverflow-offset) var(--CardOverflow-offset) var(--CardOverflow-offset) 0px"},"&[data-last-child][data-first-child]":{"--AspectRatio-radius":o,"--_CardOverflow-margin":"var(--CardOverflow-offset)"},["& > .".concat(uo.root,":only-child")]:{height:"calc(100% + -2 * var(--CardOverflow-offset))","--Button-margin":"var(--CardOverflow-offset) 0","--Button-radius":"0 var(--CardOverflow-radius) var(--CardOverflow-radius) 0"}}},null==(n=t.variants[r.variant])?void 0:n[r.color])}),pR=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyCardOverflow"}),n=r.className,o=r.component,i=void 0===o?"div":o,a=r.children,l=r.color,c=void 0===l?"neutral":l,d=r.variant,u=void 0===d?"plain":d,h=r.slots,p=void 0===h?{}:h,v=r.slotProps,f=void 0===v?{}:v,m=(0,Ie.A)(r,uR),g=(0,je.A)({},r,{component:i,color:c,variant:u}),y=(e=>{const t=e.variant,r=e.color;return Dr({root:["root",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r))]},HC,{})})(g),b=(0,je.A)({},m,{component:i,slots:p,slotProps:f}),x=pn("root",{ref:t,className:(0,Pe.A)(y.root,n),elementType:hR,externalForwardedProps:b,ownerState:g}),w=(0,s.A)(x,2),S=w[0],k=w[1];return(0,tr.jsx)(S,(0,je.A)({},k,{children:a}))});pR.muiName="CardOverflow";const vR=pR;function fR(e){return xr("MuiDialogTitle",e)}const mR=wr("MuiDialogTitle",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),gR=["component","children","variant","color","level","slots","slotProps"],yR=Qr("h2",{name:"JoyDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o;const i="inherit"!==r.level?null==(n=t.typography[r.level])?void 0:n.lineHeight:"1";return(0,je.A)({"--Icon-fontSize":"calc(1em * ".concat(i,")")},r.color&&{"--Icon-color":"currentColor"},{display:"flex",gap:"clamp(4px, 0.375em, 0.75rem)",margin:"var(--unstable_DialogTitle-margin, 0px)"},r.level&&"inherit"!==r.level&&t.typography[r.level],{color:"inherit"},r.variant&&(0,je.A)({borderRadius:t.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},null==(o=t.variants[r.variant])?void 0:o[r.color]),{[".".concat(WC.root," > &")]:{"--unstable_DialogTitle-margin":"var(--Card-padding) 0"}})}),bR={sm:"title-md",md:"title-lg",lg:"h4"},xR=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyDialogTitle"}),n=o.useContext(N_),i=o.useContext(B_),a=r.component,l=void 0===a?"h2":a,c=r.children,d=r.variant,u=r.color,h=r.level,p=void 0===h?bR[n||"md"]:h,v=r.slots,f=void 0===v?{}:v,m=r.slotProps,g=void 0===m?{}:m,y=(0,Ie.A)(r,gR),b=e.color||(d?null!=u?u:"neutral":u),x=(0,je.A)({},y,{component:l,slots:f,slotProps:g}),w=(0,je.A)({},r,{component:l,color:b,variant:d,level:p}),S=(e=>{const t=e.level,r=e.color,n=e.variant;return Dr({root:["root",t,r&&"color".concat(Le(r)),n&&"variant".concat(Le(n))]},fR,{})})(w),k=pn("root",{ref:t,className:S.root,elementType:yR,externalForwardedProps:x,ownerState:w,additionalProps:{id:null==i?void 0:i.labelledBy}}),_=(0,s.A)(k,2),C=_[0],A=_[1];return(0,tr.jsx)(C,(0,je.A)({},A,{children:c}))}),wR=xR;var SR=r(4314);function kR(e){return e.substring(2).toLowerCase()}function _R(e){const t=e.children,r=e.disableReactTree,n=void 0!==r&&r,i=e.mouseEvent,a=void 0===i?"onClick":i,s=e.onClickAway,l=e.touchEvent,c=void 0===l?"onTouchEnd":l,d=o.useRef(!1),u=o.useRef(null),h=o.useRef(!1),p=o.useRef(!1);o.useEffect(()=>(setTimeout(()=>{h.current=!0},0),()=>{h.current=!1}),[]);const v=rn($h(t),u),f=b_(e=>{const t=p.current;p.current=!1;const r=Iu(u.current);if(!h.current||!u.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth-1:!r.documentElement.contains(e.target)||u.current.contains(e.target),o||!n&&t||s(e)}),m=e=>r=>{p.current=!0;const n=t.props[e];n&&n(r)},g={ref:v};return!1!==c&&(g[c]=m(c)),o.useEffect(()=>{if(!1!==c){const e=kR(c),t=Iu(u.current),r=()=>{d.current=!0};return t.addEventListener(e,f),t.addEventListener("touchmove",r),()=>{t.removeEventListener(e,f),t.removeEventListener("touchmove",r)}}},[f,c]),!1!==a&&(g[a]=m(a)),o.useEffect(()=>{if(!1!==a){const e=kR(a),t=Iu(u.current);return t.addEventListener(e,f),()=>{t.removeEventListener(e,f)}}},[f,a]),(0,tr.jsx)(o.Fragment,{children:o.cloneElement(t,g)})}function CR(e){return xr("MuiSnackbar",e)}wr("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","endDecorator","sizeSm","sizeMd","sizeLg","startDecorator","variantPlain","variantOutlined","variantSoft","variantSolid"]);var AR,jR;const IR=["anchorOrigin","animationDuration","autoHideDuration","color","children","className","component","disableWindowBlurListener","endDecorator","invertedColors","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","onUnmount","open","resumeHideDuration","size","slots","slotProps","startDecorator","variant"];let PR,RR;const TR=Br(PR||(PR=AR||(AR=zr(["\n 0% {\n transform: translateX(var(--Snackbar-translateX, 0px)) translateY(calc(var(--_Snackbar-anchorBottom, 1) * 100%));\n opacity: 0;\n }\n 50% {\n opacity: 1;\n }\n 100% {\n transform: translateX(var(--Snackbar-translateX, 0px)) translateY(0);\n }\n"])))),ER=Br(RR||(RR=jR||(jR=zr(["\n 0% {\n transform: translateX(var(--Snackbar-translateX, 0px)) translateY(0);\n opacity: 1;\n }\n 100% {\n transform: translateX(var(--Snackbar-translateX, 0px)) translateY(calc(var(--_Snackbar-anchorBottom, 1) * 100%));\n opacity: 0;\n }\n"])))),zR=Qr("div",{name:"JoySnackbar",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l,c;const d=si({theme:t,ownerState:r},["p","padding","borderRadius"]),u=d.p,h=d.padding,p=d.borderRadius;return[(0,je.A)({"--Snackbar-radius":t.vars.radius.sm,"--Snackbar-decoratorChildRadius":"max((var(--Snackbar-radius) - var(--variant-borderWidth, 0px)) - var(--Snackbar-padding), min(var(--Snackbar-padding) + var(--variant-borderWidth, 0px), var(--Snackbar-radius) / 2))","--Button-minHeight":"var(--Snackbar-decoratorChildHeight)","--IconButton-size":"var(--Snackbar-decoratorChildHeight)","--Button-radius":"var(--Snackbar-decoratorChildRadius)","--IconButton-radius":"var(--Snackbar-decoratorChildRadius)","--Icon-color":"currentColor"},"sm"===r.size&&{"--Snackbar-padding":"0.75rem","--Snackbar-inset":"0.5rem","--Snackbar-decoratorChildHeight":"1.5rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.5rem"},"md"===r.size&&{"--Snackbar-padding":"1rem","--Snackbar-inset":"0.75rem","--Snackbar-decoratorChildHeight":"2rem","--Icon-fontSize":t.vars.fontSize.xl,gap:"0.625rem"},"lg"===r.size&&{"--Snackbar-padding":"1.25rem","--Snackbar-inset":"1rem","--Snackbar-decoratorChildHeight":"2.375rem","--Icon-fontSize":t.vars.fontSize.xl2,gap:"0.875rem"},{zIndex:t.vars.zIndex.snackbar,position:"fixed",display:"flex",alignItems:"center",minWidth:300,top:"top"===(null==(n=r.anchorOrigin)?void 0:n.vertical)?"var(--Snackbar-inset)":void 0,left:"left"===(null==(o=r.anchorOrigin)?void 0:o.horizontal)?"var(--Snackbar-inset)":void 0,bottom:"bottom"===(null==(i=r.anchorOrigin)?void 0:i.vertical)?"var(--Snackbar-inset)":void 0,right:"right"===(null==(a=r.anchorOrigin)?void 0:a.horizontal)?"var(--Snackbar-inset)":void 0},"center"===(null==(s=r.anchorOrigin)?void 0:s.horizontal)&&{"--Snackbar-translateX":"-50%",left:"50%",transform:"translateX(var(--Snackbar-translateX))"},"top"===(null==(l=r.anchorOrigin)?void 0:l.vertical)&&{"--_Snackbar-anchorBottom":"-1"},{animation:"".concat(TR," ").concat(r.animationDuration,"ms forwards")},!r.open&&{animationName:ER},{boxShadow:t.vars.shadow.lg,backgroundColor:t.vars.palette.background.surface,padding:"var(--Snackbar-padding)",borderRadius:"var(--Snackbar-radius)"},t.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[r.size])],"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(c=t.variants[r.variant])?void 0:c[r.color]),void 0!==u&&{"--Snackbar-padding":u},void 0!==h&&{"--Snackbar-padding":h},void 0!==p&&{"--Snackbar-radius":p}]}),DR=Qr("span",{name:"JoySnackbar",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inherit",flex:"none"}),MR=Qr("span",{name:"JoySnackbar",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inherit",flex:"none",marginLeft:"auto"}),LR={vertical:"bottom",horizontal:"right"},OR=o.forwardRef(function(e,t){const r=en({props:e,name:"JoySnackbar"}),n=r.anchorOrigin,i=void 0===n?LR:n,a=r.animationDuration,l=void 0===a?300:a,c=r.autoHideDuration,d=void 0===c?null:c,u=r.color,h=void 0===u?"neutral":u,p=r.children,v=r.className,f=r.component,m=r.disableWindowBlurListener,g=void 0!==m&&m,y=r.endDecorator,b=r.invertedColors,x=void 0!==b&&b,w=r.onUnmount,S=r.open,k=r.size,_=void 0===k?"md":k,C=r.slots,A=void 0===C?{}:C,j=r.slotProps,I=r.startDecorator,P=r.variant,R=void 0===P?"outlined":P,T=(0,Ie.A)(r,IR),E=o.useState(!0),z=(0,s.A)(E,2),D=z[0],M=z[1],L=o.useState(!1),O=(0,s.A)(L,2),F=O[0],N=O[1],B=o.useRef(w);B.current=w,o.useEffect(()=>{if(!S){N(!0);const e=setTimeout(()=>{var e;M(!0),N(!1),null==(e=B.current)||e.call(B)},l);return()=>{clearTimeout(e)}}N(!1),M(!1)},[S,l]);const H=(0,je.A)({},r,{anchorOrigin:i,autoHideDuration:d,color:h,animationDuration:l,disableWindowBlurListener:g,invertedColors:x,size:_,variant:R});delete H.onUnmount;const W=(e=>{const t=e.variant,r=e.color,n=e.size,o=e.anchorOrigin;return Dr({root:["root",n&&"size".concat(Le(n)),r&&"color".concat(Le(r)),t&&"variant".concat(Le(t)),"anchorOrigin".concat(Le(o.vertical)).concat(Le(o.horizontal))],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},CR,{})})(H),V=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.autoHideDuration,r=void 0===t?null:t,n=e.disableWindowBlurListener,i=void 0!==n&&n,a=e.onClose,s=e.open,l=e.resumeHideDuration,c=Xn();o.useEffect(()=>{if(s)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"!==e.key&&"Esc"!==e.key||null==a||a(e,"escapeKeyDown")}},[s,a]);const d=b_((e,t)=>{null==a||a(e,t)}),u=b_(e=>{a&&null!=e&&c.start(e,()=>{d(null,"timeout")})});o.useEffect(()=>(s&&u(r),c.clear),[s,r,u,c]);const h=c.clear,p=o.useCallback(()=>{null!=r&&u(null!=l?l:.5*r)},[r,l,u]),v=e=>t=>{const r=e.onFocus;null==r||r(t),h()},f=e=>t=>{const r=e.onMouseEnter;null==r||r(t),h()},m=e=>t=>{const r=e.onMouseLeave;null==r||r(t),p()};return o.useEffect(()=>{if(!i&&s)return window.addEventListener("focus",p),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",h)}},[i,s,p,h]),{getRootProps:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,je.A)({},on(e),on(t));return(0,je.A)({role:"presentation"},t,r,{onBlur:(n=r,e=>{const t=n.onBlur;null==t||t(e),p()}),onFocus:v(r),onMouseEnter:f(r),onMouseLeave:m(r)});var n},onClickAway:e=>{null==a||a(e,"clickaway")}}}(H),$=V.getRootProps,U=V.onClickAway,q=(0,je.A)({},T,{component:f,slots:A,slotProps:j}),K=pn("root",{ref:t,className:(0,Pe.A)(W.root,v),elementType:zR,externalForwardedProps:q,getSlotProps:$,ownerState:H}),G=(0,s.A)(K,2),J=G[0],Q=G[1],Y=pn("startDecorator",{className:W.startDecorator,elementType:DR,externalForwardedProps:q,ownerState:H}),X=(0,s.A)(Y,2),Z=X[0],ee=X[1],te=pn("endDecorator",{className:W.endDecorator,elementType:MR,externalForwardedProps:q,ownerState:H}),re=(0,s.A)(te,2),ne=re[0],oe=re[1],ie=A.clickAway||_R;return!S&&D?null:(0,tr.jsx)(ie,(0,je.A)({onClickAway:e=>{F||U(e)}},"function"===typeof(null==j?void 0:j.clickAway)?j.clickAway(H):null==j?void 0:j.clickAway,{children:(0,tr.jsxs)(J,(0,je.A)({},Q,{children:[I&&(0,tr.jsx)(Z,(0,je.A)({},ee,{children:I})),p,y&&(0,tr.jsx)(ne,(0,je.A)({},oe,{children:y}))]}))}))}),FR=OR,NR=o.createContext(null);function BR(e){var t,r;let n=e.children;const i=o.useState(!1),a=(0,s.A)(i,2),l=a[0],c=a[1],d=o.useState(null),u=(0,s.A)(d,2),h=u[0],p=u[1],v=o.useCallback(e=>{p(e),c(!0)},[]);return(0,tr.jsxs)(NR.Provider,{value:v,children:[n,(0,tr.jsx)(FR,{open:l,onClose:(e,t)=>{"clickaway"!==t&&c(!1)},autoHideDuration:null!==(t=null===h||void 0===h?void 0:h.duration)&&void 0!==t?t:4e3,color:null!==(r=null===h||void 0===h?void 0:h.color)&&void 0!==r?r:"neutral",variant:"soft",anchorOrigin:{vertical:"bottom",horizontal:"right"},endDecorator:(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",onClick:()=>c(!1),children:"Dismiss"}),children:null===h||void 0===h?void 0:h.message})]})}function HR(){const e=o.useContext(NR);if(!e)throw new Error("useSnackbar must be used within a SnackbarProvider");return e}const WR=function(){const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();r?(console.log(t),await fetch("".concat(IW,"/api/house/").concat(t),{method:"DELETE",headers:{Authorization:r}})):console.log("No token found")},onSuccess:()=>{t.invalidateQueries({queryKey:["board"]})}})},VR=e=>{var t;let r=e.children,n=e.id,i=e.house;const a=HA(),l=!(null===a||void 0===a||!a.selectionMode),c=WR(),d=HR(),u=o.useState(!1),h=(0,s.A)(u,2),p=h[0],v=h[1],f=aR({id:n,disabled:l}),m=f.attributes,g=f.listeners,y=f.setNodeRef,b=f.transform,x=f.transition,w=f.isDragging,S={transform:Fj.Transform.toString(b),transition:x,opacity:w?0:1},k=l&&!a.isSelected(n)&&!a.canSelect(n);return(0,tr.jsxs)("div",{ref:y,style:S,onClick:()=>{l&&a&&(k||a.toggle(n))},children:[(0,tr.jsx)(ta,{sx:{alignSelf:"center",padding:"auto"},children:(0,tr.jsx)(hi,{variant:"outlined",sx:{width:"280px",overflow:"hidden",borderRadius:"md",cursor:l?"pointer":"default"},children:(0,tr.jsxs)(vR,{sx:{position:"relative"},children:[(0,tr.jsx)(Io,{ratio:"16/10",children:null!==(t=i.photos)&&void 0!==t&&t[0]?(0,tr.jsx)("img",(0,Ae.A)((0,Ae.A)({src:i.photos[0],srcSet:i.photos[0],loading:"lazy",alt:"",draggable:!1},m),l?{}:g)):(0,tr.jsx)(Tr,(0,Ae.A)((0,Ae.A)((0,Ae.A)({sx:{display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"neutral.softBg",color:"neutral.400"}},m),l?{}:g),{},{children:(0,tr.jsx)(o_.A,{sx:{fontSize:40}})}))}),!l&&(0,tr.jsx)(Z_,{size:"sm",variant:"soft",color:"danger",onPointerDown:e=>e.stopPropagation(),onClick:e=>{e.stopPropagation(),v(!0)},"aria-label":"Delete property",sx:{position:"absolute",top:8,right:8,zIndex:2,borderRadius:"50%",bgcolor:"background.surface","&:hover":{bgcolor:"danger.softBg"}},children:(0,tr.jsx)(SR.A,{})}),r]})})}),(0,tr.jsx)(L_,{open:p,onClose:()=>v(!1),children:(0,tr.jsxs)(U_,{role:"alertdialog","aria-labelledby":"delete-house-title","aria-describedby":"delete-house-description",sx:{minWidth:320},onClick:e=>e.stopPropagation(),children:[(0,tr.jsx)(sC,{}),(0,tr.jsx)(wR,{id:"delete-house-title",children:"Delete property?"}),(0,tr.jsx)(Gn,{id:"delete-house-description",textColor:"text.secondary",children:"This removes the property from your board. This can't be undone."}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,justifyContent:"flex-end",mt:2},children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:()=>v(!1),children:"Cancel"}),(0,tr.jsx)(wo,{color:"danger",onClick:()=>{c.mutate(i.id),v(!1),d({message:"Property deleted",color:"success"})},autoFocus:!0,children:"Delete"})]})]})})]})};function $R(e){let t=e.id,r=e.list,n=e.listId,i=e.boardId,a=e.aiSearchId;const l=EP({id:t}).setNodeRef,c=(0,o.useState)(null),d=(0,s.A)(c,2),u=d[0],h=d[1],p=mj(),v=(0,o.useState)(!1),f=(0,s.A)(v,2),m=f[0],g=f[1],y=(0,o.useState)(null),b=(0,s.A)(y,2),x=b[0],w=b[1];return(0,tr.jsxs)(Ui,{variant:"plain",color:"neutral",sx:{display:"flex",flexDirection:"column",alignItems:"center",flexShrink:0,width:"360px",gap:2},children:[(0,tr.jsx)(v_,{sx:{letterSpacing:"2px",fontWeight:"800",alignSelf:"center"},children:r.status}),(0,tr.jsx)(wo,{variant:"soft",color:"neutral",sx:{width:"60%",alignSelf:"center"},onClick:()=>g(!0),children:(0,tr.jsx)(Gn,{level:"body-sm",children:"+"})}),(0,tr.jsx)(L_,{"aria-labelledby":"modal-status","aria-describedby":"modal-desc",open:m,onClose:()=>g(!1),sx:{display:"flex",justifyContent:"center",alignItems:"center"},children:(0,tr.jsxs)(U_,{children:[(0,tr.jsx)(sC,{onClick:()=>w(null)}),(0,tr.jsx)(Gn,{children:"Add new house"}),(0,tr.jsx)("form",{onSubmit:e=>{e.preventDefault(),(()=>{if(!u)return;const e=(e=>({link:e.url.replace(/(\d+)[^d]*$/,"$1"),status:e.status.toLowerCase(),boardId:e.boardId}))(u);e.link.includes("https://www.rightmove.co.uk")?(p.mutate(e),g(!1)):w("We only support Rightmove links")})()},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Link"}),(0,tr.jsx)(NC,{autoFocus:!0,required:!0,onChange:e=>h({url:e.target.value,status:r.status,boardId:i})})]}),(0,tr.jsx)(wo,{type:"submit",disabled:!!x,children:"Submit"})]})}),x&&(0,tr.jsx)(Gn,{level:"body-sm",color:"danger",children:x})]})}),(0,tr.jsx)(ZP,{id:n,items:r.items,strategy:QP,children:(0,tr.jsx)("div",{ref:l,children:r.items.map((e,t)=>(0,tr.jsx)(VR,{id:e.id,house:e,children:(0,tr.jsx)(fj,{house:e,index:t,aiSearchId:a})},e.id))})})]},n)}var UR=r(2573);const qR="toppi_commute_onboarding_dismissed";function KR(){const e=(0,o.useState)(()=>{try{return"true"===localStorage.getItem(qR)}catch(e){return!1}}),t=(0,s.A)(e,2),r=t[0],n=t[1],i=$A(),a=i.data,l=void 0===a?[]:a;if(i.isLoading||r||l.length>0)return null;return(0,tr.jsx)(FA,{variant:"soft",color:"primary",startDecorator:(0,tr.jsx)(UR.A,{}),endDecorator:(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,alignItems:"center",flexShrink:0},children:[(0,tr.jsx)(wo,{component:kc,to:"/settings/destinations",variant:"solid",color:"primary",size:"sm",children:"Set up destinations"}),(0,tr.jsx)(Z_,{variant:"plain",color:"neutral",size:"sm",onClick:()=>{try{localStorage.setItem(qR,"true")}catch(e){}n(!0)},"aria-label":"Dismiss commute destinations prompt",children:(0,tr.jsx)(la.A,{fontSize:"small"})})]}),sx:{mb:2,alignItems:{xs:"flex-start",sm:"center"},flexWrap:{xs:"wrap",sm:"nowrap"}},children:(0,tr.jsxs)(Tr,{sx:{minWidth:0},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:"See commute times on every property"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:"Add your work, school, or other destinations to get travel times next to every listing \u2014 automatically."})]})})}function GR(e){let t=e.icon,r=e.title,n=e.description,o=e.action,i=e.sx;return(0,tr.jsxs)(Mn,{spacing:1.5,sx:(0,Ae.A)({alignItems:"center",textAlign:"center",px:3,py:6,maxWidth:420,mx:"auto"},i),children:[t&&(0,tr.jsx)(Tr,{sx:{display:"grid",placeItems:"center",width:56,height:56,borderRadius:"50%",bgcolor:"primary.softBg",color:"primary.plainColor",fontSize:"1.75rem"},children:t}),(0,tr.jsx)(Gn,{level:"title-md",children:r}),n&&(0,tr.jsx)(Gn,{level:"body-sm",sx:{color:"text.tertiary"},children:n}),o&&(0,tr.jsx)(Tr,{sx:{mt:1},children:o})]})}function JR(e){return xr("MuiSkeleton",e)}wr("MuiSkeleton",["root","variantOverlay","variantCircular","variantRectangular","variantText","variantInline","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs"]);var QR,YR,XR,ZR,eT;const tT=["className","component","children","animation","overlay","loading","variant","level","height","width","sx","slots","slotProps"];let rT,nT,oT,iT,aT;const sT=Br(rT||(rT=QR||(QR=zr(["\n 0% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.8;\n background: var(--unstable_pulse-bg);\n }\n\n 100% {\n opacity: 1;\n }\n"])))),lT=Br(nT||(nT=YR||(YR=zr(["\n 0% {\n transform: translateX(-100%);\n }\n\n 50% {\n /* +0.5s of delay between each loop */\n transform: translateX(100%);\n }\n\n 100% {\n transform: translateX(100%);\n }\n"])))),cT=Qr("span",{name:"JoySkeleton",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;return"pulse"===t.animation&&"inline"!==t.variant&&Nr(oT||(oT=XR||(XR=zr(["\n &::before {\n animation: "," 2s ease-in-out 0.5s infinite;\n background: ",";\n }\n "]))),sT,r.vars.palette.background.level3)},e=>{let t=e.ownerState,r=e.theme;return"pulse"===t.animation&&"inline"===t.variant&&Nr(iT||(iT=ZR||(ZR=zr(["\n &::after {\n animation: "," 2s ease-in-out 0.5s infinite;\n background: ",";\n }\n "]))),sT,r.vars.palette.background.level3)},e=>{let t=e.ownerState,r=e.theme;return"wave"===t.animation&&Nr(aT||(aT=eT||(eT=zr(["\n /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */\n -webkit-mask-image: -webkit-radial-gradient(white, black);\n background: ",";\n\n &::after {\n content: ' ';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: var(--unstable_pseudo-zIndex);\n animation: "," 1.6s linear 0.5s infinite;\n background: linear-gradient(\n 90deg,\n transparent,\n var(--unstable_wave-bg, rgba(0 0 0 / 0.08)),\n transparent\n );\n transform: translateX(-100%); /* Avoid flash during server-side hydration */\n }\n "]))),r.vars.palette.background.level3,lT)},e=>{let t=e.ownerState,r=e.theme;var n,o,i,a;const s=(null==(n=r.components)||null==(n=n.JoyTypography)||null==(n=n.defaultProps)?void 0:n.level)||"body1";return[{display:"block",position:"relative","--unstable_pseudo-zIndex":9,"--unstable_pulse-bg":r.vars.palette.background.level1,overflow:"hidden",cursor:"default",color:"transparent","& *":{visibility:"hidden"},"&::before":{display:"block",content:'" "',top:0,bottom:0,left:0,right:0,zIndex:"var(--unstable_pseudo-zIndex)",borderRadius:"inherit"},[r.getColorSchemeSelector("dark")]:{"--unstable_wave-bg":"rgba(255 255 255 / 0.1)"}},"rectangular"===t.variant&&(0,je.A)({borderRadius:"min(0.15em, 6px)",height:"auto",width:"100%","&::before":{position:"absolute"}},!t.animation&&{backgroundColor:r.vars.palette.background.level3},"inherit"!==t.level&&(0,je.A)({},r.typography[t.level])),"circular"===t.variant&&(0,je.A)({borderRadius:"50%",width:"100%",height:"100%","&::before":{position:"absolute"}},!t.animation&&{backgroundColor:r.vars.palette.background.level3},"inherit"!==t.level&&(0,je.A)({},r.typography[t.level])),"text"===t.variant&&(0,je.A)({borderRadius:"min(0.15em, 6px)",background:"transparent",width:"100%"},"inherit"!==t.level&&(0,je.A)({},r.typography[t.level||s],{paddingBlockStart:"calc((".concat((null==(o=r.typography[t.level||s])?void 0:o.lineHeight)||1," - 1) * 0.56em)"),paddingBlockEnd:"calc((".concat((null==(i=r.typography[t.level||s])?void 0:i.lineHeight)||1," - 1) * 0.44em)"),"&::before":(0,je.A)({height:"1em"},r.typography[t.level||s],"wave"===t.animation&&{backgroundColor:r.vars.palette.background.level3},!t.animation&&{backgroundColor:r.vars.palette.background.level3}),"&::after":(0,je.A)({height:"1em",top:"calc((".concat((null==(a=r.typography[t.level||s])?void 0:a.lineHeight)||1," - 1) * 0.56em)")},r.typography[t.level||s])})),"inline"===t.variant&&(0,je.A)({display:"inline",position:"initial",borderRadius:"min(0.15em, 6px)"},!t.animation&&{backgroundColor:r.vars.palette.background.level3},"inherit"!==t.level&&(0,je.A)({},r.typography[t.level]),{WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::before":{position:"absolute",zIndex:"var(--unstable_pseudo-zIndex)",backgroundColor:r.vars.palette.background.level3}},"pulse"===t.animation&&{"&::after":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:"var(--unstable_pseudo-zIndex)",backgroundColor:r.vars.palette.background.level3}}),"overlay"===t.variant&&(0,je.A)({borderRadius:r.vars.radius.xs,position:"absolute",width:"100%",height:"100%",zIndex:"var(--unstable_pseudo-zIndex)"},"pulse"===t.animation&&{backgroundColor:r.vars.palette.background.surface},"inherit"!==t.level&&(0,je.A)({},r.typography[t.level]),{"&::before":{position:"absolute"}})]}),dT=o.forwardRef(function(e,t){const r=en({props:e,name:"JoySkeleton"}),n=r.className,i=r.component,a=void 0===i?"span":i,l=r.children,c=r.animation,d=void 0===c?"pulse":c,u=r.overlay,h=void 0!==u&&u,p=r.loading,v=void 0===p||p,f=r.variant,m=void 0===f?"overlay":f,g=r.level,y=void 0===g?"text"===m?"body-md":"inherit":g,b=r.height,x=r.width,w=r.sx,S=r.slots,k=void 0===S?{}:S,_=r.slotProps,C=void 0===_?{}:_,A=(0,Ie.A)(r,tT),j=(0,je.A)({},A,{component:a,slots:k,slotProps:C,sx:[{width:x,height:b},...Array.isArray(w)?w:[w]]}),I=(0,je.A)({},r,{animation:d,component:a,level:y,loading:v,overlay:h,variant:m,width:x,height:b}),P=(e=>{const t=e.variant,r=e.level;return Dr({root:["root",t&&"variant".concat(Le(t)),r&&"level".concat(Le(r))]},JR,{})})(I),R=pn("root",{ref:t,className:(0,Pe.A)(P.root,n),elementType:cT,externalForwardedProps:j,ownerState:I}),T=(0,s.A)(R,2),E=T[0],z=T[1];return v?(0,tr.jsx)(E,(0,je.A)({},z,{children:l})):(0,tr.jsx)(o.Fragment,{children:o.Children.map(l,(e,t)=>0===t&&o.isValidElement(e)?o.cloneElement(e,{"data-first-child":""}):e)})});dT.muiName="Skeleton";const uT=dT;function hT(){return(0,tr.jsxs)(hi,{variant:"outlined",sx:{width:"280px",overflow:"hidden",borderRadius:"md"},children:[(0,tr.jsx)(vR,{sx:{position:"relative"},children:(0,tr.jsx)(Io,{ratio:"16/10",children:(0,tr.jsx)(uT,{variant:"rectangular",sx:{width:"100%",height:"100%"}})})}),(0,tr.jsxs)(qC,{sx:{gap:1,p:2},children:[(0,tr.jsx)(uT,{variant:"text",level:"title-lg",sx:{width:"45%"}}),(0,tr.jsx)(uT,{variant:"text",level:"title-sm",sx:{width:"85%"}}),(0,tr.jsx)(uT,{variant:"text",level:"body-sm",sx:{width:"65%"}}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,sx:{mt:.5},children:[(0,tr.jsx)(uT,{variant:"text",level:"body-xs",sx:{width:32}}),(0,tr.jsx)(uT,{variant:"text",level:"body-xs",sx:{width:32}}),(0,tr.jsx)(uT,{variant:"text",level:"body-xs",sx:{width:56}})]}),(0,tr.jsx)(nc,{sx:{my:1}}),(0,tr.jsxs)(Tr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,tr.jsx)(uT,{variant:"rectangular",width:88,height:22,sx:{borderRadius:"sm"}}),(0,tr.jsx)(uT,{variant:"text",level:"body-sm",sx:{width:36}})]})]})]})}function pT(){return(0,tr.jsx)(Tr,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-start",gap:2,overflow:"hidden"},children:[0,1,2,3].map(e=>(0,tr.jsxs)(Tr,{sx:{width:360,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[(0,tr.jsx)(uT,{variant:"text",level:"body-sm",sx:{width:88,mt:.5}}),(0,tr.jsx)(uT,{variant:"rectangular",sx:{width:"60%",height:32,borderRadius:"sm"}}),(0,tr.jsx)(hT,{}),e%2===0&&(0,tr.jsx)(hT,{})]},e))})}function vT(e){return xr("MuiDrawer",e)}wr("MuiDrawer",["root","hidden","backdrop","content","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const fT=["children","anchor","container","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","color","variant","invertedColors","size","onClose","onKeyDown","open","component","slots","slotProps"],mT=Qr(E_,{name:"JoyDrawer",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState;return(0,je.A)({"--Drawer-transitionDuration":"0.3s","--Drawer-transitionFunction":"ease","--ModalClose-radius":"max((var(--Drawer-contentRadius) - var(--variant-borderWidth, 0px)) - var(--ModalClose-inset), min(var(--ModalClose-inset) / 2, (var(--Drawer-contentRadius) - var(--variant-borderWidth, 0px)) / 2))"},"sm"===t.size&&{"--ModalClose-inset":"0.5rem","--Drawer-verticalSize":"clamp(350px, 30%, 100%)","--Drawer-horizontalSize":"clamp(256px, 20%, 100%)","--Drawer-titleMargin":"0.625rem 0.75rem calc(0.625rem / 2)"},"md"===t.size&&{"--ModalClose-inset":"0.5rem","--Drawer-verticalSize":"clamp(400px, 45%, 100%)","--Drawer-horizontalSize":"clamp(300px, 30%, 100%)","--Drawer-titleMargin":"0.75rem 0.75rem calc(0.75rem / 2)"},"lg"===t.size&&{"--ModalClose-inset":"0.75rem","--Drawer-verticalSize":"clamp(500px, 60%, 100%)","--Drawer-horizontalSize":"clamp(440px, 60%, 100%)","--Drawer-titleMargin":"1rem 1rem calc(1rem / 2)"},{transitionProperty:"visibility",transitionDelay:t.open?"0s":"var(--Drawer-transitionDuration)"},!t.open&&{visibility:"hidden"})}),gT=Qr(D_,{name:"JoyDrawer",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})(e=>({opacity:e.ownerState.open?1:0,transition:"opacity var(--Drawer-transitionDuration) ease-in-out"})),yT=Qr("div",{name:"JoyDrawer",slot:"Content",overridesResolver:(e,t)=>t.content})(e=>{let t=e.theme,r=e.ownerState;var n;return(0,je.A)({},t.typography["body-".concat(r.size)],{boxShadow:t.shadow.md,backgroundColor:t.vars.palette.background.surface,outline:0,display:"flex",flexDirection:"column",position:"fixed",boxSizing:"border-box",overflow:"auto"},"left"===r.anchor&&{top:0,left:0,transform:r.open?"translateX(0)":"translateX(-100%)"},"right"===r.anchor&&{top:0,right:0,transform:r.open?"translateX(0)":"translateX(100%)"},"top"===r.anchor&&{top:0,transform:r.open?"translateY(0)":"translateY(-100%)"},"bottom"===r.anchor&&{bottom:0,transform:r.open?"translateY(0)":"translateY(100%)"},{height:r.anchor.match(/(left|right)/)?"100%":"min(100vh, var(--Drawer-verticalSize))",width:r.anchor.match(/(top|bottom)/)?"100vw":"min(100vw, var(--Drawer-horizontalSize))",transition:"transform var(--Drawer-transitionDuration) var(--Drawer-transitionFunction)"},"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(n=t.variants[r.variant])?void 0:n[r.color],{["& > .".concat(mR.root)]:{"--unstable_DialogTitle-margin":"var(--Drawer-titleMargin)"}})}),bT=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyDrawer"}),n=r.children,i=r.anchor,a=void 0===i?"left":i,l=r.container,c=r.disableAutoFocus,d=void 0!==c&&c,u=r.disableEnforceFocus,h=void 0!==u&&u,p=r.disableEscapeKeyDown,v=void 0!==p&&p,f=r.disablePortal,m=void 0!==f&&f,g=r.disableRestoreFocus,y=void 0!==g&&g,b=r.disableScrollLock,x=void 0!==b&&b,w=r.hideBackdrop,S=void 0!==w&&w,k=r.color,_=void 0===k?"neutral":k,C=r.variant,A=void 0===C?"plain":C,j=r.invertedColors,I=void 0!==j&&j,P=r.size,R=void 0===P?"md":P,T=r.onClose,E=r.open,z=r.component,D=r.slots,M=void 0===D?{}:D,L=r.slotProps,O=void 0===L?{}:L,F=(0,Ie.A)(r,fT),N=(0,je.A)({},r,{anchor:a,disableAutoFocus:d,disableEnforceFocus:h,disableEscapeKeyDown:v,disablePortal:m,disableRestoreFocus:y,disableScrollLock:x,hideBackdrop:S,invertedColors:I,color:_,variant:A,size:R}),B=I_((0,je.A)({},N,{rootRef:t,children:null})),H=B.getRootProps,W=B.getBackdropProps,V=B.rootRef,$=B.portalRef,U=B.isTopModal,q=(e=>{const t=e.open,r=e.variant,n=e.color,o=e.size;return Dr({root:["root",!t&&"hidden",r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),o&&"size".concat(Le(o))],backdrop:["backdrop"],content:["content"]},vT,{})})(N),K=(0,je.A)({},F,{component:z,slots:M,slotProps:O}),G=gi(),J=gi(),Q=o.useMemo(()=>({variant:A,color:_,labelledBy:G,describedBy:J}),[_,A,G,J]),Y=pn("root",{ref:V,className:q.root,elementType:mT,externalForwardedProps:K,getSlotProps:H,ownerState:N}),X=(0,s.A)(Y,2),Z=X[0],ee=X[1],te=pn("backdrop",{className:q.backdrop,elementType:gT,externalForwardedProps:K,getSlotProps:W,ownerState:N}),re=(0,s.A)(te,2),ne=re[0],oe=re[1],ie=pn("content",{className:q.content,elementType:yT,additionalProps:{tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":G,"aria-describedby":J},externalForwardedProps:K,ownerState:N}),ae=(0,s.A)(ie,2),se=ae[0],le=ae[1];return(0,tr.jsx)(R_.Provider,{value:T,children:(0,tr.jsx)(N_.Provider,{value:R,children:(0,tr.jsx)(B_.Provider,{value:Q,children:(0,tr.jsx)(Uh,{ref:$,container:l,disablePortal:m,children:(0,tr.jsxs)(Z,(0,je.A)({},ee,{children:[S?null:(0,tr.jsx)(ne,(0,je.A)({},oe)),(0,tr.jsx)(y_,{disableEnforceFocus:h,disableAutoFocus:d,disableRestoreFocus:y,isEnabled:U,open:E,children:(0,tr.jsx)(se,(0,je.A)({},le,{children:n}))})]}))})})})})}),xT=bT;function wT(e){const t=e.styles,r=e.defaultTheme,n=void 0===r?{}:r,o="function"===typeof t?e=>{return t(void 0===(r=e)||null===r||0===Object.keys(r).length?n:e);var r}:t;return(0,tr.jsx)(Fr,{styles:o})}const ST=o.createContext(null);function kT(){return o.useContext(ST)}const _T="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";const CT=function(e){const t=e.children,r=e.theme,n=kT(),i=o.useMemo(()=>{const e=null===n?r:function(e,t){if("function"===typeof t)return t(e);return(0,je.A)({},e,t)}(n,r);return null!=e&&(e[_T]=null!==n),e},[r,n]);return(0,tr.jsx)(ST.Provider,{value:i,children:t})};const AT=["value"],jT=o.createContext();const IT=function(e){let t=e.value,r=(0,Ie.A)(e,AT);return(0,tr.jsx)(jT.Provider,(0,je.A)({value:null==t||t},r))};const PT=o.createContext(void 0);const RT=function(e){let t=e.value,r=e.children;return(0,tr.jsx)(PT.Provider,{value:t,children:r})};function TT(e){const t=De(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles="@layer global{".concat(t.styles,"}")),t):e}const ET=function(e){let t=e.styles,r=e.themeId,n=e.defaultTheme;const o=er(void 0===n?{}:n),i=r&&o[r]||o;let a="function"===typeof t?t(i):t;return i.modularCssLayers&&(a=Array.isArray(a)?a.map(e=>TT("function"===typeof e?e(i):e)):TT(a)),(0,tr.jsx)(wT,{styles:a})};const zT={};function DT(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return o.useMemo(()=>{const o=e&&t[e]||t;if("function"===typeof r){const i=r(o),a=e?(0,je.A)({},t,{[e]:i}):i;return n?()=>a:a}return e?(0,je.A)({},t,{[e]:r}):(0,je.A)({},t,r)},[e,t,r,n])}const MT=function(e){const t=e.children,r=e.theme,n=e.themeId,o=Xt(zT),i=kT()||zT,a=DT(n,o,r),s=DT(n,i,r,!0),l="rtl"===a.direction,c=function(e){const t=Xt(),r=gi()||"",n=e.modularCssLayers;let o="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return o=n&&null===t?"string"===typeof n?n.replace(/mui(?!\.)/g,o):"@layer ".concat(o,";"):"",eu(()=>{const e=document.querySelector("head");if(!e)return;const t=e.firstChild;if(o){var n;if(t&&null!=(n=t.hasAttribute)&&n.call(t,"data-mui-layer-order")&&t.getAttribute("data-mui-layer-order")===r)return;const i=document.createElement("style");i.setAttribute("data-mui-layer-order",r),i.textContent=o,e.prepend(i)}else{var i;null==(i=e.querySelector('style[data-mui-layer-order="'.concat(r,'"]')))||i.remove()}},[o,r]),o?(0,tr.jsx)(ET,{styles:o}):null}(a);return(0,tr.jsx)(CT,{theme:s,children:(0,tr.jsx)(Yt.T.Provider,{value:a,children:(0,tr.jsx)(IT,{value:l,children:(0,tr.jsxs)(RT,{value:null==a?void 0:a.components,children:[c,t]})})})})},LT="color-scheme",OT="data-color-scheme";function FT(e){if("undefined"!==typeof window&&"system"===e){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}function NT(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function BT(e,t){if("undefined"===typeof window)return;let r;try{r=localStorage.getItem(e)||void 0,r||localStorage.setItem(e,t)}catch(Mp){}return r||t}function HT(e){const t=e.defaultMode,r=void 0===t?"light":t,n=e.defaultLightColorScheme,i=e.defaultDarkColorScheme,a=e.supportedColorSchemes,l=void 0===a?[]:a,c=e.modeStorageKey,d=void 0===c?"mode":c,u=e.colorSchemeStorageKey,h=void 0===u?LT:u,p=e.storageWindow,v=void 0===p?"undefined"===typeof window?void 0:window:p,f=l.join(","),m=o.useState(()=>{const e=BT(d,r),t=BT("".concat(h,"-light"),n),o=BT("".concat(h,"-dark"),i);return{mode:e,systemMode:FT(e),lightColorScheme:t,darkColorScheme:o}}),g=(0,s.A)(m,2),y=g[0],b=g[1],x=function(e){return NT(e,t=>"light"===t?e.lightColorScheme:"dark"===t?e.darkColorScheme:void 0)}(y),w=o.useCallback(e=>{b(t=>{if(e===t.mode)return t;const n=null!=e?e:r;try{localStorage.setItem(d,n)}catch(Mp){}return(0,je.A)({},t,{mode:n,systemMode:FT(n)})})},[d,r]),S=o.useCallback(e=>{e?"string"===typeof e?e&&!f.includes(e)?console.error("`".concat(e,"` does not exist in `theme.colorSchemes`.")):b(t=>{const r=(0,je.A)({},t);return NT(t,t=>{try{localStorage.setItem("".concat(h,"-").concat(t),e)}catch(Mp){}"light"===t&&(r.lightColorScheme=e),"dark"===t&&(r.darkColorScheme=e)}),r}):b(t=>{const r=(0,je.A)({},t),o=null===e.light?n:e.light,a=null===e.dark?i:e.dark;if(o)if(f.includes(o)){r.lightColorScheme=o;try{localStorage.setItem("".concat(h,"-light"),o)}catch(s){}}else console.error("`".concat(o,"` does not exist in `theme.colorSchemes`."));if(a)if(f.includes(a)){r.darkColorScheme=a;try{localStorage.setItem("".concat(h,"-dark"),a)}catch(s){}}else console.error("`".concat(a,"` does not exist in `theme.colorSchemes`."));return r}):b(e=>{try{localStorage.setItem("".concat(h,"-light"),n),localStorage.setItem("".concat(h,"-dark"),i)}catch(Mp){}return(0,je.A)({},e,{lightColorScheme:n,darkColorScheme:i})})},[f,h,n,i]),k=o.useCallback(e=>{"system"===y.mode&&b(t=>{const r=null!=e&&e.matches?"dark":"light";return t.systemMode===r?t:(0,je.A)({},t,{systemMode:r})})},[y.mode]),_=o.useRef(k);return _.current=k,o.useEffect(()=>{const e=function(){return _.current(...arguments)},t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>{t.removeListener(e)}},[]),o.useEffect(()=>{if(v){const e=e=>{const t=e.newValue;"string"!==typeof e.key||!e.key.startsWith(h)||t&&!f.match(t)||(e.key.endsWith("light")&&S({light:t}),e.key.endsWith("dark")&&S({dark:t})),e.key!==d||t&&!["light","dark","system"].includes(t)||w(t||r)};return v.addEventListener("storage",e),()=>{v.removeEventListener("storage",e)}}},[S,w,d,h,f,r,v]),(0,je.A)({},y,{colorScheme:x,setMode:w,setColorScheme:S})}const WT=["colorSchemes","components","generateCssVars","cssVarPrefix"];const VT={attribute:"data-joy-color-scheme",colorSchemeStorageKey:"joy-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"joy-mode"},$T=function(e){const t=e.themeId,r=e.theme,n=void 0===r?{}:r,i=e.attribute,a=void 0===i?OT:i,l=e.modeStorageKey,c=void 0===l?"mode":l,d=e.colorSchemeStorageKey,u=void 0===d?LT:d,h=e.defaultMode,p=void 0===h?"light":h,v=e.defaultColorScheme,f=e.disableTransitionOnChange,m=void 0!==f&&f,g=e.resolveTheme,y=e.excludeVariablesFromRoot;(!n.colorSchemes||"string"===typeof v&&!n.colorSchemes[v]||"object"===typeof v&&!n.colorSchemes[null==v?void 0:v.light]||"object"===typeof v&&!n.colorSchemes[null==v?void 0:v.dark])&&console.error("MUI: `".concat(v,"` does not exist in `theme.colorSchemes`."));const b=o.createContext(void 0),x="string"===typeof v?v:v.light,w="string"===typeof v?v:v.dark;return{CssVarsProvider:function(e){const r=e.children,i=e.theme,l=void 0===i?n:i,d=e.modeStorageKey,h=void 0===d?c:d,f=e.colorSchemeStorageKey,x=void 0===f?u:f,w=e.attribute,S=void 0===w?a:w,k=e.defaultMode,_=void 0===k?p:k,C=e.defaultColorScheme,A=void 0===C?v:C,j=e.disableTransitionOnChange,I=void 0===j?m:j,P=e.storageWindow,R=void 0===P?"undefined"===typeof window?void 0:window:P,T=e.documentNode,E=void 0===T?"undefined"===typeof document?void 0:document:T,z=e.colorSchemeNode,D=void 0===z?"undefined"===typeof document?void 0:document.documentElement:z,M=e.colorSchemeSelector,L=void 0===M?":root":M,O=e.disableNestedContext,F=void 0!==O&&O,N=e.disableStyleSheetGeneration,B=void 0!==N&&N,H=o.useRef(!1),W=kT(),V=o.useContext(b),$=!!V&&!F,U=l[t],q=U||l,K=q.colorSchemes,G=void 0===K?{}:K,J=q.components,Q=void 0===J?{}:J,Y=q.generateCssVars,X=void 0===Y?()=>({vars:{},css:{}}):Y,Z=q.cssVarPrefix,ee=(0,Ie.A)(q,WT),te=Object.keys(G),re="string"===typeof A?A:A.light,ne="string"===typeof A?A:A.dark,oe=HT({supportedColorSchemes:te,defaultLightColorScheme:re,defaultDarkColorScheme:ne,modeStorageKey:h,colorSchemeStorageKey:x,defaultMode:_,storageWindow:R}),ie=oe.mode,ae=oe.setMode,se=oe.systemMode,le=oe.lightColorScheme,ce=oe.darkColorScheme,de=oe.colorScheme,ue=oe.setColorScheme;let he=ie,pe=de;$&&(he=V.mode,pe=V.colorScheme);const ve=pe||("dark"===(he||("system"===_?p:_))?ne:re),fe=X(),me=fe.css,ge=fe.vars,ye=(0,je.A)({},ee,{components:Q,colorSchemes:G,cssVarPrefix:Z,vars:ge,getColorSchemeSelector:e=>"[".concat(S,'="').concat(e,'"] &')}),be={},xe={};Object.entries(G).forEach(e=>{let t=(0,s.A)(e,2),r=t[0],n=t[1];const o=X(r),i=o.css,a=o.vars;ye.vars=Ne(ye.vars,a),r===ve&&(Object.keys(n).forEach(e=>{n[e]&&"object"===typeof n[e]?ye[e]=(0,je.A)({},ye[e],n[e]):ye[e]=n[e]}),ye.palette&&(ye.palette.colorScheme=r));if(r===("string"===typeof A?A:"dark"===_?A.dark:A.light)){if(y){const e={};y(Z).forEach(t=>{e[t]=i[t],delete i[t]}),be["[".concat(S,'="').concat(r,'"]')]=e}be["".concat(L,", [").concat(S,'="').concat(r,'"]')]=i}else xe["".concat(":root"===L?"":L,"[").concat(S,'="').concat(r,'"]')]=i}),ye.vars=Ne(ye.vars,ge),o.useEffect(()=>{pe&&D&&D.setAttribute(S,pe)},[pe,S,D]),o.useEffect(()=>{let e;if(I&&H.current&&E){const t=E.createElement("style");t.appendChild(E.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),E.head.appendChild(t),window.getComputedStyle(E.body),e=setTimeout(()=>{E.head.removeChild(t)},1)}return()=>{clearTimeout(e)}},[pe,I,E]),o.useEffect(()=>(H.current=!0,()=>{H.current=!1}),[]);const we=o.useMemo(()=>({allColorSchemes:te,colorScheme:pe,darkColorScheme:ce,lightColorScheme:le,mode:he,setColorScheme:ue,setMode:ae,systemMode:se}),[te,pe,ce,le,he,ue,ae,se]);let Se=!0;(B||$&&(null==W?void 0:W.cssVarPrefix)===Z)&&(Se=!1);const ke=(0,tr.jsxs)(o.Fragment,{children:[Se&&(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)(wT,{styles:{[L]:me}}),(0,tr.jsx)(wT,{styles:be}),(0,tr.jsx)(wT,{styles:xe})]}),(0,tr.jsx)(MT,{themeId:U?t:void 0,theme:g?g(ye):ye,children:r})]});return $?ke:(0,tr.jsx)(b.Provider,{value:we,children:ke})},useColorScheme:()=>{const e=o.useContext(b);if(!e)throw new Error(Me(19));return e},getInitColorSchemeScript:e=>function(e){const t=e||{},r=t.defaultMode,n=void 0===r?"light":r,o=t.defaultLightColorScheme,i=void 0===o?"light":o,a=t.defaultDarkColorScheme,s=void 0===a?"dark":a,l=t.modeStorageKey,c=void 0===l?"mode":l,d=t.colorSchemeStorageKey,u=void 0===d?LT:d,h=t.attribute,p=void 0===h?OT:h,v=t.colorSchemeNode,f=void 0===v?"document.documentElement":v,m=t.nonce;return(0,tr.jsx)("script",{suppressHydrationWarning:!0,nonce:"undefined"===typeof window?m:"",dangerouslySetInnerHTML:{__html:"(function() {\ntry {\n var mode = localStorage.getItem('".concat(c,"') || '").concat(n,"';\n var colorScheme = '';\n if (mode === 'system') {\n // handle system mode\n var mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = localStorage.getItem('").concat(u,"-dark') || '").concat(s,"';\n } else {\n colorScheme = localStorage.getItem('").concat(u,"-light') || '").concat(i,"';\n }\n }\n if (mode === 'light') {\n colorScheme = localStorage.getItem('").concat(u,"-light') || '").concat(i,"';\n }\n if (mode === 'dark') {\n colorScheme = localStorage.getItem('").concat(u,"-dark') || '").concat(s,"';\n }\n if (colorScheme) {\n ").concat(f,".setAttribute('").concat(p,"', colorScheme);\n }\n} catch(e){}})();")}},"mui-color-scheme-init")}((0,je.A)({attribute:a,colorSchemeStorageKey:u,defaultMode:p,defaultLightColorScheme:x,defaultDarkColorScheme:w,modeStorageKey:c},e))}}({themeId:"$$joy",theme:Ir,attribute:VT.attribute,modeStorageKey:VT.modeStorageKey,colorSchemeStorageKey:VT.colorSchemeStorageKey,defaultColorScheme:{light:VT.defaultLightColorScheme,dark:VT.defaultDarkColorScheme}}),UT=$T.CssVarsProvider,qT=$T.useColorScheme;$T.getInitColorSchemeScript;var KT=r(7385),GT=r(567),JT=r(8628),QT=r(2590),YT=r(8248),XT=r(9954),ZT=r(206);const eE="";function tE(){const e=Ma().user;return!!eE&&(null===e||void 0===e?void 0:e.email)===eE}async function rE(e,t){const r=await fetch("".concat(IW).concat(t),{headers:{Authorization:null!==e&&void 0!==e?e:""}});if(!r.ok)throw new Error("HTTP ".concat(r.status));return r.json()}function nE(){var e,t;const r=Ma(),n=r.user,o=r.logout,i=Ql(),a=i.subscription,s=i.openPortal,l=[null===n||void 0===n?void 0:n.given_name,null===n||void 0===n?void 0:n.family_name].filter(Boolean).join(" ").trim(),c=null!==(e=null===n||void 0===n?void 0:n.email)&&void 0!==e?e:"",d=null!==(t=null===a||void 0===a?void 0:a.planTier)&&void 0!==t?t:null;return{displayName:l,email:c,planTier:d,planLabel:"pro"===d?"Pro":"Free",avatarInitial:(l||c||"?").charAt(0).toUpperCase(),canAccessBillingPortal:"pro"===(null===a||void 0===a?void 0:a.planTier),openPortal:s,handleLogout:()=>{Xk(),o()}}}function oE(e){return xr("MuiDialogActions",e)}wr("MuiDialogActions",["root"]);function iE(e){return xr("MuiCardActions",e)}wr("MuiCardActions",["root"]);const aE=["className","component","children","buttonFlex","orientation","slots","slotProps"],sE=Qr("div")(e=>{let t=e.ownerState;var r;return(0,je.A)({"--Button-radius":"var(--Card-childRadius)","--IconButton-radius":"var(--Card-childRadius)",display:"flex"},(null==(r=t.orientation)?void 0:r.startsWith("horizontal"))&&{alignItems:"center"},{flexDirection:"horizontal"===t.orientation?"row":"column"},"horizontal-reverse"===t.orientation&&{flexDirection:"row-reverse"},{zIndex:1,gap:"calc(0.625 * var(--Card-padding))",padding:"var(--unstable_padding)","--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 0 0",[".".concat(WC.root," > &")]:{"--unstable_padding":"calc(0.75 * var(--Card-padding)) 0 var(--Card-padding)"},[".".concat(ai.root," > .").concat(Zl.root," + &")]:{"--unstable_padding":"0"}},t.buttonFlex?{["& > :not(.".concat(K_.root,")")]:{flex:t.buttonFlex},["& > :not(button) > .".concat(uo.root)]:{width:"100%"}}:{["& > .".concat(uo.root,":only-child")]:{flex:"auto"}})}),lE=Qr(sE,{name:"JoyCardActions",slot:"Root",overridesResolver:(e,t)=>t.root})({}),cE=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyCardActions"}),n=r.className,o=r.component,i=void 0===o?"div":o,a=r.children,l=r.buttonFlex,c=r.orientation,d=void 0===c?"horizontal":c,u=r.slots,h=void 0===u?{}:u,p=r.slotProps,v=void 0===p?{}:p,f=(0,Ie.A)(r,aE),m=(0,je.A)({},f,{component:i,slots:h,slotProps:v}),g=(0,je.A)({},r,{component:i,buttonFlex:l,orientation:d}),y=Dr({root:["root"]},iE,{}),b=pn("root",{ref:t,className:(0,Pe.A)(y.root,n),elementType:lE,externalForwardedProps:m,ownerState:g}),x=(0,s.A)(b,2),w=x[0],S=x[1];return(0,tr.jsx)(w,(0,je.A)({},S,{children:a}))}),dE=["component","children","buttonFlex","orientation","slots","slotProps"],uE=Qr(sE,{name:"JoyDialogActions",slot:"Root",overridesResolver:(e,t)=>t.root})({}),hE=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyDialogActions"}),n=r.component,o=void 0===n?"div":n,i=r.children,a=r.buttonFlex,l=r.orientation,c=void 0===l?"horizontal-reverse":l,d=r.slots,u=void 0===d?{}:d,h=r.slotProps,p=void 0===h?{}:h,v=(0,Ie.A)(r,dE),f=(0,je.A)({},v,{component:o,slots:u,slotProps:p}),m=(0,je.A)({},r,{component:o,buttonFlex:a,orientation:c}),g=pn("root",{ref:t,className:Dr({root:["root"]},oE,{}).root,elementType:uE,externalForwardedProps:f,ownerState:m}),y=(0,s.A)(g,2),b=y[0],x=y[1];return(0,tr.jsx)(b,(0,je.A)({},x,{children:i}))});function pE(e){return xr("MuiDialogContent",e)}wr("MuiDialogContent",["root"]);const vE=["component","children","orientation","slots","slotProps"],fE=Qr($C,{name:"JoyDialogContent",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme;return{color:"var(--DialogContent-color, ".concat(t.vars.palette.text.tertiary,")"),overflow:"auto",margin:"var(--unstable_DialogContent-margin)",[".".concat(F_.root," > .").concat(mR.root," + &")]:{"--unstable_DialogContent-margin":"-0.375em 0 0 0"}}}),mE=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyDialogContent"}),n=o.useContext(B_),i=r.component,a=void 0===i?"div":i,l=r.children,c=r.orientation,d=void 0===c?"vertical":c,u=r.slots,h=void 0===u?{}:u,p=r.slotProps,v=void 0===p?{}:p,f=(0,Ie.A)(r,vE),m=(0,je.A)({},f,{component:a,slots:h,slotProps:v}),g=(0,je.A)({},r,{component:a,orientation:d}),y=pn("root",{ref:t,className:Dr({root:["root"]},pE,{}).root,elementType:fE,externalForwardedProps:m,ownerState:g,additionalProps:{id:null==n?void 0:n.describedBy}}),b=(0,s.A)(y,2),x=b[0],w=b[1];return(0,tr.jsx)(x,(0,je.A)({},w,{children:l}))});function gE(e){return xr("MuiLinearProgress",e)}wr("MuiLinearProgress",["root","determinate","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);var yE,bE;const xE=["children","className","component","color","size","variant","thickness","determinate","value","style","slots","slotProps"];let wE,SE;const kE=Br(wE||(wE=yE||(yE=zr(["\n 0% {\n left: var(--_LinearProgress-progressInset);\n width: var(--LinearProgress-progressMinWidth);\n }\n\n 25% {\n width: var(--LinearProgress-progressMaxWidth);\n }\n\n 50% {\n left: var(--_LinearProgress-progressLeft);\n width: var(--LinearProgress-progressMinWidth);\n }\n\n 75% {\n width: var(--LinearProgress-progressMaxWidth);\n }\n\n 100% {\n left: var(--_LinearProgress-progressInset);\n width: var(--LinearProgress-progressMinWidth);\n }\n"])))),_E=Qr("div",{name:"JoyLinearProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o,i,a;return(0,je.A)({"--LinearProgress-radius":"var(--LinearProgress-thickness)","--LinearProgress-progressThickness":"var(--LinearProgress-thickness)","--LinearProgress-progressRadius":"max(var(--LinearProgress-radius) - var(--_LinearProgress-padding), min(var(--_LinearProgress-padding) / 2, var(--LinearProgress-radius) / 2))"},"sm"===t.size&&{"--LinearProgress-thickness":"4px"},"md"===t.size&&{"--LinearProgress-thickness":"6px"},"lg"===t.size&&{"--LinearProgress-thickness":"8px"},t.thickness&&{"--LinearProgress-thickness":"".concat(t.thickness,"px")},!t.determinate&&{"--LinearProgress-progressMinWidth":"calc(var(--LinearProgress-percent) * 1% / 2)","--LinearProgress-progressMaxWidth":"calc(var(--LinearProgress-percent) * 1%)","--_LinearProgress-progressLeft":"calc(100% - var(--LinearProgress-progressMinWidth) - var(--_LinearProgress-progressInset))","--_LinearProgress-progressInset":"calc(var(--LinearProgress-thickness) / 2 - var(--LinearProgress-progressThickness) / 2)"},{minBlockSize:"var(--LinearProgress-thickness)",boxSizing:"border-box",borderRadius:"var(--LinearProgress-radius)",display:"flex",justifyContent:"center",alignItems:"center",flex:1,padding:"var(--_LinearProgress-padding)",position:"relative"},null==(n=r.variants[t.variant])?void 0:n[t.color],{"--_LinearProgress-padding":"max((var(--LinearProgress-thickness) - 2 * var(--variant-borderWidth, 0px) - var(--LinearProgress-progressThickness)) / 2, 0px)","&::before":{content:'""',display:"block",boxSizing:"inherit",blockSize:"var(--LinearProgress-progressThickness)",borderRadius:"var(--LinearProgress-progressRadius)",backgroundColor:"currentColor",color:"inherit",position:"absolute"}},"soft"===t.variant&&{backgroundColor:r.variants.soft.neutral.backgroundColor,color:null==(o=r.variants.solid)?void 0:o[t.color].backgroundColor},"solid"===t.variant&&{backgroundColor:null==(i=r.variants.softHover)?void 0:i[t.color].backgroundColor,color:null==(a=r.variants.solid)?void 0:a[t.color].backgroundColor})},e=>e.ownerState.determinate?{"&::before":{left:"var(--_LinearProgress-padding)",inlineSize:"calc(var(--LinearProgress-percent) * 1% - 2 * var(--_LinearProgress-padding))"}}:Nr(SE||(SE=bE||(bE=zr(["\n &::before {\n animation: ","\n var(--LinearProgress-circulation, 2.5s ease-in-out 0s infinite normal none running);\n }\n "]))),kE),e=>{let t=e.ownerState,r=e.theme;const n=si({theme:r,ownerState:t},["borderRadius","height"]),o=n.borderRadius,i=n.height;return(0,je.A)({},void 0!==o&&{"--LinearProgress-radius":o},void 0!==i&&{"--LinearProgress-thickness":i})}),CE=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyLinearProgress"}),n=r.children,o=r.className,i=r.component,a=r.color,l=void 0===a?"primary":a,c=r.size,d=void 0===c?"md":c,u=r.variant,h=void 0===u?"soft":u,p=r.thickness,v=r.determinate,f=void 0!==v&&v,m=r.value,g=void 0===m?f?0:25:m,y=r.style,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,xE),_=(0,je.A)({},r,{component:i,color:l,size:d,variant:h,thickness:p,value:g,determinate:f,instanceSize:e.size}),C=(e=>{const t=e.determinate,r=e.color,n=e.variant,o=e.size;return Dr({root:["root",t&&"determinate",r&&"color".concat(Le(r)),n&&"variant".concat(Le(n)),o&&"size".concat(Le(o))]},gE,{})})(_),A=(0,je.A)({},k,{component:i,slots:x,slotProps:S}),j=pn("root",{ref:t,className:(0,Pe.A)(C.root,o),elementType:_E,externalForwardedProps:A,ownerState:_,additionalProps:(0,je.A)({as:i,role:"progressbar",style:(0,je.A)({},{"--LinearProgress-percent":g},y)},"number"===typeof g&&f&&{"aria-valuenow":Math.round(g)})}),I=(0,s.A)(j,2),P=I[0],R=I[1];return(0,tr.jsx)(P,(0,je.A)({},R,{children:n}))}),AE=CE;function jE(e){let t=e.open,r=e.onClose,n=e.title;const i=Ql().startCheckout,a=o.useState(!1),l=(0,s.A)(a,2),c=l[0],d=l[1],u=o.useState(null),h=(0,s.A)(u,2),p=h[0],v=h[1];return o.useEffect(()=>{t||(v(null),d(!1))},[t]),(0,tr.jsx)(L_,{open:t,onClose:r,children:(0,tr.jsxs)(U_,{minWidth:440,children:[(0,tr.jsx)(sC,{}),(0,tr.jsx)(wR,{children:null!==n&&void 0!==n?n:"You've used your free search this month"}),(0,tr.jsx)(mE,{children:(0,tr.jsxs)(Mn,{spacing:2,sx:{mt:1},children:[(0,tr.jsxs)(Gn,{level:"body-md",children:["Upgrade to Pro for unlimited searches, daily monitoring, email alerts, and enrichment data \u2014 all for \xa3",15,"/month."]}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"neutral.500",sx:{mb:.5},children:[1," / ",1," free searches used this month"]}),(0,tr.jsx)(AE,{determinate:!0,value:100,color:"warning",sx:{borderRadius:"sm"}})]}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"neutral.500",children:"Cancel anytime. No lock-in."}),p&&(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",children:p})]})}),(0,tr.jsxs)(hE,{children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:r,children:"Maybe later"}),(0,tr.jsxs)(wo,{variant:"solid",color:"primary",onClick:async()=>{v(null),d(!0);try{await i()}catch(e){d(!1),v(e instanceof Error&&e.message?"Couldn't start checkout: ".concat(e.message):"Couldn't start checkout. Please try again.")}},loading:c,children:["Upgrade to Pro \u2014 \xa3",15,"/mo"]})]})]})})}var IE=r(4884),PE=r(4906);function RE(e){let t=e.trigger,r=e.triggerSx,n=e.triggerVariant,o=void 0===n?"plain":n,i=e.placement,a=void 0===i?"bottom-end":i,s=e.ariaLabel,l=void 0===s?"Account menu":s,c=e.open,d=e.onOpenChange;const u=nE(),h=u.displayName,p=u.email,v=u.avatarInitial,f=u.canAccessBillingPortal,m=u.openPortal,g=u.handleLogout,y=void 0!==c;return(0,tr.jsxs)($d,(0,Ae.A)((0,Ae.A)({},y?{open:c,onOpenChange:(e,t)=>null===d||void 0===d?void 0:d(t)}:{}),{},{children:[(0,tr.jsx)(Zd,{variant:o,size:"sm","aria-label":l,sx:r,children:t}),(0,tr.jsxs)(hp,{placement:a,size:"sm",sx:{zIndex:99999,p:1,gap:.5,"--ListItem-radius":"var(--joy-radius-sm)",minWidth:220},children:[(0,tr.jsx)(Ip,{sx:{"&:hover":{bgcolor:"transparent"},cursor:"default"},children:(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center"},children:[(0,tr.jsx)(Xo,{variant:"soft",color:"primary",sx:{borderRadius:"50%"},children:v}),(0,tr.jsxs)(Tr,{sx:{ml:1.5,minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",textColor:"text.primary",noWrap:!0,children:h||"Account"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",noWrap:!0,children:p})]})]})}),(0,tr.jsx)(Ep,{}),(0,tr.jsxs)(Ip,{component:"a",href:"/account",children:[(0,tr.jsx)(IE.A,{}),"Account settings"]}),(0,tr.jsxs)(Ip,{component:"a",href:"/settings/destinations",children:[(0,tr.jsx)(GA.A,{}),"Commute destinations"]}),f&&(0,tr.jsxs)(Ip,{onClick:()=>{m()},children:[(0,tr.jsx)(PE.A,{}),"Manage billing"]}),(0,tr.jsx)(Ep,{}),(0,tr.jsxs)(Ip,{onClick:g,children:[(0,tr.jsx)(zp.A,{}),"Log out"]})]})]}))}var TE=r(3042);const EE=e=>{const t=o.useRef({});return o.useEffect(()=>{t.current=e}),t.current};function zE(e){return xr("MuiBadge",e)}const DE=wr("MuiBadge",["root","badge","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","invisible","locationInside","locationOutside","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]),ME=["anchorOrigin","badgeInset","children","size","color","invisible","max","badgeContent","showZero","variant","component","slots","slotProps"],LE=Qr("span",{name:"JoyBadge",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({},"sm"===r.size&&(0,je.A)({"--Badge-minHeight":"0.5rem"},r.badgeContent&&{"--Badge-minHeight":"1rem"},{"--Badge-paddingX":"0.25rem"}),"md"===r.size&&(0,je.A)({"--Badge-minHeight":"0.75rem"},r.badgeContent&&{"--Badge-minHeight":"1.25rem"},{"--Badge-paddingX":"0.375rem"}),"lg"===r.size&&(0,je.A)({"--Badge-minHeight":"1rem"},r.badgeContent&&{"--Badge-minHeight":"1.5rem"},{"--Badge-paddingX":"0.5rem"}),{"--Badge-ringSize":"2px","--Badge-ring":"0 0 0 var(--Badge-ringSize) var(--Badge-ringColor, ".concat(t.vars.palette.background.surface,")"),position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0})}),OE=Qr("span",{name:"JoyBadge",slot:"Badge",overridesResolver:(e,t)=>t.badge})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l;const c={top:r.badgeInset,left:r.badgeInset,bottom:r.badgeInset,right:r.badgeInset};if("string"===typeof r.badgeInset){const e=r.badgeInset.split(" ");e.length>1&&(c.top=e[0],c.right=e[1],2===e.length&&(c.bottom=e[0],c.left=e[1]),3===e.length&&(c.left=e[1],c.bottom=e[2]),4===e.length&&(c.bottom=e[2],c.left=e[3]))}const d="top"===(null==(n=r.anchorOrigin)?void 0:n.vertical)?"translateY(-50%)":"translateY(50%)",u="left"===(null==(o=r.anchorOrigin)?void 0:o.horizontal)?"translateX(-50%)":"translateX(50%)",h="top"===(null==(i=r.anchorOrigin)?void 0:i.vertical)?"0%":"100%",p="left"===(null==(a=r.anchorOrigin)?void 0:a.horizontal)?"0%":"100%",v=t.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[r.size])];return(0,je.A)({"--Icon-color":"currentColor","--Icon-fontSize":"calc(1em * ".concat(null!=(s=null==v?void 0:v.lineHeight)?s:"1",")"),display:"inline-flex",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",boxShadow:"var(--Badge-ring)",lineHeight:1,padding:"0 calc(var(--Badge-paddingX) - var(--variant-borderWidth, 0px))",minHeight:"var(--Badge-minHeight)",minWidth:"var(--Badge-minHeight)",borderRadius:"var(--Badge-radius, var(--Badge-minHeight))",zIndex:t.vars.zIndex.badge,backgroundColor:t.vars.palette.background.surface,[r.anchorOrigin.vertical]:c[r.anchorOrigin.vertical],[r.anchorOrigin.horizontal]:c[r.anchorOrigin.horizontal],transform:"scale(1) ".concat(u," ").concat(d),transformOrigin:"".concat(p," ").concat(h),["&.".concat(DE.invisible)]:{transform:"scale(0) ".concat(u," ").concat(d)}},v,{fontWeight:t.vars.fontWeight.md},null==(l=t.variants[r.variant])?void 0:l[r.color])}),FE=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyBadge"}),n=r.anchorOrigin,o=void 0===n?{vertical:"top",horizontal:"right"}:n,i=r.badgeInset,a=void 0===i?0:i,l=r.children,c=r.size,d=void 0===c?"md":c,u=r.color,h=void 0===u?"primary":u,p=r.invisible,v=void 0!==p&&p,f=r.max,m=void 0===f?99:f,g=r.badgeContent,y=void 0===g?"":g,b=r.showZero,x=void 0!==b&&b,w=r.variant,S=void 0===w?"solid":w,k=r.component,_=r.slots,C=void 0===_?{}:_,A=r.slotProps,j=void 0===A?{}:A,I=(0,Ie.A)(r,ME),P=EE({anchorOrigin:o,size:d,badgeInset:a,color:h,variant:S});let R=v;!1!==v||(0!==y||x)&&null!=y||(R=!0);const T=R?P:r,E=T.color,z=void 0===E?h:E,D=T.size,M=void 0===D?d:D,L=T.anchorOrigin,O=void 0===L?o:L,F=T.variant,N=void 0===F?S:F,B=T.badgeInset,H=void 0===B?a:B,W=(0,je.A)({},r,{anchorOrigin:O,badgeInset:H,variant:N,invisible:R,color:z,size:M}),V=(e=>{const t=e.color,r=e.variant,n=e.size,o=e.anchorOrigin;return Dr({root:["root"],badge:["badge",e.invisible&&"invisible",o&&"anchorOrigin".concat(Le(o.vertical)).concat(Le(o.horizontal)),r&&"variant".concat(Le(r)),t&&"color".concat(Le(t)),n&&"size".concat(Le(n))]},zE,{})})(W),$=(0,je.A)({},I,{component:k,slots:C,slotProps:j});let U=y&&Number(y)>m?"".concat(m,"+"):y;R&&0===y&&(U="");const q=pn("root",{ref:t,className:V.root,elementType:LE,externalForwardedProps:$,ownerState:W}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=pn("badge",{className:V.badge,elementType:OE,externalForwardedProps:$,ownerState:W}),Y=(0,s.A)(Q,2),X=Y[0],Z=Y[1];return(0,tr.jsxs)(G,(0,je.A)({},J,{children:[l,(0,tr.jsx)(X,(0,je.A)({},Z,{children:U}))]}))}),NE=FE;var BE=r(5310);const HE=()=>{const e=Ma().getIdToken;return ql({queryKey:["notifications"],queryFn:async()=>{var t;const r=await e();if(!r)return{notifications:[]};const n=await fetch("".concat(IW,"/api/notifications"),{headers:{Authorization:r}});return n.ok&&null!==(t=await Gl(n))&&void 0!==t?t:{notifications:[]}},staleTime:6e4})},WE=()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();r&&await fetch("".concat(IW,"/api/notifications/mark-read"),{method:"POST",headers:{Authorization:r,"Content-Type":"application/json"},body:JSON.stringify(t)})},onSuccess:()=>{t.invalidateQueries({queryKey:["notifications"]})}})};var VE=r(9014),$E=r(728);function UE(e){if("price_drop"===e.type)return(0,tr.jsx)(CA.A,{sx:{color:"danger.500"}});if("new_match"===e.type)return(0,tr.jsx)(VE.A,{sx:{color:"primary.500"}});if("listing_status_change"===e.type){const t=e.title.toLowerCase();return t.includes("under offer")?(0,tr.jsx)(oj.A,{sx:{color:"warning.500"}}):t.includes("sold")?(0,tr.jsx)(ij.A,{sx:{color:"danger.500"}}):(0,tr.jsx)($E.A,{sx:{color:"neutral.500"}})}return(0,tr.jsx)(BE.A,{})}var qE=r(5283);const KE=["id"];class GE extends Error{constructor(e,t){super("HTTP ".concat(e)),this.status=void 0,this.body=void 0,this.status=e,this.body=t}}const JE=async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=await e(),o=await fetch("".concat(IW,"/api").concat(t),(0,Ae.A)((0,Ae.A)({},r),{},{headers:(0,Ae.A)({Authorization:null!==n&&void 0!==n?n:"","Content-Type":"application/json"},r.headers||{})}));if(!o.ok){let e=null;try{e=await o.json()}catch(a){}throw new GE(o.status,e)}const i=await o.text();return i?JSON.parse(i):null},QE=()=>{const e=Ma().getIdToken;return ql({queryKey:["aiSearches"],queryFn:()=>JE(e,"/ai-search")})},YE=()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>JE(e,"/ai-search",{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{t_("first_search_created"),t.invalidateQueries({queryKey:["aiSearches"]})}})},XE=e=>["aiSearchSuggestions",e],ZE=e=>{const t=Ma().getIdToken;return ql({queryKey:["latestAiSearchJob",e],queryFn:()=>JE(t,"/ai-search/".concat(e,"/latest-job")).catch(()=>null),enabled:!!e,refetchInterval:e=>{var t;const r=null===(t=e.state.data)||void 0===t?void 0:t.status;return("pending"===r||"running"===r)&&2e3}})},ez="undefined"!==typeof window&&window.isSecureContext,tz="undefined"!==typeof window&&"undefined"!==typeof navigator&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,rz=ez&&tz;function nz(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=window.atob(t),n=new Uint8Array(r.length);for(let o=0;o{if(!rz)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.ready,r=await t.pushManager.getSubscription();e||d(!!r)}catch(t){}finally{e||v(!0)}})(),()=>{e=!0}},[]);const b=(0,o.useCallback)(async()=>{if(!rz)return!1;y(!0);try{const t=await Notification.requestPermission();if(i(t),"granted"!==t)return!1;const r=await navigator.serviceWorker.ready,n=await r.pushManager.getSubscription(),o=null!==n&&void 0!==n?n:await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:nz(await az())});return await JE(e,"/notifications/push-subscription",{method:"POST",body:JSON.stringify({endpoint:o.endpoint,auth:oz(o.getKey("auth")),p256dh:oz(o.getKey("p256dh")),userAgent:navigator.userAgent})}),d(!0),!0}catch(t){return console.warn("Push subscribe failed",t),!1}finally{y(!1)}},[e]),x=(0,o.useCallback)(async()=>{if(!rz)return!1;y(!0);try{const t=await navigator.serviceWorker.ready,r=await t.pushManager.getSubscription();return r&&(await JE(e,"/notifications/push-subscription",{method:"DELETE",body:JSON.stringify({endpoint:r.endpoint})}),await r.unsubscribe()),d(!1),!0}catch(t){return console.warn("Push unsubscribe failed",t),!1}finally{y(!1)}},[e]);return{isSupported:rz,isReady:p,permission:n,isSubscribed:c,isWorking:g,subscribe:b,unsubscribe:x}}const lz="toppi.pushPromptSnoozedUntil";function cz(e){let t=e.onResolved,r=e.title;const n=sz(),o=n.isSupported,i=n.isReady,a=n.permission,s=n.isSubscribed,l=n.isWorking,c=n.subscribe;if(!o||!i)return null;if(s)return null;if("granted"===a)return null;if("denied"===a)return(0,tr.jsx)(Tr,{sx:{px:2,py:1.25,bgcolor:"background.level1"},children:(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Push notifications are blocked. Enable them in your browser settings to get instant alerts."})});return(0,tr.jsx)(FA,{variant:"soft",color:"primary",sx:{borderRadius:0,py:1.25},startDecorator:(0,tr.jsx)(qE.A,{}),endDecorator:(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(wo,{size:"sm",variant:"solid",color:"primary",loading:l,onClick:async()=>{await c()&&(null===t||void 0===t||t())},children:"Enable"}),(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;try{const t=new Date(Date.now()+864e5*e);window.localStorage.setItem(lz,t.toISOString())}catch(t){}}(),null===t||void 0===t||t()},"aria-label":"Dismiss",children:(0,tr.jsx)(la.A,{fontSize:"small"})})]}),children:(0,tr.jsx)(Gn,{level:"body-sm",children:null!==r&&void 0!==r?r:"Get push alerts the moment a matching home appears \u2014 before it goes under offer."})})}function dz(e){let t=e.n,r=e.onClick;const n=new Date(t.createdAt).toLocaleDateString("en-GB",{day:"numeric",month:"short"}),o=ie(),i="listing_status_change"===t.type&&t.title.toLowerCase().includes("under offer")&&!!t.houseId;return(0,tr.jsxs)(Tr,{onClick:()=>r(t),sx:{px:2,py:1.25,display:"flex",gap:1.5,alignItems:"flex-start",cursor:t.houseId?"pointer":"default",bgcolor:t.read?"transparent":"background.level1","&:hover":t.houseId?{bgcolor:"background.level2"}:void 0},children:[(0,tr.jsx)(Tr,{sx:{mt:.25},children:UE(t)}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",noWrap:!0,children:t.title}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.secondary",children:t.body}),i&&(0,tr.jsx)(hc,{component:"button",level:"body-xs",sx:{mt:.5,display:"block"},onClick:e=>{e.stopPropagation(),o("/house/".concat(t.houseId,"?moreLikeThis=true"))},children:"Find similar properties \u2192"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",sx:{mt:.25},children:n})]}),!t.read&&(0,tr.jsx)(Ti,{size:"sm",color:"primary",variant:"solid",children:"new"})]})}function uz(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.open,i=r.onOpenChange;const a=ie(),l=HE(),c=l.data,d=l.isLoading,u=(()=>{const e=Ma().getIdToken;return ql({queryKey:["notifications","unread-count"],queryFn:async()=>{var t;const r=await e();if(!r)return{count:0};const n=await fetch("".concat(IW,"/api/notifications/unread-count"),{headers:{Authorization:r}});return n.ok&&null!==(t=await Gl(n))&&void 0!==t?t:{count:0}},refetchInterval:6e4,staleTime:3e4})})().data,h=WE(),p=null!==(e=null===c||void 0===c?void 0:c.notifications)&&void 0!==e?e:[],v=null!==(t=null===u||void 0===u?void 0:u.count)&&void 0!==t?t:0,f=(0,o.useState)(function(){try{const e=window.localStorage.getItem(lz);return!!e&&new Date(e).getTime()>Date.now()}catch(e){return!1}}()),m=(0,s.A)(f,2),g=m[0],y=m[1],b=p.find(e=>{var t;return"listing_status_change"===e.type||"new_match"===e.type&&(null!==(t=e.matchScore)&&void 0!==t?t:0)>=80}),x=!g&&!!b,w="listing_status_change"===(null===b||void 0===b?void 0:b.type)?"A saved property just changed status \u2014 get instant push alerts next time.":"Get push alerts the moment a matching home appears \u2014 before it goes under offer.",S=e=>{e.read||h.mutate({ids:[e.id]}),e.houseId&&a("/house/".concat(e.houseId))};return(0,tr.jsxs)($d,{open:n,onOpenChange:(e,t)=>null===i||void 0===i?void 0:i(t),children:[(0,tr.jsx)(Zd,{slots:{root:Z_},slotProps:{root:{variant:"plain",color:"neutral",size:"sm"}},"aria-label":v>0?"Notifications, ".concat(v," unread"):"Notifications",children:(0,tr.jsx)(NE,{badgeContent:v,color:"danger",max:99,invisible:0===v,children:(0,tr.jsx)(BE.A,{})})}),(0,tr.jsxs)(hp,{placement:"bottom-end",sx:{width:360,maxHeight:480,overflow:"auto",p:0,zIndex:1200},children:[(0,tr.jsxs)(Tr,{sx:{px:2,py:1.25,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Notifications"}),v>0&&(0,tr.jsx)(wo,{size:"sm",variant:"plain",onClick:()=>h.mutate({all:!0}),children:"Mark all read"})]}),(0,tr.jsx)(nc,{}),x&&(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(cz,{title:w,onResolved:()=>y(!0)}),(0,tr.jsx)(nc,{})]}),d?(0,tr.jsx)(Tr,{sx:{p:3,display:"flex",justifyContent:"center"},children:(0,tr.jsx)(An,{size:"sm"})}):0===p.length?(0,tr.jsx)(Tr,{sx:{p:3,textAlign:"center"},children:(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"No notifications yet"})}):(0,tr.jsx)(Mn,{divider:(0,tr.jsx)(nc,{}),children:p.map(e=>(0,tr.jsx)(dz,{n:e,onClick:S},e.id))})]})]})}function hz(e){return xr("MuiListItemContent",e)}wr("MuiListItemContent",["root"]);const pz=["component","className","children","slots","slotProps"],vz=Qr("div",{name:"JoyListItemContent",slot:"Root",overridesResolver:(e,t)=>t.root})({flex:"1 1 auto",minWidth:0}),fz=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyListItemContent"}),n=r.component,o=r.className,i=r.children,a=r.slots,l=void 0===a?{}:a,c=r.slotProps,d=void 0===c?{}:c,u=(0,Ie.A)(r,pz),h=(0,je.A)({},r),p=Dr({root:["root"]},hz,{}),v=(0,je.A)({},u,{component:n,slots:l,slotProps:d}),f=pn("root",{ref:t,className:(0,Pe.A)(p.root,o),elementType:vz,externalForwardedProps:v,ownerState:h}),m=(0,s.A)(f,2),g=m[0],y=m[1];return(0,tr.jsx)(g,(0,je.A)({},y,{children:i}))});var mz=r(8094);const gz=o.createContext(null);function yz(e){let t=e.children;const r=o.useState(!1),n=(0,s.A)(r,2),i=n[0],a=n[1],l=o.useState(""),c=(0,s.A)(l,2),d=c[0],u=c[1],h=o.useState(0),p=(0,s.A)(h,2),v=p[0],f=p[1],m=ie(),g=Ma().logout,y=o.useCallback(()=>{u(""),f(0),a(!0)},[]),b=o.useCallback(()=>a(!1),[]),x=o.useMemo(()=>[{id:"dashboard",label:"Go to Dashboard",keywords:"home boards properties",icon:(0,tr.jsx)(mz.A,{fontSize:"small"}),run:()=>m("/dashboard")},{id:"ai-search",label:"Go to AI Search",keywords:"find property search ai",icon:(0,tr.jsx)(n_.A,{fontSize:"small"}),run:()=>m("/ai-search")},{id:"destinations",label:"Commute destinations",keywords:"settings transport tube",icon:(0,tr.jsx)(GA.A,{fontSize:"small"}),run:()=>m("/settings/destinations")},{id:"logout",label:"Log out",keywords:"sign out",icon:(0,tr.jsx)(zp.A,{fontSize:"small"}),run:()=>{Xk(),g()}}],[m,g]),w=o.useMemo(()=>{const e=d.trim().toLowerCase();return e?x.filter(t=>t.label.toLowerCase().includes(e)||t.keywords.includes(e)):x},[x,d]);o.useEffect(()=>{v>=w.length&&f(0)},[w.length,v]),o.useEffect(()=>{const e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()&&(e.preventDefault(),a(e=>!e),i||(u(""),f(0)))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i]);const S=e=>{b(),e.run()};return(0,tr.jsxs)(gz.Provider,{value:{open:y,close:b},children:[t,(0,tr.jsx)(L_,{open:i,onClose:b,children:(0,tr.jsxs)(U_,{"aria-labelledby":"command-palette-title",sx:{minWidth:{xs:"90vw",sm:480},maxWidth:560,p:0,overflow:"hidden"},children:[(0,tr.jsxs)(Tr,{sx:{p:1.5,borderBottom:"1px solid",borderColor:"divider"},children:[(0,tr.jsx)(Gn,{id:"command-palette-title",level:"body-xs",color:"neutral",sx:{mb:.5},children:"Command palette"}),(0,tr.jsx)(NC,{autoFocus:!0,value:d,onChange:e=>{u(e.target.value),f(0)},onKeyDown:e=>{if("ArrowDown"===e.key)e.preventDefault(),f(e=>Math.min(w.length-1,e+1));else if("ArrowUp"===e.key)e.preventDefault(),f(e=>Math.max(0,e-1));else if("Enter"===e.key){const e=w[v];e&&S(e)}},placeholder:"Type to filter\u2026",startDecorator:(0,tr.jsx)(i_.A,{fontSize:"small"}),size:"md"})]}),(0,tr.jsx)(Ui,{size:"sm",sx:{maxHeight:320,overflow:"auto","--ListItem-radius":"6px",p:.5},children:0===w.length?(0,tr.jsx)(ta,{children:(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",sx:{px:1,py:1},children:"No results"})}):w.map((e,t)=>(0,tr.jsx)(ta,{children:(0,tr.jsxs)(kp,{selected:t===v,onClick:()=>S(e),onMouseEnter:()=>f(t),children:[(0,tr.jsx)(aa,{children:e.icon}),(0,tr.jsx)(fz,{children:e.label})]})},e.id))})]})})]})}const bz=[{prefix:"/ai-search",label:"AI Search",href:"/ai-search",icon:n_.A},{prefix:"/notifications",label:"Notifications",href:"/notifications",icon:GT.A},{prefix:"/alerts",label:"Notifications",href:"/notifications",icon:GT.A},{prefix:"/settings",label:"Settings",href:"/settings",icon:JT.A},{prefix:"/profile",label:"Settings",href:"/settings",icon:JT.A},{prefix:"/account",label:"Settings",href:"/settings",icon:JT.A},{prefix:"/house/",label:"Property",href:"/dashboard",icon:o_.A},{prefix:"/compare",label:"Compare",href:"/dashboard",icon:KT.A},{prefix:"/dashboard",label:"Board",href:"/dashboard",icon:KT.A}];function xz(){const e=qT(),t=e.mode,r=e.setMode,n=o.useState(!1),i=(0,s.A)(n,2),a=i[0],l=i[1];return o.useEffect(()=>{l(!0)},[]),a?(0,tr.jsx)(bA,{title:"Change theme",variant:"outlined",children:(0,tr.jsx)(Z_,{id:"toggle-mode",size:"sm",variant:"plain",color:"neutral","aria-label":"Change theme",sx:{alignSelf:"center"},onClick:()=>{r("light"===t?"dark":"light")},children:"light"===t?(0,tr.jsx)(QT.A,{}):(0,tr.jsx)(YT.A,{})})}):(0,tr.jsx)(Z_,{size:"sm",variant:"outlined",color:"primary","aria-label":"Change theme"})}function wz(e){var t;const r=Ma(),n=r.login,i=r.isAuthenticated,a=tE(),l=function(){const e=o.useContext(gz);if(!e)throw new Error("useCommandPalette must be used within CommandPaletteProvider");return e}(),c=function(e){const t=bz.find(t=>e.startsWith(t.prefix));return null!==t&&void 0!==t?t:{label:"Board",href:"/dashboard",icon:KT.A}}(ne().pathname),d=c.label,u=c.href,h=c.icon,p=null===(t=e.showAccountMenu)||void 0===t||t,v=o.useState(null),f=(0,s.A)(v,2),m=f[0],g=f[1];return(0,tr.jsxs)(Tr,{sx:{display:"flex",flexGrow:1,justifyContent:"space-between"},children:[e.onMenuClick&&(0,tr.jsx)(Z_,{variant:"outlined",color:"neutral",size:"sm",onClick:e.onMenuClick,"aria-label":"Open navigation menu",sx:{display:{xs:"inline-flex",sm:"none"},alignSelf:"center"},children:(0,tr.jsx)(ZT.A,{})}),(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"center",alignItems:"center",spacing:1,sx:{display:{xs:"none",sm:"flex"}},children:[(0,tr.jsx)(Z_,{component:"a",href:i?"/dashboard":"/","aria-label":"Home",children:(0,tr.jsx)(XT.A,{})}),(0,tr.jsx)(hc,{href:i?"/dashboard":"/",children:(0,tr.jsx)(Gn,{level:"h3",children:"Toppi"})}),(0,tr.jsx)(wo,{variant:"plain",color:"neutral",component:"a",href:u,size:"sm",startDecorator:(0,tr.jsx)(h,{"aria-hidden":"true"}),sx:{alignSelf:"center"},children:d}),a&&(0,tr.jsx)(wo,{variant:"plain",color:"neutral",component:"a",href:"/admin",size:"sm",sx:{alignSelf:"center"},startDecorator:(0,tr.jsx)(TE.A,{}),children:"Admin"})]}),(0,tr.jsxs)(Tr,{sx:{display:{xs:"flex",sm:"none"},alignItems:"center",gap:.75,minWidth:0},children:[(0,tr.jsx)(h,{"aria-hidden":"true"}),(0,tr.jsx)(Gn,{level:"title-sm",noWrap:!0,children:d})]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:"row",gap:1.5,alignItems:"center"},children:[(0,tr.jsx)(wo,{size:"sm",variant:"outlined",color:"neutral",onClick:l.open,"aria-label":"Search \u2014 open command palette",startDecorator:(0,tr.jsx)(i_.A,{color:"primary"}),endDecorator:(0,tr.jsx)(Tr,{sx:{display:"flex",alignItems:"center",px:.75,py:.25,borderRadius:"sm",bgcolor:"background.level1"},children:(0,tr.jsx)(Gn,{level:"title-sm",textColor:"text.icon",children:"\u2318 K"})}),sx:{alignSelf:"center",justifyContent:"space-between",fontWeight:"md",color:"text.tertiary",minWidth:220,display:{xs:"none",sm:"inline-flex"}},children:"Search anything\u2026"}),(0,tr.jsx)(Z_,{size:"sm",variant:"outlined",color:"neutral","aria-label":"Open command palette",onClick:l.open,sx:{display:{xs:"inline-flex",sm:"none"},alignSelf:"center"},children:(0,tr.jsx)(i_.A,{})}),(0,tr.jsx)(xz,{}),e.user.isAuthenticated&&(0,tr.jsx)(uz,{open:"notifications"===m,onOpenChange:e=>g(t=>e?"notifications":"notifications"===t?null:t)}),e.user.isAuthenticated?p&&(0,tr.jsx)(Sz,{openMenu:m,setOpenMenu:g}):(0,tr.jsx)(wo,{color:"neutral",onClick:()=>n(),variant:"soft",children:"Login"})]})]})}function Sz(e){let t=e.openMenu,r=e.setOpenMenu;const n=nE(),i=n.displayName,a=n.avatarInitial,l=n.planTier,c=o.useState(!1),d=(0,s.A)(c,2),u=d[0],h=d[1],p=i?"".concat(i," avatar"):"User avatar";return(0,tr.jsxs)(tr.Fragment,{children:[l&&(0,tr.jsx)(Ti,{size:"sm",variant:"pro"===l?"solid":"soft",color:"pro"===l?"primary":"neutral",sx:{cursor:"free"===l?"pointer":"default"},onClick:"free"===l?()=>h(!0):void 0,children:"pro"===l?"Pro":"Free"}),(0,tr.jsx)(RE,{ariaLabel:"Account menu",placement:"bottom-end",triggerSx:{maxWidth:"32px",maxHeight:"32px",borderRadius:"9999999px"},open:"profile"===t,onOpenChange:e=>r(t=>e?"profile":"profile"===t?null:t),trigger:(0,tr.jsx)(Xo,{alt:p,sx:{maxWidth:"32px",maxHeight:"32px"},children:a})}),(0,tr.jsx)(jE,{open:u,onClose:()=>h(!1)})]})}var kz=r(2505),_z=r(2840);const Cz=function(){const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();if(!r)return console.log("No token found"),{data:[]};const n=await fetch("".concat(IW,"/api/board"),{method:"POST",headers:{Authorization:r},body:JSON.stringify(t)});return n.ok?n.json():{data:[]}},onSuccess:()=>{t.invalidateQueries({queryKey:["house"]}),t.invalidateQueries({queryKey:["board"]}),window.location.reload()}})};const Az=function(){const e=zl();return Lk({mutationFn:async e=>{console.log(e),await fetch("".concat(IW,"/api/board/").concat(e),{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["board"]})}})};var jz=r(1215),Iz=r(9837);function Pz(e){const t=Ma().getIdToken;return ql({queryKey:["boardMembers",e],queryFn:async()=>{var r;if(!e)return[];const n=await t(),o=await fetch("".concat(IW,"/api/board/").concat(e,"/members"),{headers:{Authorization:null!==n&&void 0!==n?n:""}});if(!o.ok)throw new Error("Failed to fetch board members");return null!==(r=await Gl(o))&&void 0!==r?r:[]},enabled:!!e})}function Rz(e){let t=e.open,r=e.onClose,n=e.boardId;const i=o.useState(""),a=(0,s.A)(i,2),l=a[0],c=a[1],d=o.useState(!1),u=(0,s.A)(d,2),h=u[0],p=u[1],v=function(){const e=Ma().getIdToken;return Lk({mutationFn:async t=>{let r=t.boardId,n=t.email;const o=await e(),i=await fetch("".concat(IW,"/api/board/").concat(r,"/invite"),{method:"POST",headers:{Authorization:null!==o&&void 0!==o?o:"","Content-Type":"application/json"},body:JSON.stringify({email:n})});if(!i.ok)throw new Error("Failed to send invite");return i.json()}})}(),f=Pz(n).data,m=()=>{p(!1),c(""),r()};return(0,tr.jsx)(L_,{open:t,onClose:m,children:(0,tr.jsxs)(U_,{minWidth:440,children:[(0,tr.jsx)(sC,{}),(0,tr.jsx)(wR,{children:"Invite collaborator"}),(0,tr.jsx)(mE,{children:(0,tr.jsxs)(Mn,{spacing:2,sx:{mt:1},children:[h&&(0,tr.jsx)(Gn,{level:"body-sm",color:"success",children:"Invite sent! They'll receive an email with a link to join the board."}),(0,tr.jsxs)(mC,{required:!0,children:[(0,tr.jsx)(SC,{children:"Email address"}),(0,tr.jsx)(NC,{type:"email",placeholder:"colleague@example.com",value:l,onChange:e=>{c(e.target.value),p(!1)}})]}),f&&f.length>0&&(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:"Current members"}),(0,tr.jsx)(Ui,{size:"sm",sx:{"--ListItem-paddingY":"4px"},children:f.map(e=>(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(fz,{children:(0,tr.jsx)(Gn,{level:"body-sm",children:e.email||"Pending \u2014 invite not yet accepted"})}),(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"owner"===e.role?"primary":"neutral",children:e.role})]},e.id))})]})]})}),(0,tr.jsxs)(hE,{children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:m,children:"Cancel"}),(0,tr.jsx)(wo,{loading:v.isPending,disabled:!l,onClick:()=>{v.mutate({boardId:n,email:l},{onSuccess:()=>{p(!0),c("")}})},children:"Send invite"})]})]})})}var Tz=r(9913),Ez=r(3187),zz=r(6270),Dz=r(916);const Mz=async e=>{const t=await e();return{Authorization:null!==t&&void 0!==t?t:"","Content-Type":"application/json"}};const Lz={commuteDestinationAdded(e,t){Zk("commute_destination_added",{transport_mode:e,is_first_destination:t})},comparisonStarted(e){Zk("comparison_started",{property_count:e})},notificationInboxOpened(e){Zk("notification_inbox_opened",{unread_count:e})},propertyStatusChanged(e,t){Zk("property_status_changed",{from_status:e,to_status:t})},boardShared(e){Zk("board_shared",{is_first_share:e})},matchScoreExpanded(e){Zk("match_score_expanded",{match_score_pct:e})},priceDropAlertClicked(e){Zk("price_drop_alert_clicked",{price_drop_pct:e})}},Oz="has_shared_board_once";function Fz(e){let t=e.open,r=e.onClose;const n=function(e){var t,r,n,o,i,a;const s=Ma().getIdToken,l=zl(),c=["boardShareLink",e],d=ql({queryKey:c,queryFn:async()=>{if(!e)return null;const t=await Jl("".concat(IW,"/api/board/").concat(e,"/share"),{headers:await Mz(s)});if(204===t.status||404===t.status)return null;if(!t.ok)throw new Error("Failed to load share link (HTTP ".concat(t.status,")"));return await Gl(t)},enabled:!!e,retry:1}),u=Lk({mutationFn:async()=>{if(!e)throw new Error("boardId is required");const t=await Jl("".concat(IW,"/api/board/").concat(e,"/share"),{method:"POST",headers:await Mz(s)});if(!t.ok)throw new Error("Failed to create share link (HTTP ".concat(t.status,")"));return t.json()},onSuccess:()=>l.invalidateQueries({queryKey:c})}),h=Lk({mutationFn:async()=>{if(!e)throw new Error("boardId is required");const t=await fetch("".concat(IW,"/api/board/").concat(e,"/share"),{method:"DELETE",headers:await Mz(s)});if(!t.ok&&204!==t.status)throw new Error("Failed to revoke share link (HTTP ".concat(t.status,")"))},onSuccess:()=>l.invalidateQueries({queryKey:c})});return{shareUrl:null===(t=d.data)||void 0===t?void 0:t.shareUrl,token:null===(r=d.data)||void 0===r?void 0:r.token,viewCount:null!==(n=null===(o=d.data)||void 0===o?void 0:o.viewCount)&&void 0!==n?n:0,createdAt:null===(i=d.data)||void 0===i?void 0:i.createdAt,link:null!==(a=d.data)&&void 0!==a?a:null,isLoading:d.isLoading,isError:d.isError,refetch:d.refetch,createLink:u.mutate,createError:u.error,revokeLink:h.mutate,isCreating:u.isPending,isRevoking:h.isPending}}(e.boardId),i=n.shareUrl,a=n.viewCount,l=n.isLoading,c=n.isError,d=n.refetch,u=n.createLink,h=n.createError,p=n.revokeLink,v=n.isCreating,f=n.isRevoking,m=o.useState(!1),g=(0,s.A)(m,2),y=g[0],b=g[1],x=o.useState(!1),w=(0,s.A)(x,2),S=w[0],k=w[1],_=o.useState(!1),C=(0,s.A)(_,2),A=C[0],j=C[1];o.useEffect(()=>{t&&(b(!1),k(!1))},[t]),o.useEffect(()=>{if(!t||!l)return void j(!1);const e=setTimeout(()=>j(!0),5e3);return()=>clearTimeout(e)},[t,l]);const I=!!i;return(0,tr.jsx)(L_,{open:t,onClose:r,children:(0,tr.jsxs)(U_,{size:"sm",variant:"outlined",sx:{maxWidth:480,width:"100%"},children:[(0,tr.jsx)(sC,{}),(0,tr.jsxs)(wR,{children:[(0,tr.jsx)(jz.A,{}),"Share board"]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(mE,{sx:{gap:2},children:[(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"Anyone with the link can view your shortlist \u2014 without signing in. They won't see enrichment data or notes."}),l?(0,tr.jsxs)(Mn,{spacing:1.5,children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral","aria-live":"polite",children:"Checking for existing share link\u2026"}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1,alignItems:"center",children:[(0,tr.jsx)(uT,{variant:"rectangular",sx:{flex:1,height:40,borderRadius:"sm"}}),(0,tr.jsx)(uT,{variant:"rectangular",width:40,height:40,sx:{borderRadius:"sm"}})]}),(0,tr.jsx)(uT,{variant:"rectangular",width:140,height:36,sx:{borderRadius:"sm"}}),A&&(0,tr.jsx)(FA,{color:"warning",variant:"soft",size:"sm",children:"Taking longer than expected \u2014 please wait."})]}):c?(0,tr.jsxs)(Mn,{spacing:1.5,children:[(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",children:"Couldn't load the share link. Please try again."}),(0,tr.jsx)(wo,{variant:"soft",color:"neutral",onClick:()=>{d()},startDecorator:(0,tr.jsx)(Dz.A,{}),children:"Retry"})]}):I?(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Share link"}),(0,tr.jsx)(NC,{readOnly:!0,value:i,endDecorator:(0,tr.jsx)(Z_,{onClick:async()=>{if(!i)return;try{await navigator.clipboard.writeText(i),b(!0),window.setTimeout(()=>b(!1),2e3)}catch(t){}let e=!1;try{e=!window.localStorage.getItem(Oz),e&&window.localStorage.setItem(Oz,"1")}catch(r){}Lz.boardShared(e)},variant:"soft","aria-label":"Copy share link",children:y?(0,tr.jsx)(sa.A,{}):(0,tr.jsx)(Tz.A,{})}),sx:{fontFamily:"monospace",fontSize:"sm"}})]}),(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"neutral",startDecorator:(0,tr.jsx)(Ez.A,{}),children:[a," view",1!==a?"s":""]}),(0,tr.jsx)(wo,{size:"sm",variant:"soft",color:"danger",startDecorator:(0,tr.jsx)(zz.A,{}),onClick:()=>{p(void 0,{onSuccess:()=>k(!0)})},loading:f,children:"Revoke link"})]})]}):(0,tr.jsxs)(Mn,{spacing:1.5,children:[S&&(0,tr.jsx)(Gn,{level:"body-sm",color:"warning",children:"Link revoked. Generate a new one?"}),h&&(0,tr.jsxs)(FA,{color:"danger",variant:"soft",size:"sm",children:["Couldn't create share link: ",h.message]}),(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:()=>{k(!1),u()},loading:v,startDecorator:(0,tr.jsx)(jz.A,{}),children:"Generate share link"})]})]})]})})}function Nz(e){let t=e.boards,r=e.activeBoard,n=e.setActiveBoard;const i=o.useState(!1),a=(0,s.A)(i,2),l=a[0],c=a[1],d=o.useState(""),u=(0,s.A)(d,2),h=u[0],p=u[1],v=o.useState(!1),f=(0,s.A)(v,2),m=f[0],g=f[1],y=o.useState(!1),b=(0,s.A)(y,2),x=b[0],w=b[1],S=o.useState(null),k=(0,s.A)(S,2),_=k[0],C=k[1],A=Cz(),j=Az(),I=ie(),P=ne(),R=HR(),T=nE(),E=T.displayName,z=T.email,D=T.planLabel,M=T.avatarInitial,L=Hk().data,O=Pz(null===r||void 0===r?void 0:r.id).data,F=o.useMemo(()=>!(!L||!O)&&O.some(e=>"owner"===e.role&&(e.email&&e.email===L.email||e.id===L.id)),[L,O]),N=()=>{c(!1),p("")};return(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(Mn,{sx:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,tr.jsxs)(Tr,{sx:{flex:1,minHeight:0,overflow:"auto",px:.5},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,mt:.5,mb:.75},children:[(0,tr.jsx)(Gn,{level:"body-xs",sx:{textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:"lg",color:"text.tertiary"},children:"Boards"}),(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"neutral",onClick:()=>c(!0),"aria-label":"Create new board",children:(0,tr.jsx)(kz.A,{fontSize:"small"})})]}),(0,tr.jsx)(Ui,{size:"sm",sx:{"--List-gap":"2px","--ListItem-radius":"var(--joy-radius-md)"},children:t&&t.map(e=>{const t=(null===r||void 0===r?void 0:r.id)===e.id;return(0,tr.jsx)(ta,{sx:{"&:hover .board-delete, &:focus-within .board-delete":{opacity:1}},children:(0,tr.jsxs)(kp,{selected:t,variant:t?"soft":"plain",color:t?"primary":"neutral",onClick:()=>n(e),sx:{borderRadius:"md",fontWeight:t?"lg":"md"},children:[(0,tr.jsx)(aa,{children:(0,tr.jsx)(mz.A,{fontSize:"small"})}),(0,tr.jsx)(fz,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),(0,tr.jsx)(Z_,{className:"board-delete",size:"sm",variant:"plain",color:"danger",onClick:t=>{t.stopPropagation(),C(e)},"aria-label":"Delete board ".concat(e.name),sx:{opacity:{xs:1,sm:0},transition:"opacity 0.15s","--IconButton-size":"26px"},children:(0,tr.jsx)(SR.A,{fontSize:"small"})})]})},e.id)})}),(0,tr.jsx)(Gn,{level:"body-xs",sx:{textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:"lg",color:"text.tertiary",px:1,mt:2,mb:.75},children:"AI"}),(0,tr.jsx)(Ui,{size:"sm",sx:{"--List-gap":"2px","--ListItem-radius":"var(--joy-radius-md)"},children:(0,tr.jsx)(ta,{children:(0,tr.jsxs)(kp,{selected:"/ai-search"===P.pathname,variant:"/ai-search"===P.pathname?"soft":"plain",color:"/ai-search"===P.pathname?"primary":"neutral",onClick:()=>I("/ai-search"),sx:{borderRadius:"md",fontWeight:"/ai-search"===P.pathname?"lg":"md"},children:[(0,tr.jsx)(aa,{children:(0,tr.jsx)(n_.A,{fontSize:"small"})}),(0,tr.jsx)(fz,{children:"AI Search"})]})})})]}),(0,tr.jsxs)(Tr,{sx:{px:.5},children:[r&&(0,tr.jsxs)(Mn,{spacing:.25,sx:{mb:1},children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",size:"sm",fullWidth:!0,startDecorator:(0,tr.jsx)(Iz.A,{fontSize:"small"}),onClick:()=>g(!0),sx:{justifyContent:"flex-start",borderRadius:"md"},children:"Invite collaborator"}),F&&(0,tr.jsx)(wo,{variant:"plain",color:"neutral",size:"sm",fullWidth:!0,startDecorator:(0,tr.jsx)(jz.A,{fontSize:"small"}),onClick:()=>w(!0),sx:{justifyContent:"flex-start",borderRadius:"md"},children:"Share board"})]}),(0,tr.jsx)(nc,{}),(0,tr.jsx)(RE,{placement:"top-start",ariaLabel:"Account and settings",triggerVariant:"plain",triggerSx:{width:"100%",justifyContent:"flex-start",px:1,py:1.25,borderRadius:"md"},trigger:(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1.25,width:"100%",minWidth:0},children:[(0,tr.jsx)(Xo,{size:"sm",variant:"soft",color:"primary",children:M}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0,textAlign:"left"},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"lg",noWrap:!0,children:E||z||"Account"}),(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",noWrap:!0,children:[D," plan"]})]}),(0,tr.jsx)(_z.A,{fontSize:"small"})]})})]})]}),(0,tr.jsx)(L_,{open:l,onClose:N,children:(0,tr.jsxs)(U_,{"aria-labelledby":"create-board-title",sx:{minWidth:320},children:[(0,tr.jsx)(sC,{}),(0,tr.jsx)(wR,{id:"create-board-title",children:"Create new board"}),(0,tr.jsx)("form",{onSubmit:e=>{null===e||void 0===e||e.preventDefault();const t=h.trim();t&&(A.mutate({name:t}),N())},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Board name"}),(0,tr.jsx)(NC,{autoFocus:!0,placeholder:"e.g. SW London family home",value:h,onChange:e=>p(e.target.value)})]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,justifyContent:"flex-end"},children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:N,children:"Cancel"}),(0,tr.jsx)(wo,{type:"submit",disabled:!h.trim(),children:"Create board"})]})]})})]})}),r&&(0,tr.jsx)(Rz,{open:m,onClose:()=>g(!1),boardId:r.id}),r&&(0,tr.jsx)(Fz,{open:x,onClose:()=>w(!1),boardId:r.id}),(0,tr.jsx)(L_,{open:null!==_,onClose:()=>C(null),children:(0,tr.jsxs)(U_,{role:"alertdialog","aria-labelledby":"delete-board-title","aria-describedby":"delete-board-description",sx:{minWidth:320},children:[(0,tr.jsx)(sC,{}),(0,tr.jsx)(wR,{id:"delete-board-title",children:"Delete board?"}),(0,tr.jsx)(Tr,{id:"delete-board-description",sx:{color:"text.secondary"},children:_&&(0,tr.jsxs)(tr.Fragment,{children:["Delete ",(0,tr.jsx)("strong",{children:_.name}),"? This cannot be undone \u2014 all properties and notes saved on this board will be removed."]})}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,justifyContent:"flex-end",mt:2},children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:()=>C(null),children:"Cancel"}),(0,tr.jsx)(wo,{color:"danger",onClick:()=>{_&&(j.mutate(_.id),C(null),R({message:"Board deleted",color:"success"}))},autoFocus:!0,children:"Delete"})]})]})})]})}const Bz=o.createContext(null);function Hz(e){let t=e.children,r=e.boards,n=e.activeBoard,i=e.onSelectBoard,a=e.banner,l=e.mainSx;const c=Ma(),d=o.useState(!1),u=(0,s.A)(d,2),h=u[0],p=u[1],v=o.useMemo(()=>({openDrawer:()=>p(!0),closeDrawer:()=>p(!1)}),[]);return(0,tr.jsx)(Bz.Provider,{value:v,children:(0,tr.jsxs)(Er.Root,{sx:{height:"100vh",width:"100%",gridTemplateRows:a?"64px auto 1fr":"64px 1fr"},children:[(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:c,onMenuClick:()=>p(!0),showAccountMenu:!1})}),a&&(0,tr.jsx)(Tr,{sx:{gridColumn:"1 / -1"},children:a}),(0,tr.jsx)(Er.SideNav,{children:(0,tr.jsx)(Nz,{boards:r,activeBoard:n,setActiveBoard:i})}),(0,tr.jsxs)(xT,{open:h,onClose:()=>p(!1),anchor:"left",size:"sm",sx:{display:{sm:"none"}},children:[(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"flex-end",p:1},children:(0,tr.jsx)(sC,{})}),(0,tr.jsx)(Tr,{sx:{overflow:"auto",p:1,flex:1,display:"flex"},children:(0,tr.jsx)(Nz,{boards:r,activeBoard:n,setActiveBoard:e=>{i(e),p(!1)}})})]}),(0,tr.jsx)(Er.Main,{sx:[{minWidth:0,height:"100%",overflow:"auto"},...Array.isArray(l)?l:[l]],children:t})]})})}function Wz(){const e=Ql(),t=e.subscription,r=e.openPortal;return t&&"past_due"===t.status?(0,tr.jsx)(FA,{color:"warning",variant:"soft",startDecorator:(0,tr.jsx)(_A.A,{}),endDecorator:(0,tr.jsx)(wo,{size:"sm",variant:"soft",color:"warning",onClick:()=>{r()},children:"Manage billing"}),sx:{borderRadius:0},children:"Your payment failed. Update your billing details to keep Pro access."}):null}const Vz=function(){const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();if(!r)return console.log("No token found"),{data:[]};const n=await fetch("".concat(IW,"/api/house/update"),{method:"PUT",headers:{Authorization:r},body:JSON.stringify(t)});return n.ok?n.json():{data:[]}},onSuccess:()=>{t.invalidateQueries({queryKey:["house"]})}})};const $z=function(){const e=Ma().getIdToken;return ql({queryKey:["board"],queryFn:async()=>{var t;const r=await e();if(!r)return[];const n=await fetch("".concat(IW,"/api/board"),{headers:{Authorization:r}});return n.ok&&null!==(t=await Gl(n))&&void 0!==t?t:[]}})};var Uz=r(8795);function qz(e){return xr("MuiSheet",e)}wr("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const Kz=["className","color","component","variant","invertedColors","slots","slotProps"],Gz=Qr("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o;const i=null==(n=t.variants[r.variant])?void 0:n[r.color],a=si({theme:t,ownerState:r},["borderRadius","bgcolor","backgroundColor","background"]),s=a.borderRadius,l=a.bgcolor,c=a.backgroundColor,d=a.background,u=Ke(t,"palette.".concat(l))||l||Ke(t,"palette.".concat(c))||c||d||(null==i?void 0:i.backgroundColor)||(null==i?void 0:i.background)||t.vars.palette.background.surface;return[(0,je.A)({"--Icon-color":"neutral"!==r.color||"solid"===r.variant?"currentColor":t.vars.palette.text.icon,"--ListItem-stickyBackground":"transparent"===u?"initial":u,"--Sheet-background":"transparent"===u?"initial":u},void 0!==s&&{"--List-radius":"calc(".concat(s," - var(--variant-borderWidth, 0px))"),"--unstable_actionRadius":"calc(".concat(s," - var(--variant-borderWidth, 0px))")},{backgroundColor:t.vars.palette.background.surface,position:"relative"}),(0,je.A)({},t.typography["body-md"],"solid"===r.variant&&r.color&&r.invertedColors&&ni(r.color)(t),"soft"===r.variant&&r.color&&r.invertedColors&&oi(r.color)(t),null==(o=t.variants[r.variant])?void 0:o[r.color],i)]}),Jz=o.forwardRef(function(e,t){const r=en({props:e,name:"JoySheet"}),n=r.className,o=r.color,i=void 0===o?"neutral":o,a=r.component,l=void 0===a?"div":a,c=r.variant,d=void 0===c?"plain":c,u=r.invertedColors,h=void 0!==u&&u,p=r.slots,v=void 0===p?{}:p,f=r.slotProps,m=void 0===f?{}:f,g=(0,Ie.A)(r,Kz),y=(0,je.A)({},r,{color:i,component:l,invertedColors:h,variant:d}),b=(e=>{const t=e.variant,r=e.color;return Dr({root:["root",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r))]},qz,{})})(y),x=(0,je.A)({},g,{component:l,slots:v,slotProps:m}),w=pn("root",{ref:t,className:(0,Pe.A)(b.root,n),elementType:Gz,externalForwardedProps:x,ownerState:y}),S=(0,s.A)(w,2),k=S[0],_=S[1];return(0,tr.jsx)(k,(0,je.A)({},_))}),Qz=Jz,Yz=(e,t)=>{if(null!=t)return t in e?t:Object.keys(e).find(r=>e[r].items.some(e=>e.id===t))};function Xz(){const e=HA(),t=ie();if(!e||!e.selectionMode)return null;const r=e.selectedIds.size;return(0,tr.jsxs)(Qz,{variant:"solid",color:"primary",invertedColors:!0,sx:{position:"fixed",bottom:0,left:0,right:0,px:3,py:1.5,display:"flex",alignItems:"center",gap:2,zIndex:1200,boxShadow:"lg"},children:[(0,tr.jsx)(Gn,{level:"body-sm",sx:{color:"inherit"},children:0===r?"Select 2 or 3 properties to compare":"".concat(r," ").concat(1===r?"property":"properties"," selected").concat(r<2?" \u2014 pick at least 2":"")}),(0,tr.jsx)(Tr,{sx:{flex:1}}),(0,tr.jsx)(wo,{size:"sm",variant:"outlined",color:"neutral",onClick:e.exitSelectionMode,children:"Cancel"}),(0,tr.jsxs)(wo,{size:"sm",variant:"solid",color:"primary",disabled:r<2,onClick:()=>{const r=Array.from(e.selectedIds).join(",");t("/compare?ids=".concat(r)),e.exitSelectionMode()},children:["Compare (",r,")"]})]})}function Zz(){const e=function(){const e=o.useContext(Bz);if(!e)throw new Error("useAppShell must be used within an AppShell");return e}().openDrawer;return(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:e,startDecorator:(0,tr.jsx)(kz.A,{}),sx:{display:{xs:"inline-flex",sm:"none"}},children:"Create board"})}function eD(){return(0,tr.jsxs)(BA,{children:[(0,tr.jsx)(Td,{title:"My Board \u2014 Toppi",noIndex:!0}),(0,tr.jsx)(tD,{}),(0,tr.jsx)(Xz,{})]})}function tD(){var e,t,r;const n=$z().data,i=ne(),a=HA(),l=(0,o.useState)({}),c=(0,s.A)(l,2),d=c[0],u=c[1],h=(0,o.useState)(null),p=(0,s.A)(h,2),v=p[0],f=p[1],m=(0,o.useState)(null),g=(0,s.A)(m,2),y=g[0],b=g[1],x=(0,o.useState)(null),w=(0,s.A)(x,2),S=w[0],k=w[1],_=(e=>{var t;const r=QE().data;return e&&r&&null!==(t=r.find(t=>t.boardId===e))&&void 0!==t?t:null})(null!==(e=null===y||void 0===y?void 0:y.id)&&void 0!==e?e:null),C=null!==(t=null===_||void 0===_?void 0:_.id)&&void 0!==t?t:null,A=function(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(e=>null!=e),[...t])}(Zj(qI),Zj(HI,{coordinateGetter:cR})),j=(0,o.useRef)({saved:c_(),viewing:c_(),offer:c_(),rejected:c_()});function I(e){var t;return null!==(t=null===S||void 0===S?void 0:S.filter(t=>t.status===e).sort((e,t)=>e.position-t.position))&&void 0!==t?t:[]}(0,o.useEffect)(()=>{if(n&&n.length>0){var e;const t=null===(e=i.state)||void 0===e?void 0:e.boardId;b(e=>{if(t){const e=n.find(e=>e.id===t);if(e)return e}return n.find(t=>t.id===(null===e||void 0===e?void 0:e.id))||n[0]})}else b(null)},[n,i.state]),(0,o.useEffect)(()=>{y&&k(y.houses)},[y]),(0,o.useEffect)(()=>{if(null===a||void 0===a||!a.selectionMode)return;const e=e=>{"Escape"===e.key&&a.exitSelectionMode()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[null===a||void 0===a?void 0:a.selectionMode,a]),(0,o.useEffect)(()=>{if(S){const e={[j.current.saved]:{status:aj.saved.label,items:I("saved")},[j.current.viewing]:{status:aj.viewing.label,items:I("viewing")},[j.current.offer]:{status:aj.offer.label,items:I("offer")},[j.current.rejected]:{status:aj.rejected.label,items:I("rejected")}};u(e)}},[n,S,y]);const P=Vz(),R=(0,Ae.A)({},BP),T=v?((e,t)=>{var r;return null!==(r=null===e||void 0===e?void 0:e.find(e=>e.id===t))&&void 0!==r?r:null})(S,v):null;return(0,tr.jsx)(Hz,{boards:n,activeBoard:y,onSelectBoard:b,banner:(0,tr.jsx)(Wz,{}),mainSx:{overflow:"hidden"},children:void 0===n?(0,tr.jsx)(pT,{}):y?(0,tr.jsxs)(Tr,{sx:{height:"100%",display:"flex",flexDirection:"column",minWidth:0},children:[(0,tr.jsx)(Tr,{sx:{px:3,pt:1.5},children:(0,tr.jsx)(KR,{})}),(null!==(r=null===S||void 0===S?void 0:S.length)&&void 0!==r?r:0)>=2&&a&&!a.selectionMode&&(0,tr.jsx)(Tr,{sx:{px:3,py:1.5,display:"flex",justifyContent:"flex-end",bgcolor:"background.surface"},children:(0,tr.jsx)(wo,{size:"sm",variant:"outlined",startDecorator:(0,tr.jsx)(Uz.A,{}),onClick:a.enterSelectionMode,children:"Compare properties"})}),(0,tr.jsx)(AP,{sensors:A,collisionDetection:sI,onDragStart:e=>{let t=e.active;f(t.id)},onDragOver:e=>{let t=e.active,r=e.over;const n=Yz(d,t.id),o=Yz(d,null===r||void 0===r?void 0:r.id);n&&o&&n!==o&&u(e=>{const i=e[n].items,a=e[o].items,s=i.findIndex(e=>e.id===t.id),l=a.findIndex(e=>e.id!==(null===r||void 0===r?void 0:r.id));return(0,Ae.A)((0,Ae.A)({},e),{},{[n]:(0,Ae.A)((0,Ae.A)({},e[n]),{},{items:[...e[n].items.filter(e=>e.id!==t.id)]}),[o]:(0,Ae.A)((0,Ae.A)({},e[o]),{},{items:[...e[o].items.slice(0,l),d[n].items[s],...e[o].items.slice(l,e[o].items.length)]})})})},onDragEnd:e=>{let t=e.active,r=e.over;const n=Yz(d,t.id),o=Yz(d,null===r||void 0===r?void 0:r.id);if(!n||!o||n!==o)return;const i=d[n].items.findIndex(e=>e.id===t.id),a=d[n].items[i],s=d[o].items.findIndex(e=>e.id===(null===r||void 0===r?void 0:r.id));if(i!==s){var l;u(e=>(0,Ae.A)((0,Ae.A)({},e),{},{[o]:(0,Ae.A)((0,Ae.A)({},e[o]),{},{items:UP(e[o].items,i,s)})}));const e=(null!==(l=a.status)&&void 0!==l?l:"unknown").toLowerCase(),t=d[o].status.toLowerCase();e!==t&&Lz.propertyStatusChanged(e,t),P.mutate((0,Ae.A)((0,Ae.A)({},a),{},{position:s+1,status:t}))}f(null)},children:(0,tr.jsxs)(Tr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"row",alignItems:"flex-start",overflowX:"auto",overflowY:"auto",bgcolor:"background.surface",gap:2},children:[Object.values(d).length>0&&Object.values(d).every(e=>0===e.items.length)?(0,tr.jsxs)(Tr,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1.5},children:[(0,tr.jsx)(GR,{icon:(0,tr.jsx)(i_.A,{}),title:"No properties yet",description:"Run an AI Search to find and rank matching properties \u2014 they'll appear here automatically.",action:(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",component:kc,to:"/ai-search",startDecorator:(0,tr.jsx)(n_.A,{}),children:"Go to AI Search"})}),(0,tr.jsxs)(Gn,{level:"body-sm",color:"neutral",sx:{textAlign:"center",maxWidth:320},children:["Know someone looking for a home?"," ",(0,tr.jsx)(hc,{component:kc,to:"/settings",children:"Share your referral link"})," ","\u2014 you both get a month free."]})]}):Object.entries(d).map(e=>{let t=(0,s.A)(e,2),r=t[0],n=t[1];return(0,tr.jsx)($R,{id:r,list:n,boardId:y.id,aiSearchId:C},r)}),(0,tr.jsx)($P,{dropAnimation:R,children:T?(0,tr.jsx)(ta,{sx:{alignSelf:"center",padding:"auto"},children:(0,tr.jsx)(hi,{variant:"outlined",sx:{width:"280px"},children:(0,tr.jsxs)(vR,{children:[(0,tr.jsx)(Io,{ratio:"2",children:(0,tr.jsx)("img",{src:T.photos[0],srcSet:T.photos[0],loading:"lazy",alt:"",draggable:!1})}),(0,tr.jsx)(fj,{house:T})]})})}):null})]})})]}):(0,tr.jsxs)(Tr,{sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,tr.jsx)(GR,{icon:(0,tr.jsx)(o_.A,{}),title:"No boards yet",description:"Create your first board to start tracking properties, or run an AI Search to find matches automatically.",action:(0,tr.jsxs)(Tr,{sx:{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:1},children:[(0,tr.jsx)(Zz,{}),(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",component:kc,to:"/ai-search",startDecorator:(0,tr.jsx)(n_.A,{}),children:"Go to AI Search"})]})}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",sx:{mt:2,display:{xs:"none",sm:"block"}},children:'Or use the "+" in the sidebar to create a board.'})]})})}const rD=function(e){return(0,tr.jsx)(ET,(0,je.A)({},e,{defaultTheme:Ir,themeId:"$$joy"}))};const nD=function(e){const t=e.children,r=e.disableColorScheme,n=void 0!==r&&r;return(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)(rD,{styles:e=>{var t,r;const o={};n||Object.entries(e.colorSchemes).forEach(t=>{let r=(0,s.A)(t,2),n=r[0],i=r[1];var a;o[e.getColorSchemeSelector(n).replace(/\s*&/,"")]={colorScheme:null==(a=i.palette)?void 0:a.mode}});const i=null!=(t=null==(r=e.components)||null==(r=r.JoyTypography)||null==(r=r.defaultProps)?void 0:r.level)?t:"body-md";return(0,je.A)({html:{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.vars.fontWeight.lg},body:(0,je.A)({margin:0,color:e.vars.palette.text.primary,fontFamily:e.vars.fontFamily.body},e.typography[i],{backgroundColor:e.vars.palette.background.body,"@media print":{backgroundColor:e.vars.palette.common.white},"&::backdrop":{backgroundColor:e.vars.palette.background.backdrop}})},o)},defaultTheme:Ir}),t]})},oD={50:"#F0FDFA",100:"#CCFBF1",200:"#99F6E4",300:"#5EEAD4",400:"#2DD4BF",500:"#14B8A6",600:"#0D9488",700:"#0F766E",800:"#115E59",900:"#134E4A"},iD=jr({radius:{xs:"6px",sm:"8px",md:"12px",lg:"16px",xl:"20px"},typography:{h1:{letterSpacing:"-0.025em",fontWeight:700},h2:{letterSpacing:"-0.02em",fontWeight:700},h3:{letterSpacing:"-0.015em",fontWeight:700},h4:{fontWeight:700}},components:{JoyButton:{styleOverrides:{root:{fontWeight:600}}},JoyChip:{styleOverrides:{root:{fontWeight:600}}},JoyCard:{styleOverrides:{root:e=>{let t=e.ownerState;return(0,Ae.A)({},"outlined"===t.variant&&{boxShadow:"var(--joy-shadow-xs)"})}}}},colorSchemes:{light:{palette:{primary:(0,Ae.A)((0,Ae.A)({},oD),{},{solidBg:oD[600],solidHoverBg:oD[700],solidActiveBg:oD[800],solidColor:"#fff",softColor:oD[700],softBg:oD[100],softHoverBg:oD[200],softActiveBg:oD[200],plainColor:oD[700],plainHoverBg:oD[100],plainActiveBg:oD[100],outlinedColor:oD[700],outlinedBorder:oD[300],outlinedHoverBg:oD[100]})}},dark:{palette:{primary:(0,Ae.A)((0,Ae.A)({},oD),{},{solidBg:oD[600],solidHoverBg:oD[500],solidActiveBg:oD[400],solidColor:"#fff",softColor:oD[200],softBg:"color-mix(in srgb, ".concat(oD[500]," 22%, transparent)"),softHoverBg:"color-mix(in srgb, ".concat(oD[500]," 30%, transparent)"),softActiveBg:"color-mix(in srgb, ".concat(oD[500]," 30%, transparent)"),plainColor:oD[300],plainHoverBg:"color-mix(in srgb, ".concat(oD[500]," 16%, transparent)"),outlinedColor:oD[200],outlinedBorder:"color-mix(in srgb, ".concat(oD[500]," 40%, transparent)"),outlinedHoverBg:"color-mix(in srgb, ".concat(oD[500]," 16%, transparent)")})}}}});var aD,sD,lD,cD,dD,uD,hD,pD,vD,fD,mD,gD,yD=(aD=new WeakMap,class extends Ya{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),Wa(this,aD,void 0),this.config=e,Ua(aD,this,new Map)}build(e,t,r){var n;const o=t.queryKey,i=null!==(n=t.queryHash)&&void 0!==n?n:cs(o,t);let a=this.get(i);return a||(a=new hl({client:e,queryKey:o,queryHash:i,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(a)),a}add(e){$a(aD,this).has(e.queryHash)||($a(aD,this).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=$a(aD,this).get(e.queryHash);t&&(e.destroy(),t===e&&$a(aD,this).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ps.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return $a(aD,this).get(e)}getAll(){return[...$a(aD,this).values()]}find(e){const t=(0,Ae.A)({exact:!0},e);return this.getAll().find(e=>ss(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ss(e,t)):t}notify(e){Ps.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ps.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ps.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}}),bD=(sD=new WeakMap,lD=new WeakMap,cD=new WeakMap,class extends Ya{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),Wa(this,sD,void 0),Wa(this,lD,void 0),Wa(this,cD,void 0),this.config=e,Ua(sD,this,new Set),Ua(lD,this,new Map),Ua(cD,this,0)}build(e,t,r){var n;const o=new Tk({client:e,mutationCache:this,mutationId:Ua(cD,this,(n=$a(cD,this),++n)),options:e.defaultMutationOptions(t),state:r});return this.add(o),o}add(e){$a(sD,this).add(e);const t=xD(e);if("string"===typeof t){const r=$a(lD,this).get(t);r?r.push(e):$a(lD,this).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if($a(sD,this).delete(e)){const t=xD(e);if("string"===typeof t){const r=$a(lD,this).get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&$a(lD,this).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=xD(e);if("string"===typeof t){const r=$a(lD,this).get(t),n=null===r||void 0===r?void 0:r.find(e=>"pending"===e.state.status);return!n||n===e}return!0}runNext(e){const t=xD(e);if("string"===typeof t){var r,n;const o=null===(r=$a(lD,this).get(t))||void 0===r?void 0:r.find(t=>t!==e&&t.state.isPaused);return null!==(n=null===o||void 0===o?void 0:o.continue())&&void 0!==n?n:Promise.resolve()}return Promise.resolve()}clear(){Ps.batch(()=>{$a(sD,this).forEach(e=>{this.notify({type:"removed",mutation:e})}),$a(sD,this).clear(),$a(lD,this).clear()})}getAll(){return Array.from($a(sD,this))}find(e){const t=(0,Ae.A)({exact:!0},e);return this.getAll().find(e=>ls(t,e))}findAll(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.getAll().filter(t=>ls(e,t))}notify(e){Ps.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(e=>e.state.isPaused);return Ps.batch(()=>Promise.all(e.map(e=>e.continue().catch(rs))))}});function xD(e){var t;return null===(t=e.options.scope)||void 0===t?void 0:t.id}var wD=(dD=new WeakMap,uD=new WeakMap,hD=new WeakMap,pD=new WeakMap,vD=new WeakMap,fD=new WeakMap,mD=new WeakMap,gD=new WeakMap,class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Wa(this,dD,void 0),Wa(this,uD,void 0),Wa(this,hD,void 0),Wa(this,pD,void 0),Wa(this,vD,void 0),Wa(this,fD,void 0),Wa(this,mD,void 0),Wa(this,gD,void 0),Ua(dD,this,e.queryCache||new yD),Ua(uD,this,e.mutationCache||new bD),Ua(hD,this,e.defaultOptions||{}),Ua(pD,this,new Map),Ua(vD,this,new Map),Ua(fD,this,0)}mount(){var e;Ua(fD,this,(e=$a(fD,this),e++,e)),1===$a(fD,this)&&(Ua(mD,this,Xa.subscribe(async e=>{e&&(await this.resumePausedMutations(),$a(dD,this).onFocus())})),Ua(gD,this,Rs.subscribe(async e=>{e&&(await this.resumePausedMutations(),$a(dD,this).onOnline())})))}unmount(){var e,t,r;Ua(fD,this,(e=$a(fD,this),e--,e)),0===$a(fD,this)&&(null===(t=$a(mD,this))||void 0===t||t.call(this),Ua(mD,this,void 0),null===(r=$a(gD,this))||void 0===r||r.call(this),Ua(gD,this,void 0))}isFetching(e){return $a(dD,this).findAll((0,Ae.A)((0,Ae.A)({},e),{},{fetchStatus:"fetching"})).length}isMutating(e){return $a(uD,this).findAll((0,Ae.A)((0,Ae.A)({},e),{},{status:"pending"})).length}getQueryData(e){var t;const r=this.defaultQueryOptions({queryKey:e});return null===(t=$a(dD,this).get(r.queryHash))||void 0===t?void 0:t.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=$a(dD,this).build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(is(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return $a(dD,this).findAll(e).map(e=>[e.queryKey,e.state.data])}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=$a(dD,this).get(n.queryHash),i=function(e,t){return"function"===typeof e?e(t):e}(t,null===o||void 0===o?void 0:o.state.data);if(void 0!==i)return $a(dD,this).build(this,n).setData(i,(0,Ae.A)((0,Ae.A)({},r),{},{manual:!0}))}setQueriesData(e,t,r){return Ps.batch(()=>$a(dD,this).findAll(e).map(e=>{let n=e.queryKey;return[n,this.setQueryData(n,t,r)]}))}getQueryState(e){var t;const r=this.defaultQueryOptions({queryKey:e});return null===(t=$a(dD,this).get(r.queryHash))||void 0===t?void 0:t.state}removeQueries(e){const t=$a(dD,this);Ps.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){const r=$a(dD,this);return Ps.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries((0,Ae.A)({type:"active"},e),t)))}cancelQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,Ae.A)({revert:!0},t),n=Ps.batch(()=>$a(dD,this).findAll(e).map(e=>e.cancel(r)));return Promise.all(n).then(rs).catch(rs)}invalidateQueries(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ps.batch(()=>{var r,n;return $a(dD,this).findAll(e).forEach(e=>{e.invalidate()}),"none"===(null===e||void 0===e?void 0:e.refetchType)?Promise.resolve():this.refetchQueries((0,Ae.A)((0,Ae.A)({},e),{},{type:null!==(r=null!==(n=null===e||void 0===e?void 0:e.refetchType)&&void 0!==n?n:null===e||void 0===e?void 0:e.type)&&void 0!==r?r:"active"}),t)})}refetchQueries(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=(0,Ae.A)((0,Ae.A)({},r),{},{cancelRefetch:null===(t=r.cancelRefetch)||void 0===t||t}),o=Ps.batch(()=>$a(dD,this).findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(rs)),"paused"===e.state.fetchStatus?Promise.resolve():t}));return Promise.all(o).then(rs)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=$a(dD,this).build(this,t);return r.isStaleByTime(is(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(rs).catch(rs)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(rs).catch(rs)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Rs.isOnline()?$a(uD,this).resumePausedMutations():Promise.resolve()}getQueryCache(){return $a(dD,this)}getMutationCache(){return $a(uD,this)}getDefaultOptions(){return $a(hD,this)}setDefaultOptions(e){Ua(hD,this,e)}setQueryDefaults(e,t){$a(pD,this).set(ds(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$a(pD,this).values()],r={};return t.forEach(t=>{us(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){$a(vD,this).set(ds(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$a(vD,this).values()],r={};return t.forEach(t=>{us(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t=(0,Ae.A)((0,Ae.A)((0,Ae.A)((0,Ae.A)({},$a(hD,this).queries),this.getQueryDefaults(e.queryKey)),e),{},{_defaulted:!0});return t.queryHash||(t.queryHash=cs(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ws&&(t.enabled=!1),t}defaultMutationOptions(e){return null!==e&&void 0!==e&&e._defaulted?e:(0,Ae.A)((0,Ae.A)((0,Ae.A)((0,Ae.A)({},$a(hD,this).mutations),(null===e||void 0===e?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey)),e),{},{_defaulted:!0})}clear(){$a(dD,this).clear(),$a(uD,this).clear()}});function SD(e){return yr("MuiBreadcrumbs",e)}br("MuiBreadcrumbs",["root","ol","li","separator","sizeSm","sizeMd","sizeLg"]);const kD=["children","className","size","separator","component","slots","slotProps"],_D=Qr("nav",{name:"JoyBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({},"sm"===r.size&&{"--Icon-fontSize":t.vars.fontSize.lg,gap:"var(--Breadcrumbs-gap, 0.25rem)",padding:"0.5rem"},"md"===r.size&&{"--Icon-fontSize":t.vars.fontSize.xl,gap:"var(--Breadcrumbs-gap, 0.375rem)",padding:"0.75rem"},"lg"===r.size&&{"--Icon-fontSize":t.vars.fontSize.xl2,gap:"var(--Breadcrumbs-gap, 0.5rem)",padding:"1rem"},t.typography["body-".concat(r.size)])}),CD=Qr("ol",{name:"JoyBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",gap:"inherit",padding:0,margin:0,listStyle:"none"}),AD=Qr("li",{name:"JoyBreadcrumbs",slot:"Li",overridesResolver:(e,t)=>t.li})({display:"flex",alignItems:"center"}),jD=Qr("li",{name:"JoyBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none"}),ID=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyBreadcrumbs"}),n=r.children,i=r.className,a=r.size,l=void 0===a?"md":a,c=r.separator,d=void 0===c?"/":c,u=r.component,h=r.slots,p=void 0===h?{}:h,v=r.slotProps,f=void 0===v?{}:v,m=(0,Ie.A)(r,kD),g=(0,je.A)({},r,{separator:d,size:l}),y=(e=>{const t=e.size;return Dr({root:["root",t&&"size".concat(Le(t))],li:["li"],ol:["ol"],separator:["separator"]},SD,{})})(g),b=(0,je.A)({},m,{component:u,slots:p,slotProps:f}),x=pn("root",{ref:t,className:(0,Pe.A)(y.root,i),elementType:_D,externalForwardedProps:b,ownerState:g}),w=(0,s.A)(x,2),S=w[0],k=w[1],_=pn("ol",{className:y.ol,elementType:CD,externalForwardedProps:b,ownerState:g}),C=(0,s.A)(_,2),A=C[0],j=C[1],I=pn("li",{className:y.li,elementType:AD,externalForwardedProps:b,ownerState:g}),P=(0,s.A)(I,2),R=P[0],T=P[1],E=pn("separator",{additionalProps:{"aria-hidden":!0},className:y.separator,elementType:jD,externalForwardedProps:b,ownerState:g}),z=(0,s.A)(E,2),D=z[0],M=z[1],L=o.Children.toArray(n).filter(e=>o.isValidElement(e)).map((e,t)=>{var r;return(0,tr.jsx)(R,(0,je.A)({},T,{children:Ln(e,["Typography"])?o.cloneElement(e,{component:null!=(r=e.props.component)?r:"span"}):e}),"child-".concat(t))});return(0,tr.jsx)(Wn.Provider,{value:!0,children:(0,tr.jsx)(S,(0,je.A)({},k,{children:(0,tr.jsx)(A,(0,je.A)({},j,{children:L.reduce((e,t,r)=>(r({getItemIndex:i,registerItem:l,totalSubitemCount:u}),[l,i,u]),m=o.useMemo(()=>({direction:n,getTabId:p,getTabPanelId:v,onSelected:a,orientation:s,registerTabIdLookup:c,selectionFollowsFocus:d,value:h}),[n,p,v,a,s,c,d,h]);return(0,tr.jsx)(ku.Provider,{value:f,children:(0,tr.jsx)(PD.Provider,{value:m,children:r})})}const ED=o.createContext("md");function zD(e){return xr("MuiTabs",e)}wr("MuiTabs",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const DD=["children","value","defaultValue","orientation","direction","component","onChange","selectionFollowsFocus","variant","color","size","slots","slotProps"],MD=Qr("div",{name:"JoyTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o;const i=null==(n=r.variants[t.variant])?void 0:n[t.color],a=si({theme:r,ownerState:t},["bgcolor","backgroundColor","background","p","padding"]),s=a.bgcolor,l=a.backgroundColor,c=a.background,d=a.p,u=a.padding,h=Ke(r,"palette.".concat(s))||s||Ke(r,"palette.".concat(l))||l||c||(null==i?void 0:i.backgroundColor)||(null==i?void 0:i.background)||r.vars.palette.background.surface;return(0,je.A)({},"sm"===t.size&&{"--Tabs-spacing":"0.75rem"},"md"===t.size&&{"--Tabs-spacing":"1rem"},"lg"===t.size&&{"--Tabs-spacing":"1.25rem"},{"--Tab-indicatorThickness":"2px","--Icon-color":"neutral"!==t.color||"solid"===t.variant?"currentColor":r.vars.palette.text.icon,"--TabList-stickyBackground":"transparent"===h?"initial":h,display:"flex",flexDirection:"column"},"vertical"===t.orientation&&{flexDirection:"row"},{backgroundColor:r.vars.palette.background.surface,position:"relative"},r.typography["body-".concat(t.size)],null==(o=r.variants[t.variant])?void 0:o[t.color],void 0!==d&&{"--Tabs-padding":d},void 0!==u&&{"--Tabs-padding":u})}),LD=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyTabs"}),n=r.children,i=r.value,a=r.defaultValue,l=r.orientation,c=void 0===l?"horizontal":l,d=r.direction,u=void 0===d?"ltr":d,h=r.component,p=r.variant,v=void 0===p?"plain":p,f=r.color,m=void 0===f?"neutral":f,g=r.size,y=void 0===g?"md":g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,DD),_=a||(void 0===i?0:void 0),C=function(e){const t=e.value,r=e.defaultValue,n=e.onChange,i=e.orientation,a=void 0===i?"horizontal":i,l=e.direction,c=void 0===l?"ltr":l,d=e.selectionFollowsFocus,u=void 0!==d&&d,h=KC({controlled:t,default:r,name:"Tabs",state:"value"}),p=(0,s.A)(h,2),v=p[0],f=p[1],m=o.useCallback((e,t)=>{f(t),null==n||n(e,t)},[n,f]),g=_u(),y=g.subitems,b=g.contextValue,x=o.useRef(()=>{}),w=o.useCallback(e=>{var t;return null==(t=y.get(e))?void 0:t.id},[y]),S=o.useCallback(e=>x.current(e),[]),k=o.useCallback(e=>{x.current=e},[]);return{contextValue:(0,je.A)({direction:c,getTabId:S,getTabPanelId:w,onSelected:m,orientation:a,registerTabIdLookup:k,selectionFollowsFocus:u,value:v},b)}}((0,je.A)({},r,{orientation:c,defaultValue:_})),A=C.contextValue,j=(0,je.A)({},r,{orientation:c,direction:u,variant:v,color:m,size:y}),I=(e=>{const t=e.orientation,r=e.variant,n=e.color,o=e.size;return Dr({root:["root",t,r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),o&&"size".concat(Le(o))]},zD,{})})(j),P=(0,je.A)({},k,{component:h,slots:x,slotProps:S}),R=pn("root",{ref:t,elementType:MD,externalForwardedProps:P,additionalProps:{ref:t,as:h},ownerState:j,className:I.root}),T=(0,s.A)(R,2),E=T[0],z=T[1];return(0,tr.jsx)(E,(0,je.A)({},z,{children:(0,tr.jsx)(TD,{value:A,children:(0,tr.jsx)(ED.Provider,{value:y,children:n})})}))}),OD=LD,FD="valueChange";function ND(e,t){if(t.type===FD)return(0,je.A)({},e,{highlightedValue:t.value});const r=pu(e,t),n=t.context.selectionFollowsFocus;if(t.type===ou){if(r.selectedValues.length>0)return(0,je.A)({},r,{highlightedValue:r.selectedValues[0]});du(null,"reset",t.context)}return n&&null!=r.highlightedValue?(0,je.A)({},r,{selectedValues:[r.highlightedValue]}):r}function BD(e){const t=e.value,r=e.children,n=t.dispatch,i=t.getItemIndex,a=t.getItemState,s=t.registerItem,l=t.totalSubitemCount,c=o.useMemo(()=>({dispatch:n,getItemState:a,getItemIndex:i}),[n,i,a]),d=o.useMemo(()=>({getItemIndex:i,registerItem:s,totalSubitemCount:l}),[s,i,l]);return(0,tr.jsx)(ku.Provider,{value:d,children:(0,tr.jsx)(Au.Provider,{value:c,children:r})})}function HD(e){return xr("MuiTabList",e)}wr("MuiTabList",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);function WD(e){return xr("MuiTab",e)}const VD=wr("MuiTab",["root","disabled","focusVisible","selected","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),$D=["component","children","variant","color","size","disableUnderline","underlinePlacement","tabFlex","sticky","slots","slotProps"],UD=Qr(Wi,{name:"JoyTabList",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;const o=null==(n=t.variants[r.variant])?void 0:n[r.color];return(0,je.A)({"--List-gap":"0px","--ListDivider-gap":"0px","--ListItem-paddingX":"var(--Tabs-spacing)","--ListItem-gap":"0.375rem","--unstable_TabList-hasUnderline":r.disableUnderline?"var(--unknown,)":"initial"},Fi,{flexGrow:"initial",flexDirection:"vertical"===r.orientation?"column":"row",borderRadius:"var(--List-radius, 0px)",padding:"var(--List-padding, 0px)",zIndex:1},r.sticky&&{position:"sticky",top:"top"===r.sticky?"calc(-1 * var(--Tabs-padding, 0px))":"initial",bottom:"bottom"===r.sticky?"calc(-1 * var(--Tabs-padding, 0px))":"initial",backgroundColor:(null==o?void 0:o.backgroundColor)||"var(--TabList-stickyBackground, ".concat(t.vars.palette.background.body,")")},!r.disableUnderline&&(0,je.A)({},"bottom"===r.underlinePlacement&&{"--unstable_TabList-underlineBottom":"1px",paddingBottom:1,boxShadow:"inset 0 -1px ".concat(t.vars.palette.divider)},"top"===r.underlinePlacement&&{"--unstable_TabList-underlineTop":"1px",paddingTop:1,boxShadow:"inset 0 1px ".concat(t.vars.palette.divider)},"right"===r.underlinePlacement&&{"--unstable_TabList-underlineRight":"1px",paddingRight:1,boxShadow:"inset -1px 0 ".concat(t.vars.palette.divider)},"left"===r.underlinePlacement&&{"--unstable_TabList-underlineLeft":"1px",paddingLeft:1,boxShadow:"inset 1px 0 ".concat(t.vars.palette.divider)}),r.tabFlex&&{["& .".concat(VD.root)]:{flex:r.tabFlex}})}),qD=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyTabList"}),n=o.useContext(ED),i=function(e){var t;const r=e.rootRef,n=RD(),i=n.direction,a=void 0===i?"ltr":i,s=n.onSelected,l=n.orientation,c=void 0===l?"horizontal":l,d=n.value,u=n.registerTabIdLookup,h=n.selectionFollowsFocus,p=_u(),v=p.subitems,f=p.contextValue;u(o.useCallback(e=>{var t;return null==(t=v.get(e))?void 0:t.id},[v]));const m=o.useMemo(()=>Array.from(v.keys()),[v]),g=o.useCallback(e=>{var t,r;return null==e?null:null!=(t=null==(r=v.get(e))?void 0:r.ref.current)?t:null},[v]),y="rtl"===a;let b;b="vertical"===c?"vertical":y?"horizontal-rtl":"horizontal-ltr";const x=o.useCallback((e,t)=>{var r;s(e,null!=(r=t[0])?r:null)},[s]),w=o.useMemo(()=>void 0===d?{}:null!=d?{selectedValues:[d]}:{selectedValues:[]},[d]),S=o.useCallback(e=>{var t,r;return null!=(t=null==(r=v.get(e))?void 0:r.disabled)&&t},[v]),k=Su({controlledProps:w,disabledItemsFocusable:!h,focusManagement:"DOM",getItemDomElement:g,isItemDisabled:S,items:m,rootRef:r,onChange:x,orientation:b,reducerActionContext:o.useMemo(()=>({selectionFollowsFocus:h||!1}),[h]),selectionMode:"single",stateReducer:ND}),_=k.contextValue,C=k.dispatch,A=k.getRootProps,j=k.state,I=j.highlightedValue,P=j.selectedValues,R=k.rootRef;return o.useEffect(()=>{void 0!==d&&null!=d&&C({type:FD,value:d})},[C,d]),{contextValue:o.useMemo(()=>(0,je.A)({},f,_),[f,_]),dispatch:C,getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({},e,A(e),{"aria-orientation":"vertical"===c?"vertical":void 0,role:"tablist"})},highlightedValue:I,isRtl:y,orientation:c,rootRef:R,selectedValue:null!=(t=P[0])?t:null}}({rootRef:t}),a=i.isRtl,l=i.orientation,c=i.getRootProps,d=i.contextValue,u=r.component,h=void 0===u?"div":u,p=r.children,v=r.variant,f=void 0===v?"plain":v,m=r.color,g=void 0===m?"neutral":m,y=r.size,b=r.disableUnderline,x=void 0!==b&&b,w=r.underlinePlacement,S=void 0===w?"horizontal"===l?"bottom":"right":w,k=r.tabFlex,_=r.sticky,C=r.slots,A=void 0===C?{}:C,j=r.slotProps,I=void 0===j?{}:j,P=(0,Ie.A)(r,$D),R=null!=y?y:n,T=(0,je.A)({},r,{isRtl:a,orientation:l,variant:f,color:g,size:R,sticky:_,tabFlex:k,nesting:!1,disableUnderline:x,underlinePlacement:S}),E=(e=>{const t=e.orientation,r=e.size,n=e.variant,o=e.color;return Dr({root:["root",t,n&&"variant".concat(Le(n)),o&&"color".concat(Le(o)),r&&"size".concat(Le(r))]},HD,{})})(T),z=(0,je.A)({},P,{component:h,slots:A,slotProps:I}),D=pn("root",{ref:t,elementType:UD,getSlotProps:c,externalForwardedProps:z,ownerState:T,className:E.root}),M=(0,s.A)(D,2),L=M[0],O=M[1];return(0,tr.jsx)(L,(0,je.A)({},O,{children:(0,tr.jsx)(BD,{value:d,children:(0,tr.jsx)(Ni,{row:"horizontal"===l,nested:!0,children:p})})}))}),KD=qD;function GD(e){return e.size}const JD=["action","children","value","disabled","onChange","onClick","onFocus","component","orientation","variant","color","disableIndicator","indicatorPlacement","indicatorInset","slots","slotProps"],QD=Qr(xp,{name:"JoyTab",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState;return[{flex:"initial",justifyContent:t.row?"center":"initial","--unstable_ListItemDecorator-alignItems":"center","--unstable_offset":"min(calc(-1 * var(--variant-borderWidth, 0px)), -1px)"},!t.disableIndicator&&{'&[aria-selected="true"]':{"--Tab-indicatorColor":"currentColor",zIndex:1},"&::after":{content:'""',display:"block",position:"absolute",margin:"auto",background:"var(--Tab-indicatorColor)",borderRadius:"var(--Tab-indicatorRadius)"}},!t.disableIndicator&&"bottom"===t.indicatorPlacement&&{paddingBottom:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:t.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:t.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",bottom:"calc(-1px - var(--unstable_TabList-underlineBottom, 0px))"}},!t.disableIndicator&&"top"===t.indicatorPlacement&&{paddingTop:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:t.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:t.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",top:"calc(-1px - var(--unstable_TabList-underlineTop, 0px))"}},!t.disableIndicator&&"right"===t.indicatorPlacement&&{paddingRight:"calc(var(--ListItem-paddingRight) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:t.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:t.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",right:"calc(-1px - var(--unstable_TabList-underlineRight, 0px))"}},!t.disableIndicator&&"left"===t.indicatorPlacement&&{paddingLeft:"calc(var(--ListItem-paddingLeft) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:t.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:t.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",left:"calc(-1px - var(--unstable_TabList-underlineLeft, 0px))"}}]}),YD=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyTab"}),n=o.useContext(Li),i=r.action,a=r.children,l=r.disabled,c=void 0!==l&&l,d=r.component,u=void 0===d?"button":d,h=r.orientation,p=void 0===h?"horizontal":h,v=r.variant,f=void 0===v?"plain":v,m=r.color,g=void 0===m?"neutral":m,y=r.disableIndicator,b=void 0!==y&&y,x=r.indicatorPlacement,w=void 0===x?n?"bottom":"right":x,S=r.indicatorInset,k=void 0!==S&&S,_=r.slots,C=void 0===_?{}:_,A=r.slotProps,j=void 0===A?{}:A,I=(0,Ie.A)(r,JD),P=o.useRef(null),R=rn(P,t),T=function(e){const t=e.value,r=e.rootRef,n=e.disabled,i=void 0!==n&&n,a=e.id,s=o.useRef(null),l=gi(a),c=RD(),d=c.value,u=c.selectionFollowsFocus,h=c.getTabPanelId,p=vp(null!=t?t:GD,o.useMemo(()=>({disabled:i,ref:s,id:l}),[i,s,l])),v=p.id,f=p.index,m=p.totalItemCount,g=pp({item:v}),y=g.getRootProps,b=g.highlighted,x=g.selected,w=lo({disabled:i,focusableWhenDisabled:!u,type:"button"}),S=w.getRootProps,k=w.rootRef,_=w.active,C=w.focusVisible,A=w.setFocusVisible,j=rn(s,r,k),I=void 0!==v?h(v):void 0;return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(y,S);return(0,je.A)({},e,r(t),{role:"tab","aria-controls":I,"aria-selected":x,id:l,ref:j})},active:_,focusVisible:C,highlighted:b,index:f,rootRef:j,selected:x||v===d,setFocusVisible:A,totalTabsCount:m}}((0,je.A)({},r,{rootRef:R})),E=T.active,z=T.focusVisible,D=T.setFocusVisible,M=T.selected,L=T.getRootProps;o.useImperativeHandle(i,()=>({focusVisible:()=>{D(!0),P.current.focus()}}),[D]);const O=(0,je.A)({},r,{disableIndicator:b,indicatorPlacement:w,indicatorInset:k,orientation:p,row:n,active:E,focusVisible:z,disabled:c,selected:M,variant:f,color:g}),F=(e=>{const t=e.selected,r=e.disabled,n=e.focusVisible,o=e.variant,i=e.color;return Dr({root:["root",e.orientation,r&&"disabled",n&&"focusVisible",t&&"selected",o&&"variant".concat(Le(o)),i&&"color".concat(Le(i))]},WD,{})})(O),N=(0,je.A)({},I,{component:u,slots:C,slotProps:j}),B=pn("root",{ref:t,elementType:QD,getSlotProps:L,externalForwardedProps:N,ownerState:O,className:F.root}),H=(0,s.A)(B,2),W=H[0],V=H[1];return(0,tr.jsx)(na.Provider,{value:p,children:(0,tr.jsx)(W,(0,je.A)({},V,{children:a}))})}),XD=YD;function ZD(e){return e.size}function eM(e){return xr("MuiTabPanel",e)}wr("MuiTabPanel",["root","hidden","sizeSm","sizeMd","sizeLg","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const tM=["children","value","component","color","variant","size","slots","slotProps","keepMounted"],rM=Qr("div",{name:"JoyTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;return(0,je.A)({display:r.hidden?"none":"block",padding:"var(--Tabs-spacing)",flexGrow:1,fontFamily:t.vars.fontFamily.body},t.typography["body-".concat(r.size)],null==(n=t.variants[r.variant])?void 0:n[r.color])}),nM=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyTabPanel"}),n=(RD()||{orientation:"horizontal"}).orientation,i=o.useContext(ED),a=r.children,l=r.value,c=void 0===l?0:l,d=r.component,u=r.color,h=void 0===u?"neutral":u,p=r.variant,v=void 0===p?"plain":p,f=r.size,m=r.slots,g=void 0===m?{}:m,y=r.slotProps,b=void 0===y?{}:y,x=r.keepMounted,w=void 0!==x&&x,S=(0,Ie.A)(r,tM),k=function(e){const t=e.value,r=e.id,n=e.rootRef,i=RD();if(null===i)throw new Error("No TabContext provided");const a=i.value,s=i.getTabId,l=gi(r),c=o.useRef(null),d=rn(c,n),u=vp(null!=t?t:ZD,o.useMemo(()=>({id:l,ref:c}),[l])).id,h=u!==a,p=void 0!==u?s(u):void 0;return{hidden:h,getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({"aria-labelledby":null!=p?p:void 0,hidden:h,id:null!=l?l:void 0},e,{ref:d})},rootRef:d}}((0,je.A)({},r,{value:c})),_=k.hidden,C=k.getRootProps,A=null!=f?f:i,j=(0,je.A)({},r,{orientation:n,hidden:_,size:A,color:h,variant:v}),I=(e=>{const t=e.hidden,r=e.size,n=e.variant,o=e.color,i=e.orientation;return Dr({root:["root",t&&"hidden",r&&"size".concat(Le(r)),i,n&&"variant".concat(Le(n)),o&&"color".concat(Le(o)),r&&"size".concat(Le(r))]},eM,{})})(j),P=(0,je.A)({},S,{component:d,slots:g,slotProps:b}),R=pn("root",{ref:t,elementType:rM,getSlotProps:C,externalForwardedProps:P,additionalProps:{role:"tabpanel",ref:t,as:d},ownerState:j,className:I.root}),T=(0,s.A)(R,2),E=T[0],z=T[1];return w?(0,tr.jsx)(E,(0,je.A)({},z,{children:a})):(0,tr.jsx)(E,(0,je.A)({},z,{children:!_&&a}))}),oM=nM,iM=(e,t,r)=>{const n=e.keys[0];if(Array.isArray(t))t.forEach((t,n)=>{r((t,r)=>{n<=e.keys.length-1&&(0===n?Object.assign(t,r):t[e.up(e.keys[n])]=r)},t)});else if(t&&"object"===typeof t){const a=Object.keys(t).length>e.keys.length?e.keys:(o=e.keys,i=Object.keys(t),o.filter(e=>i.includes(e)));a.forEach(o=>{if(-1!==e.keys.indexOf(o)){const i=t[o];void 0!==i&&r((t,r)=>{n===o?Object.assign(t,r):t[e.up(o)]=r},i)}})}else"number"!==typeof t&&"string"!==typeof t||r((e,t)=>{Object.assign(e,t)},t);var o,i};function aM(e){return e?"Level".concat(e):""}function sM(e){return e.unstable_level>0&&e.container}function lM(e){return function(t){return"var(--Grid-".concat(t,"Spacing").concat(aM(e.unstable_level),")")}}function cM(e){return function(t){return 0===e.unstable_level?"var(--Grid-".concat(t,"Spacing)"):"var(--Grid-".concat(t,"Spacing").concat(aM(e.unstable_level-1),")")}}function dM(e){return 0===e.unstable_level?"var(--Grid-columns)":"var(--Grid-columns".concat(aM(e.unstable_level-1),")")}const uM=e=>{let t=e.theme,r=e.ownerState;const n=lM(r),o={};return iM(t.breakpoints,r.gridSize,(e,t)=>{let i={};!0===t&&(i={flexBasis:0,flexGrow:1,maxWidth:"100%"}),"auto"===t&&(i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),"number"===typeof t&&(i={flexGrow:0,flexBasis:"auto",width:"calc(100% * ".concat(t," / ").concat(dM(r)).concat(sM(r)?" + ".concat(n("column")):"",")")}),e(o,i)}),o},hM=e=>{let t=e.theme,r=e.ownerState;const n={};return iM(t.breakpoints,r.gridOffset,(e,t)=>{let o={};"auto"===t&&(o={marginLeft:"auto"}),"number"===typeof t&&(o={marginLeft:0===t?"0px":"calc(100% * ".concat(t," / ").concat(dM(r),")")}),e(n,o)}),n},pM=e=>{let t=e.theme,r=e.ownerState;if(!r.container)return{};const n=sM(r)?{["--Grid-columns".concat(aM(r.unstable_level))]:dM(r)}:{"--Grid-columns":12};return iM(t.breakpoints,r.columns,(e,t)=>{e(n,{["--Grid-columns".concat(aM(r.unstable_level))]:t})}),n},vM=e=>{let t=e.theme,r=e.ownerState;if(!r.container)return{};const n=cM(r),o=sM(r)?{["--Grid-rowSpacing".concat(aM(r.unstable_level))]:n("row")}:{};return iM(t.breakpoints,r.rowSpacing,(e,n)=>{var i;e(o,{["--Grid-rowSpacing".concat(aM(r.unstable_level))]:"string"===typeof n?n:null==(i=t.spacing)?void 0:i.call(t,n)})}),o},fM=e=>{let t=e.theme,r=e.ownerState;if(!r.container)return{};const n=cM(r),o=sM(r)?{["--Grid-columnSpacing".concat(aM(r.unstable_level))]:n("column")}:{};return iM(t.breakpoints,r.columnSpacing,(e,n)=>{var i;e(o,{["--Grid-columnSpacing".concat(aM(r.unstable_level))]:"string"===typeof n?n:null==(i=t.spacing)?void 0:i.call(t,n)})}),o},mM=e=>{let t=e.theme,r=e.ownerState;if(!r.container)return{};const n={};return iM(t.breakpoints,r.direction,(e,t)=>{e(n,{flexDirection:t})}),n},gM=e=>{let t=e.ownerState;const r=lM(t),n=cM(t);return(0,je.A)({minWidth:0,boxSizing:"border-box"},t.container&&(0,je.A)({display:"flex",flexWrap:"wrap"},t.wrap&&"wrap"!==t.wrap&&{flexWrap:t.wrap},{margin:"calc(".concat(r("row")," / -2) calc(").concat(r("column")," / -2)")},t.disableEqualOverflow&&{margin:"calc(".concat(r("row")," * -1) 0px 0px calc(").concat(r("column")," * -1)")}),(!t.container||sM(t))&&(0,je.A)({padding:"calc(".concat(n("row")," / 2) calc(").concat(n("column")," / 2)")},(t.disableEqualOverflow||t.parentDisableEqualOverflow)&&{padding:"".concat(n("row")," 0px 0px ").concat(n("column"))}))},yM=e=>{const t=[];return Object.entries(e).forEach(e=>{let r=(0,s.A)(e,2),n=r[0],o=r[1];!1!==o&&void 0!==o&&t.push("grid-".concat(n,"-").concat(String(o)))}),t},bM=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"xs";function r(e){return void 0!==e&&("string"===typeof e&&!Number.isNaN(Number(e))||"number"===typeof e&&e>0)}if(r(e))return["spacing-".concat(t,"-").concat(String(e))];if("object"===typeof e&&!Array.isArray(e)){const t=[];return Object.entries(e).forEach(e=>{let n=(0,s.A)(e,2),o=n[0],i=n[1];r(i)&&t.push("spacing-".concat(o,"-").concat(String(i)))}),t}return[]},xM=e=>void 0===e?[]:"object"===typeof e?Object.entries(e).map(e=>{let t=(0,s.A)(e,2),r=t[0],n=t[1];return"direction-".concat(r,"-").concat(n)}):["direction-xs-".concat(String(e))],wM=["className","children","columns","container","component","direction","wrap","spacing","rowSpacing","columnSpacing","disableEqualOverflow","unstable_level"],SM=Qt(),kM=jn("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>t.root});function _M(e){return Zr({props:e,name:"MuiGrid",defaultTheme:SM})}const CM=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.createStyledComponent,r=void 0===t?kM:t,n=e.useThemeProps,i=void 0===n?_M:n,a=e.componentName,l=void 0===a?"MuiGrid":a,c=o.createContext(void 0),d=r(pM,fM,vM,uM,mM,gM,hM),u=o.forwardRef(function(e,t){var r,n,a,u,h,p,v,f;const m=er(),g=Vt(i(e)),y=o.useContext(c),b=g.className,x=g.children,w=g.columns,S=void 0===w?12:w,k=g.container,_=void 0!==k&&k,C=g.component,A=void 0===C?"div":C,j=g.direction,I=void 0===j?"row":j,P=g.wrap,R=void 0===P?"wrap":P,T=g.spacing,E=void 0===T?0:T,z=g.rowSpacing,D=void 0===z?E:z,M=g.columnSpacing,L=void 0===M?E:M,O=g.disableEqualOverflow,F=g.unstable_level,N=void 0===F?0:F,B=(0,Ie.A)(g,wM);let H=O;N&&void 0!==O&&(H=e.disableEqualOverflow);const W={},V={},$={};Object.entries(B).forEach(e=>{let t=(0,s.A)(e,2),r=t[0],n=t[1];void 0!==m.breakpoints.values[r]?W[r]=n:void 0!==m.breakpoints.values[r.replace("Offset","")]?V[r.replace("Offset","")]=n:$[r]=n});const U=null!=(r=e.columns)?r:N?void 0:S,q=null!=(n=e.spacing)?n:N?void 0:E,K=null!=(a=null!=(u=e.rowSpacing)?u:e.spacing)?a:N?void 0:D,G=null!=(h=null!=(p=e.columnSpacing)?p:e.spacing)?h:N?void 0:L,J=(0,je.A)({},g,{level:N,columns:U,container:_,direction:I,wrap:R,spacing:q,rowSpacing:K,columnSpacing:G,gridSize:W,gridOffset:V,disableEqualOverflow:null!=(v=null!=(f=H)?f:y)&&v,parentDisableEqualOverflow:y}),Q=((e,t)=>{const r=e.container,n=e.direction,o=e.spacing,i=e.wrap,a=e.gridSize;return Dr({root:["root",r&&"container","wrap"!==i&&"wrap-xs-".concat(String(i)),...xM(n),...yM(a),...r?bM(o,t.breakpoints.keys[0]):[]]},e=>yr(l,e),{})})(J,m);let Y=(0,tr.jsx)(d,(0,je.A)({ref:t,as:A,ownerState:J,className:(0,Pe.A)(Q.root,b)},$,{children:o.Children.map(x,e=>{var t,r;return o.isValidElement(e)&&Ln(e,["Grid"])?o.cloneElement(e,{unstable_level:null!=(t=null==(r=e.props)?void 0:r.unstable_level)?t:N+1}):e})}));return void 0!==H&&H!==(null!=y&&y)&&(Y=(0,tr.jsx)(c.Provider,{value:H,children:Y})),Y});return u.muiName="Grid",u}({createStyledComponent:Qr("div",{name:"JoyGrid",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>en({props:e,name:"JoyGrid"})}),AM=CM;var jM=r(6670);const IM=e=>{const t=Ma().getIdToken;return ql({queryKey:["getHouse",e],queryFn:async()=>{const r=await t();if(!r)return null;const n=await fetch("".concat(IW,"/api/house/").concat(e),{headers:{Authorization:r}});return n.ok?await n.json():null},enabled:!!e})};const PM=["onChange","maxRows","minRows","style","value"];function RM(e){return parseInt(e,10)||0}const TM={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};const EM=o.forwardRef(function(e,t){const r=e.onChange,n=e.maxRows,i=e.minRows,a=void 0===i?1:i,s=e.style,l=e.value,c=(0,Ie.A)(e,PM),d=o.useRef(null!=l).current,u=o.useRef(null),h=rn(t,u),p=o.useRef(null),v=o.useRef(null),f=o.useCallback(()=>{const t=u.current,r=w_(t).getComputedStyle(t);if("0px"===r.width)return{outerHeightStyle:0,overflowing:!1};const o=v.current;o.style.width=r.width,o.value=t.value||e.placeholder||"x","\n"===o.value.slice(-1)&&(o.value+=" ");const i=r.boxSizing,s=RM(r.paddingBottom)+RM(r.paddingTop),l=RM(r.borderBottomWidth)+RM(r.borderTopWidth),c=o.scrollHeight;o.value="x";const d=o.scrollHeight;let h=c;a&&(h=Math.max(Number(a)*d,h)),n&&(h=Math.min(Number(n)*d,h)),h=Math.max(h,d);return{outerHeightStyle:h+("border-box"===i?s+l:0),overflowing:Math.abs(h-c)<=1}},[n,a,e.placeholder]),m=o.useCallback(()=>{const e=f();if(void 0===(t=e)||null===t||0===Object.keys(t).length||0===t.outerHeightStyle&&!t.overflowing)return;var t;const r=e.outerHeightStyle,n=u.current;p.current!==r&&(p.current=r,n.style.height="".concat(r,"px")),n.style.overflow=e.overflowing?"hidden":""},[f]);eu(()=>{const e=()=>{m()};let t;const r=function(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),i=0;i{e.apply(this,o)},r)}return n.clear=()=>{clearTimeout(t)},n}(e),n=u.current,o=w_(n);let i;return o.addEventListener("resize",r),"undefined"!==typeof ResizeObserver&&(i=new ResizeObserver(e),i.observe(n)),()=>{r.clear(),cancelAnimationFrame(t),o.removeEventListener("resize",r),i&&i.disconnect()}},[f,m]),eu(()=>{m()});return(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)("textarea",(0,je.A)({value:l,onChange:e=>{d||m(),r&&r(e)},ref:h,rows:a,style:s},c)),(0,tr.jsx)("textarea",{"aria-hidden":!0,className:e.className,readOnly:!0,ref:v,tabIndex:-1,style:(0,je.A)({},TM,s,{paddingTop:0,paddingBottom:0})})]})});function zM(e){return xr("MuiTextarea",e)}const DM=wr("MuiTextarea",["root","textarea","startDecorator","endDecorator","formControl","disabled","error","focused","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft"]),MM=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","size","color","variant","startDecorator","endDecorator","minRows","maxRows","component","slots","slotProps"],LM=Qr("div",{name:"JoyTextarea",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l;const c=null==(n=t.variants["".concat(r.variant)])?void 0:n[r.color];return[(0,je.A)({"--Textarea-radius":t.vars.radius.sm,"--Textarea-gap":"0.5rem","--Textarea-placeholderColor":"inherit","--Textarea-placeholderOpacity":.64,"--Textarea-decoratorColor":t.vars.palette.text.icon,"--Textarea-focused":"0","--Textarea-focusedThickness":t.vars.focus.thickness,"--Textarea-focusedHighlight":null==(o=t.vars.palette["neutral"===r.color?"primary":r.color])?void 0:o[500],'&:not([data-inverted-colors="false"])':(0,je.A)({},r.instanceColor&&{"--_Textarea-focusedHighlight":null==(i=t.vars.palette["neutral"===r.instanceColor?"primary":r.instanceColor])?void 0:i[500]},{"--Textarea-focusedHighlight":"var(--_Textarea-focusedHighlight, ".concat(t.vars.palette.focusVisible,")")})},"sm"===r.size&&{"--Textarea-minHeight":"2rem","--Textarea-paddingBlock":"calc(0.375rem - 0.5px - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"0.5rem","--Textarea-decoratorChildHeight":"min(1.5rem, var(--Textarea-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},"md"===r.size&&{"--Textarea-minHeight":"2.25rem","--Textarea-paddingBlock":"calc(0.375rem - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"0.75rem","--Textarea-decoratorChildHeight":"min(1.75rem, var(--Textarea-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},"lg"===r.size&&{"--Textarea-minHeight":"3rem","--Textarea-paddingBlock":"calc(0.75rem - var(--variant-borderWidth, 0px))","--Textarea-paddingInline":"1rem","--Textarea-gap":"0.75rem","--Textarea-decoratorChildHeight":"min(2.375rem, var(--Textarea-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--_Textarea-paddingBlock":"max((var(--Textarea-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Textarea-decoratorChildHeight)) / 2, 0px)","--Textarea-decoratorChildRadius":"max(var(--Textarea-radius) - var(--variant-borderWidth, 0px) - var(--_Textarea-paddingBlock), min(var(--_Textarea-paddingBlock) + var(--variant-borderWidth, 0px), var(--Textarea-radius) / 2))","--Button-minHeight":"var(--Textarea-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Textarea-decoratorChildHeight)","--Button-radius":"var(--Textarea-decoratorChildRadius)","--IconButton-radius":"var(--Textarea-decoratorChildRadius)",boxSizing:"border-box"},"plain"!==r.variant&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Textarea-minHeight)",cursor:"text",position:"relative",display:"flex",flexDirection:"column",paddingInlineStart:"var(--Textarea-paddingInline)",paddingBlock:"var(--Textarea-paddingBlock)",borderRadius:"var(--Textarea-radius)"},t.typography["body-".concat(r.size)],c,{backgroundColor:null!=(a=null==c?void 0:c.backgroundColor)?a:t.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Textarea-focusedInset, inset) 0 0 0 calc(var(--Textarea-focused) * var(--Textarea-focusedThickness)) var(--Textarea-focusedHighlight)"}}),{"&:hover":(0,je.A)({},null==(s=t.variants["".concat(r.variant,"Hover")])?void 0:s[r.color],{backgroundColor:null,cursor:"text"}),["&.".concat(DM.disabled)]:null==(l=t.variants["".concat(r.variant,"Disabled")])?void 0:l[r.color],"&:focus-within::before":{"--Textarea-focused":"1"}}]}),OM=Qr(EM,{name:"JoyTextarea",slot:"Textarea",overridesResolver:(e,t)=>t.textarea})({resize:"none",border:"none",minWidth:0,outline:0,padding:0,paddingInlineEnd:"var(--Textarea-paddingInline)",flex:"auto",alignSelf:"stretch",color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit","&::-webkit-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Textarea-placeholderColor)",opacity:"var(--Textarea-placeholderOpacity)"}}),FM=Qr("div",{name:"JoyTextarea",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"flex",marginInlineStart:"calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",marginInlineEnd:"var(--Textarea-paddingBlock)",marginBlockEnd:"var(--Textarea-gap)",color:"var(--Textarea-decoratorColor)",cursor:"initial"}),NM=Qr("div",{name:"JoyTextarea",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"flex",marginInlineStart:"calc(var(--Textarea-paddingBlock) - var(--Textarea-paddingInline))",marginInlineEnd:"var(--Textarea-paddingBlock)",marginBlockStart:"var(--Textarea-gap)",color:"var(--Textarea-decoratorColor)",cursor:"initial"}),BM=o.forwardRef(function(e,t){var r,n,o,i,a,l,c,d;const u=en({props:e,name:"JoyTextarea"}),h=IC(u,DM),p=h.propsToForward,v=h.rootStateClasses,f=h.inputStateClasses,m=h.getRootProps,g=h.getInputProps,y=h.formControl,b=h.focused,x=h.error,w=void 0!==x&&x,S=h.disabled,k=void 0!==S&&S,_=h.size,C=void 0===_?"md":_,A=h.color,j=void 0===A?"neutral":A,I=h.variant,P=void 0===I?"outlined":I,R=h.startDecorator,T=h.endDecorator,E=h.minRows,z=h.maxRows,D=h.component,M=h.slots,L=void 0===M?{}:M,O=h.slotProps,F=void 0===O?{}:O,N=(0,Ie.A)(h,MM);const B=null!=(r=null!=(n=e.disabled)?n:null==y?void 0:y.disabled)?r:k,H=null!=(o=null!=(i=e.error)?i:null==y?void 0:y.error)?o:w,W=null!=(a=null!=(l=e.size)?l:null==y?void 0:y.size)?a:C,V=null!=(c=e.color)?c:H?"danger":null!=(d=null==y?void 0:y.color)?d:j,$=(0,je.A)({instanceColor:H?"danger":e.color},u,{color:V,disabled:B,error:H,focused:b,size:W,variant:P}),U=(e=>{const t=e.disabled,r=e.variant,n=e.color,o=e.size;return Dr({root:["root",t&&"disabled",r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),o&&"size".concat(Le(o))],textarea:["textarea"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},zM,{})})($),q=(0,je.A)({},N,{component:D,slots:L,slotProps:F}),K=pn("root",{ref:t,className:[U.root,v],elementType:LM,externalForwardedProps:q,getSlotProps:m,ownerState:$}),G=(0,s.A)(K,2),J=G[0],Q=G[1],Y=pn("textarea",{additionalProps:{id:null==y?void 0:y.htmlFor,"aria-describedby":null==y?void 0:y["aria-describedby"]},className:[U.textarea,f],elementType:OM,internalForwardedProps:(0,je.A)({},p,{minRows:E,maxRows:z}),externalForwardedProps:q,getSlotProps:g,ownerState:$}),X=(0,s.A)(Y,2),Z=X[0],ee=X[1],te=pn("startDecorator",{className:U.startDecorator,elementType:FM,externalForwardedProps:q,ownerState:$}),re=(0,s.A)(te,2),ne=re[0],oe=re[1],ie=pn("endDecorator",{className:U.endDecorator,elementType:NM,externalForwardedProps:q,ownerState:$}),ae=(0,s.A)(ie,2),se=ae[0],le=ae[1];return(0,tr.jsxs)(J,(0,je.A)({},Q,{children:[R&&(0,tr.jsx)(ne,(0,je.A)({},oe,{children:R})),(0,tr.jsx)(Z,(0,je.A)({},ee)),T&&(0,tr.jsx)(se,(0,je.A)({},le,{children:T}))]}))}),HM=BM,WM={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},VM="buttonClick",$M="browserAutoFill",UM=e=>{const t=e.label,r=e.value;return"string"===typeof t?t:"string"===typeof r?r:String(e)};function qM(e,t){const r=e.open,n=t.context.selectionMode;if(t.type===VM){var o;const n=null!=(o=e.selectedValues[0])?o:du(null,"start",t.context);return(0,je.A)({},e,{open:!r,highlightedValue:r?null:n})}if(t.type===$M)return uu(t.item,e,t.context);const i=pu(e,t);switch(t.type){case iu:if(e.open){if("Escape"===t.event.key)return(0,je.A)({},i,{open:!1})}else{var a,s;if("ArrowDown"===t.event.key)return(0,je.A)({},e,{open:!0,highlightedValue:null!=(a=e.selectedValues[0])?a:du(null,"start",t.context)});if("ArrowUp"===t.event.key)return(0,je.A)({},e,{open:!0,highlightedValue:null!=(s=e.selectedValues[0])?s:du(null,"end",t.context)})}break;case ru:if("single"===n)return(0,je.A)({},i,{open:!1});break;case tu:return(0,je.A)({},i,{open:!1});default:return i}return i}function KM(e){return Array.isArray(e)?0===e.length?"":JSON.stringify(e.map(e=>e.value)):null==(null==e?void 0:e.value)?"":"string"===typeof e.value||"number"===typeof e.value?e.value:JSON.stringify(e.value)}function GM(e){const t=e.areOptionsEqual,r=e.buttonRef,n=e.defaultOpen,i=void 0!==n&&n,a=e.defaultValue,s=e.disabled,l=void 0!==s&&s,c=e.listboxId,d=e.listboxRef,u=e.multiple,h=void 0!==u&&u,p=e.name,v=e.required,f=e.onChange,m=e.onHighlightChange,g=e.onOpenChange,y=e.open,b=e.options,x=e.getOptionAsString,w=void 0===x?UM:x,S=e.getSerializedValue,k=void 0===S?KM:S,_=e.value,C=e.componentName,A=void 0===C?"useSelect":C,j=o.useRef(null),I=rn(r,j),P=o.useRef(null),R=gi(c);let T;void 0===_&&void 0===a?T=[]:void 0!==a&&(T=h?a:null==a?[]:[a]);const E=o.useMemo(()=>{if(void 0!==_)return h?_:null==_?[]:[_]},[_,h]),z=_u(),D=z.subitems,M=z.contextValue,L=o.useMemo(()=>null!=b?new Map(b.map((e,t)=>[e.value,{value:e.value,label:e.label,disabled:e.disabled,ref:o.createRef(),id:"".concat(R,"_").concat(t)}])):D,[b,D,R]),O=rn(d,P),F=lo({disabled:l,rootRef:I}),N=F.getRootProps,B=F.active,H=F.focusVisible,W=F.rootRef,V=o.useMemo(()=>Array.from(L.keys()),[L]),$=o.useCallback(e=>{if(void 0!==t){const r=V.find(r=>t(r,e));return L.get(r)}return L.get(e)},[L,t,V]),U=o.useCallback(e=>{var t;const r=$(e);return null!=(t=null==r?void 0:r.disabled)&&t},[$]),q=o.useCallback(e=>{const t=$(e);return t?w(t):""},[$,w]),K=o.useMemo(()=>({selectedValues:E,open:y}),[E,y]),G=o.useCallback(e=>{var t;return null==(t=L.get(e))?void 0:t.id},[L]),J=o.useCallback((e,t)=>{var r;h?null==f||f(e,t):null==f||f(e,null!=(r=t[0])?r:null)},[h,f]),Q=o.useCallback((e,t)=>{null==m||m(e,null!=t?t:null)},[m]),Y=o.useCallback((e,t,r)=>{var n;"open"===t&&(null==g||g(r),!1===r&&"blur"!==(null==e?void 0:e.type)&&(null==(n=j.current)||n.focus()))},[g]),X=Su({getInitialState:()=>{var e;return{highlightedValue:null,selectedValues:null!=(e=T)?e:[],open:i}},getItemId:G,controlledProps:K,focusManagement:"DOM",getItemDomElement:o.useCallback(e=>{var t,r;return null==e?null:null!=(t=null==(r=D.get(e))?void 0:r.ref.current)?t:null},[D]),itemComparer:t,isItemDisabled:U,rootRef:O,onChange:J,onHighlightChange:Q,onStateChange:Y,reducerActionContext:o.useMemo(()=>({multiple:h}),[h]),items:V,getItemAsString:q,selectionMode:h?"multiple":"single",stateReducer:qM,componentName:A}),Z=X.dispatch,ee=X.getRootProps,te=X.contextValue,re=X.state,ne=re.open,oe=re.highlightedValue,ie=re.selectedValues,ae=X.rootRef,se=o.useRef(ne);eu(()=>{if(ne&&null!==oe){var e;const t=null==(e=$(oe))?void 0:e.ref;if(!P.current||null==t||!t.current)return;se.current||t.current.focus({preventScroll:!0});const r=P.current.getBoundingClientRect(),n=t.current.getBoundingClientRect();n.topr.bottom&&(P.current.scrollTop+=n.bottom-r.bottom)}},[ne,oe,$]);const le=o.useCallback(e=>$(e),[$]),ce=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),t.defaultMuiPrevented||"ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),Z({type:iu,key:t.key,event:t}))},de=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,je.A)({},e,function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{onClick:(t=e,e=>{var r;null==t||null==(r=t.onClick)||r.call(t,e),e.defaultMuiPrevented||Z({type:VM,event:e})}),onKeyDown:ce(e)};var t}(e),{role:"combobox","aria-expanded":ne,"aria-controls":R})},ue=e=>t=>{var r,n;null==(r=e.onBlur)||r.call(e,t),t.defaultMuiPrevented||(null!=(n=P.current)&&n.contains(t.relatedTarget)||t.relatedTarget===j.current)&&(t.defaultMuiPrevented=!0)},he=function(){return{onBlur:ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}};o.useDebugValue({selectedOptions:ie,highlightedOption:oe,open:ne});const pe=o.useMemo(()=>(0,je.A)({},te,M),[te,M]);let ve,fe;var me;(ve=e.multiple?ie:ie.length>0?ie[0]:null,h)?fe=ve.map(e=>le(e)).filter(e=>void 0!==e):fe=null!=(me=le(ve))?me:null;const ge=e=>t=>{var r;if(null==e||null==(r=e.onChange)||r.call(e,t),t.defaultMuiPrevented)return;const n=L.get(t.target.value);""===t.target.value?Z({type:cu}):void 0!==n&&Z({type:$M,item:n.value,event:t})};return{buttonActive:B,buttonFocusVisible:H,buttonRef:W,contextValue:pe,disabled:l,dispatch:Z,getButtonProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(de,N);return(0,je.A)({},e,r(t))},getHiddenInputProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e);return(0,je.A)({name:p,tabIndex:-1,"aria-hidden":!0,required:!!v||void 0,value:k(fe),style:WM},e,{onChange:ge(t)})},getListboxProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(he,ee);return(0,je.A)({id:R,role:"listbox","aria-multiselectable":h?"true":void 0},e,r(t))},getOptionMetadata:le,listboxRef:ae,open:ne,options:V,value:ve,highlightedOption:oe}}function JM(e){const t=e.value,r=e.children,n=t.dispatch,i=t.getItemIndex,a=t.getItemState,s=t.registerItem,l=t.totalSubitemCount,c=o.useMemo(()=>({dispatch:n,getItemState:a,getItemIndex:i}),[n,i,a]),d=o.useMemo(()=>({getItemIndex:i,registerItem:s,totalSubitemCount:l}),[s,i,l]);return(0,tr.jsx)(ku.Provider,{value:d,children:(0,tr.jsx)(Au.Provider,{value:c,children:r})})}const QM=Vo((0,tr.jsx)("path",{d:"m12 5.83 2.46 2.46c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 3.7a.9959.9959 0 0 0-1.41 0L8.12 6.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 5.83zm0 12.34-2.46-2.46a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l3.17 3.18c.39.39 1.02.39 1.41 0l3.17-3.17c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L12 18.17z"}),"Unfold");function YM(e){return xr("MuiSelect",e)}const XM=wr("MuiSelect",["root","button","indicator","startDecorator","endDecorator","popper","listbox","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","focusVisible","disabled","expanded","multiple"]);var ZM;const eL=["action","autoFocus","children","defaultValue","defaultListboxOpen","disabled","getSerializedValue","placeholder","listboxId","listboxOpen","onChange","onListboxOpenChange","onClose","renderValue","required","value","size","variant","color","startDecorator","endDecorator","indicator","aria-describedby","aria-label","aria-labelledby","id","name","multiple","slots","slotProps"];function tL(e){var t;return Array.isArray(e)?(0,tr.jsx)(o.Fragment,{children:e.map(e=>e.label).join(", ")}):null!=(t=null==e?void 0:e.label)?t:""}const rL=[{name:"offset",options:{offset:[0,4]}},{name:"equalWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:e=>{let t=e.state;t.styles.popper.width="".concat(t.rects.reference.width,"px")}}],nL=Qr("div",{name:"JoySelect",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s;const l=null==(n=t.variants["".concat(r.variant)])?void 0:n[r.color],c=si({theme:t,ownerState:r},["borderRadius"]).borderRadius;return[(0,je.A)({"--Select-radius":t.vars.radius.sm,"--Select-gap":"0.5rem","--Select-placeholderOpacity":.64,"--Select-decoratorColor":t.vars.palette.text.icon,"--Select-focusedThickness":t.vars.focus.thickness,"--Select-focusedHighlight":null==(o=t.vars.palette["neutral"===r.color?"primary":r.color])?void 0:o[500],'&:not([data-inverted-colors="false"])':(0,je.A)({},r.instanceColor&&{"--_Select-focusedHighlight":null==(i=t.vars.palette["neutral"===r.instanceColor?"primary":r.instanceColor])?void 0:i[500]},{"--Select-focusedHighlight":t.vars.palette.focusVisible}),"--Select-indicatorColor":null!=l&&l.backgroundColor?null==l?void 0:l.color:t.vars.palette.text.tertiary},"sm"===r.size&&{"--Select-minHeight":"2rem","--Select-paddingInline":"0.5rem","--Select-decoratorChildHeight":"min(1.5rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl},"md"===r.size&&{"--Select-minHeight":"2.25rem","--Select-paddingInline":"0.75rem","--Select-decoratorChildHeight":"min(1.75rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},"lg"===r.size&&{"--Select-minHeight":"2.75rem","--Select-paddingInline":"1rem","--Select-decoratorChildHeight":"min(2.375rem, var(--Select-minHeight))","--Icon-fontSize":t.vars.fontSize.xl2},{"--Select-decoratorChildOffset":"min(calc(var(--Select-paddingInline) - (var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2), var(--Select-paddingInline))","--_Select-paddingBlock":"max((var(--Select-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Select-decoratorChildHeight)) / 2, 0px)","--Select-decoratorChildRadius":"max(var(--Select-radius) - var(--variant-borderWidth, 0px) - var(--_Select-paddingBlock), min(var(--_Select-paddingBlock) + var(--variant-borderWidth, 0px), var(--Select-radius) / 2))","--Button-minHeight":"var(--Select-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Select-decoratorChildHeight)","--Button-radius":"var(--Select-decoratorChildRadius)","--IconButton-radius":"var(--Select-decoratorChildRadius)",boxSizing:"border-box"},"plain"!==r.variant&&{boxShadow:t.shadow.xs},{minWidth:0,minHeight:"var(--Select-minHeight)",position:"relative",display:"flex",alignItems:"center",borderRadius:"var(--Select-radius)",cursor:"pointer"},!(null!=l&&l.backgroundColor)&&{backgroundColor:t.vars.palette.background.surface},r.size&&{paddingBlock:{sm:2,md:3,lg:4}[r.size]},{paddingInline:"var(--Select-paddingInline)"},t.typography["body-".concat(r.size)],l,{"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)"},["&.".concat(XM.focusVisible)]:{"--Select-indicatorColor":null==l?void 0:l.color,"&::before":{boxShadow:"inset 0 0 0 var(--Select-focusedThickness) var(--Select-focusedHighlight)"}},["&.".concat(XM.disabled)]:{"--Select-indicatorColor":"inherit"}}),{"&:hover":null==(a=t.variants["".concat(r.variant,"Hover")])?void 0:a[r.color],["&.".concat(XM.disabled)]:null==(s=t.variants["".concat(r.variant,"Disabled")])?void 0:s[r.color]},void 0!==c&&{"--Select-radius":c}]}),oL=Qr("button",{name:"JoySelect",slot:"Button",overridesResolver:(e,t)=>t.button})(e=>{let t=e.ownerState;return(0,je.A)({border:0,outline:0,background:"none",padding:0,fontSize:"inherit",color:"inherit",alignSelf:"stretch",display:"flex",alignItems:"center",flex:1,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap",overflow:"hidden"},(null===t.value||void 0===t.value)&&{opacity:"var(--Select-placeholderOpacity)"},{"&::before":{content:'""',display:"block",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",borderRadius:"var(--Select-radius)"}})}),iL=Qr(Wi,{name:"JoySelect",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(e=>{let t=e.theme,r=e.ownerState;var n;const o=null==(n=t.variants[r.variant])?void 0:n[r.color];return(0,je.A)({"--focus-outline-offset":"calc(".concat(t.vars.focus.thickness," * -1)"),"--ListItem-stickyBackground":(null==o?void 0:o.backgroundColor)||(null==o?void 0:o.background)||t.vars.palette.background.popup,"--ListItem-stickyTop":"calc(var(--List-padding, var(--ListDivider-gap)) * -1)"},Fi,{minWidth:"max-content",maxHeight:"44vh",overflow:"auto",outline:0,boxShadow:t.shadow.md,borderRadius:"var(--List-radius, ".concat(t.vars.radius.sm,")"),zIndex:"var(--unstable_popup-zIndex, ".concat(t.vars.zIndex.popup,")")},!(null!=o&&o.backgroundColor)&&{backgroundColor:t.vars.palette.background.popup})}),aL=Qr("span",{name:"JoySelect",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Button-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Select-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Select-paddingInline) / -4)",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineEnd:"var(--Select-gap)"}),sL=Qr("span",{name:"JoySelect",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Button-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Select-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Select-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",color:"var(--Select-decoratorColor)",marginInlineStart:"var(--Select-gap)"}),lL=Qr("span",{name:"JoySelect",slot:"Indicator"})(e=>{let t=e.ownerState,r=e.theme;return(0,je.A)({},"sm"===t.size&&{"--Icon-fontSize":r.vars.fontSize.lg},"md"===t.size&&{"--Icon-fontSize":r.vars.fontSize.xl},"lg"===t.size&&{"--Icon-fontSize":r.vars.fontSize.xl2},{"--Icon-color":"neutral"!==t.color||"solid"===t.variant?"currentColor":r.vars.palette.text.icon,display:"inherit",alignItems:"center",marginInlineStart:"var(--Select-gap)",marginInlineEnd:"calc(var(--Select-paddingInline) / -4)",[".".concat(XM.endDecorator," + &")]:{marginInlineStart:"calc(var(--Select-gap) / 2)"},["&.".concat(XM.expanded,", .").concat(XM.disabled," > &")]:{"--Icon-color":"currentColor"}})}),cL=o.forwardRef(function(e,t){var r,n,i,a,l,c,d;const u=en({props:e,name:"JoySelect"}),h=u,p=h.action,v=h.autoFocus,f=h.children,m=h.defaultValue,g=h.defaultListboxOpen,y=void 0!==g&&g,b=h.disabled,x=h.getSerializedValue,w=h.placeholder,S=h.listboxId,k=h.listboxOpen,_=h.onChange,C=h.onListboxOpenChange,A=h.onClose,j=h.renderValue,I=h.required,P=void 0!==I&&I,R=h.value,T=h.size,E=void 0===T?"md":T,z=h.variant,D=void 0===z?"outlined":z,M=h.color,L=void 0===M?"neutral":M,O=h.startDecorator,F=h.endDecorator,N=h.indicator,B=void 0===N?ZM||(ZM=(0,tr.jsx)(QM,{})):N,H=h["aria-describedby"],W=h["aria-label"],V=h["aria-labelledby"],$=h.id,U=h.name,q=h.multiple,K=void 0!==q&&q,G=h.slots,J=void 0===G?{}:G,Q=h.slotProps,Y=void 0===Q?{}:Q,X=(0,Ie.A)(h,eL),Z=o.useContext(lC);const ee=null!=(r=null!=(n=e.disabled)?n:null==Z?void 0:Z.disabled)?r:b,te=null!=(i=null!=(a=e.size)?a:null==Z?void 0:Z.size)?i:E,re=null!=(l=e.color)?l:null!=Z&&Z.error?"danger":null!=(c=null==Z?void 0:Z.color)?c:L,ne=null!=j?j:tL,oe=o.useState(null),ie=(0,s.A)(oe,2),ae=ie[0],se=ie[1],le=o.useRef(null),ce=o.useRef(null),de=rn(t,le);o.useImperativeHandle(p,()=>({focusVisible:()=>{var e;null==(e=ce.current)||e.focus()}}),[]),o.useEffect(()=>{se(le.current)},[]),o.useEffect(()=>{v&&ce.current.focus()},[v]);const ue=o.useCallback(e=>{null==C||C(e),e||null==A||A()},[A,C]),he=GM({buttonRef:ce,defaultOpen:y,defaultValue:m,disabled:ee,getSerializedValue:x,listboxId:S,multiple:K,name:U,required:P,onChange:_,onOpenChange:ue,open:k,value:R}),pe=he.buttonActive,ve=he.buttonFocusVisible,fe=he.contextValue,me=he.disabled,ge=he.getButtonProps,ye=he.getListboxProps,be=he.getHiddenInputProps,xe=he.getOptionMetadata,we=he.open,Se=he.value,ke=(0,je.A)({},u,{active:pe,defaultListboxOpen:y,disabled:me,focusVisible:ve,open:we,renderValue:ne,value:Se,size:te,variant:D,color:re}),_e=(e=>{const t=e.color,r=e.disabled,n=e.focusVisible,o=e.size,i=e.variant,a=e.open,s=e.multiple;return Dr({root:["root",r&&"disabled",n&&"focusVisible",a&&"expanded",i&&"variant".concat(Le(i)),t&&"color".concat(Le(t)),o&&"size".concat(Le(o)),s&&"multiple"],button:["button"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],indicator:["indicator",a&&"expanded"],listbox:["listbox",a&&"expanded",r&&"disabled"]},YM,{})})(ke),Ce=(0,je.A)({},X,{slots:J,slotProps:Y}),Ae=o.useMemo(()=>{let e;var t;K?e=Se.map(e=>xe(e)).filter(e=>void 0!==e):e=null!=(t=xe(Se))?t:null;return e},[xe,Se,K]),Re=pn("root",{ref:de,className:_e.root,elementType:nL,externalForwardedProps:Ce,ownerState:ke}),Te=(0,s.A)(Re,2),Ee=Te[0],ze=Te[1],De=pn("button",{additionalProps:{"aria-describedby":null!=H?H:null==Z?void 0:Z["aria-describedby"],"aria-label":W,"aria-labelledby":null!=V?V:null==Z?void 0:Z.labelId,"aria-required":P?"true":void 0,id:null!=$?$:null==Z?void 0:Z.htmlFor,name:U},className:_e.button,elementType:oL,externalForwardedProps:Ce,getSlotProps:ge,ownerState:ke}),Me=(0,s.A)(De,2),Oe=Me[0],Fe=Me[1],Ne=pn("listbox",{additionalProps:{anchorEl:ae,open:we,placement:"bottom",keepMounted:!0},className:_e.listbox,elementType:iL,externalForwardedProps:Ce,getSlotProps:ye,ownerState:(0,je.A)({},ke,{nesting:!1,row:!1,wrap:!1}),getSlotOwnerState:e=>({size:e.size||te,variant:e.variant||D,color:e.color||(e.disablePortal?re:L),disableColorInversion:!e.disablePortal})}),Be=(0,s.A)(Ne,2),He=Be[0],We=Be[1],Ve=pn("startDecorator",{className:_e.startDecorator,elementType:aL,externalForwardedProps:Ce,ownerState:ke}),$e=(0,s.A)(Ve,2),Ue=$e[0],qe=$e[1],Ke=pn("endDecorator",{className:_e.endDecorator,elementType:sL,externalForwardedProps:Ce,ownerState:ke}),Ge=(0,s.A)(Ke,2),Je=Ge[0],Qe=Ge[1],Ye=pn("indicator",{className:_e.indicator,elementType:lL,externalForwardedProps:Ce,ownerState:ke}),Xe=(0,s.A)(Ye,2),Ze=Xe[0],et=Xe[1],tt=o.useMemo(()=>[...rL,...We.modifiers||[]],[We.modifiers]);let rt=w;return(Array.isArray(Ae)&&Ae.length>0||!Array.isArray(Ae)&&Ae)&&(rt=ne(Ae)),(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsxs)(Ee,(0,je.A)({},ze,{children:[O&&(0,tr.jsx)(Ue,(0,je.A)({},qe,{children:O})),(0,tr.jsx)(Oe,(0,je.A)({},Fe,{children:rt})),F&&(0,tr.jsx)(Je,(0,je.A)({},Qe,{children:F})),B&&(0,tr.jsx)(Ze,(0,je.A)({},et,{children:B})),(0,tr.jsx)("input",(0,je.A)({},be()))]})),ae&&(0,tr.jsx)(He,(0,je.A)({},We,{className:(0,Pe.A)(We.className),modifiers:tt},!(null!=(d=u.slots)&&d.listbox)&&{as:sp,slots:{root:We.as||"ul"}},{children:(0,tr.jsx)(JM,{value:fe,children:(0,tr.jsx)(xi,{variant:D,color:L,children:(0,tr.jsx)(Mi.Provider,{value:"select",children:(0,tr.jsx)(Ni,{nested:!0,children:f})})})})}))]})}),dL=cL;function uL(e){return xr("MuiOption",e)}const hL=wr("MuiOption",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","highlighted","variantPlain","variantSoft","variantOutlined","variantSolid"]),pL=["component","children","disabled","value","label","variant","color","slots","slotProps"],vL=Qr(xp,{name:"JoyOption",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;const o=null==(n=t.variants["".concat(r.variant,"Hover")])?void 0:n[r.color];return{["&.".concat(hL.highlighted,':not([aria-selected="true"])')]:{backgroundColor:null==o?void 0:o.backgroundColor}}}),fL=o.memo(o.forwardRef(function(e,t){var r;const n=en({props:e,name:"JoyOption"}),i=n.component,a=void 0===i?"li":i,l=n.children,c=n.disabled,d=void 0!==c&&c,u=n.value,h=n.label,p=n.variant,v=void 0===p?"plain":p,f=n.color,m=void 0===f?"neutral":f,g=n.slots,y=void 0===g?{}:g,b=n.slotProps,x=void 0===b?{}:b,w=(0,Ie.A)(n,pL),S=o.useContext(Li),k=bi(e.variant,e.color),_=k.variant,C=void 0===_?v:_,A=k.color,j=void 0===A?m:A,I=o.useRef(null),P=rn(I,t),R=function(e){const t=e.value,r=e.label,n=e.disabled,i=e.rootRef,a=e.id,s=pp({item:t}),l=s.getRootProps,c=s.highlighted,d=s.selected,u=lo({disabled:n,focusableWhenDisabled:!0}),h=u.getRootProps,p=u.rootRef,v=gi(a),f=o.useRef(null),m=o.useMemo(()=>({disabled:n,label:r,value:t,ref:f,id:v}),[n,r,t,v]),g=vp(t,m).index,y=rn(i,f,p),b=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),t.defaultMuiPrevented||[" ","Enter"].includes(t.key)&&(t.defaultMuiPrevented=!0)},x=function(){return{onKeyDown:b(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}};return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r=Ud(l,Ud(h,x));return(0,je.A)({},e,t,r(t),{id:v,ref:y,role:"option","aria-selected":d})},highlighted:c,index:g,selected:d,rootRef:y}}({disabled:d,label:null!=h?h:"string"===typeof l?l:null==(r=I.current)?void 0:r.innerText,value:u,rootRef:P}),T=R.getRootProps,E=R.selected,z=R.highlighted,D=R.index,M=(0,je.A)({},n,{disabled:d,selected:E,highlighted:z,index:D,component:a,variant:C,color:j,row:S}),L=(e=>Dr({root:["root",e.disabled&&"disabled",e.highlighted&&"highlighted",e.selected&&"selected"]},uL,{}))(M),O=(0,je.A)({},w,{component:a,slots:y,slotProps:x}),F=pn("root",{ref:t,getSlotProps:T,elementType:vL,externalForwardedProps:O,className:L.root,ownerState:M}),N=(0,s.A)(F,2),B=N[0],H=N[1];return(0,tr.jsx)(B,(0,je.A)({},H,{children:l}))})),mL=o.forwardRef(function(e,t){const r=function(e){const t=o.useContext(Au);if(!t)throw new Error("Option: ListContext was not found.");const r=t.getItemState,n=t.dispatch,i=r(e),a=i.highlighted,s=i.selected,l=i.focusable,c=o.useCallback(t=>{if(t!==e)throw new Error(["Base UI Option: Tried to access the state of another Option.","This is unsupported when the Option uses the OptionContextStabilizer as a performance optimization."].join("/n"));return{highlighted:a,selected:s,focusable:l}},[a,s,l,e]);return{contextValue:o.useMemo(()=>({dispatch:n,getItemState:c}),[n,c])}}(e.value).contextValue;return(0,tr.jsx)(Au.Provider,{value:r,children:(0,tr.jsx)(fL,(0,je.A)({},e,{ref:t}))})}),gL=mL;var yL=r(3021),bL=r(3395),xL=r(6081),wL=r(4783),SL=r(7948),kL=r(2090);const _L=e=>["getHouseEvents",e],CL=e=>{const t=Ma().getIdToken;return ql({queryKey:_L(e),queryFn:async()=>{const r=await t();if(!r||!e)return[];const n=await fetch("".concat(IW,"/api/house/").concat(e,"/events"),{headers:{Authorization:r}});if(!n.ok)throw new Error("Failed to load events: ".concat(n.status));return await n.json()},enabled:!!e})},AL=e=>{const t=Ma().getIdToken,r=zl();return Lk({mutationFn:async r=>{const n=await t();if(!n||!e)return null;const o=await fetch("".concat(IW,"/api/house/").concat(e,"/events"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify(r)});if(!o.ok)throw new Error("Failed to create event: ".concat(o.status));return await o.json()},onSuccess:()=>{r.invalidateQueries({queryKey:_L(e)})}})},jL=e=>{switch(e){case"VIEWING":return(0,tr.jsx)(yL.A,{fontSize:"small"});case"OFFER":return(0,tr.jsx)(bL.A,{fontSize:"small"});case"STATUS_CHANGE":return(0,tr.jsx)(xL.A,{fontSize:"small"});case"ADDED":return(0,tr.jsx)(wL.A,{fontSize:"small"});case"ENRICHED":return(0,tr.jsx)(n_.A,{fontSize:"small"});case"ENRICHMENT_FAILED":return(0,tr.jsx)(SL.A,{fontSize:"small"});default:return(0,tr.jsx)(kL.A,{fontSize:"small"})}},IL=e=>{switch(e){case"VIEWING":return"primary";case"OFFER":return"success";case"STATUS_CHANGE":return"warning";case"ENRICHMENT_FAILED":return"danger";default:return"neutral"}},PL=e=>{try{return new Date(e).toLocaleString("en-GB",{dateStyle:"medium",timeStyle:"short"})}catch(t){return e}},RL=e=>{const t=e.data||{};switch(e.eventType){case"VIEWING":return t.agentName?"Viewing \u2014 ".concat(t.agentName):"Viewing";case"OFFER":{const e="number"===typeof t.amountGbp?(e=>e.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0}))(t.amountGbp):"",r=t.status?" (".concat(t.status,")"):"";return"Offer ".concat(e).concat(r).trim()}case"STATUS_CHANGE":return"Status changed".concat(t.from&&t.to?": ".concat(t.from," \u2192 ").concat(t.to):"");case"ADDED":return"Added to board";case"ENRICHED":return"Insights generated";case"ENRICHMENT_FAILED":return"Insights generation failed";default:return e.eventType}};function TL(e){let t=e.event,r=e.isLast;const n=(e=>{const t=e.data||{};return"VIEWING"===e.eventType&&"string"===typeof t.observations&&t.observations?t.observations:"ENRICHMENT_FAILED"===e.eventType&&"string"===typeof t.error&&t.error?t.error:null})(t);return(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:2,pb:r?0:2},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,tr.jsx)(Tr,{sx:{width:32,height:32,borderRadius:"50%",bgcolor:"".concat(IL(t.eventType),".softBg"),color:"".concat(IL(t.eventType),".softColor"),display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:jL(t.eventType)}),!r&&(0,tr.jsx)(Tr,{sx:{width:"1px",flex:1,bgcolor:"divider",mt:.5}})]}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0,pb:.5},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:RL(t)}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:PL(t.occurredAt)}),n&&(0,tr.jsx)(Gn,{level:"body-sm",sx:{mt:.75},children:n})]})]})}function EL(e){let t=e.open,r=e.onClose,n=e.houseId;const i=(0,o.useState)(""),a=(0,s.A)(i,2),l=a[0],c=a[1],d=(0,o.useState)(""),u=(0,s.A)(d,2),h=u[0],p=u[1],v=(0,o.useState)(""),f=(0,s.A)(v,2),m=f[0],g=f[1],y=(0,o.useState)(null),b=(0,s.A)(y,2),x=b[0],w=b[1],S=AL(n),k=()=>{c(""),p(""),g(""),w(null)},_=()=>{S.isPending||(k(),r())};return(0,tr.jsx)(L_,{open:t,onClose:_,children:(0,tr.jsxs)(U_,{size:"md",sx:{minWidth:{sm:420}},children:[(0,tr.jsx)(sC,{disabled:S.isPending}),(0,tr.jsx)(wR,{children:"Log a Viewing"}),(0,tr.jsx)(mE,{children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(mC,{required:!0,children:[(0,tr.jsx)(SC,{children:"Date & Time"}),(0,tr.jsx)(NC,{type:"datetime-local",value:l,onChange:e=>c(e.target.value),disabled:S.isPending})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Agent Name"}),(0,tr.jsx)(NC,{placeholder:"e.g. Savills Peckham",value:h,onChange:e=>p(e.target.value),disabled:S.isPending})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Observations"}),(0,tr.jsx)(HM,{minRows:3,placeholder:"First impressions\u2026",value:m,onChange:e=>g(e.target.value),disabled:S.isPending})]}),x&&(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",children:x})]})}),(0,tr.jsxs)(hE,{children:[(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",onClick:_,disabled:S.isPending,children:"Cancel"}),(0,tr.jsx)(wo,{variant:"solid",onClick:async()=>{if(!l)return;const e={};h&&(e.agentName=h),m&&(e.observations=m),w(null);try{await S.mutateAsync({eventType:"VIEWING",occurredAt:new Date(l).toISOString(),data:e}),k(),r()}catch(t){w(t instanceof Error&&t.message?"Couldn't save viewing: ".concat(t.message):"Couldn't save viewing. Please try again.")}},loading:S.isPending,disabled:!l,children:"Save Viewing"})]})]})})}function zL(e){let t=e.open,r=e.onClose,n=e.houseId;const i=(0,o.useState)(""),a=(0,s.A)(i,2),l=a[0],c=a[1],d=(0,o.useState)("pending"),u=(0,s.A)(d,2),h=u[0],p=u[1],v=(0,o.useState)(null),f=(0,s.A)(v,2),m=f[0],g=f[1],y=AL(n),b=()=>{c(""),p("pending"),g(null)},x=()=>{y.isPending||(b(),r())};return(0,tr.jsx)(L_,{open:t,onClose:x,children:(0,tr.jsxs)(U_,{size:"sm",sx:{minWidth:{sm:360}},children:[(0,tr.jsx)(sC,{disabled:y.isPending}),(0,tr.jsx)(wR,{children:"Record an Offer"}),(0,tr.jsx)(mE,{children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(mC,{required:!0,children:[(0,tr.jsx)(SC,{children:"Offer Amount"}),(0,tr.jsx)(NC,{type:"number",startDecorator:"\xa3",value:l,onChange:e=>c(e.target.value),disabled:y.isPending})]}),(0,tr.jsxs)(mC,{required:!0,children:[(0,tr.jsx)(SC,{children:"Status"}),(0,tr.jsxs)(dL,{value:h,onChange:(e,t)=>t&&p(t),disabled:y.isPending,children:[(0,tr.jsx)(gL,{value:"pending",children:"Pending"}),(0,tr.jsx)(gL,{value:"accepted",children:"Accepted"}),(0,tr.jsx)(gL,{value:"rejected",children:"Rejected"}),(0,tr.jsx)(gL,{value:"countered",children:"Countered"})]})]}),m&&(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",children:m})]})}),(0,tr.jsxs)(hE,{children:[(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",onClick:x,disabled:y.isPending,children:"Cancel"}),(0,tr.jsx)(wo,{variant:"solid",onClick:async()=>{const e=parseInt(l,10);if(Number.isFinite(e)&&!(e<=0)){g(null);try{await y.mutateAsync({eventType:"OFFER",occurredAt:(new Date).toISOString(),data:{amountGbp:e,status:h}}),b(),r()}catch(t){g(t instanceof Error&&t.message?"Couldn't save offer: ".concat(t.message):"Couldn't save offer. Please try again.")}}},loading:y.isPending,disabled:!l,children:"Save Offer"})]})]})})}function DL(e){let t=e.houseId;const r=CL(t),n=r.data,i=r.isLoading,a=(0,o.useState)(!1),l=(0,s.A)(a,2),c=l[0],d=l[1],u=(0,o.useState)(!1),h=(0,s.A)(u,2),p=h[0],v=h[1],f=o.useMemo(()=>n?[...n].sort((e,t)=>e.occurredAt.localeCompare(t.occurredAt)):[],[n]);return(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1,sx:{mb:2},children:[(0,tr.jsx)(wo,{size:"sm",variant:"solid",startDecorator:(0,tr.jsx)(yL.A,{}),onClick:()=>d(!0),children:"Log Viewing"}),(0,tr.jsx)(wo,{size:"sm",variant:"outlined",startDecorator:(0,tr.jsx)(bL.A,{}),onClick:()=>v(!0),children:"Record Offer"})]}),(0,tr.jsx)(nc,{sx:{mb:2}}),i?(0,tr.jsx)(Tr,{display:"flex",justifyContent:"center",py:4,children:(0,tr.jsx)(An,{})}):0===f.length?(0,tr.jsxs)(Tr,{display:"flex",flexDirection:"column",alignItems:"center",py:6,gap:1,children:[(0,tr.jsx)(Gn,{level:"body-lg",textColor:"text.secondary",children:"No events yet"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"Viewings, offers, and other events will appear here."})]}):(0,tr.jsx)(Mn,{spacing:0,children:f.map((e,t)=>(0,tr.jsx)(TL,{event:e,isLast:t===f.length-1},e.id))}),(0,tr.jsx)(EL,{open:c,onClose:()=>d(!1),houseId:t}),(0,tr.jsx)(zL,{open:p,onClose:()=>v(!1),houseId:t})]})}var ML=r(555);function LL(e){var t,r,n;let i=e.open,a=e.onClose,s=e.aiSearchId,l=e.referenceHouseId;const c=(e=>{const t=Ma().getIdToken;return Lk({mutationFn:async r=>{const n=await t();if(!n||!e)throw new Error("Missing auth/id");const o=await fetch("".concat(IW,"/api/ai-search/").concat(e,"/more-like-this"),{method:"POST",headers:{Authorization:n,"Content-Type":"application/json"},body:JSON.stringify({referenceHouseId:r})});if(!o.ok)throw new Error("Failed to find similar: ".concat(o.status));return await o.json()}})})(s),d=c.mutate,u=null===(t=c.data)||void 0===t?void 0:t.referenceHouseId,h=c.isPending,p=IM(i?l:void 0).data;(0,o.useEffect)(()=>{i&&u!==l&&!h&&d(l)},[i,l,u,h,d]);const v=null!==(r=null===(n=c.data)||void 0===n?void 0:n.results)&&void 0!==r?r:[],f="removed"===(null===p||void 0===p?void 0:p.listingStatus);return(0,tr.jsxs)(xT,{anchor:"right",open:i,onClose:a,slotProps:{content:{sx:{width:{xs:"100%",sm:420}}}},children:[(0,tr.jsxs)(Tr,{sx:{p:2,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,tr.jsx)(Gn,{level:"title-lg",children:"More like this"}),(0,tr.jsx)(sC,{onClick:a})]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(Tr,{sx:{p:2,overflow:"auto"},children:[p&&(0,tr.jsxs)(hi,{variant:"soft",color:"neutral",sx:{mb:2},children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Finding properties similar to"}),(0,tr.jsx)(Gn,{level:"title-sm",children:p.address||p.title||"this property"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:[null!=p.priceGbp?"\xa3".concat(p.priceGbp.toLocaleString()):null,null!=p.bedrooms?"".concat(p.bedrooms," bed"):null].filter(Boolean).join(" \xb7 ")||"Details limited"}),f&&(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",sx:{mt:.5},children:"This listing has been removed from the portal. Search uses stored details."})]}),c.isPending&&(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,tr.jsx)(An,{size:"md"})}),c.isError&&(0,tr.jsx)(Gn,{color:"danger",level:"body-sm",children:"Couldn't find similar properties \u2014 please try again."}),!c.isPending&&!c.isError&&0===v.length&&(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No other properties on this board to compare against yet."}),(0,tr.jsx)(Mn,{spacing:1.5,children:v.map(e=>(0,tr.jsx)(OL,{result:e},e.houseId))})]})]})}function OL(e){var t;let r=e.result;const n=IM(r.houseId).data,i=ie(),a=(0,o.useMemo)(()=>Math.round(100*r.similarityScore),[r.similarityScore]),s=a>=75?"success":a>=50?"warning":"neutral";return(0,tr.jsxs)(hi,{variant:"outlined",sx:{p:1.5},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:1},children:[(0,tr.jsxs)(Tr,{sx:{minWidth:0,flex:1},children:[(0,tr.jsx)(hc,{level:"title-sm",onClick:()=>i("/house/".concat(r.houseId)),sx:{cursor:"pointer"},endDecorator:(0,tr.jsx)(ML.A,{fontSize:"small"}),children:null!==(t=null===n||void 0===n?void 0:n.title)&&void 0!==t?t:"View property"}),n&&(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:n.address})]}),(0,tr.jsxs)(Ti,{size:"sm",color:s,variant:"soft",children:[a,"%"]})]}),(0,tr.jsx)(Gn,{level:"body-sm",sx:{mt:.75},children:r.rationale})]})}function FL(e){let t=e.photos;const r=(0,o.useState)(0),n=(0,s.A)(r,2),i=n[0],a=n[1];return t&&0!==t.length?(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Io,{ratio:"4/3",sx:{borderRadius:"lg",overflow:"hidden",mb:1},children:(0,tr.jsx)("img",{src:t[i],alt:"property",style:{objectFit:"cover",width:"100%",height:"100%"}})}),t.length>1&&(0,tr.jsx)(Tr,{sx:{display:"flex",gap:1,overflowX:"auto",pb:.5},children:t.map((e,t)=>(0,tr.jsx)(Tr,{onClick:()=>a(t),sx:{width:72,height:54,flexShrink:0,cursor:"pointer",borderRadius:"sm",overflow:"hidden",border:"2px solid",borderColor:t===i?"primary.500":"transparent"},children:(0,tr.jsx)("img",{src:e,alt:"",style:{width:"100%",height:"100%",objectFit:"cover"}})},t))})]}):null}const NL=["status","variant","size"];function BL(e){let t=e.status,r=e.variant,n=void 0===r?"soft":r,o=e.size,i=void 0===o?"sm":o,a=(0,Ic.A)(e,NL);const s=function(e){if(!e)return aj.saved;const t=e.toLowerCase();return t in aj?aj[t]:{label:e.charAt(0).toUpperCase()+e.slice(1),color:"neutral"}}(t);return(0,tr.jsx)(Ti,(0,Ae.A)((0,Ae.A)({variant:n,size:i,color:s.color},a),{},{children:s.label}))}function HL(e){let t=e.house,r=e.aiSearch,n=e.onMoreLikeThis;return(0,tr.jsxs)(AM,{container:!0,spacing:3,sx:{mb:4},children:[(0,tr.jsx)(AM,{xs:12,md:7,children:(0,tr.jsx)(FL,{photos:t.photos})}),(0,tr.jsx)(AM,{xs:12,md:5,children:(0,tr.jsxs)(Mn,{spacing:2.5,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"h2",fontWeight:"xl",sx:{mb:.5},children:(o=t.priceGbp,null==o?"Price N/A":0===o?"Price on application":o.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0}))}),(0,tr.jsxs)(Mn,{direction:"row",spacing:2,flexWrap:"wrap",children:[(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(IA.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-sm",children:null==t.bedrooms?"? beds":"".concat(t.bedrooms," beds")})]}),(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(PA.A,{fontSize:"small"}),(0,tr.jsxs)(Gn,{level:"body-sm",children:[t.bathrooms," baths"]})]}),Number(t.floorSpaceSqm)>0&&(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(RA.A,{fontSize:"small"}),(0,tr.jsxs)(Gn,{level:"body-sm",children:[t.floorSpaceSqm,"m\xb2"]})]})]})]}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(hc,{level:"h4",href:t.link,target:"_blank",rel:"noopener noreferrer",underline:"hover",color:"neutral",sx:{mb:.5,display:"block"},children:t.title}),(0,tr.jsx)(Gn,{level:"body-md",textColor:"text.secondary",children:t.address})]}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,children:[(0,tr.jsx)(BL,{status:t.status}),t.propertyType&&(0,tr.jsx)(Ti,{variant:"soft",color:"neutral",size:"sm",children:t.propertyType}),t.addedOn&&(0,tr.jsxs)(Ti,{variant:"outlined",color:"neutral",size:"sm",children:["Added ",t.addedOn]})]}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1,flexWrap:"wrap",useFlexGap:!0,children:[(0,tr.jsx)(wo,{component:"a",href:t.link,target:"_blank",rel:"noopener noreferrer",startDecorator:(0,tr.jsx)(ML.A,{}),variant:"solid",color:"primary",children:"Visit listing"}),r&&(0,tr.jsx)(bA,{title:"Find similar properties on this board",children:(0,tr.jsx)(wo,{startDecorator:(0,tr.jsx)(Uz.A,{}),variant:"outlined",color:"neutral",onClick:n,children:"More like this"})})]})]})})]});var o}var WL=r(8563),VL=r(8850),$L=r(7912);const UL=e=>{const t=Ma().getIdToken;return ql({queryKey:["getPriceHistory",e],queryFn:async()=>{const r=await t();if(!r)return{points:[]};const n=await fetch("".concat(IW,"/api/house/").concat(e,"/price-history"),{headers:{Authorization:r}});return n.ok?await n.json():{points:[]}},enabled:!!e,staleTime:3e5})};var qL=r(1361),KL=r(9626),GL=r(8256);const JL={MET:{color:"success",Icon:qL.A},PARTIAL:{color:"warning",Icon:KL.A},UNMET:{color:"danger",Icon:GL.A}};function QL(e){let t=e.criteria,r=e.maxChips,n=void 0===r?5:r;if(!t||0===t.length)return null;const o=t.slice(0,n);return(0,tr.jsx)(Mn,{direction:"row",flexWrap:"wrap",gap:.5,children:o.map(e=>{const t=JL[e.status];if(!t)return(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",children:e.label},e.key);const r=t.color,n=t.Icon;return(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:r,startDecorator:(0,tr.jsx)(n,{sx:{fontSize:14}}),children:e.label},e.key)})})}function YL(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""}function XL(e){let t=e.schools;const r=o.useMemo(()=>[...null!==t&&void 0!==t?t:[]].sort((e,t)=>{var r,n;return(null!==(r=e.distanceMiles)&&void 0!==r?r:999)-(null!==(n=t.distanceMiles)&&void 0!==n?n:999)}),[t]),n=r.slice(0,5);return(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,sx:{mb:1.5},children:[(0,tr.jsx)(AA.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"Nearby Schools"}),r.length>0&&(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"neutral",children:[r.length," ",1===r.length?"school":"schools"]})]}),0===r.length?(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,sx:{color:"text.tertiary"},children:[(0,tr.jsx)(jA.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"School data not yet available."})]}):(0,tr.jsx)(Ui,{variant:"outlined",sx:{borderRadius:"sm","--ListItem-paddingY":"0.75rem"},children:n.map((e,t)=>{const r=function(e){const t=(e||"").toLowerCase();return"outstanding"===t?"success":"good"===t?"primary":"requires improvement"===t?"warning":"inadequate"===t?"danger":null}(e.ofstedRating);return(0,tr.jsxs)(o.Fragment,{children:[t>0&&(0,tr.jsx)(Ep,{}),(0,tr.jsx)(ta,{children:(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},sx:{width:"100%"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",gap:1,children:[(0,tr.jsx)(Gn,{level:"title-sm",sx:{minWidth:0,flex:1},children:e.name}),(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:.75,flexWrap:"wrap",children:[r&&e.ofstedRating&&(0,tr.jsx)(Ti,{size:"sm",color:r,variant:"soft",children:e.ofstedRating}),e.type&&(0,tr.jsx)(Ti,{size:"sm",variant:"outlined",color:"neutral",children:YL(e.type)}),null!=e.distanceMiles&&(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"text.tertiary",children:[e.distanceMiles.toFixed(1)," mi"]})]})]})})]},"".concat(e.name,"-").concat(t))})})]})}function ZL(e){return xr("MuiAccordion",e)}const eO=wr("MuiAccordion",["root","expanded","disabled"]);const tO=o.createContext({});function rO(e){return xr("MuiAccordionDetails",e)}const nO=wr("MuiAccordionDetails",["root","content","expanded"]),oO=["accordionId","component","color","children","defaultExpanded","disabled","expanded","onChange","variant","slots","slotProps"],iO=Qr(Qi,{name:"JoyAccordion",slot:"Root",overridesResolver:(e,t)=>t.root})({borderBottom:"var(--Accordion-borderBottom)","&[data-first-child]":{"--ListItem-radius":"var(--unstable_List-childRadius) var(--unstable_List-childRadius) 0 0"},"&[data-last-child]":{"--ListItem-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)",'& [aria-expanded="true"]':{"--ListItem-radius":"0"},["& .".concat(nO.root)]:{"--AccordionDetails-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)"}},"&:not([data-first-child]):not([data-last-child])":{"--ListItem-radius":"0"}}),aO=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAccordion"}),n=r.accordionId,i=r.component,a=void 0===i?"div":i,l=r.color,c=void 0===l?"neutral":l,d=r.children,u=r.defaultExpanded,h=void 0!==u&&u,p=r.disabled,v=void 0!==p&&p,f=r.expanded,m=r.onChange,g=r.variant,y=void 0===g?"plain":g,b=r.slots,x=void 0===b?{}:b,w=r.slotProps,S=void 0===w?{}:w,k=(0,Ie.A)(r,oO),_=gi(n),C=KC({controlled:f,default:h,name:"Accordion",state:"expanded"}),A=(0,s.A)(C,2),j=A[0],I=A[1],P=o.useCallback(e=>{I(!j),m&&m(e,!j)},[j,m,I]),R=o.useMemo(()=>({accordionId:_,expanded:j,disabled:v,toggle:P}),[_,j,v,P]),T=(0,je.A)({},k,{component:a,slots:x,slotProps:S}),E=(0,je.A)({},r,{component:a,color:c,variant:y,expanded:j,disabled:v,nested:!0}),z=(e=>{const t=e.variant,r=e.color;return Dr({root:["root",e.expanded&&"expanded",e.disabled&&"disabled",r&&"color".concat(Le(r)),t&&"variant".concat(Le(t))]},ZL,{})})(E),D=pn("root",{ref:t,className:z.root,elementType:iO,externalForwardedProps:T,ownerState:E}),M=(0,s.A)(D,2),L=M[0],O=M[1];return(0,tr.jsx)(tO.Provider,{value:R,children:(0,tr.jsx)(L,(0,je.A)({},O,{children:o.Children.map(d,(e,t)=>o.isValidElement(e)&&0===t?o.cloneElement(e,{"data-first-child":""}):e)}))})}),sO=aO,lO=["component","children","color","variant","slots","slotProps"],cO=Qr("div",{name:"JoyAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n;return(0,je.A)({overflow:"hidden",borderRadius:"var(--AccordionDetails-radius)",display:"grid",gridTemplateRows:"1fr",marginInline:"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",transition:"var(--AccordionDetails-transition)"},null==(n=r.variants[t.variant])?void 0:n[t.color],{["&:not(.".concat(nO.expanded,")")]:{gridTemplateRows:"0fr"}})}),dO=Qr("div",{name:"JoyAccordionDetails",slot:"Content",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",overflow:"hidden",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",paddingBlockStart:"calc(var(--ListItem-paddingY) / 2)",paddingBlockEnd:"calc(2.5 * var(--ListItem-paddingY))",transition:"var(--AccordionDetails-transition)",["&:not(.".concat(nO.expanded,")")]:{paddingBlock:0}}),uO=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAccordionDetails"}),n=r.component,i=void 0===n?"div":n,a=r.children,l=r.color,c=void 0===l?"neutral":l,d=r.variant,u=void 0===d?"plain":d,h=r.slots,p=void 0===h?{}:h,v=r.slotProps,f=void 0===v?{}:v,m=(0,Ie.A)(r,lO),g=o.useContext(tO),y=g.accordionId,b=g.expanded,x=void 0!==b&&b,w=o.useRef(null),S=rn(w,t);o.useEffect(()=>{if(w.current){w.current.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])').forEach(e=>{if(x){const t=e.getAttribute("data-prev-tabindex"),r=e.getAttribute("tabindex");r&&t&&(e.setAttribute("tabindex",t),e.removeAttribute("data-prev-tabindex")),t||r||e.removeAttribute("tabindex")}else e.setAttribute("data-prev-tabindex",e.getAttribute("tabindex")||""),e.setAttribute("tabindex","-1")})}},[x]);const k=(0,je.A)({},m,{component:i,slots:p,slotProps:f}),_=(0,je.A)({},r,{component:i,color:c,variant:u,expanded:x,nesting:!0}),C=(e=>{const t=e.expanded;return Dr({root:["root",t&&"expanded"],content:["content",t&&"expanded"]},rO,{})})(_),A=pn("root",{ref:S,className:C.root,elementType:cO,externalForwardedProps:k,additionalProps:{id:"".concat(y,"-details"),"aria-labelledby":"".concat(y,"-summary"),role:"region",hidden:!x||void 0},ownerState:_}),j=(0,s.A)(A,2),I=j[0],P=j[1],R=pn("content",{className:C.content,elementType:dO,externalForwardedProps:k,ownerState:_}),T=(0,s.A)(R,2),E=T[0],z=T[1];return(0,tr.jsx)(I,(0,je.A)({},P,{children:(0,tr.jsx)(E,(0,je.A)({},z,{children:a}))}))}),hO=uO;function pO(e){return xr("MuiAccordionGroup",e)}wr("MuiAccordionGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const vO=["component","color","children","disableDivider","variant","transition","size","slots","slotProps"],fO=Qr(Wi,{name:"JoyAccordionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState,n={};return r.transition&&("string"===typeof r.transition&&(n={"--AccordionDetails-transition":"grid-template-rows ".concat(r.transition,", padding-block ").concat(r.transition)}),"object"===typeof r.transition&&(n={"--AccordionDetails-transition":"grid-template-rows ".concat(r.transition.initial,", padding-block ").concat(r.transition.initial),["& .".concat(nO.root,".").concat(nO.expanded)]:{"--AccordionDetails-transition":"grid-template-rows ".concat(r.transition.expanded,", padding-block ").concat(r.transition.expanded)}})),(0,je.A)({"--List-padding":"0px","--ListDivider-gap":"0px"},n,!r.disableDivider&&{["& .".concat(eO.root,":not([data-last-child])")]:{"--Accordion-borderBottom":"1px solid ".concat(t.vars.palette.divider)}})}),mO=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAccordionGroup"}),n=r.component,o=void 0===n?"div":n,i=r.color,a=void 0===i?"neutral":i,l=r.children,c=r.disableDivider,d=void 0!==c&&c,u=r.variant,h=void 0===u?"plain":u,p=r.transition,v=void 0===p?"0.2s ease":p,f=r.size,m=void 0===f?"md":f,g=r.slots,y=void 0===g?{}:g,b=r.slotProps,x=void 0===b?{}:b,w=(0,Ie.A)(r,vO),S=(0,je.A)({},w,{component:o,slots:y,slotProps:x}),k=(0,je.A)({},r,{component:o,color:a,disableDivider:d,variant:h,transition:v,size:m}),_=(e=>{const t=e.variant,r=e.color,n=e.size;return Dr({root:["root",t&&"variant".concat(Le(t)),r&&"color".concat(Le(r)),n&&"size".concat(Le(n))]},pO,{})})(k),C=pn("root",{ref:t,className:_.root,elementType:fO,externalForwardedProps:S,ownerState:k}),A=(0,s.A)(C,2),j=A[0],I=A[1];return(0,tr.jsx)(j,(0,je.A)({},I,{children:(0,tr.jsx)(Ni,{children:l})}))}),gO=mO;function yO(e){return xr("MuiAccordionSummary",e)}const bO=wr("MuiAccordionSummary",["root","button","indicator","disabled","expanded"]),xO=Vo((0,tr.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");var wO;const SO=["component","color","children","indicator","variant","slots","slotProps"],kO=Qr(Qi,{name:"JoyAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>({fontWeight:e.theme.vars.fontWeight.md,gap:"calc(var(--ListItem-paddingX, 0.75rem) + 0.25rem)",["&.".concat(bO.expanded)]:{"--Icon-color":"currentColor"}})),_O=Qr(xp,{name:"JoyAccordionSummary",slot:"Button",overridesResolver:(e,t)=>t.button})({gap:"inherit",fontWeight:"inherit",justifyContent:"space-between",font:"inherit","&:focus-visible":{zIndex:1},[".".concat(bO.root," &")]:{"--unstable_ListItem-flex":"1 0 0%"}}),CO=Qr("span",{name:"JoyAccordionSummary",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})({display:"inline-flex",["&.".concat(bO.expanded)]:{transform:"rotate(180deg)"}}),AO=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyAccordionSummary"}),n=r.component,i=void 0===n?"div":n,a=r.color,l=void 0===a?"neutral":a,c=r.children,d=r.indicator,u=void 0===d?wO||(wO=(0,tr.jsx)(xO,{})):d,h=r.variant,p=void 0===h?"plain":h,v=r.slots,f=void 0===v?{}:v,m=r.slotProps,g=void 0===m?{}:m,y=(0,Ie.A)(r,SO),b=o.useContext(tO),x=b.accordionId,w=b.disabled,S=void 0!==w&&w,k=b.expanded,_=void 0!==k&&k,C=b.toggle,A=(0,je.A)({},y,{component:i,slots:f,slotProps:g}),j=(0,je.A)({},r,{component:i,color:l,disabled:S,expanded:_,variant:p}),I=(e=>{const t=e.disabled,r=e.expanded;return Dr({root:["root",t&&"disabled",r&&"expanded"],button:["button",t&&"disabled",r&&"expanded"],indicator:["indicator",t&&"disabled",r&&"expanded"]},yO,{})})(j),P=pn("root",{ref:t,className:I.root,elementType:kO,externalForwardedProps:A,ownerState:j}),R=(0,s.A)(P,2),T=R[0],E=R[1],z=pn("button",{ref:t,className:I.button,elementType:_O,externalForwardedProps:A,additionalProps:{component:"button",id:"".concat(x,"-summary"),"aria-expanded":_?"true":"false","aria-controls":"".concat(x,"-details"),disabled:S,type:"button",onClick:e=>{var t,r,n,o;(C&&C(e),"function"===typeof g.button)?null==(t=g.button(j))||null==(r=t.onClick)||r.call(t,e):null==(n=g.button)||null==(o=n.onClick)||o.call(n,e)}},ownerState:j}),D=(0,s.A)(z,2),M=D[0],L=D[1],O=pn("indicator",{ref:t,className:I.indicator,elementType:CO,externalForwardedProps:A,ownerState:j}),F=(0,s.A)(O,2),N=F[0],B=F[1];return(0,tr.jsx)(T,(0,je.A)({},E,{children:(0,tr.jsxs)(M,(0,je.A)({},L,{children:[c,u&&(0,tr.jsx)(N,(0,je.A)({},B,{children:u}))]}))}))}),jO=AO;var IO=r(9758),PO=r(5941),RO=r(2645);function TO(e){return e<30?"Low":e<=70?"Medium":"High"}function EO(e){const t=(e||"").toLowerCase().trim();return t&&"very low"!==t&&"low"!==t?"medium"===t?"warning":"danger":"success"}function zO(e){const t=(e||"").toLowerCase();return t.includes("approved")||t.includes("granted")?"success":t.includes("refused")||t.includes("rejected")?"danger":t.includes("pending")||t.includes("awaiting")||t.includes("under")?"warning":"neutral"}function DO(e,t){return e?e.length>t?"".concat(e.slice(0,t-1).trimEnd(),"\u2026"):e:""}function MO(e){var t;let r=e.crimeRatePer1000,n=e.floodRisk,o=e.planningApplications;const i=null!=r,a=null!=n&&n.length>0,s=(null!==o&&void 0!==o?o:[]).slice(0,5);return(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"title-md",sx:{mb:1.5},children:"Neighbourhood"}),(0,tr.jsxs)(Mn,{spacing:2,children:[i&&(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,sx:{mb:.5},children:[(0,tr.jsx)(IO.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Crime rate"})]}),(0,tr.jsx)(AE,{determinate:!0,value:Math.min(r/120*100,100),color:(c=r,c<30?"success":c<=70?"warning":"danger"),sx:{my:.75}}),(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"text.secondary",children:[r," crimes per 1,000 residents \u2014 ",TO(r)," crime area"]})]}),i&&a&&(0,tr.jsx)(nc,{}),a&&(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,flexWrap:"wrap",children:[(0,tr.jsx)(PO.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Flood risk:"}),(0,tr.jsx)(Ti,{size:"sm",color:EO(n),variant:"soft",children:(l=n,(l||"").toLowerCase().trim()?"".concat(function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}(l)," risk"):"Low risk")}),(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:["(",n,")"]})]}),(i||a)&&s.length>0&&(0,tr.jsx)(nc,{}),s.length>0&&(0,tr.jsx)(gO,{variant:"outlined",sx:{borderRadius:"sm"},children:(0,tr.jsxs)(sO,{children:[(0,tr.jsx)(jO,{children:(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,children:[(0,tr.jsx)(RO.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-sm",children:null!=o&&o.length>5?"Planning Applications (showing ".concat(5," of ").concat(o.length,")"):"Planning Applications (".concat(null!==(t=null===o||void 0===o?void 0:o.length)&&void 0!==t?t:0,")")})]})}),(0,tr.jsx)(hO,{children:(0,tr.jsx)(Mn,{spacing:1.25,children:s.map((e,t)=>(0,tr.jsxs)(Tr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:1.5},children:[(0,tr.jsxs)(Tr,{sx:{minWidth:0,flex:1},children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:e.reference}),e.description&&(0,tr.jsx)(Gn,{level:"body-sm",children:DO(e.description,100)})]}),(0,tr.jsxs)(Mn,{alignItems:"flex-end",gap:.5,sx:{flexShrink:0},children:[e.status&&(0,tr.jsx)(Ti,{size:"sm",color:zO(e.status),variant:"soft",children:e.status}),e.date&&"null"!==e.date&&(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:e.date})]})]},"".concat(e.reference,"-").concat(t)))})})]})}),!i&&!a&&0===s.length&&(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"Neighbourhood data not yet available."})]})]});var l,c}function LO(e){return xr("MuiTable",e)}wr("MuiTable",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","stickyHeader","stickyFooter","noWrap","hoverRow","borderAxisNone","borderAxisX","borderAxisXBetween","borderAxisY","borderAxisYBetween","borderAxisBoth","borderAxisBothBetween"]);const OO=["className","component","children","borderAxis","hoverRow","noWrap","size","variant","color","stripe","stickyHeader","stickyFooter","slots","slotProps"],FO={getColumnExceptFirst:()=>"& tr > *:not(:first-of-type), & tr > th + td, & tr > td + th",getCell:()=>"& th, & td",getHeadCell:()=>"& th",getHeaderCell:()=>"& thead th",getHeaderCellOfRow:e=>"& thead tr:nth-of-type(".concat(e,") th"),getBottomHeaderCell:()=>"& thead th:not([colspan])",getHeaderNestedFirstColumn:()=>"& thead tr:not(:first-of-type) th:not([colspan]):first-of-type",getDataCell:()=>"& td",getDataCellExceptLastRow:()=>"& tr:not(:last-of-type) > td",getBodyCellExceptLastRow(){return"".concat(this.getDataCellExceptLastRow(),', & tr:not(:last-of-type) > th[scope="row"]')},getBodyCellOfRow:e=>"number"===typeof e&&e<0?"& tbody tr:nth-last-of-type(".concat(Math.abs(e),") td, & tbody tr:nth-last-of-type(").concat(Math.abs(e),') th[scope="row"]'):"& tbody tr:nth-of-type(".concat(e,") td, & tbody tr:nth-of-type(").concat(e,') th[scope="row"]'),getBodyRow:e=>void 0===e?"& tbody tr":"& tbody tr:nth-of-type(".concat(e,")"),getFooterCell:()=>"& tfoot th, & tfoot td",getFooterFirstRowCell:()=>"& tfoot tr:not(:last-of-type) th, & tfoot tr:not(:last-of-type) td"},NO=Qr("table",{name:"JoyTable",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a,s,l,c;const d=null==(n=t.variants[r.variant])?void 0:n[r.color];return[(0,je.A)({"--Table-headerUnderlineThickness":"2px","--TableCell-borderColor":null!=(o=null==d?void 0:d.borderColor)?o:t.vars.palette.divider,"--TableCell-headBackground":"var(--Sheet-background, ".concat(t.vars.palette.background.surface,")")},"sm"===r.size&&{"--unstable_TableCell-height":"var(--TableCell-height, 32px)","--TableCell-paddingX":"0.25rem","--TableCell-paddingY":"0.25rem"},"md"===r.size&&{"--unstable_TableCell-height":"var(--TableCell-height, 40px)","--TableCell-paddingX":"0.5rem","--TableCell-paddingY":"0.375rem"},"lg"===r.size&&{"--unstable_TableCell-height":"var(--TableCell-height, 48px)","--TableCell-paddingX":"0.75rem","--TableCell-paddingY":"0.5rem"},{tableLayout:"fixed",width:"100%",borderSpacing:"0px",borderCollapse:"separate",borderRadius:"var(--TableCell-cornerRadius, var(--unstable_actionRadius))"},t.typography["body-".concat({sm:"xs",md:"sm",lg:"md"}[r.size])],null==(i=t.variants[r.variant])?void 0:i[r.color],{"& caption":{color:t.vars.palette.text.tertiary,padding:"calc(2 * var(--TableCell-paddingY)) var(--TableCell-paddingX)"},[FO.getDataCell()]:(0,je.A)({padding:"var(--TableCell-paddingY) var(--TableCell-paddingX)",height:"var(--unstable_TableCell-height)",borderColor:"var(--TableCell-borderColor)",backgroundColor:"var(--TableCell-dataBackground)"},r.noWrap&&{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}),[FO.getHeadCell()]:{textAlign:"left",padding:"var(--TableCell-paddingY) var(--TableCell-paddingX)",backgroundColor:"var(--TableCell-headBackground)",height:"var(--unstable_TableCell-height)",fontWeight:t.vars.fontWeight.lg,borderColor:"var(--TableCell-borderColor)",color:t.vars.palette.text.secondary,textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},[FO.getHeaderCell()]:{verticalAlign:"bottom","&:first-of-type":{borderTopLeftRadius:"var(--TableCell-cornerRadius, var(--unstable_actionRadius))"},"&:last-of-type":{borderTopRightRadius:"var(--TableCell-cornerRadius, var(--unstable_actionRadius))"}},"& tfoot tr > *":{backgroundColor:"var(--TableCell-footBackground, ".concat(t.vars.palette.background.level1,")"),"&:first-of-type":{borderBottomLeftRadius:"var(--TableCell-cornerRadius, var(--unstable_actionRadius))"},"&:last-of-type":{borderBottomRightRadius:"var(--TableCell-cornerRadius, var(--unstable_actionRadius))"}}}),((null==(a=r.borderAxis)?void 0:a.startsWith("x"))||(null==(s=r.borderAxis)?void 0:s.startsWith("both")))&&{[FO.getHeaderCell()]:{borderBottomWidth:1,borderBottomStyle:"solid"},[FO.getBottomHeaderCell()]:{borderBottomWidth:"var(--Table-headerUnderlineThickness)",borderBottomStyle:"solid"},[FO.getBodyCellExceptLastRow()]:{borderBottomWidth:1,borderBottomStyle:"solid"},[FO.getFooterCell()]:{borderTopWidth:1,borderTopStyle:"solid"}},((null==(l=r.borderAxis)?void 0:l.startsWith("y"))||(null==(c=r.borderAxis)?void 0:c.startsWith("both")))&&{["".concat(FO.getColumnExceptFirst(),", ").concat(FO.getHeaderNestedFirstColumn())]:{borderLeftWidth:1,borderLeftStyle:"solid"}},("x"===r.borderAxis||"both"===r.borderAxis)&&{[FO.getHeaderCellOfRow(1)]:{borderTopWidth:1,borderTopStyle:"solid"},[FO.getBodyCellOfRow(-1)]:{borderBottomWidth:1,borderBottomStyle:"solid"},[FO.getFooterCell()]:{borderBottomWidth:1,borderBottomStyle:"solid"}},("y"===r.borderAxis||"both"===r.borderAxis)&&{"& tr > *:first-of-type":{borderLeftWidth:1,borderLeftStyle:"solid"},"& tr > *:last-of-type:not(:first-of-type)":{borderRightWidth:1,borderRightStyle:"solid"}},r.stripe&&{[FO.getBodyRow(r.stripe)]:{background:"var(--TableRow-stripeBackground, ".concat(t.vars.palette.background.level2,")"),color:t.vars.palette.text.primary}},r.hoverRow&&{[FO.getBodyRow()]:{"&:hover":{background:"var(--TableRow-hoverBackground, ".concat(t.vars.palette.background.level3,")")}}},r.stickyHeader&&{[FO.getHeaderCell()]:{position:"sticky",top:0,zIndex:t.vars.zIndex.table},[FO.getHeaderCellOfRow(2)]:{top:"var(--unstable_TableCell-height)"}},r.stickyFooter&&{[FO.getFooterCell()]:{position:"sticky",bottom:0,zIndex:t.vars.zIndex.table,color:t.vars.palette.text.secondary,fontWeight:t.vars.fontWeight.lg},[FO.getFooterFirstRowCell()]:{bottom:"var(--unstable_TableCell-height)"}}]}),BO=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyTable"}),n=r.className,o=r.component,i=r.children,a=r.borderAxis,l=void 0===a?"xBetween":a,c=r.hoverRow,d=void 0!==c&&c,u=r.noWrap,h=void 0!==u&&u,p=r.size,v=void 0===p?"md":p,f=r.variant,m=void 0===f?"plain":f,g=r.color,y=void 0===g?"neutral":g,b=r.stripe,x=r.stickyHeader,w=void 0!==x&&x,S=r.stickyFooter,k=void 0!==S&&S,_=r.slots,C=void 0===_?{}:_,A=r.slotProps,j=void 0===A?{}:A,I=(0,Ie.A)(r,OO),P=(0,je.A)({},r,{borderAxis:l,hoverRow:d,noWrap:h,component:o,size:v,color:y,variant:m,stripe:b,stickyHeader:w,stickyFooter:k}),R=(e=>{const t=e.size,r=e.variant,n=e.color,o=e.borderAxis;return Dr({root:["root",e.stickyHeader&&"stickyHeader",e.stickyFooter&&"stickyFooter",e.noWrap&&"noWrap",e.hoverRow&&"hoverRow",o&&"borderAxis".concat(Le(o)),r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),t&&"size".concat(Le(t))]},LO,{})})(P),T=(0,je.A)({},I,{component:o,slots:C,slotProps:j}),E=pn("root",{ref:t,className:(0,Pe.A)(R.root,n),elementType:NO,externalForwardedProps:T,ownerState:P}),z=(0,s.A)(E,2),D=z[0],M=z[1];return(0,tr.jsx)(Wn.Provider,{value:!0,children:(0,tr.jsx)(D,(0,je.A)({},M,{children:i}))})}),HO=BO;function WO(e){if(!e||"null"===e)return"\u2014";try{const t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString("en-GB",{month:"short",year:"numeric"})}catch(t){return"\u2014"}}function VO(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"\u2014"}function $O(e,t){const r=e.date&&"null"!==e.date?new Date(e.date).getTime():0;return(t.date&&"null"!==t.date?new Date(t.date).getTime():0)-r}function UO(e){let t=e.soldTransactions,r=e.avgPricePerSqf;const n=o.useMemo(()=>[...null!==t&&void 0!==t?t:[]].sort($O).slice(0,10),[t]),i=n.some(e=>null!=e.distanceMiles);return(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:1,sx:{mb:1.5},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,children:[(0,tr.jsx)(ij.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"Recent Sold Prices"})]}),null!=r&&(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"primary",children:["\xa3",r.toLocaleString("en-GB"),"/sqft avg nearby"]})]}),0===n.length?(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"No nearby sold price data available."}):(0,tr.jsx)(Qz,{variant:"outlined",sx:{borderRadius:"sm",overflow:"auto"},children:(0,tr.jsxs)(HO,{size:"sm",stripe:"odd",stickyHeader:!0,hoverRow:!0,children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{style:{minWidth:180},children:"Address"}),(0,tr.jsx)("th",{style:{minWidth:100},children:"Price"}),(0,tr.jsx)("th",{style:{minWidth:60},children:"Beds"}),(0,tr.jsx)("th",{style:{minWidth:90},children:"Type"}),(0,tr.jsx)("th",{style:{minWidth:90},children:"Date"}),i&&(0,tr.jsx)("th",{style:{minWidth:60},children:"Dist"})]})}),(0,tr.jsx)("tbody",{children:n.map((e,t)=>{return(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:e.address})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",fontWeight:"md",children:(r=e.price,r.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0}))})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:null!=e.bedrooms?e.bedrooms:"\u2014"})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:VO(e.type)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:WO(e.date)})}),i&&(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:null!=e.distanceMiles?"".concat(e.distanceMiles.toFixed(1)," mi"):"\u2014"})})]},"".concat(e.address,"-").concat(t));var r})})]})})]})}function qO(e){let t=e.title,r=e.subtitle,n=e.actions,o=e.children,i=e.sx;return(0,tr.jsxs)(Tr,{component:"section",sx:(0,Ae.A)({mb:4},i),children:[(t||n)&&(0,tr.jsxs)(Mn,{direction:"row",spacing:2,sx:{alignItems:"flex-start",justifyContent:"space-between",mb:r?.5:1.5},children:[t&&(0,tr.jsx)(Gn,{level:"title-lg",children:t}),n&&(0,tr.jsx)(Tr,{sx:{flexShrink:0},children:n})]}),r&&(0,tr.jsx)(Gn,{level:"body-sm",sx:{color:"text.tertiary",mb:1.5},children:r}),o]})}const KO=e=>{const t=(e||"").toUpperCase();return["A","B"].includes(t)?"success":["C","D"].includes(t)?"warning":"danger"},GO=e=>e&&{"1a":"Very Low","1b":"Very Low",2:"Low",3:"Moderate",4:"Good",5:"Very Good","6a":"Excellent","6b":"Excellent"}[e]||"",JO=e=>e.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0});function QO(e){let t=e.title;return(0,tr.jsx)(bA,{title:t,placement:"top",size:"sm",variant:"outlined",arrow:!0,children:(0,tr.jsx)(jA.A,{sx:{fontSize:14,color:"text.tertiary",cursor:"help",flexShrink:0}})})}function YO(e){let t=e.points;if(t.length<2)return null;const r=t[0],n=t[t.length-1],o=n.priceGbp-r.priceGbp,i=r.priceGbp>0?Math.round(o/r.priceGbp*100):0;return(0,tr.jsxs)(qO,{title:"Price History",sx:{mb:0},children:[(0,tr.jsxs)(Tr,{sx:{mb:1.5,px:2,py:1.25,bgcolor:"background.level1",borderRadius:"sm",display:"flex",flexWrap:"wrap",gap:2},children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"First recorded"}),(0,tr.jsx)(Gn,{level:"title-sm",children:JO(r.priceGbp)})]}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Last recorded"}),(0,tr.jsx)(Gn,{level:"title-sm",children:JO(n.priceGbp)})]}),(0,tr.jsxs)(Tr,{sx:{ml:{sm:"auto"}},children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Change"}),0===i?(0,tr.jsx)(Gn,{level:"title-sm",children:"Unchanged"}):(0,tr.jsxs)(Ti,{size:"sm",color:i<0?"danger":"success",variant:"soft",startDecorator:i<0?(0,tr.jsx)(CA.A,{fontSize:"small"}):(0,tr.jsx)($L.A,{fontSize:"small"}),children:[i>0?"+":"",i,"%"]})]})]}),(0,tr.jsx)(hi,{variant:"outlined",children:(0,tr.jsx)(Mn,{divider:(0,tr.jsx)(nc,{}),children:t.map((e,r)=>{const n=r>0?t[r-1]:null,o=n?e.priceGbp-n.priceGbp:0,i=n&&n.priceGbp>0?Math.round(o/n.priceGbp*100):0;return(0,tr.jsxs)(Tr,{sx:{px:2,py:1.25,display:"flex",justifyContent:"space-between",alignItems:"center",gap:2},children:[(0,tr.jsx)(Tr,{sx:{minWidth:0,flex:1},children:(0,tr.jsx)(Gn,{level:"body-sm",children:(a=e.checkedAt,new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}))})}),(0,tr.jsxs)(Tr,{sx:{textAlign:"right",display:"flex",alignItems:"center",gap:1},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:JO(e.priceGbp)}),n&&0!==i&&(0,tr.jsxs)(Ti,{size:"sm",color:i<0?"danger":"success",variant:"soft",children:[i>0?"+":"",i,"%"]})]})]},r);var a})})})]})}function XO(e){var t;let r=e.enrichment,n=e.houseId;const o=Ma().getIdToken,i=zl(),a=null!==(t=r.commuteResults)&&void 0!==t?t:[],s=$A().data,l=void 0===s?[]:s,c=(()=>{if(0===a.length)return"Peak-hour departure (next Monday)";const e=new Set;for(const t of a){const r=l.find(e=>e.id===t.destinationId);null!==r&&void 0!==r&&r.departureTime&&e.add(r.departureTime)}return 1===e.size?"Peak-hour departure (".concat(Array.from(e)[0],", next Monday)"):0===e.size?"Peak-hour departure (08:00, next Monday)":"Peak-hour departure \xb7 per-destination times"})(),d=Lk({mutationFn:async()=>{const e=await o();if(!e||!n)return null;return(await fetch("".concat(IW,"/api/house/").concat(n,"/enrich"),{method:"POST",headers:{Authorization:e}})).ok},onSuccess:()=>{i.invalidateQueries({queryKey:["getHouseEnrichment",n]})}});return(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,tr.jsx)(Gn,{level:"title-lg",children:"Location & Commute"}),(0,tr.jsx)(QO,{title:"Commute times are estimated for each destination's saved peak-hour departure time on the next weekday."})]}),r.ptal&&(0,tr.jsx)(hi,{variant:"soft",sx:{maxWidth:320,mb:1.5},children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:1,sx:{mb:.5},children:[(0,tr.jsx)(VL.A,{fontSize:"small",color:"primary"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Public Transport Accessibility (PTAL)"}),(0,tr.jsx)(QO,{title:"TfL's Public Transport Accessibility Level for London properties. Scored 1a (very poor) to 6b (excellent), based on walking distance to stops and service frequency. Only available for Greater London."})]}),(0,tr.jsxs)(Tr,{display:"flex",alignItems:"baseline",gap:1,children:[(0,tr.jsx)(Gn,{level:"h4",children:r.ptal}),GO(r.ptal)&&(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"text.secondary",children:["\u2014 ",GO(r.ptal)]})]})]})}),0===l.length?(0,tr.jsx)(hi,{variant:"outlined",children:(0,tr.jsx)(GR,{icon:(0,tr.jsx)(VL.A,{}),title:"No commute destinations set up",description:"Add the places you commute to and we'll estimate travel times for every property.",action:(0,tr.jsx)(wo,{component:kc,to:"/settings/destinations",variant:"soft",color:"primary",size:"sm",children:"Add destinations"}),sx:{py:4}})}):0===a.length?(0,tr.jsx)(hi,{variant:"outlined",children:(0,tr.jsx)(qC,{sx:{textAlign:"center",py:3},children:(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"Calculating commute times\u2026"})})}):(0,tr.jsxs)(hi,{variant:"outlined",children:[(0,tr.jsx)(Mn,{divider:(0,tr.jsx)(nc,{}),children:a.map(e=>(0,tr.jsxs)(Tr,{sx:{px:2,py:1.25,display:"flex",justifyContent:"space-between",alignItems:"center",gap:2},children:[(0,tr.jsxs)(Tr,{sx:{minWidth:0,flex:1},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:e.destinationName}),(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:[rj(e.transportMode)," ",tj(e.transportMode),"unavailable"!==e.dataSource&&" \xb7 via ".concat("tfl"===e.dataSource?"TfL":"Google Maps")]})]}),null!=e.durationMinutes?(0,tr.jsxs)(Ti,{size:"md",variant:"soft",color:"primary",children:[e.durationMinutes," min"]}):(0,tr.jsx)(Ti,{size:"md",variant:"soft",color:"warning",children:"Unavailable"})]},e.destinationId))}),(0,tr.jsxs)(Tr,{sx:{px:2,py:1,display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid",borderColor:"divider"},children:[(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",children:c}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",loading:d.isPending,disabled:!n,onClick:()=>d.mutate(),children:"Update"})]})]})]})}function ZO(e){let t=e.house,r=e.aiSearch;if(null==t.matchScore)return null;const n=Math.round(100*t.matchScore),o=cj(n);return(0,tr.jsx)(hi,{variant:"outlined",sx:{mb:2},children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",justifyContent:"space-between",mb:1,children:[(0,tr.jsx)(Gn,{level:"title-md",startDecorator:(0,tr.jsx)(TA.A,{}),children:"AI Match"}),(0,tr.jsxs)(Ti,{size:"sm",variant:"solid",color:o,"aria-label":"".concat(n,"% match"),children:[n,"%"]})]}),(0,tr.jsx)(AE,{determinate:!0,value:n,color:o,sx:{mb:1.5}}),(0,tr.jsx)(QL,{criteria:t.matchCriteria,maxChips:20}),t.matchRationale&&(0,tr.jsx)(Gn,{level:"body-sm",sx:{mt:1.5,color:"text.secondary"},children:t.matchRationale}),(null===r||void 0===r?void 0:r.requirementsText)&&(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(nc,{sx:{my:1.5}}),(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",children:['Based on your search: "',r.requirementsText,'"']})]})]})})}function eF(e){var t,r,n,o,i,a,s;let l=e.house,c=e.houseId,d=e.aiSearch;const u=WA(c),h=u.data,p=u.isLoading,v=UL(c).data,f=CL(c).data,m=(0,tr.jsx)(ZO,{house:l,aiSearch:d});if(p)return(0,tr.jsxs)(Mn,{spacing:2,children:[m,(0,tr.jsx)(uT,{variant:"rectangular",height:72,sx:{borderRadius:"md"}}),(0,tr.jsx)(uT,{variant:"rectangular",height:120,sx:{borderRadius:"md"}}),(0,tr.jsx)(uT,{variant:"rectangular",height:120,sx:{borderRadius:"md"}})]});if(!h){const e=(null!==f&&void 0!==f?f:[]).filter(e=>"ENRICHMENT_FAILED"===e.eventType).sort((e,t)=>t.occurredAt.localeCompare(e.occurredAt))[0],t=(null!==f&&void 0!==f?f:[]).filter(e=>"ENRICHED"===e.eventType).sort((e,t)=>t.occurredAt.localeCompare(e.occurredAt))[0];if(!!e&&(!t||e.occurredAt>t.occurredAt)){var g;const t="string"===typeof(null===e||void 0===e||null===(g=e.data)||void 0===g?void 0:g.error)?e.data.error:null;return(0,tr.jsxs)(Mn,{spacing:2,children:[m,(0,tr.jsx)(GR,{icon:(0,tr.jsx)(jA.A,{}),title:"Insights generation failed",description:(0,tr.jsxs)(tr.Fragment,{children:["We hit an error pulling neighbourhood data for this property. It will retry automatically on the next sweep.",t&&(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)("br",{}),(0,tr.jsx)("br",{}),"(",t,")"]})]})})]})}return(0,tr.jsxs)(Mn,{spacing:2,children:[m,(0,tr.jsx)(GR,{icon:(0,tr.jsx)(TA.A,{}),title:"Insights pending",description:"Insights are generated automatically after a property is saved."})]})}const y=!!h.energyRating;return(0,tr.jsxs)(Mn,{spacing:4,children:[m,y&&(0,tr.jsx)(qO,{title:"Energy Rating",sx:{mb:0},children:(0,tr.jsx)(AM,{container:!0,spacing:2,children:(0,tr.jsx)(AM,{xs:12,sm:6,md:4,children:(0,tr.jsx)(hi,{variant:"soft",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:1,sx:{mb:1},children:[(0,tr.jsx)(WL.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Energy Rating (EPC)"}),(0,tr.jsx)(QO,{title:"Energy Performance Certificate rating from A (most efficient) to G (least). Affects heating bills \u2014 a D or below often means higher running costs. Some mortgage lenders now require a minimum C."})]}),(0,tr.jsx)(Ti,{color:KO(h.energyRating),variant:"solid",size:"lg",children:h.energyRating})]})})})})}),(0,tr.jsx)(YO,{points:null!==(t=null===v||void 0===v?void 0:v.points)&&void 0!==t?t:[]}),(0,tr.jsx)(XO,{enrichment:h,houseId:c}),(0,tr.jsx)(XL,{schools:null!==(r=h.schools)&&void 0!==r?r:[]}),(0,tr.jsx)(MO,{crimeRatePer1000:null!==(n=h.crimeRatePer1000)&&void 0!==n?n:null,floodRisk:null!==(o=h.floodRisk)&&void 0!==o?o:null,planningApplications:null!==(i=h.planningApplications)&&void 0!==i?i:[]}),(0,tr.jsx)(UO,{soldTransactions:null!==(a=h.soldTransactions)&&void 0!==a?a:[],avgPricePerSqf:null!==(s=h.avgPricePerSqf)&&void 0!==s?s:null}),h.enrichedAt&&(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:["Insights last updated:"," ",new Date(h.enrichedAt).toLocaleDateString("en-GB",{dateStyle:"long"})]})]})}function tF(e){return xr("MuiFormHelperText",e)}wr("MuiFormHelperText",["root"]);const rF=["children","component","slots","slotProps"],nF=Qr("div",{name:"JoyFormHelperText",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme;return{"--Icon-fontSize":"calc(var(--FormHelperText-lineHeight) * 1em)",display:"flex",alignItems:"center",gap:"2px",fontFamily:t.vars.fontFamily.body,fontSize:"var(--FormHelperText-fontSize, ".concat(t.vars.fontSize.sm,")"),lineHeight:"var(--FormHelperText-lineHeight, ".concat(t.vars.lineHeight.sm,")"),color:"var(--FormHelperText-color, ".concat(t.vars.palette.text.tertiary,")"),margin:"var(--FormHelperText-margin, 0px)",[".".concat(yC.root," + &")]:{"--FormHelperText-margin":"0px"},[".".concat(dC.error," &")]:{"--Icon-color":"currentColor"}}}),oF=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyFormHelperText"}),n=r.children,i=r.component,a=r.slots,l=void 0===a?{}:a,c=r.slotProps,d=void 0===c?{}:c,u=(0,Ie.A)(r,rF),h=o.useRef(null),p=rn(h,t),v=o.useContext(lC),f=null==v?void 0:v.setHelperText;o.useEffect(()=>(null==f||f(h.current),()=>{null==f||f(null)}),[f]);const m=Dr({root:["root"]},tF,{}),g=(0,je.A)({},u,{component:i,slots:l,slotProps:d}),y=pn("root",{ref:p,elementType:nF,externalForwardedProps:g,ownerState:r,additionalProps:{as:i,id:null==v?void 0:v["aria-describedby"]},className:m.root}),b=(0,s.A)(y,2),x=b[0],w=b[1];return(0,tr.jsx)(x,(0,je.A)({},w,{children:n}))}),iF=e=>{const t=Ma().getIdToken,r=zl();return Lk({mutationFn:async r=>{const n=await t();if(!n||!e)return null;const o=await fetch("".concat(IW,"/api/house/").concat(e,"/notes"),{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify({notes:r})});if(!o.ok)throw new Error("Failed to save notes: ".concat(o.status));return await o.json()},onSuccess:()=>{r.invalidateQueries({queryKey:["getHouse",e]})}})};function aF(e){var t,r;let n=e.house,i=e.houseId;const a=null!==(t=n.notes)&&void 0!==t?t:"",l=(0,o.useState)(a),c=(0,s.A)(l,2),d=c[0],u=c[1],h=iF(i);(0,o.useEffect)(()=>{var e;u(null!==(e=n.notes)&&void 0!==e?e:"")},[n.notes]);const p=500-d.length,v=d!==(null!==(r=n.notes)&&void 0!==r?r:""),f=p<0;return(0,tr.jsxs)(hi,{children:[(0,tr.jsxs)(Tr,{sx:{mb:1},children:[(0,tr.jsx)(Gn,{level:"title-md",children:"Notes"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:"Add any notes or comments about this property."})]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(Mn,{spacing:2,sx:{my:1},children:[(0,tr.jsx)(HM,{size:"sm",minRows:4,sx:{mt:1.5},placeholder:"No notes yet\u2026",value:d,onChange:e=>u(e.target.value),disabled:h.isPending}),(0,tr.jsxs)(oF,{sx:{mt:.75,fontSize:"xs",color:f?"danger.500":void 0},children:[p," characters left"]})]}),(0,tr.jsx)(vR,{sx:{borderTop:"1px solid",borderColor:"divider"},children:(0,tr.jsxs)(cE,{sx:{alignSelf:"flex-end",pt:2},children:[(0,tr.jsx)(wo,{size:"sm",variant:"outlined",color:"neutral",onClick:()=>{var e;return u(null!==(e=n.notes)&&void 0!==e?e:"")},disabled:h.isPending||!v,children:"Cancel"}),(0,tr.jsx)(wo,{size:"sm",variant:"solid",onClick:()=>{f||h.mutate(0===d.length?null:d)},loading:h.isPending,disabled:f||!v,children:"Save"})]})})]})}function sF(){var e;const t=ae().houseId,r=ie(),n=Ma(),i=IM(t),a=i.data,l=i.isLoading,c=i.error,d=$z().data,u=QE().data,h=(0,o.useState)(!1),p=(0,s.A)(h,2),v=p[0],f=p[1],m=Ac(),g=(0,s.A)(m,2),y=g[0],b=g[1],x=null===d||void 0===d?void 0:d.find(e=>e.houses.some(e=>e.id===(null!==t&&void 0!==t?t:""))),w=null!==(e=null===u||void 0===u?void 0:u.find(e=>e.boardId===(null===x||void 0===x?void 0:x.id)))&&void 0!==e?e:null;(0,o.useEffect)(()=>{if("true"===y.get("moreLikeThis")&&w){f(!0);const e=new URLSearchParams(y);e.delete("moreLikeThis"),b(e,{replace:!0})}},[y,w,b]);const S=(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:n})});return l?(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[S,(0,tr.jsx)(Tr,{display:"flex",justifyContent:"center",py:8,children:(0,tr.jsx)(An,{})})]}):c||!a?(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[S,(0,tr.jsx)(GR,{icon:(0,tr.jsx)(jA.A,{}),title:c?"Something went wrong":"Property not found",description:c?c.message:"We couldn't find this property \u2014 it may have been removed.",action:(0,tr.jsx)(wo,{variant:"soft",color:"primary",onClick:()=>r("/dashboard"),children:"Back to dashboard"}),sx:{py:10}})]}):(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:null!==a&&void 0!==a&&a.address?"".concat(a.address," \u2014 Toppi"):"Property \u2014 Toppi",noIndex:!0}),S,(0,tr.jsxs)(Tr,{sx:{maxWidth:"1100px",mx:"auto",px:{xs:2,md:4},py:3},children:[(0,tr.jsxs)(ID,{size:"sm","aria-label":"breadcrumbs",separator:(0,tr.jsx)(jM.A,{fontSize:"small"}),sx:{mb:2},children:[(0,tr.jsx)(hc,{underline:"none",color:"neutral",onClick:()=>r("/dashboard"),sx:{cursor:"pointer"},children:(0,tr.jsx)(o_.A,{})}),(0,tr.jsx)(Gn,{level:"title-sm",color:"primary",children:"House"})]}),(0,tr.jsx)(HL,{house:a,aiSearch:w,onMoreLikeThis:()=>f(!0)}),(0,tr.jsxs)(OD,{defaultValue:0,sx:{bgcolor:"transparent"},children:[(0,tr.jsxs)(KD,{size:"sm",sx:{justifyContent:"flex-start",["&& .".concat(VD.root)]:{fontWeight:"600",flex:"initial",color:"text.tertiary",["&.".concat(VD.selected)]:{bgcolor:"transparent",color:"text.primary","&::after":{height:"2px",bgcolor:"primary.500"}}}},children:[(0,tr.jsx)(XD,{sx:{borderRadius:"6px 6px 0 0"},indicatorInset:!0,value:0,children:"Description"}),(0,tr.jsx)(XD,{sx:{borderRadius:"6px 6px 0 0"},indicatorInset:!0,value:1,children:"Insights"}),(0,tr.jsx)(XD,{sx:{borderRadius:"6px 6px 0 0"},indicatorInset:!0,value:2,children:"Notes"}),(0,tr.jsx)(XD,{sx:{borderRadius:"6px 6px 0 0"},indicatorInset:!0,value:3,children:"Events"})]}),(0,tr.jsx)(oM,{value:0,children:(0,tr.jsxs)(Mn,{spacing:3,children:[(0,tr.jsxs)(AM,{container:!0,spacing:2,children:[(0,tr.jsxs)(AM,{xs:12,sm:4,children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Added On"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:a.addedOn})]}),(0,tr.jsxs)(AM,{xs:12,sm:4,children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Property Type"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:a.propertyType})]}),(0,tr.jsxs)(AM,{xs:12,sm:4,children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Floor Space"}),(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"text.secondary",children:[a.floorSpaceFt," ft\xb2 / ",a.floorSpaceSqm," m\xb2"]})]})]}),a.keyFeatures&&(0,tr.jsx)(qO,{title:"Key Features",sx:{mb:0},children:(0,tr.jsx)(Gn,{level:"body-sm",children:a.keyFeatures})}),a.propertyDescription&&(0,tr.jsx)(qO,{title:"Description",sx:{mb:0},children:(0,tr.jsx)(Gn,{level:"body-sm",children:a.propertyDescription})})]})}),(0,tr.jsx)(oM,{value:1,children:(0,tr.jsx)(eF,{house:a,houseId:t,aiSearch:w})}),(0,tr.jsx)(oM,{value:2,children:(0,tr.jsx)(aF,{house:a,houseId:t})}),(0,tr.jsx)(oM,{value:3,children:(0,tr.jsx)(DL,{houseId:t})})]})]}),w&&t&&(0,tr.jsx)(LL,{open:v,onClose:()=>f(!1),aiSearchId:w.id,referenceHouseId:t})]})}var lF=r(8725);function cF(e){let t=e.open,r=e.boardName,n=e.propertyCount;const o=ie(),i=Wk();return(0,tr.jsx)(L_,{open:t,children:(0,tr.jsxs)(U_,{size:"lg",variant:"plain",layout:"center",sx:{maxWidth:500,textAlign:"center",p:4},children:[(0,tr.jsx)(Tr,{sx:{fontSize:56,mb:1},children:"\ud83c\udfe1"}),(0,tr.jsxs)(Gn,{level:"h3",mb:1,children:["You've just seen ",r]}),(0,tr.jsxs)(Gn,{level:"body-md",color:"neutral",mb:3,children:["That's ",n," properties, AI-ranked for someone else's criteria. What would Toppi find if it searched for ",(0,tr.jsx)("em",{children:"yours"}),"?"]}),(0,tr.jsxs)(Mn,{gap:1.5,children:[(0,tr.jsx)(wo,{size:"lg",color:"primary",fullWidth:!0,endDecorator:(0,tr.jsx)(lF.A,{}),onClick:()=>{i.mutate({skipped:!1}),o("/ai-search")},children:"Start my free AI search"}),(0,tr.jsx)(wo,{variant:"plain",color:"neutral",fullWidth:!0,onClick:()=>{o("/dashboard")},children:"Just browse the board for now"})]}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",mt:2,children:"Free to try \xb7 No credit card needed"})]})})}function dF(){const e=ae().token,t=ie(),r=Ma(),n=r.isAuthenticated,i=r.login,a=function(){const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e(),n=await fetch("".concat(IW,"/api/invite/").concat(t,"/accept"),{headers:{Authorization:null!==r&&void 0!==r?r:""}});if(!n.ok)throw new Error("Failed to accept invite");return n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:["board"]})}})}(),l=Hk(),c=l.data,d=l.isLoading,u=$z().data,h=o.useState(!1),p=(0,s.A)(h,2),v=p[0],f=p[1],m=o.useState(null),g=(0,s.A)(m,2),y=g[0],b=g[1],x=o.useState(null),w=(0,s.A)(x,2),S=w[0],k=w[1];if(o.useEffect(()=>{n&&e&&!v&&a.mutate(e,{onSuccess:e=>{var t;f(!0),b(null!==(t=null===e||void 0===e?void 0:e.boardId)&&void 0!==t?t:null)},onError:e=>{var t;k(null!==(t=e.message)&&void 0!==t?t:"Failed to accept invite")}})},[n,e]),o.useEffect(()=>{v&&!d&&c&&c.onboardingCompleted&&t("/dashboard")},[v,c,d,t]),!n)return(0,tr.jsxs)(Tr,{sx:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[(0,tr.jsx)(Gn,{level:"h3",children:"You need to sign in to accept this invite"}),(0,tr.jsx)(wo,{onClick:()=>i(),children:"Sign in"})]});if(a.isPending)return(0,tr.jsxs)(Tr,{sx:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[(0,tr.jsx)(An,{}),(0,tr.jsx)(Gn,{level:"body-md",children:"Accepting invite\u2026"})]});if(S)return(0,tr.jsxs)(Tr,{sx:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[(0,tr.jsx)(Gn,{level:"h3",color:"danger",children:"Invite error"}),(0,tr.jsx)(Gn,{level:"body-md",children:S}),(0,tr.jsx)(wo,{variant:"plain",onClick:()=>t("/dashboard"),children:"Go to dashboard"})]});if(v){var _,C,A;const e=y?null===u||void 0===u?void 0:u.find(e=>e.id===y):void 0,r=null!==(_=null===e||void 0===e?void 0:e.name)&&void 0!==_?_:"this board",n=null!==(C=null===e||void 0===e||null===(A=e.houses)||void 0===A?void 0:A.length)&&void 0!==C?C:0,o=!d&&c&&!c.onboardingCompleted;return(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(Tr,{sx:{height:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2},children:[(0,tr.jsx)(Gn,{level:"h3",color:"success",children:"You've joined the board!"}),(0,tr.jsx)(wo,{onClick:()=>t("/dashboard"),children:"Go to dashboard"})]}),o&&(0,tr.jsx)(cF,{open:!0,boardName:r,propertyCount:n})]})}return null}var uF=r(1638);const hF="data:image/svg+xml;utf8,"+encodeURIComponent('No photo'),pF=e=>null==e?"Price on request":0===e?"POA":e.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0});function vF(e){let t=e.property;const r=t.address,n=t.price,o=t.bedrooms,i=t.bathrooms,a=t.propertyType,s=t.photos,l=t.listingStatus,c=(null===s||void 0===s?void 0:s[0])||hF;return(0,tr.jsxs)(hi,{variant:"outlined",sx:{overflow:"hidden",height:"100%"},children:[(0,tr.jsx)(vR,{children:(0,tr.jsx)(Io,{ratio:"16/10",children:(0,tr.jsx)("img",{src:c,alt:r,loading:"lazy"})})}),(0,tr.jsxs)(qC,{sx:{gap:.75,p:2},children:[(0,tr.jsx)(Gn,{level:"title-lg",children:pF(n)}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",noWrap:!0,title:r,children:r}),(null!=o||null!=i)&&(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,sx:{color:"text.tertiary",flexWrap:"wrap",rowGap:.5},children:[null!=o&&(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(IA.A,{sx:{fontSize:16}}),(0,tr.jsx)(Gn,{level:"body-xs",children:o})]}),null!=i&&(0,tr.jsxs)(Mn,{direction:"row",spacing:.5,alignItems:"center",children:[(0,tr.jsx)(PA.A,{sx:{fontSize:16}}),(0,tr.jsx)(Gn,{level:"body-xs",children:i})]})]}),(a||"under_offer"===l)&&(0,tr.jsxs)(Mn,{direction:"row",gap:.75,mt:.5,flexWrap:"wrap",children:[a&&(0,tr.jsx)(Ti,{size:"sm",variant:"outlined",color:"neutral",children:(d=a,d?d.replace(/[_-]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()):"")}),"under_offer"===l&&(0,tr.jsx)(Ti,{size:"sm",color:"warning",variant:"soft",children:"Under offer"})]})]})]});var d}const fF="/".replace(/\/$/,"")||"/";function mF(){const e=function(e){var t,r,n,o,i,a;const s=ql({queryKey:["publicBoard",e],queryFn:async()=>{if(!e)throw new Error("shareToken is required");const t=await fetch("".concat(IW,"/api/share/").concat(e));if(404===t.status){const e=new Error("not_found");throw e.code="not_found",e}if(!t.ok)throw new Error("Failed to load shared board (HTTP ".concat(t.status,")"));return t.json()},enabled:!!e,retry:(e,t)=>"not_found"!==t.code&&e<2}),l=s.isError&&"not_found"===(null===(t=s.error)||void 0===t?void 0:t.code);return{boardName:null===(r=s.data)||void 0===r?void 0:r.boardName,properties:null!==(n=null===(o=s.data)||void 0===o?void 0:o.properties)&&void 0!==n?n:[],propertyCount:null!==(i=null===(a=s.data)||void 0===a?void 0:a.propertyCount)&&void 0!==i?i:0,isLoading:s.isLoading,isError:s.isError,notFound:l}}(ae().shareToken),t=e.boardName,r=e.properties,n=e.propertyCount,o=e.isLoading,i=e.notFound,a=e.isError;return(0,tr.jsxs)(Tr,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",bgcolor:"background.body"},children:[(0,tr.jsx)(Td,{title:t?"".concat(t," \u2014 shared board on Toppi"):"Shared board \u2014 Toppi",description:"A shared read-only property board on Toppi \u2014 the AI-powered UK property search assistant."}),(0,tr.jsx)(gF,{}),(0,tr.jsx)(Tr,{sx:{flex:1,pb:12},children:o?(0,tr.jsx)(bF,{}):i?(0,tr.jsx)(xF,{}):a?(0,tr.jsx)(wF,{}):(0,tr.jsxs)(Do,{maxWidth:"lg",sx:{py:4},children:[(0,tr.jsxs)(Mn,{spacing:1,sx:{mb:3},children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",flexWrap:"wrap",children:[(0,tr.jsx)(Gn,{level:"h3",children:t}),(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",startDecorator:(0,tr.jsx)(uF.A,{}),children:"Read only"})]}),(0,tr.jsxs)(Gn,{level:"body-sm",color:"neutral",children:[n," ",1===n?"property":"properties"]})]}),(0,tr.jsx)(Tr,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:2},children:r.map(e=>(0,tr.jsx)(vF,{property:e},e.id))})]})}),(0,tr.jsx)(yF,{})]})}function gF(){return(0,tr.jsx)(Qz,{variant:"outlined",sx:{px:3,py:1.5,display:"flex",alignItems:"center",borderTop:"none",borderLeft:"none",borderRight:"none"},children:(0,tr.jsx)(Tr,{component:"a",href:fF,sx:{display:"flex",alignItems:"center",textDecoration:"none",color:"inherit"},children:(0,tr.jsx)(Gn,{level:"h4",sx:{fontWeight:"lg"},children:"Toppi"})})})}function yF(){return(0,tr.jsxs)(Qz,{variant:"solid",color:"primary",invertedColors:!0,sx:{position:"fixed",bottom:0,left:0,right:0,px:3,py:2,display:"flex",alignItems:"center",gap:2,zIndex:1200,boxShadow:"lg"},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1.5,flex:1,minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",sx:{color:"inherit",display:{xs:"none",sm:"block"},flexShrink:0},children:"Toppi"}),(0,tr.jsx)(Gn,{level:"body-sm",sx:{color:"inherit"},noWrap:!0,children:"Build your own AI-powered shortlist"})]}),(0,tr.jsx)(wo,{component:"a",href:fF,size:"sm",variant:"solid",color:"neutral",startDecorator:(0,tr.jsx)(n_.A,{}),sx:{flexShrink:0},children:"Start a free AI search"})]})}function bF(){return(0,tr.jsxs)(Do,{maxWidth:"lg",sx:{py:4},children:[(0,tr.jsxs)(Mn,{spacing:1,sx:{mb:3},children:[(0,tr.jsx)(Gn,{level:"h3",children:(0,tr.jsx)(uT,{children:"Loading shared board name\u2026"})}),(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:(0,tr.jsx)(uT,{children:"Loading property count"})})]}),(0,tr.jsx)(Tr,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:2},children:Array.from({length:6}).map((e,t)=>(0,tr.jsxs)(hi,{variant:"outlined",sx:{overflow:"hidden"},children:[(0,tr.jsx)(Io,{ratio:"16/9",children:(0,tr.jsx)(uT,{variant:"rectangular"})}),(0,tr.jsxs)(Tr,{sx:{p:1.5},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:(0,tr.jsx)(uT,{children:"Loading address"})}),(0,tr.jsx)(Gn,{level:"body-sm",children:(0,tr.jsx)(uT,{children:"\xa3000,000 \xb7 0 bed"})})]})]},t))})]})}function xF(){return(0,tr.jsx)(SF,{icon:(0,tr.jsx)(uF.A,{sx:{fontSize:56,color:"neutral.400"}}),title:"Link unavailable",body:"This link has been revoked or is no longer active."})}function wF(){return(0,tr.jsx)(SF,{icon:(0,tr.jsx)(uF.A,{sx:{fontSize:56,color:"neutral.400"}}),title:"Couldn't load this board",body:"Something went wrong. Please try again in a moment."})}function SF(e){let t=e.icon,r=e.title,n=e.body;return(0,tr.jsxs)(Tr,{sx:{minHeight:"60vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1.5,px:3,textAlign:"center"},children:[t,(0,tr.jsx)(Gn,{level:"h4",children:r}),(0,tr.jsx)(Gn,{level:"body-md",color:"neutral",sx:{maxWidth:360},children:n})]})}function kF(){const e=ae().referralCode,t=ie();return(0,o.useEffect)(()=>{e&&localStorage.setItem(Nk,e),t("/",{replace:!0})},[e,t]),null}function _F(e){return xr("MuiButtonGroup",e)}wr("MuiButtonGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);const CF=["buttonFlex","className","component","disabled","size","color","variant","children","orientation","slots","slotProps","spacing"],AF=Qr("div")(e=>{let t=e.theme,r=e.ownerState;var n,o,i;const a=si({theme:t,ownerState:r},["borderRadius"]).borderRadius,s="vertical"===r.orientation?"var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius)":"var(--ButtonGroup-radius) var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius)",l="vertical"===r.orientation?"var(--unstable_childRadius) var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius)":"var(--unstable_childRadius) var(--ButtonGroup-radius) var(--ButtonGroup-radius) var(--unstable_childRadius)",c="vertical"===r.orientation?"calc(var(--ButtonGroup-separatorSize) * -1) 0 0 0":"0 0 0 calc(var(--ButtonGroup-separatorSize) * -1)",d={};iM(t.breakpoints,r.spacing,(e,r)=>{var n;null!==r&&e(d,{"--ButtonGroup-connected":r.toString().match(/^0(?!\.)/)?"1":"0",gap:"string"===typeof r?r:null==(n=t.spacing)?void 0:n.call(t,r)})});const u=null==(n=t.variants.outlined)?void 0:n[r.color],h=null==(o=t.variants.outlinedDisabled)?void 0:o[r.color],p=null==(i=t.variants.outlinedHover)?void 0:i[r.color];return[(0,je.A)({"--ButtonGroup-separatorSize":"outlined"===r.variant?"1px":"calc(var(--ButtonGroup-connected) * 1px)","--ButtonGroup-separatorColor":null==u?void 0:u.borderColor,"--ButtonGroup-radius":t.vars.radius.sm,"--Divider-inset":"0.5rem","--unstable_childRadius":"calc((1 - var(--ButtonGroup-connected)) * var(--ButtonGroup-radius) - var(--variant-borderWidth, 0px))"},d,{display:"flex",borderRadius:"var(--ButtonGroup-radius)",flexDirection:"vertical"===r.orientation?"column":"row","& > [data-first-child]":(0,je.A)({"--Button-radius":s,"--IconButton-radius":s},"horizontal"===r.orientation&&{borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},"vertical"===r.orientation&&{borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :not([data-first-child]):not([data-last-child]):not(:only-child)":(0,je.A)({"--Button-radius":"var(--unstable_childRadius)","--IconButton-radius":"var(--unstable_childRadius)",borderRadius:"var(--unstable_childRadius)"},"horizontal"===r.orientation&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderRight:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},"vertical"===r.orientation&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)",borderBottom:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > [data-last-child]":(0,je.A)({"--Button-radius":l,"--IconButton-radius":l},"horizontal"===r.orientation&&{borderLeft:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"},"vertical"===r.orientation&&{borderTop:"var(--ButtonGroup-separatorSize) solid var(--ButtonGroup-separatorColor)"}),"& > :only-child":{"--Button-radius":"var(--ButtonGroup-radius)","--IconButton-radius":"var(--ButtonGroup-radius)"},"& > :not([data-first-child]):not(:only-child)":{"--Button-margin":c,"--IconButton-margin":c},["& .".concat(uo.root,", & .").concat(K_.root)]:(0,je.A)({"&:not(:disabled)":{zIndex:1},"&:disabled":{"--ButtonGroup-separatorColor":null==h?void 0:h.borderColor}},"outlined"===r.variant&&{"&:hover":{"--ButtonGroup-separatorColor":null==p?void 0:p.borderColor}},{["&:hover, ".concat(t.focus.selector)]:{zIndex:2}})},r.buttonFlex&&{["& > *:not(.".concat(K_.root,")")]:{flex:r.buttonFlex},["& > :not(button) > .".concat(uo.root)]:{width:"100%"}}),void 0!==a&&{"--ButtonGroup-radius":a}]}),jF=Qr(AF,{name:"JoyButtonGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({}),IF=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyButtonGroup"}),n=r.buttonFlex,i=r.className,a=r.component,l=void 0===a?"div":a,c=r.disabled,d=void 0!==c&&c,u=r.size,h=void 0===u?"md":u,p=r.color,v=void 0===p?"neutral":p,f=r.variant,m=void 0===f?"outlined":f,g=r.children,y=r.orientation,b=void 0===y?"horizontal":y,x=r.slots,w=void 0===x?{}:x,S=r.slotProps,k=void 0===S?{}:S,_=r.spacing,C=void 0===_?0:_,A=(0,Ie.A)(r,CF),j=(0,je.A)({},r,{buttonFlex:n,color:v,component:l,orientation:b,spacing:C,size:h,variant:m}),I=(e=>{const t=e.size,r=e.variant,n=e.color;return Dr({root:["root",e.orientation,r&&"variant".concat(Le(r)),n&&"color".concat(Le(n)),t&&"size".concat(Le(t))]},_F,{})})(j),P=(0,je.A)({},A,{component:l,slots:w,slotProps:k}),R=pn("root",{ref:t,className:(0,Pe.A)(I.root,i),elementType:jF,externalForwardedProps:P,additionalProps:{role:"group"},ownerState:j}),T=(0,s.A)(R,2),E=T[0],z=T[1],D=o.useMemo(()=>({variant:m,color:v,size:h,disabled:d}),[m,v,h,d]);return(0,tr.jsx)(E,(0,je.A)({},z,{children:(0,tr.jsx)(ho.Provider,{value:D,children:o.Children.map(g,(e,t)=>{if(!o.isValidElement(e))return e;const r={};if(Ln(e,["Divider"])){var n,i;const t=e.props;r.inset=null!=(n=null==t?void 0:t.inset)?n:"context";const o="vertical"===b?"horizontal":"vertical";r.orientation=null!=(i=null==t?void 0:t.orientation)?i:o,r.role="presentation",r.component="span"}return o.Children.count(g)>1&&(0===t&&(r["data-first-child"]=""),t===o.Children.count(g)-1&&(r["data-last-child"]="")),o.cloneElement(e,r)})})}))}),PF=IF,RF=["checked","defaultChecked","disabled","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","id","color","variant","size","startDecorator","endDecorator","component","slots","slotProps"],TF=Qr("div",{name:"JoySwitch",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;var n;const o=(e=>{let t=e.theme,r=e.ownerState;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n,o,i;const a=(null==(n=t.variants["".concat(r.variant).concat(e.state||"")])?void 0:n[r.color])||{};return{"--Switch-trackBackground":null!=(o=a.backgroundColor)?o:t.vars.palette.background.surface,"--Switch-trackColor":a.color,"--Switch-trackBorderColor":"outlined"===r.variant?a.borderColor:"currentColor","--Switch-thumbBackground":a.color,"--Switch-thumbColor":null!=(i=a.backgroundColor)?i:t.vars.palette.background.surface}}})({theme:t,ownerState:r});return(0,je.A)({"--Icon-color":"currentColor","--variant-borderWidth":null==(n=t.variants[r.variant])||null==(n=n[r.color])?void 0:n["--variant-borderWidth"],"--Switch-trackRadius":t.vars.radius.xl,"--Switch-thumbShadow":"soft"===r.variant?"none":"0 0 0 1px var(--Switch-trackBackground)"},"sm"===r.size&&{"--Switch-trackWidth":"26px","--Switch-trackHeight":"16px","--Switch-thumbSize":"10px",fontSize:t.vars.fontSize.sm,gap:"var(--Switch-gap, 6px)"},"md"===r.size&&{"--Switch-trackWidth":"32px","--Switch-trackHeight":"20px","--Switch-thumbSize":"14px",fontSize:t.vars.fontSize.md,gap:"var(--Switch-gap, 8px)"},"lg"===r.size&&{"--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-thumbSize":"18px",gap:"var(--Switch-gap, 12px)"},{"--unstable_paddingBlock":"max((var(--Switch-trackHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Switch-thumbSize)) / 2, 0px)","--Switch-thumbRadius":"max(var(--Switch-trackRadius) - var(--unstable_paddingBlock), min(var(--unstable_paddingBlock) / 2, var(--Switch-trackRadius) / 2))","--Switch-thumbWidth":"var(--Switch-thumbSize)","--Switch-thumbOffset":"max((var(--Switch-trackHeight) - var(--Switch-thumbSize)) / 2, 0px)"},o(),{"&:hover":{"@media (hover: hover)":(0,je.A)({},o({state:"Hover"}))},["&.".concat(hC.checked)]:(0,je.A)({},o(),{"&:hover":{"@media (hover: hover)":(0,je.A)({},o({state:"Hover"}))}}),["&.".concat(hC.disabled)]:(0,je.A)({pointerEvents:"none",color:t.vars.palette.text.tertiary},o({state:"Disabled"})),display:"inline-flex",alignItems:"center",alignSelf:"center",fontFamily:t.vars.fontFamily.body,position:"relative",padding:"calc((var(--Switch-thumbSize) / 2) - (var(--Switch-trackHeight) / 2)) calc(-1 * var(--Switch-thumbOffset))",backgroundColor:"initial",border:"none",margin:"var(--unstable_Switch-margin)"})}),EF=Qr("div",{name:"JoySwitch",slot:"Action",overridesResolver:(e,t)=>t.action})(e=>{let t=e.theme;return{borderRadius:"var(--Switch-trackRadius)",position:"absolute",top:0,left:0,bottom:0,right:0,[t.focus.selector]:t.focus.default}}),zF=Qr("input",{name:"JoySwitch",slot:"Input",overridesResolver:(e,t)=>t.input})({margin:0,height:"100%",width:"100%",opacity:0,position:"absolute",cursor:"pointer"}),DF=Qr("span",{name:"JoySwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({position:"relative",color:"var(--Switch-trackColor)",height:"var(--Switch-trackHeight)",width:"var(--Switch-trackWidth)",display:"flex",flexShrink:0,justifyContent:"space-between",alignItems:"center",boxSizing:"border-box",border:"var(--variant-borderWidth, 0px) solid",borderColor:"var(--Switch-trackBorderColor)",backgroundColor:"var(--Switch-trackBackground)",borderRadius:"var(--Switch-trackRadius)",fontFamily:t.vars.fontFamily.body},"sm"===r.size&&{fontSize:t.vars.fontSize.xs},"md"===r.size&&{fontSize:t.vars.fontSize.sm},"lg"===r.size&&{fontSize:t.vars.fontSize.md})}),MF=Qr("span",{name:"JoySwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})({"--Icon-fontSize":"calc(var(--Switch-thumbSize) * 0.75)",display:"inline-flex",justifyContent:"center",alignItems:"center",position:"absolute",top:"50%",left:"calc(50% - var(--Switch-trackWidth) / 2 + var(--Switch-thumbWidth) / 2 + var(--Switch-thumbOffset))",transform:"translate(-50%, -50%)",width:"var(--Switch-thumbWidth)",height:"var(--Switch-thumbSize)",borderRadius:"var(--Switch-thumbRadius)",boxShadow:"var(--Switch-thumbShadow)",color:"var(--Switch-thumbColor)",backgroundColor:"var(--Switch-thumbBackground)",["&.".concat(hC.checked)]:{left:"calc(50% + var(--Switch-trackWidth) / 2 - var(--Switch-thumbWidth) / 2 - var(--Switch-thumbOffset))"}}),LF=Qr("span",{name:"JoySwitch",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex"}),OF=Qr("span",{name:"JoySwitch",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex"}),FF=o.forwardRef(function(e,t){var r,n,i,a,l,c;const d=en({props:e,name:"JoySwitch"}),u=d.disabled,h=d.id,p=d.color,v=d.variant,f=void 0===v?"solid":v,m=d.size,g=void 0===m?"md":m,y=d.startDecorator,b=d.endDecorator,x=d.component,w=d.slots,S=void 0===w?{}:w,k=d.slotProps,_=void 0===k?{}:k,C=(0,Ie.A)(d,RF),A=o.useContext(lC);const j=null!=(r=null!=(n=e.size)?n:null==A?void 0:A.size)?r:g,I=null!=(i=e.color)?i:null!=A&&A.error?"danger":null!=(a=null==A?void 0:A.color)?a:p,P=GC((0,je.A)({disabled:null!=(l=null!=(c=e.disabled)?c:null==A?void 0:A.disabled)?l:u},d)),R=P.getInputProps,T=P.checked,E=P.disabled,z=P.focusVisible,D=P.readOnly,M=(0,je.A)({},d,{id:h,checked:T,disabled:E,focusVisible:z,readOnly:D,color:T?I||"primary":I||"neutral",variant:f,size:j}),L=(e=>{const t=e.checked,r=e.disabled,n=e.focusVisible,o=e.readOnly,i=e.color,a=e.variant,s=e.size;return Dr({root:["root",t&&"checked",r&&"disabled",n&&"focusVisible",o&&"readOnly",a&&"variant".concat(Le(a)),i&&"color".concat(Le(i)),s&&"size".concat(Le(s))],thumb:["thumb",t&&"checked"],track:["track",t&&"checked"],action:["action",n&&"focusVisible"],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]},uC,{})})(M),O=(0,je.A)({},C,{component:x,slots:S,slotProps:_}),F=pn("root",{ref:t,className:L.root,elementType:TF,externalForwardedProps:O,ownerState:M}),N=(0,s.A)(F,2),B=N[0],H=N[1],W=pn("startDecorator",{additionalProps:{"aria-hidden":!0},className:L.startDecorator,elementType:LF,externalForwardedProps:O,ownerState:M}),V=(0,s.A)(W,2),$=V[0],U=V[1],q=pn("endDecorator",{additionalProps:{"aria-hidden":!0},className:L.endDecorator,elementType:OF,externalForwardedProps:O,ownerState:M}),K=(0,s.A)(q,2),G=K[0],J=K[1],Q=pn("track",{className:L.track,elementType:DF,externalForwardedProps:O,ownerState:M}),Y=(0,s.A)(Q,2),X=Y[0],Z=Y[1],ee=pn("thumb",{className:L.thumb,elementType:MF,externalForwardedProps:O,ownerState:M}),te=(0,s.A)(ee,2),re=te[0],ne=te[1],oe=pn("action",{className:L.action,elementType:EF,externalForwardedProps:O,ownerState:M}),ie=(0,s.A)(oe,2),ae=ie[0],se=ie[1],le=pn("input",{additionalProps:{id:null!=h?h:null==A?void 0:A.htmlFor,"aria-describedby":null==A?void 0:A["aria-describedby"]},className:L.input,elementType:zF,externalForwardedProps:O,getSlotProps:R,ownerState:M}),ce=(0,s.A)(le,2),de=ce[0],ue=ce[1];return(0,tr.jsxs)(B,(0,je.A)({},H,{children:[y&&(0,tr.jsx)($,(0,je.A)({},U,{children:"function"===typeof y?y(M):y})),(0,tr.jsxs)(X,(0,je.A)({},Z,{children:[null==Z?void 0:Z.children,(0,tr.jsx)(re,(0,je.A)({},ne))]})),(0,tr.jsx)(ae,(0,je.A)({},se,{children:(0,tr.jsx)(de,(0,je.A)({},ue))})),b&&(0,tr.jsx)(G,(0,je.A)({},J,{children:"function"===typeof b?b(M):b}))]}))}),NF=FF;var BF=r(8939),HF=r(5040),WF=r(389),VF=r(2328),$F=r(7485);function UF(e){var t;let r=e.selectedLocation,n=e.onSelect,i=e.onClear,a=e.placeholder,l=void 0===a?"Search by postcode or area (e.g. SW12, Hackney)":a,c=e.disabled,d=void 0!==c&&c;const u=(0,o.useState)(null!==(t=null===r||void 0===r?void 0:r.displayName)&&void 0!==t?t:""),h=(0,s.A)(u,2),p=h[0],v=h[1],f=(0,o.useState)(!1),m=(0,s.A)(f,2),g=m[0],y=m[1],b=(0,o.useRef)(null),x=function(e){const t=Ma().getIdToken,r=(0,o.useState)([]),n=(0,s.A)(r,2),i=n[0],a=n[1],l=(0,o.useState)(!1),c=(0,s.A)(l,2),d=c[0],u=c[1],h=(0,o.useState)(!1),p=(0,s.A)(h,2),v=p[0],f=p[1];return(0,o.useEffect)(()=>{if(!e||e.length<2)return a([]),void f(!1);const r=new AbortController,n=setTimeout(async()=>{u(!0),f(!1);try{const n=await t();if(!n)return;const o=await fetch("".concat(IW,"/api/location/search?query=").concat(encodeURIComponent(e)),{headers:{Authorization:n},signal:r.signal});o.ok?a(await o.json()):(a([]),f(!0))}catch(n){if("AbortError"===(null===n||void 0===n?void 0:n.name))return;console.error("useLocationSearch error:",n),a([]),f(!0)}finally{r.signal.aborted||u(!1)}},300);return()=>{r.abort(),clearTimeout(n)}},[e]),{suggestions:i,loading:d,error:v}}(r?"":p),w=x.suggestions,S=x.loading,k=x.error,_=()=>{if(!r&&w.length>0){const e=w[0];v(e.displayName),y(!1),n(e)}};return(0,o.useEffect)(()=>{const e=e=>{b.current&&!b.current.contains(e.target)&&y(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,tr.jsxs)(Tr,{ref:b,sx:{position:"relative"},children:[r?(0,tr.jsx)(Ti,{size:"md",variant:"soft",color:"primary",startDecorator:(0,tr.jsx)(WF.A,{fontSize:"small"}),endDecorator:(0,tr.jsx)(Tr,{component:"span",onClick:()=>{v(""),i()},sx:{cursor:"pointer",lineHeight:1,ml:.5,fontWeight:"bold"},children:"\xd7"}),children:r.displayName}):(0,tr.jsx)(NC,{placeholder:l,value:p,disabled:d,onChange:e=>{v(e.target.value),y(!0)},onFocus:()=>y(!0),onBlur:_,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),_())},startDecorator:S?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(WF.A,{fontSize:"small"})}),!r&&k&&p.length>=2&&!S&&(0,tr.jsx)(Gn,{level:"body-xs",color:"danger",sx:{mt:.5},children:"Couldn't reach the location service. Check your connection or try again in a moment."}),g&&w.length>0&&!r&&(0,tr.jsx)(Tr,{sx:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,mt:.5,borderRadius:"sm",border:"1px solid",borderColor:"neutral.outlinedBorder",bgcolor:"background.popup",boxShadow:"md",overflow:"hidden"},children:w.map(e=>(0,tr.jsxs)(Tr,{onClick:()=>{v(e.displayName),y(!1),n(e)},sx:{px:1.5,py:1,cursor:"pointer",display:"flex",alignItems:"center",gap:1,"&:hover":{bgcolor:"neutral.softHoverBg"}},children:[(0,tr.jsx)(WF.A,{fontSize:"small",sx:{color:"text.tertiary"}}),(0,tr.jsx)(Gn,{level:"body-sm",children:e.displayName})]},e.locationIdentifier))})]})}var qF=r(5473),KF=r(1337),GF=r(6170);function JF(e){var t,r,n,i,a,l;let c=e.aiSearchId;const d=(0,o.useState)(!0),u=(0,s.A)(d,2),h=u[0],p=u[1],v=KA(c),f=v.data,m=v.isLoading,g=(e=>{const t=Ma().getIdToken,r=zl();return Lk({mutationFn:async()=>{const r=await t();if(!r||!e)throw new Error("Missing auth/id");const n=await fetch("".concat(IW,"/api/ai-search/").concat(e,"/preferences"),{method:"DELETE",headers:{Authorization:r}});if(!n.ok)throw new Error("Failed to clear preferences: ".concat(n.status))},onSuccess:()=>{r.invalidateQueries({queryKey:qA(e)}),r.invalidateQueries({queryKey:["houseReaction"]})}})})(c),y=null!==(t=null===f||void 0===f?void 0:f.totalReactions)&&void 0!==t?t:0,b=null!==(r=null===f||void 0===f?void 0:f.isActive)&&void 0!==r&&r,x=Math.min(100,y/3*100);return(0,tr.jsx)(hi,{variant:"soft",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"What I've Learned"}),b&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"success",children:"Active"})]}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",onClick:()=>p(e=>!e),endDecorator:h?(0,tr.jsx)(qF.A,{}):(0,tr.jsx)(KF.A,{}),children:h?"Hide":"Show"})]}),h&&(0,tr.jsxs)(Mn,{spacing:1.5,sx:{mt:1.5},children:[m&&(0,tr.jsx)(Gn,{level:"body-sm",children:"Loading\u2026"}),!m&&0===y&&(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No reactions yet. Use \ud83d\udc4d / \ud83d\udc4e on results \u2014 or move cards to Rejected \u2014 and Toppi will start tuning future runs to your taste."}),!m&&y>0&&(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Gn,{level:"body-sm",children:null===f||void 0===f?void 0:f.preferenceSummary}),!b&&(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Gn,{level:"body-xs",sx:{mb:.5},children:["Progress to active learning (",y,"/",3," signals)"]}),(0,tr.jsx)(AE,{determinate:!0,value:x})]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:[(0,tr.jsx)(bA,{title:"Properties you've liked",children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"success",children:["\ud83d\udc4d ",null!==(n=null===f||void 0===f?void 0:f.likedCount)&&void 0!==n?n:0]})}),(0,tr.jsx)(bA,{title:"Properties you've disliked",children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"danger",children:["\ud83d\udc4e ",null!==(i=null===f||void 0===f?void 0:f.dislikedCount)&&void 0!==i?i:0]})}),(0,tr.jsx)(bA,{title:"Cards you moved to Rejected",children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"neutral",children:["Rejected ",null!==(a=null===f||void 0===f?void 0:f.rejectedImplicitCount)&&void 0!==a?a:0]})}),(null!==(l=null===f||void 0===f?void 0:f.rejectedCount)&&void 0!==l?l:0)>0&&(0,tr.jsx)(bA,{title:"These properties will be hidden from future runs",children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"warning",children:["Hidden next run: ",null===f||void 0===f?void 0:f.rejectedCount]})})]}),(0,tr.jsx)(Tr,{children:(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",startDecorator:(0,tr.jsx)(GF.A,{fontSize:"small"}),onClick:()=>{if(!f||0===f.totalReactions)return;window.confirm("Reset everything Toppi has learned from your reactions on this search? Future runs will start fresh.")&&g.mutate()},disabled:g.isPending,children:"Reset learning"})})]})]})]})})}var QF,YF,XF,ZF,eN,tN,rN,nN,oN,iN,aN;function sN(e,t){const r=new Set(t);return e.filter(e=>!r.has(e))}var lN=(QF=new WeakMap,YF=new WeakMap,XF=new WeakMap,ZF=new WeakMap,eN=new WeakMap,tN=new WeakMap,rN=new WeakMap,nN=new WeakMap,oN=new WeakMap,iN=new WeakMap,aN=new WeakSet,class extends Ya{constructor(e,t,r){super(),Ha(this,aN),Wa(this,QF,void 0),Wa(this,YF,void 0),Wa(this,XF,void 0),Wa(this,ZF,void 0),Wa(this,eN,void 0),Wa(this,tN,void 0),Wa(this,rN,void 0),Wa(this,nN,void 0),Wa(this,oN,void 0),Wa(this,iN,[]),Ua(QF,this,e),Ua(ZF,this,r),Ua(XF,this,[]),Ua(eN,this,[]),Ua(YF,this,[]),this.setQueries(t)}onSubscribe(){1===this.listeners.size&&$a(eN,this).forEach(e=>{e.subscribe(t=>{Va(aN,this,pN).call(this,e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,$a(eN,this).forEach(e=>{e.destroy()})}setQueries(e,t){Ua(XF,this,e),Ua(ZF,this,t),Ps.batch(()=>{const e=$a(eN,this),t=Va(aN,this,hN).call(this,$a(XF,this));t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));const r=t.map(e=>e.observer),n=r.map(e=>e.getCurrentResult()),o=e.length!==r.length,i=r.some((t,r)=>t!==e[r]),a=o||i,s=!!a||n.some((e,t)=>{const r=$a(YF,this)[t];return!r||!vs(e,r)});(a||s)&&(a&&(Ua(iN,this,t),Ua(eN,this,r)),Ua(YF,this,n),this.hasListeners()&&(a&&(sN(e,r).forEach(e=>{e.destroy()}),sN(r,e).forEach(e=>{e.subscribe(t=>{Va(aN,this,pN).call(this,e,t)})})),Va(aN,this,vN).call(this)))})}getCurrentResult(){return $a(YF,this)}getQueries(){return $a(eN,this).map(e=>e.getCurrentQuery())}getObservers(){return $a(eN,this)}getOptimisticResult(e,t){const r=Va(aN,this,hN).call(this,e),n=r.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),o=r.map(e=>e.defaultedQueryOptions.queryHash);return[n,e=>Va(aN,this,dN).call(this,null!==e&&void 0!==e?e:n,t,o),()=>Va(aN,this,cN).call(this,n,r)]}});function cN(e,t){return t.map((r,n)=>{const o=e[n];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}function dN(e,t,r){if(t){const n=$a(oN,this),o=void 0!==r&&void 0!==n&&(n.length!==r.length||r.some((e,t)=>e!==n[t]));return $a(tN,this)&&$a(YF,this)===$a(nN,this)&&!o&&t===$a(rN,this)||(Ua(rN,this,t),Ua(nN,this,$a(YF,this)),void 0!==r&&Ua(oN,this,r),Ua(tN,this,ps($a(tN,this),t(e)))),$a(tN,this)}return e}function uN(){var e;return void 0!==(null===(e=$a(ZF,this))||void 0===e?void 0:e.combine)&&$a(eN,this).some((e,t)=>{var r;return e.options.suspense&&void 0===(null===(r=$a(YF,this)[t])||void 0===r?void 0:r.data)})}function hN(e){const t=new Map;$a(eN,this).forEach(e=>{const r=e.options.queryHash;if(!r)return;const n=t.get(r);n?n.push(e):t.set(r,[e])});const r=[];return e.forEach(e=>{var n;const o=$a(QF,this).defaultQueryOptions(e),i=null===(n=t.get(o.queryHash))||void 0===n?void 0:n.shift(),a=null!==i&&void 0!==i?i:new yl($a(QF,this),o);r.push({defaultedQueryOptions:o,observer:a})}),r}function pN(e,t){const r=$a(eN,this).indexOf(e);-1!==r&&(Ua(YF,this,function(e,t,r){const n=e.slice(0);return n[t]=r,n}($a(YF,this),r,t)),Va(aN,this,vN).call(this))}function vN(){if(this.hasListeners()){var e;const t=Va(aN,this,cN).call(this,$a(YF,this),$a(iN,this)),r=Va(aN,this,uN).call(this),n=$a(tN,this),o=r?n:Va(aN,this,dN).call(this,t,null===(e=$a(ZF,this))||void 0===e?void 0:e.combine);(r||n!==o)&&Ps.batch(()=>{this.listeners.forEach(e=>{e($a(YF,this))})})}}const fN=["queries"];const mN=[20,30,45,60];function gN(e){let t=e.destinations,r=e.filters,n=e.onFilterChange,o=e.sortKey,i=e.onSortChange,a=e.totalCount,s=e.filteredCount;if(0===t.length)return null;const l=Object.values(r).some(e=>null!=e),c=(e,t)=>{const o=(0,Ae.A)({},r);null==t?delete o[e]:o[e]=t,n(o)};return(0,tr.jsxs)(Mn,{spacing:1,sx:{mb:1},children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1,sx:{alignItems:"flex-end",flexWrap:"wrap"},children:[t.map(e=>{var t;const n=rj(e.transportMode),o=null!==(t=r[e.id])&&void 0!==t?t:null;return(0,tr.jsxs)(mC,{size:"sm",sx:{minWidth:180},children:[(0,tr.jsxs)(SC,{sx:{fontSize:"xs"},children:[n," ",e.name]}),(0,tr.jsxs)(dL,{size:"sm",value:null==o?"any":String(o),onChange:(t,r)=>{c(e.id,null==r||"any"===r?null:Number(r))},"aria-label":"Filter commute to ".concat(e.name),children:[(0,tr.jsx)(gL,{value:"any",children:"Any"}),mN.map(e=>(0,tr.jsx)(gL,{value:String(e),children:"\u2264".concat(e," min")},e))]})]},e.id)}),(0,tr.jsxs)(mC,{size:"sm",sx:{minWidth:200},children:[(0,tr.jsx)(SC,{sx:{fontSize:"xs"},children:"Sort by"}),(0,tr.jsxs)(dL,{size:"sm",value:o,onChange:(e,t)=>t&&i(t),"aria-label":"Sort ranked results",children:[(0,tr.jsx)(gL,{value:"best_match",children:"Best match"}),t.map(e=>(0,tr.jsx)(gL,{value:"commute:".concat(e.id),children:"Commute: ".concat(e.name," \u2191")},e.id)),(0,tr.jsx)(gL,{value:"price_asc",children:"Price: low to high"}),(0,tr.jsx)(gL,{value:"price_desc",children:"Price: high to low"})]})]})]}),l&&(0,tr.jsx)(FA,{color:"neutral",variant:"soft",size:"sm",endDecorator:(0,tr.jsx)(wo,{size:"sm",variant:"plain",onClick:()=>n({}),children:"Clear"}),children:(0,tr.jsx)(Tr,{sx:{display:"flex",alignItems:"center",gap:.5},children:(0,tr.jsxs)(Gn,{level:"body-sm",children:["Showing ",s," of ",a," properties \xb7 Commute filter active"]})})})]})}var yN=r(4802),bN=r(9766);const xN=()=>{const e=Ma(),t=e.getIdToken;return ql({queryKey:["referral"],queryFn:()=>(async e=>{const t=await e(),r=await fetch("".concat(IW,"/api/referral"),{headers:{Authorization:null!==t&&void 0!==t?t:"","Content-Type":"application/json"}});if(!r.ok)throw new Error("HTTP ".concat(r.status));const n=await r.text();return n?JSON.parse(n):null})(t),enabled:e.isAuthenticated,staleTime:3e5})},wN="searchShareDismissed";function SN(){const e=xN().data,t=(0,o.useState)(()=>{try{return"1"===sessionStorage.getItem(wN)}catch(e){return!1}}),r=(0,s.A)(t,2),n=r[0],i=r[1],a=(0,o.useState)(!1),l=(0,s.A)(a,2),c=l[0],d=l[1];if(n||null===e||void 0===e||!e.referralUrl)return null;return(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(FA,{color:"primary",variant:"soft",startDecorator:(0,tr.jsx)(jz.A,{}),endDecorator:(0,tr.jsxs)(Mn,{direction:"row",gap:1,children:[(0,tr.jsx)(wo,{size:"sm",variant:"solid",color:"primary",onClick:async()=>{try{var t;await navigator.clipboard.writeText(e.referralUrl),d(!0),null===(t=window.posthog)||void 0===t||t.capture("referral_link_copied",{source:"post_search_prompt"})}catch(r){}},children:"Share Toppi"}),(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"primary",onClick:()=>{try{sessionStorage.setItem(wN,"1")}catch(e){}i(!0)},"aria-label":"Dismiss referral prompt",children:(0,tr.jsx)(yN.A,{})})]}),children:"Loving your results? Refer a friend \u2014 you both get a free month."}),(0,tr.jsx)(FR,{open:c,onClose:()=>d(!1),autoHideDuration:3e3,anchorOrigin:{vertical:"bottom",horizontal:"center"},color:"success",variant:"soft",startDecorator:(0,tr.jsx)(bN.A,{}),children:"Link copied! Share it with friends."})]})}const kN={searchCreated(e,t){Zk("search_created",{search_id:e,query_length:t})},searchRunManual(e,t){Zk("search_run_manual",{search_id:e,has_monitoring:t})},firstResultsSeen(e,t,r){if("undefined"===typeof window)return;const n="first_results_seen_".concat(e);try{if(window.localStorage.getItem(n))return;window.localStorage.setItem(n,"1")}catch(o){}Zk("first_results_seen",{search_id:e,result_count:t,match_score_avg:r})},monitoringEnabled(e){Zk("monitoring_enabled",{search_id:e})},monitoringRunReceived(e,t){Zk("monitoring_run_received",{search_id:e,new_match_count:t})},proSubscriptionStarted(e,t){Zk("pro_subscription_started",{plan:e,source_page:t})}},_N=Number.POSITIVE_INFINITY;function CN(e,t){return null===e||void 0===e?void 0:e.find(e=>e.destinationId===t)}function AN(e){let t=e.houses,r=e.aiSearchId;const n=ie(),i=Ma().getIdToken,a=(0,o.useState)(null),l=(0,s.A)(a,2),c=l[0],d=l[1],u=(0,o.useState)({}),h=(0,s.A)(u,2),p=h[0],v=h[1],f=(0,o.useState)("best_match"),m=(0,s.A)(f,2),g=m[0],y=m[1],b=(0,o.useState)(!1),x=(0,s.A)(b,2),w=x[0],S=x[1];(0,o.useEffect)(()=>{S(!1)},[t]),(0,o.useEffect)(()=>{if(!r||0===t.length)return;const e=t.filter(e=>"number"===typeof e.matchScore),n=0===e.length?0:Math.round(e.reduce((e,t)=>{var r;return e+(null!==(r=t.matchScore)&&void 0!==r?r:0)},0)/e.length*100)/100;kN.firstResultsSeen(r,t.length,n)},[r,t.length]),(0,o.useEffect)(()=>{t.length>0&&function(e){t_("first_search_results_viewed",e)}({resultsCount:t.length})},[t.length]);const k=$A().data,_=void 0===k?[]:k,C=function(e,t){let r=e.queries,n=(0,Ic.A)(e,fN);const i=zl(t),a=Wl(),l=Ol(),c=o.useMemo(()=>r.map(e=>{const t=i.defaultQueryOptions(e);return t._optimisticResults=a?"isRestoring":"optimistic",t}),[r,i,a]);c.forEach(e=>{Vl(e);const t=i.getQueryCache().get(e.queryHash);Fl(e,l,t)}),Nl(l);const d=o.useState(()=>new lN(i,c,n)),u=(0,s.A)(d,1)[0],h=u.getOptimisticResult(c,n.combine),p=(0,s.A)(h,3),v=p[0],f=p[1],m=p[2],g=!a&&!1!==n.subscribed;o.useSyncExternalStore(o.useCallback(e=>g?u.subscribe(Ps.batchCalls(e)):rs,[u,g]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),o.useEffect(()=>{u.setQueries(c,n)},[c,n,u]);const y=v.some((e,t)=>$l(c[t],e))?v.flatMap((e,t)=>{const r=c[t];if(r&&$l(r,e)){const e=new yl(i,r);return Ul(r,e,l)}return[]}):[];if(y.length>0)throw Promise.all(y);const b=v.find((e,t)=>{const r=c[t];return r&&Bl({result:e,errorResetBoundary:l,throwOnError:r.throwOnError,query:i.getQueryCache().get(r.queryHash),suspense:r.suspense})});if(null!==b&&void 0!==b&&b.error)throw b.error;return f(m())}({queries:t.map(e=>({queryKey:["getHouseEnrichment",e.id],queryFn:async()=>{const t=await i();if(!t)return null;const r=await fetch("".concat(IW,"/api/house/").concat(e.id,"/enrichment"),{headers:{Authorization:t}});return r.ok?await r.json():null},enabled:!!e.id&&_.length>0,staleTime:3e5}))}),A=(0,o.useMemo)(()=>{const e={};return t.forEach((t,r)=>{var n,o;e[t.id]=null===(n=C[r])||void 0===n||null===(o=n.data)||void 0===o?void 0:o.commuteResults}),e},[t,C]),j=(0,o.useMemo)(()=>[...t].filter(e=>null!=e.matchScore).sort((e,t)=>{var r,n;return(null!==(r=t.matchScore)&&void 0!==r?r:0)-(null!==(n=e.matchScore)&&void 0!==n?n:0)}),[t]),I=(0,o.useMemo)(()=>j.filter(e=>e.listingStatus&&"active"!==e.listingStatus).length,[j]),P=(0,o.useMemo)(()=>w?j.filter(e=>!e.listingStatus||"active"===e.listingStatus):j,[j,w]),R=(0,o.useMemo)(()=>{const e=Object.entries(p).filter(e=>null!=(0,s.A)(e,2)[1]);return 0===e.length?P:P.filter(t=>{const r=A[t.id];return e.every(e=>{let t=(0,s.A)(e,2),n=t[0],o=t[1];const i=CN(r,n);return!i||null==i.durationMinutes||i.durationMinutes<=o})})},[P,p,A]),T=(0,o.useMemo)(()=>{if("best_match"===g)return R;if("price_asc"===g)return[...R].sort((e,t)=>{var r,n;return(null!==(r=e.priceGbp)&&void 0!==r?r:Number.MAX_SAFE_INTEGER)-(null!==(n=t.priceGbp)&&void 0!==n?n:Number.MAX_SAFE_INTEGER)});if("price_desc"===g)return[...R].sort((e,t)=>{var r,n;return(null!==(r=t.priceGbp)&&void 0!==r?r:-1)-(null!==(n=e.priceGbp)&&void 0!==n?n:-1)});const e=g.slice(8);return[...R].sort((t,r)=>{var n,o,i,a;return(null!==(n=null===(o=CN(A[t.id],e))||void 0===o?void 0:o.durationMinutes)&&void 0!==n?n:_N)-(null!==(i=null===(a=CN(A[r.id],e))||void 0===a?void 0:a.durationMinutes)&&void 0!==i?i:_N)})},[R,g,A]);if(0===j.length)return(0,tr.jsxs)(Tr,{sx:{textAlign:"center",py:6},children:[(0,tr.jsx)(i_.A,{sx:{fontSize:48,color:"neutral.300"}}),(0,tr.jsx)(Gn,{level:"body-md",color:"neutral",sx:{mt:1},children:"No ranked results yet \u2014 run the search to see matches sorted by score."})]});const E=I>0?(0,tr.jsx)(Tr,{children:(0,tr.jsx)(Ti,{size:"sm",variant:w?"solid":"outlined",color:w?"primary":"neutral",onClick:()=>S(e=>!e),sx:{cursor:"pointer"},children:w?"Active only \xb7 ".concat(I," hidden"):"".concat(I," sold/removed \xb7 active only")})}):null;return 0===T.length?(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(gN,{destinations:_,filters:p,onFilterChange:v,sortKey:g,onSortChange:y,totalCount:j.length,filteredCount:0}),(0,tr.jsx)(KR,{}),E,(0,tr.jsxs)(Tr,{sx:{textAlign:"center",py:4},children:[(0,tr.jsx)(Gn,{level:"body-md",color:"neutral",children:"No properties match the active filters."}),(0,tr.jsx)(wo,{variant:"plain",size:"sm",sx:{mt:1},onClick:()=>{v({}),S(!1)},children:"Clear filters"})]})]}):(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(gN,{destinations:_,filters:p,onFilterChange:v,sortKey:g,onSortChange:y,totalCount:j.length,filteredCount:T.length}),(0,tr.jsx)(KR,{}),(0,tr.jsx)(SN,{}),E,T.map((e,t)=>{var o,i,a;const s=Math.round(100*(null!==(o=e.matchScore)&&void 0!==o?o:0)),l=s>=80?"success":s>=60?"primary":"neutral",c=null===(i=e.photos)||void 0===i?void 0:i[0],u=null!==(a=A[e.id])&&void 0!==a?a:[];return(0,tr.jsx)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:1.5},children:(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1.5,alignItems:"flex-start"},children:[(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",sx:{minWidth:24,pt:.5,fontWeight:"lg"},children:["#",t+1]}),(0,tr.jsx)(Io,{ratio:"4/3",sx:{width:96,borderRadius:"sm",flexShrink:0},children:c?(0,tr.jsx)("img",{src:c,alt:"",style:{objectFit:"cover"}}):(0,tr.jsx)(Tr,{sx:{bgcolor:"neutral.100",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,tr.jsx)(o_.A,{sx:{color:"neutral.400"}})})}),(0,tr.jsxs)(Mn,{spacing:.5,sx:{flex:1,minWidth:0},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",noWrap:!0,sx:{minWidth:0},children:e.address||e.title}),e.listingStatus&&"active"!==e.listingStatus&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"under_offer"===e.listingStatus?"warning":"sold"===e.listingStatus?"danger":"neutral",sx:{ml:1,fontSize:"10px",py:0,flexShrink:0},children:"under_offer"===e.listingStatus?"\u26a0\ufe0f Under offer":"sold"===e.listingStatus?"Sold":"Removed"})]}),(0,tr.jsxs)(Gn,{level:"body-sm",color:"neutral",children:[null!=e.priceGbp?"\xa3".concat(e.priceGbp.toLocaleString()):"Price unknown",null!=e.bedrooms?" \xb7 ".concat(e.bedrooms," bed"):""]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,alignItems:"center"},children:[(0,tr.jsx)(AE,{determinate:!0,value:s,color:l,sx:{flex:1,maxWidth:140}}),(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:l,"aria-label":"".concat(s,"% match"),children:[s,"%"]})]}),(0,tr.jsx)(QL,{criteria:e.matchCriteria,maxChips:5}),u.length>0&&(0,tr.jsx)(nj,{results:u,max:3,destinations:_}),e.matchRationale&&(0,tr.jsx)(Gn,{level:"body-xs",sx:{overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",color:"text.secondary",mt:.5},children:e.matchRationale}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,alignItems:"center",mt:.5,flexWrap:"wrap"},children:[(0,tr.jsx)(wo,{size:"sm",variant:"plain",onClick:()=>{var t;Lz.matchScoreExpanded(Math.round(100*(null!==(t=e.matchScore)&&void 0!==t?t:0))),n("/house/".concat(e.id))},children:"View property \u2192"}),r&&(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",startDecorator:(0,tr.jsx)(Uz.A,{fontSize:"small"}),onClick:()=>d(e),"aria-label":"More properties like ".concat(e.title||e.address||"this property"),children:"More like this"}),e.status&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",children:e.status})]})]})]})},e.id)}),r&&c&&(0,tr.jsx)(LL,{open:!!c,onClose:()=>d(null),aiSearchId:r,referenceHouseId:c.id})]})}function jN(e){let t=e.condition;if(!t||"stable"===t.condition)return null;if("tightening"===t.condition){const e=t.consecutiveDryRuns;return(0,tr.jsx)(FA,{variant:"soft",color:"warning",startDecorator:(0,tr.jsx)(CA.A,{}),sx:{mb:2,borderRadius:"md"},"aria-label":"Market tightening warning",children:(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Market tightening in your area"}),(0,tr.jsxs)(Gn,{level:"body-sm",color:"neutral",children:["Toppi has found fewer than 5 matches in the last ",e," run",1===e?"":"s","."]})]})})}return"improving"!==t.condition?null:(0,tr.jsx)(FA,{variant:"soft",color:"success",startDecorator:(0,tr.jsx)($L.A,{}),sx:{mb:2,borderRadius:"md"},"aria-label":"Market improving",children:(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"More properties appearing in your area"}),(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"Your search is finding a healthy number of matches."})]})})}function IN(e){let t=e.aiSearchId,r=e.onAccept;const n=(e=>{const t=Ma().getIdToken;return ql({queryKey:XE(e),queryFn:async()=>{var r;const n=await JE(t,"/ai-search/".concat(e,"/suggestions"));return null!==(r=null===n||void 0===n?void 0:n.suggestions)&&void 0!==r?r:[]},enabled:!!e,staleTime:6e4,refetchOnWindowFocus:!1})})(t),o=n.data,i=(e=>{const t=Ma().getIdToken,r=zl();return Lk({mutationFn:r=>JE(t,"/ai-search/".concat(e,"/suggestions/").concat(r,"/accept"),{method:"POST"}),onMutate:async t=>{await r.cancelQueries({queryKey:XE(e)});const n=r.getQueryData(XE(e));return r.setQueryData(XE(e),e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.filter(e=>e.id!==t))&&void 0!==r?r:[]}),{previous:n}},onError:(t,n,o)=>{null!==o&&void 0!==o&&o.previous&&r.setQueryData(XE(e),o.previous)},onSettled:()=>r.invalidateQueries({queryKey:XE(e)})})})(t),a=(e=>{const t=Ma().getIdToken,r=zl();return Lk({mutationFn:r=>JE(t,"/ai-search/".concat(e,"/suggestions/").concat(r,"/dismiss"),{method:"POST"}),onMutate:async t=>{await r.cancelQueries({queryKey:XE(e)});const n=r.getQueryData(XE(e));return r.setQueryData(XE(e),e=>{var r;return null!==(r=null===e||void 0===e?void 0:e.filter(e=>e.id!==t))&&void 0!==r?r:[]}),{previous:n}},onError:(t,n,o)=>{null!==o&&void 0!==o&&o.previous&&r.setQueryData(XE(e),o.previous)},onSettled:()=>r.invalidateQueries({queryKey:XE(e)})})})(t);return o&&0!==o.length?(0,tr.jsx)(hi,{variant:"outlined",sx:{mb:2,borderLeft:"3px solid",borderColor:"warning.400"},"aria-label":"Toppi search adjustment suggestions",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5},children:[(0,tr.jsx)(n_.A,{fontSize:"small",color:"warning"}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Toppi suggests an adjustment"})]}),o.map(e=>(0,tr.jsxs)(Tr,{sx:{mb:1.5,"&:last-of-type":{mb:0}},children:[(0,tr.jsx)(Gn,{level:"body-sm",children:e.text}),e.estimatedImpact&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",sx:{mt:.5},children:e.estimatedImpact}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,mt:1},children:[(0,tr.jsx)(wo,{size:"sm",variant:"solid",color:"primary","aria-label":"Accept suggestion: ".concat(e.text),onClick:()=>{i.mutate(e.id),null===r||void 0===r||r({id:e.id,proposedValue:e.proposedValue,type:e.type,text:e.text})},children:"Update search"}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral","aria-label":"Dismiss suggestion: ".concat(e.text),onClick:()=>a.mutate(e.id),children:"Not for me"})]})]},e.id))]})}):null}var PN=r(553),RN=r(9179),TN=r(5874);function EN(e){let t=e.aiSearchId;const r=KA(t).data;return r&&r.preferenceSummary&&0!==r.totalReactions?(0,tr.jsx)(hi,{variant:"soft",color:"primary",sx:{mb:2},"aria-label":"Your learned taste profile",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:1.5,flexWrap:"wrap"},children:[(0,tr.jsx)(Xo,{size:"sm",variant:"soft",color:"primary",children:(0,tr.jsx)(PN.A,{})}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Your taste profile"}),(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"primary",children:[r.totalReactions," reaction",1===r.totalReactions?"":"s"]})]}),(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:r.preferenceSummary}),(0,tr.jsx)(nc,{sx:{my:1.5}}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:[(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"success",startDecorator:(0,tr.jsx)(RN.A,{}),children:[r.likedCount," liked"]}),(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"danger",startDecorator:(0,tr.jsx)(TN.A,{}),children:[r.rejectedCount," passed"]})]})]})}):null}const zN=e=>"toppi-stale-modal-dismissed:".concat(e);function DN(e){let t=e.aiSearchId,r=e.lastRunAt,n=e.onUpdateSearch;const i=(0,o.useState)(!1),a=(0,s.A)(i,2),l=a[0],c=a[1],d=KA(t).data;(0,o.useEffect)(()=>{(function(e){if(!e)return!1;const t=Date.parse(e);return!Number.isNaN(t)&&Date.now()-t>2592e6})(r)&&(sessionStorage.getItem(zN(t))||c(!0))},[t,r]);const u=()=>{sessionStorage.setItem(zN(t),"1"),c(!1)};return(0,tr.jsx)(L_,{open:l,onClose:u,children:(0,tr.jsxs)(U_,{variant:"outlined",role:"alertdialog",sx:{maxWidth:420},children:[(0,tr.jsxs)(wR,{children:[(0,tr.jsx)(_A.A,{}),"It's been a while"]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(mE,{children:[(0,tr.jsx)(Gn,{level:"body-sm",children:"Your search hasn't run recently. Here's what Toppi has learned about your taste:"}),(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",sx:{mt:1},children:(null===d||void 0===d?void 0:d.preferenceSummary)||"React to a few properties on your board and Toppi will start learning your taste."})]}),(0,tr.jsxs)(hE,{children:[(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:()=>{u(),null===n||void 0===n||n()},children:"Update my search"}),(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:u,children:"I'm happy with it"})]})]})})}var MN=r(1635);const LN=["rightmove","zoopla","onthemarket"],ON={rightmove:"Rightmove",zoopla:"Zoopla",onthemarket:"OnTheMarket"};function FN(e){var t;return null!==(t=ON[e.toLowerCase()])&&void 0!==t?t:e}function NN(e){var t;let r=e.job;const n=null!==(t=r.failedPortals)&&void 0!==t?t:[],o=r.attemptedPortals&&r.attemptedPortals.length>0?r.attemptedPortals:[...LN];if(0===n.length&&(!r.attemptedPortals||0===r.attemptedPortals.length)&&"done"!==r.status&&"failed"!==r.status)return null;const i=new Set(n.map(e=>e.toLowerCase())),a=Boolean(r.retryJobId);return(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1,flexWrap:"wrap",alignItems:"center",rowGap:.5,children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",sx:{mr:.5},children:"Portals:"}),o.map(e=>{if(!i.has(e.toLowerCase()))return(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"success",startDecorator:(0,tr.jsx)(qL.A,{sx:{fontSize:14}}),children:FN(e)},e);const t=a?"Unavailable \u2014 retry queued for within 30 min":"Unavailable this run \u2014 we'll try again next scheduled run",r=a?Dz.A:MN.A,n=a?"warning":"danger";return(0,tr.jsx)(bA,{title:t,placement:"top",variant:"soft",children:(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:n,startDecorator:(0,tr.jsx)(r,{sx:{fontSize:14}}),children:FN(e)})},e)})]}),n.length>0&&(0,tr.jsx)(FA,{variant:"soft",color:"warning",size:"sm",sx:{mt:1},startDecorator:(0,tr.jsx)(jA.A,{}),children:(0,tr.jsx)(Gn,{level:"body-sm",children:a?"Some portals were unavailable \u2014 we've automatically queued a retry. Results will update shortly.":"Some portals were unavailable this run. Your next scheduled search will include them."})})]})}const BN=["rightmove","zoopla","onthemarket"],HN={rightmove:"Rightmove",zoopla:"Zoopla",onthemarket:"OnTheMarket"};function WN(e){return e.map(e=>{var t;return null!==(t=HN[e.toLowerCase()])&&void 0!==t?t:e}).join(", ")}function VN(e){var t,r,n,o;let i=e.primary,a=e.aiSearchId;const s=null!==(t=i.retryJobId)&&void 0!==t?t:null,l=((e,t)=>{const r=Ma().getIdToken;return ql({queryKey:["aiSearchJob",e,t],queryFn:()=>JE(r,"/ai-search/".concat(e,"/job/").concat(t)).catch(()=>null),enabled:!!e&&!!t,refetchInterval:e=>{var t;const r=null===(t=e.state.data)||void 0===t?void 0:t.status;return("pending"===r||"running"===r)&&5e3}})})(a,s),c=l.data;if(!s)return null;const d=i.failedPortals&&i.failedPortals.length>0?i.failedPortals:null!==c&&void 0!==c&&c.attemptedPortals&&c.attemptedPortals.length>0?c.attemptedPortals:[...BN];if(!c||"pending"===c.status||"running"===c.status)return(0,tr.jsx)(FA,{color:"warning",variant:"soft",size:"sm",startDecorator:(0,tr.jsx)(An,{size:"sm"}),sx:{mt:1},children:(0,tr.jsxs)(Gn,{level:"body-sm",children:["Retrying ",WN(d),"\u2026"]})});if("failed"===c.status)return(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",startDecorator:(0,tr.jsx)(KL.A,{}),sx:{mt:1},children:(0,tr.jsxs)(Gn,{level:"body-sm",children:["Retry for ",WN(d)," also failed \u2014 results may be incomplete."]})});const u=null!==(r=c.failedPortals)&&void 0!==r?r:[];if(u.length>0)return(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",startDecorator:(0,tr.jsx)(KL.A,{}),sx:{mt:1},children:(0,tr.jsxs)(Gn,{level:"body-sm",children:["Retry for ",WN(u)," also failed \u2014 results may be incomplete."]})});const h=null!==(n=null===(o=c.progress)||void 0===o?void 0:o.listingsAdded)&&void 0!==n?n:0,p=c.attemptedPortals&&c.attemptedPortals.length>0?c.attemptedPortals:d;return(0,tr.jsx)(FA,{color:"success",variant:"soft",size:"sm",startDecorator:(0,tr.jsx)(qL.A,{}),sx:{mt:1},children:(0,tr.jsx)(Gn,{level:"body-sm",children:h>0?"Updated with ".concat(WN(p)," results \u2014 ").concat(h," new ").concat(1===h?"property":"properties"," added."):"Updated with ".concat(WN(p)," results \u2014 no extra listings found this time.")})})}const $N=["rightmove","zoopla","onthemarket"],UN=[...$N],qN={rightmove:"Rightmove",zoopla:"Zoopla",onthemarket:"OnTheMarket"},KN=[{label:"3-bed SW London under \xa3600k",requirements:"3 bedroom house, South West London, under \xa3600,000, good primary schools, garden"},{label:"2-bed flat near tube under \xa3450k",requirements:"2 bedroom flat, within 10 minutes walk of tube station, under \xa3450,000, modern kitchen"},{label:"Family home with good schools",requirements:"3-4 bedroom house, good Ofsted-rated schools, quiet residential street, garden, under \xa3700,000"},{label:"Fixer-upper under \xa3350k",requirements:"House or flat in need of renovation, under \xa3350,000, any location, potential to add value"}],GN=[{key:"requirements",label:"Understanding requirements"},{key:"searching",label:"Searching property sites"},{key:"extracting",label:"Reading listings"},{key:"ranking",label:"Ranking by match"}];function JN(e){var t,r,n;let i=e.aiSearchId,a=e.boardId,s=e.onRunEnd,l=e.onEditRequest;const c=ZE(i),d=c.data,u=c.isLoading,h=ie();if((0,o.useEffect)(()=>{"done"!==(null===d||void 0===d?void 0:d.status)&&"failed"!==(null===d||void 0===d?void 0:d.status)||null===s||void 0===s||s()},[null===d||void 0===d?void 0:d.status]),u)return null;if(!d)return(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No runs yet. Hit Run to start."});const p="pending"===d.status||"running"===d.status,v=d.progress,f=null!==(t=null===v||void 0===v?void 0:v.listingsDiscovered)&&void 0!==t?t:0,m=null!==(r=null===v||void 0===v?void 0:v.listingsExtracted)&&void 0!==r?r:0,g=f>0?Math.min(100,m/f*100):void 0,y=(b=null===v||void 0===v?void 0:v.statusMessage)?b.includes("Parsing")?0:b.includes("Searching")||b.includes("Found")?1:b.includes("Extracting")?2:(b.includes("Ranking"),3):0;var b,x;return(0,tr.jsxs)(Mn,{spacing:2,children:[p&&(0,tr.jsxs)(Tr,{sx:{p:1.5,borderRadius:"sm",bgcolor:"neutral.softBg",border:"1px solid",borderColor:"neutral.outlinedBorder"},children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:"Searches take 5\u201315 minutes"}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",sx:{mt:.5},children:"You can leave this page \u2014 results will be here when you come back."})]}),p&&(0,tr.jsx)(Tr,{sx:{display:"flex",gap:.5,alignItems:"center"},children:GN.map((e,t)=>{const r=t0||v.listingsAdded>0)&&(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[f>0&&(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",children:["Found: ",f]}),m>0&&(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",children:["Extracted: ",m,f>0?"/".concat(f):""]}),v.listingsAdded>0&&(0,tr.jsxs)(Gn,{level:"body-xs",color:"success",children:["Added: ",v.listingsAdded]})]}),("done"===d.status||"failed"===d.status)&&(0,tr.jsx)(NN,{job:d}),(0,tr.jsx)(VN,{primary:d,aiSearchId:d.aiSearchId}),"done"===d.status&&(null!==(n=null===v||void 0===v?void 0:v.listingsAdded)&&void 0!==n?n:0)>0&&(0,tr.jsxs)(wo,{size:"sm",variant:"soft",color:"success",startDecorator:(0,tr.jsx)(mz.A,{}),onClick:()=>h("/dashboard",{state:{boardId:a}}),children:["View ",null===v||void 0===v?void 0:v.listingsAdded," results on board"]}),"done"===d.status&&!(null!==v&&void 0!==v&&v.listingsAdded)&&(0,tr.jsx)(FA,{color:"neutral",variant:"soft",size:"sm",startDecorator:(0,tr.jsx)(qL.A,{}),children:(0,tr.jsxs)(Mn,{spacing:.5,children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Search complete \u2014 no new listings this run"}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Try broadening your requirements, or wait for the next scheduled run."}),l&&(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",onClick:l,sx:{alignSelf:"flex-start",px:0},children:"Edit requirements \u2192"})]})})]})}function QN(e){let t=e.sites,r=e.onChange;return(0,tr.jsx)(Tr,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:$N.map(e=>(0,tr.jsx)(lA,{label:qN[e],checked:t.includes(e),onChange:n=>r(n.target.checked?[...t,e]:t.filter(t=>t!==e))},e))})}function YN(e){var t;const r=(e=>{const t=Ma().getIdToken;return ql({queryKey:["runHistory",e],queryFn:()=>JE(t,"/ai-search/".concat(e,"/run-history")),enabled:!!e,staleTime:3e5,refetchOnWindowFocus:!1})})(e.aiSearchId),n=r.data;return r.isLoading?(0,tr.jsx)(An,{size:"sm"}):null!==n&&void 0!==n&&null!==(t=n.runs)&&void 0!==t&&t.length?(0,tr.jsx)(Ui,{size:"sm",sx:{"--List-gap":"0px","--ListItem-paddingY":"6px"},children:n.runs.map((e,t)=>{var r;return(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)(ta,{children:(0,tr.jsxs)(fz,{children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:Kl(null!==(r=e.completedAt)&&void 0!==r?r:e.startedAt)}),"failed"===e.status?(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"danger",children:"Failed"}):e.newMatchesFound&&e.newMatchesFound>0?(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"success",children:["+",e.newMatchesFound," match",1!==e.newMatchesFound?"es":""]}):(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",children:"No new matches"})]}),e.agentCommentary&&(0,tr.jsx)(Tr,{sx:{mt:1,pl:1,borderLeft:"2px solid",borderColor:"neutral.200"},children:(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",fontStyle:"italic",children:e.agentCommentary})})]})}),t{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>JE(e,"/ai-search/".concat(t,"/run"),{method:"POST"}),onSuccess:(e,r)=>{t.invalidateQueries({queryKey:["latestAiSearchJob",r]})}})})(),h=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>{let r=t.id,n=(0,Ic.A)(t,KE);return JE(e,"/ai-search/".concat(r),{method:"PUT",body:JSON.stringify(n)})},onSuccess:()=>t.invalidateQueries({queryKey:["aiSearches"]})})})(),p=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>{let r=t.id,n=t.enabled;return JE(e,"/ai-search/".concat(r,"/monitoring"),{method:"PATCH",body:JSON.stringify({enabled:n})})},onMutate:async e=>{let r=e.id,n=e.enabled;await t.cancelQueries({queryKey:["aiSearches"]});const o=t.getQueryData(["aiSearches"]);return t.setQueryData(["aiSearches"],e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.map(e=>e.id===r?(0,Ae.A)((0,Ae.A)({},e),{},{monitoringEnabled:n}):e))&&void 0!==t?t:e}),{previous:o}},onError:(e,r,n)=>{null!==n&&void 0!==n&&n.previous&&t.setQueryData(["aiSearches"],n.previous)},onSettled:()=>t.invalidateQueries({queryKey:["aiSearches"]})})})(),v=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>{let r=t.id,n=t.enabled;return JE(e,"/ai-search/".concat(r,"/email"),{method:"PATCH",body:JSON.stringify({enabled:n})})},onMutate:async e=>{let r=e.id,n=e.enabled;await t.cancelQueries({queryKey:["aiSearches"]});const o=t.getQueryData(["aiSearches"]);return t.setQueryData(["aiSearches"],e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.map(e=>e.id===r?(0,Ae.A)((0,Ae.A)({},e),{},{emailEnabled:n}):e))&&void 0!==t?t:e}),{previous:o}},onError:(e,r,n)=>{null!==n&&void 0!==n&&n.previous&&t.setQueryData(["aiSearches"],n.previous)},onSettled:()=>t.invalidateQueries({queryKey:["aiSearches"]})})})(),f=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>{let r=t.id,n=t.frequency;return JE(e,"/ai-search/".concat(r,"/frequency"),{method:"PATCH",body:JSON.stringify({frequency:n})})},onMutate:async e=>{let r=e.id,n=e.frequency;await t.cancelQueries({queryKey:["aiSearches"]});const o=t.getQueryData(["aiSearches"]);return t.setQueryData(["aiSearches"],e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.map(e=>e.id===r?(0,Ae.A)((0,Ae.A)({},e),{},{scheduledFrequency:n}):e))&&void 0!==t?t:e}),{previous:o}},onError:(e,r,n)=>{null!==n&&void 0!==n&&n.previous&&t.setQueryData(["aiSearches"],n.previous)},onSettled:()=>t.invalidateQueries({queryKey:["aiSearches"]})})})(),m=ZE(n.id).data,g=Ql().subscription,y=ie(),b="pending"===(null===m||void 0===m?void 0:m.status)||"running"===(null===m||void 0===m?void 0:m.status),x=!1===n.monitoringEnabled,w=null!==(t=n.scheduledFrequency)&&void 0!==t?t:"DAILY",S=!x&&"MANUAL"===w,k=x?"Paused":S?"Manual":"Watching",_=x?"neutral":S?"primary":"success",C=x?"Paused \u2014 new-match alerts won't fire for this search.":S?"Only runs when you press Run Search.":n.lastRunAt?"Last run: ".concat(Kl(n.lastRunAt))+(n.nextRunAt?" \xb7 Next run: ".concat(function(e){if(!e)return"\u2014";const t=new Date(e),r=t.getTime();if(Number.isNaN(r))return"\u2014";const n=r-Date.now();if(n<=0)return"any moment";if(n<36e5){const e=Math.max(1,Math.floor(n/6e4));return 1===e?"in 1 min":"in ".concat(e," min")}if(n<216e5){const e=Math.floor(n/36e5);return 1===e?"in 1 hour":"in ".concat(e," hours")}const o=new Date,i=new Intl.DateTimeFormat("en-GB",{hour:"numeric",hour12:!0}).format(t).toLowerCase().replace(/\s+/g,""),a=t.getFullYear()===o.getFullYear()&&t.getMonth()===o.getMonth()&&t.getDate()===o.getDate(),s=new Date(o);s.setDate(o.getDate()+1);const l=t.getFullYear()===s.getFullYear()&&t.getMonth()===s.getMonth()&&t.getDate()===s.getDate();if(a){const e=t.getHours()>=17?"tonight at":"today at";return"".concat(e," ").concat(i)}if(l)return"tomorrow at ".concat(i);const c=new Intl.DateTimeFormat("en-GB",{day:"numeric",month:"short"}).format(t);return"".concat(c," at ").concat(i)}(n.nextRunAt)):""):"Not yet run",A=(0,o.useState)("list"),j=(0,s.A)(A,2),I=j[0],P=j[1],R=(0,o.useState)(!1),T=(0,s.A)(R,2),E=T[0],z=T[1],D=(0,o.useState)(n.name),M=(0,s.A)(D,2),L=M[0],O=M[1],F=(0,o.useState)(n.requirementsText),N=(0,s.A)(F,2),B=N[0],H=N[1],W=(0,o.useState)(n.sites),V=(0,s.A)(W,2),$=V[0],U=V[1],q=(0,o.useState)(null!==(r=n.location)&&void 0!==r?r:null),K=(0,s.A)(q,2),G=K[0],J=K[1];(0,o.useEffect)(()=>{var e;z(!1),O(n.name),H(n.requirementsText),U(n.sites),J(null!==(e=n.location)&&void 0!==e?e:null)},[n.id]);const Q=()=>{var e;O(n.name),H(n.requirementsText),U(n.sites),J(null!==(e=n.location)&&void 0!==e?e:null),z(!0)},Y=()=>{L.trim()&&B.trim()&&0!==$.length&&h.mutate({id:n.id,name:L.trim(),requirementsText:B.trim(),sites:$,location:null!==G&&void 0!==G?G:void 0},{onSuccess:()=>z(!1)})},X="free"===(null===g||void 0===g?void 0:g.planTier)&&"number"===typeof g.freeSearchesRemaining;return E?(0,tr.jsxs)(Mn,{spacing:2,sx:{p:3,maxWidth:640},children:[(0,tr.jsx)(Gn,{level:"h4",children:"Edit search"}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Name"}),(0,tr.jsx)(NC,{value:L,onChange:e=>O(e.target.value),autoFocus:!0})]}),(0,tr.jsxs)(mC,{error:!G,children:[(0,tr.jsx)(SC,{children:"Location"}),(0,tr.jsx)(UF,{selectedLocation:G,onSelect:J,onClear:()=>J(null)}),!G&&(0,tr.jsx)(oF,{children:"Pick a location from the suggestions list \u2014 required to enable Save."})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Requirements"}),(0,tr.jsx)(HM,{minRows:4,value:B,onChange:e=>H(e.target.value)})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Sites"}),(0,tr.jsx)(QN,{sites:$,onChange:U}),0===$.length&&(0,tr.jsx)(Gn,{level:"body-xs",color:"danger",sx:{mt:.5},children:"Select at least one portal"})]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1},children:[(0,tr.jsx)(wo,{onClick:Y,loading:h.isPending,disabled:!L.trim()||!B.trim()||0===$.length,children:"Save"}),(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:()=>z(!1),disabled:h.isPending,children:"Cancel"})]})]}):(0,tr.jsxs)(Mn,{spacing:2,sx:{p:3,maxWidth:720},children:[(0,tr.jsx)(DN,{aiSearchId:n.id,lastRunAt:n.lastRunAt,onUpdateSearch:Q}),(0,tr.jsx)(jN,{condition:n.marketCondition}),(0,tr.jsx)(IN,{aiSearchId:n.id,onAccept:e=>{e.proposedValue&&H(e.proposedValue),Q()}}),n.tasteProfileReady&&(0,tr.jsx)(EN,{aiSearchId:n.id}),(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,tr.jsx)(Gn,{level:"h4",sx:{flex:1},children:n.name}),(0,tr.jsxs)(PF,{size:"sm",variant:"outlined",color:"neutral",children:[(0,tr.jsx)(Z_,{onClick:()=>P("list"),color:"list"===I?"primary":"neutral",variant:"list"===I?"soft":"outlined","aria-label":"List view",children:(0,tr.jsx)(VF.A,{})}),(0,tr.jsx)(Z_,{onClick:()=>{P("board"),y("/dashboard",{state:{boardId:n.boardId}})},color:"board"===I?"primary":"neutral",variant:"board"===I?"soft":"outlined","aria-label":"Board view",children:(0,tr.jsx)($F.A,{})})]}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"neutral",startDecorator:(0,tr.jsx)(BF.A,{}),onClick:Q,disabled:b,children:"Edit"}),(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"danger",startDecorator:(0,tr.jsx)(SR.A,{}),onClick:()=>a(n.id),children:"Delete"})]}),n.location&&(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:.75},children:[(0,tr.jsx)(WF.A,{fontSize:"small",sx:{color:"text.tertiary"}}),(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:n.location.displayName})]}),(0,tr.jsx)(hi,{variant:"soft",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"title-sm",sx:{mb:.5},children:"Requirements"}),(0,tr.jsx)(Gn,{level:"body-sm",children:n.requirementsText})]})}),(0,tr.jsx)(Tr,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:n.sites.map(e=>{var t;return(0,tr.jsx)(Ti,{size:"sm",variant:"outlined",children:null!==(t=qN[e])&&void 0!==t?t:e},e)})}),(0,tr.jsx)(hi,{variant:"outlined",sx:{py:1.5,px:2},children:(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:.25},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Monitoring"}),(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:_,children:k})]}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:C})]}),(0,tr.jsx)(NF,{checked:!x,onChange:e=>{e.target.checked&&kN.monitoringEnabled(n.id),p.mutate({id:n.id,enabled:e.target.checked})},disabled:p.isPending,slotProps:{input:{"aria-label":"Toggle monitoring for ".concat(n.name)}}})]}),!x&&(0,tr.jsxs)(mC,{size:"sm",orientation:"horizontal",sx:{alignItems:"center",gap:1},children:[(0,tr.jsx)(SC,{sx:{mb:0},children:"Frequency"}),(0,tr.jsxs)(dL,{size:"sm",value:w,disabled:b||f.isPending,onChange:(e,t)=>{t&&t!==w&&f.mutate({id:n.id,frequency:t},{onError:e=>{e instanceof GE&&402===e.status&&d("Twice-daily monitoring is a Pro feature.")}})},sx:{minWidth:160},slotProps:{button:{"aria-label":"Set frequency for ".concat(n.name)}},children:[(0,tr.jsx)(gL,{value:"DAILY",children:"Daily"}),(0,tr.jsxs)(gL,{value:"TWICE_DAILY",children:["Twice daily","free"===(null===g||void 0===g?void 0:g.planTier)&&(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"warning",sx:{ml:1},children:"Pro"})]}),(0,tr.jsx)(gL,{value:"MANUAL",children:"Manual only"})]})]})]})}),(0,tr.jsx)(hi,{variant:"outlined",sx:{py:1.5,px:2},children:(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:.25},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Email alerts"}),(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:!1===n.emailEnabled?"neutral":"primary",children:!1===n.emailEnabled?"Off for this search":"On"})]}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:!1===n.emailEnabled?"In-app notifications still fire, but you won't get emails for this search's matches.":"Email mode and threshold are set globally in Settings."})]}),(0,tr.jsx)(NF,{checked:!1!==n.emailEnabled,onChange:e=>v.mutate({id:n.id,enabled:e.target.checked}),disabled:v.isPending,slotProps:{input:{"aria-label":"Toggle email alerts for ".concat(n.name)}}})]})}),X&&(0,tr.jsx)(Gn,{level:"body-xs",color:0===g.freeSearchesRemaining?"warning":"neutral",children:1===g.freeSearchesRemaining?"1 free search remaining this month":0===g.freeSearchesRemaining?"No free searches remaining \u2014 upgrade to continue":"".concat(g.freeSearchesRemaining," free searches remaining this month")}),(0,tr.jsx)(wo,{startDecorator:u.isPending?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(HF.A,{}),onClick:()=>{null===l||void 0===l||l(n.id),kN.searchRunManual(n.id,!1!==n.monitoringEnabled),u.mutate(n.id,{onError:e=>{if(null===c||void 0===c||c(),e instanceof GE&&402===e.status){var t;const r=null!==(t=e.body)&&void 0!==t?t:null;d(function(e,t){return"past_due"===t?"Update your billing to continue":"pro_required"===(null===e||void 0===e?void 0:e.error)?"Pro feature \u2014 upgrade to unlock":null!==e&&void 0!==e&&e.message?e.message:"You've used your free search this month"}(r,null===g||void 0===g?void 0:g.status))}}})},disabled:u.isPending||b,color:"primary",children:u.isPending?"Starting...":b?"Search running...":"Run Search"}),(0,tr.jsx)(nc,{}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Latest run"}),(0,tr.jsx)(JN,{aiSearchId:n.id,boardId:n.boardId,onRunEnd:c,onEditRequest:Q}),(0,tr.jsx)(nc,{}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Run history"}),(0,tr.jsx)(YN,{aiSearchId:n.id}),(0,tr.jsx)(nc,{}),(0,tr.jsx)(Gn,{level:"title-sm",children:"Ranked results"}),(0,tr.jsx)(AN,{houses:i,aiSearchId:n.id}),(0,tr.jsx)(nc,{}),(0,tr.jsx)(JF,{aiSearchId:n.id})]})}function ZN(e){let t=e.onSuccess,r=e.onCancel;const n=YE(),i=(()=>{const e=Ma().getIdToken;return Lk({mutationFn:t=>JE(e,"/ai-search/paraphrase",{method:"POST",body:JSON.stringify({requirementsText:t})})})})(),a=(0,o.useState)(""),l=(0,s.A)(a,2),c=l[0],d=l[1],u=(0,o.useState)(!1),h=(0,s.A)(u,2),p=h[0],v=h[1],f=(0,o.useState)(""),m=(0,s.A)(f,2),g=m[0],y=m[1],b=(0,o.useState)(!1),x=(0,s.A)(b,2),w=x[0],S=x[1],k=(0,o.useState)(null),_=(0,s.A)(k,2),C=_[0],A=_[1],j=(0,o.useState)(!1),I=(0,s.A)(j,2),P=I[0],R=I[1],T=(0,o.useState)(UN),E=(0,s.A)(T,2),z=E[0],D=E[1],M=(0,o.useState)("form"),L=(0,s.A)(M,2),O=L[0],F=L[1],N=(0,o.useState)(null),B=(0,s.A)(N,2),H=B[0],W=B[1],V=c.trim().length>0&&g.trim().length>0&&null!==C&&z.length>0,$=()=>{F("creating");const e=g.trim().length;n.mutate({name:c.trim(),requirementsText:g.trim(),sites:z,location:C},{onSuccess:r=>{r&&(kN.searchCreated(r.id,e),t(r.id))},onError:()=>F("form")})},U=()=>{if(!V)return v(!0),S(!0),void R(!0);F("paraphrasing"),i.mutate(g.trim(),{onSuccess:e=>{e?(W(e),F("confirming")):$()},onError:()=>{$()}})};if("confirming"===O&&H)return(0,tr.jsx)(Tr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",p:3},children:(0,tr.jsxs)(Mn,{spacing:2,sx:{width:"100%",maxWidth:520},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,tr.jsx)(n_.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"Confirm your search"})]}),(0,tr.jsx)(FA,{color:"neutral",variant:"soft",startDecorator:(0,tr.jsx)(n_.A,{}),children:(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Here's what I understood:"}),(0,tr.jsx)(Gn,{level:"body-sm",sx:{mt:.5},children:H.humanSummary})]})}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1},children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:()=>F("form"),disabled:n.isPending,children:"\u2190 Edit requirements"}),(0,tr.jsx)(wo,{color:"primary",loading:n.isPending,onClick:$,children:"Looks right, create search \u2192"})]})]})});const q="paraphrasing"===O||"creating"===O||n.isPending;return(0,tr.jsx)(Tr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",p:3},children:(0,tr.jsxs)(Mn,{spacing:2,sx:{width:"100%",maxWidth:520},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:1},children:[(0,tr.jsx)(n_.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"New AI Search"})]}),(0,tr.jsxs)(mC,{error:p&&!c.trim(),children:[(0,tr.jsx)(SC,{children:"Name"}),(0,tr.jsx)(NC,{placeholder:"e.g. SW London family home",value:c,onChange:e=>{d(e.target.value),v(!0)},onBlur:()=>v(!0),autoFocus:!0}),p&&!c.trim()&&(0,tr.jsx)(oF,{children:"Add a name."})]}),(0,tr.jsxs)(mC,{error:P&&!C,children:[(0,tr.jsx)(SC,{children:"Location"}),(0,tr.jsx)(UF,{selectedLocation:C,onSelect:e=>{A(e),R(!0)},onClear:()=>{A(null),R(!0)}}),P&&!C&&(0,tr.jsx)(oF,{children:"Pick a location from the suggestions list \u2014 required to enable Create."})]}),(0,tr.jsxs)(mC,{error:w&&!g.trim(),children:[(0,tr.jsx)(SC,{children:"Requirements"}),(0,tr.jsx)(HM,{minRows:4,placeholder:"Describe what you're looking for in plain English\ne.g. 3 bed house under \xa3600k, good schools, near tube, garden",value:g,onChange:e=>{y(e.target.value),S(!0)},onBlur:()=>S(!0),onKeyDown:e=>{"Enter"===e.key&&e.metaKey&&U()}}),w&&!g.trim()&&(0,tr.jsx)(oF,{children:"Describe what you're looking for."})]}),!g&&(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",sx:{mb:.75},children:"Try a template:"}),(0,tr.jsx)(Tr,{sx:{display:"flex",gap:.75,flexWrap:"wrap"},children:KN.map(e=>(0,tr.jsx)(Ti,{size:"sm",variant:"outlined",color:"neutral",onClick:()=>y(e.requirements),sx:{cursor:"pointer","&:hover":{bgcolor:"neutral.softHoverBg"}},children:e.label},e.label))})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Sites"}),(0,tr.jsx)(QN,{sites:z,onChange:D}),0===z.length&&(0,tr.jsx)(Gn,{level:"body-xs",color:"danger",sx:{mt:.5},children:"Select at least one portal"})]}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1},children:[(0,tr.jsx)(wo,{onClick:U,loading:q,disabled:q,startDecorator:"paraphrasing"===O?(0,tr.jsx)(An,{size:"sm"}):null,children:"paraphrasing"===O?"Checking requirements\u2026":"Create"}),(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:r,disabled:q,children:"Cancel"})]})]})})}function eB(e){let t=e.searches,r=e.isLoading,n=e.activeId,o=e.showCreate,i=e.runningSearchId,a=e.onSelect,s=e.onCreate;return(0,tr.jsxs)(Tr,{sx:{p:1},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,mt:.5,mb:.75},children:[(0,tr.jsx)(Gn,{level:"body-xs",sx:{textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:"lg",color:"text.tertiary"},children:"AI Searches"}),(0,tr.jsx)(wo,{size:"sm",variant:"soft",color:"primary",startDecorator:(0,tr.jsx)(kz.A,{fontSize:"small"}),disabled:!!i,onClick:s,children:"New"})]}),(0,tr.jsxs)(Ui,{size:"sm",sx:{"--List-gap":"2px","--ListItem-radius":"var(--joy-radius-md)"},children:[r&&(0,tr.jsx)(ta,{children:(0,tr.jsx)(An,{size:"sm"})}),null===t||void 0===t?void 0:t.map(e=>{const t=i===e.id,r=!!i&&!t,s=!1===e.monitoringEnabled,l=!s&&"MANUAL"===e.scheduledFrequency,c=!o&&n===e.id;return(0,tr.jsx)(ta,{children:(0,tr.jsxs)(kp,{selected:c,variant:c?"soft":"plain",color:c?"primary":"neutral",disabled:r,onClick:()=>a(e.id),sx:{borderRadius:"md",fontWeight:c?"lg":"md"},children:[(0,tr.jsx)(n_.A,{fontSize:"small"}),(0,tr.jsx)(fz,{sx:{ml:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),!t&&(s?(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"neutral",children:"Paused"}):l?(0,tr.jsx)(Ti,{size:"sm",variant:"outlined",color:"neutral",children:"Manual"}):(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"success",startDecorator:(0,tr.jsx)(Tr,{sx:{width:6,height:6,borderRadius:"50%",bgcolor:"success.500"}}),children:"Watching"})),t&&(0,tr.jsx)(An,{size:"sm"})]})},e.id)}),!r&&0===(null===t||void 0===t?void 0:t.length)&&(0,tr.jsx)(ta,{children:(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"No searches yet"})})]})]})}function tB(){var e,t,r,n;const i=ie(),a=QE(),l=a.data,c=a.isLoading,d=$z().data,u=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>JE(e,"/ai-search/".concat(t),{method:"DELETE"}),onSuccess:()=>t.invalidateQueries({queryKey:["aiSearches"]})})})(),h=(0,o.useState)(null),p=(0,s.A)(h,2),v=p[0],f=p[1],m=(0,o.useState)(!1),g=(0,s.A)(m,2),y=g[0],b=g[1],x=(0,o.useState)(null),w=(0,s.A)(x,2),S=w[0],k=w[1],_=(0,o.useState)(void 0),C=(0,s.A)(_,2),A=C[0],j=C[1],I=void 0!==A,P=null!==(e=null===l||void 0===l?void 0:l.find(e=>e.id===v))&&void 0!==e?e:y?null:null!==(t=null===l||void 0===l?void 0:l[0])&&void 0!==t?t:null,R=P?null===d||void 0===d?void 0:d.find(e=>e.id===P.boardId):void 0,T=null!==(r=null===R||void 0===R?void 0:R.houses)&&void 0!==r?r:[];return(0,tr.jsxs)(Hz,{boards:d,activeBoard:null,onSelectBoard:e=>{i("/dashboard",{state:{boardId:e.id}})},mainSx:{overflow:"hidden"},children:[(0,tr.jsx)(Td,{title:"AI Property Search \u2014 Toppi",description:"Describe your ideal home and let Toppi search the whole UK property market for you \u2014 Rightmove, Zoopla and OnTheMarket, ranked and monitored.",canonicalPath:"/ai-search",noIndex:!0}),(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},height:"100%",minHeight:0},children:[(0,tr.jsx)(Tr,{sx:{width:{sm:280},flexShrink:0,borderRight:{sm:"1px solid"},borderBottom:{xs:"1px solid",sm:"none"},borderColor:"divider",overflow:"auto",maxHeight:{xs:"35vh",sm:"none"},bgcolor:"background.surface"},children:(0,tr.jsx)(eB,{searches:l,isLoading:c,activeId:null!==(n=null===P||void 0===P?void 0:P.id)&&void 0!==n?n:null,showCreate:y,runningSearchId:S,onSelect:e=>{f(e),b(!1)},onCreate:()=>{b(!0),f(null)}})}),(0,tr.jsx)(Tr,{sx:{flex:1,minWidth:0,overflow:"auto"},children:y?(0,tr.jsx)(ZN,{onSuccess:e=>{f(e),b(!1)},onCancel:()=>b(!1)}):P?(0,tr.jsx)(XN,{search:P,houses:T,onDelete:e=>{u.mutate(e),v===e&&f(null)},onRunStart:e=>k(e),onRunEnd:()=>k(null),onUpgradeRequired:e=>j(null!==e&&void 0!==e?e:"You've used your free search this month")}):(0,tr.jsx)(GR,{icon:(0,tr.jsx)(TA.A,{}),title:"AI Property Search",description:"Describe what you're looking for in plain English",action:(0,tr.jsx)(wo,{startDecorator:(0,tr.jsx)(n_.A,{}),onClick:()=>b(!0),children:"Create your first search"})})})]}),(0,tr.jsx)(jE,{open:I,title:A,onClose:()=>j(void 0)})]})}const rB=e=>null==e?"\u2014":e.toLocaleString("en-GB",{style:"currency",currency:"GBP",minimumFractionDigits:0}),nB=e=>{const t=(e||"").toLowerCase();return t.includes("very low")||"low"===t?"success":"medium"===t?"warning":"danger"},oB=e=>{const t=(e||"").toUpperCase();return["A","B"].includes(t)?"success":["C","D"].includes(t)?"warning":"danger"},iB=e=>{const t=(e||"").toLowerCase();return"outstanding"===t?"success":"good"===t?"primary":"requires improvement"===t?"warning":"inadequate"===t?"danger":"neutral"},aB=e=>null==e?"neutral":e>=80?"success":e>=60?"warning":"neutral",sB=[{key:"photo",label:"Photo"},{key:"price",label:"Price"},{key:"priceReduced",label:"Price reduced"},{key:"specs",label:"Beds \xb7 Baths \xb7 Size"},{key:"matchScore",label:"Match Score"},{key:"status",label:"Status"},{key:"floodRisk",label:"Flood Risk"},{key:"energyRating",label:"Energy Rating (EPC)"},{key:"crimeRate",label:"Crime Rate"},{key:"ptal",label:"PTAL"},{key:"nearestSchool",label:"Nearest School"},{key:"actions",label:""}];function lB(e){var t;let r=e.house;const n=null===(t=r.photos)||void 0===t?void 0:t[0];return(0,tr.jsx)(Io,{ratio:"4/3",sx:{borderRadius:"md",overflow:"hidden"},children:n?(0,tr.jsx)("img",{src:n,alt:r.title,style:{objectFit:"cover",width:"100%",height:"100%"}}):(0,tr.jsx)(Tr,{sx:{bgcolor:"background.level2",display:"flex",alignItems:"center",justifyContent:"center",color:"text.tertiary"},children:(0,tr.jsx)(Gn,{level:"body-sm",children:"No photo"})})})}function cB(e){let t=e.house;const r=null!=t.matchScore?Math.round(100*t.matchScore):null;return null==r?(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"}):(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:1,children:[(0,tr.jsx)(AE,{determinate:!0,value:r,color:aB(r),sx:{flex:1}}),(0,tr.jsxs)(Gn,{level:"body-sm",fontWeight:"md",sx:{minWidth:32,textAlign:"right"},children:[r,"%"]})]}),t.matchRationale&&(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",sx:{display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.matchRationale})]})}function dB(e){let t=e.house;return(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,flexWrap:"wrap",useFlexGap:!0,children:[(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(IA.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-sm",children:null==t.bedrooms?"?":t.bedrooms})]}),(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(PA.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-sm",children:t.bathrooms})]}),Number(t.floorSpaceSqm)>0&&(0,tr.jsxs)(Tr,{display:"flex",alignItems:"center",gap:.5,children:[(0,tr.jsx)(RA.A,{fontSize:"small"}),(0,tr.jsxs)(Gn,{level:"body-sm",children:[t.floorSpaceSqm,"m\xb2"]})]})]})}function uB(e){let t=e.label,r=e.color;return t?(0,tr.jsx)(Ti,{color:r,variant:"soft",size:"sm",children:t}):(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"})}function hB(e){let t=e.enrichment;return null==(null===t||void 0===t?void 0:t.crimeRatePer1000)?(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"}):(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:t.crimeRatePer1000}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"per 1,000"})]})}function pB(e){let t=e.enrichment;return null!==t&&void 0!==t&&t.ptal?(0,tr.jsx)(Gn,{level:"body-sm",fontWeight:"md",children:t.ptal}):(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"})}function vB(e){var t;let r=e.enrichment;const n=null===r||void 0===r||null===(t=r.schools)||void 0===t?void 0:t[0];return n?(0,tr.jsxs)(Mn,{spacing:.5,children:[(0,tr.jsx)(Gn,{level:"body-sm",children:n.name.split(",")[0]}),null!=n.distanceMiles&&(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:[n.distanceMiles," mi"]}),n.ofstedRating&&(0,tr.jsx)(Ti,{color:iB(n.ofstedRating),variant:"soft",size:"sm",children:n.ofstedRating})]}):(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"})}function fB(e){let t=e.house,r=e.enrichment,n=e.enrichmentLoading;const o=ie(),i=e=>{switch(e){case"photo":return(0,tr.jsx)(lB,{house:t});case"price":return(0,tr.jsx)(Gn,{level:"h4",children:null==t.priceGbp?"Price N/A":0===t.priceGbp?"POA":rB(t.priceGbp)});case"priceReduced":return null!=t.priceReducedPct&&t.priceReducedPct>0?(0,tr.jsxs)(Ti,{color:"danger",variant:"soft",size:"sm",children:["\u2212",t.priceReducedPct,"%"]}):(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"\u2014"});case"specs":return(0,tr.jsx)(dB,{house:t});case"matchScore":return(0,tr.jsx)(cB,{house:t});case"status":return(0,tr.jsx)(BL,{status:t.status});case"floodRisk":return n?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(uB,{label:null===r||void 0===r?void 0:r.floodRisk,color:nB(null===r||void 0===r?void 0:r.floodRisk)});case"energyRating":return n?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(uB,{label:null===r||void 0===r?void 0:r.energyRating,color:oB(null===r||void 0===r?void 0:r.energyRating)});case"crimeRate":return n?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(hB,{enrichment:r});case"ptal":return n?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(pB,{enrichment:r});case"nearestSchool":return n?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsx)(vB,{enrichment:r});case"actions":return(0,tr.jsx)(wo,{size:"sm",variant:"outlined",onClick:()=>o("/house/".concat(t.id)),children:"View Property"});default:return null}};return(0,tr.jsx)(hi,{variant:"outlined",sx:{p:2},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"title-md",sx:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.title}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",sx:{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.address})]}),(0,tr.jsx)(nc,{}),sB.map(e=>(0,tr.jsxs)(Tr,{children:[e.label&&(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",sx:{mb:.5,display:{xs:"block",sm:"none"}},children:e.label}),i(e.key)]},e.key))]})})}function mB(e){let t=e.id;const r=IM(t),n=r.data,o=r.isLoading,i=WA(t),a=i.data,s=i.isLoading;return o?(0,tr.jsx)(hi,{variant:"outlined",sx:{p:3},children:(0,tr.jsx)(Tr,{display:"flex",justifyContent:"center",children:(0,tr.jsx)(An,{})})}):n?(0,tr.jsx)(fB,{house:n,enrichment:a,enrichmentLoading:s}):(0,tr.jsx)(hi,{variant:"outlined",sx:{p:3},children:(0,tr.jsx)(Gn,{level:"body-sm",color:"danger",children:"Property not found"})})}function gB(){return(0,tr.jsx)(hi,{variant:"soft",sx:{p:2,position:"sticky",top:24},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsx)(Tr,{children:(0,tr.jsx)(Gn,{level:"title-md",children:"Comparing"})}),(0,tr.jsx)(nc,{}),sB.map(e=>(0,tr.jsx)(Tr,{sx:{minHeight:32,display:"flex",alignItems:"center"},children:(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:e.label})},e.key))]})})}function yB(){const e=Ac(),t=(0,s.A)(e,1)[0],r=ie(),n=Ma(),i=t.get("ids")||"",a=Array.from(new Set(i.split(",").map(e=>e.trim()).filter(Boolean))).slice(0,3);o.useEffect(()=>{a.length>=2&&Lz.comparisonStarted(a.length)},[i]);const l=(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:n})});if(a.length<2)return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:"Compare Properties \u2014 Toppi",noIndex:!0}),l,(0,tr.jsxs)(Tr,{sx:{maxWidth:"600px",mx:"auto",px:2,py:6,textAlign:"center"},children:[(0,tr.jsx)(Gn,{level:"h4",sx:{mb:1},children:"Select at least 2 properties"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",sx:{mb:3},children:"Pass two or three property IDs in the URL to compare them side by side."}),(0,tr.jsx)(wo,{onClick:()=>r("/dashboard"),children:"Back to Dashboard"})]})]});const c=Math.floor(9/a.length);return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:"Compare Properties \u2014 Toppi",noIndex:!0}),l,(0,tr.jsxs)(Tr,{sx:{maxWidth:"1200px",mx:"auto",px:{xs:2,md:4},py:3},children:[(0,tr.jsxs)(ID,{size:"sm",separator:(0,tr.jsx)(jM.A,{fontSize:"small"}),sx:{mb:2},children:[(0,tr.jsx)(hc,{underline:"none",color:"neutral",onClick:()=>r("/dashboard"),sx:{cursor:"pointer"},children:(0,tr.jsx)(o_.A,{})}),(0,tr.jsx)(Gn,{level:"title-sm",color:"primary",children:"Compare"})]}),(0,tr.jsxs)(Gn,{level:"h2",sx:{mb:2},children:["Compare ",a.length," properties"]}),(0,tr.jsxs)(AM,{container:!0,spacing:2,children:[(0,tr.jsx)(AM,{xs:0,sm:3,sx:{display:{xs:"none",sm:"block"}},children:(0,tr.jsx)(gB,{})}),a.map(e=>(0,tr.jsx)(AM,{xs:12,sm:c,children:(0,tr.jsx)(mB,{id:e})},e))]})]})]})}function bB(){const e=ie(),t=zl();return o.useEffect(()=>{Zk("subscription_started"),kN.proSubscriptionStarted("pro","/subscription/success"),t.invalidateQueries({queryKey:["subscription"]});const r=window.setTimeout(()=>e("/dashboard",{replace:!0}),1200);return()=>window.clearTimeout(r)},[e,t]),(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Td,{title:"Subscription \u2014 Toppi",noIndex:!0}),(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",gap:2},children:[(0,tr.jsx)(An,{}),(0,tr.jsx)(Gn,{level:"body-md",children:"Welcome to Pro \u2014 taking you back\u2026"})]})]})}var xB=r(5916);const wB=["07:00","07:30","08:00","08:30","09:00","09:30","10:00"],SB="08:00";function kB(e){let t=e.mode,r=e.fontSize,n=void 0===r?"small":r;const o=ej(t).Icon;return(0,tr.jsx)(o,{fontSize:n})}function _B(e){let t=e.value,r=e.onChange,n=e.disabled,i=e.sizeProp,a=void 0===i?"sm":i;const l=wB.includes(t),c=(0,o.useState)(!l),d=(0,s.A)(c,2),u=d[0],h=d[1],p=(0,o.useState)(l?SB:t),v=(0,s.A)(p,2),f=v[0],m=v[1];return(0,tr.jsxs)(Mn,{direction:"row",spacing:1,alignItems:"center",children:[(0,tr.jsxs)(dL,{size:a,value:u?"custom":t,onChange:(e,t)=>{null!=t&&("custom"!==t?(h(!1),r(t)):h(!0))},disabled:n,"aria-label":"Typical departure time",sx:{minWidth:110},children:[wB.map(e=>(0,tr.jsx)(gL,{value:e,children:e},e)),(0,tr.jsx)(gL,{value:"custom",children:"Custom\u2026"})]}),u&&(0,tr.jsx)(NC,{size:a,type:"time",value:f,onChange:e=>{const t=e.target.value;m(t),/^([01]\d|2[0-3]):[0-5]\d$/.test(t)&&r(t)},disabled:n,sx:{maxWidth:130}})]})}function CB(e){let t=e.destination,r=e.onDelete,n=e.deleting;const o=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{let r=t.id,n=t.patch;const o=await e();if(!o)return null;const i=await fetch("".concat(IW,"/api/destinations/").concat(r),{method:"PATCH",headers:{Authorization:o,"Content-Type":"application/json"},body:JSON.stringify(n)});if(400===i.status)throw new Error("invalid_input");if(404===i.status)throw new Error("not_found");if(!i.ok)throw new Error("patch_failed");return await i.json()},onSuccess:()=>{t.invalidateQueries({queryKey:VA})}})})(),i=t.departureTime||SB;return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{p:2,borderRadius:"sm",display:"flex",justifyContent:"space-between",alignItems:"center",gap:2,flexWrap:"wrap"},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1.5,minWidth:0,flex:1},children:[(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"primary",startDecorator:(0,tr.jsx)(kB,{mode:t.transportMode}),children:tj(t.transportMode)}),(0,tr.jsxs)(Tr,{sx:{minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:t.name}),(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",noWrap:!0,children:[t.address,t.postcode?" \xb7 ".concat(t.postcode):""]})]})]}),(0,tr.jsxs)(mC,{size:"sm",children:[(0,tr.jsx)(SC,{sx:{fontSize:"xs"},children:"Departure"}),(0,tr.jsx)(_B,{value:i,onChange:e=>{e!==i&&o.mutate({id:t.id,patch:{departureTime:e}})},disabled:o.isPending},i)]}),(0,tr.jsx)(Z_,{variant:"plain",color:"danger",size:"sm",disabled:n,onClick:r,"aria-label":"Remove ".concat(t.name),children:(0,tr.jsx)(SR.A,{})})]})}function AB(e){let t=e.disabled,r=e.currentCount;const n=(0,o.useState)(""),i=(0,s.A)(n,2),a=i[0],l=i[1],c=(0,o.useState)(null),d=(0,s.A)(c,2),u=d[0],h=d[1],p=(0,o.useState)("TUBE_BUS"),v=(0,s.A)(p,2),f=v[0],m=v[1],g=(0,o.useState)(SB),y=(0,s.A)(g,2),b=y[0],x=y[1],w=(0,o.useState)(null),S=(0,s.A)(w,2),k=S[0],_=S[1],C=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();if(!r)return null;const n=await fetch("".concat(IW,"/api/destinations"),{method:"POST",headers:{Authorization:r,"Content-Type":"application/json"},body:JSON.stringify(t)});if(422===n.status)throw new Error("limit_reached");if(!n.ok)throw new Error("create_failed");return await n.json()},onSuccess:()=>{t.invalidateQueries({queryKey:VA})}})})();return(0,tr.jsxs)(hi,{variant:"outlined",sx:{p:2},children:[(0,tr.jsx)(Gn,{level:"title-sm",sx:{mb:1.5},children:"Add destination"}),(0,tr.jsxs)(AM,{container:!0,spacing:1.5,children:[(0,tr.jsx)(AM,{xs:12,sm:4,children:(0,tr.jsxs)(mC,{size:"sm",children:[(0,tr.jsx)(SC,{children:"Label"}),(0,tr.jsx)(NC,{value:a,onChange:e=>l(e.target.value),placeholder:"Work",disabled:t})]})}),(0,tr.jsx)(AM,{xs:12,sm:8,children:(0,tr.jsxs)(mC,{size:"sm",children:[(0,tr.jsx)(SC,{children:"Address"}),(0,tr.jsx)(UF,{selectedLocation:u,onSelect:h,onClear:()=>h(null),disabled:t,placeholder:"Search a place, postcode or area (e.g. King's Cross, N1C)"})]})}),(0,tr.jsx)(AM,{xs:12,sm:4,children:(0,tr.jsxs)(mC,{size:"sm",children:[(0,tr.jsx)(SC,{children:"Transport mode"}),(0,tr.jsxs)(dL,{value:f,onChange:(e,t)=>t&&m(t),disabled:t,startDecorator:(0,tr.jsx)(kB,{mode:f}),children:[(0,tr.jsx)(gL,{value:"TUBE_BUS",children:"Tube / Bus"}),(0,tr.jsx)(gL,{value:"NATIONAL_RAIL",children:"National Rail"}),(0,tr.jsx)(gL,{value:"DRIVING",children:"Driving"}),(0,tr.jsx)(gL,{value:"WALKING",children:"Walking"}),(0,tr.jsx)(gL,{value:"CYCLING",children:"Cycling"})]})]})}),(0,tr.jsx)(AM,{xs:12,sm:4,children:(0,tr.jsxs)(mC,{size:"sm",children:[(0,tr.jsx)(SC,{children:"Typical departure time"}),(0,tr.jsx)(_B,{value:b,onChange:x,disabled:t})]})}),(0,tr.jsx)(AM,{xs:12,sm:4,sx:{display:"flex",alignItems:"flex-end",justifyContent:"flex-end"},children:(0,tr.jsx)(wo,{size:"sm",startDecorator:(0,tr.jsx)(xB.A,{}),loading:C.isPending,disabled:t,onClick:async()=>{if(_(null),a.trim()&&u)try{await C.mutateAsync({name:a.trim(),address:u.displayName,postcode:u.locationIdentifier||void 0,transportMode:f,departureTime:b}),Lz.commuteDestinationAdded(f,0===r),l(""),h(null),m("TUBE_BUS"),x(SB)}catch(Mp){const t=Mp instanceof Error?Mp.message:"create_failed";_("limit_reached"===t?"You can save up to ".concat(5," destinations."):"Could not save destination. Please try again.")}else _("Name and address are required.")},children:"Add destination"})})]}),k&&(0,tr.jsx)(oF,{sx:{color:"danger.500",mt:1.5},children:k})]})}function jB(){const e=Ma(),t=$A(),r=t.data,n=t.isLoading,i=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:async t=>{const r=await e();return!!r&&(await fetch("".concat(IW,"/api/destinations/").concat(t),{method:"DELETE",headers:{Authorization:r}})).ok},onSuccess:()=>{t.invalidateQueries({queryKey:VA})}})})(),a=(0,o.useState)(null),l=(0,s.A)(a,2),c=l[0],d=l[1],u=null!==r&&void 0!==r?r:[],h=u.length>=5;return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:"Commute Destinations \u2014 Toppi",noIndex:!0}),(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:e})}),(0,tr.jsx)(Tr,{sx:{maxWidth:900,mx:"auto",px:3,py:4},children:(0,tr.jsxs)(Mn,{spacing:4,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"h2",children:"Commute Destinations"}),(0,tr.jsxs)(Gn,{level:"body-md",textColor:"text.tertiary",children:["Save up to ",5," places \u2014 Toppi will show how long the commute is from every property and factor it into match scoring."]})]}),(0,tr.jsx)(nc,{}),n?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,tr.jsx)(An,{})}):(0,tr.jsxs)(Mn,{spacing:1.5,children:[0===u.length&&(0,tr.jsx)(Qz,{variant:"soft",sx:{p:3,borderRadius:"sm",textAlign:"center"},children:(0,tr.jsx)(Gn,{level:"body-md",textColor:"text.tertiary",children:"No destinations saved yet. Add the places you commute to and they'll show up on every property card."})}),u.map(e=>(0,tr.jsx)(CB,{destination:e,deleting:c===e.id,onDelete:()=>(async e=>{d(e);try{await i.mutateAsync(e)}finally{d(null)}})(e.id)},e.id))]}),(0,tr.jsx)(AB,{disabled:h,currentCount:u.length}),h&&(0,tr.jsxs)(Gn,{level:"body-xs",textColor:"text.tertiary",children:["You've reached the maximum of ",5," destinations. Remove one to add another."]})]})})]})}var IB=r(9576);function PB(e){return xr("MuiRadioGroup",e)}wr("MuiRadioGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg","horizontal","vertical"]);const RB=["className","component","children","name","defaultValue","disableIcon","overlay","value","onChange","color","variant","size","orientation","role","slots","slotProps"],TB=Qr("div",{name:"JoyRadioGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n;return(0,je.A)({},"sm"===t.size&&{"--RadioGroup-gap":"0.625rem"},"md"===t.size&&{"--RadioGroup-gap":"0.875rem"},"lg"===t.size&&{"--RadioGroup-gap":"1.25rem"},{display:"flex",margin:"var(--unstable_RadioGroup-margin)",flexDirection:"horizontal"===t.orientation?"row":"column",borderRadius:r.vars.radius.sm},null==(n=r.variants[t.variant])?void 0:n[t.color])}),EB=o.forwardRef(function(e,t){const r=en({props:e,name:"JoyRadioGroup"}),n=r.className,i=r.component,a=r.children,l=r.name,c=r.defaultValue,d=r.disableIcon,u=void 0!==d&&d,h=r.overlay,p=r.value,v=r.onChange,f=r.color,m=void 0===f?"neutral":f,g=r.variant,y=void 0===g?"plain":g,b=r.size,x=void 0===b?"md":b,w=r.orientation,S=void 0===w?"vertical":w,k=r.role,_=void 0===k?"radiogroup":k,C=r.slots,A=void 0===C?{}:C,j=r.slotProps,I=void 0===j?{}:j,P=(0,Ie.A)(r,RB),R=KC({controlled:p,default:c,name:"RadioGroup"}),T=(0,s.A)(R,2),E=T[0],z=T[1],D=o.useContext(lC),M=e.size||(null==D?void 0:D.size)||x,L=(0,je.A)({orientation:S,size:M,variant:y,color:m,role:_},r),O=(e=>{const t=e.orientation,r=e.size,n=e.variant,o=e.color;return Dr({root:["root",t,n&&"variant".concat(Le(n)),o&&"color".concat(Le(o)),r&&"size".concat(Le(r))]},PB,{})})(L),F=gi(l);const N=o.useMemo(()=>({disableIcon:u,overlay:h,orientation:S,size:M,name:F,value:E,onChange:e=>{z(e.target.value),v&&v(e)}}),[u,F,v,h,S,z,M,E]),B=pn("root",{ref:t,className:(0,Pe.A)(O.root,n),elementType:TB,externalForwardedProps:(0,je.A)({},P,{component:i,slots:A,slotProps:I}),ownerState:L,additionalProps:{as:i,role:_,id:null==D?void 0:D.htmlFor,"aria-labelledby":null==D?void 0:D.labelId,"aria-describedby":null==D?void 0:D["aria-describedby"]}}),H=(0,s.A)(B,2),W=H[0],V=H[1];return(0,tr.jsx)(Bi.Provider,{value:N,children:(0,tr.jsx)(W,(0,je.A)({},V,{children:(0,tr.jsx)(lC.Provider,{value:void 0,children:o.Children.map(a,(e,t)=>o.isValidElement(e)?o.cloneElement(e,(0,je.A)({},0===t&&{"data-first-child":""},t===o.Children.count(a)-1&&{"data-last-child":""},{"data-parent":"RadioGroup"})):e)})}))})}),zB=EB;function DB(e){return xr("MuiRadio",e)}const MB=wr("MuiRadio",["root","radio","icon","action","input","label","checked","disabled","focusVisible","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),LB=["checked","checkedIcon","defaultChecked","disabled","disableIcon","overlay","label","id","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","color","variant","size","uncheckedIcon","value","component","slots","slotProps"];const OB=Qr("span",{name:"JoyRadio",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.ownerState,r=e.theme;var n,o,i;return[(0,je.A)({"--Icon-fontSize":"var(--Radio-size)","--Icon-color":"currentColor"},"sm"===t.size&&{"--Radio-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:r.vars.fontSize.sm,gap:"var(--Radio-gap, 0.5rem)"},"md"===t.size&&{"--Radio-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:r.vars.fontSize.md,gap:"var(--Radio-gap, 0.625rem)"},"lg"===t.size&&{"--Radio-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:r.vars.fontSize.lg,gap:"var(--Radio-gap, 0.75rem)"},{position:t.overlay?"initial":"relative",display:"inline-flex",boxSizing:"border-box",minWidth:0,fontFamily:r.vars.fontFamily.body,lineHeight:"var(--Radio-size)",color:r.vars.palette.text.primary,["&.".concat(MB.disabled)]:{color:null==(n=r.variants.plainDisabled)||null==(n=n[t.color])?void 0:n.color}},t.disableIcon&&{color:null==(o=r.variants[t.variant])||null==(o=o[t.color])?void 0:o.color,["&.".concat(MB.disabled)]:{color:null==(i=r.variants["".concat(t.variant,"Disabled")])||null==(i=i[t.color])?void 0:i.color}},"RadioGroup"===t["data-parent"]&&void 0===t["data-first-child"]&&{marginInlineStart:"horizontal"===t.orientation?"var(--RadioGroup-gap)":void 0,marginBlockStart:"horizontal"===t.orientation?void 0:"var(--RadioGroup-gap)"})]}),FB=Qr("span",{name:"JoyRadio",slot:"Radio",overridesResolver:(e,t)=>t.radio})(e=>{let t=e.ownerState,r=e.theme;var n,o,i,a,s;const l=null==(n=r.variants["".concat(t.variant)])?void 0:n[t.color];return[(0,je.A)({"--Icon-color":"neutral"!==t.color||"solid"===t.variant?"currentColor":r.vars.palette.text.icon,margin:0,boxSizing:"border-box",width:"var(--Radio-size)",height:"var(--Radio-size)",borderRadius:"var(--Radio-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{["&.".concat(MB.checked)]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[(0,je.A)({},l,{backgroundColor:null!=(o=null==l?void 0:l.backgroundColor)?o:r.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":null==(i=r.variants["".concat(t.variant,"Hover")])?void 0:i[t.color]}},{"&:active":null==(a=r.variants["".concat(t.variant,"Active")])?void 0:a[t.color]},{["&.".concat(MB.disabled)]:null==(s=r.variants["".concat(t.variant,"Disabled")])?void 0:s[t.color]}]]}),NB=Qr("span",{name:"JoyRadio",slot:"Action",overridesResolver:(e,t)=>t.action})(e=>{let t=e.theme,r=e.ownerState;var n,o,i,a;return[{position:"absolute",textAlign:"left",borderRadius:"var(--Radio-actionRadius, ".concat(r.overlay?"var(--unstable_actionRadius, inherit)":"inherit",")"),top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[t.focus.selector]:t.focus.default},...r.disableIcon?[null==(n=t.variants[r.variant])?void 0:n[r.color],{"&:hover":{"@media (hover: hover)":null==(o=t.variants["".concat(r.variant,"Hover")])?void 0:o[r.color]}},{"&:active":null==(i=t.variants["".concat(r.variant,"Active")])?void 0:i[r.color]},{["&.".concat(MB.disabled)]:null==(a=t.variants["".concat(r.variant,"Disabled")])?void 0:a[r.color]}]:[]]}),BB=Qr("input",{name:"JoyRadio",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",height:"100%",width:"100%",cursor:"pointer"})),HB=Qr("label",{name:"JoyRadio",slot:"Label",overridesResolver:(e,t)=>t.label})(e=>{let t=e.ownerState;return(0,je.A)({flex:1,minWidth:0},t.disableIcon&&{zIndex:1,pointerEvents:"none"})}),WB=Qr("span",{name:"JoyRadio",slot:"Icon",overridesResolver:(e,t)=>t.icon})(e=>({width:"calc(var(--Radio-size) / 2)",height:"calc(var(--Radio-size) / 2)",borderRadius:"inherit",color:"inherit",backgroundColor:"currentColor",transform:e.ownerState.checked?"scale(1)":"scale(0)"})),VB=o.forwardRef(function(e,t){var r,n,i,a,l,c,d;const u=en({props:e,name:"JoyRadio"}),h=u.checked,p=u.checkedIcon,v=u.defaultChecked,f=u.disabled,m=u.disableIcon,g=void 0!==m&&m,y=u.overlay,b=void 0!==y&&y,x=u.label,w=u.id,S=u.name,k=u.onBlur,_=u.onChange,C=u.onFocus,A=u.onFocusVisible,j=u.readOnly,I=u.required,P=u.color,R=u.variant,T=void 0===R?"outlined":R,E=u.size,z=void 0===E?"md":E,D=u.uncheckedIcon,M=u.value,L=u.component,O=u.slots,F=void 0===O?{}:O,N=u.slotProps,B=void 0===N?{}:N,H=(0,Ie.A)(u,LB),W=o.useContext(lC);const V=gi(null!=w?w:null==W?void 0:W.htmlFor),$=o.useContext(Bi),U=null!=W&&W.error?"danger":null!=(r=null!=(n=null!=(i=e.color)?i:null==W?void 0:W.color)?n:P)?r:"primary",q=null!=W&&W.error?"danger":null!=(a=null!=(l=null!=(c=e.color)?c:null==W?void 0:W.color)?l:P)?a:"neutral",K=e.size||(null==W?void 0:W.size)||(null==$?void 0:$.size)||z,G=e.name||(null==$?void 0:$.name)||S,J=e.disableIcon||(null==$?void 0:$.disableIcon)||g,Q=e.overlay||(null==$?void 0:$.overlay)||b,Y="undefined"===typeof h&&null!=M?function(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}(null==$?void 0:$.value,M):h,X=GC({checked:Y,defaultChecked:v,disabled:e.disabled||(null==W?void 0:W.disabled)||f,onBlur:k,onChange:_,onFocus:C,onFocusVisible:A}),Z=X.getInputProps,ee=X.checked,te=X.disabled,re=X.focusVisible,ne=null!=(d=e.color)?d:ee?U:q,oe=(0,je.A)({},u,{checked:ee,disabled:te,focusVisible:re,color:ne,variant:T,size:K,disableIcon:J,overlay:Q,orientation:null==$?void 0:$.orientation}),ie=(e=>{const t=e.checked,r=e.disabled,n=e.disableIcon,o=e.focusVisible,i=e.color,a=e.variant,s=e.size;return Dr({root:["root",t&&"checked",r&&"disabled",o&&"focusVisible",a&&"variant".concat(Le(a)),i&&"color".concat(Le(i)),s&&"size".concat(Le(s))],radio:["radio",t&&"checked",r&&"disabled"],icon:["icon"],action:["action",t&&"checked",n&&r&&"disabled",o&&"focusVisible"],input:["input"],label:["label"]},DB,{})})(oe),ae=(0,je.A)({},H,{component:L,slots:F,slotProps:B}),se=pn("root",{ref:t,className:ie.root,elementType:OB,externalForwardedProps:ae,ownerState:oe}),le=(0,s.A)(se,2),ce=le[0],de=le[1],ue=pn("radio",{className:ie.radio,elementType:FB,externalForwardedProps:ae,ownerState:oe}),he=(0,s.A)(ue,2),pe=he[0],ve=he[1],fe=pn("icon",{className:ie.icon,elementType:WB,externalForwardedProps:ae,ownerState:oe}),me=(0,s.A)(fe,2),ge=me[0],ye=me[1],be=pn("action",{className:ie.action,elementType:NB,externalForwardedProps:ae,ownerState:oe}),xe=(0,s.A)(be,2),we=xe[0],Se=xe[1],ke=pn("input",{additionalProps:{type:"radio",role:void 0,id:V,name:G,readOnly:j,required:null!=I?I:null==W?void 0:W.required,value:String(M),"aria-describedby":null==W?void 0:W["aria-describedby"]},className:ie.input,elementType:BB,externalForwardedProps:ae,getSlotProps:()=>Z({onChange:null==$?void 0:$.onChange}),ownerState:oe}),_e=(0,s.A)(ke,2),Ce=_e[0],Ae=_e[1],Pe=pn("label",{additionalProps:{htmlFor:V},className:ie.label,elementType:HB,externalForwardedProps:ae,ownerState:oe}),Re=(0,s.A)(Pe,2),Te=Re[0],Ee=Re[1];return(0,tr.jsxs)(ce,(0,je.A)({},de,{children:[(0,tr.jsxs)(pe,(0,je.A)({},ve,{children:[ee&&!J&&p,!ee&&!J&&D,!p&&!D&&!J&&(0,tr.jsx)(ge,(0,je.A)({},ye)),(0,tr.jsx)(we,(0,je.A)({},Se,{children:(0,tr.jsx)(Ce,(0,je.A)({},Ae))}))]})),x&&(0,tr.jsx)(Te,(0,je.A)({},Ee,{children:(0,tr.jsx)(Hn.Provider,{value:!0,children:x})}))]}))}),$B=VB;const UB=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))};function qB(e,t){return e-t}function KB(e,t){var r;return(null!=(r=e.reduce((e,r,n)=>{const o=Math.abs(t-r);return null===e||o({left:"".concat(e,"%")}),leap:e=>({width:"".concat(e,"%")})},"horizontal-reverse":{offset:e=>({right:"".concat(e,"%")}),leap:e=>({width:"".concat(e,"%")})},vertical:{offset:e=>({bottom:"".concat(e,"%")}),leap:e=>({height:"".concat(e,"%")})}},tH=e=>e;let rH;function nH(){return void 0===rH&&(rH="undefined"===typeof CSS||"function"!==typeof CSS.supports||CSS.supports("touch-action","none")),rH}function oH(e){const t=e["aria-labelledby"],r=e.defaultValue,n=e.disabled,i=void 0!==n&&n,a=e.disableSwap,l=void 0!==a&&a,c=e.isRtl,d=void 0!==c&&c,u=e.marks,h=void 0!==u&&u,p=e.max,v=void 0===p?100:p,f=e.min,m=void 0===f?0:f,g=e.name,y=e.onChange,b=e.onChangeCommitted,x=e.orientation,w=void 0===x?"horizontal":x,S=e.rootRef,k=e.scale,_=void 0===k?tH:k,C=e.step,A=void 0===C?1:C,j=e.shiftStep,I=void 0===j?10:j,P=e.tabIndex,R=e.value,T=o.useRef(void 0),E=o.useState(-1),z=(0,s.A)(E,2),D=z[0],M=z[1],L=o.useState(-1),O=(0,s.A)(L,2),F=O[0],N=O[1],B=o.useState(!1),H=(0,s.A)(B,2),W=H[0],V=H[1],$=o.useRef(0),U=KC({controlled:R,default:null!=r?r:m,name:"Slider"}),q=(0,s.A)(U,2),K=q[0],G=q[1],J=y&&((e,t,r)=>{const n=e.nativeEvent||e,o=new n.constructor(n.type,n);Object.defineProperty(o,"target",{writable:!0,value:{value:t,name:g}}),y(o,t,r)}),Q=Array.isArray(K);let Y=Q?K.slice().sort(qB):[K];Y=Y.map(e=>null==e?m:UB(e,m,v));const X=!0===h&&null!==A?[...Array(Math.floor((v-m)/A)+1)].map((e,t)=>({value:m+A*t})):h||[],Z=X.map(e=>e.value),ee=so(),te=ee.isFocusVisibleRef,re=ee.onBlur,ne=ee.onFocus,oe=ee.ref,ie=o.useState(-1),ae=(0,s.A)(ie,2),se=ae[0],le=ae[1],ce=o.useRef(null),de=rn(oe,ce),ue=rn(S,de),he=e=>t=>{var r;const n=Number(t.currentTarget.getAttribute("data-index"));ne(t),!0===te.current&&le(n),N(n),null==e||null==(r=e.onFocus)||r.call(e,t)},pe=e=>t=>{var r;re(t),!1===te.current&&le(-1),N(-1),null==e||null==(r=e.onBlur)||r.call(e,t)},ve=(e,t)=>{const r=Number(e.currentTarget.getAttribute("data-index")),n=Y[r],o=Z.indexOf(n);let i=t;if(X&&null==A){const e=Z[Z.length-1];i=i>e?e:it=>{var r;if(null!==A){const e=Number(t.currentTarget.getAttribute("data-index")),r=Y[e];let n=null;("ArrowLeft"===t.key||"ArrowDown"===t.key)&&t.shiftKey||"PageDown"===t.key?n=Math.max(r-I,m):(("ArrowRight"===t.key||"ArrowUp"===t.key)&&t.shiftKey||"PageUp"===t.key)&&(n=Math.min(r+I,v)),null!==n&&(ve(t,n),t.preventDefault())}null==e||null==(r=e.onKeyDown)||r.call(e,t)};eu(()=>{var e;i&&ce.current.contains(document.activeElement)&&(null==(e=document.activeElement)||e.blur())},[i]),i&&-1!==D&&M(-1),i&&-1!==se&&le(-1);const me=o.useRef(void 0);let ge=w;d&&"horizontal"===w&&(ge+="-reverse");const ye=e=>{let t=e.finger,r=e.move,n=void 0!==r&&r;const o=ce.current.getBoundingClientRect(),i=o.width,a=o.height,s=o.bottom,c=o.left;let d,u;if(d=0===ge.indexOf("vertical")?(s-t.y)/a:(t.x-c)/i,-1!==ge.indexOf("-reverse")&&(d=1-d),u=function(e,t,r){return(r-t)*e+t}(d,m,v),A)u=QB(u,A,m);else{const e=KB(Z,u);u=Z[e]}u=UB(u,m,v);let h=0;if(Q){h=n?me.current:KB(Y,u),l&&(u=UB(u,Y[h-1]||-1/0,Y[h+1]||1/0));const e=u;u=YB({values:Y,newValue:u,index:h}),l&&n||(h=u.indexOf(e),me.current=h)}return{newValue:u,activeIndex:h}},be=b_(e=>{const t=GB(e,T);if(!t)return;if($.current+=1,"mousemove"===e.type&&0===e.buttons)return void xe(e);const r=ye({finger:t,move:!0}),n=r.newValue,o=r.activeIndex;XB({sliderRef:ce,activeIndex:o,setActive:M}),G(n),!W&&$.current>2&&V(!0),J&&!ZB(n,K)&&J(e,n,o)}),xe=b_(e=>{const t=GB(e,T);if(V(!1),!t)return;const r=ye({finger:t,move:!0}).newValue;M(-1),"touchend"===e.type&&N(-1),b&&b(e,r),T.current=void 0,Se()}),we=b_(e=>{if(i)return;nH()||e.preventDefault();const t=e.changedTouches[0];null!=t&&(T.current=t.identifier);const r=GB(e,T);if(!1!==r){const t=ye({finger:r}),n=t.newValue,o=t.activeIndex;XB({sliderRef:ce,activeIndex:o,setActive:M}),G(n),J&&!ZB(n,K)&&J(e,n,o)}$.current=0;const n=Iu(ce.current);n.addEventListener("touchmove",be,{passive:!0}),n.addEventListener("touchend",xe,{passive:!0})}),Se=o.useCallback(()=>{const e=Iu(ce.current);e.removeEventListener("mousemove",be),e.removeEventListener("mouseup",xe),e.removeEventListener("touchmove",be),e.removeEventListener("touchend",xe)},[xe,be]);o.useEffect(()=>{const e=ce.current;return e.addEventListener("touchstart",we,{passive:nH()}),()=>{e.removeEventListener("touchstart",we),Se()}},[Se,we]),o.useEffect(()=>{i&&Se()},[i,Se]);const ke=JB(Q?Y[0]:m,m,v),_e=JB(Y[Y.length-1],m,v)-ke,Ce=e=>t=>{var r;null==(r=e.onMouseLeave)||r.call(e,t),N(-1)};return{active:D,axis:ge,axisProps:eH,dragging:W,focusedThumbIndex:se,getHiddenInputProps:function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n;const o=on(r),a={onChange:(s=o||{},e=>{var t;null==(t=s.onChange)||t.call(s,e),ve(e,e.target.valueAsNumber)}),onFocus:he(o||{}),onBlur:pe(o||{}),onKeyDown:fe(o||{})};var s;const l=(0,je.A)({},o,a);return(0,je.A)({tabIndex:P,"aria-labelledby":t,"aria-orientation":w,"aria-valuemax":_(v),"aria-valuemin":_(m),name:g,type:"range",min:e.min,max:e.max,step:null===e.step&&e.marks?"any":null!=(n=e.step)?n:void 0,disabled:i},r,l,{style:(0,je.A)({},WM,{direction:d?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r={onMouseDown:(n=t||{},e=>{var t;if(null==(t=n.onMouseDown)||t.call(n,e),i)return;if(e.defaultPrevented)return;if(0!==e.button)return;e.preventDefault();const r=GB(e,T);if(!1!==r){const t=ye({finger:r}),n=t.newValue,o=t.activeIndex;XB({sliderRef:ce,activeIndex:o,setActive:M}),G(n),J&&!ZB(n,K)&&J(e,n,o)}$.current=0;const o=Iu(ce.current);o.addEventListener("mousemove",be,{passive:!0}),o.addEventListener("mouseup",xe)})};var n;const o=(0,je.A)({},t,r);return(0,je.A)({},e,{ref:ue},o)},getThumbProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=on(e),r={onMouseOver:(n=t||{},e=>{var t;null==(t=n.onMouseOver)||t.call(n,e);const r=Number(e.currentTarget.getAttribute("data-index"));N(r)}),onMouseLeave:Ce(t||{})};var n;return(0,je.A)({},e,t,r)},marks:X,open:F,range:Q,rootRef:ue,trackLeap:_e,trackOffset:ke,values:Y,getThumbStyle:e=>({pointerEvents:-1!==D&&D!==e?"none":void 0})}}function iH(e){return xr("MuiSlider",e)}const aH=wr("MuiSlider",["root","disabled","dragging","focusVisible","marked","vertical","trackInverted","trackFalse","rail","track","mark","markActive","markLabel","thumb","thumbStart","thumbEnd","valueLabel","valueLabelOpen","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","disabled","sizeSm","sizeMd","sizeLg","input"]),sH=["aria-label","aria-valuetext","className","classes","disableSwap","disabled","defaultValue","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","onMouseDown","orientation","shiftStep","scale","step","tabIndex","track","value","valueLabelDisplay","valueLabelFormat","isRtl","color","size","variant","component","slots","slotProps"];function lH(e){return e}const cH=Qr("span",{name:"JoySlider",slot:"Root",overridesResolver:(e,t)=>t.root})(e=>{let t=e.theme,r=e.ownerState;const n=(e=>{let t=e.theme,r=e.ownerState;return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var n,o;const i=(null==(n=t.variants["".concat(r.variant).concat(e.state||"")])?void 0:n[r.color])||{};return(0,je.A)({},!e.state&&{"--variant-borderWidth":null!=(o=i["--variant-borderWidth"])?o:"0px"},{"--Slider-trackColor":i.color,"--Slider-thumbBackground":i.color,"--Slider-thumbColor":i.backgroundColor||t.vars.palette.background.surface,"--Slider-trackBackground":i.backgroundColor||t.vars.palette.background.surface,"--Slider-trackBorderColor":i.borderColor,"--Slider-railBackground":t.vars.palette.background.level2})}})({theme:t,ownerState:r});return[(0,je.A)({"--Slider-size":"max(42px, max(var(--Slider-thumbSize), var(--Slider-trackSize)))","--Slider-trackRadius":"var(--Slider-size)","--Slider-markBackground":t.vars.palette.text.tertiary,["& .".concat(aH.markActive)]:{"--Slider-markBackground":"var(--Slider-trackColor)"}},"sm"===r.size&&{"--Slider-markSize":"2px","--Slider-trackSize":"4px","--Slider-thumbSize":"14px","--Slider-valueLabelArrowSize":"6px"},"md"===r.size&&{"--Slider-markSize":"2px","--Slider-trackSize":"6px","--Slider-thumbSize":"18px","--Slider-valueLabelArrowSize":"8px"},"lg"===r.size&&{"--Slider-markSize":"3px","--Slider-trackSize":"8px","--Slider-thumbSize":"24px","--Slider-valueLabelArrowSize":"10px"},{"--Slider-thumbRadius":"calc(var(--Slider-thumbSize) / 2)","--Slider-thumbWidth":"var(--Slider-thumbSize)"},n(),{"&:hover":{"@media (hover: hover)":(0,je.A)({},n({state:"Hover"}))},"&:active":(0,je.A)({},n({state:"Active"})),["&.".concat(aH.disabled)]:(0,je.A)({pointerEvents:"none",color:t.vars.palette.text.tertiary},n({state:"Disabled"})),boxSizing:"border-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent"},"horizontal"===r.orientation&&{padding:"calc(var(--Slider-size) / 2) 0",width:"100%"},"vertical"===r.orientation&&{padding:"0 calc(var(--Slider-size) / 2)",height:"100%"},{"@media print":{colorAdjust:"exact"}})]}),dH=Qr("span",{name:"JoySlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(e=>{let t=e.ownerState;return[(0,je.A)({display:"block",position:"absolute",backgroundColor:"inverted"===t.track?"var(--Slider-trackBackground)":"var(--Slider-railBackground)",border:"inverted"===t.track?"var(--variant-borderWidth, 0px) solid var(--Slider-trackBorderColor)":"initial",borderRadius:"var(--Slider-trackRadius)"},"horizontal"===t.orientation&&{height:"var(--Slider-trackSize)",top:"50%",left:0,right:0,transform:"translateY(-50%)"},"vertical"===t.orientation&&{width:"var(--Slider-trackSize)",top:0,bottom:0,left:"50%",transform:"translateX(-50%)"},"inverted"===t.track&&{opacity:1})]}),uH=Qr("span",{name:"JoySlider",slot:"Track",overridesResolver:(e,t)=>t.track})(e=>{let t=e.ownerState;return[(0,je.A)({display:"block",position:"absolute",color:"var(--Slider-trackColor)",border:"inverted"===t.track?"initial":"var(--variant-borderWidth, 0px) solid var(--Slider-trackBorderColor)",backgroundColor:"inverted"===t.track?"var(--Slider-railBackground)":"var(--Slider-trackBackground)"},"horizontal"===t.orientation&&{height:"var(--Slider-trackSize)",top:"50%",transform:"translateY(-50%)",borderRadius:"var(--Slider-trackRadius) 0 0 var(--Slider-trackRadius)"},"vertical"===t.orientation&&{width:"var(--Slider-trackSize)",left:"50%",transform:"translateX(-50%)",borderRadius:"0 0 var(--Slider-trackRadius) var(--Slider-trackRadius)"},!1===t.track&&{display:"none"})]}),hH=Qr("span",{name:"JoySlider",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(e=>{let t=e.ownerState,r=e.theme;var n;return(0,je.A)({position:"absolute",boxSizing:"border-box",outline:0,display:"flex",alignItems:"center",justifyContent:"center",width:"var(--Slider-thumbWidth)",height:"var(--Slider-thumbSize)",border:"var(--variant-borderWidth, 0px) solid var(--Slider-trackBorderColor)",borderRadius:"var(--Slider-thumbRadius)",boxShadow:"var(--Slider-thumbShadow)",color:"var(--Slider-thumbColor)",backgroundColor:"var(--Slider-thumbBackground)",[r.focus.selector]:(0,je.A)({},r.focus.default,{outlineOffset:0,outlineWidth:"max(4px, var(--Slider-thumbSize) / 3.6)",outlineColor:"rgba(".concat(null==(n=r.vars.palette)||null==(n=n[t.color])?void 0:n.mainChannel," / 0.32)")})},"horizontal"===t.orientation&&{top:"50%",transform:"translate(-50%, -50%)"},"vertical"===t.orientation&&{left:"50%",transform:"translate(-50%, 50%)"},{"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",background:"transparent",top:0,left:0,width:"100%",height:"100%",border:"2px solid",borderColor:"var(--Slider-thumbColor)",borderRadius:"inherit"}})}),pH=Qr("span",{name:"JoySlider",slot:"Mark",overridesResolver:(e,t)=>t.mark})(e=>{let t=e.ownerState;return(0,je.A)({position:"absolute",width:"var(--Slider-markSize)",height:"var(--Slider-markSize)",borderRadius:"var(--Slider-markSize)",backgroundColor:"var(--Slider-markBackground)"},"horizontal"===t.orientation&&(0,je.A)({top:"50%",transform:"translate(calc(var(--Slider-markSize) / -2), -50%)"},0===t.percent&&{transform:"translate(min(var(--Slider-markSize), 3px), -50%)"},100===t.percent&&{transform:"translate(calc(var(--Slider-markSize) * -1 - min(var(--Slider-markSize), 3px)), -50%)"}),"vertical"===t.orientation&&(0,je.A)({left:"50%",transform:"translate(-50%, calc(var(--Slider-markSize) / 2))"},0===t.percent&&{transform:"translate(-50%, calc(min(var(--Slider-markSize), 3px) * -1))"},100===t.percent&&{transform:"translate(-50%, calc(var(--Slider-markSize) * 1 + min(var(--Slider-markSize), 3px)))"}))}),vH=Qr("span",{name:"JoySlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({},"sm"===r.size&&{fontSize:t.fontSize.xs,lineHeight:t.lineHeight.md,paddingInline:"0.25rem",minWidth:"20px"},"md"===r.size&&{fontSize:t.fontSize.sm,lineHeight:t.lineHeight.md,paddingInline:"0.375rem",minWidth:"24px"},"lg"===r.size&&{fontSize:t.fontSize.md,lineHeight:t.lineHeight.md,paddingInline:"0.5rem",minWidth:"28px"},{zIndex:1,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap",fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,bottom:0,transformOrigin:"bottom center",transform:"translateY(calc((var(--Slider-thumbSize) + var(--Slider-valueLabelArrowSize)) * -1)) scale(0)",position:"absolute",backgroundColor:t.vars.palette.background.tooltip,boxShadow:t.shadow.sm,borderRadius:t.vars.radius.xs,color:"#fff","&::before":{display:"var(--Slider-valueLabelArrowDisplay)",position:"absolute",content:'""',color:t.vars.palette.background.tooltip,bottom:0,border:"calc(var(--Slider-valueLabelArrowSize) / 2) solid",borderColor:"currentColor",borderRightColor:"transparent",borderBottomColor:"transparent",borderLeftColor:"transparent",left:"50%",transform:"translate(-50%, 100%)",backgroundColor:"transparent"},["&.".concat(aH.valueLabelOpen)]:{transform:"translateY(calc((var(--Slider-thumbSize) + var(--Slider-valueLabelArrowSize)) * -1)) scale(1)"}})}),fH=Qr("span",{name:"JoySlider",slot:"MarkLabel",overridesResolver:(e,t)=>t.markLabel})(e=>{let t=e.theme,r=e.ownerState;return(0,je.A)({fontFamily:t.vars.fontFamily.body},"sm"===r.size&&{fontSize:t.vars.fontSize.xs},"md"===r.size&&{fontSize:t.vars.fontSize.sm},"lg"===r.size&&{fontSize:t.vars.fontSize.md},{color:t.palette.text.tertiary,position:"absolute",whiteSpace:"nowrap"},"horizontal"===r.orientation&&{top:"calc(50% + 4px + (max(var(--Slider-trackSize), var(--Slider-thumbSize)) / 2))",transform:"translateX(-50%)"},"vertical"===r.orientation&&{left:"calc(50% + 8px + (max(var(--Slider-trackSize), var(--Slider-thumbSize)) / 2))",transform:"translateY(50%)"})}),mH=Qr("input",{name:"JoySlider",slot:"Input",overridesResolver:(e,t)=>t.input})({}),gH=o.forwardRef(function(e,t){const r=en({props:e,name:"JoySlider"}),n=r["aria-label"],i=r["aria-valuetext"],a=r.className,l=r.classes,c=r.disableSwap,d=void 0!==c&&c,u=r.disabled,h=void 0!==u&&u,p=r.defaultValue,v=r.getAriaLabel,f=r.getAriaValueText,m=r.marks,g=void 0!==m&&m,y=r.max,b=void 0===y?100:y,x=r.min,w=void 0===x?0:x,S=r.orientation,k=void 0===S?"horizontal":S,_=r.shiftStep,C=void 0===_?10:_,A=r.scale,j=void 0===A?lH:A,I=r.step,P=void 0===I?1:I,R=r.track,T=void 0===R?"normal":R,E=r.valueLabelDisplay,z=void 0===E?"off":E,D=r.valueLabelFormat,M=void 0===D?lH:D,L=r.isRtl,O=void 0!==L&&L,F=r.color,N=void 0===F?"primary":F,B=r.size,H=void 0===B?"md":B,W=r.variant,V=void 0===W?"solid":W,$=r.component,U=r.slots,q=void 0===U?{}:U,K=r.slotProps,G=void 0===K?{}:K,J=(0,Ie.A)(r,sH),Q=(0,je.A)({},r,{marks:g,classes:l,disabled:h,defaultValue:p,disableSwap:d,isRtl:O,max:b,min:w,orientation:k,shiftStep:C,scale:j,step:P,track:T,valueLabelDisplay:z,valueLabelFormat:M,color:N,size:H,variant:V}),Y=oH((0,je.A)({},Q,{rootRef:t})),X=Y.axisProps,Z=Y.getRootProps,ee=Y.getHiddenInputProps,te=Y.getThumbProps,re=Y.open,ne=Y.active,oe=Y.axis,ie=Y.focusedThumbIndex,ae=Y.range,se=Y.dragging,le=Y.marks,ce=Y.values,de=Y.trackOffset,ue=Y.trackLeap,he=Y.getThumbStyle;Q.marked=le.length>0&&le.some(e=>e.label),Q.dragging=se;const pe=(0,je.A)({},X[oe].offset(de),X[oe].leap(ue)),ve=(e=>{const t=e.disabled,r=e.dragging,n=e.marked,o=e.orientation,i=e.track,a=e.variant,s=e.color,l=e.size;return Dr({root:["root",t&&"disabled",r&&"dragging",n&&"marked","vertical"===o&&"vertical","inverted"===i&&"trackInverted",!1===i&&"trackFalse",a&&"variant".concat(Le(a)),s&&"color".concat(Le(s)),l&&"size".concat(Le(l))],rail:["rail"],track:["track"],thumb:["thumb",t&&"disabled"],input:["input"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],valueLabelOpen:["valueLabelOpen"],active:["active"],focusVisible:["focusVisible"]},iH,{})})(Q),fe=(0,je.A)({},J,{component:$,slots:q,slotProps:G}),me=pn("root",{ref:t,className:(0,Pe.A)(ve.root,a),elementType:cH,externalForwardedProps:fe,getSlotProps:Z,ownerState:Q}),ge=(0,s.A)(me,2),ye=ge[0],be=ge[1],xe=pn("rail",{className:ve.rail,elementType:dH,externalForwardedProps:fe,ownerState:Q}),we=(0,s.A)(xe,2),Se=we[0],ke=we[1],_e=pn("track",{additionalProps:{style:pe},className:ve.track,elementType:uH,externalForwardedProps:fe,ownerState:Q}),Ce=(0,s.A)(_e,2),Ae=Ce[0],Re=Ce[1],Te=pn("mark",{className:ve.mark,elementType:pH,externalForwardedProps:fe,ownerState:Q}),Ee=(0,s.A)(Te,2),ze=Ee[0],De=Ee[1],Me=pn("markLabel",{className:ve.markLabel,elementType:fH,externalForwardedProps:fe,ownerState:Q,additionalProps:{"aria-hidden":!0}}),Oe=(0,s.A)(Me,2),Fe=Oe[0],Ne=Oe[1],Be=pn("thumb",{className:ve.thumb,elementType:hH,externalForwardedProps:fe,getSlotProps:te,ownerState:Q}),He=(0,s.A)(Be,2),We=He[0],Ve=He[1],$e=pn("input",{className:ve.input,elementType:mH,externalForwardedProps:fe,getSlotProps:ee,ownerState:Q}),Ue=(0,s.A)($e,2),qe=Ue[0],Ke=Ue[1],Ge=pn("valueLabel",{className:ve.valueLabel,elementType:vH,externalForwardedProps:fe,ownerState:Q}),Je=(0,s.A)(Ge,2),Qe=Je[0],Ye=Je[1];return(0,tr.jsxs)(ye,(0,je.A)({},be,{children:[(0,tr.jsx)(Se,(0,je.A)({},ke)),(0,tr.jsx)(Ae,(0,je.A)({},Re)),le.filter(e=>e.value>=w&&e.value<=b).map((e,t)=>{const r=JB(e.value,w,b),n=X[oe].offset(r);let i;return i=!1===T?-1!==ce.indexOf(e.value):"normal"===T&&(ae?e.value>=ce[0]&&e.value<=ce[ce.length-1]:e.value<=ce[0])||"inverted"===T&&(ae?e.value<=ce[0]||e.value>=ce[ce.length-1]:e.value>=ce[0]),(0,tr.jsxs)(o.Fragment,{children:[(0,tr.jsx)(ze,(0,je.A)({"data-index":t},De,!ln(ze)&&{ownerState:(0,je.A)({},De.ownerState,{percent:r})},{style:(0,je.A)({},n,De.style),className:(0,Pe.A)(De.className,i&&ve.markActive)})),null!=e.label?(0,tr.jsx)(Fe,(0,je.A)({"data-index":t},Ne,{style:(0,je.A)({},n,Ne.style),className:(0,Pe.A)(ve.markLabel,Ne.className,i&&ve.markLabelActive),children:e.label})):null]},e.value)}),ce.map((e,t)=>{const r=JB(e,w,b),o=X[oe].offset(r);return(0,tr.jsxs)(We,(0,je.A)({"data-index":t},Ve,{className:(0,Pe.A)(Ve.className,ne===t&&ve.active,ie===t&&ve.focusVisible),style:(0,je.A)({},o,he(t),Ve.style),children:[(0,tr.jsx)(qe,(0,je.A)({"data-index":t,"aria-label":v?v(t):n,"aria-valuenow":j(e),"aria-valuetext":f?f(j(e),t):i,value:ce[t]},Ke)),"off"!==z?(0,tr.jsx)(Qe,(0,je.A)({},Ye,{className:(0,Pe.A)(Ye.className,(re===t||ne===t||"on"===z)&&ve.valueLabelOpen),children:"function"===typeof M?M(j(e),t):M})):null]}),t)})]}))}),yH=gH;var bH=r(321),xH=r(9207);const wH=["notificationPreferences"],SH={immediate:{label:"Immediately",helper:"Email me the moment a new matching property is found."},daily_digest:{label:"Daily digest",helper:"One summary email per day covering everything new since yesterday."},off:{label:"Off",helper:"No match emails \u2014 you can still check the in-app inbox."}},kH="immediate",_H=70,CH=!1,AH=80,jH=Array.from({length:24},(e,t)=>t);function IH(e){return"".concat(String(e).padStart(2,"0"),":00")}function PH(){const e=(()=>{const e=Ma(),t=e.getIdToken,r=e.isAuthenticated;return ql({queryKey:wH,queryFn:()=>JE(t,"/me/notification-preferences"),enabled:r,staleTime:3e5})})(),t=e.data,r=e.isLoading,n=(()=>{const e=Ma().getIdToken,t=zl();return Lk({mutationFn:t=>JE(e,"/me/notification-preferences",{method:"PUT",body:JSON.stringify(t)}),onSuccess:e=>{e?t.setQueryData(wH,e):t.invalidateQueries({queryKey:wH})}})})(),i=sz(),a=(0,o.useState)(kH),l=(0,s.A)(a,2),c=l[0],d=l[1],u=(0,o.useState)(_H),h=(0,s.A)(u,2),p=h[0],v=h[1],f=(0,o.useState)(CH),m=(0,s.A)(f,2),g=m[0],y=m[1],b=(0,o.useState)(AH),x=(0,s.A)(b,2),w=x[0],S=x[1],k=(0,o.useState)(null),_=(0,s.A)(k,2),C=_[0],A=_[1],j=(0,o.useState)(null),I=(0,s.A)(j,2),P=I[0],R=I[1],T=(0,o.useState)(null),E=(0,s.A)(T,2),z=E[0],D=E[1];(0,o.useEffect)(()=>{t&&(d(t.emailMode),v(t.scoreThresholdPct),y(t.pushEnabled),S(t.pushThresholdPct),A(t.quietHoursStart),R(t.quietHoursEnd))},[t]),(0,o.useEffect)(()=>{i.isReady&&!i.isSubscribed&&g&&y(!1)},[i.isReady,i.isSubscribed,g]);const M=null!=t&&(c!==t.emailMode||p!==t.scoreThresholdPct||g!==t.pushEnabled||w!==t.pushThresholdPct||C!==t.quietHoursStart||P!==t.quietHoursEnd),L=null==C!==(null==P),O=async e=>{if(e){if(!await i.subscribe())return void D({color:"danger",msg:"denied"===i.permission?"Notifications are blocked in your browser settings.":"Couldn't enable push notifications."});y(!0),function(){try{window.localStorage.removeItem(lz)}catch(e){}}()}else{if(!await i.unsubscribe())return void D({color:"danger",msg:"Couldn't disable push notifications \u2014 please try again."});y(!1)}};return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:3},children:[(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",children:[(0,tr.jsx)(bH.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"Email Notifications"})]}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",sx:{mt:.5},children:"Choose when Toppi emails you about new matching properties. In-app notifications are always shown regardless of these settings."})]}),(0,tr.jsx)(nc,{}),r?(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsx)(uT,{variant:"text",level:"title-md",width:"40%"}),(0,tr.jsx)(uT,{variant:"rectangular",height:120}),(0,tr.jsx)(uT,{variant:"rectangular",height:80})]}):(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"When should we email you about new matches?"}),(0,tr.jsx)(zB,{name:"emailMode",value:c,onChange:e=>d(e.target.value),sx:{gap:1,mt:1},children:Object.keys(SH).map(e=>(0,tr.jsx)(Qz,{variant:"soft",sx:(0,Ae.A)({p:1.5,borderRadius:"sm"},c===e?{borderColor:"primary.500",borderWidth:1,borderStyle:"solid"}:{borderColor:"transparent",borderWidth:1,borderStyle:"solid"}),children:(0,tr.jsx)($B,{value:e,label:(0,tr.jsxs)(Tr,{component:"span",sx:{display:"block"},children:[(0,tr.jsx)(Gn,{component:"span",level:"title-sm",sx:{display:"block",mb:.5},children:SH[e].label}),(0,tr.jsx)(Gn,{component:"span",level:"body-xs",textColor:"text.tertiary",sx:{display:"block"},children:SH[e].helper})]})})},e))})]}),(0,tr.jsxs)(mC,{disabled:"off"===c,children:[(0,tr.jsx)(SC,{children:"Minimum match score to email"}),(0,tr.jsx)(oF,{sx:{mb:1},children:"Only email me when a property scores at least this well. Lower-scoring matches still appear in the in-app inbox."}),(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",spacing:2,sx:{px:1},children:[(0,tr.jsx)(yH,{min:0,max:100,step:5,value:p,onChange:(e,t)=>v(t),valueLabelDisplay:"auto",valueLabelFormat:e=>"".concat(e,"%"),marks:[{value:0,label:"0%"},{value:50,label:"50%"},{value:70,label:"70%"},{value:100,label:"100%"}],sx:{flex:1},disabled:"off"===c}),(0,tr.jsxs)(Gn,{level:"body-sm",sx:{minWidth:48,textAlign:"right"},children:[p,"%"]})]})]}),"off"===c&&(0,tr.jsxs)(FA,{color:"warning",variant:"soft",children:["Email notifications are off. You'll still see new matches in the in-app inbox at"," ",(0,tr.jsx)("strong",{children:"/notifications"}),"."]}),(0,tr.jsx)(nc,{sx:{my:1}}),(0,tr.jsxs)(Tr,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",children:[(0,tr.jsx)(qE.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"Push Notifications"})]}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",sx:{mt:.5},children:"Get instant alerts on this device \u2014 even when Toppi isn't open."})]}),i.isSupported?(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(mC,{orientation:"horizontal",sx:{justifyContent:"space-between",alignItems:"flex-start"},children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(SC,{sx:{mb:0},children:"Browser push on this device"}),(0,tr.jsx)(oF,{sx:{mt:.5},children:"denied"===i.permission?"Blocked in browser settings \u2014 enable there to use push.":"Tap a notification to jump straight to the property."})]}),(0,tr.jsx)(NF,{checked:g&&i.isSubscribed,onChange:e=>O(e.target.checked),disabled:i.isWorking||"denied"===i.permission||!i.isReady})]}),"denied"===i.permission&&(0,tr.jsx)(Ti,{color:"danger",variant:"soft",size:"sm",children:"Notifications blocked in browser settings"}),g&&i.isSubscribed&&(0,tr.jsx)(Qz,{variant:"soft",color:"neutral",sx:{borderRadius:"sm",p:2},children:(0,tr.jsxs)(Mn,{spacing:2.5,children:[(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Push alert threshold"}),(0,tr.jsx)(oF,{sx:{mb:1},children:"Send a push only for matches at or above this score."}),(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",spacing:2,sx:{px:1},children:[(0,tr.jsx)(yH,{min:50,max:100,step:5,value:w,onChange:(e,t)=>S(t),valueLabelDisplay:"auto",valueLabelFormat:e=>"".concat(e,"%"),marks:[{value:50,label:"50%"},{value:80,label:"80%"},{value:100,label:"100%"}],sx:{flex:1}}),(0,tr.jsxs)(Gn,{level:"body-sm",sx:{minWidth:48,textAlign:"right"},children:[w,"%"]})]})]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(mC,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1,alignItems:"center",children:[(0,tr.jsx)(xH.A,{fontSize:"small"}),(0,tr.jsx)(SC,{sx:{mb:0},children:"Quiet hours (UTC)"})]}),(0,tr.jsx)(oF,{sx:{mt:.5,mb:1},children:'Skip push during this window. Pick both, or leave both "None". Under-offer alerts still respect this window \u2014 set "None" to never miss one.'}),(0,tr.jsxs)(Mn,{direction:"row",spacing:2,children:[(0,tr.jsxs)(mC,{sx:{flex:1},children:[(0,tr.jsx)(SC,{children:"From"}),(0,tr.jsxs)(dL,{value:null!==C?String(C):"",placeholder:"None",onChange:(e,t)=>A(""===t||null==t?null:Number(t)),children:[(0,tr.jsx)(gL,{value:"",children:"None"}),jH.map(e=>(0,tr.jsx)(gL,{value:String(e),children:IH(e)},e))]})]}),(0,tr.jsxs)(mC,{sx:{flex:1},children:[(0,tr.jsx)(SC,{children:"To"}),(0,tr.jsxs)(dL,{value:null!==P?String(P):"",placeholder:"None",onChange:(e,t)=>R(""===t||null==t?null:Number(t)),children:[(0,tr.jsx)(gL,{value:"",children:"None"}),jH.map(e=>(0,tr.jsx)(gL,{value:String(e),children:IH(e)},e))]})]})]}),L&&(0,tr.jsx)(FA,{color:"warning",variant:"soft",size:"sm",sx:{mt:1.5},children:"Set both From and To, or clear both."})]})]})})]}):(0,tr.jsx)(FA,{color:"neutral",variant:"soft",size:"sm",children:"This browser doesn't support push notifications."}),(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"flex-end"},children:(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:async()=>{if(L)D({color:"danger",msg:"Set both start and end of quiet hours, or clear both."});else try{const e=null==C&&null==P&&(null!=(null===t||void 0===t?void 0:t.quietHoursStart)||null!=(null===t||void 0===t?void 0:t.quietHoursEnd));await n.mutateAsync({emailMode:c,scoreThresholdPct:p,pushEnabled:g,pushThresholdPct:w,quietHoursStart:C,quietHoursEnd:P,clearQuietHours:e}),D({color:"success",msg:"Preferences saved"})}catch(e){D({color:"danger",msg:"Couldn't save \u2014 please try again."})}},loading:n.isPending,disabled:!M||L,children:"Save preferences"})})]})]}),(0,tr.jsx)(FR,{open:null!=z,onClose:()=>D(null),color:null===z||void 0===z?void 0:z.color,variant:"soft",autoHideDuration:3e3,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:null===z||void 0===z?void 0:z.msg})]})}var RH=r(3425),TH=r(1430),EH=r(3417);const zH=e=>"I've been using Toppi to find my next home \u2014 it searches Rightmove, Zoopla & OnTheMarket with AI. Join me: ".concat(e),DH=e=>{let t=e.label,r=e.value,n=e.color,o=void 0===n?"neutral":n;return(0,tr.jsxs)(Ti,{variant:"soft",color:o,size:"sm",children:[(0,tr.jsx)("strong",{children:r})," ",t]})};function MH(){const e=xN(),t=e.data,r=e.isLoading,n=(0,o.useState)(!1),i=(0,s.A)(n,2),a=i[0],l=i[1];if(r||!t)return(0,tr.jsx)(hi,{variant:"outlined",sx:{p:0},children:(0,tr.jsx)(qC,{sx:{p:2.5},children:(0,tr.jsxs)(Mn,{gap:2,children:[(0,tr.jsx)(uT,{variant:"text",level:"title-sm",width:"60%"}),(0,tr.jsx)(uT,{variant:"rectangular",height:56}),(0,tr.jsx)(uT,{variant:"rectangular",height:32,width:"80%"})]})})});const c=t.referralUrl,d=t.stats;return(0,tr.jsx)(hi,{variant:"outlined",sx:{p:0},children:(0,tr.jsx)(qC,{sx:{p:2.5},children:(0,tr.jsxs)(Mn,{gap:2,children:[(0,tr.jsxs)(Mn,{direction:"row",gap:1.5,alignItems:"flex-start",children:[(0,tr.jsx)(Tr,{sx:{p:1,borderRadius:"sm",bgcolor:"warning.softBg",color:"warning.solidBg"},children:(0,tr.jsx)(RH.A,{fontSize:"small"})}),(0,tr.jsxs)(Mn,{children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Refer a friend, get 1 month free"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"When a friend subscribes within 30 days of signing up via your link, your Pro plan is extended by 1 month \u2014 automatically."})]})]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Your referral link"}),(0,tr.jsx)(NC,{readOnly:!0,value:c,endDecorator:(0,tr.jsx)(wo,{size:"sm",variant:"soft",onClick:async()=>{if(null!==t&&void 0!==t&&t.referralUrl)try{await navigator.clipboard.writeText(t.referralUrl),l(!0),Zk("referral_link_copied"),window.setTimeout(()=>l(!1),2e3)}catch(e){}},startDecorator:a?(0,tr.jsx)(sa.A,{}):(0,tr.jsx)(Tz.A,{}),children:a?"Copied!":"Copy"})})]}),(0,tr.jsxs)(Mn,{direction:"row",gap:1,flexWrap:"wrap",children:[(0,tr.jsx)(wo,{component:"a",href:"https://wa.me/?text=".concat(encodeURIComponent(zH(c))),target:"_blank",rel:"noopener noreferrer",variant:"outlined",color:"neutral",size:"sm",startDecorator:(0,tr.jsx)(TH.A,{}),children:"WhatsApp"}),(0,tr.jsx)(wo,{component:"a",href:"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent(zH(c))),target:"_blank",rel:"noopener noreferrer",variant:"outlined",color:"neutral",size:"sm",startDecorator:(0,tr.jsx)(EH.A,{}),children:"Twitter"})]}),(0,tr.jsxs)(Mn,{direction:"row",gap:2,flexWrap:"wrap",children:[(0,tr.jsx)(DH,{label:"Referred",value:d.totalReferred}),(0,tr.jsx)(DH,{label:"Subscribed",value:d.totalConverted,color:"success"}),(0,tr.jsx)(DH,{label:"Months earned",value:d.creditsEarned,color:"primary"})]})]})})})}const LH="true"==="";const OH="hello@toppi.app";function FH(){var e,t,r;const n=Ma().user,o=n&&("".concat(null!==(e=n.given_name)&&void 0!==e?e:""," ").concat(null!==(t=n.family_name)&&void 0!==t?t:"").trim()||n.email)||"";return(0,tr.jsx)(Qz,{variant:"outlined",sx:{p:3,borderRadius:"sm"},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",children:[(0,tr.jsx)(IE.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"Profile"})]}),(0,tr.jsx)(nc,{}),(0,tr.jsxs)(Mn,{spacing:.5,children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Name"}),(0,tr.jsx)(Gn,{level:"body-md",children:o||"\u2014"})]}),(0,tr.jsxs)(Mn,{spacing:.5,children:[(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Email"}),(0,tr.jsx)(Gn,{level:"body-md",children:null!==(r=null===n||void 0===n?void 0:n.email)&&void 0!==r?r:"\u2014"})]}),(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"text.tertiary",children:["Name and email come from your sign-in provider and can't be changed here yet \u2014 email"," ",(0,tr.jsx)(hc,{href:"mailto:".concat(OH),children:OH})," and we'll update them for you."]})]})})}function NH(){const e=Ql(),t=e.subscription,r=e.isLoading,n=e.isError,i=e.refetch,a=e.openPortal,l=e.startCheckout,c="pro"===(null===t||void 0===t?void 0:t.planTier),d=(0,o.useState)(null),u=(0,s.A)(d,2),h=u[0],p=u[1],v=(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"space-between",children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:1.5,alignItems:"center",children:[(0,tr.jsx)(PE.A,{color:"primary"}),(0,tr.jsx)(Gn,{level:"h4",children:"Billing"})]}),!r&&!n&&(0,tr.jsx)(Ti,{size:"sm",variant:c?"solid":"soft",color:c?"primary":"neutral",children:c?"Pro":"Free"})]});return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{p:3,borderRadius:"sm"},children:[(0,tr.jsxs)(Mn,{spacing:2,children:[v,(0,tr.jsx)(nc,{}),r&&(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(uT,{variant:"text",level:"body-sm",width:"80%"}),(0,tr.jsx)(uT,{variant:"text",level:"body-sm",width:"60%"}),(0,tr.jsx)(uT,{variant:"rectangular",height:36,width:140,sx:{borderRadius:"sm",mt:.5}})]}),n&&(0,tr.jsx)(FA,{color:"danger",variant:"soft",startDecorator:(0,tr.jsx)(_A.A,{}),endDecorator:(0,tr.jsx)(wo,{size:"sm",variant:"plain",color:"danger",onClick:()=>{i()},children:"Retry"}),children:"Failed to load billing information."}),!r&&!n&&(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:c?"You're on the Pro plan. Manage your subscription, invoices and payment method in the Stripe billing portal.":"You're on the Free plan. Upgrade to unlock unlimited AI searches and full property monitoring."}),(0,tr.jsx)(Tr,{children:c?(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",size:"sm",onClick:()=>{(async()=>{try{p(null),await a()}catch(e){p(e instanceof Error?e.message:"Could not open the billing portal.")}})()},children:"Manage billing"}):(0,tr.jsx)(wo,{variant:"solid",color:"primary",size:"sm",onClick:()=>{l()},children:"Upgrade to Pro"})})]})]}),(0,tr.jsx)(FR,{open:null!==h,onClose:()=>p(null),color:"danger",variant:"soft",autoHideDuration:6e3,children:null!==h&&void 0!==h?h:""})]})}function BH(){return(0,tr.jsx)(hi,{variant:"soft",sx:{p:2.5},children:(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,tr.jsx)(GA.A,{color:"primary"}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Commute destinations"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Save the places you commute to so Toppi can score every property by travel time."})]}),(0,tr.jsx)(wo,{component:kc,to:"/settings/destinations",size:"sm",variant:"outlined",color:"neutral",children:"Open"})]})})}function HH(){return(0,tr.jsx)(hi,{variant:"soft",sx:{p:2.5},children:(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,tr.jsx)(IB.A,{color:"primary"}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"API Keys"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",children:"Connect Claude, Cursor, or other AI agents to your Toppi account."})]}),(0,tr.jsx)(wo,{component:kc,to:"/settings/api-keys",size:"sm",variant:"outlined",color:"neutral",children:"Manage"})]})})}function WH(){const e=Ma();return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:"Account Settings \u2014 Toppi",noIndex:!0}),(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:e})}),(0,tr.jsx)(Tr,{sx:{maxWidth:900,mx:"auto",px:3,py:4},children:(0,tr.jsxs)(Mn,{spacing:4,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"h2",children:"Account Settings"}),(0,tr.jsx)(Gn,{level:"body-md",textColor:"text.tertiary",children:"Manage your profile, billing and email notifications."})]}),(0,tr.jsx)(FH,{}),(0,tr.jsx)(MH,{}),(0,tr.jsx)(PH,{}),(0,tr.jsx)(NH,{}),(0,tr.jsx)(BH,{}),LH&&(0,tr.jsx)(HH,{})]})})]})}var VH=r(8143);const $H=async e=>{const t=await e();return{Authorization:null!==t&&void 0!==t?t:"","Content-Type":"application/json"}};function UH(e){if(!e)return"\u2014";const t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function qH(e){let t=e.open,r=e.onClose,n=e.onCreate,i=e.isCreating,a=e.createError;const l=(0,o.useState)(""),c=(0,s.A)(l,2),d=c[0],u=c[1],h=(0,o.useState)(null),p=(0,s.A)(h,2),v=p[0],f=p[1],m=(0,o.useState)(!1),g=(0,s.A)(m,2),y=g[0],b=g[1];o.useEffect(()=>{u(""),f(null),b(!1)},[t]);const x=d.trim(),w=x.length>0&&!i,S=async()=>{if(w)try{const e=await n(x);f(e)}catch(e){}},k=i?()=>{}:r;return(0,tr.jsx)(L_,{open:t,onClose:k,children:(0,tr.jsxs)(U_,{size:"sm",variant:"outlined",sx:{maxWidth:520,width:"100%"},children:[(0,tr.jsx)(sC,{disabled:i}),(0,tr.jsxs)(wR,{children:[(0,tr.jsx)(IB.A,{}),v?"Your new API key":"Generate API key"]}),(0,tr.jsx)(mE,{sx:{gap:2},children:v?(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(FA,{color:"warning",variant:"soft",startDecorator:(0,tr.jsx)(_A.A,{}),children:"Copy this key now \u2014 you won't be able to see it again."}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:v.label}),(0,tr.jsx)(NC,{readOnly:!0,value:v.key,endDecorator:(0,tr.jsx)(Z_,{onClick:async()=>{if(v)try{await navigator.clipboard.writeText(v.key),b(!0),window.setTimeout(()=>b(!1),2e3)}catch(e){}},variant:"soft","aria-label":"Copy API key",children:y?(0,tr.jsx)(sa.A,{}):(0,tr.jsx)(Tz.A,{})}),sx:{fontFamily:"monospace",fontSize:"sm"}})]}),(0,tr.jsx)(Mn,{direction:"row",justifyContent:"flex-end",children:(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:r,children:"Done"})})]}):(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:'Give this key a name that reminds you where it\'s used (for example, "Claude Desktop" or "Cursor").'}),a&&(0,tr.jsxs)(FA,{color:"danger",variant:"soft",size:"sm",children:["Couldn't create the key: ",a.message]}),(0,tr.jsxs)(mC,{children:[(0,tr.jsx)(SC,{children:"Name"}),(0,tr.jsx)(NC,{autoFocus:!0,value:d,onChange:e=>u(e.target.value),placeholder:"e.g. Claude Desktop",disabled:i,onKeyDown:e=>{"Enter"===e.key&&w&&S()}})]}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:r,disabled:i,children:"Cancel"}),(0,tr.jsx)(wo,{variant:"solid",color:"primary",onClick:()=>{S()},loading:i,disabled:!w,children:"Generate"})]})]})})]})})}function KH(e){var t;let r=e.open,n=e.apiKey,o=e.onClose,i=e.onConfirm,a=e.isRevoking,s=e.revokeError;const l=a?()=>{}:o;return(0,tr.jsx)(L_,{open:r,onClose:l,children:(0,tr.jsxs)(U_,{size:"sm",variant:"outlined",sx:{maxWidth:440,width:"100%"},children:[(0,tr.jsx)(sC,{disabled:a}),(0,tr.jsx)(wR,{children:"Revoke this key?"}),(0,tr.jsxs)(mE,{sx:{gap:2},children:[(0,tr.jsxs)(Gn,{level:"body-sm",children:["Any agent using ",(0,tr.jsx)("strong",{children:null!==(t=null===n||void 0===n?void 0:n.label)&&void 0!==t?t:"this key"})," will immediately lose access \u2014 this can't be undone."]}),s&&(0,tr.jsxs)(FA,{color:"danger",variant:"soft",size:"sm",children:["Couldn't revoke: ",s.message]}),(0,tr.jsxs)(Mn,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,tr.jsx)(wo,{variant:"plain",color:"neutral",onClick:o,disabled:a,children:"Cancel"}),(0,tr.jsx)(wo,{variant:"solid",color:"danger",onClick:()=>{i()},loading:a,children:"Revoke"})]})]})]})})}function GH(){const e=Ma(),t=function(){var e;const t=Ma().getIdToken,r=zl(),n=["apiKeys"],o=ql({queryKey:n,queryFn:async()=>{var e;const r=await Jl("".concat(IW,"/api/api-keys"),{headers:await $H(t)});if(!r.ok)throw new Error("Failed to load API keys (HTTP ".concat(r.status,")"));const n=await Gl(r);return n?Array.isArray(n)?n:null!==(e=n.keys)&&void 0!==e?e:[]:[]},retry:1}),i=Lk({mutationFn:async e=>{const r=await Jl("".concat(IW,"/api/api-keys"),{method:"POST",headers:await $H(t),body:JSON.stringify({label:e})});if(!r.ok)throw new Error("Failed to create API key (HTTP ".concat(r.status,")"));const n=await Gl(r);if(!n)throw new Error("Empty response from create API key endpoint");return n},onSuccess:()=>r.invalidateQueries({queryKey:n})}),a=Lk({mutationFn:async e=>{const r=await fetch("".concat(IW,"/api/api-keys/").concat(e),{method:"DELETE",headers:await $H(t)});if(!r.ok&&204!==r.status)throw new Error("Failed to revoke API key (HTTP ".concat(r.status,")"))},onSuccess:()=>r.invalidateQueries({queryKey:n})});return{keys:null!==(e=o.data)&&void 0!==e?e:[],isLoading:o.isLoading,isError:o.isError,refetch:o.refetch,createKey:i.mutateAsync,createError:i.error,isCreating:i.isPending,revokeKey:a.mutateAsync,revokeError:a.error,isRevoking:a.isPending}}(),r=t.keys,n=t.isLoading,i=t.isError,a=t.refetch,l=t.createKey,c=t.createError,d=t.isCreating,u=t.revokeKey,h=t.revokeError,p=t.isRevoking,v=(0,o.useState)(!1),f=(0,s.A)(v,2),m=f[0],g=f[1],y=(0,o.useState)(null),b=(0,s.A)(y,2),x=b[0],w=b[1];return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:e})}),(0,tr.jsx)(Tr,{sx:{maxWidth:900,mx:"auto",px:3,py:4},children:(0,tr.jsxs)(Mn,{spacing:3,children:[(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(wo,{component:kc,to:"/settings",variant:"plain",color:"neutral",size:"sm",startDecorator:(0,tr.jsx)(VH.A,{}),sx:{alignSelf:"flex-start",ml:-1},children:"Back to settings"}),(0,tr.jsx)(Gn,{level:"h2",children:"API Keys"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"API keys let AI agents like Claude Desktop and Cursor act on your Toppi account through the Toppi MCP server. Each key is shown once at creation \u2014 store it somewhere safe, and revoke it if you lose access."})]}),(0,tr.jsx)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2.5},children:(0,tr.jsxs)(Mn,{spacing:2,children:[(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[(0,tr.jsx)(Gn,{level:"title-sm",children:"Your keys"}),(0,tr.jsx)(wo,{variant:"solid",color:"primary",size:"sm",startDecorator:(0,tr.jsx)(xB.A,{}),onClick:()=>g(!0),children:"Generate new key"})]}),n&&(0,tr.jsx)(Mn,{alignItems:"center",py:4,children:(0,tr.jsx)(An,{size:"sm"})}),!n&&i&&(0,tr.jsxs)(Mn,{spacing:1.5,children:[(0,tr.jsx)(FA,{color:"danger",variant:"soft",size:"sm",children:"Couldn't load your API keys."}),(0,tr.jsx)(wo,{variant:"soft",color:"neutral",size:"sm",startDecorator:(0,tr.jsx)(Dz.A,{}),onClick:()=>{a()},sx:{alignSelf:"flex-start"},children:"Retry"})]}),!n&&!i&&0===r.length&&(0,tr.jsxs)(Mn,{alignItems:"center",spacing:1.5,py:4,children:[(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"No API keys yet."}),(0,tr.jsx)(wo,{variant:"outlined",color:"primary",size:"sm",startDecorator:(0,tr.jsx)(xB.A,{}),onClick:()=>g(!0),children:"Generate new key"})]}),!n&&!i&&r.length>0&&(0,tr.jsxs)(HO,{stripe:"odd",borderAxis:"x",size:"sm",children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{children:"Name"}),(0,tr.jsx)("th",{children:"Prefix"}),(0,tr.jsx)("th",{children:"Created"}),(0,tr.jsx)("th",{children:"Last used"}),(0,tr.jsx)("th",{children:"Status"}),(0,tr.jsx)("th",{style:{width:56}})]})}),(0,tr.jsx)("tbody",{children:r.map(e=>{const t=!!e.revokedAt;return(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:e.label})}),(0,tr.jsx)("td",{children:(0,tr.jsxs)(Gn,{level:"body-xs",sx:{fontFamily:"monospace"},children:[e.keyPrefix,"\u2026"]})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:UH(e.createdAt)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:UH(e.lastUsedAt)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:t?"neutral":"success",children:t?"Revoked":"Active"})}),(0,tr.jsx)("td",{children:!t&&(0,tr.jsx)(Z_,{size:"sm",variant:"plain",color:"danger","aria-label":"Revoke ".concat(e.label),onClick:()=>w(e),children:(0,tr.jsx)(SR.A,{})})})]},e.id)})})]})]})})]})}),(0,tr.jsx)(qH,{open:m,onClose:()=>g(!1),onCreate:l,isCreating:d,createError:c}),(0,tr.jsx)(KH,{open:null!==x,apiKey:x,onClose:()=>w(null),onConfirm:async()=>{if(x)try{await u(x.id),w(null)}catch(e){}},isRevoking:p,revokeError:h})]})}var JH=r(7875),QH=r(4721),YH=r(7991);const XH={rightmove:"Rightmove",zoopla:"Zoopla",onthemarket:"OnTheMarket"};function ZH(e){var t;return null!==(t=XH[e.toLowerCase()])&&void 0!==t?t:e}function eW(e){var t,r;let n=e.stats,o=e.isLoading;return(0,tr.jsx)(hi,{variant:"outlined",sx:{mb:3},children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"title-md",sx:{mb:2},children:"Portal Coverage (Last 30 Days)"}),o?(0,tr.jsx)(An,{size:"sm"}):n&&0!==n.days.length?(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsxs)(Mn,{direction:"row",spacing:3,alignItems:"center",sx:{mb:2},flexWrap:"wrap",useFlexGap:!0,children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Current Coverage"}),(0,tr.jsxs)(Gn,{level:"h3",color:n.currentCoveragePct>=.9?"success":"warning",children:[Math.round(100*n.currentCoveragePct),"%"]})]}),(0,tr.jsx)(Mn,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:n.portalsMonitored.map(e=>{var t,r;const o=n.days[n.days.length-1],i=null!==(t=null===o||void 0===o||null===(r=o.perPortal)||void 0===r?void 0:r[e])&&void 0!==t?t:0;return(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:i>=.9?"success":"warning",children:[ZH(e),": ",Math.round(100*i),"%"]},e)})})]}),(0,tr.jsx)(Tr,{sx:{display:"flex",gap:.5,alignItems:"flex-end",height:64},children:n.days.map(e=>{const t=Math.max(100*e.avgCoveragePct,6),r=e.avgCoveragePct>=.9;return(0,tr.jsx)(bA,{title:"".concat(e.date,": ").concat(Math.round(100*e.avgCoveragePct),"%"),placement:"top",variant:"soft",children:(0,tr.jsx)(Tr,{sx:{flex:1,height:"".concat(t,"%"),minHeight:4,bgcolor:r?"success.softBg":"warning.softBg",borderRadius:2}})},e.date)})}),(0,tr.jsxs)(Mn,{direction:"row",justifyContent:"space-between",sx:{mt:.5},children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:null===(t=n.days[0])||void 0===t?void 0:t.date}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:null===(r=n.days[n.days.length-1])||void 0===r?void 0:r.date})]})]}):(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No coverage data yet \u2014 data will appear after the first search run."})]})})}function tW(e){var t;let r=e.stats,n=e.isLoading;const o=null!==(t=null===r||void 0===r?void 0:r.days.reduce((e,t)=>e+t.newPropertiesAdded,0))&&void 0!==t?t:0;return(0,tr.jsx)(hi,{variant:"outlined",sx:{mb:3},children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"title-md",sx:{mb:2},children:"Extraction Quality"}),n?(0,tr.jsx)(An,{size:"sm"}):r?(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},spacing:3,divider:(0,tr.jsx)(nc,{orientation:"vertical"}),children:[(0,tr.jsxs)(Tr,{sx:{textAlign:"center",minWidth:140},children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Fields Missing Rate (7d avg)"}),(0,tr.jsxs)(Gn,{level:"h3",color:(i=r.avgExtractionFlagRateLast7Days,i<=.05?"success":i<=.15?"warning":"danger"),children:[Math.round(100*r.avgExtractionFlagRateLast7Days),"%"]}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"of properties"})]}),(0,tr.jsxs)(Tr,{sx:{textAlign:"center",minWidth:140},children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Dedup Merges (30d)"}),(0,tr.jsx)(Gn,{level:"h3",children:r.totalDedupMergesLast30Days}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"cross-portal matches"})]}),(0,tr.jsxs)(Tr,{sx:{textAlign:"center",minWidth:140},children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"New Properties (30d)"}),(0,tr.jsx)(Gn,{level:"h3",children:o}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"added to boards"})]})]}):(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No extraction data yet \u2014 populated by the per-run snapshot once jobs complete."})]})});var i}function rW(e,t,r){return e>=t?"success":e>=r?"warning":"danger"}function nW(e){var t,r,n,o,i,a,s;let l=e.kpis;if(e.isLoading)return(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",mb:3},children:(0,tr.jsx)(An,{size:"sm"})});const c=[{label:"Daily Active Users",value:null!==(t=null===l||void 0===l?void 0:l.dau)&&void 0!==t?t:"\u2014",sub:"last 24h",tone:"primary"},{label:"Weekly Active Users",value:null!==(r=null===l||void 0===l?void 0:l.wau)&&void 0!==r?r:"\u2014",sub:"last 7 days",tone:"primary"},{label:"Monthly Active Users",value:null!==(n=null===l||void 0===l?void 0:l.mau)&&void 0!==n?n:"\u2014",sub:"last 30 days",tone:"primary"},{label:"Activation Rate",value:l?"".concat(l.activationRatePct,"%"):"\u2014",sub:"".concat(null!==(o=null===l||void 0===l?void 0:l.activatedUsers)&&void 0!==o?o:0," of ").concat(null!==(i=null===l||void 0===l?void 0:l.totalUsers)&&void 0!==i?i:0," signups"),tone:l?rW(l.activationRatePct,50,25):"neutral"},{label:"Pro Conversion",value:l?"".concat(l.proConversionRatePct,"%"):"\u2014",sub:"".concat(null!==(a=null===l||void 0===l?void 0:l.proUsers)&&void 0!==a?a:0," paying users"),tone:l?rW(l.proConversionRatePct,10,3):"neutral"},{label:"Monitoring Adoption",value:l?"".concat(l.monitoringAdoptionPct,"%"):"\u2014",sub:"".concat(null!==(s=null===l||void 0===l?void 0:l.monitoringUsers)&&void 0!==s?s:0," with active monitoring"),tone:l?rW(l.monitoringAdoptionPct,40,15):"neutral"}];return(0,tr.jsx)(Tr,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(175px, 1fr))",gap:2,mb:3},children:c.map(e=>(0,tr.jsx)(hi,{variant:"soft",color:e.tone,children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"body-xs",sx:{color:"text.secondary"},children:e.label}),(0,tr.jsx)(Gn,{level:"h3",children:e.value}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:e.sub})]})},e.label))})}function oW(e){var t,r;let n=e.funnel,o=e.isLoading;return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2,mb:3},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,mb:2,children:[(0,tr.jsx)($L.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"Activation Funnel"}),(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:"neutral",sx:{ml:"auto"},children:[null!==(t=null===n||void 0===n||null===(r=n.steps[0])||void 0===r?void 0:r.users)&&void 0!==t?t:0," signups"]})]}),o?(0,tr.jsx)(An,{size:"sm"}):n&&0!==n.steps.length?(0,tr.jsx)(Mn,{gap:1.5,children:n.steps.map(e=>{return(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:2,sx:{flexWrap:{xs:"wrap",sm:"nowrap"}},children:[(0,tr.jsx)(Gn,{level:"body-sm",sx:{minWidth:{xs:"100%",sm:200},color:"text.secondary"},children:e.label}),(0,tr.jsx)(AE,{determinate:!0,value:Math.min(100,Math.max(0,e.ofTotalPct)),color:(t=e.ofTotalPct,t>=70?"success":t>=40?"warning":t>0?"danger":"neutral"),sx:{flex:1,"--LinearProgress-thickness":"10px"}}),(0,tr.jsxs)(Gn,{level:"body-sm",sx:{minWidth:90,textAlign:"right"},children:[e.users," ",(0,tr.jsxs)(Gn,{component:"span",level:"body-xs",color:"neutral",children:["(",e.ofTotalPct,"%)"]})]})]},e.key);var t})}):(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No funnel data yet."})]})}var iW=r(6360);function aW(e){if(!e)return"\u2014";const t=new Date(e);return Number.isNaN(t.getTime())?"\u2014":t.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}function sW(e){if(!e)return"\u2014";const t=new Date(e);if(Number.isNaN(t.getTime()))return"\u2014";const r=Date.now()-t.getTime(),n=Math.round(r/6e4);if(n<1)return"just now";if(n<60)return"".concat(n,"m ago");const o=Math.round(n/60);if(o<24)return"".concat(o,"h ago");const i=Math.round(o/24);return i<30?"".concat(i,"d ago"):aW(e)}function lW(){var e,t;const r=o.useState(""),n=(0,s.A)(r,2),i=n[0],a=n[1],l=o.useState(""),c=(0,s.A)(l,2),d=c[0],u=c[1],h=o.useState("ALL"),p=(0,s.A)(h,2),v=p[0],f=p[1];o.useEffect(()=>{const e=window.setTimeout(()=>u(i),300);return()=>window.clearTimeout(e)},[i]);const m=function(e){var t,r;const n=Ma(),o=n.getIdToken,i=n.isAuthenticated,a=(null===(t=e.search)||void 0===t?void 0:t.trim())||"",s=(null===(r=e.plan)||void 0===r?void 0:r.trim())||"";return ql({queryKey:["admin","users",a,s],queryFn:async()=>{const e=await o(),t=new URLSearchParams;a&&t.set("search",a),s&&"ALL"!==s&&t.set("plan",s);const r="/api/admin/users".concat(t.toString()?"?".concat(t.toString()):"");try{return await rE(e,r)}catch(n){return null}},enabled:!0===i,staleTime:6e4})}({search:d,plan:v}),g=m.data,y=m.isLoading,b=null!==(e=null===g||void 0===g?void 0:g.users)&&void 0!==e?e:[],x=null!==(t=null===g||void 0===g?void 0:g.totalCached)&&void 0!==t?t:0;return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2,mb:3},children:[(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},gap:1.5,mb:2,children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,children:[(0,tr.jsx)(YH.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"Users"}),(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",children:["(",b.length,x>b.length?" of ".concat(x):""," shown)"]})]}),(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},gap:1,sx:{ml:{sm:"auto"},width:{xs:"100%",sm:"auto"}},children:[(0,tr.jsx)(NC,{size:"sm",placeholder:"Search email\u2026",startDecorator:(0,tr.jsx)(iW.A,{}),sx:{width:{xs:"100%",sm:220}},value:i,onChange:e=>a(e.target.value)}),(0,tr.jsxs)(dL,{size:"sm",value:v,onChange:(e,t)=>f(null!==t&&void 0!==t?t:"ALL"),sx:{width:{xs:"100%",sm:120}},children:[(0,tr.jsx)(gL,{value:"ALL",children:"All plans"}),(0,tr.jsx)(gL,{value:"FREE",children:"Free"}),(0,tr.jsx)(gL,{value:"PRO",children:"Pro"})]})]})]}),y?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,tr.jsx)(An,{size:"sm"})}):g?0===b.length?(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:0===x?"No users synced yet \u2014 sync runs hourly.":"No users match the current filter."}):(0,tr.jsx)(Tr,{sx:{maxHeight:480,overflow:"auto"},children:(0,tr.jsxs)(HO,{stripe:"odd",borderAxis:"x",size:"sm",stickyHeader:!0,children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{children:"Email"}),(0,tr.jsx)("th",{children:"Signed up"}),(0,tr.jsx)("th",{children:"Last active"}),(0,tr.jsx)("th",{children:"Plan"}),(0,tr.jsx)("th",{children:"Activated"}),(0,tr.jsx)("th",{style:{textAlign:"right"},children:"Searches (30d)"}),(0,tr.jsx)("th",{children:"Monitoring"})]})}),(0,tr.jsx)("tbody",{children:b.map(e=>(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:e.email})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:aW(e.createdAt)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:sW(e.lastSignInAt)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"PRO"===e.planTier?"primary":"neutral",children:e.planTier})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:e.hasActivated?"success":"warning",children:e.hasActivated?"Yes":"No"})}),(0,tr.jsx)("td",{style:{textAlign:"right"},children:e.searchRuns30d}),(0,tr.jsx)("td",{children:e.monitoringActive?(0,tr.jsx)(Ti,{size:"sm",variant:"soft",color:"success",children:"Active"}):(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"\u2014"})})]},e.kindeId))})]})}):(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"User directory not available. Set the KINDE_MANAGEMENT_* env vars and wait for the next sync."})]})}function cW(e){return e>=50?"success":e>=20?"warning":"neutral"}function dW(e){return"db"===e?"db":"posthog-pending"===e?"pending events":e}function uW(e){let t=e.row;return(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:t.label})}),(0,tr.jsx)("td",{style:{textAlign:"right"},children:(0,tr.jsx)(Gn,{level:"body-sm",children:t.userCount})}),(0,tr.jsx)("td",{style:{textAlign:"right"},children:(0,tr.jsxs)(Ti,{size:"sm",variant:"soft",color:cW(t.adoptionPct),children:[t.adoptionPct,"%"]})}),(0,tr.jsx)("td",{style:{width:140},children:(0,tr.jsx)(AE,{determinate:!0,value:Math.min(100,Math.max(0,t.adoptionPct)),sx:{width:120},color:cW(t.adoptionPct)})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",variant:"plain",color:(r=t.derivedFrom,"db"===r?"neutral":"warning"),children:dW(t.derivedFrom)})})]});var r}function hW(){var e;const t=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","feature-adoption"],queryFn:async()=>{const e=await t();try{return await rE(e,"/api/admin/feature-adoption")}catch(r){return null}},enabled:!0===e.isAuthenticated,staleTime:3e5})}(),r=t.data,n=t.isLoading,o=null!==(e=null===r||void 0===r?void 0:r.rows)&&void 0!==e?e:[];return(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2,mb:3},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,mb:2,children:[(0,tr.jsx)(JH.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"Feature Adoption"}),(0,tr.jsx)(bA,{title:"% of all signups who have used this feature. Rows tagged 'pending events' will populate once PostHog back-fill ships.",children:(0,tr.jsx)(jA.A,{fontSize:"small",sx:{color:"text.tertiary",cursor:"help"}})})]}),n?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",py:4},children:(0,tr.jsx)(An,{size:"sm"})}):r&&0!==o.length?(0,tr.jsxs)(HO,{stripe:"odd",borderAxis:"x",size:"sm",children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{children:"Feature"}),(0,tr.jsx)("th",{style:{textAlign:"right"},children:"Users"}),(0,tr.jsx)("th",{style:{textAlign:"right"},children:"Adoption"}),(0,tr.jsx)("th",{style:{width:140},children:"Bar"}),(0,tr.jsx)("th",{children:"Source"})]})}),(0,tr.jsx)("tbody",{children:o.map(e=>(0,tr.jsx)(uW,{row:e},e.key))})]}):(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No feature adoption data yet."})]})}function pW(){var e,t,r,n,o,i,a,s,l;const c=Ma(),d=tE(),u=ql({queryKey:["admin","health"],queryFn:async()=>{const e=await fetch("".concat(IW,"/health"));if(!e.ok)throw new Error("HTTP ".concat(e.status));return e.json()},staleTime:3e4}).data,h=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","stats"],queryFn:async()=>rE(await t(),"/api/admin/stats"),enabled:!0===e.isAuthenticated,staleTime:6e4})}(),p=h.data,v=h.isLoading,f=function(e){const t=Ma(),r=t.getIdToken,n=t.isAuthenticated;return ql({queryKey:["admin","llm-cost",e],queryFn:async()=>{const t=await r();try{return await rE(t,"/api/admin/llm-cost?month=".concat(e))}catch(n){return null}},enabled:!0===n,staleTime:6e4})}(function(){const e=new Date;return"".concat(e.getUTCFullYear(),"-").concat(String(e.getUTCMonth()+1).padStart(2,"0"))}()),m=f.data,g=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","portal-coverage"],queryFn:async()=>{const e=await t();try{return await rE(e,"/api/admin/portal-coverage")}catch(r){return null}},enabled:!0===e.isAuthenticated,staleTime:6e4})}(),y=g.data,b=g.isLoading,x=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","extraction-quality"],queryFn:async()=>{const e=await t();try{return await rE(e,"/api/admin/extraction-quality")}catch(r){return null}},enabled:!0===e.isAuthenticated,staleTime:6e4})}(),w=x.data,S=x.isLoading,k=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","product-kpis"],queryFn:async()=>{const e=await t();try{return await rE(e,"/api/admin/product-kpis")}catch(r){return null}},enabled:!0===e.isAuthenticated,staleTime:3e5})}(),_=k.data,C=k.isLoading,A=function(){const e=Ma(),t=e.getIdToken;return ql({queryKey:["admin","activation-funnel"],queryFn:async()=>{const e=await t();try{return await rE(e,"/api/admin/activation-funnel")}catch(r){return null}},enabled:!0===e.isAuthenticated,staleTime:3e5})}(),j=A.data,I=A.isLoading;return c.isLoading?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,tr.jsx)(An,{})}):d?(0,tr.jsxs)(Er.Root,{sx:{height:"100vh",width:"100vw"},children:[(0,tr.jsx)(Td,{title:"Admin \u2014 Toppi",noIndex:!0}),(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:c})}),(0,tr.jsx)(Er.Main,{children:(0,tr.jsxs)(Tr,{sx:{p:3,maxWidth:1100,mx:"auto"},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,mb:3,children:[(0,tr.jsx)(TE.A,{}),(0,tr.jsx)(Gn,{level:"h3",children:"System Dashboard"}),(0,tr.jsxs)(Gn,{level:"body-xs",color:"neutral",sx:{ml:"auto"},children:["Updated ",(new Date).toLocaleTimeString()]})]}),(0,tr.jsx)(nW,{kpis:_,isLoading:C}),(0,tr.jsx)(oW,{funnel:j,isLoading:I}),(0,tr.jsx)(hW,{}),(0,tr.jsx)(lW,{}),(0,tr.jsxs)(Tr,{sx:{display:"flex",gap:1,mb:3,flexWrap:"wrap"},children:[(0,tr.jsxs)(Ti,{color:null!==u&&void 0!==u&&u.db?"success":"danger",variant:"soft",size:"sm",children:["DB: ",null!==u&&void 0!==u&&u.db?"Healthy":"Unreachable"]}),(0,tr.jsxs)(Ti,{color:null!==u&&void 0!==u&&u.restate?"success":"danger",variant:"soft",size:"sm",children:["Restate: ",null!==u&&void 0!==u&&u.restate?"Healthy":"Unreachable"]}),(null===u||void 0===u?void 0:u.version)&&(0,tr.jsx)(Ti,{color:"neutral",variant:"outlined",size:"sm",children:u.version})]}),(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2,mb:3},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,mb:1.5,children:[(0,tr.jsx)(JH.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"AI Search Jobs \u2014 last 7 days"})]}),v?(0,tr.jsx)(An,{size:"sm"}):(0,tr.jsxs)(HO,{stripe:"odd",borderAxis:"x",size:"sm",children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{children:"Date"}),(0,tr.jsx)("th",{children:"Runs"}),(0,tr.jsx)("th",{children:"Success"}),(0,tr.jsx)("th",{children:"Failed"}),(0,tr.jsx)("th",{style:{width:160},children:"Success Rate"})]})}),(0,tr.jsxs)("tbody",{children:[(null!==(e=null===p||void 0===p?void 0:p.dailyJobStats)&&void 0!==e?e:[]).map(e=>{const t=e.runs>0?e.succeeded/e.runs*100:0,r=t>=90?"success":t>=70?"warning":"danger";return(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:e.date})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-sm",children:e.runs})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",color:"success",variant:"soft",children:e.succeeded})}),(0,tr.jsx)("td",{children:(0,tr.jsx)(Ti,{size:"sm",color:e.failed>0?"danger":"neutral",variant:"soft",children:e.failed})}),(0,tr.jsx)("td",{children:(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,children:[(0,tr.jsx)(AE,{determinate:!0,value:t,color:r,sx:{flex:1}}),(0,tr.jsxs)(Gn,{level:"body-xs",children:[t.toFixed(0),"%"]})]})})]},e.date)}),0===(null!==(t=null===p||void 0===p?void 0:p.dailyJobStats)&&void 0!==t?t:[]).length&&(0,tr.jsx)("tr",{children:(0,tr.jsx)("td",{colSpan:5,children:(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No jobs in the last 7 days."})})})]})]}),(0,tr.jsx)(Tr,{sx:{display:"flex",gap:3,mt:1.5},children:(0,tr.jsxs)(Gn,{level:"body-sm",color:"neutral",children:["Total this month: ",(0,tr.jsx)("strong",{children:null!==(r=null===p||void 0===p?void 0:p.totalRunsThisMonth)&&void 0!==r?r:"\u2014"})]})})]}),(0,tr.jsx)(eW,{stats:y,isLoading:b}),(0,tr.jsx)(tW,{stats:w,isLoading:S}),(0,tr.jsxs)(Tr,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:2,mb:3},children:[(0,tr.jsx)(hi,{variant:"soft",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Input Tokens (this month)"}),(0,tr.jsx)(Gn,{level:"h3",children:null!==(n=null===m||void 0===m||null===(o=m.totalInputTokens)||void 0===o?void 0:o.toLocaleString())&&void 0!==n?n:"\u2014"})]})}),(0,tr.jsx)(hi,{variant:"soft",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Output Tokens (this month)"}),(0,tr.jsx)(Gn,{level:"h3",children:null!==(i=null===m||void 0===m||null===(a=m.totalOutputTokens)||void 0===a?void 0:a.toLocaleString())&&void 0!==i?i:"\u2014"})]})}),(0,tr.jsx)(hi,{variant:"soft",color:"warning",children:(0,tr.jsxs)(qC,{children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:.5,children:[(0,tr.jsx)(QH.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"body-xs",color:"neutral",children:"Est. Cost USD (this month)"})]}),(0,tr.jsx)(Gn,{level:"h3",children:m?"$".concat(m.estimatedCostUsd.toFixed(2)):"\u2014"})]})})]}),(0,tr.jsxs)(Qz,{variant:"outlined",sx:{borderRadius:"sm",p:2},children:[(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,mb:1.5,children:[(0,tr.jsx)(YH.A,{fontSize:"small"}),(0,tr.jsx)(Gn,{level:"title-md",children:"User Usage (this month)"})]}),(0,tr.jsxs)(HO,{size:"sm",borderAxis:"x",children:[(0,tr.jsx)("thead",{children:(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("th",{children:"User"}),(0,tr.jsx)("th",{children:"Runs"}),(0,tr.jsx)("th",{children:"Limit"}),(0,tr.jsx)("th",{style:{width:160},children:"Usage"})]})}),(0,tr.jsxs)("tbody",{children:[(null!==(s=null===p||void 0===p?void 0:p.topUsers)&&void 0!==s?s:[]).map(e=>{const t=e.freeLimit>0?e.runsThisMonth/e.freeLimit*100:0;return(0,tr.jsxs)("tr",{children:[(0,tr.jsx)("td",{children:(0,tr.jsx)(Gn,{level:"body-xs",children:e.userId})}),(0,tr.jsx)("td",{children:e.runsThisMonth}),(0,tr.jsx)("td",{children:e.freeLimit}),(0,tr.jsx)("td",{children:(0,tr.jsxs)(Mn,{direction:"row",alignItems:"center",gap:1,children:[(0,tr.jsx)(AE,{determinate:!0,value:Math.min(t,100),color:t>=100?"danger":"neutral",sx:{flex:1}}),t>=100&&(0,tr.jsx)(Ti,{size:"sm",color:"danger",variant:"soft",children:"At limit"})]})})]},e.userId)}),0===(null!==(l=null===p||void 0===p?void 0:p.topUsers)&&void 0!==l?l:[]).length&&(0,tr.jsx)("tr",{children:(0,tr.jsx)("td",{colSpan:4,children:(0,tr.jsx)(Gn,{level:"body-sm",color:"neutral",children:"No usage yet this month."})})})]})]})]})]})})]}):(0,tr.jsx)(we,{to:"/",replace:!0})}function vW(){const e=Ma().isAuthenticated;return(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(Td,{title:"Page not found \u2014 Toppi",noIndex:!0}),(0,tr.jsxs)(Tr,{sx:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:3,textAlign:"center"},children:[(0,tr.jsx)(MN.A,{sx:{fontSize:64,color:"neutral.400"}}),(0,tr.jsx)(Gn,{level:"h1",sx:{fontSize:{xs:"3rem",sm:"4rem"},fontWeight:700,lineHeight:1},children:"404"}),(0,tr.jsx)(Gn,{level:"h3",children:"Page not found"}),(0,tr.jsx)(Gn,{level:"body-md",color:"neutral",sx:{maxWidth:480},children:"The page you're looking for doesn't exist or has been moved."}),(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},spacing:1.5,sx:{mt:2,width:{xs:"100%",sm:"auto"},maxWidth:360},children:[(0,tr.jsx)(wo,{component:kc,to:e?"/dashboard":"/",startDecorator:(0,tr.jsx)(o_.A,{}),variant:"solid",color:"primary",fullWidth:!0,children:e?"Go to dashboard":"Go home"}),e&&(0,tr.jsx)(wo,{component:kc,to:"/ai-search",startDecorator:(0,tr.jsx)(n_.A,{}),variant:"outlined",color:"neutral",fullWidth:!0,children:"Run an AI search"})]})]})]})}function fW(e){let t=e.n,r=e.onClick;const n=!!t.houseId,o=ie(),i="listing_status_change"===t.type&&t.title.toLowerCase().includes("under offer")&&!!t.houseId;return(0,tr.jsxs)(Qz,{variant:"outlined",onClick:()=>r(t),sx:{p:2,borderRadius:"sm",display:"flex",gap:2,alignItems:"flex-start",cursor:n?"pointer":"default",bgcolor:t.read?"background.surface":"background.level1",transition:"background-color 0.15s","&:hover":n?{bgcolor:"background.level2"}:void 0},children:[(0,tr.jsx)(Tr,{sx:{mt:.25},children:UE(t)}),(0,tr.jsxs)(Tr,{sx:{flex:1,minWidth:0},children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[(0,tr.jsx)(Gn,{level:"title-sm",children:t.title}),!t.read&&(0,tr.jsx)(Ti,{size:"sm",color:"primary",variant:"solid",children:"new"})]}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.secondary",children:t.body}),i&&(0,tr.jsx)(hc,{component:"button",level:"body-sm",sx:{mt:.5,display:"block"},onClick:e=>{e.stopPropagation(),o("/house/".concat(t.houseId,"?moreLikeThis=true"))},children:"Find similar properties \u2192"}),(0,tr.jsx)(Gn,{level:"body-xs",textColor:"text.tertiary",sx:{mt:.5},children:(a=t.createdAt,new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}))})]})]});var a}function mW(){var e;const t=Ma(),r=ie(),n=HE(),i=n.data,a=n.isLoading,s=WE(),l=null!==(e=null===i||void 0===i?void 0:i.notifications)&&void 0!==e?e:[],c=l.filter(e=>!e.read).length,d=l.filter(e=>"new_match"===e.type&&!e.read),u=d.length,h=d.map(e=>e.id).sort().join(",");o.useEffect(()=>{u>0&&kN.monitoringRunReceived("",u)},[h]),o.useEffect(()=>{a||Lz.notificationInboxOpened(c)},[a]);const p=e=>{if("price_drop"===e.type){const t=e.body.match(/(\d+(?:\.\d+)?)\s*%/);Lz.priceDropAlertClicked(t?parseFloat(t[1]):0)}e.read||s.mutate({ids:[e.id]}),e.houseId&&r("/house/".concat(e.houseId))};return(0,tr.jsxs)(Tr,{sx:{bgcolor:"background.body",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:"Notifications \u2014 Toppi",noIndex:!0}),(0,tr.jsx)(Er.Header,{children:(0,tr.jsx)(wz,{user:t})}),(0,tr.jsx)(Tr,{sx:{maxWidth:720,mx:"auto",px:3,py:4},children:(0,tr.jsxs)(Mn,{spacing:3,children:[(0,tr.jsxs)(Tr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:2,flexWrap:"wrap"},children:[(0,tr.jsxs)(Tr,{children:[(0,tr.jsx)(Gn,{level:"h2",children:"Notifications"}),(0,tr.jsx)(Gn,{level:"body-md",textColor:"text.tertiary",children:"Updates about your saved properties \u2014 price drops, new matches from your AI searches, and listing status changes."})]}),c>0&&(0,tr.jsx)(wo,{size:"sm",variant:"soft",onClick:()=>s.mutate({all:!0}),loading:s.isPending,children:"Mark all read"})]}),(0,tr.jsx)(nc,{}),a?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",py:6},children:(0,tr.jsx)(An,{})}):0===l.length?(0,tr.jsxs)(Qz,{variant:"soft",sx:{p:4,borderRadius:"sm",textAlign:"center"},children:[(0,tr.jsx)(BE.A,{sx:{fontSize:40,color:"neutral.400",mb:1}}),(0,tr.jsx)(Gn,{level:"title-md",sx:{mb:.5},children:"No notifications yet"}),(0,tr.jsx)(Gn,{level:"body-sm",textColor:"text.tertiary",children:"When properties on your boards drop in price or your AI searches find new matches, you'll see them here."})]}):(0,tr.jsx)(Mn,{spacing:1.5,children:l.map(e=>(0,tr.jsx)(fW,{n:e,onClick:p},e.id))})]})})]})}function gW(e){let t=e.title,r=e.children;return(0,tr.jsxs)(Mn,{spacing:1,children:[(0,tr.jsx)(Gn,{level:"h3",children:t}),r]})}function yW(e){let t=e.title,r=e.lastUpdated,n=e.children,o=e.metaTitle,i=e.metaDescription,a=e.canonicalPath;return(0,tr.jsxs)(Tr,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh"},children:[(0,tr.jsx)(Td,{title:null!==o&&void 0!==o?o:"".concat(t," \u2014 Toppi"),description:i,canonicalPath:a}),(0,tr.jsx)(Tr,{sx:{flex:1,py:{xs:4,md:6},px:{xs:2,md:4}},children:(0,tr.jsxs)(Do,{maxWidth:"md",children:[(0,tr.jsx)(wo,{component:kc,to:"/",variant:"plain",color:"neutral",size:"sm",startDecorator:(0,tr.jsx)(VH.A,{}),sx:{mb:3,alignSelf:"flex-start"},children:"Back to Toppi"}),(0,tr.jsxs)(Mn,{spacing:1,sx:{mb:4},children:[(0,tr.jsx)(Gn,{level:"h1",children:t}),(0,tr.jsxs)(Gn,{level:"body-sm",textColor:"neutral.500",children:["Last updated: ",r]})]}),(0,tr.jsx)(Mn,{spacing:3,children:n})]})}),(0,tr.jsx)(jc,{})]})}function bW(){return(0,tr.jsxs)(yW,{title:"Terms of Service",lastUpdated:"19 June 2026",metaDescription:"Terms of Service governing use of Toppi, the AI-powered UK property search assistant.",canonicalPath:"/terms",children:[(0,tr.jsx)(Gn,{level:"body-md",children:'These Terms of Service ("Terms") govern your use of Toppi ("the Service") operated by Toppi ("we", "us", or "our"). By accessing or using the Service, you agree to be bound by these Terms. If you disagree with any part, please do not use the Service.'}),(0,tr.jsx)(gW,{title:"1. The Service",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Toppi is a property search assistant that helps you find and organise UK residential property listings sourced from publicly available portals. The Service includes AI-powered search, scheduled monitoring, a property workspace, and optional collaboration features."})}),(0,tr.jsx)(gW,{title:"2. Accounts",children:(0,tr.jsx)(Gn,{level:"body-md",children:"You must register with accurate information and keep your credentials secure. You are responsible for activity on your account. You must be at least 18 years old to use Toppi."})}),(0,tr.jsx)(gW,{title:"3. Subscriptions and billing",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Toppi offers a free tier and paid subscription plans. Paid plans are billed in advance on a recurring basis via our payment processor, Stripe. You may cancel at any time from your account settings; cancellation takes effect at the end of the current billing period and we do not provide refunds for partial periods unless required by law."})}),(0,tr.jsx)(gW,{title:"4. Listing data and accuracy",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Property listings, prices, photos, and statuses are sourced from third-party portals and public datasets. We make reasonable efforts to keep this data current, but we do not guarantee accuracy, completeness, or availability. Always verify details directly with the listing agent before making any property decision."})}),(0,tr.jsx)(gW,{title:"5. Acceptable use",children:(0,tr.jsx)(Gn,{level:"body-md",children:"You agree not to: (a) scrape, copy, or redistribute Toppi's data or interface; (b) reverse engineer the Service; (c) use the Service for unlawful purposes; or (d) attempt to disrupt the Service or other users' access to it."})}),(0,tr.jsx)(gW,{title:"6. Intellectual property",children:(0,tr.jsx)(Gn,{level:"body-md",children:"The Service, its features, and its branding remain our property. Listing data displayed through Toppi remains the property of the respective sources. You retain ownership of notes, comments, and other content you create within the Service."})}),(0,tr.jsx)(gW,{title:"7. Limitation of liability",children:(0,tr.jsx)(Gn,{level:"body-md",children:'The Service is provided "as is" without warranties of any kind. To the maximum extent permitted by law, Toppi is not liable for indirect, incidental, or consequential damages arising from your use of the Service, including any property decisions made based on information shown.'})}),(0,tr.jsx)(gW,{title:"8. Termination",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We may suspend or terminate your account for breach of these Terms or for prolonged inactivity. You may close your account at any time from your account settings."})}),(0,tr.jsx)(gW,{title:"9. Changes to these Terms",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We may update these Terms from time to time. Material changes will be notified by email or in-app. Continued use of the Service after changes take effect constitutes acceptance of the updated Terms."})}),(0,tr.jsx)(gW,{title:"10. Governing law",children:(0,tr.jsx)(Gn,{level:"body-md",children:"These Terms are governed by the laws of England and Wales. Disputes will be subject to the exclusive jurisdiction of the courts of England and Wales."})}),(0,tr.jsx)(gW,{title:"11. Contact",children:(0,tr.jsxs)(Gn,{level:"body-md",children:["Questions about these Terms? Email us at"," ",(0,tr.jsx)(hc,{href:"mailto:hello@toppi.app",children:"hello@toppi.app"}),"."]})})]})}function xW(){return(0,tr.jsxs)(yW,{title:"Privacy Policy",lastUpdated:"19 June 2026",metaDescription:"How Toppi collects, uses and protects your personal data under UK GDPR and the Data Protection Act 2018.",canonicalPath:"/privacy",children:[(0,tr.jsx)(Gn,{level:"body-md",children:'Toppi ("we", "us", or "our") respects your privacy and is committed to protecting your personal data. This Privacy Policy explains what data we collect, how we use it, and the rights you have over it. Toppi is the data controller for the personal data we process. This policy is governed by the UK GDPR and the Data Protection Act 2018.'}),(0,tr.jsx)(gW,{title:"1. Data we collect",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We collect: (a) account data (name, email) provided when you register via our auth provider Kinde; (b) usage data (searches you create, properties you save, notes and events you record); (c) payment metadata (handled by Stripe \u2014 we do not store full card details); (d) technical data (IP address, browser type, device identifiers) for security and diagnostics."})}),(0,tr.jsx)(gW,{title:"2. How we use your data",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We use your data to: provide and improve the Service, run AI searches on your behalf, send transactional and notification emails you've opted into, process payments, prevent abuse, and meet legal obligations. We do not sell your personal data."})}),(0,tr.jsx)(gW,{title:"3. Legal bases (UK GDPR)",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We process personal data on the following bases: performance of our contract with you (account and Service delivery), our legitimate interests (Service security and improvement), your consent (marketing emails, optional analytics), and legal obligations (accounting records)."})}),(0,tr.jsx)(gW,{title:"4. Sharing your data",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We share data only with the processors needed to run the Service: Kinde (authentication), Stripe (payments), Resend (transactional email), and our hosting provider. Each is contractually bound to process your data only on our instructions and consistent with this policy. We do not share your data with advertisers."})}),(0,tr.jsx)(gW,{title:"5. Data retention",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We retain your account data for as long as your account is active. If you close your account, we delete your personal data within 30 days, except where we are required to retain billing records (typically 6 years) to meet legal obligations."})}),(0,tr.jsx)(gW,{title:"6. Your rights",children:(0,tr.jsxs)(Gn,{level:"body-md",children:["You have the right to: access your data, correct inaccurate data, request deletion, object to certain processing, request portability, and withdraw consent at any time. You can exercise most rights from your account settings; for anything else, email"," ",(0,tr.jsx)(hc,{href:"mailto:privacy@toppi.app",children:"privacy@toppi.app"}),". You may also lodge a complaint with the UK Information Commissioner's Office (ICO) at ico.org.uk."]})}),(0,tr.jsx)(gW,{title:"7. Security",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We use HTTPS for all traffic, encrypt data at rest where supported, and restrict access to production systems. No system is perfectly secure \u2014 we'll notify you within 72 hours of discovering any breach affecting your data, as required by the UK GDPR."})}),(0,tr.jsx)(gW,{title:"8. International transfers",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Some of our processors operate outside the UK. Where data is transferred internationally, we rely on UK adequacy decisions or the International Data Transfer Agreement to safeguard your data."})}),(0,tr.jsx)(gW,{title:"9. Children",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Toppi is not intended for users under 18 and we do not knowingly collect data from children."})}),(0,tr.jsx)(gW,{title:"10. Changes to this policy",children:(0,tr.jsx)(Gn,{level:"body-md",children:"We may update this policy from time to time. Material changes will be notified by email or in-app before they take effect."})}),(0,tr.jsx)(gW,{title:"11. Contact",children:(0,tr.jsxs)(Gn,{level:"body-md",children:["For any privacy question, email"," ",(0,tr.jsx)(hc,{href:"mailto:privacy@toppi.app",children:"privacy@toppi.app"}),"."]})})]})}function wW(){return(0,tr.jsxs)(yW,{title:"Cookie Policy",lastUpdated:"19 June 2026",metaDescription:"Which cookies Toppi uses and why, and how to control them.",canonicalPath:"/cookies",children:[(0,tr.jsx)(Gn,{level:"body-md",children:"This Cookie Policy explains how Toppi uses cookies and similar technologies when you visit toppi.app. It should be read alongside our Privacy Policy."}),(0,tr.jsx)(gW,{title:"1. What cookies are",children:(0,tr.jsx)(Gn,{level:"body-md",children:"Cookies are small text files stored by your browser. They let a site remember your session, preferences, and recent activity between page loads."})}),(0,tr.jsxs)(gW,{title:"2. How Toppi uses cookies",children:[(0,tr.jsx)(Gn,{level:"body-md",children:"We use only the cookies needed to operate the Service:"}),(0,tr.jsxs)(Mn,{component:"ul",spacing:1,sx:{pl:3,m:0},children:[(0,tr.jsxs)(Gn,{component:"li",level:"body-md",children:[(0,tr.jsx)("strong",{children:"Authentication"})," \u2014 set by our auth provider, Kinde, to keep you signed in."]}),(0,tr.jsxs)(Gn,{component:"li",level:"body-md",children:[(0,tr.jsx)("strong",{children:"Session preferences"})," \u2014 small browser-storage values (e.g. your preferred board layout, dismissed onboarding modal, pending referral code) that make the app behave consistently across visits."]}),(0,tr.jsxs)(Gn,{component:"li",level:"body-md",children:[(0,tr.jsx)("strong",{children:"Security"})," \u2014 anti-CSRF and rate-limiting tokens set during sensitive flows such as checkout."]})]}),(0,tr.jsx)(Gn,{level:"body-md",children:"We do not currently use third-party advertising or cross-site tracking cookies."})]}),(0,tr.jsx)(gW,{title:"3. Managing cookies",children:(0,tr.jsx)(Gn,{level:"body-md",children:"You can clear or block cookies in your browser settings. Blocking authentication cookies will sign you out and prevent you from using the Service."})}),(0,tr.jsx)(gW,{title:"4. Changes to this policy",children:(0,tr.jsx)(Gn,{level:"body-md",children:"If we add new categories of cookies (for example, opt-in analytics), we'll update this page and ask for your consent first where required."})}),(0,tr.jsx)(gW,{title:"5. Contact",children:(0,tr.jsxs)(Gn,{level:"body-md",children:["Questions? Email"," ",(0,tr.jsx)(hc,{href:"mailto:privacy@toppi.app",children:"privacy@toppi.app"}),"."]})})]})}var SW=r(7175),kW=r(1485),_W=r(4804);function CW(e){let t=e.open,r=e.onClose,n=e.onCreateSearch;return(0,tr.jsx)(L_,{open:t,onClose:r,children:(0,tr.jsxs)(U_,{size:"md",layout:"center",sx:{maxWidth:480},children:[(0,tr.jsx)(sC,{}),(0,tr.jsxs)(wR,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,tr.jsx)(n_.A,{color:"primary"}),"Welcome to Toppi"]}),(0,tr.jsxs)(mE,{children:[(0,tr.jsx)(Gn,{level:"body-md",sx:{mb:1.5},children:"Toppi finds your next home before it goes \u2014 searching Rightmove, Zoopla & OnTheMarket, then scoring every listing against your exact requirements."}),(0,tr.jsx)(Gn,{level:"title-sm",sx:{mt:2,mb:1},children:"Here's how to get started:"}),(0,tr.jsxs)(Ui,{size:"sm",sx:{"--ListItem-paddingY":"4px"},children:[(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(aa,{children:(0,tr.jsx)(SW.A,{color:"primary"})}),"Describe your ideal home"]}),(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(aa,{children:(0,tr.jsx)(kW.A,{color:"primary"})}),"Run an AI search (5\u201315 min)"]}),(0,tr.jsxs)(ta,{children:[(0,tr.jsx)(aa,{children:(0,tr.jsx)(_W.A,{color:"primary"})}),"See results ranked by match %"]})]}),(0,tr.jsx)(Tr,{sx:{mt:3},children:(0,tr.jsx)(wo,{size:"lg",color:"primary",fullWidth:!0,startDecorator:(0,tr.jsx)(n_.A,{}),onClick:n,children:"Create your first search"})})]})]})})}function AW(){const e=o.useState(()=>null===qk()),t=(0,s.A)(e,2),r=t[0],n=t[1];if(!r)return null;return(0,tr.jsx)(Qz,{role:"dialog","aria-label":"Cookie consent","aria-modal":"false",variant:"outlined",sx:{position:"fixed",bottom:0,left:0,right:0,zIndex:9999,borderTop:"1px solid",borderColor:"divider",borderRadius:0,px:{xs:2,sm:3},py:2,bgcolor:"background.surface",boxShadow:"md"},children:(0,tr.jsxs)(Mn,{direction:{xs:"column",sm:"row"},alignItems:{xs:"stretch",sm:"center"},justifyContent:"space-between",gap:2,sx:{maxWidth:1200,mx:"auto"},children:[(0,tr.jsxs)(Gn,{level:"body-sm",sx:{flex:1},children:["We use a single analytics cookie to understand how Toppi is used and improve it. Essential cookies for sign-in and security are always on."," ",(0,tr.jsx)(hc,{href:"/cookies",level:"body-sm",children:"Read the cookie policy"})]}),(0,tr.jsxs)(Mn,{direction:"row",gap:1,justifyContent:{xs:"flex-end",sm:"flex-start"},flexShrink:0,children:[(0,tr.jsx)(wo,{variant:"outlined",color:"neutral",size:"sm",onClick:()=>{Gk("declined"),n(!1)},"aria-label":"Decline analytics cookies",children:"Decline"}),(0,tr.jsx)(wo,{variant:"solid",color:"primary",size:"sm",onClick:()=>{Gk("accepted"),n(!1)},"aria-label":"Accept analytics cookies",children:"Accept analytics"})]})]})})}const jW="post_login_redirect",IW="https://www.toppi.app",PW=new wD({queryCache:new yD({onError:e=>{e instanceof TypeError&&"Failed to fetch"===e.message||console.error("Query error:",e)}})});function RW(e){let t=e.children;const r=Ma(),n=r.isAuthenticated,o=r.isLoading,i=r.login,a=ne();return o?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,tr.jsx)(An,{})}):n?(0,tr.jsx)(tr.Fragment,{children:t}):("/dashboard"!==a.pathname&&localStorage.setItem(jW,a.pathname+a.search),i(),null)}function TW(){const e=ie();return o.useEffect(()=>{const t=localStorage.getItem(jW);t&&"/dashboard"!==t&&(localStorage.removeItem(jW),e(t,{replace:!0}))},[e]),null}function EW(){const e=Ma(),t=e.isAuthenticated,r=e.isLoading,n=e.login;return o.useEffect(()=>{r||t||n()},[t,r]),r?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,tr.jsx)(An,{})}):t?(0,tr.jsx)(we,{to:"/dashboard",replace:!0}):null}function zW(){const e=Ma(),t=e.isAuthenticated;return e.isLoading?(0,tr.jsx)(Tr,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh"},children:(0,tr.jsx)(An,{})}):t?(0,tr.jsx)(we,{to:"/dashboard",replace:!0}):(0,tr.jsx)(r_,{})}function DW(){const e=Ma().isAuthenticated,t=Hk(),r=t.data,n=t.isLoading,o=Wk(),i=ie(),a=ne();if(!e||n||!r)return null;if(r.onboardingCompleted)return null;if(a.pathname.startsWith("/invite/"))return null;if(a.pathname.startsWith("/share/"))return null;return(0,tr.jsx)(CW,{open:!0,onClose:()=>{o.mutate({skipped:!0})},onCreateSearch:()=>{o.mutate({skipped:!1}),i("/ai-search")}})}function MW(){const e=window.location.origin;return(0,o.useEffect)(()=>{const e=new URLSearchParams(window.location.search),t={};let r=!1;if(Ok.forEach(n=>{const o=e.get(n);o&&(t[n]=o,r=!0)}),r){if(!localStorage.getItem(Fk)){t.captured_at=Date.now();try{localStorage.setItem(Fk,JSON.stringify(t))}catch(n){}}try{const e=new URL(window.location.href);Ok.forEach(t=>e.searchParams.delete(t)),window.history.replaceState({},"",e.toString())}catch(o){}}},[]),(0,tr.jsx)(wd,{children:(0,tr.jsxs)(UT,{theme:iD,disableTransitionOnChange:!0,children:[(0,tr.jsx)(nD,{}),(0,tr.jsx)(rD,{styles:{"@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":{animationDuration:"0.01ms !important",animationIterationCount:"1 !important",transitionDuration:"0.01ms !important",scrollBehavior:"auto !important"}}}}),(0,tr.jsx)(Dl,{client:PW,children:(0,tr.jsx)(Na,{clientId:"bc2666981ab74fff92a95922bab6bf4a",domain:"https://toppiapi.kinde.com",redirectUri:"".concat(e,"/dashboard"),logoutUri:e,children:(0,tr.jsx)(yz,{children:(0,tr.jsxs)(BR,{children:[(0,tr.jsx)(DW,{}),(0,tr.jsx)(AW,{}),(0,tr.jsxs)(_e,{children:[(0,tr.jsx)(Se,{path:"/",element:(0,tr.jsx)(zW,{})}),!1,(0,tr.jsx)(Se,{path:"/terms",element:(0,tr.jsx)(bW,{})}),(0,tr.jsx)(Se,{path:"/privacy",element:(0,tr.jsx)(xW,{})}),(0,tr.jsx)(Se,{path:"/cookies",element:(0,tr.jsx)(wW,{})}),(0,tr.jsx)(Se,{path:"/privacy-policy",element:(0,tr.jsx)(we,{to:"/privacy",replace:!0})}),(0,tr.jsx)(Se,{path:"/terms-of-service",element:(0,tr.jsx)(we,{to:"/terms",replace:!0})}),(0,tr.jsx)(Se,{path:"/legal",element:(0,tr.jsx)(we,{to:"/terms",replace:!0})}),(0,tr.jsx)(Se,{path:"/saved",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/watchlist",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/favourites",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/favorites",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/shortlist",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/login",element:(0,tr.jsx)(EW,{})}),(0,tr.jsx)(Se,{path:"/dashboard",element:(0,tr.jsx)(RW,{children:(0,tr.jsxs)(tr.Fragment,{children:[(0,tr.jsx)(TW,{}),(0,tr.jsx)(eD,{})]})})}),(0,tr.jsx)(Se,{path:"/dashboard/ai-search",element:(0,tr.jsx)(we,{to:"/ai-search",replace:!0})}),(0,tr.jsx)(Se,{path:"/dashboard/settings",element:(0,tr.jsx)(we,{to:"/settings",replace:!0})}),(0,tr.jsx)(Se,{path:"/dashboard/*",element:(0,tr.jsx)(we,{to:"/dashboard",replace:!0})}),(0,tr.jsx)(Se,{path:"/house/:houseId",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(sF,{})})}),(0,tr.jsx)(Se,{path:"/invite/:token/accept",element:(0,tr.jsx)(dF,{})}),(0,tr.jsx)(Se,{path:"/share/:shareToken",element:(0,tr.jsx)(mF,{})}),(0,tr.jsx)(Se,{path:"/join/:referralCode",element:(0,tr.jsx)(kF,{})}),(0,tr.jsx)(Se,{path:"/ai-search",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(tB,{})})}),(0,tr.jsx)(Se,{path:"/compare",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(yB,{})})}),(0,tr.jsx)(Se,{path:"/subscription/success",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(bB,{})})}),(0,tr.jsx)(Se,{path:"/settings",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(WH,{})})}),(0,tr.jsx)(Se,{path:"/settings/destinations",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(jB,{})})}),LH&&(0,tr.jsx)(Se,{path:"/settings/api-keys",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(GH,{})})}),(0,tr.jsx)(Se,{path:"/profile",element:(0,tr.jsx)(we,{to:"/settings",replace:!0})}),(0,tr.jsx)(Se,{path:"/account",element:(0,tr.jsx)(we,{to:"/settings",replace:!0})}),(0,tr.jsx)(Se,{path:"/admin",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(pW,{})})}),(0,tr.jsx)(Se,{path:"/notifications",element:(0,tr.jsx)(RW,{children:(0,tr.jsx)(mW,{})})}),(0,tr.jsx)(Se,{path:"/alerts",element:(0,tr.jsx)(we,{to:"/notifications",replace:!0})}),(0,tr.jsx)(Se,{path:"*",element:(0,tr.jsx)(vW,{})})]})]})})})})]})})}const LW=function(){return(0,tr.jsx)(MW,{})},OW=e=>{e&&e instanceof Function&&r.e(453).then(r.bind(r,6453)).then(t=>{let r=t.getCLS,n=t.getFID,o=t.getFCP,i=t.getLCP,a=t.getTTFB;r(e),n(e),o(e),i(e),a(e)})};!function(){var e;$k(),Qk||(e=e=>{},Kk.add(e))}();n(document.getElementById("root")).render((0,tr.jsx)(o.StrictMode,{children:(0,tr.jsx)(xc,{children:(0,tr.jsx)(LW,{})})})),OW(),"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/service-worker.js",{scope:"/"}).catch(e=>{console.warn("Service worker registration failed",e)})})},918(e,t,r){"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{A:()=>n})},581(e,t,r){"use strict";r.d(t,{E:()=>me,T:()=>ue,c:()=>ve,h:()=>he,w:()=>de});var n=r(5043);var o=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t0?u(w,--b):0,g--,10===x&&(g=1,m--),x}function C(){return x=b2||P(x)>3?"":" "}function D(e,t){for(;--t&&C()&&!(x<48||x>102||x>57&&x<65||x>70&&x<97););return I(e,j()+(t<6&&32==A()&&32==C()))}function M(e){for(;C();)switch(x){case e:return b;case 34:case 39:34!==e&&39!==e&&M(x);break;case 40:41===e&&M(e);break;case 92:C()}return b}function L(e,t){for(;C()&&e+x!==57&&(e+x!==84||47!==A()););return"/*"+I(t,b-1)+"*"+a(47===e?e:C())}function O(e){for(;!P(A());)C();return I(e,b)}var F="-ms-",N="-moz-",B="-webkit-",H="comm",W="rule",V="decl",$="@keyframes";function U(e,t){for(var r="",n=v(e),o=0;o0&&p(F)-g&&f(b>32?Y(F+";",n,r,g-1):Y(c(F," ","")+";",n,r,g-2),h);break;case 59:F+=";";default:if(f(M=J(F,t,r,v,m,o,l,P,R=[],T=[],g),i),123===I)if(0===m)G(F,t,M,M,R,i,g,l,T);else switch(99===y&&110===u(F,3)?100:y){case 100:case 108:case 109:case 115:G(e,M,M,n&&f(J(e,M,M,0,0,o,l,P,o,R=[],g),T),o,T,g,l,n?R:T);break;default:G(F,M,M,M,[""],T,0,l,T)}}v=m=b=0,w=k=1,P=F="",g=s;break;case 58:g=1+p(F),b=x;default:if(w<1)if(123==I)--w;else if(125==I&&0==w++&&125==_())continue;switch(F+=a(I),I*w){case 38:k=m>0?1:(F+="\f",-1);break;case 44:l[v++]=(p(F)-1)*k,k=1;break;case 64:45===A()&&(F+=E(C())),y=A(),m=g=p(P=F+=O(j())),I++;break;case 45:45===x&&2==p(F)&&(w=0)}}return i}function J(e,t,r,n,o,a,s,d,u,p,f){for(var m=o-1,g=0===o?a:[""],y=v(g),b=0,x=0,w=0;b0?g[k]+" "+_:c(_,/&\f/g,g[k])))&&(u[w++]=C);return S(e,t,r,0===o?W:d,u,p,f)}function Q(e,t,r){return S(e,t,r,H,a(x),h(e,2,-2),0)}function Y(e,t,r,n){return S(e,t,r,V,h(e,0,n),h(e,n+1,-1),n)}var X=function(e,t,r){for(var n=0,o=0;n=o,o=A(),38===n&&12===o&&(t[r]=1),!P(o);)C();return I(e,b)},Z=function(e,t){return T(function(e,t){var r=-1,n=44;do{switch(P(n)){case 0:38===n&&12===A()&&(t[r]=1),e[r]+=X(b-1,t,r);break;case 2:e[r]+=E(n);break;case 4:if(44===n){e[++r]=58===A()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=a(n)}}while(n=C());return e}(R(e),t))},ee=new WeakMap,te=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ee.get(r))&&!n){ee.set(e,!0);for(var o=[],i=Z(t,o),a=r.props,s=0,l=0;s6)switch(u(e,t+1)){case 109:if(45!==u(e,t+4))break;case 102:return c(e,/(.+:)(.+)-([^]+)/,"$1"+B+"$2-$3$1"+N+(108==u(e,t+3)?"$3":"$2-$3"))+e;case 115:return~d(e,"stretch")?ne(c(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==u(e,t+1))break;case 6444:switch(u(e,p(e)-3-(~d(e,"!important")&&10))){case 107:return c(e,":",":"+B)+e;case 101:return c(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+B+(45===u(e,14)?"inline-":"")+"box$3$1"+B+"$2$3$1"+F+"$2box$3")+e}break;case 5936:switch(u(e,t+11)){case 114:return B+e+F+c(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return B+e+F+c(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return B+e+F+c(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return B+e+F+e+e}return e}var oe=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case V:e.return=ne(e.value,e.length);break;case $:return U([k(e,{value:c(e.value,"@","@"+B)})],n);case W:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return U([k(e,{props:[c(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return U([k(e,{props:[c(t,/:(plac\w+)/,":"+B+"input-$1")]}),k(e,{props:[c(t,/:(plac\w+)/,":-moz-$1")]}),k(e,{props:[c(t,/:(plac\w+)/,F+"input-$1")]})],n)}return""})}}],ie=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var n,i,a=e.stylisPlugins||oe,s={},l=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;rv});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=r(918),i=/[A-Z]|^ms/g,a=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!==typeof e},c=(0,o.A)(function(e){return s(e)?e:e.replace(i,"-$&").toLowerCase()}),d=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(a,function(e,t,r){return h={name:t,styles:r,next:h},t})}return 1===n[e]||s(e)||"number"!==typeof t||0===t?t:t+"px"};function u(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var o=r;if(1===o.anim)return h={name:o.name,styles:o.styles,next:h},o.name;var i=r;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)h={name:a.name,styles:a.styles,next:h},a=a.next;return i.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:h}}},5903(e,t,r){"use strict";r.d(t,{A:()=>m});var n=r(8168),o=r(581),i=r(6598),a=r(9436),s=r(1722),l=r(5043),c=r(918),d=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,u=(0,c.A)(function(e){return d.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),h=function(e){return"theme"!==e},p=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?u:h},v=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},f=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,s.SF)(t,r,n),(0,a.s)(function(){return(0,s.sk)(t,r,n)}),null},m=function e(t,r){var a,c,d=t.__emotion_real===t,u=d&&t.__emotion_base||t;void 0!==r&&(a=r.label,c=r.target);var h=v(t,r,d),m=h||p(u),g=!m("as");return function(){var y=arguments,b=d&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==a&&b.push("label:"+a+";"),null==y[0]||void 0===y[0].raw)b.push.apply(b,y);else{var x=y[0];b.push(x[0]);for(var w=y.length,S=1;Ss,s:()=>a});var o=r(5043),i=!!(n||(n=r.t(o,2))).useInsertionEffect&&(n||(n=r.t(o,2))).useInsertionEffect,a=i||function(e){return e()},s=i||o.useLayoutEffect},1722(e,t,r){"use strict";r.d(t,{Rk:()=>n,SF:()=>o,sk:()=>i});function n(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")}),n}var o=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},i=function(e,t,r){o(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}},4884(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6m0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20"}),"AccountCircleRounded")},2505(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add")},4783(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline")},9954(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M18 11c.7 0 1.37.1 2 .29V9l-8-6-8 6v12h7.68c-.43-.91-.68-1.92-.68-3 0-3.87 3.13-7 7-7"},"0"),(0,i.jsx)("path",{d:"M18 13c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m3 5.5h-2.5V21h-1v-2.5H15v-1h2.5V15h1v2.5H21z"},"1")],"AddHome")},5916(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"}),"AddRounded")},8143(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 11H7.83l4.88-4.88c.39-.39.39-1.03 0-1.42a.9959.9959 0 0 0-1.41 0l-6.59 6.59c-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L7.83 13H19c.55 0 1-.45 1-1s-.45-1-1-1"}),"ArrowBackRounded")},6502(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},8725(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M5 13h11.17l-4.88 4.88c-.39.39-.39 1.03 0 1.42.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41l-6.58-6.6a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L16.17 11H5c-.55 0-1 .45-1 1s.45 1 1 1"}),"ArrowForwardRounded")},4721(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoney")},4676(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"}),"AutoAwesome")},5371(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m19.46 8 .79-1.75L22 5.46c.39-.18.39-.73 0-.91l-1.75-.79L19.46 2c-.18-.39-.73-.39-.91 0l-.79 1.75-1.76.79c-.39.18-.39.73 0 .91l1.75.79.79 1.76c.18.39.74.39.92 0M11.5 9.5 9.91 6c-.35-.78-1.47-.78-1.82 0L6.5 9.5 3 11.09c-.78.36-.78 1.47 0 1.82l3.5 1.59L8.09 18c.36.78 1.47.78 1.82 0l1.59-3.5 3.5-1.59c.78-.36.78-1.47 0-1.82zm7.04 6.5-.79 1.75-1.75.79c-.39.18-.39.73 0 .91l1.75.79.79 1.76c.18.39.73.39.91 0l.79-1.75 1.76-.79c.39-.18.39-.73 0-.91l-1.75-.79-.79-1.76c-.18-.39-.74-.39-.92 0"}),"AutoAwesomeRounded")},7875(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4 9h4v11H4zm12 4h4v7h-4zm-6-9h4v16h-4z"}),"BarChart")},8846(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("circle",{cx:"7",cy:"7",r:"2"},"0"),(0,i.jsx)("path",{d:"M20 13V4.83C20 3.27 18.73 2 17.17 2c-.75 0-1.47.3-2 .83l-1.25 1.25c-.16-.05-.33-.08-.51-.08-.4 0-.77.12-1.08.32l2.76 2.76c.2-.31.32-.68.32-1.08 0-.18-.03-.34-.07-.51l1.25-1.25c.15-.15.36-.24.58-.24.46 0 .83.37.83.83V13h-6.85c-.3-.21-.57-.45-.82-.72l-1.4-1.55c-.19-.21-.43-.38-.69-.5-.31-.15-.65-.23-1-.23C6 10.01 5 11.01 5 12.25V13H2v6c0 1.1.9 2 2 2 0 .55.45 1 1 1h14c.55 0 1-.45 1-1 1.1 0 2-.9 2-2v-6z"},"1")],"Bathtub")},6541(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M21 10.78V8c0-1.65-1.35-3-3-3h-4c-.77 0-1.47.3-2 .78-.53-.48-1.23-.78-2-.78H6C4.35 5 3 6.35 3 8v2.78c-.61.55-1 1.34-1 2.22v6h2v-2h16v2h2v-6c0-.88-.39-1.67-1-2.22M14 7h4c.55 0 1 .45 1 1v2h-6V8c0-.55.45-1 1-1M5 8c0-.55.45-1 1-1h4c.55 0 1 .45 1 1v2H5z"}),"Bed")},9207(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11.65 3.46c.27-.71-.36-1.45-1.12-1.34-5.52.8-9.47 6.07-8.34 11.88.78 4.02 4.09 7.21 8.14 7.87 3.74.61 7.16-.87 9.32-3.44.48-.57.19-1.48-.55-1.62-6.02-1.15-9.68-7.54-7.45-13.35"}),"BedtimeRounded")},8563(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11 21h-1l1-7H7.5c-.58 0-.57-.32-.38-.66.19-.34.05-.08.07-.12C8.48 10.94 10.42 7.54 13 3h1l-1 7h3.5c.49 0 .56.33.47.51l-.07.15C12.96 17.55 11 21 11 21"}),"Bolt")},3021(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday")},8256(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"}),"CancelOutlined")},3425(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M20 6h-2.18c.11-.31.18-.65.18-1 0-1.66-1.34-3-3-3-1.05 0-1.96.54-2.5 1.35l-.5.67-.5-.68C10.96 2.54 10.05 2 9 2 7.34 2 6 3.34 6 5c0 .35.07.69.18 1H4c-1.11 0-1.99.89-1.99 2L2 19c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V8c0-1.11-.89-2-2-2m-5-2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1M9 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m11 15H4v-2h16zm0-5H4V9c0-.55.45-1 1-1h4.08L7.6 10.02c-.33.45-.23 1.08.22 1.4.44.32 1.07.22 1.39-.22L12 7.4l2.79 3.8c.32.44.95.54 1.39.22.45-.32.55-.95.22-1.4L14.92 8H19c.55 0 1 .45 1 1z"}),"CardGiftcardRounded")},1361(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m3.88-11.71L10 14.17l-1.88-1.88a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l2.59 2.59c.39.39 1.02.39 1.41 0L17.3 9.7c.39-.39.39-1.02 0-1.41-.39-.39-1.03-.39-1.42 0"}),"CheckCircleOutlineRounded")},9766(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2M9.29 16.29 5.7 12.7a.9959.9959 0 0 1 0-1.41c.39-.39 1.02-.39 1.41 0L10 14.17l6.88-6.88c.39-.39 1.02-.39 1.41 0 .39.39.39 1.02 0 1.41l-7.59 7.59c-.38.39-1.02.39-1.41 0"}),"CheckCircleRounded")},3525(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0z"}),"CheckRounded")},6670(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M9.29 6.71c-.39.39-.39 1.02 0 1.41L13.17 12l-3.88 3.88c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41L10.7 6.7c-.38-.38-1.02-.38-1.41.01"}),"ChevronRightRounded")},4802(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close")},3529(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M18.3 5.71a.9959.9959 0 0 0-1.41 0L12 10.59 7.11 5.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded")},8795(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows")},2645(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"Construction")},9913(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15 20H5V7c0-.55-.45-1-1-1s-1 .45-1 1v13c0 1.1.9 2 2 2h10c.55 0 1-.45 1-1s-.45-1-1-1m5-4V4c0-1.1-.9-2-2-2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2m-2 0H9V4h9z"}),"ContentCopyRounded")},4906(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m-1 14H5c-.55 0-1-.45-1-1v-5h16v5c0 .55-.45 1-1 1m1-10H4V6h16z"}),"CreditCardRounded")},2590(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11.01 3.05C6.51 3.54 3 7.36 3 12c0 4.97 4.03 9 9 9 4.63 0 8.45-3.5 8.95-8 .09-.79-.78-1.42-1.54-.95-.84.54-1.84.85-2.91.85-2.98 0-5.4-2.42-5.4-5.4 0-1.06.31-2.06.84-2.89.45-.67-.04-1.63-.93-1.56"}),"DarkModeRounded")},8094(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M3 13h8V3H3zm0 8h8v-6H3zm10 0h8V11h-8zm0-18v6h8V3z"}),"Dashboard")},7485(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4 13h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1m0 8h6c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1m10 0h6c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1M13 4v4c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1"}),"DashboardRounded")},4314(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2zM18 4h-2.5l-.71-.71c-.18-.18-.44-.29-.7-.29H9.91c-.26 0-.52.11-.7.29L8.5 4H6c-.55 0-1 .45-1 1s.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1"}),"DeleteRounded")},8415(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2M5 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5m0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5m5.8-10 2.4-2.4.8.8c1.3 1.3 3 2.1 5.1 2.1V9c-1.5 0-2.7-.6-3.6-1.5l-1.9-1.9c-.5-.4-1-.6-1.6-.6s-1.1.2-1.4.6L7.8 8.4c-.4.4-.6.9-.6 1.4 0 .6.2 1.1.6 1.4L11 14v5h2v-6.2zM19 12c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5m0 8.5c-1.9 0-3.5-1.6-3.5-3.5s1.6-3.5 3.5-3.5 3.5 1.6 3.5 3.5-1.6 3.5-3.5 3.5"}),"DirectionsBike")},8850(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4 16c0 .88.39 1.67 1 2.22V20c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h8v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1.78c.61-.55 1-1.34 1-2.22V6c0-3.5-3.58-4-8-4s-8 .5-8 4zm3.5 1c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17m9 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m1.5-6H6V6h12z"}),"DirectionsBus")},338(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16m11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5 11l1.5-4.5h11L19 11z"}),"DirectionsCar")},2843(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2c-4.42 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4M7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17m3.5-6H6V6h5zm5.5 6c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m1.5-6h-5V6h5z"}),"DirectionsTransit")},2573(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h12v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4m5.66 3H6.43c.61-.52 2.06-1 5.57-1 3.71 0 5.12.46 5.66 1M11 7v3H6V7zm2 0h5v3h-5zm3.5 10h-9c-.83 0-1.5-.67-1.5-1.5V12h12v3.5c0 .83-.67 1.5-1.5 1.5"},"0"),(0,i.jsx)("circle",{cx:"8.5",cy:"14.5",r:"1.5"},"1"),(0,i.jsx)("circle",{cx:"15.5",cy:"14.5",r:"1.5"},"2")],"DirectionsTransitOutlined")},6191(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2M9.8 8.9 7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6z"}),"DirectionsWalk")},8939(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M3 17.46v3.04c0 .28.22.5.5.5h3.04c.13 0 .26-.05.35-.15L17.81 9.94l-3.75-3.75L3.15 17.1c-.1.1-.15.22-.15.36M20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75z"}),"EditRounded")},321(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m-.4 4.25-7.07 4.42c-.32.2-.74.2-1.06 0L4.4 8.25c-.25-.16-.4-.43-.4-.72 0-.67.73-1.07 1.3-.72L12 11l6.7-4.19c.57-.35 1.3.05 1.3.72 0 .29-.15.56-.4.72"}),"EmailRounded")},7948(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutline")},1635(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 7c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1s-1-.45-1-1V8c0-.55.45-1 1-1m-.01-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8m1-3h-2v-2h2z"}),"ErrorOutlineRounded")},2090(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M17 12h-5v5h5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1zm3 18H5V8h14z"}),"Event")},5473(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess")},1337(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore")},8965(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m5.2494 8.0688 2.83-2.8269 14.1343 14.15-2.83 2.8269zm4.2363-4.2415 2.828-2.8289 5.6577 5.656-2.828 2.8289zM.9989 12.3147l2.8284-2.8285 5.6569 5.6569-2.8285 2.8284zM1 21h12v2H1z"}),"Gavel")},3602(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1"}),"HomeRounded")},9014(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M1 11v10h5v-6h4v6h5V11L8 6z"},"0"),(0,i.jsx)("path",{d:"M10 3v1.97l7 5V11h2v2h-2v2h2v2h-2v4h6V3zm9 6h-2V7h2z"},"1")],"HomeWork")},7030(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined")},1215(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M18 8h-2c-.55 0-1 .45-1 1s.45 1 1 1h2v11H6V10h2c.55 0 1-.45 1-1s-.45-1-1-1H6c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2"},"0"),(0,i.jsx)("path",{d:"M12 16c.55 0 1-.45 1-1V5h1.79c.45 0 .67-.54.35-.85l-2.79-2.79c-.2-.2-.51-.2-.71 0L8.85 4.15c-.31.31-.09.85.36.85H11v10c0 .55.45 1 1 1"},"1")],"IosShareRounded")},9576(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M20.59 10h-7.94c-.95-2.69-3.76-4.5-6.88-3.88-2.29.46-4.15 2.3-4.63 4.58C.32 14.58 3.26 18 7 18c2.61 0 4.83-1.67 5.65-4H13l1.29 1.29c.39.39 1.02.39 1.41 0L17 14l1.29 1.29c.39.39 1.03.39 1.42 0l2.59-2.61c.39-.39.39-1.03-.01-1.42l-.99-.97c-.2-.19-.45-.29-.71-.29M7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3"}),"KeyRounded")},2840(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M8.12 14.71 12 10.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 8.71a.9959.9959 0 0 0-1.41 0L6.7 13.3c-.39.39-.39 1.02 0 1.41.39.38 1.03.39 1.42 0"}),"KeyboardArrowUpRounded")},555(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch")},8248(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightModeRounded")},6270(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M14 9h2.87c1.46 0 2.8.98 3.08 2.42.31 1.64-.74 3.11-2.22 3.48l1.53 1.53c1.77-.91 2.95-2.82 2.7-5.01C21.68 8.86 19.37 7 16.79 7H14c-.55 0-1 .45-1 1s.45 1 1 1M3.51 3.51a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l2.64 2.64c-1.77.91-2.95 2.82-2.7 5.01C2.32 15.14 4.63 17 7.21 17H10c.55 0 1-.45 1-1s-.45-1-1-1H7.13c-1.46 0-2.8-.98-3.08-2.42-.31-1.64.75-3.11 2.22-3.48l2.12 2.12c-.23.19-.39.46-.39.78 0 .55.45 1 1 1h1.17l8.9 8.9c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41zM14 11l1.71 1.71c.18-.18.29-.43.29-.71 0-.55-.45-1-1-1z"}),"LinkOffRounded")},3395(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42M5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7"}),"LocalOffer")},1638(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2m-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z"}),"LockRounded")},1157(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M5 5h6c.55 0 1-.45 1-1s-.45-1-1-1H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h6c.55 0 1-.45 1-1s-.45-1-1-1H5z"},"0"),(0,i.jsx)("path",{d:"m20.65 11.65-2.79-2.79c-.32-.32-.86-.1-.86.35V11h-7c-.55 0-1 .45-1 1s.45 1 1 1h7v1.79c0 .45.54.67.85.35l2.79-2.79c.2-.19.2-.51.01-.7"},"1")],"LogoutRounded")},4804(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 3H5.01c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2H19c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-3.99 7.5c0 .83-.67 1.5-1.5 1.5.83 0 1.5.67 1.5 1.5V15c0 1.11-.9 2-2 2H10c-.55 0-1-.45-1-1s.45-1 1-1h3.01L13 13h-1c-.55 0-1-.45-1-1s.45-1 1-1h1l.01-2H10c-.55 0-.99-.45-.99-1s.44-1 .99-1h3.01c1.1 0 2 .9 2 2z"}),"Looks3Rounded")},7175(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-6 14c-.55 0-1-.45-1-1V9h-1c-.55 0-1-.45-1-1s.45-1 1-1h2c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1"}),"LooksOneRounded")},1485(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-4 8c0 1.1-.9 2-2 2h-2v2h3c.55 0 1 .45 1 1s-.45 1-1 1h-4c-.55 0-1-.45-1-1v-3c0-1.1.9-2 2-2h2V9h-3c-.55 0-1-.45-1-1s.45-1 1-1h3c1.1 0 2 .9 2 2z"}),"LooksTwoRounded")},206(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4 18h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1m0-5h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1s.45 1 1 1M3 7c0 .55.45 1 1 1h16c.55 0 1-.45 1-1s-.45-1-1-1H4c-.55 0-1 .45-1 1"}),"MenuRounded")},3042(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M15.11 12.45 14 10.24l-3.11 6.21c-.16.34-.51.55-.89.55s-.73-.21-.89-.55L7.38 13H2v5c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-5h-6c-.38 0-.73-.21-.89-.55"},"0"),(0,i.jsx)("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v5h6c.38 0 .73.21.89.55L10 13.76l3.11-6.21c.34-.68 1.45-.68 1.79 0L16.62 11H22V6c0-1.1-.9-2-2-2"},"1")],"MonitorHeart")},7385(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3zm-3-7V3.5L18.5 9z"}),"NoteAdd")},5310(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2m6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1z"}),"Notifications")},5283(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M18 16v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.68-1.5-1.51-1.5S10.5 3.17 10.5 4v.68C7.63 5.36 6 7.92 6 11v5l-1.3 1.29c-.63.63-.19 1.71.7 1.71h13.17c.89 0 1.34-1.08.71-1.71zm-6.01 6c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2M6.77 4.73c.42-.38.43-1.03.03-1.43-.38-.38-1-.39-1.39-.02C3.7 4.84 2.52 6.96 2.14 9.34c-.09.61.38 1.16 1 1.16.48 0 .9-.35.98-.83.3-1.94 1.26-3.67 2.65-4.94M18.6 3.28c-.4-.37-1.02-.36-1.4.02-.4.4-.38 1.04.03 1.42 1.38 1.27 2.35 3 2.65 4.94.07.48.49.83.98.83.61 0 1.09-.55.99-1.16-.38-2.37-1.55-4.48-3.25-6.05"}),"NotificationsActiveRounded")},567(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19.29 17.29 18 16v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-1.29 1.29c-.63.63-.19 1.71.7 1.71h13.17c.9 0 1.34-1.08.71-1.71M16 17H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5zm-4 5c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2"}),"NotificationsNoneRounded")},7991(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3m-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3m0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5m8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5"}),"People")},9837(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m-9-2V8c0-.55-.45-1-1-1s-1 .45-1 1v2H2c-.55 0-1 .45-1 1s.45 1 1 1h2v2c0 .55.45 1 1 1s1-.45 1-1v-2h2c.55 0 1-.45 1-1s-.45-1-1-1zm9 4c-2.67 0-8 1.34-8 4v1c0 .55.45 1 1 1h14c.55 0 1-.45 1-1v-1c0-2.66-5.33-4-8-4"}),"PersonAddRounded")},389(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5"}),"Place")},5040(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M8 6.82v10.36c0 .79.87 1.27 1.54.84l8.14-5.18c.62-.39.62-1.29 0-1.69L9.54 5.98C8.87 5.55 8 6.03 8 6.82"}),"PlayArrowRounded")},553(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)([(0,i.jsx)("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),(0,i.jsx)("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")],"Psychology")},916(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M17.65 6.35c-1.63-1.63-3.94-2.57-6.48-2.31-3.67.37-6.69 3.35-7.1 7.02C3.52 15.91 7.27 20 12 20c3.19 0 5.93-1.87 7.21-4.56.32-.67-.16-1.44-.9-1.44-.37 0-.72.2-.88.53-1.13 2.43-3.84 3.97-6.8 3.31-2.22-.49-4.01-2.3-4.48-4.52C5.31 9.44 8.26 6 12 6c1.66 0 3.14.69 4.22 1.78l-1.51 1.51c-.63.63-.19 1.71.7 1.71H19c.55 0 1-.45 1-1V6.41c0-.89-1.08-1.34-1.71-.71z"}),"RefreshRounded")},728(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M7 11v2h10v-2zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"RemoveCircleOutline")},6170(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 5V2L8 6l4 4V7c3.31 0 6 2.69 6 6 0 2.97-2.17 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93 0-4.42-3.58-8-8-8m-6 8c0-1.65.67-3.15 1.76-4.24L6.34 7.34C4.9 8.79 4 10.79 4 13c0 4.08 3.05 7.44 7 7.93v-2.02c-2.83-.48-5-2.94-5-5.91"}),"RestartAlt")},6300(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M5 13.18v4L12 21l7-3.82v-4L12 17zM12 3 1 9l11 6 9-4.91V17h2V9z"}),"School")},6360(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search")},71(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15.5 14h-.79l-.28-.27c1.2-1.4 1.82-3.31 1.48-5.34-.47-2.78-2.79-5-5.59-5.34-4.23-.52-7.79 3.04-7.27 7.27.34 2.8 2.56 5.12 5.34 5.59 2.03.34 3.94-.28 5.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"SearchRounded")},9758(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"}),"Security")},3972(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m21.41 11.41-8.83-8.83c-.37-.37-.88-.58-1.41-.58H4c-1.1 0-2 .9-2 2v7.17c0 .53.21 1.04.59 1.41l8.83 8.83c.78.78 2.05.78 2.83 0l7.17-7.17c.78-.78.78-2.04-.01-2.83M6.5 8C5.67 8 5 7.33 5 6.5S5.67 5 6.5 5 8 5.67 8 6.5 7.33 8 6.5 8"}),"Sell")},8628(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M19.5 12c0-.23-.01-.45-.03-.68l1.86-1.41c.4-.3.51-.86.26-1.3l-1.87-3.23c-.25-.44-.79-.62-1.25-.42l-2.15.91c-.37-.26-.76-.49-1.17-.68l-.29-2.31c-.06-.5-.49-.88-.99-.88h-3.73c-.51 0-.94.38-1 .88l-.29 2.31c-.41.19-.8.42-1.17.68l-2.15-.91c-.46-.2-1-.02-1.25.42L2.41 8.62c-.25.44-.14.99.26 1.3l1.86 1.41c-.02.22-.03.44-.03.67s.01.45.03.68l-1.86 1.41c-.4.3-.51.86-.26 1.3l1.87 3.23c.25.44.79.62 1.25.42l2.15-.91c.37.26.76.49 1.17.68l.29 2.31c.06.5.49.88.99.88h3.73c.5 0 .93-.38.99-.88l.29-2.31c.41-.19.8-.42 1.17-.68l2.15.91c.46.2 1 .02 1.25-.42l1.87-3.23c.25-.44.14-.99-.26-1.3l-1.86-1.41c.03-.23.04-.45.04-.68m-7.46 3.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5"}),"SettingsRounded")},1359(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m17.66 17.66-1.06 1.06-.71-.71 1.06-1.06-1.94-1.94-1.06 1.06-.71-.71 1.06-1.06-1.94-1.94-1.06 1.06-.71-.71 1.06-1.06L9.7 9.7l-1.06 1.06-.71-.71 1.06-1.06-1.94-1.94-1.06 1.06-.71-.71 1.06-1.06L4 4v14c0 1.1.9 2 2 2h14zM7 17v-5.76L12.76 17z"}),"SquareFoot")},6081(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"}),"SwapHoriz")},5874(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2m4 0v12h4V3z"}),"ThumbDown")},127(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M22 4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h2zM2.17 11.12c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22L10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97z"}),"ThumbDownAlt")},9278(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m10.89 18.28.57-2.89c.12-.59-.04-1.2-.42-1.66-.38-.46-.94-.73-1.54-.73H4v-1.08L6.57 6h8.09c.18 0 .34.16.34.34v7.84zM10 22l6.41-6.41c.38-.38.59-.89.59-1.42V6.34C17 5.05 15.95 4 14.66 4h-8.1c-.71 0-1.36.37-1.72.97l-2.67 6.15c-.11.25-.17.52-.17.8V13c0 1.1.9 2 2 2h5.5l-.92 4.65c-.05.22-.02.46.08.66.23.45.52.86.88 1.22zm10-7h2V4h-2c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1"}),"ThumbDownOffAlt")},9179(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M1 21h4V9H1zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73z"}),"ThumbUp")},3932(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M2 20h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1H2zm19.83-7.12c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22L14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.84C7 18.95 8.05 20 9.34 20h8.11c.7 0 1.36-.37 1.72-.97z"}),"ThumbUpAlt")},1007(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m13.11 5.72-.57 2.89c-.12.59.04 1.2.42 1.66.38.46.94.73 1.54.73H20v1.08L17.43 18H9.34c-.18 0-.34-.16-.34-.34V9.82zM14 2 7.59 8.41C7.21 8.79 7 9.3 7 9.83v7.83C7 18.95 8.05 20 9.34 20h8.1c.71 0 1.36-.37 1.72-.97l2.67-6.15c.11-.25.17-.52.17-.8V11c0-1.1-.9-2-2-2h-5.5l.92-4.65c.05-.22.02-.46-.08-.66-.23-.45-.52-.86-.88-1.22zM4 9H2v11h2c.55 0 1-.45 1-1v-9c0-.55-.45-1-1-1"}),"ThumbUpOffAlt")},4624(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 2c-4 0-8 .5-8 4v9.5C4 17.43 5.57 19 7.5 19L6 20.5v.5h2.23l2-2H14l2 2h2v-.5L16.5 19c1.93 0 3.5-1.57 3.5-3.5V6c0-3.5-3.58-4-8-4M7.5 17c-.83 0-1.5-.67-1.5-1.5S6.67 14 7.5 14s1.5.67 1.5 1.5S8.33 17 7.5 17m3.5-7H6V6h5zm2 0V6h5v4zm3.5 7c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"Train")},3881(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m16 18 2.29-2.29-4.88-4.88-4 4L2 7.41 3.41 6l6 6 4-4 6.3 6.29L22 12v6z"}),"TrendingDown")},7912(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"}),"TrendingUp")},3417(e,t,r){"use strict";var n=r(4994);t.A=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}n.default=e,r&&r.set(e,n)}(r(5043));var o=n(r(39)),i=r(579);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}t.A=(0,o.default)((0,i.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"}),"Twitter")},2328(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4 14h2c.55 0 1-.45 1-1v-2c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1m0 5h2c.55 0 1-.45 1-1v-2c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1M4 9h2c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1m5 5h11c.55 0 1-.45 1-1v-2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1m0 5h11c.55 0 1-.45 1-1v-2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v2c0 .55.45 1 1 1M8 6v2c0 .55.45 1 1 1h11c.55 0 1-.45 1-1V6c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1"}),"ViewListRounded")},3187(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"VisibilityRounded")},9626(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded")},4909(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded")},5941(e,t,r){"use strict";var n=r(4994);t.A=void 0;var o=n(r(39)),i=r(579);t.A=(0,o.default)((0,i.jsx)("path",{d:"M21.98 14H22zM5.35 13c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1v-2c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1v2c1.9 0 2.17-1 3.35-1m13.32 2c-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.1 1-3.34 1-1.24 0-1.38-1-3.33-1-1.95 0-2.1 1-3.34 1v2c1.95 0 2.11-1 3.34-1 1.24 0 1.38 1 3.33 1 1.95 0 2.1-1 3.34-1 1.19 0 1.42 1 3.33 1 1.94 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1v-2c-1.24 0-1.38-1-3.33-1M5.35 9c1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.42 1 3.33 1 1.95 0 2.09-1 3.33-1 1.19 0 1.4.98 3.31 1V8c-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1-1.95 0-2.09 1-3.33 1-1.19 0-1.42-1-3.33-1C3.38 7 3.24 8 2 8v2c1.9 0 2.17-1 3.35-1"}),"Water")},1430(e,t,r){"use strict";var n=r(4994);t.A=void 0;!function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=e[i]}n.default=e,r&&r.set(e,n)}(r(5043));var o=n(r(39)),i=r(579);function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}t.A=(0,o.default)((0,i.jsx)("path",{d:"M16.75 13.96c.25.13.41.2.46.3.06.11.04.61-.21 1.18-.2.56-1.24 1.1-1.7 1.12-.46.02-.47.36-2.96-.73-2.49-1.09-3.99-3.75-4.11-3.92-.12-.17-.96-1.38-.92-2.61.05-1.22.69-1.8.95-2.04.24-.26.51-.29.68-.26h.47c.15 0 .36-.06.55.45l.69 1.87c.06.13.1.28.01.44l-.27.41-.39.42c-.12.12-.26.25-.12.5.12.26.62 1.09 1.32 1.78.91.88 1.71 1.17 1.95 1.3.24.14.39.12.54-.04l.81-.94c.19-.25.35-.19.58-.11l1.67.88M12 2a10 10 0 0 1 10 10 10 10 0 0 1-10 10c-1.97 0-3.8-.57-5.35-1.55L2 22l1.55-4.65A9.969 9.969 0 0 1 2 12 10 10 0 0 1 12 2m0 2a8 8 0 0 0-8 8c0 1.72.54 3.31 1.46 4.61L4.5 19.5l2.89-.96A7.95 7.95 0 0 0 12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8z"}),"WhatsApp")},39(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n.createSvgIcon}});var n=r(837)},837(e,t,r){"use strict";r.r(t),r.d(t,{capitalize:()=>s,createChainedFunction:()=>l,createSvgIcon:()=>Or,debounce:()=>Fr,deprecatedPropType:()=>Nr,isMuiElement:()=>Br,mergeSlotProps:()=>rn,ownerDocument:()=>Wr,ownerWindow:()=>Vr,requirePropFactory:()=>$r,setRef:()=>Ur,unstable_ClassNameGenerator:()=>nn,unstable_memoTheme:()=>Cr,unstable_useEnhancedEffect:()=>Kr,unstable_useId:()=>Qr,unsupportedProp:()=>Yr,useControlled:()=>Xr,useEventCallback:()=>en,useForkRef:()=>tn});const n=e=>e,o=(()=>{let e=n;return{configure(t){e=t},generate:t=>e(t),reset(){e=n}}})();function i(e){const t=new URL("https://mui.com/production-error/?code=".concat(e));for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;ot.searchParams.append("args[]",e)),"Minified MUI error #".concat(e,"; visit ").concat(t," for the full message.")}function a(e){if("string"!==typeof e)throw new Error(i(7));return e.charAt(0).toUpperCase()+e.slice(1)}const s=a;const l=function(){for(var e=arguments.length,t=new Array(e),r=0;rnull==t?e:function(){for(var r=arguments.length,n=new Array(r),o=0;o{})};var c=r(9379),d=r(5043),u=r.t(d,2),h=r(45),p=r(5544),v=r(8387);var f=r(5903),m=r(6598);const g=[];function y(e){return g[0]=e,(0,m.J)(g)}var b,x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),A=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),E=Symbol.for("react.view_transition"),z=Symbol.for("react.client.reference");function D(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case x:switch(e=e.type){case S:case _:case k:case I:case P:case E:return e;default:switch(e=e&&e.$$typeof){case A:case j:case T:case R:case C:return e;default:return t}}case w:return t}}}function M(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function L(e){if(d.isValidElement(e)||b(e)||!M(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=L(e[r])}),t}function O(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const n=r.clone?(0,c.A)({},e):e;return M(e)&&M(t)&&Object.keys(t).forEach(o=>{d.isValidElement(t[o])||b(t[o])?n[o]=t[o]:M(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&M(e[o])?n[o]=O(e[o],t[o],r):r.clone?n[o]=M(t[o])?L(t[o]):t[o]:n[o]=t[o]}),n}b=function(e){return"string"===typeof e||"function"===typeof e||e===S||e===_||e===k||e===I||e===P||"object"===typeof e&&null!==e&&(e.$$typeof===T||e.$$typeof===R||e.$$typeof===A||e.$$typeof===C||e.$$typeof===j||e.$$typeof===z||void 0!==e.getModuleId)};const F=["values","unit","step"];function N(e){const t=e.values,r=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,n=e.unit,o=void 0===n?"px":n,i=e.step,a=void 0===i?5:i,s=(0,h.A)(e,F),l=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>(0,c.A)((0,c.A)({},e),{},{[t.key]:t.val}),{})})(r),d=Object.keys(l);function u(e){const t="number"===typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(o,")")}function p(e){const t="number"===typeof r[e]?r[e]:e;return"@media (max-width:".concat(t-a/100).concat(o,")")}function v(e,t){const n=d.indexOf(t);return"@media (min-width:".concat("number"===typeof r[e]?r[e]:e).concat(o,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[d[n]]?r[d[n]]:t)-a/100).concat(o,")")}return(0,c.A)({keys:d,values:l,up:u,down:p,between:v,only:function(e){return d.indexOf(e)+1e.startsWith("@container")).sort((e,t)=>{var r,n;const o=/min-width:\s*([0-9.]+)/;return+((null===(r=e.match(o))||void 0===r?void 0:r[1])||0)-+((null===(n=t.match(o))||void 0===n?void 0:n[1])||0)});return r.length?r.reduce((e,r)=>{const n=t[r];return delete e[r],e[r]=n,e},(0,c.A)({},t)):t}const H={borderRadius:4};const W={xs:0,sm:600,md:900,lg:1200,xl:1536},V={keys:["xs","sm","md","lg","xl"],up:e=>"@media (min-width:".concat(W[e],"px)")},$={containerQueries:e=>({up:t=>{let r="number"===typeof t?t:W[t]||t;return"number"===typeof r&&(r="".concat(r,"px")),e?"@container ".concat(e," (min-width:").concat(r,")"):"@container (min-width:".concat(r,")")}})};function U(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||V;return t.reduce((n,o,i)=>(n[e.up(e.keys[i])]=r(t[i]),n),{})}if("object"===typeof t){const e=n.breakpoints||V;return Object.keys(t).reduce((o,i)=>{if(function(e,t){return"@"===t||t.startsWith("@")&&(e.some(e=>t.startsWith("@".concat(e)))||!!t.match(/^@\d/))}(e.keys,i)){const e=function(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const n=(0,p.A)(r,3),o=n[1],i=n[2],a=Number.isNaN(+o)?o||0:+o;return e.containerQueries(i).up(a)}(n.containerQueries?n:$,i);e&&(o[e]=r(t[i],i))}else if(Object.keys(e.values||W).includes(i)){o[e.up(i)]=r(t[i],i)}else{const e=i;o[e]=t[e]}return o},{})}return r(t)}function q(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null===(e=t.keys)||void 0===e?void 0:e.reduce((e,r)=>(e[t.up(r)]={},e),{}))||{}}function K(e,t){return e.reduce((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e},t)}function G(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r="vars.".concat(t).split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=r)return r}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function J(e,t,r){let n,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||o:G(e,r)||o,t&&(n=t(n,o,e)),n}const Q=function(e){const t=e.prop,r=e.cssProperty,n=void 0===r?e.prop:r,o=e.themeKey,i=e.transform,s=e=>{if(null==e[t])return null;const r=e[t],s=G(e.theme,o)||{};return U(e,r,e=>{let r=J(s,i,e);return e===r&&"string"===typeof e&&(r=J(s,i,"".concat(t).concat("default"===e?"":a(e)),e)),!1===n?r:{[n]:r}})};return s.propTypes={},s.filterProps=[t],s};const Y=function(e,t){return t?O(e,t,{clone:!1}):e};const X={m:"margin",p:"padding"},Z={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ee={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},te=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}(e=>{if(e.length>2){if(!ee[e])return[e];e=ee[e]}const t=e.split(""),r=(0,p.A)(t,2),n=r[0],o=r[1],i=X[n],a=Z[o]||"";return Array.isArray(a)?a.map(e=>i+e):[i+a]}),re=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],ne=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],oe=[...re,...ne];function ie(e,t,r,n){var o;const i=null!==(o=G(e,t,!0))&&void 0!==o?o:r;return"number"===typeof i||"string"===typeof i?e=>"string"===typeof e?e:"string"===typeof i?"calc(".concat(e," * ").concat(i,")"):i*e:Array.isArray(i)?e=>{if("string"===typeof e)return e;const t=Math.abs(e);const r=i[t];return e>=0?r:"number"===typeof r?-r:"-".concat(r)}:"function"===typeof i?i:()=>{}}function ae(e){return ie(e,"spacing",8)}function se(e,t){return"string"===typeof t||null==t?t:e(t)}function le(e,t,r,n){if(!t.includes(r))return null;const o=function(e,t){return r=>e.reduce((e,n)=>(e[n]=se(t,r),e),{})}(te(r),n);return U(e,e[r],o)}function ce(e,t){const r=ae(e.theme);return Object.keys(e).map(n=>le(e,t,n,r)).reduce(Y,{})}function de(e){return ce(e,re)}function ue(e){return ce(e,ne)}function he(e){return ce(e,oe)}de.propTypes={},de.filterProps=re,ue.propTypes={},ue.filterProps=ne,he.propTypes={},he.filterProps=oe;function pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae({spacing:e});if(e.mui)return e;const r=function(){for(var e=arguments.length,r=new Array(e),n=0;n{const r=t(e);return"number"===typeof r?"".concat(r,"px"):r}).join(" ")};return r.mui=!0,r}const ve=function(){for(var e=arguments.length,t=new Array(e),r=0;r(t.filterProps.forEach(r=>{e[r]=t}),e),{}),o=e=>Object.keys(e).reduce((t,r)=>n[r]?Y(t,n[r](e)):t,{});return o.propTypes={},o.filterProps=t.reduce((e,t)=>e.concat(t.filterProps),[]),o};function fe(e){return"number"!==typeof e?e:"".concat(e,"px solid")}function me(e,t){return Q({prop:e,themeKey:"borders",transform:t})}const ge=me("border",fe),ye=me("borderTop",fe),be=me("borderRight",fe),xe=me("borderBottom",fe),we=me("borderLeft",fe),Se=me("borderColor"),ke=me("borderTopColor"),_e=me("borderRightColor"),Ce=me("borderBottomColor"),Ae=me("borderLeftColor"),je=me("outline",fe),Ie=me("outlineColor"),Pe=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=ie(e.theme,"shape.borderRadius",4),r=e=>({borderRadius:se(t,e)});return U(e,e.borderRadius,r)}return null};Pe.propTypes={},Pe.filterProps=["borderRadius"];ve(ge,ye,be,xe,we,Se,ke,_e,Ce,Ae,Pe,je,Ie);const Re=e=>{if(void 0!==e.gap&&null!==e.gap){const t=ie(e.theme,"spacing",8),r=e=>({gap:se(t,e)});return U(e,e.gap,r)}return null};Re.propTypes={},Re.filterProps=["gap"];const Te=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=ie(e.theme,"spacing",8),r=e=>({columnGap:se(t,e)});return U(e,e.columnGap,r)}return null};Te.propTypes={},Te.filterProps=["columnGap"];const Ee=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=ie(e.theme,"spacing",8),r=e=>({rowGap:se(t,e)});return U(e,e.rowGap,r)}return null};Ee.propTypes={},Ee.filterProps=["rowGap"];ve(Re,Te,Ee,Q({prop:"gridColumn"}),Q({prop:"gridRow"}),Q({prop:"gridAutoFlow"}),Q({prop:"gridAutoColumns"}),Q({prop:"gridAutoRows"}),Q({prop:"gridTemplateColumns"}),Q({prop:"gridTemplateRows"}),Q({prop:"gridTemplateAreas"}),Q({prop:"gridArea"}));function ze(e,t){return"grey"===t?t:e}ve(Q({prop:"color",themeKey:"palette",transform:ze}),Q({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:ze}),Q({prop:"backgroundColor",themeKey:"palette",transform:ze}));function De(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}const Me=Q({prop:"width",transform:De}),Le=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var r,n;const o=(null===(r=e.theme)||void 0===r||null===(r=r.breakpoints)||void 0===r||null===(r=r.values)||void 0===r?void 0:r[t])||W[t];return o?"px"!==(null===(n=e.theme)||void 0===n||null===(n=n.breakpoints)||void 0===n?void 0:n.unit)?{maxWidth:"".concat(o).concat(e.theme.breakpoints.unit)}:{maxWidth:o}:{maxWidth:De(t)}};return U(e,e.maxWidth,t)}return null};Le.filterProps=["maxWidth"];const Oe=Q({prop:"minWidth",transform:De}),Fe=Q({prop:"height",transform:De}),Ne=Q({prop:"maxHeight",transform:De}),Be=Q({prop:"minHeight",transform:De}),He=(Q({prop:"size",cssProperty:"width",transform:De}),Q({prop:"size",cssProperty:"height",transform:De}),ve(Me,Le,Oe,Fe,Ne,Be,Q({prop:"boxSizing"})),{border:{themeKey:"borders",transform:fe},borderTop:{themeKey:"borders",transform:fe},borderRight:{themeKey:"borders",transform:fe},borderBottom:{themeKey:"borders",transform:fe},borderLeft:{themeKey:"borders",transform:fe},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:fe},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Pe},color:{themeKey:"palette",transform:ze},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:ze},backgroundColor:{themeKey:"palette",transform:ze},p:{style:ue},pt:{style:ue},pr:{style:ue},pb:{style:ue},pl:{style:ue},px:{style:ue},py:{style:ue},padding:{style:ue},paddingTop:{style:ue},paddingRight:{style:ue},paddingBottom:{style:ue},paddingLeft:{style:ue},paddingX:{style:ue},paddingY:{style:ue},paddingInline:{style:ue},paddingInlineStart:{style:ue},paddingInlineEnd:{style:ue},paddingBlock:{style:ue},paddingBlockStart:{style:ue},paddingBlockEnd:{style:ue},m:{style:de},mt:{style:de},mr:{style:de},mb:{style:de},ml:{style:de},mx:{style:de},my:{style:de},margin:{style:de},marginTop:{style:de},marginRight:{style:de},marginBottom:{style:de},marginLeft:{style:de},marginX:{style:de},marginY:{style:de},marginInline:{style:de},marginInlineStart:{style:de},marginInlineEnd:{style:de},marginBlock:{style:de},marginBlockStart:{style:de},marginBlockEnd:{style:de},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Re},rowGap:{style:Ee},columnGap:{style:Te},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:De},maxWidth:{style:Le},minWidth:{transform:De},height:{transform:De},maxHeight:{transform:De},minHeight:{transform:De},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}});const We=function(){function e(e,t,r,n){const o={[e]:t,theme:r},i=n[e];if(!i)return{[e]:t};const s=i.cssProperty,l=void 0===s?e:s,c=i.themeKey,d=i.transform,u=i.style;if(null==t)return null;if("typography"===c&&"inherit"===t)return{[e]:t};const h=G(r,c)||{};if(u)return u(o);return U(o,t,t=>{let r=J(h,d,t);return t===r&&"string"===typeof t&&(r=J(h,d,"".concat(e).concat("default"===t?"":a(t)),t)),!1===l?r:{[l]:r}})}return function t(r){var n;const o=r||{},i=o.sx,a=o.theme,s=void 0===a?{}:a,l=o.nested;if(!i)return null;const c=null!==(n=s.unstable_sxConfig)&&void 0!==n?n:He;function d(r){let n=r;if("function"===typeof r)n=r(s);else if("object"!==typeof r)return r;if(!n)return null;const o=q(s.breakpoints),i=Object.keys(o);let a=o;return Object.keys(n).forEach(r=>{const o=function(e,t){return"function"===typeof e?e(t):e}(n[r],s);if(null!==o&&void 0!==o)if("object"===typeof o)if(c[r])a=Y(a,e(r,o,s,c));else{const e=U({theme:s},o,e=>({[r]:e}));!function(){for(var e=arguments.length,t=new Array(e),r=0;re.concat(Object.keys(t)),[]),o=new Set(n);return t.every(e=>o.size===Object.keys(e).length)}(e,o)?a=Y(a,e):a[r]=t({sx:o,theme:s,nested:!0})}else a=Y(a,e(r,o,s,c))}),!l&&s.modularCssLayers?{"@layer sx":B(s,K(i,a))}:B(s,K(i,a))}return Array.isArray(i)?i.map(d):d(i)}}();We.filterProps=["sx"];const Ve=We;function $e(e,t){const r=this;if(r.vars){var n;if(null===(n=r.colorSchemes)||void 0===n||!n[e]||"function"!==typeof r.getColorSchemeSelector)return{};let o=r.getColorSchemeSelector(e);return"&"===o?t:((o.includes("data-")||o.includes("."))&&(o="*:where(".concat(o.replace(/\s*&$/,""),") &")),{[o]:t})}return r.palette.mode===e?t:{}}const Ue=["breakpoints","palette","spacing","shape"];const qe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.breakpoints,r=void 0===t?{}:t,n=e.palette,o=void 0===n?{}:n,i=e.spacing,a=e.shape,s=void 0===a?{}:a,l=(0,h.A)(e,Ue),d=N(r),u=pe(i);let p=O({breakpoints:d,direction:"ltr",components:{},palette:(0,c.A)({mode:"light"},o),spacing:u,shape:(0,c.A)((0,c.A)({},H),s)},l);p=function(e){const t=(e,t)=>e.replace("@media",t?"@container ".concat(t):"@container");function r(r,n){r.up=function(){return t(e.breakpoints.up(...arguments),n)},r.down=function(){return t(e.breakpoints.down(...arguments),n)},r.between=function(){return t(e.breakpoints.between(...arguments),n)},r.only=function(){return t(e.breakpoints.only(...arguments),n)},r.not=function(){const r=t(e.breakpoints.not(...arguments),n);return r.includes("not all and")?r.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):r}}const n={},o=e=>(r(n,e),n);return r(o),(0,c.A)((0,c.A)({},e),{},{containerQueries:o})}(p),p.applyStyles=$e;for(var v=arguments.length,f=new Array(v>1?v-1:0),m=1;mO(e,t),p),p.unstable_sxConfig=(0,c.A)((0,c.A)({},He),null===l||void 0===l?void 0:l.unstable_sxConfig),p.unstable_sx=function(e){return Ve({sx:e,theme:this})},p},Ke=["variants"];function Ge(e){const t=e.variants,r=(0,h.A)(e,Ke),n={variants:t,style:y(r),isProcessed:!0};return n.style===r||t&&t.forEach(e=>{"function"!==typeof e.style&&(e.style=y(e.style))}),n}const Je=["variants"],Qe=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],Ye=qe();function Xe(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function Ze(e,t){return t&&e&&"object"===typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles="@layer ".concat(t,"{").concat(String(e.styles),"}")),e}function et(e,t,r){const n="function"===typeof t?t(e):t;if(Array.isArray(n))return n.flatMap(t=>et(e,t,r));if(Array.isArray(null===n||void 0===n?void 0:n.variants)){let t;if(n.isProcessed)t=r?Ze(n.style,r):n.style;else{n.variants;const e=(0,h.A)(n,Je);t=r?Ze(y(e),r):e}return tt(e,n.variants,[t],r)}return null!==n&&void 0!==n&&n.isProcessed?r?Ze(y(n.style),r):n.style:r?Ze(y(n),r):n}function tt(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;e:for(let a=0;a1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))};function ot(e){return nt(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function it(e){if(e.type)return e;if("#"===e.charAt(0))return it(function(e){e=e.slice(1);const t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map(e=>e+e)),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", "),")"):""}(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(i(9,e));let n,o=e.substring(t+1,e.length-1);if("color"===r){if(o=o.split(" "),n=o.shift(),4===o.length&&"/"===o[3].charAt(0)&&(o[3]=o[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(n))throw new Error(i(10,n))}else o=o.split(",");return o=o.map(e=>parseFloat(e)),{type:r,values:o,colorSpace:n}}const at=(e,t)=>{try{return(e=>{const t=it(e);return t.values.slice(0,3).map((e,r)=>t.type.includes("hsl")&&0!==r?"".concat(e,"%"):e).join(" ")})(e)}catch(r){return e}};function st(e){const t=e.type,r=e.colorSpace;let n=e.values;return t.includes("rgb")?n=n.map((e,t)=>t<3?parseInt(e,10):e):t.includes("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=t.includes("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(t,"(").concat(n,")")}function lt(e){const t=(e=it(e)).values,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return o-i*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const l=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),st({type:s,values:l})}function ct(e){let t="hsl"===(e=it(e)).type||"hsla"===e.type?it(lt(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function dt(e,t,r){try{return function(e,t){return e=it(e),t=ot(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,st(e)}(e,t)}catch(n){return e}}function ut(e,t){if(e=it(e),t=ot(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return st(e)}function ht(e,t,r){try{return ut(e,t)}catch(n){return e}}function pt(e,t){if(e=it(e),t=ot(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return st(e)}function vt(e,t,r){try{return pt(e,t)}catch(n){return e}}function ft(e,t,r){try{return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return ct(e)>.5?ut(e,t):pt(e,t)}(e,t)}catch(n){return e}}const mt={black:"#000",white:"#fff"},gt={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},yt={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},bt={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},xt={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},wt={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},St={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},kt={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},_t=["mode","contrastThreshold","tonalOffset"];function Ct(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:mt.white,default:mt.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const At=Ct();function jt(){return{text:{primary:mt.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:mt.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const It=jt();function Pt(e,t,r,n){const o=n.light||n,i=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=pt(e.main,o):"dark"===t&&(e.dark=ut(e.main,i)))}function Rt(e){const t=e.mode,r=void 0===t?"light":t,n=e.contrastThreshold,o=void 0===n?3:n,a=e.tonalOffset,s=void 0===a?.2:a,l=(0,h.A)(e,_t),d=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:wt[200],light:wt[50],dark:wt[400]}:{main:wt[700],light:wt[400],dark:wt[800]}}(r),u=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:yt[200],light:yt[50],dark:yt[400]}:{main:yt[500],light:yt[300],dark:yt[700]}}(r),p=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:bt[500],light:bt[300],dark:bt[700]}:{main:bt[700],light:bt[400],dark:bt[800]}}(r),v=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:St[400],light:St[300],dark:St[700]}:{main:St[700],light:St[500],dark:St[900]}}(r),f=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:kt[400],light:kt[300],dark:kt[700]}:{main:kt[800],light:kt[500],dark:kt[900]}}(r),m=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:xt[400],light:xt[300],dark:xt[700]}:{main:"#ed6c02",light:xt[500],dark:xt[900]}}(r);function g(e){const t=function(e,t){const r=ct(e),n=ct(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,It.text.primary)>=o?It.text.primary:At.text.primary;return t}const y=e=>{let t=e.color,r=e.name,n=e.mainShade,o=void 0===n?500:n,a=e.lightShade,l=void 0===a?300:a,d=e.darkShade,u=void 0===d?700:d;if(t=(0,c.A)({},t),!t.main&&t[o]&&(t.main=t[o]),!t.hasOwnProperty("main"))throw new Error(i(11,r?" (".concat(r,")"):"",o));if("string"!==typeof t.main)throw new Error(i(12,r?" (".concat(r,")"):"",JSON.stringify(t.main)));return Pt(t,"light",l,s),Pt(t,"dark",u,s),t.contrastText||(t.contrastText=g(t.main)),t};let b;"light"===r?b=Ct():"dark"===r&&(b=jt());return O((0,c.A)({common:(0,c.A)({},mt),mode:r,primary:y({color:d,name:"primary"}),secondary:y({color:u,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:y({color:p,name:"error"}),warning:y({color:m,name:"warning"}),info:y({color:v,name:"info"}),success:y({color:f,name:"success"}),grey:gt,contrastThreshold:o,getContrastText:g,augmentColor:y,tonalOffset:s},b),l)}var Tt=r(9526);function Et(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";function t(){for(var r=arguments.length,n=new Array(r),o=0;o1?n-1:0),i=1;i{const r=(0,p.A)(e,2),n=r[0],o=r[1];"object"===typeof o&&(t[n]="".concat(o.fontStyle?"".concat(o.fontStyle," "):"").concat(o.fontVariant?"".concat(o.fontVariant," "):"").concat(o.fontWeight?"".concat(o.fontWeight," "):"").concat(o.fontStretch?"".concat(o.fontStretch," "):"").concat(o.fontSize||"").concat(o.lineHeight?"/".concat(o.lineHeight," "):"").concat(o.fontFamily||""))}),t}const Dt=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=e;t.forEach((e,i)=>{i===t.length-1?Array.isArray(o)?o[Number(e)]=r:o&&"object"===typeof o&&(o[e]=r):o&&"object"===typeof o&&(o[e]||(o[e]=n.includes(e)?[]:{}),o=o[e])})};function Mt(e,t){const r=t||{},n=r.prefix,o=r.shouldSkipGeneratingVar,i={},a={},s={};var l,c;return l=(e,t,r)=>{if(("string"===typeof t||"number"===typeof t)&&(!o||!o(e,t))){const o="--".concat(n?"".concat(n,"-"):"").concat(e.join("-")),l=((e,t)=>"number"===typeof t?["lineHeight","fontWeight","opacity","zIndex"].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes("opacity")?t:"".concat(t,"px"):t)(e,t);Object.assign(i,{[o]:l}),Dt(a,e,"var(".concat(o,")"),r),Dt(s,e,"var(".concat(o,", ").concat(l,")"),r)}},c=e=>"vars"===e[0],function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Object.entries(t).forEach(t=>{let o=(0,p.A)(t,2),i=o[0],a=o[1];(!c||c&&!c([...r,i]))&&void 0!==a&&null!==a&&("object"===typeof a&&Object.keys(a).length>0?e(a,[...r,i],Array.isArray(a)?[...n,i]:n):l([...r,i],a,n))})}(e),{css:i,vars:a,varsWithDefaults:s}}const Lt=["colorSchemes","components","defaultColorScheme"];const Ot=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.getSelector,n=void 0===r?function(t,r){let n=i;"class"===i&&(n=".%s");"data"===i&&(n="[data-%s]");null!==i&&void 0!==i&&i.startsWith("data-")&&!i.includes("%s")&&(n="[".concat(i,'="%s"]'));if(t){if("media"===n){var o;if(e.defaultColorScheme===t)return":root";const n=(null===(o=s[t])||void 0===o||null===(o=o.palette)||void 0===o?void 0:o.mode)||t;return{["@media (prefers-color-scheme: ".concat(n,")")]:{":root":r}}}if(n)return e.defaultColorScheme===t?":root, ".concat(n.replace("%s",String(t))):n.replace("%s",String(t))}return":root"}:r,o=t.disableCssColorScheme,i=t.colorSchemeSelector,a=e.colorSchemes,s=void 0===a?{}:a,l=(e.components,e.defaultColorScheme),d=void 0===l?"light":l,u=Mt((0,h.A)(e,Lt),t),v=u.vars,f=u.css;let m=u.varsWithDefaults;const g={},y=s[d],b=(0,h.A)(s,[d].map(Tt.A));if(Object.entries(b||{}).forEach(e=>{let r=(0,p.A)(e,2),n=r[0];const o=Mt(r[1],t),i=o.vars,a=o.css,s=o.varsWithDefaults;m=O(m,s),g[n]={css:a,vars:i}}),y){const e=Mt(y,t),r=e.css,n=e.vars,o=e.varsWithDefaults;m=O(m,o),g[d]={css:r,vars:n}}return{vars:m,generateThemeVars:()=>{let e=(0,c.A)({},v);return Object.entries(g).forEach(t=>{let r=(0,p.A)(t,2)[1].vars;e=O(e,r)}),e},generateStyleSheets:()=>{const t=[],r=e.defaultColorScheme||"light";function i(e,r){Object.keys(r).length&&t.push("string"===typeof e?{[e]:(0,c.A)({},r)}:e)}i(n(void 0,(0,c.A)({},f)),f);const a=g[r],l=(0,h.A)(g,[r].map(Tt.A));if(a){var d;const e=a.css,t=null===(d=s[r])||void 0===d||null===(d=d.palette)||void 0===d?void 0:d.mode,l=!o&&t?(0,c.A)({colorScheme:t},e):(0,c.A)({},e);i(n(r,(0,c.A)({},l)),l)}return Object.entries(l).forEach(e=>{var t;let r=(0,p.A)(e,2),a=r[0],l=r[1].css;const d=null===(t=s[a])||void 0===t||null===(t=t.palette)||void 0===t?void 0:t.mode,u=!o&&d?(0,c.A)({colorScheme:d},l):(0,c.A)({},l);i(n(a,(0,c.A)({},u)),u)}),t}}};function Ft(e,t){return(0,c.A)({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const Nt=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];const Bt={textTransform:"uppercase"},Ht='"Roboto", "Helvetica", "Arial", sans-serif';function Wt(e,t){const r="function"===typeof t?t(e):t,n=r.fontFamily,o=void 0===n?Ht:n,i=r.fontSize,a=void 0===i?14:i,s=r.fontWeightLight,l=void 0===s?300:s,d=r.fontWeightRegular,u=void 0===d?400:d,p=r.fontWeightMedium,v=void 0===p?500:p,f=r.fontWeightBold,m=void 0===f?700:f,g=r.htmlFontSize,y=void 0===g?16:g,b=r.allVariants,x=r.pxToRem,w=(0,h.A)(r,Nt);const S=a/14,k=x||(e=>"".concat(e/y*S,"rem")),_=(e,t,r,n,i)=>{return(0,c.A)((0,c.A)((0,c.A)({fontFamily:o,fontWeight:e,fontSize:k(t),lineHeight:r},o===Ht?{letterSpacing:"".concat((a=n/t,Math.round(1e5*a)/1e5),"em")}:{}),i),b);var a},C={h1:_(l,96,1.167,-1.5),h2:_(l,60,1.2,-.5),h3:_(u,48,1.167,0),h4:_(u,34,1.235,.25),h5:_(u,24,1.334,0),h6:_(v,20,1.6,.15),subtitle1:_(u,16,1.75,.15),subtitle2:_(v,14,1.57,.1),body1:_(u,16,1.5,.15),body2:_(u,14,1.43,.15),button:_(v,14,1.75,.4,Bt),caption:_(u,12,1.66,.4),overline:_(u,12,2.66,1,Bt),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return O((0,c.A)({htmlFontSize:y,pxToRem:k,fontFamily:o,fontSize:a,fontWeightLight:l,fontWeightRegular:u,fontWeightMedium:v,fontWeightBold:m},C),w,{clone:!1})}function Vt(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}const $t=["none",Vt(0,2,1,-1,0,1,1,0,0,1,3,0),Vt(0,3,1,-2,0,2,2,0,0,1,5,0),Vt(0,3,3,-2,0,3,4,0,0,1,8,0),Vt(0,2,4,-1,0,4,5,0,0,1,10,0),Vt(0,3,5,-1,0,5,8,0,0,1,14,0),Vt(0,3,5,-1,0,6,10,0,0,1,18,0),Vt(0,4,5,-2,0,7,10,1,0,2,16,1),Vt(0,5,5,-3,0,8,10,1,0,3,14,2),Vt(0,5,6,-3,0,9,12,1,0,3,16,2),Vt(0,6,6,-3,0,10,14,1,0,4,18,3),Vt(0,6,7,-4,0,11,15,1,0,4,20,3),Vt(0,7,8,-4,0,12,17,2,0,5,22,4),Vt(0,7,8,-4,0,13,19,2,0,5,24,4),Vt(0,7,9,-4,0,14,21,2,0,5,26,4),Vt(0,8,9,-5,0,15,22,2,0,6,28,5),Vt(0,8,10,-5,0,16,24,2,0,6,30,5),Vt(0,8,11,-5,0,17,26,2,0,6,32,5),Vt(0,9,11,-5,0,18,28,2,0,7,34,6),Vt(0,9,12,-6,0,19,29,2,0,7,36,6),Vt(0,10,13,-6,0,20,31,3,0,8,38,7),Vt(0,10,13,-6,0,21,33,3,0,8,40,7),Vt(0,10,14,-6,0,22,35,3,0,8,42,7),Vt(0,11,14,-7,0,23,36,3,0,9,44,8),Vt(0,11,15,-7,0,24,38,3,0,9,46,8)],Ut=["duration","easing","delay"],qt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Kt={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Gt(e){return"".concat(Math.round(e),"ms")}function Jt(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function Qt(e){const t=(0,c.A)((0,c.A)({},qt),e.easing),r=(0,c.A)((0,c.A)({},Kt),e.duration);return(0,c.A)((0,c.A)({getAutoHeightDuration:Jt,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=n.duration,i=void 0===o?r.standard:o,a=n.easing,s=void 0===a?t.easeInOut:a,l=n.delay,c=void 0===l?0:l;(0,h.A)(n,Ut);return(Array.isArray(e)?e:[e]).map(e=>"".concat(e," ").concat("string"===typeof i?i:Gt(i)," ").concat(s," ").concat("string"===typeof c?c:Gt(c))).join(",")}},e),{},{easing:t,duration:r})}const Yt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Xt(e){return M(e)||"undefined"===typeof e||"string"===typeof e||"boolean"===typeof e||"number"===typeof e||Array.isArray(e)}function Zt(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,c.A)({},e);return function e(t){const r=Object.entries(t);for(let n=0;n0&&void 0!==arguments[0]?arguments[0]:{};e.breakpoints;const t=e.mixins,r=void 0===t?{}:t,n=(e.spacing,e.palette),o=void 0===n?{}:n,a=e.transitions,s=void 0===a?{}:a,l=e.typography,d=void 0===l?{}:l,u=(e.shape,(0,h.A)(e,er));if(e.vars&&void 0===e.generateThemeVars)throw new Error(i(20));const p=Rt(o),v=qe(e);let f=O(v,{mixins:Ft(v.breakpoints,r),palette:p,shadows:$t.slice(),typography:Wt(p,d),transitions:Qt(s),zIndex:(0,c.A)({},Yt)});f=O(f,u);for(var m=arguments.length,g=new Array(m>1?m-1:0),y=1;yO(e,t),f),f.unstable_sxConfig=(0,c.A)((0,c.A)({},He),null===u||void 0===u?void 0:u.unstable_sxConfig),f.unstable_sx=function(e){return Ve({sx:e,theme:this})},f.toRuntimeSource=Zt,f}const rr=tr;const nr=["palette","opacity","overlays"],or=[...Array(25)].map((e,t)=>{if(0===t)return"none";const r=function(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(10*t)/1e3}(t);return"linear-gradient(rgba(255 255 255 / ".concat(r,"), rgba(255 255 255 / ").concat(r,"))")});function ir(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function ar(e){return"dark"===e?or:[]}function sr(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!(null===(t=e[1])||void 0===t||!t.match(/(mode|contrastThreshold|tonalOffset)/))}const lr=e=>[...[...Array(25)].map((t,r)=>"--".concat(e?"".concat(e,"-"):"","overlays-").concat(r)),"--".concat(e?"".concat(e,"-"):"","palette-AppBar-darkBg"),"--".concat(e?"".concat(e,"-"):"","palette-AppBar-darkColor")],cr=e=>(t,r)=>{const n=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if("class"===o&&(i=".%s"),"data"===o&&(i="[data-%s]"),null!==o&&void 0!==o&&o.startsWith("data-")&&!o.includes("%s")&&(i="[".concat(o,'="%s"]')),e.defaultColorScheme===t){if("dark"===t){const o={};return lr(e.cssVarPrefix).forEach(e=>{o[e]=r[e],delete r[e]}),"media"===i?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:o}}:i?{[i.replace("%s",t)]:o,["".concat(n,", ").concat(i.replace("%s",t))]:r}:{[n]:(0,c.A)((0,c.A)({},r),o)}}if(i&&"media"!==i)return"".concat(n,", ").concat(i.replace("%s",String(t)))}else if(t){if("media"===i)return{["@media (prefers-color-scheme: ".concat(String(t),")")]:{[n]:r}};if(i)return i.replace("%s",String(t))}return n};r.dn(cr);const dr=["palette"],ur=["colorSchemes","defaultColorScheme","disableCssColorScheme","cssVarPrefix","shouldSkipGeneratingVar","colorSchemeSelector","rootSelector"];function hr(e,t,r){!e[t]&&r&&(e[t]=r)}function pr(e){return"string"===typeof e&&e.startsWith("hsl")?lt(e):e}function vr(e,t){"".concat(t,"Channel")in e||(e["".concat(t,"Channel")]=at(pr(e[t]),("MUI: Can't create `palette.".concat(t,"Channel` because `palette.").concat(t,"` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()."),"To suppress this warning, you need to explicitly provide the `palette.".concat(t,'Channel` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.'))))}const fr=e=>{try{return e()}catch(t){}};function mr(e,t,r,n){var o,i,a;if(!t)return;t=!0===t?{}:t;const s="dark"===n?"dark":"light";var l;if(!r)return void(e[n]=function(e){const t=e.palette,r=void 0===t?{mode:"light"}:t,n=e.opacity,o=e.overlays,i=(0,h.A)(e,nr),a=Rt(r);return(0,c.A)({palette:a,opacity:(0,c.A)((0,c.A)({},ir(a.mode)),n),overlays:o||ar(a.mode)},i)}((0,c.A)((0,c.A)({},t),{},{palette:(0,c.A)({mode:s},null===(l=t)||void 0===l?void 0:l.palette)})));const d=rr((0,c.A)((0,c.A)({},r),{},{palette:(0,c.A)({mode:s},null===(o=t)||void 0===o?void 0:o.palette)})),u=d.palette,p=(0,h.A)(d,dr);return e[n]=(0,c.A)((0,c.A)({},t),{},{palette:u,opacity:(0,c.A)((0,c.A)({},ir(s)),null===(i=t)||void 0===i?void 0:i.opacity),overlays:(null===(a=t)||void 0===a?void 0:a.overlays)||ar(s)}),p}function gr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.colorSchemes,r=void 0===t?{light:!0}:t,n=e.defaultColorScheme,o=e.disableCssColorScheme,a=void 0!==o&&o,s=e.cssVarPrefix,l=void 0===s?"mui":s,d=e.shouldSkipGeneratingVar,u=void 0===d?sr:d,v=e.colorSchemeSelector,f=void 0===v?r.light&&r.dark?"media":void 0:v,m=e.rootSelector,g=void 0===m?":root":m,y=(0,h.A)(e,ur),b=Object.keys(r)[0],x=n||(r.light&&"light"!==b?"light":b),w=function(){return Et(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mui")}(l),S=r[x],k=r.light,_=r.dark,C=(0,h.A)(r,[x,"light","dark"].map(Tt.A)),A=(0,c.A)({},C);let j=S;if(("dark"===x&&!("dark"in r)||"light"===x&&!("light"in r))&&(j=!0),!j)throw new Error(i(21,x));const I=mr(A,j,y,x);k&&!A.light&&mr(A,k,void 0,"light"),_&&!A.dark&&mr(A,_,void 0,"dark");let P=(0,c.A)((0,c.A)({defaultColorScheme:x},I),{},{cssVarPrefix:l,colorSchemeSelector:f,rootSelector:g,getCssVar:w,colorSchemes:A,font:(0,c.A)((0,c.A)({},zt(I.typography)),I.font),spacing:(R=y.spacing,"number"===typeof R?"".concat(R,"px"):"string"===typeof R||"function"===typeof R||Array.isArray(R)?R:"8px")});var R;Object.keys(P.colorSchemes).forEach(e=>{const t=P.colorSchemes[e].palette,r=e=>{const r=e.split("-"),n=r[1],o=r[2];return w(e,t[n][o])};var n;if("light"===t.mode&&(hr(t.common,"background","#fff"),hr(t.common,"onBackground","#000")),"dark"===t.mode&&(hr(t.common,"background","#000"),hr(t.common,"onBackground","#fff")),n=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach(e=>{n[e]||(n[e]={})}),"light"===t.mode){hr(t.Alert,"errorColor",ht(t.error.light,.6)),hr(t.Alert,"infoColor",ht(t.info.light,.6)),hr(t.Alert,"successColor",ht(t.success.light,.6)),hr(t.Alert,"warningColor",ht(t.warning.light,.6)),hr(t.Alert,"errorFilledBg",r("palette-error-main")),hr(t.Alert,"infoFilledBg",r("palette-info-main")),hr(t.Alert,"successFilledBg",r("palette-success-main")),hr(t.Alert,"warningFilledBg",r("palette-warning-main")),hr(t.Alert,"errorFilledColor",fr(()=>t.getContrastText(t.error.main))),hr(t.Alert,"infoFilledColor",fr(()=>t.getContrastText(t.info.main))),hr(t.Alert,"successFilledColor",fr(()=>t.getContrastText(t.success.main))),hr(t.Alert,"warningFilledColor",fr(()=>t.getContrastText(t.warning.main))),hr(t.Alert,"errorStandardBg",vt(t.error.light,.9)),hr(t.Alert,"infoStandardBg",vt(t.info.light,.9)),hr(t.Alert,"successStandardBg",vt(t.success.light,.9)),hr(t.Alert,"warningStandardBg",vt(t.warning.light,.9)),hr(t.Alert,"errorIconColor",r("palette-error-main")),hr(t.Alert,"infoIconColor",r("palette-info-main")),hr(t.Alert,"successIconColor",r("palette-success-main")),hr(t.Alert,"warningIconColor",r("palette-warning-main")),hr(t.AppBar,"defaultBg",r("palette-grey-100")),hr(t.Avatar,"defaultBg",r("palette-grey-400")),hr(t.Button,"inheritContainedBg",r("palette-grey-300")),hr(t.Button,"inheritContainedHoverBg",r("palette-grey-A100")),hr(t.Chip,"defaultBorder",r("palette-grey-400")),hr(t.Chip,"defaultAvatarColor",r("palette-grey-700")),hr(t.Chip,"defaultIconColor",r("palette-grey-700")),hr(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),hr(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),hr(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),hr(t.LinearProgress,"primaryBg",vt(t.primary.main,.62)),hr(t.LinearProgress,"secondaryBg",vt(t.secondary.main,.62)),hr(t.LinearProgress,"errorBg",vt(t.error.main,.62)),hr(t.LinearProgress,"infoBg",vt(t.info.main,.62)),hr(t.LinearProgress,"successBg",vt(t.success.main,.62)),hr(t.LinearProgress,"warningBg",vt(t.warning.main,.62)),hr(t.Skeleton,"bg","rgba(".concat(r("palette-text-primaryChannel")," / 0.11)")),hr(t.Slider,"primaryTrack",vt(t.primary.main,.62)),hr(t.Slider,"secondaryTrack",vt(t.secondary.main,.62)),hr(t.Slider,"errorTrack",vt(t.error.main,.62)),hr(t.Slider,"infoTrack",vt(t.info.main,.62)),hr(t.Slider,"successTrack",vt(t.success.main,.62)),hr(t.Slider,"warningTrack",vt(t.warning.main,.62));const e=ft(t.background.default,.8);hr(t.SnackbarContent,"bg",e),hr(t.SnackbarContent,"color",fr(()=>t.getContrastText(e))),hr(t.SpeedDialAction,"fabHoverBg",ft(t.background.paper,.15)),hr(t.StepConnector,"border",r("palette-grey-400")),hr(t.StepContent,"border",r("palette-grey-400")),hr(t.Switch,"defaultColor",r("palette-common-white")),hr(t.Switch,"defaultDisabledColor",r("palette-grey-100")),hr(t.Switch,"primaryDisabledColor",vt(t.primary.main,.62)),hr(t.Switch,"secondaryDisabledColor",vt(t.secondary.main,.62)),hr(t.Switch,"errorDisabledColor",vt(t.error.main,.62)),hr(t.Switch,"infoDisabledColor",vt(t.info.main,.62)),hr(t.Switch,"successDisabledColor",vt(t.success.main,.62)),hr(t.Switch,"warningDisabledColor",vt(t.warning.main,.62)),hr(t.TableCell,"border",vt(dt(t.divider,1),.88)),hr(t.Tooltip,"bg",dt(t.grey[700],.92))}if("dark"===t.mode){hr(t.Alert,"errorColor",vt(t.error.light,.6)),hr(t.Alert,"infoColor",vt(t.info.light,.6)),hr(t.Alert,"successColor",vt(t.success.light,.6)),hr(t.Alert,"warningColor",vt(t.warning.light,.6)),hr(t.Alert,"errorFilledBg",r("palette-error-dark")),hr(t.Alert,"infoFilledBg",r("palette-info-dark")),hr(t.Alert,"successFilledBg",r("palette-success-dark")),hr(t.Alert,"warningFilledBg",r("palette-warning-dark")),hr(t.Alert,"errorFilledColor",fr(()=>t.getContrastText(t.error.dark))),hr(t.Alert,"infoFilledColor",fr(()=>t.getContrastText(t.info.dark))),hr(t.Alert,"successFilledColor",fr(()=>t.getContrastText(t.success.dark))),hr(t.Alert,"warningFilledColor",fr(()=>t.getContrastText(t.warning.dark))),hr(t.Alert,"errorStandardBg",ht(t.error.light,.9)),hr(t.Alert,"infoStandardBg",ht(t.info.light,.9)),hr(t.Alert,"successStandardBg",ht(t.success.light,.9)),hr(t.Alert,"warningStandardBg",ht(t.warning.light,.9)),hr(t.Alert,"errorIconColor",r("palette-error-main")),hr(t.Alert,"infoIconColor",r("palette-info-main")),hr(t.Alert,"successIconColor",r("palette-success-main")),hr(t.Alert,"warningIconColor",r("palette-warning-main")),hr(t.AppBar,"defaultBg",r("palette-grey-900")),hr(t.AppBar,"darkBg",r("palette-background-paper")),hr(t.AppBar,"darkColor",r("palette-text-primary")),hr(t.Avatar,"defaultBg",r("palette-grey-600")),hr(t.Button,"inheritContainedBg",r("palette-grey-800")),hr(t.Button,"inheritContainedHoverBg",r("palette-grey-700")),hr(t.Chip,"defaultBorder",r("palette-grey-700")),hr(t.Chip,"defaultAvatarColor",r("palette-grey-300")),hr(t.Chip,"defaultIconColor",r("palette-grey-300")),hr(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),hr(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),hr(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),hr(t.LinearProgress,"primaryBg",ht(t.primary.main,.5)),hr(t.LinearProgress,"secondaryBg",ht(t.secondary.main,.5)),hr(t.LinearProgress,"errorBg",ht(t.error.main,.5)),hr(t.LinearProgress,"infoBg",ht(t.info.main,.5)),hr(t.LinearProgress,"successBg",ht(t.success.main,.5)),hr(t.LinearProgress,"warningBg",ht(t.warning.main,.5)),hr(t.Skeleton,"bg","rgba(".concat(r("palette-text-primaryChannel")," / 0.13)")),hr(t.Slider,"primaryTrack",ht(t.primary.main,.5)),hr(t.Slider,"secondaryTrack",ht(t.secondary.main,.5)),hr(t.Slider,"errorTrack",ht(t.error.main,.5)),hr(t.Slider,"infoTrack",ht(t.info.main,.5)),hr(t.Slider,"successTrack",ht(t.success.main,.5)),hr(t.Slider,"warningTrack",ht(t.warning.main,.5));const e=ft(t.background.default,.98);hr(t.SnackbarContent,"bg",e),hr(t.SnackbarContent,"color",fr(()=>t.getContrastText(e))),hr(t.SpeedDialAction,"fabHoverBg",ft(t.background.paper,.15)),hr(t.StepConnector,"border",r("palette-grey-600")),hr(t.StepContent,"border",r("palette-grey-600")),hr(t.Switch,"defaultColor",r("palette-grey-300")),hr(t.Switch,"defaultDisabledColor",r("palette-grey-600")),hr(t.Switch,"primaryDisabledColor",ht(t.primary.main,.55)),hr(t.Switch,"secondaryDisabledColor",ht(t.secondary.main,.55)),hr(t.Switch,"errorDisabledColor",ht(t.error.main,.55)),hr(t.Switch,"infoDisabledColor",ht(t.info.main,.55)),hr(t.Switch,"successDisabledColor",ht(t.success.main,.55)),hr(t.Switch,"warningDisabledColor",ht(t.warning.main,.55)),hr(t.TableCell,"border",ht(dt(t.divider,1),.68)),hr(t.Tooltip,"bg",dt(t.grey[700],.92))}vr(t.background,"default"),vr(t.background,"paper"),vr(t.common,"background"),vr(t.common,"onBackground"),vr(t,"divider"),Object.keys(t).forEach(e=>{const r=t[e];"tonalOffset"!==e&&r&&"object"===typeof r&&(r.main&&hr(t[e],"mainChannel",at(pr(r.main))),r.light&&hr(t[e],"lightChannel",at(pr(r.light))),r.dark&&hr(t[e],"darkChannel",at(pr(r.dark))),r.contrastText&&hr(t[e],"contrastTextChannel",at(pr(r.contrastText))),"text"===e&&(vr(t[e],"primary"),vr(t[e],"secondary")),"action"===e&&(r.active&&vr(t[e],"active"),r.selected&&vr(t[e],"selected")))})});for(var T=arguments.length,E=new Array(T>1?T-1:0),z=1;zO(e,t),P);const D={prefix:l,disableCssColorScheme:a,shouldSkipGeneratingVar:u,getSelector:cr(P)},M=Ot(P,D),L=M.vars,F=M.generateThemeVars,N=M.generateStyleSheets;return P.vars=L,Object.entries(P.colorSchemes[P.defaultColorScheme]).forEach(e=>{let t=(0,p.A)(e,2),r=t[0],n=t[1];P[r]=n}),P.generateThemeVars=F,P.generateStyleSheets=N,P.generateSpacing=function(){return pe(y.spacing,ae(this))},P.getColorSchemeSelector=function(e){return function(t){return"media"===e?"@media (prefers-color-scheme: ".concat(t,")"):e?e.startsWith("data-")&&!e.includes("%s")?"[".concat(e,'="').concat(t,'"] &'):"class"===e?".".concat(t," &"):"data"===e?"[data-".concat(t,"] &"):"".concat(e.replace("%s",t)," &"):"&"}}(f),P.spacing=P.generateSpacing(),P.shouldSkipGeneratingVar=u,P.unstable_sxConfig=(0,c.A)((0,c.A)({},He),null===y||void 0===y?void 0:y.unstable_sxConfig),P.unstable_sx=function(e){return Ve({sx:e,theme:this})},P.toRuntimeSource=Zt,P}const yr=["palette","cssVariables","colorSchemes","defaultColorScheme"];function br(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]=(0,c.A)((0,c.A)({},!0!==r&&r),{},{palette:Rt((0,c.A)((0,c.A)({},!0===r?{}:r.palette),{},{mode:t}))}))}const xr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.palette,r=e.cssVariables,n=void 0!==r&&r,o=e.colorSchemes,i=void 0===o?t?void 0:{light:!0}:o,a=e.defaultColorScheme,s=void 0===a?null===t||void 0===t?void 0:t.mode:a,l=(0,h.A)(e,yr),d=s||"light",u=null===i||void 0===i?void 0:i[d],p=(0,c.A)((0,c.A)({},i),t?{[d]:(0,c.A)((0,c.A)({},"boolean"!==typeof u&&u),{},{palette:t})}:void 0);for(var v=arguments.length,f=new Array(v>1?v-1:0),m=1;m0&&void 0!==arguments[0]?arguments[0]:{};const t=e.themeId,r=e.defaultTheme,n=void 0===r?Ye:r,o=e.rootShouldForwardProp,i=void 0===o?Xe:o,a=e.slotShouldForwardProp,s=void 0===a?Xe:a;function l(e){!function(e,t,r){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?r:e.theme[t]||e.theme}(e,t,n)}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}(e,e=>e.filter(e=>e!==Ve));const r=t.name,n=t.slot,o=t.skipVariantsResolver,a=t.skipSx,d=t.overridesResolver,u=void 0===d?(m=(v=n)?v.charAt(0).toLowerCase()+v.slice(1):v)?(e,t)=>t[m]:null:d,p=(0,h.A)(t,Qe);var v,m;const g=r&&r.startsWith("Mui")||n?"components":"custom",y=void 0!==o?o:n&&"Root"!==n&&"root"!==n||!1,b=a||!1;let x=Xe;"Root"===n||"root"===n?x=i:n?x=s:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(x=void 0);const w=function(e,t){return(0,f.A)(e,t)}(e,(0,c.A)({shouldForwardProp:x,label:rt(r,n)},p)),S=e=>{if(e.__emotion_real===e)return e;if("function"===typeof e)return function(t){return et(t,e,t.theme.modularCssLayers?g:void 0)};if(M(e)){const t=Ge(e);return function(e){return t.variants?et(e,t,e.theme.modularCssLayers?g:void 0):e.theme.modularCssLayers?Ze(t.style,g):t.style}}return e},k=function(){const t=[];for(var n=arguments.length,o=new Array(n),i=0;iwr(e)&&"classes"!==e}),kr=Sr,_r={theme:void 0};const Cr=function(e){let t,r;return function(n){let o=t;return void 0!==o&&n.theme===r||(_r.theme=n.theme,o=Ge(e(_r)),t=o,r=n.theme),o}};function Ar(e,t){const r=(0,c.A)({},t);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n;if("components"===o||"slots"===o)r[o]=(0,c.A)((0,c.A)({},e[o]),r[o]);else if("componentsProps"===o||"slotProps"===o){const n=e[o],i=t[o];if(i)if(n){r[o]=(0,c.A)({},i);for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const t=e;r[o][t]=Ar(n[t],i[t])}}else r[o]=i;else r[o]=n||{}}else void 0===r[o]&&(r[o]=e[o])}return r}var jr=r(579);const Ir=d.createContext(void 0);function Pr(e){return function(e){const t=e.theme,r=e.name,n=e.props;if(!t||!t.components||!t.components[r])return n;const o=t.components[r];return o.defaultProps?Ar(o.defaultProps,n):o.styleOverrides||o.variants?n:Ar(o,n)}({props:e.props,name:e.name,theme:{components:d.useContext(Ir)}})}const Rr={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Tr(e,t){const r=Rr[t];return r?"".concat(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui","-").concat(r):"".concat(o.generate(e),"-").concat(t)}function Er(e){return Tr("MuiSvgIcon",e)}!function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const n={};t.forEach(t=>{n[t]=Tr(e,t,r)})}("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const zr=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],Dr=kr("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const r=e.ownerState;return[t.root,"inherit"!==r.color&&t["color".concat(s(r.color))],t["fontSize".concat(s(r.fontSize))]]}})(Cr(e=>{var t,r,n,o,i,a,s,l,c,d,u,h,v,f,m;let g=e.theme;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:null===(t=g.transitions)||void 0===t||null===(r=t.create)||void 0===r?void 0:r.call(t,"fill",{duration:null===(n=(null!==(o=g.vars)&&void 0!==o?o:g).transitions)||void 0===n||null===(n=n.duration)||void 0===n?void 0:n.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:(null===(i=g.typography)||void 0===i||null===(a=i.pxToRem)||void 0===a?void 0:a.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:(null===(s=g.typography)||void 0===s||null===(l=s.pxToRem)||void 0===l?void 0:l.call(s,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:(null===(c=g.typography)||void 0===c||null===(d=c.pxToRem)||void 0===d?void 0:d.call(c,35))||"2.1875rem"}},...Object.entries((null!==(u=g.vars)&&void 0!==u?u:g).palette).filter(e=>{let t=(0,p.A)(e,2)[1];return t&&t.main}).map(e=>{var t,r;let n=(0,p.A)(e,1)[0];return{props:{color:n},style:{color:null===(t=(null!==(r=g.vars)&&void 0!==r?r:g).palette)||void 0===t||null===(t=t[n])||void 0===t?void 0:t.main}}}),{props:{color:"action"},style:{color:null===(h=(null!==(v=g.vars)&&void 0!==v?v:g).palette)||void 0===h||null===(h=h.action)||void 0===h?void 0:h.active}},{props:{color:"disabled"},style:{color:null===(f=(null!==(m=g.vars)&&void 0!==m?m:g).palette)||void 0===f||null===(f=f.action)||void 0===f?void 0:f.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Mr=d.forwardRef(function(e,t){const r=Pr({props:e,name:"MuiSvgIcon"});const n=r.children,o=r.className,i=r.color,a=void 0===i?"inherit":i,l=r.component,u=void 0===l?"svg":l,p=r.fontSize,f=void 0===p?"medium":p,m=r.htmlColor,g=r.inheritViewBox,y=void 0!==g&&g,b=r.titleAccess,x=r.viewBox,w=void 0===x?"0 0 24 24":x,S=(0,h.A)(r,zr),k=d.isValidElement(n)&&"svg"===n.type,_=(0,c.A)((0,c.A)({},r),{},{color:a,component:u,fontSize:f,instanceFontSize:e.fontSize,inheritViewBox:y,viewBox:w,hasSvgAsChild:k}),C={};y||(C.viewBox=w);const A=(e=>{const t=e.color,r=e.fontSize,n=e.classes;return function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};for(const o in e){const i=e[o];let a="",s=!0;for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,o=new Array(n),i=0;i{e.apply(this,o)},r)}return n.clear=()=>{clearTimeout(t)},n};const Nr=function(e,t){return()=>null};const Br=function(e,t){var r,n;return d.isValidElement(e)&&-1!==t.indexOf(null!==(r=e.type.muiName)&&void 0!==r?r:null===(n=e.type)||void 0===n||null===(n=n._payload)||void 0===n||null===(n=n.value)||void 0===n?void 0:n.muiName)};function Hr(e){return e&&e.ownerDocument||document}const Wr=Hr;const Vr=function(e){return Hr(e).defaultView||window};const $r=function(e,t){return()=>null};const Ur=function(e,t){"function"===typeof e?e(t):e&&(e.current=t)},qr="undefined"!==typeof window?d.useLayoutEffect:d.useEffect,Kr=qr;let Gr=0;const Jr=(0,c.A)({},u).useId;const Qr=function(e){if(void 0!==Jr){const t=Jr();return null!==e&&void 0!==e?e:t}return function(e){const t=d.useState(e),r=(0,p.A)(t,2),n=r[0],o=r[1],i=e||n;return d.useEffect(()=>{null==n&&(Gr+=1,o("mui-".concat(Gr)))},[n]),i}(e)};const Yr=function(e,t,r,n,o){return null};const Xr=function(e){let t=e.controlled,r=e.default;e.name,e.state;const n=d.useRef(void 0!==t).current,o=d.useState(r),i=(0,p.A)(o,2),a=i[0],s=i[1];return[n?t:a,d.useCallback(e=>{n||s(e)},[])]};const Zr=function(e){const t=d.useRef(e);return qr(()=>{t.current=e}),d.useRef(function(){return(0,t.current)(...arguments)}).current},en=Zr;const tn=function(){for(var e=arguments.length,t=new Array(e),r=0;r{const r=t.map(t=>{if(null==t)return null;if("function"===typeof t){const r=t,n=r(e);return"function"===typeof n?n:()=>{r(null)}}return t.current=e,()=>{t.current=null}});return()=>{r.forEach(e=>null===e||void 0===e?void 0:e())}},t);return d.useMemo(()=>t.every(e=>null==e)?null:e=>{n.current&&(n.current(),n.current=void 0),null!=e&&(n.current=o(e))},t)};function rn(e,t){if(!e)return t;if("function"===typeof e||"function"===typeof t)return r=>{const n="function"===typeof t?t(r):t,o="function"===typeof e?e((0,c.A)((0,c.A)({},r),n)):e,i=(0,v.A)(null===r||void 0===r?void 0:r.className,null===n||void 0===n?void 0:n.className,null===o||void 0===o?void 0:o.className);return(0,c.A)((0,c.A)((0,c.A)((0,c.A)((0,c.A)({},n),o),!!i&&{className:i}),(null===n||void 0===n?void 0:n.style)&&(null===o||void 0===o?void 0:o.style)&&{style:(0,c.A)((0,c.A)({},n.style),o.style)}),(null===n||void 0===n?void 0:n.sx)&&(null===o||void 0===o?void 0:o.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(o.sx)?o.sx:[o.sx]]})};const r=t,n=(0,v.A)(null===r||void 0===r?void 0:r.className,null===e||void 0===e?void 0:e.className);return(0,c.A)((0,c.A)((0,c.A)((0,c.A)((0,c.A)({},t),e),!!n&&{className:n}),(null===r||void 0===r?void 0:r.style)&&(null===e||void 0===e?void 0:e.style)&&{style:(0,c.A)((0,c.A)({},r.style),e.style)}),(null===r||void 0===r?void 0:r.sx)&&(null===e||void 0===e?void 0:e.sx)&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]})}const nn={configure:e=>{o.configure(e)}}},219(e,t,r){"use strict";var n=r(3763),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?a:s[e.$$typeof]||o}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,d=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,v=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(v){var o=p(r);o&&o!==v&&e(t,o,n)}var a=d(r);u&&(a=a.concat(u(r)));for(var s=l(t),f=l(r),m=0;m