@devmoods/postgres-admin 0.17.1 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client/_index.html
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<meta name="x-title" content="{{ title }}" />
|
|
14
14
|
<link rel="manifest" href="/manifest.json" />
|
|
15
15
|
<title>{{ title }}</title>
|
|
16
|
-
<script type="module" crossorigin src="./assets/index-
|
|
16
|
+
<script type="module" crossorigin src="./assets/index-C25WaEng.js"></script>
|
|
17
17
|
<link rel="stylesheet" crossorigin href="./assets/index-aBTEnaK6.css">
|
|
18
18
|
</head>
|
|
19
19
|
<body>
|
|
@@ -10,7 +10,7 @@ Error generating stack: `+e.message+`
|
|
|
10
10
|
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}else if(n.formEncType===`application/json`){if(!xn(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}k(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Zt(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Zt(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Qt(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Qt(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(xn(c.formMethod))return{path:t,submission:c};let l=re(t);return e&&l.search&&Sn(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:ne(l),submission:c}}function St(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){let x=y?mn(y[1])?y[1].error:y[1].data:void 0,S=i.createURL(a.location),C=i.createURL(c),w;if(u&&a.errors){let e=Object.keys(a.errors)[0];w=o.findIndex(t=>t.route.id===e)}else if(y&&mn(y[1])){let e=y[0];w=o.findIndex(t=>t.route.id===e)-1}let T=y?y[1].statusCode:void 0,E=T&&T>=400,D={currentUrl:S,currentParams:a.matches[0]?.params||{},nextUrl:C,nextParams:o[0].params,...s,actionResult:x,actionStatus:T},O=Ke(o),k=o.map((i,o)=>{let{route:s}=i,f=null;if(w!=null&&o>w)f=!1;else if(s.lazy)f=!0;else if(!Ct(s))f=!1;else if(u){let{shouldLoad:e}=wt(s,a.loaderData,a.errors);f=e}else Tt(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Bt(n,r,e,c,O,i,l,t,f);let p=!1;typeof b==`boolean`?p=b:E?p=!1:d||S.pathname+S.search===C.pathname+C.search?p=!0:S.search===C.search?Et(a.matches[o],i)&&(p=!0):p=!0;let m={...D,defaultShouldRevalidate:p};return Bt(n,r,e,c,O,i,l,t,Dt(i,m),m,b)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,y=de(g,e.path,_);if(!y){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let x=Cn(y,e.path),S=new AbortController,C=Yt(i,e.path,S.signal),w=null;if(f.has(s))f.delete(s),w=Vt(n,r,C,e.path,y,x,l,t);else if(m)d&&(w=Vt(n,r,C,e.path,y,x,l,t));else{let i;i=typeof b==`boolean`?b:E?!1:d;let a={...D,defaultShouldRevalidate:i};Dt(x,a)&&(w=Vt(n,r,C,e.path,y,x,l,t,a))}w&&A.push({key:s,routeId:e.routeId,path:e.path,matches:w,match:x,request:C,controller:S})}),{dsMatches:k,revalidatingFetchers:A}}function Ct(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function wt(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Ct(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function Tt(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function Et(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function Dt(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function Ot(e,t,n,r,i,a){let o;if(e){let t=r[e];k(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>kt(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=le(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=le([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}}function kt(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>kt(e,t)))??!1:!1}var At=new WeakMap,jt=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(k(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=At.get(i);o||(o={},At.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=P(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)A(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)A(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},Mt=new WeakMap;function Nt(e,t,n,r,i){let a=n[e.id];if(k(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=Mt.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{k(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=F(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?A(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?A(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return Mt.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=jt({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function Pt(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function Ft(e){return e.matches.some(e=>e.route.middleware)?It(e,()=>Pt(e)):Pt(e)}function It(e,t){return Lt(e,t,e=>{if(yn(e))throw e;return e},dn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=rn(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Lt(e,t,n,r,i){let{matches:a,...o}=e;return await Rt(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Rt(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Rt(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function zt(e,t,n,r,i){let a=jt({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=Nt(r.route,xn(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Bt(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=zt(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?Dt(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?Dt(a,{...l,defaultShouldRevalidate:e}):Dt(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!xn(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(xn(n.method)||!p)?Ut({request:n,path:r,unstable_pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function Vt(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Bt(e,t,n,r,Ke(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:zt(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Ht(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,unstable_url:Xt(t,n),unstable_pattern:Ke(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return It(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function Ut({request:e,path:t,unstable_pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=xn(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,unstable_url:Xt(e,t),unstable_pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a)if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw on(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}else if(t)c=await f(t);else{let t=new URL(e.url);throw on(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function Wt(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Gt(e){let{result:t,type:n}=e;if(_n(t)){let e;try{e=await Wt(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new We(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?gn(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:un(t),statusCode:Ge(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:Ge(t)?t.status:void 0}:gn(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function Kt(e,t,n,r,i){let a=e.headers.get(`Location`);if(k(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!Ne(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=bt(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var qt=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Jt(e,t,n,r){if(Ne(e)){let r=e,i=r.startsWith(`//`)?new URL(t.protocol+r):new URL(r);if(qt.includes(i.protocol))throw Error(`Invalid redirect location`);let a=Ae(i.pathname,n)!=null;if(i.origin===t.origin&&a)return i.pathname+i.search+i.hash}try{let t=r.createURL(e);if(qt.includes(t.protocol))throw Error(`Invalid redirect location`)}catch{}return e}function Yt(e,t,n,r){let i=e.createURL(cn(t)).toString(),a={signal:n};if(r&&xn(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):t===`text/plain`?a.body=r.text:t===`application/x-www-form-urlencoded`&&r.formData?a.body=Zt(r.formData):a.body=r.formData}return new Request(i,a)}function Xt(e,t){let n=new URL(e.url),r=typeof t==`string`?re(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Zt(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Qt(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function $t(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&mn(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(k(!hn(f),`Cannot handle redirect results in processLoaderData`),mn(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=rn(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=_t),c||(c=!0,s=Ge(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function en(e,t,n,r,i,a){let{loaderData:o,errors:s}=$t(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let o=a[n];if(k(o,`Did not find corresponding fetcher result`),mn(o)){let t=rn(e.matches,r?.route.id);s&&s[t.route.id]||(s={...s,[t.route.id]:o.error}),e.fetchers.delete(n)}else if(hn(o))k(!1,`Unhandled fetcher revalidation redirect`);else{let t=kn(o.data);e.fetchers.set(n,t)}}),{loaderData:o,errors:s}}function tn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==_t).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function nn(e){return e?mn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function rn(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function an(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function on(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new We(e||500,o,Error(s),!0)}function sn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(hn(r))return{key:n,result:r}}}function cn(e){return ne({...typeof e==`string`?re(e):e,hash:``})}function ln(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash?!0:t.hash!==``}function un(e){return new We(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function dn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&fn(t))}function fn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function pn(e){return _n(e.result)&&ut.has(e.result.status)}function mn(e){return e.type===`error`}function hn(e){return(e&&e.type)===`redirect`}function gn(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function _n(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function vn(e){return ut.has(e)}function yn(e){return _n(e)&&vn(e.status)&&e.headers.has(`Location`)}function bn(e){return lt.has(e.toUpperCase())}function xn(e){return st.has(e.toUpperCase())}function Sn(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function Cn(e,t){let n=typeof t==`string`?re(t).search:t.search;if(e[e.length-1].route.index&&Sn(n||``))return e[e.length-1];let r=Le(e);return r[r.length-1]}function wn(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function Tn(e,t){return t?{state:`loading`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:`loading`,location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function En(e,t){return{state:`submitting`,location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Dn(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function On(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function kn(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function An(e,t){try{let n=e.sessionStorage.getItem(gt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function jn(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(gt,JSON.stringify(n))}catch(e){A(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function Mn(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Nn=x.createContext(null);Nn.displayName=`DataRouter`;var Pn=x.createContext(null);Pn.displayName=`DataRouterState`;var Fn=x.createContext(!1);function In(){return x.useContext(Fn)}var Ln=x.createContext({isTransitioning:!1});Ln.displayName=`ViewTransition`;var Rn=x.createContext(new Map);Rn.displayName=`Fetchers`;var zn=x.createContext(null);zn.displayName=`Await`;var Bn=x.createContext(null);Bn.displayName=`Navigation`;var Vn=x.createContext(null);Vn.displayName=`Location`;var Hn=x.createContext({outlet:null,matches:[],isDataRoute:!1});Hn.displayName=`Route`;var Un=x.createContext(null);Un.displayName=`RouteError`;var Wn=`REACT_ROUTER_ERROR`,Gn=`REDIRECT`,Kn=`ROUTE_ERROR_RESPONSE`;function qn(e){if(e.startsWith(`${Wn}:${Gn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Jn(e){if(e.startsWith(`${Wn}:${Kn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new We(t.status,t.statusText,t.data)}catch{}}function Yn(e,{relative:t}={}){k(Xn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=x.useContext(Bn),{hash:i,pathname:a,search:o}=ar(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Be([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Xn(){return x.useContext(Vn)!=null}function Zn(){return k(Xn(),`useLocation() may be used only in the context of a <Router> component.`),x.useContext(Vn).location}var Qn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function $n(e){x.useContext(Bn).static||x.useLayoutEffect(e)}function er(){let{isDataRoute:e}=x.useContext(Hn);return e?wr():tr()}function tr(){k(Xn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=x.useContext(Nn),{basename:t,navigator:n}=x.useContext(Bn),{matches:r}=x.useContext(Hn),{pathname:i}=Zn(),a=JSON.stringify(Re(r)),o=x.useRef(!1);return $n(()=>{o.current=!0}),x.useCallback((r,s={})=>{if(A(o.current,Qn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=ze(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Be([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var nr=x.createContext(null);function rr(e){let t=x.useContext(Hn).outlet;return x.useMemo(()=>t&&x.createElement(nr.Provider,{value:e},t),[t,e])}function ir(){let{matches:e}=x.useContext(Hn),t=e[e.length-1];return t?t.params:{}}function ar(e,{relative:t}={}){let{matches:n}=x.useContext(Hn),{pathname:r}=Zn(),i=JSON.stringify(Re(n));return x.useMemo(()=>ze(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function or(e,t){return sr(e,t)}function sr(e,t,n){k(Xn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=x.useContext(Bn),{matches:i}=x.useContext(Hn),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Er(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
11
|
|
|
12
12
|
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Zn(),d;if(t){let e=typeof t==`string`?re(t):t;k(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=de(e,{pathname:p});A(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),A(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=mr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Be([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Be([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?x.createElement(Vn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...d},navigationType:`POP`}},h):h}function cr(){let e=Cr(),t=Ge(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=x.createElement(x.Fragment,null,x.createElement(`p`,null,`💿 Hey developer 👋`),x.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,x.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,x.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),x.createElement(x.Fragment,null,x.createElement(`h2`,null,`Unexpected Application Error!`),x.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?x.createElement(`pre`,{style:i},n):null,o)}var lr=x.createElement(cr,null),ur=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Jn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:x.createElement(Hn.Provider,{value:this.props.routeContext},x.createElement(Un.Provider,{value:e,children:this.props.component}));return this.context?x.createElement(fr,{error:e},t):t}};ur.contextType=Fn;var dr=new WeakMap;function fr({children:e,error:t}){let{basename:n}=x.useContext(Bn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=qn(t.digest);if(e){let r=dr.get(t);if(r)throw r;let i=Je(e.location,n);if(qe&&!dr.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw dr.set(t,n),n}return x.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function pr({routeContext:e,match:t,children:n}){let r=x.useContext(Nn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(Hn.Provider,{value:e},n)}function mr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);k(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:Ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||lr,o&&(s<0&&c===0?(Er(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?x.createElement(n.route.Component,null):n.route.element?n.route.element:e,x.createElement(pr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?x.createElement(ur,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function hr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gr(e){let t=x.useContext(Nn);return k(t,hr(e)),t}function _r(e){let t=x.useContext(Pn);return k(t,hr(e)),t}function vr(e){let t=x.useContext(Hn);return k(t,hr(e)),t}function yr(e){let t=vr(e),n=t.matches[t.matches.length-1];return k(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function br(){return yr(`useRouteId`)}function xr(){return _r(`useNavigation`).navigation}function Sr(){let{matches:e,loaderData:t}=_r(`useMatches`);return x.useMemo(()=>e.map(e=>pe(e,t)),[e,t])}function Cr(){let e=x.useContext(Un),t=_r(`useRouteError`),n=yr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function wr(){let{router:e}=gr(`useNavigate`),t=yr(`useNavigate`),n=x.useRef(!1);return $n(()=>{n.current=!0}),x.useCallback(async(r,i={})=>{A(n.current,Qn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Tr={};function Er(e,t,n){!t&&!Tr[e]&&(Tr[e]=!0,A(!1,n))}var Dr={};function Or(e,t){!e&&!Dr[t]&&(Dr[t]=!0,console.warn(t))}var kr=x.useOptimistic,Ar=()=>void 0;function jr(e){return kr?kr(e):[e,Ar]}function Mr(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&A(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:x.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&A(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:x.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&A(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:x.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var Nr=[`HydrateFallback`,`hydrateFallbackElement`],Pr=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function Fr({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=In()||r;let[i,a]=x.useState(e.state),[o,s]=jr(i),[c,l]=x.useState(),[u,d]=x.useState({isTransitioning:!1}),[f,p]=x.useState(),[m,h]=x.useState(),[g,_]=x.useState(),v=x.useRef(new Map),y=x.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},unstable_pattern:Ke(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),Or(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(Or(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):x.startTransition(()=>{r===!0&&s(e=>Ir(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);x.useLayoutEffect(()=>e.subscribe(y),[e,y]),x.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Pr)},[u]),x.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):x.startTransition(()=>{r===!0&&s(e=>Ir(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),x.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),x.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=x.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),S=e.basename||`/`,C=x.useMemo(()=>({router:e,navigator:b,static:!1,basename:S,onError:n}),[e,b,S,n]);return x.createElement(x.Fragment,null,x.createElement(Nn.Provider,{value:C},x.createElement(Pn.Provider,{value:o},x.createElement(Rn.Provider,{value:v.current},x.createElement(Ln.Provider,{value:u},x.createElement(Vr,{basename:S,location:o.location,navigationType:o.historyAction,navigator:b,unstable_useTransitions:r},x.createElement(Lr,{routes:e.routes,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function Ir(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var Lr=x.memo(Rr);function Rr({routes:e,future:t,state:n,isStatic:r,onError:i}){return sr(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function zr(e){return rr(e.context)}function Br(e){k(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Vr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){k(!Xn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=x.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=re(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,unstable_mask:m}=n,h=x.useMemo(()=>{let e=Ae(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,unstable_mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return A(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:x.createElement(Bn.Provider,{value:c},x.createElement(Vn.Provider,{children:t,value:h}))}function Hr({children:e,location:t}){return or(Ur(e),t)}x.Component;function Ur(e,t=[]){let n=[];return x.Children.forEach(e,(e,r)=>{if(!x.isValidElement(e))return;let i=[...t,r];if(e.type===x.Fragment){n.push.apply(n,Ur(e.props.children,i));return}k(e.type===Br,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),k(!e.props.index||!e.props.children,`An index route cannot have child routes.`);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,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ur(e.props.children,i)),n.push(a)}),n}var Wr=`get`,Gr=`application/x-www-form-urlencoded`;function Kr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function qr(e){return Kr(e)&&e.tagName.toLowerCase()===`button`}function Jr(e){return Kr(e)&&e.tagName.toLowerCase()===`form`}function Yr(e){return Kr(e)&&e.tagName.toLowerCase()===`input`}function Xr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Zr(e,t){return e.button===0&&(!t||t===`_self`)&&!Xr(e)}var Qr=null;function $r(){if(Qr===null)try{new FormData(document.createElement(`form`),0),Qr=!1}catch{Qr=!0}return Qr}var ei=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function ti(e){return e!=null&&!ei.has(e)?(A(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gr}"`),null):e}function ni(e,t){let n,r,i,a,o;if(Jr(e)){let o=e.getAttribute(`action`);r=o?Ae(o,t):null,n=e.getAttribute(`method`)||Wr,i=ti(e.getAttribute(`enctype`))||Gr,a=new FormData(e)}else if(qr(e)||Yr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Ae(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Wr,i=ti(e.getAttribute(`formenctype`))||ti(o.getAttribute(`enctype`))||Gr,a=new FormData(o,e),!$r()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Kr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Wr,r=null,i=Gr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var ri={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},ii=/[&><\u2028\u2029]/g;function ai(e){return e.replace(ii,e=>ri[e])}function oi(e,t){if(e===!1||e==null)throw Error(t)}function si(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Ae(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function ci(e,t){if(e.id in t)return t[e.id];try{let n=await b(()=>import(e.module),[],import.meta.url);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function li(e){return e!=null&&typeof e.page==`string`}function ui(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function di(e,t,n){return gi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await ci(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ui).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function fi(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function pi(e,t,{includeHydrateFallback:n}={}){return mi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function mi(e){return[...new Set(e)]}function hi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function gi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!li(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(hi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function _i(){let e=x.useContext(Nn);return oi(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function vi(){let e=x.useContext(Pn);return oi(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var yi=x.createContext(void 0);yi.displayName=`FrameworkContext`;function bi(){let e=x.useContext(yi);return oi(e,`You must render this element inside a <HydratedRouter> element`),e}function xi(e,t){let n=x.useContext(yi),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=x.useRef(null);x.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),x.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Si(s,p),onBlur:Si(c,m),onMouseEnter:Si(l,p),onMouseLeave:Si(u,m),onTouchStart:Si(d,p)}]:[a,f,{}]:[!1,f,{}]}function Si(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ci({page:e,...t}){let n=In(),{router:r}=_i(),i=x.useMemo(()=>de(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?x.createElement(Ti,{page:e,matches:i,...t}):x.createElement(Ei,{page:e,matches:i,...t}):null}function wi(e){let{manifest:t,routeModules:n}=bi(),[r,i]=x.useState([]);return x.useEffect(()=>{let r=!1;return di(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Ti({page:e,matches:t,...n}){let r=Zn(),{future:i}=bi(),{basename:a}=_i(),o=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=si(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return x.createElement(x.Fragment,null,o.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ei({page:e,matches:t,...n}){let r=Zn(),{future:i,manifest:a,routeModules:o}=bi(),{basename:s}=_i(),{loaderData:c,matches:l}=vi(),u=x.useMemo(()=>fi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=x.useMemo(()=>fi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=si(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=x.useMemo(()=>pi(d,a),[d,a]),m=wi(d);return x.createElement(x.Fragment,null,f.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>x.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>x.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Di(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}x.Component;var Oi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Oi&&(window.__reactRouterVersion=`7.14.0`)}catch{}function ki(e,t){return vt({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:O({window:t?.window}),hydrationData:t?.hydrationData||Ai(),routes:e,mapRouteProperties:Mr,hydrationRouteProperties:Nr,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Ai(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:ji(e.errors)}),e}function ji(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new We(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(r.__subType){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}function Mi({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=x.useState({action:n.action,location:n.location}),o=x.useCallback(e=>{r===!1?a(e):x.startTransition(()=>a(e))},[r]);return x.useLayoutEffect(()=>n.listen(o),[n,o]),x.createElement(Vr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Mi.displayName=`unstable_HistoryRouter`;var Ni=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pi=x.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,unstable_useTransitions:_}=x.useContext(Bn),v=typeof l==`string`&&Ni.test(l),y=Je(l,h);l=y.to;let b=Yn(l,{relative:r}),S=Zn(),C=null;if(o){let e=ze(o,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Be([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=xi(n,p),D=Bi(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(y.isExternal||i),A=x.createElement(`a`,{...p,...E,href:(k?C:void 0)||y.absoluteURL||b,onClick:k?O:e,ref:Di(m,T),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return w&&!v?x.createElement(x.Fragment,null,A,x.createElement(Ci,{page:b})):A});Pi.displayName=`Link`;var Fi=x.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=ar(a,{relative:c.relative}),d=Zn(),f=x.useContext(Pn),{navigator:p,basename:m}=x.useContext(Bn),h=f!=null&&Xi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Ae(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:S,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return x.createElement(Pi,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Fi.displayName=`NavLink`;var Ii=x.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Wr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f,...p},m)=>{let{unstable_useTransitions:h}=x.useContext(Bn),g=Ui(),_=Wi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&Ni.test(s);return x.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,unstable_defaultShouldRevalidate:f});h&&n!==!1?x.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Ii.displayName=`Form`;function Li({getKey:e,storageKey:t,...n}){let r=x.useContext(yi),{basename:i}=x.useContext(Bn),a=Zn(),o=Sr();Ji({getKey:e,storageKey:t});let s=x.useMemo(()=>{if(!r||!e)return null;let t=qi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return x.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ai(JSON.stringify(t||Gi))}, ${ai(JSON.stringify(s))})`}})}Li.displayName=`ScrollRestoration`;function I(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ri(e){let t=x.useContext(Nn);return k(t,I(e)),t}function zi(e){let t=x.useContext(Pn);return k(t,I(e)),t}function Bi(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let u=er(),d=Zn(),f=ar(e,{relative:o});return x.useCallback(p=>{if(Zr(p,t)){p.preventDefault();let t=n===void 0?ne(d)===ne(f):n,m=()=>u(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?x.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var Vi=0,Hi=()=>`__${String(++Vi)}__`;function Ui(){let{router:e}=Ri(`useSubmit`),{basename:t}=x.useContext(Bn),n=br(),r=e.fetch,i=e.navigate;return x.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ni(e,t);a.navigate===!1?await r(a.fetcherKey||Hi(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Wi(e,{relative:t}={}){let{basename:n}=x.useContext(Bn),r=x.useContext(Hn);k(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...ar(e||`.`,{relative:t})},o=Zn();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Be([n,a.pathname])),ne(a)}var Gi=`react-router-scroll-positions`,Ki={};function qi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Ae(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ji({getKey:e,storageKey:t}={}){let{router:n}=Ri(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=zi(`useScrollRestoration`),{basename:a}=x.useContext(Bn),o=Zn(),s=Sr(),c=xr();x.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Yi(x.useCallback(()=>{if(c.state===`idle`){let t=qi(o,s,a,e);Ki[t]=window.scrollY}try{sessionStorage.setItem(t||Gi,JSON.stringify(Ki))}catch(e){A(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(x.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Gi);e&&(Ki=JSON.parse(e))}catch{}},[t]),x.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Ki,()=>window.scrollY,e?(t,n)=>qi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),x.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{A(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Yi(e,t){let{capture:n}=t||{};x.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Xi(e,{relative:t}={}){let n=x.useContext(Ln);k(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Ri(`useViewTransitionState`),i=ar(e,{relative:t});if(!n.isTransitioning)return!1;let a=Ae(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ae(n.nextLocation.pathname,r)||n.nextLocation.pathname;return De(i.pathname,o)!=null||De(i.pathname,a)!=null}var Zi=o((e=>{var t=f().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),Qi=o(((e,t)=>{t.exports=Zi()})),$i=g(),ea=Qi(),ta=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),na=o(((e,t)=>{t.exports=ta()})),ra={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ia=x.createContext&&x.createContext(ra),aa=[`attr`,`size`,`title`];function oa(e,t){if(e==null)return{};var n,r,i=sa(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function sa(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ca.apply(null,arguments)}function la(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?la(Object(n),!0).forEach(function(t){da(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):la(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function da(e,t,n){return(t=fa(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fa(e){var t=pa(e,`string`);return typeof t==`symbol`?t:t+``}function pa(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ma(e){return e&&e.map((e,t)=>x.createElement(e.tag,ua({key:t},e.attr),ma(e.child)))}function ha(e){return t=>x.createElement(ga,ca({attr:ua({},e.attr)},t),ma(e.child))}function ga(e){var t=t=>{var{attr:n,size:r,title:i}=e,a=oa(e,aa),o=r||t.size||`1em`,s;return t.className&&(s=t.className),e.className&&(s=(s?s+` `:``)+e.className),x.createElement(`svg`,ca({stroke:`currentColor`,fill:`currentColor`,strokeWidth:`0`},t.attr,n,a,{className:s,style:ua(ua({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:`http://www.w3.org/2000/svg`}),i&&x.createElement(`title`,null,i),e.children)};return ia===void 0?t(ra):x.createElement(ia.Consumer,null,e=>t(e))}var L=na();function _a(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M228.9 79.9L51.8 403.1C40.6 423.3 55.5 448 78.9 448h354.3c23.3 0 38.2-24.7 27.1-44.9L283.1 79.9c-11.7-21.2-42.5-21.2-54.2 0zM273.6 214L270 336h-28l-3.6-122h35.2zM256 402.4c-10.7 0-19.1-8.1-19.1-18.4s8.4-18.4 19.1-18.4 19.1 8.1 19.1 18.4-8.4 18.4-19.1 18.4z`},child:[]}]})(e)}function va(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M443.5 420.2L336.7 312.4c20.9-26.2 33.5-59.4 33.5-95.5 0-84.5-68.5-153-153.1-153S64 132.5 64 217s68.5 153 153.1 153c36.6 0 70.1-12.8 96.5-34.2l106.1 107.1c3.2 3.4 7.6 5.1 11.9 5.1 4.1 0 8.2-1.5 11.3-4.5 6.6-6.3 6.8-16.7.6-23.3zm-226.4-83.1c-32.1 0-62.3-12.5-85-35.2-22.7-22.7-35.2-52.9-35.2-84.9 0-32.1 12.5-62.3 35.2-84.9 22.7-22.7 52.9-35.2 85-35.2s62.3 12.5 85 35.2c22.7 22.7 35.2 52.9 35.2 84.9 0 32.1-12.5 62.3-35.2 84.9-22.7 22.7-52.9 35.2-85 35.2z`},child:[]}]})(e)}function ya(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M368.5 240h-225c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7h225c8.8 0 16-7.2 16-16s-7.2-16-16-16z`},child:[]}]})(e)}function ba(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm19 304h-38.2V207.9H275V352zm-19.1-159.8c-11.3 0-20.5-8.6-20.5-20s9.3-19.9 20.5-19.9c11.4 0 20.7 8.5 20.7 19.9s-9.3 20-20.7 20z`},child:[]}]})(e)}function xa(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M255.8 112c-80.4 0-143.8 50.6-219.6 133.3-5.5 6.1-5.6 15.2-.1 21.3C101 338.3 158.2 400 255.8 400c96.4 0 168.7-77.7 220.1-134 5.3-5.8 5.6-14.6.5-20.7C424 181.8 351.5 112 255.8 112zm4.4 233.9c-53 2.4-96.6-41.2-94.1-94.1 2.1-46.2 39.5-83.6 85.7-85.7 53-2.4 96.6 41.2 94.1 94.1-2.1 46.2-39.5 83.6-85.7 85.7z`},child:[]},{tag:`path`,attr:{d:`M256 209c0-6 1.1-11.7 3.1-16.9-1 0-2-.1-3.1-.1-36.9 0-66.6 31.4-63.8 68.9 2.4 31.3 27.6 56.5 58.9 58.9 37.5 2.8 68.9-26.9 68.9-63.8 0-1.3-.1-2.6-.1-3.9-5.6 2.5-11.7 3.9-18.2 3.9-25.2 0-45.7-21.1-45.7-47z`},child:[]}]})(e)}function Sa(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M88.3 68.1c-5.6-5.5-14.6-5.5-20.1.1-5.5 5.5-5.5 14.5 0 20l355.5 355.7c3.7 3.7 9 4.9 13.7 3.6 2.4-.6 4.6-1.9 6.4-3.7 5.5-5.5 5.5-14.5 0-20L88.3 68.1zM260.2 345.9c-53 2.4-96.6-41.2-94.1-94.1.6-12.2 3.6-23.8 8.6-34.3L121.3 164c-27.7 21.4-55.4 48.9-85.1 81.3-5.5 6.1-5.6 15.2-.1 21.3C101 338.3 158.2 400 255.8 400c29.7 0 57.1-7.4 82.3-19.2l-43.5-43.5c-10.6 5-22.2 8-34.4 8.6zM475.8 266c5.3-5.8 5.6-14.6.5-20.7C424 181.8 351.5 112 255.8 112c-29.1 0-56 6.6-82 19l43.7 43.7c10.5-5 22.1-8.1 34.3-8.6 53-2.4 96.6 41.2 94.1 94.1-.6 12.2-3.6 23.8-8.6 34.3l53.5 53.5c33-25.3 61.3-55.9 85-82z`},child:[]},{tag:`path`,attr:{d:`M192.2 260.9c2.4 31.3 27.6 56.5 58.9 58.9 8.2.6 16.1-.3 23.4-2.6l-79.8-79.8c-2.2 7.4-3.1 15.3-2.5 23.5zM320 256c0-1.3-.1-2.6-.1-3.9-5.6 2.5-11.7 3.9-18.2 3.9-1.1 0-2.1 0-3.1-.1l18.6 18.7c1.8-5.9 2.8-12.2 2.8-18.6zM256 209c0-6 1.1-11.7 3.1-16.9-1 0-2-.1-3.1-.1-6.4 0-12.6 1-18.5 2.8l18.7 18.7c-.1-1.5-.2-3-.2-4.5z`},child:[]}]})(e)}function Ca(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M278.6 256l68.2-68.2c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-68.2-68.2c-6.2-6.2-16.4-6.2-22.6 0-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3l68.2 68.2-68.2 68.2c-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3 6.2 6.2 16.4 6.2 22.6 0l68.2-68.2 68.2 68.2c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6L278.6 256z`},child:[]}]})(e)}function wa(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M362.6 192.9L345 174.8c-.7-.8-1.8-1.2-2.8-1.2-1.1 0-2.1.4-2.8 1.2l-122 122.9-44.4-44.4c-.8-.8-1.8-1.2-2.8-1.2-1 0-2 .4-2.8 1.2l-17.8 17.8c-1.6 1.6-1.6 4.1 0 5.7l56 56c3.6 3.6 8 5.7 11.7 5.7 5.3 0 9.9-3.9 11.6-5.5h.1l133.7-134.4c1.4-1.7 1.4-4.2-.1-5.7z`},child:[]}]})(e)}function Ta(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm106.5 150.5L228.8 332.8h-.1c-1.7 1.7-6.3 5.5-11.6 5.5-3.8 0-8.1-2.1-11.7-5.7l-56-56c-1.6-1.6-1.6-4.1 0-5.7l17.8-17.8c.8-.8 1.8-1.2 2.8-1.2 1 0 2 .4 2.8 1.2l44.4 44.4 122-122.9c.8-.8 1.8-1.2 2.8-1.2 1.1 0 2.1.4 2.8 1.2l17.5 18.1c1.8 1.7 1.8 4.2.2 5.8z`},child:[]}]})(e)}function Ea(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z`},child:[]}]})(e)}function Da(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z`},child:[]}]})(e)}function Oa(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z`},child:[]}]})(e)}function ka(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M256 48C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48zm17.2 109.6l-3.1 115.1c-.2 8.2-5.9 14.8-14.1 14.8s-13.9-6.6-14.1-14.8l-3.1-115.1c-.2-9.6 7.5-17.6 17.2-17.6 9.6 0 17.4 7.9 17.2 17.6zM256 354c-10.7 0-19.1-8.1-19.1-18.4s8.4-18.4 19.1-18.4c10.7 0 19.1 8.1 19.1 18.4S266.7 354 256 354z`},child:[]}]})(e)}function Aa(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M368.5 240H272v-96.5c0-8.8-7.2-16-16-16s-16 7.2-16 16V240h-96.5c-8.8 0-16 7.2-16 16 0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7H240v96.5c0 4.4 1.8 8.4 4.7 11.3 2.9 2.9 6.9 4.7 11.3 4.7 8.8 0 16-7.2 16-16V272h96.5c8.8 0 16-7.2 16-16s-7.2-16-16-16z`},child:[]}]})(e)}function ja(e){return ha({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M346.5 240H272v-74.5c0-8.8-7.2-16-16-16s-16 7.2-16 16V240h-74.5c-8.8 0-16 6-16 16s7.5 16 16 16H240v74.5c0 9.5 7 16 16 16s16-7.2 16-16V272h74.5c8.8 0 16-7.2 16-16s-7.2-16-16-16z`},child:[]},{tag:`path`,attr:{d:`M256 76c48.1 0 93.3 18.7 127.3 52.7S436 207.9 436 256s-18.7 93.3-52.7 127.3S304.1 436 256 436c-48.1 0-93.3-18.7-127.3-52.7S76 304.1 76 256s18.7-93.3 52.7-127.3S207.9 76 256 76m0-28C141.1 48 48 141.1 48 256s93.1 208 208 208 208-93.1 208-208S370.9 48 256 48z`},child:[]}]})(e)}var Ma=o(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()})),Na=o(((e,t)=>{var n=typeof Element<`u`,r=typeof Map==`function`,i=typeof Set==`function`,a=typeof ArrayBuffer==`function`&&!!ArrayBuffer.isView;function o(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;var s,c,l;if(Array.isArray(e)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(!o(e[c],t[c]))return!1;return!0}var u;if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;for(u=e.entries();!(c=u.next()).done;)if(!o(c.value[1],t.get(c.value[0])))return!1;return!0}if(i&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(c=u.next()).done;)if(!t.has(c.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!=t.length)return!1;for(c=s;c--!==0;)if(e[c]!==t[c])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf==`function`&&typeof t.valueOf==`function`)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString==`function`&&typeof t.toString==`function`)return e.toString()===t.toString();if(l=Object.keys(e),s=l.length,s!==Object.keys(t).length)return!1;for(c=s;c--!==0;)if(!Object.prototype.hasOwnProperty.call(t,l[c]))return!1;if(n&&e instanceof Element)return!1;for(c=s;c--!==0;)if(!((l[c]===`_owner`||l[c]===`__v`||l[c]===`__o`)&&e.$$typeof)&&!o(e[l[c]],t[l[c]]))return!1;return!0}return e!==e&&t!==t}t.exports=function(e,t){try{return o(e,t)}catch(e){if((e.message||``).match(/stack|recursion/i))return console.warn(`react-fast-compare cannot handle circular refs`),!1;throw e}}})),R=c(Ma(),1),Pa=c(Na(),1);function Fa(e){throw Error(`The prop "${e}" is required`)}var Ia=e=>Wa(e,`-`);function La(e,t=[],n={}){for(let r of Object.keys(e)){let i=e[r],a=t.concat([Ia(r)]);typeof i==`object`&&i?La(i,a,n):n[a.join(`-`)]=i}return n}function Ra(e,t,n=[]){return new Proxy(e,{get(e,r,i){let a=n.concat(r.toString()),o=Reflect.get(e,r,i);return o&&typeof o==`object`&&!Array.isArray(o)?Ra(o,t,a):t(a,o)}})}function za(e){return Ra(e,e=>`var(--${e.map(Ia).join(`-`)})`)}function Ba(e){return e}function Va(e,t){if(e!=null)if(typeof e==`function`)e(t);else try{e.current=t}catch{throw Error(`Cannot assign value "${t}" to ref "${e}"`)}}function Ha(...e){return(0,x.useMemo)(()=>e.every(e=>e==null)?null:t=>{e.forEach(e=>{Va(e,t)})},[...e])}function Ua(e,t){let n=(0,x.createContext)(t);return n.displayName=e,n}function Wa(e,t){return e.replace(/([a-z\d])([A-Z])/g,`$1${t}$2`).replace(/([A-Z]+)([A-Z][a-z\d]+)/g,`$1${t}$2`).toLowerCase()}function Ga(e){return e==null?[]:Array.isArray(e)?e:[e]}var Ka={alert:`BZ7qn`,title:`hdHDi`,closeButton:`SgstT`,content:`Q9Sh5`,error:`VGIpm`,success:`DlYCJ`,info:`rHcuC`,warning:`OC-ol`,none:`xqeOj`},qa={success:Ta,error:ka,warning:_a,info:ba,none:ba};function Ja({intent:e=`none`,title:t,onClose:n,children:r,...i}){let a=qa[e];return(0,L.jsxs)(`div`,{...i,className:(0,R.default)(Ka.alert,i.className,Ka[e]),children:[n&&(0,L.jsx)(`button`,{type:`button`,onClick:n,className:Ka.closeButton,"aria-label":`Close`,children:(0,L.jsx)(Ca,{})}),(0,L.jsxs)(`div`,{className:Ka.title,children:[(0,L.jsx)(a,{}),t]}),typeof r<`u`&&(0,L.jsx)(`div`,{className:Ka.content,children:r})]})}function Ya(){return typeof window<`u`&&!!window.document?.createElement}var Xa=Ya(),Za=Xa?x.useLayoutEffect:x.useEffect,Qa={badge:`xeHAL`,"badge-danger":`cgE-K`,"badge-warning":`_0U-VJ`,"badge-success":`ZgKwX`,"badge-pill":`OBQRM`,notificationBadge:`LzQDv`},$a=Ba(({as:e=`span`,intent:t=`none`,pill:n=!1,className:r,ref:i,...a})=>(0,L.jsx)(e,{ref:i,...a,className:(0,R.default)(Qa.badge,Qa[`badge-${t}`],n&&Qa[`badge-pill`],r)})),eo={root:`mtrF8`,contained:`W8YVd`,"intent-danger":`_3UX8S`,"intent-none":`-HhPB`,text:`_2LiTf`,outlined:`_9x9uq`,"size-s":`_5jbkc`,"size-m":`tf6zw`,"size-l":`_7vljf`,content:`SUABR`,spinner:`QSIpR`},to={root:`QAwiK`,static:`xse-M`,circle:`bWHVH`,circleTrack:`qGMq-`,indeterminate:`uxHDU`,circleStatic:`aGrAV`,circleIndeterminate:`vIA5t`};function no({size:e=52,thickness:t=2,value:n,color:r=`var(--CircularProgress-color)`,children:i,className:a,...o}){let s={},c={},l={};if(typeof n==`number`){let r=2*Math.PI*((e-t)/2);s.strokeDasharray=r.toFixed(3),l[`aria-valuenow`]=Math.round(n),s.strokeDashoffset=`${((100-n)/100*r).toFixed(3)}px`,c.transform=`rotate(-90deg)`}return(0,L.jsxs)(`div`,{className:(0,R.default)(to.root,{[to.indeterminate]:n==null,[to.static]:typeof n==`number`},a),style:{color:r,width:e,height:e,...c},role:`progressbar`,...l,...o,children:[(0,L.jsxs)(`svg`,{viewBox:`${e/2} ${e/2} ${e} ${e}`,children:[(0,L.jsx)(`circle`,{className:to.circleTrack,cx:e,cy:e,r:(e-t)/2,fill:`none`,strokeWidth:t}),(0,L.jsx)(`circle`,{className:(0,R.default)(to.circle,{[to.circleIndeterminate]:n==null,[to.circleStatic]:typeof n==`number`}),style:s,cx:e,cy:e,r:(e-t)/2,fill:`none`,strokeWidth:t,strokeLinecap:`round`})]}),(0,L.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,transform:`rotate(90deg)`},children:i})]})}var ro=e=>{let t=Xa?e.map(e=>window.matchMedia(e).matches):e.map(()=>!0);return{subscribe(n){if(!Xa)return()=>{};let r=e.map(e=>window.matchMedia(e));t=r.map(e=>e.matches);let i=()=>{t=e.map(e=>window.matchMedia(e).matches),n()};for(let e of r)e.addEventListener(`change`,i);return()=>{for(let e of r)e.removeEventListener(`change`,i)}},getSnapshot(){return t},getServerSnapshot(){return t}}};function io(e){let t=Ga(e),n=(0,x.useMemo)(()=>ro(t),[t.join(`/`)]),r=(0,x.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getServerSnapshot);return Array.isArray(e)?r:r[0]}function ao(e,t){let[n,r]=(0,x.useState)(()=>{if(!Xa)return t;try{return JSON.parse(window.localStorage.getItem(e)||`null`)??t}catch{return t}});return(0,x.useEffect)(()=>{if(Xa)try{n===void 0?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),(0,x.useEffect)(()=>{let t=t=>{if(!(t.key!==e||t.storageArea!==window.localStorage))try{t.newValue!=null&&r(JSON.parse(t.newValue))}catch{}};return window.addEventListener(`storage`,t),()=>{window.removeEventListener(`storage`,t)}},[e]),[n,r]}var oo=e=>`screen and (min-width: ${e})`,so=[oo(`0px`),oo(`600px`),oo(`1200px`)];function co(e){let[t,n,r,i]=To(e);return`hsla(${t}, ${n*.9}%, ${100-r}%, ${i})`}function lo(e){return JSON.parse(JSON.stringify(e),(e,t)=>typeof t==`string`&&t.startsWith(`#`)?co(t):t)}function uo(e){return fo(e)}function fo(e){let{id:t=`theme-${new Date().getTime()*Math.random()}`,...n}=e,{primary:r=`#0074d9`,secondary:i=`#a2c14e`,danger:a=`#d2322d`,...o}=n.colors||{},{base:s=`#ffffff`,...c}=o,l=`#fff`,u={"05":`#f9fafb`,10:`#f3f4f6`,20:`#e5e7eb`,30:`#d1d5db`,40:`#9ca3af`,50:`#6b7280`,60:`#4b5563`,70:`#374151`,80:`#1f2937`,90:`#111827`,95:`#030712`},d={"05":`#fef2f2`,10:`#fee2e2`,20:`#fecaca`,30:`#fca5a5`,40:`#f87171`,50:`#ef4444`,60:`#dc2626`,70:`#b91c1c`,80:`#991b1b`,90:`#7f1d1d`,95:`#450a0a`};return{id:t,tokens:{...n,spacing:{auto:`auto`,none:`0px`,xxs:`2px`,xs:`4px`,s:`8px`,m:`16px`,l:`24px`,xl:`32px`,xxl:`64px`,...n.spacing},fonts:{base:`Inter`,...n.fonts},colors:{base:s,gray:u,red:d,linkText:r,primaryText:`#1f2937`,baseText:s===`#ffffff`?u[70]:xo(s,100),primary:r,secondary:i,primaryLight:xo(r,20),primaryDark:xo(r,-20),secondaryLight:xo(i,20),secondaryDark:xo(i,-20),danger:a,dangerLight:xo(a,20),dangerDark:xo(a,-20),warning:`#fbbf24`,warningTint:xo(`#fff3cd`,-10),warningLight:`#fff3cd`,success:`#047857`,successTint:xo(`#d4edda`,-10),successLight:`#d4edda`,info:`#0c5460`,infoTint:xo(`#d1ecf1`,-10),infoLight:`#d1ecf1`,white:l,formsBorder:u[30],formsBorderHover:u[40],formsBorderFocus:`transparent`,formsBorderDisabled:`#ccc`,formsBorderError:d[60],formsBorderWidth:`1px`,formsBorderRadius:`4px`,formsPadding:`8px`,formsBackground:u[`05`],formsBackgroundHover:l,formsBackgroundFocus:l,formsBackgroundDisabled:u[10],formsBackgroundError:d[`05`],formsText:u[60],formsTextDisabled:u[50],formsTextError:u[60],formsTextPlaceholder:u[40],formsError:d[60],formsShadow:`0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.06)`,selection:{background:xo(r,10),text:`#fff`},...c},shadows:{elevation0:`none`,elevation1:`0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.1)`,elevation2:`0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12)`,...n.shadows},borderRadius:{s:`4px`,m:`6px`,...n.borderRadius},focusRing:{width:`2px`,color:`rgba(64, 122, 230, 0.6)`,...n.focusRing},zIndex:Array.from({length:10}).map((e,t)=>t*100),cursor:{pointer:`pointer`,...n.cursor}},breakpoints:so}}var po=uo({id:`dmk-default`,colors:{primary:`#0074d9`,secondary:`#a2c14e`}}),mo=(0,x.createContext)({theme:po,setTheme:()=>{},darkMode:!1,setDarkMode:()=>!1,tokens:za(po.tokens)});function z({theme:e=po,children:t,injectCssCustomProperties:n=!0,allowDarkMode:r=!1,respectDefaultDarkMode:i=!1}){let[a,o]=(0,x.useState)(e);(0,x.useEffect)(()=>{o(e)},[e]);let s=(0,x.useMemo)(()=>lo(a),[a]),c=io(`(prefers-color-scheme: dark)`),[l,u]=ao(`dmk-dark-mode`,i?c:!1),d=l&&r?s:a,f=d.tokens.colors.base;return(0,x.useEffect)(()=>{let e=document.createElement(`div`);e.style.background=f,document.body.appendChild(e);let t=window.getComputedStyle(e).backgroundColor;document.body.removeChild(e),document.documentElement.style.setProperty(`--theme-color`,f);let n=document.querySelector(`meta[name="theme-color"]`);n??(n=document.createElement(`meta`),n.setAttribute(`name`,`theme-color`),document.head.appendChild(n)),n.setAttribute(`content`,Co(t))},[l,f]),(0,x.useInsertionEffect)(()=>{n&&bo(La(d.tokens)),document.body.setAttribute(`data-mode`,l?`dark`:`light`)},[d,n,l]),(0,L.jsx)(mo,{value:(0,x.useMemo)(()=>({theme:d,tokens:za(d.tokens),setTheme:o,darkMode:l,setDarkMode:u}),[d,l,u]),children:(0,L.jsx)(yo,{breakpoints:e.breakpoints,children:t})})}function ho(){return(0,x.use)(mo)}function go(){return(0,x.use)(vo)}function _o(){let{tokens:e}=ho();return e}var vo=Ua(`BreakpointsContext`,[!1,!1,!0]);function yo({breakpoints:e,children:t}){return(0,L.jsx)(vo,{value:io(e),children:t})}function bo(e){for(let t of Object.keys(e))document.documentElement.style.setProperty(`--${t}`,e[t])}function xo(e,t){return`#${e.replace(/^#/,``).replace(/../g,e=>`0${Math.min(255,Math.max(0,parseInt(e,16)+t)).toString(16)}`.slice(-2))}`}function So(e){e.startsWith(`#`)&&(e=e.slice(1));let[t,n,r,i]=[0,0,0,1];if(e.length===3)t=parseInt(`${e[0]}${e[0]}`,16),n=parseInt(`${e[1]}${e[1]}`,16),r=parseInt(`${e[2]}${e[2]}`,16),i=1;else if(e.length===4)t=parseInt(`${e[0]}${e[0]}`,16),n=parseInt(`${e[1]}${e[1]}`,16),r=parseInt(`${e[2]}${e[2]}`,16),i=parseInt(`${e[3]}${e[3]}`,16),i=+(i/255).toFixed(3);else if(e.length===6)t=parseInt(`${e[0]}${e[1]}`,16),n=parseInt(`${e[2]}${e[3]}`,16),r=parseInt(`${e[4]}${e[5]}`,16),i=1;else if(e.length===8)t=parseInt(`${e[0]}${e[1]}`,16),n=parseInt(`${e[2]}${e[3]}`,16),r=parseInt(`${e[4]}${e[5]}`,16),i=parseInt(`${e[6]}${e[7]}`,16),i=+(i/255).toFixed(3);else throw Error(`Invalid hex: ${e}`);return[t,n,r,i]}function Co(e){let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)/);if(!t)return`#ffffff`;let[,n,r,i,a]=t.map(Number),o=e=>{let t=Math.round(e).toString(16);return t.length===1?`0${t}`:t};if(a==null||isNaN(a)||a===1)return`#${o(n)}${o(r)}${o(i)}`;let s=Math.round(a*255);return`#${o(n)}${o(r)}${o(i)}${o(s)}`}function wo(e,t,n,r){e/=255,t/=255,n/=255;let i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,[s,c,l]=[0,0,0];return s=o===0?0:a===e?(t-n)/o%6:a===t?(n-e)/o+2:(e-t)/o+4,s=Math.round(s*60),s<0&&(s+=360),l=(a+i)/2,c=o===0?0:o/(1-Math.abs(2*l-1)),c=+(c*100).toFixed(1),l=+(l*100).toFixed(1),[s,c,l,r]}function To(e){return wo(...So(e))}var Eo=Ba(({as:e=`button`,variant:t=`contained`,intent:n=`none`,className:r,color:i,style:a,size:o,isPending:s,disabled:c,children:l,...u})=>{let d=Do({variant:t,intent:n,color:i,className:r,style:a,size:o});return(0,L.jsxs)(e,{"data-state":s?`pending`:`initial`,type:e===`button`?`button`:void 0,onTouchStart:()=>{},...u,...d,disabled:c||s,children:[(0,L.jsx)(`span`,{className:eo.content,children:l}),s&&(0,L.jsx)(`span`,{className:eo.spinner,children:(0,L.jsx)(no,{size:22,thickness:2})})]})});function Do({variant:e=`contained`,intent:t=`none`,color:n,style:r,size:i=`m`,className:a}={}){return{style:{...n&&{"--Button-color":n,"--Button-hoverColor":xo(n,20)},...r},className:(0,R.default)(eo.root,eo[e],eo[`intent-${t}`],eo[`size-${i}`],a)}}var Oo=m(),ko={root:`nwF8S`,checkbox:`_076Ml`,hiddenCheckbox:`vULBC`},Ao={vstack:`f-weF`,"stack--spacing-none":`_4n4EX`,hstack:`O-Obi`,"stack--spacing-xxs":`FpVz1`,"stack--spacing-xs":`yXJ18`,"stack--spacing-s":`fvPFs`,"stack--spacing-m":`_9zB8n`,"stack--spacing-l":`Fh5sy`,"stack--spacing-xl":`_1cgrL`,"stack--spacing-xxl":`nfwQY`,wrap:`NcK99`};function jo(e){let t=go();return Array.isArray(e)?No(t,e):e}function Mo(e){let t=go();return e.map(e=>Array.isArray(e)?No(t,e):e)}function No(e,t){for(let n=e.length-1;n>=0;--n)if(e[n])return t[n];throw Error(`Invalid breakpoint config. At least one of them should have min-width: 0px`)}function Po({height:e=`m`,horizontal:t=!1}){let[n,r]=Mo([e,t]),i=_o();return(0,L.jsx)(`div`,{style:{flexGrow:0,flexShrink:0,[r?`width`:`height`]:typeof n==`number`?n:i.spacing[n].valueOf()}})}function Fo(e){let t=_o(),{alignItems:n,alignSelf:r,justifyContent:i,paddingLeft:a,paddingRight:o,paddingTop:s,paddingBottom:c,paddingX:l,paddingY:u,padding:d,marginLeft:f,marginRight:p,marginTop:m,marginBottom:h,marginX:g,marginY:_,margin:v,...y}=e,[b,x,S]=Mo([i,n,r]),[C,w,T,E,D,O,k]=Mo([a,o,s,c,l,u,d]).map(e=>typeof e==`number`||e==null?e:t.spacing[e]),[A,j,ee,te,ne,re,M]=Mo([f,p,m,h,g,_,v]).map(e=>typeof e==`number`||e==null?e:t.spacing[e]),N={};return D!=null&&(N.paddingLeft=D.valueOf(),N.paddingRight=D.valueOf()),O!=null&&(N.paddingTop=O.valueOf(),N.paddingBottom=O.valueOf()),C!=null&&(N.paddingLeft=C.valueOf()),w!=null&&(N.paddingRight=w.valueOf()),T!=null&&(N.paddingTop=T.valueOf()),E!=null&&(N.paddingBottom=E.valueOf()),k!=null&&(N.padding=k.valueOf()),ne!=null&&(N.marginLeft=ne.valueOf(),N.marginRight=ne.valueOf()),re!=null&&(N.marginTop=ee?.valueOf(),N.marginBottom=te?.valueOf()),A!=null&&(N.marginLeft=A.valueOf()),j!=null&&(N.marginRight=j.valueOf()),ee!=null&&(N.marginTop=ee.valueOf()),te!=null&&(N.marginBottom=te.valueOf()),M!=null&&(N.margin=M.valueOf()),b!=null&&(N.justifyContent=b),x!=null&&(N.alignItems=x),S!=null&&(N.alignSelf=S),[N,y]}var Io=Ba(function({as:e=`div`,spacing:t=`m`,justifyContent:n=`flex-start`,alignItems:r=`stretch`,horizontal:i=!1,wrap:a=!1,...o}){let[s,c,l]=Mo([i,t,a]),[u,d]=Fo({alignItems:r,justifyContent:n,...o});return(0,L.jsx)(e,{...d,className:(0,R.default)(s?Ao.hstack:Ao.vstack,l&&Ao.wrap,o.className,typeof c!=`number`&&Ao[`stack--spacing-${c}`]),style:{...u,...o.style}})}),Lo=Ua(`CheckboxGroupContext`,null);function Ro({children:e,error:t,style:n,className:r,indeterminate:i,...a}){let o=zo(a);return(0,L.jsxs)(`label`,{"aria-disabled":o.disabled,"data-error":t,className:(0,R.default)(ko.root,r),style:n,children:[(0,L.jsx)(`input`,{type:`checkbox`,...a,className:(0,R.default)(`dmk-visually-hidden`,ko.hiddenCheckbox),"aria-checked":o.checked,"aria-invalid":t?`true`:`false`,"data-indeterminate":i,...o}),(0,L.jsx)(`span`,{className:ko.checkbox}),(0,L.jsx)(`span`,{children:e})]})}function zo(e){let t=(0,x.use)(Lo);return t==null?e:{value:e.value,name:t.name,checked:t.isChecked(e.value),disabled:t.disabled,onChange:t.onChange}}function Bo(...e){}function Vo(e,t){return Ho(e)?e(Uo(t)?t():t):e}function Ho(e){return typeof e==`function`}function Uo(e){return typeof e==`function`}function Wo(e,t){return typeof Object.hasOwn==`function`?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function Go(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ko(e){return e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``)}function qo(e,t){let n={...e};for(let e of t)Wo(n,e)&&delete n[e];return n}function Jo(e,t){let n={};for(let r of t)Wo(e,r)&&(n[r]=e[r]);return n}function Yo(e){return e}function Xo(e,t){if(!e)throw Error(typeof t==`string`?t:`Invariant failed`)}function Zo(e){return Object.keys(e)}function Qo(e,...t){let n=typeof e==`function`?e(...t):e;return n==null?!1:!n}function $o(e){return e.disabled||e[`aria-disabled`]===!0||e[`aria-disabled`]===`true`}function es(e){return e.getAttribute(`aria-disabled`)===`true`||`disabled`in e&&e.disabled===!0}function ts(e){let t={};for(let n in e)e[n]!==void 0&&(t[n]=e[n]);return t}function B(...e){for(let t of e)if(t!==void 0)return t}function ns(e,t){typeof e==`function`?e(t):e&&(e.current=t)}function rs(e){return!e||!(0,x.isValidElement)(e)?!1:`ref`in e.props||`ref`in e}function is(e){return rs(e)?{...e.props}.ref||e.ref:null}function as(e,t){let n={...e};for(let r in t){if(!Wo(t,r))continue;if(r===`className`){let r=`className`;n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if(r===`style`){let r=`style`;n[r]=e[r]?{...e[r],...t[r]}:t[r];continue}let i=t[r];if(typeof i==`function`&&r.startsWith(`on`)){let t=e[r];if(typeof t==`function`){n[r]=(...e)=>{i(...e),t(...e)};continue}}n[r]=i}return n}var os=ss();function ss(){return typeof window<`u`&&!!window.document?.createElement}function V(e){return e?`self`in e?e.document:e.ownerDocument||document:document}function cs(e){return e?`self`in e?e.self:V(e).defaultView||window:self}function ls(e,t=!1){let{activeElement:n}=V(e);if(!n?.nodeName)return null;if(ds(n)&&n.contentDocument?.body)return ls(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=V(n).getElementById(e);if(t)return t}}return n}function us(e,t){return e===t||e.contains(t)}function ds(e){return e.tagName===`IFRAME`}function fs(e){let t=e.tagName.toLowerCase();return t===`button`?!0:t===`input`&&e.type?ps.indexOf(e.type)!==-1:!1}var ps=[`button`,`color`,`file`,`image`,`reset`,`submit`];function ms(e){if(typeof e.checkVisibility==`function`)return e.checkVisibility();let t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function hs(e){try{let t=e instanceof HTMLInputElement&&e.selectionStart!==null,n=e.tagName===`TEXTAREA`;return t||n||!1}catch{return!1}}function gs(e){return e.isContentEditable||hs(e)}function _s(e){if(hs(e))return e.value;if(e.isContentEditable){let t=V(e).createRange();return t.selectNodeContents(e),t.toString()}return``}function vs(e){let t=0,n=0;if(hs(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){let r=V(e).getSelection();if(r?.rangeCount&&r.anchorNode&&us(e,r.anchorNode)&&r.focusNode&&us(e,r.focusNode)){let i=r.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),t=a.toString().length,a.setEnd(i.endContainer,i.endOffset),n=a.toString().length}}return{start:t,end:n}}function ys(e,t){let n=[`dialog`,`menu`,`listbox`,`tree`,`grid`],r=e?.getAttribute(`role`);return r&&n.indexOf(r)!==-1?r:t}function bs(e,t){let n={menu:`menuitem`,listbox:`option`,tree:`treeitem`},r=ys(e);return r?n[r]??t:t}function xs(e){if(!e)return null;let t=e=>e===`auto`||e===`scroll`;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:n}=getComputedStyle(e);if(t(n))return e}return xs(e.parentElement)||document.scrollingElement||document.body}function Ss(e,t){let n=e.map((e,t)=>[t,e]),r=!1;return n.sort(([e,n],[i,a])=>{let o=t(n),s=t(a);return o===s||!o||!s?0:Cs(o,s)?(e>i&&(r=!0),-1):(e<i&&(r=!0),1)}),r?n.map(([e,t])=>t):e}function Cs(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function ws(){return os&&!!navigator.maxTouchPoints}function Ts(){return os?/mac|iphone|ipad|ipod/i.test(navigator.platform):!1}function Es(){return os&&Ts()&&/apple/i.test(navigator.vendor)}function Ds(){return os&&/firefox\//i.test(navigator.userAgent)}function Os(){return os&&navigator.platform.startsWith(`Mac`)&&!ws()}function ks(e){return!!(e.currentTarget&&!us(e.currentTarget,e.target))}function As(e){return e.target===e.currentTarget}function js(e){let t=e.currentTarget;if(!t)return!1;let n=Ts();if(n&&!e.metaKey||!n&&!e.ctrlKey)return!1;let r=t.tagName.toLowerCase();return r===`a`||r===`button`&&t.type===`submit`||r===`input`&&t.type===`submit`}function Ms(e){let t=e.currentTarget;if(!t)return!1;let n=t.tagName.toLowerCase();return e.altKey?n===`a`||n===`button`&&t.type===`submit`||n===`input`&&t.type===`submit`:!1}function Ns(e,t,n){let r=new Event(t,n);return e.dispatchEvent(r)}function Ps(e,t){let n=new FocusEvent(`blur`,t),r=e.dispatchEvent(n),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent(`focusout`,i)),r}function Fs(e,t,n){let r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}function Is(e,t){let n=new MouseEvent(`click`,t);return e.dispatchEvent(n)}function Ls(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!us(n,r)}function Rs(e,t,n,r){let i=(e=>{if(r){let t=setTimeout(e,r);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{i(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),i}function zs(e,t,n,r=window){let i=[];try{r.document.addEventListener(e,t,n);for(let a of Array.from(r.frames))i.push(zs(e,t,n,a))}catch{}return()=>{try{r.document.removeEventListener(e,t,n)}catch{}for(let e of i)e()}}var Bs={...x},Vs=Bs.useId;Bs.useDeferredValue;var Hs=Bs.useInsertionEffect,Us=os?x.useLayoutEffect:x.useEffect;function Ws(e){let t=(0,x.useRef)(e);return Us(()=>{t.current=e}),t}function H(e){let t=(0,x.useRef)(()=>{throw Error(`Cannot call an event handler while rendering.`)});return Hs?Hs(()=>{t.current=e}):t.current=e,(0,x.useCallback)((...e)=>t.current?.call(t,...e),[])}function Gs(e){let[t,n]=(0,x.useState)(null);return Us(()=>{if(t==null||!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}function Ks(...e){return(0,x.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let n of e)ns(n,t)}},e)}function qs(e){if(Vs){let t=Vs();return e||t}let[t,n]=(0,x.useState)(e);return Us(()=>{e||t||n(`id-${Math.random().toString(36).slice(2,8)}`)},[e,t]),e||t}function Js(e,t){let n=e=>{if(typeof e==`string`)return e},[r,i]=(0,x.useState)(()=>n(t));return Us(()=>{i((e&&`current`in e?e.current:e)?.tagName.toLowerCase()||n(t))},[e,t]),r}function Ys(e,t){let n=(0,x.useRef)(!1);(0,x.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,x.useEffect)(()=>()=>{n.current=!1},[])}function Xs(){return(0,x.useReducer)(()=>[],[])}function Zs(e){return H(typeof e==`function`?e:()=>e)}function Qs(e,t,n=[]){let r=(0,x.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return{...e,wrapElement:r}}function $s(e=!1,t){let[n,r]=(0,x.useState)(null);return{portalRef:Ks(r,t),portalNode:n,domReady:!e||n}}function ec(e,t,n){let r=e.onLoadedMetadataCapture,i=(0,x.useMemo)(()=>Object.assign(()=>{},r,...n===void 0?[]:[{[t]:n}]),[r,t,n]);return[r?.[t],{onLoadedMetadataCapture:i}]}var tc=!1;function nc(){return(0,x.useEffect)(()=>{tc||=(zs(`mousemove`,sc,!0),zs(`mousedown`,cc,!0),zs(`mouseup`,cc,!0),zs(`keydown`,cc,!0),zs(`scroll`,cc,!0),!0)},[]),H(()=>rc)}var rc=!1,ic=0,ac=0;function oc(e){let t=e.movementX||e.screenX-ic,n=e.movementY||e.screenY-ac;return ic=e.screenX,ac=e.screenY,t||n||!1}function sc(e){oc(e)&&(rc=!0)}function cc(){rc=!1}function U(e){let t=x.forwardRef((t,n)=>e({...t,ref:n}));return t.displayName=e.displayName||e.name,t}function lc(e,t){return x.memo(e,t)}function W(e,t){let{wrapElement:n,render:r,...i}=t,a=Ks(t.ref,is(r)),o;if(x.isValidElement(r)){let e={...r.props,ref:a};o=x.cloneElement(r,as(i,e))}else o=r?r(i):(0,L.jsx)(e,{...i});return n?n(o):o}function G(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function uc(e=[],t=[]){let n=x.createContext(void 0),r=x.createContext(void 0),i=()=>x.useContext(n),a=(e=!1)=>{let t=x.useContext(r),n=i();return e?t:t||n},o=()=>{let e=x.useContext(r),t=i();if(!(e&&e===t))return t},s=t=>e.reduceRight((e,n)=>(0,L.jsx)(n,{...t,children:e}),(0,L.jsx)(n.Provider,{...t}));return{context:n,scopedContext:r,useContext:i,useScopedContext:a,useProviderContext:o,ContextProvider:s,ScopedContextProvider:e=>(0,L.jsx)(s,{...e,children:t.reduceRight((t,n)=>(0,L.jsx)(n,{...e,children:t}),(0,L.jsx)(r.Provider,{...e}))})}}var dc=uc(),fc=dc.useContext;dc.useScopedContext,dc.useProviderContext;var pc=dc.ContextProvider,mc=dc.ScopedContextProvider,hc=uc([pc],[mc]),gc=hc.useContext;hc.useScopedContext;var _c=hc.useProviderContext,vc=hc.ContextProvider,yc=hc.ScopedContextProvider,bc=(0,x.createContext)(void 0),xc=(0,x.createContext)(void 0),Sc={id:null};function Cc(e,t,n=!1){let r=e.findIndex(e=>e.id===t);return[...e.slice(r+1),...n?[Sc]:[],...e.slice(0,r)]}function wc(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Tc(e,t){return t&&e.item(t)||null}function Ec(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function Dc(e,t=!1){if(hs(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let n=V(e).getSelection();n?.selectAllChildren(e),t&&n?.collapseToEnd()}}var Oc=Symbol(`FOCUS_SILENTLY`);function kc(e){e[Oc]=!0,e.focus({preventScroll:!0})}function Ac(e){let t=e[Oc];return delete e[Oc],t}function jc(e,t,n){if(!t||t===n)return!1;let r=e.item(t.id);return!(!r||n&&r.element===n)}var Mc=`div`,Nc=G(function({store:e,shouldRegisterItem:t=!0,getItem:n=Yo,element:r,...i}){let a=fc();e||=a;let o=qs(i.id),s=(0,x.useRef)(r);return(0,x.useEffect)(()=>{let r=s.current;if(!o||!r||!t)return;let i=n({id:o,element:r});return e?.renderItem(i)},[o,t,n,e]),i={...i,ref:Ks(s,i.ref)},ts(i)});U(function(e){return W(Mc,Nc(e))});var Pc=(0,x.createContext)(!0),Fc=`input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])`;function Ic(e){return Number.parseInt(e.getAttribute(`tabindex`)||`0`,10)<0}function Lc(e){return!(!e.matches(Fc)||!ms(e)||e.closest(`[inert]`))}function Rc(e){if(!Lc(e)||Ic(e))return!1;if(!(`form`in e)||!e.form||e.checked||e.type!==`radio`)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!(`length`in t))return!0;let n=ls(e);return!n||n===e||!(`form`in n)||n.form!==e.form||n.name!==e.name}function zc(e,t){let n=Array.from(e.querySelectorAll(Fc));t&&n.unshift(e);let r=n.filter(Lc);return r.forEach((e,t)=>{if(!ds(e))return;let n=e.contentDocument?.body;n&&r.splice(t,1,...zc(n))}),r}function Bc(e,t,n){let r=Array.from(e.querySelectorAll(Fc)),i=r.filter(Rc);return t&&Rc(e)&&i.unshift(e),i.forEach((e,t)=>{if(!ds(e))return;let r=e.contentDocument?.body;if(!r)return;let a=Bc(r,!1,n);i.splice(t,1,...a)}),!i.length&&n?r:i}function Vc(e,t,n){let[r]=Bc(e,t,n);return r||null}function Hc(e,t,n,r){let i=ls(e),a=zc(e,t),o=a.indexOf(i),s=a.slice(o+1);return s.find(Rc)||(n?a.find(Rc):null)||(r?s[0]:null)||null}function Uc(e,t){return Hc(document.body,!1,e,t)}function Wc(e,t,n,r){let i=ls(e),a=zc(e,t).reverse(),o=a.indexOf(i),s=a.slice(o+1);return s.find(Rc)||(n?a.find(Rc):null)||(r?s[0]:null)||null}function Gc(e,t){return Wc(document.body,!1,e,t)}function Kc(e){let t=ls(e);if(!t)return!1;if(t===e)return!0;let n=t.getAttribute(`aria-activedescendant`);return n?n===e.id:!1}function qc(e){let t=ls(e);if(!t)return!1;if(us(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);return!n||!(`id`in e)?!1:n===e.id?!0:!!e.querySelector(`#${CSS.escape(n)}`)}function Jc(e){let t=e.getAttribute(`tabindex`)??``;e.setAttribute(`data-tabindex`,t),e.setAttribute(`tabindex`,`-1`)}function Yc(e,t){let n=Bc(e,t);for(let e of n)Jc(e)}function Xc(e){let t=e.querySelectorAll(`[data-tabindex]`),n=e=>{let t=e.getAttribute(`data-tabindex`);e.removeAttribute(`data-tabindex`),t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)};e.hasAttribute(`data-tabindex`)&&n(e);for(let e of t)n(e)}function Zc(e,t){`scrollIntoView`in e?(e.focus({preventScroll:!0}),e.scrollIntoView({block:`nearest`,inline:`nearest`,...t})):e.focus()}var Qc=`div`,$c=Symbol(`accessibleWhenDisabled`),el=Es(),tl=[`text`,`search`,`url`,`tel`,`email`,`password`,`number`,`date`,`month`,`week`,`time`,`datetime`,`datetime-local`];function nl(e){let{tagName:t,readOnly:n,type:r}=e;return t===`TEXTAREA`&&!n||t===`SELECT`&&!n?!0:t===`INPUT`&&!n?tl.includes(r):!!(e.isContentEditable||e.getAttribute(`role`)===`combobox`&&e.dataset.name)}function rl(e){return e?e===`button`||e===`summary`||e===`input`||e===`select`||e===`textarea`||e===`a`:!0}function il(e){return e?e===`button`||e===`input`||e===`select`||e===`textarea`:!0}var al=[`button`,`color`,`file`,`image`,`reset`,`submit`];function ol(e,t){return e===`button`?!0:e===`input`&&t?t===`checkbox`||t===`radio`?!0:al.includes(t):!1}function sl({focusable:e,trulyDisabled:t,nativeTabbable:n,supportsDisabled:r,safariTabIndex:i,tabIndexProp:a}){return e?t?n&&!r?-1:void 0:n?i&&a==null?0:a:a??0:a}function cl(e,t){return H(n=>{e?.(n),!n.defaultPrevented&&t&&(n.stopPropagation(),n.preventDefault())})}var ll=!1,ul=!0;function dl(e){let t=e.target;t&&`hasAttribute`in t&&(t.hasAttribute(`data-focus-visible`)||(ul=!1))}function fl(e){e.metaKey||e.ctrlKey||e.altKey||(ul=!0)}var pl=G(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:n,onFocusVisible:r,...i}){let a=(0,x.useRef)(null),[o,s]=ec(i,$c,t);t??=o,(0,x.useEffect)(()=>{e&&(ll||=(zs(`mousedown`,dl,!0),zs(`keydown`,fl,!0),!0))},[e]);let c=e&&$o(i),l=!!c&&!t,[u,d]=(0,x.useState)(!1);(0,x.useEffect)(()=>{e&&l&&u&&d(!1)},[e,l,u]),(0,x.useEffect)(()=>{if(!e||!u)return;let t=a.current;if(!t||typeof IntersectionObserver>`u`)return;let n=new IntersectionObserver(()=>{Lc(t)||d(!1)});return n.observe(t),()=>n.disconnect()},[e,u]);let f=cl(i.onKeyPressCapture,c),p=cl(i.onMouseDownCapture,c),m=cl(i.onClickCapture,c),h=(t,n)=>{if(n&&(t.currentTarget=n),!e)return;let i=t.currentTarget;i&&Kc(i)&&(r?.(t),!t.defaultPrevented&&(i.dataset.focusVisible=`true`,d(!0)))},g=i.onKeyDownCapture,_=H(t=>{if(g?.(t),t.defaultPrevented||!e||u||t.metaKey||t.altKey||t.ctrlKey||!As(t))return;let n=t.currentTarget;Rs(n,`focusout`,()=>h(t,n))}),v=i.onFocusCapture,y=H(t=>{if(v?.(t),t.defaultPrevented||!e)return;if(!As(t)){d(!1);return}let n=t.currentTarget;ul||nl(t.target)?Rs(t.target,`focusout`,()=>h(t,n)):d(!1)}),b=i.onBlur,S=H(t=>{b?.(t),e&&Ls(t)&&(t.currentTarget.removeAttribute(`data-focus-visible`),d(!1))}),C=(0,x.useContext)(Pc),w=H(t=>{e&&n&&t&&C&&queueMicrotask(()=>{Kc(t)||Lc(t)&&t.focus()})}),T=Js(a),E=e&&rl(T),D=e&&il(T),[O,k]=(0,x.useState)(!1);el&&(0,x.useEffect)(()=>{if(!e)return;let t=a.current;if(!t)return;let n=t.tagName.toLowerCase(),r=t.type;k(ol(n,r))},[e]);let A=i.style,j=(0,x.useMemo)(()=>l?{pointerEvents:`none`,...A}:A,[l,A]);return i={"data-focus-visible":e&&u||void 0,"data-autofocus":n||void 0,"aria-disabled":c||void 0,...i,...s,ref:Ks(a,w,i.ref),style:j,tabIndex:sl({focusable:e,trulyDisabled:l,nativeTabbable:E,supportsDisabled:D,safariTabIndex:O,tabIndexProp:i.tabIndex}),disabled:D&&l?!0:void 0,contentEditable:c?void 0:i.contentEditable,onKeyPressCapture:f,onClickCapture:m,onMouseDownCapture:p,onKeyDownCapture:_,onFocusCapture:y,onBlur:S},ts(i)});U(function(e){return W(Qc,pl(e))});var ml=`button`;function hl(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return e.key===`Enter`?fs(t)||t.tagName===`SUMMARY`||t.tagName===`A`:e.key===` `?fs(t)||t.tagName===`SUMMARY`||t.tagName===`INPUT`||t.tagName===`SELECT`:!1}var gl=Symbol(`command`),_l=G(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let r=(0,x.useRef)(null),[i,a]=(0,x.useState)(!1);(0,x.useEffect)(()=>{r.current&&a(fs(r.current))},[]);let[o,s]=(0,x.useState)(!1),c=(0,x.useRef)(!1),l=$o(n),[u,d]=ec(n,gl,!0),f=n.onKeyDown,p=H(n=>{f?.(n);let r=n.currentTarget;if(n.defaultPrevented||u||l||!As(n)||hs(r)||r.isContentEditable)return;let i=e&&n.key===`Enter`,a=t&&n.key===` `,o=n.key===`Enter`&&!e,d=n.key===` `&&!t;if(o||d){n.preventDefault();return}if(i||a){let e=hl(n);if(i){if(!e){n.preventDefault();let{view:e,...t}=n,i=()=>Is(r,t);Ds()?Rs(r,`keyup`,i):queueMicrotask(i)}}else a&&(c.current=!0,e||(n.preventDefault(),s(!0)))}}),m=n.onKeyUp,h=H(e=>{if(m?.(e),e.defaultPrevented||u||l||e.metaKey)return;let n=t&&e.key===` `;if(c.current&&n&&(c.current=!1,!hl(e))){e.preventDefault(),s(!1);let t=e.currentTarget,{view:n,...r}=e;queueMicrotask(()=>Is(t,r))}});return n={"data-active":o||void 0,type:i?`button`:void 0,...d,...n,ref:Ks(r,n.ref),onKeyDown:p,onKeyUp:h},n=pl(n),n});U(function(e){return W(ml,_l(e))});function vl(e,t){let n=e.__unstableInternals;return Xo(n,`Invalid store`),n[t]}function yl(e,...t){let n=e,r=n,i=Symbol(),a=Bo,o=new Set,s=new Set,c=new Set,l=new Set,u=new Set,d=new WeakMap,f=new WeakMap,p=e=>(c.add(e),()=>c.delete(e)),m=()=>{let e=o.size,r=Symbol();o.add(r);let i=()=>{o.delete(r),!o.size&&a()};if(e)return i;let s=Zo(n).map(e=>Go(...t.map(t=>{let n=(t?.getState)?.call(t);if(n&&Wo(n,e))return Cl(t,[e],t=>{S(e,t[e],!0)})}))),l=[];for(let e of c)l.push(e());let u=t.map(xl);return a=Go(...s,...l,...u),i},h=(e,t,n=l)=>(n.add(t),f.set(t,e),()=>{var e;(e=d.get(t))==null||e(),d.delete(t),f.delete(t),n.delete(t)}),g=(e,t)=>h(e,t),_=(e,t)=>(d.set(t,t(n,n)),h(e,t)),v=(e,t)=>(d.set(t,t(n,r)),h(e,t,u)),y=e=>yl(Jo(n,e),C),b=e=>yl(qo(n,e),C),x=()=>n,S=(e,a,o=!1)=>{var c;if(!Wo(n,e))return;let p=Vo(a,n[e]);if(p===n[e])return;if(!o)for(let n of t)(c=n?.setState)==null||c.call(n,e,p);let m=n;n={...n,[e]:p};let h=Symbol();i=h,s.add(e);let g=(t,r,i)=>{var a;let o=f.get(t);(!o||o.some(t=>i?i.has(t):t===e))&&((a=d.get(t))==null||a(),d.set(t,t(n,r)))};for(let e of l)g(e,m);queueMicrotask(()=>{if(i!==h)return;let e=n;for(let e of u)g(e,r,s);r=e,s.clear()})},C={getState:x,setState:S,__unstableInternals:{setup:p,init:m,subscribe:g,sync:_,batch:v,pick:y,omit:b}};return C}function bl(e,...t){if(e)return vl(e,`setup`)(...t)}function xl(e,...t){if(e)return vl(e,`init`)(...t)}function Sl(e,...t){if(e)return vl(e,`subscribe`)(...t)}function Cl(e,...t){if(e)return vl(e,`sync`)(...t)}function wl(e,...t){if(e)return vl(e,`batch`)(...t)}function Tl(e,...t){if(e)return vl(e,`omit`)(...t)}function El(e,...t){if(e)return vl(e,`pick`)(...t)}function Dl(...e){let t={};for(let n of e){let e=(n?.getState)?.call(n);e&&Object.assign(t,e)}let n=yl(t,...e);return Object.assign({},...e,n)}var Ol=o((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),kl=o(((e,t)=>{t.exports=Ol()}))(),Al=()=>()=>{};function K(e,t=Yo){let n=x.useCallback(t=>e?Sl(e,null,t):Al(),[e]),r=()=>{let n=typeof t==`string`?t:null,r=typeof t==`function`?t:null,i=e?.getState();if(r)return r(i);if(i&&n&&Wo(i,n))return i[n]};return(0,kl.useSyncExternalStore)(n,r,r)}function jl(e,t){let n=x.useRef({}),r=x.useCallback(t=>e?Sl(e,null,t):Al(),[e]),i=()=>{let r=e?.getState(),i=!1,a=n.current;for(let e in t){let n=t[e];if(typeof n==`function`){let t=n(r);t!==a[e]&&(a[e]=t,i=!0)}if(typeof n==`string`){if(!r||!Wo(r,n))continue;let t=r[n];t!==a[e]&&(a[e]=t,i=!0)}}return i&&(n.current={...a}),n.current};return(0,kl.useSyncExternalStore)(r,i,i)}function Ml(e,t,n,r){let i=Wo(t,n)?t[n]:void 0,a=Ws({value:i,setValue:r?t[r]:void 0});Us(()=>Cl(e,[n],(e,t)=>{let{value:r,setValue:i}=a.current;i&&e[n]!==t[n]&&e[n]!==r&&i(e[n])}),[e,n]),Us(()=>{if(i!==void 0)return e.setState(n,i),wl(e,[n],()=>{i!==void 0&&e.setState(n,i)})})}function Nl(e,t){let[n,r]=x.useState(()=>e(t));Us(()=>xl(n),[n]);let i=x.useCallback(e=>K(n,e),[n]);return[x.useMemo(()=>({...n,useState:i}),[n,i]),H(()=>{r(n=>e({...t,...n.getState()}))})]}var Pl=`button`;function Fl(e){return gs(e)?!0:e.tagName===`INPUT`&&!fs(e)}function Il(e,t=!1){let n=e.clientHeight,{top:r}=e.getBoundingClientRect(),i=Math.max(n*.875,n-40)*1.5,a=t?n-i+r:i+r;return e.tagName===`HTML`?a+e.scrollTop:a}function Ll(e,t=!1){let{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function q(e,t,n,r=!1){if(!t||!n)return;let{renderedItems:i}=t.getState(),a=xs(e);if(!a)return;let o=Il(a,r),s,c;for(let e=0;e<i.length;e+=1){let i=s;if(s=n(e),!s)break;if(s===i)continue;let a=Tc(t,s)?.element;if(!a)continue;let l=Ll(a,r)-o,u=Math.abs(l);if(r&&l<=0||!r&&l>=0){c!==void 0&&c<u&&(s=i);break}c=u}return s}function Rl(e,t){return As(e)?!1:jc(t,e.target)}var J=G(function({store:e,rowId:t,preventScrollOnKeyDown:n=!1,moveOnKeyPress:r=!0,tabbable:i=!1,getItem:a,"aria-setsize":o,"aria-posinset":s,...c}){let l=gc();e||=l;let u=qs(c.id),d=(0,x.useRef)(null),f=(0,x.useContext)(xc),p=$o(c)&&!c.accessibleWhenDisabled,{rowId:m,baseElement:h,isActiveItem:g,ariaSetSize:_,ariaPosInSet:v,isTabbable:y}=jl(e,{rowId(e){if(t)return t;if(e&&f?.baseElement&&f.baseElement===e.baseElement)return f.id},baseElement(e){return e?.baseElement||void 0},isActiveItem(e){return!!e&&e.activeId===u},ariaSetSize(e){if(o!=null)return o;if(e&&f?.ariaSetSize&&f.baseElement===e.baseElement)return f.ariaSetSize},ariaPosInSet(e){if(s!=null)return s;if(!e||!f?.ariaPosInSet||f.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===m);return f.ariaPosInSet+t.findIndex(e=>e.id===u)},isTabbable(t){if(!t?.renderedItems.length)return!0;if(t.virtualFocus)return!1;if(i)return!0;if(t.activeId===null)return!1;let n=e?.item(t.activeId);return n?.disabled||!n?.element?!0:t.activeId===u}}),b=(0,x.useCallback)(e=>{let t={...e,id:u||e.id,rowId:m,disabled:!!p,children:e.element?.textContent};return a?a(t):t},[u,m,p,a]),S=c.onFocus,C=(0,x.useRef)(!1),w=H(t=>{if(S?.(t),t.defaultPrevented||ks(t)||!u||!e||Rl(t,e))return;let{virtualFocus:n,baseElement:r}=e.getState();e.setActiveId(u),gs(t.currentTarget)&&Dc(t.currentTarget),n&&As(t)&&(Fl(t.currentTarget)||r?.isConnected&&(Es()&&t.currentTarget.hasAttribute(`data-autofocus`)&&t.currentTarget.scrollIntoView({block:`nearest`,inline:`nearest`}),C.current=!0,t.relatedTarget===r||jc(e,t.relatedTarget)?kc(r):r.focus()))}),T=c.onBlurCapture,E=H(t=>{T?.(t),!t.defaultPrevented&&e?.getState()?.virtualFocus&&C.current&&(C.current=!1,t.preventDefault(),t.stopPropagation())}),D=c.onKeyDown,O=Zs(n),k=Zs(r),A=H(t=>{if(D?.(t),t.defaultPrevented||!As(t)||!e)return;let{currentTarget:n}=t,r=e.getState(),i=!!e.item(u)?.rowId,a=r.orientation!==`horizontal`,o=r.orientation!==`vertical`,s=()=>!!(i||o||!r.baseElement||!hs(r.baseElement)),c={ArrowUp:(i||a)&&e.up,ArrowRight:(i||o)&&e.next,ArrowDown:(i||a)&&e.down,ArrowLeft:(i||o)&&e.previous,Home:()=>{if(s())return!i||t.ctrlKey?e?.first():e?.previous(-1)},End:()=>{if(s())return!i||t.ctrlKey?e?.last():e?.next(-1)},PageUp:()=>q(n,e,e?.up,!0),PageDown:()=>q(n,e,e?.down)}[t.key];if(c){if(gs(n)){let e=vs(n),r=o&&t.key===`ArrowLeft`,i=o&&t.key===`ArrowRight`,s=a&&t.key===`ArrowUp`,c=a&&t.key===`ArrowDown`;if(i||c){let{length:t}=_s(n);if(e.end!==t)return}else if((r||s)&&e.start!==0)return}let r=c();if(O(t)||r!==void 0){if(!k(t))return;t.preventDefault(),e.move(r)}}}),j=(0,x.useMemo)(()=>({id:u,baseElement:h}),[u,h]);return c=Qs(c,e=>(0,L.jsx)(bc.Provider,{value:j,children:e}),[j]),c={"data-active-item":g||void 0,...c,id:u,ref:Ks(d,c.ref),tabIndex:y?c.tabIndex:-1,onFocus:w,onBlurCapture:E,onKeyDown:A},c=_l(c),c=Nc({store:e,...c,getItem:b,shouldRegisterItem:u?c.shouldRegisterItem:!1}),ts({...c,"aria-setsize":_,"aria-posinset":v})});lc(U(function(e){return W(Pl,J(e))}));function Y(e){let t=[];for(let n of e)t.push(...n);return t}function X(e){return e.slice().reverse()}var zl=`div`;function Bl(e){return e.some(e=>!!e.rowId)}function Vl(e){let t=e.target;return t&&!hs(t)?!1:e.key.length===1&&!e.ctrlKey&&!e.metaKey}function Hl(e){return e.key===`Shift`||e.key===`Control`||e.key===`Alt`||e.key===`Meta`}function Ul(e,t,n){return H(r=>{if(t?.(r),r.defaultPrevented||r.isPropagationStopped()||!As(r)||Hl(r)||Vl(r))return;let i=Tc(e,e.getState().activeId)?.element;if(!i)return;let{view:a,...o}=r;i!==n?.current&&i.focus(),Fs(i,r.type,o)||r.preventDefault(),r.currentTarget.contains(i)&&r.stopPropagation()})}function Wl(e){return wc(Y(X(Ec(e))))}function Gl(e,t){let{virtualFocus:n,baseElement:r}=e.getState();if(!n||!r||!hs(r)){t();return}let i=r.scrollLeft,a=r.scrollTop;t(),r.scrollLeft=i,r.scrollTop=a}function Kl(e){let[t,n]=(0,x.useState)(!1),r=(0,x.useCallback)(()=>n(!0),[]),i=K(e,t=>Tc(e,t.activeId));return(0,x.useEffect)(()=>{let r=i?.element;t&&r&&(n(!1),Gl(e,()=>{r.focus({preventScroll:!0})}))},[e,i,t]),r}var ql=G(function({store:e,composite:t=!0,focusOnMove:n=t,moveOnKeyPress:r=!0,...i}){let a=_c();e||=a,Xo(e,!1);let o=(0,x.useRef)(null),s=(0,x.useRef)(null),c=Kl(e),l=K(e,`moves`),[,u]=Gs(t?e.setBaseElement:null);(0,x.useEffect)(()=>{if(!e||!l||!t||!n)return;let{activeId:r}=e.getState(),i=Tc(e,r)?.element;i&&Gl(e,()=>Zc(i))},[e,l,t,n]),Us(()=>{if(!e||!l||!t)return;let{baseElement:n,activeId:r}=e.getState();if(r!==null||!n)return;let i=s.current;s.current=null,i&&Ps(i,{relatedTarget:n}),Kc(n)||n.focus()},[e,l,t]);let d=K(e,`activeId`),f=K(e,`virtualFocus`);Us(()=>{if(!e||!t||!f)return;let n=s.current;if(s.current=null,!n)return;let r=Tc(e,d)?.element||ls(n);r!==n&&Ps(n,{relatedTarget:r})},[e,d,f,t]);let p=Ul(e,i.onKeyDownCapture,s),m=Ul(e,i.onKeyUpCapture,s),h=i.onFocusCapture,g=H(t=>{if(h?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n}=e.getState();if(!n)return;let r=t.relatedTarget,i=Ac(t.currentTarget);As(t)&&i&&(t.stopPropagation(),s.current=r)}),_=i.onFocus,v=H(n=>{if(_?.(n),n.defaultPrevented||!t||!e)return;let{relatedTarget:r}=n,{virtualFocus:i}=e.getState();i?As(n)&&!jc(e,r)&&queueMicrotask(c):As(n)&&e.setActiveId(null)}),y=i.onBlurCapture,b=H(t=>{if(y?.(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:r}=e.getState();if(!n)return;let i=Tc(e,r)?.element,a=t.relatedTarget,o=jc(e,a),c=s.current;s.current=null,As(t)&&o?(a===i?c&&c!==a&&Ps(c,t):i?Ps(i,t):c&&Ps(c,t),t.stopPropagation()):!jc(e,t.target)&&i&&Ps(i,t)}),S=i.onKeyDown,C=Zs(r),w=H(t=>{if(S?.(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!As(t))return;let{orientation:n,renderedItems:r,activeId:i}=e.getState();if(Tc(e,i)?.element?.isConnected)return;let a=n!==`horizontal`,o=n!==`vertical`,s=Bl(r);if((t.key===`ArrowLeft`||t.key===`ArrowRight`||t.key===`Home`||t.key===`End`)&&hs(t.currentTarget))return;let c={ArrowUp:(s||a)&&(()=>s?Wl(r)?.id:e?.last()),ArrowRight:(s||o)&&e.first,ArrowDown:(s||a)&&e.first,ArrowLeft:(s||o)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let n=c();if(n!==void 0){if(!C(t))return;t.preventDefault(),e.move(n)}}});return i=Qs(i,t=>(0,L.jsx)(vc,{value:e,children:t}),[e]),i={"aria-activedescendant":K(e,n=>{if(e&&t&&n.virtualFocus)return Tc(e,n.activeId)?.id}),...i,ref:Ks(o,u,i.ref),onKeyDownCapture:p,onKeyUpCapture:m,onFocusCapture:g,onFocus:v,onBlurCapture:b,onKeyDown:w},i=pl({focusable:K(e,e=>t&&(e.virtualFocus||e.activeId===null)),...i}),i});U(function(e){return W(zl,ql(e))});var Jl=uc();Jl.useContext,Jl.useScopedContext;var Yl=Jl.useProviderContext,Xl=Jl.ContextProvider,Zl=Jl.ScopedContextProvider,Ql=uc([Xl],[Zl]);Ql.useContext;var $l=Ql.useScopedContext,eu=Ql.useProviderContext,tu=Ql.ContextProvider,nu=Ql.ScopedContextProvider,ru=(0,x.createContext)(void 0),iu=(0,x.createContext)(void 0),au=`div`;function ou(e,t){let n=setTimeout(t,e);return()=>clearTimeout(n)}function su(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}function cu(...e){return e.join(`, `).split(`, `).reduce((e,t)=>{let n=t.endsWith(`ms`)?1:1e3,r=Number.parseFloat(t||`0s`)*n;return r>e?r:e},0)}function lu(e,t,n){return!n&&t!==!1&&(!e||!!t)}var uu=G(function({store:e,alwaysVisible:t,...n}){let r=Yl();e||=r,Xo(e,!1);let i=(0,x.useRef)(null),a=qs(n.id),[o,s]=(0,x.useState)(null),c=K(e,`open`),l=K(e,`mounted`),u=K(e,`animated`),d=K(e,`contentElement`),f=K(e.disclosure,`contentElement`);Us(()=>{i.current&&e?.setContentElement(i.current)},[e]),Us(()=>{let t;return e?.setState(`animated`,e=>(t=e,!0)),()=>{t!==void 0&&e?.setState(`animated`,t)}},[e]),Us(()=>{if(u){if(!d?.isConnected){s(null);return}return su(()=>{s(c?`enter`:l?`leave`:null)})}},[u,d,c,l]),Us(()=>{if(!e||!u||!o||!d)return;let t=()=>e?.setState(`animating`,!1),n=()=>(0,Oo.flushSync)(t);if(o===`leave`&&c||o===`enter`&&!c)return;if(typeof u==`number`)return ou(u,n);let{transitionDuration:r,animationDuration:i,transitionDelay:a,animationDelay:s}=getComputedStyle(d),{transitionDuration:l=`0`,animationDuration:p=`0`,transitionDelay:m=`0`,animationDelay:h=`0`}=f?getComputedStyle(f):{},g=cu(a,s,m,h)+cu(r,i,l,p);if(!g){o===`enter`&&e.setState(`animated`,!1),t();return}return ou(Math.max(g-1e3/60,0),n)},[e,u,d,f,c,o]),n=Qs(n,t=>(0,L.jsx)(nu,{value:e,children:t}),[e]);let p=lu(l,n.hidden,t),m=n.style,h=(0,x.useMemo)(()=>p?{...m,display:`none`}:m,[p,m]);return n={"data-open":c||void 0,"data-enter":o===`enter`||void 0,"data-leave":o===`leave`||void 0,hidden:p,...n,id:a,ref:Ks(a?e.setContentElement:null,i,n.ref),style:h},ts(n)}),du=U(function(e){return W(au,uu(e))});U(function({unmountOnHide:e,...t}){let n=Yl();return K(t.store||n,t=>!e||t?.mounted)===!1?null:(0,L.jsx)(du,{...t})});function fu(e={}){let t=Dl(e.store,Tl(e.disclosure,[`contentElement`,`disclosureElement`])),n=t?.getState(),r=B(e.open,n?.open,e.defaultOpen,!1),i=B(e.animated,n?.animated,!1),a=yl({open:r,animated:i,animating:!!i&&r,mounted:r,contentElement:B(n?.contentElement,null),disclosureElement:B(n?.disclosureElement,null)},t);return bl(a,()=>Cl(a,[`animated`,`animating`],e=>{e.animated||a.setState(`animating`,!1)})),bl(a,()=>Sl(a,[`open`],()=>{a.getState().animated&&a.setState(`animating`,!0)})),bl(a,()=>Cl(a,[`open`,`animating`],e=>{a.setState(`mounted`,e.open||e.animating)})),{...a,disclosure:e.disclosure,setOpen:e=>a.setState(`open`,e),show:()=>a.setState(`open`,!0),hide:()=>a.setState(`open`,!1),toggle:()=>a.setState(`open`,e=>!e),stopAnimation:()=>a.setState(`animating`,!1),setContentElement:e=>a.setState(`contentElement`,e),setDisclosureElement:e=>a.setState(`disclosureElement`,e)}}function pu(e,t,n){return Ys(t,[n.store,n.disclosure]),Ml(e,n,`open`,`setOpen`),Ml(e,n,`mounted`,`setMounted`),Ml(e,n,`animated`),Object.assign(e,{disclosure:n.disclosure})}function mu(e={}){let[t,n]=Nl(fu,e);return pu(t,n,e)}var hu=uc([tu],[nu]);hu.useContext,hu.useScopedContext;var gu=hu.useProviderContext,_u=hu.ContextProvider,vu=hu.ScopedContextProvider;function yu(e){let t=e.find(e=>!!e.element),n=[...e].reverse().find(e=>!!e.element)?.element,r=t?.element?.parentElement;if(!n)return V(r).body;for(;r;){if(r.contains(n))return r;r=r.parentElement}return V(r).body}function bu(e){return e?.__unstablePrivateStore}function xu(e={}){e.store;let t=e.store?.getState(),n=B(e.items,t?.items,e.defaultItems,[]),r=new Map(n.map(e=>[e.id,e])),i={items:n,renderedItems:B(t?.renderedItems,[])},a=bu(e.store),o=yl({items:n,renderedItems:i.renderedItems},a),s=yl(i,e.store),c=e=>{let t=Ss(e,e=>e.element);o.setState(`renderedItems`,t),s.setState(`renderedItems`,t)};bl(s,()=>xl(o)),bl(o,()=>wl(o,[`items`],e=>{s.setState(`items`,e.items)})),bl(o,()=>wl(o,[`renderedItems`],e=>{let t=!0,n=requestAnimationFrame(()=>{let{renderedItems:t}=s.getState();e.renderedItems!==t&&c(e.renderedItems)});if(typeof IntersectionObserver!=`function`)return()=>cancelAnimationFrame(n);let r=()=>{if(t){t=!1;return}cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems))},i=yu(e.renderedItems),a=new IntersectionObserver(r,{root:i});for(let t of e.renderedItems)t.element&&a.observe(t.element);return()=>{cancelAnimationFrame(n),a.disconnect()}}));let l=(e,t,n=!1)=>{let i;return t(t=>{let n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(n!==-1){i=t[n];let o={...i,...e};a[n]=o,r.set(e.id,o)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);let a=t.findIndex(({id:t})=>t===e.id);if(a===-1)return t;let o=t.slice();return o[a]=i,r.set(e.id,i),o})}},u=e=>l(e,e=>o.setState(`items`,e),!0);return{...s,registerItem:u,renderItem:e=>Go(u(e),l(e,e=>o.setState(`renderedItems`,e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){let{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o}}function Su(e,t,n){return Ys(t,[n.store]),Ml(e,n,`items`,`setItems`),e}var Cu={id:null};function wu(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Tu(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function Eu(e,t){return e.filter(e=>e.rowId===t)}function Du(e,t,n=!1){let r=e.findIndex(e=>e.id===t);return[...e.slice(r+1),...n?[Cu]:[],...e.slice(0,r)]}function Ou(e){let t=[];for(let n of e){let e=t.find(e=>e[0]?.rowId===n.rowId);e?e.push(n):t.push([n])}return t}function ku(e){let t=0;for(let{length:n}of e)n>t&&(t=n);return t}function Au(e){return{id:`__EMPTY_ITEM__`,disabled:!0,rowId:e}}function ju(e,t,n){let r=ku(e);for(let i of e)for(let e=0;e<r;e+=1){let r=i[e];if(!r||n&&r.disabled){let r=e===0&&n?wu(i):i[e-1];i[e]=r&&t!==r.id&&n?r:Au(r?.rowId)}}return e}function Mu(e){let t=Ou(e),n=ku(t),r=[];for(let e=0;e<n;e+=1)for(let n of t){let t=n[e];t&&r.push({...t,rowId:t.rowId?`${e}`:void 0})}return r}function Nu(e={}){let t=e.store?.getState(),n=xu(e),r=B(e.activeId,t?.activeId,e.defaultActiveId),i=yl({...n.getState(),id:B(e.id,t?.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:r,baseElement:B(t?.baseElement,null),includesBaseElement:B(e.includesBaseElement,t?.includesBaseElement,r===null),moves:B(t?.moves,0),orientation:B(e.orientation,t?.orientation,`both`),rtl:B(e.rtl,t?.rtl,!1),virtualFocus:B(e.virtualFocus,t?.virtualFocus,!1),focusLoop:B(e.focusLoop,t?.focusLoop,!1),focusWrap:B(e.focusWrap,t?.focusWrap,!1),focusShift:B(e.focusShift,t?.focusShift,!1)},n,e.store);bl(i,()=>Cl(i,[`renderedItems`,`activeId`],e=>{i.setState(`activeId`,t=>t===void 0?wu(e.renderedItems)?.id:t)}));let a=(e=`next`,t={})=>{let n=i.getState(),{skip:r=0,activeId:a=n.activeId,focusShift:o=n.focusShift,focusLoop:s=n.focusLoop,focusWrap:c=n.focusWrap,includesBaseElement:l=n.includesBaseElement,renderedItems:u=n.renderedItems,rtl:d=n.rtl}=t,f=e===`up`||e===`down`,p=e===`next`||e===`down`,m=p?d&&!f:!d||f,h=o&&!r,g=f?Y(ju(Ou(u),a,h)):u;if(g=m?X(g):g,g=f?Mu(g):g,a==null)return wu(g)?.id;let _=g.find(e=>e.id===a);if(!_)return wu(g)?.id;let v=g.some(e=>e.rowId),y=g.indexOf(_),b=g.slice(y+1),x=Eu(b,_.rowId);if(r){let e=Tu(x,a);return(e.slice(r)[0]||e[e.length-1])?.id}let S=s&&(f?s!==`horizontal`:s!==`vertical`),C=v&&c&&(f?c!==`horizontal`:c!==`vertical`),w=p?(!v||f)&&S&&l:f?l:!1;if(S)return wu(Du(C&&!w?g:Eu(g,_.rowId),a,w),a)?.id;if(C){let e=wu(w?x:b,a);return w?e?.id||null:e?.id}let T=wu(x,a);return!T&&w?null:T?.id};return{...n,...i,setBaseElement:e=>i.setState(`baseElement`,e),setActiveId:e=>i.setState(`activeId`,e),move:e=>{e!==void 0&&(i.setState(`activeId`,e),i.setState(`moves`,e=>e+1))},first:()=>wu(i.getState().renderedItems)?.id,last:()=>wu(X(i.getState().renderedItems))?.id,next:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`next`,e)),previous:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`previous`,e)),down:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`down`,e)),up:e=>(e!==void 0&&typeof e==`number`&&(e={skip:e}),a(`up`,e))}}function Pu(e,t,n){return e=Su(e,t,n),Ml(e,n,`activeId`,`setActiveId`),Ml(e,n,`includesBaseElement`),Ml(e,n,`virtualFocus`),Ml(e,n,`orientation`),Ml(e,n,`rtl`),Ml(e,n,`focusLoop`),Ml(e,n,`focusWrap`),Ml(e,n,`focusShift`),e}(0,x.createContext)(void 0);var Fu=uc([_u,vc],[vu,yc]);Fu.useContext,Fu.useScopedContext;var Iu=Fu.useProviderContext;Fu.ContextProvider,Fu.ScopedContextProvider,(0,x.createContext)(void 0),(0,x.createContext)(!1);var Lu=`hr`,Ru=G(function({orientation:e=`horizontal`,...t}){return t={role:`separator`,"aria-orientation":e,...t},t});U(function(e){return W(Lu,Ru(e))});var zu=`hr`,Bu=G(function({store:e,...t}){let n=gc();e||=n,Xo(e,!1);let r=K(e,e=>e.orientation===`horizontal`?`vertical`:`horizontal`);return t=Ru({...t,orientation:r}),t});U(function(e){return W(zu,Bu(e))});var Vu=uc([_u],[vu]);Vu.useContext,Vu.useScopedContext;var Hu=Vu.useProviderContext,Uu=Vu.ContextProvider,Wu=Vu.ScopedContextProvider;function Z(e){return[e.clientX,e.clientY]}function Gu(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=a,o=0,s=e-1;o<e;s=o++){let a=t[o],c=t[s],l=t[s===0?e-1:s-1];if(a==null||c==null||l==null)return!1;let[u,d]=a,[f,p]=c,[,m]=l,h=(d-p)*(n-u)-(u-f)*(r-d);if(p<d){if(r>=p&&r<d){if(h===0)return!0;h>0&&(r===p?r>m&&(i=!i):i=!i)}}else if(d<p){if(r>d&&r<=p){if(h===0)return!0;h<0&&(r===p?r<m&&(i=!i):i=!i)}}else if(r===d&&(n>=f&&n<=u||n>=u&&n<=f))return!0}return i}function Ku(e,t){let{top:n,right:r,bottom:i,left:a}=t,[o,s]=e;return[o<a?`left`:o>r?`right`:null,s<n?`top`:s>i?`bottom`:null]}function qu(e,t){let n=e.getBoundingClientRect(),{top:r,right:i,bottom:a,left:o}=n,[s,c]=Ku(t,n),l=[t];return s?(c!==`top`&&l.push([s===`left`?o:i,r]),l.push([s===`left`?i:o,r]),l.push([s===`left`?i:o,a]),c!==`bottom`&&l.push([s===`left`?o:i,a])):c===`top`?(l.push([o,r]),l.push([o,a]),l.push([i,a]),l.push([i,r])):(l.push([o,a]),l.push([o,r]),l.push([i,r]),l.push([i,a])),l}var Ju=(0,x.createContext)(null),Yu=`span`,Xu=G(function(e){return e={...e,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`,...e.style}},e});U(function(e){return W(Yu,Xu(e))});var Zu=`span`,Qu=G(function(e){return e={"data-focus-trap":``,tabIndex:0,"aria-hidden":!0,...e,style:{position:`fixed`,top:0,left:0,...e.style}},e=Xu(e),e}),$u=U(function(e){return W(Zu,Qu(e))}),ed=`div`;function td(e){return V(e).body}function nd(e,t){return t?typeof t==`function`?t(e):t:V(e).createElement(`div`)}function rd(e=`id`){return`${e?`${e}-`:``}${Math.random().toString(36).slice(2,8)}`}function id(e){queueMicrotask(()=>{e?.focus()})}var ad=G(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:n,portalRef:r,portal:i=!0,...a}){let o=(0,x.useRef)(null),s=Ks(o,a.ref),c=(0,x.useContext)(Ju),[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)(null),p=(0,x.useRef)(null),m=(0,x.useRef)(null),h=(0,x.useRef)(null),g=(0,x.useRef)(null);return Us(()=>{let e=o.current;if(!e||!i){u(null);return}let t=nd(e,n);if(!t){u(null);return}let a=t.isConnected;if(a||(c||td(e)).appendChild(t),t.id||=e.id?`portal/${e.id}`:rd(),u(t),ns(r,t),!a)return()=>{t.remove(),ns(r,null)}},[i,n,c,r]),Us(()=>{if(!i||!e||!t)return;let n=V(t).createElement(`span`);return n.style.position=`fixed`,t.insertAdjacentElement(`afterend`,n),f(n),()=>{n.remove(),f(null)}},[i,e,t]),(0,x.useEffect)(()=>{if(!l||!e)return;let t=0,n=e=>{if(!Ls(e))return;let n=e.type===`focusin`;if(cancelAnimationFrame(t),n)return Xc(l);t=requestAnimationFrame(()=>{Yc(l,!0)})};return l.addEventListener(`focusin`,n,!0),l.addEventListener(`focusout`,n,!0),()=>{cancelAnimationFrame(t),l.removeEventListener(`focusin`,n,!0),l.removeEventListener(`focusout`,n,!0)}},[l,e]),a=Qs(a,t=>{if(t=(0,L.jsx)(Ju.Provider,{value:l||c,children:t}),!i)return t;if(!l)return(0,L.jsx)(`span`,{ref:s,id:a.id,style:{position:`fixed`},hidden:!0});t=(0,L.jsxs)(L.Fragment,{children:[e&&l&&(0,L.jsx)($u,{ref:m,"data-focus-trap":a.id,className:`__focus-trap-inner-before`,onFocus:e=>{Ls(e,l)?id(Uc()):id(p.current)}}),t,e&&l&&(0,L.jsx)($u,{ref:h,"data-focus-trap":a.id,className:`__focus-trap-inner-after`,onFocus:e=>{Ls(e,l)?id(Gc()):id(g.current)}})]}),l&&(t=(0,Oo.createPortal)(t,l));let n=(0,L.jsxs)(L.Fragment,{children:[e&&l&&(0,L.jsx)($u,{ref:p,"data-focus-trap":a.id,className:`__focus-trap-outer-before`,onFocus:e=>{e.relatedTarget!==g.current&&Ls(e,l)?id(m.current):id(Gc())}}),e&&(0,L.jsx)(`span`,{"aria-owns":l?.id,style:{position:`fixed`}}),e&&l&&(0,L.jsx)($u,{ref:g,"data-focus-trap":a.id,className:`__focus-trap-outer-after`,onFocus:e=>{if(Ls(e,l))id(h.current);else{let e=Uc();if(e===m.current){requestAnimationFrame(()=>Uc()?.focus());return}id(e)}}})]});return d&&e&&(n=(0,Oo.createPortal)(n,d)),(0,L.jsxs)(L.Fragment,{children:[n,t]})},[l,c,i,a.id,e,d]),a={...a,ref:s},a});U(function(e){return W(ed,ad(e))});var od=(0,x.createContext)(0);function sd({level:e,children:t}){let n=(0,x.useContext)(od),r=Math.max(Math.min(e||n+1,6),1);return(0,L.jsx)(od.Provider,{value:r,children:t})}var cd=`div`,ld=G(function({autoFocusOnShow:e=!0,...t}){return t=Qs(t,t=>(0,L.jsx)(Pc.Provider,{value:e,children:t}),[e]),t});U(function(e){return W(cd,ld(e))});function ud(e,t){let n=V(e).createElement(`button`);return n.type=`button`,n.tabIndex=-1,n.textContent=`Dismiss popup`,Object.assign(n.style,{border:`0px`,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:`0px`,position:`absolute`,whiteSpace:`nowrap`,width:`1px`}),n.addEventListener(`click`,t),e.prepend(n),()=>{n.removeEventListener(`click`,t),n.remove()}}function dd(e){let t=(0,x.useRef)(null);return(0,x.useEffect)(()=>{if(!e){t.current=null;return}return zs(`mousedown`,e=>{t.current=e.target},!0)},[e]),t}var fd=new WeakMap;function pd(e,t,n){fd.has(e)||fd.set(e,new Map);let r=fd.get(e),i=r.get(t);if(!i)return r.set(t,n()),()=>{var e;(e=r.get(t))==null||e(),r.delete(t)};let a=n(),o=()=>{a(),i(),r.delete(t)};return r.set(t,o),()=>{r.get(t)===o&&(a(),r.set(t,i))}}function md(e,t,n){return pd(e,t,()=>{let r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r==null?e.removeAttribute(t):e.setAttribute(t,r)}})}function hd(e,t,n){return pd(e,t,()=>{let r=t in e,i=e[t];return e[t]=n,()=>{r?e[t]=i:delete e[t]}})}function gd(e,t){return e?pd(e,`style`,()=>{let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}function _d(e,t,n){return e?pd(e,t,()=>{let r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}):()=>{}}var vd=[`SCRIPT`,`STYLE`];function yd(e){return`__ariakit-dialog-snapshot-${e}`}function Q(e,t){let n=V(t),r=yd(e);if(!n.body[r])return!0;do{if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}while(!0)}function bd(e,t,n){return vd.includes(t.tagName)||!Q(e,t)?!1:!n.some(e=>e&&us(t,e))}function xd(e,t,n,r){for(let i of t){if(!i?.isConnected)continue;let a=t.some(e=>!e||e===i?!1:e.contains(i)),o=V(i),s=i;for(;i.parentElement&&i!==o.body;){if(r?.(i.parentElement,s),!a)for(let r of i.parentElement.children)bd(e,r,t)&&n(r,s);i=i.parentElement}}}function Sd(e,t){let{body:n}=V(t[0]),r=[];return xd(e,t,t=>{r.push(hd(t,yd(e),!0))}),Go(hd(n,yd(e),!0),()=>{for(let e of r)e()})}function Cd(e,...t){if(!e)return!1;let n=e.getAttribute(`data-backdrop`);return n==null?!1:n===``||n===`true`||!t.length?!0:t.some(e=>n===e)}function wd(e=``,t=!1){return`__ariakit-dialog-${t?`ancestor`:`outside`}${e?`-${e}`:``}`}function Td(e,t=``){return Go(hd(e,wd(),!0),hd(e,wd(t),!0))}function Ed(e,t=``){return Go(hd(e,wd(``,!0),!0),hd(e,wd(t,!0),!0))}function Dd(e,t){let n=wd(t,!0);if(e[n])return!0;let r=wd(t);do{if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}while(!0)}function Od(e,t){let n=[],r=t.map(e=>e?.id);return xd(e,t,t=>{Cd(t,...r)||n.unshift(Td(t,e))},(t,r)=>{r.hasAttribute(`data-dialog`)&&r.id!==e||n.unshift(Ed(t,e))}),()=>{for(let e of n)e()}}function kd(e){return e.tagName===`HTML`?!0:us(V(e).body,e)}function Ad(e,t){if(!e)return!1;if(us(e,t))return!0;let n=t.getAttribute(`aria-activedescendant`);if(n){let t=V(e).getElementById(n);if(t)return us(e,t)}return!1}function jd(e,t){if(!(`clientY`in e))return!1;let n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function Md({store:e,type:t,listener:n,capture:r,domReady:i}){let a=H(n),o=K(e,`open`),s=(0,x.useRef)(!1);Us(()=>{if(!o||!i)return;let{contentElement:t}=e.getState();if(!t)return;let n=()=>{s.current=!0};return t.addEventListener(`focusin`,n,!0),()=>t.removeEventListener(`focusin`,n,!0)},[e,o,i]),(0,x.useEffect)(()=>o?zs(t,t=>{let{contentElement:n,disclosureElement:r}=e.getState(),i=t.target;n&&i&&kd(i)&&(us(n,i)||Ad(r,i)||i.hasAttribute(`data-focus-trap`)||jd(t,n)||s.current&&!Dd(i,n.id)||a(t))},r):void 0,[o,r,e,t,a])}function $(e,t){return typeof e==`function`?e(t):!!e}function Nd(e,t,n,r){let i=dd(K(e,`open`)),a={store:e,domReady:n,capture:!0};Md({...a,type:`click`,listener:n=>{let{contentElement:a}=e.getState(),o=i.current;o&&Dd(o,a?.id)&&$(t,n)&&(r&&(r.current=!0),e.hide())}}),Md({...a,type:`focusin`,listener:n=>{let{contentElement:r}=e.getState();r&&n.target!==V(r)&&$(t,n)&&e.hide()}}),Md({...a,type:`contextmenu`,listener:n=>{$(t,n)&&(r&&(r.current=!0),e.hide())}})}var Pd=(0,x.createContext)({});function Fd(e){let t=(0,x.useContext)(Pd),[n,r]=(0,x.useState)([]),i=(0,x.useCallback)(e=>(r(t=>[...t,e]),Go(t.add?.call(t,e),()=>{r(t=>t.filter(t=>t!==e))})),[t]);Us(()=>Cl(e,[`open`,`contentElement`],n=>{if(n.open&&n.contentElement)return t.add?.call(t,e)}),[e,t]);let a=(0,x.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,x.useCallback)(e=>(0,L.jsx)(Pd.Provider,{value:a,children:e}),[a]),nestedDialogs:n}}function Id({attribute:e,contentId:t,contentElement:n,enabled:r}){let[i,a]=Xs(),o=(0,x.useCallback)(()=>{if(!r||!n)return!1;let{body:i}=V(n),a=i.getAttribute(e);return!a||a===t},[i,r,n,e,t]);return(0,x.useEffect)(()=>{if(!r||!t||!n)return;let{body:i}=V(n);if(o())return i.setAttribute(e,t),()=>i.removeAttribute(e);let s=new MutationObserver(()=>(0,Oo.flushSync)(a));return s.observe(i,{attributeFilter:[e]}),()=>s.disconnect()},[i,r,t,n,o,e]),o}function Ld(e){let t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?`paddingLeft`:`paddingRight`}function Rd(e,t,n){let r=Id({attribute:`data-dialog-prevent-body-scroll`,contentElement:e,contentId:t,enabled:n});(0,x.useEffect)(()=>{if(!r()||!e)return;let t=V(e),n=cs(e),{documentElement:i,body:a}=t,o=i.style.getPropertyValue(`--scrollbar-width`),s=o?Number.parseInt(o,10):n.innerWidth-i.clientWidth,c=()=>_d(i,`--scrollbar-width`,`${s}px`),l=Ld(i),u=()=>gd(a,{overflow:`hidden`,[l]:`${s}px`}),d=()=>{let{scrollX:e,scrollY:t,visualViewport:r}=n,i=r?.offsetLeft??0,o=r?.offsetTop??0,c=gd(a,{position:`fixed`,overflow:`hidden`,top:`${-(t-Math.floor(o))}px`,left:`${-(e-Math.floor(i))}px`,right:`0`,[l]:`${s}px`});return()=>{c(),n.scrollTo({left:e,top:t,behavior:`instant`})}},f=Ts()&&!Os();return Go(c(),f?d():u())},[r,e])}function zd(e,...t){if(!e)return!1;let n=e.getAttribute(`data-focus-trap`);return n==null?!1:t.length?n===``?!1:t.some(e=>n===e):!0}function Bd(){return`inert`in HTMLElement.prototype}function Vd(e){return md(e,`aria-hidden`,`true`)}function Hd(e,t){return`style`in e?Bd()?hd(e,`inert`,!0):Go(...Bc(e,!0).map(e=>{if(t?.some(t=>t&&us(t,e)))return Bo;let n=pd(e,`focus`,()=>(e.focus=Bo,()=>{delete e.focus}));return Go(md(e,`tabindex`,`-1`),n)}),Vd(e),gd(e,{pointerEvents:`none`,userSelect:`none`,cursor:`default`})):Bo}function Ud(e,t){let n=[],r=t.map(e=>e?.id);return xd(e,t,e=>{Cd(e,...r)||zd(e,...r)||n.unshift(Hd(e,t))},e=>{e.hasAttribute(`role`)&&(t.some(t=>t&&us(t,e))||n.unshift(md(e,`role`,`none`)))}),()=>{for(let e of n)e()}}var Wd=`div`,Gd=`a.button.details.dialog.div.form.h1.h2.h3.h4.h5.h6.header.img.input.label.li.nav.ol.p.section.select.span.summary.textarea.ul.svg`.split(`.`);G(function(e){return e});var Kd=U(function(e){return W(Wd,e)});Object.assign(Kd,Gd.reduce((e,t)=>(e[t]=U(function(e){return W(t,e)}),e),{}));function qd({store:e,backdrop:t,alwaysVisible:n,hidden:r}){let i=(0,x.useRef)(null),a=mu({disclosure:e}),o=K(e,`contentElement`);(0,x.useEffect)(()=>{let e=i.current,t=o;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)},[o]),Us(()=>{let e=o?.id;if(!e)return;let t=i.current;if(t)return Ed(t,e)},[o]);let s=uu({ref:i,store:a,role:`presentation`,"data-backdrop":o?.id||``,alwaysVisible:n,hidden:r??void 0,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,x.isValidElement)(t))return(0,L.jsx)(Kd,{...s,render:t});let c=typeof t==`boolean`?`div`:t;return(0,L.jsx)(Kd,{...s,render:(0,L.jsx)(c,{})})}function Jd(e={}){return fu(e)}function Yd(e,t,n){return pu(e,t,n)}function Xd(e={}){let[t,n]=Nl(Jd,e);return Yd(t,n,e)}var Zd=`div`,Qd=Es();function $d(e){let t=ls();return!t||e&&us(e,t)?!1:!!Lc(t)}function ef(e,t=!1){if(!e)return null;let n=`current`in e?e.current:e;return n?t?Lc(n)?n:null:n:null}var tf=G(function({store:e,open:t,onClose:n,focusable:r=!0,modal:i=!0,portal:a=!!i,backdrop:o=!!i,hideOnEscape:s=!0,hideOnInteractOutside:c=!0,getPersistentElements:l,preventBodyScroll:u=!!i,autoFocusOnShow:d=!0,autoFocusOnHide:f=!0,initialFocus:p,finalFocus:m,unmountOnHide:h,unstable_treeSnapshotKey:g,..._}){let v=eu(),y=(0,x.useRef)(null),b=Xd({store:e||v,open:t,setOpen(e){if(e)return;let t=y.current;if(!t)return;let r=new Event(`close`,{bubbles:!1,cancelable:!0});n&&t.addEventListener(`close`,n,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&b.setOpen(!0)}}),{portalRef:S,domReady:C}=$s(a,_.portalRef),w=_.preserveTabOrder,T=K(b,e=>w&&!i&&e.mounted),E=qs(_.id),D=K(b,`open`),O=K(b,`mounted`),k=K(b,`contentElement`),A=lu(O,_.hidden,_.alwaysVisible);Rd(k,E,u&&!A);let j=(0,x.useRef)(!1);Us(()=>Cl(b,[`open`],e=>{e.open&&(j.current=!1)}),[b]),Nd(b,c,C,j);let{wrapElement:ee,nestedDialogs:te}=Fd(b);_=Qs(_,ee,[ee]);let ne=(0,x.useRef)(null);Qd&&(0,x.useEffect)(()=>{if(!C)return;let e=y.current;if(!e)return;let t=V(e),n=e=>{ne.current=e.target};return t.addEventListener(`mousedown`,n,!0),()=>{t.removeEventListener(`mousedown`,n,!0)}},[C]),Us(()=>{if(!D)return;let e=y.current,t=ls(e,!0);if(t){if(t.tagName===`BODY`){let t=ne.current;if(ne.current=null,!t?.isConnected||!Lc(t)||e&&us(e,t))return;b.setDisclosureElement(t);return}e&&us(e,t)||b.setDisclosureElement(t)}},[b,D]),(0,x.useEffect)(()=>{if(!O||!C)return;let e=y.current;if(!e)return;let t=cs(e),n=t.visualViewport||t,r=()=>{let n=t.visualViewport?.height??t.innerHeight;e.style.setProperty(`--dialog-viewport-height`,`${n}px`)};return r(),n.addEventListener(`resize`,r),()=>{n.removeEventListener(`resize`,r)}},[O,C]),(0,x.useEffect)(()=>{if(!i||!O||!C)return;let e=y.current;if(e&&!e.querySelector(`[data-dialog-dismiss]`))return ud(e,b.hide)},[b,i,O,C]),Us(()=>{if(!Bd()||D||!O||!C)return;let e=y.current;if(e)return Hd(e)},[D,O,C]);let re=D&&C;Us(()=>{if(!E||!re)return;let e=y.current;return Sd(E,[e])},[E,re,g]);let M=H(l);Us(()=>{if(!E||!re)return;let{disclosureElement:e}=b.getState(),t=[y.current,...M()||[],...te.map(e=>e.getState().contentElement)];return i?Go(Od(E,t),Ud(E,t)):Od(E,[e,...t])},[E,b,re,M,te,i,g]);let N=!!d,ie=Zs(d),[ae,oe]=(0,x.useState)(!1);(0,x.useEffect)(()=>{if(!D||!N||!C||!k?.isConnected)return;let e=ef(p,!0)||k.querySelector(`[data-autofocus=true],[autofocus]`)||Vc(k,!0,a&&T)||k,t=Lc(e);ie(t?e:null)&&(oe(!0),queueMicrotask(()=>{b.getState().open&&(e.focus(),Qd&&t&&e.scrollIntoView({block:`nearest`,inline:`nearest`}))}))},[D,N,C,k,p,a,T,b,ie]);let P=!!f,se=Zs(f),[F,ce]=(0,x.useState)(!1);(0,x.useEffect)(()=>{if(D)return ce(!0),()=>ce(!1)},[D]);let le=(0,x.useCallback)((e,t=!0)=>{if(j.current)return;let{disclosureElement:n}=b.getState();if($d(e))return;let r=ef(m)||n;if(r?.id){let e=V(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!Lc(r)){let e=r.closest(`[data-dialog]`);if(e?.id){let t=V(e),n=`[aria-controls~="${e.id}"]`,i=t.querySelector(n);i&&(r=i)}}let i=r&&Lc(r);if(!i&&t){requestAnimationFrame(()=>le(e,!1));return}se(i?r:null)&&i&&r?.focus()},[b,m,se]),ue=(0,x.useRef)(!1);Us(()=>{if(D||!F||!P)return;let e=y.current;ue.current=!0,le(e)},[D,F,C,P,le]),(0,x.useEffect)(()=>{if(!F||!P)return;let e=y.current;return()=>{if(ue.current){ue.current=!1;return}le(e)}},[F,P,le]);let de=Zs(s);(0,x.useEffect)(()=>!C||!O?void 0:zs(`keydown`,e=>{if(e.key!==`Escape`||e.defaultPrevented)return;let t=y.current;if(!t||Dd(t))return;let n=e.target;if(!n)return;let{disclosureElement:r}=b.getState();(n.tagName===`BODY`||us(t,n)||!r||us(r,n))&&de(e)&&b.hide()},!0),[b,C,O,de]),_=Qs(_,e=>(0,L.jsx)(sd,{level:i?1:void 0,children:e}),[i]);let fe=_.hidden,pe=_.alwaysVisible;_=Qs(_,e=>o?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qd,{store:b,backdrop:o,hidden:fe,alwaysVisible:pe}),e]}):e,[b,o,fe,pe]);let[me,he]=(0,x.useState)(),[ge,_e]=(0,x.useState)();return _=Qs(_,e=>(0,L.jsx)(nu,{value:b,children:(0,L.jsx)(ru.Provider,{value:he,children:(0,L.jsx)(iu.Provider,{value:_e,children:e})})}),[b]),_={"data-dialog":``,role:`dialog`,tabIndex:r?-1:void 0,"aria-labelledby":_[`aria-label`]==null?me:void 0,"aria-describedby":ge,..._,id:E,ref:Ks(y,_.ref)},_=ld({..._,autoFocusOnShow:ae}),_=uu({store:b,..._}),_=pl({..._,focusable:r}),_=ad({portal:a,..._,portalRef:S,preserveTabOrder:T}),_});function nf(e,t=eu){return U(function(n){let r=t();return K(n.store||r,e=>!n.unmountOnHide||e?.mounted||!!n.open)?(0,L.jsx)(e,{...n}):null})}var rf=nf(U(function(e){return W(Zd,tf(e))}),eu),af=Math.min,of=Math.max,sf=Math.round,cf=Math.floor,lf=e=>({x:e,y:e}),uf={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function df(e,t,n){return of(e,af(t,n))}function ff(e,t){return typeof e==`function`?e(t):e}function pf(e){return e.split(`-`)[0]}function mf(e){return e.split(`-`)[1]}function hf(e){return e===`x`?`y`:`x`}function gf(e){return e===`y`?`height`:`width`}function _f(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function vf(e){return hf(_f(e))}function yf(e,t,n){n===void 0&&(n=!1);let r=mf(e),i=vf(e),a=gf(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Of(o)),[o,Of(o)]}function bf(e){let t=Of(e);return[xf(e),t,xf(t)]}function xf(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Sf=[`left`,`right`],Cf=[`right`,`left`],wf=[`top`,`bottom`],Tf=[`bottom`,`top`];function Ef(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Cf:Sf:t?Sf:Cf;case`left`:case`right`:return t?wf:Tf;default:return[]}}function Df(e,t,n,r){let i=mf(e),a=Ef(pf(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(xf)))),a}function Of(e){let t=pf(e);return uf[t]+e.slice(t.length)}function kf(e){return{top:0,right:0,bottom:0,left:0,...e}}function Af(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:kf(e)}function jf(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Mf(e,t,n){let{reference:r,floating:i}=e,a=_f(t),o=vf(t),s=gf(o),c=pf(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(mf(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Nf(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ff(t,e),p=Af(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=jf(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=jf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Pf=50,Ff=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Nf},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Mf(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Pf&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Mf(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},If=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ff(e,t)||{};if(l==null)return{};let d=Af(u),f={x:n,y:r},p=vf(i),m=gf(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=af(d[_],T),D=af(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=df(O,A,k),ee=!c.arrow&&mf(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=ee?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:j,centerOffset:A-j-te,...ee&&{alignmentOffset:te}},reset:ee}}}),Lf=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ff(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=pf(r),_=_f(o),v=pf(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Of(o)]:bf(o)),x=p!==`none`;!d&&x&&b.push(...Df(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=yf(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==_f(t))||T.every(e=>_f(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=_f(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}},Rf=new Set([`left`,`top`]);async function zf(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=pf(n),s=mf(n),c=_f(n)===`y`,l=Rf.has(o)?-1:1,u=a&&c?-1:1,d=ff(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Bf=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await zf(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Vf=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ff(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=_f(pf(i)),p=hf(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=df(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=df(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Hf=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ff(e,t),u={x:n,y:r},d=_f(i),f=hf(d),p=u[f],m=u[d],h=ff(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Rf.has(pf(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Uf=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ff(e,t),u=await o.detectOverflow(t,l),d=pf(i),f=mf(i),p=_f(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=af(h-u[g],v),x=af(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=of(u.left,0),t=of(u.right,0),n=of(u.top,0),r=of(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:of(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:of(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Wf(){return typeof window<`u`}function Gf(e){return Jf(e)?(e.nodeName||``).toLowerCase():`#document`}function Kf(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function qf(e){return((Jf(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Jf(e){return Wf()?e instanceof Node||e instanceof Kf(e).Node:!1}function Yf(e){return Wf()?e instanceof Element||e instanceof Kf(e).Element:!1}function Xf(e){return Wf()?e instanceof HTMLElement||e instanceof Kf(e).HTMLElement:!1}function Zf(e){return!Wf()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Kf(e).ShadowRoot}function Qf(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=lp(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function $f(e){return/^(table|td|th)$/.test(Gf(e))}function ep(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var tp=/transform|translate|scale|rotate|perspective|filter/,np=/paint|layout|strict|content/,rp=e=>!!e&&e!==`none`,ip;function ap(e){let t=Yf(e)?lp(e):e;return rp(t.transform)||rp(t.translate)||rp(t.scale)||rp(t.rotate)||rp(t.perspective)||!sp()&&(rp(t.backdropFilter)||rp(t.filter))||tp.test(t.willChange||``)||np.test(t.contain||``)}function op(e){let t=dp(e);for(;Xf(t)&&!cp(t);){if(ap(t))return t;if(ep(t))return null;t=dp(t)}return null}function sp(){return ip??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),ip}function cp(e){return/^(html|body|#document)$/.test(Gf(e))}function lp(e){return Kf(e).getComputedStyle(e)}function up(e){return Yf(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function dp(e){if(Gf(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Zf(e)&&e.host||qf(e);return Zf(t)?t.host:t}function fp(e){let t=dp(e);return cp(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xf(t)&&Qf(t)?t:fp(t)}function pp(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=fp(e),i=r===e.ownerDocument?.body,a=Kf(r);if(i){let e=mp(a);return t.concat(a,a.visualViewport||[],Qf(r)?r:[],e&&n?pp(e):[])}else return t.concat(r,pp(r,[],n))}function mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hp(e){let t=lp(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Xf(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=sf(n)!==a||sf(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function gp(e){return Yf(e)?e:e.contextElement}function _p(e){let t=gp(e);if(!Xf(t))return lf(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=hp(t),o=(a?sf(n.width):n.width)/r,s=(a?sf(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var vp=lf(0);function yp(e){let t=Kf(e);return!sp()||!t.visualViewport?vp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bp(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Kf(e)?!1:t}function xp(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=gp(e),o=lf(1);t&&(r?Yf(r)&&(o=_p(r)):o=_p(e));let s=bp(a,n,r)?yp(a):lf(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Kf(a),t=r&&Yf(r)?Kf(r):r,n=e,i=mp(n);for(;i&&r&&t!==n;){let e=_p(i),t=i.getBoundingClientRect(),r=lp(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Kf(i),i=mp(n)}}return jf({width:u,height:d,x:c,y:l})}function Sp(e,t){let n=up(e).scrollLeft;return t?t.left+n:xp(qf(e)).left+n}function Cp(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Sp(e,n),y:n.top+t.scrollTop}}function wp(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=qf(r),s=t?ep(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=lf(1),u=lf(0),d=Xf(r);if((d||!d&&!a)&&((Gf(r)!==`body`||Qf(o))&&(c=up(r)),d)){let e=xp(r);l=_p(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Cp(o,c):lf(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Tp(e){return Array.from(e.getClientRects())}function Ep(e){let t=qf(e),n=up(e),r=e.ownerDocument.body,i=of(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=of(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Sp(e),s=-n.scrollTop;return lp(r).direction===`rtl`&&(o+=of(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Dp=25;function Op(e,t){let n=Kf(e),r=qf(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=sp();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Sp(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Dp&&(a-=o)}else l<=Dp&&(a+=l);return{width:a,height:o,x:s,y:c}}function kp(e,t){let n=xp(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Xf(e)?_p(e):lf(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ap(e,t,n){let r;if(t===`viewport`)r=Op(e,n);else if(t===`document`)r=Ep(qf(e));else if(Yf(t))r=kp(t,n);else{let n=yp(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return jf(r)}function jp(e,t){let n=dp(e);return n===t||!Yf(n)||cp(n)?!1:lp(n).position===`fixed`||jp(n,t)}function Mp(e,t){let n=t.get(e);if(n)return n;let r=pp(e,[],!1).filter(e=>Yf(e)&&Gf(e)!==`body`),i=null,a=lp(e).position===`fixed`,o=a?dp(e):e;for(;Yf(o)&&!cp(o);){let t=lp(o),n=ap(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Qf(o)&&!n&&jp(e,o))?r=r.filter(e=>e!==o):i=t,o=dp(o)}return t.set(e,r),r}function Np(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ep(t)?[]:Mp(t,this._c):[].concat(n),r],o=Ap(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Ap(t,a[e],i);s=of(n.top,s),c=af(n.right,c),l=af(n.bottom,l),u=of(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Pp(e){let{width:t,height:n}=hp(e);return{width:t,height:n}}function Fp(e,t,n){let r=Xf(t),i=qf(t),a=n===`fixed`,o=xp(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=lf(0);function l(){c.x=Sp(i)}if(r||!r&&!a)if((Gf(t)!==`body`||Qf(i))&&(s=up(t)),r){let e=xp(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Cp(i,s):lf(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Ip(e){return lp(e).position===`static`}function Lp(e,t){if(!Xf(e)||lp(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return qf(e)===n&&(n=n.ownerDocument.body),n}function Rp(e,t){let n=Kf(e);if(ep(e))return n;if(!Xf(e)){let t=dp(e);for(;t&&!cp(t);){if(Yf(t)&&!Ip(t))return t;t=dp(t)}return n}let r=Lp(e,t);for(;r&&$f(r)&&Ip(r);)r=Lp(r,t);return r&&cp(r)&&Ip(r)&&!ap(r)?n:r||op(e)||n}var zp=async function(e){let t=this.getOffsetParent||Rp,n=this.getDimensions,r=await n(e.floating);return{reference:Fp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Bp(e){return lp(e).direction===`rtl`}var Vp={convertOffsetParentRelativeRectToViewportRelativeRect:wp,getDocumentElement:qf,getClippingRect:Np,getOffsetParent:Rp,getElementRects:zp,getClientRects:Tp,getDimensions:Pp,getScale:_p,isElement:Yf,isRTL:Bp};function Hp(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Up(e,t){let n=null,r,i=qf(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=cf(d),h=cf(i.clientWidth-(u+f)),g=cf(i.clientHeight-(d+p)),_=cf(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:of(0,af(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Hp(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Wp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=gp(e),u=i||a?[...l?pp(l):[],...t?pp(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Up(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?xp(e):null;c&&g();function g(){let t=xp(e);h&&!Hp(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Gp=Bf,Kp=Vf,qp=Lf,Jp=Uf,Yp=If,Xp=Hf,Zp=(e,t,n)=>{let r=new Map,i={platform:Vp,...n},a={...i.platform,_c:r};return Ff(e,t,{...i,platform:a})},Qp=`div`;function $p(e=0,t=0,n=0,r=0){if(typeof DOMRect==`function`)return new DOMRect(e,t,n,r);let i={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...i,toJSON:()=>i}}function em(e){if(!e)return $p();let{x:t,y:n,width:r,height:i}=e;return $p(t,n,r,i)}function tm(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{let n=e,r=t?.(n);return r||!n?em(r):n.getBoundingClientRect()}}}function nm(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function rm(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}function im(e,t){return Gp(({placement:n})=>{let r=(e?.clientHeight||0)/2,i=typeof t.gutter==`number`?t.gutter+r:t.gutter??r;return{crossAxis:n.split(`-`)[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}})}function am(e){if(e.flip===!1)return;let t=typeof e.flip==`string`?e.flip.split(` `):void 0;return Xo(!t||t.every(nm),!1),qp({padding:e.overflowPadding,fallbackPlacements:t})}function om(e){if(!(!e.slide&&!e.overlap))return Kp({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Xp()})}function sm(e){return Jp({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:i}){let a=t.floating,o=Math.round(i.reference.width);n=Math.floor(n),r=Math.floor(r),a.style.setProperty(`--popover-anchor-width`,`${o}px`),a.style.setProperty(`--popover-available-width`,`${n}px`),a.style.setProperty(`--popover-available-height`,`${r}px`),e.sameWidth&&(a.style.width=`${o}px`),e.fitViewport&&(a.style.maxWidth=`${n}px`,a.style.maxHeight=`${r}px`)}})}function cm(e,t){if(e)return Yp({element:e,padding:t.arrowPadding})}var lm=G(function({store:e,modal:t=!1,portal:n=!!t,preserveTabOrder:r=!0,autoFocusOnShow:i=!0,wrapperProps:a,fixed:o=!1,flip:s=!0,shift:c=0,slide:l=!0,overlap:u=!1,sameWidth:d=!1,fitViewport:f=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:g,updatePosition:_,...v}){let y=gu();e||=y,Xo(e,!1);let b=K(e,`arrowElement`),S=K(e,`anchorElement`),C=K(e,`disclosureElement`),w=K(e,`popoverElement`),T=K(e,`contentElement`),E=K(e,`placement`),D=K(e,`mounted`),O=K(e,`rendered`),k=(0,x.useRef)(null),[A,j]=(0,x.useState)(!1),{portalRef:ee,domReady:te}=$s(n,v.portalRef),ne=H(g),re=H(_),M=!!_;Us(()=>{if(!w?.isConnected)return;w.style.setProperty(`--popover-overflow-padding`,`${h}px`);let t=tm(S,ne),n=async()=>{if(!D)return;b||(k.current=k.current||document.createElement(`div`));let n=b||k.current,r=[im(n,{gutter:p,shift:c}),am({flip:s,overflowPadding:h}),om({slide:l,shift:c,overlap:u,overflowPadding:h}),cm(n,{arrowPadding:m}),sm({sameWidth:d,fitViewport:f,overflowPadding:h})],i=await Zp(t,w,{placement:E,strategy:o?`fixed`:`absolute`,middleware:r});e?.setState(`currentPlacement`,i.placement),j(!0);let a=rm(i.x),g=rm(i.y);if(Object.assign(w.style,{top:`0`,left:`0`,transform:`translate3d(${a}px,${g}px,0)`}),n&&i.middlewareData.arrow){let{x:e,y:t}=i.middlewareData.arrow,r=i.placement.split(`-`)[0],a=n.clientWidth/2,o=n.clientHeight/2,s=e==null?-a:e+a,c=t==null?-o:t+o;w.style.setProperty(`--popover-transform-origin`,{top:`${s}px calc(100% + ${o}px)`,bottom:`${s}px ${-o}px`,left:`calc(100% + ${a}px) ${c}px`,right:`${-a}px ${c}px`}[r]),Object.assign(n.style,{left:e==null?``:`${e}px`,top:t==null?``:`${t}px`,[r]:`100%`})}},r=Wp(t,w,async()=>{M?(await re({updatePosition:n}),j(!0)):await n()},{elementResize:typeof ResizeObserver==`function`});return()=>{j(!1),r()}},[e,O,w,b,S,w,E,D,te,o,s,c,l,u,d,f,p,m,h,ne,M,re]),Us(()=>{if(!D||!te||!w?.isConnected||!T?.isConnected)return;let e=()=>{w.style.zIndex=getComputedStyle(T).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[D,te,w,T]);let N=o?`fixed`:`absolute`;return v=Qs(v,t=>(0,L.jsx)(`div`,{...a,style:{position:N,top:0,left:0,width:`max-content`,...a?.style},ref:e?.setPopoverElement,children:t}),[e,N,a]),v=Qs(v,t=>(0,L.jsx)(vu,{value:e,children:t}),[e]),v={"data-placing":!A||void 0,...v,style:{position:`relative`,...v.style}},v=tf({store:e,modal:t,portal:n,preserveTabOrder:r,preserveTabOrderAnchor:C||S,autoFocusOnShow:A&&i,...v,portalRef:ee}),v});nf(U(function(e){return W(Qp,lm(e))}),gu);var um=`div`;function dm(e,t,n,r){return qc(t)?!0:e?!!(us(t,e)||n&&us(n,e)||r?.some(t=>dm(e,t,n))):!1}function fm({store:e,...t}){let[n,r]=(0,x.useState)(!1),i=K(e,`mounted`);(0,x.useEffect)(()=>{i||r(!1)},[i]);let a=t.onFocus,o=H(e=>{a?.(e),!e.defaultPrevented&&r(!0)}),s=(0,x.useRef)(null);return(0,x.useEffect)(()=>Cl(e,[`anchorElement`],e=>{s.current=e.anchorElement}),[e]),t={autoFocusOnHide:n,finalFocus:s,...t,onFocus:o},t}var pm=(0,x.createContext)(null),mm=G(function({store:e,modal:t=!1,portal:n=!!t,hideOnEscape:r=!0,hideOnHoverOutside:i=!0,disablePointerEventsOnApproach:a=!!i,...o}){let s=Hu();e||=s,Xo(e,!1);let c=(0,x.useRef)(null),[l,u]=(0,x.useState)([]),d=(0,x.useRef)(0),f=(0,x.useRef)(null),{portalRef:p,domReady:m}=$s(n,o.portalRef),h=nc(),g=!!i,_=Zs(i),v=!!a,y=Zs(a),b=K(e,`open`),S=K(e,`mounted`);(0,x.useEffect)(()=>{if(!m||!S||!g&&!v)return;let t=c.current;return t?Go(zs(`mousemove`,n=>{if(!e||!h())return;let{anchorElement:r,hideTimeout:i,timeout:a}=e.getState(),o=f.current,[s]=n.composedPath(),c=r;if(dm(s,t,c,l)){f.current=s&&c&&us(c,s)?Z(n):null,window.clearTimeout(d.current),d.current=0;return}if(!d.current){if(o){let e=Z(n);if(Gu(e,qu(t,o))){if(f.current=e,!y(n))return;n.preventDefault(),n.stopPropagation();return}}_(n)&&(d.current=window.setTimeout(()=>{d.current=0,e?.hide()},i??a))}},!0),()=>clearTimeout(d.current)):void 0},[e,h,m,S,g,v,l,y,_]),(0,x.useEffect)(()=>{if(!m||!S||!v)return;let e=e=>{let t=c.current;if(!t)return;let n=f.current;if(!n)return;let r=qu(t,n);if(Gu(Z(e),r)){if(!y(e))return;e.preventDefault(),e.stopPropagation()}};return Go(zs(`mouseenter`,e,!0),zs(`mouseover`,e,!0),zs(`mouseout`,e,!0),zs(`mouseleave`,e,!0))},[m,S,v,y]),(0,x.useEffect)(()=>{m&&(b||e?.setAutoFocusOnShow(!1))},[e,m,b]);let C=Ws(b);(0,x.useEffect)(()=>{if(m)return()=>{C.current||e?.setAutoFocusOnShow(!1)}},[e,m]);let w=(0,x.useContext)(pm);Us(()=>{if(t||!n||!S||!m)return;let e=c.current;if(e)return w?.(e)},[t,n,S,m]);let T=(0,x.useCallback)(e=>{u(t=>[...t,e]);let t=w?.(e);return()=>{u(t=>t.filter(t=>t!==e)),t?.()}},[w]);o=Qs(o,t=>(0,L.jsx)(Wu,{value:e,children:(0,L.jsx)(pm.Provider,{value:T,children:t})}),[e,T]),o={...o,ref:Ks(c,o.ref)},o=fm({store:e,...o});let E=K(e,e=>t||e.autoFocusOnShow);return o=lm({store:e,modal:t,portal:n,autoFocusOnShow:E,...o,portalRef:p,hideOnEscape(t){return Qo(r,t)?!1:(requestAnimationFrame(()=>{requestAnimationFrame(()=>{e?.hide()})}),!0)}}),o});nf(U(function(e){return W(um,mm(e))}),Hu);var hm=`a`,gm=G(function({store:e,showOnHover:t=!0,...n}){let r=Hu();e||=r,Xo(e,!1);let i=$o(n),a=(0,x.useRef)(0);(0,x.useEffect)(()=>()=>window.clearTimeout(a.current),[]),(0,x.useEffect)(()=>zs(`mouseleave`,t=>{if(!e)return;let{anchorElement:n}=e.getState();n&&t.target===n&&(window.clearTimeout(a.current),a.current=0)},!0),[e]);let o=n.onMouseMove,s=Zs(t),c=nc(),l=H(t=>{if(o?.(t),i||!e||t.defaultPrevented||a.current||!c()||!s(t))return;let n=t.currentTarget;e.setAnchorElement(n),e.setDisclosureElement(n);let{showTimeout:r,timeout:l}=e.getState(),u=()=>{a.current=0,c()&&(e?.setAnchorElement(n),e?.show(),queueMicrotask(()=>{e?.setDisclosureElement(n)}))},d=r??l;d===0?u():a.current=window.setTimeout(u,d)}),u=n.onClick,d=H(t=>{u?.(t),e&&(window.clearTimeout(a.current),a.current=0)}),f=(0,x.useCallback)(t=>{if(!e)return;let{anchorElement:n}=e.getState();n?.isConnected||e.setAnchorElement(t)},[e]);return n={...n,ref:Ks(f,n.ref),onMouseMove:l,onClick:d},n=pl(n),n});U(function(e){return W(hm,gm(e))});function _m({popover:e,...t}={}){let n=Dl(t.store,Tl(e,[`arrowElement`,`anchorElement`,`contentElement`,`popoverElement`,`disclosureElement`])),r=n?.getState(),i=Jd({...t,store:n}),a=B(t.placement,r?.placement,`bottom`),o=yl({...i.getState(),placement:a,currentPlacement:a,anchorElement:B(r?.anchorElement,null),popoverElement:B(r?.popoverElement,null),arrowElement:B(r?.arrowElement,null),rendered:Symbol(`rendered`)},i,n);return{...i,...o,setAnchorElement:e=>o.setState(`anchorElement`,e),setPopoverElement:e=>o.setState(`popoverElement`,e),setArrowElement:e=>o.setState(`arrowElement`,e),render:()=>o.setState(`rendered`,Symbol(`rendered`))}}function vm(e,t,n){return Ys(t,[n.popover]),Ml(e,n,`placement`),Yd(e,t,n)}function ym(e={}){let t=e.store?.getState(),n=_m({...e,placement:B(e.placement,t?.placement,`bottom`)}),r=B(e.timeout,t?.timeout,500),i=yl({...n.getState(),timeout:r,showTimeout:B(e.showTimeout,t?.showTimeout),hideTimeout:B(e.hideTimeout,t?.hideTimeout),autoFocusOnShow:B(t?.autoFocusOnShow,!1)},n,e.store);return{...n,...i,setAutoFocusOnShow:e=>i.setState(`autoFocusOnShow`,e)}}function bm(e,t,n){return Ml(e,n,`timeout`),Ml(e,n,`showTimeout`),Ml(e,n,`hideTimeout`),vm(e,t,n)}var xm=uc([vc],[yc]),Sm=xm.useContext,Cm=xm.useScopedContext;xm.useProviderContext,xm.ContextProvider,xm.ScopedContextProvider,(0,x.createContext)(void 0);var wm=`div`,Tm=G(function({store:e,...t}){let n=gu();return e||=n,t={...t,ref:Ks(e?.setAnchorElement,t.ref)},t});U(function(e){return W(wm,Tm(e))});var Em=`button`,Dm=G(function(e){let t=(0,x.useRef)(null),n=Js(t,Em),[r,i]=(0,x.useState)(()=>!!n&&fs({tagName:n,type:e.type}));return(0,x.useEffect)(()=>{t.current&&i(fs(t.current))},[]),e={role:!r&&n!==`a`?`button`:void 0,...e,ref:Ks(t,e.ref)},e=_l(e),e});U(function(e){return W(Em,Dm(e))});var Om=`button`,km=Symbol(`disclosure`),Am=G(function({store:e,toggleOnClick:t=!0,...n}){let r=Yl();e||=r,Xo(e,!1);let i=(0,x.useRef)(null),[a,o]=(0,x.useState)(!1),s=K(e,`disclosureElement`),c=K(e,`open`);(0,x.useEffect)(()=>{let t=s===i.current;s?.isConnected||(e?.setDisclosureElement(i.current),t=!0),o(c&&t)},[s,e,c]);let l=n.onClick,u=Zs(t),[d,f]=ec(n,km,!0),p=H(t=>{l?.(t),!t.defaultPrevented&&(d||u(t)&&(e?.setDisclosureElement(t.currentTarget),e?.toggle()))});return n={"aria-expanded":a,"aria-controls":K(e,`contentElement`)?.id,...f,...n,ref:Ks(i,n.ref),onClick:p},n=Dm(n),n});U(function(e){return W(Om,Am(e))});var jm=`button`,Mm=G(function({store:e,...t}){let n=eu();return e||=n,Xo(e,!1),t={"aria-haspopup":ys(K(e,`contentElement`),`dialog`),...t},t=Am({store:e,...t}),t});U(function(e){return W(jm,Mm(e))});var Nm=`button`,Pm=G(function({store:e,...t}){let n=gu();e||=n,Xo(e,!1);let r=t.onClick,i=H(t=>{e?.setAnchorElement(t.currentTarget),r?.(t)});return t=Qs(t,t=>(0,L.jsx)(vu,{value:e,children:t}),[e]),t={...t,onClick:i},t=Tm({store:e,...t}),t=Mm({store:e,...t}),t});U(function(e){return W(Nm,Pm(e))});var Fm=`button`,Im=G(function({store:e,...t}){let n=$l();e||=n;let r=t.onClick,i=H(t=>{r?.(t),!t.defaultPrevented&&e?.hide()});return t={"data-dialog-dismiss":``,children:(0,x.useMemo)(()=>(0,L.jsxs)(`svg`,{"aria-label":`Dismiss popup`,display:`block`,fill:`none`,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:1.5,viewBox:`0 0 16 16`,height:`1em`,width:`1em`,children:[(0,L.jsx)(`line`,{x1:`4`,y1:`4`,x2:`12`,y2:`12`}),(0,L.jsx)(`line`,{x1:`4`,y1:`12`,x2:`12`,y2:`4`})]}),[]),...t,onClick:i},t=Dm(t),t}),Lm=U(function(e){return W(Fm,Im(e))}),Rm=`h1`,zm=G(function(e){let t=(0,x.useRef)(null),n=(0,x.useContext)(od)||1,r=`h${n}`,i=Js(t,r),a=(0,x.useMemo)(()=>!!i&&/^h\d$/.test(i),[i]);return e={render:(0,L.jsx)(r,{}),role:a?void 0:`heading`,"aria-level":a?void 0:n,...e,ref:Ks(t,e.ref)},e});U(function(e){return W(Rm,zm(e))});var Bm=`h1`,Vm=G(function({store:e,...t}){let n=(0,x.useContext)(ru),r=qs(t.id);return Us(()=>(n?.(r),()=>n?.(void 0)),[n,r]),t={...t,id:r},t=zm(t),t}),Hm=U(function(e){return W(Bm,Vm(e))}),Um=`div`,Wm=``;function Gm(){Wm=``}function Km(e){let t=e.target;return t&&hs(t)?!1:e.key===` `&&Wm.length?!0:e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key)}function qm(e,t){if(As(e))return!0;let n=e.target;return n?t.some(e=>e.element===n):!1}function Jm(e){return e.filter(e=>!e.disabled)}function Ym(e,t){let n=e.element?.textContent||e.children||`value`in e&&e.value;return n?Ko(n).trim().toLowerCase().startsWith(t.toLowerCase()):!1}function Xm(e,t,n){if(!n)return e;let r=e.find(e=>e.id===n);return!r||!Ym(r,t)||Wm!==t&&Ym(r,Wm)?e:(Wm=t,Cc(e.filter(e=>Ym(e,Wm)),n).filter(e=>e.id!==n))}var Zm=G(function({store:e,typeahead:t=!0,...n}){let r=gc();e||=r,Xo(e,!1);let i=n.onKeyDownCapture,a=(0,x.useRef)(0),o=H(n=>{if(i?.(n),n.defaultPrevented||!t||!e)return;if(!Km(n))return Gm();let{renderedItems:r,items:o,activeId:s,id:c}=e.getState(),l=Jm(o.length>r.length?o:r),u=V(n.currentTarget),d=`[data-offscreen-id="${c}"]`,f=u.querySelectorAll(d);for(let e of f){let t=e.ariaDisabled===`true`||`disabled`in e&&!!e.disabled;l.push({id:e.id,element:e,disabled:t})}if(f.length&&(l=Ss(l,e=>e.element)),!qm(n,l))return Gm();n.preventDefault(),window.clearTimeout(a.current),a.current=window.setTimeout(()=>{Wm=``},500);let p=n.key.toLowerCase();Wm+=p,l=Xm(l,p,s);let m=l.find(e=>Ym(e,Wm));m?e.move(m.id):Gm()});return n={...n,onKeyDownCapture:o},ts(n)});U(function(e){return W(Um,Zm(e))});var Qm=`div`;function $m(e){let t=e.relatedTarget;return t?.nodeType===Node.ELEMENT_NODE?t:null}function eh(e){let t=$m(e);return t?us(e.currentTarget,t):!1}var th=Symbol(`composite-hover`);function nh(e){let t=$m(e);if(!t)return!1;do{if(Wo(t,th)&&t[th])return!0;t=t.parentElement}while(t);return!1}var rh=G(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:n=!!t,...r}){let i=gc();e||=i,Xo(e,!1);let a=nc(),o=r.onMouseMove,s=Zs(t),c=H(t=>{if(o?.(t),!t.defaultPrevented&&a()&&s(t)){if(!qc(t.currentTarget)){let t=e?.getState().baseElement;t&&!Kc(t)&&t.focus()}e?.setActiveId(t.currentTarget.id)}}),l=r.onMouseLeave,u=Zs(n),d=H(t=>{var n;l?.(t),!t.defaultPrevented&&a()&&(eh(t)||nh(t)||s(t)&&u(t)&&(e?.setActiveId(null),(n=e?.getState().baseElement)==null||n.focus()))}),f=(0,x.useCallback)(e=>{e&&(e[th]=!0)},[]);return r={...r,ref:Ks(f,r.ref),onMouseMove:c,onMouseLeave:d},ts(r)});lc(U(function(e){return W(Qm,rh(e))}));var ih=uc([vc,Uu],[yc,Wu]),ah=ih.useContext,oh=ih.useScopedContext,sh=ih.useProviderContext,ch=ih.ContextProvider,lh=ih.ScopedContextProvider;(0,x.createContext)(void 0);var uh=`div`;function dh({store:e,...t}){let[n,r]=(0,x.useState)(void 0),i=t[`aria-label`],a=K(e,`disclosureElement`),o=K(e,`contentElement`);return(0,x.useEffect)(()=>{let e=a;if(!e)return;let t=o;t&&(i||t.hasAttribute(`aria-label`)?r(void 0):e.id&&r(e.id))},[i,a,o]),n}var fh=G(function({store:e,alwaysVisible:t,composite:n,...r}){let i=sh();e||=i,Xo(e,!1);let a=e.parent,o=e.menubar,s=!!a,c=qs(r.id),l=r.onKeyDown,u=K(e,e=>e.placement.split(`-`)[0]),d=K(e,e=>e.orientation===`both`?void 0:e.orientation),f=d!==`vertical`,p=K(o,e=>!!e&&e.orientation!==`vertical`),m=H(t=>{if(l?.(t),!t.defaultPrevented){if(s||o&&!f){let n={ArrowRight:()=>u===`left`&&!f,ArrowLeft:()=>u===`right`&&!f,ArrowUp:()=>u===`bottom`&&f,ArrowDown:()=>u===`top`&&f}[t.key];if(n?.())return t.stopPropagation(),t.preventDefault(),e?.hide()}if(o){let e={ArrowRight:()=>{if(p)return o.next()},ArrowLeft:()=>{if(p)return o.previous()},ArrowDown:()=>{if(!p)return o.next()},ArrowUp:()=>{if(!p)return o.previous()}}[t.key],n=e?.();n!==void 0&&(t.stopPropagation(),t.preventDefault(),o.move(n))}}});r=Qs(r,t=>(0,L.jsx)(lh,{value:e,children:t}),[e]);let h=dh({store:e,...r}),g=lu(K(e,`mounted`),r.hidden,t),_=g?{...r.style,display:`none`}:r.style;r={"aria-labelledby":h,hidden:g,...r,id:c,ref:Ks(c?e.setContentElement:null,r.ref),style:_,onKeyDown:m};let v=!!e.combobox;return n??=!v,n&&(r={role:`menu`,"aria-orientation":d,...r}),r=ql({store:e,composite:n,...r}),r=Zm({store:e,typeahead:!v,...r}),r});U(function(e){return W(uh,fh(e))});var ph=`div`,mh=G(function({store:e,modal:t=!1,portal:n=!!t,hideOnEscape:r=!0,autoFocusOnShow:i=!0,hideOnHoverOutside:a,alwaysVisible:o,...s}){let c=sh();e||=c,Xo(e,!1);let l=(0,x.useRef)(null),u=e.parent,d=e.menubar,f=!!u,p=!!d&&!f,m=f?!1:t;s={...s,ref:Ks(l,s.ref)};let{"aria-labelledby":h,...g}=fh({store:e,alwaysVisible:o,...s});s=g;let[_,v]=(0,x.useState)(),y=K(e,`autoFocusOnShow`),b=K(e,`initialFocus`),S=K(e,`baseElement`),C=K(e,`renderedItems`);(0,x.useEffect)(()=>{let e=!1;return v(t=>{if(e)return;if(m&&t?.current?.isConnected)return t;if(!y)return;let n;switch(b){case`first`:n=C.find(e=>!e.disabled&&e.element)?.element||null;break;case`last`:n=[...C].reverse().find(e=>!e.disabled&&e.element)?.element||null;break;default:n=S}if(n&&n===t?.current)return t;let r=(0,x.createRef)();return r.current=n,r}),()=>{e=!0}},[e,m,y,b,C,S]);let w=!!i,T=!!_||!!s.initialFocus||!!m,E=K(e.combobox||e,`contentElement`),D=K(u?.combobox||u,`contentElement`),O=(0,x.useMemo)(()=>{if(!D||!E)return;let e=E.getAttribute(`role`),t=D.getAttribute(`role`);if(!((t===`menu`||t===`menubar`)&&e===`menu`))return D},[E,D]);return O!==void 0&&(s={preserveTabOrderAnchor:O,...s}),s=mm({store:e,alwaysVisible:o,initialFocus:_,autoFocusOnShow:w?T&&i:y||!!m,...s,hideOnEscape(t){return Qo(r,t)?!1:(e?.hideAll(),!0)},hideOnHoverOutside(t){let n=e?.getState().disclosureElement;return(typeof a==`function`?a(t):a??(f?!0:p?n?!qc(n):!0:!1))?t.defaultPrevented||!f||!n||(Ns(n,`mouseout`,t),!qc(n))?!0:(requestAnimationFrame(()=>{qc(n)||e?.hide()}),!1):!1},modal:m,portal:n,backdrop:f?!1:s.backdrop}),s={"aria-labelledby":h,...s},s}),hh=nf(U(function(e){return W(ph,mh(e))}),sh),gh=`button`;function _h(e,t){return{ArrowDown:t===`bottom`||t===`top`?`first`:!1,ArrowUp:t===`bottom`||t===`top`?`last`:!1,ArrowRight:t===`right`?`first`:!1,ArrowLeft:t===`left`?`first`:!1}[e.key]}function vh(e,t){return!!e?.some(e=>!e.element||e.element===t?!1:e.element.getAttribute(`aria-expanded`)===`true`)}var yh=G(function({store:e,focusable:t,accessibleWhenDisabled:n,showOnHover:r,...i}){let a=sh();e||=a,Xo(e,!1);let o=(0,x.useRef)(null),s=e.parent,c=e.menubar,l=!!s,u=!!c&&!l,d=$o(i),f=e=>d||es(e),p=()=>{let t=o.current;t&&(e?.setDisclosureElement(t),e?.setAnchorElement(t),e?.show())},m=i.onFocus,h=H(t=>{if(m?.(t),f(t.currentTarget)||t.defaultPrevented||(e?.setAutoFocusOnShow(!1),e?.setActiveId(null),!c)||!u)return;let{items:n}=c.getState();vh(n,t.currentTarget)&&p()}),g=K(e,e=>e.placement.split(`-`)[0]),_=i.onKeyDown,v=H(t=>{if(_?.(t),f(t.currentTarget)||t.defaultPrevented)return;let n=_h(t,g);n&&(t.preventDefault(),p(),e?.setAutoFocusOnShow(!0),e?.setInitialFocus(n))}),y=i.onClick,b=H(t=>{if(y?.(t),t.defaultPrevented||!e)return;let n=!t.detail,{open:r}=e.getState();(!r||n)&&((!l||n)&&e.setAutoFocusOnShow(!0),e.setInitialFocus(n?`first`:`container`)),l&&p()});i=Qs(i,t=>(0,L.jsx)(ch,{value:e,children:t}),[e]),l&&(i={...i,render:(0,L.jsx)(Kd.div,{render:i.render})});let S=qs(i.id),C=K(s?.combobox||s,`contentElement`);return i={role:l||u?bs(C,`menuitem`):void 0,"aria-haspopup":ys(K(e,`contentElement`),`menu`),...i,id:S,ref:Ks(o,i.ref),onFocus:h,onKeyDown:v,onClick:b},i=gm({store:e,focusable:t,accessibleWhenDisabled:n,...i,showOnHover:e=>{if(!(()=>{if(typeof r==`function`)return r(e);if(r!=null)return r;if(l)return!0;if(!c)return!1;let{items:t}=c.getState();return u&&vh(t)})())return!1;let t=u?c:s;return t&&t.setActiveId(e.currentTarget.id),!0}}),i=Pm({store:e,toggleOnClick:!l,focusable:t,accessibleWhenDisabled:n,...i}),i=Zm({store:e,typeahead:u,...i}),i}),bh=U(function(e){return W(gh,yh(e))}),xh=`div`;function Sh(e,t,n){if(!e)return!1;if(qc(e))return!0;let r=(t?.find(e=>e.element===n?!1:e.element?.getAttribute(`aria-expanded`)===`true`)?.element)?.getAttribute(`aria-controls`);if(!r)return!1;let i=V(e).getElementById(r);return i?qc(i)?!0:!!i.querySelector(`[role=menuitem][aria-expanded=true]`):!1}var Ch=G(function({store:e,hideOnClick:t=!0,preventScrollOnKeyDown:n=!0,focusOnHover:r,blurOnHoverEnd:i,...a}){let o=oh(!0),s=Cm();e=e||o||s,Xo(e,!1);let c=a.onClick,l=Zs(t),u=`hideAll`in e?e.hideAll:void 0,d=!!u,f=H(e=>{c?.(e),!e.defaultPrevented&&(Ms(e)||js(e)||u&&e.currentTarget.getAttribute(`aria-haspopup`)!==`menu`&&l(e)&&u())});return a={role:bs(K(e,e=>`contentElement`in e?e.contentElement:null),`menuitem`),...a,onClick:f},a=J({store:e,preventScrollOnKeyDown:n,...a}),a=rh({store:e,...a,focusOnHover(t){if(!e||!(typeof r==`function`?r(t):r??!0))return!1;let{baseElement:n,items:i}=e.getState();return d?(t.currentTarget.hasAttribute(`aria-expanded`)&&t.currentTarget.focus(),!0):Sh(n,i,t.currentTarget)?(t.currentTarget.focus(),!0):!1},blurOnHoverEnd(e){return typeof i==`function`?i(e):i??d}}),a}),wh=lc(U(function(e){return W(xh,Ch(e))}));function Th({combobox:e,parent:t,menubar:n,...r}={}){let i=!!n&&!t,a=Dl(r.store,El(t,[`values`]),Tl(e,[`arrowElement`,`anchorElement`,`contentElement`,`popoverElement`,`disclosureElement`])),o=a.getState(),s=Nu({...r,store:a,orientation:B(r.orientation,o.orientation,`vertical`)}),c=ym({...r,store:a,placement:B(r.placement,o.placement,`bottom-start`),timeout:B(r.timeout,o.timeout,i?0:150),hideTimeout:B(r.hideTimeout,o.hideTimeout,0)}),l=yl({...s.getState(),...c.getState(),initialFocus:B(o.initialFocus,`container`),values:B(r.values,o.values,r.defaultValues,{})},s,c,a);return bl(l,()=>Cl(l,[`mounted`],e=>{e.mounted||l.setState(`activeId`,null)})),bl(l,()=>Cl(t,[`orientation`],e=>{l.setState(`placement`,e.orientation===`vertical`?`right-start`:`bottom-start`)})),{...s,...c,...l,combobox:e,parent:t,menubar:n,hideAll:()=>{c.hide(),t?.hideAll()},setInitialFocus:e=>l.setState(`initialFocus`,e),setValues:e=>l.setState(`values`,e),setValue:(e,t)=>{e!==`__proto__`&&e!==`constructor`&&(Array.isArray(e)||l.setState(`values`,n=>{let r=n[e],i=Vo(t,r);return i===r?n:{...n,[e]:i!==void 0&&i}}))}}}function Eh(e,t,n){return Ys(t,[n.combobox,n.parent,n.menubar]),Ml(e,n,`values`,`setValues`),Object.assign(bm(Pu(e,t,n),t,n),{combobox:n.combobox,parent:n.parent,menubar:n.menubar})}function Dh(e={}){let t=ah(),n=Sm(),r=Iu();e={...e,parent:e.parent===void 0?t:e.parent,menubar:e.menubar===void 0?n:e.menubar,combobox:e.combobox===void 0?r:e.combobox};let[i,a]=Nl(Th,e);return Eh(i,a,e)}function Oh(e={}){return(0,L.jsx)(ch,{value:Dh(e),children:e.children})}var kh=`hr`,Ah=G(function({store:e,...t}){let n=ah();return e||=n,t=Bu({store:e,...t}),t}),jh=U(function(e){return W(kh,Ah(e))}),Mh={root:`_0bZjG`,inputContainer:`f-ccT`,input:`BQJSS`,startAdornment:`pFIPb`,endAdornment:`MBy3g`},Nh={legend:`BjkL4`,label:`IogM9`,errorText:`iCPgd`,textErrorMessage:`_1r4K2`,helperText:`aW7kV`,fieldSet:`LwRcp`};function Ph({error:e,className:t,...n}){return(0,L.jsx)(`fieldset`,{...n,className:(0,R.default)(Nh.fieldSet,e&&Nh.hasError,t)})}function Fh({error:e,className:t,...n}){return(0,L.jsx)(`div`,{...n,className:(0,R.default)(Nh.helperText,e&&Nh.hasError,t)})}function Ih({error:e,className:t,...n}){return(0,L.jsx)(`label`,{...n,className:(0,R.default)(Nh.label,e&&Nh.hasError,t)})}function Lh({error:e,className:t,...n}){return(0,L.jsx)(`div`,{...n,className:(0,R.default)(Nh.legend,e&&Nh.hasError,t)})}function Rh({className:e,...t}){return(0,L.jsx)(`p`,{...t,className:(0,R.default)(Nh.errorText,Nh.textErrorMessage,e)})}var zh=Ba(function({as:e=`input`,label:t,disabled:n,error:r,hint:i,size:a,multiline:o,startAdornment:s,endAdornment:c,id:l,style:u,className:d,inputClassName:f,ref:p,wrapperRef:m,...h}){let g=e===`input`?o?`textarea`:`input`:e,_=(0,x.useId)(),v=l||_;return(0,L.jsxs)(`div`,{className:(0,R.default)(Mh.root,d),style:{maxWidth:a,...u},"data-error":!!r,"aria-disabled":!!n,id:l?`${l}-container`:void 0,ref:m,children:[t&&(0,L.jsx)(Ih,{htmlFor:v,children:t}),i&&(0,L.jsx)(Fh,{id:`${v}_hint`,children:i}),(0,L.jsxs)(`div`,{className:(0,R.default)(Mh.inputContainer),children:[s&&(0,L.jsx)(`div`,{className:Mh.startAdornment,children:s}),(0,L.jsx)(g,{ref:p,disabled:n,id:v,...h,"aria-describedby":(0,R.default)(h[`aria-describedby`],!!i&&`${v}_hint`,!!r&&`${v}_error`),"aria-invalid":!!r,className:(0,R.default)(Mh.input,f)}),c&&(0,L.jsx)(`div`,{className:Mh.endAdornment,children:c})]}),r&&(0,L.jsx)(Rh,{id:`${v}_error`,role:`alert`,children:r})]})});function Bh({value:e,ref:t,wrapperRef:n,...r}){let i=(0,x.useRef)(void 0),a=Ha(t,i),o=()=>{Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,`value`)?.set?.call(i.current,``);let e=new Event(`input`,{bubbles:!0});i.current?.dispatchEvent(e)},s=e=>{e.key===`Escape`&&o(),r.onKeyDown?.(e)},c=(e??``).length>0;return(0,L.jsx)(zh,{ref:a,wrapperRef:n,...r,type:`search`,onKeyDown:s,value:e,startAdornment:(0,L.jsx)(va,{size:24,style:{marginTop:6}}),endAdornment:(0,L.jsx)(`button`,{type:`button`,onClick:o,tabIndex:-1,style:{marginTop:6,opacity:+!!c,pointerEvents:c?void 0:`none`},children:(0,L.jsx)(Ca,{size:32,style:{opacity:.75}})})})}function Vh(e,t){let[n,r]=(0,x.useState)(e),i=(0,x.useRef)(Date.now());return(0,x.useEffect)(()=>{let n=setTimeout(()=>{Date.now()-i.current>=t&&(r(e),i.current=Date.now())},t-(Date.now()-i.current));return()=>{clearTimeout(n)}},[e,t]),n}var Hh={root:`hhIFY`,button:`LYR4G`,value:`afH1B`,numberInput:`MdvMX`};function Uh({id:e,name:t,value:n,defaultValue:r,onChange:i,min:a=-1/0,max:o=1/0,step:s=1,disabled:c,error:l,className:u,style:d,onFocus:f,decreaseIcon:p,increaseIcon:m,...h}){let g=n!==void 0,_=(0,x.useRef)(null),[v,y]=(0,x.useState)((g?n:r)??``);g&&n!==v&&y(n);let b=Number(o),S=Number(a),C=Number(s),w=e=>{let n=Gh(e,S,b);y(n);let r=new Event(`change`),a={writable:!1,value:{name:t,value:n}};Object.defineProperty(r,`target`,a),Object.defineProperty(r,`currentTarget`,a),i?.(r)},T=e=>{let t=Number(v)||0;e.key===`Home`?(e.preventDefault(),w(`${S}`)):e.key===`End`&&b<1/0?(e.preventDefault(),w(`${b}`)):e.key===`ArrowUp`?(e.preventDefault(),w(`${t+C}`)):e.key===`ArrowDown`&&(e.preventDefault(),w(`${t-C}`))},E=e=>{w(e.target.value)},D=e=>()=>{w((Number(v)||0)+e),Wh()||_.current?.focus()};return(0,L.jsxs)(`div`,{className:(0,R.default)(Hh.root,u),"aria-valuenow":Number(n||0),"aria-valuemin":S===-1/0?void 0:S,"aria-valuemax":b===1/0?void 0:b,tabIndex:-1,style:d,"aria-invalid":!!l,"aria-disabled":!!c,id:e?`${e}-container`:void 0,children:[(0,L.jsx)(`button`,{type:`button`,onClick:D(-C),className:(0,R.default)(Hh.button),disabled:c||Number(v||0)<=S,"aria-label":`Decrease`,tabIndex:-1,children:p??(0,L.jsx)(ya,{})}),(0,L.jsx)(`input`,{ref:_,id:e,role:`spinbutton`,type:`tel`,inputMode:`numeric`,pattern:`[0-9]*`,className:(0,R.default)(Hh.value,Hh.numberInput),name:t,min:S,max:b,value:v,onChange:E,onKeyDown:T,disabled:c,onFocus:e=>{_.current?.select(),f?.(e)},...h}),(0,L.jsx)(`button`,{type:`button`,onClick:D(C),className:Hh.button,disabled:c||Number(v||0)>=b,"aria-label":`Increase`,tabIndex:-1,children:m??(0,L.jsx)(Aa,{})})]})}function Wh(){try{return document.createEvent(`TouchEvent`),!0}catch{return!1}}function Gh(e,t,n){let r=typeof e==`string`?parseFloat(e):e;return e===`-`?e:isNaN(r)?``:Math.max(t,Math.min(n,r))}var Kh={backdrop:`JKTsp`,dialog:`hTxsM`,header:`Y-99i`,withTitle:`_51P42`,title:`GprBx`,content:`G5k-W`,closeButton:`xWVnm`,footer:`NGZT3`};function qh({title:e,isOpen:t=!0,onDismiss:n,initialFocusRef:r,className:i,style:a,children:o,hideOnInteractOutside:s}){let c=s??!!n;return(0,L.jsxs)(rf,{initialFocus:r,open:t,onClose:()=>n?.(),backdrop:(0,L.jsx)(`div`,{className:Kh.backdrop}),modal:!0,hideOnInteractOutside:c,hideOnEscape:!!n,className:(0,R.default)(Kh.dialog,Kh.withTitle,i),style:{"--transition-opacity":1,...a},children:[(0,L.jsxs)(`header`,{className:(0,R.default)(Kh.header,Kh.withTitle),children:[e&&(0,L.jsx)(Hm,{className:Kh.title,children:e}),(0,L.jsx)(Lm,{className:Kh.closeButton,style:{display:n?void 0:`none`},children:(0,L.jsx)(Ca,{})})]}),(0,L.jsx)(`section`,{className:(0,R.default)(Kh.content,Kh.withTitle),children:o})]})}qh.Footer=({children:e})=>(0,L.jsx)(`footer`,{className:Kh.footer,children:e});var Jh={menuButton:`uQnDM`,list:`_5sdh-`,listItem:`cYlZh`,separator:`WSXYE`};function Yh({items:e,label:t=`Menu`,buttonProps:n={},arrow:r=!0}){let{className:i,style:a}=Do(n);return(0,L.jsxs)(Oh,{children:[(0,L.jsx)(bh,{className:(0,R.default)(Jh.menuButton,i),style:a,children:(0,L.jsxs)(`span`,{className:`dmk-text-with-icon`,children:[t,r&&(0,L.jsx)(Da,{className:`dmk-margin-left-xxs`})]})}),(0,L.jsx)(hh,{className:Jh.list,children:e.map(({action:e,label:t,selected:n,separator:r},i)=>r?(0,L.jsx)(jh,{className:Jh.separator},i):(0,L.jsxs)(wh,{onClick:e,className:Jh.listItem,disabled:!e,children:[t,` `,n&&(0,L.jsx)(wa,{})]},i))})]})}var Xh=class extends x.Component{constructor(){super(...arguments),this.state={error:null},this.resetErrorBoundary=()=>{this.props.onReset?.(),this.setState({error:null})}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){return this.state.error?(0,x.isValidElement)(this.props.fallback)?this.props.fallback:typeof this.props.fallback==`function`?this.props.fallback({error:this.state.error,resetErrorBoundary:this.resetErrorBoundary}):null:this.props.children}};Xh.defaultProps={fallback:(0,L.jsx)(`div`,{className:`dmk-padding-m`,children:(0,L.jsx)(Ja,{intent:`error`,title:`Error`,children:(0,L.jsx)(`p`,{children:`An error occurred`})})}),onError:(e,t)=>console.error(e,t)};var Zh={root:`j5ZL9`,hamburgerButton:`wJ6xF`};function Qh({open:e=!1,className:t,...n}){return(0,L.jsx)(`button`,{type:`button`,...n,className:(0,R.default)(Zh.root,t),"data-open":e,children:(0,L.jsxs)(`div`,{className:Zh.hamburgerButton,children:[(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{}),(0,L.jsx)(`span`,{})]})})}var $h=e=>{if(e.trim()===``)return``;let t=parseFloat(e.replace(/[^0-9,.]/g,``));return isNaN(t)?``:t},eg=Ba(({value:e,onChange:t,onBlur:n,min:r,max:i,...a})=>{let o=+(r??0),s=+(i||2**53-1),[c,l]=(0,x.useState)(e??``),u=(0,x.useRef)(null);return(0,x.useEffect)(()=>{e!=null&&l(`${e}`)},[e]),(0,L.jsx)(zh,{type:`tel`,inputMode:`numeric`,pattern:`[0-9]*`,autoComplete:`off`,value:c,onChange:e=>{let n=e.currentTarget.value;l(n);let r=$h(n);u.current=r;let i=new Event(`change`);Object.defineProperty(i,`target`,{writable:!1,value:{name:e.target.name,value:`${r}`}}),t?.(i)},onBlur:e=>{typeof u.current==`number`?l(`${u.current}`):l(``),n?.(e)},min:o,max:s,...a})}),tg={root:`_2NpgS`,radio:`qytUm`,input:`_9AxBc`,radioGroup:`xYP4R`},ng=Ba(function({as:e=og,name:t,value:n,onChange:r,disabled:i,children:a,error:o,variant:s=`normal`,...c}){return(0,L.jsx)(rg,{value:(0,x.useMemo)(()=>({name:t,disabled:i,isChecked:e=>n===e,onChange:r}),[t,n,r,i]),children:(0,L.jsx)(e,{role:`radiogroup`,"data-radio-group":t,"data-variant":s,...c,"data-error":!!o,"aria-disabled":!!i,className:(0,R.default)(tg.radioGroup,c.className),children:a})})}),rg=Ua(`RadioGroupContext`,null);function ig({children:e,className:t,style:n,error:r,...i}){let a=ag(i);return(0,L.jsxs)(`label`,{className:(0,R.default)(tg.root,t),"data-checked":a.checked,"data-error":r,"aria-disabled":a.disabled,style:n,children:[(0,L.jsx)(`input`,{...i,className:(0,R.default)(`dmk-visually-hidden`,tg.input),"aria-checked":a.checked,"aria-invalid":r?`true`:`false`,type:`radio`,...a}),(0,L.jsx)(`span`,{className:tg.radio,"aria-hidden":`true`}),(0,L.jsx)(`span`,{children:typeof e==`function`?e(a.checked):e})]})}function ag(e){let t=(0,x.use)(rg);return t==null?e:{value:e.value,name:t.name,checked:t.isChecked(e.value),disabled:t.disabled,onChange:t.onChange}}var og=Ba(function(e){return(0,L.jsx)(Io,{spacing:`s`,...e})}),sg={root:`piq-R`,sidebar:`Og3fR`,mobile:`muuLM`,overlay:`xZmuk`,header:`JYx2J`,contentContainer:`_5UdA1`,content:`xV9Cb`,sidebarMenuItem:`xAYHd`,sidebarSectionHeading:`tt-vd`,sidebarSectionHeader:`_4VfZO`,arrow:`H1UKZ`,open:`udBU-`};function cg(e=!1){let[t,n]=(0,x.useState)(e),r=(0,x.useCallback)(()=>n(e=>!e),[]),i=(0,x.useCallback)(()=>n(!0),[]),a=(0,x.useCallback)(()=>n(!1),[]);return(0,x.useMemo)(()=>({value:t,toggle:r,enable:i,disable:a}),[t,r,i,a])}function lg(e){let t=(0,x.useRef)(void 0);return Za(()=>{t.current=e},[e]),t.current}var ug=(0,x.createContext)(null);function dg(){let e=(0,x.use)(ug);if(e==null)throw Error(`MenuOpenContext not available`);return e}function fg({header:e,sidebar:t,children:n,className:r,maxWidth:i,headerHeight:a,style:o}){let s=jo([!0,!1,!1]),c=cg(!s),l=lg(c.value);return Za(()=>{!s&&!l?c.enable():s&&l&&c.disable()},[s,c,l]),(0,L.jsx)(ug,{value:c,children:(0,L.jsxs)(`div`,{className:(0,R.default)(sg.root,r,s&&sg.mobile),style:{"--max-width":i,"--header-height":a,...o},children:[e,s&&c.value&&(0,L.jsx)(`div`,{className:sg.overlay,onClick:c.disable}),(0,L.jsxs)(`aside`,{className:(0,R.default)(sg.sidebar,s&&sg.mobile),"data-open":c.value,children:[s&&(0,L.jsx)(Io,{horizontal:!0,justifyContent:`flex-end`,className:`dmk-margin-bottom-l`,children:(0,L.jsx)(pg,{})}),t]}),(0,L.jsx)(`main`,{className:(0,R.default)(sg.contentContainer,s&&sg.mobile),children:(0,L.jsx)(`div`,{className:sg.content,children:n})})]})})}function pg(){let e=dg();return(0,L.jsx)(Qh,{open:e.value,onClick:e.toggle})}function mg({logo:e,children:t,className:n,style:r}){let i=jo([!0,!1,!1]);return(0,L.jsxs)(Io,{horizontal:[!1,!0,!0],justifyContent:`space-between`,alignItems:`center`,className:(0,R.default)(sg.header,i&&sg.mobile,n),style:r,children:[(0,L.jsxs)(Io,{horizontal:!0,alignItems:`center`,justifyContent:`space-between`,children:[i&&(0,L.jsx)(pg,{}),e]}),t]})}var hg=Ba(function({as:e=`a`,onClick:t,className:n,children:r,...i}){let a=dg(),o=jo([!0,!1,!1]);return(0,L.jsx)(e,{...i,className:(0,R.default)(sg.sidebarMenuItem,n),draggable:!1,onClick:e=>{t?.(e),!e.defaultPrevented&&o&&a.disable()},children:(0,L.jsx)(`span`,{children:r})})}),gg={root:`ScOVn`,selectContainer:`o18SG`,arrow:`LsR6O`,select:`f1zqA`,hint:`_1hf0-`};function _g(e){return ha({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M11.47 4.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1-1.06 1.06L12 6.31 8.78 9.53a.75.75 0 0 1-1.06-1.06l3.75-3.75Zm-3.75 9.75a.75.75 0 0 1 1.06 0L12 17.69l3.22-3.22a.75.75 0 1 1 1.06 1.06l-3.75 3.75a.75.75 0 0 1-1.06 0l-3.75-3.75a.75.75 0 0 1 0-1.06Z`,clipRule:`evenodd`},child:[]}]})(e)}function vg(e){return ha({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M11.47 2.47a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06l-6.22-6.22V21a.75.75 0 0 1-1.5 0V4.81l-6.22 6.22a.75.75 0 1 1-1.06-1.06l7.5-7.5Z`,clipRule:`evenodd`},child:[]}]})(e)}function yg(e){return ha({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`},child:[{tag:`path`,attr:{fillRule:`evenodd`,d:`M12 2.25a.75.75 0 0 1 .75.75v16.19l6.22-6.22a.75.75 0 1 1 1.06 1.06l-7.5 7.5a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 1 1 1.06-1.06l6.22 6.22V3a.75.75 0 0 1 .75-.75Z`,clipRule:`evenodd`},child:[]}]})(e)}function bg({style:e,className:t,error:n,hint:r,label:i,value:a,disabled:o,children:s,placeholder:c,id:l,ref:u,...d}){let f=(0,x.useId)(),p=l||f;return(0,L.jsxs)(`div`,{className:(0,R.default)(gg.root,t),"data-error":!!n,"aria-disabled":!!o,style:e,children:[i&&(0,L.jsx)(Ih,{htmlFor:p,children:i}),r&&(0,L.jsx)(`div`,{className:gg.hint,id:`${p}_hint`,children:r}),(0,L.jsxs)(`div`,{className:(0,R.default)(gg.selectContainer),children:[(0,L.jsxs)(`select`,{id:p,ref:u,...d,disabled:o,value:a===null?``:a,className:(0,R.default)(gg.select),"aria-invalid":!!n,"aria-describedby":(0,R.default)(d[`aria-describedby`],!!r&&`${p}_hint`,!!n&&`${p}_error`),children:[c&&(0,L.jsx)(`option`,{value:``,children:c}),s]}),(0,L.jsx)(`div`,{className:gg.arrow,"aria-hidden":!0,role:`presentation`,children:(0,L.jsx)(_g,{})})]}),n&&(0,L.jsx)(Rh,{role:`alert`,id:`${p}_error`,children:n})]})}var xg={visuallyHidden:`zZoQC`},Sg=Ba(function({as:e=`div`,className:t,ref:n,...r}){return(0,L.jsx)(e,{ref:n,...r,className:(0,R.default)(xg.visuallyHidden,t)})}),Cg={root:`_7x-oj`,scrollableContainer:`Sc0YX`,sortPrioIndicator:`tKRSW`},wg=[10,20,50,100];function Tg({limit:e,onLimitChange:t,page:n,onPageChange:r,total:i,limits:a=wg}){let o=Math.ceil(i/Math.max(1,e)),s=e*(Math.max(1,n)-1);return(0,L.jsxs)(Io,{horizontal:!0,alignItems:`center`,children:[(0,L.jsx)(Uh,{name:`page`,value:n,onChange:e=>r(+e.currentTarget.value||1),min:1,max:o,decreaseIcon:(0,L.jsx)(Oa,{}),increaseIcon:(0,L.jsx)(Ea,{})}),(0,L.jsxs)(`span`,{style:{whiteSpace:`nowrap`},children:[(0,L.jsx)(`span`,{className:`dmk-text-semibold`,children:s+1}),` to`,` `,(0,L.jsx)(`span`,{className:`dmk-text-semibold`,children:Math.min(s+e,i)}),` `,`of `,(0,L.jsx)(`span`,{className:`dmk-text-semibold`,children:i})]}),(0,L.jsx)(`div`,{className:`dmk-margin-left-auto`,children:(0,L.jsx)(Yh,{label:`${e} per page`,items:a.map(n=>({label:`${n} per page`,action:()=>t(n),selected:n===e})),buttonProps:{variant:`text`,size:`s`}})})]})}var Eg=365.2425,Dg=6e4,Og=36e5,kg=3600*24;kg*7,kg*Eg/12*3;var Ag=Symbol.for(`constructDateFrom`);function jg(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Ag in e?e[Ag](t):e instanceof Date?new e.constructor(t):new Date(t)}function Mg(e,t){return jg(t||e,e)}function Ng(e,t){let n=Mg(e)-+Mg(t);return n<0?-1:n>0?1:n}function Pg(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Fg(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}function Ig(e,t){let n=Mg(e,t?.in);if(isNaN(+n))throw RangeError(`Invalid time value`);let r=t?.format??`extended`,i=t?.representation??`complete`,a=``,o=``,s=r===`extended`?`-`:``,c=r===`extended`?`:`:``;if(i!==`time`){let e=Fg(n.getDate(),2),t=Fg(n.getMonth()+1,2);a=`${Fg(n.getFullYear(),4)}${s}${t}${s}${e}`}if(i!==`date`){let e=n.getTimezoneOffset();if(e!==0){let t=Math.abs(e),n=Fg(Math.trunc(t/60),2),r=Fg(t%60,2);o=`${e<0?`+`:`-`}${n}:${r}`}else o=`Z`;let t=Fg(n.getHours(),2),r=Fg(n.getMinutes(),2),i=Fg(n.getSeconds(),2),s=a===``?``:`T`,l=[t,r,i].join(c);a=`${a}${s}${l}${o}`}return a}function Lg(e,t){let n=()=>jg(t?.in,NaN),r=t?.additionalDigits??2,i=Hg(e),a;if(i.date){let e=Ug(i.date,r);a=Wg(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=Kg(i.time),isNaN(s)))return n();if(i.timezone){if(c=Jg(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=Mg(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return Mg(o+s+c,t?.in)}var Rg={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},zg=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Bg=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Vg=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hg(e){let t={},n=e.split(Rg.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Rg.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Rg.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=Rg.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function Ug(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function Wg(e,t){if(t===null)return new Date(NaN);let n=e.match(zg);if(!n)return new Date(NaN);let r=!!n[4],i=Gg(n[1]),a=Gg(n[2])-1,o=Gg(n[3]),s=Gg(n[4]),c=Gg(n[5])-1;if(r)return e_(t,s,c)?Yg(t,s,c):new Date(NaN);{let e=new Date(0);return!Qg(t,a,o)||!$g(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function Gg(e){return e?parseInt(e):1}function Kg(e){let t=e.match(Bg);if(!t)return NaN;let n=qg(t[1]),r=qg(t[2]),i=qg(t[3]);return t_(n,r,i)?n*Og+r*Dg+i*1e3:NaN}function qg(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Jg(e){if(e===`Z`)return 0;let t=e.match(Vg);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return n_(r,i)?n*(r*Og+i*Dg):NaN}function Yg(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Xg=[31,null,31,30,31,30,31,31,30,31,30,31];function Zg(e){return e%400==0||e%4==0&&e%100!=0}function Qg(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Xg[t]||(Zg(e)?29:28))}function $g(e,t){return t>=1&&t<=(Zg(e)?366:365)}function e_(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function t_(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function n_(e,t){return t>=0&&t<=59}var r_=(e,t)=>e==null&&t==null?0:e==null?-1:t==null?1:typeof e==`string`&&typeof t==`string`?e.localeCompare(t):Pg(e)&&Pg(t)?Ng(e,t):typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?e===t?0:e?1:-1:String(e).localeCompare(String(t)),i_=Symbol();function a_(e,t={},n=void 0,r=r_){let i=Ga(e),a=(e,r)=>{if(typeof e==`function`)return Ga(e(r));if(e===i_)return[r];if(typeof e==`string`&&typeof r==`object`&&r){let i=e.at(0)===`-`?e.slice(1):e;return i in t?[t[i]?.(r,n)]:[r[i]]}return[r]};return function(e){return e.slice().sort((e,t)=>{if(i.length===0)return r(e,t);for(let n of i){let i=a(n,e),o=a(n,t);for(let e=0;e<i.length;e++){let t=i[e],a=o[e];if(t==null&&a==null)continue;if(t==null)return 1;if(a==null)return-1;let s=r(t,a);if(s!==0)return typeof n==`string`&&n.at(0)===`-`?s*-1:s}}return 0})}}function o_({multi:e=!0,keys:t}={}){function n(t,n){if(n.column==null)return[];let r=`-${String(n.column)}`;return t.includes(r)?t.filter(e=>e!==r):t.includes(n.column)?t.map(e=>e===n.column?r:e):!e||!n.shiftKey?[n.column]:t.concat([n.column])}return{multi:e,keys:t,sortReducer:n}}var s_=[];function c_(e,t={}){let[n,r]=(0,x.useReducer)(e.sortReducer,t.initialSortingColumns??s_),i=(0,x.useMemo)(()=>a_(n,e.keys,t.context),[n,e.keys,t.context]);function a(e){let t=n.length>1,r;return(r=n.indexOf(e))>-1?(0,L.jsx)(l_,{direction:`asc`,priority:t?r+1:null}):(r=n.indexOf(`-${String(e)}`))>-1?(0,L.jsx)(l_,{direction:`desc`,priority:t?r+1:null}):(0,L.jsx)(l_,{})}function o(e,t){return(0,L.jsxs)(L.Fragment,{children:[t??e,` `,a(e)]})}function s(e,t){return{"data-sortable":!0,onClick:t=>{r({column:e,shiftKey:t.shiftKey})},children:o(e,t)}}return{sortColumns:n,toggleSortColumn:r,sorted:i,getThProps:s}}function l_({direction:e,priority:t}){return e==null?(0,L.jsx)(_g,{className:`dmk-text-muted`}):(0,L.jsxs)(L.Fragment,{children:[e===`asc`?(0,L.jsx)(vg,{}):(0,L.jsx)(yg,{}),` `,t!=null&&(0,L.jsx)(`sup`,{className:Cg.sortPrioIndicator,children:t})]})}function u_(e){return(0,L.jsx)(`div`,{...e,className:(0,R.default)(Cg.scrollableContainer,e.className)})}function d_({ref:e,isPending:t,renderHeaderRow:n,renderRow:r,renderEmpty:i,renderFooter:a,items:o,caption:s,...c}){let l=(0,x.useRef)(null),u=Ha(e,l),[d,f]=(0,x.useState)(0);return(0,x.useLayoutEffect)(()=>{l.current&&f(l.current.querySelectorAll(`thead th`).length)}),(0,L.jsxs)(`table`,{ref:u,...c,className:(0,R.default)(Cg.root,c.className),children:[s&&(0,L.jsx)(Sg,{as:`caption`,children:s}),(0,L.jsx)(`thead`,{children:n()}),o&&o.length>0&&(0,L.jsx)(`tbody`,{children:(o||[]).map(r)}),(0,L.jsxs)(`tfoot`,{children:[t&&(0,L.jsx)(`tr`,{children:(0,L.jsx)(`td`,{"data-align":`center`,colSpan:d,children:(0,L.jsx)(Io,{horizontal:!0,spacing:`s`,justifyContent:`center`,alignItems:`center`,style:{height:100},children:(0,L.jsx)(no,{size:64})})})}),!t&&o&&o.length===0&&i?.({numColumns:d}),a?.({numColumns:d})]})]})}function f_(e,t){let n=(0,x.useRef)(e);Za(()=>{n.current=e},[e]),(0,x.useEffect)(()=>{if(!t&&t!==0)return;let e=setTimeout(()=>n.current(),t);return()=>clearTimeout(e)},[t])}var p_=Ua(`ToastContext`,null);function m_(e,t){switch(t.type){case`ADD`:return[...e,{_id:Date.now(),...t.payload}].slice(-5);case`REMOVE`:return e.filter(e=>e._id!==t.payload);default:return e}}function h_({children:e}){let[t,n]=(0,x.useReducer)(m_,[]),[r,i]=(0,x.useState)({}),a=(0,x.useCallback)(e=>{n({type:`ADD`,payload:e})},[]),o=e=>{n({type:`REMOVE`,payload:e}),i(t=>{let n={...t};return delete n[e],n})},s=e=>{let n=0;for(let i=0;i<e;i++){let e=t[i]._id;n+=(r[e]||0)+8}return n},c=(e,t)=>{i(n=>({...n,[e]:t}))};return(0,L.jsxs)(p_.Provider,{value:a,children:[e,(0,L.jsx)(`div`,{style:{position:`fixed`,top:0,zIndex:`var(--z-index-9)`,right:16,left:16,maxWidth:500,margin:`40px auto`,pointerEvents:`none`},children:t.map((e,t)=>(0,L.jsx)(`div`,{style:{position:`absolute`,top:0,left:0,right:0,transform:`translateY(${s(t)}px)`,transition:`transform 200ms ease-out`,pointerEvents:`all`},children:(0,L.jsx)(v_,{onClose:()=>o(e._id),onHeight:t=>c(e._id,t),...e})},e._id))})]})}function g_(){let e=(0,x.use)(p_);if(e==null)throw Error();return e}function __({title:e,description:t,intent:n,duration:r,onClose:i}){let a=_o(),o=r??1e4,[s,c]=(0,x.useState)(!1),[l,u]=(0,x.useState)(o);return f_(()=>{c(!0)},l),(0,L.jsx)(`div`,{style:{boxShadow:a.shadows.elevation1.valueOf(),borderRadius:a.borderRadius.s,opacity:+!s,transition:`opacity 200ms ease-out`},onTransitionEnd:()=>{s&&i()},children:(0,L.jsx)(Ja,{title:e,intent:n||`success`,onClose:()=>c(!0),onMouseOver:()=>{u(null)},onMouseLeave:()=>{u(o)},children:t})})}function v_({onHeight:e,...t}){return(0,L.jsx)(`div`,{ref:(0,x.useCallback)(t=>{t&&requestAnimationFrame(()=>{let n=t.getBoundingClientRect().height;e(n)})},[e]),children:(0,L.jsx)(__,{...t})})}var y_={email:x_,date:S_,"date-time":S_},b_={"credit-card-number":C_};function x_(e){if(!e)return!1;let t=e.split(`@`);return!(t.length!==2||!t[1].includes(`.`)||t[0].substr(-1)===`.`)}function S_(e){if(!e)return!1;let t=Lg(e);return isNaN(t.getTime())?!1:Pg(t)}function C_(e){return typeof e==`string`?e.replace(/\D+/g,``):``}var w_=T_();function T_(e=0){let t=e,n=()=>++t;return n.reset=()=>t=0,n}function E_(e){return e.length===0?void 0:e[e.length-1]}function D_(e,t){if(!Array.isArray(t))return e;let n=new Set(t),r=new Set(e),i=[];for(let e of t)r.has(e)&&i.push(e);for(let t of e)n.has(t)||i.push(t);return i}function O_(e,t){if(!e)throw Error(`Invariant failed`)}function k_(e,t){if(!e){console.warn(t);try{throw Error(t)}catch{}}}function A_(e){return e}function j_(e){return e.type===`object`||!!e.properties||Array.isArray(e.required)||Array.isArray(e.allOf)||!!(e.if&&j_(e.if))}function M_(e,t=`schema must be of type object`){if(!e||!j_(e))throw Error(t)}function N_(e){return!!(e.type===`string`||typeof e.const==`string`||`anyOf`in e&&e.anyOf&&e.anyOf.every(e=>N_(e)&&typeof e.const==`string`))}function P_(e){return e.type===`number`}function F_(e){return e.type===`integer`}function I_(e){return e.type===`boolean`||typeof e.const==`boolean`}function L_(e){return e.type===`array`}function R_(e){return e.type===`null`}function z_(e,t){if(e.$bitiforms&&e.$bitiforms.widget){let n=e.$bitiforms.widget;if(!Object.prototype.hasOwnProperty.call(t,n))throw Error(`Unknown widget ${n}`);return t[n]}if(R_(e))return x.Fragment;if(L_(e))return N_(e.items)?t.CheckboxGroupWidget:t.ArrayWidget;if(j_(e))return t.ObjectWidget;if(I_(e))return t.CheckboxWidget;if(N_(e)){if(e.enum||e.oneOf||e.anyOf)return t.RadioGroupWidget;if(e.format&&e.format.startsWith(`date`))return t.DateWidget}return P_(e)||F_(e)?t.NumberWidget:t.TextInputWidget}function B_(e,t){let n=z_(e,t);if(n==null)throw Error(`Resolved widget is undefined for schema ${JSON.stringify(e)}`);return n}var V_={widgets:{},formats:y_,texts:{"wizard.next":`Continue`,"wizard.prev":`Go back`,"wizard.fixErrorsBeforeContinue":`Fix the errors above before continuing`,"errors.required":`Must be filled in`,"errors.radiogroup.required":`Select an element`,"errors.checkbox.required":`Must be checked`,"errors.minItems":`You must select at least {count}`,"errors.maxLength":`The maximum length is {maxLength}`,"errors.minLength":`The minimum length is {minLength}`,"errors.minimum":`Minimum value is {minimum}`,"errors.invalidFormat.email":`Not a valid email address`,"arrayfield.remove":`Remove item`,"arrayfield.add":`Add item`},resolveWidget:B_},H_=(0,x.createContext)(V_);H_.displayName=`FormConfigContext`;function U_(){return(0,x.useContext)(H_)}function W_({widgets:e=V_.widgets,texts:t=V_.texts,formats:n=V_.formats,resolveWidget:r=V_.resolveWidget,children:i}){let a=(0,x.useMemo)(()=>({widgets:{...V_.widgets,...e},texts:{...V_.texts,...t},formats:{...V_.formats,...n},resolveWidget:r}),[e,t,n,r]);return(0,L.jsx)(H_.Provider,{value:a,children:i})}var G_=(0,x.createContext)({});G_.displayName=`FormValuesContext`;var K_=(0,x.createContext)(!1);K_.displayName=`RevealErrorsContext`;function q_(){let e=(0,x.useContext)(K_),[t,n]=(0,x.useState)(!1),r=(0,x.useCallback)(()=>n(!0),[]);return(0,x.useEffect)(()=>{n(e)},[e]),{value:t,enable:r}}var J_=(0,x.createContext)(null);J_.displayName=`UpdateValuesContext`;function Y_(e){let t=(0,x.useContext)(J_);if(t==null)throw Error(`Not wrapped in UpdateValuesContext.Provider`);return(0,x.useCallback)(n=>t(e,n),[e,t])}var X_=(0,x.createContext)(null);X_.displayName=`FormRendererContext`;function Z_(e){return e==null?!1:Array.isArray(e)?e.length===0?!1:e.some(e=>Z_(e)):Q_(e)?!0:typeof e==`object`?Object.keys(e).some(t=>Z_(e[t])):typeof e==`string`}function Q_(e){return!!(e&&typeof e==`object`&&!Array.isArray(e)&&typeof e.message==`string`&&e.args)}function $_(e,t){return e.map(e=>Q_(e)?ev(t?.[e.message]??e.message,e.args):t?.[e]||e).join(`, `)}function ev(e,t){let n=Object.keys(t).join(`|`);return(e||``).replace(RegExp(`{(${n})}`,`g`),(e,n)=>t[n]??e)}var tv=y_;function nv({formats:e=tv}={}){function t(t,n,r){if(typeof t.const<`u`&&t.const!==n)return[rv(`errors.const`,t,{value:t.const})];let i=[];if(av(n))return r?(i.push(iv(`errors.required`,t)),i):[];let a=n.length;if(t.minLength&&a<t.minLength&&i.push(rv(`errors.minLength`,t,{minLength:t.minLength})),t.maxLength&&a>t.maxLength&&i.push(rv(`errors.maxLength`,t,{maxLength:t.maxLength})),t.enum&&!t.enum.includes(n)&&i.push(rv(`errors.oneOf`,t,{values:t.enum})),t.oneOf&&!t.oneOf.some(e=>!Z_(u(e,n,!0)))&&i.push(rv(`errors.oneOf`,t,{})),t.format){let r=t.format;k_(Object.prototype.hasOwnProperty.call(e,r),`${r} format validator is not implemented.`);let a=e[r];a!=null&&!a(n)&&i.push(iv(`errors.invalidFormat.${t.format}`,t))}return i}function n(e,t,n){if(typeof e.const<`u`&&e.const!==t)return[rv(`errors.const`,e,{value:e.const})];let r=[];return av(t)?n?(r.push(iv(`errors.required`,e)),r):[]:(e.enum&&!e.enum.includes(t)&&r.push(rv(`errors.oneOf`,e,{values:e.enum})),r)}function r(e,t,n){if(typeof e.const<`u`&&e.const!==t)return[rv(`errors.const`,e,{value:e.const})];let r=[];if(av(t)||isNaN(Number(t)))return n?(r.push(iv(`errors.required`,e)),r):[];let i=parseFloat(`${t}`);return e.minimum&&i<e.minimum&&r.push(rv(`errors.minimum`,e,{minimum:e.minimum})),e.maximum&&i>e.maximum&&r.push(rv(`errors.maximum`,e,{maximum:e.maximum})),r}function i(e,t,n){if(typeof e.const<`u`&&e.const!==t)return[rv(`errors.const`,e,{value:e.const})];let r=[];if(av(t)||isNaN(Number(t)))return n?(r.push(iv(`errors.required`,e)),r):[];let i=parseFloat(`${t}`);return Number.isInteger(i)||r.push(iv(`errors.notAnInteger`,e)),e.minimum&&i<e.minimum&&r.push(rv(`errors.minimum`,e,{minimum:e.minimum})),e.maximum&&i>e.maximum&&r.push(rv(`errors.maximum`,e,{maximum:e.maximum})),r}function a(e,t){let n={all:[],items:[]};if(e.minItems&&e.minItems>0&&(t||[]).length<e.minItems&&n.all.push(rv(`errors.minItems`,e,{count:e.minItems})),e.maxItems&&(t||[]).length>e.maxItems&&n.all.push(rv(`errors.maxItems`,e,{count:e.maxItems})),e.contains){let r=e.contains;(!Array.isArray(t)||t.every(e=>Z_(u(r,e,!1))))&&n.all.push(iv(`errors.notContains`,e))}return t&&t.length>0&&(n.items=t.map(t=>{let n=lv(e.items,t),r=u(n,t,!1);return j_(n)?{_id:t._id,...r}:r})),n}function o(e,t){let n=e.properties||{},r=Object.keys(n).reduce((r,i)=>(r[i]=u(n[i],(t||{})[i],(e.required||[]).includes(i)),r),{_all:[]});if(e.anyOf){let n=!1;for(let r of e.anyOf)if(!Z_(o(r,t))){n=!0;break}n||(r._all=[iv(`errors.anyOf`,e)])}return r}function s(e,t){return t==null?[]:[iv(`errors.shouldBeNull`,e)]}let c=new WeakMap,l=new WeakMap;function u(e,u,d){let f=t=>{let n=c.get(e);if(n!==void 0&&n===u)return l.get(e);let r=t();return c.set(e,u),l.set(e,r),r};if(j_(e))return o(e,u);if(N_(e))return f(()=>t(e,u,d));if(I_(e))return f(()=>n(e,u,d));if(P_(e))return f(()=>r(e,u,d));if(F_(e))return f(()=>i(e,u,d));if(L_(e))return a(e,u);if(R_(e))return s(e,u);throw Error(`validateSchema() got invalid schema ${JSON.stringify(e)}`)}function d(e,t){return u(e,t,!0)}return{validateSchema:d}}function rv(e,t,n){return{message:iv(e,t),args:n}}function iv(e,t){return t.$bitiforms?.errorMessages?.[e]||e}function av(e){return typeof e==`string`?e.trim()===``:e==null}var ov;function sv(){return ov??=nv().validateSchema,ov}function cv(e,t){if(!j_(e))throw Error(`Tried to evaluate an if that is not a ObjectSchema`);return!Z_(sv()(e,t))}function lv(e,t){let n=e.$bitiforms||{};if(j_(e)){let r={...e.properties||{}},i=[...e.required||[]];for(let e of Object.keys(r))r[e]=lv(r[e],(t||{})[e]);if(e.if){e.then!=null&&M_(e.then,`schemas using \`if\` should also have \`then\` of type object: ${JSON.stringify(e)}`);let n=cv(e.if,t)?e.then:e.else;k_(typeof n?.$bitiforms>`u`,`$bitiforms must not be set on branched schemas.
|
|
13
|
-
Got schema ${JSON.stringify(n,null,2)}`);let a=n==null?null:lv(n,t);a&&(M_(a,`then and else schemas must be object schemas: ${JSON.stringify(a,null,2)}`),a.required&&i.push(...a.required),Object.assign(r,a.properties))}if(e.allOf)for(let n of e.allOf){let e=lv(n,t);j_(e)&&(e.required&&i.push(...e.required),Object.assign(r,e.properties))}let a={type:`object`,properties:r,$bitiforms:n,required:[...new Set(i)]};return e.title&&(a.title=e.title),e.description&&(a.description=e.description),a}return e}function uv(e,t={}){let n=[];for(let r of e){let e=lv(r,t);dv(e)&&n.push(e)}return n}function dv(e){return!!(j_(e)&&e.properties&&Object.keys(e.properties).length>0)}function fv(e,t){if(Array.isArray(e))return uv(e,t);let n=Object.keys(e.properties||{}).length>0;if(Array.isArray(e.allOf)){let{allOf:r,...i}=e;return uv(n?[i].concat(r):r,t)}if(n)return uv([e],t);throw Error(`resolveBaseSchema() either takes an array of ObjectSchemas or an ObjectSchema with an .allOf property.`)}function pv(e){let t={type:`object`,properties:{}},n=[];for(let r of e)Object.assign(t.properties,r.properties),r.required&&n.push(...r.required);return n.length>0&&(t.required=[...new Set(n)]),t}function mv(e,t){if(j_(e)){let n=e.properties||{},r=t||hv(e);return{...r,...Object.keys(n).reduce((e,t)=>(e[t]=mv(n[t],r[t]),e),{})}}return L_(e)?j_(e.items)?(t||hv(e)).map(t=>{let n=t||hv(e.items);return{...n,_id:n._id==null?w_():n._id,...mv(lv(e.items,n),n)}}):(t||hv(e)).map(t=>mv(e.items,t)):Object.prototype.hasOwnProperty.call(e,`const`)?e.const:t??hv(e)}function hv(e){if(Object.prototype.hasOwnProperty.call(e,`default`))return e.default;if(j_(e))return{};if(N_(e))return``;if(I_(e)||P_(e)||F_(e)||R_(e))return null;if(L_(e))return[];throw Error(`getDefaultValue invalid schema ${JSON.stringify(e)}`)}function gv(e,t){if(j_(e)){let n=e.properties||{};return typeof t!=`object`||!t?{}:Object.keys(n).reduce((e,r)=>(e[r]=gv(n[r],t[r]),e),{})}return L_(e)?Array.isArray(t)?t.map(t=>gv(lv(e.items,t),t)):[]:N_(e)&&e.format&&b_[e.format]?b_[e.format](String(t)):t}var _v=(e,t,n)=>(e||[]).find(e=>e._id===t)||n;function vv({id:e,name:t,path:n,value:r,schema:i,errors:a,disabled:o,texts:s,renderAddButton:c,renderItem:l,renderContainer:u}){let[d]=(0,x.useState)(()=>T_(E_(r)?._id)),f=Y_(n),p=(0,x.useCallback)(()=>{f(e=>e.concat({_id:d(),...mv(lv(i.items,{}),{})}))},[d,i.items,f]),m=(0,x.useCallback)(e=>{f(t=>t.filter(t=>t._id!==e))},[f]),h=(0,x.useCallback)((e,t)=>{f(n=>n.map(n=>{if(n._id===e){let e={...n,[t.target.name]:t.target.value};return mv(lv(i.items,e),e)}return n}))},[f,i.items]),g=q_();M_(i.items);let _=!!(g.value&&a&&a.all.length>0),v=r.length;return(0,L.jsx)(L.Fragment,{children:u({schema:i,name:t,id:e,children:(0,L.jsxs)(L.Fragment,{children:[r.map((r,o)=>(0,L.jsx)(yv,{id:r._id,path:`${n}/${o}`,parentId:e,parentName:t,item:r,onFieldChange:h,render:l,index:o,onRemove:m,schema:i.items,errors:a,texts:s},r._id)),c({disabled:o,onClick:p,itemCount:v,texts:s})]}),errors:_?$_(a.all,s):null,itemCount:v,texts:s})})}var yv=(0,x.memo)(function({parentId:e,parentName:t,path:n,render:r,id:i,index:a,texts:o,onRemove:s,item:c,schema:l,onFieldChange:u,errors:d}){let f=lv(l,c).properties||{},p=D_(Object.keys(f),l.$bitiforms?.propertyOrder),m=_v(d.items,i,{}),h=p.reduce((r,a)=>(r[a]={path:`${n}/${a}`,schema:f[a],id:`${e}__${a}__${i}`,name:`${t}__${a}__${i}`,onChange:e=>u(i,{target:{name:a,value:e.target.value}}),value:c[a],errors:m[a],texts:o},r),{});return(0,L.jsx)(L.Fragment,{children:r?.({fields:h,index:a,id:i,path:n,onRemove:()=>{s(i)},texts:o})})}),bv=(0,x.memo)(function(e){let{texts:t,resolveWidget:n,widgets:r}=U_();O_(typeof e.name==`string`&&e.name.trim()!==``);let i=n(e.schema,r);return(0,L.jsx)(x.Suspense,{fallback:(0,L.jsx)(`div`,{}),children:(0,L.jsx)(i,{...e,texts:t})})}),xv=class e{static from(t){if(t===``)return new e([]);t.startsWith(`/`)||(t=`/${t}`);let[,...n]=t.split(`/`);return new e(n.map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)))}constructor(e){this.tokens=e}toString(){return this.tokens.length===0?``:`/${this.tokens.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}toPath(){return this.tokens}};function Sv(e,t,n){let r=(typeof t==`string`?xv.from(t):t).toPath(),i=(e,t,n,r)=>{let a,o=t[r];return t.length>r?(Array.isArray(e)?(o=parseInt(o,10),a=e.slice()):a={...e},a[o]=i(e[o]===void 0?{}:e[o],t,n,r+1),a):typeof n==`function`?n(e):n};return i(e,r,n,0)}var Cv=class extends Error{constructor(e){super(`SubmissionError`),this.errors=e}},wv=1,Tv=2,Ev=4,Dv=5,Ov=6,kv=7,Av=8,jv={};function Mv(e){let t=(0,x.useId)();return e||t}function Nv({name:e,initialValues:t=jv,schema:n,disabled:r,onSubmit:i,onFormValuesChanged:a}){let o=Iv(),s=Mv(e);function c(e,t){function r(e){let t=Lv(n,e.values,!1,o()),r=!0;(0,Pa.default)(t.steps,e.steps)&&(r=!1,t.steps=e.steps);let i=!0;(0,Pa.default)(t.values,e.values)&&(i=!1,t.values=e.values);let a=!0;return(0,Pa.default)(t.errors,e.errors)&&(a=!1,t.errors=e.errors),!r&&!i&&!a?e:{...e,...t}}switch(t.type){case wv:return{...e,submissionState:`not-submitted`,submissionErrors:{},revealAllErrors:!1};case Tv:return r(e);case Ev:return{...e,submissionState:`submitting`};case Dv:return{...e,submissionState:`submitted`};case Ov:{let n=t.error;return{...e,submissionState:`failed`,submissionErrors:n instanceof Cv?n.errors:{},revealAllErrors:!0}}case kv:return{...e,revealAllErrors:t.value};case Av:return r({...e,values:Sv(e.values,t.path,t.updater)});default:return e}}let l=(0,x.useRef)(!0);(0,x.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]);let[u,d]=(0,x.useReducer)(c,void 0,()=>{let{steps:e,errors:r,values:i}=Lv(n,t,!1,o());return{values:i,steps:e,touched:{},errors:r,submissionState:`not-submitted`,submissionErrors:{},revealAllErrors:!1}});(0,x.useEffect)(()=>{a?.(u.values)},[u.values,a]),(0,x.useEffect)(()=>{d({type:Tv})},[n]);let f=(0,x.useCallback)(e=>{d({type:kv,value:e})},[]),p=(0,x.useCallback)((e,t)=>{d({type:Av,path:e,updater:t})},[]),m=(0,x.useCallback)(e=>{if(r)return;let{name:t,value:n}=e.target;p(``,e=>({...e,[t]:n}))},[r,p]),h=async e=>{if(!l.current||r)return;e.preventDefault?.(),d({type:Ev});let{errors:t,values:a}=Lv(n,u.values,!0,o()),s=!Z_(t);try{if(await i?.({values:a,errors:t,isValid:s})===!1)throw new Cv({});d({type:Dv})}catch(e){d({type:Ov,error:e})}},g=()=>u.steps.map(e=>{let{properties:t={},$bitiforms:n={}}=e,i=D_(Object.keys(t),n.propertyOrder).reduce((e,n)=>(e[n]={path:n,schema:t[n],value:u.values[n],id:`form-${s}-${n}`,name:n,errors:u.errors[n],onChange:m,disabled:r},e),{});return{isValid:()=>!Object.keys(i).some(e=>Z_(i[e].errors)),fields:i}}),_=(0,x.useCallback)(()=>{l.current&&d({type:wv})},[]),v=g(),y={name:s,errors:u.errors,steps:v,values:u.values,onSubmit:h,submissionState:u.submissionState,clearSubmission:_,submissionErrors:u.submissionErrors,revealAllErrors:f,schema:n};return[y,{revealAllErrors:u.revealAllErrors,values:y.values,updateValues:p}]}function Pv({revealAllErrors:e,values:t,updateValues:n,children:r}){return(0,L.jsx)(J_.Provider,{value:n,children:(0,L.jsx)(K_.Provider,{value:e,children:(0,L.jsx)(G_.Provider,{value:t,children:r})})})}function Fv({render:e,component:t,element:n,...r}){let[i,a]=Nv(r);if(typeof e==`function`&&t)throw Error(`one of render or component must be provided, but not both`);if(typeof e==`function`)return(0,L.jsx)(Pv,{...a,children:e(i)});if(n)return(0,L.jsx)(Pv,{...a,children:(0,L.jsx)(X_.Provider,{value:i,children:n})});if(t)return(0,L.jsx)(Pv,{...a,children:(0,L.jsx)(t,{...i})});throw Error(`one of render or component must be provided`)}function Iv(){let{formats:e}=U_(),t=(0,x.useRef)(null);function n(){return t.current??=nv({formats:e}),t.current}return n}function Lv(e,t,n,r){let i=fv(e,t),a=pv(i),o=mv(a,t);n&&(o=gv(a,o));let s=r.validateSchema(a,o);return{steps:i,values:o,errors:s}}function Rv({id:e,name:t,path:n,value:r,schema:i,errors:a,disabled:o,texts:s}){let c=Y_(n),l=(0,x.useCallback)((e,t)=>{c(n=>({...n,[e]:t}))},[c]),u=i.$bitiforms||{},d=i.properties||{};return(0,L.jsxs)(`div`,{"data-bitiforms-object":!0,role:`group`,"data-field-path":n,children:[i.title&&(0,L.jsx)(`legend`,{"data-bitiforms-object-title":!0,children:i.title}),i.description&&(0,L.jsx)(`div`,{"data-bitiforms-object-description":!0,children:i.description}),(0,L.jsx)(`div`,{"data-bitiforms-object-fields":!0,children:D_(Object.keys(d),u.propertyOrder).map(i=>{let c=`${t}_${i}`;return(0,L.jsx)(zv,{path:`${n}/${i}`,field:i,schema:d[i],value:r[i],id:`${e}_${i}`,errors:a[i],name:c,onChange:l,disabled:o,texts:s},c)})})]})}var zv=(0,x.memo)(function({field:e,onChange:t,...n}){return(0,L.jsx)(bv,{...n,onChange:n=>t(e,n.target.value)})});function Bv(e){if(!e.enum)return[];let t=[];for(let n=0;n<e.enum.length;n++)t.push([e.enum[n],e.$enumNames?.[n]||e.enum[n]]);return t}function Vv(e){return(0,x.useMemo)(()=>{if(N_(e)){let t=e=>e,n=e=>e,r=[];return e.enum?r=Bv(e):e.oneOf?r=e.oneOf.map(e=>{let t=e.const?e.const:e.enum?e.enum[0]:``;return[t,e.title||t]}):e.anyOf&&(r=e.anyOf.map(e=>{let t=e.const?e.const:e.enum?e.enum[0]:``;return[t,e.title||t]})),{values:r,fromSchemaValue:n,toSchemaValue:t}}if(I_(e))return{values:[[`yes`,`Yes`],[`no`,`No`]],fromSchemaValue:e=>e===!0?`yes`:e===!1?`no`:null,toSchemaValue:e=>{switch(e){case`yes`:return!0;case`no`:return!1;default:return null}}};if(P_(e)||F_(e)){let t=e=>parseInt(e??``,10),n=[];for(let t=e.minimum??0;t<=(e.maximum??20);t++)n.push([`${t}`,`${t}`]);return{values:n,fromSchemaValue:e=>`${e??``}`,toSchemaValue:t}}throw Error(`Invalid schema given to SelectWidget`)},[e])}var Hv=e=>e;function Uv(e,t=Hv){let n=e.name,r=q_();return{onBlur:()=>{r.enable()},onChange:r=>{let i=t(r.target.value);e.onChange({target:{name:n,value:i}})},error:r.value?$_(e.errors,e.texts):void 0,schema:e.schema,$bitiforms:e.schema.$bitiforms||{},id:e.id,name:e.name,value:e.value,disabled:e.disabled}}var Wv=({fields:e,onRemove:t,texts:n,path:r})=>(0,L.jsxs)(`div`,{"data-bitiforms-array-item":!0,"data-field-path":r,children:[Object.keys(e).map(t=>(0,L.jsx)(bv,{...e[t]},t)),(0,L.jsx)(Eo,{className:`dmk-margin-top-m`,variant:`outlined`,intent:`danger`,type:`button`,onClick:t,"data-bitiforms-array-remove-button":!0,children:(n||{})[`arrayfield.remove`]??`Remove`})]}),Gv=({disabled:e,onClick:t,texts:n})=>(0,L.jsx)(Io,{as:`footer`,horizontal:!0,alignItems:`center`,className:`dmk-margin-top-l`,"data-bitiforms-array-add-button":!0,children:!e&&(0,L.jsx)(Eo,{variant:`outlined`,onClick:t,children:(n||{})[`arrayfield.add`]??`Add`})}),Kv=({schema:e,id:t,name:n,children:r,errors:i,itemCount:a})=>(0,L.jsxs)(`div`,{"data-bitiforms-array-field":n,children:[e.title&&(0,L.jsxs)(`h3`,{id:`${t}_title`,className:`dmk-text-title2 dmk-margin-bottom-s`,children:[e.title,` `,(0,L.jsxs)(`span`,{"data-bitiforms-array-item-count":!0,children:[`(`,a,`)`]})]}),e.description&&(0,L.jsx)(`div`,{id:`${t}_description`,children:e.description}),i&&(0,L.jsx)(`div`,{children:i}),r]});function qv(e){return(0,L.jsx)(vv,{...e,renderItem:Wv,renderAddButton:Gv,renderContainer:Kv})}function Jv(e){return(0,L.jsx)(`div`,{"data-bitiforms-description":!0,...e})}function Yv({onChange:e,id:t,name:n,value:r,errors:i,schema:a,texts:o,disabled:s,path:c}){let l=q_();O_(Zv(a),`CheckboxGroupWidget must be given a schema of type 'object' or 'array'. ${JSON.stringify(a)} given.`);let u=t=>i=>L_(a)&&Array.isArray(r)?e({target:{name:n,value:Qv(r,t,i.currentTarget.checked)}}):e({target:{name:n,value:{...r,[t]:i.currentTarget.checked}}}),d=()=>{l.enable()},f=l.value,p=Xv(i,a);return(0,L.jsxs)(Ph,{"aria-labelledby":`${t}-legend`,"data-bitiforms-checkboxgroup":!0,"data-field-path":c,children:[a.title&&(0,L.jsx)(Lh,{id:`${t}-legend`,children:a.title}),a.description&&(0,L.jsx)(Jv,{id:`${t}_description`,children:a.description}),(0,L.jsx)(Io,{spacing:`s`,children:$v(a).map(([e,n])=>{let a=Array.isArray(r)?r.includes(e):r[e]===!0,o=Array.isArray(r)?!a&&p.length>0?`invalid`:void 0:Z_(i[e])?`invalid`:void 0;return(0,L.jsx)(Ro,{id:`${t}_${e}`,checked:a,value:e,error:f?!!o:void 0,onChange:u(e),onBlur:d,disabled:s,children:n},e)})}),f&&p.length>0&&(0,L.jsx)(Rh,{role:`alert`,children:$_(p,o)})]})}function Xv(e,t){return Z_(e)?L_(t)?e.all:[`errors.checkboxGroup.invalid`]:[]}function Zv(e){return!!(L_(e)&&N_(e.items)&&e.items.enum||j_(e)&&Object.values(e.properties||{}).every(I_))}function Qv(e,t,n){let r=new Set(e);return n?[...r.add(t)]:(r.delete(t),[...r])}function $v(e){if(L_(e)&&N_(e.items)&&e.items.enum){let t=[];for(let n=0;n<e.items.enum.length;n++)t.push([e.items.enum[n],e.items.$enumNames?.[n]||e.items.enum[n]]);return t}return j_(e)?D_(Object.keys(e.properties||{}),(e.$bitiforms||{}).propertyOrder).map(t=>[t,e.properties[t].title]):[]}function ey({name:e,value:t,onChange:n,schema:r,errors:i,texts:a,path:o}){let s=q_(),c=t=>{let{checked:r}=t.currentTarget;return n({target:{name:e,value:r}})},l=s.value&&Z_(i);return(0,L.jsxs)(`div`,{"data-field-path":o,children:[(0,L.jsx)(Ro,{checked:t||!1,onChange:c,onBlur:s.enable,error:l,children:r.title}),l&&(0,L.jsx)(Rh,{role:`alert`,children:a?.[`errors.checkbox.required`]})]})}function ty(e){let{onBlur:t,onChange:n,error:r,schema:i,id:a,name:o,value:s,disabled:c,$bitiforms:l}=Uv(e);return(0,L.jsx)(zh,{"data-field-path":e.path,name:o,type:`date`,id:a,label:i.title,hint:i.description,error:r,value:s??``,onChange:n,onBlur:t,disabled:c,...l.widgetProps})}function ny({schema:e,path:t}){return!e.title&&!e.description&&!e.const?null:(0,L.jsxs)(`div`,{"data-bitiforms-helptext":!0,"data-field-path":t,children:[e.title&&(0,L.jsx)(`h4`,{children:e.title}),e.description||e.const||``]})}var ry=({})=>null;function iy({suffix:e=``,...t}){let{$bitiforms:n,onBlur:r,onChange:i,error:a,schema:o,id:s,name:c,value:l,disabled:u}=Uv(t,ay);return(0,L.jsx)(eg,{"data-field-path":t.path,id:s,name:c,placeholder:n.placeholder,error:a,label:o.title,autoFocus:n.autoFocus,...n.widgetProps,hint:o.description,value:l==null||l===``?``:l,onBlur:r,onChange:e=>{i({target:{name:e.target.name,value:e.target.value}})},min:o.minimum,max:o.maximum,disabled:u,endAdornment:e})}var ay=e=>{if(e.trim()===``)return null;let t=parseFloat(e.replace(/[^0-9,.]/g,``));return isNaN(t)?null:t};function oy(e){return(0,L.jsx)(Rv,{...e})}var sy={email:`email`};function cy(e){return e.type===`string`&&e.format&&sy[e.format]||`text`}function ly({type:e,endAdornment:t,...n}){let{$bitiforms:r,onBlur:i,onChange:a,error:o,schema:s,id:c,name:l,value:u,disabled:d}=Uv(n),f=cy(s);return(0,L.jsx)(zh,{"data-field-path":n.path,type:e||f,id:c,name:l,placeholder:r.placeholder,error:o,label:s.title,autoFocus:r.autoFocus,hint:s.description,value:u??``,onBlur:i,onChange:a,disabled:d,endAdornment:t,...r.widgetProps,autoComplete:typeof r.autoComplete==`string`?r.autoComplete:r.autoComplete===!1?`off`:`on`})}function uy(e){let t=cg(!1);return(0,L.jsx)(ly,{...e,type:t.value?`text`:`password`,endAdornment:(0,L.jsx)(Eo,{tabIndex:-1,variant:`text`,style:{fontSize:32,lineHeight:1,padding:0},onClick:t.toggle,children:t.value?(0,L.jsx)(xa,{}):(0,L.jsx)(Sa,{})})})}var dy=({value:e,label:t,disabled:n})=>(0,L.jsx)(ig,{value:e,disabled:n,children:t});function fy({className:e,renderOption:t=dy,texts:n,...r}){let{values:i,fromSchemaValue:a,toSchemaValue:o}=Vv(r.schema),{onBlur:s,onChange:c,schema:l,id:u,error:d,name:f,value:p,disabled:m}=Uv(r,o);return(0,L.jsxs)(`div`,{"aria-labelledby":`${u}-legend`,"data-field-path":r.path,children:[(0,L.jsx)(Lh,{error:!!d,id:`${u}-legend`,children:l.title}),l.description&&(0,L.jsx)(Jv,{id:`${u}_description`,children:l.description}),(0,L.jsx)(ng,{name:f,id:u,className:e,error:!!d,value:a(p)??``,onChange:c,onBlur:s,disabled:m,children:i.map(([e,n],r)=>(0,L.jsx)(x.Fragment,{children:t({value:e,label:n,disabled:m||!1,index:r})},e))}),d&&(0,L.jsx)(Rh,{children:n?.[`errors.radiogroup.required`]})]})}function py(e){let{values:t,fromSchemaValue:n,toSchemaValue:r}=Vv(e.schema),{id:i,name:a,$bitiforms:o,error:s,schema:c,onChange:l,onBlur:u,value:d,disabled:f}=Uv(e,r);return(0,L.jsx)(bg,{"data-field-path":e.path,id:i,name:a,label:c.title,autoFocus:o.autoFocus,error:s,hint:c.description,value:n(d),onChange:l,onBlur:u,disabled:f,children:t.map(([e,t])=>(0,L.jsx)(`option`,{value:e,children:t},e))})}function my({errors:e,onClose:t,title:n=`Failed to submit`}){let{texts:r}=U_();return(0,L.jsx)(Ja,{intent:`error`,title:n,onClose:t,children:(0,L.jsx)(`ul`,{children:Object.values(e).map((e,t)=>(0,L.jsx)(`li`,{children:$_([e],r)},t))})})}var hy={ArrayWidget:qv,ObjectWidget:oy,CheckboxWidget:ey,CheckboxGroupWidget:Yv,DateWidget:ty,HelpTextWidget:ny,HiddenWidget:ry,NumberWidget:iy,PasswordWidget:uy,RadioGroupWidget:fy,SelectWidget:py,TextInputWidget:ly},gy=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_y=new class extends gy{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},vy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yy=new class{#e=vy;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function by(e){setTimeout(e,0)}var xy=typeof window>`u`||`Deno`in globalThis;function Sy(){}function Cy(e,t){return typeof e==`function`?e(t):e}function wy(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ty(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ey(e,t){return typeof e==`function`?e(t):e}function Dy(e,t){return typeof e==`function`?e(t):e}function Oy(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ay(o,t.options))return!1}else if(!My(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ky(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jy(t.options.mutationKey)!==jy(a))return!1}else if(!My(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ay(e,t){return(t?.queryKeyHashFn||jy)(e)}function jy(e){return JSON.stringify(e,(e,t)=>Ly(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function My(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>My(e[n],t[n])):!1}var Ny=Object.prototype.hasOwnProperty;function Py(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Iy(e)&&Iy(t);if(!r&&!(Ly(e)&&Ly(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ny.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Py(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fy(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Iy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ly(e){if(!Ry(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ry(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ry(e){return Object.prototype.toString.call(e)===`[object Object]`}function zy(e){return new Promise(t=>{yy.setTimeout(t,e)})}function By(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Py(e,t)}function Vy(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hy(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uy=Symbol();function Wy(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Uy?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gy(e,t){return typeof e==`function`?e(...t):!!e}function Ky(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var qy=(()=>{let e=()=>xy;return{isServer(){return e()},setIsServer(t){e=t}}})();function Jy(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Yy=by;function Xy(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Yy,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Zy=Xy(),Qy=new class extends gy{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function $y(e){return Math.min(1e3*2**e,3e4)}function eb(e){return(e??`online`)===`online`?Qy.isOnline():!0}var tb=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function nb(e){let t=!1,n=0,r,i=Jy(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new tb(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>_y.isFocused()&&(e.networkMode===`always`||Qy.isOnline())&&e.canRun(),u=()=>eb(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(qy.isServer()?0:3),o=e.retryDelay??$y,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),zy(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var rb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wy(this.gcTime)&&(this.#e=yy.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qy.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(yy.clearTimeout(this.#e),void 0)}},ib=class extends rb{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=sb(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=sb(this.options);e.data!==void 0&&(this.setState(ob(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=By(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Sy).catch(Sy):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dy(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ey(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ty(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Wy(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=nb({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof tb&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof tb){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ab(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ob(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Zy.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function ab(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eb(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ob(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function sb(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var cb=class extends gy{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Jy(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ub(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return db(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return db(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Dy(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Fy(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&fb(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Dy(this.options.enabled,this.#t)!==Dy(t.enabled,this.#t)||Ey(this.options.staleTime,this.#t)!==Ey(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Dy(this.options.enabled,this.#t)!==Dy(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return mb(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Sy)),t}#g(){this.#b();let e=Ey(this.options.staleTime,this.#t);if(qy.isServer()||this.#r.isStale||!wy(e))return;let t=Ty(this.#r.dataUpdatedAt,e)+1;this.#d=yy.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(qy.isServer()||Dy(this.options.enabled,this.#t)===!1||!wy(this.#p)||this.#p===0)&&(this.#f=yy.setInterval(()=>{(this.options.refetchIntervalInBackground||_y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(yy.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(yy.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ub(e,t),o=i&&fb(e,n,t,r);(a||o)&&(l={...l,...ab(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=By(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=By(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:pb(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Dy(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=Jy())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Fy(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Zy.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function lb(e,t){return Dy(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function ub(e,t){return lb(e,t)||e.state.data!==void 0&&db(e,t,t.refetchOnMount)}function db(e,t,n){if(Dy(t.enabled,e)!==!1&&Ey(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&pb(e,t)}return!1}function fb(e,t,n,r){return(e!==t||Dy(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&pb(e,n)}function pb(e,t){return Dy(t.enabled,e)!==!1&&e.isStaleByTime(Ey(t.staleTime,e))}function mb(e,t){return!Fy(e.getCurrentResult(),t)}function hb(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Ky(e,()=>t.signal,()=>n=!0)},u=Wy(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Hy:Vy;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?_b:gb,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:gb(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function gb(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _b(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vb=class extends rb{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||yb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=nb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Zy.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function yb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var bb=class extends gy{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new vb({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=xb(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Zy.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ky(t,e))}findAll(e={}){return this.getAll().filter(t=>ky(e,t))}notify(e){Zy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Zy.batch(()=>Promise.all(e.map(e=>e.continue().catch(Sy))))}};function xb(e){return e.options.scope?.id}var Sb=class extends gy{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Fy(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&jy(t.mutationKey)!==jy(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??yb();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Zy.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Cb=class extends gy{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Ay(r,t),a=this.get(i);return a||(a=new ib({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Zy.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Oy(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Oy(e,t)):t}notify(e){Zy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zy.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zy.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},wb=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Cb,this.#t=e.mutationCache||new bb,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Qy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ey(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Cy(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Zy.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Zy.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Zy.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Zy.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Sy).catch(Sy)}invalidateQueries(e,t={}){return Zy.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Zy.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Sy)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Sy)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ey(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sy).catch(Sy)}fetchInfiniteQuery(e){return e.behavior=hb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sy).catch(Sy)}ensureInfiniteQueryData(e){return e.behavior=hb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qy.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(jy(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{My(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(jy(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{My(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ay(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Uy&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Tb=x.createContext(void 0),Eb=e=>{let t=x.useContext(Tb);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Db=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Tb.Provider,{value:e,children:t})),Ob=x.createContext(!1),kb=()=>x.useContext(Ob);Ob.Provider;function Ab(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jb=x.createContext(Ab()),Mb=()=>x.useContext(jb),Nb=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Gy(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Pb=e=>{x.useEffect(()=>{e.clearReset()},[e])},Fb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gy(n,[e.error,r])),Ib=(e,t)=>t.state.data===void 0,Lb=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Rb=(e,t)=>e.isLoading&&e.isFetching&&!t,zb=(e,t)=>e?.suspense&&t.isPending,Bb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Vb(e,t,n){let r=kb(),i=Mb(),a=Eb(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Lb(o),Nb(o,i,s),Pb(i);let c=!a.getQueryCache().get(o.queryHash),[l]=x.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(e=>{let t=d?l.subscribe(Zy.batchCalls(e)):Sy;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setOptions(o)},[o,l]),zb(o,u))throw Bb(o,l,i);if(Fb({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!qy.isServer()&&Rb(u,r)&&(c?Bb(o,l,i):s?.promise)?.catch(Sy).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Hb(e,t){return Vb(e,cb,t)}function Ub(e,t){return Vb({...e,enabled:!0,suspense:!0,throwOnError:Ib,placeholderData:void 0},cb,t)}function Wb(e,t){let n=Eb(t),[r]=x.useState(()=>new Sb(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(Zy.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((e,t)=>{r.mutate(e,t).catch(Sy)},[r]);if(i.error&&Gy(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Gb=Object.defineProperty,Kb=Object.defineProperties,qb=Object.getOwnPropertyDescriptors,Jb=Object.getOwnPropertySymbols,Yb=Object.prototype.hasOwnProperty,Xb=Object.prototype.propertyIsEnumerable,Zb=(e,t,n)=>t in e?Gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qb=(e,t)=>{for(var n in t||={})Yb.call(t,n)&&Zb(e,n,t[n]);if(Jb)for(var n of Jb(t))Xb.call(t,n)&&Zb(e,n,t[n]);return e},$b=(e,t)=>Kb(e,qb(t)),ex=(e,t)=>{var n={};for(var r in e)Yb.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jb)for(var r of Jb(e))t.indexOf(r)<0&&Xb.call(e,r)&&(n[r]=e[r]);return n},tx=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),nx=e=>cx({max:5,isRetriable:e=>e instanceof ax?e.response.status===503:e instanceof ox,getDelay:e=>500*e,signal:e}),rx=()=>globalThis.crypto.randomUUID();function ix(e={}){var t=e,{fetch:n=fetch,getRootUrl:r=()=>``,timeout:i=0,retryOn:a=nx,headers:o={},requestIdHeaderName:s=`X-Request-ID`,getRequestId:c=rx,json:l=!0,transform:u=e=>e}=t,d=ex(t,[`fetch`,`getRootUrl`,`timeout`,`retryOn`,`headers`,`requestIdHeaderName`,`getRequestId`,`json`,`transform`]);let f=[];function p(e){return tx(this,arguments,function*(e,t={}){let p=t.json??l,m=t.transform??u,h=yield r(e),g=t.fetch??n,_=c(),v=n=>tx(null,null,function*(){let r=new Headers;r.set(s,n),p&&(r.set(`Accept`,`application/json`),t.method!==`GET`&&typeof t.body==`string`&&r.set(`Content-Type`,`application/json`));for(let[e,n]of Object.entries(Qb(Qb({},o),t.headers)))r.set(e,n);return new Request(`${h}${e}`,$b(Qb(Qb({credentials:`include`},d),t),{headers:r}))}),y=new AbortController,b=t.signal,x=()=>{y.abort(b?.reason)};return b!=null&&b.aborted?y.abort(b.reason):b?.addEventListener(`abort`,x,{once:!0}),fx(()=>tx(null,null,function*(){let e=t.timeout??i??0,n=yield v(_),r=yield tx(null,null,function*(){return ux(e=>tx(null,null,function*(){let t=new Request(n,{signal:e});for(let e of f)e.request&&(yield e.request(t));return g(t)}),e,{signal:n.signal})});r.jsonData=p?yield r.clone().json().then(e=>{let n=typeof m==`function`?m(e):m.response?m.response(e):e;return t.schema?px(t.schema,n):n},()=>{}):void 0;for(let e of f)e.response&&(yield e.response(r));if(r.status<200||r.status>=400)throw new ax(r);return r}),t.retryOn||(a===nx?nx(y.signal):a()))().finally(()=>{b?.removeEventListener(`abort`,x)})})}return p.intercept=e=>(f.push(e),()=>{let t=f.indexOf(e);t>=0&&f.splice(t,1)}),p}var ax=class extends Error{constructor(e){let t=`${e.status} ${e.statusText} at ${e.url}`;super(t),this.name=this.constructor.name,this.response=e}},ox=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},sx=class extends Error{constructor(e,t){super(`Validation error`),this.name=this.constructor.name,this.issues=e.issues,this.data=t}};function cx({max:e,isRetriable:t,getDelay:n,signal:r}){let i=0;return function(a){return tx(this,null,function*(){return i++,t(a)&&i<e?(yield dx(n(i),{signal:r}),!0):!1})}}function lx(e){return e instanceof Error?e:Error(`Aborted`)}function ux(e,t){return tx(this,arguments,function*(e,t,n={}){let r=n.signal;if(r!=null&&r.aborted)throw r.reason;if(t<=0||!Number.isFinite(t))return e(r??new AbortController().signal);let i=new AbortController,{signal:a}=i,o=()=>{i.abort(r.reason)};r&&r.addEventListener(`abort`,o,{once:!0});let s=setTimeout(()=>{i.abort(new ox(`Timed out after ${t} ms`))},t);try{return yield e(a)}finally{clearTimeout(s),r?.removeEventListener(`abort`,o)}})}function dx(e,t={}){let{signal:n}=t;return new Promise((t,r)=>{if(n!=null&&n.aborted){r(lx(n.reason));return}let i=setTimeout(()=>{n?.removeEventListener(`abort`,a),t()},e),a=()=>{clearTimeout(i),n?.removeEventListener(`abort`,a),r(lx(n?.reason))};n?.addEventListener(`abort`,a,{once:!0})})}function fx(e,t=()=>!0){let n=(...r)=>tx(null,null,function*(){try{return yield e(...r)}catch(e){if(yield t(e))return n(...r);throw e}});return n}function px(e,t){return tx(this,null,function*(){let n=e[`~standard`].validate(t);if(n instanceof Promise&&(n=yield n),n.issues)throw new sx(n,t);return n.value})}var mx=[`number`,`string`,`datetime`,`date`,`format-string`,`yes-no`,`boolean`,`json`,`duration`],hx=ix({getRootUrl:()=>`/${document.querySelector(`meta[name="x-basename"]`)?.getAttribute(`content`)}/api`,headers:{"X-CSRF-Token":document.querySelector(`meta[name="csrf-token"]`)?.getAttribute(`content`)??``}});async function gx(){return hx(`/tables`)}async function _x(e,t,n,r,i){let a=new URLSearchParams;for(let e of t)a.append(`order`,e);return a.append(`limit`,n.toString()),a.append(`page`,r.toString()),i&&a.append(`search`,i),hx(`/tables/${e}?${a.toString()}`)}async function vx(e,t){return hx(`/tables/${e}/${t}`)}async function yx(e,t){return hx(`/tables/${e}/${t}`,{method:`DELETE`})}async function bx(e,t){return hx(`/tables/${e}`,{method:`POST`,body:JSON.stringify(t)})}async function xx(e,t,n){return hx(`/tables/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)})}async function Sx(e,t){return hx(`/tables/${e}/suggestions/${t}`)}function Cx(){let e=(0,ea.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`database`],queryFn:wx},e[0]=t):t=e[0],Ub(t)}async function wx(){let e=await gx(),t=[],n={};for(let r of e.jsonData?.tables??[])t.push(r.tableName),n[r.tableName]=r;return{tableIds:t,tables:n,rowCounts:e.jsonData?.rowCounts??{},databaseName:e.jsonData?.databaseName??`unknown`}}function Tx(e,t){let n=(0,ea.c)(17),{order:r,limit:i,page:a,search:o}=t,s;n[0]!==i||n[1]!==r||n[2]!==a||n[3]!==o?(s={order:r,limit:i,page:a,search:o},n[0]=i,n[1]=r,n[2]=a,n[3]=o,n[4]=s):s=n[4];let c;n[5]!==s||n[6]!==e?(c=[`tables`,e,s],n[5]=s,n[6]=e,n[7]=c):c=n[7];let l;n[8]!==i||n[9]!==r||n[10]!==a||n[11]!==o||n[12]!==e?(l=()=>_x(e,r,i,a,o).then(Ex),n[8]=i,n[9]=r,n[10]=a,n[11]=o,n[12]=e,n[13]=l):l=n[13];let u;return n[14]!==c||n[15]!==l?(u={queryKey:c,queryFn:l},n[14]=c,n[15]=l,n[16]=u):u=n[16],Ub(u)}function Ex(e){return e.jsonData}function Dx(e){let t=(0,ea.c)(11),n=Eb(),r=g_(),i;t[0]===e?i=t[1]:(i=async t=>{let{pk:n,data:r}=t;return n==null?bx(e,r):xx(e,n,r)},t[0]=e,t[1]=i);let a;t[2]!==n||t[3]!==e?(a=()=>{n.invalidateQueries({queryKey:[`tables`,e]})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;t[5]===r?o=t[6]:(o=()=>{r({title:`Failed to update row`,description:``,intent:`error`})},t[5]=r,t[6]=o);let s;return t[7]!==i||t[8]!==a||t[9]!==o?(s={mutationFn:i,onSuccess:a,onError:o},t[7]=i,t[8]=a,t[9]=o,t[10]=s):s=t[10],Wb(s)}function Ox(e){let t=(0,ea.c)(11),n=Eb(),r=g_(),i;t[0]===e?i=t[1]:(i=t=>yx(e,t),t[0]=e,t[1]=i);let a;t[2]!==n||t[3]!==e?(a=()=>{n.invalidateQueries({queryKey:[`tables`,e]})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;t[5]===r?o=t[6]:(o=()=>{r({title:`Failed to delete row`,description:``,intent:`error`})},t[5]=r,t[6]=o);let s;return t[7]!==i||t[8]!==a||t[9]!==o?(s={mutationFn:i,onSuccess:a,onError:o},t[7]=i,t[8]=a,t[9]=o,t[10]=s):s=t[10],Wb(s)}function kx(e,t){let n=(0,ea.c)(3),r;return n[0]!==t||n[1]!==e?(r={queryKey:[`tables`,e,`rows`,t],queryFn:()=>t==null?{}:vx(e,t).then(Ax)},n[0]=t,n[1]=e,n[2]=r):r=n[2],Ub(r)}function Ax(e){return e.jsonData}function jx(e,t){let n=(0,ea.c)(3),r;return n[0]!==t||n[1]!==e?(r={queryKey:[`foreign-key-options`,e,t],queryFn:()=>Sx(e,t).then(Mx)},n[0]=t,n[1]=e,n[2]=r):r=n[2],Hb(r)}function Mx(e){return e.jsonData}var Nx=e=>e.name?String(e.name):e.title?String(e.title):e.slug?String(e.slug):JSON.stringify(e);function Px(e){let t=(0,ea.c)(16),n=e.schema.$bitiforms?.widgetProps,r;t[0]===n?r=t[1]:(r=n||{},t[0]=n,t[1]=r);let{foreignTable:i,foreignColumn:a}=r,{data:o}=jx(i,a),s;t[2]===o?s=t[3]:(s=o===void 0?[]:o,t[2]=o,t[3]=s);let c=s,l=e.value||``,u;t[4]===l?u=t[5]:(u=l.toString(),t[4]=l,t[5]=u);let d=u,f=e.schema.title,p=e.schema.description,m;t[6]===e?m=t[7]:(m=t=>{e.onChange({target:{name:e.name,value:Number(t.target.value)}})},t[6]=e,t[7]=m);let h;t[8]===c?h=t[9]:(h=c.map(Fx),t[8]=c,t[9]=h);let g;return t[10]!==e.schema.description||t[11]!==e.schema.title||t[12]!==d||t[13]!==m||t[14]!==h?(g=(0,L.jsx)(bg,{label:f,hint:p,value:d,onChange:m,children:h}),t[10]=e.schema.description,t[11]=e.schema.title,t[12]=d,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function Fx(e){return(0,L.jsxs)(`option`,{value:String(e.id),children:[String(e.id),`: `,Nx(e)]},String(e.id))}var Ix=uo({colors:{primary:`#2a2f3b`}}),Lx=new wb({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),Rx={...hy,ForeignKeyWidget:Px};function zx(e){let t=(0,ea.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,L.jsx)(x.StrictMode,{children:(0,L.jsx)(Xh,{children:(0,L.jsx)(W_,{widgets:Rx,children:(0,L.jsx)(Db,{client:Lx,children:(0,L.jsx)(z,{theme:Ix,children:(0,L.jsx)(h_,{children:n})})})})})}),t[0]=n,t[1]=r),r}var Bx=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Vx=(e=>e?Bx(e):Bx),Hx=e=>e;function Ux(e,t=Hx){let n=x.useSyncExternalStore(e.subscribe,x.useCallback(()=>t(e.getState()),[e,t]),x.useCallback(()=>t(e.getInitialState()),[e,t]));return x.useDebugValue(n),n}var Wx=e=>!!e.dispatchFromDevtools&&typeof e.dispatch==`function`,Gx=new Map,Kx=e=>{let t=Gx.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},qx=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=Gx.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return Gx.set(n.name,i),{type:`tracked`,store:e,...i}},Jx=(e,t)=>{if(t===void 0)return;let n=Gx.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&Gx.delete(e))},Yx=e=>{if(!e)return;let t=e.split(`
|
|
13
|
+
Got schema ${JSON.stringify(n,null,2)}`);let a=n==null?null:lv(n,t);a&&(M_(a,`then and else schemas must be object schemas: ${JSON.stringify(a,null,2)}`),a.required&&i.push(...a.required),Object.assign(r,a.properties))}if(e.allOf)for(let n of e.allOf){let e=lv(n,t);j_(e)&&(e.required&&i.push(...e.required),Object.assign(r,e.properties))}let a={type:`object`,properties:r,$bitiforms:n,required:[...new Set(i)]};return e.title&&(a.title=e.title),e.description&&(a.description=e.description),a}return e}function uv(e,t={}){let n=[];for(let r of e){let e=lv(r,t);dv(e)&&n.push(e)}return n}function dv(e){return!!(j_(e)&&e.properties&&Object.keys(e.properties).length>0)}function fv(e,t){if(Array.isArray(e))return uv(e,t);let n=Object.keys(e.properties||{}).length>0;if(Array.isArray(e.allOf)){let{allOf:r,...i}=e;return uv(n?[i].concat(r):r,t)}if(n)return uv([e],t);throw Error(`resolveBaseSchema() either takes an array of ObjectSchemas or an ObjectSchema with an .allOf property.`)}function pv(e){let t={type:`object`,properties:{}},n=[];for(let r of e)Object.assign(t.properties,r.properties),r.required&&n.push(...r.required);return n.length>0&&(t.required=[...new Set(n)]),t}function mv(e,t){if(j_(e)){let n=e.properties||{},r=t||hv(e);return{...r,...Object.keys(n).reduce((e,t)=>(e[t]=mv(n[t],r[t]),e),{})}}return L_(e)?j_(e.items)?(t||hv(e)).map(t=>{let n=t||hv(e.items);return{...n,_id:n._id==null?w_():n._id,...mv(lv(e.items,n),n)}}):(t||hv(e)).map(t=>mv(e.items,t)):Object.prototype.hasOwnProperty.call(e,`const`)?e.const:t??hv(e)}function hv(e){if(Object.prototype.hasOwnProperty.call(e,`default`))return e.default;if(j_(e))return{};if(N_(e))return``;if(I_(e)||P_(e)||F_(e)||R_(e))return null;if(L_(e))return[];throw Error(`getDefaultValue invalid schema ${JSON.stringify(e)}`)}function gv(e,t){if(j_(e)){let n=e.properties||{};return typeof t!=`object`||!t?{}:Object.keys(n).reduce((e,r)=>(e[r]=gv(n[r],t[r]),e),{})}return L_(e)?Array.isArray(t)?t.map(t=>gv(lv(e.items,t),t)):[]:N_(e)&&e.format&&b_[e.format]?b_[e.format](String(t)):t}var _v=(e,t,n)=>(e||[]).find(e=>e._id===t)||n;function vv({id:e,name:t,path:n,value:r,schema:i,errors:a,disabled:o,texts:s,renderAddButton:c,renderItem:l,renderContainer:u}){let[d]=(0,x.useState)(()=>T_(E_(r)?._id)),f=Y_(n),p=(0,x.useCallback)(()=>{f(e=>e.concat({_id:d(),...mv(lv(i.items,{}),{})}))},[d,i.items,f]),m=(0,x.useCallback)(e=>{f(t=>t.filter(t=>t._id!==e))},[f]),h=(0,x.useCallback)((e,t)=>{f(n=>n.map(n=>{if(n._id===e){let e={...n,[t.target.name]:t.target.value};return mv(lv(i.items,e),e)}return n}))},[f,i.items]),g=q_();M_(i.items);let _=!!(g.value&&a&&a.all.length>0),v=r.length;return(0,L.jsx)(L.Fragment,{children:u({schema:i,name:t,id:e,children:(0,L.jsxs)(L.Fragment,{children:[r.map((r,o)=>(0,L.jsx)(yv,{id:r._id,path:`${n}/${o}`,parentId:e,parentName:t,item:r,onFieldChange:h,render:l,index:o,onRemove:m,schema:i.items,errors:a,texts:s},r._id)),c({disabled:o,onClick:p,itemCount:v,texts:s})]}),errors:_?$_(a.all,s):null,itemCount:v,texts:s})})}var yv=(0,x.memo)(function({parentId:e,parentName:t,path:n,render:r,id:i,index:a,texts:o,onRemove:s,item:c,schema:l,onFieldChange:u,errors:d}){let f=lv(l,c).properties||{},p=D_(Object.keys(f),l.$bitiforms?.propertyOrder),m=_v(d.items,i,{}),h=p.reduce((r,a)=>(r[a]={path:`${n}/${a}`,schema:f[a],id:`${e}__${a}__${i}`,name:`${t}__${a}__${i}`,onChange:e=>u(i,{target:{name:a,value:e.target.value}}),value:c[a],errors:m[a],texts:o},r),{});return(0,L.jsx)(L.Fragment,{children:r?.({fields:h,index:a,id:i,path:n,onRemove:()=>{s(i)},texts:o})})}),bv=(0,x.memo)(function(e){let{texts:t,resolveWidget:n,widgets:r}=U_();O_(typeof e.name==`string`&&e.name.trim()!==``);let i=n(e.schema,r);return(0,L.jsx)(x.Suspense,{fallback:(0,L.jsx)(`div`,{}),children:(0,L.jsx)(i,{...e,texts:t})})}),xv=class e{static from(t){if(t===``)return new e([]);t.startsWith(`/`)||(t=`/${t}`);let[,...n]=t.split(`/`);return new e(n.map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`)))}constructor(e){this.tokens=e}toString(){return this.tokens.length===0?``:`/${this.tokens.map(e=>e.replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}`}toPath(){return this.tokens}};function Sv(e,t,n){let r=(typeof t==`string`?xv.from(t):t).toPath(),i=(e,t,n,r)=>{let a,o=t[r];return t.length>r?(Array.isArray(e)?(o=parseInt(o,10),a=e.slice()):a={...e},a[o]=i(e[o]===void 0?{}:e[o],t,n,r+1),a):typeof n==`function`?n(e):n};return i(e,r,n,0)}var Cv=class extends Error{constructor(e){super(`SubmissionError`),this.errors=e}},wv=1,Tv=2,Ev=4,Dv=5,Ov=6,kv=7,Av=8,jv={};function Mv(e){let t=(0,x.useId)();return e||t}function Nv({name:e,initialValues:t=jv,schema:n,disabled:r,onSubmit:i,onFormValuesChanged:a}){let o=Iv(),s=Mv(e);function c(e,t){function r(e){let t=Lv(n,e.values,!1,o()),r=!0;(0,Pa.default)(t.steps,e.steps)&&(r=!1,t.steps=e.steps);let i=!0;(0,Pa.default)(t.values,e.values)&&(i=!1,t.values=e.values);let a=!0;return(0,Pa.default)(t.errors,e.errors)&&(a=!1,t.errors=e.errors),!r&&!i&&!a?e:{...e,...t}}switch(t.type){case wv:return{...e,submissionState:`not-submitted`,submissionErrors:{},revealAllErrors:!1};case Tv:return r(e);case Ev:return{...e,submissionState:`submitting`};case Dv:return{...e,submissionState:`submitted`};case Ov:{let n=t.error;return{...e,submissionState:`failed`,submissionErrors:n instanceof Cv?n.errors:{},revealAllErrors:!0}}case kv:return{...e,revealAllErrors:t.value};case Av:return r({...e,values:Sv(e.values,t.path,t.updater)});default:return e}}let l=(0,x.useRef)(!0);(0,x.useEffect)(()=>(l.current=!0,()=>{l.current=!1}),[]);let[u,d]=(0,x.useReducer)(c,void 0,()=>{let{steps:e,errors:r,values:i}=Lv(n,t,!1,o());return{values:i,steps:e,touched:{},errors:r,submissionState:`not-submitted`,submissionErrors:{},revealAllErrors:!1}});(0,x.useEffect)(()=>{a?.(u.values)},[u.values,a]),(0,x.useEffect)(()=>{d({type:Tv})},[n]);let f=(0,x.useCallback)(e=>{d({type:kv,value:e})},[]),p=(0,x.useCallback)((e,t)=>{d({type:Av,path:e,updater:t})},[]),m=(0,x.useCallback)(e=>{if(r)return;let{name:t,value:n}=e.target;p(``,e=>({...e,[t]:n}))},[r,p]),h=async e=>{if(!l.current||r)return;e.preventDefault?.(),d({type:Ev});let{errors:t,values:a}=Lv(n,u.values,!0,o()),s=!Z_(t);try{if(await i?.({values:a,errors:t,isValid:s})===!1)throw new Cv({});d({type:Dv})}catch(e){d({type:Ov,error:e})}},g=()=>u.steps.map(e=>{let{properties:t={},$bitiforms:n={}}=e,i=D_(Object.keys(t),n.propertyOrder).reduce((e,n)=>(e[n]={path:n,schema:t[n],value:u.values[n],id:`form-${s}-${n}`,name:n,errors:u.errors[n],onChange:m,disabled:r},e),{});return{isValid:()=>!Object.keys(i).some(e=>Z_(i[e].errors)),fields:i}}),_=(0,x.useCallback)(()=>{l.current&&d({type:wv})},[]),v=g(),y={name:s,errors:u.errors,steps:v,values:u.values,onSubmit:h,submissionState:u.submissionState,clearSubmission:_,submissionErrors:u.submissionErrors,revealAllErrors:f,schema:n};return[y,{revealAllErrors:u.revealAllErrors,values:y.values,updateValues:p}]}function Pv({revealAllErrors:e,values:t,updateValues:n,children:r}){return(0,L.jsx)(J_.Provider,{value:n,children:(0,L.jsx)(K_.Provider,{value:e,children:(0,L.jsx)(G_.Provider,{value:t,children:r})})})}function Fv({render:e,component:t,element:n,...r}){let[i,a]=Nv(r);if(typeof e==`function`&&t)throw Error(`one of render or component must be provided, but not both`);if(typeof e==`function`)return(0,L.jsx)(Pv,{...a,children:e(i)});if(n)return(0,L.jsx)(Pv,{...a,children:(0,L.jsx)(X_.Provider,{value:i,children:n})});if(t)return(0,L.jsx)(Pv,{...a,children:(0,L.jsx)(t,{...i})});throw Error(`one of render or component must be provided`)}function Iv(){let{formats:e}=U_(),t=(0,x.useRef)(null);function n(){return t.current??=nv({formats:e}),t.current}return n}function Lv(e,t,n,r){let i=fv(e,t),a=pv(i),o=mv(a,t);n&&(o=gv(a,o));let s=r.validateSchema(a,o);return{steps:i,values:o,errors:s}}function Rv({id:e,name:t,path:n,value:r,schema:i,errors:a,disabled:o,texts:s}){let c=Y_(n),l=(0,x.useCallback)((e,t)=>{c(n=>({...n,[e]:t}))},[c]),u=i.$bitiforms||{},d=i.properties||{};return(0,L.jsxs)(`div`,{"data-bitiforms-object":!0,role:`group`,"data-field-path":n,children:[i.title&&(0,L.jsx)(`legend`,{"data-bitiforms-object-title":!0,children:i.title}),i.description&&(0,L.jsx)(`div`,{"data-bitiforms-object-description":!0,children:i.description}),(0,L.jsx)(`div`,{"data-bitiforms-object-fields":!0,children:D_(Object.keys(d),u.propertyOrder).map(i=>{let c=`${t}_${i}`;return(0,L.jsx)(zv,{path:`${n}/${i}`,field:i,schema:d[i],value:r[i],id:`${e}_${i}`,errors:a[i],name:c,onChange:l,disabled:o,texts:s},c)})})]})}var zv=(0,x.memo)(function({field:e,onChange:t,...n}){return(0,L.jsx)(bv,{...n,onChange:n=>t(e,n.target.value)})});function Bv(e){if(!e.enum)return[];let t=[];for(let n=0;n<e.enum.length;n++)t.push([e.enum[n],e.$enumNames?.[n]||e.enum[n]]);return t}function Vv(e){return(0,x.useMemo)(()=>{if(N_(e)){let t=e=>e,n=e=>e,r=[];return e.enum?r=Bv(e):e.oneOf?r=e.oneOf.map(e=>{let t=e.const?e.const:e.enum?e.enum[0]:``;return[t,e.title||t]}):e.anyOf&&(r=e.anyOf.map(e=>{let t=e.const?e.const:e.enum?e.enum[0]:``;return[t,e.title||t]})),{values:r,fromSchemaValue:n,toSchemaValue:t}}if(I_(e))return{values:[[`yes`,`Yes`],[`no`,`No`]],fromSchemaValue:e=>e===!0?`yes`:e===!1?`no`:null,toSchemaValue:e=>{switch(e){case`yes`:return!0;case`no`:return!1;default:return null}}};if(P_(e)||F_(e)){let t=e=>parseInt(e??``,10),n=[];for(let t=e.minimum??0;t<=(e.maximum??20);t++)n.push([`${t}`,`${t}`]);return{values:n,fromSchemaValue:e=>`${e??``}`,toSchemaValue:t}}throw Error(`Invalid schema given to SelectWidget`)},[e])}var Hv=e=>e;function Uv(e,t=Hv){let n=e.name,r=q_();return{onBlur:()=>{r.enable()},onChange:r=>{let i=t(r.target.value);e.onChange({target:{name:n,value:i}})},error:r.value?$_(e.errors,e.texts):void 0,schema:e.schema,$bitiforms:e.schema.$bitiforms||{},id:e.id,name:e.name,value:e.value,disabled:e.disabled}}var Wv=({fields:e,onRemove:t,texts:n,path:r})=>(0,L.jsxs)(`div`,{"data-bitiforms-array-item":!0,"data-field-path":r,children:[Object.keys(e).map(t=>(0,L.jsx)(bv,{...e[t]},t)),(0,L.jsx)(Eo,{className:`dmk-margin-top-m`,variant:`outlined`,intent:`danger`,type:`button`,onClick:t,"data-bitiforms-array-remove-button":!0,children:(n||{})[`arrayfield.remove`]??`Remove`})]}),Gv=({disabled:e,onClick:t,texts:n})=>(0,L.jsx)(Io,{as:`footer`,horizontal:!0,alignItems:`center`,className:`dmk-margin-top-l`,"data-bitiforms-array-add-button":!0,children:!e&&(0,L.jsx)(Eo,{variant:`outlined`,onClick:t,children:(n||{})[`arrayfield.add`]??`Add`})}),Kv=({schema:e,id:t,name:n,children:r,errors:i,itemCount:a})=>(0,L.jsxs)(`div`,{"data-bitiforms-array-field":n,children:[e.title&&(0,L.jsxs)(`h3`,{id:`${t}_title`,className:`dmk-text-title2 dmk-margin-bottom-s`,children:[e.title,` `,(0,L.jsxs)(`span`,{"data-bitiforms-array-item-count":!0,children:[`(`,a,`)`]})]}),e.description&&(0,L.jsx)(`div`,{id:`${t}_description`,children:e.description}),i&&(0,L.jsx)(`div`,{children:i}),r]});function qv(e){return(0,L.jsx)(vv,{...e,renderItem:Wv,renderAddButton:Gv,renderContainer:Kv})}function Jv(e){return(0,L.jsx)(`div`,{"data-bitiforms-description":!0,...e})}function Yv({onChange:e,id:t,name:n,value:r,errors:i,schema:a,texts:o,disabled:s,path:c}){let l=q_();O_(Zv(a),`CheckboxGroupWidget must be given a schema of type 'object' or 'array'. ${JSON.stringify(a)} given.`);let u=t=>i=>L_(a)&&Array.isArray(r)?e({target:{name:n,value:Qv(r,t,i.currentTarget.checked)}}):e({target:{name:n,value:{...r,[t]:i.currentTarget.checked}}}),d=()=>{l.enable()},f=l.value,p=Xv(i,a);return(0,L.jsxs)(Ph,{"aria-labelledby":`${t}-legend`,"data-bitiforms-checkboxgroup":!0,"data-field-path":c,children:[a.title&&(0,L.jsx)(Lh,{id:`${t}-legend`,children:a.title}),a.description&&(0,L.jsx)(Jv,{id:`${t}_description`,children:a.description}),(0,L.jsx)(Io,{spacing:`s`,children:$v(a).map(([e,n])=>{let a=Array.isArray(r)?r.includes(e):r[e]===!0,o=Array.isArray(r)?!a&&p.length>0?`invalid`:void 0:Z_(i[e])?`invalid`:void 0;return(0,L.jsx)(Ro,{id:`${t}_${e}`,checked:a,value:e,error:f?!!o:void 0,onChange:u(e),onBlur:d,disabled:s,children:n},e)})}),f&&p.length>0&&(0,L.jsx)(Rh,{role:`alert`,children:$_(p,o)})]})}function Xv(e,t){return Z_(e)?L_(t)?e.all:[`errors.checkboxGroup.invalid`]:[]}function Zv(e){return!!(L_(e)&&N_(e.items)&&e.items.enum||j_(e)&&Object.values(e.properties||{}).every(I_))}function Qv(e,t,n){let r=new Set(e);return n?[...r.add(t)]:(r.delete(t),[...r])}function $v(e){if(L_(e)&&N_(e.items)&&e.items.enum){let t=[];for(let n=0;n<e.items.enum.length;n++)t.push([e.items.enum[n],e.items.$enumNames?.[n]||e.items.enum[n]]);return t}return j_(e)?D_(Object.keys(e.properties||{}),(e.$bitiforms||{}).propertyOrder).map(t=>[t,e.properties[t].title]):[]}function ey({name:e,value:t,onChange:n,schema:r,errors:i,texts:a,path:o}){let s=q_(),c=t=>{let{checked:r}=t.currentTarget;return n({target:{name:e,value:r}})},l=s.value&&Z_(i);return(0,L.jsxs)(`div`,{"data-field-path":o,children:[(0,L.jsx)(Ro,{checked:t||!1,onChange:c,onBlur:s.enable,error:l,children:r.title}),l&&(0,L.jsx)(Rh,{role:`alert`,children:a?.[`errors.checkbox.required`]})]})}function ty(e){let{onBlur:t,onChange:n,error:r,schema:i,id:a,name:o,value:s,disabled:c,$bitiforms:l}=Uv(e);return(0,L.jsx)(zh,{"data-field-path":e.path,name:o,type:`date`,id:a,label:i.title,hint:i.description,error:r,value:s??``,onChange:n,onBlur:t,disabled:c,...l.widgetProps})}function ny({schema:e,path:t}){return!e.title&&!e.description&&!e.const?null:(0,L.jsxs)(`div`,{"data-bitiforms-helptext":!0,"data-field-path":t,children:[e.title&&(0,L.jsx)(`h4`,{children:e.title}),e.description||e.const||``]})}var ry=({})=>null;function iy({suffix:e=``,...t}){let{$bitiforms:n,onBlur:r,onChange:i,error:a,schema:o,id:s,name:c,value:l,disabled:u}=Uv(t,ay);return(0,L.jsx)(eg,{"data-field-path":t.path,id:s,name:c,placeholder:n.placeholder,error:a,label:o.title,autoFocus:n.autoFocus,...n.widgetProps,hint:o.description,value:l==null||l===``?``:l,onBlur:r,onChange:e=>{i({target:{name:e.target.name,value:e.target.value}})},min:o.minimum,max:o.maximum,disabled:u,endAdornment:e})}var ay=e=>{if(e.trim()===``)return null;let t=parseFloat(e.replace(/[^0-9,.]/g,``));return isNaN(t)?null:t};function oy(e){return(0,L.jsx)(Rv,{...e})}var sy={email:`email`};function cy(e){return e.type===`string`&&e.format&&sy[e.format]||`text`}function ly({type:e,endAdornment:t,...n}){let{$bitiforms:r,onBlur:i,onChange:a,error:o,schema:s,id:c,name:l,value:u,disabled:d}=Uv(n),f=cy(s);return(0,L.jsx)(zh,{"data-field-path":n.path,type:e||f,id:c,name:l,placeholder:r.placeholder,error:o,label:s.title,autoFocus:r.autoFocus,hint:s.description,value:u??``,onBlur:i,onChange:a,disabled:d,endAdornment:t,...r.widgetProps,autoComplete:typeof r.autoComplete==`string`?r.autoComplete:r.autoComplete===!1?`off`:`on`})}function uy(e){let t=cg(!1);return(0,L.jsx)(ly,{...e,type:t.value?`text`:`password`,endAdornment:(0,L.jsx)(Eo,{tabIndex:-1,variant:`text`,style:{fontSize:32,lineHeight:1,padding:0},onClick:t.toggle,children:t.value?(0,L.jsx)(xa,{}):(0,L.jsx)(Sa,{})})})}var dy=({value:e,label:t,disabled:n})=>(0,L.jsx)(ig,{value:e,disabled:n,children:t});function fy({className:e,renderOption:t=dy,texts:n,...r}){let{values:i,fromSchemaValue:a,toSchemaValue:o}=Vv(r.schema),{onBlur:s,onChange:c,schema:l,id:u,error:d,name:f,value:p,disabled:m}=Uv(r,o);return(0,L.jsxs)(`div`,{"aria-labelledby":`${u}-legend`,"data-field-path":r.path,children:[(0,L.jsx)(Lh,{error:!!d,id:`${u}-legend`,children:l.title}),l.description&&(0,L.jsx)(Jv,{id:`${u}_description`,children:l.description}),(0,L.jsx)(ng,{name:f,id:u,className:e,error:!!d,value:a(p)??``,onChange:c,onBlur:s,disabled:m,children:i.map(([e,n],r)=>(0,L.jsx)(x.Fragment,{children:t({value:e,label:n,disabled:m||!1,index:r})},e))}),d&&(0,L.jsx)(Rh,{children:n?.[`errors.radiogroup.required`]})]})}function py(e){let{values:t,fromSchemaValue:n,toSchemaValue:r}=Vv(e.schema),{id:i,name:a,$bitiforms:o,error:s,schema:c,onChange:l,onBlur:u,value:d,disabled:f}=Uv(e,r);return(0,L.jsx)(bg,{"data-field-path":e.path,id:i,name:a,label:c.title,autoFocus:o.autoFocus,error:s,hint:c.description,value:n(d),onChange:l,onBlur:u,disabled:f,children:t.map(([e,t])=>(0,L.jsx)(`option`,{value:e,children:t},e))})}function my({errors:e,onClose:t,title:n=`Failed to submit`}){let{texts:r}=U_();return(0,L.jsx)(Ja,{intent:`error`,title:n,onClose:t,children:(0,L.jsx)(`ul`,{children:Object.values(e).map((e,t)=>(0,L.jsx)(`li`,{children:$_([e],r)},t))})})}var hy={ArrayWidget:qv,ObjectWidget:oy,CheckboxWidget:ey,CheckboxGroupWidget:Yv,DateWidget:ty,HelpTextWidget:ny,HiddenWidget:ry,NumberWidget:iy,PasswordWidget:uy,RadioGroupWidget:fy,SelectWidget:py,TextInputWidget:ly},gy=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},_y=new class extends gy{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},vy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},yy=new class{#e=vy;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function by(e){setTimeout(e,0)}var xy=typeof window>`u`||`Deno`in globalThis;function Sy(){}function Cy(e,t){return typeof e==`function`?e(t):e}function wy(e){return typeof e==`number`&&e>=0&&e!==1/0}function Ty(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ey(e,t){return typeof e==`function`?e(t):e}function Dy(e,t){return typeof e==`function`?e(t):e}function Oy(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Ay(o,t.options))return!1}else if(!My(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ky(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(jy(t.options.mutationKey)!==jy(a))return!1}else if(!My(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Ay(e,t){return(t?.queryKeyHashFn||jy)(e)}function jy(e){return JSON.stringify(e,(e,t)=>Ly(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function My(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>My(e[n],t[n])):!1}var Ny=Object.prototype.hasOwnProperty;function Py(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Iy(e)&&Iy(t);if(!r&&!(Ly(e)&&Ly(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ny.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Py(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Fy(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Iy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ly(e){if(!Ry(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ry(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ry(e){return Object.prototype.toString.call(e)===`[object Object]`}function zy(e){return new Promise(t=>{yy.setTimeout(t,e)})}function By(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Py(e,t)}function Vy(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Hy(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Uy=Symbol();function Wy(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Uy?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gy(e,t){return typeof e==`function`?e(...t):!!e}function Ky(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var qy=(()=>{let e=()=>xy;return{isServer(){return e()},setIsServer(t){e=t}}})();function Jy(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Yy=by;function Xy(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Yy,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Zy=Xy(),Qy=new class extends gy{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function $y(e){return Math.min(1e3*2**e,3e4)}function eb(e){return(e??`online`)===`online`?Qy.isOnline():!0}var tb=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function nb(e){let t=!1,n=0,r,i=Jy(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new tb(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>_y.isFocused()&&(e.networkMode===`always`||Qy.isOnline())&&e.canRun(),u=()=>eb(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(qy.isServer()?0:3),o=e.retryDelay??$y,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),zy(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var rb=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),wy(this.gcTime)&&(this.#e=yy.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(qy.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(yy.clearTimeout(this.#e),this.#e=void 0)}},ib=class extends rb{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=sb(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=sb(this.options);e.data!==void 0&&(this.setState(ob(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=By(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Sy).catch(Sy):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Dy(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Uy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ey(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Ty(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Wy(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=nb({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof tb&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof tb){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ab(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ob(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Zy.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function ab(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eb(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ob(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function sb(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var cb=class extends gy{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Jy(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ub(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return db(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return db(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Dy(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Fy(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&fb(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Dy(this.options.enabled,this.#t)!==Dy(t.enabled,this.#t)||Ey(this.options.staleTime,this.#t)!==Ey(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Dy(this.options.enabled,this.#t)!==Dy(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return mb(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Sy)),t}#g(){this.#b();let e=Ey(this.options.staleTime,this.#t);if(qy.isServer()||this.#r.isStale||!wy(e))return;let t=Ty(this.#r.dataUpdatedAt,e)+1;this.#d=yy.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(qy.isServer()||Dy(this.options.enabled,this.#t)===!1||!wy(this.#p)||this.#p===0)&&(this.#f=yy.setInterval(()=>{(this.options.refetchIntervalInBackground||_y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(yy.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(yy.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ub(e,t),o=i&&fb(e,n,t,r);(a||o)&&(l={...l,...ab(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=By(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=By(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:pb(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Dy(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=Jy())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Fy(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Zy.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function lb(e,t){return Dy(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function ub(e,t){return lb(e,t)||e.state.data!==void 0&&db(e,t,t.refetchOnMount)}function db(e,t,n){if(Dy(t.enabled,e)!==!1&&Ey(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&pb(e,t)}return!1}function fb(e,t,n,r){return(e!==t||Dy(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&pb(e,n)}function pb(e,t){return Dy(t.enabled,e)!==!1&&e.isStaleByTime(Ey(t.staleTime,e))}function mb(e,t){return!Fy(e.getCurrentResult(),t)}function hb(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Ky(e,()=>t.signal,()=>n=!0)},u=Wy(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Hy:Vy;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?_b:gb,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:gb(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function gb(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function _b(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var vb=class extends rb{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||yb(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=nb({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...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{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Zy.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function yb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var bb=class extends gy{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new vb({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=xb(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=xb(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Zy.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ky(t,e))}findAll(e={}){return this.getAll().filter(t=>ky(e,t))}notify(e){Zy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Zy.batch(()=>Promise.all(e.map(e=>e.continue().catch(Sy))))}};function xb(e){return e.options.scope?.id}var Sb=class extends gy{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Fy(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&jy(t.mutationKey)!==jy(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??yb();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Zy.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Cb=class extends gy{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Ay(r,t),a=this.get(i);return a||(a=new ib({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Zy.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Oy(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Oy(e,t)):t}notify(e){Zy.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Zy.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Zy.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},wb=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Cb,this.#t=e.mutationCache||new bb,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=_y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Qy.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ey(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Cy(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Zy.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Zy.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Zy.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Zy.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Sy).catch(Sy)}invalidateQueries(e,t={}){return Zy.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Zy.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Sy)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Sy)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Ey(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Sy).catch(Sy)}fetchInfiniteQuery(e){return e.behavior=hb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Sy).catch(Sy)}ensureInfiniteQueryData(e){return e.behavior=hb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Qy.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(jy(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{My(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(jy(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{My(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Ay(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Uy&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Tb=x.createContext(void 0),Eb=e=>{let t=x.useContext(Tb);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Db=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Tb.Provider,{value:e,children:t})),Ob=x.createContext(!1),kb=()=>x.useContext(Ob);Ob.Provider;function Ab(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var jb=x.createContext(Ab()),Mb=()=>x.useContext(jb),Nb=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Gy(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Pb=e=>{x.useEffect(()=>{e.clearReset()},[e])},Fb=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Gy(n,[e.error,r])),Ib=(e,t)=>t.state.data===void 0,Lb=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Rb=(e,t)=>e.isLoading&&e.isFetching&&!t,zb=(e,t)=>e?.suspense&&t.isPending,Bb=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Vb(e,t,n){let r=kb(),i=Mb(),a=Eb(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Lb(o),Nb(o,i,s),Pb(i);let c=!a.getQueryCache().get(o.queryHash),[l]=x.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(e=>{let t=d?l.subscribe(Zy.batchCalls(e)):Sy;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),x.useEffect(()=>{l.setOptions(o)},[o,l]),zb(o,u))throw Bb(o,l,i);if(Fb({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!qy.isServer()&&Rb(u,r)&&(c?Bb(o,l,i):s?.promise)?.catch(Sy).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Hb(e,t){return Vb(e,cb,t)}function Ub(e,t){return Vb({...e,enabled:!0,suspense:!0,throwOnError:Ib,placeholderData:void 0},cb,t)}function Wb(e,t){let n=Eb(t),[r]=x.useState(()=>new Sb(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(Zy.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((e,t)=>{r.mutate(e,t).catch(Sy)},[r]);if(i.error&&Gy(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Gb=Object.defineProperty,Kb=Object.defineProperties,qb=Object.getOwnPropertyDescriptors,Jb=Object.getOwnPropertySymbols,Yb=Object.prototype.hasOwnProperty,Xb=Object.prototype.propertyIsEnumerable,Zb=(e,t,n)=>t in e?Gb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qb=(e,t)=>{for(var n in t||={})Yb.call(t,n)&&Zb(e,n,t[n]);if(Jb)for(var n of Jb(t))Xb.call(t,n)&&Zb(e,n,t[n]);return e},$b=(e,t)=>Kb(e,qb(t)),ex=(e,t)=>{var n={};for(var r in e)Yb.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Jb)for(var r of Jb(e))t.indexOf(r)<0&&Xb.call(e,r)&&(n[r]=e[r]);return n},tx=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),nx=e=>cx({max:5,isRetriable:e=>e instanceof ax?e.response.status===503:e instanceof ox,getDelay:e=>500*e,signal:e}),rx=()=>globalThis.crypto.randomUUID();function ix(e={}){var t=e,{fetch:n=fetch,getRootUrl:r=()=>``,timeout:i=0,retryOn:a=nx,headers:o={},requestIdHeaderName:s=`X-Request-ID`,getRequestId:c=rx,json:l=!0,transform:u=e=>e}=t,d=ex(t,[`fetch`,`getRootUrl`,`timeout`,`retryOn`,`headers`,`requestIdHeaderName`,`getRequestId`,`json`,`transform`]);let f=[];function p(e){return tx(this,arguments,function*(e,t={}){let p=t.json??l,m=t.transform??u,h=yield r(e),g=t.fetch??n,_=c(),v=n=>tx(null,null,function*(){let r=new Headers;r.set(s,n),p&&(r.set(`Accept`,`application/json`),t.method!==`GET`&&typeof t.body==`string`&&r.set(`Content-Type`,`application/json`));for(let[e,n]of Object.entries(Qb(Qb({},o),t.headers)))r.set(e,n);return new Request(`${h}${e}`,$b(Qb(Qb({credentials:`include`},d),t),{headers:r}))}),y=new AbortController,b=t.signal,x=()=>{y.abort(b?.reason)};return b!=null&&b.aborted?y.abort(b.reason):b?.addEventListener(`abort`,x,{once:!0}),fx(()=>tx(null,null,function*(){let e=t.timeout??i??0,n=yield v(_),r=yield tx(null,null,function*(){return ux(e=>tx(null,null,function*(){let t=new Request(n,{signal:e});for(let e of f)e.request&&(yield e.request(t));return g(t)}),e,{signal:n.signal})});r.jsonData=p?yield r.clone().json().then(e=>{let n=typeof m==`function`?m(e):m.response?m.response(e):e;return t.schema?px(t.schema,n):n},()=>{}):void 0;for(let e of f)e.response&&(yield e.response(r));if(r.status<200||r.status>=400)throw new ax(r);return r}),t.retryOn||(a===nx?nx(y.signal):a()))().finally(()=>{b?.removeEventListener(`abort`,x)})})}return p.intercept=e=>(f.push(e),()=>{let t=f.indexOf(e);t>=0&&f.splice(t,1)}),p}var ax=class extends Error{constructor(e){let t=`${e.status} ${e.statusText} at ${e.url}`;super(t),this.name=this.constructor.name,this.response=e}},ox=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},sx=class extends Error{constructor(e,t){super(`Validation error`),this.name=this.constructor.name,this.issues=e.issues,this.data=t}};function cx({max:e,isRetriable:t,getDelay:n,signal:r}){let i=0;return function(a){return tx(this,null,function*(){return i++,t(a)&&i<e?(yield dx(n(i),{signal:r}),!0):!1})}}function lx(e){return e instanceof Error?e:Error(`Aborted`)}function ux(e,t){return tx(this,arguments,function*(e,t,n={}){let r=n.signal;if(r!=null&&r.aborted)throw r.reason;if(t<=0||!Number.isFinite(t))return e(r??new AbortController().signal);let i=new AbortController,{signal:a}=i,o=()=>{i.abort(r.reason)};r&&r.addEventListener(`abort`,o,{once:!0});let s=setTimeout(()=>{i.abort(new ox(`Timed out after ${t} ms`))},t);try{return yield e(a)}finally{clearTimeout(s),r?.removeEventListener(`abort`,o)}})}function dx(e,t={}){let{signal:n}=t;return new Promise((t,r)=>{if(n!=null&&n.aborted){r(lx(n.reason));return}let i=setTimeout(()=>{n?.removeEventListener(`abort`,a),t()},e),a=()=>{clearTimeout(i),n?.removeEventListener(`abort`,a),r(lx(n?.reason))};n?.addEventListener(`abort`,a,{once:!0})})}function fx(e,t=()=>!0){let n=(...r)=>tx(null,null,function*(){try{return yield e(...r)}catch(e){if(yield t(e))return n(...r);throw e}});return n}function px(e,t){return tx(this,null,function*(){let n=e[`~standard`].validate(t);if(n instanceof Promise&&(n=yield n),n.issues)throw new sx(n,t);return n.value})}var mx=[`number`,`string`,`datetime`,`date`,`format-string`,`yes-no`,`boolean`,`json`,`duration`],hx=ix({getRootUrl:()=>`/${document.querySelector(`meta[name="x-basename"]`)?.getAttribute(`content`)}/api`,headers:{"X-CSRF-Token":document.querySelector(`meta[name="csrf-token"]`)?.getAttribute(`content`)??``}});async function gx(){return hx(`/tables`)}async function _x(e,t,n,r,i){let a=new URLSearchParams;for(let e of t)a.append(`order`,e);return a.append(`limit`,n.toString()),a.append(`page`,r.toString()),i&&a.append(`search`,i),hx(`/tables/${e}?${a.toString()}`)}async function vx(e,t){return hx(`/tables/${e}/${t}`)}async function yx(e,t){return hx(`/tables/${e}/${t}`,{method:`DELETE`})}async function bx(e,t){return hx(`/tables/${e}`,{method:`POST`,body:JSON.stringify(t)})}async function xx(e,t,n){return hx(`/tables/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)})}async function Sx(e,t){return hx(`/tables/${e}/suggestions/${t}`)}function Cx(){let e=(0,ea.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`database`],queryFn:wx},e[0]=t):t=e[0],Ub(t)}async function wx(){let e=await gx(),t=[],n={};for(let r of e.jsonData?.tables??[])t.push(r.tableName),n[r.tableName]=r;return{tableIds:t,tables:n,rowCounts:e.jsonData?.rowCounts??{},databaseName:e.jsonData?.databaseName??`unknown`}}function Tx(e,t){let n=(0,ea.c)(17),{order:r,limit:i,page:a,search:o}=t,s;n[0]!==i||n[1]!==r||n[2]!==a||n[3]!==o?(s={order:r,limit:i,page:a,search:o},n[0]=i,n[1]=r,n[2]=a,n[3]=o,n[4]=s):s=n[4];let c;n[5]!==s||n[6]!==e?(c=[`tables`,e,s],n[5]=s,n[6]=e,n[7]=c):c=n[7];let l;n[8]!==i||n[9]!==r||n[10]!==a||n[11]!==o||n[12]!==e?(l=()=>_x(e,r,i,a,o).then(Ex),n[8]=i,n[9]=r,n[10]=a,n[11]=o,n[12]=e,n[13]=l):l=n[13];let u;return n[14]!==c||n[15]!==l?(u={queryKey:c,queryFn:l},n[14]=c,n[15]=l,n[16]=u):u=n[16],Ub(u)}function Ex(e){return e.jsonData}function Dx(e){let t=(0,ea.c)(11),n=Eb(),r=g_(),i;t[0]===e?i=t[1]:(i=async t=>{let{pk:n,data:r}=t;return n==null?bx(e,r):xx(e,n,r)},t[0]=e,t[1]=i);let a;t[2]!==n||t[3]!==e?(a=()=>{n.invalidateQueries({queryKey:[`tables`,e]})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;t[5]===r?o=t[6]:(o=()=>{r({title:`Failed to update row`,description:``,intent:`error`})},t[5]=r,t[6]=o);let s;return t[7]!==i||t[8]!==a||t[9]!==o?(s={mutationFn:i,onSuccess:a,onError:o},t[7]=i,t[8]=a,t[9]=o,t[10]=s):s=t[10],Wb(s)}function Ox(e){let t=(0,ea.c)(11),n=Eb(),r=g_(),i;t[0]===e?i=t[1]:(i=t=>yx(e,t),t[0]=e,t[1]=i);let a;t[2]!==n||t[3]!==e?(a=()=>{n.invalidateQueries({queryKey:[`tables`,e]})},t[2]=n,t[3]=e,t[4]=a):a=t[4];let o;t[5]===r?o=t[6]:(o=()=>{r({title:`Failed to delete row`,description:``,intent:`error`})},t[5]=r,t[6]=o);let s;return t[7]!==i||t[8]!==a||t[9]!==o?(s={mutationFn:i,onSuccess:a,onError:o},t[7]=i,t[8]=a,t[9]=o,t[10]=s):s=t[10],Wb(s)}function kx(e,t){let n=(0,ea.c)(3),r;return n[0]!==t||n[1]!==e?(r={queryKey:[`tables`,e,`rows`,t],queryFn:()=>t==null?{}:vx(e,t).then(Ax)},n[0]=t,n[1]=e,n[2]=r):r=n[2],Ub(r)}function Ax(e){return e.jsonData}function jx(e,t){let n=(0,ea.c)(3),r;return n[0]!==t||n[1]!==e?(r={queryKey:[`foreign-key-options`,e,t],queryFn:()=>Sx(e,t).then(Mx)},n[0]=t,n[1]=e,n[2]=r):r=n[2],Hb(r)}function Mx(e){return e.jsonData}var Nx=e=>e.name?String(e.name):e.title?String(e.title):e.slug?String(e.slug):JSON.stringify(e);function Px(e){let t=(0,ea.c)(16),n=e.schema.$bitiforms?.widgetProps,r;t[0]===n?r=t[1]:(r=n||{},t[0]=n,t[1]=r);let{foreignTable:i,foreignColumn:a}=r,{data:o}=jx(i,a),s;t[2]===o?s=t[3]:(s=o===void 0?[]:o,t[2]=o,t[3]=s);let c=s,l=e.value||``,u;t[4]===l?u=t[5]:(u=l.toString(),t[4]=l,t[5]=u);let d=u,f=e.schema.title,p=e.schema.description,m;t[6]===e?m=t[7]:(m=t=>{e.onChange({target:{name:e.name,value:Number(t.target.value)}})},t[6]=e,t[7]=m);let h;t[8]===c?h=t[9]:(h=c.map(Fx),t[8]=c,t[9]=h);let g;return t[10]!==e.schema.description||t[11]!==e.schema.title||t[12]!==d||t[13]!==m||t[14]!==h?(g=(0,L.jsx)(bg,{label:f,hint:p,value:d,onChange:m,children:h}),t[10]=e.schema.description,t[11]=e.schema.title,t[12]=d,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function Fx(e){return(0,L.jsxs)(`option`,{value:String(e.id),children:[String(e.id),`: `,Nx(e)]},String(e.id))}var Ix=uo({colors:{primary:`#2a2f3b`}}),Lx=new wb({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}}),Rx={...hy,ForeignKeyWidget:Px};function zx(e){let t=(0,ea.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,L.jsx)(x.StrictMode,{children:(0,L.jsx)(Xh,{children:(0,L.jsx)(W_,{widgets:Rx,children:(0,L.jsx)(Db,{client:Lx,children:(0,L.jsx)(z,{theme:Ix,children:(0,L.jsx)(h_,{children:n})})})})})}),t[0]=n,t[1]=r),r}var Bx=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Vx=(e=>e?Bx(e):Bx),Hx=e=>e;function Ux(e,t=Hx){let n=x.useSyncExternalStore(e.subscribe,x.useCallback(()=>t(e.getState()),[e,t]),x.useCallback(()=>t(e.getInitialState()),[e,t]));return x.useDebugValue(n),n}var Wx=e=>!!e.dispatchFromDevtools&&typeof e.dispatch==`function`,Gx=new Map,Kx=e=>{let t=Gx.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},qx=(e,t,n)=>{if(e===void 0)return{type:`untracked`,connection:t.connect(n)};let r=Gx.get(n.name);if(r)return{type:`tracked`,store:e,...r};let i={connection:t.connect(n),stores:{}};return Gx.set(n.name,i),{type:`tracked`,store:e,...i}},Jx=(e,t)=>{if(t===void 0)return;let n=Gx.get(e);n&&(delete n.stores[t],Object.keys(n.stores).length===0&&Gx.delete(e))},Yx=e=>{if(!e)return;let t=e.split(`
|
|
14
14
|
`),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return/.+ (.+) .+/.exec(r)?.[1]},Xx=(e,t={})=>(n,r,i)=>{let{enabled:a,anonymousActionType:o,store:s,...c}=t,l;try{l=(a??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return e(n,r,i);let{connection:u,...d}=qx(s,l,c),f=!0;i.setState=((e,t,a)=>{let l=n(e,t);if(!f)return l;let d=a===void 0?{type:o||Yx(Error().stack)||`anonymous`}:typeof a==`string`?{type:a}:a;return s===void 0?(u?.send(d,r()),l):(u?.send({...d,type:`${s}/${d.type}`},{...Kx(c.name),[s]:i.getState()}),l)}),i.devtools={cleanup:()=>{u&&typeof u.unsubscribe==`function`&&u.unsubscribe(),Jx(c.name,s)}};let p=(...e)=>{let t=f;f=!1,n(...e),f=t},m=e(i.setState,r,i);if(d.type===`untracked`?u?.init(m):(d.stores[d.store]=i,u?.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?m:t.getState()])))),Wx(i)){let e=i.dispatch;i.dispatch=(...t)=>{e(...t)}}return u.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return Zx(e.payload,e=>{if(e.type===`__setState`){if(s===void 0){p(e.state);return}Object.keys(e.state).length!==1&&console.error(`
|
|
15
15
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
16
16
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devmoods/postgres-admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@devmoods/fetch": "^4.3.0",
|
|
19
19
|
"@devmoods/ui": "^2.16.0",
|
|
20
|
-
"@tanstack/react-query": "^5.
|
|
20
|
+
"@tanstack/react-query": "^5.99.0",
|
|
21
21
|
"arktype": "^2.2.0",
|
|
22
22
|
"date-fns": "^4.1.0",
|
|
23
23
|
"pg-structure": "^7.15.3",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"react-dom": "^19.2.5",
|
|
26
26
|
"react-fast-compare": "^3.2.2",
|
|
27
27
|
"react-icons": "^5.6.0",
|
|
28
|
-
"react-router": "^7.14.
|
|
28
|
+
"react-router": "^7.14.1",
|
|
29
29
|
"zustand": "^5.0.12"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@devmoods/config": "0.2.
|
|
33
|
-
"@devmoods/express-extras": "0.
|
|
32
|
+
"@devmoods/config": "0.2.3",
|
|
33
|
+
"@devmoods/express-extras": "0.73.0",
|
|
34
34
|
"@types/react": "^19.2.14",
|
|
35
35
|
"@types/react-dom": "^19.2.3",
|
|
36
36
|
"@vitejs/plugin-react": "^6.0.1",
|
|
37
|
-
"@vitest/coverage-v8": "^4.1.
|
|
37
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
38
38
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
39
|
-
"dotenv": "^17.4.
|
|
39
|
+
"dotenv": "^17.4.2",
|
|
40
40
|
"sass": "^1.99.0",
|
|
41
41
|
"tsup": "^8.5.1",
|
|
42
42
|
"vite": "^8.0.8"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "ea4f51756aca98bd050cf98128bf4d4b3da1bf38"
|
|
45
45
|
}
|