tmex-cli 0.3.0 → 0.3.1

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.
Files changed (20) hide show
  1. package/dist/runtime/server.js +25 -17
  2. package/package.json +1 -1
  3. package/resources/fe-dist/assets/DevicePage-BTbDSWYN.js +26 -0
  4. package/resources/fe-dist/assets/DevicePage-BTbDSWYN.js.map +1 -0
  5. package/resources/fe-dist/assets/{DevicesPage-BTB6mlBW.js → DevicesPage-C76Xejy5.js} +2 -2
  6. package/resources/fe-dist/assets/{DevicesPage-BTB6mlBW.js.map → DevicesPage-C76Xejy5.js.map} +1 -1
  7. package/resources/fe-dist/assets/{SettingsPage-BDVq_Akt.js → SettingsPage-DQ9W4fOo.js} +2 -2
  8. package/resources/fe-dist/assets/{SettingsPage-BDVq_Akt.js.map → SettingsPage-DQ9W4fOo.js.map} +1 -1
  9. package/resources/fe-dist/assets/{index-Chps0Pui.js → index-Bmahx5fj.js} +21 -21
  10. package/resources/fe-dist/assets/index-Bmahx5fj.js.map +1 -0
  11. package/resources/fe-dist/assets/{select-7tfuDWw3.js → select-Wn7lKWHQ.js} +2 -2
  12. package/resources/fe-dist/assets/{select-7tfuDWw3.js.map → select-Wn7lKWHQ.js.map} +1 -1
  13. package/resources/fe-dist/assets/{switch-CNHRGb7-.js → switch-JVIhfemP.js} +2 -2
  14. package/resources/fe-dist/assets/{switch-CNHRGb7-.js.map → switch-JVIhfemP.js.map} +1 -1
  15. package/resources/fe-dist/assets/{useValueChanged-Bi_NzPTr.js → useValueChanged-DU---PIl.js} +2 -2
  16. package/resources/fe-dist/assets/{useValueChanged-Bi_NzPTr.js.map → useValueChanged-DU---PIl.js.map} +1 -1
  17. package/resources/fe-dist/index.html +1 -1
  18. package/resources/fe-dist/assets/DevicePage-BE5Hlzny.js +0 -26
  19. package/resources/fe-dist/assets/DevicePage-BE5Hlzny.js.map +0 -1
  20. package/resources/fe-dist/assets/index-Chps0Pui.js.map +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-BDVq_Akt.js","assets/select-7tfuDWw3.js","assets/useValueChanged-Bi_NzPTr.js","assets/switch-CNHRGb7-.js","assets/DevicesPage-BTB6mlBW.js","assets/DevicePage-BE5Hlzny.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-DQ9W4fOo.js","assets/select-Wn7lKWHQ.js","assets/useValueChanged-DU---PIl.js","assets/switch-JVIhfemP.js","assets/DevicesPage-C76Xejy5.js","assets/DevicePage-BTbDSWYN.js"])))=>i.map(i=>d[i]);
2
2
  var Nz=Object.defineProperty;var W1=o=>{throw TypeError(o)};var Mz=(o,n,a)=>n in o?Nz(o,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):o[n]=a;var We=(o,n,a)=>Mz(o,typeof n!="symbol"?n+"":n,a),Wv=(o,n,a)=>n.has(o)||W1("Cannot "+a);var ee=(o,n,a)=>(Wv(o,n,"read from private field"),a?a.call(o):n.get(o)),lt=(o,n,a)=>n.has(o)?W1("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,a),Be=(o,n,a,s)=>(Wv(o,n,"write to private field"),s?s.call(o,a):n.set(o,a),a),Bt=(o,n,a)=>(Wv(o,n,"access private method"),a);var dm=(o,n,a,s)=>({set _(l){Be(o,n,l,a)},get _(){return ee(o,n,s)}});function _z(o,n){for(var a=0;a<n.length;a++){const s=n[a];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in o)){const c=Object.getOwnPropertyDescriptor(s,l);c&&Object.defineProperty(o,l,c.get?c:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function a(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=a(l);fetch(l.href,c)}})();const kz="modulepreload",Lz=function(o){return"/"+o},K1={},CS=function(n,a,s){let l=Promise.resolve();if(a&&a.length>0){let f=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),g=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));l=f(a.map(m=>{if(m=Lz(m),m in K1)return;K1[m]=!0;const b=m.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${p}`))return;const v=document.createElement("link");if(v.rel=b?"stylesheet":kz,b||(v.as="script"),v.crossOrigin="",v.href=m,g&&v.setAttribute("nonce",g),document.head.appendChild(v),b)return new Promise((w,E)=>{v.addEventListener("load",w),v.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${m}`)))})}))}function c(f){const h=new Event("vite:preloadError",{cancelable:!0});if(h.payload=f,window.dispatchEvent(h),!h.defaultPrevented)throw f}return l.then(f=>{for(const h of f||[])h.status==="rejected"&&c(h.reason);return n().catch(c)})};function UA(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Kv={exports:{}},fm={},Jv={exports:{}},hf={exports:{}};hf.exports;var J1;function Uz(){return J1||(J1=1,(function(o,n){/**
3
3
  * @license React
4
4
  * react.development.js
@@ -7,7 +7,7 @@ var Nz=Object.defineProperty;var W1=o=>{throw TypeError(o)};var Mz=(o,n,a)=>n in
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */(function(){function a(D,G){Object.defineProperty(c.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",G[0],G[1])}})}function s(D){return D===null||typeof D!="object"?null:(D=he&&D[he]||D["@@iterator"],typeof D=="function"?D:null)}function l(D,G){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var ge=D+"."+G;we[ge]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",G,D),we[ge]=!0)}function c(D,G,ge){this.props=D,this.context=G,this.refs=Re,this.updater=ge||De}function f(){}function h(D,G,ge){this.props=D,this.context=G,this.refs=Re,this.updater=ge||De}function g(){}function m(D){return""+D}function b(D){try{m(D);var G=!1}catch{G=!0}if(G){G=console;var ge=G.error,ye=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ge.call(G,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ye),m(D)}}function p(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===tt?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case L:return"Fragment";case ae:return"Profiler";case ce:return"StrictMode";case ve:return"Suspense";case ze:return"SuspenseList";case xe:return"Activity"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case pe:return"Portal";case Te:return D.displayName||"Context";case me:return(D._context.displayName||"Context")+".Consumer";case Ue:var G=D.render;return D=D.displayName,D||(D=G.displayName||G.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case je:return G=D.displayName||null,G!==null?G:p(D.type)||"Memo";case at:G=D._payload,D=D._init;try{return p(D(G))}catch{}}return null}function v(D){if(D===L)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===at)return"<...>";try{var G=p(D);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function w(){var D=Ce.A;return D===null?null:D.getOwner()}function E(){return Error("react-stack-top-frame")}function T(D){if(ot.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function C(D,G){function ge(){yt||(yt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}ge.isReactWarning=!0,Object.defineProperty(D,"key",{get:ge,configurable:!0})}function A(){var D=p(this.type);return $t[D]||($t[D]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),D=this.props.ref,D!==void 0?D:null}function k(D,G,ge,ye,Ne,$e){var Se=ge.ref;return D={$$typeof:ie,type:D,key:G,props:ge,_owner:ye},(Se!==void 0?Se:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:A}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ne}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$e}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function U(D,G){return G=k(D.type,G,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(G._store.validated=D._store.validated),G}function M(D){Y(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===at&&(D._payload.status==="fulfilled"?Y(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function Y(D){return typeof D=="object"&&D!==null&&D.$$typeof===ie}function $(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ge){return G[ge]})}function _(D,G){return typeof D=="object"&&D!==null&&D.key!=null?(b(D.key),$(""+D.key)):G.toString(36)}function z(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(g,g):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function te(D,G,ge,ye,Ne){var $e=typeof D;($e==="undefined"||$e==="boolean")&&(D=null);var Se=!1;if(D===null)Se=!0;else switch($e){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(D.$$typeof){case ie:case pe:Se=!0;break;case at:return Se=D._init,te(Se(D._payload),G,ge,ye,Ne)}}if(Se){Se=D,Ne=Ne(Se);var Ke=ye===""?"."+_(Se,0):ye;return Le(Ne)?(ge="",Ke!=null&&(ge=Ke.replace(Pt,"$&/")+"/"),te(Ne,G,ge,"",function(Rt){return Rt})):Ne!=null&&(Y(Ne)&&(Ne.key!=null&&(Se&&Se.key===Ne.key||b(Ne.key)),ge=U(Ne,ge+(Ne.key==null||Se&&Se.key===Ne.key?"":(""+Ne.key).replace(Pt,"$&/")+"/")+Ke),ye!==""&&Se!=null&&Y(Se)&&Se.key==null&&Se._store&&!Se._store.validated&&(ge._store.validated=2),Ne=ge),G.push(Ne)),1}if(Se=0,Ke=ye===""?".":ye+":",Le(D))for(var Ve=0;Ve<D.length;Ve++)ye=D[Ve],$e=Ke+_(ye,Ve),Se+=te(ye,G,ge,$e,Ne);else if(Ve=s(D),typeof Ve=="function")for(Ve===D.entries&&(bt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),bt=!0),D=Ve.call(D),Ve=0;!(ye=D.next()).done;)ye=ye.value,$e=Ke+_(ye,Ve++),Se+=te(ye,G,ge,$e,Ne);else if($e==="object"){if(typeof D.then=="function")return te(z(D),G,ge,ye,Ne);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Se}function H(D,G,ge){if(D==null)return D;var ye=[],Ne=0;return te(D,ye,"","",function($e){return G.call(ge,$e,Ne++)}),ye}function J(D){if(D._status===-1){var G=D._ioInfo;G!=null&&(G.start=G.end=performance.now()),G=D._result;var ge=G();if(ge.then(function(Ne){if(D._status===0||D._status===-1){D._status=1,D._result=Ne;var $e=D._ioInfo;$e!=null&&($e.end=performance.now()),ge.status===void 0&&(ge.status="fulfilled",ge.value=Ne)}},function(Ne){if(D._status===0||D._status===-1){D._status=2,D._result=Ne;var $e=D._ioInfo;$e!=null&&($e.end=performance.now()),ge.status===void 0&&(ge.status="rejected",ge.reason=Ne)}}),G=D._ioInfo,G!=null){G.value=ge;var ye=ge.displayName;typeof ye=="string"&&(G.name=ye)}D._status===-1&&(D._status=0,D._result=ge)}if(D._status===1)return G=D._result,G===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
10
+ */(function(){function a(D,G){Object.defineProperty(c.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",G[0],G[1])}})}function s(D){return D===null||typeof D!="object"?null:(D=he&&D[he]||D["@@iterator"],typeof D=="function"?D:null)}function l(D,G){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var ge=D+"."+G;we[ge]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",G,D),we[ge]=!0)}function c(D,G,ge){this.props=D,this.context=G,this.refs=Re,this.updater=ge||De}function f(){}function h(D,G,ge){this.props=D,this.context=G,this.refs=Re,this.updater=ge||De}function g(){}function m(D){return""+D}function b(D){try{m(D);var G=!1}catch{G=!0}if(G){G=console;var ge=G.error,ye=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return ge.call(G,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ye),m(D)}}function p(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===tt?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case L:return"Fragment";case se:return"Profiler";case ce:return"StrictMode";case ve:return"Suspense";case ze:return"SuspenseList";case xe:return"Activity"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case pe:return"Portal";case Te:return D.displayName||"Context";case me:return(D._context.displayName||"Context")+".Consumer";case Ue:var G=D.render;return D=D.displayName,D||(D=G.displayName||G.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case je:return G=D.displayName||null,G!==null?G:p(D.type)||"Memo";case at:G=D._payload,D=D._init;try{return p(D(G))}catch{}}return null}function v(D){if(D===L)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===at)return"<...>";try{var G=p(D);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function w(){var D=Ce.A;return D===null?null:D.getOwner()}function E(){return Error("react-stack-top-frame")}function T(D){if(ot.call(D,"key")){var G=Object.getOwnPropertyDescriptor(D,"key").get;if(G&&G.isReactWarning)return!1}return D.key!==void 0}function C(D,G){function ge(){yt||(yt=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}ge.isReactWarning=!0,Object.defineProperty(D,"key",{get:ge,configurable:!0})}function A(){var D=p(this.type);return $t[D]||($t[D]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),D=this.props.ref,D!==void 0?D:null}function k(D,G,ge,ye,Ne,$e){var Se=ge.ref;return D={$$typeof:ie,type:D,key:G,props:ge,_owner:ye},(Se!==void 0?Se:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:A}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ne}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$e}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function U(D,G){return G=k(D.type,G,D.props,D._owner,D._debugStack,D._debugTask),D._store&&(G._store.validated=D._store.validated),G}function M(D){Y(D)?D._store&&(D._store.validated=1):typeof D=="object"&&D!==null&&D.$$typeof===at&&(D._payload.status==="fulfilled"?Y(D._payload.value)&&D._payload.value._store&&(D._payload.value._store.validated=1):D._store&&(D._store.validated=1))}function Y(D){return typeof D=="object"&&D!==null&&D.$$typeof===ie}function $(D){var G={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(ge){return G[ge]})}function _(D,G){return typeof D=="object"&&D!==null&&D.key!=null?(b(D.key),$(""+D.key)):G.toString(36)}function z(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(g,g):(D.status="pending",D.then(function(G){D.status==="pending"&&(D.status="fulfilled",D.value=G)},function(G){D.status==="pending"&&(D.status="rejected",D.reason=G)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function te(D,G,ge,ye,Ne){var $e=typeof D;($e==="undefined"||$e==="boolean")&&(D=null);var Se=!1;if(D===null)Se=!0;else switch($e){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(D.$$typeof){case ie:case pe:Se=!0;break;case at:return Se=D._init,te(Se(D._payload),G,ge,ye,Ne)}}if(Se){Se=D,Ne=Ne(Se);var Ke=ye===""?"."+_(Se,0):ye;return Le(Ne)?(ge="",Ke!=null&&(ge=Ke.replace(Pt,"$&/")+"/"),te(Ne,G,ge,"",function(Rt){return Rt})):Ne!=null&&(Y(Ne)&&(Ne.key!=null&&(Se&&Se.key===Ne.key||b(Ne.key)),ge=U(Ne,ge+(Ne.key==null||Se&&Se.key===Ne.key?"":(""+Ne.key).replace(Pt,"$&/")+"/")+Ke),ye!==""&&Se!=null&&Y(Se)&&Se.key==null&&Se._store&&!Se._store.validated&&(ge._store.validated=2),Ne=ge),G.push(Ne)),1}if(Se=0,Ke=ye===""?".":ye+":",Le(D))for(var Ve=0;Ve<D.length;Ve++)ye=D[Ve],$e=Ke+_(ye,Ve),Se+=te(ye,G,ge,$e,Ne);else if(Ve=s(D),typeof Ve=="function")for(Ve===D.entries&&(bt||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),bt=!0),D=Ve.call(D),Ve=0;!(ye=D.next()).done;)ye=ye.value,$e=Ke+_(ye,Ve++),Se+=te(ye,G,ge,$e,Ne);else if($e==="object"){if(typeof D.then=="function")return te(z(D),G,ge,ye,Ne);throw G=String(D),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Se}function H(D,G,ge){if(D==null)return D;var ye=[],Ne=0;return te(D,ye,"","",function($e){return G.call(ge,$e,Ne++)}),ye}function J(D){if(D._status===-1){var G=D._ioInfo;G!=null&&(G.start=G.end=performance.now()),G=D._result;var ge=G();if(ge.then(function(Ne){if(D._status===0||D._status===-1){D._status=1,D._result=Ne;var $e=D._ioInfo;$e!=null&&($e.end=performance.now()),ge.status===void 0&&(ge.status="fulfilled",ge.value=Ne)}},function(Ne){if(D._status===0||D._status===-1){D._status=2,D._result=Ne;var $e=D._ioInfo;$e!=null&&($e.end=performance.now()),ge.status===void 0&&(ge.status="rejected",ge.reason=Ne)}}),G=D._ioInfo,G!=null){G.value=ge;var ye=ge.displayName;typeof ye=="string"&&(G.name=ye)}D._status===-1&&(D._status=0,D._result=ge)}if(D._status===1)return G=D._result,G===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
11
11
 
12
12
  Your code should look like:
13
13
  const MyComponent = lazy(() => import('./MyComponent'))
@@ -19,7 +19,7 @@ Your code should look like:
19
19
  1. You might have mismatching versions of React and the renderer (such as React DOM)
20
20
  2. You might be breaking the Rules of Hooks
21
21
  3. You might have more than one copy of React in the same app
22
- See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),D}function P(){Ce.asyncTransitions--}function ne(D){if(ln===null)try{var G=("require"+Math.random()).slice(0,7);ln=(o&&o[G]).call(o,"timers").setImmediate}catch{ln=function(ye){vn===!1&&(vn=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var Ne=new MessageChannel;Ne.port1.onmessage=ye,Ne.port2.postMessage(void 0)}}return ln(D)}function Z(D){return 1<D.length&&typeof AggregateError=="function"?new AggregateError(D):D[0]}function j(D,G){G!==Zn-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Zn=G}function oe(D,G,ge){var ye=Ce.actQueue;if(ye!==null)if(ye.length!==0)try{I(ye),ne(function(){return oe(D,G,ge)});return}catch(Ne){Ce.thrownErrors.push(Ne)}else Ce.actQueue=null;0<Ce.thrownErrors.length?(ye=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,ge(ye)):G(D)}function I(D){if(!co){co=!0;var G=0;try{for(;G<D.length;G++){var ge=D[G];do{Ce.didUsePromise=!1;var ye=ge(!1);if(ye!==null){if(Ce.didUsePromise){D[G]=ge,D.splice(0,G);return}ge=ye}else break}while(!0)}D.length=0}catch(Ne){D.splice(0,G+1),Ce.thrownErrors.push(Ne)}finally{co=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ie=Symbol.for("react.transitional.element"),pe=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),ce=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),me=Symbol.for("react.consumer"),Te=Symbol.for("react.context"),Ue=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),at=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),he=Symbol.iterator,we={},De={isMounted:function(){return!1},enqueueForceUpdate:function(D){l(D,"forceUpdate")},enqueueReplaceState:function(D){l(D,"replaceState")},enqueueSetState:function(D){l(D,"setState")}},Ye=Object.assign,Re={};Object.freeze(Re),c.prototype.isReactComponent={},c.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},c.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};var Ae={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Un in Ae)Ae.hasOwnProperty(Un)&&a(Un,Ae[Un]);f.prototype=c.prototype,Ae=h.prototype=new f,Ae.constructor=h,Ye(Ae,c.prototype),Ae.isPureReactComponent=!0;var Le=Array.isArray,tt=Symbol.for("react.client.reference"),Ce={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ot=Object.prototype.hasOwnProperty,gt=console.createTask?console.createTask:function(){return null};Ae={react_stack_bottom_frame:function(D){return D()}};var yt,ht,$t={},on=Ae.react_stack_bottom_frame.bind(Ae,E)(),bn=gt(v(E)),bt=!1,Pt=/\/+/g,Ft=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},vn=!1,ln=null,Zn=0,hn=!1,co=!1,uo=typeof queueMicrotask=="function"?function(D){queueMicrotask(function(){return queueMicrotask(D)})}:ne;Ae=Object.freeze({__proto__:null,c:function(D){return N().useMemoCache(D)}});var Un={map:H,forEach:function(D,G,ge){H(D,function(){G.apply(this,arguments)},ge)},count:function(D){var G=0;return H(D,function(){G++}),G},toArray:function(D){return H(D,function(G){return G})||[]},only:function(D){if(!Y(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};n.Activity=xe,n.Children=Un,n.Component=c,n.Fragment=L,n.Profiler=ae,n.PureComponent=h,n.StrictMode=ce,n.Suspense=ve,n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ce,n.__COMPILER_RUNTIME=Ae,n.act=function(D){var G=Ce.actQueue,ge=Zn;Zn++;var ye=Ce.actQueue=G!==null?G:[],Ne=!1;try{var $e=D()}catch(Ve){Ce.thrownErrors.push(Ve)}if(0<Ce.thrownErrors.length)throw j(G,ge),D=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,D;if($e!==null&&typeof $e=="object"&&typeof $e.then=="function"){var Se=$e;return uo(function(){Ne||hn||(hn=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(Ve,Rt){Ne=!0,Se.then(function(Cn){if(j(G,ge),ge===0){try{I(ye),ne(function(){return oe(Cn,Ve,Rt)})}catch(xn){Ce.thrownErrors.push(xn)}if(0<Ce.thrownErrors.length){var rn=Z(Ce.thrownErrors);Ce.thrownErrors.length=0,Rt(rn)}}else Ve(Cn)},function(Cn){j(G,ge),0<Ce.thrownErrors.length&&(Cn=Z(Ce.thrownErrors),Ce.thrownErrors.length=0),Rt(Cn)})}}}var Ke=$e;if(j(G,ge),ge===0&&(I(ye),ye.length!==0&&uo(function(){Ne||hn||(hn=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Ce.actQueue=null),0<Ce.thrownErrors.length)throw D=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,D;return{then:function(Ve,Rt){Ne=!0,ge===0?(Ce.actQueue=ye,ne(function(){return oe(Ke,Ve,Rt)})):Ve(Ke)}}},n.cache=function(D){return function(){return D.apply(null,arguments)}},n.cacheSignal=function(){return null},n.captureOwnerStack=function(){var D=Ce.getCurrentStack;return D===null?null:D()},n.cloneElement=function(D,G,ge){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ye=Ye({},D.props),Ne=D.key,$e=D._owner;if(G!=null){var Se;e:{if(ot.call(G,"ref")&&(Se=Object.getOwnPropertyDescriptor(G,"ref").get)&&Se.isReactWarning){Se=!1;break e}Se=G.ref!==void 0}Se&&($e=w()),T(G)&&(b(G.key),Ne=""+G.key);for(Ke in G)!ot.call(G,Ke)||Ke==="key"||Ke==="__self"||Ke==="__source"||Ke==="ref"&&G.ref===void 0||(ye[Ke]=G[Ke])}var Ke=arguments.length-2;if(Ke===1)ye.children=ge;else if(1<Ke){Se=Array(Ke);for(var Ve=0;Ve<Ke;Ve++)Se[Ve]=arguments[Ve+2];ye.children=Se}for(ye=k(D.type,Ne,ye,$e,D._debugStack,D._debugTask),Ne=2;Ne<arguments.length;Ne++)M(arguments[Ne]);return ye},n.createContext=function(D){return D={$$typeof:Te,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:me,_context:D},D._currentRenderer=null,D._currentRenderer2=null,D},n.createElement=function(D,G,ge){for(var ye=2;ye<arguments.length;ye++)M(arguments[ye]);ye={};var Ne=null;if(G!=null)for(Ve in ht||!("__self"in G)||"key"in G||(ht=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),T(G)&&(b(G.key),Ne=""+G.key),G)ot.call(G,Ve)&&Ve!=="key"&&Ve!=="__self"&&Ve!=="__source"&&(ye[Ve]=G[Ve]);var $e=arguments.length-2;if($e===1)ye.children=ge;else if(1<$e){for(var Se=Array($e),Ke=0;Ke<$e;Ke++)Se[Ke]=arguments[Ke+2];Object.freeze&&Object.freeze(Se),ye.children=Se}if(D&&D.defaultProps)for(Ve in $e=D.defaultProps,$e)ye[Ve]===void 0&&(ye[Ve]=$e[Ve]);Ne&&C(ye,typeof D=="function"?D.displayName||D.name||"Unknown":D);var Ve=1e4>Ce.recentlyCreatedOwnerStacks++;return k(D,Ne,ye,w(),Ve?Error("react-stack-top-frame"):on,Ve?gt(v(D)):bn)},n.createRef=function(){var D={current:null};return Object.seal(D),D},n.forwardRef=function(D){D!=null&&D.$$typeof===je?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof D!="function"?console.error("forwardRef requires a render function but was given %s.",D===null?"null":typeof D):D.length!==0&&D.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",D.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),D!=null&&D.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var G={$$typeof:Ue,render:D},ge;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return ge},set:function(ye){ge=ye,D.name||D.displayName||(Object.defineProperty(D,"name",{value:ye}),D.displayName=ye)}}),G},n.isValidElement=Y,n.lazy=function(D){D={_status:-1,_result:D};var G={$$typeof:at,_payload:D,_init:J},ge={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return D._ioInfo=ge,G._debugInfo=[{awaited:ge}],G},n.memo=function(D,G){D==null&&console.error("memo: The first argument must be a component. Instead received: %s",D===null?"null":typeof D),G={$$typeof:je,type:D,compare:G===void 0?null:G};var ge;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return ge},set:function(ye){ge=ye,D.name||D.displayName||(Object.defineProperty(D,"name",{value:ye}),D.displayName=ye)}}),G},n.startTransition=function(D){var G=Ce.T,ge={};ge._updatedFibers=new Set,Ce.T=ge;try{var ye=D(),Ne=Ce.S;Ne!==null&&Ne(ge,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&(Ce.asyncTransitions++,ye.then(P,P),ye.then(g,Ft))}catch($e){Ft($e)}finally{G===null&&ge._updatedFibers&&(D=ge._updatedFibers.size,ge._updatedFibers.clear(),10<D&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),G!==null&&ge.types!==null&&(G.types!==null&&G.types!==ge.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),G.types=ge.types),Ce.T=G}},n.unstable_useCacheRefresh=function(){return N().useCacheRefresh()},n.use=function(D){return N().use(D)},n.useActionState=function(D,G,ge){return N().useActionState(D,G,ge)},n.useCallback=function(D,G){return N().useCallback(D,G)},n.useContext=function(D){var G=N();return D.$$typeof===me&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),G.useContext(D)},n.useDebugValue=function(D,G){return N().useDebugValue(D,G)},n.useDeferredValue=function(D,G){return N().useDeferredValue(D,G)},n.useEffect=function(D,G){return D==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useEffect(D,G)},n.useEffectEvent=function(D){return N().useEffectEvent(D)},n.useId=function(){return N().useId()},n.useImperativeHandle=function(D,G,ge){return N().useImperativeHandle(D,G,ge)},n.useInsertionEffect=function(D,G){return D==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useInsertionEffect(D,G)},n.useLayoutEffect=function(D,G){return D==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useLayoutEffect(D,G)},n.useMemo=function(D,G){return N().useMemo(D,G)},n.useOptimistic=function(D,G){return N().useOptimistic(D,G)},n.useReducer=function(D,G,ge){return N().useReducer(D,G,ge)},n.useRef=function(D){return N().useRef(D)},n.useState=function(D){return N().useState(D)},n.useSyncExternalStore=function(D,G,ge){return N().useSyncExternalStore(D,G,ge)},n.useTransition=function(){return N().useTransition()},n.version="19.2.4",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(hf,hf.exports)),hf.exports}var Z1;function Gl(){return Z1||(Z1=1,Jv.exports=Uz()),Jv.exports}var eO;function zz(){if(eO)return fm;eO=1;/**
22
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),D}function P(){Ce.asyncTransitions--}function ne(D){if(ln===null)try{var G=("require"+Math.random()).slice(0,7);ln=(o&&o[G]).call(o,"timers").setImmediate}catch{ln=function(ye){vn===!1&&(vn=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var Ne=new MessageChannel;Ne.port1.onmessage=ye,Ne.port2.postMessage(void 0)}}return ln(D)}function Z(D){return 1<D.length&&typeof AggregateError=="function"?new AggregateError(D):D[0]}function j(D,G){G!==Zn-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),Zn=G}function oe(D,G,ge){var ye=Ce.actQueue;if(ye!==null)if(ye.length!==0)try{I(ye),ne(function(){return oe(D,G,ge)});return}catch(Ne){Ce.thrownErrors.push(Ne)}else Ce.actQueue=null;0<Ce.thrownErrors.length?(ye=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,ge(ye)):G(D)}function I(D){if(!co){co=!0;var G=0;try{for(;G<D.length;G++){var ge=D[G];do{Ce.didUsePromise=!1;var ye=ge(!1);if(ye!==null){if(Ce.didUsePromise){D[G]=ge,D.splice(0,G);return}ge=ye}else break}while(!0)}D.length=0}catch(Ne){D.splice(0,G+1),Ce.thrownErrors.push(Ne)}finally{co=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var ie=Symbol.for("react.transitional.element"),pe=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),ce=Symbol.for("react.strict_mode"),se=Symbol.for("react.profiler"),me=Symbol.for("react.consumer"),Te=Symbol.for("react.context"),Ue=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),at=Symbol.for("react.lazy"),xe=Symbol.for("react.activity"),he=Symbol.iterator,we={},De={isMounted:function(){return!1},enqueueForceUpdate:function(D){l(D,"forceUpdate")},enqueueReplaceState:function(D){l(D,"replaceState")},enqueueSetState:function(D){l(D,"setState")}},Ye=Object.assign,Re={};Object.freeze(Re),c.prototype.isReactComponent={},c.prototype.setState=function(D,G){if(typeof D!="object"&&typeof D!="function"&&D!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,D,G,"setState")},c.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};var Ae={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(Un in Ae)Ae.hasOwnProperty(Un)&&a(Un,Ae[Un]);f.prototype=c.prototype,Ae=h.prototype=new f,Ae.constructor=h,Ye(Ae,c.prototype),Ae.isPureReactComponent=!0;var Le=Array.isArray,tt=Symbol.for("react.client.reference"),Ce={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ot=Object.prototype.hasOwnProperty,gt=console.createTask?console.createTask:function(){return null};Ae={react_stack_bottom_frame:function(D){return D()}};var yt,ht,$t={},on=Ae.react_stack_bottom_frame.bind(Ae,E)(),bn=gt(v(E)),bt=!1,Pt=/\/+/g,Ft=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},vn=!1,ln=null,Zn=0,hn=!1,co=!1,uo=typeof queueMicrotask=="function"?function(D){queueMicrotask(function(){return queueMicrotask(D)})}:ne;Ae=Object.freeze({__proto__:null,c:function(D){return N().useMemoCache(D)}});var Un={map:H,forEach:function(D,G,ge){H(D,function(){G.apply(this,arguments)},ge)},count:function(D){var G=0;return H(D,function(){G++}),G},toArray:function(D){return H(D,function(G){return G})||[]},only:function(D){if(!Y(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};n.Activity=xe,n.Children=Un,n.Component=c,n.Fragment=L,n.Profiler=se,n.PureComponent=h,n.StrictMode=ce,n.Suspense=ve,n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Ce,n.__COMPILER_RUNTIME=Ae,n.act=function(D){var G=Ce.actQueue,ge=Zn;Zn++;var ye=Ce.actQueue=G!==null?G:[],Ne=!1;try{var $e=D()}catch(Ve){Ce.thrownErrors.push(Ve)}if(0<Ce.thrownErrors.length)throw j(G,ge),D=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,D;if($e!==null&&typeof $e=="object"&&typeof $e.then=="function"){var Se=$e;return uo(function(){Ne||hn||(hn=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(Ve,Rt){Ne=!0,Se.then(function(Cn){if(j(G,ge),ge===0){try{I(ye),ne(function(){return oe(Cn,Ve,Rt)})}catch(xn){Ce.thrownErrors.push(xn)}if(0<Ce.thrownErrors.length){var rn=Z(Ce.thrownErrors);Ce.thrownErrors.length=0,Rt(rn)}}else Ve(Cn)},function(Cn){j(G,ge),0<Ce.thrownErrors.length&&(Cn=Z(Ce.thrownErrors),Ce.thrownErrors.length=0),Rt(Cn)})}}}var Ke=$e;if(j(G,ge),ge===0&&(I(ye),ye.length!==0&&uo(function(){Ne||hn||(hn=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Ce.actQueue=null),0<Ce.thrownErrors.length)throw D=Z(Ce.thrownErrors),Ce.thrownErrors.length=0,D;return{then:function(Ve,Rt){Ne=!0,ge===0?(Ce.actQueue=ye,ne(function(){return oe(Ke,Ve,Rt)})):Ve(Ke)}}},n.cache=function(D){return function(){return D.apply(null,arguments)}},n.cacheSignal=function(){return null},n.captureOwnerStack=function(){var D=Ce.getCurrentStack;return D===null?null:D()},n.cloneElement=function(D,G,ge){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ye=Ye({},D.props),Ne=D.key,$e=D._owner;if(G!=null){var Se;e:{if(ot.call(G,"ref")&&(Se=Object.getOwnPropertyDescriptor(G,"ref").get)&&Se.isReactWarning){Se=!1;break e}Se=G.ref!==void 0}Se&&($e=w()),T(G)&&(b(G.key),Ne=""+G.key);for(Ke in G)!ot.call(G,Ke)||Ke==="key"||Ke==="__self"||Ke==="__source"||Ke==="ref"&&G.ref===void 0||(ye[Ke]=G[Ke])}var Ke=arguments.length-2;if(Ke===1)ye.children=ge;else if(1<Ke){Se=Array(Ke);for(var Ve=0;Ve<Ke;Ve++)Se[Ve]=arguments[Ve+2];ye.children=Se}for(ye=k(D.type,Ne,ye,$e,D._debugStack,D._debugTask),Ne=2;Ne<arguments.length;Ne++)M(arguments[Ne]);return ye},n.createContext=function(D){return D={$$typeof:Te,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:me,_context:D},D._currentRenderer=null,D._currentRenderer2=null,D},n.createElement=function(D,G,ge){for(var ye=2;ye<arguments.length;ye++)M(arguments[ye]);ye={};var Ne=null;if(G!=null)for(Ve in ht||!("__self"in G)||"key"in G||(ht=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),T(G)&&(b(G.key),Ne=""+G.key),G)ot.call(G,Ve)&&Ve!=="key"&&Ve!=="__self"&&Ve!=="__source"&&(ye[Ve]=G[Ve]);var $e=arguments.length-2;if($e===1)ye.children=ge;else if(1<$e){for(var Se=Array($e),Ke=0;Ke<$e;Ke++)Se[Ke]=arguments[Ke+2];Object.freeze&&Object.freeze(Se),ye.children=Se}if(D&&D.defaultProps)for(Ve in $e=D.defaultProps,$e)ye[Ve]===void 0&&(ye[Ve]=$e[Ve]);Ne&&C(ye,typeof D=="function"?D.displayName||D.name||"Unknown":D);var Ve=1e4>Ce.recentlyCreatedOwnerStacks++;return k(D,Ne,ye,w(),Ve?Error("react-stack-top-frame"):on,Ve?gt(v(D)):bn)},n.createRef=function(){var D={current:null};return Object.seal(D),D},n.forwardRef=function(D){D!=null&&D.$$typeof===je?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof D!="function"?console.error("forwardRef requires a render function but was given %s.",D===null?"null":typeof D):D.length!==0&&D.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",D.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),D!=null&&D.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var G={$$typeof:Ue,render:D},ge;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return ge},set:function(ye){ge=ye,D.name||D.displayName||(Object.defineProperty(D,"name",{value:ye}),D.displayName=ye)}}),G},n.isValidElement=Y,n.lazy=function(D){D={_status:-1,_result:D};var G={$$typeof:at,_payload:D,_init:J},ge={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return D._ioInfo=ge,G._debugInfo=[{awaited:ge}],G},n.memo=function(D,G){D==null&&console.error("memo: The first argument must be a component. Instead received: %s",D===null?"null":typeof D),G={$$typeof:je,type:D,compare:G===void 0?null:G};var ge;return Object.defineProperty(G,"displayName",{enumerable:!1,configurable:!0,get:function(){return ge},set:function(ye){ge=ye,D.name||D.displayName||(Object.defineProperty(D,"name",{value:ye}),D.displayName=ye)}}),G},n.startTransition=function(D){var G=Ce.T,ge={};ge._updatedFibers=new Set,Ce.T=ge;try{var ye=D(),Ne=Ce.S;Ne!==null&&Ne(ge,ye),typeof ye=="object"&&ye!==null&&typeof ye.then=="function"&&(Ce.asyncTransitions++,ye.then(P,P),ye.then(g,Ft))}catch($e){Ft($e)}finally{G===null&&ge._updatedFibers&&(D=ge._updatedFibers.size,ge._updatedFibers.clear(),10<D&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),G!==null&&ge.types!==null&&(G.types!==null&&G.types!==ge.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),G.types=ge.types),Ce.T=G}},n.unstable_useCacheRefresh=function(){return N().useCacheRefresh()},n.use=function(D){return N().use(D)},n.useActionState=function(D,G,ge){return N().useActionState(D,G,ge)},n.useCallback=function(D,G){return N().useCallback(D,G)},n.useContext=function(D){var G=N();return D.$$typeof===me&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),G.useContext(D)},n.useDebugValue=function(D,G){return N().useDebugValue(D,G)},n.useDeferredValue=function(D,G){return N().useDeferredValue(D,G)},n.useEffect=function(D,G){return D==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useEffect(D,G)},n.useEffectEvent=function(D){return N().useEffectEvent(D)},n.useId=function(){return N().useId()},n.useImperativeHandle=function(D,G,ge){return N().useImperativeHandle(D,G,ge)},n.useInsertionEffect=function(D,G){return D==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useInsertionEffect(D,G)},n.useLayoutEffect=function(D,G){return D==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),N().useLayoutEffect(D,G)},n.useMemo=function(D,G){return N().useMemo(D,G)},n.useOptimistic=function(D,G){return N().useOptimistic(D,G)},n.useReducer=function(D,G,ge){return N().useReducer(D,G,ge)},n.useRef=function(D){return N().useRef(D)},n.useState=function(D){return N().useState(D)},n.useSyncExternalStore=function(D,G,ge){return N().useSyncExternalStore(D,G,ge)},n.useTransition=function(){return N().useTransition()},n.version="19.2.4",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(hf,hf.exports)),hf.exports}var Z1;function Gl(){return Z1||(Z1=1,Jv.exports=Uz()),Jv.exports}var eO;function zz(){if(eO)return fm;eO=1;/**
23
23
  * @license React
24
24
  * react-jsx-dev-runtime.development.js
25
25
  *
@@ -27,12 +27,12 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
27
27
  *
28
28
  * This source code is licensed under the MIT license found in the
29
29
  * LICENSE file in the root directory of this source tree.
30
- */return(function(){function o(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===J?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case C:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case T:return"Portal";case M:return L.displayName||"Context";case U:return(L._context.displayName||"Context")+".Consumer";case Y:var ce=L.render;return L=L.displayName,L||(L=ce.displayName||ce.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case z:return ce=L.displayName||null,ce!==null?ce:o(L.type)||"Memo";case te:ce=L._payload,L=L._init;try{return o(L(ce))}catch{}}return null}function n(L){return""+L}function a(L){try{n(L);var ce=!1}catch{ce=!0}if(ce){ce=console;var ae=ce.error,me=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return ae.call(ce,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",me),n(L)}}function s(L){if(L===C)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===te)return"<...>";try{var ce=o(L);return ce?"<"+ce+">":"<...>"}catch{return"<...>"}}function l(){var L=N.A;return L===null?null:L.getOwner()}function c(){return Error("react-stack-top-frame")}function f(L){if(P.call(L,"key")){var ce=Object.getOwnPropertyDescriptor(L,"key").get;if(ce&&ce.isReactWarning)return!1}return L.key!==void 0}function h(L,ce){function ae(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ce))}ae.isReactWarning=!0,Object.defineProperty(L,"key",{get:ae,configurable:!0})}function g(){var L=o(this.type);return oe[L]||(oe[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function m(L,ce,ae,me,Te,Ue){var ve=ae.ref;return L={$$typeof:E,type:L,key:ce,props:ae,_owner:me},(ve!==void 0?ve:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:g}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Te}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function b(L,ce,ae,me,Te,Ue){var ve=ce.children;if(ve!==void 0)if(me)if(ne(ve)){for(me=0;me<ve.length;me++)p(ve[me]);Object.freeze&&Object.freeze(ve)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(ve);if(P.call(ce,"key")){ve=o(L);var ze=Object.keys(ce).filter(function(at){return at!=="key"});me=0<ze.length?"{key: someKey, "+ze.join(": ..., ")+": ...}":"{key: someKey}",pe[ve+me]||(ze=0<ze.length?"{"+ze.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
30
+ */return(function(){function o(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===J?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case C:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case T:return"Portal";case M:return L.displayName||"Context";case U:return(L._context.displayName||"Context")+".Consumer";case Y:var ce=L.render;return L=L.displayName,L||(L=ce.displayName||ce.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case z:return ce=L.displayName||null,ce!==null?ce:o(L.type)||"Memo";case te:ce=L._payload,L=L._init;try{return o(L(ce))}catch{}}return null}function n(L){return""+L}function a(L){try{n(L);var ce=!1}catch{ce=!0}if(ce){ce=console;var se=ce.error,me=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return se.call(ce,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",me),n(L)}}function s(L){if(L===C)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===te)return"<...>";try{var ce=o(L);return ce?"<"+ce+">":"<...>"}catch{return"<...>"}}function l(){var L=N.A;return L===null?null:L.getOwner()}function c(){return Error("react-stack-top-frame")}function f(L){if(P.call(L,"key")){var ce=Object.getOwnPropertyDescriptor(L,"key").get;if(ce&&ce.isReactWarning)return!1}return L.key!==void 0}function h(L,ce){function se(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ce))}se.isReactWarning=!0,Object.defineProperty(L,"key",{get:se,configurable:!0})}function g(){var L=o(this.type);return oe[L]||(oe[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function m(L,ce,se,me,Te,Ue){var ve=se.ref;return L={$$typeof:E,type:L,key:ce,props:se,_owner:me},(ve!==void 0?ve:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:g}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Te}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function b(L,ce,se,me,Te,Ue){var ve=ce.children;if(ve!==void 0)if(me)if(ne(ve)){for(me=0;me<ve.length;me++)p(ve[me]);Object.freeze&&Object.freeze(ve)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(ve);if(P.call(ce,"key")){ve=o(L);var ze=Object.keys(ce).filter(function(at){return at!=="key"});me=0<ze.length?"{key: someKey, "+ze.join(": ..., ")+": ...}":"{key: someKey}",pe[ve+me]||(ze=0<ze.length?"{"+ze.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
31
31
  let props = %s;
32
32
  <%s {...props} />
33
33
  React keys must be passed directly to JSX without using spread:
34
34
  let props = %s;
35
- <%s key={someKey} {...props} />`,me,ve,ze,ve),pe[ve+me]=!0)}if(ve=null,ae!==void 0&&(a(ae),ve=""+ae),f(ce)&&(a(ce.key),ve=""+ce.key),"key"in ce){ae={};for(var je in ce)je!=="key"&&(ae[je]=ce[je])}else ae=ce;return ve&&h(ae,typeof L=="function"?L.displayName||L.name||"Unknown":L),m(L,ve,ae,l(),Te,Ue)}function p(L){v(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===te&&(L._payload.status==="fulfilled"?v(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function v(L){return typeof L=="object"&&L!==null&&L.$$typeof===E}var w=Gl(),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),M=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),N=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,ne=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(L){return L()}};var j,oe={},I=w.react_stack_bottom_frame.bind(w,c)(),ie=Z(s(c)),pe={};fm.Fragment=C,fm.jsxDEV=function(L,ce,ae,me){var Te=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,ae,me,Te?Error("react-stack-top-frame"):I,Te?Z(s(L)):ie)}})(),fm}var tO;function jz(){return tO||(tO=1,Kv.exports=zz()),Kv.exports}var re=jz(),Vf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(o){return this.listeners.add(o),this.onSubscribe(),()=>{this.listeners.delete(o),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pz={setTimeout:(o,n)=>setTimeout(o,n),clearTimeout:o=>clearTimeout(o),setInterval:(o,n)=>setInterval(o,n),clearInterval:o=>clearInterval(o)},_a,_l,TA,Hz=(TA=class{constructor(){lt(this,_a,Pz);lt(this,_l,!1)}setTimeoutProvider(o){ee(this,_l)&&o!==ee(this,_a)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:ee(this,_a),provider:o}),Be(this,_a,o),Be(this,_l,!1)}setTimeout(o,n){return Be(this,_l,!0),ee(this,_a).setTimeout(o,n)}clearTimeout(o){ee(this,_a).clearTimeout(o)}setInterval(o,n){return Be(this,_l,!0),ee(this,_a).setInterval(o,n)}clearInterval(o){ee(this,_a).clearInterval(o)}},_a=new WeakMap,_l=new WeakMap,TA),Al=new Hz;function Iz(o){setTimeout(o,0)}var Fl=typeof window>"u"||"Deno"in globalThis;function $o(){}function Bz(o,n){return typeof o=="function"?o(n):o}function z0(o){return typeof o=="number"&&o>=0&&o!==1/0}function zA(o,n){return Math.max(o+(n||0)-Date.now(),0)}function ki(o,n){return typeof o=="function"?o(n):o}function kr(o,n){return typeof o=="function"?o(n):o}function nO(o,n){const{type:a="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=o;if(f){if(s){if(n.queryHash!==OS(f,n.options))return!1}else if(!Tf(n.queryKey,f))return!1}if(a!=="all"){const g=n.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof h=="boolean"&&n.isStale()!==h||l&&l!==n.state.fetchStatus||c&&!c(n))}function oO(o,n){const{exact:a,status:s,predicate:l,mutationKey:c}=o;if(c){if(!n.options.mutationKey)return!1;if(a){if(Rf(n.options.mutationKey)!==Rf(c))return!1}else if(!Tf(n.options.mutationKey,c))return!1}return!(s&&n.state.status!==s||l&&!l(n))}function OS(o,n){return((n==null?void 0:n.queryKeyHashFn)||Rf)(o)}function Rf(o){return JSON.stringify(o,(n,a)=>H0(a)?Object.keys(a).sort().reduce((s,l)=>(s[l]=a[l],s),{}):a)}function Tf(o,n){return o===n?!0:typeof o!=typeof n?!1:o&&n&&typeof o=="object"&&typeof n=="object"?Object.keys(n).every(a=>Tf(o[a],n[a])):!1}var Vz=Object.prototype.hasOwnProperty;function j0(o,n,a=0){if(o===n)return o;if(a>500)return n;const s=rO(o)&&rO(n);if(!s&&!(H0(o)&&H0(n)))return n;const c=(s?o:Object.keys(o)).length,f=s?n:Object.keys(n),h=f.length,g=s?new Array(h):{};let m=0;for(let b=0;b<h;b++){const p=s?b:f[b],v=o[p],w=n[p];if(v===w){g[p]=v,(s?b<c:Vz.call(o,p))&&m++;continue}if(v===null||w===null||typeof v!="object"||typeof w!="object"){g[p]=w;continue}const E=j0(v,w,a+1);g[p]=E,E===v&&m++}return c===h&&m===c?o:g}function P0(o,n){if(!n||Object.keys(o).length!==Object.keys(n).length)return!1;for(const a in o)if(o[a]!==n[a])return!1;return!0}function rO(o){return Array.isArray(o)&&o.length===Object.keys(o).length}function H0(o){if(!aO(o))return!1;const n=o.constructor;if(n===void 0)return!0;const a=n.prototype;return!(!aO(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(o)!==Object.prototype)}function aO(o){return Object.prototype.toString.call(o)==="[object Object]"}function Fz(o){return new Promise(n=>{Al.setTimeout(n,o)})}function I0(o,n,a){if(typeof a.structuralSharing=="function")return a.structuralSharing(o,n);if(a.structuralSharing!==!1){try{return j0(o,n)}catch(s){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${a.queryHash}]: ${s}`),s}return j0(o,n)}return n}function Yz(o,n,a=0){const s=[...o,n];return a&&s.length>a?s.slice(1):s}function $z(o,n,a=0){const s=[n,...o];return a&&s.length>a?s.slice(0,-1):s}var Im=Symbol();function jA(o,n){return o.queryFn===Im&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${o.queryHash}'`),!o.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!o.queryFn||o.queryFn===Im?()=>Promise.reject(new Error(`Missing queryFn: '${o.queryHash}'`)):o.queryFn}function PA(o,n){return typeof o=="function"?o(...n):!!o}function qz(o,n,a){let s=!1,l;return Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(l??(l=n()),s||(s=!0,l.aborted?a():l.addEventListener("abort",a,{once:!0})),l)}),o}var kl,xi,su,CA,Gz=(CA=class extends Vf{constructor(){super();lt(this,kl);lt(this,xi);lt(this,su);Be(this,su,n=>{if(!Fl&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){ee(this,xi)||this.setEventListener(ee(this,su))}onUnsubscribe(){var n;this.hasListeners()||((n=ee(this,xi))==null||n.call(this),Be(this,xi,void 0))}setEventListener(n){var a;Be(this,su,n),(a=ee(this,xi))==null||a.call(this),Be(this,xi,n(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(n){ee(this,kl)!==n&&(Be(this,kl,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){var n;return typeof ee(this,kl)=="boolean"?ee(this,kl):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},kl=new WeakMap,xi=new WeakMap,su=new WeakMap,CA),DS=new Gz;function B0(){let o,n;const a=new Promise((l,c)=>{o=l,n=c});a.status="pending",a.catch(()=>{});function s(l){Object.assign(a,l),delete a.resolve,delete a.reject}return a.resolve=l=>{s({status:"fulfilled",value:l}),o(l)},a.reject=l=>{s({status:"rejected",reason:l}),n(l)},a}var Xz=Iz;function Qz(){let o=[],n=0,a=h=>{h()},s=h=>{h()},l=Xz;const c=h=>{n?o.push(h):l(()=>{a(h)})},f=()=>{const h=o;o=[],h.length&&l(()=>{s(()=>{h.forEach(g=>{a(g)})})})};return{batch:h=>{let g;n++;try{g=h()}finally{n--,n||f()}return g},batchCalls:h=>(...g)=>{c(()=>{h(...g)})},schedule:c,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var yo=Qz(),iu,Ri,lu,OA,Wz=(OA=class extends Vf{constructor(){super();lt(this,iu,!0);lt(this,Ri);lt(this,lu);Be(this,lu,n=>{if(!Fl&&window.addEventListener){const a=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",s)}}})}onSubscribe(){ee(this,Ri)||this.setEventListener(ee(this,lu))}onUnsubscribe(){var n;this.hasListeners()||((n=ee(this,Ri))==null||n.call(this),Be(this,Ri,void 0))}setEventListener(n){var a;Be(this,lu,n),(a=ee(this,Ri))==null||a.call(this),Be(this,Ri,n(this.setOnline.bind(this)))}setOnline(n){ee(this,iu)!==n&&(Be(this,iu,n),this.listeners.forEach(s=>{s(n)}))}isOnline(){return ee(this,iu)}},iu=new WeakMap,Ri=new WeakMap,lu=new WeakMap,OA),Bm=new Wz;function Kz(o){return Math.min(1e3*2**o,3e4)}function HA(o){return(o??"online")==="online"?Bm.isOnline():!0}var V0=class extends Error{constructor(o){super("CancelledError"),this.revert=o==null?void 0:o.revert,this.silent=o==null?void 0:o.silent}};function IA(o){let n=!1,a=0,s;const l=B0(),c=()=>l.status!=="pending",f=T=>{var C;if(!c()){const A=new V0(T);v(A),(C=o.onCancel)==null||C.call(o,A)}},h=()=>{n=!0},g=()=>{n=!1},m=()=>DS.isFocused()&&(o.networkMode==="always"||Bm.isOnline())&&o.canRun(),b=()=>HA(o.networkMode)&&o.canRun(),p=T=>{c()||(s==null||s(),l.resolve(T))},v=T=>{c()||(s==null||s(),l.reject(T))},w=()=>new Promise(T=>{var C;s=A=>{(c()||m())&&T(A)},(C=o.onPause)==null||C.call(o)}).then(()=>{var T;s=void 0,c()||(T=o.onContinue)==null||T.call(o)}),E=()=>{if(c())return;let T;const C=a===0?o.initialPromise:void 0;try{T=C??o.fn()}catch(A){T=Promise.reject(A)}Promise.resolve(T).then(p).catch(A=>{var $;if(c())return;const k=o.retry??(Fl?0:3),U=o.retryDelay??Kz,M=typeof U=="function"?U(a,A):U,Y=k===!0||typeof k=="number"&&a<k||typeof k=="function"&&k(a,A);if(n||!Y){v(A);return}a++,($=o.onFail)==null||$.call(o,a,A),Fz(M).then(()=>m()?void 0:w()).then(()=>{n?v(A):E()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s==null||s(),l),cancelRetry:h,continueRetry:g,canStart:b,start:()=>(b()?E():w().then(E),l)}}var Ll,DA,BA=(DA=class{constructor(){lt(this,Ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),z0(this.gcTime)&&Be(this,Ll,Al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(o){this.gcTime=Math.max(this.gcTime||0,o??(Fl?1/0:300*1e3))}clearGcTimeout(){ee(this,Ll)&&(Al.clearTimeout(ee(this,Ll)),Be(this,Ll,void 0))}},Ll=new WeakMap,DA),Ul,cu,Mr,zl,io,jf,jl,Kr,vs,AA,Jz=(AA=class extends BA{constructor(n){super();lt(this,Kr);lt(this,Ul);lt(this,cu);lt(this,Mr);lt(this,zl);lt(this,io);lt(this,jf);lt(this,jl);Be(this,jl,!1),Be(this,jf,n.defaultOptions),this.setOptions(n.options),this.observers=[],Be(this,zl,n.client),Be(this,Mr,ee(this,zl).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Be(this,Ul,iO(this.options)),this.state=n.state??ee(this,Ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=ee(this,io))==null?void 0:n.promise}setOptions(n){if(this.options={...ee(this,jf),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=iO(this.options);a.data!==void 0&&(this.setState(sO(a.data,a.dataUpdatedAt)),Be(this,Ul,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ee(this,Mr).remove(this)}setData(n,a){const s=I0(this.state.data,n,this.options);return Bt(this,Kr,vs).call(this,{data:s,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),s}setState(n,a){Bt(this,Kr,vs).call(this,{type:"setState",state:n,setStateOptions:a})}cancel(n){var s,l;const a=(s=ee(this,io))==null?void 0:s.promise;return(l=ee(this,io))==null||l.cancel(n),a?a.then($o).catch($o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,Ul))}isActive(){return this.observers.some(n=>kr(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>ki(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!zA(this.state.dataUpdatedAt,n)}onFocus(){var a;const n=this.observers.find(s=>s.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(a=ee(this,io))==null||a.continue()}onOnline(){var a;const n=this.observers.find(s=>s.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(a=ee(this,io))==null||a.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ee(this,Mr).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(ee(this,io)&&(ee(this,jl)?ee(this,io).cancel({revert:!0}):ee(this,io).cancelRetry()),this.scheduleGc()),ee(this,Mr).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Kr,vs).call(this,{type:"invalidate"})}async fetch(n,a){var g,m,b,p,v,w,E,T,C,A,k,U;if(this.state.fetchStatus!=="idle"&&((g=ee(this,io))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(ee(this,io))return ee(this,io).continueRetry(),ee(this,io).promise}if(n&&this.setOptions(n),!this.options.queryFn){const M=this.observers.find(Y=>Y.options.queryFn);M&&this.setOptions(M.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const s=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Be(this,jl,!0),s.signal)})},c=()=>{const M=jA(this.options,a),$=(()=>{const _={client:ee(this,zl),queryKey:this.queryKey,meta:this.meta};return l(_),_})();return Be(this,jl,!1),this.options.persister?this.options.persister(M,$,this):M($)},h=(()=>{const M={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:ee(this,zl),state:this.state,fetchFn:c};return l(M),M})();(m=this.options.behavior)==null||m.onFetch(h,this),Be(this,cu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&Bt(this,Kr,vs).call(this,{type:"fetch",meta:(p=h.fetchOptions)==null?void 0:p.meta}),Be(this,io,IA({initialPromise:a==null?void 0:a.initialPromise,fn:h.fetchFn,onCancel:M=>{M instanceof V0&&M.revert&&this.setState({...ee(this,cu),fetchStatus:"idle"}),s.abort()},onFail:(M,Y)=>{Bt(this,Kr,vs).call(this,{type:"failed",failureCount:M,error:Y})},onPause:()=>{Bt(this,Kr,vs).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Kr,vs).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const M=await ee(this,io).start();if(M===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(v=ee(this,Mr).config).onSuccess)==null||w.call(v,M,this),(T=(E=ee(this,Mr).config).onSettled)==null||T.call(E,M,this.state.error,this),M}catch(M){if(M instanceof V0){if(M.silent)return ee(this,io).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Bt(this,Kr,vs).call(this,{type:"error",error:M}),(A=(C=ee(this,Mr).config).onError)==null||A.call(C,M,this),(U=(k=ee(this,Mr).config).onSettled)==null||U.call(k,this.state.data,M,this),M}finally{this.scheduleGc()}}},Ul=new WeakMap,cu=new WeakMap,Mr=new WeakMap,zl=new WeakMap,io=new WeakMap,jf=new WeakMap,jl=new WeakMap,Kr=new WeakSet,vs=function(n){const a=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...VA(s.data,this.options),fetchMeta:n.meta??null};case"success":const l={...s,...sO(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Be(this,cu,n.manual?l:void 0),l;case"error":const c=n.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=a(this.state),yo.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),ee(this,Mr).notify({query:this,type:"updated",action:n})})},AA);function VA(o,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HA(n.networkMode)?"fetching":"paused",...o===void 0&&{error:null,status:"pending"}}}function sO(o,n){return{data:o,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function iO(o){const n=typeof o.initialData=="function"?o.initialData():o.initialData,a=n!==void 0,s=a?typeof o.initialDataUpdatedAt=="function"?o.initialDataUpdatedAt():o.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:a?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Fo,Vt,Pf,Uo,Pl,uu,Rs,Ti,Hf,du,fu,Hl,Il,Ci,hu,Jt,pf,F0,Y0,$0,q0,G0,X0,Q0,FA,NA,Zz=(NA=class extends Vf{constructor(n,a){super();lt(this,Jt);lt(this,Fo);lt(this,Vt);lt(this,Pf);lt(this,Uo);lt(this,Pl);lt(this,uu);lt(this,Rs);lt(this,Ti);lt(this,Hf);lt(this,du);lt(this,fu);lt(this,Hl);lt(this,Il);lt(this,Ci);lt(this,hu,new Set);this.options=a,Be(this,Fo,n),Be(this,Ti,null),Be(this,Rs,B0()),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Vt).addObserver(this),lO(ee(this,Vt),this.options)?Bt(this,Jt,pf).call(this):this.updateResult(),Bt(this,Jt,q0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W0(ee(this,Vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W0(ee(this,Vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Jt,G0).call(this),Bt(this,Jt,X0).call(this),ee(this,Vt).removeObserver(this)}setOptions(n){const a=this.options,s=ee(this,Vt);if(this.options=ee(this,Fo).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,ee(this,Vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,Jt,Q0).call(this),ee(this,Vt).setOptions(this.options),a._defaulted&&!P0(this.options,a)&&ee(this,Fo).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Vt),observer:this});const l=this.hasListeners();l&&cO(ee(this,Vt),s,this.options,a)&&Bt(this,Jt,pf).call(this),this.updateResult(),l&&(ee(this,Vt)!==s||kr(this.options.enabled,ee(this,Vt))!==kr(a.enabled,ee(this,Vt))||ki(this.options.staleTime,ee(this,Vt))!==ki(a.staleTime,ee(this,Vt)))&&Bt(this,Jt,F0).call(this);const c=Bt(this,Jt,Y0).call(this);l&&(ee(this,Vt)!==s||kr(this.options.enabled,ee(this,Vt))!==kr(a.enabled,ee(this,Vt))||c!==ee(this,Ci))&&Bt(this,Jt,$0).call(this,c)}getOptimisticResult(n){const a=ee(this,Fo).getQueryCache().build(ee(this,Fo),n),s=this.createResult(a,n);return t3(this,s)&&(Be(this,Uo,s),Be(this,uu,this.options),Be(this,Pl,ee(this,Vt).state)),s}getCurrentResult(){return ee(this,Uo)}trackResult(n,a){return new Proxy(n,{get:(s,l)=>(this.trackProp(l),a==null||a(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ee(this,Rs).status==="pending"&&ee(this,Rs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(n){ee(this,hu).add(n)}getCurrentQuery(){return ee(this,Vt)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=ee(this,Fo).defaultQueryOptions(n),s=ee(this,Fo).getQueryCache().build(ee(this,Fo),a);return s.fetch().then(()=>this.createResult(s,a))}fetch(n){return Bt(this,Jt,pf).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Uo)))}createResult(n,a){var te;const s=ee(this,Vt),l=this.options,c=ee(this,Uo),f=ee(this,Pl),h=ee(this,uu),m=n!==s?n.state:ee(this,Pf),{state:b}=n;let p={...b},v=!1,w;if(a._optimisticResults){const H=this.hasListeners(),J=!H&&lO(n,a),N=H&&cO(n,s,a,l);(J||N)&&(p={...p,...VA(b.data,n.options)}),a._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:E,errorUpdatedAt:T,status:C}=p;w=p.data;let A=!1;if(a.placeholderData!==void 0&&w===void 0&&C==="pending"){let H;c!=null&&c.isPlaceholderData&&a.placeholderData===(h==null?void 0:h.placeholderData)?(H=c.data,A=!0):H=typeof a.placeholderData=="function"?a.placeholderData((te=ee(this,fu))==null?void 0:te.state.data,ee(this,fu)):a.placeholderData,H!==void 0&&(C="success",w=I0(c==null?void 0:c.data,H,a),v=!0)}if(a.select&&w!==void 0&&!A)if(c&&w===(f==null?void 0:f.data)&&a.select===ee(this,Hf))w=ee(this,du);else try{Be(this,Hf,a.select),w=a.select(w),w=I0(c==null?void 0:c.data,w,a),Be(this,du,w),Be(this,Ti,null)}catch(H){Be(this,Ti,H)}ee(this,Ti)&&(E=ee(this,Ti),w=ee(this,du),T=Date.now(),C="error");const k=p.fetchStatus==="fetching",U=C==="pending",M=C==="error",Y=U&&k,$=w!==void 0,z={status:C,fetchStatus:p.fetchStatus,isPending:U,isSuccess:C==="success",isError:M,isInitialLoading:Y,isLoading:Y,data:w,dataUpdatedAt:p.dataUpdatedAt,error:E,errorUpdatedAt:T,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!U,isLoadingError:M&&!$,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:M&&$,isStale:AS(n,a),refetch:this.refetch,promise:ee(this,Rs),isEnabled:kr(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const H=z.data!==void 0,J=z.status==="error"&&!H,N=Z=>{J?Z.reject(z.error):H&&Z.resolve(z.data)},P=()=>{const Z=Be(this,Rs,z.promise=B0());N(Z)},ne=ee(this,Rs);switch(ne.status){case"pending":n.queryHash===s.queryHash&&N(ne);break;case"fulfilled":(J||z.data!==ne.value)&&P();break;case"rejected":(!J||z.error!==ne.reason)&&P();break}}return z}updateResult(){const n=ee(this,Uo),a=this.createResult(ee(this,Vt),this.options);if(Be(this,Pl,ee(this,Vt).state),Be(this,uu,this.options),ee(this,Pl).data!==void 0&&Be(this,fu,ee(this,Vt)),P0(a,n))return;Be(this,Uo,a);const s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!ee(this,hu).size)return!0;const f=new Set(c??ee(this,hu));return this.options.throwOnError&&f.add("error"),Object.keys(ee(this,Uo)).some(h=>{const g=h;return ee(this,Uo)[g]!==n[g]&&f.has(g)})};Bt(this,Jt,FA).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Jt,q0).call(this)}},Fo=new WeakMap,Vt=new WeakMap,Pf=new WeakMap,Uo=new WeakMap,Pl=new WeakMap,uu=new WeakMap,Rs=new WeakMap,Ti=new WeakMap,Hf=new WeakMap,du=new WeakMap,fu=new WeakMap,Hl=new WeakMap,Il=new WeakMap,Ci=new WeakMap,hu=new WeakMap,Jt=new WeakSet,pf=function(n){Bt(this,Jt,Q0).call(this);let a=ee(this,Vt).fetch(this.options,n);return n!=null&&n.throwOnError||(a=a.catch($o)),a},F0=function(){Bt(this,Jt,G0).call(this);const n=ki(this.options.staleTime,ee(this,Vt));if(Fl||ee(this,Uo).isStale||!z0(n))return;const s=zA(ee(this,Uo).dataUpdatedAt,n)+1;Be(this,Hl,Al.setTimeout(()=>{ee(this,Uo).isStale||this.updateResult()},s))},Y0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Vt)):this.options.refetchInterval)??!1},$0=function(n){Bt(this,Jt,X0).call(this),Be(this,Ci,n),!(Fl||kr(this.options.enabled,ee(this,Vt))===!1||!z0(ee(this,Ci))||ee(this,Ci)===0)&&Be(this,Il,Al.setInterval(()=>{(this.options.refetchIntervalInBackground||DS.isFocused())&&Bt(this,Jt,pf).call(this)},ee(this,Ci)))},q0=function(){Bt(this,Jt,F0).call(this),Bt(this,Jt,$0).call(this,Bt(this,Jt,Y0).call(this))},G0=function(){ee(this,Hl)&&(Al.clearTimeout(ee(this,Hl)),Be(this,Hl,void 0))},X0=function(){ee(this,Il)&&(Al.clearInterval(ee(this,Il)),Be(this,Il,void 0))},Q0=function(){const n=ee(this,Fo).getQueryCache().build(ee(this,Fo),this.options);if(n===ee(this,Vt))return;const a=ee(this,Vt);Be(this,Vt,n),Be(this,Pf,n.state),this.hasListeners()&&(a==null||a.removeObserver(this),n.addObserver(this))},FA=function(n){yo.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(ee(this,Uo))}),ee(this,Fo).getQueryCache().notify({query:ee(this,Vt),type:"observerResultsUpdated"})})},NA);function e3(o,n){return kr(n.enabled,o)!==!1&&o.state.data===void 0&&!(o.state.status==="error"&&n.retryOnMount===!1)}function lO(o,n){return e3(o,n)||o.state.data!==void 0&&W0(o,n,n.refetchOnMount)}function W0(o,n,a){if(kr(n.enabled,o)!==!1&&ki(n.staleTime,o)!=="static"){const s=typeof a=="function"?a(o):a;return s==="always"||s!==!1&&AS(o,n)}return!1}function cO(o,n,a,s){return(o!==n||kr(s.enabled,o)===!1)&&(!a.suspense||o.state.status!=="error")&&AS(o,a)}function AS(o,n){return kr(n.enabled,o)!==!1&&o.isStaleByTime(ki(n.staleTime,o))}function t3(o,n){return!P0(o.getCurrentResult(),n)}function uO(o){return{onFetch:(n,a)=>{var b,p,v,w,E;const s=n.options,l=(v=(p=(b=n.fetchOptions)==null?void 0:b.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,c=((w=n.state.data)==null?void 0:w.pages)||[],f=((E=n.state.data)==null?void 0:E.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const m=async()=>{let T=!1;const C=U=>{qz(U,()=>n.signal,()=>T=!0)},A=jA(n.options,n.fetchOptions),k=async(U,M,Y)=>{if(T)return Promise.reject();if(M==null&&U.pages.length)return Promise.resolve(U);const _=(()=>{const J={client:n.client,queryKey:n.queryKey,pageParam:M,direction:Y?"backward":"forward",meta:n.options.meta};return C(J),J})(),z=await A(_),{maxPages:te}=n.options,H=Y?$z:Yz;return{pages:H(U.pages,z,te),pageParams:H(U.pageParams,M,te)}};if(l&&c.length){const U=l==="backward",M=U?n3:dO,Y={pages:c,pageParams:f},$=M(s,Y);h=await k(Y,$,U)}else{const U=o??c.length;do{const M=g===0?f[0]??s.initialPageParam:dO(s,h);if(g>0&&M==null)break;h=await k(h,M),g++}while(g<U)}return h};n.options.persister?n.fetchFn=()=>{var T,C;return(C=(T=n.options).persister)==null?void 0:C.call(T,m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},a)}:n.fetchFn=m}}}function dO(o,{pages:n,pageParams:a}){const s=n.length-1;return n.length>0?o.getNextPageParam(n[s],n,a[s],a):void 0}function n3(o,{pages:n,pageParams:a}){var s;return n.length>0?(s=o.getPreviousPageParam)==null?void 0:s.call(o,n[0],n,a[0],a):void 0}var If,ka,Eo,Bl,La,Si,MA,o3=(MA=class extends BA{constructor(n){super();lt(this,La);lt(this,If);lt(this,ka);lt(this,Eo);lt(this,Bl);Be(this,If,n.client),this.mutationId=n.mutationId,Be(this,Eo,n.mutationCache),Be(this,ka,[]),this.state=n.state||r3(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ee(this,ka).includes(n)||(ee(this,ka).push(n),this.clearGcTimeout(),ee(this,Eo).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Be(this,ka,ee(this,ka).filter(a=>a!==n)),this.scheduleGc(),ee(this,Eo).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ee(this,ka).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Eo).remove(this))}continue(){var n;return((n=ee(this,Bl))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var f,h,g,m,b,p,v,w,E,T,C,A,k,U,M,Y,$,_;const a=()=>{Bt(this,La,Si).call(this,{type:"continue"})},s={client:ee(this,If),meta:this.options.meta,mutationKey:this.options.mutationKey};Be(this,Bl,IA({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(z,te)=>{Bt(this,La,Si).call(this,{type:"failed",failureCount:z,error:te})},onPause:()=>{Bt(this,La,Si).call(this,{type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ee(this,Eo).canRun(this)}));const l=this.state.status==="pending",c=!ee(this,Bl).canStart();try{if(l)a();else{Bt(this,La,Si).call(this,{type:"pending",variables:n,isPaused:c}),ee(this,Eo).config.onMutate&&await ee(this,Eo).config.onMutate(n,this,s);const te=await((h=(f=this.options).onMutate)==null?void 0:h.call(f,n,s));te!==this.state.context&&Bt(this,La,Si).call(this,{type:"pending",context:te,variables:n,isPaused:c})}const z=await ee(this,Bl).start();return await((m=(g=ee(this,Eo).config).onSuccess)==null?void 0:m.call(g,z,n,this.state.context,this,s)),await((p=(b=this.options).onSuccess)==null?void 0:p.call(b,z,n,this.state.context,s)),await((w=(v=ee(this,Eo).config).onSettled)==null?void 0:w.call(v,z,null,this.state.variables,this.state.context,this,s)),await((T=(E=this.options).onSettled)==null?void 0:T.call(E,z,null,n,this.state.context,s)),Bt(this,La,Si).call(this,{type:"success",data:z}),z}catch(z){try{await((A=(C=ee(this,Eo).config).onError)==null?void 0:A.call(C,z,n,this.state.context,this,s))}catch(te){Promise.reject(te)}try{await((U=(k=this.options).onError)==null?void 0:U.call(k,z,n,this.state.context,s))}catch(te){Promise.reject(te)}try{await((Y=(M=ee(this,Eo).config).onSettled)==null?void 0:Y.call(M,void 0,z,this.state.variables,this.state.context,this,s))}catch(te){Promise.reject(te)}try{await((_=($=this.options).onSettled)==null?void 0:_.call($,void 0,z,n,this.state.context,s))}catch(te){Promise.reject(te)}throw Bt(this,La,Si).call(this,{type:"error",error:z}),z}finally{ee(this,Eo).runNext(this)}}},If=new WeakMap,ka=new WeakMap,Eo=new WeakMap,Bl=new WeakMap,La=new WeakSet,Si=function(n){const a=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),yo.batch(()=>{ee(this,ka).forEach(s=>{s.onMutationUpdate(n)}),ee(this,Eo).notify({mutation:this,type:"updated",action:n})})},MA);function r3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ts,Jr,Bf,_A,a3=(_A=class extends Vf{constructor(n={}){super();lt(this,Ts);lt(this,Jr);lt(this,Bf);this.config=n,Be(this,Ts,new Set),Be(this,Jr,new Map),Be(this,Bf,0)}build(n,a,s){const l=new o3({client:n,mutationCache:this,mutationId:++dm(this,Bf)._,options:n.defaultMutationOptions(a),state:s});return this.add(l),l}add(n){ee(this,Ts).add(n);const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a);s?s.push(n):ee(this,Jr).set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ee(this,Ts).delete(n)){const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a);if(s)if(s.length>1){const l=s.indexOf(n);l!==-1&&s.splice(l,1)}else s[0]===n&&ee(this,Jr).delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a),l=s==null?void 0:s.find(c=>c.state.status==="pending");return!l||l===n}else return!0}runNext(n){var s;const a=hm(n);if(typeof a=="string"){const l=(s=ee(this,Jr).get(a))==null?void 0:s.find(c=>c!==n&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yo.batch(()=>{ee(this,Ts).forEach(n=>{this.notify({type:"removed",mutation:n})}),ee(this,Ts).clear(),ee(this,Jr).clear()})}getAll(){return Array.from(ee(this,Ts))}find(n){const a={exact:!0,...n};return this.getAll().find(s=>oO(a,s))}findAll(n={}){return this.getAll().filter(a=>oO(n,a))}notify(n){yo.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return yo.batch(()=>Promise.all(n.map(a=>a.continue().catch($o))))}},Ts=new WeakMap,Jr=new WeakMap,Bf=new WeakMap,_A);function hm(o){var n;return(n=o.options.scope)==null?void 0:n.id}var Ua,kA,s3=(kA=class extends Vf{constructor(n={}){super();lt(this,Ua);this.config=n,Be(this,Ua,new Map)}build(n,a,s){const l=a.queryKey,c=a.queryHash??OS(l,a);let f=this.get(c);return f||(f=new Jz({client:n,queryKey:l,queryHash:c,options:n.defaultQueryOptions(a),state:s,defaultOptions:n.getQueryDefaults(l)}),this.add(f)),f}add(n){ee(this,Ua).has(n.queryHash)||(ee(this,Ua).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=ee(this,Ua).get(n.queryHash);a&&(n.destroy(),a===n&&ee(this,Ua).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){yo.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ee(this,Ua).get(n)}getAll(){return[...ee(this,Ua).values()]}find(n){const a={exact:!0,...n};return this.getAll().find(s=>nO(a,s))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(s=>nO(n,s)):a}notify(n){yo.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){yo.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){yo.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ua=new WeakMap,kA),An,Oi,Di,pu,mu,Ai,gu,yu,LA,i3=(LA=class{constructor(o={}){lt(this,An);lt(this,Oi);lt(this,Di);lt(this,pu);lt(this,mu);lt(this,Ai);lt(this,gu);lt(this,yu);Be(this,An,o.queryCache||new s3),Be(this,Oi,o.mutationCache||new a3),Be(this,Di,o.defaultOptions||{}),Be(this,pu,new Map),Be(this,mu,new Map),Be(this,Ai,0)}mount(){dm(this,Ai)._++,ee(this,Ai)===1&&(Be(this,gu,DS.subscribe(async o=>{o&&(await this.resumePausedMutations(),ee(this,An).onFocus())})),Be(this,yu,Bm.subscribe(async o=>{o&&(await this.resumePausedMutations(),ee(this,An).onOnline())})))}unmount(){var o,n;dm(this,Ai)._--,ee(this,Ai)===0&&((o=ee(this,gu))==null||o.call(this),Be(this,gu,void 0),(n=ee(this,yu))==null||n.call(this),Be(this,yu,void 0))}isFetching(o){return ee(this,An).findAll({...o,fetchStatus:"fetching"}).length}isMutating(o){return ee(this,Oi).findAll({...o,status:"pending"}).length}getQueryData(o){var a;const n=this.defaultQueryOptions({queryKey:o});return(a=ee(this,An).get(n.queryHash))==null?void 0:a.state.data}ensureQueryData(o){const n=this.defaultQueryOptions(o),a=ee(this,An).build(this,n),s=a.state.data;return s===void 0?this.fetchQuery(o):(o.revalidateIfStale&&a.isStaleByTime(ki(n.staleTime,a))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(o){return ee(this,An).findAll(o).map(({queryKey:n,state:a})=>{const s=a.data;return[n,s]})}setQueryData(o,n,a){const s=this.defaultQueryOptions({queryKey:o}),l=ee(this,An).get(s.queryHash),c=l==null?void 0:l.state.data,f=Bz(n,c);if(f!==void 0)return ee(this,An).build(this,s).setData(f,{...a,manual:!0})}setQueriesData(o,n,a){return yo.batch(()=>ee(this,An).findAll(o).map(({queryKey:s})=>[s,this.setQueryData(s,n,a)]))}getQueryState(o){var a;const n=this.defaultQueryOptions({queryKey:o});return(a=ee(this,An).get(n.queryHash))==null?void 0:a.state}removeQueries(o){const n=ee(this,An);yo.batch(()=>{n.findAll(o).forEach(a=>{n.remove(a)})})}resetQueries(o,n){const a=ee(this,An);return yo.batch(()=>(a.findAll(o).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...o},n)))}cancelQueries(o,n={}){const a={revert:!0,...n},s=yo.batch(()=>ee(this,An).findAll(o).map(l=>l.cancel(a)));return Promise.all(s).then($o).catch($o)}invalidateQueries(o,n={}){return yo.batch(()=>(ee(this,An).findAll(o).forEach(a=>{a.invalidate()}),(o==null?void 0:o.refetchType)==="none"?Promise.resolve():this.refetchQueries({...o,type:(o==null?void 0:o.refetchType)??(o==null?void 0:o.type)??"active"},n)))}refetchQueries(o,n={}){const a={...n,cancelRefetch:n.cancelRefetch??!0},s=yo.batch(()=>ee(this,An).findAll(o).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,a);return a.throwOnError||(c=c.catch($o)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then($o)}fetchQuery(o){const n=this.defaultQueryOptions(o);n.retry===void 0&&(n.retry=!1);const a=ee(this,An).build(this,n);return a.isStaleByTime(ki(n.staleTime,a))?a.fetch(n):Promise.resolve(a.state.data)}prefetchQuery(o){return this.fetchQuery(o).then($o).catch($o)}fetchInfiniteQuery(o){return o.behavior=uO(o.pages),this.fetchQuery(o)}prefetchInfiniteQuery(o){return this.fetchInfiniteQuery(o).then($o).catch($o)}ensureInfiniteQueryData(o){return o.behavior=uO(o.pages),this.ensureQueryData(o)}resumePausedMutations(){return Bm.isOnline()?ee(this,Oi).resumePausedMutations():Promise.resolve()}getQueryCache(){return ee(this,An)}getMutationCache(){return ee(this,Oi)}getDefaultOptions(){return ee(this,Di)}setDefaultOptions(o){Be(this,Di,o)}setQueryDefaults(o,n){ee(this,pu).set(Rf(o),{queryKey:o,defaultOptions:n})}getQueryDefaults(o){const n=[...ee(this,pu).values()],a={};return n.forEach(s=>{Tf(o,s.queryKey)&&Object.assign(a,s.defaultOptions)}),a}setMutationDefaults(o,n){ee(this,mu).set(Rf(o),{mutationKey:o,defaultOptions:n})}getMutationDefaults(o){const n=[...ee(this,mu).values()],a={};return n.forEach(s=>{Tf(o,s.mutationKey)&&Object.assign(a,s.defaultOptions)}),a}defaultQueryOptions(o){if(o._defaulted)return o;const n={...ee(this,Di).queries,...this.getQueryDefaults(o.queryKey),...o,_defaulted:!0};return n.queryHash||(n.queryHash=OS(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Im&&(n.enabled=!1),n}defaultMutationOptions(o){return o!=null&&o._defaulted?o:{...ee(this,Di).mutations,...(o==null?void 0:o.mutationKey)&&this.getMutationDefaults(o.mutationKey),...o,_defaulted:!0}}clear(){ee(this,An).clear(),ee(this,Oi).clear()}},An=new WeakMap,Oi=new WeakMap,Di=new WeakMap,pu=new WeakMap,mu=new WeakMap,Ai=new WeakMap,gu=new WeakMap,yu=new WeakMap,LA),x=Gl();const _e=UA(x),NS=_z({__proto__:null,default:_e},[x]);var Zv={exports:{}},nf={},fO;function l3(){if(fO)return nf;fO=1;/**
35
+ <%s key={someKey} {...props} />`,me,ve,ze,ve),pe[ve+me]=!0)}if(ve=null,se!==void 0&&(a(se),ve=""+se),f(ce)&&(a(ce.key),ve=""+ce.key),"key"in ce){se={};for(var je in ce)je!=="key"&&(se[je]=ce[je])}else se=ce;return ve&&h(se,typeof L=="function"?L.displayName||L.name||"Unknown":L),m(L,ve,se,l(),Te,Ue)}function p(L){v(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===te&&(L._payload.status==="fulfilled"?v(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function v(L){return typeof L=="object"&&L!==null&&L.$$typeof===E}var w=Gl(),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),M=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),N=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,ne=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(L){return L()}};var j,oe={},I=w.react_stack_bottom_frame.bind(w,c)(),ie=Z(s(c)),pe={};fm.Fragment=C,fm.jsxDEV=function(L,ce,se,me){var Te=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,se,me,Te?Error("react-stack-top-frame"):I,Te?Z(s(L)):ie)}})(),fm}var tO;function jz(){return tO||(tO=1,Kv.exports=zz()),Kv.exports}var re=jz(),Vf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(o){return this.listeners.add(o),this.onSubscribe(),()=>{this.listeners.delete(o),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pz={setTimeout:(o,n)=>setTimeout(o,n),clearTimeout:o=>clearTimeout(o),setInterval:(o,n)=>setInterval(o,n),clearInterval:o=>clearInterval(o)},_a,_l,TA,Hz=(TA=class{constructor(){lt(this,_a,Pz);lt(this,_l,!1)}setTimeoutProvider(o){ee(this,_l)&&o!==ee(this,_a)&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:ee(this,_a),provider:o}),Be(this,_a,o),Be(this,_l,!1)}setTimeout(o,n){return Be(this,_l,!0),ee(this,_a).setTimeout(o,n)}clearTimeout(o){ee(this,_a).clearTimeout(o)}setInterval(o,n){return Be(this,_l,!0),ee(this,_a).setInterval(o,n)}clearInterval(o){ee(this,_a).clearInterval(o)}},_a=new WeakMap,_l=new WeakMap,TA),Al=new Hz;function Iz(o){setTimeout(o,0)}var Fl=typeof window>"u"||"Deno"in globalThis;function $o(){}function Bz(o,n){return typeof o=="function"?o(n):o}function z0(o){return typeof o=="number"&&o>=0&&o!==1/0}function zA(o,n){return Math.max(o+(n||0)-Date.now(),0)}function ki(o,n){return typeof o=="function"?o(n):o}function kr(o,n){return typeof o=="function"?o(n):o}function nO(o,n){const{type:a="all",exact:s,fetchStatus:l,predicate:c,queryKey:f,stale:h}=o;if(f){if(s){if(n.queryHash!==OS(f,n.options))return!1}else if(!Tf(n.queryKey,f))return!1}if(a!=="all"){const g=n.isActive();if(a==="active"&&!g||a==="inactive"&&g)return!1}return!(typeof h=="boolean"&&n.isStale()!==h||l&&l!==n.state.fetchStatus||c&&!c(n))}function oO(o,n){const{exact:a,status:s,predicate:l,mutationKey:c}=o;if(c){if(!n.options.mutationKey)return!1;if(a){if(Rf(n.options.mutationKey)!==Rf(c))return!1}else if(!Tf(n.options.mutationKey,c))return!1}return!(s&&n.state.status!==s||l&&!l(n))}function OS(o,n){return((n==null?void 0:n.queryKeyHashFn)||Rf)(o)}function Rf(o){return JSON.stringify(o,(n,a)=>H0(a)?Object.keys(a).sort().reduce((s,l)=>(s[l]=a[l],s),{}):a)}function Tf(o,n){return o===n?!0:typeof o!=typeof n?!1:o&&n&&typeof o=="object"&&typeof n=="object"?Object.keys(n).every(a=>Tf(o[a],n[a])):!1}var Vz=Object.prototype.hasOwnProperty;function j0(o,n,a=0){if(o===n)return o;if(a>500)return n;const s=rO(o)&&rO(n);if(!s&&!(H0(o)&&H0(n)))return n;const c=(s?o:Object.keys(o)).length,f=s?n:Object.keys(n),h=f.length,g=s?new Array(h):{};let m=0;for(let b=0;b<h;b++){const p=s?b:f[b],v=o[p],w=n[p];if(v===w){g[p]=v,(s?b<c:Vz.call(o,p))&&m++;continue}if(v===null||w===null||typeof v!="object"||typeof w!="object"){g[p]=w;continue}const E=j0(v,w,a+1);g[p]=E,E===v&&m++}return c===h&&m===c?o:g}function P0(o,n){if(!n||Object.keys(o).length!==Object.keys(n).length)return!1;for(const a in o)if(o[a]!==n[a])return!1;return!0}function rO(o){return Array.isArray(o)&&o.length===Object.keys(o).length}function H0(o){if(!aO(o))return!1;const n=o.constructor;if(n===void 0)return!0;const a=n.prototype;return!(!aO(a)||!a.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(o)!==Object.prototype)}function aO(o){return Object.prototype.toString.call(o)==="[object Object]"}function Fz(o){return new Promise(n=>{Al.setTimeout(n,o)})}function I0(o,n,a){if(typeof a.structuralSharing=="function")return a.structuralSharing(o,n);if(a.structuralSharing!==!1){try{return j0(o,n)}catch(s){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${a.queryHash}]: ${s}`),s}return j0(o,n)}return n}function Yz(o,n,a=0){const s=[...o,n];return a&&s.length>a?s.slice(1):s}function $z(o,n,a=0){const s=[n,...o];return a&&s.length>a?s.slice(0,-1):s}var Im=Symbol();function jA(o,n){return o.queryFn===Im&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${o.queryHash}'`),!o.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!o.queryFn||o.queryFn===Im?()=>Promise.reject(new Error(`Missing queryFn: '${o.queryHash}'`)):o.queryFn}function PA(o,n){return typeof o=="function"?o(...n):!!o}function qz(o,n,a){let s=!1,l;return Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(l??(l=n()),s||(s=!0,l.aborted?a():l.addEventListener("abort",a,{once:!0})),l)}),o}var kl,xi,su,CA,Gz=(CA=class extends Vf{constructor(){super();lt(this,kl);lt(this,xi);lt(this,su);Be(this,su,n=>{if(!Fl&&window.addEventListener){const a=()=>n();return window.addEventListener("visibilitychange",a,!1),()=>{window.removeEventListener("visibilitychange",a)}}})}onSubscribe(){ee(this,xi)||this.setEventListener(ee(this,su))}onUnsubscribe(){var n;this.hasListeners()||((n=ee(this,xi))==null||n.call(this),Be(this,xi,void 0))}setEventListener(n){var a;Be(this,su,n),(a=ee(this,xi))==null||a.call(this),Be(this,xi,n(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(n){ee(this,kl)!==n&&(Be(this,kl,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(a=>{a(n)})}isFocused(){var n;return typeof ee(this,kl)=="boolean"?ee(this,kl):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},kl=new WeakMap,xi=new WeakMap,su=new WeakMap,CA),DS=new Gz;function B0(){let o,n;const a=new Promise((l,c)=>{o=l,n=c});a.status="pending",a.catch(()=>{});function s(l){Object.assign(a,l),delete a.resolve,delete a.reject}return a.resolve=l=>{s({status:"fulfilled",value:l}),o(l)},a.reject=l=>{s({status:"rejected",reason:l}),n(l)},a}var Xz=Iz;function Qz(){let o=[],n=0,a=h=>{h()},s=h=>{h()},l=Xz;const c=h=>{n?o.push(h):l(()=>{a(h)})},f=()=>{const h=o;o=[],h.length&&l(()=>{s(()=>{h.forEach(g=>{a(g)})})})};return{batch:h=>{let g;n++;try{g=h()}finally{n--,n||f()}return g},batchCalls:h=>(...g)=>{c(()=>{h(...g)})},schedule:c,setNotifyFunction:h=>{a=h},setBatchNotifyFunction:h=>{s=h},setScheduler:h=>{l=h}}}var yo=Qz(),iu,Ri,lu,OA,Wz=(OA=class extends Vf{constructor(){super();lt(this,iu,!0);lt(this,Ri);lt(this,lu);Be(this,lu,n=>{if(!Fl&&window.addEventListener){const a=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",a),window.removeEventListener("offline",s)}}})}onSubscribe(){ee(this,Ri)||this.setEventListener(ee(this,lu))}onUnsubscribe(){var n;this.hasListeners()||((n=ee(this,Ri))==null||n.call(this),Be(this,Ri,void 0))}setEventListener(n){var a;Be(this,lu,n),(a=ee(this,Ri))==null||a.call(this),Be(this,Ri,n(this.setOnline.bind(this)))}setOnline(n){ee(this,iu)!==n&&(Be(this,iu,n),this.listeners.forEach(s=>{s(n)}))}isOnline(){return ee(this,iu)}},iu=new WeakMap,Ri=new WeakMap,lu=new WeakMap,OA),Bm=new Wz;function Kz(o){return Math.min(1e3*2**o,3e4)}function HA(o){return(o??"online")==="online"?Bm.isOnline():!0}var V0=class extends Error{constructor(o){super("CancelledError"),this.revert=o==null?void 0:o.revert,this.silent=o==null?void 0:o.silent}};function IA(o){let n=!1,a=0,s;const l=B0(),c=()=>l.status!=="pending",f=T=>{var C;if(!c()){const A=new V0(T);v(A),(C=o.onCancel)==null||C.call(o,A)}},h=()=>{n=!0},g=()=>{n=!1},m=()=>DS.isFocused()&&(o.networkMode==="always"||Bm.isOnline())&&o.canRun(),b=()=>HA(o.networkMode)&&o.canRun(),p=T=>{c()||(s==null||s(),l.resolve(T))},v=T=>{c()||(s==null||s(),l.reject(T))},w=()=>new Promise(T=>{var C;s=A=>{(c()||m())&&T(A)},(C=o.onPause)==null||C.call(o)}).then(()=>{var T;s=void 0,c()||(T=o.onContinue)==null||T.call(o)}),E=()=>{if(c())return;let T;const C=a===0?o.initialPromise:void 0;try{T=C??o.fn()}catch(A){T=Promise.reject(A)}Promise.resolve(T).then(p).catch(A=>{var $;if(c())return;const k=o.retry??(Fl?0:3),U=o.retryDelay??Kz,M=typeof U=="function"?U(a,A):U,Y=k===!0||typeof k=="number"&&a<k||typeof k=="function"&&k(a,A);if(n||!Y){v(A);return}a++,($=o.onFail)==null||$.call(o,a,A),Fz(M).then(()=>m()?void 0:w()).then(()=>{n?v(A):E()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(s==null||s(),l),cancelRetry:h,continueRetry:g,canStart:b,start:()=>(b()?E():w().then(E),l)}}var Ll,DA,BA=(DA=class{constructor(){lt(this,Ll)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),z0(this.gcTime)&&Be(this,Ll,Al.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(o){this.gcTime=Math.max(this.gcTime||0,o??(Fl?1/0:300*1e3))}clearGcTimeout(){ee(this,Ll)&&(Al.clearTimeout(ee(this,Ll)),Be(this,Ll,void 0))}},Ll=new WeakMap,DA),Ul,cu,Mr,zl,io,jf,jl,Kr,vs,AA,Jz=(AA=class extends BA{constructor(n){super();lt(this,Kr);lt(this,Ul);lt(this,cu);lt(this,Mr);lt(this,zl);lt(this,io);lt(this,jf);lt(this,jl);Be(this,jl,!1),Be(this,jf,n.defaultOptions),this.setOptions(n.options),this.observers=[],Be(this,zl,n.client),Be(this,Mr,ee(this,zl).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,Be(this,Ul,iO(this.options)),this.state=n.state??ee(this,Ul),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=ee(this,io))==null?void 0:n.promise}setOptions(n){if(this.options={...ee(this,jf),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const a=iO(this.options);a.data!==void 0&&(this.setState(sO(a.data,a.dataUpdatedAt)),Be(this,Ul,a))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ee(this,Mr).remove(this)}setData(n,a){const s=I0(this.state.data,n,this.options);return Bt(this,Kr,vs).call(this,{data:s,type:"success",dataUpdatedAt:a==null?void 0:a.updatedAt,manual:a==null?void 0:a.manual}),s}setState(n,a){Bt(this,Kr,vs).call(this,{type:"setState",state:n,setStateOptions:a})}cancel(n){var s,l;const a=(s=ee(this,io))==null?void 0:s.promise;return(l=ee(this,io))==null||l.cancel(n),a?a.then($o).catch($o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ee(this,Ul))}isActive(){return this.observers.some(n=>kr(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Im||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>ki(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!zA(this.state.dataUpdatedAt,n)}onFocus(){var a;const n=this.observers.find(s=>s.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(a=ee(this,io))==null||a.continue()}onOnline(){var a;const n=this.observers.find(s=>s.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(a=ee(this,io))==null||a.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),ee(this,Mr).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(a=>a!==n),this.observers.length||(ee(this,io)&&(ee(this,jl)?ee(this,io).cancel({revert:!0}):ee(this,io).cancelRetry()),this.scheduleGc()),ee(this,Mr).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Kr,vs).call(this,{type:"invalidate"})}async fetch(n,a){var g,m,b,p,v,w,E,T,C,A,k,U;if(this.state.fetchStatus!=="idle"&&((g=ee(this,io))==null?void 0:g.status())!=="rejected"){if(this.state.data!==void 0&&(a!=null&&a.cancelRefetch))this.cancel({silent:!0});else if(ee(this,io))return ee(this,io).continueRetry(),ee(this,io).promise}if(n&&this.setOptions(n),!this.options.queryFn){const M=this.observers.find(Y=>Y.options.queryFn);M&&this.setOptions(M.options)}Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']");const s=new AbortController,l=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Be(this,jl,!0),s.signal)})},c=()=>{const M=jA(this.options,a),$=(()=>{const _={client:ee(this,zl),queryKey:this.queryKey,meta:this.meta};return l(_),_})();return Be(this,jl,!1),this.options.persister?this.options.persister(M,$,this):M($)},h=(()=>{const M={fetchOptions:a,options:this.options,queryKey:this.queryKey,client:ee(this,zl),state:this.state,fetchFn:c};return l(M),M})();(m=this.options.behavior)==null||m.onFetch(h,this),Be(this,cu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&Bt(this,Kr,vs).call(this,{type:"fetch",meta:(p=h.fetchOptions)==null?void 0:p.meta}),Be(this,io,IA({initialPromise:a==null?void 0:a.initialPromise,fn:h.fetchFn,onCancel:M=>{M instanceof V0&&M.revert&&this.setState({...ee(this,cu),fetchStatus:"idle"}),s.abort()},onFail:(M,Y)=>{Bt(this,Kr,vs).call(this,{type:"failed",failureCount:M,error:Y})},onPause:()=>{Bt(this,Kr,vs).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Kr,vs).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const M=await ee(this,io).start();if(M===void 0)throw console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),new Error(`${this.queryHash} data is undefined`);return this.setData(M),(w=(v=ee(this,Mr).config).onSuccess)==null||w.call(v,M,this),(T=(E=ee(this,Mr).config).onSettled)==null||T.call(E,M,this.state.error,this),M}catch(M){if(M instanceof V0){if(M.silent)return ee(this,io).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Bt(this,Kr,vs).call(this,{type:"error",error:M}),(A=(C=ee(this,Mr).config).onError)==null||A.call(C,M,this),(U=(k=ee(this,Mr).config).onSettled)==null||U.call(k,this.state.data,M,this),M}finally{this.scheduleGc()}}},Ul=new WeakMap,cu=new WeakMap,Mr=new WeakMap,zl=new WeakMap,io=new WeakMap,jf=new WeakMap,jl=new WeakMap,Kr=new WeakSet,vs=function(n){const a=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...VA(s.data,this.options),fetchMeta:n.meta??null};case"success":const l={...s,...sO(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Be(this,cu,n.manual?l:void 0),l;case"error":const c=n.error;return{...s,error:c,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=a(this.state),yo.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),ee(this,Mr).notify({query:this,type:"updated",action:n})})},AA);function VA(o,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:HA(n.networkMode)?"fetching":"paused",...o===void 0&&{error:null,status:"pending"}}}function sO(o,n){return{data:o,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function iO(o){const n=typeof o.initialData=="function"?o.initialData():o.initialData,a=n!==void 0,s=a?typeof o.initialDataUpdatedAt=="function"?o.initialDataUpdatedAt():o.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:a?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Fo,Vt,Pf,Uo,Pl,uu,Rs,Ti,Hf,du,fu,Hl,Il,Ci,hu,Jt,pf,F0,Y0,$0,q0,G0,X0,Q0,FA,NA,Zz=(NA=class extends Vf{constructor(n,a){super();lt(this,Jt);lt(this,Fo);lt(this,Vt);lt(this,Pf);lt(this,Uo);lt(this,Pl);lt(this,uu);lt(this,Rs);lt(this,Ti);lt(this,Hf);lt(this,du);lt(this,fu);lt(this,Hl);lt(this,Il);lt(this,Ci);lt(this,hu,new Set);this.options=a,Be(this,Fo,n),Be(this,Ti,null),Be(this,Rs,B0()),this.bindMethods(),this.setOptions(a)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ee(this,Vt).addObserver(this),lO(ee(this,Vt),this.options)?Bt(this,Jt,pf).call(this):this.updateResult(),Bt(this,Jt,q0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return W0(ee(this,Vt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return W0(ee(this,Vt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,Jt,G0).call(this),Bt(this,Jt,X0).call(this),ee(this,Vt).removeObserver(this)}setOptions(n){const a=this.options,s=ee(this,Vt);if(this.options=ee(this,Fo).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,ee(this,Vt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,Jt,Q0).call(this),ee(this,Vt).setOptions(this.options),a._defaulted&&!P0(this.options,a)&&ee(this,Fo).getQueryCache().notify({type:"observerOptionsUpdated",query:ee(this,Vt),observer:this});const l=this.hasListeners();l&&cO(ee(this,Vt),s,this.options,a)&&Bt(this,Jt,pf).call(this),this.updateResult(),l&&(ee(this,Vt)!==s||kr(this.options.enabled,ee(this,Vt))!==kr(a.enabled,ee(this,Vt))||ki(this.options.staleTime,ee(this,Vt))!==ki(a.staleTime,ee(this,Vt)))&&Bt(this,Jt,F0).call(this);const c=Bt(this,Jt,Y0).call(this);l&&(ee(this,Vt)!==s||kr(this.options.enabled,ee(this,Vt))!==kr(a.enabled,ee(this,Vt))||c!==ee(this,Ci))&&Bt(this,Jt,$0).call(this,c)}getOptimisticResult(n){const a=ee(this,Fo).getQueryCache().build(ee(this,Fo),n),s=this.createResult(a,n);return t3(this,s)&&(Be(this,Uo,s),Be(this,uu,this.options),Be(this,Pl,ee(this,Vt).state)),s}getCurrentResult(){return ee(this,Uo)}trackResult(n,a){return new Proxy(n,{get:(s,l)=>(this.trackProp(l),a==null||a(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ee(this,Rs).status==="pending"&&ee(this,Rs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,l))})}trackProp(n){ee(this,hu).add(n)}getCurrentQuery(){return ee(this,Vt)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const a=ee(this,Fo).defaultQueryOptions(n),s=ee(this,Fo).getQueryCache().build(ee(this,Fo),a);return s.fetch().then(()=>this.createResult(s,a))}fetch(n){return Bt(this,Jt,pf).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),ee(this,Uo)))}createResult(n,a){var te;const s=ee(this,Vt),l=this.options,c=ee(this,Uo),f=ee(this,Pl),h=ee(this,uu),m=n!==s?n.state:ee(this,Pf),{state:b}=n;let p={...b},v=!1,w;if(a._optimisticResults){const H=this.hasListeners(),J=!H&&lO(n,a),N=H&&cO(n,s,a,l);(J||N)&&(p={...p,...VA(b.data,n.options)}),a._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:E,errorUpdatedAt:T,status:C}=p;w=p.data;let A=!1;if(a.placeholderData!==void 0&&w===void 0&&C==="pending"){let H;c!=null&&c.isPlaceholderData&&a.placeholderData===(h==null?void 0:h.placeholderData)?(H=c.data,A=!0):H=typeof a.placeholderData=="function"?a.placeholderData((te=ee(this,fu))==null?void 0:te.state.data,ee(this,fu)):a.placeholderData,H!==void 0&&(C="success",w=I0(c==null?void 0:c.data,H,a),v=!0)}if(a.select&&w!==void 0&&!A)if(c&&w===(f==null?void 0:f.data)&&a.select===ee(this,Hf))w=ee(this,du);else try{Be(this,Hf,a.select),w=a.select(w),w=I0(c==null?void 0:c.data,w,a),Be(this,du,w),Be(this,Ti,null)}catch(H){Be(this,Ti,H)}ee(this,Ti)&&(E=ee(this,Ti),w=ee(this,du),T=Date.now(),C="error");const k=p.fetchStatus==="fetching",U=C==="pending",M=C==="error",Y=U&&k,$=w!==void 0,z={status:C,fetchStatus:p.fetchStatus,isPending:U,isSuccess:C==="success",isError:M,isInitialLoading:Y,isLoading:Y,data:w,dataUpdatedAt:p.dataUpdatedAt,error:E,errorUpdatedAt:T,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>m.dataUpdateCount||p.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!U,isLoadingError:M&&!$,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:M&&$,isStale:AS(n,a),refetch:this.refetch,promise:ee(this,Rs),isEnabled:kr(a.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const H=z.data!==void 0,J=z.status==="error"&&!H,N=Z=>{J?Z.reject(z.error):H&&Z.resolve(z.data)},P=()=>{const Z=Be(this,Rs,z.promise=B0());N(Z)},ne=ee(this,Rs);switch(ne.status){case"pending":n.queryHash===s.queryHash&&N(ne);break;case"fulfilled":(J||z.data!==ne.value)&&P();break;case"rejected":(!J||z.error!==ne.reason)&&P();break}}return z}updateResult(){const n=ee(this,Uo),a=this.createResult(ee(this,Vt),this.options);if(Be(this,Pl,ee(this,Vt).state),Be(this,uu,this.options),ee(this,Pl).data!==void 0&&Be(this,fu,ee(this,Vt)),P0(a,n))return;Be(this,Uo,a);const s=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!ee(this,hu).size)return!0;const f=new Set(c??ee(this,hu));return this.options.throwOnError&&f.add("error"),Object.keys(ee(this,Uo)).some(h=>{const g=h;return ee(this,Uo)[g]!==n[g]&&f.has(g)})};Bt(this,Jt,FA).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,Jt,q0).call(this)}},Fo=new WeakMap,Vt=new WeakMap,Pf=new WeakMap,Uo=new WeakMap,Pl=new WeakMap,uu=new WeakMap,Rs=new WeakMap,Ti=new WeakMap,Hf=new WeakMap,du=new WeakMap,fu=new WeakMap,Hl=new WeakMap,Il=new WeakMap,Ci=new WeakMap,hu=new WeakMap,Jt=new WeakSet,pf=function(n){Bt(this,Jt,Q0).call(this);let a=ee(this,Vt).fetch(this.options,n);return n!=null&&n.throwOnError||(a=a.catch($o)),a},F0=function(){Bt(this,Jt,G0).call(this);const n=ki(this.options.staleTime,ee(this,Vt));if(Fl||ee(this,Uo).isStale||!z0(n))return;const s=zA(ee(this,Uo).dataUpdatedAt,n)+1;Be(this,Hl,Al.setTimeout(()=>{ee(this,Uo).isStale||this.updateResult()},s))},Y0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ee(this,Vt)):this.options.refetchInterval)??!1},$0=function(n){Bt(this,Jt,X0).call(this),Be(this,Ci,n),!(Fl||kr(this.options.enabled,ee(this,Vt))===!1||!z0(ee(this,Ci))||ee(this,Ci)===0)&&Be(this,Il,Al.setInterval(()=>{(this.options.refetchIntervalInBackground||DS.isFocused())&&Bt(this,Jt,pf).call(this)},ee(this,Ci)))},q0=function(){Bt(this,Jt,F0).call(this),Bt(this,Jt,$0).call(this,Bt(this,Jt,Y0).call(this))},G0=function(){ee(this,Hl)&&(Al.clearTimeout(ee(this,Hl)),Be(this,Hl,void 0))},X0=function(){ee(this,Il)&&(Al.clearInterval(ee(this,Il)),Be(this,Il,void 0))},Q0=function(){const n=ee(this,Fo).getQueryCache().build(ee(this,Fo),this.options);if(n===ee(this,Vt))return;const a=ee(this,Vt);Be(this,Vt,n),Be(this,Pf,n.state),this.hasListeners()&&(a==null||a.removeObserver(this),n.addObserver(this))},FA=function(n){yo.batch(()=>{n.listeners&&this.listeners.forEach(a=>{a(ee(this,Uo))}),ee(this,Fo).getQueryCache().notify({query:ee(this,Vt),type:"observerResultsUpdated"})})},NA);function e3(o,n){return kr(n.enabled,o)!==!1&&o.state.data===void 0&&!(o.state.status==="error"&&n.retryOnMount===!1)}function lO(o,n){return e3(o,n)||o.state.data!==void 0&&W0(o,n,n.refetchOnMount)}function W0(o,n,a){if(kr(n.enabled,o)!==!1&&ki(n.staleTime,o)!=="static"){const s=typeof a=="function"?a(o):a;return s==="always"||s!==!1&&AS(o,n)}return!1}function cO(o,n,a,s){return(o!==n||kr(s.enabled,o)===!1)&&(!a.suspense||o.state.status!=="error")&&AS(o,a)}function AS(o,n){return kr(n.enabled,o)!==!1&&o.isStaleByTime(ki(n.staleTime,o))}function t3(o,n){return!P0(o.getCurrentResult(),n)}function uO(o){return{onFetch:(n,a)=>{var b,p,v,w,E;const s=n.options,l=(v=(p=(b=n.fetchOptions)==null?void 0:b.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,c=((w=n.state.data)==null?void 0:w.pages)||[],f=((E=n.state.data)==null?void 0:E.pageParams)||[];let h={pages:[],pageParams:[]},g=0;const m=async()=>{let T=!1;const C=U=>{qz(U,()=>n.signal,()=>T=!0)},A=jA(n.options,n.fetchOptions),k=async(U,M,Y)=>{if(T)return Promise.reject();if(M==null&&U.pages.length)return Promise.resolve(U);const _=(()=>{const J={client:n.client,queryKey:n.queryKey,pageParam:M,direction:Y?"backward":"forward",meta:n.options.meta};return C(J),J})(),z=await A(_),{maxPages:te}=n.options,H=Y?$z:Yz;return{pages:H(U.pages,z,te),pageParams:H(U.pageParams,M,te)}};if(l&&c.length){const U=l==="backward",M=U?n3:dO,Y={pages:c,pageParams:f},$=M(s,Y);h=await k(Y,$,U)}else{const U=o??c.length;do{const M=g===0?f[0]??s.initialPageParam:dO(s,h);if(g>0&&M==null)break;h=await k(h,M),g++}while(g<U)}return h};n.options.persister?n.fetchFn=()=>{var T,C;return(C=(T=n.options).persister)==null?void 0:C.call(T,m,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},a)}:n.fetchFn=m}}}function dO(o,{pages:n,pageParams:a}){const s=n.length-1;return n.length>0?o.getNextPageParam(n[s],n,a[s],a):void 0}function n3(o,{pages:n,pageParams:a}){var s;return n.length>0?(s=o.getPreviousPageParam)==null?void 0:s.call(o,n[0],n,a[0],a):void 0}var If,ka,Eo,Bl,La,Si,MA,o3=(MA=class extends BA{constructor(n){super();lt(this,La);lt(this,If);lt(this,ka);lt(this,Eo);lt(this,Bl);Be(this,If,n.client),this.mutationId=n.mutationId,Be(this,Eo,n.mutationCache),Be(this,ka,[]),this.state=n.state||r3(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){ee(this,ka).includes(n)||(ee(this,ka).push(n),this.clearGcTimeout(),ee(this,Eo).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){Be(this,ka,ee(this,ka).filter(a=>a!==n)),this.scheduleGc(),ee(this,Eo).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){ee(this,ka).length||(this.state.status==="pending"?this.scheduleGc():ee(this,Eo).remove(this))}continue(){var n;return((n=ee(this,Bl))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var f,h,g,m,b,p,v,w,E,T,C,A,k,U,M,Y,$,_;const a=()=>{Bt(this,La,Si).call(this,{type:"continue"})},s={client:ee(this,If),meta:this.options.meta,mutationKey:this.options.mutationKey};Be(this,Bl,IA({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(z,te)=>{Bt(this,La,Si).call(this,{type:"failed",failureCount:z,error:te})},onPause:()=>{Bt(this,La,Si).call(this,{type:"pause"})},onContinue:a,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ee(this,Eo).canRun(this)}));const l=this.state.status==="pending",c=!ee(this,Bl).canStart();try{if(l)a();else{Bt(this,La,Si).call(this,{type:"pending",variables:n,isPaused:c}),ee(this,Eo).config.onMutate&&await ee(this,Eo).config.onMutate(n,this,s);const te=await((h=(f=this.options).onMutate)==null?void 0:h.call(f,n,s));te!==this.state.context&&Bt(this,La,Si).call(this,{type:"pending",context:te,variables:n,isPaused:c})}const z=await ee(this,Bl).start();return await((m=(g=ee(this,Eo).config).onSuccess)==null?void 0:m.call(g,z,n,this.state.context,this,s)),await((p=(b=this.options).onSuccess)==null?void 0:p.call(b,z,n,this.state.context,s)),await((w=(v=ee(this,Eo).config).onSettled)==null?void 0:w.call(v,z,null,this.state.variables,this.state.context,this,s)),await((T=(E=this.options).onSettled)==null?void 0:T.call(E,z,null,n,this.state.context,s)),Bt(this,La,Si).call(this,{type:"success",data:z}),z}catch(z){try{await((A=(C=ee(this,Eo).config).onError)==null?void 0:A.call(C,z,n,this.state.context,this,s))}catch(te){Promise.reject(te)}try{await((U=(k=this.options).onError)==null?void 0:U.call(k,z,n,this.state.context,s))}catch(te){Promise.reject(te)}try{await((Y=(M=ee(this,Eo).config).onSettled)==null?void 0:Y.call(M,void 0,z,this.state.variables,this.state.context,this,s))}catch(te){Promise.reject(te)}try{await((_=($=this.options).onSettled)==null?void 0:_.call($,void 0,z,n,this.state.context,s))}catch(te){Promise.reject(te)}throw Bt(this,La,Si).call(this,{type:"error",error:z}),z}finally{ee(this,Eo).runNext(this)}}},If=new WeakMap,ka=new WeakMap,Eo=new WeakMap,Bl=new WeakMap,La=new WeakSet,Si=function(n){const a=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=a(this.state),yo.batch(()=>{ee(this,ka).forEach(s=>{s.onMutationUpdate(n)}),ee(this,Eo).notify({mutation:this,type:"updated",action:n})})},MA);function r3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ts,Jr,Bf,_A,a3=(_A=class extends Vf{constructor(n={}){super();lt(this,Ts);lt(this,Jr);lt(this,Bf);this.config=n,Be(this,Ts,new Set),Be(this,Jr,new Map),Be(this,Bf,0)}build(n,a,s){const l=new o3({client:n,mutationCache:this,mutationId:++dm(this,Bf)._,options:n.defaultMutationOptions(a),state:s});return this.add(l),l}add(n){ee(this,Ts).add(n);const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a);s?s.push(n):ee(this,Jr).set(a,[n])}this.notify({type:"added",mutation:n})}remove(n){if(ee(this,Ts).delete(n)){const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a);if(s)if(s.length>1){const l=s.indexOf(n);l!==-1&&s.splice(l,1)}else s[0]===n&&ee(this,Jr).delete(a)}}this.notify({type:"removed",mutation:n})}canRun(n){const a=hm(n);if(typeof a=="string"){const s=ee(this,Jr).get(a),l=s==null?void 0:s.find(c=>c.state.status==="pending");return!l||l===n}else return!0}runNext(n){var s;const a=hm(n);if(typeof a=="string"){const l=(s=ee(this,Jr).get(a))==null?void 0:s.find(c=>c!==n&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){yo.batch(()=>{ee(this,Ts).forEach(n=>{this.notify({type:"removed",mutation:n})}),ee(this,Ts).clear(),ee(this,Jr).clear()})}getAll(){return Array.from(ee(this,Ts))}find(n){const a={exact:!0,...n};return this.getAll().find(s=>oO(a,s))}findAll(n={}){return this.getAll().filter(a=>oO(n,a))}notify(n){yo.batch(()=>{this.listeners.forEach(a=>{a(n)})})}resumePausedMutations(){const n=this.getAll().filter(a=>a.state.isPaused);return yo.batch(()=>Promise.all(n.map(a=>a.continue().catch($o))))}},Ts=new WeakMap,Jr=new WeakMap,Bf=new WeakMap,_A);function hm(o){var n;return(n=o.options.scope)==null?void 0:n.id}var Ua,kA,s3=(kA=class extends Vf{constructor(n={}){super();lt(this,Ua);this.config=n,Be(this,Ua,new Map)}build(n,a,s){const l=a.queryKey,c=a.queryHash??OS(l,a);let f=this.get(c);return f||(f=new Jz({client:n,queryKey:l,queryHash:c,options:n.defaultQueryOptions(a),state:s,defaultOptions:n.getQueryDefaults(l)}),this.add(f)),f}add(n){ee(this,Ua).has(n.queryHash)||(ee(this,Ua).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const a=ee(this,Ua).get(n.queryHash);a&&(n.destroy(),a===n&&ee(this,Ua).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){yo.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return ee(this,Ua).get(n)}getAll(){return[...ee(this,Ua).values()]}find(n){const a={exact:!0,...n};return this.getAll().find(s=>nO(a,s))}findAll(n={}){const a=this.getAll();return Object.keys(n).length>0?a.filter(s=>nO(n,s)):a}notify(n){yo.batch(()=>{this.listeners.forEach(a=>{a(n)})})}onFocus(){yo.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){yo.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Ua=new WeakMap,kA),An,Oi,Di,pu,mu,Ai,gu,yu,LA,i3=(LA=class{constructor(o={}){lt(this,An);lt(this,Oi);lt(this,Di);lt(this,pu);lt(this,mu);lt(this,Ai);lt(this,gu);lt(this,yu);Be(this,An,o.queryCache||new s3),Be(this,Oi,o.mutationCache||new a3),Be(this,Di,o.defaultOptions||{}),Be(this,pu,new Map),Be(this,mu,new Map),Be(this,Ai,0)}mount(){dm(this,Ai)._++,ee(this,Ai)===1&&(Be(this,gu,DS.subscribe(async o=>{o&&(await this.resumePausedMutations(),ee(this,An).onFocus())})),Be(this,yu,Bm.subscribe(async o=>{o&&(await this.resumePausedMutations(),ee(this,An).onOnline())})))}unmount(){var o,n;dm(this,Ai)._--,ee(this,Ai)===0&&((o=ee(this,gu))==null||o.call(this),Be(this,gu,void 0),(n=ee(this,yu))==null||n.call(this),Be(this,yu,void 0))}isFetching(o){return ee(this,An).findAll({...o,fetchStatus:"fetching"}).length}isMutating(o){return ee(this,Oi).findAll({...o,status:"pending"}).length}getQueryData(o){var a;const n=this.defaultQueryOptions({queryKey:o});return(a=ee(this,An).get(n.queryHash))==null?void 0:a.state.data}ensureQueryData(o){const n=this.defaultQueryOptions(o),a=ee(this,An).build(this,n),s=a.state.data;return s===void 0?this.fetchQuery(o):(o.revalidateIfStale&&a.isStaleByTime(ki(n.staleTime,a))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(o){return ee(this,An).findAll(o).map(({queryKey:n,state:a})=>{const s=a.data;return[n,s]})}setQueryData(o,n,a){const s=this.defaultQueryOptions({queryKey:o}),l=ee(this,An).get(s.queryHash),c=l==null?void 0:l.state.data,f=Bz(n,c);if(f!==void 0)return ee(this,An).build(this,s).setData(f,{...a,manual:!0})}setQueriesData(o,n,a){return yo.batch(()=>ee(this,An).findAll(o).map(({queryKey:s})=>[s,this.setQueryData(s,n,a)]))}getQueryState(o){var a;const n=this.defaultQueryOptions({queryKey:o});return(a=ee(this,An).get(n.queryHash))==null?void 0:a.state}removeQueries(o){const n=ee(this,An);yo.batch(()=>{n.findAll(o).forEach(a=>{n.remove(a)})})}resetQueries(o,n){const a=ee(this,An);return yo.batch(()=>(a.findAll(o).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...o},n)))}cancelQueries(o,n={}){const a={revert:!0,...n},s=yo.batch(()=>ee(this,An).findAll(o).map(l=>l.cancel(a)));return Promise.all(s).then($o).catch($o)}invalidateQueries(o,n={}){return yo.batch(()=>(ee(this,An).findAll(o).forEach(a=>{a.invalidate()}),(o==null?void 0:o.refetchType)==="none"?Promise.resolve():this.refetchQueries({...o,type:(o==null?void 0:o.refetchType)??(o==null?void 0:o.type)??"active"},n)))}refetchQueries(o,n={}){const a={...n,cancelRefetch:n.cancelRefetch??!0},s=yo.batch(()=>ee(this,An).findAll(o).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,a);return a.throwOnError||(c=c.catch($o)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then($o)}fetchQuery(o){const n=this.defaultQueryOptions(o);n.retry===void 0&&(n.retry=!1);const a=ee(this,An).build(this,n);return a.isStaleByTime(ki(n.staleTime,a))?a.fetch(n):Promise.resolve(a.state.data)}prefetchQuery(o){return this.fetchQuery(o).then($o).catch($o)}fetchInfiniteQuery(o){return o.behavior=uO(o.pages),this.fetchQuery(o)}prefetchInfiniteQuery(o){return this.fetchInfiniteQuery(o).then($o).catch($o)}ensureInfiniteQueryData(o){return o.behavior=uO(o.pages),this.ensureQueryData(o)}resumePausedMutations(){return Bm.isOnline()?ee(this,Oi).resumePausedMutations():Promise.resolve()}getQueryCache(){return ee(this,An)}getMutationCache(){return ee(this,Oi)}getDefaultOptions(){return ee(this,Di)}setDefaultOptions(o){Be(this,Di,o)}setQueryDefaults(o,n){ee(this,pu).set(Rf(o),{queryKey:o,defaultOptions:n})}getQueryDefaults(o){const n=[...ee(this,pu).values()],a={};return n.forEach(s=>{Tf(o,s.queryKey)&&Object.assign(a,s.defaultOptions)}),a}setMutationDefaults(o,n){ee(this,mu).set(Rf(o),{mutationKey:o,defaultOptions:n})}getMutationDefaults(o){const n=[...ee(this,mu).values()],a={};return n.forEach(s=>{Tf(o,s.mutationKey)&&Object.assign(a,s.defaultOptions)}),a}defaultQueryOptions(o){if(o._defaulted)return o;const n={...ee(this,Di).queries,...this.getQueryDefaults(o.queryKey),...o,_defaulted:!0};return n.queryHash||(n.queryHash=OS(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Im&&(n.enabled=!1),n}defaultMutationOptions(o){return o!=null&&o._defaulted?o:{...ee(this,Di).mutations,...(o==null?void 0:o.mutationKey)&&this.getMutationDefaults(o.mutationKey),...o,_defaulted:!0}}clear(){ee(this,An).clear(),ee(this,Oi).clear()}},An=new WeakMap,Oi=new WeakMap,Di=new WeakMap,pu=new WeakMap,mu=new WeakMap,Ai=new WeakMap,gu=new WeakMap,yu=new WeakMap,LA),x=Gl();const _e=UA(x),NS=_z({__proto__:null,default:_e},[x]);var Zv={exports:{}},nf={},fO;function l3(){if(fO)return nf;fO=1;/**
36
36
  * @license React
37
37
  * react-jsx-runtime.development.js
38
38
  *
@@ -40,12 +40,12 @@ React keys must be passed directly to JSX without using spread:
40
40
  *
41
41
  * This source code is licensed under the MIT license found in the
42
42
  * LICENSE file in the root directory of this source tree.
43
- */return(function(){function o(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===J?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case C:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case T:return"Portal";case M:return L.displayName||"Context";case U:return(L._context.displayName||"Context")+".Consumer";case Y:var ce=L.render;return L=L.displayName,L||(L=ce.displayName||ce.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case z:return ce=L.displayName||null,ce!==null?ce:o(L.type)||"Memo";case te:ce=L._payload,L=L._init;try{return o(L(ce))}catch{}}return null}function n(L){return""+L}function a(L){try{n(L);var ce=!1}catch{ce=!0}if(ce){ce=console;var ae=ce.error,me=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return ae.call(ce,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",me),n(L)}}function s(L){if(L===C)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===te)return"<...>";try{var ce=o(L);return ce?"<"+ce+">":"<...>"}catch{return"<...>"}}function l(){var L=N.A;return L===null?null:L.getOwner()}function c(){return Error("react-stack-top-frame")}function f(L){if(P.call(L,"key")){var ce=Object.getOwnPropertyDescriptor(L,"key").get;if(ce&&ce.isReactWarning)return!1}return L.key!==void 0}function h(L,ce){function ae(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ce))}ae.isReactWarning=!0,Object.defineProperty(L,"key",{get:ae,configurable:!0})}function g(){var L=o(this.type);return oe[L]||(oe[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function m(L,ce,ae,me,Te,Ue){var ve=ae.ref;return L={$$typeof:E,type:L,key:ce,props:ae,_owner:me},(ve!==void 0?ve:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:g}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Te}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function b(L,ce,ae,me,Te,Ue){var ve=ce.children;if(ve!==void 0)if(me)if(ne(ve)){for(me=0;me<ve.length;me++)p(ve[me]);Object.freeze&&Object.freeze(ve)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(ve);if(P.call(ce,"key")){ve=o(L);var ze=Object.keys(ce).filter(function(at){return at!=="key"});me=0<ze.length?"{key: someKey, "+ze.join(": ..., ")+": ...}":"{key: someKey}",pe[ve+me]||(ze=0<ze.length?"{"+ze.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
43
+ */return(function(){function o(L){if(L==null)return null;if(typeof L=="function")return L.$$typeof===J?null:L.displayName||L.name||null;if(typeof L=="string")return L;switch(L){case C:return"Fragment";case k:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case _:return"SuspenseList";case H:return"Activity"}if(typeof L=="object")switch(typeof L.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),L.$$typeof){case T:return"Portal";case M:return L.displayName||"Context";case U:return(L._context.displayName||"Context")+".Consumer";case Y:var ce=L.render;return L=L.displayName,L||(L=ce.displayName||ce.name||"",L=L!==""?"ForwardRef("+L+")":"ForwardRef"),L;case z:return ce=L.displayName||null,ce!==null?ce:o(L.type)||"Memo";case te:ce=L._payload,L=L._init;try{return o(L(ce))}catch{}}return null}function n(L){return""+L}function a(L){try{n(L);var ce=!1}catch{ce=!0}if(ce){ce=console;var se=ce.error,me=typeof Symbol=="function"&&Symbol.toStringTag&&L[Symbol.toStringTag]||L.constructor.name||"Object";return se.call(ce,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",me),n(L)}}function s(L){if(L===C)return"<>";if(typeof L=="object"&&L!==null&&L.$$typeof===te)return"<...>";try{var ce=o(L);return ce?"<"+ce+">":"<...>"}catch{return"<...>"}}function l(){var L=N.A;return L===null?null:L.getOwner()}function c(){return Error("react-stack-top-frame")}function f(L){if(P.call(L,"key")){var ce=Object.getOwnPropertyDescriptor(L,"key").get;if(ce&&ce.isReactWarning)return!1}return L.key!==void 0}function h(L,ce){function se(){j||(j=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",ce))}se.isReactWarning=!0,Object.defineProperty(L,"key",{get:se,configurable:!0})}function g(){var L=o(this.type);return oe[L]||(oe[L]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),L=this.props.ref,L!==void 0?L:null}function m(L,ce,se,me,Te,Ue){var ve=se.ref;return L={$$typeof:E,type:L,key:ce,props:se,_owner:me},(ve!==void 0?ve:null)!==null?Object.defineProperty(L,"ref",{enumerable:!1,get:g}):Object.defineProperty(L,"ref",{enumerable:!1,value:null}),L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(L,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(L,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Te}),Object.defineProperty(L,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ue}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L}function b(L,ce,se,me,Te,Ue){var ve=ce.children;if(ve!==void 0)if(me)if(ne(ve)){for(me=0;me<ve.length;me++)p(ve[me]);Object.freeze&&Object.freeze(ve)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(ve);if(P.call(ce,"key")){ve=o(L);var ze=Object.keys(ce).filter(function(at){return at!=="key"});me=0<ze.length?"{key: someKey, "+ze.join(": ..., ")+": ...}":"{key: someKey}",pe[ve+me]||(ze=0<ze.length?"{"+ze.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
44
44
  let props = %s;
45
45
  <%s {...props} />
46
46
  React keys must be passed directly to JSX without using spread:
47
47
  let props = %s;
48
- <%s key={someKey} {...props} />`,me,ve,ze,ve),pe[ve+me]=!0)}if(ve=null,ae!==void 0&&(a(ae),ve=""+ae),f(ce)&&(a(ce.key),ve=""+ce.key),"key"in ce){ae={};for(var je in ce)je!=="key"&&(ae[je]=ce[je])}else ae=ce;return ve&&h(ae,typeof L=="function"?L.displayName||L.name||"Unknown":L),m(L,ve,ae,l(),Te,Ue)}function p(L){v(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===te&&(L._payload.status==="fulfilled"?v(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function v(L){return typeof L=="object"&&L!==null&&L.$$typeof===E}var w=Gl(),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),M=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),N=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,ne=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(L){return L()}};var j,oe={},I=w.react_stack_bottom_frame.bind(w,c)(),ie=Z(s(c)),pe={};nf.Fragment=C,nf.jsx=function(L,ce,ae){var me=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,ae,!1,me?Error("react-stack-top-frame"):I,me?Z(s(L)):ie)},nf.jsxs=function(L,ce,ae){var me=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,ae,!0,me?Error("react-stack-top-frame"):I,me?Z(s(L)):ie)}})(),nf}var hO;function c3(){return hO||(hO=1,Zv.exports=l3()),Zv.exports}var nn=c3(),YA=x.createContext(void 0),u3=o=>{const n=x.useContext(YA);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},d3=({client:o,children:n})=>(x.useEffect(()=>(o.mount(),()=>{o.unmount()}),[o]),nn.jsx(YA.Provider,{value:o,children:n})),$A=x.createContext(!1),f3=()=>x.useContext($A);$A.Provider;function h3(){let o=!1;return{clearReset:()=>{o=!1},reset:()=>{o=!0},isReset:()=>o}}var p3=x.createContext(h3()),m3=()=>x.useContext(p3),g3=(o,n,a)=>{const s=a!=null&&a.state.error&&typeof o.throwOnError=="function"?PA(o.throwOnError,[a.state.error,a]):o.throwOnError;(o.suspense||o.experimental_prefetchInRender||s)&&(n.isReset()||(o.retryOnMount=!1))},y3=o=>{x.useEffect(()=>{o.clearReset()},[o])},b3=({result:o,errorResetBoundary:n,throwOnError:a,query:s,suspense:l})=>o.isError&&!n.isReset()&&!o.isFetching&&s&&(l&&o.data===void 0||PA(a,[o.error,s])),v3=o=>{if(o.suspense){const a=l=>l==="static"?l:Math.max(l??1e3,1e3),s=o.staleTime;o.staleTime=typeof s=="function"?(...l)=>a(s(...l)):a(s),typeof o.gcTime=="number"&&(o.gcTime=Math.max(o.gcTime,1e3))}},S3=(o,n)=>o.isLoading&&o.isFetching&&!n,w3=(o,n)=>(o==null?void 0:o.suspense)&&n.isPending,pO=(o,n,a)=>n.fetchOptimistic(o).catch(()=>{a.clearReset()});function E3(o,n,a){var v,w,E,T;if(typeof o!="object"||Array.isArray(o))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const s=f3(),l=m3(),c=u3(),f=c.defaultQueryOptions(o);(w=(v=c.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||w.call(v,f);const h=c.getQueryCache().get(f.queryHash);f.queryFn||console.error(`[${f.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),f._optimisticResults=s?"isRestoring":"optimistic",v3(f),g3(f,l,h),y3(l);const g=!c.getQueryCache().get(f.queryHash),[m]=x.useState(()=>new n(c,f)),b=m.getOptimisticResult(f),p=!s&&o.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(C=>{const A=p?m.subscribe(yo.batchCalls(C)):$o;return m.updateResult(),A},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(f)},[f,m]),w3(f,b))throw pO(f,m,l);if(b3({result:b,errorResetBoundary:l,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw b.error;if((T=(E=c.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||T.call(E,f,b),f.experimental_prefetchInRender&&!Fl&&S3(b,s)){const C=g?pO(f,m,l):h==null?void 0:h.promise;C==null||C.catch($o).finally(()=>{m.updateResult()})}return f.notifyOnChangeProps?b:m.trackResult(b)}function x3(o,n){return E3(o,Zz)}var e0={exports:{}},of={},t0={exports:{}},n0={},mO;function R3(){return mO||(mO=1,(function(o){/**
48
+ <%s key={someKey} {...props} />`,me,ve,ze,ve),pe[ve+me]=!0)}if(ve=null,se!==void 0&&(a(se),ve=""+se),f(ce)&&(a(ce.key),ve=""+ce.key),"key"in ce){se={};for(var je in ce)je!=="key"&&(se[je]=ce[je])}else se=ce;return ve&&h(se,typeof L=="function"?L.displayName||L.name||"Unknown":L),m(L,ve,se,l(),Te,Ue)}function p(L){v(L)?L._store&&(L._store.validated=1):typeof L=="object"&&L!==null&&L.$$typeof===te&&(L._payload.status==="fulfilled"?v(L._payload.value)&&L._payload.value._store&&(L._payload.value._store.validated=1):L._store&&(L._store.validated=1))}function v(L){return typeof L=="object"&&L!==null&&L.$$typeof===E}var w=Gl(),E=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),M=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),H=Symbol.for("react.activity"),J=Symbol.for("react.client.reference"),N=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=Object.prototype.hasOwnProperty,ne=Array.isArray,Z=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(L){return L()}};var j,oe={},I=w.react_stack_bottom_frame.bind(w,c)(),ie=Z(s(c)),pe={};nf.Fragment=C,nf.jsx=function(L,ce,se){var me=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,se,!1,me?Error("react-stack-top-frame"):I,me?Z(s(L)):ie)},nf.jsxs=function(L,ce,se){var me=1e4>N.recentlyCreatedOwnerStacks++;return b(L,ce,se,!0,me?Error("react-stack-top-frame"):I,me?Z(s(L)):ie)}})(),nf}var hO;function c3(){return hO||(hO=1,Zv.exports=l3()),Zv.exports}var nn=c3(),YA=x.createContext(void 0),u3=o=>{const n=x.useContext(YA);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},d3=({client:o,children:n})=>(x.useEffect(()=>(o.mount(),()=>{o.unmount()}),[o]),nn.jsx(YA.Provider,{value:o,children:n})),$A=x.createContext(!1),f3=()=>x.useContext($A);$A.Provider;function h3(){let o=!1;return{clearReset:()=>{o=!1},reset:()=>{o=!0},isReset:()=>o}}var p3=x.createContext(h3()),m3=()=>x.useContext(p3),g3=(o,n,a)=>{const s=a!=null&&a.state.error&&typeof o.throwOnError=="function"?PA(o.throwOnError,[a.state.error,a]):o.throwOnError;(o.suspense||o.experimental_prefetchInRender||s)&&(n.isReset()||(o.retryOnMount=!1))},y3=o=>{x.useEffect(()=>{o.clearReset()},[o])},b3=({result:o,errorResetBoundary:n,throwOnError:a,query:s,suspense:l})=>o.isError&&!n.isReset()&&!o.isFetching&&s&&(l&&o.data===void 0||PA(a,[o.error,s])),v3=o=>{if(o.suspense){const a=l=>l==="static"?l:Math.max(l??1e3,1e3),s=o.staleTime;o.staleTime=typeof s=="function"?(...l)=>a(s(...l)):a(s),typeof o.gcTime=="number"&&(o.gcTime=Math.max(o.gcTime,1e3))}},S3=(o,n)=>o.isLoading&&o.isFetching&&!n,w3=(o,n)=>(o==null?void 0:o.suspense)&&n.isPending,pO=(o,n,a)=>n.fetchOptimistic(o).catch(()=>{a.clearReset()});function E3(o,n,a){var v,w,E,T;if(typeof o!="object"||Array.isArray(o))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const s=f3(),l=m3(),c=u3(),f=c.defaultQueryOptions(o);(w=(v=c.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||w.call(v,f);const h=c.getQueryCache().get(f.queryHash);f.queryFn||console.error(`[${f.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`),f._optimisticResults=s?"isRestoring":"optimistic",v3(f),g3(f,l,h),y3(l);const g=!c.getQueryCache().get(f.queryHash),[m]=x.useState(()=>new n(c,f)),b=m.getOptimisticResult(f),p=!s&&o.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(C=>{const A=p?m.subscribe(yo.batchCalls(C)):$o;return m.updateResult(),A},[m,p]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(f)},[f,m]),w3(f,b))throw pO(f,m,l);if(b3({result:b,errorResetBoundary:l,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw b.error;if((T=(E=c.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||T.call(E,f,b),f.experimental_prefetchInRender&&!Fl&&S3(b,s)){const C=g?pO(f,m,l):h==null?void 0:h.promise;C==null||C.catch($o).finally(()=>{m.updateResult()})}return f.notifyOnChangeProps?b:m.trackResult(b)}function x3(o,n){return E3(o,Zz)}var e0={exports:{}},of={},t0={exports:{}},n0={},mO;function R3(){return mO||(mO=1,(function(o){/**
49
49
  * @license React
50
50
  * scheduler.development.js
51
51
  *
@@ -53,7 +53,7 @@ React keys must be passed directly to JSX without using spread:
53
53
  *
54
54
  * This source code is licensed under the MIT license found in the
55
55
  * LICENSE file in the root directory of this source tree.
56
- */(function(){function n(){if(Y=!1,te){var j=o.unstable_now();N=j;var oe=!0;try{e:{U=!1,M&&(M=!1,_(H),H=-1),k=!0;var I=A;try{t:{for(f(j),C=s(w);C!==null&&!(C.expirationTime>j&&g());){var ie=C.callback;if(typeof ie=="function"){C.callback=null,A=C.priorityLevel;var pe=ie(C.expirationTime<=j);if(j=o.unstable_now(),typeof pe=="function"){C.callback=pe,f(j),oe=!0;break t}C===s(w)&&l(w),f(j)}else l(w);C=s(w)}if(C!==null)oe=!0;else{var L=s(E);L!==null&&m(h,L.startTime-j),oe=!1}}break e}finally{C=null,A=I,k=!1}oe=void 0}}finally{oe?P():te=!1}}}function a(j,oe){var I=j.length;j.push(oe);e:for(;0<I;){var ie=I-1>>>1,pe=j[ie];if(0<c(pe,oe))j[ie]=oe,j[I]=pe,I=ie;else break e}}function s(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var oe=j[0],I=j.pop();if(I!==oe){j[0]=I;e:for(var ie=0,pe=j.length,L=pe>>>1;ie<L;){var ce=2*(ie+1)-1,ae=j[ce],me=ce+1,Te=j[me];if(0>c(ae,I))me<pe&&0>c(Te,ae)?(j[ie]=Te,j[me]=I,ie=me):(j[ie]=ae,j[ce]=I,ie=ce);else if(me<pe&&0>c(Te,I))j[ie]=Te,j[me]=I,ie=me;else break e}}return oe}function c(j,oe){var I=j.sortIndex-oe.sortIndex;return I!==0?I:j.id-oe.id}function f(j){for(var oe=s(E);oe!==null;){if(oe.callback===null)l(E);else if(oe.startTime<=j)l(E),oe.sortIndex=oe.expirationTime,a(w,oe);else break;oe=s(E)}}function h(j){if(M=!1,f(j),!U)if(s(w)!==null)U=!0,te||(te=!0,P());else{var oe=s(E);oe!==null&&m(h,oe.startTime-j)}}function g(){return Y?!0:!(o.unstable_now()-N<J)}function m(j,oe){H=$(function(){j(o.unstable_now())},oe)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var b=performance;o.unstable_now=function(){return b.now()}}else{var p=Date,v=p.now();o.unstable_now=function(){return p.now()-v}}var w=[],E=[],T=1,C=null,A=3,k=!1,U=!1,M=!1,Y=!1,$=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null,te=!1,H=-1,J=5,N=-1;if(typeof z=="function")var P=function(){z(n)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,Z=ne.port2;ne.port1.onmessage=n,P=function(){Z.postMessage(null)}}else P=function(){$(n,0)};o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(j){j.callback=null},o.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<j?Math.floor(1e3/j):5},o.unstable_getCurrentPriorityLevel=function(){return A},o.unstable_next=function(j){switch(A){case 1:case 2:case 3:var oe=3;break;default:oe=A}var I=A;A=oe;try{return j()}finally{A=I}},o.unstable_requestPaint=function(){Y=!0},o.unstable_runWithPriority=function(j,oe){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var I=A;A=j;try{return oe()}finally{A=I}},o.unstable_scheduleCallback=function(j,oe,I){var ie=o.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?ie+I:ie):I=ie,j){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=I+pe,j={id:T++,callback:oe,priorityLevel:j,startTime:I,expirationTime:pe,sortIndex:-1},I>ie?(j.sortIndex=I,a(E,j),s(w)===null&&j===s(E)&&(M?(_(H),H=-1):M=!0,m(h,I-ie))):(j.sortIndex=pe,a(w,j),U||k||(U=!0,te||(te=!0,P()))),j},o.unstable_shouldYield=g,o.unstable_wrapCallback=function(j){var oe=A;return function(){var I=A;A=oe;try{return j.apply(this,arguments)}finally{A=I}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(n0)),n0}var gO;function T3(){return gO||(gO=1,t0.exports=R3()),t0.exports}var o0={exports:{}},wo={},yO;function C3(){if(yO)return wo;yO=1;/**
56
+ */(function(){function n(){if(Y=!1,te){var j=o.unstable_now();N=j;var oe=!0;try{e:{U=!1,M&&(M=!1,_(H),H=-1),k=!0;var I=A;try{t:{for(f(j),C=s(w);C!==null&&!(C.expirationTime>j&&g());){var ie=C.callback;if(typeof ie=="function"){C.callback=null,A=C.priorityLevel;var pe=ie(C.expirationTime<=j);if(j=o.unstable_now(),typeof pe=="function"){C.callback=pe,f(j),oe=!0;break t}C===s(w)&&l(w),f(j)}else l(w);C=s(w)}if(C!==null)oe=!0;else{var L=s(E);L!==null&&m(h,L.startTime-j),oe=!1}}break e}finally{C=null,A=I,k=!1}oe=void 0}}finally{oe?P():te=!1}}}function a(j,oe){var I=j.length;j.push(oe);e:for(;0<I;){var ie=I-1>>>1,pe=j[ie];if(0<c(pe,oe))j[ie]=oe,j[I]=pe,I=ie;else break e}}function s(j){return j.length===0?null:j[0]}function l(j){if(j.length===0)return null;var oe=j[0],I=j.pop();if(I!==oe){j[0]=I;e:for(var ie=0,pe=j.length,L=pe>>>1;ie<L;){var ce=2*(ie+1)-1,se=j[ce],me=ce+1,Te=j[me];if(0>c(se,I))me<pe&&0>c(Te,se)?(j[ie]=Te,j[me]=I,ie=me):(j[ie]=se,j[ce]=I,ie=ce);else if(me<pe&&0>c(Te,I))j[ie]=Te,j[me]=I,ie=me;else break e}}return oe}function c(j,oe){var I=j.sortIndex-oe.sortIndex;return I!==0?I:j.id-oe.id}function f(j){for(var oe=s(E);oe!==null;){if(oe.callback===null)l(E);else if(oe.startTime<=j)l(E),oe.sortIndex=oe.expirationTime,a(w,oe);else break;oe=s(E)}}function h(j){if(M=!1,f(j),!U)if(s(w)!==null)U=!0,te||(te=!0,P());else{var oe=s(E);oe!==null&&m(h,oe.startTime-j)}}function g(){return Y?!0:!(o.unstable_now()-N<J)}function m(j,oe){H=$(function(){j(o.unstable_now())},oe)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),o.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var b=performance;o.unstable_now=function(){return b.now()}}else{var p=Date,v=p.now();o.unstable_now=function(){return p.now()-v}}var w=[],E=[],T=1,C=null,A=3,k=!1,U=!1,M=!1,Y=!1,$=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null,te=!1,H=-1,J=5,N=-1;if(typeof z=="function")var P=function(){z(n)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,Z=ne.port2;ne.port1.onmessage=n,P=function(){Z.postMessage(null)}}else P=function(){$(n,0)};o.unstable_IdlePriority=5,o.unstable_ImmediatePriority=1,o.unstable_LowPriority=4,o.unstable_NormalPriority=3,o.unstable_Profiling=null,o.unstable_UserBlockingPriority=2,o.unstable_cancelCallback=function(j){j.callback=null},o.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<j?Math.floor(1e3/j):5},o.unstable_getCurrentPriorityLevel=function(){return A},o.unstable_next=function(j){switch(A){case 1:case 2:case 3:var oe=3;break;default:oe=A}var I=A;A=oe;try{return j()}finally{A=I}},o.unstable_requestPaint=function(){Y=!0},o.unstable_runWithPriority=function(j,oe){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var I=A;A=j;try{return oe()}finally{A=I}},o.unstable_scheduleCallback=function(j,oe,I){var ie=o.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?ie+I:ie):I=ie,j){case 1:var pe=-1;break;case 2:pe=250;break;case 5:pe=1073741823;break;case 4:pe=1e4;break;default:pe=5e3}return pe=I+pe,j={id:T++,callback:oe,priorityLevel:j,startTime:I,expirationTime:pe,sortIndex:-1},I>ie?(j.sortIndex=I,a(E,j),s(w)===null&&j===s(E)&&(M?(_(H),H=-1):M=!0,m(h,I-ie))):(j.sortIndex=pe,a(w,j),U||k||(U=!0,te||(te=!0,P()))),j},o.unstable_shouldYield=g,o.unstable_wrapCallback=function(j){var oe=A;return function(){var I=A;A=oe;try{return j.apply(this,arguments)}finally{A=I}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})(n0)),n0}var gO;function T3(){return gO||(gO=1,t0.exports=R3()),t0.exports}var o0={exports:{}},wo={},yO;function C3(){if(yO)return wo;yO=1;/**
57
57
  * @license React
58
58
  * react-dom.development.js
59
59
  *
@@ -73,7 +73,7 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
73
73
  *
74
74
  * This source code is licensed under the MIT license found in the
75
75
  * LICENSE file in the root directory of this source tree.
76
- */return(function(){function o(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}function n(e,t,r,i){if(r>=t.length)return i;var u=t[r],d=Qn(e)?e.slice():Dt({},e);return d[u]=n(e[u],t,r+1,i),d}function a(e,t,r){if(t.length!==r.length)console.warn("copyWithRename() expects paths of the same length");else{for(var i=0;i<r.length-1;i++)if(t[i]!==r[i]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return s(e,t,r,0)}}function s(e,t,r,i){var u=t[i],d=Qn(e)?e.slice():Dt({},e);return i+1===t.length?(d[r[i]]=d[u],Qn(d)?d.splice(u,1):delete d[u]):d[u]=s(e[u],t,r,i+1),d}function l(e,t,r){var i=t[r],u=Qn(e)?e.slice():Dt({},e);return r+1===t.length?(Qn(u)?u.splice(i,1):delete u[i],u):(u[i]=l(e[i],t,r+1),u)}function c(){return!1}function f(){return null}function h(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function g(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function b(){}function p(e){var t=[];return e.forEach(function(r){t.push(r)}),t.sort().join(", ")}function v(e,t,r,i){return new yk(e,t,r,i)}function w(e,t){e.context===Zs&&(mb(e.current,2,t,e,null,null),lc())}function E(e,t){if(wr!==null){var r=t.staleFamilies;t=t.updatedFamilies,Ku(),nE(e.current,t,r),lc()}}function T(e){wr=e}function C(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function A(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function k(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function M(e){if(A(e)!==e)throw Error("Unable to find node on an unmounted component.")}function Y(e){var t=e.alternate;if(!t){if(t=A(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var r=e,i=t;;){var u=r.return;if(u===null)break;var d=u.alternate;if(d===null){if(i=u.return,i!==null){r=i;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===r)return M(u),e;if(d===i)return M(u),t;d=d.sibling}throw Error("Unable to find node on an unmounted component.")}if(r.return!==i.return)r=u,i=d;else{for(var y=!1,S=u.child;S;){if(S===r){y=!0,r=u,i=d;break}if(S===i){y=!0,i=u,r=d;break}S=S.sibling}if(!y){for(S=d.child;S;){if(S===r){y=!0,r=d,i=u;break}if(S===i){y=!0,i=d,r=u;break}S=S.sibling}if(!y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(r.alternate!==i)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(r.tag!==3)throw Error("Unable to find node on an unmounted component.");return r.stateNode.current===r?e:t}function $(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=$(e),t!==null)return t;e=e.sibling}return null}function _(e){return e===null||typeof e!="object"?null:(e=cT&&e[cT]||e["@@iterator"],typeof e=="function"?e:null)}function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===HL?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case mc:return"Fragment";case Eb:return"Profiler";case ap:return"StrictMode";case Rb:return"Suspense";case Tb:return"SuspenseList";case Cb:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case pc:return"Portal";case wa:return e.displayName||"Context";case xb:return(e._context.displayName||"Context")+".Consumer";case id:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sp:return t=e.displayName||null,t!==null?t:z(e.type)||"Memo";case tr:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}function te(e){return typeof e.tag=="number"?H(e):typeof e.name=="string"?e.name:null}function H(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return z(t);case 8:return t===ap?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var r=t.length-1;0<=r;r--)if(typeof t[r].name=="string")return t[r].name}if(e.return!==null)return H(e.return)}return null}function J(e){return{current:e}}function N(e,t){0>es?console.error("Unexpected pop."):(t!==Db[es]&&console.error("Unexpected Fiber popped."),e.current=Ob[es],Ob[es]=null,Db[es]=null,es--)}function P(e,t,r){es++,Ob[es]=e.current,Db[es]=r,e.current=t}function ne(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function Z(e,t){P(Gs,t,e),P(ld,e,e),P(qs,null,e);var r=t.nodeType;switch(r){case 9:case 11:r=r===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?kR(t):ms;break;default:if(r=t.tagName,t=t.namespaceURI)t=kR(t),t=LR(t,r);else switch(r){case"svg":t=Qc;break;case"math":t=rm;break;default:t=ms}}r=r.toLowerCase(),r=Ow(null,r),r={context:t,ancestorInfo:r},N(qs,e),P(qs,r,e)}function j(e){N(qs,e),N(ld,e),N(Gs,e)}function oe(){return ne(qs.current)}function I(e){e.memoizedState!==null&&P(ip,e,e);var t=ne(qs.current),r=e.type,i=LR(t.context,r);r=Ow(t.ancestorInfo,r),i={context:i,ancestorInfo:r},t!==i&&(P(ld,e,e),P(qs,i,e))}function ie(e){ld.current===e&&(N(qs,e),N(ld,e)),ip.current===e&&(N(ip,e),Zd._currentValue=xl)}function pe(){}function L(){if(cd===0){uT=console.log,dT=console.info,fT=console.warn,hT=console.error,pT=console.group,mT=console.groupCollapsed,gT=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}cd++}function ce(){if(cd--,cd===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Dt({},e,{value:uT}),info:Dt({},e,{value:dT}),warn:Dt({},e,{value:fT}),error:Dt({},e,{value:hT}),group:Dt({},e,{value:pT}),groupCollapsed:Dt({},e,{value:mT}),groupEnd:Dt({},e,{value:gT})})}0>cd&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function ae(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
76
+ */return(function(){function o(e,t){for(e=e.memoizedState;e!==null&&0<t;)e=e.next,t--;return e}function n(e,t,r,i){if(r>=t.length)return i;var u=t[r],d=Qn(e)?e.slice():Dt({},e);return d[u]=n(e[u],t,r+1,i),d}function a(e,t,r){if(t.length!==r.length)console.warn("copyWithRename() expects paths of the same length");else{for(var i=0;i<r.length-1;i++)if(t[i]!==r[i]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return s(e,t,r,0)}}function s(e,t,r,i){var u=t[i],d=Qn(e)?e.slice():Dt({},e);return i+1===t.length?(d[r[i]]=d[u],Qn(d)?d.splice(u,1):delete d[u]):d[u]=s(e[u],t,r,i+1),d}function l(e,t,r){var i=t[r],u=Qn(e)?e.slice():Dt({},e);return r+1===t.length?(Qn(u)?u.splice(i,1):delete u[i],u):(u[i]=l(e[i],t,r+1),u)}function c(){return!1}function f(){return null}function h(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function g(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function m(){}function b(){}function p(e){var t=[];return e.forEach(function(r){t.push(r)}),t.sort().join(", ")}function v(e,t,r,i){return new yk(e,t,r,i)}function w(e,t){e.context===Zs&&(mb(e.current,2,t,e,null,null),lc())}function E(e,t){if(wr!==null){var r=t.staleFamilies;t=t.updatedFamilies,Ku(),nE(e.current,t,r),lc()}}function T(e){wr=e}function C(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function A(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function k(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function U(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function M(e){if(A(e)!==e)throw Error("Unable to find node on an unmounted component.")}function Y(e){var t=e.alternate;if(!t){if(t=A(e),t===null)throw Error("Unable to find node on an unmounted component.");return t!==e?null:e}for(var r=e,i=t;;){var u=r.return;if(u===null)break;var d=u.alternate;if(d===null){if(i=u.return,i!==null){r=i;continue}break}if(u.child===d.child){for(d=u.child;d;){if(d===r)return M(u),e;if(d===i)return M(u),t;d=d.sibling}throw Error("Unable to find node on an unmounted component.")}if(r.return!==i.return)r=u,i=d;else{for(var y=!1,S=u.child;S;){if(S===r){y=!0,r=u,i=d;break}if(S===i){y=!0,i=u,r=d;break}S=S.sibling}if(!y){for(S=d.child;S;){if(S===r){y=!0,r=d,i=u;break}if(S===i){y=!0,i=d,r=u;break}S=S.sibling}if(!y)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(r.alternate!==i)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(r.tag!==3)throw Error("Unable to find node on an unmounted component.");return r.stateNode.current===r?e:t}function $(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=$(e),t!==null)return t;e=e.sibling}return null}function _(e){return e===null||typeof e!="object"?null:(e=cT&&e[cT]||e["@@iterator"],typeof e=="function"?e:null)}function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===HL?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case mc:return"Fragment";case Eb:return"Profiler";case ap:return"StrictMode";case Rb:return"Suspense";case Tb:return"SuspenseList";case Cb:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case pc:return"Portal";case wa:return e.displayName||"Context";case xb:return(e._context.displayName||"Context")+".Consumer";case id:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case sp:return t=e.displayName||null,t!==null?t:z(e.type)||"Memo";case tr:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}function te(e){return typeof e.tag=="number"?H(e):typeof e.name=="string"?e.name:null}function H(e){var t=e.type;switch(e.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(t._context.displayName||"Context")+".Consumer";case 10:return t.displayName||"Context";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return z(t);case 8:return t===ap?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;break;case 29:if(t=e._debugInfo,t!=null){for(var r=t.length-1;0<=r;r--)if(typeof t[r].name=="string")return t[r].name}if(e.return!==null)return H(e.return)}return null}function J(e){return{current:e}}function N(e,t){0>es?console.error("Unexpected pop."):(t!==Db[es]&&console.error("Unexpected Fiber popped."),e.current=Ob[es],Ob[es]=null,Db[es]=null,es--)}function P(e,t,r){es++,Ob[es]=e.current,Db[es]=r,e.current=t}function ne(e){return e===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function Z(e,t){P(Gs,t,e),P(ld,e,e),P(qs,null,e);var r=t.nodeType;switch(r){case 9:case 11:r=r===9?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?kR(t):ms;break;default:if(r=t.tagName,t=t.namespaceURI)t=kR(t),t=LR(t,r);else switch(r){case"svg":t=Qc;break;case"math":t=rm;break;default:t=ms}}r=r.toLowerCase(),r=Ow(null,r),r={context:t,ancestorInfo:r},N(qs,e),P(qs,r,e)}function j(e){N(qs,e),N(ld,e),N(Gs,e)}function oe(){return ne(qs.current)}function I(e){e.memoizedState!==null&&P(ip,e,e);var t=ne(qs.current),r=e.type,i=LR(t.context,r);r=Ow(t.ancestorInfo,r),i={context:i,ancestorInfo:r},t!==i&&(P(ld,e,e),P(qs,i,e))}function ie(e){ld.current===e&&(N(qs,e),N(ld,e)),ip.current===e&&(N(ip,e),Zd._currentValue=xl)}function pe(){}function L(){if(cd===0){uT=console.log,dT=console.info,fT=console.warn,hT=console.error,pT=console.group,mT=console.groupCollapsed,gT=console.groupEnd;var e={configurable:!0,enumerable:!0,value:pe,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}cd++}function ce(){if(cd--,cd===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Dt({},e,{value:uT}),info:Dt({},e,{value:dT}),warn:Dt({},e,{value:fT}),error:Dt({},e,{value:hT}),group:Dt({},e,{value:pT}),groupCollapsed:Dt({},e,{value:mT}),groupEnd:Dt({},e,{value:gT})})}0>cd&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function se(e){var t=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith(`Error: react-stack-top-frame
77
77
  `)&&(e=e.slice(29)),t=e.indexOf(`
78
78
  `),t!==-1&&(e=e.slice(t+1)),t=e.indexOf("react_stack_bottom_frame"),t!==-1&&(t=e.lastIndexOf(`
79
79
  `,t)),t!==-1)e=e.slice(0,t);else return"";return e}function me(e){if(Ab===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ab=t&&t[1]||"",yT=-1<r.stack.indexOf(`
@@ -81,13 +81,13 @@ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix
81
81
  `+Ab+e+yT}function Te(e,t){if(!e||Nb)return"";var r=Mb.get(e);if(r!==void 0)return r;Nb=!0,r=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var i=null;i=fe.H,fe.H=null,L();try{var u={DetermineComponentFrameRoot:function(){try{if(t){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(ke){var le=ke}Reflect.construct(e,[],F)}else{try{F.call()}catch(ke){le=ke}e.call(F.prototype)}}else{try{throw Error()}catch(ke){le=ke}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(ke){if(ke&&le&&typeof ke.stack=="string")return[ke.stack,le.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=u.DetermineComponentFrameRoot(),S=y[0],R=y[1];if(S&&R){var O=S.split(`
82
82
  `),W=R.split(`
83
83
  `);for(y=d=0;d<O.length&&!O[d].includes("DetermineComponentFrameRoot");)d++;for(;y<W.length&&!W[y].includes("DetermineComponentFrameRoot");)y++;if(d===O.length||y===W.length)for(d=O.length-1,y=W.length-1;1<=d&&0<=y&&O[d]!==W[y];)y--;for(;1<=d&&0<=y;d--,y--)if(O[d]!==W[y]){if(d!==1||y!==1)do if(d--,y--,0>y||O[d]!==W[y]){var K=`
84
- `+O[d].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),typeof e=="function"&&Mb.set(e,K),K}while(1<=d&&0<=y);break}}}finally{Nb=!1,fe.H=i,ce(),Error.prepareStackTrace=r}return O=(O=e?e.displayName||e.name:"")?me(O):"",typeof e=="function"&&Mb.set(e,O),O}function Ue(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==t&&t!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return me("Activity");default:return""}}function ve(e){try{var t="",r=null;do{t+=Ue(e,r);var i=e._debugInfo;if(i)for(var u=i.length-1;0<=u;u--){var d=i[u];if(typeof d.name=="string"){var y=t;e:{var S=d.name,R=d.env,O=d.debugLocation;if(O!=null){var W=ae(O),K=W.lastIndexOf(`
84
+ `+O[d].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),typeof e=="function"&&Mb.set(e,K),K}while(1<=d&&0<=y);break}}}finally{Nb=!1,fe.H=i,ce(),Error.prepareStackTrace=r}return O=(O=e?e.displayName||e.name:"")?me(O):"",typeof e=="function"&&Mb.set(e,O),O}function Ue(e,t){switch(e.tag){case 26:case 27:case 5:return me(e.type);case 16:return me("Lazy");case 13:return e.child!==t&&t!==null?me("Suspense Fallback"):me("Suspense");case 19:return me("SuspenseList");case 0:case 15:return Te(e.type,!1);case 11:return Te(e.type.render,!1);case 1:return Te(e.type,!0);case 31:return me("Activity");default:return""}}function ve(e){try{var t="",r=null;do{t+=Ue(e,r);var i=e._debugInfo;if(i)for(var u=i.length-1;0<=u;u--){var d=i[u];if(typeof d.name=="string"){var y=t;e:{var S=d.name,R=d.env,O=d.debugLocation;if(O!=null){var W=se(O),K=W.lastIndexOf(`
85
85
  `),F=K===-1?W:W.slice(K+1);if(F.indexOf(S)!==-1){var le=`
86
86
  `+F;break e}}le=me(S+(R?" ["+R+"]":""))}t=y+le}}r=e,e=e.return}while(e);return t}catch(ke){return`
87
87
  Error generating stack: `+ke.message+`
88
- `+ke.stack}}function ze(e){return(e=e?e.displayName||e.name:"")?me(e):""}function je(){if(nr===null)return null;var e=nr._debugOwner;return e!=null?te(e):null}function at(){if(nr===null)return"";var e=nr;try{var t="";switch(e.tag===6&&(e=e.return),e.tag){case 26:case 27:case 5:t+=me(e.type);break;case 13:t+=me("Suspense");break;case 19:t+=me("SuspenseList");break;case 31:t+=me("Activity");break;case 30:case 0:case 15:case 1:e._debugOwner||t!==""||(t+=ze(e.type));break;case 11:e._debugOwner||t!==""||(t+=ze(e.type.render))}for(;e;)if(typeof e.tag=="number"){var r=e;e=r._debugOwner;var i=r._debugStack;if(e&&i){var u=ae(i);u!==""&&(t+=`
88
+ `+ke.stack}}function ze(e){return(e=e?e.displayName||e.name:"")?me(e):""}function je(){if(nr===null)return null;var e=nr._debugOwner;return e!=null?te(e):null}function at(){if(nr===null)return"";var e=nr;try{var t="";switch(e.tag===6&&(e=e.return),e.tag){case 26:case 27:case 5:t+=me(e.type);break;case 13:t+=me("Suspense");break;case 19:t+=me("SuspenseList");break;case 31:t+=me("Activity");break;case 30:case 0:case 15:case 1:e._debugOwner||t!==""||(t+=ze(e.type));break;case 11:e._debugOwner||t!==""||(t+=ze(e.type.render))}for(;e;)if(typeof e.tag=="number"){var r=e;e=r._debugOwner;var i=r._debugStack;if(e&&i){var u=se(i);u!==""&&(t+=`
89
89
  `+u)}}else if(e.debugStack!=null){var d=e.debugStack;(e=e.owner)&&d&&(t+=`
90
- `+ae(d))}else break;var y=t}catch(S){y=`
90
+ `+se(d))}else break;var y=t}catch(S){y=`
91
91
  Error generating stack: `+S.message+`
92
92
  `+S.stack}return y}function xe(e,t,r,i,u,d,y){var S=nr;he(e);try{return e!==null&&e._debugTask?e._debugTask.run(t.bind(null,r,i,u,d,y)):t(r,i,u,d,y)}finally{he(S)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function he(e){fe.getCurrentStack=e===null?null:at,Ea=!1,nr=e}function we(e){return typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function De(e){try{return Ye(e),!1}catch{return!0}}function Ye(e){return""+e}function Re(e,t){if(De(e))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",t,we(e)),Ye(e)}function Ae(e,t){if(De(e))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",t,we(e)),Ye(e)}function Le(e){if(De(e))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",we(e)),Ye(e)}function tt(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled)return!0;if(!t.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{yc=t.inject(e),vo=t}catch(r){console.error("React instrumentation encountered an error: %o.",r)}return!!t.checkDCE}function Ce(e){if(typeof qL=="function"&&GL(e),vo&&typeof vo.setStrictMode=="function")try{vo.setStrictMode(yc,e)}catch(t){xa||(xa=!0,console.error("React instrumentation encountered an error: %o",t))}}function ot(e){return e>>>=0,e===0?32:31-(XL(e)/QL|0)|0}function gt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function yt(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var u=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~d,i!==0?u=gt(i):(y&=S,y!==0?u=gt(y):r||(r=S&~e,r!==0&&(u=gt(r))))):(S=i&~d,S!==0?u=gt(S):y!==0?u=gt(y):r||(r=i&~e,r!==0&&(u=gt(r)))),u===0?0:t!==0&&t!==u&&(t&d)===0&&(d=u&-u,r=t&-t,d>=r||d===32&&(r&4194048)!==0)?t:u}function ht(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $t(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function on(){var e=up;return up<<=1,(up&62914560)===0&&(up=4194304),e}function bn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Pt(e,t,r,i,u,d){var y=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,O=e.hiddenUpdates;for(r=y&~r;0<r;){var W=31-Oo(r),K=1<<W;S[W]=0,R[W]=-1;var F=O[W];if(F!==null)for(O[W]=null,W=0;W<F.length;W++){var le=F[W];le!==null&&(le.lane&=-536870913)}r&=~K}i!==0&&Ft(e,i,0),d!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function Ft(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Oo(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function vn(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Oo(r),u=1<<i;u&t|e[i]&t&&(e[i]|=t),r&=~u}}function ln(e,t){var r=t&-t;return r=(r&42)!==0?1:Zn(r),(r&(e.suspendedLanes|t))!==0?0:r}function Zn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function hn(e,t,r){if(Ra)for(e=e.pendingUpdatersLaneMap;0<r;){var i=31-Oo(r),u=1<<i;e[i].add(t),r&=~u}}function co(e,t){if(Ra)for(var r=e.pendingUpdatersLaneMap,i=e.memoizedUpdaters;0<t;){var u=31-Oo(t);e=1<<u,u=r[u],0<u.size&&(u.forEach(function(d){var y=d.alternate;y!==null&&i.has(y)||i.add(d)}),u.clear()),t&=~e}}function uo(e){return e&=-e,br<e?Ta<e?(e&134217727)!==0?ts:dp:Ta:br}function Un(){var e=Qt.p;return e!==0?e:(e=window.event,e===void 0?ts:nT(e.type))}function D(e,t){var r=Qt.p;try{return Qt.p=e,t()}finally{Qt.p=r}}function G(e){delete e[mo],delete e[Do],delete e[zb],delete e[WL],delete e[KL]}function ge(e){var t=e[mo];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Qs]||r[mo]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=VR(e);e!==null;){if(r=e[mo])return r;e=VR(e)}return t}e=r,r=e.parentNode}return null}function ye(e){if(e=e[mo]||e[Qs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ne(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function $e(e){var t=e[bT];return t||(t=e[bT]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Se(e){e[ud]=!0}function Ke(e,t){Ve(e,t),Ve(e+"Capture",t)}function Ve(e,t){el[e]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",e),el[e]=t;var r=e.toLowerCase();for(jb[r]=e,e==="onDoubleClick"&&(jb.ondblclick=e),e=0;e<t.length;e++)vT.add(t[e])}function Rt(e,t){JL[t.type]||t.onChange||t.onInput||t.readOnly||t.disabled||t.value==null||console.error(e==="select"?"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`.":"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),t.onChange||t.readOnly||t.disabled||t.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function Cn(e){return Fr.call(wT,e)?!0:Fr.call(ST,e)?!1:ZL.test(e)?wT[e]=!0:(ST[e]=!0,console.error("Invalid attribute name: `%s`",e),!1)}function rn(e,t,r){if(Cn(t)){if(!e.hasAttribute(t)){switch(typeof r){case"symbol":case"object":return r;case"function":return r;case"boolean":if(r===!1)return r}return r===void 0?void 0:null}return e=e.getAttribute(t),e===""&&r===!0?!0:(Re(r,t),e===""+r?r:e)}}function xn(e,t,r){if(Cn(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}Re(r,t),e.setAttribute(t,""+r)}}function Xo(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}Re(r,t),e.setAttribute(t,""+r)}}function B(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}Re(i,r),e.setAttributeNS(t,r,""+i)}}function Q(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return Le(e),e;default:return""}}function ue(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ee(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(y){Le(y),r=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(y){Le(y),r=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Me(e){if(!e._valueTracker){var t=ue(e)?"checked":"value";e._valueTracker=Ee(e,t,""+e[t])}}function Je(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=ue(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ze(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Pe(e){return e.replace(eU,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Fe(e,t){t.checked===void 0||t.defaultChecked===void 0||xT||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",je()||"A component",t.type),xT=!0),t.value===void 0||t.defaultValue===void 0||ET||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",je()||"A component",t.type),ET=!0)}function Xe(e,t,r,i,u,d,y,S){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?(Re(y,"type"),e.type=y):e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Q(t)):e.value!==""+Q(t)&&(e.value=""+Q(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?et(e,y,Q(t)):r!=null?et(e,y,Q(r)):i!=null&&e.removeAttribute("value"),u==null&&d!=null&&(e.defaultChecked=!!d),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?(Re(S,"name"),e.name=""+Q(S)):e.removeAttribute("name")}function ut(e,t,r,i,u,d,y,S){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(Re(d,"type"),e.type=d),t!=null||r!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Me(e);return}r=r!=null?""+Q(r):"",t=t!=null?""+Q(t):r,S||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(Re(y,"name"),e.name=y),Me(e)}function et(e,t,r){t==="number"&&Ze(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function vt(e,t){t.value==null&&(typeof t.children=="object"&&t.children!==null?wb.Children.forEach(t.children,function(r){r==null||typeof r=="string"||typeof r=="number"||typeof r=="bigint"||TT||(TT=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):t.dangerouslySetInnerHTML==null||CT||(CT=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),t.selected==null||RT||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),RT=!0)}function _t(){var e=je();return e?`
93
93
 
@@ -295,10 +295,10 @@ You might need to use a local HTTP server (instead of file://): https://react.de
295
295
  * LICENSE.md file in the root directory of this source tree.
296
296
  *
297
297
  * @license MIT
298
- */var GA=o=>{throw TypeError(o)},N3=(o,n,a)=>n.has(o)||GA("Cannot "+a),r0=(o,n,a)=>(N3(o,n,"read from private field"),a?a.call(o):n.get(o)),M3=(o,n,a)=>n.has(o)?GA("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,a),wO="popstate";function _3(o={}){function n(s,l){let{pathname:c,search:f,hash:h}=s.location;return Cf("",{pathname:c,search:f,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function a(s,l){return typeof l=="string"?l:Va(l)}return L3(n,a,null,o)}function Mt(o,n){if(o===!1||o===null||typeof o>"u")throw new Error(n)}function qn(o,n){if(!o){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function k3(){return Math.random().toString(36).substring(2,10)}function EO(o,n){return{usr:o.state,key:o.key,idx:n}}function Cf(o,n,a=null,s){return{pathname:typeof o=="string"?o:o.pathname,search:"",hash:"",...typeof n=="string"?Ui(n):n,state:a,key:n&&n.key||s||k3()}}function Va({pathname:o="/",search:n="",hash:a=""}){return n&&n!=="?"&&(o+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(o+=a.charAt(0)==="#"?a:"#"+a),o}function Ui(o){let n={};if(o){let a=o.indexOf("#");a>=0&&(n.hash=o.substring(a),o=o.substring(0,a));let s=o.indexOf("?");s>=0&&(n.search=o.substring(s),o=o.substring(0,s)),o&&(n.pathname=o)}return n}function L3(o,n,a,s={}){let{window:l=document.defaultView,v5Compat:c=!1}=s,f=l.history,h="POP",g=null,m=b();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function b(){return(f.state||{idx:null}).idx}function p(){h="POP";let C=b(),A=C==null?null:C-m;m=C,g&&g({action:h,location:T.location,delta:A})}function v(C,A){h="PUSH";let k=Cf(T.location,C,A);m=b()+1;let U=EO(k,m),M=T.createHref(k);try{f.pushState(U,"",M)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;l.location.assign(M)}c&&g&&g({action:h,location:T.location,delta:1})}function w(C,A){h="REPLACE";let k=Cf(T.location,C,A);m=b();let U=EO(k,m),M=T.createHref(k);f.replaceState(U,"",M),c&&g&&g({action:h,location:T.location,delta:0})}function E(C){return XA(C)}let T={get action(){return h},get location(){return o(l,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(wO,p),g=C,()=>{l.removeEventListener(wO,p),g=null}},createHref(C){return n(l,C)},createURL:E,encodeLocation(C){let A=E(C);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:v,replace:w,go(C){return f.go(C)}};return T}function XA(o,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Mt(a,"No window.location.(origin|href) available to create URL");let s=typeof o=="string"?o:Va(o);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=a+s),new URL(s,a)}var mf,xO=class{constructor(o){if(M3(this,mf,new Map),o)for(let[n,a]of o)this.set(n,a)}get(o){if(r0(this,mf).has(o))return r0(this,mf).get(o);if(o.defaultValue!==void 0)return o.defaultValue;throw new Error("No value found for context")}set(o,n){r0(this,mf).set(o,n)}};mf=new WeakMap;var U3=new Set(["lazy","caseSensitive","path","id","index","children"]);function z3(o){return U3.has(o)}var j3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function P3(o){return j3.has(o)}function H3(o){return o.index===!0}function Of(o,n,a=[],s={},l=!1){return o.map((c,f)=>{let h=[...a,String(f)],g=typeof c.id=="string"?c.id:h.join("-");if(Mt(c.index!==!0||!c.children,"Cannot specify children on an index route"),Mt(l||!s[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),H3(c)){let m={...c,id:g};return s[g]=RO(m,n(m)),m}else{let m={...c,id:g,children:void 0};return s[g]=RO(m,n(m)),c.children&&(m.children=Of(c.children,n,h,s,l)),m}})}function RO(o,n){return Object.assign(o,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...o.lazy,...n.lazy}}:{}})}function wi(o,n,a="/"){return gf(o,n,a,!1)}function gf(o,n,a,s){let l=typeof n=="string"?Ui(n):n,c=zr(l.pathname||"/",a);if(c==null)return null;let f=QA(o);B3(f);let h=null;for(let g=0;h==null&&g<f.length;++g){let m=J3(c);h=W3(f[g],m,s)}return h}function I3(o,n){let{route:a,pathname:s,params:l}=o;return{id:a.id,pathname:s,params:l,data:n[a.id],loaderData:n[a.id],handle:a.handle}}function QA(o,n=[],a=[],s="",l=!1){let c=(f,h,g=l,m)=>{let b={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&g)return;Mt(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let p=Ha([s,b.relativePath]),v=a.concat(b);f.children&&f.children.length>0&&(Mt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),QA(f.children,n,v,p,g)),!(f.path==null&&!f.index)&&n.push({path:p,score:X3(p,f.index),routesMeta:v})};return o.forEach((f,h)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))c(f,h);else for(let m of WA(f.path))c(f,h,!0,m)}),n}function WA(o){let n=o.split("/");if(n.length===0)return[];let[a,...s]=n,l=a.endsWith("?"),c=a.replace(/\?$/,"");if(s.length===0)return l?[c,""]:[c];let f=WA(s.join("/")),h=[];return h.push(...f.map(g=>g===""?c:[c,g].join("/"))),l&&h.push(...f),h.map(g=>o.startsWith("/")&&g===""?"/":g)}function B3(o){o.sort((n,a)=>n.score!==a.score?a.score-n.score:Q3(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var V3=/^:[\w-]+$/,F3=3,Y3=2,$3=1,q3=10,G3=-2,TO=o=>o==="*";function X3(o,n){let a=o.split("/"),s=a.length;return a.some(TO)&&(s+=G3),n&&(s+=Y3),a.filter(l=>!TO(l)).reduce((l,c)=>l+(V3.test(c)?F3:c===""?$3:q3),s)}function Q3(o,n){return o.length===n.length&&o.slice(0,-1).every((s,l)=>s===n[l])?o[o.length-1]-n[n.length-1]:0}function W3(o,n,a=!1){let{routesMeta:s}=o,l={},c="/",f=[];for(let h=0;h<s.length;++h){let g=s[h],m=h===s.length-1,b=c==="/"?n:n.slice(c.length)||"/",p=Df({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},b),v=g.route;if(!p&&m&&a&&!s[s.length-1].route.index&&(p=Df({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!p)return null;Object.assign(l,p.params),f.push({params:l,pathname:Ha([c,p.pathname]),pathnameBase:tj(Ha([c,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(c=Ha([c,p.pathnameBase]))}return f}function Df(o,n){typeof o=="string"&&(o={path:o,caseSensitive:!1,end:!0});let[a,s]=K3(o.path,o.caseSensitive,o.end),l=n.match(a);if(!l)return null;let c=l[0],f=c.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:s.reduce((m,{paramName:b,isOptional:p},v)=>{if(b==="*"){let E=h[v]||"";f=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const w=h[v];return p&&!w?m[b]=void 0:m[b]=(w||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:f,pattern:o}}function K3(o,n=!1,a=!0){qn(o==="*"||!o.endsWith("*")||o.endsWith("/*"),`Route path "${o}" will be treated as if it were "${o.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${o.replace(/\*$/,"/*")}".`);let s=[],l="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,g)=>(s.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return o.endsWith("*")?(s.push({paramName:"*"}),l+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":o!==""&&o!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),s]}function J3(o){try{return o.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return qn(!1,`The URL path "${o}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),o}}function zr(o,n){if(n==="/")return o;if(!o.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=o.charAt(a);return s&&s!=="/"?null:o.slice(a)||"/"}function Z3({basename:o,pathname:n}){return n==="/"?o:Ha([o,n])}var KA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MS=o=>KA.test(o);function ej(o,n="/"){let{pathname:a,search:s="",hash:l=""}=typeof o=="string"?Ui(o):o,c;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?c=CO(a.substring(1),"/"):c=CO(a,n)):c=n,{pathname:c,search:nj(s),hash:oj(l)}}function CO(o,n){let a=n.replace(/\/+$/,"").split("/");return o.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function a0(o,n,a,s){return`Cannot include a '${o}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function JA(o){return o.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function _S(o){let n=JA(o);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function kS(o,n,a,s=!1){let l;typeof o=="string"?l=Ui(o):(l={...o},Mt(!l.pathname||!l.pathname.includes("?"),a0("?","pathname","search",l)),Mt(!l.pathname||!l.pathname.includes("#"),a0("#","pathname","hash",l)),Mt(!l.search||!l.search.includes("#"),a0("#","search","hash",l)));let c=o===""||l.pathname==="",f=c?"/":l.pathname,h;if(f==null)h=a;else{let p=n.length-1;if(!s&&f.startsWith("..")){let v=f.split("/");for(;v[0]==="..";)v.shift(),p-=1;l.pathname=v.join("/")}h=p>=0?n[p]:"/"}let g=ej(l,h),m=f&&f!=="/"&&f.endsWith("/"),b=(c||f===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(m||b)&&(g.pathname+="/"),g}var Ha=o=>o.join("/").replace(/\/\/+/g,"/"),tj=o=>o.replace(/\/+$/,"").replace(/^\/*/,"/"),nj=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,oj=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,Ff=class{constructor(o,n,a,s=!1){this.status=o,this.statusText=n||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Af(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}function Yf(o){return o.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ZA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eN(o,n){let a=o;if(typeof a!="string"||!KA.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,l=!1;if(ZA)try{let c=new URL(window.location.href),f=a.startsWith("//")?new URL(c.protocol+a):new URL(a),h=zr(f.pathname,n);f.origin===c.origin&&h!=null?a=h+f.search+f.hash:l=!0}catch{qn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:a}}var Ni=Symbol("Uninstrumented");function rj(o,n){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};o.forEach(l=>l({id:n.id,index:n.index,path:n.path,instrument(c){let f=Object.keys(a);for(let h of f)c[h]&&a[h].push(c[h])}}));let s={};if(typeof n.lazy=="function"&&a.lazy.length>0){let l=nu(a.lazy,n.lazy,()=>{});l&&(s.lazy=l)}if(typeof n.lazy=="object"){let l=n.lazy;["middleware","loader","action"].forEach(c=>{let f=l[c],h=a[`lazy.${c}`];if(typeof f=="function"&&h.length>0){let g=nu(h,f,()=>{});g&&(s.lazy=Object.assign(s.lazy||{},{[c]:g}))}})}return["loader","action"].forEach(l=>{let c=n[l];if(typeof c=="function"&&a[l].length>0){let f=c[Ni]??c,h=nu(a[l],f,(...g)=>OO(g[0]));h&&(l==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[Ni]=f,s[l]=h)}}),n.middleware&&n.middleware.length>0&&a.middleware.length>0&&(s.middleware=n.middleware.map(l=>{let c=l[Ni]??l,f=nu(a.middleware,c,(...h)=>OO(h[0]));return f?(f[Ni]=c,f):l})),s}function aj(o,n){let a={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(l){let c=Object.keys(l);for(let f of c)l[f]&&a[f].push(l[f])}})),a.navigate.length>0){let s=o.navigate[Ni]??o.navigate,l=nu(a.navigate,s,(...c)=>{let[f,h]=c;return{to:typeof f=="number"||typeof f=="string"?f:f?Va(f):".",...DO(o,h??{})}});l&&(l[Ni]=s,o.navigate=l)}if(a.fetch.length>0){let s=o.fetch[Ni]??o.fetch,l=nu(a.fetch,s,(...c)=>{let[f,,h,g]=c;return{href:h??".",fetcherKey:f,...DO(o,g??{})}});l&&(l[Ni]=s,o.fetch=l)}return o}function nu(o,n,a){return o.length===0?null:async(...s)=>{let l=await tN(o,a(...s),()=>n(...s),o.length-1);if(l.type==="error")throw l.value;return l.value}}async function tN(o,n,a,s){let l=o[s],c;if(l){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=tN(o,n,a,s-1),c=await f,Mt(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await l(h,n)}catch(g){console.error("An instrumentation function threw an error:",g)}f||await h(),await f}else try{c={type:"success",value:await a()}}catch(f){c={type:"error",value:f}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function OO(o){let{request:n,context:a,params:s,unstable_pattern:l}=o;return{request:sj(n),params:{...s},unstable_pattern:l,context:ij(a)}}function DO(o,n){return{currentUrl:Va(o.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function sj(o){return{method:o.method,url:o.url,headers:{get:(...n)=>o.headers.get(...n)}}}function ij(o){if(cj(o)){let n={...o};return Object.freeze(n),n}else return{get:n=>o.get(n)}}var lj=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cj(o){if(o===null||typeof o!="object")return!1;const n=Object.getPrototypeOf(o);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===lj}var nN=["POST","PUT","PATCH","DELETE"],uj=new Set(nN),dj=["GET",...nN],fj=new Set(dj),oN=new Set([301,302,303,307,308]),hj=new Set([307,308]),s0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},pj={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},mj=o=>({hasErrorBoundary:!!o.hasErrorBoundary}),rN="remix-router-transitions",aN=Symbol("ResetLoaderData");function gj(o){const n=o.window?o.window:typeof window<"u"?window:void 0,a=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Mt(o.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=o.hydrationRouteProperties||[],l=o.mapRouteProperties||mj,c=l;if(o.unstable_instrumentations){let B=o.unstable_instrumentations;c=Q=>({...l(Q),...rj(B.map(ue=>ue.route).filter(Boolean),Q)})}let f={},h=Of(o.routes,c,void 0,f),g,m=o.basename||"/";m.startsWith("/")||(m=`/${m}`);let b=o.dataStrategy||wj,p={...o.future},v=null,w=new Set,E=null,T=null,C=null,A=o.hydrationData!=null,k=wi(h,o.history.location,m),U=!1,M=null,Y;if(k==null&&!o.patchRoutesOnNavigation){let B=_r(404,{pathname:o.history.location.pathname}),{matches:Q,route:ue}=pm(h);Y=!0,k=Q,M={[ue.id]:B}}else if(k&&!o.hydrationData&&Rt(k,h,o.history.location.pathname).active&&(k=null),k)if(k.some(B=>B.route.lazy))Y=!1;else if(!k.some(B=>LS(B.route)))Y=!0;else{let B=o.hydrationData?o.hydrationData.loaderData:null,Q=o.hydrationData?o.hydrationData.errors:null;if(Q){let ue=k.findIndex(Ee=>Q[Ee.route.id]!==void 0);Y=k.slice(0,ue+1).every(Ee=>!J0(Ee.route,B,Q))}else Y=k.every(ue=>!J0(ue.route,B,Q))}else{Y=!1,k=[];let B=Rt(null,h,o.history.location.pathname);B.active&&B.matches&&(U=!0,k=B.matches)}let $,_={historyAction:o.history.action,location:o.history.location,matches:k,initialized:Y,navigation:s0,restoreScrollPosition:o.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:o.hydrationData&&o.hydrationData.loaderData||{},actionData:o.hydrationData&&o.hydrationData.actionData||null,errors:o.hydrationData&&o.hydrationData.errors||M,fetchers:new Map,blockers:new Map},z="POP",te=null,H=!1,J,N=!1,P=new Map,ne=null,Z=!1,j=!1,oe=new Set,I=new Map,ie=0,pe=-1,L=new Map,ce=new Set,ae=new Map,me=new Map,Te=new Set,Ue=new Map,ve,ze=null;function je(){if(v=o.history.listen(({action:B,location:Q,delta:ue})=>{if(ve){ve(),ve=void 0;return}qn(Ue.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ee=ye({currentLocation:_.location,nextLocation:Q,historyAction:B});if(Ee&&ue!=null){let Me=new Promise(Je=>{ve=Je});o.history.go(ue*-1),ge(Ee,{state:"blocked",location:Q,proceed(){ge(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Me.then(()=>o.history.go(ue))},reset(){let Je=new Map(_.blockers);Je.set(Ee,rf),he({blockers:Je})}}),te==null||te.resolve(),te=null;return}return Re(B,Q)}),a){Hj(n,P);let B=()=>Ij(n,P);n.addEventListener("pagehide",B),ne=()=>n.removeEventListener("pagehide",B)}return _.initialized||Re("POP",_.location,{initialHydration:!0}),$}function at(){v&&v(),ne&&ne(),w.clear(),J&&J.abort(),_.fetchers.forEach((B,Q)=>ln(Q)),_.blockers.forEach((B,Q)=>G(Q))}function xe(B){return w.add(B),()=>w.delete(B)}function he(B,Q={}){B.matches&&(B.matches=B.matches.map(Me=>{let Je=f[Me.route.id],Ze=Me.route;return Ze.element!==Je.element||Ze.errorElement!==Je.errorElement||Ze.hydrateFallbackElement!==Je.hydrateFallbackElement?{...Me,route:Je}:Me})),_={..._,...B};let ue=[],Ee=[];_.fetchers.forEach((Me,Je)=>{Me.state==="idle"&&(Te.has(Je)?ue.push(Je):Ee.push(Je))}),Te.forEach(Me=>{!_.fetchers.has(Me)&&!I.has(Me)&&ue.push(Me)}),[...w].forEach(Me=>Me(_,{deletedFetchers:ue,newErrors:B.errors??null,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),ue.forEach(Me=>ln(Me)),Ee.forEach(Me=>_.fetchers.delete(Me))}function we(B,Q,{flushSync:ue}={}){var ut,et;let Ee=_.actionData!=null&&_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&_.navigation.state==="loading"&&((ut=B.state)==null?void 0:ut._isRedirect)!==!0,Me;Q.actionData?Object.keys(Q.actionData).length>0?Me=Q.actionData:Me=null:Ee?Me=_.actionData:Me=null;let Je=Q.loaderData?PO(_.loaderData,Q.loaderData,Q.matches||[],Q.errors):_.loaderData,Ze=_.blockers;Ze.size>0&&(Ze=new Map(Ze),Ze.forEach((vt,_t)=>Ze.set(_t,rf)));let Pe=Z?!1:Ve(B,Q.matches||_.matches),Fe=H===!0||_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&((et=B.state)==null?void 0:et._isRedirect)!==!0;g&&(h=g,g=void 0),Z||z==="POP"||(z==="PUSH"?o.history.push(B,B.state):z==="REPLACE"&&o.history.replace(B,B.state));let Xe;if(z==="POP"){let vt=P.get(_.location.pathname);vt&&vt.has(B.pathname)?Xe={currentLocation:_.location,nextLocation:B}:P.has(B.pathname)&&(Xe={currentLocation:B,nextLocation:_.location})}else if(N){let vt=P.get(_.location.pathname);vt?vt.add(B.pathname):(vt=new Set([B.pathname]),P.set(_.location.pathname,vt)),Xe={currentLocation:_.location,nextLocation:B}}he({...Q,actionData:Me,loaderData:Je,historyAction:z,location:B,initialized:!0,navigation:s0,revalidation:"idle",restoreScrollPosition:Pe,preventScrollReset:Fe,blockers:Ze},{viewTransitionOpts:Xe,flushSync:ue===!0}),z="POP",H=!1,N=!1,Z=!1,j=!1,te==null||te.resolve(),te=null,ze==null||ze.resolve(),ze=null}async function De(B,Q){if(te==null||te.resolve(),te=null,typeof B=="number"){te||(te=VO());let _t=te.promise;return o.history.go(B),_t}let ue=K0(_.location,_.matches,m,B,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:Ee,submission:Me,error:Je}=AO(!1,ue,Q),Ze=_.location,Pe=Cf(_.location,Ee,Q&&Q.state);Pe={...Pe,...o.history.encodeLocation(Pe)};let Fe=Q&&Q.replace!=null?Q.replace:void 0,Xe="PUSH";Fe===!0?Xe="REPLACE":Fe===!1||Me!=null&&xo(Me.formMethod)&&Me.formAction===_.location.pathname+_.location.search&&(Xe="REPLACE");let ut=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,et=(Q&&Q.flushSync)===!0,vt=ye({currentLocation:Ze,nextLocation:Pe,historyAction:Xe});if(vt){ge(vt,{state:"blocked",location:Pe,proceed(){ge(vt,{state:"proceeding",proceed:void 0,reset:void 0,location:Pe}),De(B,Q)},reset(){let _t=new Map(_.blockers);_t.set(vt,rf),he({blockers:_t})}});return}await Re(Xe,Pe,{submission:Me,pendingError:Je,preventScrollReset:ut,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:et,callSiteDefaultShouldRevalidate:Q&&Q.unstable_defaultShouldRevalidate})}function Ye(){ze||(ze=VO()),bn(),he({revalidation:"loading"});let B=ze.promise;return _.navigation.state==="submitting"?B:_.navigation.state==="idle"?(Re(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),B):(Re(z||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:N===!0}),B)}async function Re(B,Q,ue){J&&J.abort(),J=null,z=B,Z=(ue&&ue.startUninterruptedRevalidation)===!0,Ke(_.location,_.matches),H=(ue&&ue.preventScrollReset)===!0,N=(ue&&ue.enableViewTransition)===!0;let Ee=g||h,Me=ue&&ue.overrideNavigation,Je=ue!=null&&ue.initialHydration&&_.matches&&_.matches.length>0&&!U?_.matches:wi(Ee,Q,m),Ze=(ue&&ue.flushSync)===!0;if(Je&&_.initialized&&!j&&Aj(_.location,Q)&&!(ue&&ue.submission&&xo(ue.submission.formMethod))){we(Q,{matches:Je},{flushSync:Ze});return}let Pe=Rt(Je,Ee,Q.pathname);if(Pe.active&&Pe.matches&&(Je=Pe.matches),!Je){let{error:Mn,notFoundMatches:eo,route:Gt}=Ne(Q.pathname);we(Q,{matches:eo,loaderData:{},errors:{[Gt.id]:Mn}},{flushSync:Ze});return}J=new AbortController;let Fe=eu(o.history,Q,J.signal,ue&&ue.submission),Xe=o.getContext?await o.getContext():new xO,ut;if(ue&&ue.pendingError)ut=[Ei(Je).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&xo(ue.submission.formMethod)){let Mn=await Ae(Fe,Q,ue.submission,Je,Xe,Pe.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:Ze});if(Mn.shortCircuited)return;if(Mn.pendingActionResult){let[eo,Gt]=Mn.pendingActionResult;if(cr(Gt)&&Af(Gt.error)&&Gt.error.status===404){J=null,we(Q,{matches:Mn.matches,loaderData:{},errors:{[eo]:Gt.error}});return}}Je=Mn.matches||Je,ut=Mn.pendingActionResult,Me=i0(Q,ue.submission),Ze=!1,Pe.active=!1,Fe=eu(o.history,Fe.url,Fe.signal)}let{shortCircuited:et,matches:vt,loaderData:_t,errors:Sn}=await Le(Fe,Q,Je,Xe,Pe.active,Me,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,Ze,ut,ue&&ue.callSiteDefaultShouldRevalidate);et||(J=null,we(Q,{matches:vt||Je,...HO(ut),loaderData:_t,errors:Sn}))}async function Ae(B,Q,ue,Ee,Me,Je,Ze,Pe={}){bn();let Fe=jj(Q,ue);if(he({navigation:Fe},{flushSync:Pe.flushSync===!0}),Je){let et=await Cn(Ee,Q.pathname,B.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:_t,route:Sn}=pm(h);return{matches:_t,pendingActionResult:[Sn.id,{type:"error",error:et.error}]}}let vt=Ei(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[vt,{type:"error",error:et.error}]}}else if(et.matches)Ee=et.matches;else{let{notFoundMatches:vt,error:_t,route:Sn}=Ne(Q.pathname);return{matches:vt,pendingActionResult:[Sn.id,{type:"error",error:_t}]}}}let Xe,ut=Mm(Ee,Q);if(!ut.route.action&&!ut.route.lazy)Xe={type:"error",error:_r(405,{method:B.method,pathname:Q.pathname,routeId:ut.route.id})};else{let et=ou(c,f,B,Ee,ut,Ze?[]:s,Me),vt=await $t(B,et,Me,null);if(Xe=vt[ut.route.id],!Xe){for(let _t of Ee)if(vt[_t.route.id]){Xe=vt[_t.route.id];break}}if(B.signal.aborted)return{shortCircuited:!0}}if(Nl(Xe)){let et;return Pe&&Pe.replace!=null?et=Pe.replace:et=UO(Xe.response.headers.get("Location"),new URL(B.url),m,o.history)===_.location.pathname+_.location.search,await ht(B,Xe,!0,{submission:ue,replace:et}),{shortCircuited:!0}}if(cr(Xe)){let et=Ei(Ee,ut.route.id);return(Pe&&Pe.replace)!==!0&&(z="PUSH"),{matches:Ee,pendingActionResult:[et.route.id,Xe,ut.route.id]}}return{matches:Ee,pendingActionResult:[ut.route.id,Xe]}}async function Le(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe,Xe,ut,et,vt){let _t=Je||i0(Q,Ze),Sn=Ze||Pe||BO(_t),Mn=!Z&&!Xe;if(Me){if(Mn){let zn=tt(et);he({navigation:_t,...zn!==void 0?{actionData:zn}:{}},{flushSync:ut})}let Ct=await Cn(ue,Q.pathname,B.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){if(Ct.partialMatches.length===0){let{matches:_s,route:$a}=pm(h);return{matches:_s,loaderData:{},errors:{[$a.id]:Ct.error}}}let zn=Ei(Ct.partialMatches).route.id;return{matches:Ct.partialMatches,loaderData:{},errors:{[zn]:Ct.error}}}else if(Ct.matches)ue=Ct.matches;else{let{error:zn,notFoundMatches:_s,route:$a}=Ne(Q.pathname);return{matches:_s,loaderData:{},errors:{[$a.id]:zn}}}}let eo=g||h,{dsMatches:Gt,revalidatingFetchers:Ro}=NO(B,Ee,c,f,o.history,_,ue,Sn,Q,Xe?[]:s,Xe===!0,j,oe,Te,ae,ce,eo,m,o.patchRoutesOnNavigation!=null,et,vt);if(pe=++ie,!o.dataStrategy&&!Gt.some(Ct=>Ct.shouldLoad)&&!Gt.some(Ct=>Ct.route.middleware&&Ct.route.middleware.length>0)&&Ro.length===0){let Ct=uo();return we(Q,{matches:ue,loaderData:{},errors:et&&cr(et[1])?{[et[0]]:et[1].error}:null,...HO(et),...Ct?{fetchers:new Map(_.fetchers)}:{}},{flushSync:ut}),{shortCircuited:!0}}if(Mn){let Ct={};if(!Me){Ct.navigation=_t;let zn=tt(et);zn!==void 0&&(Ct.actionData=zn)}Ro.length>0&&(Ct.fetchers=Ce(Ro)),he(Ct,{flushSync:ut})}Ro.forEach(Ct=>{hn(Ct.key),Ct.controller&&I.set(Ct.key,Ct.controller)});let na=()=>Ro.forEach(Ct=>hn(Ct.key));J&&J.signal.addEventListener("abort",na);let{loaderResults:Xn,fetcherResults:To}=await on(Gt,Ro,B,Ee);if(B.signal.aborted)return{shortCircuited:!0};J&&J.signal.removeEventListener("abort",na),Ro.forEach(Ct=>I.delete(Ct.key));let to=mm(Xn);if(to)return await ht(B,to.result,!0,{replace:Fe}),{shortCircuited:!0};if(to=mm(To),to)return ce.add(to.key),await ht(B,to.result,!0,{replace:Fe}),{shortCircuited:!0};let{loaderData:Kl,errors:Pr}=jO(_,ue,Xn,et,Ro,To);Xe&&_.errors&&(Pr={..._.errors,...Pr});let gr=uo(),Ms=Un(pe),oa=gr||Ms||Ro.length>0;return{matches:ue,loaderData:Kl,errors:Pr,...oa?{fetchers:new Map(_.fetchers)}:{}}}function tt(B){if(B&&!cr(B[1]))return{[B[0]]:B[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Ce(B){return B.forEach(Q=>{let ue=_.fetchers.get(Q.key),Ee=af(void 0,ue?ue.data:void 0);_.fetchers.set(Q.key,Ee)}),new Map(_.fetchers)}async function ot(B,Q,ue,Ee){hn(B);let Me=(Ee&&Ee.flushSync)===!0,Je=g||h,Ze=K0(_.location,_.matches,m,ue,Q,Ee==null?void 0:Ee.relative),Pe=wi(Je,Ze,m),Fe=Rt(Pe,Je,Ze);if(Fe.active&&Fe.matches&&(Pe=Fe.matches),!Pe){Pt(B,Q,_r(404,{pathname:Ze}),{flushSync:Me});return}let{path:Xe,submission:ut,error:et}=AO(!0,Ze,Ee);if(et){Pt(B,Q,et,{flushSync:Me});return}let vt=o.getContext?await o.getContext():new xO,_t=(Ee&&Ee.preventScrollReset)===!0;if(ut&&xo(ut.formMethod)){await gt(B,Q,Xe,Pe,vt,Fe.active,Me,_t,ut,Ee&&Ee.unstable_defaultShouldRevalidate);return}ae.set(B,{routeId:Q,path:Xe}),await yt(B,Q,Xe,Pe,vt,Fe.active,Me,_t,ut)}async function gt(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe,Xe){bn(),ae.delete(B);let ut=_.fetchers.get(B);bt(B,Pj(Fe,ut),{flushSync:Ze});let et=new AbortController,vt=eu(o.history,ue,et.signal,Fe);if(Je){let pn=await Cn(Ee,new URL(vt.url).pathname,vt.signal,B);if(pn.type==="aborted")return;if(pn.type==="error"){Pt(B,Q,pn.error,{flushSync:Ze});return}else if(pn.matches)Ee=pn.matches;else{Pt(B,Q,_r(404,{pathname:ue}),{flushSync:Ze});return}}let _t=Mm(Ee,ue);if(!_t.route.action&&!_t.route.lazy){let pn=_r(405,{method:Fe.formMethod,pathname:ue,routeId:Q});Pt(B,Q,pn,{flushSync:Ze});return}I.set(B,et);let Sn=ie,Mn=ou(c,f,vt,Ee,_t,s,Me),eo=await $t(vt,Mn,Me,B),Gt=eo[_t.route.id];if(!Gt){for(let pn of Mn)if(eo[pn.route.id]){Gt=eo[pn.route.id];break}}if(vt.signal.aborted){I.get(B)===et&&I.delete(B);return}if(Te.has(B)){if(Nl(Gt)||cr(Gt)){bt(B,Ss(void 0));return}}else{if(Nl(Gt))if(I.delete(B),pe>Sn){bt(B,Ss(void 0));return}else return ce.add(B),bt(B,af(Fe)),ht(vt,Gt,!1,{fetcherSubmission:Fe,preventScrollReset:Pe});if(cr(Gt)){Pt(B,Q,Gt.error);return}}let Ro=_.navigation.location||_.location,na=eu(o.history,Ro,et.signal),Xn=g||h,To=_.navigation.state!=="idle"?wi(Xn,_.navigation.location,m):_.matches;Mt(To,"Didn't find any matches after fetcher action");let to=++ie;L.set(B,to);let Kl=af(Fe,Gt.data);_.fetchers.set(B,Kl);let{dsMatches:Pr,revalidatingFetchers:gr}=NO(na,Me,c,f,o.history,_,To,Fe,Ro,s,!1,j,oe,Te,ae,ce,Xn,m,o.patchRoutesOnNavigation!=null,[_t.route.id,Gt],Xe);gr.filter(pn=>pn.key!==B).forEach(pn=>{let ks=pn.key,Jl=_.fetchers.get(ks),eh=af(void 0,Jl?Jl.data:void 0);_.fetchers.set(ks,eh),hn(ks),pn.controller&&I.set(ks,pn.controller)}),he({fetchers:new Map(_.fetchers)});let Ms=()=>gr.forEach(pn=>hn(pn.key));et.signal.addEventListener("abort",Ms);let{loaderResults:oa,fetcherResults:Ct}=await on(Pr,gr,na,Me);if(et.signal.aborted)return;if(et.signal.removeEventListener("abort",Ms),L.delete(B),I.delete(B),gr.forEach(pn=>I.delete(pn.key)),_.fetchers.has(B)){let pn=Ss(Gt.data);_.fetchers.set(B,pn)}let zn=mm(oa);if(zn)return ht(na,zn.result,!1,{preventScrollReset:Pe});if(zn=mm(Ct),zn)return ce.add(zn.key),ht(na,zn.result,!1,{preventScrollReset:Pe});let{loaderData:_s,errors:$a}=jO(_,To,oa,void 0,gr,Ct);Un(to),_.navigation.state==="loading"&&to>pe?(Mt(z,"Expected pending action"),J&&J.abort(),we(_.navigation.location,{matches:To,loaderData:_s,errors:$a,fetchers:new Map(_.fetchers)})):(he({errors:$a,loaderData:PO(_.loaderData,_s,To,$a),fetchers:new Map(_.fetchers)}),j=!1)}async function yt(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe){let Xe=_.fetchers.get(B);bt(B,af(Fe,Xe?Xe.data:void 0),{flushSync:Ze});let ut=new AbortController,et=eu(o.history,ue,ut.signal);if(Je){let Gt=await Cn(Ee,new URL(et.url).pathname,et.signal,B);if(Gt.type==="aborted")return;if(Gt.type==="error"){Pt(B,Q,Gt.error,{flushSync:Ze});return}else if(Gt.matches)Ee=Gt.matches;else{Pt(B,Q,_r(404,{pathname:ue}),{flushSync:Ze});return}}let vt=Mm(Ee,ue);I.set(B,ut);let _t=ie,Sn=ou(c,f,et,Ee,vt,s,Me),eo=(await $t(et,Sn,Me,B))[vt.route.id];if(I.get(B)===ut&&I.delete(B),!et.signal.aborted){if(Te.has(B)){bt(B,Ss(void 0));return}if(Nl(eo))if(pe>_t){bt(B,Ss(void 0));return}else{ce.add(B),await ht(et,eo,!1,{preventScrollReset:Pe});return}if(cr(eo)){Pt(B,Q,eo.error);return}bt(B,Ss(eo.data))}}async function ht(B,Q,ue,{submission:Ee,fetcherSubmission:Me,preventScrollReset:Je,replace:Ze}={}){ue||(te==null||te.resolve(),te=null),Q.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Pe=Q.response.headers.get("Location");Mt(Pe,"Expected a Location header on the redirect Response"),Pe=UO(Pe,new URL(B.url),m,o.history);let Fe=Cf(_.location,Pe,{_isRedirect:!0});if(a){let Sn=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))Sn=!0;else if(MS(Pe)){const Mn=XA(Pe,!0);Sn=Mn.origin!==n.location.origin||zr(Mn.pathname,m)==null}if(Sn){Ze?n.location.replace(Pe):n.location.assign(Pe);return}}J=null;let Xe=Ze===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ut,formAction:et,formEncType:vt}=_.navigation;!Ee&&!Me&&ut&&et&&vt&&(Ee=BO(_.navigation));let _t=Ee||Me;if(hj.has(Q.response.status)&&_t&&xo(_t.formMethod))await Re(Xe,Fe,{submission:{..._t,formAction:Pe},preventScrollReset:Je||H,enableViewTransition:ue?N:void 0});else{let Sn=i0(Fe,Ee);await Re(Xe,Fe,{overrideNavigation:Sn,fetcherSubmission:Me,preventScrollReset:Je||H,enableViewTransition:ue?N:void 0})}}async function $t(B,Q,ue,Ee){var Ze;let Me,Je={};try{Me=await xj(b,B,Q,Ee,ue,!1)}catch(Pe){return Q.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Je[Fe.route.id]={type:"error",error:Pe}}),Je}if(B.signal.aborted)return Je;if(!xo(B.method))for(let Pe of Q){if(((Ze=Me[Pe.route.id])==null?void 0:Ze.type)==="error")break;!Me.hasOwnProperty(Pe.route.id)&&!_.loaderData.hasOwnProperty(Pe.route.id)&&(!_.errors||!_.errors.hasOwnProperty(Pe.route.id))&&Pe.shouldCallHandler()&&(Me[Pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Pe.route.id}`)})}for(let[Pe,Fe]of Object.entries(Me))if(kj(Fe)){let Xe=Fe.result;Je[Pe]={type:"redirect",response:Oj(Xe,B,Pe,Q,m)}}else Je[Pe]=await Cj(Fe);return Je}async function on(B,Q,ue,Ee){let Me=$t(ue,B,Ee,null),Je=Promise.all(Q.map(async Fe=>{if(Fe.matches&&Fe.match&&Fe.request&&Fe.controller){let ut=(await $t(Fe.request,Fe.matches,Ee,Fe.key))[Fe.match.route.id];return{[Fe.key]:ut}}else return Promise.resolve({[Fe.key]:{type:"error",error:_r(404,{pathname:Fe.path})}})})),Ze=await Me,Pe=(await Je).reduce((Fe,Xe)=>Object.assign(Fe,Xe),{});return{loaderResults:Ze,fetcherResults:Pe}}function bn(){j=!0,ae.forEach((B,Q)=>{I.has(Q)&&oe.add(Q),hn(Q)})}function bt(B,Q,ue={}){_.fetchers.set(B,Q),he({fetchers:new Map(_.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function Pt(B,Q,ue,Ee={}){let Me=Ei(_.matches,Q);ln(B),he({errors:{[Me.route.id]:ue},fetchers:new Map(_.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function Ft(B){return me.set(B,(me.get(B)||0)+1),Te.has(B)&&Te.delete(B),_.fetchers.get(B)||pj}function vn(B,Q){hn(B,Q==null?void 0:Q.reason),bt(B,Ss(null))}function ln(B){let Q=_.fetchers.get(B);I.has(B)&&!(Q&&Q.state==="loading"&&L.has(B))&&hn(B),ae.delete(B),L.delete(B),ce.delete(B),Te.delete(B),oe.delete(B),_.fetchers.delete(B)}function Zn(B){let Q=(me.get(B)||0)-1;Q<=0?(me.delete(B),Te.add(B)):me.set(B,Q),he({fetchers:new Map(_.fetchers)})}function hn(B,Q){let ue=I.get(B);ue&&(ue.abort(Q),I.delete(B))}function co(B){for(let Q of B){let ue=Ft(Q),Ee=Ss(ue.data);_.fetchers.set(Q,Ee)}}function uo(){let B=[],Q=!1;for(let ue of ce){let Ee=_.fetchers.get(ue);Mt(Ee,`Expected fetcher: ${ue}`),Ee.state==="loading"&&(ce.delete(ue),B.push(ue),Q=!0)}return co(B),Q}function Un(B){let Q=[];for(let[ue,Ee]of L)if(Ee<B){let Me=_.fetchers.get(ue);Mt(Me,`Expected fetcher: ${ue}`),Me.state==="loading"&&(hn(ue),L.delete(ue),Q.push(ue))}return co(Q),Q.length>0}function D(B,Q){let ue=_.blockers.get(B)||rf;return Ue.get(B)!==Q&&Ue.set(B,Q),ue}function G(B){_.blockers.delete(B),Ue.delete(B)}function ge(B,Q){let ue=_.blockers.get(B)||rf;Mt(ue.state==="unblocked"&&Q.state==="blocked"||ue.state==="blocked"&&Q.state==="blocked"||ue.state==="blocked"&&Q.state==="proceeding"||ue.state==="blocked"&&Q.state==="unblocked"||ue.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${Q.state}`);let Ee=new Map(_.blockers);Ee.set(B,Q),he({blockers:Ee})}function ye({currentLocation:B,nextLocation:Q,historyAction:ue}){if(Ue.size===0)return;Ue.size>1&&qn(!1,"A router only supports one blocker at a time");let Ee=Array.from(Ue.entries()),[Me,Je]=Ee[Ee.length-1],Ze=_.blockers.get(Me);if(!(Ze&&Ze.state==="proceeding")&&Je({currentLocation:B,nextLocation:Q,historyAction:ue}))return Me}function Ne(B){let Q=_r(404,{pathname:B}),ue=g||h,{matches:Ee,route:Me}=pm(ue);return{notFoundMatches:Ee,route:Me,error:Q}}function $e(B,Q,ue){if(E=B,C=Q,T=ue||null,!A&&_.navigation===s0){A=!0;let Ee=Ve(_.location,_.matches);Ee!=null&&he({restoreScrollPosition:Ee})}return()=>{E=null,C=null,T=null}}function Se(B,Q){return T&&T(B,Q.map(Ee=>I3(Ee,_.loaderData)))||B.key}function Ke(B,Q){if(E&&C){let ue=Se(B,Q);E[ue]=C()}}function Ve(B,Q){if(E){let ue=Se(B,Q),Ee=E[ue];if(typeof Ee=="number")return Ee}return null}function Rt(B,Q,ue){if(o.patchRoutesOnNavigation)if(B){if(Object.keys(B[0].params).length>0)return{active:!0,matches:gf(Q,ue,m,!0)}}else return{active:!0,matches:gf(Q,ue,m,!0)||[]};return{active:!1,matches:null}}async function Cn(B,Q,ue,Ee){if(!o.patchRoutesOnNavigation)return{type:"success",matches:B};let Me=B;for(;;){let Je=g==null,Ze=g||h,Pe=f;try{await o.patchRoutesOnNavigation({signal:ue,path:Q,matches:Me,fetcherKey:Ee,patch:(ut,et)=>{ue.aborted||MO(ut,et,Ze,Pe,c,!1)}})}catch(ut){return{type:"error",error:ut,partialMatches:Me}}finally{Je&&!ue.aborted&&(h=[...h])}if(ue.aborted)return{type:"aborted"};let Fe=wi(Ze,Q,m),Xe=null;if(Fe){if(Object.keys(Fe[0].params).length===0)return{type:"success",matches:Fe};if(Xe=gf(Ze,Q,m,!0),!(Xe&&Me.length<Xe.length&&rn(Me,Xe.slice(0,Me.length))))return{type:"success",matches:Fe}}if(Xe||(Xe=gf(Ze,Q,m,!0)),!Xe||rn(Me,Xe))return{type:"success",matches:null};Me=Xe}}function rn(B,Q){return B.length===Q.length&&B.every((ue,Ee)=>ue.route.id===Q[Ee].route.id)}function xn(B){f={},g=Of(B,c,void 0,f)}function Xo(B,Q,ue=!1){let Ee=g==null;MO(B,Q,g||h,f,c,ue),Ee&&(h=[...h],he({}))}return $={get basename(){return m},get future(){return p},get state(){return _},get routes(){return h},get window(){return n},initialize:je,subscribe:xe,enableScrollRestoration:$e,navigate:De,fetch:ot,revalidate:Ye,createHref:B=>o.history.createHref(B),encodeLocation:B=>o.history.encodeLocation(B),getFetcher:Ft,resetFetcher:vn,deleteFetcher:Zn,dispose:at,getBlocker:D,deleteBlocker:G,patchRoutes:Xo,_internalFetchControllers:I,_internalSetRoutes:xn,_internalSetStateDoNotUseOrYouWillBreakYourApp(B){he(B)}},o.unstable_instrumentations&&($=aj($,o.unstable_instrumentations.map(B=>B.router).filter(Boolean))),$}function yj(o){return o!=null&&("formData"in o&&o.formData!=null||"body"in o&&o.body!==void 0)}function K0(o,n,a,s,l,c){let f,h;if(l){f=[];for(let m of n)if(f.push(m),m.route.id===l){h=m;break}}else f=n,h=n[n.length-1];let g=kS(s||".",_S(f),zr(o.pathname,a)||o.pathname,c==="path");if(s==null&&(g.search=o.search,g.hash=o.hash),(s==null||s===""||s===".")&&h){let m=zS(g.search);if(h.route.index&&!m)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let b=new URLSearchParams(g.search),p=b.getAll("index");b.delete("index"),p.filter(w=>w).forEach(w=>b.append("index",w));let v=b.toString();g.search=v?`?${v}`:""}}return a!=="/"&&(g.pathname=Z3({basename:a,pathname:g.pathname})),Va(g)}function AO(o,n,a){if(!a||!yj(a))return{path:n};if(a.formMethod&&!zj(a.formMethod))return{path:n,error:_r(405,{method:a.formMethod})};let s=()=>({path:n,error:_r(400,{type:"invalid-body"})}),c=(a.formMethod||"get").toUpperCase(),f=dN(n);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!xo(c))return s();let p=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((v,[w,E])=>`${v}${w}=${E}
299
- `,""):String(a.body);return{path:n,submission:{formMethod:c,formAction:f,formEncType:a.formEncType,formData:void 0,json:void 0,text:p}}}else if(a.formEncType==="application/json"){if(!xo(c))return s();try{let p=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:n,submission:{formMethod:c,formAction:f,formEncType:a.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}Mt(typeof FormData=="function","FormData is not available in this environment");let h,g;if(a.formData)h=eS(a.formData),g=a.formData;else if(a.body instanceof FormData)h=eS(a.body),g=a.body;else if(a.body instanceof URLSearchParams)h=a.body,g=zO(h);else if(a.body==null)h=new URLSearchParams,g=new FormData;else try{h=new URLSearchParams(a.body),g=zO(h)}catch{return s()}let m={formMethod:c,formAction:f,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(xo(m.formMethod))return{path:n,submission:m};let b=Ui(n);return o&&b.search&&zS(b.search)&&h.append("index",""),b.search=`?${h}`,{path:Va(b),submission:m}}function NO(o,n,a,s,l,c,f,h,g,m,b,p,v,w,E,T,C,A,k,U,M){var Z;let Y=U?cr(U[1])?U[1].error:U[1].data:void 0,$=l.createURL(c.location),_=l.createURL(g),z;if(b&&c.errors){let j=Object.keys(c.errors)[0];z=f.findIndex(oe=>oe.route.id===j)}else if(U&&cr(U[1])){let j=U[0];z=f.findIndex(oe=>oe.route.id===j)-1}let te=U?U[1].statusCode:void 0,H=te&&te>=400,J={currentUrl:$,currentParams:((Z=c.matches[0])==null?void 0:Z.params)||{},nextUrl:_,nextParams:f[0].params,...h,actionResult:Y,actionStatus:te},N=Yf(f),P=f.map((j,oe)=>{let{route:I}=j,ie=null;if(z!=null&&oe>z?ie=!1:I.lazy?ie=!0:LS(I)?b?ie=J0(I,c.loaderData,c.errors):bj(c.loaderData,c.matches[oe],j)&&(ie=!0):ie=!1,ie!==null)return Z0(a,s,o,N,j,m,n,ie);let pe=!1;typeof M=="boolean"?pe=M:H?pe=!1:(p||$.pathname+$.search===_.pathname+_.search||$.search!==_.search||vj(c.matches[oe],j))&&(pe=!0);let L={...J,defaultShouldRevalidate:pe},ce=bf(j,L);return Z0(a,s,o,N,j,m,n,ce,L,M)}),ne=[];return E.forEach((j,oe)=>{if(b||!f.some(Te=>Te.route.id===j.routeId)||w.has(oe))return;let I=c.fetchers.get(oe),ie=I&&I.state!=="idle"&&I.data===void 0,pe=wi(C,j.path,A);if(!pe){if(k&&ie)return;ne.push({key:oe,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(T.has(oe))return;let L=Mm(pe,j.path),ce=new AbortController,ae=eu(l,j.path,ce.signal),me=null;if(v.has(oe))v.delete(oe),me=ou(a,s,ae,pe,L,m,n);else if(ie)p&&(me=ou(a,s,ae,pe,L,m,n));else{let Te;typeof M=="boolean"?Te=M:H?Te=!1:Te=p;let Ue={...J,defaultShouldRevalidate:Te};bf(L,Ue)&&(me=ou(a,s,ae,pe,L,m,n,Ue))}me&&ne.push({key:oe,routeId:j.routeId,path:j.path,matches:me,match:L,request:ae,controller:ce})}),{dsMatches:P,revalidatingFetchers:ne}}function LS(o){return o.loader!=null||o.middleware!=null&&o.middleware.length>0}function J0(o,n,a){if(o.lazy)return!0;if(!LS(o))return!1;let s=n!=null&&o.id in n,l=a!=null&&a[o.id]!==void 0;return!s&&l?!1:typeof o.loader=="function"&&o.loader.hydrate===!0?!0:!s&&!l}function bj(o,n,a){let s=!n||a.route.id!==n.route.id,l=!o.hasOwnProperty(a.route.id);return s||l}function vj(o,n){let a=o.route.path;return o.pathname!==n.pathname||a!=null&&a.endsWith("*")&&o.params["*"]!==n.params["*"]}function bf(o,n){if(o.route.shouldRevalidate){let a=o.route.shouldRevalidate(n);if(typeof a=="boolean")return a}return n.defaultShouldRevalidate}function MO(o,n,a,s,l,c){let f;if(o){let m=s[o];Mt(m,`No route found to patch children into: routeId = ${o}`),m.children||(m.children=[]),f=m.children}else f=a;let h=[],g=[];if(n.forEach(m=>{let b=f.find(p=>sN(m,p));b?g.push({existingRoute:b,newRoute:m}):h.push(m)}),h.length>0){let m=Of(h,l,[o||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...m)}if(c&&g.length>0)for(let m=0;m<g.length;m++){let{existingRoute:b,newRoute:p}=g[m],v=b,[w]=Of([p],l,[],{},!0);Object.assign(v,{element:w.element?w.element:v.element,errorElement:w.errorElement?w.errorElement:v.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:v.hydrateFallbackElement})}}function sN(o,n){return"id"in o&&"id"in n&&o.id===n.id?!0:o.index===n.index&&o.path===n.path&&o.caseSensitive===n.caseSensitive?(!o.children||o.children.length===0)&&(!n.children||n.children.length===0)?!0:o.children.every((a,s)=>{var l;return(l=n.children)==null?void 0:l.some(c=>sN(a,c))}):!1}var _O=new WeakMap,iN=({key:o,route:n,manifest:a,mapRouteProperties:s})=>{let l=a[n.id];if(Mt(l,"No route found in manifest"),!l.lazy||typeof l.lazy!="object")return;let c=l.lazy[o];if(!c)return;let f=_O.get(l);f||(f={},_O.set(l,f));let h=f[o];if(h)return h;let g=(async()=>{let m=z3(o),p=l[o]!==void 0&&o!=="hasErrorBoundary";if(m)qn(!m,"Route property "+o+" is not a supported lazy route property. This property will be ignored."),f[o]=Promise.resolve();else if(p)qn(!1,`Route "${l.id}" has a static property "${o}" defined. The lazy property will be ignored.`);else{let v=await c();v!=null&&(Object.assign(l,{[o]:v}),Object.assign(l,s(l)))}typeof l.lazy=="object"&&(l.lazy[o]=void 0,Object.values(l.lazy).every(v=>v===void 0)&&(l.lazy=void 0))})();return f[o]=g,g},kO=new WeakMap;function Sj(o,n,a,s,l){let c=a[o.id];if(Mt(c,"No route found in manifest"),!o.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof o.lazy=="function"){let b=kO.get(c);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let p=(async()=>{Mt(typeof o.lazy=="function","No lazy route function found");let v=await o.lazy(),w={};for(let E in v){let T=v[E];if(T===void 0)continue;let C=P3(E),k=c[E]!==void 0&&E!=="hasErrorBoundary";C?qn(!C,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?qn(!k,`Route "${c.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.`):w[E]=T}Object.assign(c,w),Object.assign(c,{...s(c),lazy:void 0})})();return kO.set(c,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let f=Object.keys(o.lazy),h=[],g;for(let b of f){if(l&&l.includes(b))continue;let p=iN({key:b,route:o,manifest:a,mapRouteProperties:s});p&&(h.push(p),b===n&&(g=p))}let m=h.length>0?Promise.all(h).then(()=>{}):void 0;return m==null||m.catch(()=>{}),g==null||g.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:g}}async function LO(o){let n=o.matches.filter(l=>l.shouldLoad),a={};return(await Promise.all(n.map(l=>l.resolve()))).forEach((l,c)=>{a[n[c].route.id]=l}),a}async function wj(o){return o.matches.some(n=>n.route.middleware)?lN(o,()=>LO(o)):LO(o)}function lN(o,n){return Ej(o,n,s=>{if(Uj(s))throw s;return s},Mj,a);function a(s,l,c){if(c)return Promise.resolve(Object.assign(c.value,{[l]:{type:"error",result:s}}));{let{matches:f}=o,h=Math.min(Math.max(f.findIndex(m=>m.route.id===l),0),Math.max(f.findIndex(m=>m.shouldCallHandler()),0)),g=Ei(f,f[h].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:s}})}}}async function Ej(o,n,a,s,l){let{matches:c,request:f,params:h,context:g,unstable_pattern:m}=o,b=c.flatMap(v=>v.route.middleware?v.route.middleware.map(w=>[v.route.id,w]):[]);return await cN({request:f,params:h,context:g,unstable_pattern:m},b,n,a,s,l)}async function cN(o,n,a,s,l,c,f=0){let{request:h}=o;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let g=n[f];if(!g)return await a();let[m,b]=g,p,v=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await cN(o,n,a,s,l,c,f+1)},p.value}catch(w){return p={value:await c(w,m,p)},p.value}};try{let w=await b(o,v),E=w!=null?s(w):void 0;return l(E)?E:p?E??p.value:(p={value:await v()},p.value)}catch(w){return await c(w,m,p)}}function uN(o,n,a,s,l){let c=iN({key:"middleware",route:s.route,manifest:n,mapRouteProperties:o}),f=Sj(s.route,xo(a.method)?"action":"loader",n,o,l);return{middleware:c,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Z0(o,n,a,s,l,c,f,h,g=null,m){let b=!1,p=uN(o,n,a,l,c);return{...l,_lazyPromises:p,shouldLoad:h,shouldRevalidateArgs:g,shouldCallHandler(v){return b=!0,g?typeof m=="boolean"?bf(l,{...g,defaultShouldRevalidate:m}):typeof v=="boolean"?bf(l,{...g,defaultShouldRevalidate:v}):bf(l,g):h},resolve(v){let{lazy:w,loader:E,middleware:T}=l.route,C=b||h||v&&!xo(a.method)&&(w||E),A=T&&T.length>0&&!E&&!w;return C&&(xo(a.method)||!A)?Rj({request:a,unstable_pattern:s,match:l,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:v,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function ou(o,n,a,s,l,c,f,h=null){return s.map(g=>g.route.id!==l.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:uN(o,n,a,g,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Z0(o,n,a,Yf(s),g,c,f,!0,h))}async function xj(o,n,a,s,l,c){a.some(m=>{var b;return(b=m._lazyPromises)==null?void 0:b.middleware})&&await Promise.all(a.map(m=>{var b;return(b=m._lazyPromises)==null?void 0:b.middleware}));let f={request:n,unstable_pattern:Yf(a),params:a[0].params,context:l,matches:a},g=await o({...f,fetcherKey:s,runClientMiddleware:m=>{let b=f;return lN(b,()=>m({...b,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(m=>{var b,p;return[(b=m._lazyPromises)==null?void 0:b.handler,(p=m._lazyPromises)==null?void 0:p.route]}))}catch{}return g}async function Rj({request:o,unstable_pattern:n,match:a,lazyHandlerPromise:s,lazyRoutePromise:l,handlerOverride:c,scopedContext:f}){let h,g,m=xo(o.method),b=m?"action":"loader",p=v=>{let w,E=new Promise((A,k)=>w=k);g=()=>w(),o.signal.addEventListener("abort",g);let T=A=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${a.route.id}]`)):v({request:o,unstable_pattern:n,params:a.params,context:f},...A!==void 0?[A]:[]),C=(async()=>{try{return{type:"data",result:await(c?c(k=>T(k)):T())}}catch(A){return{type:"error",result:A}}})();return Promise.race([C,E])};try{let v=m?a.route.action:a.route.loader;if(s||l)if(v){let w,[E]=await Promise.all([p(v).catch(T=>{w=T}),s,l]);if(w!==void 0)throw w;h=E}else{await s;let w=m?a.route.action:a.route.loader;if(w)[h]=await Promise.all([p(w),l]);else if(b==="action"){let E=new URL(o.url),T=E.pathname+E.search;throw _r(405,{method:o.method,pathname:T,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(v)h=await p(v);else{let w=new URL(o.url),E=w.pathname+w.search;throw _r(404,{pathname:E})}}catch(v){return{type:"error",result:v}}finally{g&&o.signal.removeEventListener("abort",g)}return h}async function Tj(o){let n=o.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?o.body==null?null:o.json():o.text()}async function Cj(o){var s,l,c,f,h;let{result:n,type:a}=o;if(US(n)){let g;try{g=await Tj(n)}catch(m){return{type:"error",error:m}}return a==="error"?{type:"error",error:new Ff(n.status,n.statusText,g),statusCode:n.status,headers:n.headers}:{type:"data",data:g,statusCode:n.status,headers:n.headers}}return a==="error"?IO(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(l=n.init)!=null&&l.headers?new Headers(n.init.headers):void 0}:{type:"error",error:Nj(n),statusCode:Af(n)?n.status:void 0,headers:(c=n.init)!=null&&c.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Af(n)?n.status:void 0}:IO(n)?{type:"data",data:n.data,statusCode:(f=n.init)==null?void 0:f.status,headers:(h=n.init)!=null&&h.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function Oj(o,n,a,s,l){let c=o.headers.get("Location");if(Mt(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!MS(c)){let f=s.slice(0,s.findIndex(h=>h.route.id===a)+1);c=K0(new URL(n.url),f,l,c),o.headers.set("Location",c)}return o}function UO(o,n,a,s){let l=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(MS(o)){let c=o,f=c.startsWith("//")?new URL(n.protocol+c):new URL(c);if(l.includes(f.protocol))throw new Error("Invalid redirect location");let h=zr(f.pathname,a)!=null;if(f.origin===n.origin&&h)return f.pathname+f.search+f.hash}try{let c=s.createURL(o);if(l.includes(c.protocol))throw new Error("Invalid redirect location")}catch{}return o}function eu(o,n,a,s){let l=o.createURL(dN(n)).toString(),c={signal:a};if(s&&xo(s.formMethod)){let{formMethod:f,formEncType:h}=s;c.method=f.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(s.json)):h==="text/plain"?c.body=s.text:h==="application/x-www-form-urlencoded"&&s.formData?c.body=eS(s.formData):c.body=s.formData}return new Request(l,c)}function eS(o){let n=new URLSearchParams;for(let[a,s]of o.entries())n.append(a,typeof s=="string"?s:s.name);return n}function zO(o){let n=new FormData;for(let[a,s]of o.entries())n.append(a,s);return n}function Dj(o,n,a,s=!1,l=!1){let c={},f=null,h,g=!1,m={},b=a&&cr(a[1])?a[1].error:void 0;return o.forEach(p=>{if(!(p.route.id in n))return;let v=p.route.id,w=n[v];if(Mt(!Nl(w),"Cannot handle redirect results in processLoaderData"),cr(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),f=f||{},l)f[v]=E;else{let T=Ei(o,v);f[T.route.id]==null&&(f[T.route.id]=E)}s||(c[v]=aN),g||(g=!0,h=Af(w.error)?w.error.status:500),w.headers&&(m[v]=w.headers)}else c[v]=w.data,w.statusCode&&w.statusCode!==200&&!g&&(h=w.statusCode),w.headers&&(m[v]=w.headers)}),b!==void 0&&a&&(f={[a[0]]:b},a[2]&&(c[a[2]]=void 0)),{loaderData:c,errors:f,statusCode:h||200,loaderHeaders:m}}function jO(o,n,a,s,l,c){let{loaderData:f,errors:h}=Dj(n,a,s);return l.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:b,controller:p}=g;if(p&&p.signal.aborted)return;let v=c[m];if(Mt(v,"Did not find corresponding fetcher result"),cr(v)){let w=Ei(o.matches,b==null?void 0:b.route.id);h&&h[w.route.id]||(h={...h,[w.route.id]:v.error}),o.fetchers.delete(m)}else if(Nl(v))Mt(!1,"Unhandled fetcher revalidation redirect");else{let w=Ss(v.data);o.fetchers.set(m,w)}}),{loaderData:f,errors:h}}function PO(o,n,a,s){let l=Object.entries(n).filter(([,c])=>c!==aN).reduce((c,[f,h])=>(c[f]=h,c),{});for(let c of a){let f=c.route.id;if(!n.hasOwnProperty(f)&&o.hasOwnProperty(f)&&c.route.loader&&(l[f]=o[f]),s&&s.hasOwnProperty(f))break}return l}function HO(o){return o?cr(o[1])?{actionData:{}}:{actionData:{[o[0]]:o[1].data}}:{}}function Ei(o,n){return(n?o.slice(0,o.findIndex(s=>s.route.id===n)+1):[...o]).reverse().find(s=>s.route.hasErrorBoundary===!0)||o[0]}function pm(o){let n=o.length===1?o[0]:o.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function _r(o,{pathname:n,routeId:a,method:s,type:l,message:c}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return o===400?(f="Bad Request",s&&n&&a?h=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:l==="invalid-body"&&(h="Unable to encode submission body")):o===403?(f="Forbidden",h=`Route "${a}" does not match URL "${n}"`):o===404?(f="Not Found",h=`No route matches URL "${n}"`):o===405&&(f="Method Not Allowed",s&&n&&a?h=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:s&&(h=`Invalid request method "${s.toUpperCase()}"`)),new Ff(o||500,f,new Error(h),!0)}function mm(o){let n=Object.entries(o);for(let a=n.length-1;a>=0;a--){let[s,l]=n[a];if(Nl(l))return{key:s,result:l}}}function dN(o){let n=typeof o=="string"?Ui(o):o;return Va({...n,hash:""})}function Aj(o,n){return o.pathname!==n.pathname||o.search!==n.search?!1:o.hash===""?n.hash!=="":o.hash===n.hash?!0:n.hash!==""}function Nj(o){var n,a;return new Ff(((n=o.init)==null?void 0:n.status)??500,((a=o.init)==null?void 0:a.statusText)??"Internal Server Error",o.data)}function Mj(o){return o!=null&&typeof o=="object"&&Object.entries(o).every(([n,a])=>typeof n=="string"&&_j(a))}function _j(o){return o!=null&&typeof o=="object"&&"type"in o&&"result"in o&&(o.type==="data"||o.type==="error")}function kj(o){return US(o.result)&&oN.has(o.result.status)}function cr(o){return o.type==="error"}function Nl(o){return(o&&o.type)==="redirect"}function IO(o){return typeof o=="object"&&o!=null&&"type"in o&&"data"in o&&"init"in o&&o.type==="DataWithResponseInit"}function US(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.headers=="object"&&typeof o.body<"u"}function Lj(o){return oN.has(o)}function Uj(o){return US(o)&&Lj(o.status)&&o.headers.has("Location")}function zj(o){return fj.has(o.toUpperCase())}function xo(o){return uj.has(o.toUpperCase())}function zS(o){return new URLSearchParams(o).getAll("index").some(n=>n==="")}function Mm(o,n){let a=typeof n=="string"?Ui(n).search:n.search;if(o[o.length-1].route.index&&zS(a||""))return o[o.length-1];let s=JA(o);return s[s.length-1]}function BO(o){let{formMethod:n,formAction:a,formEncType:s,text:l,formData:c,json:f}=o;if(!(!n||!a||!s)){if(l!=null)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:void 0,text:l};if(c!=null)return{formMethod:n,formAction:a,formEncType:s,formData:c,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:f,text:void 0}}}function i0(o,n){return n?{state:"loading",location:o,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:o,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function jj(o,n){return{state:"submitting",location:o,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function af(o,n){return o?{state:"loading",formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function Pj(o,n){return{state:"submitting",formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text,data:n?n.data:void 0}}function Ss(o){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:o}}function Hj(o,n){try{let a=o.sessionStorage.getItem(rN);if(a){let s=JSON.parse(a);for(let[l,c]of Object.entries(s||{}))c&&Array.isArray(c)&&n.set(l,new Set(c||[]))}}catch{}}function Ij(o,n){if(n.size>0){let a={};for(let[s,l]of n)a[s]=[...l];try{o.sessionStorage.setItem(rN,JSON.stringify(a))}catch(s){qn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function VO(){let o,n,a=new Promise((s,l)=>{o=async c=>{s(c);try{await a}catch{}},n=async c=>{l(c);try{await a}catch{}}});return{promise:a,resolve:o,reject:n}}var Xl=x.createContext(null);Xl.displayName="DataRouter";var $f=x.createContext(null);$f.displayName="DataRouterState";var fN=x.createContext(!1);function Bj(){return x.useContext(fN)}var jS=x.createContext({isTransitioning:!1});jS.displayName="ViewTransition";var hN=x.createContext(new Map);hN.displayName="Fetchers";var Vj=x.createContext(null);Vj.displayName="Await";var jr=x.createContext(null);jr.displayName="Navigation";var lg=x.createContext(null);lg.displayName="Location";var ea=x.createContext({outlet:null,matches:[],isDataRoute:!1});ea.displayName="Route";var PS=x.createContext(null);PS.displayName="RouteError";var pN="REACT_ROUTER_ERROR",Fj="REDIRECT",Yj="ROUTE_ERROR_RESPONSE";function $j(o){if(o.startsWith(`${pN}:${Fj}:{`))try{let n=JSON.parse(o.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function qj(o){if(o.startsWith(`${pN}:${Yj}:{`))try{let n=JSON.parse(o.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Ff(n.status,n.statusText,n.data)}catch{}}function Gj(o,{relative:n}={}){Mt(qf(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=x.useContext(jr),{hash:l,pathname:c,search:f}=Gf(o,{relative:n}),h=c;return a!=="/"&&(h=c==="/"?a:Ha([a,c])),s.createHref({pathname:h,search:f,hash:l})}function qf(){return x.useContext(lg)!=null}function Ns(){return Mt(qf(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(lg).location}var mN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gN(o){x.useContext(jr).static||x.useLayoutEffect(o)}function yN(){let{isDataRoute:o}=x.useContext(ea);return o?c4():Xj()}function Xj(){Mt(qf(),"useNavigate() may be used only in the context of a <Router> component.");let o=x.useContext(Xl),{basename:n,navigator:a}=x.useContext(jr),{matches:s}=x.useContext(ea),{pathname:l}=Ns(),c=JSON.stringify(_S(s)),f=x.useRef(!1);return gN(()=>{f.current=!0}),x.useCallback((g,m={})=>{if(qn(f.current,mN),!f.current)return;if(typeof g=="number"){a.go(g);return}let b=kS(g,JSON.parse(c),l,m.relative==="path");o==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Ha([n,b.pathname])),(m.replace?a.replace:a.push)(b,m.state,m)},[n,a,c,l,o])}var Qj=x.createContext(null);function Wj(o){let n=x.useContext(ea).outlet;return x.useMemo(()=>n&&x.createElement(Qj.Provider,{value:o},n),[n,o])}function Kj(){let{matches:o}=x.useContext(ea),n=o[o.length-1];return n?n.params:{}}function Gf(o,{relative:n}={}){let{matches:a}=x.useContext(ea),{pathname:s}=Ns(),l=JSON.stringify(_S(a));return x.useMemo(()=>kS(o,JSON.parse(l),s,n==="path"),[o,l,s,n])}function Jj(o,n,a,s,l){Mt(qf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=x.useContext(jr),{matches:f}=x.useContext(ea),h=f[f.length-1],g=h?h.params:{},m=h?h.pathname:"/",b=h?h.pathnameBase:"/",p=h&&h.route;{let k=p&&p.path||"";vN(m,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) 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.
298
+ */var GA=o=>{throw TypeError(o)},N3=(o,n,a)=>n.has(o)||GA("Cannot "+a),r0=(o,n,a)=>(N3(o,n,"read from private field"),a?a.call(o):n.get(o)),M3=(o,n,a)=>n.has(o)?GA("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(o):n.set(o,a),wO="popstate";function _3(o={}){function n(s,l){let{pathname:c,search:f,hash:h}=s.location;return Cf("",{pathname:c,search:f,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function a(s,l){return typeof l=="string"?l:Va(l)}return L3(n,a,null,o)}function Mt(o,n){if(o===!1||o===null||typeof o>"u")throw new Error(n)}function qn(o,n){if(!o){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function k3(){return Math.random().toString(36).substring(2,10)}function EO(o,n){return{usr:o.state,key:o.key,idx:n}}function Cf(o,n,a=null,s){return{pathname:typeof o=="string"?o:o.pathname,search:"",hash:"",...typeof n=="string"?Ui(n):n,state:a,key:n&&n.key||s||k3()}}function Va({pathname:o="/",search:n="",hash:a=""}){return n&&n!=="?"&&(o+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(o+=a.charAt(0)==="#"?a:"#"+a),o}function Ui(o){let n={};if(o){let a=o.indexOf("#");a>=0&&(n.hash=o.substring(a),o=o.substring(0,a));let s=o.indexOf("?");s>=0&&(n.search=o.substring(s),o=o.substring(0,s)),o&&(n.pathname=o)}return n}function L3(o,n,a,s={}){let{window:l=document.defaultView,v5Compat:c=!1}=s,f=l.history,h="POP",g=null,m=b();m==null&&(m=0,f.replaceState({...f.state,idx:m},""));function b(){return(f.state||{idx:null}).idx}function p(){h="POP";let C=b(),A=C==null?null:C-m;m=C,g&&g({action:h,location:T.location,delta:A})}function v(C,A){h="PUSH";let k=Cf(T.location,C,A);m=b()+1;let U=EO(k,m),M=T.createHref(k);try{f.pushState(U,"",M)}catch(Y){if(Y instanceof DOMException&&Y.name==="DataCloneError")throw Y;l.location.assign(M)}c&&g&&g({action:h,location:T.location,delta:1})}function w(C,A){h="REPLACE";let k=Cf(T.location,C,A);m=b();let U=EO(k,m),M=T.createHref(k);f.replaceState(U,"",M),c&&g&&g({action:h,location:T.location,delta:0})}function E(C){return XA(C)}let T={get action(){return h},get location(){return o(l,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return l.addEventListener(wO,p),g=C,()=>{l.removeEventListener(wO,p),g=null}},createHref(C){return n(l,C)},createURL:E,encodeLocation(C){let A=E(C);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:v,replace:w,go(C){return f.go(C)}};return T}function XA(o,n=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Mt(a,"No window.location.(origin|href) available to create URL");let s=typeof o=="string"?o:Va(o);return s=s.replace(/ $/,"%20"),!n&&s.startsWith("//")&&(s=a+s),new URL(s,a)}var mf,xO=class{constructor(o){if(M3(this,mf,new Map),o)for(let[n,a]of o)this.set(n,a)}get(o){if(r0(this,mf).has(o))return r0(this,mf).get(o);if(o.defaultValue!==void 0)return o.defaultValue;throw new Error("No value found for context")}set(o,n){r0(this,mf).set(o,n)}};mf=new WeakMap;var U3=new Set(["lazy","caseSensitive","path","id","index","children"]);function z3(o){return U3.has(o)}var j3=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function P3(o){return j3.has(o)}function H3(o){return o.index===!0}function Of(o,n,a=[],s={},l=!1){return o.map((c,f)=>{let h=[...a,String(f)],g=typeof c.id=="string"?c.id:h.join("-");if(Mt(c.index!==!0||!c.children,"Cannot specify children on an index route"),Mt(l||!s[g],`Found a route id collision on id "${g}". Route id's must be globally unique within Data Router usages`),H3(c)){let m={...c,id:g};return s[g]=RO(m,n(m)),m}else{let m={...c,id:g,children:void 0};return s[g]=RO(m,n(m)),c.children&&(m.children=Of(c.children,n,h,s,l)),m}})}function RO(o,n){return Object.assign(o,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...o.lazy,...n.lazy}}:{}})}function wi(o,n,a="/"){return gf(o,n,a,!1)}function gf(o,n,a,s){let l=typeof n=="string"?Ui(n):n,c=zr(l.pathname||"/",a);if(c==null)return null;let f=QA(o);B3(f);let h=null;for(let g=0;h==null&&g<f.length;++g){let m=J3(c);h=W3(f[g],m,s)}return h}function I3(o,n){let{route:a,pathname:s,params:l}=o;return{id:a.id,pathname:s,params:l,data:n[a.id],loaderData:n[a.id],handle:a.handle}}function QA(o,n=[],a=[],s="",l=!1){let c=(f,h,g=l,m)=>{let b={relativePath:m===void 0?f.path||"":m,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&g)return;Mt(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let p=Ha([s,b.relativePath]),v=a.concat(b);f.children&&f.children.length>0&&(Mt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),QA(f.children,n,v,p,g)),!(f.path==null&&!f.index)&&n.push({path:p,score:X3(p,f.index),routesMeta:v})};return o.forEach((f,h)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))c(f,h);else for(let m of WA(f.path))c(f,h,!0,m)}),n}function WA(o){let n=o.split("/");if(n.length===0)return[];let[a,...s]=n,l=a.endsWith("?"),c=a.replace(/\?$/,"");if(s.length===0)return l?[c,""]:[c];let f=WA(s.join("/")),h=[];return h.push(...f.map(g=>g===""?c:[c,g].join("/"))),l&&h.push(...f),h.map(g=>o.startsWith("/")&&g===""?"/":g)}function B3(o){o.sort((n,a)=>n.score!==a.score?a.score-n.score:Q3(n.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var V3=/^:[\w-]+$/,F3=3,Y3=2,$3=1,q3=10,G3=-2,TO=o=>o==="*";function X3(o,n){let a=o.split("/"),s=a.length;return a.some(TO)&&(s+=G3),n&&(s+=Y3),a.filter(l=>!TO(l)).reduce((l,c)=>l+(V3.test(c)?F3:c===""?$3:q3),s)}function Q3(o,n){return o.length===n.length&&o.slice(0,-1).every((s,l)=>s===n[l])?o[o.length-1]-n[n.length-1]:0}function W3(o,n,a=!1){let{routesMeta:s}=o,l={},c="/",f=[];for(let h=0;h<s.length;++h){let g=s[h],m=h===s.length-1,b=c==="/"?n:n.slice(c.length)||"/",p=Df({path:g.relativePath,caseSensitive:g.caseSensitive,end:m},b),v=g.route;if(!p&&m&&a&&!s[s.length-1].route.index&&(p=Df({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!p)return null;Object.assign(l,p.params),f.push({params:l,pathname:Ha([c,p.pathname]),pathnameBase:tj(Ha([c,p.pathnameBase])),route:v}),p.pathnameBase!=="/"&&(c=Ha([c,p.pathnameBase]))}return f}function Df(o,n){typeof o=="string"&&(o={path:o,caseSensitive:!1,end:!0});let[a,s]=K3(o.path,o.caseSensitive,o.end),l=n.match(a);if(!l)return null;let c=l[0],f=c.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:s.reduce((m,{paramName:b,isOptional:p},v)=>{if(b==="*"){let E=h[v]||"";f=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const w=h[v];return p&&!w?m[b]=void 0:m[b]=(w||"").replace(/%2F/g,"/"),m},{}),pathname:c,pathnameBase:f,pattern:o}}function K3(o,n=!1,a=!0){qn(o==="*"||!o.endsWith("*")||o.endsWith("/*"),`Route path "${o}" will be treated as if it were "${o.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${o.replace(/\*$/,"/*")}".`);let s=[],l="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,g)=>(s.push({paramName:h,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return o.endsWith("*")?(s.push({paramName:"*"}),l+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?l+="\\/*$":o!==""&&o!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),s]}function J3(o){try{return o.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return qn(!1,`The URL path "${o}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),o}}function zr(o,n){if(n==="/")return o;if(!o.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,s=o.charAt(a);return s&&s!=="/"?null:o.slice(a)||"/"}function Z3({basename:o,pathname:n}){return n==="/"?o:Ha([o,n])}var KA=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,MS=o=>KA.test(o);function ej(o,n="/"){let{pathname:a,search:s="",hash:l=""}=typeof o=="string"?Ui(o):o,c;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?c=CO(a.substring(1),"/"):c=CO(a,n)):c=n,{pathname:c,search:nj(s),hash:oj(l)}}function CO(o,n){let a=n.replace(/\/+$/,"").split("/");return o.split("/").forEach(l=>{l===".."?a.length>1&&a.pop():l!=="."&&a.push(l)}),a.length>1?a.join("/"):"/"}function a0(o,n,a,s){return`Cannot include a '${o}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function JA(o){return o.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function _S(o){let n=JA(o);return n.map((a,s)=>s===n.length-1?a.pathname:a.pathnameBase)}function kS(o,n,a,s=!1){let l;typeof o=="string"?l=Ui(o):(l={...o},Mt(!l.pathname||!l.pathname.includes("?"),a0("?","pathname","search",l)),Mt(!l.pathname||!l.pathname.includes("#"),a0("#","pathname","hash",l)),Mt(!l.search||!l.search.includes("#"),a0("#","search","hash",l)));let c=o===""||l.pathname==="",f=c?"/":l.pathname,h;if(f==null)h=a;else{let p=n.length-1;if(!s&&f.startsWith("..")){let v=f.split("/");for(;v[0]==="..";)v.shift(),p-=1;l.pathname=v.join("/")}h=p>=0?n[p]:"/"}let g=ej(l,h),m=f&&f!=="/"&&f.endsWith("/"),b=(c||f===".")&&a.endsWith("/");return!g.pathname.endsWith("/")&&(m||b)&&(g.pathname+="/"),g}var Ha=o=>o.join("/").replace(/\/\/+/g,"/"),tj=o=>o.replace(/\/+$/,"").replace(/^\/*/,"/"),nj=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,oj=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,Ff=class{constructor(o,n,a,s=!1){this.status=o,this.statusText=n||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function Af(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}function Yf(o){return o.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ZA=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function eN(o,n){let a=o;if(typeof a!="string"||!KA.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,l=!1;if(ZA)try{let c=new URL(window.location.href),f=a.startsWith("//")?new URL(c.protocol+a):new URL(a),h=zr(f.pathname,n);f.origin===c.origin&&h!=null?a=h+f.search+f.hash:l=!0}catch{qn(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:a}}var Ni=Symbol("Uninstrumented");function rj(o,n){let a={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};o.forEach(l=>l({id:n.id,index:n.index,path:n.path,instrument(c){let f=Object.keys(a);for(let h of f)c[h]&&a[h].push(c[h])}}));let s={};if(typeof n.lazy=="function"&&a.lazy.length>0){let l=nu(a.lazy,n.lazy,()=>{});l&&(s.lazy=l)}if(typeof n.lazy=="object"){let l=n.lazy;["middleware","loader","action"].forEach(c=>{let f=l[c],h=a[`lazy.${c}`];if(typeof f=="function"&&h.length>0){let g=nu(h,f,()=>{});g&&(s.lazy=Object.assign(s.lazy||{},{[c]:g}))}})}return["loader","action"].forEach(l=>{let c=n[l];if(typeof c=="function"&&a[l].length>0){let f=c[Ni]??c,h=nu(a[l],f,(...g)=>OO(g[0]));h&&(l==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[Ni]=f,s[l]=h)}}),n.middleware&&n.middleware.length>0&&a.middleware.length>0&&(s.middleware=n.middleware.map(l=>{let c=l[Ni]??l,f=nu(a.middleware,c,(...h)=>OO(h[0]));return f?(f[Ni]=c,f):l})),s}function aj(o,n){let a={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(l){let c=Object.keys(l);for(let f of c)l[f]&&a[f].push(l[f])}})),a.navigate.length>0){let s=o.navigate[Ni]??o.navigate,l=nu(a.navigate,s,(...c)=>{let[f,h]=c;return{to:typeof f=="number"||typeof f=="string"?f:f?Va(f):".",...DO(o,h??{})}});l&&(l[Ni]=s,o.navigate=l)}if(a.fetch.length>0){let s=o.fetch[Ni]??o.fetch,l=nu(a.fetch,s,(...c)=>{let[f,,h,g]=c;return{href:h??".",fetcherKey:f,...DO(o,g??{})}});l&&(l[Ni]=s,o.fetch=l)}return o}function nu(o,n,a){return o.length===0?null:async(...s)=>{let l=await tN(o,a(...s),()=>n(...s),o.length-1);if(l.type==="error")throw l.value;return l.value}}async function tN(o,n,a,s){let l=o[s],c;if(l){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=tN(o,n,a,s-1),c=await f,Mt(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await l(h,n)}catch(g){console.error("An instrumentation function threw an error:",g)}f||await h(),await f}else try{c={type:"success",value:await a()}}catch(f){c={type:"error",value:f}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function OO(o){let{request:n,context:a,params:s,unstable_pattern:l}=o;return{request:sj(n),params:{...s},unstable_pattern:l,context:ij(a)}}function DO(o,n){return{currentUrl:Va(o.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function sj(o){return{method:o.method,url:o.url,headers:{get:(...n)=>o.headers.get(...n)}}}function ij(o){if(cj(o)){let n={...o};return Object.freeze(n),n}else return{get:n=>o.get(n)}}var lj=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cj(o){if(o===null||typeof o!="object")return!1;const n=Object.getPrototypeOf(o);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===lj}var nN=["POST","PUT","PATCH","DELETE"],uj=new Set(nN),dj=["GET",...nN],fj=new Set(dj),oN=new Set([301,302,303,307,308]),hj=new Set([307,308]),s0={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},pj={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},rf={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},mj=o=>({hasErrorBoundary:!!o.hasErrorBoundary}),rN="remix-router-transitions",aN=Symbol("ResetLoaderData");function gj(o){const n=o.window?o.window:typeof window<"u"?window:void 0,a=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Mt(o.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=o.hydrationRouteProperties||[],l=o.mapRouteProperties||mj,c=l;if(o.unstable_instrumentations){let B=o.unstable_instrumentations;c=Q=>({...l(Q),...rj(B.map(ue=>ue.route).filter(Boolean),Q)})}let f={},h=Of(o.routes,c,void 0,f),g,m=o.basename||"/";m.startsWith("/")||(m=`/${m}`);let b=o.dataStrategy||wj,p={...o.future},v=null,w=new Set,E=null,T=null,C=null,A=o.hydrationData!=null,k=wi(h,o.history.location,m),U=!1,M=null,Y;if(k==null&&!o.patchRoutesOnNavigation){let B=_r(404,{pathname:o.history.location.pathname}),{matches:Q,route:ue}=pm(h);Y=!0,k=Q,M={[ue.id]:B}}else if(k&&!o.hydrationData&&Rt(k,h,o.history.location.pathname).active&&(k=null),k)if(k.some(B=>B.route.lazy))Y=!1;else if(!k.some(B=>LS(B.route)))Y=!0;else{let B=o.hydrationData?o.hydrationData.loaderData:null,Q=o.hydrationData?o.hydrationData.errors:null;if(Q){let ue=k.findIndex(Ee=>Q[Ee.route.id]!==void 0);Y=k.slice(0,ue+1).every(Ee=>!J0(Ee.route,B,Q))}else Y=k.every(ue=>!J0(ue.route,B,Q))}else{Y=!1,k=[];let B=Rt(null,h,o.history.location.pathname);B.active&&B.matches&&(U=!0,k=B.matches)}let $,_={historyAction:o.history.action,location:o.history.location,matches:k,initialized:Y,navigation:s0,restoreScrollPosition:o.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:o.hydrationData&&o.hydrationData.loaderData||{},actionData:o.hydrationData&&o.hydrationData.actionData||null,errors:o.hydrationData&&o.hydrationData.errors||M,fetchers:new Map,blockers:new Map},z="POP",te=null,H=!1,J,N=!1,P=new Map,ne=null,Z=!1,j=!1,oe=new Set,I=new Map,ie=0,pe=-1,L=new Map,ce=new Set,se=new Map,me=new Map,Te=new Set,Ue=new Map,ve,ze=null;function je(){if(v=o.history.listen(({action:B,location:Q,delta:ue})=>{if(ve){ve(),ve=void 0;return}qn(Ue.size===0||ue!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ee=ye({currentLocation:_.location,nextLocation:Q,historyAction:B});if(Ee&&ue!=null){let Me=new Promise(Je=>{ve=Je});o.history.go(ue*-1),ge(Ee,{state:"blocked",location:Q,proceed(){ge(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Me.then(()=>o.history.go(ue))},reset(){let Je=new Map(_.blockers);Je.set(Ee,rf),he({blockers:Je})}}),te==null||te.resolve(),te=null;return}return Re(B,Q)}),a){Hj(n,P);let B=()=>Ij(n,P);n.addEventListener("pagehide",B),ne=()=>n.removeEventListener("pagehide",B)}return _.initialized||Re("POP",_.location,{initialHydration:!0}),$}function at(){v&&v(),ne&&ne(),w.clear(),J&&J.abort(),_.fetchers.forEach((B,Q)=>ln(Q)),_.blockers.forEach((B,Q)=>G(Q))}function xe(B){return w.add(B),()=>w.delete(B)}function he(B,Q={}){B.matches&&(B.matches=B.matches.map(Me=>{let Je=f[Me.route.id],Ze=Me.route;return Ze.element!==Je.element||Ze.errorElement!==Je.errorElement||Ze.hydrateFallbackElement!==Je.hydrateFallbackElement?{...Me,route:Je}:Me})),_={..._,...B};let ue=[],Ee=[];_.fetchers.forEach((Me,Je)=>{Me.state==="idle"&&(Te.has(Je)?ue.push(Je):Ee.push(Je))}),Te.forEach(Me=>{!_.fetchers.has(Me)&&!I.has(Me)&&ue.push(Me)}),[...w].forEach(Me=>Me(_,{deletedFetchers:ue,newErrors:B.errors??null,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),ue.forEach(Me=>ln(Me)),Ee.forEach(Me=>_.fetchers.delete(Me))}function we(B,Q,{flushSync:ue}={}){var ut,et;let Ee=_.actionData!=null&&_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&_.navigation.state==="loading"&&((ut=B.state)==null?void 0:ut._isRedirect)!==!0,Me;Q.actionData?Object.keys(Q.actionData).length>0?Me=Q.actionData:Me=null:Ee?Me=_.actionData:Me=null;let Je=Q.loaderData?PO(_.loaderData,Q.loaderData,Q.matches||[],Q.errors):_.loaderData,Ze=_.blockers;Ze.size>0&&(Ze=new Map(Ze),Ze.forEach((vt,_t)=>Ze.set(_t,rf)));let Pe=Z?!1:Ve(B,Q.matches||_.matches),Fe=H===!0||_.navigation.formMethod!=null&&xo(_.navigation.formMethod)&&((et=B.state)==null?void 0:et._isRedirect)!==!0;g&&(h=g,g=void 0),Z||z==="POP"||(z==="PUSH"?o.history.push(B,B.state):z==="REPLACE"&&o.history.replace(B,B.state));let Xe;if(z==="POP"){let vt=P.get(_.location.pathname);vt&&vt.has(B.pathname)?Xe={currentLocation:_.location,nextLocation:B}:P.has(B.pathname)&&(Xe={currentLocation:B,nextLocation:_.location})}else if(N){let vt=P.get(_.location.pathname);vt?vt.add(B.pathname):(vt=new Set([B.pathname]),P.set(_.location.pathname,vt)),Xe={currentLocation:_.location,nextLocation:B}}he({...Q,actionData:Me,loaderData:Je,historyAction:z,location:B,initialized:!0,navigation:s0,revalidation:"idle",restoreScrollPosition:Pe,preventScrollReset:Fe,blockers:Ze},{viewTransitionOpts:Xe,flushSync:ue===!0}),z="POP",H=!1,N=!1,Z=!1,j=!1,te==null||te.resolve(),te=null,ze==null||ze.resolve(),ze=null}async function De(B,Q){if(te==null||te.resolve(),te=null,typeof B=="number"){te||(te=VO());let _t=te.promise;return o.history.go(B),_t}let ue=K0(_.location,_.matches,m,B,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:Ee,submission:Me,error:Je}=AO(!1,ue,Q),Ze=_.location,Pe=Cf(_.location,Ee,Q&&Q.state);Pe={...Pe,...o.history.encodeLocation(Pe)};let Fe=Q&&Q.replace!=null?Q.replace:void 0,Xe="PUSH";Fe===!0?Xe="REPLACE":Fe===!1||Me!=null&&xo(Me.formMethod)&&Me.formAction===_.location.pathname+_.location.search&&(Xe="REPLACE");let ut=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,et=(Q&&Q.flushSync)===!0,vt=ye({currentLocation:Ze,nextLocation:Pe,historyAction:Xe});if(vt){ge(vt,{state:"blocked",location:Pe,proceed(){ge(vt,{state:"proceeding",proceed:void 0,reset:void 0,location:Pe}),De(B,Q)},reset(){let _t=new Map(_.blockers);_t.set(vt,rf),he({blockers:_t})}});return}await Re(Xe,Pe,{submission:Me,pendingError:Je,preventScrollReset:ut,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:et,callSiteDefaultShouldRevalidate:Q&&Q.unstable_defaultShouldRevalidate})}function Ye(){ze||(ze=VO()),bn(),he({revalidation:"loading"});let B=ze.promise;return _.navigation.state==="submitting"?B:_.navigation.state==="idle"?(Re(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),B):(Re(z||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:N===!0}),B)}async function Re(B,Q,ue){J&&J.abort(),J=null,z=B,Z=(ue&&ue.startUninterruptedRevalidation)===!0,Ke(_.location,_.matches),H=(ue&&ue.preventScrollReset)===!0,N=(ue&&ue.enableViewTransition)===!0;let Ee=g||h,Me=ue&&ue.overrideNavigation,Je=ue!=null&&ue.initialHydration&&_.matches&&_.matches.length>0&&!U?_.matches:wi(Ee,Q,m),Ze=(ue&&ue.flushSync)===!0;if(Je&&_.initialized&&!j&&Aj(_.location,Q)&&!(ue&&ue.submission&&xo(ue.submission.formMethod))){we(Q,{matches:Je},{flushSync:Ze});return}let Pe=Rt(Je,Ee,Q.pathname);if(Pe.active&&Pe.matches&&(Je=Pe.matches),!Je){let{error:Mn,notFoundMatches:eo,route:Gt}=Ne(Q.pathname);we(Q,{matches:eo,loaderData:{},errors:{[Gt.id]:Mn}},{flushSync:Ze});return}J=new AbortController;let Fe=eu(o.history,Q,J.signal,ue&&ue.submission),Xe=o.getContext?await o.getContext():new xO,ut;if(ue&&ue.pendingError)ut=[Ei(Je).route.id,{type:"error",error:ue.pendingError}];else if(ue&&ue.submission&&xo(ue.submission.formMethod)){let Mn=await Ae(Fe,Q,ue.submission,Je,Xe,Pe.active,ue&&ue.initialHydration===!0,{replace:ue.replace,flushSync:Ze});if(Mn.shortCircuited)return;if(Mn.pendingActionResult){let[eo,Gt]=Mn.pendingActionResult;if(cr(Gt)&&Af(Gt.error)&&Gt.error.status===404){J=null,we(Q,{matches:Mn.matches,loaderData:{},errors:{[eo]:Gt.error}});return}}Je=Mn.matches||Je,ut=Mn.pendingActionResult,Me=i0(Q,ue.submission),Ze=!1,Pe.active=!1,Fe=eu(o.history,Fe.url,Fe.signal)}let{shortCircuited:et,matches:vt,loaderData:_t,errors:Sn}=await Le(Fe,Q,Je,Xe,Pe.active,Me,ue&&ue.submission,ue&&ue.fetcherSubmission,ue&&ue.replace,ue&&ue.initialHydration===!0,Ze,ut,ue&&ue.callSiteDefaultShouldRevalidate);et||(J=null,we(Q,{matches:vt||Je,...HO(ut),loaderData:_t,errors:Sn}))}async function Ae(B,Q,ue,Ee,Me,Je,Ze,Pe={}){bn();let Fe=jj(Q,ue);if(he({navigation:Fe},{flushSync:Pe.flushSync===!0}),Je){let et=await Cn(Ee,Q.pathname,B.signal);if(et.type==="aborted")return{shortCircuited:!0};if(et.type==="error"){if(et.partialMatches.length===0){let{matches:_t,route:Sn}=pm(h);return{matches:_t,pendingActionResult:[Sn.id,{type:"error",error:et.error}]}}let vt=Ei(et.partialMatches).route.id;return{matches:et.partialMatches,pendingActionResult:[vt,{type:"error",error:et.error}]}}else if(et.matches)Ee=et.matches;else{let{notFoundMatches:vt,error:_t,route:Sn}=Ne(Q.pathname);return{matches:vt,pendingActionResult:[Sn.id,{type:"error",error:_t}]}}}let Xe,ut=Mm(Ee,Q);if(!ut.route.action&&!ut.route.lazy)Xe={type:"error",error:_r(405,{method:B.method,pathname:Q.pathname,routeId:ut.route.id})};else{let et=ou(c,f,B,Ee,ut,Ze?[]:s,Me),vt=await $t(B,et,Me,null);if(Xe=vt[ut.route.id],!Xe){for(let _t of Ee)if(vt[_t.route.id]){Xe=vt[_t.route.id];break}}if(B.signal.aborted)return{shortCircuited:!0}}if(Nl(Xe)){let et;return Pe&&Pe.replace!=null?et=Pe.replace:et=UO(Xe.response.headers.get("Location"),new URL(B.url),m,o.history)===_.location.pathname+_.location.search,await ht(B,Xe,!0,{submission:ue,replace:et}),{shortCircuited:!0}}if(cr(Xe)){let et=Ei(Ee,ut.route.id);return(Pe&&Pe.replace)!==!0&&(z="PUSH"),{matches:Ee,pendingActionResult:[et.route.id,Xe,ut.route.id]}}return{matches:Ee,pendingActionResult:[ut.route.id,Xe]}}async function Le(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe,Xe,ut,et,vt){let _t=Je||i0(Q,Ze),Sn=Ze||Pe||BO(_t),Mn=!Z&&!Xe;if(Me){if(Mn){let zn=tt(et);he({navigation:_t,...zn!==void 0?{actionData:zn}:{}},{flushSync:ut})}let Ct=await Cn(ue,Q.pathname,B.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){if(Ct.partialMatches.length===0){let{matches:_s,route:$a}=pm(h);return{matches:_s,loaderData:{},errors:{[$a.id]:Ct.error}}}let zn=Ei(Ct.partialMatches).route.id;return{matches:Ct.partialMatches,loaderData:{},errors:{[zn]:Ct.error}}}else if(Ct.matches)ue=Ct.matches;else{let{error:zn,notFoundMatches:_s,route:$a}=Ne(Q.pathname);return{matches:_s,loaderData:{},errors:{[$a.id]:zn}}}}let eo=g||h,{dsMatches:Gt,revalidatingFetchers:Ro}=NO(B,Ee,c,f,o.history,_,ue,Sn,Q,Xe?[]:s,Xe===!0,j,oe,Te,se,ce,eo,m,o.patchRoutesOnNavigation!=null,et,vt);if(pe=++ie,!o.dataStrategy&&!Gt.some(Ct=>Ct.shouldLoad)&&!Gt.some(Ct=>Ct.route.middleware&&Ct.route.middleware.length>0)&&Ro.length===0){let Ct=uo();return we(Q,{matches:ue,loaderData:{},errors:et&&cr(et[1])?{[et[0]]:et[1].error}:null,...HO(et),...Ct?{fetchers:new Map(_.fetchers)}:{}},{flushSync:ut}),{shortCircuited:!0}}if(Mn){let Ct={};if(!Me){Ct.navigation=_t;let zn=tt(et);zn!==void 0&&(Ct.actionData=zn)}Ro.length>0&&(Ct.fetchers=Ce(Ro)),he(Ct,{flushSync:ut})}Ro.forEach(Ct=>{hn(Ct.key),Ct.controller&&I.set(Ct.key,Ct.controller)});let na=()=>Ro.forEach(Ct=>hn(Ct.key));J&&J.signal.addEventListener("abort",na);let{loaderResults:Xn,fetcherResults:To}=await on(Gt,Ro,B,Ee);if(B.signal.aborted)return{shortCircuited:!0};J&&J.signal.removeEventListener("abort",na),Ro.forEach(Ct=>I.delete(Ct.key));let to=mm(Xn);if(to)return await ht(B,to.result,!0,{replace:Fe}),{shortCircuited:!0};if(to=mm(To),to)return ce.add(to.key),await ht(B,to.result,!0,{replace:Fe}),{shortCircuited:!0};let{loaderData:Kl,errors:Pr}=jO(_,ue,Xn,et,Ro,To);Xe&&_.errors&&(Pr={..._.errors,...Pr});let gr=uo(),Ms=Un(pe),oa=gr||Ms||Ro.length>0;return{matches:ue,loaderData:Kl,errors:Pr,...oa?{fetchers:new Map(_.fetchers)}:{}}}function tt(B){if(B&&!cr(B[1]))return{[B[0]]:B[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Ce(B){return B.forEach(Q=>{let ue=_.fetchers.get(Q.key),Ee=af(void 0,ue?ue.data:void 0);_.fetchers.set(Q.key,Ee)}),new Map(_.fetchers)}async function ot(B,Q,ue,Ee){hn(B);let Me=(Ee&&Ee.flushSync)===!0,Je=g||h,Ze=K0(_.location,_.matches,m,ue,Q,Ee==null?void 0:Ee.relative),Pe=wi(Je,Ze,m),Fe=Rt(Pe,Je,Ze);if(Fe.active&&Fe.matches&&(Pe=Fe.matches),!Pe){Pt(B,Q,_r(404,{pathname:Ze}),{flushSync:Me});return}let{path:Xe,submission:ut,error:et}=AO(!0,Ze,Ee);if(et){Pt(B,Q,et,{flushSync:Me});return}let vt=o.getContext?await o.getContext():new xO,_t=(Ee&&Ee.preventScrollReset)===!0;if(ut&&xo(ut.formMethod)){await gt(B,Q,Xe,Pe,vt,Fe.active,Me,_t,ut,Ee&&Ee.unstable_defaultShouldRevalidate);return}se.set(B,{routeId:Q,path:Xe}),await yt(B,Q,Xe,Pe,vt,Fe.active,Me,_t,ut)}async function gt(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe,Xe){bn(),se.delete(B);let ut=_.fetchers.get(B);bt(B,Pj(Fe,ut),{flushSync:Ze});let et=new AbortController,vt=eu(o.history,ue,et.signal,Fe);if(Je){let pn=await Cn(Ee,new URL(vt.url).pathname,vt.signal,B);if(pn.type==="aborted")return;if(pn.type==="error"){Pt(B,Q,pn.error,{flushSync:Ze});return}else if(pn.matches)Ee=pn.matches;else{Pt(B,Q,_r(404,{pathname:ue}),{flushSync:Ze});return}}let _t=Mm(Ee,ue);if(!_t.route.action&&!_t.route.lazy){let pn=_r(405,{method:Fe.formMethod,pathname:ue,routeId:Q});Pt(B,Q,pn,{flushSync:Ze});return}I.set(B,et);let Sn=ie,Mn=ou(c,f,vt,Ee,_t,s,Me),eo=await $t(vt,Mn,Me,B),Gt=eo[_t.route.id];if(!Gt){for(let pn of Mn)if(eo[pn.route.id]){Gt=eo[pn.route.id];break}}if(vt.signal.aborted){I.get(B)===et&&I.delete(B);return}if(Te.has(B)){if(Nl(Gt)||cr(Gt)){bt(B,Ss(void 0));return}}else{if(Nl(Gt))if(I.delete(B),pe>Sn){bt(B,Ss(void 0));return}else return ce.add(B),bt(B,af(Fe)),ht(vt,Gt,!1,{fetcherSubmission:Fe,preventScrollReset:Pe});if(cr(Gt)){Pt(B,Q,Gt.error);return}}let Ro=_.navigation.location||_.location,na=eu(o.history,Ro,et.signal),Xn=g||h,To=_.navigation.state!=="idle"?wi(Xn,_.navigation.location,m):_.matches;Mt(To,"Didn't find any matches after fetcher action");let to=++ie;L.set(B,to);let Kl=af(Fe,Gt.data);_.fetchers.set(B,Kl);let{dsMatches:Pr,revalidatingFetchers:gr}=NO(na,Me,c,f,o.history,_,To,Fe,Ro,s,!1,j,oe,Te,se,ce,Xn,m,o.patchRoutesOnNavigation!=null,[_t.route.id,Gt],Xe);gr.filter(pn=>pn.key!==B).forEach(pn=>{let ks=pn.key,Jl=_.fetchers.get(ks),eh=af(void 0,Jl?Jl.data:void 0);_.fetchers.set(ks,eh),hn(ks),pn.controller&&I.set(ks,pn.controller)}),he({fetchers:new Map(_.fetchers)});let Ms=()=>gr.forEach(pn=>hn(pn.key));et.signal.addEventListener("abort",Ms);let{loaderResults:oa,fetcherResults:Ct}=await on(Pr,gr,na,Me);if(et.signal.aborted)return;if(et.signal.removeEventListener("abort",Ms),L.delete(B),I.delete(B),gr.forEach(pn=>I.delete(pn.key)),_.fetchers.has(B)){let pn=Ss(Gt.data);_.fetchers.set(B,pn)}let zn=mm(oa);if(zn)return ht(na,zn.result,!1,{preventScrollReset:Pe});if(zn=mm(Ct),zn)return ce.add(zn.key),ht(na,zn.result,!1,{preventScrollReset:Pe});let{loaderData:_s,errors:$a}=jO(_,To,oa,void 0,gr,Ct);Un(to),_.navigation.state==="loading"&&to>pe?(Mt(z,"Expected pending action"),J&&J.abort(),we(_.navigation.location,{matches:To,loaderData:_s,errors:$a,fetchers:new Map(_.fetchers)})):(he({errors:$a,loaderData:PO(_.loaderData,_s,To,$a),fetchers:new Map(_.fetchers)}),j=!1)}async function yt(B,Q,ue,Ee,Me,Je,Ze,Pe,Fe){let Xe=_.fetchers.get(B);bt(B,af(Fe,Xe?Xe.data:void 0),{flushSync:Ze});let ut=new AbortController,et=eu(o.history,ue,ut.signal);if(Je){let Gt=await Cn(Ee,new URL(et.url).pathname,et.signal,B);if(Gt.type==="aborted")return;if(Gt.type==="error"){Pt(B,Q,Gt.error,{flushSync:Ze});return}else if(Gt.matches)Ee=Gt.matches;else{Pt(B,Q,_r(404,{pathname:ue}),{flushSync:Ze});return}}let vt=Mm(Ee,ue);I.set(B,ut);let _t=ie,Sn=ou(c,f,et,Ee,vt,s,Me),eo=(await $t(et,Sn,Me,B))[vt.route.id];if(I.get(B)===ut&&I.delete(B),!et.signal.aborted){if(Te.has(B)){bt(B,Ss(void 0));return}if(Nl(eo))if(pe>_t){bt(B,Ss(void 0));return}else{ce.add(B),await ht(et,eo,!1,{preventScrollReset:Pe});return}if(cr(eo)){Pt(B,Q,eo.error);return}bt(B,Ss(eo.data))}}async function ht(B,Q,ue,{submission:Ee,fetcherSubmission:Me,preventScrollReset:Je,replace:Ze}={}){ue||(te==null||te.resolve(),te=null),Q.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Pe=Q.response.headers.get("Location");Mt(Pe,"Expected a Location header on the redirect Response"),Pe=UO(Pe,new URL(B.url),m,o.history);let Fe=Cf(_.location,Pe,{_isRedirect:!0});if(a){let Sn=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))Sn=!0;else if(MS(Pe)){const Mn=XA(Pe,!0);Sn=Mn.origin!==n.location.origin||zr(Mn.pathname,m)==null}if(Sn){Ze?n.location.replace(Pe):n.location.assign(Pe);return}}J=null;let Xe=Ze===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ut,formAction:et,formEncType:vt}=_.navigation;!Ee&&!Me&&ut&&et&&vt&&(Ee=BO(_.navigation));let _t=Ee||Me;if(hj.has(Q.response.status)&&_t&&xo(_t.formMethod))await Re(Xe,Fe,{submission:{..._t,formAction:Pe},preventScrollReset:Je||H,enableViewTransition:ue?N:void 0});else{let Sn=i0(Fe,Ee);await Re(Xe,Fe,{overrideNavigation:Sn,fetcherSubmission:Me,preventScrollReset:Je||H,enableViewTransition:ue?N:void 0})}}async function $t(B,Q,ue,Ee){var Ze;let Me,Je={};try{Me=await xj(b,B,Q,Ee,ue,!1)}catch(Pe){return Q.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Je[Fe.route.id]={type:"error",error:Pe}}),Je}if(B.signal.aborted)return Je;if(!xo(B.method))for(let Pe of Q){if(((Ze=Me[Pe.route.id])==null?void 0:Ze.type)==="error")break;!Me.hasOwnProperty(Pe.route.id)&&!_.loaderData.hasOwnProperty(Pe.route.id)&&(!_.errors||!_.errors.hasOwnProperty(Pe.route.id))&&Pe.shouldCallHandler()&&(Me[Pe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Pe.route.id}`)})}for(let[Pe,Fe]of Object.entries(Me))if(kj(Fe)){let Xe=Fe.result;Je[Pe]={type:"redirect",response:Oj(Xe,B,Pe,Q,m)}}else Je[Pe]=await Cj(Fe);return Je}async function on(B,Q,ue,Ee){let Me=$t(ue,B,Ee,null),Je=Promise.all(Q.map(async Fe=>{if(Fe.matches&&Fe.match&&Fe.request&&Fe.controller){let ut=(await $t(Fe.request,Fe.matches,Ee,Fe.key))[Fe.match.route.id];return{[Fe.key]:ut}}else return Promise.resolve({[Fe.key]:{type:"error",error:_r(404,{pathname:Fe.path})}})})),Ze=await Me,Pe=(await Je).reduce((Fe,Xe)=>Object.assign(Fe,Xe),{});return{loaderResults:Ze,fetcherResults:Pe}}function bn(){j=!0,se.forEach((B,Q)=>{I.has(Q)&&oe.add(Q),hn(Q)})}function bt(B,Q,ue={}){_.fetchers.set(B,Q),he({fetchers:new Map(_.fetchers)},{flushSync:(ue&&ue.flushSync)===!0})}function Pt(B,Q,ue,Ee={}){let Me=Ei(_.matches,Q);ln(B),he({errors:{[Me.route.id]:ue},fetchers:new Map(_.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function Ft(B){return me.set(B,(me.get(B)||0)+1),Te.has(B)&&Te.delete(B),_.fetchers.get(B)||pj}function vn(B,Q){hn(B,Q==null?void 0:Q.reason),bt(B,Ss(null))}function ln(B){let Q=_.fetchers.get(B);I.has(B)&&!(Q&&Q.state==="loading"&&L.has(B))&&hn(B),se.delete(B),L.delete(B),ce.delete(B),Te.delete(B),oe.delete(B),_.fetchers.delete(B)}function Zn(B){let Q=(me.get(B)||0)-1;Q<=0?(me.delete(B),Te.add(B)):me.set(B,Q),he({fetchers:new Map(_.fetchers)})}function hn(B,Q){let ue=I.get(B);ue&&(ue.abort(Q),I.delete(B))}function co(B){for(let Q of B){let ue=Ft(Q),Ee=Ss(ue.data);_.fetchers.set(Q,Ee)}}function uo(){let B=[],Q=!1;for(let ue of ce){let Ee=_.fetchers.get(ue);Mt(Ee,`Expected fetcher: ${ue}`),Ee.state==="loading"&&(ce.delete(ue),B.push(ue),Q=!0)}return co(B),Q}function Un(B){let Q=[];for(let[ue,Ee]of L)if(Ee<B){let Me=_.fetchers.get(ue);Mt(Me,`Expected fetcher: ${ue}`),Me.state==="loading"&&(hn(ue),L.delete(ue),Q.push(ue))}return co(Q),Q.length>0}function D(B,Q){let ue=_.blockers.get(B)||rf;return Ue.get(B)!==Q&&Ue.set(B,Q),ue}function G(B){_.blockers.delete(B),Ue.delete(B)}function ge(B,Q){let ue=_.blockers.get(B)||rf;Mt(ue.state==="unblocked"&&Q.state==="blocked"||ue.state==="blocked"&&Q.state==="blocked"||ue.state==="blocked"&&Q.state==="proceeding"||ue.state==="blocked"&&Q.state==="unblocked"||ue.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${ue.state} -> ${Q.state}`);let Ee=new Map(_.blockers);Ee.set(B,Q),he({blockers:Ee})}function ye({currentLocation:B,nextLocation:Q,historyAction:ue}){if(Ue.size===0)return;Ue.size>1&&qn(!1,"A router only supports one blocker at a time");let Ee=Array.from(Ue.entries()),[Me,Je]=Ee[Ee.length-1],Ze=_.blockers.get(Me);if(!(Ze&&Ze.state==="proceeding")&&Je({currentLocation:B,nextLocation:Q,historyAction:ue}))return Me}function Ne(B){let Q=_r(404,{pathname:B}),ue=g||h,{matches:Ee,route:Me}=pm(ue);return{notFoundMatches:Ee,route:Me,error:Q}}function $e(B,Q,ue){if(E=B,C=Q,T=ue||null,!A&&_.navigation===s0){A=!0;let Ee=Ve(_.location,_.matches);Ee!=null&&he({restoreScrollPosition:Ee})}return()=>{E=null,C=null,T=null}}function Se(B,Q){return T&&T(B,Q.map(Ee=>I3(Ee,_.loaderData)))||B.key}function Ke(B,Q){if(E&&C){let ue=Se(B,Q);E[ue]=C()}}function Ve(B,Q){if(E){let ue=Se(B,Q),Ee=E[ue];if(typeof Ee=="number")return Ee}return null}function Rt(B,Q,ue){if(o.patchRoutesOnNavigation)if(B){if(Object.keys(B[0].params).length>0)return{active:!0,matches:gf(Q,ue,m,!0)}}else return{active:!0,matches:gf(Q,ue,m,!0)||[]};return{active:!1,matches:null}}async function Cn(B,Q,ue,Ee){if(!o.patchRoutesOnNavigation)return{type:"success",matches:B};let Me=B;for(;;){let Je=g==null,Ze=g||h,Pe=f;try{await o.patchRoutesOnNavigation({signal:ue,path:Q,matches:Me,fetcherKey:Ee,patch:(ut,et)=>{ue.aborted||MO(ut,et,Ze,Pe,c,!1)}})}catch(ut){return{type:"error",error:ut,partialMatches:Me}}finally{Je&&!ue.aborted&&(h=[...h])}if(ue.aborted)return{type:"aborted"};let Fe=wi(Ze,Q,m),Xe=null;if(Fe){if(Object.keys(Fe[0].params).length===0)return{type:"success",matches:Fe};if(Xe=gf(Ze,Q,m,!0),!(Xe&&Me.length<Xe.length&&rn(Me,Xe.slice(0,Me.length))))return{type:"success",matches:Fe}}if(Xe||(Xe=gf(Ze,Q,m,!0)),!Xe||rn(Me,Xe))return{type:"success",matches:null};Me=Xe}}function rn(B,Q){return B.length===Q.length&&B.every((ue,Ee)=>ue.route.id===Q[Ee].route.id)}function xn(B){f={},g=Of(B,c,void 0,f)}function Xo(B,Q,ue=!1){let Ee=g==null;MO(B,Q,g||h,f,c,ue),Ee&&(h=[...h],he({}))}return $={get basename(){return m},get future(){return p},get state(){return _},get routes(){return h},get window(){return n},initialize:je,subscribe:xe,enableScrollRestoration:$e,navigate:De,fetch:ot,revalidate:Ye,createHref:B=>o.history.createHref(B),encodeLocation:B=>o.history.encodeLocation(B),getFetcher:Ft,resetFetcher:vn,deleteFetcher:Zn,dispose:at,getBlocker:D,deleteBlocker:G,patchRoutes:Xo,_internalFetchControllers:I,_internalSetRoutes:xn,_internalSetStateDoNotUseOrYouWillBreakYourApp(B){he(B)}},o.unstable_instrumentations&&($=aj($,o.unstable_instrumentations.map(B=>B.router).filter(Boolean))),$}function yj(o){return o!=null&&("formData"in o&&o.formData!=null||"body"in o&&o.body!==void 0)}function K0(o,n,a,s,l,c){let f,h;if(l){f=[];for(let m of n)if(f.push(m),m.route.id===l){h=m;break}}else f=n,h=n[n.length-1];let g=kS(s||".",_S(f),zr(o.pathname,a)||o.pathname,c==="path");if(s==null&&(g.search=o.search,g.hash=o.hash),(s==null||s===""||s===".")&&h){let m=zS(g.search);if(h.route.index&&!m)g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&m){let b=new URLSearchParams(g.search),p=b.getAll("index");b.delete("index"),p.filter(w=>w).forEach(w=>b.append("index",w));let v=b.toString();g.search=v?`?${v}`:""}}return a!=="/"&&(g.pathname=Z3({basename:a,pathname:g.pathname})),Va(g)}function AO(o,n,a){if(!a||!yj(a))return{path:n};if(a.formMethod&&!zj(a.formMethod))return{path:n,error:_r(405,{method:a.formMethod})};let s=()=>({path:n,error:_r(400,{type:"invalid-body"})}),c=(a.formMethod||"get").toUpperCase(),f=dN(n);if(a.body!==void 0){if(a.formEncType==="text/plain"){if(!xo(c))return s();let p=typeof a.body=="string"?a.body:a.body instanceof FormData||a.body instanceof URLSearchParams?Array.from(a.body.entries()).reduce((v,[w,E])=>`${v}${w}=${E}
299
+ `,""):String(a.body);return{path:n,submission:{formMethod:c,formAction:f,formEncType:a.formEncType,formData:void 0,json:void 0,text:p}}}else if(a.formEncType==="application/json"){if(!xo(c))return s();try{let p=typeof a.body=="string"?JSON.parse(a.body):a.body;return{path:n,submission:{formMethod:c,formAction:f,formEncType:a.formEncType,formData:void 0,json:p,text:void 0}}}catch{return s()}}}Mt(typeof FormData=="function","FormData is not available in this environment");let h,g;if(a.formData)h=eS(a.formData),g=a.formData;else if(a.body instanceof FormData)h=eS(a.body),g=a.body;else if(a.body instanceof URLSearchParams)h=a.body,g=zO(h);else if(a.body==null)h=new URLSearchParams,g=new FormData;else try{h=new URLSearchParams(a.body),g=zO(h)}catch{return s()}let m={formMethod:c,formAction:f,formEncType:a&&a.formEncType||"application/x-www-form-urlencoded",formData:g,json:void 0,text:void 0};if(xo(m.formMethod))return{path:n,submission:m};let b=Ui(n);return o&&b.search&&zS(b.search)&&h.append("index",""),b.search=`?${h}`,{path:Va(b),submission:m}}function NO(o,n,a,s,l,c,f,h,g,m,b,p,v,w,E,T,C,A,k,U,M){var Z;let Y=U?cr(U[1])?U[1].error:U[1].data:void 0,$=l.createURL(c.location),_=l.createURL(g),z;if(b&&c.errors){let j=Object.keys(c.errors)[0];z=f.findIndex(oe=>oe.route.id===j)}else if(U&&cr(U[1])){let j=U[0];z=f.findIndex(oe=>oe.route.id===j)-1}let te=U?U[1].statusCode:void 0,H=te&&te>=400,J={currentUrl:$,currentParams:((Z=c.matches[0])==null?void 0:Z.params)||{},nextUrl:_,nextParams:f[0].params,...h,actionResult:Y,actionStatus:te},N=Yf(f),P=f.map((j,oe)=>{let{route:I}=j,ie=null;if(z!=null&&oe>z?ie=!1:I.lazy?ie=!0:LS(I)?b?ie=J0(I,c.loaderData,c.errors):bj(c.loaderData,c.matches[oe],j)&&(ie=!0):ie=!1,ie!==null)return Z0(a,s,o,N,j,m,n,ie);let pe=!1;typeof M=="boolean"?pe=M:H?pe=!1:(p||$.pathname+$.search===_.pathname+_.search||$.search!==_.search||vj(c.matches[oe],j))&&(pe=!0);let L={...J,defaultShouldRevalidate:pe},ce=bf(j,L);return Z0(a,s,o,N,j,m,n,ce,L,M)}),ne=[];return E.forEach((j,oe)=>{if(b||!f.some(Te=>Te.route.id===j.routeId)||w.has(oe))return;let I=c.fetchers.get(oe),ie=I&&I.state!=="idle"&&I.data===void 0,pe=wi(C,j.path,A);if(!pe){if(k&&ie)return;ne.push({key:oe,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(T.has(oe))return;let L=Mm(pe,j.path),ce=new AbortController,se=eu(l,j.path,ce.signal),me=null;if(v.has(oe))v.delete(oe),me=ou(a,s,se,pe,L,m,n);else if(ie)p&&(me=ou(a,s,se,pe,L,m,n));else{let Te;typeof M=="boolean"?Te=M:H?Te=!1:Te=p;let Ue={...J,defaultShouldRevalidate:Te};bf(L,Ue)&&(me=ou(a,s,se,pe,L,m,n,Ue))}me&&ne.push({key:oe,routeId:j.routeId,path:j.path,matches:me,match:L,request:se,controller:ce})}),{dsMatches:P,revalidatingFetchers:ne}}function LS(o){return o.loader!=null||o.middleware!=null&&o.middleware.length>0}function J0(o,n,a){if(o.lazy)return!0;if(!LS(o))return!1;let s=n!=null&&o.id in n,l=a!=null&&a[o.id]!==void 0;return!s&&l?!1:typeof o.loader=="function"&&o.loader.hydrate===!0?!0:!s&&!l}function bj(o,n,a){let s=!n||a.route.id!==n.route.id,l=!o.hasOwnProperty(a.route.id);return s||l}function vj(o,n){let a=o.route.path;return o.pathname!==n.pathname||a!=null&&a.endsWith("*")&&o.params["*"]!==n.params["*"]}function bf(o,n){if(o.route.shouldRevalidate){let a=o.route.shouldRevalidate(n);if(typeof a=="boolean")return a}return n.defaultShouldRevalidate}function MO(o,n,a,s,l,c){let f;if(o){let m=s[o];Mt(m,`No route found to patch children into: routeId = ${o}`),m.children||(m.children=[]),f=m.children}else f=a;let h=[],g=[];if(n.forEach(m=>{let b=f.find(p=>sN(m,p));b?g.push({existingRoute:b,newRoute:m}):h.push(m)}),h.length>0){let m=Of(h,l,[o||"_","patch",String((f==null?void 0:f.length)||"0")],s);f.push(...m)}if(c&&g.length>0)for(let m=0;m<g.length;m++){let{existingRoute:b,newRoute:p}=g[m],v=b,[w]=Of([p],l,[],{},!0);Object.assign(v,{element:w.element?w.element:v.element,errorElement:w.errorElement?w.errorElement:v.errorElement,hydrateFallbackElement:w.hydrateFallbackElement?w.hydrateFallbackElement:v.hydrateFallbackElement})}}function sN(o,n){return"id"in o&&"id"in n&&o.id===n.id?!0:o.index===n.index&&o.path===n.path&&o.caseSensitive===n.caseSensitive?(!o.children||o.children.length===0)&&(!n.children||n.children.length===0)?!0:o.children.every((a,s)=>{var l;return(l=n.children)==null?void 0:l.some(c=>sN(a,c))}):!1}var _O=new WeakMap,iN=({key:o,route:n,manifest:a,mapRouteProperties:s})=>{let l=a[n.id];if(Mt(l,"No route found in manifest"),!l.lazy||typeof l.lazy!="object")return;let c=l.lazy[o];if(!c)return;let f=_O.get(l);f||(f={},_O.set(l,f));let h=f[o];if(h)return h;let g=(async()=>{let m=z3(o),p=l[o]!==void 0&&o!=="hasErrorBoundary";if(m)qn(!m,"Route property "+o+" is not a supported lazy route property. This property will be ignored."),f[o]=Promise.resolve();else if(p)qn(!1,`Route "${l.id}" has a static property "${o}" defined. The lazy property will be ignored.`);else{let v=await c();v!=null&&(Object.assign(l,{[o]:v}),Object.assign(l,s(l)))}typeof l.lazy=="object"&&(l.lazy[o]=void 0,Object.values(l.lazy).every(v=>v===void 0)&&(l.lazy=void 0))})();return f[o]=g,g},kO=new WeakMap;function Sj(o,n,a,s,l){let c=a[o.id];if(Mt(c,"No route found in manifest"),!o.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof o.lazy=="function"){let b=kO.get(c);if(b)return{lazyRoutePromise:b,lazyHandlerPromise:b};let p=(async()=>{Mt(typeof o.lazy=="function","No lazy route function found");let v=await o.lazy(),w={};for(let E in v){let T=v[E];if(T===void 0)continue;let C=P3(E),k=c[E]!==void 0&&E!=="hasErrorBoundary";C?qn(!C,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?qn(!k,`Route "${c.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.`):w[E]=T}Object.assign(c,w),Object.assign(c,{...s(c),lazy:void 0})})();return kO.set(c,p),p.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:p}}let f=Object.keys(o.lazy),h=[],g;for(let b of f){if(l&&l.includes(b))continue;let p=iN({key:b,route:o,manifest:a,mapRouteProperties:s});p&&(h.push(p),b===n&&(g=p))}let m=h.length>0?Promise.all(h).then(()=>{}):void 0;return m==null||m.catch(()=>{}),g==null||g.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:g}}async function LO(o){let n=o.matches.filter(l=>l.shouldLoad),a={};return(await Promise.all(n.map(l=>l.resolve()))).forEach((l,c)=>{a[n[c].route.id]=l}),a}async function wj(o){return o.matches.some(n=>n.route.middleware)?lN(o,()=>LO(o)):LO(o)}function lN(o,n){return Ej(o,n,s=>{if(Uj(s))throw s;return s},Mj,a);function a(s,l,c){if(c)return Promise.resolve(Object.assign(c.value,{[l]:{type:"error",result:s}}));{let{matches:f}=o,h=Math.min(Math.max(f.findIndex(m=>m.route.id===l),0),Math.max(f.findIndex(m=>m.shouldCallHandler()),0)),g=Ei(f,f[h].route.id).route.id;return Promise.resolve({[g]:{type:"error",result:s}})}}}async function Ej(o,n,a,s,l){let{matches:c,request:f,params:h,context:g,unstable_pattern:m}=o,b=c.flatMap(v=>v.route.middleware?v.route.middleware.map(w=>[v.route.id,w]):[]);return await cN({request:f,params:h,context:g,unstable_pattern:m},b,n,a,s,l)}async function cN(o,n,a,s,l,c,f=0){let{request:h}=o;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let g=n[f];if(!g)return await a();let[m,b]=g,p,v=async()=>{if(p)throw new Error("You may only call `next()` once per middleware");try{return p={value:await cN(o,n,a,s,l,c,f+1)},p.value}catch(w){return p={value:await c(w,m,p)},p.value}};try{let w=await b(o,v),E=w!=null?s(w):void 0;return l(E)?E:p?E??p.value:(p={value:await v()},p.value)}catch(w){return await c(w,m,p)}}function uN(o,n,a,s,l){let c=iN({key:"middleware",route:s.route,manifest:n,mapRouteProperties:o}),f=Sj(s.route,xo(a.method)?"action":"loader",n,o,l);return{middleware:c,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Z0(o,n,a,s,l,c,f,h,g=null,m){let b=!1,p=uN(o,n,a,l,c);return{...l,_lazyPromises:p,shouldLoad:h,shouldRevalidateArgs:g,shouldCallHandler(v){return b=!0,g?typeof m=="boolean"?bf(l,{...g,defaultShouldRevalidate:m}):typeof v=="boolean"?bf(l,{...g,defaultShouldRevalidate:v}):bf(l,g):h},resolve(v){let{lazy:w,loader:E,middleware:T}=l.route,C=b||h||v&&!xo(a.method)&&(w||E),A=T&&T.length>0&&!E&&!w;return C&&(xo(a.method)||!A)?Rj({request:a,unstable_pattern:s,match:l,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:v,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function ou(o,n,a,s,l,c,f,h=null){return s.map(g=>g.route.id!==l.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:uN(o,n,a,g,c),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Z0(o,n,a,Yf(s),g,c,f,!0,h))}async function xj(o,n,a,s,l,c){a.some(m=>{var b;return(b=m._lazyPromises)==null?void 0:b.middleware})&&await Promise.all(a.map(m=>{var b;return(b=m._lazyPromises)==null?void 0:b.middleware}));let f={request:n,unstable_pattern:Yf(a),params:a[0].params,context:l,matches:a},g=await o({...f,fetcherKey:s,runClientMiddleware:m=>{let b=f;return lN(b,()=>m({...b,fetcherKey:s,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(a.flatMap(m=>{var b,p;return[(b=m._lazyPromises)==null?void 0:b.handler,(p=m._lazyPromises)==null?void 0:p.route]}))}catch{}return g}async function Rj({request:o,unstable_pattern:n,match:a,lazyHandlerPromise:s,lazyRoutePromise:l,handlerOverride:c,scopedContext:f}){let h,g,m=xo(o.method),b=m?"action":"loader",p=v=>{let w,E=new Promise((A,k)=>w=k);g=()=>w(),o.signal.addEventListener("abort",g);let T=A=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${b}" [routeId: ${a.route.id}]`)):v({request:o,unstable_pattern:n,params:a.params,context:f},...A!==void 0?[A]:[]),C=(async()=>{try{return{type:"data",result:await(c?c(k=>T(k)):T())}}catch(A){return{type:"error",result:A}}})();return Promise.race([C,E])};try{let v=m?a.route.action:a.route.loader;if(s||l)if(v){let w,[E]=await Promise.all([p(v).catch(T=>{w=T}),s,l]);if(w!==void 0)throw w;h=E}else{await s;let w=m?a.route.action:a.route.loader;if(w)[h]=await Promise.all([p(w),l]);else if(b==="action"){let E=new URL(o.url),T=E.pathname+E.search;throw _r(405,{method:o.method,pathname:T,routeId:a.route.id})}else return{type:"data",result:void 0}}else if(v)h=await p(v);else{let w=new URL(o.url),E=w.pathname+w.search;throw _r(404,{pathname:E})}}catch(v){return{type:"error",result:v}}finally{g&&o.signal.removeEventListener("abort",g)}return h}async function Tj(o){let n=o.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?o.body==null?null:o.json():o.text()}async function Cj(o){var s,l,c,f,h;let{result:n,type:a}=o;if(US(n)){let g;try{g=await Tj(n)}catch(m){return{type:"error",error:m}}return a==="error"?{type:"error",error:new Ff(n.status,n.statusText,g),statusCode:n.status,headers:n.headers}:{type:"data",data:g,statusCode:n.status,headers:n.headers}}return a==="error"?IO(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:(s=n.init)==null?void 0:s.status,headers:(l=n.init)!=null&&l.headers?new Headers(n.init.headers):void 0}:{type:"error",error:Nj(n),statusCode:Af(n)?n.status:void 0,headers:(c=n.init)!=null&&c.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:Af(n)?n.status:void 0}:IO(n)?{type:"data",data:n.data,statusCode:(f=n.init)==null?void 0:f.status,headers:(h=n.init)!=null&&h.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function Oj(o,n,a,s,l){let c=o.headers.get("Location");if(Mt(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!MS(c)){let f=s.slice(0,s.findIndex(h=>h.route.id===a)+1);c=K0(new URL(n.url),f,l,c),o.headers.set("Location",c)}return o}function UO(o,n,a,s){let l=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(MS(o)){let c=o,f=c.startsWith("//")?new URL(n.protocol+c):new URL(c);if(l.includes(f.protocol))throw new Error("Invalid redirect location");let h=zr(f.pathname,a)!=null;if(f.origin===n.origin&&h)return f.pathname+f.search+f.hash}try{let c=s.createURL(o);if(l.includes(c.protocol))throw new Error("Invalid redirect location")}catch{}return o}function eu(o,n,a,s){let l=o.createURL(dN(n)).toString(),c={signal:a};if(s&&xo(s.formMethod)){let{formMethod:f,formEncType:h}=s;c.method=f.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(s.json)):h==="text/plain"?c.body=s.text:h==="application/x-www-form-urlencoded"&&s.formData?c.body=eS(s.formData):c.body=s.formData}return new Request(l,c)}function eS(o){let n=new URLSearchParams;for(let[a,s]of o.entries())n.append(a,typeof s=="string"?s:s.name);return n}function zO(o){let n=new FormData;for(let[a,s]of o.entries())n.append(a,s);return n}function Dj(o,n,a,s=!1,l=!1){let c={},f=null,h,g=!1,m={},b=a&&cr(a[1])?a[1].error:void 0;return o.forEach(p=>{if(!(p.route.id in n))return;let v=p.route.id,w=n[v];if(Mt(!Nl(w),"Cannot handle redirect results in processLoaderData"),cr(w)){let E=w.error;if(b!==void 0&&(E=b,b=void 0),f=f||{},l)f[v]=E;else{let T=Ei(o,v);f[T.route.id]==null&&(f[T.route.id]=E)}s||(c[v]=aN),g||(g=!0,h=Af(w.error)?w.error.status:500),w.headers&&(m[v]=w.headers)}else c[v]=w.data,w.statusCode&&w.statusCode!==200&&!g&&(h=w.statusCode),w.headers&&(m[v]=w.headers)}),b!==void 0&&a&&(f={[a[0]]:b},a[2]&&(c[a[2]]=void 0)),{loaderData:c,errors:f,statusCode:h||200,loaderHeaders:m}}function jO(o,n,a,s,l,c){let{loaderData:f,errors:h}=Dj(n,a,s);return l.filter(g=>!g.matches||g.matches.some(m=>m.shouldLoad)).forEach(g=>{let{key:m,match:b,controller:p}=g;if(p&&p.signal.aborted)return;let v=c[m];if(Mt(v,"Did not find corresponding fetcher result"),cr(v)){let w=Ei(o.matches,b==null?void 0:b.route.id);h&&h[w.route.id]||(h={...h,[w.route.id]:v.error}),o.fetchers.delete(m)}else if(Nl(v))Mt(!1,"Unhandled fetcher revalidation redirect");else{let w=Ss(v.data);o.fetchers.set(m,w)}}),{loaderData:f,errors:h}}function PO(o,n,a,s){let l=Object.entries(n).filter(([,c])=>c!==aN).reduce((c,[f,h])=>(c[f]=h,c),{});for(let c of a){let f=c.route.id;if(!n.hasOwnProperty(f)&&o.hasOwnProperty(f)&&c.route.loader&&(l[f]=o[f]),s&&s.hasOwnProperty(f))break}return l}function HO(o){return o?cr(o[1])?{actionData:{}}:{actionData:{[o[0]]:o[1].data}}:{}}function Ei(o,n){return(n?o.slice(0,o.findIndex(s=>s.route.id===n)+1):[...o]).reverse().find(s=>s.route.hasErrorBoundary===!0)||o[0]}function pm(o){let n=o.length===1?o[0]:o.find(a=>a.index||!a.path||a.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function _r(o,{pathname:n,routeId:a,method:s,type:l,message:c}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return o===400?(f="Bad Request",s&&n&&a?h=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${a}", so there is no way to handle the request.`:l==="invalid-body"&&(h="Unable to encode submission body")):o===403?(f="Forbidden",h=`Route "${a}" does not match URL "${n}"`):o===404?(f="Not Found",h=`No route matches URL "${n}"`):o===405&&(f="Method Not Allowed",s&&n&&a?h=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${a}", so there is no way to handle the request.`:s&&(h=`Invalid request method "${s.toUpperCase()}"`)),new Ff(o||500,f,new Error(h),!0)}function mm(o){let n=Object.entries(o);for(let a=n.length-1;a>=0;a--){let[s,l]=n[a];if(Nl(l))return{key:s,result:l}}}function dN(o){let n=typeof o=="string"?Ui(o):o;return Va({...n,hash:""})}function Aj(o,n){return o.pathname!==n.pathname||o.search!==n.search?!1:o.hash===""?n.hash!=="":o.hash===n.hash?!0:n.hash!==""}function Nj(o){var n,a;return new Ff(((n=o.init)==null?void 0:n.status)??500,((a=o.init)==null?void 0:a.statusText)??"Internal Server Error",o.data)}function Mj(o){return o!=null&&typeof o=="object"&&Object.entries(o).every(([n,a])=>typeof n=="string"&&_j(a))}function _j(o){return o!=null&&typeof o=="object"&&"type"in o&&"result"in o&&(o.type==="data"||o.type==="error")}function kj(o){return US(o.result)&&oN.has(o.result.status)}function cr(o){return o.type==="error"}function Nl(o){return(o&&o.type)==="redirect"}function IO(o){return typeof o=="object"&&o!=null&&"type"in o&&"data"in o&&"init"in o&&o.type==="DataWithResponseInit"}function US(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.headers=="object"&&typeof o.body<"u"}function Lj(o){return oN.has(o)}function Uj(o){return US(o)&&Lj(o.status)&&o.headers.has("Location")}function zj(o){return fj.has(o.toUpperCase())}function xo(o){return uj.has(o.toUpperCase())}function zS(o){return new URLSearchParams(o).getAll("index").some(n=>n==="")}function Mm(o,n){let a=typeof n=="string"?Ui(n).search:n.search;if(o[o.length-1].route.index&&zS(a||""))return o[o.length-1];let s=JA(o);return s[s.length-1]}function BO(o){let{formMethod:n,formAction:a,formEncType:s,text:l,formData:c,json:f}=o;if(!(!n||!a||!s)){if(l!=null)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:void 0,text:l};if(c!=null)return{formMethod:n,formAction:a,formEncType:s,formData:c,json:void 0,text:void 0};if(f!==void 0)return{formMethod:n,formAction:a,formEncType:s,formData:void 0,json:f,text:void 0}}}function i0(o,n){return n?{state:"loading",location:o,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}:{state:"loading",location:o,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function jj(o,n){return{state:"submitting",location:o,formMethod:n.formMethod,formAction:n.formAction,formEncType:n.formEncType,formData:n.formData,json:n.json,text:n.text}}function af(o,n){return o?{state:"loading",formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function Pj(o,n){return{state:"submitting",formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text,data:n?n.data:void 0}}function Ss(o){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:o}}function Hj(o,n){try{let a=o.sessionStorage.getItem(rN);if(a){let s=JSON.parse(a);for(let[l,c]of Object.entries(s||{}))c&&Array.isArray(c)&&n.set(l,new Set(c||[]))}}catch{}}function Ij(o,n){if(n.size>0){let a={};for(let[s,l]of n)a[s]=[...l];try{o.sessionStorage.setItem(rN,JSON.stringify(a))}catch(s){qn(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function VO(){let o,n,a=new Promise((s,l)=>{o=async c=>{s(c);try{await a}catch{}},n=async c=>{l(c);try{await a}catch{}}});return{promise:a,resolve:o,reject:n}}var Xl=x.createContext(null);Xl.displayName="DataRouter";var $f=x.createContext(null);$f.displayName="DataRouterState";var fN=x.createContext(!1);function Bj(){return x.useContext(fN)}var jS=x.createContext({isTransitioning:!1});jS.displayName="ViewTransition";var hN=x.createContext(new Map);hN.displayName="Fetchers";var Vj=x.createContext(null);Vj.displayName="Await";var jr=x.createContext(null);jr.displayName="Navigation";var lg=x.createContext(null);lg.displayName="Location";var ea=x.createContext({outlet:null,matches:[],isDataRoute:!1});ea.displayName="Route";var PS=x.createContext(null);PS.displayName="RouteError";var pN="REACT_ROUTER_ERROR",Fj="REDIRECT",Yj="ROUTE_ERROR_RESPONSE";function $j(o){if(o.startsWith(`${pN}:${Fj}:{`))try{let n=JSON.parse(o.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function qj(o){if(o.startsWith(`${pN}:${Yj}:{`))try{let n=JSON.parse(o.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Ff(n.status,n.statusText,n.data)}catch{}}function Gj(o,{relative:n}={}){Mt(qf(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=x.useContext(jr),{hash:l,pathname:c,search:f}=Gf(o,{relative:n}),h=c;return a!=="/"&&(h=c==="/"?a:Ha([a,c])),s.createHref({pathname:h,search:f,hash:l})}function qf(){return x.useContext(lg)!=null}function Ns(){return Mt(qf(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(lg).location}var mN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function gN(o){x.useContext(jr).static||x.useLayoutEffect(o)}function yN(){let{isDataRoute:o}=x.useContext(ea);return o?c4():Xj()}function Xj(){Mt(qf(),"useNavigate() may be used only in the context of a <Router> component.");let o=x.useContext(Xl),{basename:n,navigator:a}=x.useContext(jr),{matches:s}=x.useContext(ea),{pathname:l}=Ns(),c=JSON.stringify(_S(s)),f=x.useRef(!1);return gN(()=>{f.current=!0}),x.useCallback((g,m={})=>{if(qn(f.current,mN),!f.current)return;if(typeof g=="number"){a.go(g);return}let b=kS(g,JSON.parse(c),l,m.relative==="path");o==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Ha([n,b.pathname])),(m.replace?a.replace:a.push)(b,m.state,m)},[n,a,c,l,o])}var Qj=x.createContext(null);function Wj(o){let n=x.useContext(ea).outlet;return x.useMemo(()=>n&&x.createElement(Qj.Provider,{value:o},n),[n,o])}function Kj(){let{matches:o}=x.useContext(ea),n=o[o.length-1];return n?n.params:{}}function Gf(o,{relative:n}={}){let{matches:a}=x.useContext(ea),{pathname:s}=Ns(),l=JSON.stringify(_S(a));return x.useMemo(()=>kS(o,JSON.parse(l),s,n==="path"),[o,l,s,n])}function Jj(o,n,a,s,l){Mt(qf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=x.useContext(jr),{matches:f}=x.useContext(ea),h=f[f.length-1],g=h?h.params:{},m=h?h.pathname:"/",b=h?h.pathnameBase:"/",p=h&&h.route;{let k=p&&p.path||"";vN(m,!p||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) 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.
300
300
 
301
- Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let v=Ns(),w;w=v;let E=w.pathname||"/",T=E;if(b!=="/"){let k=b.replace(/^\//,"").split("/");T="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=wi(o,{pathname:T});return qn(p||C!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),qn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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.`),o4(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:Ha([b,c.encodeLocation?c.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?b:Ha([b,c.encodeLocation?c.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),f,a,s,l)}function Zj(){let o=l4(),n=Af(o)?`${o.status} ${o.statusText}`:o instanceof Error?o.message:JSON.stringify(o),a=o instanceof Error?o.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",o),f=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:c},"ErrorBoundary")," or"," ",x.createElement("code",{style:c},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),a?x.createElement("pre",{style:l},a):null,f)}var e4=x.createElement(Zj,null),bN=class extends x.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,n){return n.location!==o.location||n.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:n.error,location:n.location,revalidation:o.revalidation||n.revalidation}}componentDidCatch(o,n){this.props.onError?this.props.onError(o,n):console.error("React Router caught the following error during render",o)}render(){let o=this.state.error;if(this.context&&typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){const a=qj(o.digest);a&&(o=a)}let n=o!==void 0?x.createElement(ea.Provider,{value:this.props.routeContext},x.createElement(PS.Provider,{value:o,children:this.props.component})):this.props.children;return this.context?x.createElement(t4,{error:o},n):n}};bN.contextType=fN;var l0=new WeakMap;function t4({children:o,error:n}){let{basename:a}=x.useContext(jr);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=$j(n.digest);if(s){let l=l0.get(n);if(l)throw l;let c=eN(s.location,a);if(ZA&&!l0.get(n))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw l0.set(n,f),f}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return o}function n4({routeContext:o,match:n,children:a}){let s=x.useContext(Xl);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(ea.Provider,{value:o},a)}function o4(o,n=[],a=null,s=null,l=null){if(o==null){if(!a)return null;if(a.errors)o=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)o=a.matches;else return null}let c=o,f=a==null?void 0:a.errors;if(f!=null){let b=c.findIndex(p=>p.route.id&&(f==null?void 0:f[p.route.id])!==void 0);Mt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let h=!1,g=-1;if(a)for(let b=0;b<c.length;b++){let p=c[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=b),p.route.id){let{loaderData:v,errors:w}=a,E=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!w||w[p.route.id]===void 0);if(p.route.lazy||E){h=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}let m=a&&s?(b,p)=>{var v,w;s(b,{location:a.location,params:((w=(v=a.matches)==null?void 0:v[0])==null?void 0:w.params)??{},unstable_pattern:Yf(a.matches),errorInfo:p})}:void 0;return c.reduceRight((b,p,v)=>{let w,E=!1,T=null,C=null;a&&(w=f&&p.route.id?f[p.route.id]:void 0,T=p.route.errorElement||e4,h&&(g<0&&v===0?(vN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):g===v&&(E=!0,C=p.route.hydrateFallbackElement||null)));let A=n.concat(c.slice(0,v+1)),k=()=>{let U;return w?U=T:E?U=C:p.route.Component?U=x.createElement(p.route.Component,null):p.route.element?U=p.route.element:U=b,x.createElement(n4,{match:p,routeContext:{outlet:b,matches:A,isDataRoute:a!=null},children:U})};return a&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?x.createElement(bN,{location:a.location,revalidation:a.revalidation,component:T,error:w,children:k(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:m}):k()},null)}function HS(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function r4(o){let n=x.useContext(Xl);return Mt(n,HS(o)),n}function a4(o){let n=x.useContext($f);return Mt(n,HS(o)),n}function s4(o){let n=x.useContext(ea);return Mt(n,HS(o)),n}function IS(o){let n=s4(o),a=n.matches[n.matches.length-1];return Mt(a.route.id,`${o} can only be used on routes that contain a unique "id"`),a.route.id}function i4(){return IS("useRouteId")}function l4(){var s;let o=x.useContext(PS),n=a4("useRouteError"),a=IS("useRouteError");return o!==void 0?o:(s=n.errors)==null?void 0:s[a]}function c4(){let{router:o}=r4("useNavigate"),n=IS("useNavigate"),a=x.useRef(!1);return gN(()=>{a.current=!0}),x.useCallback(async(l,c={})=>{qn(a.current,mN),a.current&&(typeof l=="number"?await o.navigate(l):await o.navigate(l,{fromRouteId:n,...c}))},[o,n])}var FO={};function vN(o,n,a){!n&&!FO[o]&&(FO[o]=!0,qn(!1,a))}var YO={};function $O(o,n){!o&&!YO[n]&&(YO[n]=!0,console.warn(n))}var u4="useOptimistic",qO=NS[u4],d4=()=>{};function f4(o){return qO?qO(o):[o,d4]}function h4(o){let n={hasErrorBoundary:o.hasErrorBoundary||o.ErrorBoundary!=null||o.errorElement!=null};return o.Component&&(o.element&&qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:x.createElement(o.Component),Component:void 0})),o.HydrateFallback&&(o.hydrateFallbackElement&&qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:x.createElement(o.HydrateFallback),HydrateFallback:void 0})),o.ErrorBoundary&&(o.errorElement&&qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:x.createElement(o.ErrorBoundary),ErrorBoundary:void 0})),n}var p4=["HydrateFallback","hydrateFallbackElement"],m4=class{constructor(){this.status="pending",this.promise=new Promise((o,n)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",o(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",n(a))}})}};function g4({router:o,flushSync:n,onError:a,unstable_useTransitions:s}){s=Bj()||s;let[c,f]=x.useState(o.state),[h,g]=f4(c),[m,b]=x.useState(),[p,v]=x.useState({isTransitioning:!1}),[w,E]=x.useState(),[T,C]=x.useState(),[A,k]=x.useState(),U=x.useRef(new Map),M=x.useCallback((z,{deletedFetchers:te,newErrors:H,flushSync:J,viewTransitionOpts:N})=>{H&&a&&Object.values(H).forEach(ne=>{var Z;return a(ne,{location:z.location,params:((Z=z.matches[0])==null?void 0:Z.params)??{},unstable_pattern:Yf(z.matches)})}),z.fetchers.forEach((ne,Z)=>{ne.data!==void 0&&U.current.set(Z,ne.data)}),te.forEach(ne=>U.current.delete(ne)),$O(J===!1||n!=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 P=o.window!=null&&o.window.document!=null&&typeof o.window.document.startViewTransition=="function";if($O(N==null||P,"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."),!N||!P){n&&J?n(()=>f(z)):s===!1?f(z):x.startTransition(()=>{s===!0&&g(ne=>GO(ne,z)),f(z)});return}if(n&&J){n(()=>{T&&(w==null||w.resolve(),T.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let ne=o.window.document.startViewTransition(()=>{n(()=>f(z))});ne.finished.finally(()=>{n(()=>{E(void 0),C(void 0),b(void 0),v({isTransitioning:!1})})}),n(()=>C(ne));return}T?(w==null||w.resolve(),T.skipTransition(),k({state:z,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(b(z),v({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[o.window,n,T,w,s,g,a]);x.useLayoutEffect(()=>o.subscribe(M),[o,M]),x.useEffect(()=>{p.isTransitioning&&!p.flushSync&&E(new m4)},[p]),x.useEffect(()=>{if(w&&m&&o.window){let z=m,te=w.promise,H=o.window.document.startViewTransition(async()=>{s===!1?f(z):x.startTransition(()=>{s===!0&&g(J=>GO(J,z)),f(z)}),await te});H.finished.finally(()=>{E(void 0),C(void 0),b(void 0),v({isTransitioning:!1})}),C(H)}},[m,w,o.window,s,g]),x.useEffect(()=>{w&&m&&h.location.key===m.location.key&&w.resolve()},[w,T,h.location,m]),x.useEffect(()=>{!p.isTransitioning&&A&&(b(A.state),v({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}),k(void 0))},[p.isTransitioning,A]);let Y=x.useMemo(()=>({createHref:o.createHref,encodeLocation:o.encodeLocation,go:z=>o.navigate(z),push:(z,te,H)=>o.navigate(z,{state:te,preventScrollReset:H==null?void 0:H.preventScrollReset}),replace:(z,te,H)=>o.navigate(z,{replace:!0,state:te,preventScrollReset:H==null?void 0:H.preventScrollReset})}),[o]),$=o.basename||"/",_=x.useMemo(()=>({router:o,navigator:Y,static:!1,basename:$,onError:a}),[o,Y,$,a]);return x.createElement(x.Fragment,null,x.createElement(Xl.Provider,{value:_},x.createElement($f.Provider,{value:h},x.createElement(hN.Provider,{value:U.current},x.createElement(jS.Provider,{value:p},x.createElement(S4,{basename:$,location:h.location,navigationType:h.historyAction,navigator:Y,unstable_useTransitions:s},x.createElement(y4,{routes:o.routes,future:o.future,state:h,onError:a})))))),null)}function GO(o,n){return{...o,navigation:n.navigation.state!=="idle"?n.navigation:o.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:o.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:o.actionData,fetchers:n.fetchers}}var y4=x.memo(b4);function b4({routes:o,future:n,state:a,onError:s}){return Jj(o,void 0,a,s,n)}function v4(o){return Wj(o.context)}function S4({basename:o="/",children:n=null,location:a,navigationType:s="POP",navigator:l,static:c=!1,unstable_useTransitions:f}){Mt(!qf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=o.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:h,navigator:l,static:c,unstable_useTransitions:f,future:{}}),[h,l,c,f]);typeof a=="string"&&(a=Ui(a));let{pathname:m="/",search:b="",hash:p="",state:v=null,key:w="default"}=a,E=x.useMemo(()=>{let T=zr(m,h);return T==null?null:{location:{pathname:T,search:b,hash:p,state:v,key:w},navigationType:s}},[h,m,b,p,v,w,s]);return qn(E!=null,`<Router basename="${h}"> is not able to match the URL "${m}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:x.createElement(jr.Provider,{value:g},x.createElement(lg.Provider,{children:n,value:E}))}var _m="get",km="application/x-www-form-urlencoded";function cg(o){return typeof HTMLElement<"u"&&o instanceof HTMLElement}function w4(o){return cg(o)&&o.tagName.toLowerCase()==="button"}function E4(o){return cg(o)&&o.tagName.toLowerCase()==="form"}function x4(o){return cg(o)&&o.tagName.toLowerCase()==="input"}function R4(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function T4(o,n){return o.button===0&&(!n||n==="_self")&&!R4(o)}var gm=null;function C4(){if(gm===null)try{new FormData(document.createElement("form"),0),gm=!1}catch{gm=!0}return gm}var O4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function c0(o){return o!=null&&!O4.has(o)?(qn(!1,`"${o}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${km}"`),null):o}function D4(o,n){let a,s,l,c,f;if(E4(o)){let h=o.getAttribute("action");s=h?zr(h,n):null,a=o.getAttribute("method")||_m,l=c0(o.getAttribute("enctype"))||km,c=new FormData(o)}else if(w4(o)||x4(o)&&(o.type==="submit"||o.type==="image")){let h=o.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=o.getAttribute("formaction")||h.getAttribute("action");if(s=g?zr(g,n):null,a=o.getAttribute("formmethod")||h.getAttribute("method")||_m,l=c0(o.getAttribute("formenctype"))||c0(h.getAttribute("enctype"))||km,c=new FormData(h,o),!C4()){let{name:m,type:b,value:p}=o;if(b==="image"){let v=m?`${m}.`:"";c.append(`${v}x`,"0"),c.append(`${v}y`,"0")}else m&&c.append(m,p)}}else{if(cg(o))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=_m,s=null,l=km,f=o}return c&&l==="text/plain"&&(f=c,c=void 0),{action:s,method:a.toLowerCase(),encType:l,formData:c,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function BS(o,n){if(o===!1||o===null||typeof o>"u")throw new Error(n)}function A4(o,n,a,s){let l=typeof o=="string"?new URL(o,typeof window>"u"?"server://singlefetch/":window.location.origin):o;return a?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${s}`:l.pathname=`${l.pathname}.${s}`:l.pathname==="/"?l.pathname=`_root.${s}`:n&&zr(l.pathname,n)==="/"?l.pathname=`${n.replace(/\/$/,"")}/_root.${s}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${s}`,l}async function N4(o,n){if(o.id in n)return n[o.id];try{let a=await import(o.module);return n[o.id]=a,a}catch(a){return console.error(`Error loading route module \`${o.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function M4(o){return o==null?!1:o.href==null?o.rel==="preload"&&typeof o.imageSrcSet=="string"&&typeof o.imageSizes=="string":typeof o.rel=="string"&&typeof o.href=="string"}async function _4(o,n,a){let s=await Promise.all(o.map(async l=>{let c=n.routes[l.route.id];if(c){let f=await N4(c,a);return f.links?f.links():[]}return[]}));return z4(s.flat(1).filter(M4).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function XO(o,n,a,s,l,c){let f=(g,m)=>a[m]?g.route.id!==a[m].route.id:!0,h=(g,m)=>{var b;return a[m].pathname!==g.pathname||((b=a[m].route.path)==null?void 0:b.endsWith("*"))&&a[m].params["*"]!==g.params["*"]};return c==="assets"?n.filter((g,m)=>f(g,m)||h(g,m)):c==="data"?n.filter((g,m)=>{var p;let b=s.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(f(g,m)||h(g,m))return!0;if(g.route.shouldRevalidate){let v=g.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(o,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function k4(o,n,{includeHydrateFallback:a}={}){return L4(o.map(s=>{let l=n.routes[s.route.id];if(!l)return[];let c=[l.module];return l.clientActionModule&&(c=c.concat(l.clientActionModule)),l.clientLoaderModule&&(c=c.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(c=c.concat(l.hydrateFallbackModule)),l.imports&&(c=c.concat(l.imports)),c}).flat(1))}function L4(o){return[...new Set(o)]}function U4(o){let n={},a=Object.keys(o).sort();for(let s of a)n[s]=o[s];return n}function z4(o,n){let a=new Set;return new Set(n),o.reduce((s,l)=>{let c=JSON.stringify(U4(l));return a.has(c)||(a.add(c),s.push({key:c,link:l})),s},[])}function SN(){let o=x.useContext(Xl);return BS(o,"You must render this element inside a <DataRouterContext.Provider> element"),o}function j4(){let o=x.useContext($f);return BS(o,"You must render this element inside a <DataRouterStateContext.Provider> element"),o}var VS=x.createContext(void 0);VS.displayName="FrameworkContext";function wN(){let o=x.useContext(VS);return BS(o,"You must render this element inside a <HydratedRouter> element"),o}function P4(o,n){let a=x.useContext(VS),[s,l]=x.useState(!1),[c,f]=x.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:m,onMouseLeave:b,onTouchStart:p}=n,v=x.useRef(null);x.useEffect(()=>{if(o==="render"&&f(!0),o==="viewport"){let T=A=>{A.forEach(k=>{f(k.isIntersecting)})},C=new IntersectionObserver(T,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[o]),x.useEffect(()=>{if(s){let T=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(T)}}},[s]);let w=()=>{l(!0)},E=()=>{l(!1),f(!1)};return a?o!=="intent"?[c,v,{}]:[c,v,{onFocus:sf(h,w),onBlur:sf(g,E),onMouseEnter:sf(m,w),onMouseLeave:sf(b,E),onTouchStart:sf(p,w)}]:[!1,v,{}]}function sf(o,n){return a=>{o&&o(a),a.defaultPrevented||n(a)}}function H4({page:o,...n}){let{router:a}=SN(),s=x.useMemo(()=>wi(a.routes,o,a.basename),[a.routes,o,a.basename]);return s?x.createElement(B4,{page:o,matches:s,...n}):null}function I4(o){let{manifest:n,routeModules:a}=wN(),[s,l]=x.useState([]);return x.useEffect(()=>{let c=!1;return _4(o,n,a).then(f=>{c||l(f)}),()=>{c=!0}},[o,n,a]),s}function B4({page:o,matches:n,...a}){let s=Ns(),{future:l,manifest:c,routeModules:f}=wN(),{basename:h}=SN(),{loaderData:g,matches:m}=j4(),b=x.useMemo(()=>XO(o,n,m,c,s,"data"),[o,n,m,c,s]),p=x.useMemo(()=>XO(o,n,m,c,s,"assets"),[o,n,m,c,s]),v=x.useMemo(()=>{if(o===s.pathname+s.search+s.hash)return[];let T=new Set,C=!1;if(n.forEach(k=>{var M;let U=c.routes[k.route.id];!U||!U.hasLoader||(!b.some(Y=>Y.route.id===k.route.id)&&k.route.id in g&&((M=f[k.route.id])!=null&&M.shouldRevalidate)||U.hasClientLoader?C=!0:T.add(k.route.id))}),T.size===0)return[];let A=A4(o,h,l.unstable_trailingSlashAwareDataRequests,"data");return C&&T.size>0&&A.searchParams.set("_routes",n.filter(k=>T.has(k.route.id)).map(k=>k.route.id).join(",")),[A.pathname+A.search]},[h,l.unstable_trailingSlashAwareDataRequests,g,s,c,b,n,o,f]),w=x.useMemo(()=>k4(p,c),[p,c]),E=I4(p);return x.createElement(x.Fragment,null,v.map(T=>x.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...a})),w.map(T=>x.createElement("link",{key:T,rel:"modulepreload",href:T,...a})),E.map(({key:T,link:C})=>x.createElement("link",{key:T,nonce:a.nonce,...C,crossOrigin:C.crossOrigin??a.crossOrigin})))}function V4(...o){return n=>{o.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var F4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{F4&&(window.__reactRouterVersion="7.13.0")}catch{}function Y4(o,n){return gj({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:_3({window:n==null?void 0:n.window}),hydrationData:$4(),routes:o,mapRouteProperties:h4,hydrationRouteProperties:p4,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,unstable_instrumentations:n==null?void 0:n.unstable_instrumentations}).initialize()}function $4(){let o=window==null?void 0:window.__staticRouterHydrationData;return o&&o.errors&&(o={...o,errors:q4(o.errors)}),o}function q4(o){if(!o)return null;let n=Object.entries(o),a={};for(let[s,l]of n)if(l&&l.__type==="RouteErrorResponse")a[s]=new Ff(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let c=window[l.__subType];if(typeof c=="function")try{let f=new c(l.message);f.stack="",a[s]=f}catch{}}if(a[s]==null){let c=new Error(l.message);c.stack="",a[s]=c}}else a[s]=l;return a}var EN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FS=x.forwardRef(function({onClick:n,discover:a="render",prefetch:s="none",relative:l,reloadDocument:c,replace:f,state:h,target:g,to:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v,...w},E){let{basename:T,unstable_useTransitions:C}=x.useContext(jr),A=typeof m=="string"&&EN.test(m),k=eN(m,T);m=k.to;let U=Gj(m,{relative:l}),[M,Y,$]=P4(s,w),_=W4(m,{replace:f,state:h,target:g,preventScrollReset:b,relative:l,viewTransition:p,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function z(H){n&&n(H),H.defaultPrevented||_(H)}let te=x.createElement("a",{...w,...$,href:k.absoluteURL||U,onClick:k.isExternal||c?n:z,ref:V4(E,Y),target:g,"data-discover":!A&&a==="render"?"true":void 0});return M&&!A?x.createElement(x.Fragment,null,te,x.createElement(H4,{page:U})):te});FS.displayName="Link";var G4=x.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:s="",end:l=!1,style:c,to:f,viewTransition:h,children:g,...m},b){let p=Gf(f,{relative:m.relative}),v=Ns(),w=x.useContext($f),{navigator:E,basename:T}=x.useContext(jr),C=w!=null&&tP(p)&&h===!0,A=E.encodeLocation?E.encodeLocation(p).pathname:p.pathname,k=v.pathname,U=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(k=k.toLowerCase(),U=U?U.toLowerCase():null,A=A.toLowerCase()),U&&T&&(U=zr(U,T)||U);const M=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let Y=k===A||!l&&k.startsWith(A)&&k.charAt(M)==="/",$=U!=null&&(U===A||!l&&U.startsWith(A)&&U.charAt(A.length)==="/"),_={isActive:Y,isPending:$,isTransitioning:C},z=Y?n:void 0,te;typeof s=="function"?te=s(_):te=[s,Y?"active":null,$?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let H=typeof c=="function"?c(_):c;return x.createElement(FS,{...m,"aria-current":z,className:te,ref:b,style:H,to:f,viewTransition:h},typeof g=="function"?g(_):g)});G4.displayName="NavLink";var X4=x.forwardRef(({discover:o="render",fetcherKey:n,navigate:a,reloadDocument:s,replace:l,state:c,method:f=_m,action:h,onSubmit:g,relative:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v,...w},E)=>{let{unstable_useTransitions:T}=x.useContext(jr),C=Z4(),A=eP(h,{relative:m}),k=f.toLowerCase()==="get"?"get":"post",U=typeof h=="string"&&EN.test(h),M=Y=>{if(g&&g(Y),Y.defaultPrevented)return;Y.preventDefault();let $=Y.nativeEvent.submitter,_=($==null?void 0:$.getAttribute("formmethod"))||f,z=()=>C($||Y.currentTarget,{fetcherKey:n,method:_,navigate:a,replace:l,state:c,relative:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v});T&&a!==!1?x.startTransition(()=>z()):z()};return x.createElement("form",{ref:E,method:k,action:A,onSubmit:s?g:M,...w,"data-discover":!U&&o==="render"?"true":void 0})});X4.displayName="Form";function Q4(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xN(o){let n=x.useContext(Xl);return Mt(n,Q4(o)),n}function W4(o,{target:n,replace:a,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}={}){let m=yN(),b=Ns(),p=Gf(o,{relative:c});return x.useCallback(v=>{if(T4(v,n)){v.preventDefault();let w=a!==void 0?a:Va(b)===Va(p),E=()=>m(o,{replace:w,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h});g?x.startTransition(()=>E()):E()}},[b,m,p,a,s,n,o,l,c,f,h,g])}var K4=0,J4=()=>`__${String(++K4)}__`;function Z4(){let{router:o}=xN("useSubmit"),{basename:n}=x.useContext(jr),a=i4(),s=o.fetch,l=o.navigate;return x.useCallback(async(c,f={})=>{let{action:h,method:g,encType:m,formData:b,body:p}=D4(c,n);if(f.navigate===!1){let v=f.fetcherKey||J4();await s(v,a,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:p,formMethod:f.method||g,formEncType:f.encType||m,flushSync:f.flushSync})}else await l(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:p,formMethod:f.method||g,formEncType:f.encType||m,replace:f.replace,state:f.state,fromRouteId:a,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,l,n,a])}function eP(o,{relative:n}={}){let{basename:a}=x.useContext(jr),s=x.useContext(ea);Mt(s,"useFormAction must be used inside a RouteContext");let[l]=s.matches.slice(-1),c={...Gf(o||".",{relative:n})},f=Ns();if(o==null){c.search=f.search;let h=new URLSearchParams(c.search),g=h.getAll("index");if(g.some(b=>b==="")){h.delete("index"),g.filter(p=>p).forEach(p=>h.append("index",p));let b=h.toString();c.search=b?`?${b}`:""}}return(!o||o===".")&&l.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Ha([a,c.pathname])),Va(c)}function tP(o,{relative:n}={}){let a=x.useContext(jS);Mt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=xN("useViewTransitionState"),l=Gf(o,{relative:n});if(!a.isTransitioning)return!1;let c=zr(a.currentLocation.pathname,s)||a.currentLocation.pathname,f=zr(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Df(l.pathname,f)!=null||Df(l.pathname,c)!=null}var zi=qA();const nP=UA(zi);function oP(o){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=o:a.appendChild(document.createTextNode(o))}const rP=o=>{switch(o){case"success":return iP;case"info":return cP;case"warning":return lP;case"error":return uP;default:return null}},aP=Array(12).fill(0),sP=({visible:o,className:n})=>_e.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":o},_e.createElement("div",{className:"sonner-spinner"},aP.map((a,s)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),iP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),lP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),uP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),dP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fP=()=>{const[o,n]=_e.useState(document.hidden);return _e.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),o};let tS=1;class hP{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:s,...l}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:tS++,f=this.toasts.find(g=>g.id===c),h=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(g=>g.id===c?(this.publish({...g,...n,id:c,title:s}),{...g,...n,id:c,dismissible:h,title:s}):g):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const l=Promise.resolve(n instanceof Function?n():n);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],_e.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(mP(m)&&!m.ok){c=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...E})}else if(m instanceof Error){c=!1;const p=typeof a.error=="function"?await a.error(m):a.error,v=typeof a.description=="function"?await a.description(m):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...E})}else if(a.success!==void 0){c=!1;const p=typeof a.success=="function"?await a.success(m):a.success,v=typeof a.description=="function"?await a.description(m):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:v,...E})}}).catch(async m=>{if(f=["reject",m],a.error!==void 0){c=!1;const b=typeof a.error=="function"?await a.error(m):a.error,p=typeof a.description=="function"?await a.description(m):a.description,w=typeof b=="object"&&!_e.isValidElement(b)?b:{message:b};this.create({id:s,type:"error",description:p,...w})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),g=()=>new Promise((m,b)=>h.then(()=>f[0]==="reject"?b(f[1]):m(f[1])).catch(b));return typeof s!="string"&&typeof s!="number"?{unwrap:g}:Object.assign(s,{unwrap:g})},this.custom=(n,a)=>{const s=(a==null?void 0:a.id)||tS++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yo=new hP,pP=(o,n)=>{const a=(n==null?void 0:n.id)||tS++;return Yo.addToast({title:o,...n,id:a}),a},mP=o=>o&&typeof o=="object"&&"ok"in o&&typeof o.ok=="boolean"&&"status"in o&&typeof o.status=="number",gP=pP,yP=()=>Yo.toasts,bP=()=>Yo.getActiveToasts(),xY=Object.assign(gP,{success:Yo.success,info:Yo.info,warning:Yo.warning,error:Yo.error,custom:Yo.custom,message:Yo.message,promise:Yo.promise,dismiss:Yo.dismiss,loading:Yo.loading},{getHistory:yP,getToasts:bP});oP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ym(o){return o.label!==void 0}const vP=3,SP="24px",wP="16px",QO=4e3,EP=356,xP=14,RP=45,TP=200;function Ma(...o){return o.filter(Boolean).join(" ")}function CP(o){const[n,a]=o.split("-"),s=[];return n&&s.push(n),a&&s.push(a),s}const OP=o=>{var n,a,s,l,c,f,h,g,m;const{invert:b,toast:p,unstyled:v,interacting:w,setHeights:E,visibleToasts:T,heights:C,index:A,toasts:k,expanded:U,removeToast:M,defaultRichColors:Y,closeButton:$,style:_,cancelButtonStyle:z,actionButtonStyle:te,className:H="",descriptionClassName:J="",duration:N,position:P,gap:ne,expandByDefault:Z,classNames:j,icons:oe,closeButtonAriaLabel:I="Close toast"}=o,[ie,pe]=_e.useState(null),[L,ce]=_e.useState(null),[ae,me]=_e.useState(!1),[Te,Ue]=_e.useState(!1),[ve,ze]=_e.useState(!1),[je,at]=_e.useState(!1),[xe,he]=_e.useState(!1),[we,De]=_e.useState(0),[Ye,Re]=_e.useState(0),Ae=_e.useRef(p.duration||N||QO),Le=_e.useRef(null),tt=_e.useRef(null),Ce=A===0,ot=A+1<=T,gt=p.type,yt=p.dismissible!==!1,ht=p.className||"",$t=p.descriptionClassName||"",on=_e.useMemo(()=>C.findIndex(Se=>Se.toastId===p.id)||0,[C,p.id]),bn=_e.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:$},[p.closeButton,$]),bt=_e.useMemo(()=>p.duration||N||QO,[p.duration,N]),Pt=_e.useRef(0),Ft=_e.useRef(0),vn=_e.useRef(0),ln=_e.useRef(null),[Zn,hn]=P.split("-"),co=_e.useMemo(()=>C.reduce((Se,Ke,Ve)=>Ve>=on?Se:Se+Ke.height,0),[C,on]),uo=fP(),Un=p.invert||b,D=gt==="loading";Ft.current=_e.useMemo(()=>on*ne+co,[on,co]),_e.useEffect(()=>{Ae.current=bt},[bt]),_e.useEffect(()=>{me(!0)},[]),_e.useEffect(()=>{const Se=tt.current;if(Se){const Ke=Se.getBoundingClientRect().height;return Re(Ke),E(Ve=>[{toastId:p.id,height:Ke,position:p.position},...Ve]),()=>E(Ve=>Ve.filter(Rt=>Rt.toastId!==p.id))}},[E,p.id]),_e.useLayoutEffect(()=>{if(!ae)return;const Se=tt.current,Ke=Se.style.height;Se.style.height="auto";const Ve=Se.getBoundingClientRect().height;Se.style.height=Ke,Re(Ve),E(Rt=>Rt.find(rn=>rn.toastId===p.id)?Rt.map(rn=>rn.toastId===p.id?{...rn,height:Ve}:rn):[{toastId:p.id,height:Ve,position:p.position},...Rt])},[ae,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const G=_e.useCallback(()=>{Ue(!0),De(Ft.current),E(Se=>Se.filter(Ke=>Ke.toastId!==p.id)),setTimeout(()=>{M(p)},TP)},[p,M,E,Ft]);_e.useEffect(()=>{if(p.promise&&gt==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return U||w||uo?(()=>{if(vn.current<Pt.current){const Rt=new Date().getTime()-Pt.current;Ae.current=Ae.current-Rt}vn.current=new Date().getTime()})():(()=>{Ae.current!==1/0&&(Pt.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),G()},Ae.current))})(),()=>clearTimeout(Se)},[U,w,p,gt,uo,G]),_e.useEffect(()=>{p.delete&&(G(),p.onDismiss==null||p.onDismiss.call(p,p))},[G,p.delete]);function ge(){var Se;if(oe!=null&&oe.loading){var Ke;return _e.createElement("div",{className:Ma(j==null?void 0:j.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":gt==="loading"},oe.loading)}return _e.createElement(sP,{className:Ma(j==null?void 0:j.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:gt==="loading"})}const ye=p.icon||(oe==null?void 0:oe[gt])||rP(gt);var Ne,$e;return _e.createElement("li",{tabIndex:0,ref:tt,className:Ma(H,ht,j==null?void 0:j.toast,p==null||(n=p.classNames)==null?void 0:n.toast,j==null?void 0:j.default,j==null?void 0:j[gt],p==null||(a=p.classNames)==null?void 0:a[gt]),"data-sonner-toast":"","data-rich-colors":(Ne=p.richColors)!=null?Ne:Y,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":ae,"data-promise":!!p.promise,"data-swiped":xe,"data-removed":Te,"data-visible":ot,"data-y-position":Zn,"data-x-position":hn,"data-index":A,"data-front":Ce,"data-swiping":ve,"data-dismissible":yt,"data-type":gt,"data-invert":Un,"data-swipe-out":je,"data-swipe-direction":L,"data-expanded":!!(U||Z&&ae),"data-testid":p.testId,style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Te?we:Ft.current}px`,"--initial-height":Z?"auto":`${Ye}px`,..._,...p.style},onDragEnd:()=>{ze(!1),pe(null),ln.current=null},onPointerDown:Se=>{Se.button!==2&&(D||!yt||(Le.current=new Date,De(Ft.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ze(!0),ln.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Ke,Ve;if(je||!yt)return;ln.current=null;const Rt=Number(((Se=tt.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((Ke=tt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rn=new Date().getTime()-((Ve=Le.current)==null?void 0:Ve.getTime()),xn=ie==="x"?Rt:Cn,Xo=Math.abs(xn)/rn;if(Math.abs(xn)>=RP||Xo>.11){De(Ft.current),p.onDismiss==null||p.onDismiss.call(p,p),ce(ie==="x"?Rt>0?"right":"left":Cn>0?"down":"up"),G(),at(!0);return}else{var B,Q;(B=tt.current)==null||B.style.setProperty("--swipe-amount-x","0px"),(Q=tt.current)==null||Q.style.setProperty("--swipe-amount-y","0px")}he(!1),ze(!1),pe(null)},onPointerMove:Se=>{var Ke,Ve,Rt;if(!ln.current||!yt||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const rn=Se.clientY-ln.current.y,xn=Se.clientX-ln.current.x;var Xo;const B=(Xo=o.swipeDirections)!=null?Xo:CP(P);!ie&&(Math.abs(xn)>1||Math.abs(rn)>1)&&pe(Math.abs(xn)>Math.abs(rn)?"x":"y");let Q={x:0,y:0};const ue=Ee=>1/(1.5+Math.abs(Ee)/20);if(ie==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&rn<0||B.includes("bottom")&&rn>0)Q.y=rn;else{const Ee=rn*ue(rn);Q.y=Math.abs(Ee)<Math.abs(rn)?Ee:rn}}else if(ie==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&xn<0||B.includes("right")&&xn>0)Q.x=xn;else{const Ee=xn*ue(xn);Q.x=Math.abs(Ee)<Math.abs(xn)?Ee:xn}(Math.abs(Q.x)>0||Math.abs(Q.y)>0)&&he(!0),(Ve=tt.current)==null||Ve.style.setProperty("--swipe-amount-x",`${Q.x}px`),(Rt=tt.current)==null||Rt.style.setProperty("--swipe-amount-y",`${Q.y}px`)}},bn&&!p.jsx&&gt!=="loading"?_e.createElement("button",{"aria-label":I,"data-disabled":D,"data-close-button":!0,onClick:D||!yt?()=>{}:()=>{G(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ma(j==null?void 0:j.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},($e=oe==null?void 0:oe.close)!=null?$e:dP):null,(gt||p.icon||p.promise)&&p.icon!==null&&((oe==null?void 0:oe[gt])!==null||p.icon)?_e.createElement("div",{"data-icon":"",className:Ma(j==null?void 0:j.icon,p==null||(l=p.classNames)==null?void 0:l.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ge():null,p.type!=="loading"?ye:null):null,_e.createElement("div",{"data-content":"",className:Ma(j==null?void 0:j.content,p==null||(c=p.classNames)==null?void 0:c.content)},_e.createElement("div",{"data-title":"",className:Ma(j==null?void 0:j.title,p==null||(f=p.classNames)==null?void 0:f.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?_e.createElement("div",{"data-description":"",className:Ma(J,$t,j==null?void 0:j.description,p==null||(h=p.classNames)==null?void 0:h.description)},typeof p.description=="function"?p.description():p.description):null),_e.isValidElement(p.cancel)?p.cancel:p.cancel&&ym(p.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||z,onClick:Se=>{ym(p.cancel)&&yt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),G())},className:Ma(j==null?void 0:j.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,_e.isValidElement(p.action)?p.action:p.action&&ym(p.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||te,onClick:Se=>{ym(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&G())},className:Ma(j==null?void 0:j.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function WO(){if(typeof window>"u"||typeof document>"u")return"ltr";const o=document.documentElement.getAttribute("dir");return o==="auto"||!o?window.getComputedStyle(document.documentElement).direction:o}function DP(o,n){const a={};return[o,n].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?wP:SP;function g(m){["top","right","bottom","left"].forEach(b=>{a[`${f}-${b}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?a[`${f}-${m}`]=h:a[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):g(h)}),a}const AP=_e.forwardRef(function(n,a){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:g,className:m,offset:b,mobileOffset:p,theme:v="light",richColors:w,duration:E,style:T,visibleToasts:C=vP,toastOptions:A,dir:k=WO(),gap:U=xP,icons:M,containerAriaLabel:Y="Notifications"}=n,[$,_]=_e.useState([]),z=_e.useMemo(()=>s?$.filter(ae=>ae.toasterId===s):$.filter(ae=>!ae.toasterId),[$,s]),te=_e.useMemo(()=>Array.from(new Set([c].concat(z.filter(ae=>ae.position).map(ae=>ae.position)))),[z,c]),[H,J]=_e.useState([]),[N,P]=_e.useState(!1),[ne,Z]=_e.useState(!1),[j,oe]=_e.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=_e.useRef(null),ie=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),pe=_e.useRef(null),L=_e.useRef(!1),ce=_e.useCallback(ae=>{_(me=>{var Te;return(Te=me.find(Ue=>Ue.id===ae.id))!=null&&Te.delete||Yo.dismiss(ae.id),me.filter(({id:Ue})=>Ue!==ae.id)})},[]);return _e.useEffect(()=>Yo.subscribe(ae=>{if(ae.dismiss){requestAnimationFrame(()=>{_(me=>me.map(Te=>Te.id===ae.id?{...Te,delete:!0}:Te))});return}setTimeout(()=>{nP.flushSync(()=>{_(me=>{const Te=me.findIndex(Ue=>Ue.id===ae.id);return Te!==-1?[...me.slice(0,Te),{...me[Te],...ae},...me.slice(Te+1)]:[ae,...me]})})})}),[$]),_e.useEffect(()=>{if(v!=="system"){oe(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?oe("dark"):oe("light")),typeof window>"u")return;const ae=window.matchMedia("(prefers-color-scheme: dark)");try{ae.addEventListener("change",({matches:me})=>{oe(me?"dark":"light")})}catch{ae.addListener(({matches:Te})=>{try{oe(Te?"dark":"light")}catch(Ue){console.error(Ue)}})}},[v]),_e.useEffect(()=>{$.length<=1&&P(!1)},[$]),_e.useEffect(()=>{const ae=me=>{var Te;if(f.every(ze=>me[ze]||me.code===ze)){var ve;P(!0),(ve=I.current)==null||ve.focus()}me.code==="Escape"&&(document.activeElement===I.current||(Te=I.current)!=null&&Te.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[f]),_e.useEffect(()=>{if(I.current)return()=>{pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null,L.current=!1)}},[I.current]),_e.createElement("section",{ref:a,"aria-label":`${Y} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},te.map((ae,me)=>{var Te;const[Ue,ve]=ae.split("-");return z.length?_e.createElement("ol",{key:ae,dir:k==="auto"?WO():k,tabIndex:-1,ref:I,className:m,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":Ue,"data-x-position":ve,style:{"--front-toast-height":`${((Te=H[0])==null?void 0:Te.height)||0}px`,"--width":`${EP}px`,"--gap":`${U}px`,...T,...DP(b,p)},onBlur:ze=>{L.current&&!ze.currentTarget.contains(ze.relatedTarget)&&(L.current=!1,pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null))},onFocus:ze=>{ze.target instanceof HTMLElement&&ze.target.dataset.dismissible==="false"||L.current||(L.current=!0,pe.current=ze.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{ne||P(!1)},onDragEnd:()=>P(!1),onPointerDown:ze=>{ze.target instanceof HTMLElement&&ze.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},z.filter(ze=>!ze.position&&me===0||ze.position===ae).map((ze,je)=>{var at,xe;return _e.createElement(OP,{key:ze.id,icons:M,index:je,toast:ze,defaultRichColors:w,duration:(at=A==null?void 0:A.duration)!=null?at:E,className:A==null?void 0:A.className,descriptionClassName:A==null?void 0:A.descriptionClassName,invert:l,visibleToasts:C,closeButton:(xe=A==null?void 0:A.closeButton)!=null?xe:g,interacting:ne,position:ae,style:A==null?void 0:A.style,unstyled:A==null?void 0:A.unstyled,classNames:A==null?void 0:A.classNames,cancelButtonStyle:A==null?void 0:A.cancelButtonStyle,actionButtonStyle:A==null?void 0:A.actionButtonStyle,closeButtonAriaLabel:A==null?void 0:A.closeButtonAriaLabel,removeToast:ce,toasts:z.filter(he=>he.position==ze.position),heights:H.filter(he=>he.position==ze.position),setHeights:J,expandByDefault:h,gap:U,expanded:N,swipeDirections:n.swipeDirections})})):null}))}),mt=o=>typeof o=="string",lf=()=>{let o,n;const a=new Promise((s,l)=>{o=s,n=l});return a.resolve=o,a.reject=n,a},KO=o=>o==null?"":""+o,NP=(o,n,a)=>{o.forEach(s=>{n[s]&&(a[s]=n[s])})},MP=/###/g,JO=o=>o&&o.indexOf("###")>-1?o.replace(MP,"."):o,ZO=o=>!o||mt(o),vf=(o,n,a)=>{const s=mt(n)?n.split("."):n;let l=0;for(;l<s.length-1;){if(ZO(o))return{};const c=JO(s[l]);!o[c]&&a&&(o[c]=new a),Object.prototype.hasOwnProperty.call(o,c)?o=o[c]:o={},++l}return ZO(o)?{}:{obj:o,k:JO(s[l])}},eD=(o,n,a)=>{const{obj:s,k:l}=vf(o,n,Object);if(s!==void 0||n.length===1){s[l]=a;return}let c=n[n.length-1],f=n.slice(0,n.length-1),h=vf(o,f,Object);for(;h.obj===void 0&&f.length;)c=`${f[f.length-1]}.${c}`,f=f.slice(0,f.length-1),h=vf(o,f,Object),h!=null&&h.obj&&typeof h.obj[`${h.k}.${c}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${c}`]=a},_P=(o,n,a,s)=>{const{obj:l,k:c}=vf(o,n,Object);l[c]=l[c]||[],l[c].push(a)},Vm=(o,n)=>{const{obj:a,k:s}=vf(o,n);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},kP=(o,n,a)=>{const s=Vm(o,a);return s!==void 0?s:Vm(n,a)},RN=(o,n,a)=>{for(const s in n)s!=="__proto__"&&s!=="constructor"&&(s in o?mt(o[s])||o[s]instanceof String||mt(n[s])||n[s]instanceof String?a&&(o[s]=n[s]):RN(o[s],n[s],a):o[s]=n[s]);return o},Kc=o=>o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var LP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const UP=o=>mt(o)?o.replace(/[&<>"'\/]/g,n=>LP[n]):o;class zP{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const a=this.regExpMap.get(n);if(a!==void 0)return a;const s=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,s),this.regExpQueue.push(n),s}}const jP=[" ",",","?","!",";"],PP=new zP(20),HP=(o,n,a)=>{n=n||"",a=a||"";const s=jP.filter(f=>n.indexOf(f)<0&&a.indexOf(f)<0);if(s.length===0)return!0;const l=PP.getRegExp(`(${s.map(f=>f==="?"?"\\?":f).join("|")})`);let c=!l.test(o);if(!c){const f=o.indexOf(a);f>0&&!l.test(o.substring(0,f))&&(c=!0)}return c},nS=(o,n,a=".")=>{if(!o)return;if(o[n])return Object.prototype.hasOwnProperty.call(o,n)?o[n]:void 0;const s=n.split(a);let l=o;for(let c=0;c<s.length;){if(!l||typeof l!="object")return;let f,h="";for(let g=c;g<s.length;++g)if(g!==c&&(h+=a),h+=s[g],f=l[h],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<s.length-1)continue;c+=g-c+1;break}l=f}return l},Nf=o=>o==null?void 0:o.replace("_","-"),IP={type:"logger",log(o){this.output("log",o)},warn(o){this.output("warn",o)},error(o){this.output("error",o)},output(o,n){var a,s;(s=(a=console==null?void 0:console[o])==null?void 0:a.apply)==null||s.call(a,console,n)}};class Fm{constructor(n,a={}){this.init(n,a)}init(n,a={}){this.prefix=a.prefix||"i18next:",this.logger=n||IP,this.options=a,this.debug=a.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,a,s,l){return l&&!this.debug?null:(mt(n[0])&&(n[0]=`${s}${this.prefix} ${n[0]}`),this.logger[a](n))}create(n){return new Fm(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Fm(this.logger,n)}}var ja=new Fm;class ug{constructor(){this.observers={}}on(n,a){return n.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const l=this.observers[s].get(a)||0;this.observers[s].set(a,l+1)}),this}off(n,a){if(this.observers[n]){if(!a){delete this.observers[n];return}this.observers[n].delete(a)}}emit(n,...a){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l.apply(l,[n,...a])})}}class tD extends ug{constructor(n,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const a=this.options.ns.indexOf(n);a>-1&&this.options.ns.splice(a,1)}getResource(n,a,s,l={}){var m,b;const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,f=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;n.indexOf(".")>-1?h=n.split("."):(h=[n,a],s&&(Array.isArray(s)?h.push(...s):mt(s)&&c?h.push(...s.split(c)):h.push(s)));const g=Vm(this.data,h);return!g&&!a&&!s&&n.indexOf(".")>-1&&(n=h[0],a=h[1],s=h.slice(2).join(".")),g||!f||!mt(s)?g:nS((b=(m=this.data)==null?void 0:m[n])==null?void 0:b[a],s,c)}addResource(n,a,s,l,c={silent:!1}){const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let h=[n,a];s&&(h=h.concat(f?s.split(f):s)),n.indexOf(".")>-1&&(h=n.split("."),l=a,a=h[1]),this.addNamespaces(a),eD(this.data,h,l),c.silent||this.emit("added",n,a,s,l)}addResources(n,a,s,l={silent:!1}){for(const c in s)(mt(s[c])||Array.isArray(s[c]))&&this.addResource(n,a,c,s[c],{silent:!0});l.silent||this.emit("added",n,a,s)}addResourceBundle(n,a,s,l,c,f={silent:!1,skipCopy:!1}){let h=[n,a];n.indexOf(".")>-1&&(h=n.split("."),l=s,s=a,a=h[1]),this.addNamespaces(a);let g=Vm(this.data,h)||{};f.skipCopy||(s=JSON.parse(JSON.stringify(s))),l?RN(g,s,c):g={...g,...s},eD(this.data,h,g),f.silent||this.emit("added",n,a,s)}removeResourceBundle(n,a){this.hasResourceBundle(n,a)&&delete this.data[n][a],this.removeNamespaces(a),this.emit("removed",n,a)}hasResourceBundle(n,a){return this.getResource(n,a)!==void 0}getResourceBundle(n,a){return a||(a=this.options.defaultNS),this.getResource(n,a)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const a=this.getDataByLanguage(n);return!!(a&&Object.keys(a)||[]).find(l=>a[l]&&Object.keys(a[l]).length>0)}toJSON(){return this.data}}var TN={processors:{},addPostProcessor(o){this.processors[o.name]=o},handle(o,n,a,s,l){return o.forEach(c=>{var f;n=((f=this.processors[c])==null?void 0:f.process(n,a,s,l))??n}),n}};const CN=Symbol("i18next/PATH_KEY");function BP(){const o=[],n=Object.create(null);let a;return n.get=(s,l)=>{var c;return(c=a==null?void 0:a.revoke)==null||c.call(a),l===CN?o:(o.push(l),a=Proxy.revocable(s,n),a.proxy)},Proxy.revocable(Object.create(null),n).proxy}function oS(o,n){const{[CN]:a}=o(BP());return a.join((n==null?void 0:n.keySeparator)??".")}const nD={},u0=o=>!mt(o)&&typeof o!="boolean"&&typeof o!="number";class Ym extends ug{constructor(n,a={}){super(),NP(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ja.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n,a={interpolation:{}}){const s={...a};if(n==null)return!1;const l=this.resolve(n,s);if((l==null?void 0:l.res)===void 0)return!1;const c=u0(l.res);return!(s.returnObjects===!1&&c)}extractFromKey(n,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const f=s&&n.indexOf(s)>-1,h=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!HP(n,s,l);if(f&&!h){const g=n.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:n,namespaces:mt(c)?[c]:c};const m=n.split(s);(s!==l||s===l&&this.options.ns.indexOf(m[0])>-1)&&(c=m.shift()),n=m.join(l)}return{key:n,namespaces:mt(c)?[c]:c}}translate(n,a,s){let l=typeof a=="object"?{...a}:a;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),n==null)return"";typeof n=="function"&&(n=oS(n,{...this.options,...l})),Array.isArray(n)||(n=[String(n)]);const c=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:h,namespaces:g}=this.extractFromKey(n[n.length-1],l),m=g[g.length-1];let b=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const p=l.lng||this.language,v=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return v?c?{res:`${m}${b}${h}`,usedKey:h,exactUsedKey:h,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(l)}:`${m}${b}${h}`:c?{res:h,usedKey:h,exactUsedKey:h,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(l)}:h;const w=this.resolve(n,l);let E=w==null?void 0:w.res;const T=(w==null?void 0:w.usedKey)||h,C=(w==null?void 0:w.exactUsedKey)||h,A=["[object Number]","[object Function]","[object RegExp]"],k=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,U=!this.i18nFormat||this.i18nFormat.handleAsObject,M=l.count!==void 0&&!mt(l.count),Y=Ym.hasDefaultValue(l),$=M?this.pluralResolver.getSuffix(p,l.count,l):"",_=l.ordinal&&M?this.pluralResolver.getSuffix(p,l.count,{ordinal:!1}):"",z=M&&!l.ordinal&&l.count===0,te=z&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${$}`]||l[`defaultValue${_}`]||l.defaultValue;let H=E;U&&!E&&Y&&(H=te);const J=u0(H),N=Object.prototype.toString.apply(H);if(U&&H&&J&&A.indexOf(N)<0&&!(mt(k)&&Array.isArray(H))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,H,{...l,ns:g}):`key '${h} (${this.language})' returned an object instead of string.`;return c?(w.res=P,w.usedParams=this.getUsedParamsDetails(l),w):P}if(f){const P=Array.isArray(H),ne=P?[]:{},Z=P?C:T;for(const j in H)if(Object.prototype.hasOwnProperty.call(H,j)){const oe=`${Z}${f}${j}`;Y&&!E?ne[j]=this.translate(oe,{...l,defaultValue:u0(te)?te[j]:void 0,joinArrays:!1,ns:g}):ne[j]=this.translate(oe,{...l,joinArrays:!1,ns:g}),ne[j]===oe&&(ne[j]=H[j])}E=ne}}else if(U&&mt(k)&&Array.isArray(E))E=E.join(k),E&&(E=this.extendTranslation(E,n,l,s));else{let P=!1,ne=!1;!this.isValidLookup(E)&&Y&&(P=!0,E=te),this.isValidLookup(E)||(ne=!0,E=h);const j=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:E,oe=Y&&te!==E&&this.options.updateMissing;if(ne||P||oe){if(this.logger.log(oe?"updateKey":"missingKey",p,m,h,oe?te:E),f){const L=this.resolve(h,{...l,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let I=[];const ie=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ie&&ie[0])for(let L=0;L<ie.length;L++)I.push(ie[L]);else this.options.saveMissingTo==="all"?I=this.languageUtils.toResolveHierarchy(l.lng||this.language):I.push(l.lng||this.language);const pe=(L,ce,ae)=>{var Te;const me=Y&&ae!==E?ae:j;this.options.missingKeyHandler?this.options.missingKeyHandler(L,m,ce,me,oe,l):(Te=this.backendConnector)!=null&&Te.saveMissing&&this.backendConnector.saveMissing(L,m,ce,me,oe,l),this.emit("missingKey",L,m,ce,E)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?I.forEach(L=>{const ce=this.pluralResolver.getSuffixes(L,l);z&&l[`defaultValue${this.options.pluralSeparator}zero`]&&ce.indexOf(`${this.options.pluralSeparator}zero`)<0&&ce.push(`${this.options.pluralSeparator}zero`),ce.forEach(ae=>{pe([L],h+ae,l[`defaultValue${ae}`]||te)})}):pe(I,h,te))}E=this.extendTranslation(E,n,l,w,s),ne&&E===h&&this.options.appendNamespaceToMissingKey&&(E=`${m}${b}${h}`),(ne||P)&&this.options.parseMissingKeyHandler&&(E=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${b}${h}`:h,P?E:void 0,l))}return c?(w.res=E,w.usedParams=this.getUsedParamsDetails(l),w):E}extendTranslation(n,a,s,l,c){var g,m;if((g=this.i18nFormat)!=null&&g.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const b=mt(n)&&(((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(b){const w=n.match(this.interpolator.nestingRegexp);p=w&&w.length}let v=s.replace&&!mt(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),n=this.interpolator.interpolate(n,v,s.lng||this.language||l.usedLng,s),b){const w=n.match(this.interpolator.nestingRegexp),E=w&&w.length;p<E&&(s.nest=!1)}!s.lng&&l&&l.res&&(s.lng=this.language||l.usedLng),s.nest!==!1&&(n=this.interpolator.nest(n,(...w)=>(c==null?void 0:c[0])===w[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${w[0]} in key: ${a[0]}`),null):this.translate(...w,a),s)),s.interpolation&&this.interpolator.reset()}const f=s.postProcess||this.options.postProcess,h=mt(f)?[f]:f;return n!=null&&(h!=null&&h.length)&&s.applyPostProcessor!==!1&&(n=TN.handle(h,n,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),n}resolve(n,a={}){let s,l,c,f,h;return mt(n)&&(n=[n]),n.forEach(g=>{if(this.isValidLookup(s))return;const m=this.extractFromKey(g,a),b=m.key;l=b;let p=m.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const v=a.count!==void 0&&!mt(a.count),w=v&&!a.ordinal&&a.count===0,E=a.context!==void 0&&(mt(a.context)||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);p.forEach(C=>{var A,k;this.isValidLookup(s)||(h=C,!nD[`${T[0]}-${C}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((k=this.utils)!=null&&k.hasLoadedNamespace(h))&&(nD[`${T[0]}-${C}`]=!0,this.logger.warn(`key "${l}" for languages "${T.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(U=>{var $;if(this.isValidLookup(s))return;f=U;const M=[b];if(($=this.i18nFormat)!=null&&$.addLookupKeys)this.i18nFormat.addLookupKeys(M,b,U,C,a);else{let _;v&&(_=this.pluralResolver.getSuffix(U,a.count,a));const z=`${this.options.pluralSeparator}zero`,te=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(a.ordinal&&_.indexOf(te)===0&&M.push(b+_.replace(te,this.options.pluralSeparator)),M.push(b+_),w&&M.push(b+z)),E){const H=`${b}${this.options.contextSeparator||"_"}${a.context}`;M.push(H),v&&(a.ordinal&&_.indexOf(te)===0&&M.push(H+_.replace(te,this.options.pluralSeparator)),M.push(H+_),w&&M.push(H+z))}}let Y;for(;Y=M.pop();)this.isValidLookup(s)||(c=Y,s=this.getResource(U,C,Y,a))}))})}),{res:s,usedKey:l,exactUsedKey:c,usedLng:f,usedNS:h}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,a,s,l={}){var c;return(c=this.i18nFormat)!=null&&c.getResource?this.i18nFormat.getResource(n,a,s,l):this.resourceStore.getResource(n,a,s,l)}getUsedParamsDetails(n={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=n.replace&&!mt(n.replace);let l=s?n.replace:n;if(s&&typeof n.count<"u"&&(l.count=n.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!s){l={...l};for(const c of a)delete l[c]}return l}static hasDefaultValue(n){const a="defaultValue";for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&a===s.substring(0,a.length)&&n[s]!==void 0)return!0;return!1}}class oD{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ja.create("languageUtils")}getScriptPartFromCode(n){if(n=Nf(n),!n||n.indexOf("-")<0)return null;const a=n.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(n){if(n=Nf(n),!n||n.indexOf("-")<0)return n;const a=n.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(n){if(mt(n)&&n.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(n)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let a;return n.forEach(s=>{if(a)return;const l=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(l))&&(a=l)}),!a&&this.options.supportedLngs&&n.forEach(s=>{if(a)return;const l=this.getScriptPartFromCode(s);if(this.isSupportedCode(l))return a=l;const c=this.getLanguagePartFromCode(s);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(f=>{if(f===c)return f;if(!(f.indexOf("-")<0&&c.indexOf("-")<0)&&(f.indexOf("-")>0&&c.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===c||f.indexOf(c)===0&&c.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(n,a){if(!n)return[];if(typeof n=="function"&&(n=n(a)),mt(n)&&(n=[n]),Array.isArray(n))return n;if(!a)return n.default||[];let s=n[a];return s||(s=n[this.getScriptPartFromCode(a)]),s||(s=n[this.formatLanguageCode(a)]),s||(s=n[this.getLanguagePartFromCode(a)]),s||(s=n.default),s||[]}toResolveHierarchy(n,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],n),l=[],c=f=>{f&&(this.isSupportedCode(f)?l.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return mt(n)&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(n))):mt(n)&&c(this.formatLanguageCode(n)),s.forEach(f=>{l.indexOf(f)<0&&c(this.formatLanguageCode(f))}),l}}const rD={zero:0,one:1,two:2,few:3,many:4,other:5},aD={select:o=>o===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class VP{constructor(n,a={}){this.languageUtils=n,this.options=a,this.logger=ja.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(n,a={}){const s=Nf(n==="dev"?"en":n),l=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:s,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let f;try{f=new Intl.PluralRules(s,{type:l})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),aD;if(!n.match(/-|_/))return aD;const g=this.languageUtils.getLanguagePartFromCode(n);f=this.getRule(g,a)}return this.pluralRulesCache[c]=f,f}needsPlural(n,a={}){let s=this.getRule(n,a);return s||(s=this.getRule("dev",a)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(n,a,s={}){return this.getSuffixes(n,s).map(l=>`${a}${l}`)}getSuffixes(n,a={}){let s=this.getRule(n,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((l,c)=>rD[l]-rD[c]).map(l=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(n,a,s={}){const l=this.getRule(n,s);return l?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${l.select(a)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",a,s))}}const sD=(o,n,a,s=".",l=!0)=>{let c=kP(o,n,a);return!c&&l&&mt(a)&&(c=nS(o,a,s),c===void 0&&(c=nS(n,a,s))),c},d0=o=>o.replace(/\$/g,"$$$$");class iD{constructor(n={}){var a;this.logger=ja.create("interpolator"),this.options=n,this.format=((a=n==null?void 0:n.interpolation)==null?void 0:a.format)||(s=>s),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:l,prefix:c,prefixEscaped:f,suffix:h,suffixEscaped:g,formatSeparator:m,unescapeSuffix:b,unescapePrefix:p,nestingPrefix:v,nestingPrefixEscaped:w,nestingSuffix:E,nestingSuffixEscaped:T,nestingOptionsSeparator:C,maxReplaces:A,alwaysFormat:k}=n.interpolation;this.escape=a!==void 0?a:UP,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?Kc(c):f||"{{",this.suffix=h?Kc(h):g||"}}",this.formatSeparator=m||",",this.unescapePrefix=b?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=v?Kc(v):w||Kc("$t("),this.nestingSuffix=E?Kc(E):T||Kc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=A||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(a,s)=>(a==null?void 0:a.source)===s?(a.lastIndex=0,a):new RegExp(s,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(n,a,s,l){var w;let c,f,h;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=E=>{if(E.indexOf(this.formatSeparator)<0){const k=sD(a,g,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,s,{...l,...a,interpolationkey:E}):k}const T=E.split(this.formatSeparator),C=T.shift().trim(),A=T.join(this.formatSeparator).trim();return this.format(sD(a,g,C,this.options.keySeparator,this.options.ignoreJSONStructure),A,s,{...l,...a,interpolationkey:C})};this.resetRegExp();const b=(l==null?void 0:l.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((w=l==null?void 0:l.interpolation)==null?void 0:w.skipOnVariables)!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>d0(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?d0(this.escape(E)):d0(E)}].forEach(E=>{for(h=0;c=E.regex.exec(n);){const T=c[1].trim();if(f=m(T),f===void 0)if(typeof b=="function"){const A=b(n,c,l);f=mt(A)?A:""}else if(l&&Object.prototype.hasOwnProperty.call(l,T))f="";else if(p){f=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${n}`),f="";else!mt(f)&&!this.useRawValueToEscape&&(f=KO(f));const C=E.safeValue(f);if(n=n.replace(c[0],C),p?(E.regex.lastIndex+=f.length,E.regex.lastIndex-=c[0].length):E.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),n}nest(n,a,s={}){let l,c,f;const h=(g,m)=>{const b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;const p=g.split(new RegExp(`${b}[ ]*{`));let v=`{${p[1]}`;g=p[0],v=this.interpolate(v,f);const w=v.match(/'/g),E=v.match(/"/g);(((w==null?void 0:w.length)??0)%2===0&&!E||E.length%2!==0)&&(v=v.replace(/'/g,'"'));try{f=JSON.parse(v),m&&(f={...m,...f})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${b}${v}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;l=this.nestingRegexp.exec(n);){let g=[];f={...s},f=f.replace&&!mt(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const m=/{.*}/.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(m!==-1&&(g=l[1].slice(m).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),l[1]=l[1].slice(0,m)),c=a(h.call(this,l[1].trim(),f),f),c&&l[0]===n&&!mt(c))return c;mt(c)||(c=KO(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${n}`),c=""),g.length&&(c=g.reduce((b,p)=>this.format(b,p,s.lng,{...s,interpolationkey:l[1].trim()}),c.trim())),n=n.replace(l[0],c),this.regexp.lastIndex=0}return n}}const FP=o=>{let n=o.toLowerCase().trim();const a={};if(o.indexOf("(")>-1){const s=o.split("(");n=s[0].toLowerCase().trim();const l=s[1].substring(0,s[1].length-1);n==="currency"&&l.indexOf(":")<0?a.currency||(a.currency=l.trim()):n==="relativetime"&&l.indexOf(":")<0?a.range||(a.range=l.trim()):l.split(";").forEach(f=>{if(f){const[h,...g]=f.split(":"),m=g.join(":").trim().replace(/^'+|'+$/g,""),b=h.trim();a[b]||(a[b]=m),m==="false"&&(a[b]=!1),m==="true"&&(a[b]=!0),isNaN(m)||(a[b]=parseInt(m,10))}})}return{formatName:n,formatOptions:a}},lD=o=>{const n={};return(a,s,l)=>{let c=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(c={...c,[l.interpolationkey]:void 0});const f=s+JSON.stringify(c);let h=n[f];return h||(h=o(Nf(s),l),n[f]=h),h(a)}},YP=o=>(n,a,s)=>o(Nf(a),s)(n);class $P{constructor(n={}){this.logger=ja.create("formatter"),this.options=n,this.init(n)}init(n,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?lD:YP;this.formats={number:s((l,c)=>{const f=new Intl.NumberFormat(l,{...c});return h=>f.format(h)}),currency:s((l,c)=>{const f=new Intl.NumberFormat(l,{...c,style:"currency"});return h=>f.format(h)}),datetime:s((l,c)=>{const f=new Intl.DateTimeFormat(l,{...c});return h=>f.format(h)}),relativetime:s((l,c)=>{const f=new Intl.RelativeTimeFormat(l,{...c});return h=>f.format(h,c.range||"day")}),list:s((l,c)=>{const f=new Intl.ListFormat(l,{...c});return h=>f.format(h)})}}add(n,a){this.formats[n.toLowerCase().trim()]=a}addCached(n,a){this.formats[n.toLowerCase().trim()]=lD(a)}format(n,a,s,l={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(h=>h.indexOf(")")>-1)){const h=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,h)].join(this.formatSeparator)}return c.reduce((h,g)=>{var p;const{formatName:m,formatOptions:b}=FP(g);if(this.formats[m]){let v=h;try{const w=((p=l==null?void 0:l.formatParams)==null?void 0:p[l.interpolationkey])||{},E=w.locale||w.lng||l.locale||l.lng||s;v=this.formats[m](h,E,{...b,...l,...w})}catch(w){this.logger.warn(w)}return v}else this.logger.warn(`there was no format function for ${m}`);return h},n)}}const qP=(o,n)=>{o.pending[n]!==void 0&&(delete o.pending[n],o.pendingCount--)};class GP extends ug{constructor(n,a,s,l={}){var c,f;super(),this.backend=n,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=l,this.logger=ja.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],(f=(c=this.backend)==null?void 0:c.init)==null||f.call(c,s,l.backend,l)}queueLoad(n,a,s,l){const c={},f={},h={},g={};return n.forEach(m=>{let b=!0;a.forEach(p=>{const v=`${m}|${p}`;!s.reload&&this.store.hasResourceBundle(m,p)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?f[v]===void 0&&(f[v]=!0):(this.state[v]=1,b=!1,f[v]===void 0&&(f[v]=!0),c[v]===void 0&&(c[v]=!0),g[p]===void 0&&(g[p]=!0)))}),b||(h[m]=!0)}),(Object.keys(c).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(f),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(g)}}loaded(n,a,s){const l=n.split("|"),c=l[0],f=l[1];a&&this.emit("failedLoading",c,f,a),!a&&s&&this.store.addResourceBundle(c,f,s,void 0,void 0,{skipCopy:!0}),this.state[n]=a?-1:2,a&&s&&(this.state[n]=0);const h={};this.queue.forEach(g=>{_P(g.loaded,[c],f),qP(g,n),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(m=>{h[m]||(h[m]={});const b=g.loaded[m];b.length&&b.forEach(p=>{h[m][p]===void 0&&(h[m][p]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(g=>!g.done)}read(n,a,s,l=0,c=this.retryTimeout,f){if(!n.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:a,fcName:s,tried:l,wait:c,callback:f});return}this.readingCalls++;const h=(m,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(m&&b&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,n,a,s,l+1,c*2,f)},c);return}f(m,b)},g=this.backend[s].bind(this.backend);if(g.length===2){try{const m=g(n,a);m&&typeof m.then=="function"?m.then(b=>h(null,b)).catch(h):h(null,m)}catch(m){h(m)}return}return g(n,a,h)}prepareLoading(n,a,s={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();mt(n)&&(n=this.languageUtils.toResolveHierarchy(n)),mt(a)&&(a=[a]);const c=this.queueLoad(n,a,s,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(f=>{this.loadOne(f)})}load(n,a,s){this.prepareLoading(n,a,{},s)}reload(n,a,s){this.prepareLoading(n,a,{reload:!0},s)}loadOne(n,a=""){const s=n.split("|"),l=s[0],c=s[1];this.read(l,c,"read",void 0,void 0,(f,h)=>{f&&this.logger.warn(`${a}loading namespace ${c} for language ${l} failed`,f),!f&&h&&this.logger.log(`${a}loaded namespace ${c} for language ${l}`,h),this.loaded(n,f,h)})}saveMissing(n,a,s,l,c,f={},h=()=>{}){var g,m,b,p,v;if((m=(g=this.services)==null?void 0:g.utils)!=null&&m.hasLoadedNamespace&&!((p=(b=this.services)==null?void 0:b.utils)!=null&&p.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${s}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((v=this.backend)!=null&&v.create){const w={...f,isUpdate:c},E=this.backend.create.bind(this.backend);if(E.length<6)try{let T;E.length===5?T=E(n,a,s,l,w):T=E(n,a,s,l),T&&typeof T.then=="function"?T.then(C=>h(null,C)).catch(h):h(null,T)}catch(T){h(T)}else E(n,a,s,l,h,w)}!n||!n[0]||this.store.addResource(n[0],a,s,l)}}}const f0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:o=>{let n={};if(typeof o[1]=="object"&&(n=o[1]),mt(o[1])&&(n.defaultValue=o[1]),mt(o[2])&&(n.tDescription=o[2]),typeof o[2]=="object"||typeof o[3]=="object"){const a=o[3]||o[2];Object.keys(a).forEach(s=>{n[s]=a[s]})}return n},interpolation:{escapeValue:!0,format:o=>o,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),cD=o=>{var n,a;return mt(o.ns)&&(o.ns=[o.ns]),mt(o.fallbackLng)&&(o.fallbackLng=[o.fallbackLng]),mt(o.fallbackNS)&&(o.fallbackNS=[o.fallbackNS]),((a=(n=o.supportedLngs)==null?void 0:n.indexOf)==null?void 0:a.call(n,"cimode"))<0&&(o.supportedLngs=o.supportedLngs.concat(["cimode"])),typeof o.initImmediate=="boolean"&&(o.initAsync=o.initImmediate),o},bm=()=>{},XP=o=>{Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(a=>{typeof o[a]=="function"&&(o[a]=o[a].bind(o))})},QP=o=>{var n,a,s,l,c,f,h,g,m;return!!(((s=(a=(n=o==null?void 0:o.modules)==null?void 0:n.backend)==null?void 0:a.name)==null?void 0:s.indexOf("Locize"))>0||((h=(f=(c=(l=o==null?void 0:o.modules)==null?void 0:l.backend)==null?void 0:c.constructor)==null?void 0:f.name)==null?void 0:h.indexOf("Locize"))>0||(m=(g=o==null?void 0:o.options)==null?void 0:g.backend)!=null&&m.backends&&o.options.backend.backends.some(b=>{var p,v,w;return((p=b==null?void 0:b.name)==null?void 0:p.indexOf("Locize"))>0||((w=(v=b==null?void 0:b.constructor)==null?void 0:v.name)==null?void 0:w.indexOf("Locize"))>0}))};class Sf extends ug{constructor(n={},a){if(super(),this.options=cD(n),this.services={},this.logger=ja,this.modules={external:[]},XP(this),a&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,a),this;setTimeout(()=>{this.init(n,a)},0)}}init(n={},a){this.isInitializing=!0,typeof n=="function"&&(a=n,n={}),n.defaultNS==null&&n.ns&&(mt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=f0();this.options={...s,...this.options,...cD(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!QP(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const l=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?ja.init(l(this.modules.logger),this.options):ja.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=$P;const b=new oD(this.options);this.store=new tD(this.options.resources,this.options);const p=this.services;p.logger=ja,p.resourceStore=this.store,p.languageUtils=b,p.pluralResolver=new VP(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=l(m),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new iD(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new GP(l(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(w,...E)=>{this.emit(w,...E)}),this.modules.languageDetector&&(p.languageDetector=l(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=l(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Ym(this.services,this.options),this.translator.on("*",(w,...E)=>{this.emit(w,...E)}),this.modules.external.forEach(w=>{w.init&&w.init(this)})}if(this.format=this.options.interpolation.format,a||(a=bm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=(...b)=>this.store[m](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...b)=>(this.store[m](...b),this)});const h=lf(),g=()=>{const m=(b,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(p),a(b,p)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),h}loadResources(n,a=bm){var c,f;let s=a;const l=mt(n)?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if((l==null?void 0:l.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const h=[],g=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&h.indexOf(p)<0&&h.push(p)})};l?g(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>g(b)),(f=(c=this.options.preload)==null?void 0:c.forEach)==null||f.call(c,m=>g(m)),this.services.backendConnector.load(h,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(m)})}else s(null)}reloadResources(n,a,s){const l=lf();return typeof n=="function"&&(s=n,n=void 0),typeof a=="function"&&(s=a,a=void 0),n||(n=this.languages),a||(a=this.options.ns),s||(s=bm),this.services.backendConnector.reload(n,a,c=>{l.resolve(),s(c)}),l}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&TN.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1)){for(let a=0;a<this.languages.length;a++){const s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(n)<0&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,a){this.isLanguageChangingTo=n;const s=lf();this.emit("languageChanging",n);const l=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},c=(h,g)=>{g?this.isLanguageChangingTo===n&&(l(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,s.resolve((...m)=>this.t(...m)),a&&a(h,(...m)=>this.t(...m))},f=h=>{var b,p;!n&&!h&&this.services.languageDetector&&(h=[]);const g=mt(h)?h:h&&h[0],m=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(mt(h)?[h]:h);m&&(this.language||l(m),this.translator.language||this.translator.changeLanguage(m),(p=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||p.call(b,m)),this.loadResources(m,v=>{c(v,m)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(n),s}getFixedT(n,a,s){const l=(c,f,...h)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([c,f].concat(h)):g={...f},g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||s||l.keyPrefix);const m=this.options.keySeparator||".";let b;return g.keyPrefix&&Array.isArray(c)?b=c.map(p=>(typeof p=="function"&&(p=oS(p,{...this.options,...f})),`${g.keyPrefix}${m}${p}`)):(typeof c=="function"&&(c=oS(c,{...this.options,...f})),b=g.keyPrefix?`${g.keyPrefix}${m}${c}`:c),this.t(b,g)};return mt(n)?l.lng=n:l.lngs=n,l.ns=a,l.keyPrefix=s,l}t(...n){var a;return(a=this.translator)==null?void 0:a.translate(...n)}exists(...n){var a;return(a=this.translator)==null?void 0:a.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=a.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const f=(h,g)=>{const m=this.services.backendConnector.state[`${h}|${g}`];return m===-1||m===0||m===2};if(a.precheck){const h=a.precheck(this,f);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(s,n)&&(!l||f(c,n)))}loadNamespaces(n,a){const s=lf();return this.options.ns?(mt(n)&&(n=[n]),n.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{s.resolve(),a&&a(l)}),s):(a&&a(),Promise.resolve())}loadLanguages(n,a){const s=lf();mt(n)&&(n=[n]);const l=this.options.preload||[],c=n.filter(f=>l.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return c.length?(this.options.preload=l.concat(c),this.loadResources(f=>{s.resolve(),a&&a(f)}),s):(a&&a(),Promise.resolve())}dir(n){var l,c;if(n||(n=this.resolvedLanguage||(((l=this.languages)==null?void 0:l.length)>0?this.languages[0]:this.language)),!n)return"rtl";try{const f=new Intl.Locale(n);if(f&&f.getTextInfo){const h=f.getTextInfo();if(h&&h.direction)return h.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((c=this.services)==null?void 0:c.languageUtils)||new oD(f0());return n.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},a){const s=new Sf(n,a);return s.createInstance=Sf.createInstance,s}cloneInstance(n={},a=bm){const s=n.forkResourceStore;s&&delete n.forkResourceStore;const l={...this.options,...n,isClone:!0},c=new Sf(l);if((n.debug!==void 0||n.prefix!==void 0)&&(c.logger=c.logger.clone(n)),["store","services","language"].forEach(h=>{c[h]=this[h]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},s){const h=Object.keys(this.store.data).reduce((g,m)=>(g[m]={...this.store.data[m]},g[m]=Object.keys(g[m]).reduce((b,p)=>(b[p]={...g[m][p]},b),g[m]),g),{});c.store=new tD(h,l),c.services.resourceStore=c.store}if(n.interpolation){const g={...f0().interpolation,...this.options.interpolation,...n.interpolation},m={...l,interpolation:g};c.services.interpolator=new iD(m)}return c.translator=new Ym(c.services,l),c.translator.on("*",(h,...g)=>{c.emit(h,...g)}),c.init(l,a),c.translator.options=l,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lo=Sf.createInstance();lo.createInstance;lo.dir;lo.init;lo.loadResources;lo.reloadResources;lo.use;lo.changeLanguage;lo.getFixedT;lo.t;lo.exists;lo.setDefaultNamespace;lo.hasLoadedNamespace;lo.loadNamespaces;lo.loadLanguages;const WP=(o,n,a,s)=>{var c,f,h,g;const l=[a,{code:n,...s||{}}];if((f=(c=o==null?void 0:o.services)==null?void 0:c.logger)!=null&&f.forward)return o.services.logger.forward(l,"warn","react-i18next::",!0);Yl(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),(g=(h=o==null?void 0:o.services)==null?void 0:h.logger)!=null&&g.warn?o.services.logger.warn(...l):console!=null&&console.warn&&console.warn(...l)},uD={},ON=(o,n,a,s)=>{Yl(a)&&uD[a]||(Yl(a)&&(uD[a]=new Date),WP(o,n,a,s))},DN=(o,n)=>()=>{if(o.isInitialized)n();else{const a=()=>{setTimeout(()=>{o.off("initialized",a)},0),n()};o.on("initialized",a)}},rS=(o,n,a)=>{o.loadNamespaces(n,DN(o,a))},dD=(o,n,a,s)=>{if(Yl(a)&&(a=[a]),o.options.preload&&o.options.preload.indexOf(n)>-1)return rS(o,a,s);a.forEach(l=>{o.options.ns.indexOf(l)<0&&o.options.ns.push(l)}),o.loadLanguages(n,DN(o,s))},KP=(o,n,a={})=>!n.languages||!n.languages.length?(ON(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(o,{lng:a.lng,precheck:(s,l)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!l(s.isLanguageChangingTo,o))return!1}}),Yl=o=>typeof o=="string",JP=o=>typeof o=="object"&&o!==null,ZP=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eH={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},tH=o=>eH[o],nH=o=>o.replace(ZP,tH);let aS={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:nH,transDefaultProps:void 0};const oH=(o={})=>{aS={...aS,...o}},rH=()=>aS;let AN;const aH=o=>{AN=o},sH=()=>AN,iH={type:"3rdParty",init(o){oH(o.options.react),aH(o)}},lH=x.createContext();class cH{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var h0={exports:{}},p0={},fD;function uH(){if(fD)return p0;fD=1;/**
301
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let v=Ns(),w;w=v;let E=w.pathname||"/",T=E;if(b!=="/"){let k=b.replace(/^\//,"").split("/");T="/"+E.replace(/^\//,"").split("/").slice(k.length).join("/")}let C=wi(o,{pathname:T});return qn(p||C!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),qn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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.`),o4(C&&C.map(k=>Object.assign({},k,{params:Object.assign({},g,k.params),pathname:Ha([b,c.encodeLocation?c.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?b:Ha([b,c.encodeLocation?c.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),f,a,s,l)}function Zj(){let o=l4(),n=Af(o)?`${o.status} ${o.statusText}`:o instanceof Error?o.message:JSON.stringify(o),a=o instanceof Error?o.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},f=null;return console.error("Error handled by React Router default ErrorBoundary:",o),f=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:c},"ErrorBoundary")," or"," ",x.createElement("code",{style:c},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),a?x.createElement("pre",{style:l},a):null,f)}var e4=x.createElement(Zj,null),bN=class extends x.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,n){return n.location!==o.location||n.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:n.error,location:n.location,revalidation:o.revalidation||n.revalidation}}componentDidCatch(o,n){this.props.onError?this.props.onError(o,n):console.error("React Router caught the following error during render",o)}render(){let o=this.state.error;if(this.context&&typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){const a=qj(o.digest);a&&(o=a)}let n=o!==void 0?x.createElement(ea.Provider,{value:this.props.routeContext},x.createElement(PS.Provider,{value:o,children:this.props.component})):this.props.children;return this.context?x.createElement(t4,{error:o},n):n}};bN.contextType=fN;var l0=new WeakMap;function t4({children:o,error:n}){let{basename:a}=x.useContext(jr);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=$j(n.digest);if(s){let l=l0.get(n);if(l)throw l;let c=eN(s.location,a);if(ZA&&!l0.get(n))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw l0.set(n,f),f}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return o}function n4({routeContext:o,match:n,children:a}){let s=x.useContext(Xl);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(ea.Provider,{value:o},a)}function o4(o,n=[],a=null,s=null,l=null){if(o==null){if(!a)return null;if(a.errors)o=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)o=a.matches;else return null}let c=o,f=a==null?void 0:a.errors;if(f!=null){let b=c.findIndex(p=>p.route.id&&(f==null?void 0:f[p.route.id])!==void 0);Mt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,b+1))}let h=!1,g=-1;if(a)for(let b=0;b<c.length;b++){let p=c[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(g=b),p.route.id){let{loaderData:v,errors:w}=a,E=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!w||w[p.route.id]===void 0);if(p.route.lazy||E){h=!0,g>=0?c=c.slice(0,g+1):c=[c[0]];break}}}let m=a&&s?(b,p)=>{var v,w;s(b,{location:a.location,params:((w=(v=a.matches)==null?void 0:v[0])==null?void 0:w.params)??{},unstable_pattern:Yf(a.matches),errorInfo:p})}:void 0;return c.reduceRight((b,p,v)=>{let w,E=!1,T=null,C=null;a&&(w=f&&p.route.id?f[p.route.id]:void 0,T=p.route.errorElement||e4,h&&(g<0&&v===0?(vN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):g===v&&(E=!0,C=p.route.hydrateFallbackElement||null)));let A=n.concat(c.slice(0,v+1)),k=()=>{let U;return w?U=T:E?U=C:p.route.Component?U=x.createElement(p.route.Component,null):p.route.element?U=p.route.element:U=b,x.createElement(n4,{match:p,routeContext:{outlet:b,matches:A,isDataRoute:a!=null},children:U})};return a&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?x.createElement(bN,{location:a.location,revalidation:a.revalidation,component:T,error:w,children:k(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:m}):k()},null)}function HS(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function r4(o){let n=x.useContext(Xl);return Mt(n,HS(o)),n}function a4(o){let n=x.useContext($f);return Mt(n,HS(o)),n}function s4(o){let n=x.useContext(ea);return Mt(n,HS(o)),n}function IS(o){let n=s4(o),a=n.matches[n.matches.length-1];return Mt(a.route.id,`${o} can only be used on routes that contain a unique "id"`),a.route.id}function i4(){return IS("useRouteId")}function l4(){var s;let o=x.useContext(PS),n=a4("useRouteError"),a=IS("useRouteError");return o!==void 0?o:(s=n.errors)==null?void 0:s[a]}function c4(){let{router:o}=r4("useNavigate"),n=IS("useNavigate"),a=x.useRef(!1);return gN(()=>{a.current=!0}),x.useCallback(async(l,c={})=>{qn(a.current,mN),a.current&&(typeof l=="number"?await o.navigate(l):await o.navigate(l,{fromRouteId:n,...c}))},[o,n])}var FO={};function vN(o,n,a){!n&&!FO[o]&&(FO[o]=!0,qn(!1,a))}var YO={};function $O(o,n){!o&&!YO[n]&&(YO[n]=!0,console.warn(n))}var u4="useOptimistic",qO=NS[u4],d4=()=>{};function f4(o){return qO?qO(o):[o,d4]}function h4(o){let n={hasErrorBoundary:o.hasErrorBoundary||o.ErrorBoundary!=null||o.errorElement!=null};return o.Component&&(o.element&&qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:x.createElement(o.Component),Component:void 0})),o.HydrateFallback&&(o.hydrateFallbackElement&&qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:x.createElement(o.HydrateFallback),HydrateFallback:void 0})),o.ErrorBoundary&&(o.errorElement&&qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:x.createElement(o.ErrorBoundary),ErrorBoundary:void 0})),n}var p4=["HydrateFallback","hydrateFallbackElement"],m4=class{constructor(){this.status="pending",this.promise=new Promise((o,n)=>{this.resolve=a=>{this.status==="pending"&&(this.status="resolved",o(a))},this.reject=a=>{this.status==="pending"&&(this.status="rejected",n(a))}})}};function g4({router:o,flushSync:n,onError:a,unstable_useTransitions:s}){s=Bj()||s;let[c,f]=x.useState(o.state),[h,g]=f4(c),[m,b]=x.useState(),[p,v]=x.useState({isTransitioning:!1}),[w,E]=x.useState(),[T,C]=x.useState(),[A,k]=x.useState(),U=x.useRef(new Map),M=x.useCallback((z,{deletedFetchers:te,newErrors:H,flushSync:J,viewTransitionOpts:N})=>{H&&a&&Object.values(H).forEach(ne=>{var Z;return a(ne,{location:z.location,params:((Z=z.matches[0])==null?void 0:Z.params)??{},unstable_pattern:Yf(z.matches)})}),z.fetchers.forEach((ne,Z)=>{ne.data!==void 0&&U.current.set(Z,ne.data)}),te.forEach(ne=>U.current.delete(ne)),$O(J===!1||n!=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 P=o.window!=null&&o.window.document!=null&&typeof o.window.document.startViewTransition=="function";if($O(N==null||P,"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."),!N||!P){n&&J?n(()=>f(z)):s===!1?f(z):x.startTransition(()=>{s===!0&&g(ne=>GO(ne,z)),f(z)});return}if(n&&J){n(()=>{T&&(w==null||w.resolve(),T.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let ne=o.window.document.startViewTransition(()=>{n(()=>f(z))});ne.finished.finally(()=>{n(()=>{E(void 0),C(void 0),b(void 0),v({isTransitioning:!1})})}),n(()=>C(ne));return}T?(w==null||w.resolve(),T.skipTransition(),k({state:z,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(b(z),v({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[o.window,n,T,w,s,g,a]);x.useLayoutEffect(()=>o.subscribe(M),[o,M]),x.useEffect(()=>{p.isTransitioning&&!p.flushSync&&E(new m4)},[p]),x.useEffect(()=>{if(w&&m&&o.window){let z=m,te=w.promise,H=o.window.document.startViewTransition(async()=>{s===!1?f(z):x.startTransition(()=>{s===!0&&g(J=>GO(J,z)),f(z)}),await te});H.finished.finally(()=>{E(void 0),C(void 0),b(void 0),v({isTransitioning:!1})}),C(H)}},[m,w,o.window,s,g]),x.useEffect(()=>{w&&m&&h.location.key===m.location.key&&w.resolve()},[w,T,h.location,m]),x.useEffect(()=>{!p.isTransitioning&&A&&(b(A.state),v({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}),k(void 0))},[p.isTransitioning,A]);let Y=x.useMemo(()=>({createHref:o.createHref,encodeLocation:o.encodeLocation,go:z=>o.navigate(z),push:(z,te,H)=>o.navigate(z,{state:te,preventScrollReset:H==null?void 0:H.preventScrollReset}),replace:(z,te,H)=>o.navigate(z,{replace:!0,state:te,preventScrollReset:H==null?void 0:H.preventScrollReset})}),[o]),$=o.basename||"/",_=x.useMemo(()=>({router:o,navigator:Y,static:!1,basename:$,onError:a}),[o,Y,$,a]);return x.createElement(x.Fragment,null,x.createElement(Xl.Provider,{value:_},x.createElement($f.Provider,{value:h},x.createElement(hN.Provider,{value:U.current},x.createElement(jS.Provider,{value:p},x.createElement(S4,{basename:$,location:h.location,navigationType:h.historyAction,navigator:Y,unstable_useTransitions:s},x.createElement(y4,{routes:o.routes,future:o.future,state:h,onError:a})))))),null)}function GO(o,n){return{...o,navigation:n.navigation.state!=="idle"?n.navigation:o.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:o.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:o.actionData,fetchers:n.fetchers}}var y4=x.memo(b4);function b4({routes:o,future:n,state:a,onError:s}){return Jj(o,void 0,a,s,n)}function v4(o){return Wj(o.context)}function S4({basename:o="/",children:n=null,location:a,navigationType:s="POP",navigator:l,static:c=!1,unstable_useTransitions:f}){Mt(!qf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=o.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:h,navigator:l,static:c,unstable_useTransitions:f,future:{}}),[h,l,c,f]);typeof a=="string"&&(a=Ui(a));let{pathname:m="/",search:b="",hash:p="",state:v=null,key:w="default"}=a,E=x.useMemo(()=>{let T=zr(m,h);return T==null?null:{location:{pathname:T,search:b,hash:p,state:v,key:w},navigationType:s}},[h,m,b,p,v,w,s]);return qn(E!=null,`<Router basename="${h}"> is not able to match the URL "${m}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:x.createElement(jr.Provider,{value:g},x.createElement(lg.Provider,{children:n,value:E}))}var _m="get",km="application/x-www-form-urlencoded";function cg(o){return typeof HTMLElement<"u"&&o instanceof HTMLElement}function w4(o){return cg(o)&&o.tagName.toLowerCase()==="button"}function E4(o){return cg(o)&&o.tagName.toLowerCase()==="form"}function x4(o){return cg(o)&&o.tagName.toLowerCase()==="input"}function R4(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function T4(o,n){return o.button===0&&(!n||n==="_self")&&!R4(o)}var gm=null;function C4(){if(gm===null)try{new FormData(document.createElement("form"),0),gm=!1}catch{gm=!0}return gm}var O4=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function c0(o){return o!=null&&!O4.has(o)?(qn(!1,`"${o}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${km}"`),null):o}function D4(o,n){let a,s,l,c,f;if(E4(o)){let h=o.getAttribute("action");s=h?zr(h,n):null,a=o.getAttribute("method")||_m,l=c0(o.getAttribute("enctype"))||km,c=new FormData(o)}else if(w4(o)||x4(o)&&(o.type==="submit"||o.type==="image")){let h=o.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=o.getAttribute("formaction")||h.getAttribute("action");if(s=g?zr(g,n):null,a=o.getAttribute("formmethod")||h.getAttribute("method")||_m,l=c0(o.getAttribute("formenctype"))||c0(h.getAttribute("enctype"))||km,c=new FormData(h,o),!C4()){let{name:m,type:b,value:p}=o;if(b==="image"){let v=m?`${m}.`:"";c.append(`${v}x`,"0"),c.append(`${v}y`,"0")}else m&&c.append(m,p)}}else{if(cg(o))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=_m,s=null,l=km,f=o}return c&&l==="text/plain"&&(f=c,c=void 0),{action:s,method:a.toLowerCase(),encType:l,formData:c,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function BS(o,n){if(o===!1||o===null||typeof o>"u")throw new Error(n)}function A4(o,n,a,s){let l=typeof o=="string"?new URL(o,typeof window>"u"?"server://singlefetch/":window.location.origin):o;return a?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${s}`:l.pathname=`${l.pathname}.${s}`:l.pathname==="/"?l.pathname=`_root.${s}`:n&&zr(l.pathname,n)==="/"?l.pathname=`${n.replace(/\/$/,"")}/_root.${s}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${s}`,l}async function N4(o,n){if(o.id in n)return n[o.id];try{let a=await import(o.module);return n[o.id]=a,a}catch(a){return console.error(`Error loading route module \`${o.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function M4(o){return o==null?!1:o.href==null?o.rel==="preload"&&typeof o.imageSrcSet=="string"&&typeof o.imageSizes=="string":typeof o.rel=="string"&&typeof o.href=="string"}async function _4(o,n,a){let s=await Promise.all(o.map(async l=>{let c=n.routes[l.route.id];if(c){let f=await N4(c,a);return f.links?f.links():[]}return[]}));return z4(s.flat(1).filter(M4).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function XO(o,n,a,s,l,c){let f=(g,m)=>a[m]?g.route.id!==a[m].route.id:!0,h=(g,m)=>{var b;return a[m].pathname!==g.pathname||((b=a[m].route.path)==null?void 0:b.endsWith("*"))&&a[m].params["*"]!==g.params["*"]};return c==="assets"?n.filter((g,m)=>f(g,m)||h(g,m)):c==="data"?n.filter((g,m)=>{var p;let b=s.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(f(g,m)||h(g,m))return!0;if(g.route.shouldRevalidate){let v=g.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((p=a[0])==null?void 0:p.params)||{},nextUrl:new URL(o,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function k4(o,n,{includeHydrateFallback:a}={}){return L4(o.map(s=>{let l=n.routes[s.route.id];if(!l)return[];let c=[l.module];return l.clientActionModule&&(c=c.concat(l.clientActionModule)),l.clientLoaderModule&&(c=c.concat(l.clientLoaderModule)),a&&l.hydrateFallbackModule&&(c=c.concat(l.hydrateFallbackModule)),l.imports&&(c=c.concat(l.imports)),c}).flat(1))}function L4(o){return[...new Set(o)]}function U4(o){let n={},a=Object.keys(o).sort();for(let s of a)n[s]=o[s];return n}function z4(o,n){let a=new Set;return new Set(n),o.reduce((s,l)=>{let c=JSON.stringify(U4(l));return a.has(c)||(a.add(c),s.push({key:c,link:l})),s},[])}function SN(){let o=x.useContext(Xl);return BS(o,"You must render this element inside a <DataRouterContext.Provider> element"),o}function j4(){let o=x.useContext($f);return BS(o,"You must render this element inside a <DataRouterStateContext.Provider> element"),o}var VS=x.createContext(void 0);VS.displayName="FrameworkContext";function wN(){let o=x.useContext(VS);return BS(o,"You must render this element inside a <HydratedRouter> element"),o}function P4(o,n){let a=x.useContext(VS),[s,l]=x.useState(!1),[c,f]=x.useState(!1),{onFocus:h,onBlur:g,onMouseEnter:m,onMouseLeave:b,onTouchStart:p}=n,v=x.useRef(null);x.useEffect(()=>{if(o==="render"&&f(!0),o==="viewport"){let T=A=>{A.forEach(k=>{f(k.isIntersecting)})},C=new IntersectionObserver(T,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[o]),x.useEffect(()=>{if(s){let T=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(T)}}},[s]);let w=()=>{l(!0)},E=()=>{l(!1),f(!1)};return a?o!=="intent"?[c,v,{}]:[c,v,{onFocus:sf(h,w),onBlur:sf(g,E),onMouseEnter:sf(m,w),onMouseLeave:sf(b,E),onTouchStart:sf(p,w)}]:[!1,v,{}]}function sf(o,n){return a=>{o&&o(a),a.defaultPrevented||n(a)}}function H4({page:o,...n}){let{router:a}=SN(),s=x.useMemo(()=>wi(a.routes,o,a.basename),[a.routes,o,a.basename]);return s?x.createElement(B4,{page:o,matches:s,...n}):null}function I4(o){let{manifest:n,routeModules:a}=wN(),[s,l]=x.useState([]);return x.useEffect(()=>{let c=!1;return _4(o,n,a).then(f=>{c||l(f)}),()=>{c=!0}},[o,n,a]),s}function B4({page:o,matches:n,...a}){let s=Ns(),{future:l,manifest:c,routeModules:f}=wN(),{basename:h}=SN(),{loaderData:g,matches:m}=j4(),b=x.useMemo(()=>XO(o,n,m,c,s,"data"),[o,n,m,c,s]),p=x.useMemo(()=>XO(o,n,m,c,s,"assets"),[o,n,m,c,s]),v=x.useMemo(()=>{if(o===s.pathname+s.search+s.hash)return[];let T=new Set,C=!1;if(n.forEach(k=>{var M;let U=c.routes[k.route.id];!U||!U.hasLoader||(!b.some(Y=>Y.route.id===k.route.id)&&k.route.id in g&&((M=f[k.route.id])!=null&&M.shouldRevalidate)||U.hasClientLoader?C=!0:T.add(k.route.id))}),T.size===0)return[];let A=A4(o,h,l.unstable_trailingSlashAwareDataRequests,"data");return C&&T.size>0&&A.searchParams.set("_routes",n.filter(k=>T.has(k.route.id)).map(k=>k.route.id).join(",")),[A.pathname+A.search]},[h,l.unstable_trailingSlashAwareDataRequests,g,s,c,b,n,o,f]),w=x.useMemo(()=>k4(p,c),[p,c]),E=I4(p);return x.createElement(x.Fragment,null,v.map(T=>x.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...a})),w.map(T=>x.createElement("link",{key:T,rel:"modulepreload",href:T,...a})),E.map(({key:T,link:C})=>x.createElement("link",{key:T,nonce:a.nonce,...C,crossOrigin:C.crossOrigin??a.crossOrigin})))}function V4(...o){return n=>{o.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var F4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{F4&&(window.__reactRouterVersion="7.13.0")}catch{}function Y4(o,n){return gj({basename:n==null?void 0:n.basename,getContext:n==null?void 0:n.getContext,future:n==null?void 0:n.future,history:_3({window:n==null?void 0:n.window}),hydrationData:$4(),routes:o,mapRouteProperties:h4,hydrationRouteProperties:p4,dataStrategy:n==null?void 0:n.dataStrategy,patchRoutesOnNavigation:n==null?void 0:n.patchRoutesOnNavigation,window:n==null?void 0:n.window,unstable_instrumentations:n==null?void 0:n.unstable_instrumentations}).initialize()}function $4(){let o=window==null?void 0:window.__staticRouterHydrationData;return o&&o.errors&&(o={...o,errors:q4(o.errors)}),o}function q4(o){if(!o)return null;let n=Object.entries(o),a={};for(let[s,l]of n)if(l&&l.__type==="RouteErrorResponse")a[s]=new Ff(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let c=window[l.__subType];if(typeof c=="function")try{let f=new c(l.message);f.stack="",a[s]=f}catch{}}if(a[s]==null){let c=new Error(l.message);c.stack="",a[s]=c}}else a[s]=l;return a}var EN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FS=x.forwardRef(function({onClick:n,discover:a="render",prefetch:s="none",relative:l,reloadDocument:c,replace:f,state:h,target:g,to:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v,...w},E){let{basename:T,unstable_useTransitions:C}=x.useContext(jr),A=typeof m=="string"&&EN.test(m),k=eN(m,T);m=k.to;let U=Gj(m,{relative:l}),[M,Y,$]=P4(s,w),_=W4(m,{replace:f,state:h,target:g,preventScrollReset:b,relative:l,viewTransition:p,unstable_defaultShouldRevalidate:v,unstable_useTransitions:C});function z(H){n&&n(H),H.defaultPrevented||_(H)}let te=x.createElement("a",{...w,...$,href:k.absoluteURL||U,onClick:k.isExternal||c?n:z,ref:V4(E,Y),target:g,"data-discover":!A&&a==="render"?"true":void 0});return M&&!A?x.createElement(x.Fragment,null,te,x.createElement(H4,{page:U})):te});FS.displayName="Link";var G4=x.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:s="",end:l=!1,style:c,to:f,viewTransition:h,children:g,...m},b){let p=Gf(f,{relative:m.relative}),v=Ns(),w=x.useContext($f),{navigator:E,basename:T}=x.useContext(jr),C=w!=null&&tP(p)&&h===!0,A=E.encodeLocation?E.encodeLocation(p).pathname:p.pathname,k=v.pathname,U=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;a||(k=k.toLowerCase(),U=U?U.toLowerCase():null,A=A.toLowerCase()),U&&T&&(U=zr(U,T)||U);const M=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let Y=k===A||!l&&k.startsWith(A)&&k.charAt(M)==="/",$=U!=null&&(U===A||!l&&U.startsWith(A)&&U.charAt(A.length)==="/"),_={isActive:Y,isPending:$,isTransitioning:C},z=Y?n:void 0,te;typeof s=="function"?te=s(_):te=[s,Y?"active":null,$?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let H=typeof c=="function"?c(_):c;return x.createElement(FS,{...m,"aria-current":z,className:te,ref:b,style:H,to:f,viewTransition:h},typeof g=="function"?g(_):g)});G4.displayName="NavLink";var X4=x.forwardRef(({discover:o="render",fetcherKey:n,navigate:a,reloadDocument:s,replace:l,state:c,method:f=_m,action:h,onSubmit:g,relative:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v,...w},E)=>{let{unstable_useTransitions:T}=x.useContext(jr),C=Z4(),A=eP(h,{relative:m}),k=f.toLowerCase()==="get"?"get":"post",U=typeof h=="string"&&EN.test(h),M=Y=>{if(g&&g(Y),Y.defaultPrevented)return;Y.preventDefault();let $=Y.nativeEvent.submitter,_=($==null?void 0:$.getAttribute("formmethod"))||f,z=()=>C($||Y.currentTarget,{fetcherKey:n,method:_,navigate:a,replace:l,state:c,relative:m,preventScrollReset:b,viewTransition:p,unstable_defaultShouldRevalidate:v});T&&a!==!1?x.startTransition(()=>z()):z()};return x.createElement("form",{ref:E,method:k,action:A,onSubmit:s?g:M,...w,"data-discover":!U&&o==="render"?"true":void 0})});X4.displayName="Form";function Q4(o){return`${o} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function xN(o){let n=x.useContext(Xl);return Mt(n,Q4(o)),n}function W4(o,{target:n,replace:a,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}={}){let m=yN(),b=Ns(),p=Gf(o,{relative:c});return x.useCallback(v=>{if(T4(v,n)){v.preventDefault();let w=a!==void 0?a:Va(b)===Va(p),E=()=>m(o,{replace:w,state:s,preventScrollReset:l,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h});g?x.startTransition(()=>E()):E()}},[b,m,p,a,s,n,o,l,c,f,h,g])}var K4=0,J4=()=>`__${String(++K4)}__`;function Z4(){let{router:o}=xN("useSubmit"),{basename:n}=x.useContext(jr),a=i4(),s=o.fetch,l=o.navigate;return x.useCallback(async(c,f={})=>{let{action:h,method:g,encType:m,formData:b,body:p}=D4(c,n);if(f.navigate===!1){let v=f.fetcherKey||J4();await s(v,a,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:p,formMethod:f.method||g,formEncType:f.encType||m,flushSync:f.flushSync})}else await l(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:b,body:p,formMethod:f.method||g,formEncType:f.encType||m,replace:f.replace,state:f.state,fromRouteId:a,flushSync:f.flushSync,viewTransition:f.viewTransition})},[s,l,n,a])}function eP(o,{relative:n}={}){let{basename:a}=x.useContext(jr),s=x.useContext(ea);Mt(s,"useFormAction must be used inside a RouteContext");let[l]=s.matches.slice(-1),c={...Gf(o||".",{relative:n})},f=Ns();if(o==null){c.search=f.search;let h=new URLSearchParams(c.search),g=h.getAll("index");if(g.some(b=>b==="")){h.delete("index"),g.filter(p=>p).forEach(p=>h.append("index",p));let b=h.toString();c.search=b?`?${b}`:""}}return(!o||o===".")&&l.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Ha([a,c.pathname])),Va(c)}function tP(o,{relative:n}={}){let a=x.useContext(jS);Mt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=xN("useViewTransitionState"),l=Gf(o,{relative:n});if(!a.isTransitioning)return!1;let c=zr(a.currentLocation.pathname,s)||a.currentLocation.pathname,f=zr(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Df(l.pathname,f)!=null||Df(l.pathname,c)!=null}var zi=qA();const nP=UA(zi);function oP(o){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",n.appendChild(a),a.styleSheet?a.styleSheet.cssText=o:a.appendChild(document.createTextNode(o))}const rP=o=>{switch(o){case"success":return iP;case"info":return cP;case"warning":return lP;case"error":return uP;default:return null}},aP=Array(12).fill(0),sP=({visible:o,className:n})=>_e.createElement("div",{className:["sonner-loading-wrapper",n].filter(Boolean).join(" "),"data-visible":o},_e.createElement("div",{className:"sonner-spinner"},aP.map((a,s)=>_e.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),iP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),lP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),cP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),uP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},_e.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),dP=_e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},_e.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_e.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),fP=()=>{const[o,n]=_e.useState(document.hidden);return _e.useEffect(()=>{const a=()=>{n(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),o};let tS=1;class hP{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{const a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;const{message:s,...l}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:tS++,f=this.toasts.find(g=>g.id===c),h=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),f?this.toasts=this.toasts.map(g=>g.id===c?(this.publish({...g,...n,id:c,title:s}),{...g,...n,id:c,dismissible:h,title:s}):g):this.addToast({title:s,...l,dismissible:h,id:c}),c},this.dismiss=n=>(n?(this.dismissedToasts.add(n),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:n,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const l=Promise.resolve(n instanceof Function?n():n);let c=s!==void 0,f;const h=l.then(async m=>{if(f=["resolve",m],_e.isValidElement(m))c=!1,this.create({id:s,type:"default",message:m});else if(mP(m)&&!m.ok){c=!1;const p=typeof a.error=="function"?await a.error(`HTTP error! status: ${m.status}`):a.error,v=typeof a.description=="function"?await a.description(`HTTP error! status: ${m.status}`):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...E})}else if(m instanceof Error){c=!1;const p=typeof a.error=="function"?await a.error(m):a.error,v=typeof a.description=="function"?await a.description(m):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"error",description:v,...E})}else if(a.success!==void 0){c=!1;const p=typeof a.success=="function"?await a.success(m):a.success,v=typeof a.description=="function"?await a.description(m):a.description,E=typeof p=="object"&&!_e.isValidElement(p)?p:{message:p};this.create({id:s,type:"success",description:v,...E})}}).catch(async m=>{if(f=["reject",m],a.error!==void 0){c=!1;const b=typeof a.error=="function"?await a.error(m):a.error,p=typeof a.description=="function"?await a.description(m):a.description,w=typeof b=="object"&&!_e.isValidElement(b)?b:{message:b};this.create({id:s,type:"error",description:p,...w})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),g=()=>new Promise((m,b)=>h.then(()=>f[0]==="reject"?b(f[1]):m(f[1])).catch(b));return typeof s!="string"&&typeof s!="number"?{unwrap:g}:Object.assign(s,{unwrap:g})},this.custom=(n,a)=>{const s=(a==null?void 0:a.id)||tS++;return this.create({jsx:n(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Yo=new hP,pP=(o,n)=>{const a=(n==null?void 0:n.id)||tS++;return Yo.addToast({title:o,...n,id:a}),a},mP=o=>o&&typeof o=="object"&&"ok"in o&&typeof o.ok=="boolean"&&"status"in o&&typeof o.status=="number",gP=pP,yP=()=>Yo.toasts,bP=()=>Yo.getActiveToasts(),xY=Object.assign(gP,{success:Yo.success,info:Yo.info,warning:Yo.warning,error:Yo.error,custom:Yo.custom,message:Yo.message,promise:Yo.promise,dismiss:Yo.dismiss,loading:Yo.loading},{getHistory:yP,getToasts:bP});oP("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function ym(o){return o.label!==void 0}const vP=3,SP="24px",wP="16px",QO=4e3,EP=356,xP=14,RP=45,TP=200;function Ma(...o){return o.filter(Boolean).join(" ")}function CP(o){const[n,a]=o.split("-"),s=[];return n&&s.push(n),a&&s.push(a),s}const OP=o=>{var n,a,s,l,c,f,h,g,m;const{invert:b,toast:p,unstyled:v,interacting:w,setHeights:E,visibleToasts:T,heights:C,index:A,toasts:k,expanded:U,removeToast:M,defaultRichColors:Y,closeButton:$,style:_,cancelButtonStyle:z,actionButtonStyle:te,className:H="",descriptionClassName:J="",duration:N,position:P,gap:ne,expandByDefault:Z,classNames:j,icons:oe,closeButtonAriaLabel:I="Close toast"}=o,[ie,pe]=_e.useState(null),[L,ce]=_e.useState(null),[se,me]=_e.useState(!1),[Te,Ue]=_e.useState(!1),[ve,ze]=_e.useState(!1),[je,at]=_e.useState(!1),[xe,he]=_e.useState(!1),[we,De]=_e.useState(0),[Ye,Re]=_e.useState(0),Ae=_e.useRef(p.duration||N||QO),Le=_e.useRef(null),tt=_e.useRef(null),Ce=A===0,ot=A+1<=T,gt=p.type,yt=p.dismissible!==!1,ht=p.className||"",$t=p.descriptionClassName||"",on=_e.useMemo(()=>C.findIndex(Se=>Se.toastId===p.id)||0,[C,p.id]),bn=_e.useMemo(()=>{var Se;return(Se=p.closeButton)!=null?Se:$},[p.closeButton,$]),bt=_e.useMemo(()=>p.duration||N||QO,[p.duration,N]),Pt=_e.useRef(0),Ft=_e.useRef(0),vn=_e.useRef(0),ln=_e.useRef(null),[Zn,hn]=P.split("-"),co=_e.useMemo(()=>C.reduce((Se,Ke,Ve)=>Ve>=on?Se:Se+Ke.height,0),[C,on]),uo=fP(),Un=p.invert||b,D=gt==="loading";Ft.current=_e.useMemo(()=>on*ne+co,[on,co]),_e.useEffect(()=>{Ae.current=bt},[bt]),_e.useEffect(()=>{me(!0)},[]),_e.useEffect(()=>{const Se=tt.current;if(Se){const Ke=Se.getBoundingClientRect().height;return Re(Ke),E(Ve=>[{toastId:p.id,height:Ke,position:p.position},...Ve]),()=>E(Ve=>Ve.filter(Rt=>Rt.toastId!==p.id))}},[E,p.id]),_e.useLayoutEffect(()=>{if(!se)return;const Se=tt.current,Ke=Se.style.height;Se.style.height="auto";const Ve=Se.getBoundingClientRect().height;Se.style.height=Ke,Re(Ve),E(Rt=>Rt.find(rn=>rn.toastId===p.id)?Rt.map(rn=>rn.toastId===p.id?{...rn,height:Ve}:rn):[{toastId:p.id,height:Ve,position:p.position},...Rt])},[se,p.title,p.description,E,p.id,p.jsx,p.action,p.cancel]);const G=_e.useCallback(()=>{Ue(!0),De(Ft.current),E(Se=>Se.filter(Ke=>Ke.toastId!==p.id)),setTimeout(()=>{M(p)},TP)},[p,M,E,Ft]);_e.useEffect(()=>{if(p.promise&&gt==="loading"||p.duration===1/0||p.type==="loading")return;let Se;return U||w||uo?(()=>{if(vn.current<Pt.current){const Rt=new Date().getTime()-Pt.current;Ae.current=Ae.current-Rt}vn.current=new Date().getTime()})():(()=>{Ae.current!==1/0&&(Pt.current=new Date().getTime(),Se=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),G()},Ae.current))})(),()=>clearTimeout(Se)},[U,w,p,gt,uo,G]),_e.useEffect(()=>{p.delete&&(G(),p.onDismiss==null||p.onDismiss.call(p,p))},[G,p.delete]);function ge(){var Se;if(oe!=null&&oe.loading){var Ke;return _e.createElement("div",{className:Ma(j==null?void 0:j.loader,p==null||(Ke=p.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":gt==="loading"},oe.loading)}return _e.createElement(sP,{className:Ma(j==null?void 0:j.loader,p==null||(Se=p.classNames)==null?void 0:Se.loader),visible:gt==="loading"})}const ye=p.icon||(oe==null?void 0:oe[gt])||rP(gt);var Ne,$e;return _e.createElement("li",{tabIndex:0,ref:tt,className:Ma(H,ht,j==null?void 0:j.toast,p==null||(n=p.classNames)==null?void 0:n.toast,j==null?void 0:j.default,j==null?void 0:j[gt],p==null||(a=p.classNames)==null?void 0:a[gt]),"data-sonner-toast":"","data-rich-colors":(Ne=p.richColors)!=null?Ne:Y,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":se,"data-promise":!!p.promise,"data-swiped":xe,"data-removed":Te,"data-visible":ot,"data-y-position":Zn,"data-x-position":hn,"data-index":A,"data-front":Ce,"data-swiping":ve,"data-dismissible":yt,"data-type":gt,"data-invert":Un,"data-swipe-out":je,"data-swipe-direction":L,"data-expanded":!!(U||Z&&se),"data-testid":p.testId,style:{"--index":A,"--toasts-before":A,"--z-index":k.length-A,"--offset":`${Te?we:Ft.current}px`,"--initial-height":Z?"auto":`${Ye}px`,..._,...p.style},onDragEnd:()=>{ze(!1),pe(null),ln.current=null},onPointerDown:Se=>{Se.button!==2&&(D||!yt||(Le.current=new Date,De(Ft.current),Se.target.setPointerCapture(Se.pointerId),Se.target.tagName!=="BUTTON"&&(ze(!0),ln.current={x:Se.clientX,y:Se.clientY})))},onPointerUp:()=>{var Se,Ke,Ve;if(je||!yt)return;ln.current=null;const Rt=Number(((Se=tt.current)==null?void 0:Se.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Cn=Number(((Ke=tt.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),rn=new Date().getTime()-((Ve=Le.current)==null?void 0:Ve.getTime()),xn=ie==="x"?Rt:Cn,Xo=Math.abs(xn)/rn;if(Math.abs(xn)>=RP||Xo>.11){De(Ft.current),p.onDismiss==null||p.onDismiss.call(p,p),ce(ie==="x"?Rt>0?"right":"left":Cn>0?"down":"up"),G(),at(!0);return}else{var B,Q;(B=tt.current)==null||B.style.setProperty("--swipe-amount-x","0px"),(Q=tt.current)==null||Q.style.setProperty("--swipe-amount-y","0px")}he(!1),ze(!1),pe(null)},onPointerMove:Se=>{var Ke,Ve,Rt;if(!ln.current||!yt||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;const rn=Se.clientY-ln.current.y,xn=Se.clientX-ln.current.x;var Xo;const B=(Xo=o.swipeDirections)!=null?Xo:CP(P);!ie&&(Math.abs(xn)>1||Math.abs(rn)>1)&&pe(Math.abs(xn)>Math.abs(rn)?"x":"y");let Q={x:0,y:0};const ue=Ee=>1/(1.5+Math.abs(Ee)/20);if(ie==="y"){if(B.includes("top")||B.includes("bottom"))if(B.includes("top")&&rn<0||B.includes("bottom")&&rn>0)Q.y=rn;else{const Ee=rn*ue(rn);Q.y=Math.abs(Ee)<Math.abs(rn)?Ee:rn}}else if(ie==="x"&&(B.includes("left")||B.includes("right")))if(B.includes("left")&&xn<0||B.includes("right")&&xn>0)Q.x=xn;else{const Ee=xn*ue(xn);Q.x=Math.abs(Ee)<Math.abs(xn)?Ee:xn}(Math.abs(Q.x)>0||Math.abs(Q.y)>0)&&he(!0),(Ve=tt.current)==null||Ve.style.setProperty("--swipe-amount-x",`${Q.x}px`),(Rt=tt.current)==null||Rt.style.setProperty("--swipe-amount-y",`${Q.y}px`)}},bn&&!p.jsx&&gt!=="loading"?_e.createElement("button",{"aria-label":I,"data-disabled":D,"data-close-button":!0,onClick:D||!yt?()=>{}:()=>{G(),p.onDismiss==null||p.onDismiss.call(p,p)},className:Ma(j==null?void 0:j.closeButton,p==null||(s=p.classNames)==null?void 0:s.closeButton)},($e=oe==null?void 0:oe.close)!=null?$e:dP):null,(gt||p.icon||p.promise)&&p.icon!==null&&((oe==null?void 0:oe[gt])!==null||p.icon)?_e.createElement("div",{"data-icon":"",className:Ma(j==null?void 0:j.icon,p==null||(l=p.classNames)==null?void 0:l.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||ge():null,p.type!=="loading"?ye:null):null,_e.createElement("div",{"data-content":"",className:Ma(j==null?void 0:j.content,p==null||(c=p.classNames)==null?void 0:c.content)},_e.createElement("div",{"data-title":"",className:Ma(j==null?void 0:j.title,p==null||(f=p.classNames)==null?void 0:f.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?_e.createElement("div",{"data-description":"",className:Ma(J,$t,j==null?void 0:j.description,p==null||(h=p.classNames)==null?void 0:h.description)},typeof p.description=="function"?p.description():p.description):null),_e.isValidElement(p.cancel)?p.cancel:p.cancel&&ym(p.cancel)?_e.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||z,onClick:Se=>{ym(p.cancel)&&yt&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Se),G())},className:Ma(j==null?void 0:j.cancelButton,p==null||(g=p.classNames)==null?void 0:g.cancelButton)},p.cancel.label):null,_e.isValidElement(p.action)?p.action:p.action&&ym(p.action)?_e.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||te,onClick:Se=>{ym(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Se),!Se.defaultPrevented&&G())},className:Ma(j==null?void 0:j.actionButton,p==null||(m=p.classNames)==null?void 0:m.actionButton)},p.action.label):null)};function WO(){if(typeof window>"u"||typeof document>"u")return"ltr";const o=document.documentElement.getAttribute("dir");return o==="auto"||!o?window.getComputedStyle(document.documentElement).direction:o}function DP(o,n){const a={};return[o,n].forEach((s,l)=>{const c=l===1,f=c?"--mobile-offset":"--offset",h=c?wP:SP;function g(m){["top","right","bottom","left"].forEach(b=>{a[`${f}-${b}`]=typeof m=="number"?`${m}px`:m})}typeof s=="number"||typeof s=="string"?g(s):typeof s=="object"?["top","right","bottom","left"].forEach(m=>{s[m]===void 0?a[`${f}-${m}`]=h:a[`${f}-${m}`]=typeof s[m]=="number"?`${s[m]}px`:s[m]}):g(h)}),a}const AP=_e.forwardRef(function(n,a){const{id:s,invert:l,position:c="bottom-right",hotkey:f=["altKey","KeyT"],expand:h,closeButton:g,className:m,offset:b,mobileOffset:p,theme:v="light",richColors:w,duration:E,style:T,visibleToasts:C=vP,toastOptions:A,dir:k=WO(),gap:U=xP,icons:M,containerAriaLabel:Y="Notifications"}=n,[$,_]=_e.useState([]),z=_e.useMemo(()=>s?$.filter(se=>se.toasterId===s):$.filter(se=>!se.toasterId),[$,s]),te=_e.useMemo(()=>Array.from(new Set([c].concat(z.filter(se=>se.position).map(se=>se.position)))),[z,c]),[H,J]=_e.useState([]),[N,P]=_e.useState(!1),[ne,Z]=_e.useState(!1),[j,oe]=_e.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),I=_e.useRef(null),ie=f.join("+").replace(/Key/g,"").replace(/Digit/g,""),pe=_e.useRef(null),L=_e.useRef(!1),ce=_e.useCallback(se=>{_(me=>{var Te;return(Te=me.find(Ue=>Ue.id===se.id))!=null&&Te.delete||Yo.dismiss(se.id),me.filter(({id:Ue})=>Ue!==se.id)})},[]);return _e.useEffect(()=>Yo.subscribe(se=>{if(se.dismiss){requestAnimationFrame(()=>{_(me=>me.map(Te=>Te.id===se.id?{...Te,delete:!0}:Te))});return}setTimeout(()=>{nP.flushSync(()=>{_(me=>{const Te=me.findIndex(Ue=>Ue.id===se.id);return Te!==-1?[...me.slice(0,Te),{...me[Te],...se},...me.slice(Te+1)]:[se,...me]})})})}),[$]),_e.useEffect(()=>{if(v!=="system"){oe(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?oe("dark"):oe("light")),typeof window>"u")return;const se=window.matchMedia("(prefers-color-scheme: dark)");try{se.addEventListener("change",({matches:me})=>{oe(me?"dark":"light")})}catch{se.addListener(({matches:Te})=>{try{oe(Te?"dark":"light")}catch(Ue){console.error(Ue)}})}},[v]),_e.useEffect(()=>{$.length<=1&&P(!1)},[$]),_e.useEffect(()=>{const se=me=>{var Te;if(f.every(ze=>me[ze]||me.code===ze)){var ve;P(!0),(ve=I.current)==null||ve.focus()}me.code==="Escape"&&(document.activeElement===I.current||(Te=I.current)!=null&&Te.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",se),()=>document.removeEventListener("keydown",se)},[f]),_e.useEffect(()=>{if(I.current)return()=>{pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null,L.current=!1)}},[I.current]),_e.createElement("section",{ref:a,"aria-label":`${Y} ${ie}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},te.map((se,me)=>{var Te;const[Ue,ve]=se.split("-");return z.length?_e.createElement("ol",{key:se,dir:k==="auto"?WO():k,tabIndex:-1,ref:I,className:m,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":Ue,"data-x-position":ve,style:{"--front-toast-height":`${((Te=H[0])==null?void 0:Te.height)||0}px`,"--width":`${EP}px`,"--gap":`${U}px`,...T,...DP(b,p)},onBlur:ze=>{L.current&&!ze.currentTarget.contains(ze.relatedTarget)&&(L.current=!1,pe.current&&(pe.current.focus({preventScroll:!0}),pe.current=null))},onFocus:ze=>{ze.target instanceof HTMLElement&&ze.target.dataset.dismissible==="false"||L.current||(L.current=!0,pe.current=ze.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{ne||P(!1)},onDragEnd:()=>P(!1),onPointerDown:ze=>{ze.target instanceof HTMLElement&&ze.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},z.filter(ze=>!ze.position&&me===0||ze.position===se).map((ze,je)=>{var at,xe;return _e.createElement(OP,{key:ze.id,icons:M,index:je,toast:ze,defaultRichColors:w,duration:(at=A==null?void 0:A.duration)!=null?at:E,className:A==null?void 0:A.className,descriptionClassName:A==null?void 0:A.descriptionClassName,invert:l,visibleToasts:C,closeButton:(xe=A==null?void 0:A.closeButton)!=null?xe:g,interacting:ne,position:se,style:A==null?void 0:A.style,unstyled:A==null?void 0:A.unstyled,classNames:A==null?void 0:A.classNames,cancelButtonStyle:A==null?void 0:A.cancelButtonStyle,actionButtonStyle:A==null?void 0:A.actionButtonStyle,closeButtonAriaLabel:A==null?void 0:A.closeButtonAriaLabel,removeToast:ce,toasts:z.filter(he=>he.position==ze.position),heights:H.filter(he=>he.position==ze.position),setHeights:J,expandByDefault:h,gap:U,expanded:N,swipeDirections:n.swipeDirections})})):null}))}),mt=o=>typeof o=="string",lf=()=>{let o,n;const a=new Promise((s,l)=>{o=s,n=l});return a.resolve=o,a.reject=n,a},KO=o=>o==null?"":""+o,NP=(o,n,a)=>{o.forEach(s=>{n[s]&&(a[s]=n[s])})},MP=/###/g,JO=o=>o&&o.indexOf("###")>-1?o.replace(MP,"."):o,ZO=o=>!o||mt(o),vf=(o,n,a)=>{const s=mt(n)?n.split("."):n;let l=0;for(;l<s.length-1;){if(ZO(o))return{};const c=JO(s[l]);!o[c]&&a&&(o[c]=new a),Object.prototype.hasOwnProperty.call(o,c)?o=o[c]:o={},++l}return ZO(o)?{}:{obj:o,k:JO(s[l])}},eD=(o,n,a)=>{const{obj:s,k:l}=vf(o,n,Object);if(s!==void 0||n.length===1){s[l]=a;return}let c=n[n.length-1],f=n.slice(0,n.length-1),h=vf(o,f,Object);for(;h.obj===void 0&&f.length;)c=`${f[f.length-1]}.${c}`,f=f.slice(0,f.length-1),h=vf(o,f,Object),h!=null&&h.obj&&typeof h.obj[`${h.k}.${c}`]<"u"&&(h.obj=void 0);h.obj[`${h.k}.${c}`]=a},_P=(o,n,a,s)=>{const{obj:l,k:c}=vf(o,n,Object);l[c]=l[c]||[],l[c].push(a)},Vm=(o,n)=>{const{obj:a,k:s}=vf(o,n);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},kP=(o,n,a)=>{const s=Vm(o,a);return s!==void 0?s:Vm(n,a)},RN=(o,n,a)=>{for(const s in n)s!=="__proto__"&&s!=="constructor"&&(s in o?mt(o[s])||o[s]instanceof String||mt(n[s])||n[s]instanceof String?a&&(o[s]=n[s]):RN(o[s],n[s],a):o[s]=n[s]);return o},Kc=o=>o.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var LP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const UP=o=>mt(o)?o.replace(/[&<>"'\/]/g,n=>LP[n]):o;class zP{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const a=this.regExpMap.get(n);if(a!==void 0)return a;const s=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,s),this.regExpQueue.push(n),s}}const jP=[" ",",","?","!",";"],PP=new zP(20),HP=(o,n,a)=>{n=n||"",a=a||"";const s=jP.filter(f=>n.indexOf(f)<0&&a.indexOf(f)<0);if(s.length===0)return!0;const l=PP.getRegExp(`(${s.map(f=>f==="?"?"\\?":f).join("|")})`);let c=!l.test(o);if(!c){const f=o.indexOf(a);f>0&&!l.test(o.substring(0,f))&&(c=!0)}return c},nS=(o,n,a=".")=>{if(!o)return;if(o[n])return Object.prototype.hasOwnProperty.call(o,n)?o[n]:void 0;const s=n.split(a);let l=o;for(let c=0;c<s.length;){if(!l||typeof l!="object")return;let f,h="";for(let g=c;g<s.length;++g)if(g!==c&&(h+=a),h+=s[g],f=l[h],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&g<s.length-1)continue;c+=g-c+1;break}l=f}return l},Nf=o=>o==null?void 0:o.replace("_","-"),IP={type:"logger",log(o){this.output("log",o)},warn(o){this.output("warn",o)},error(o){this.output("error",o)},output(o,n){var a,s;(s=(a=console==null?void 0:console[o])==null?void 0:a.apply)==null||s.call(a,console,n)}};class Fm{constructor(n,a={}){this.init(n,a)}init(n,a={}){this.prefix=a.prefix||"i18next:",this.logger=n||IP,this.options=a,this.debug=a.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,a,s,l){return l&&!this.debug?null:(mt(n[0])&&(n[0]=`${s}${this.prefix} ${n[0]}`),this.logger[a](n))}create(n){return new Fm(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new Fm(this.logger,n)}}var ja=new Fm;class ug{constructor(){this.observers={}}on(n,a){return n.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const l=this.observers[s].get(a)||0;this.observers[s].set(a,l+1)}),this}off(n,a){if(this.observers[n]){if(!a){delete this.observers[n];return}this.observers[n].delete(a)}}emit(n,...a){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l(...a)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([l,c])=>{for(let f=0;f<c;f++)l.apply(l,[n,...a])})}}class tD extends ug{constructor(n,a={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const a=this.options.ns.indexOf(n);a>-1&&this.options.ns.splice(a,1)}getResource(n,a,s,l={}){var m,b;const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,f=l.ignoreJSONStructure!==void 0?l.ignoreJSONStructure:this.options.ignoreJSONStructure;let h;n.indexOf(".")>-1?h=n.split("."):(h=[n,a],s&&(Array.isArray(s)?h.push(...s):mt(s)&&c?h.push(...s.split(c)):h.push(s)));const g=Vm(this.data,h);return!g&&!a&&!s&&n.indexOf(".")>-1&&(n=h[0],a=h[1],s=h.slice(2).join(".")),g||!f||!mt(s)?g:nS((b=(m=this.data)==null?void 0:m[n])==null?void 0:b[a],s,c)}addResource(n,a,s,l,c={silent:!1}){const f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator;let h=[n,a];s&&(h=h.concat(f?s.split(f):s)),n.indexOf(".")>-1&&(h=n.split("."),l=a,a=h[1]),this.addNamespaces(a),eD(this.data,h,l),c.silent||this.emit("added",n,a,s,l)}addResources(n,a,s,l={silent:!1}){for(const c in s)(mt(s[c])||Array.isArray(s[c]))&&this.addResource(n,a,c,s[c],{silent:!0});l.silent||this.emit("added",n,a,s)}addResourceBundle(n,a,s,l,c,f={silent:!1,skipCopy:!1}){let h=[n,a];n.indexOf(".")>-1&&(h=n.split("."),l=s,s=a,a=h[1]),this.addNamespaces(a);let g=Vm(this.data,h)||{};f.skipCopy||(s=JSON.parse(JSON.stringify(s))),l?RN(g,s,c):g={...g,...s},eD(this.data,h,g),f.silent||this.emit("added",n,a,s)}removeResourceBundle(n,a){this.hasResourceBundle(n,a)&&delete this.data[n][a],this.removeNamespaces(a),this.emit("removed",n,a)}hasResourceBundle(n,a){return this.getResource(n,a)!==void 0}getResourceBundle(n,a){return a||(a=this.options.defaultNS),this.getResource(n,a)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const a=this.getDataByLanguage(n);return!!(a&&Object.keys(a)||[]).find(l=>a[l]&&Object.keys(a[l]).length>0)}toJSON(){return this.data}}var TN={processors:{},addPostProcessor(o){this.processors[o.name]=o},handle(o,n,a,s,l){return o.forEach(c=>{var f;n=((f=this.processors[c])==null?void 0:f.process(n,a,s,l))??n}),n}};const CN=Symbol("i18next/PATH_KEY");function BP(){const o=[],n=Object.create(null);let a;return n.get=(s,l)=>{var c;return(c=a==null?void 0:a.revoke)==null||c.call(a),l===CN?o:(o.push(l),a=Proxy.revocable(s,n),a.proxy)},Proxy.revocable(Object.create(null),n).proxy}function oS(o,n){const{[CN]:a}=o(BP());return a.join((n==null?void 0:n.keySeparator)??".")}const nD={},u0=o=>!mt(o)&&typeof o!="boolean"&&typeof o!="number";class Ym extends ug{constructor(n,a={}){super(),NP(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ja.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n,a={interpolation:{}}){const s={...a};if(n==null)return!1;const l=this.resolve(n,s);if((l==null?void 0:l.res)===void 0)return!1;const c=u0(l.res);return!(s.returnObjects===!1&&c)}extractFromKey(n,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let c=a.ns||this.options.defaultNS||[];const f=s&&n.indexOf(s)>-1,h=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!HP(n,s,l);if(f&&!h){const g=n.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:n,namespaces:mt(c)?[c]:c};const m=n.split(s);(s!==l||s===l&&this.options.ns.indexOf(m[0])>-1)&&(c=m.shift()),n=m.join(l)}return{key:n,namespaces:mt(c)?[c]:c}}translate(n,a,s){let l=typeof a=="object"?{...a}:a;if(typeof l!="object"&&this.options.overloadTranslationOptionHandler&&(l=this.options.overloadTranslationOptionHandler(arguments)),typeof l=="object"&&(l={...l}),l||(l={}),n==null)return"";typeof n=="function"&&(n=oS(n,{...this.options,...l})),Array.isArray(n)||(n=[String(n)]);const c=l.returnDetails!==void 0?l.returnDetails:this.options.returnDetails,f=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator,{key:h,namespaces:g}=this.extractFromKey(n[n.length-1],l),m=g[g.length-1];let b=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const p=l.lng||this.language,v=l.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return v?c?{res:`${m}${b}${h}`,usedKey:h,exactUsedKey:h,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(l)}:`${m}${b}${h}`:c?{res:h,usedKey:h,exactUsedKey:h,usedLng:p,usedNS:m,usedParams:this.getUsedParamsDetails(l)}:h;const w=this.resolve(n,l);let E=w==null?void 0:w.res;const T=(w==null?void 0:w.usedKey)||h,C=(w==null?void 0:w.exactUsedKey)||h,A=["[object Number]","[object Function]","[object RegExp]"],k=l.joinArrays!==void 0?l.joinArrays:this.options.joinArrays,U=!this.i18nFormat||this.i18nFormat.handleAsObject,M=l.count!==void 0&&!mt(l.count),Y=Ym.hasDefaultValue(l),$=M?this.pluralResolver.getSuffix(p,l.count,l):"",_=l.ordinal&&M?this.pluralResolver.getSuffix(p,l.count,{ordinal:!1}):"",z=M&&!l.ordinal&&l.count===0,te=z&&l[`defaultValue${this.options.pluralSeparator}zero`]||l[`defaultValue${$}`]||l[`defaultValue${_}`]||l.defaultValue;let H=E;U&&!E&&Y&&(H=te);const J=u0(H),N=Object.prototype.toString.apply(H);if(U&&H&&J&&A.indexOf(N)<0&&!(mt(k)&&Array.isArray(H))){if(!l.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const P=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,H,{...l,ns:g}):`key '${h} (${this.language})' returned an object instead of string.`;return c?(w.res=P,w.usedParams=this.getUsedParamsDetails(l),w):P}if(f){const P=Array.isArray(H),ne=P?[]:{},Z=P?C:T;for(const j in H)if(Object.prototype.hasOwnProperty.call(H,j)){const oe=`${Z}${f}${j}`;Y&&!E?ne[j]=this.translate(oe,{...l,defaultValue:u0(te)?te[j]:void 0,joinArrays:!1,ns:g}):ne[j]=this.translate(oe,{...l,joinArrays:!1,ns:g}),ne[j]===oe&&(ne[j]=H[j])}E=ne}}else if(U&&mt(k)&&Array.isArray(E))E=E.join(k),E&&(E=this.extendTranslation(E,n,l,s));else{let P=!1,ne=!1;!this.isValidLookup(E)&&Y&&(P=!0,E=te),this.isValidLookup(E)||(ne=!0,E=h);const j=(l.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:E,oe=Y&&te!==E&&this.options.updateMissing;if(ne||P||oe){if(this.logger.log(oe?"updateKey":"missingKey",p,m,h,oe?te:E),f){const L=this.resolve(h,{...l,keySeparator:!1});L&&L.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let I=[];const ie=this.languageUtils.getFallbackCodes(this.options.fallbackLng,l.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ie&&ie[0])for(let L=0;L<ie.length;L++)I.push(ie[L]);else this.options.saveMissingTo==="all"?I=this.languageUtils.toResolveHierarchy(l.lng||this.language):I.push(l.lng||this.language);const pe=(L,ce,se)=>{var Te;const me=Y&&se!==E?se:j;this.options.missingKeyHandler?this.options.missingKeyHandler(L,m,ce,me,oe,l):(Te=this.backendConnector)!=null&&Te.saveMissing&&this.backendConnector.saveMissing(L,m,ce,me,oe,l),this.emit("missingKey",L,m,ce,E)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?I.forEach(L=>{const ce=this.pluralResolver.getSuffixes(L,l);z&&l[`defaultValue${this.options.pluralSeparator}zero`]&&ce.indexOf(`${this.options.pluralSeparator}zero`)<0&&ce.push(`${this.options.pluralSeparator}zero`),ce.forEach(se=>{pe([L],h+se,l[`defaultValue${se}`]||te)})}):pe(I,h,te))}E=this.extendTranslation(E,n,l,w,s),ne&&E===h&&this.options.appendNamespaceToMissingKey&&(E=`${m}${b}${h}`),(ne||P)&&this.options.parseMissingKeyHandler&&(E=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${m}${b}${h}`:h,P?E:void 0,l))}return c?(w.res=E,w.usedParams=this.getUsedParamsDetails(l),w):E}extendTranslation(n,a,s,l,c){var g,m;if((g=this.i18nFormat)!=null&&g.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||l.usedLng,l.usedNS,l.usedKey,{resolved:l});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const b=mt(n)&&(((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(b){const w=n.match(this.interpolator.nestingRegexp);p=w&&w.length}let v=s.replace&&!mt(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),n=this.interpolator.interpolate(n,v,s.lng||this.language||l.usedLng,s),b){const w=n.match(this.interpolator.nestingRegexp),E=w&&w.length;p<E&&(s.nest=!1)}!s.lng&&l&&l.res&&(s.lng=this.language||l.usedLng),s.nest!==!1&&(n=this.interpolator.nest(n,(...w)=>(c==null?void 0:c[0])===w[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${w[0]} in key: ${a[0]}`),null):this.translate(...w,a),s)),s.interpolation&&this.interpolator.reset()}const f=s.postProcess||this.options.postProcess,h=mt(f)?[f]:f;return n!=null&&(h!=null&&h.length)&&s.applyPostProcessor!==!1&&(n=TN.handle(h,n,a,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...l,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),n}resolve(n,a={}){let s,l,c,f,h;return mt(n)&&(n=[n]),n.forEach(g=>{if(this.isValidLookup(s))return;const m=this.extractFromKey(g,a),b=m.key;l=b;let p=m.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const v=a.count!==void 0&&!mt(a.count),w=v&&!a.ordinal&&a.count===0,E=a.context!==void 0&&(mt(a.context)||typeof a.context=="number")&&a.context!=="",T=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);p.forEach(C=>{var A,k;this.isValidLookup(s)||(h=C,!nD[`${T[0]}-${C}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((k=this.utils)!=null&&k.hasLoadedNamespace(h))&&(nD[`${T[0]}-${C}`]=!0,this.logger.warn(`key "${l}" for languages "${T.join(", ")}" won't get resolved as namespace "${h}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(U=>{var $;if(this.isValidLookup(s))return;f=U;const M=[b];if(($=this.i18nFormat)!=null&&$.addLookupKeys)this.i18nFormat.addLookupKeys(M,b,U,C,a);else{let _;v&&(_=this.pluralResolver.getSuffix(U,a.count,a));const z=`${this.options.pluralSeparator}zero`,te=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(v&&(a.ordinal&&_.indexOf(te)===0&&M.push(b+_.replace(te,this.options.pluralSeparator)),M.push(b+_),w&&M.push(b+z)),E){const H=`${b}${this.options.contextSeparator||"_"}${a.context}`;M.push(H),v&&(a.ordinal&&_.indexOf(te)===0&&M.push(H+_.replace(te,this.options.pluralSeparator)),M.push(H+_),w&&M.push(H+z))}}let Y;for(;Y=M.pop();)this.isValidLookup(s)||(c=Y,s=this.getResource(U,C,Y,a))}))})}),{res:s,usedKey:l,exactUsedKey:c,usedLng:f,usedNS:h}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,a,s,l={}){var c;return(c=this.i18nFormat)!=null&&c.getResource?this.i18nFormat.getResource(n,a,s,l):this.resourceStore.getResource(n,a,s,l)}getUsedParamsDetails(n={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=n.replace&&!mt(n.replace);let l=s?n.replace:n;if(s&&typeof n.count<"u"&&(l.count=n.count),this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),!s){l={...l};for(const c of a)delete l[c]}return l}static hasDefaultValue(n){const a="defaultValue";for(const s in n)if(Object.prototype.hasOwnProperty.call(n,s)&&a===s.substring(0,a.length)&&n[s]!==void 0)return!0;return!1}}class oD{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ja.create("languageUtils")}getScriptPartFromCode(n){if(n=Nf(n),!n||n.indexOf("-")<0)return null;const a=n.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(n){if(n=Nf(n),!n||n.indexOf("-")<0)return n;const a=n.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(n){if(mt(n)&&n.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(n)[0]}catch{}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let a;return n.forEach(s=>{if(a)return;const l=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(l))&&(a=l)}),!a&&this.options.supportedLngs&&n.forEach(s=>{if(a)return;const l=this.getScriptPartFromCode(s);if(this.isSupportedCode(l))return a=l;const c=this.getLanguagePartFromCode(s);if(this.isSupportedCode(c))return a=c;a=this.options.supportedLngs.find(f=>{if(f===c)return f;if(!(f.indexOf("-")<0&&c.indexOf("-")<0)&&(f.indexOf("-")>0&&c.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===c||f.indexOf(c)===0&&c.length>1))return f})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(n,a){if(!n)return[];if(typeof n=="function"&&(n=n(a)),mt(n)&&(n=[n]),Array.isArray(n))return n;if(!a)return n.default||[];let s=n[a];return s||(s=n[this.getScriptPartFromCode(a)]),s||(s=n[this.formatLanguageCode(a)]),s||(s=n[this.getLanguagePartFromCode(a)]),s||(s=n.default),s||[]}toResolveHierarchy(n,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],n),l=[],c=f=>{f&&(this.isSupportedCode(f)?l.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return mt(n)&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&c(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&c(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&c(this.getLanguagePartFromCode(n))):mt(n)&&c(this.formatLanguageCode(n)),s.forEach(f=>{l.indexOf(f)<0&&c(this.formatLanguageCode(f))}),l}}const rD={zero:0,one:1,two:2,few:3,many:4,other:5},aD={select:o=>o===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class VP{constructor(n,a={}){this.languageUtils=n,this.options=a,this.logger=ja.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(n,a={}){const s=Nf(n==="dev"?"en":n),l=a.ordinal?"ordinal":"cardinal",c=JSON.stringify({cleanedCode:s,type:l});if(c in this.pluralRulesCache)return this.pluralRulesCache[c];let f;try{f=new Intl.PluralRules(s,{type:l})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),aD;if(!n.match(/-|_/))return aD;const g=this.languageUtils.getLanguagePartFromCode(n);f=this.getRule(g,a)}return this.pluralRulesCache[c]=f,f}needsPlural(n,a={}){let s=this.getRule(n,a);return s||(s=this.getRule("dev",a)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(n,a,s={}){return this.getSuffixes(n,s).map(l=>`${a}${l}`)}getSuffixes(n,a={}){let s=this.getRule(n,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((l,c)=>rD[l]-rD[c]).map(l=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${l}`):[]}getSuffix(n,a,s={}){const l=this.getRule(n,s);return l?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${l.select(a)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",a,s))}}const sD=(o,n,a,s=".",l=!0)=>{let c=kP(o,n,a);return!c&&l&&mt(a)&&(c=nS(o,a,s),c===void 0&&(c=nS(n,a,s))),c},d0=o=>o.replace(/\$/g,"$$$$");class iD{constructor(n={}){var a;this.logger=ja.create("interpolator"),this.options=n,this.format=((a=n==null?void 0:n.interpolation)==null?void 0:a.format)||(s=>s),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:l,prefix:c,prefixEscaped:f,suffix:h,suffixEscaped:g,formatSeparator:m,unescapeSuffix:b,unescapePrefix:p,nestingPrefix:v,nestingPrefixEscaped:w,nestingSuffix:E,nestingSuffixEscaped:T,nestingOptionsSeparator:C,maxReplaces:A,alwaysFormat:k}=n.interpolation;this.escape=a!==void 0?a:UP,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=l!==void 0?l:!1,this.prefix=c?Kc(c):f||"{{",this.suffix=h?Kc(h):g||"}}",this.formatSeparator=m||",",this.unescapePrefix=b?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=v?Kc(v):w||Kc("$t("),this.nestingSuffix=E?Kc(E):T||Kc(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=A||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(a,s)=>(a==null?void 0:a.source)===s?(a.lastIndex=0,a):new RegExp(s,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(n,a,s,l){var w;let c,f,h;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},m=E=>{if(E.indexOf(this.formatSeparator)<0){const k=sD(a,g,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(k,void 0,s,{...l,...a,interpolationkey:E}):k}const T=E.split(this.formatSeparator),C=T.shift().trim(),A=T.join(this.formatSeparator).trim();return this.format(sD(a,g,C,this.options.keySeparator,this.options.ignoreJSONStructure),A,s,{...l,...a,interpolationkey:C})};this.resetRegExp();const b=(l==null?void 0:l.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((w=l==null?void 0:l.interpolation)==null?void 0:w.skipOnVariables)!==void 0?l.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>d0(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?d0(this.escape(E)):d0(E)}].forEach(E=>{for(h=0;c=E.regex.exec(n);){const T=c[1].trim();if(f=m(T),f===void 0)if(typeof b=="function"){const A=b(n,c,l);f=mt(A)?A:""}else if(l&&Object.prototype.hasOwnProperty.call(l,T))f="";else if(p){f=c[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${n}`),f="";else!mt(f)&&!this.useRawValueToEscape&&(f=KO(f));const C=E.safeValue(f);if(n=n.replace(c[0],C),p?(E.regex.lastIndex+=f.length,E.regex.lastIndex-=c[0].length):E.regex.lastIndex=0,h++,h>=this.maxReplaces)break}}),n}nest(n,a,s={}){let l,c,f;const h=(g,m)=>{const b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;const p=g.split(new RegExp(`${b}[ ]*{`));let v=`{${p[1]}`;g=p[0],v=this.interpolate(v,f);const w=v.match(/'/g),E=v.match(/"/g);(((w==null?void 0:w.length)??0)%2===0&&!E||E.length%2!==0)&&(v=v.replace(/'/g,'"'));try{f=JSON.parse(v),m&&(f={...m,...f})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,T),`${g}${b}${v}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,g};for(;l=this.nestingRegexp.exec(n);){let g=[];f={...s},f=f.replace&&!mt(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const m=/{.*}/.test(l[1])?l[1].lastIndexOf("}")+1:l[1].indexOf(this.formatSeparator);if(m!==-1&&(g=l[1].slice(m).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),l[1]=l[1].slice(0,m)),c=a(h.call(this,l[1].trim(),f),f),c&&l[0]===n&&!mt(c))return c;mt(c)||(c=KO(c)),c||(this.logger.warn(`missed to resolve ${l[1]} for nesting ${n}`),c=""),g.length&&(c=g.reduce((b,p)=>this.format(b,p,s.lng,{...s,interpolationkey:l[1].trim()}),c.trim())),n=n.replace(l[0],c),this.regexp.lastIndex=0}return n}}const FP=o=>{let n=o.toLowerCase().trim();const a={};if(o.indexOf("(")>-1){const s=o.split("(");n=s[0].toLowerCase().trim();const l=s[1].substring(0,s[1].length-1);n==="currency"&&l.indexOf(":")<0?a.currency||(a.currency=l.trim()):n==="relativetime"&&l.indexOf(":")<0?a.range||(a.range=l.trim()):l.split(";").forEach(f=>{if(f){const[h,...g]=f.split(":"),m=g.join(":").trim().replace(/^'+|'+$/g,""),b=h.trim();a[b]||(a[b]=m),m==="false"&&(a[b]=!1),m==="true"&&(a[b]=!0),isNaN(m)||(a[b]=parseInt(m,10))}})}return{formatName:n,formatOptions:a}},lD=o=>{const n={};return(a,s,l)=>{let c=l;l&&l.interpolationkey&&l.formatParams&&l.formatParams[l.interpolationkey]&&l[l.interpolationkey]&&(c={...c,[l.interpolationkey]:void 0});const f=s+JSON.stringify(c);let h=n[f];return h||(h=o(Nf(s),l),n[f]=h),h(a)}},YP=o=>(n,a,s)=>o(Nf(a),s)(n);class $P{constructor(n={}){this.logger=ja.create("formatter"),this.options=n,this.init(n)}init(n,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?lD:YP;this.formats={number:s((l,c)=>{const f=new Intl.NumberFormat(l,{...c});return h=>f.format(h)}),currency:s((l,c)=>{const f=new Intl.NumberFormat(l,{...c,style:"currency"});return h=>f.format(h)}),datetime:s((l,c)=>{const f=new Intl.DateTimeFormat(l,{...c});return h=>f.format(h)}),relativetime:s((l,c)=>{const f=new Intl.RelativeTimeFormat(l,{...c});return h=>f.format(h,c.range||"day")}),list:s((l,c)=>{const f=new Intl.ListFormat(l,{...c});return h=>f.format(h)})}}add(n,a){this.formats[n.toLowerCase().trim()]=a}addCached(n,a){this.formats[n.toLowerCase().trim()]=lD(a)}format(n,a,s,l={}){const c=a.split(this.formatSeparator);if(c.length>1&&c[0].indexOf("(")>1&&c[0].indexOf(")")<0&&c.find(h=>h.indexOf(")")>-1)){const h=c.findIndex(g=>g.indexOf(")")>-1);c[0]=[c[0],...c.splice(1,h)].join(this.formatSeparator)}return c.reduce((h,g)=>{var p;const{formatName:m,formatOptions:b}=FP(g);if(this.formats[m]){let v=h;try{const w=((p=l==null?void 0:l.formatParams)==null?void 0:p[l.interpolationkey])||{},E=w.locale||w.lng||l.locale||l.lng||s;v=this.formats[m](h,E,{...b,...l,...w})}catch(w){this.logger.warn(w)}return v}else this.logger.warn(`there was no format function for ${m}`);return h},n)}}const qP=(o,n)=>{o.pending[n]!==void 0&&(delete o.pending[n],o.pendingCount--)};class GP extends ug{constructor(n,a,s,l={}){var c,f;super(),this.backend=n,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=l,this.logger=ja.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=l.maxParallelReads||10,this.readingCalls=0,this.maxRetries=l.maxRetries>=0?l.maxRetries:5,this.retryTimeout=l.retryTimeout>=1?l.retryTimeout:350,this.state={},this.queue=[],(f=(c=this.backend)==null?void 0:c.init)==null||f.call(c,s,l.backend,l)}queueLoad(n,a,s,l){const c={},f={},h={},g={};return n.forEach(m=>{let b=!0;a.forEach(p=>{const v=`${m}|${p}`;!s.reload&&this.store.hasResourceBundle(m,p)?this.state[v]=2:this.state[v]<0||(this.state[v]===1?f[v]===void 0&&(f[v]=!0):(this.state[v]=1,b=!1,f[v]===void 0&&(f[v]=!0),c[v]===void 0&&(c[v]=!0),g[p]===void 0&&(g[p]=!0)))}),b||(h[m]=!0)}),(Object.keys(c).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:l}),{toLoad:Object.keys(c),pending:Object.keys(f),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(g)}}loaded(n,a,s){const l=n.split("|"),c=l[0],f=l[1];a&&this.emit("failedLoading",c,f,a),!a&&s&&this.store.addResourceBundle(c,f,s,void 0,void 0,{skipCopy:!0}),this.state[n]=a?-1:2,a&&s&&(this.state[n]=0);const h={};this.queue.forEach(g=>{_P(g.loaded,[c],f),qP(g,n),a&&g.errors.push(a),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(m=>{h[m]||(h[m]={});const b=g.loaded[m];b.length&&b.forEach(p=>{h[m][p]===void 0&&(h[m][p]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",h),this.queue=this.queue.filter(g=>!g.done)}read(n,a,s,l=0,c=this.retryTimeout,f){if(!n.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:a,fcName:s,tried:l,wait:c,callback:f});return}this.readingCalls++;const h=(m,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(m&&b&&l<this.maxRetries){setTimeout(()=>{this.read.call(this,n,a,s,l+1,c*2,f)},c);return}f(m,b)},g=this.backend[s].bind(this.backend);if(g.length===2){try{const m=g(n,a);m&&typeof m.then=="function"?m.then(b=>h(null,b)).catch(h):h(null,m)}catch(m){h(m)}return}return g(n,a,h)}prepareLoading(n,a,s={},l){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();mt(n)&&(n=this.languageUtils.toResolveHierarchy(n)),mt(a)&&(a=[a]);const c=this.queueLoad(n,a,s,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(f=>{this.loadOne(f)})}load(n,a,s){this.prepareLoading(n,a,{},s)}reload(n,a,s){this.prepareLoading(n,a,{reload:!0},s)}loadOne(n,a=""){const s=n.split("|"),l=s[0],c=s[1];this.read(l,c,"read",void 0,void 0,(f,h)=>{f&&this.logger.warn(`${a}loading namespace ${c} for language ${l} failed`,f),!f&&h&&this.logger.log(`${a}loaded namespace ${c} for language ${l}`,h),this.loaded(n,f,h)})}saveMissing(n,a,s,l,c,f={},h=()=>{}){var g,m,b,p,v;if((m=(g=this.services)==null?void 0:g.utils)!=null&&m.hasLoadedNamespace&&!((p=(b=this.services)==null?void 0:b.utils)!=null&&p.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${s}" as the namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((v=this.backend)!=null&&v.create){const w={...f,isUpdate:c},E=this.backend.create.bind(this.backend);if(E.length<6)try{let T;E.length===5?T=E(n,a,s,l,w):T=E(n,a,s,l),T&&typeof T.then=="function"?T.then(C=>h(null,C)).catch(h):h(null,T)}catch(T){h(T)}else E(n,a,s,l,h,w)}!n||!n[0]||this.store.addResource(n[0],a,s,l)}}}const f0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:o=>{let n={};if(typeof o[1]=="object"&&(n=o[1]),mt(o[1])&&(n.defaultValue=o[1]),mt(o[2])&&(n.tDescription=o[2]),typeof o[2]=="object"||typeof o[3]=="object"){const a=o[3]||o[2];Object.keys(a).forEach(s=>{n[s]=a[s]})}return n},interpolation:{escapeValue:!0,format:o=>o,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),cD=o=>{var n,a;return mt(o.ns)&&(o.ns=[o.ns]),mt(o.fallbackLng)&&(o.fallbackLng=[o.fallbackLng]),mt(o.fallbackNS)&&(o.fallbackNS=[o.fallbackNS]),((a=(n=o.supportedLngs)==null?void 0:n.indexOf)==null?void 0:a.call(n,"cimode"))<0&&(o.supportedLngs=o.supportedLngs.concat(["cimode"])),typeof o.initImmediate=="boolean"&&(o.initAsync=o.initImmediate),o},bm=()=>{},XP=o=>{Object.getOwnPropertyNames(Object.getPrototypeOf(o)).forEach(a=>{typeof o[a]=="function"&&(o[a]=o[a].bind(o))})},QP=o=>{var n,a,s,l,c,f,h,g,m;return!!(((s=(a=(n=o==null?void 0:o.modules)==null?void 0:n.backend)==null?void 0:a.name)==null?void 0:s.indexOf("Locize"))>0||((h=(f=(c=(l=o==null?void 0:o.modules)==null?void 0:l.backend)==null?void 0:c.constructor)==null?void 0:f.name)==null?void 0:h.indexOf("Locize"))>0||(m=(g=o==null?void 0:o.options)==null?void 0:g.backend)!=null&&m.backends&&o.options.backend.backends.some(b=>{var p,v,w;return((p=b==null?void 0:b.name)==null?void 0:p.indexOf("Locize"))>0||((w=(v=b==null?void 0:b.constructor)==null?void 0:v.name)==null?void 0:w.indexOf("Locize"))>0}))};class Sf extends ug{constructor(n={},a){if(super(),this.options=cD(n),this.services={},this.logger=ja,this.modules={external:[]},XP(this),a&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,a),this;setTimeout(()=>{this.init(n,a)},0)}}init(n={},a){this.isInitializing=!0,typeof n=="function"&&(a=n,n={}),n.defaultNS==null&&n.ns&&(mt(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const s=f0();this.options={...s,...this.options,...cD(n)},this.options.interpolation={...s.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!QP(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const l=m=>m?typeof m=="function"?new m:m:null;if(!this.options.isClone){this.modules.logger?ja.init(l(this.modules.logger),this.options):ja.init(null,this.options);let m;this.modules.formatter?m=this.modules.formatter:m=$P;const b=new oD(this.options);this.store=new tD(this.options.resources,this.options);const p=this.services;p.logger=ja,p.resourceStore=this.store,p.languageUtils=b,p.pluralResolver=new VP(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),m&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(p.formatter=l(m),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new iD(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new GP(l(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(w,...E)=>{this.emit(w,...E)}),this.modules.languageDetector&&(p.languageDetector=l(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=l(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Ym(this.services,this.options),this.translator.on("*",(w,...E)=>{this.emit(w,...E)}),this.modules.external.forEach(w=>{w.init&&w.init(this)})}if(this.format=this.options.interpolation.format,a||(a=bm),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const m=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);m.length>0&&m[0]!=="dev"&&(this.options.lng=m[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(m=>{this[m]=(...b)=>this.store[m](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(m=>{this[m]=(...b)=>(this.store[m](...b),this)});const h=lf(),g=()=>{const m=(b,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),h.resolve(p),a(b,p)};if(this.languages&&!this.isInitialized)return m(null,this.t.bind(this));this.changeLanguage(this.options.lng,m)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),h}loadResources(n,a=bm){var c,f;let s=a;const l=mt(n)?n:this.language;if(typeof n=="function"&&(s=n),!this.options.resources||this.options.partialBundledLanguages){if((l==null?void 0:l.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const h=[],g=m=>{if(!m||m==="cimode")return;this.services.languageUtils.toResolveHierarchy(m).forEach(p=>{p!=="cimode"&&h.indexOf(p)<0&&h.push(p)})};l?g(l):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>g(b)),(f=(c=this.options.preload)==null?void 0:c.forEach)==null||f.call(c,m=>g(m)),this.services.backendConnector.load(h,this.options.ns,m=>{!m&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(m)})}else s(null)}reloadResources(n,a,s){const l=lf();return typeof n=="function"&&(s=n,n=void 0),typeof a=="function"&&(s=a,a=void 0),n||(n=this.languages),a||(a=this.options.ns),s||(s=bm),this.services.backendConnector.reload(n,a,c=>{l.resolve(),s(c)}),l}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&TN.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1)){for(let a=0;a<this.languages.length;a++){const s=this.languages[a];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(n)<0&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,a){this.isLanguageChangingTo=n;const s=lf();this.emit("languageChanging",n);const l=h=>{this.language=h,this.languages=this.services.languageUtils.toResolveHierarchy(h),this.resolvedLanguage=void 0,this.setResolvedLanguage(h)},c=(h,g)=>{g?this.isLanguageChangingTo===n&&(l(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,s.resolve((...m)=>this.t(...m)),a&&a(h,(...m)=>this.t(...m))},f=h=>{var b,p;!n&&!h&&this.services.languageDetector&&(h=[]);const g=mt(h)?h:h&&h[0],m=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(mt(h)?[h]:h);m&&(this.language||l(m),this.translator.language||this.translator.changeLanguage(m),(p=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||p.call(b,m)),this.loadResources(m,v=>{c(v,m)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(n),s}getFixedT(n,a,s){const l=(c,f,...h)=>{let g;typeof f!="object"?g=this.options.overloadTranslationOptionHandler([c,f].concat(h)):g={...f},g.lng=g.lng||l.lng,g.lngs=g.lngs||l.lngs,g.ns=g.ns||l.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||s||l.keyPrefix);const m=this.options.keySeparator||".";let b;return g.keyPrefix&&Array.isArray(c)?b=c.map(p=>(typeof p=="function"&&(p=oS(p,{...this.options,...f})),`${g.keyPrefix}${m}${p}`)):(typeof c=="function"&&(c=oS(c,{...this.options,...f})),b=g.keyPrefix?`${g.keyPrefix}${m}${c}`:c),this.t(b,g)};return mt(n)?l.lng=n:l.lngs=n,l.ns=a,l.keyPrefix=s,l}t(...n){var a;return(a=this.translator)==null?void 0:a.translate(...n)}exists(...n){var a;return(a=this.translator)==null?void 0:a.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=a.lng||this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const f=(h,g)=>{const m=this.services.backendConnector.state[`${h}|${g}`];return m===-1||m===0||m===2};if(a.precheck){const h=a.precheck(this,f);if(h!==void 0)return h}return!!(this.hasResourceBundle(s,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(s,n)&&(!l||f(c,n)))}loadNamespaces(n,a){const s=lf();return this.options.ns?(mt(n)&&(n=[n]),n.forEach(l=>{this.options.ns.indexOf(l)<0&&this.options.ns.push(l)}),this.loadResources(l=>{s.resolve(),a&&a(l)}),s):(a&&a(),Promise.resolve())}loadLanguages(n,a){const s=lf();mt(n)&&(n=[n]);const l=this.options.preload||[],c=n.filter(f=>l.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return c.length?(this.options.preload=l.concat(c),this.loadResources(f=>{s.resolve(),a&&a(f)}),s):(a&&a(),Promise.resolve())}dir(n){var l,c;if(n||(n=this.resolvedLanguage||(((l=this.languages)==null?void 0:l.length)>0?this.languages[0]:this.language)),!n)return"rtl";try{const f=new Intl.Locale(n);if(f&&f.getTextInfo){const h=f.getTextInfo();if(h&&h.direction)return h.direction}}catch{}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((c=this.services)==null?void 0:c.languageUtils)||new oD(f0());return n.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},a){const s=new Sf(n,a);return s.createInstance=Sf.createInstance,s}cloneInstance(n={},a=bm){const s=n.forkResourceStore;s&&delete n.forkResourceStore;const l={...this.options,...n,isClone:!0},c=new Sf(l);if((n.debug!==void 0||n.prefix!==void 0)&&(c.logger=c.logger.clone(n)),["store","services","language"].forEach(h=>{c[h]=this[h]}),c.services={...this.services},c.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},s){const h=Object.keys(this.store.data).reduce((g,m)=>(g[m]={...this.store.data[m]},g[m]=Object.keys(g[m]).reduce((b,p)=>(b[p]={...g[m][p]},b),g[m]),g),{});c.store=new tD(h,l),c.services.resourceStore=c.store}if(n.interpolation){const g={...f0().interpolation,...this.options.interpolation,...n.interpolation},m={...l,interpolation:g};c.services.interpolator=new iD(m)}return c.translator=new Ym(c.services,l),c.translator.on("*",(h,...g)=>{c.emit(h,...g)}),c.init(l,a),c.translator.options=l,c.translator.backendConnector.services.utils={hasLoadedNamespace:c.hasLoadedNamespace.bind(c)},c}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const lo=Sf.createInstance();lo.createInstance;lo.dir;lo.init;lo.loadResources;lo.reloadResources;lo.use;lo.changeLanguage;lo.getFixedT;lo.t;lo.exists;lo.setDefaultNamespace;lo.hasLoadedNamespace;lo.loadNamespaces;lo.loadLanguages;const WP=(o,n,a,s)=>{var c,f,h,g;const l=[a,{code:n,...s||{}}];if((f=(c=o==null?void 0:o.services)==null?void 0:c.logger)!=null&&f.forward)return o.services.logger.forward(l,"warn","react-i18next::",!0);Yl(l[0])&&(l[0]=`react-i18next:: ${l[0]}`),(g=(h=o==null?void 0:o.services)==null?void 0:h.logger)!=null&&g.warn?o.services.logger.warn(...l):console!=null&&console.warn&&console.warn(...l)},uD={},ON=(o,n,a,s)=>{Yl(a)&&uD[a]||(Yl(a)&&(uD[a]=new Date),WP(o,n,a,s))},DN=(o,n)=>()=>{if(o.isInitialized)n();else{const a=()=>{setTimeout(()=>{o.off("initialized",a)},0),n()};o.on("initialized",a)}},rS=(o,n,a)=>{o.loadNamespaces(n,DN(o,a))},dD=(o,n,a,s)=>{if(Yl(a)&&(a=[a]),o.options.preload&&o.options.preload.indexOf(n)>-1)return rS(o,a,s);a.forEach(l=>{o.options.ns.indexOf(l)<0&&o.options.ns.push(l)}),o.loadLanguages(n,DN(o,s))},KP=(o,n,a={})=>!n.languages||!n.languages.length?(ON(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(o,{lng:a.lng,precheck:(s,l)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!l(s.isLanguageChangingTo,o))return!1}}),Yl=o=>typeof o=="string",JP=o=>typeof o=="object"&&o!==null,ZP=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,eH={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},tH=o=>eH[o],nH=o=>o.replace(ZP,tH);let aS={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:nH,transDefaultProps:void 0};const oH=(o={})=>{aS={...aS,...o}},rH=()=>aS;let AN;const aH=o=>{AN=o},sH=()=>AN,iH={type:"3rdParty",init(o){oH(o.options.react),aH(o)}},lH=x.createContext();class cH{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var h0={exports:{}},p0={},fD;function uH(){if(fD)return p0;fD=1;/**
302
302
  * @license React
303
303
  * use-sync-external-store-shim.development.js
304
304
  *
@@ -318,7 +318,7 @@ Bot:{{botName}}
318
318
  サイト:{{siteName}}
319
319
  時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
320
320
  Bot:{{botName}}
321
- 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加"},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ"},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"}}}},$S="en_US",RY={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function mH(o){return o.replace("_","-")}var m0={},Rl={},Tl={},pD;function gH(){if(pD)return Tl;pD=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.BinaryReader=Tl.BinaryWriter=void 0;class o{constructor(s=1024){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=new Uint8Array(s),this.view=new DataView(this.buffer.buffer)}ensureCapacity(s){const l=this.offset+s;if(l<=this.buffer.length)return;let c=this.buffer.length;for(;c<l;)c*=2;const f=new Uint8Array(c);f.set(this.buffer),this.buffer=f,this.view=new DataView(this.buffer.buffer)}writeUint8(s){this.ensureCapacity(1),this.view.setUint8(this.offset,s),this.offset+=1}writeUint16(s){this.ensureCapacity(2),this.view.setUint16(this.offset,s,!0),this.offset+=2}writeUint32(s){this.ensureCapacity(4),this.view.setUint32(this.offset,s,!0),this.offset+=4}writeUint64(s){this.ensureCapacity(8),this.view.setBigUint64(this.offset,s,!0),this.offset+=8}writeUint128(s){this.ensureCapacity(16);const l=s&BigInt("0xFFFFFFFFFFFFFFFF"),c=s>>BigInt(64);this.writeUint64(l),this.writeUint64(c)}writeInt8(s){this.ensureCapacity(1),this.view.setInt8(this.offset,s),this.offset+=1}writeInt16(s){this.ensureCapacity(2),this.view.setInt16(this.offset,s,!0),this.offset+=2}writeInt32(s){this.ensureCapacity(4),this.view.setInt32(this.offset,s,!0),this.offset+=4}writeInt64(s){this.ensureCapacity(8),this.view.setBigInt64(this.offset,s,!0),this.offset+=8}writeInt128(s){this.ensureCapacity(16);const l=s&BigInt("0xFFFFFFFFFFFFFFFF"),c=s>>BigInt(64);this.writeInt64(l),this.writeInt64(c)}writeFloat32(s){this.ensureCapacity(4),this.view.setFloat32(this.offset,s,!0),this.offset+=4}writeFloat64(s){this.ensureCapacity(8),this.view.setFloat64(this.offset,s,!0),this.offset+=8}writeBool(s){this.writeUint8(s?1:0)}writeString(s){const l=new TextEncoder().encode(s);this.writeUint32(l.length),this.ensureCapacity(l.length),this.buffer.set(l,this.offset),this.offset+=l.length}getBuffer(){return this.buffer.slice(0,this.offset)}}Tl.BinaryWriter=o;class n{constructor(s){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=s,this.view=new DataView(s.buffer,s.byteOffset,s.byteLength)}readUint8(){const s=this.view.getUint8(this.offset);return this.offset+=1,s}readUint16(){const s=this.view.getUint16(this.offset,!0);return this.offset+=2,s}readUint32(){const s=this.view.getUint32(this.offset,!0);return this.offset+=4,s}readUint64(){const s=this.view.getBigUint64(this.offset,!0);return this.offset+=8,s}readUint128(){const s=this.readUint64();return this.readUint64()<<BigInt(64)|s}readInt8(){const s=this.view.getInt8(this.offset);return this.offset+=1,s}readInt16(){const s=this.view.getInt16(this.offset,!0);return this.offset+=2,s}readInt32(){const s=this.view.getInt32(this.offset,!0);return this.offset+=4,s}readInt64(){const s=this.view.getBigInt64(this.offset,!0);return this.offset+=8,s}readInt128(){const s=this.readUint64();return this.readInt64()<<BigInt(64)|s}readFloat32(){const s=this.view.getFloat32(this.offset,!0);return this.offset+=4,s}readFloat64(){const s=this.view.getFloat64(this.offset,!0);return this.offset+=8,s}readBool(){return!!this.readUint8()}readString(){const s=this.readUint32(),l=this.buffer.slice(this.offset,this.offset+s);return this.offset+=s,new TextDecoder().decode(l)}getOffset(){return this.offset}}return Tl.BinaryReader=n,Tl}var g0={},mD;function yH(){return mD||(mD=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.registry=o.TypeRegistry=void 0;class n{constructor(){We(this,"handlers",new Map)}register(s,l){this.handlers.set(s,l)}getHandler(s){const l=this.handlers.get(s);if(!l)throw new Error(`No handler registered for type: ${s}`);return l}}o.TypeRegistry=n,o.registry=new n,o.registry.register("u8",{write:(a,s)=>{if(s<0||s>255||!Number.isInteger(s))throw new Error("Value out of range for u8");a.writeUint8(s)},read:a=>a.readUint8()}),o.registry.register("u16",{write:(a,s)=>{if(s<0||s>65535||!Number.isInteger(s))throw new Error("Value out of range for u16");a.writeUint16(s)},read:a=>a.readUint16()}),o.registry.register("u32",{write:(a,s)=>{if(s<0||s>4294967295||!Number.isInteger(s))throw new Error("Value out of range for u32");a.writeUint32(s)},read:a=>a.readUint32()}),o.registry.register("u64",{write:(a,s)=>{if(s<0n||s>18446744073709551615n)throw new Error("Value out of range for u64");a.writeUint64(s)},read:a=>a.readUint64()}),o.registry.register("u128",{write:(a,s)=>{if(s<0n||s>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");a.writeUint128(s)},read:a=>a.readUint128()}),o.registry.register("i8",{write:(a,s)=>{if(s<-128||s>127||!Number.isInteger(s))throw new Error("Value out of range for i8");a.writeInt8(s)},read:a=>a.readInt8()}),o.registry.register("i16",{write:(a,s)=>{if(s<-32768||s>32767||!Number.isInteger(s))throw new Error("Value out of range for i16");a.writeInt16(s)},read:a=>a.readInt16()}),o.registry.register("i32",{write:(a,s)=>{if(s<-2147483648||s>2147483647||!Number.isInteger(s))throw new Error("Value out of range for i32");a.writeInt32(s)},read:a=>a.readInt32()}),o.registry.register("i64",{write:(a,s)=>{if(s<-9223372036854775808n||s>9223372036854775807n)throw new Error("Value out of range for i64");a.writeInt64(s)},read:a=>a.readInt64()}),o.registry.register("i128",{write:(a,s)=>{if(s<-170141183460469231731687303715884105728n||s>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");a.writeInt128(s)},read:a=>a.readInt128()}),o.registry.register("f32",{write:(a,s)=>a.writeFloat32(s),read:a=>a.readFloat32()}),o.registry.register("f64",{write:(a,s)=>{if(Number.isNaN(s))throw new Error("For portability reasons we do not allow serializing NaN values.");a.writeFloat64(s)},read:a=>a.readFloat64()}),o.registry.register("bool",{write:(a,s)=>a.writeBool(s),read:a=>a.readBool()}),o.registry.register("string",{write:(a,s)=>a.writeString(s),read:a=>a.readString()}),o.registry.register("unit",{write:()=>{},read:()=>({})}),o.registry.register("struct",{write:(a,s,l)=>{if(l)for(const[c,f]of Object.entries(l))o.registry.getHandler(f.type).write(a,s[c],f.options)},read:(a,s)=>{if(!s)return{};const l={};for(const[c,f]of Object.entries(s)){const h=o.registry.getHandler(f.type);l[c]=h.read(a,f.options)}return l}}),o.registry.register("vec",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f}=l,h=(ArrayBuffer.isView(s),s.length);a.writeUint32(h);const g=o.registry.getHandler(c);if(ArrayBuffer.isView(s))for(let m=0;m<h;m++)g.write(a,s[m],f);else for(const m of s)g.write(a,m,f)},read:(a,s)=>{if(!s)return[];const{elementType:l,elementOptions:c}=s,f=a.readUint32(),h=o.registry.getHandler(l),g=Array.from({length:f},()=>h.read(a,c));switch(l){case"u8":return new Uint8Array(g);case"u16":return new Uint16Array(g);case"u32":return new Uint32Array(g);case"i8":return new Int8Array(g);case"i16":return new Int16Array(g);case"i32":return new Int32Array(g);case"i64":return new BigInt64Array(g);case"f32":return new Float32Array(g);case"f64":return new Float64Array(g);default:return g}}}),o.registry.register("set",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f}=l,h=Array.from(s).sort();a.writeUint32(h.length);const g=o.registry.getHandler(c);for(const m of h)g.write(a,m,f)},read:(a,s)=>{if(!s)return new Set;const{elementType:l,elementOptions:c}=s,f=a.readUint32(),h=o.registry.getHandler(l),g=Array.from({length:f},()=>h.read(a,c));return new Set(g)}}),o.registry.register("map",{write:(a,s,l)=>{if(!l)return;const{keyType:c,keyOptions:f,valueType:h,valueOptions:g}=l,m=Array.from(s.entries()).sort();a.writeUint32(m.length);const b=o.registry.getHandler(c),p=o.registry.getHandler(h);for(const[v,w]of m)b.write(a,v,f),p.write(a,w,g)},read:(a,s)=>{if(!s)return new Map;const{keyType:l,keyOptions:c,valueType:f,valueOptions:h}=s,g=a.readUint32(),m=o.registry.getHandler(l),b=o.registry.getHandler(f),p=Array.from({length:g},()=>{const v=m.read(a,c),w=b.read(a,h);return[v,w]});return new Map(p)}}),o.registry.register("option",{write:(a,s,l)=>{if(!l)return;const{valueType:c,valueOptions:f}=l,h=s!==null;a.writeUint8(h?1:0),h&&o.registry.getHandler(c).write(a,s,f)},read:(a,s)=>{if(!s)return null;const{valueType:l,valueOptions:c}=s;return a.readUint8()===1?o.registry.getHandler(l).read(a,c):null}}),o.registry.register("enum",{write:(a,s,l)=>{if(!l)return;const c=Object.keys(s)[0],f=s[c],h=l.variants.find(g=>g.name===c);if(!h)throw new Error(`Unknown enum variant: ${c}`);a.writeUint8(h.index),h.type!=="unit"&&o.registry.getHandler(h.type).write(a,f,h.options)},read:(a,s)=>{if(!s)return{};const l=a.readUint8(),c=s.variants.find(g=>g.index===l);if(!c)throw new Error(`Unknown enum variant index: ${l}`);if(c.type==="unit")return{[c.name]:{}};const h=o.registry.getHandler(c.type).read(a,c.options);return{[c.name]:h}}}),o.registry.register("tuple",{write:(a,s,l)=>{if(l){if(s.length!==l.length)throw new Error(`Tuple length mismatch: expected ${l.length}, got ${s.length}`);for(let c=0;c<l.length;c++){const f=l[c];if(!f)throw new Error(`Missing type information for tuple element at index ${c}`);o.registry.getHandler(f.type).write(a,s[c],f.options)}}},read:(a,s)=>{if(!s)return[];const l=[];for(const c of s){const f=o.registry.getHandler(c.type);l.push(f.read(a,c.options))}return l}}),o.registry.register("array",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f,length:h}=l;if(s.length!==h)throw new Error(`Array length mismatch: expected ${h}, got ${s.length}`);const g=o.registry.getHandler(c);for(const m of s)g.write(a,m,f)},read:(a,s)=>{if(!s)return[];const{elementType:l,elementOptions:c,length:f}=s,h=o.registry.getHandler(l);return Array.from({length:f},()=>h.read(a,c))}}),o.registry.register("bytes",{write:(a,s,l)=>{const c=s.length;if((l==null?void 0:l.length)!=null){if(c!==l.length)throw new Error(`Bytes length mismatch: expected ${l.length}, got ${c}`);for(let f=0;f<c;f++)a.writeUint8(s[f])}else{a.writeUint32(c);for(let f=0;f<c;f++)a.writeUint8(s[f])}},read:(a,s)=>{const l=(s==null?void 0:s.length)!=null?s.length:a.readUint32(),c=new Uint8Array(l);for(let f=0;f<l;f++)c[f]=a.readUint8();return c}}),o.registry.register("nativeEnum",{write:(a,s,l)=>{if(!l)return;const{valueToIndexMap:c}=l,f=s,h=c.get(f);if(h===void 0)throw new Error(`Invalid enum value: ${String(s)}`);a.writeUint8(h)},read:(a,s)=>{if(!s)return null;const{indexToValueMap:l}=s,c=a.readUint8(),f=l.get(c);if(f===void 0)throw new Error(`Invalid enum index: ${c}`);return f}})})(g0)),g0}var gD;function bH(){if(gD)return Rl;gD=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.b=Rl.Schema=void 0;const o=gH(),n=yH();class a{constructor(l,c,f){We(this,"type");We(this,"options");We(this,"registry");this.type=l,this.options=c,this.registry=f}serialize(l){const c=new o.BinaryWriter;return this.registry.getHandler(this.type).write(c,l,this.options),c.getBuffer()}deserialize(l){const c=new o.BinaryReader(l);return this.registry.getHandler(this.type).read(c,this.options)}}return Rl.Schema=a,Rl.b={u8:()=>new a("u8",null,n.registry),u16:()=>new a("u16",null,n.registry),u32:()=>new a("u32",null,n.registry),u64:()=>new a("u64",null,n.registry),u128:()=>new a("u128",null,n.registry),i8:()=>new a("i8",null,n.registry),i16:()=>new a("i16",null,n.registry),i32:()=>new a("i32",null,n.registry),i64:()=>new a("i64",null,n.registry),i128:()=>new a("i128",null,n.registry),f32:()=>new a("f32",null,n.registry),f64:()=>new a("f64",null,n.registry),bool:()=>new a("bool",null,n.registry),string:()=>new a("string",null,n.registry),unit:()=>new a("unit",null,n.registry),vec:s=>new a("vec",{elementType:s.type,elementOptions:s.options},n.registry),hashSet:s=>new a("set",{elementType:s.type,elementOptions:s.options},n.registry),hashMap:(s,l)=>new a("map",{keyType:s.type,keyOptions:s.options,valueType:l.type,valueOptions:l.options},n.registry),option:s=>new a("option",{valueType:s.type,valueOptions:s.options},n.registry),array:(s,l)=>new a("array",{elementType:s.type,elementOptions:s.options,length:l},n.registry),bytes:s=>new a("bytes",s!=null?{length:s}:{},n.registry),enum:s=>{const l=Object.entries(s).map(([c,f],h)=>({index:h,name:c,type:f.type,options:f.options}));return new a("enum",{variants:l},n.registry)},struct:s=>{const l=Object.fromEntries(Object.entries(s).map(([c,f])=>[c,{type:f.type,options:f.options}]));return new a("struct",l,n.registry)},tuple:(...s)=>{const l=s.map(c=>({type:c.type,options:c.options}));return new a("tuple",l,n.registry)},nativeEnum:s=>{const l=Object.entries(s).filter(([b])=>typeof b=="string"&&Number.isNaN(Number(b))),c=l.map(([b,p])=>p),f=c.some(b=>typeof b=="string"),h=c.some(b=>typeof b=="number");if(f&&h)throw new Error("Mixed string/numeric enums are not supported");const g=new Map,m=new Map;if(l.forEach(([b,p],v)=>{g.set(p,v),m.set(v,p)}),l.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new a("nativeEnum",{enumObj:s,valueToIndexMap:g,indexToValueMap:m},n.registry)}},Rl}var yD;function vH(){return yD||(yD=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Schema=o.b=void 0;var n=bH();Object.defineProperty(o,"b",{enumerable:!0,get:function(){return n.b}}),Object.defineProperty(o,"Schema",{enumerable:!0,get:function(){return n.Schema}})})(m0)),m0}var se=vH();const SH=1,wH=2,EH=3,xH=4,RH=5,TH=257,CH=258,OH=259,DH=260,AH=261,NH=513,MH=514,_H=515,kH=516,LH=517,UH=519,zH=520,jH=769,PH=770,HH=771,IH=772,BH=773,VH=774,FH=1025,YH=1026,$H=1281,qH=1001,za=1002,GH=1003,MN=1004,Lm=1005,XH=1101,QH=1102,WH=1201,KH=1202,JH=1301,ZH=1302,eI=1401,tI={[qH]:"Unsupported protocol version",[za]:"Invalid frame format",[GH]:"Unknown message kind",[MN]:"Failed to decode payload",[Lm]:"Frame exceeds maximum size",[XH]:"Device not found",[QH]:"Failed to connect device",[WH]:"Tmux target not found",[KH]:"Tmux not ready",[JH]:"Select conflict",[ZH]:"Select token mismatch",[eI]:"Internal server error"};function nI(o){return tI[o]??`Unknown error code: ${o}`}class ur extends Error{constructor(n,a=!1,s){super(s??nI(n)),this.code=n,this.retryable=a,this.name="WsBorshError"}}const _N=se.b.struct({magic:se.b.bytes(2),version:se.b.u16(),kind:se.b.u16(),flags:se.b.u16(),seq:se.b.u32(),payload:se.b.bytes()}),oI=se.b.option(se.b.u32()),$m=se.b.option(se.b.u16()),Ia=se.b.option(se.b.string()),rI=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),aI=se.b.struct({serverImpl:se.b.string(),serverVersion:se.b.string(),selectedVersion:se.b.u16(),maxFrameBytes:se.b.u32(),heartbeatIntervalMs:se.b.u32(),capabilities:se.b.vec(se.b.string())}),sI=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:oI,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const iI=se.b.struct({deviceId:se.b.string()}),lI=se.b.struct({deviceId:se.b.string()}),cI=se.b.struct({deviceId:se.b.string()}),uI=se.b.struct({deviceId:se.b.string()}),dI=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Ia,message:Ia,rawMessage:Ia}),fI=se.b.struct({deviceId:se.b.string(),windowId:Ia,paneId:Ia,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:$m,rows:$m}),hI=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),pI=se.b.struct({deviceId:se.b.string(),name:Ia}),mI=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),gI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()});se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()});const yI=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),bI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),vI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),kN=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),SI=kN,wI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),EI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16),encoding:se.b.u8(),data:se.b.bytes()}),xI=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),RI=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),LN=se.b.struct({chunkStreamId:se.b.u32(),originalKind:se.b.u16(),originalSeq:se.b.u32(),totalChunks:se.b.u16(),chunkIndex:se.b.u16(),data:se.b.bytes()}),TI=se.b.struct({id:se.b.string(),windowId:se.b.string(),index:se.b.u16(),title:Ia,active:se.b.bool(),width:se.b.u16(),height:se.b.u16()}),CI=se.b.struct({id:se.b.string(),name:se.b.string(),index:se.b.u16(),active:se.b.bool(),panes:se.b.vec(TI)}),OI=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(CI)}),DI=se.b.struct({deviceId:se.b.string(),session:se.b.option(OI)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const AI=se.b.struct({windowId:se.b.string()}),NI=se.b.struct({windowId:se.b.string()}),MI=se.b.struct({windowId:se.b.string(),name:se.b.string()}),_I=se.b.struct({windowId:se.b.string()}),kI=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),LI=se.b.struct({paneId:se.b.string()}),UI=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),zI=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),jI=se.b.struct({windowId:Ia,paneId:Ia,windowIndex:$m,paneIndex:$m,paneUrl:Ia}),Mf=new Uint8Array([84,88]),PI=1;function Um(o,n,a,s=0,l=PI){const c={magic:Mf,version:l,kind:o,flags:s,seq:a,payload:n};return _N.serialize(c)}function hr(o,n){return o.serialize(n)}function HI(o){if(o.length<12)throw new ur(za,!1,"Envelope too small");if(o[0]!==Mf[0]||o[1]!==Mf[1])throw new ur(za,!1,"Invalid magic bytes");try{return _N.deserialize(o)}catch(n){throw new ur(za,!1,n instanceof Error?n.message:"Failed to decode envelope")}}function Ol(o,n){try{return o.deserialize(n)}catch(a){throw new ur(MN,!1,a instanceof Error?a.message:"Failed to decode payload")}}function II(o,n){const a=LN.serialize(o);return Um(1281,a,n)}function BI(o){return LN.deserialize(o)}function VI(o){return o.length>=2&&o[0]===Mf[0]&&o[1]===Mf[1]}const FI=5e3,bD=100,sS=1e3;class YI{constructor(){We(this,"streams",new Map);We(this,"lastCleanup",Date.now())}addChunk(n){if(this.cleanup(),n.totalChunks>sS)throw new ur(za,!1,`Too many chunks: ${n.totalChunks} > ${sS}`);if(n.chunkIndex>=n.totalChunks)throw new ur(za,!1,`Chunk index out of bounds: ${n.chunkIndex} >= ${n.totalChunks}`);let a=this.streams.get(n.chunkStreamId);if(!a){if(this.streams.size>=bD&&(this.cleanup(!0),this.streams.size>=bD))throw new ur(za,!1,"Too many concurrent chunk streams");a={chunks:new Map,totalChunks:n.totalChunks,createdAt:Date.now(),originalKind:n.originalKind,originalSeq:n.originalSeq},this.streams.set(n.chunkStreamId,a)}if(a.totalChunks!==n.totalChunks)throw this.streams.delete(n.chunkStreamId),new ur(za,!1,"Chunk total count mismatch");if(a.chunks.has(n.chunkIndex))throw new ur(za,!1,`Duplicate chunk index: ${n.chunkIndex}`);return a.chunks.set(n.chunkIndex,n),a.chunks.size===a.totalChunks?this.reassemble(n.chunkStreamId,a):null}reassemble(n,a){const s=[];let l=0;for(let h=0;h<a.totalChunks;h++){const g=a.chunks.get(h);if(!g)throw this.streams.delete(n),new ur(za,!1,`Missing chunk index: ${h}`);s.push(g.data),l+=g.data.length}const c=new Uint8Array(l);let f=0;for(const h of s)c.set(h,f),f+=h.length;return this.streams.delete(n),{kind:a.originalKind,seq:a.originalSeq,payload:c}}cleanup(n=!1){const a=Date.now();if(!n&&a-this.lastCleanup<5e3)return;this.lastCleanup=a;const s=a-FI;for(const[l,c]of this.streams)c.createdAt<s&&this.streams.delete(l)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function $I(o,n,a,s){const{maxFrameBytes:l,chunkStreamId:c}=s,f=16,h=18,g=l-f;if(g<=0)throw new ur(Lm,!1,`maxFrameBytes too small: ${l}`);if(o.length<=g)return{chunks:[],totalChunks:0};const m=l-f-h;if(m<=0)throw new ur(Lm,!1,`maxFrameBytes too small for chunking: ${l}`);const b=Math.ceil(o.length/m);if(b>sS)throw new ur(Lm,!1,`Too many chunks: ${b}`);const p=[];for(let v=0;v<b;v++){const w=v*m,E=Math.min(w+m,o.length);p.push({chunkStreamId:c,originalKind:n,originalSeq:a,totalChunks:b,chunkIndex:v,data:o.slice(w,E)})}return{chunks:p,totalChunks:b}}let y0=1;function qI(){const o=y0;return y0=y0%4294967295+1,o}function GI(o){const n=dI.deserialize(o),a={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:n.deviceId,type:a[n.eventType]??"error",errorType:n.errorType??void 0,message:n.message??void 0,rawMessage:n.rawMessage??void 0}}function XI(o){const n=yI.deserialize(o),s={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output"}[n.eventType]??"output";return{deviceId:n.deviceId,type:s,data:QI(s,n.eventData)}}function QI(o,n){if(n.length===0)return{};try{switch(o){case"window-add":return AI.deserialize(n);case"window-close":return NI.deserialize(n);case"window-renamed":return MI.deserialize(n);case"window-active":return _I.deserialize(n);case"pane-add":return kI.deserialize(n);case"pane-close":return LI.deserialize(n);case"pane-active":return UI.deserialize(n);case"layout-change":return zI.deserialize(n);case"bell":{const a=jI.deserialize(n);return{windowId:a.windowId??void 0,paneId:a.paneId??void 0,windowIndex:a.windowIndex??void 0,paneIndex:a.paneIndex??void 0,paneUrl:a.paneUrl??void 0}}default:return{}}}catch{return{}}}function WI(o){const n=DI.deserialize(o);return{deviceId:n.deviceId,session:n.session?KI(n.session):null}}function KI(o){return{id:o.id,name:o.name,windows:o.windows.map(JI)}}function JI(o){return{id:o.id,name:o.name,index:o.index,active:o.active,panes:o.panes.map(ZI)}}function ZI(o){return{id:o.id,windowId:o.windowId,index:o.index,title:o.title??void 0,active:o.active,width:o.width,height:o.height}}function e5(){const o=navigator.language;return o.startsWith("zh")?"zh_CN":o.startsWith("ja")?"ja_JP":$S}lo.use(iH).init({resources:pH,lng:e5(),fallbackLng:$S,interpolation:{escapeValue:!1},returnNull:!1});const t5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,n5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class o5{constructor(n={}){We(this,"ws",null);We(this,"options");We(this,"state","IDLE");We(this,"seq",0);We(this,"chunkReassembler",new YI);We(this,"reconnectAttempts",0);We(this,"reconnectTimer",null);We(this,"heartbeatTimer",null);We(this,"messageHandlers",new Set);We(this,"stateChangeHandlers",new Set);We(this,"errorHandlers",new Set);We(this,"pendingMessages",[]);We(this,"maxPendingMessages",100);this.options={...n5,...n}}setState(n){if(this.state!==n){console.log(`[borsh-client] State: ${this.state} -> ${n}`),this.state=n;for(const a of this.stateChangeHandlers)try{a(n)}catch(s){console.error("[borsh-client] State change handler error:",s)}n==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(n){return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}onStateChange(n){return this.stateChangeHandlers.add(n),()=>this.stateChangeHandlers.delete(n)}onError(n){return this.errorHandlers.add(n),()=>this.errorHandlers.delete(n)}connect(){var n,a;if(!(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN||((a=this.ws)==null?void 0:a.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(t5),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=s=>{this.handleMessage(s.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(s){this.handleError(s instanceof Error?s:new Error(String(s)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(n){if(typeof n=="string")return;const a=new Uint8Array(n);if(!VI(a)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const s=HI(a);if(s.kind===$H){const l=BI(s.payload),c=this.chunkReassembler.addChunk(l);c&&this.dispatchMessage({kind:c.kind,seq:c.seq,payload:c.payload});return}if(s.kind===wH){this.handleHelloS2C(s.payload);return}if(s.kind===xH)return;this.dispatchMessage({kind:s.kind,seq:s.seq,payload:s.payload})}catch(s){console.error("[borsh-client] Failed to decode message:",s)}}dispatchMessage(n){for(const a of this.messageHandlers)try{a(n)}catch(s){console.error("[borsh-client] Message handler error:",s)}}handleHelloS2C(n){try{const a=Ol(aI,n);console.log("[borsh-client] HELLO_S2C received:",a),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(a){console.error("[borsh-client] Failed to decode HELLO_S2C:",a),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(n){console.error("[borsh-client] Error:",n);for(const a of this.errorHandlers)try{a(n)}catch(s){console.error("[borsh-client] Error handler error:",s)}}sendHello(){const n={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},a=hr(rI,n),s=this.nextSeq(),l=Um(SH,a,s);this.sendRaw(l),this.setState("HELLO_NEGOTIATING")}send(n,a){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:n,payload:a}),!1;const s=this.nextSeq(),l=$I(a,n,s,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:qI()});if(l.totalChunks===0){const c=Um(n,a,s);this.sendRaw(c)}else for(const c of l.chunks){const f=II(c,this.nextSeq());this.sendRaw(f)}return!0}sendRaw(n){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(n)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const n=this.pendingMessages.shift();n&&this.send(n.kind,n.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const n={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},a=hr(sI,n),s=this.nextSeq(),l=Um(EH,a,s);this.sendRaw(l)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const n=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${n}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let b0=null;function lr(){return b0||(b0=new o5),b0}class r5{constructor(n={}){We(this,"transactions",new Map);We(this,"outputGates",new Map);We(this,"deferredHistories",new Map);We(this,"deferredFlushes",new Map);We(this,"deferredOutputs",new Map);We(this,"callbacks");We(this,"ackTimeoutMs",1500);We(this,"liveResumeTimeoutMs",2e3);We(this,"timers",new Map);this.callbacks=n}setCallbacks(n){this.callbacks=n;for(const a of this.transactions.keys())this.replayDeferred(a);for(const a of this.deferredHistories.keys())this.replayDeferred(a);for(const a of this.deferredFlushes.keys())this.replayDeferred(a);for(const a of this.deferredOutputs.keys())this.replayDeferred(a)}getTransaction(n){return this.transactions.get(n)}getState(n){var a;return((a=this.transactions.get(n))==null?void 0:a.state)??"STABLE"}isStable(n){return this.getState(n)==="STABLE"}isBuffering(n){var a;return((a=this.outputGates.get(n))==null?void 0:a.state)==="BUFFERING"}dispatch(n){switch(n.type){case"SELECT_START":this.handleSelectStart(n);break;case"SWITCH_ACK":this.handleSwitchAck(n);break;case"HISTORY":this.handleHistory(n);break;case"LIVE_RESUME":this.handleLiveResume(n);break;case"OUTPUT":this.handleOutput(n);break;case"SELECT_FAILED":this.handleSelectFailed(n);break}}handleSelectStart(n){const{deviceId:a,windowId:s,paneId:l,selectToken:c,wantHistory:f}=n;this.cancelTransaction(a),this.clearDeferred(a);const h={state:"SELECTING",deviceId:a,windowId:s,paneId:l,selectToken:new Uint8Array(c),wantHistory:f,startedAt:Date.now()};this.transactions.set(a,h),this.startOutputBuffering(a),this.setTimer(a,()=>{this.handleTimeout(a,"ack")},this.ackTimeoutMs)}handleSwitchAck(n){var c,f;const{deviceId:a,selectToken:s}=n,l=this.transactions.get(a);!l||!this.validateToken(l.selectToken,s)||l.state==="SELECTING"&&(this.clearTimer(a),l.state="ACKED",(f=(c=this.callbacks).onResetTerminal)==null||f.call(c,a),this.setTimer(a,()=>{this.handleTimeout(a,"live")},this.liveResumeTimeoutMs))}handleHistory(n){const{deviceId:a,selectToken:s,data:l}=n,c=this.transactions.get(a);!c||!this.validateToken(c.selectToken,s)||c.state==="ACKED"&&(c.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(a,l):this.deferredHistories.set(a,l),this.setTimer(a,()=>{this.handleTimeout(a,"live")},this.liveResumeTimeoutMs))}handleLiveResume(n){const{deviceId:a,selectToken:s}=n,l=this.transactions.get(a);if(!l||!this.validateToken(l.selectToken,s)||l.state!=="ACKED"&&l.state!=="HISTORY_APPLIED")return;this.clearTimer(a),l.state="LIVE";const c=this.stopOutputBuffering(a);this.completeTransaction(a),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(a,c):c.length>0&&this.deferredFlushes.set(a,c),this.replayDeferred(a)}handleOutput(n){const{deviceId:a,paneId:s,data:l}=n,c=this.transactions.get(a);if(c&&c.paneId!==s)return;if(this.isBuffering(a)){this.bufferOutput(a,l);return}if(this.callbacks.onOutput){this.callbacks.onOutput(a,s,l);return}const f=this.deferredOutputs.get(a)??[];f.push({paneId:s,data:new Uint8Array(l)}),this.deferredOutputs.set(a,f)}handleSelectFailed(n){const{deviceId:a}=n;this.failTransaction(a)}handleTimeout(n,a){console.warn(`[select-sm] Timeout at ${a} for ${n}`),this.failTransaction(n)}completeTransaction(n){const a=this.transactions.get(n);a&&(a.state="STABLE",this.transactions.delete(n))}failTransaction(n){var s,l;const a=this.transactions.get(n);a&&(a.state="SELECT_FAILED",this.stopOutputBuffering(n),(l=(s=this.callbacks).onSelectFailed)==null||l.call(s,n),this.transactions.delete(n),this.clearTimer(n),this.clearDeferred(n))}cancelTransaction(n){this.transactions.get(n)&&(this.stopOutputBuffering(n),this.transactions.delete(n),this.clearTimer(n),this.clearDeferred(n))}startOutputBuffering(n){this.outputGates.set(n,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(n){const a=this.outputGates.get(n);if(!a)return[];const s=[...a.buffer];return this.outputGates.delete(n),s}bufferOutput(n,a){const s=this.outputGates.get(n);s&&(s.buffer.length>=1e3&&s.buffer.shift(),s.buffer.push(new Uint8Array(a)))}validateToken(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==a[s])return!1;return!0}replayDeferred(n){const a=this.deferredHistories.get(n);a!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(n,a),this.deferredHistories.delete(n));const s=this.deferredFlushes.get(n);s&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(n,s),this.deferredFlushes.delete(n));const l=this.deferredOutputs.get(n);if(l&&this.callbacks.onOutput){for(const c of l)this.callbacks.onOutput(n,c.paneId,c.data);this.deferredOutputs.delete(n)}}clearDeferred(n){this.deferredHistories.delete(n),this.deferredFlushes.delete(n),this.deferredOutputs.delete(n)}setTimer(n,a,s){this.clearTimer(n);const l=setTimeout(a,s);this.timers.set(n,l)}clearTimer(n){const a=this.timers.get(n);a&&(clearTimeout(a),this.timers.delete(n))}cleanup(n){this.cancelTransaction(n),this.outputGates.delete(n),this.clearDeferred(n)}cleanupAll(){for(const n of this.transactions.keys())this.cleanup(n);this.transactions.clear(),this.outputGates.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const n of this.timers.values())clearTimeout(n);this.timers.clear()}}let cf=null;function _f(o){return cf?(o&&cf.setCallbacks(o),cf):(cf=new r5(o),cf)}function a5(){return crypto.getRandomValues(new Uint8Array(16))}function UN(o){const n=hr(iI,{deviceId:o});return{kind:TH,payload:n}}function s5(o){const n=hr(cI,{deviceId:o});return{kind:OH,payload:n}}function i5(o){const n=hr(fI,{deviceId:o.deviceId,windowId:o.windowId??null,paneId:o.paneId??null,selectToken:o.selectToken,wantHistory:o.wantHistory,cols:o.cols??null,rows:o.rows??null});return{kind:NH,payload:n}}function l5(o,n){const a=hr(hI,{deviceId:o,windowId:n});return{kind:MH,payload:a}}function c5(o,n){const a=hr(pI,{deviceId:o,name:n??null});return{kind:_H,payload:a}}function u5(o,n){const a=hr(mI,{deviceId:o,windowId:n});return{kind:kH,payload:a}}function d5(o,n){const a=hr(gI,{deviceId:o,paneId:n});return{kind:LH,payload:a}}function f5(o,n,a,s=!1){const l=new TextEncoder,c=hr(bI,{deviceId:o,paneId:n,encoding:2,data:l.encode(a),isComposing:s});return{kind:jH,payload:c}}function h5(o,n,a){const s=new TextEncoder,l=hr(vI,{deviceId:o,paneId:n,encoding:2,data:s.encode(a),isComposing:!1});return{kind:PH,payload:l}}function p5(o,n,a,s){const l=hr(kN,{deviceId:o,paneId:n,cols:a,rows:s});return{kind:HH,payload:l}}function m5(o,n,a,s){const l=hr(SI,{deviceId:o,paneId:n,cols:a,rows:s});return{kind:IH,payload:l}}const vD=o=>{let n;const a=new Set,s=(m,b)=>{const p=typeof m=="function"?m(n):m;if(!Object.is(p,n)){const v=n;n=b??(typeof p!="object"||p===null)?p:Object.assign({},n,p),a.forEach(w=>w(n,v))}},l=()=>n,h={setState:s,getState:l,getInitialState:()=>g,subscribe:m=>(a.add(m),()=>a.delete(m))},g=n=o(s,l,h);return h},g5=(o=>o?vD(o):vD),y5=o=>o;function b5(o,n=y5){const a=_e.useSyncExternalStore(o.subscribe,_e.useCallback(()=>n(o.getState()),[o,n]),_e.useCallback(()=>n(o.getInitialState()),[o,n]));return _e.useDebugValue(a),a}const SD=o=>{const n=g5(o),a=s=>b5(n,s);return Object.assign(a,n),a},qS=(o=>o?SD(o):SD),v0={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,enableBrowserBellToast:!0,enableTelegramBellPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:$S,updatedAt:new Date(0).toISOString()};async function wD(){const o=await fetch("/api/settings/site");if(!o.ok)throw new Error("Failed to load site settings");return(await o.json()).settings}const qm=qS((o,n)=>({settings:null,loading:!1,fetchSettings:async()=>{const a=n().settings;if(a)return a;o({loading:!0});try{const s=await wD();return o({settings:s,loading:!1}),lo.changeLanguage(s.language),s}catch(s){return console.error("[site] failed to fetch settings:",s),o({settings:v0,loading:!1}),lo.changeLanguage(v0.language),v0}},refreshSettings:async()=>{o({loading:!0});try{const a=await wD();return o({settings:a,loading:!1}),lo.changeLanguage(a.language),a}catch(a){throw console.error("[site] failed to refresh settings:",a),o({loading:!1}),a}}})),v5=500,ED=new Map,S0=new Map;function zN(o){const n=Date.now(),a=ED.get(o);return a!==void 0&&n-a<v5?!0:(ED.set(o,n),!1)}let xD=!1;function w0(o,n){if(typeof o!="number"||typeof n!="number")return null;const a=Math.max(2,Math.floor(o)),s=Math.max(2,Math.floor(n));return{cols:a,rows:s}}function S5(o,n){if(xD)return;xD=!0;const a=lr(),s=l=>{const c=n().selectedPanes[l];!c||_f().getTransaction(l)||n().selectPane(l,c.windowId,c.paneId)};a.onStateChange(l=>{o({socketReady:l==="READY"})}),a.onMessage(l=>{const c=_f();switch(l.kind){case CH:{const f=Ol(lI,l.payload);o(h=>({deviceConnected:{...h.deviceConnected,[f.deviceId]:!0},deviceErrors:{...h.deviceErrors,[f.deviceId]:void 0}})),s(f.deviceId);return}case DH:{const f=Ol(uI,l.payload);c.cleanup(f.deviceId),o(h=>({deviceConnected:{...h.deviceConnected,[f.deviceId]:!1}}));return}case AH:{const f=GI(l.payload);w5(o,f),f.type==="reconnected"&&s(f.deviceId);return}case zH:{const f=WI(l.payload);o(h=>({snapshots:{...h.snapshots,[f.deviceId]:f}}));return}case UH:{const f=XI(l.payload);E5(o,f);return}case FH:{const f=Ol(xI,l.payload);c.dispatch({type:"SWITCH_ACK",deviceId:f.deviceId,selectToken:f.selectToken});return}case VH:{const f=Ol(EI,l.payload),h=new TextDecoder().decode(f.data);c.dispatch({type:"HISTORY",deviceId:f.deviceId,selectToken:f.selectToken,data:h});return}case YH:{const f=Ol(RI,l.payload);c.dispatch({type:"LIVE_RESUME",deviceId:f.deviceId,selectToken:f.selectToken});return}case BH:{const f=Ol(wI,l.payload);c.dispatch({type:"OUTPUT",deviceId:f.deviceId,paneId:f.paneId,data:f.data});return}case RH:return}}),a.onError(l=>{console.error("[tmux] borsh ws error:",l),o({socketReady:!1}),window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:"WebSocket Connection Error",description:"Please check Gateway status"}}))}),a.onStateChange(l=>{if(l!=="READY")return;const c=n().connectedDevices;for(const f of c){if(zN(f))continue;const h=UN(f);a.send(h.kind,h.payload)}})}function w5(o,n){if(n.type==="error"){const a=n.message??"Device Error";o(s=>{const l=s.deviceErrors[n.deviceId];return(l==null?void 0:l.message)===a&&(l==null?void 0:l.type)===n.errorType?{}:{deviceErrors:{...s.deviceErrors,[n.deviceId]:{message:a,type:n.errorType}}}});return}if(n.type==="disconnected"){_f().cleanup(n.deviceId),o(a=>({deviceConnected:{...a.deviceConnected,[n.deviceId]:!1}}));return}n.type==="reconnected"&&o(a=>({deviceConnected:{...a.deviceConnected,[n.deviceId]:!0},deviceErrors:{...a.deviceErrors,[n.deviceId]:void 0}}))}function E5(o,n){if(n.type==="bell"){const a=qm.getState().settings;if((a==null?void 0:a.enableBrowserBellToast)===!1)return;const s=n.data??{},l="Terminal Bell",c=[typeof s.windowIndex=="number"?`Window ${s.windowIndex}`:void 0,typeof s.paneIndex=="number"?`Pane ${s.paneIndex}`:void 0].filter(Boolean).join(" · ");window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:l,description:c||"Received tmux bell",paneUrl:typeof s.paneUrl=="string"?s.paneUrl:void 0}}))}if(n.type==="pane-active"){const a=n.data;a!=null&&a.windowId&&(a!=null&&a.paneId)&&o(s=>({activePaneFromEvent:{...s.activePaneFromEvent,[n.deviceId]:{windowId:a.windowId,paneId:a.paneId}}}))}}const Es=qS((o,n)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},selectedPanes:{},activePaneFromEvent:{},ensureSocketConnected(){S5(o,n),lr().connect()},connectDevice(a){if(!a||(o(l=>{const c=new Set(l.connectedDevices);return c.add(a),{connectedDevices:c}}),n().ensureSocketConnected(),zN(a)))return;const s=UN(a);lr().send(s.kind,s.payload)},disconnectDevice(a){if(!a)return;o(l=>{const c=new Set(l.connectedDevices);return c.delete(a),{connectedDevices:c}}),_f().cleanup(a);const s=s5(a);lr().send(s.kind,s.payload)},clearDeviceError(a){o(s=>({deviceErrors:{...s.deviceErrors,[a]:void 0}}))},selectPane(a,s,l,c){if(!a||!s||!l)return;o(b=>({selectedPanes:{...b.selectedPanes,[a]:{windowId:s,paneId:l}}}));const f=a5(),h=!0;_f().dispatch({type:"SELECT_START",deviceId:a,windowId:s,paneId:l,selectToken:f,wantHistory:h});const g=w0(c==null?void 0:c.cols,c==null?void 0:c.rows)??S0.get(a)??null,m=i5({deviceId:a,windowId:s,paneId:l,selectToken:f,wantHistory:h,cols:g==null?void 0:g.cols,rows:g==null?void 0:g.rows});lr().send(m.kind,m.payload)},selectWindow(a,s){if(!a||!s)return;const l=l5(a,s);lr().send(l.kind,l.payload)},sendInput(a,s,l,c=!1){if(!a||!s)return;const f=f5(a,s,l,c);lr().send(f.kind,f.payload)},resizePane(a,s,l,c){if(!a||!s)return;const f=w0(l,c);f&&S0.set(a,{...f,at:Date.now()});const h=p5(a,s,l,c);lr().send(h.kind,h.payload)},syncPaneSize(a,s,l,c){if(!a||!s)return;const f=w0(l,c);f&&S0.set(a,{...f,at:Date.now()});const h=m5(a,s,l,c);lr().send(h.kind,h.payload)},paste(a,s,l){if(!a||!s)return;const c=h5(a,s,l);lr().send(c.kind,c.payload)},createWindow(a,s){if(!a)return;const l=c5(a,s);lr().send(l.kind,l.payload)},closeWindow(a,s){if(!a||!s)return;const l=u5(a,s);lr().send(l.kind,l.payload)},closePane(a,s){if(!a||!s)return;const l=d5(a,s);lr().send(l.kind,l.payload)}})),RD="tmex:connectedDevices",jN=x.createContext(null);function x5(){const o=x.useContext(jN);if(!o)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return o}function R5({children:o}){const n=Ns(),[a,s]=x.useState(()=>{try{const p=localStorage.getItem(RD);if(p){const v=JSON.parse(p);return new Set(v)}}catch{}return new Set}),l=Es(p=>p.connectDevice),c=Es(p=>p.disconnectDevice),f=Es(p=>p.connectedDevices);x.useEffect(()=>{try{localStorage.setItem(RD,JSON.stringify([...a]))}catch{}},[a]),x.useEffect(()=>{const p=n.pathname.match(/^\/devices\/([^/]+)/),v=p==null?void 0:p[1];v&&!f.has(v)&&l(v)},[n.pathname,f,l]);const h=x.useCallback(p=>{s(v=>{const w=new Set(v);return w.add(p),w}),f.has(p)||l(p)},[f,l]),g=x.useCallback(p=>{s(v=>{const w=new Set(v);return w.delete(p),w}),f.has(p)&&c(p)},[f,c]),m=x.useCallback((p,v)=>{v?g(p):h(p)},[h,g]),b=x.useMemo(()=>({persistedDevices:a,connectDevice:h,disconnectDevice:g,toggleDevice:m}),[a,h,g,m]);return re.jsxDEV(jN.Provider,{value:b,children:o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/global-device-provider.tsx",lineNumber:117,columnNumber:10},this)}/**
321
+ 時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加"},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ"},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です"}}}},$S="en_US",RY={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function mH(o){return o.replace("_","-")}var m0={},Rl={},Tl={},pD;function gH(){if(pD)return Tl;pD=1,Object.defineProperty(Tl,"__esModule",{value:!0}),Tl.BinaryReader=Tl.BinaryWriter=void 0;class o{constructor(s=1024){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=new Uint8Array(s),this.view=new DataView(this.buffer.buffer)}ensureCapacity(s){const l=this.offset+s;if(l<=this.buffer.length)return;let c=this.buffer.length;for(;c<l;)c*=2;const f=new Uint8Array(c);f.set(this.buffer),this.buffer=f,this.view=new DataView(this.buffer.buffer)}writeUint8(s){this.ensureCapacity(1),this.view.setUint8(this.offset,s),this.offset+=1}writeUint16(s){this.ensureCapacity(2),this.view.setUint16(this.offset,s,!0),this.offset+=2}writeUint32(s){this.ensureCapacity(4),this.view.setUint32(this.offset,s,!0),this.offset+=4}writeUint64(s){this.ensureCapacity(8),this.view.setBigUint64(this.offset,s,!0),this.offset+=8}writeUint128(s){this.ensureCapacity(16);const l=s&BigInt("0xFFFFFFFFFFFFFFFF"),c=s>>BigInt(64);this.writeUint64(l),this.writeUint64(c)}writeInt8(s){this.ensureCapacity(1),this.view.setInt8(this.offset,s),this.offset+=1}writeInt16(s){this.ensureCapacity(2),this.view.setInt16(this.offset,s,!0),this.offset+=2}writeInt32(s){this.ensureCapacity(4),this.view.setInt32(this.offset,s,!0),this.offset+=4}writeInt64(s){this.ensureCapacity(8),this.view.setBigInt64(this.offset,s,!0),this.offset+=8}writeInt128(s){this.ensureCapacity(16);const l=s&BigInt("0xFFFFFFFFFFFFFFFF"),c=s>>BigInt(64);this.writeInt64(l),this.writeInt64(c)}writeFloat32(s){this.ensureCapacity(4),this.view.setFloat32(this.offset,s,!0),this.offset+=4}writeFloat64(s){this.ensureCapacity(8),this.view.setFloat64(this.offset,s,!0),this.offset+=8}writeBool(s){this.writeUint8(s?1:0)}writeString(s){const l=new TextEncoder().encode(s);this.writeUint32(l.length),this.ensureCapacity(l.length),this.buffer.set(l,this.offset),this.offset+=l.length}getBuffer(){return this.buffer.slice(0,this.offset)}}Tl.BinaryWriter=o;class n{constructor(s){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=s,this.view=new DataView(s.buffer,s.byteOffset,s.byteLength)}readUint8(){const s=this.view.getUint8(this.offset);return this.offset+=1,s}readUint16(){const s=this.view.getUint16(this.offset,!0);return this.offset+=2,s}readUint32(){const s=this.view.getUint32(this.offset,!0);return this.offset+=4,s}readUint64(){const s=this.view.getBigUint64(this.offset,!0);return this.offset+=8,s}readUint128(){const s=this.readUint64();return this.readUint64()<<BigInt(64)|s}readInt8(){const s=this.view.getInt8(this.offset);return this.offset+=1,s}readInt16(){const s=this.view.getInt16(this.offset,!0);return this.offset+=2,s}readInt32(){const s=this.view.getInt32(this.offset,!0);return this.offset+=4,s}readInt64(){const s=this.view.getBigInt64(this.offset,!0);return this.offset+=8,s}readInt128(){const s=this.readUint64();return this.readInt64()<<BigInt(64)|s}readFloat32(){const s=this.view.getFloat32(this.offset,!0);return this.offset+=4,s}readFloat64(){const s=this.view.getFloat64(this.offset,!0);return this.offset+=8,s}readBool(){return!!this.readUint8()}readString(){const s=this.readUint32(),l=this.buffer.slice(this.offset,this.offset+s);return this.offset+=s,new TextDecoder().decode(l)}getOffset(){return this.offset}}return Tl.BinaryReader=n,Tl}var g0={},mD;function yH(){return mD||(mD=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.registry=o.TypeRegistry=void 0;class n{constructor(){We(this,"handlers",new Map)}register(s,l){this.handlers.set(s,l)}getHandler(s){const l=this.handlers.get(s);if(!l)throw new Error(`No handler registered for type: ${s}`);return l}}o.TypeRegistry=n,o.registry=new n,o.registry.register("u8",{write:(a,s)=>{if(s<0||s>255||!Number.isInteger(s))throw new Error("Value out of range for u8");a.writeUint8(s)},read:a=>a.readUint8()}),o.registry.register("u16",{write:(a,s)=>{if(s<0||s>65535||!Number.isInteger(s))throw new Error("Value out of range for u16");a.writeUint16(s)},read:a=>a.readUint16()}),o.registry.register("u32",{write:(a,s)=>{if(s<0||s>4294967295||!Number.isInteger(s))throw new Error("Value out of range for u32");a.writeUint32(s)},read:a=>a.readUint32()}),o.registry.register("u64",{write:(a,s)=>{if(s<0n||s>18446744073709551615n)throw new Error("Value out of range for u64");a.writeUint64(s)},read:a=>a.readUint64()}),o.registry.register("u128",{write:(a,s)=>{if(s<0n||s>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");a.writeUint128(s)},read:a=>a.readUint128()}),o.registry.register("i8",{write:(a,s)=>{if(s<-128||s>127||!Number.isInteger(s))throw new Error("Value out of range for i8");a.writeInt8(s)},read:a=>a.readInt8()}),o.registry.register("i16",{write:(a,s)=>{if(s<-32768||s>32767||!Number.isInteger(s))throw new Error("Value out of range for i16");a.writeInt16(s)},read:a=>a.readInt16()}),o.registry.register("i32",{write:(a,s)=>{if(s<-2147483648||s>2147483647||!Number.isInteger(s))throw new Error("Value out of range for i32");a.writeInt32(s)},read:a=>a.readInt32()}),o.registry.register("i64",{write:(a,s)=>{if(s<-9223372036854775808n||s>9223372036854775807n)throw new Error("Value out of range for i64");a.writeInt64(s)},read:a=>a.readInt64()}),o.registry.register("i128",{write:(a,s)=>{if(s<-170141183460469231731687303715884105728n||s>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");a.writeInt128(s)},read:a=>a.readInt128()}),o.registry.register("f32",{write:(a,s)=>a.writeFloat32(s),read:a=>a.readFloat32()}),o.registry.register("f64",{write:(a,s)=>{if(Number.isNaN(s))throw new Error("For portability reasons we do not allow serializing NaN values.");a.writeFloat64(s)},read:a=>a.readFloat64()}),o.registry.register("bool",{write:(a,s)=>a.writeBool(s),read:a=>a.readBool()}),o.registry.register("string",{write:(a,s)=>a.writeString(s),read:a=>a.readString()}),o.registry.register("unit",{write:()=>{},read:()=>({})}),o.registry.register("struct",{write:(a,s,l)=>{if(l)for(const[c,f]of Object.entries(l))o.registry.getHandler(f.type).write(a,s[c],f.options)},read:(a,s)=>{if(!s)return{};const l={};for(const[c,f]of Object.entries(s)){const h=o.registry.getHandler(f.type);l[c]=h.read(a,f.options)}return l}}),o.registry.register("vec",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f}=l,h=(ArrayBuffer.isView(s),s.length);a.writeUint32(h);const g=o.registry.getHandler(c);if(ArrayBuffer.isView(s))for(let m=0;m<h;m++)g.write(a,s[m],f);else for(const m of s)g.write(a,m,f)},read:(a,s)=>{if(!s)return[];const{elementType:l,elementOptions:c}=s,f=a.readUint32(),h=o.registry.getHandler(l),g=Array.from({length:f},()=>h.read(a,c));switch(l){case"u8":return new Uint8Array(g);case"u16":return new Uint16Array(g);case"u32":return new Uint32Array(g);case"i8":return new Int8Array(g);case"i16":return new Int16Array(g);case"i32":return new Int32Array(g);case"i64":return new BigInt64Array(g);case"f32":return new Float32Array(g);case"f64":return new Float64Array(g);default:return g}}}),o.registry.register("set",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f}=l,h=Array.from(s).sort();a.writeUint32(h.length);const g=o.registry.getHandler(c);for(const m of h)g.write(a,m,f)},read:(a,s)=>{if(!s)return new Set;const{elementType:l,elementOptions:c}=s,f=a.readUint32(),h=o.registry.getHandler(l),g=Array.from({length:f},()=>h.read(a,c));return new Set(g)}}),o.registry.register("map",{write:(a,s,l)=>{if(!l)return;const{keyType:c,keyOptions:f,valueType:h,valueOptions:g}=l,m=Array.from(s.entries()).sort();a.writeUint32(m.length);const b=o.registry.getHandler(c),p=o.registry.getHandler(h);for(const[v,w]of m)b.write(a,v,f),p.write(a,w,g)},read:(a,s)=>{if(!s)return new Map;const{keyType:l,keyOptions:c,valueType:f,valueOptions:h}=s,g=a.readUint32(),m=o.registry.getHandler(l),b=o.registry.getHandler(f),p=Array.from({length:g},()=>{const v=m.read(a,c),w=b.read(a,h);return[v,w]});return new Map(p)}}),o.registry.register("option",{write:(a,s,l)=>{if(!l)return;const{valueType:c,valueOptions:f}=l,h=s!==null;a.writeUint8(h?1:0),h&&o.registry.getHandler(c).write(a,s,f)},read:(a,s)=>{if(!s)return null;const{valueType:l,valueOptions:c}=s;return a.readUint8()===1?o.registry.getHandler(l).read(a,c):null}}),o.registry.register("enum",{write:(a,s,l)=>{if(!l)return;const c=Object.keys(s)[0],f=s[c],h=l.variants.find(g=>g.name===c);if(!h)throw new Error(`Unknown enum variant: ${c}`);a.writeUint8(h.index),h.type!=="unit"&&o.registry.getHandler(h.type).write(a,f,h.options)},read:(a,s)=>{if(!s)return{};const l=a.readUint8(),c=s.variants.find(g=>g.index===l);if(!c)throw new Error(`Unknown enum variant index: ${l}`);if(c.type==="unit")return{[c.name]:{}};const h=o.registry.getHandler(c.type).read(a,c.options);return{[c.name]:h}}}),o.registry.register("tuple",{write:(a,s,l)=>{if(l){if(s.length!==l.length)throw new Error(`Tuple length mismatch: expected ${l.length}, got ${s.length}`);for(let c=0;c<l.length;c++){const f=l[c];if(!f)throw new Error(`Missing type information for tuple element at index ${c}`);o.registry.getHandler(f.type).write(a,s[c],f.options)}}},read:(a,s)=>{if(!s)return[];const l=[];for(const c of s){const f=o.registry.getHandler(c.type);l.push(f.read(a,c.options))}return l}}),o.registry.register("array",{write:(a,s,l)=>{if(!l)return;const{elementType:c,elementOptions:f,length:h}=l;if(s.length!==h)throw new Error(`Array length mismatch: expected ${h}, got ${s.length}`);const g=o.registry.getHandler(c);for(const m of s)g.write(a,m,f)},read:(a,s)=>{if(!s)return[];const{elementType:l,elementOptions:c,length:f}=s,h=o.registry.getHandler(l);return Array.from({length:f},()=>h.read(a,c))}}),o.registry.register("bytes",{write:(a,s,l)=>{const c=s.length;if((l==null?void 0:l.length)!=null){if(c!==l.length)throw new Error(`Bytes length mismatch: expected ${l.length}, got ${c}`);for(let f=0;f<c;f++)a.writeUint8(s[f])}else{a.writeUint32(c);for(let f=0;f<c;f++)a.writeUint8(s[f])}},read:(a,s)=>{const l=(s==null?void 0:s.length)!=null?s.length:a.readUint32(),c=new Uint8Array(l);for(let f=0;f<l;f++)c[f]=a.readUint8();return c}}),o.registry.register("nativeEnum",{write:(a,s,l)=>{if(!l)return;const{valueToIndexMap:c}=l,f=s,h=c.get(f);if(h===void 0)throw new Error(`Invalid enum value: ${String(s)}`);a.writeUint8(h)},read:(a,s)=>{if(!s)return null;const{indexToValueMap:l}=s,c=a.readUint8(),f=l.get(c);if(f===void 0)throw new Error(`Invalid enum index: ${c}`);return f}})})(g0)),g0}var gD;function bH(){if(gD)return Rl;gD=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.b=Rl.Schema=void 0;const o=gH(),n=yH();class a{constructor(l,c,f){We(this,"type");We(this,"options");We(this,"registry");this.type=l,this.options=c,this.registry=f}serialize(l){const c=new o.BinaryWriter;return this.registry.getHandler(this.type).write(c,l,this.options),c.getBuffer()}deserialize(l){const c=new o.BinaryReader(l);return this.registry.getHandler(this.type).read(c,this.options)}}return Rl.Schema=a,Rl.b={u8:()=>new a("u8",null,n.registry),u16:()=>new a("u16",null,n.registry),u32:()=>new a("u32",null,n.registry),u64:()=>new a("u64",null,n.registry),u128:()=>new a("u128",null,n.registry),i8:()=>new a("i8",null,n.registry),i16:()=>new a("i16",null,n.registry),i32:()=>new a("i32",null,n.registry),i64:()=>new a("i64",null,n.registry),i128:()=>new a("i128",null,n.registry),f32:()=>new a("f32",null,n.registry),f64:()=>new a("f64",null,n.registry),bool:()=>new a("bool",null,n.registry),string:()=>new a("string",null,n.registry),unit:()=>new a("unit",null,n.registry),vec:s=>new a("vec",{elementType:s.type,elementOptions:s.options},n.registry),hashSet:s=>new a("set",{elementType:s.type,elementOptions:s.options},n.registry),hashMap:(s,l)=>new a("map",{keyType:s.type,keyOptions:s.options,valueType:l.type,valueOptions:l.options},n.registry),option:s=>new a("option",{valueType:s.type,valueOptions:s.options},n.registry),array:(s,l)=>new a("array",{elementType:s.type,elementOptions:s.options,length:l},n.registry),bytes:s=>new a("bytes",s!=null?{length:s}:{},n.registry),enum:s=>{const l=Object.entries(s).map(([c,f],h)=>({index:h,name:c,type:f.type,options:f.options}));return new a("enum",{variants:l},n.registry)},struct:s=>{const l=Object.fromEntries(Object.entries(s).map(([c,f])=>[c,{type:f.type,options:f.options}]));return new a("struct",l,n.registry)},tuple:(...s)=>{const l=s.map(c=>({type:c.type,options:c.options}));return new a("tuple",l,n.registry)},nativeEnum:s=>{const l=Object.entries(s).filter(([b])=>typeof b=="string"&&Number.isNaN(Number(b))),c=l.map(([b,p])=>p),f=c.some(b=>typeof b=="string"),h=c.some(b=>typeof b=="number");if(f&&h)throw new Error("Mixed string/numeric enums are not supported");const g=new Map,m=new Map;if(l.forEach(([b,p],v)=>{g.set(p,v),m.set(v,p)}),l.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new a("nativeEnum",{enumObj:s,valueToIndexMap:g,indexToValueMap:m},n.registry)}},Rl}var yD;function vH(){return yD||(yD=1,(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.Schema=o.b=void 0;var n=bH();Object.defineProperty(o,"b",{enumerable:!0,get:function(){return n.b}}),Object.defineProperty(o,"Schema",{enumerable:!0,get:function(){return n.Schema}})})(m0)),m0}var ae=vH();const SH=1,wH=2,EH=3,xH=4,RH=5,TH=257,CH=258,OH=259,DH=260,AH=261,NH=513,MH=514,_H=515,kH=516,LH=517,UH=519,zH=520,jH=769,PH=770,HH=771,IH=772,BH=773,VH=774,FH=1025,YH=1026,$H=1281,qH=1001,za=1002,GH=1003,MN=1004,Lm=1005,XH=1101,QH=1102,WH=1201,KH=1202,JH=1301,ZH=1302,eI=1401,tI={[qH]:"Unsupported protocol version",[za]:"Invalid frame format",[GH]:"Unknown message kind",[MN]:"Failed to decode payload",[Lm]:"Frame exceeds maximum size",[XH]:"Device not found",[QH]:"Failed to connect device",[WH]:"Tmux target not found",[KH]:"Tmux not ready",[JH]:"Select conflict",[ZH]:"Select token mismatch",[eI]:"Internal server error"};function nI(o){return tI[o]??`Unknown error code: ${o}`}class ur extends Error{constructor(n,a=!1,s){super(s??nI(n)),this.code=n,this.retryable=a,this.name="WsBorshError"}}const _N=ae.b.struct({magic:ae.b.bytes(2),version:ae.b.u16(),kind:ae.b.u16(),flags:ae.b.u16(),seq:ae.b.u32(),payload:ae.b.bytes()}),oI=ae.b.option(ae.b.u32()),$m=ae.b.option(ae.b.u16()),Ia=ae.b.option(ae.b.string()),rI=ae.b.struct({clientImpl:ae.b.string(),clientVersion:ae.b.string(),maxFrameBytes:ae.b.u32(),supportsCompression:ae.b.bool(),supportsDiffSnapshot:ae.b.bool()}),aI=ae.b.struct({serverImpl:ae.b.string(),serverVersion:ae.b.string(),selectedVersion:ae.b.u16(),maxFrameBytes:ae.b.u32(),heartbeatIntervalMs:ae.b.u32(),capabilities:ae.b.vec(ae.b.string())}),sI=ae.b.struct({nonce:ae.b.u32(),timeMs:ae.b.u64()});ae.b.struct({refSeq:oI,code:ae.b.u16(),message:ae.b.string(),retryable:ae.b.bool()});const iI=ae.b.struct({deviceId:ae.b.string()}),lI=ae.b.struct({deviceId:ae.b.string()}),cI=ae.b.struct({deviceId:ae.b.string()}),uI=ae.b.struct({deviceId:ae.b.string()}),dI=ae.b.struct({deviceId:ae.b.string(),eventType:ae.b.u8(),errorType:Ia,message:Ia,rawMessage:Ia}),fI=ae.b.struct({deviceId:ae.b.string(),windowId:Ia,paneId:Ia,selectToken:ae.b.bytes(16),wantHistory:ae.b.bool(),cols:$m,rows:$m}),hI=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string()}),pI=ae.b.struct({deviceId:ae.b.string(),name:Ia}),mI=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string()}),gI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string()});ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string(),name:ae.b.string()});const yI=ae.b.struct({deviceId:ae.b.string(),eventType:ae.b.u8(),eventData:ae.b.bytes()}),bI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes(),isComposing:ae.b.bool()}),vI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes(),isComposing:ae.b.bool()}),kN=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),cols:ae.b.u16(),rows:ae.b.u16()}),SI=kN,wI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),encoding:ae.b.u8(),data:ae.b.bytes()}),EI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16),encoding:ae.b.u8(),alternateScreen:ae.b.bool(),data:ae.b.bytes()}),xI=ae.b.struct({deviceId:ae.b.string(),windowId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16)}),RI=ae.b.struct({deviceId:ae.b.string(),paneId:ae.b.string(),selectToken:ae.b.bytes(16)}),LN=ae.b.struct({chunkStreamId:ae.b.u32(),originalKind:ae.b.u16(),originalSeq:ae.b.u32(),totalChunks:ae.b.u16(),chunkIndex:ae.b.u16(),data:ae.b.bytes()}),TI=ae.b.struct({id:ae.b.string(),windowId:ae.b.string(),index:ae.b.u16(),title:Ia,active:ae.b.bool(),width:ae.b.u16(),height:ae.b.u16()}),CI=ae.b.struct({id:ae.b.string(),name:ae.b.string(),index:ae.b.u16(),active:ae.b.bool(),panes:ae.b.vec(TI)}),OI=ae.b.struct({id:ae.b.string(),name:ae.b.string(),windows:ae.b.vec(CI)}),DI=ae.b.struct({deviceId:ae.b.string(),session:ae.b.option(OI)});ae.b.struct({deviceId:ae.b.string(),baseRevision:ae.b.u32(),revision:ae.b.u32(),diffFormat:ae.b.u8(),diffBytes:ae.b.bytes()});const AI=ae.b.struct({windowId:ae.b.string()}),NI=ae.b.struct({windowId:ae.b.string()}),MI=ae.b.struct({windowId:ae.b.string(),name:ae.b.string()}),_I=ae.b.struct({windowId:ae.b.string()}),kI=ae.b.struct({paneId:ae.b.string(),windowId:ae.b.string()}),LI=ae.b.struct({paneId:ae.b.string()}),UI=ae.b.struct({windowId:ae.b.string(),paneId:ae.b.string()}),zI=ae.b.struct({windowId:ae.b.string(),layout:ae.b.string()}),jI=ae.b.struct({windowId:Ia,paneId:Ia,windowIndex:$m,paneIndex:$m,paneUrl:Ia}),Mf=new Uint8Array([84,88]),PI=1;function Um(o,n,a,s=0,l=PI){const c={magic:Mf,version:l,kind:o,flags:s,seq:a,payload:n};return _N.serialize(c)}function hr(o,n){return o.serialize(n)}function HI(o){if(o.length<12)throw new ur(za,!1,"Envelope too small");if(o[0]!==Mf[0]||o[1]!==Mf[1])throw new ur(za,!1,"Invalid magic bytes");try{return _N.deserialize(o)}catch(n){throw new ur(za,!1,n instanceof Error?n.message:"Failed to decode envelope")}}function Ol(o,n){try{return o.deserialize(n)}catch(a){throw new ur(MN,!1,a instanceof Error?a.message:"Failed to decode payload")}}function II(o,n){const a=LN.serialize(o);return Um(1281,a,n)}function BI(o){return LN.deserialize(o)}function VI(o){return o.length>=2&&o[0]===Mf[0]&&o[1]===Mf[1]}const FI=5e3,bD=100,sS=1e3;class YI{constructor(){We(this,"streams",new Map);We(this,"lastCleanup",Date.now())}addChunk(n){if(this.cleanup(),n.totalChunks>sS)throw new ur(za,!1,`Too many chunks: ${n.totalChunks} > ${sS}`);if(n.chunkIndex>=n.totalChunks)throw new ur(za,!1,`Chunk index out of bounds: ${n.chunkIndex} >= ${n.totalChunks}`);let a=this.streams.get(n.chunkStreamId);if(!a){if(this.streams.size>=bD&&(this.cleanup(!0),this.streams.size>=bD))throw new ur(za,!1,"Too many concurrent chunk streams");a={chunks:new Map,totalChunks:n.totalChunks,createdAt:Date.now(),originalKind:n.originalKind,originalSeq:n.originalSeq},this.streams.set(n.chunkStreamId,a)}if(a.totalChunks!==n.totalChunks)throw this.streams.delete(n.chunkStreamId),new ur(za,!1,"Chunk total count mismatch");if(a.chunks.has(n.chunkIndex))throw new ur(za,!1,`Duplicate chunk index: ${n.chunkIndex}`);return a.chunks.set(n.chunkIndex,n),a.chunks.size===a.totalChunks?this.reassemble(n.chunkStreamId,a):null}reassemble(n,a){const s=[];let l=0;for(let h=0;h<a.totalChunks;h++){const g=a.chunks.get(h);if(!g)throw this.streams.delete(n),new ur(za,!1,`Missing chunk index: ${h}`);s.push(g.data),l+=g.data.length}const c=new Uint8Array(l);let f=0;for(const h of s)c.set(h,f),f+=h.length;return this.streams.delete(n),{kind:a.originalKind,seq:a.originalSeq,payload:c}}cleanup(n=!1){const a=Date.now();if(!n&&a-this.lastCleanup<5e3)return;this.lastCleanup=a;const s=a-FI;for(const[l,c]of this.streams)c.createdAt<s&&this.streams.delete(l)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function $I(o,n,a,s){const{maxFrameBytes:l,chunkStreamId:c}=s,f=16,h=18,g=l-f;if(g<=0)throw new ur(Lm,!1,`maxFrameBytes too small: ${l}`);if(o.length<=g)return{chunks:[],totalChunks:0};const m=l-f-h;if(m<=0)throw new ur(Lm,!1,`maxFrameBytes too small for chunking: ${l}`);const b=Math.ceil(o.length/m);if(b>sS)throw new ur(Lm,!1,`Too many chunks: ${b}`);const p=[];for(let v=0;v<b;v++){const w=v*m,E=Math.min(w+m,o.length);p.push({chunkStreamId:c,originalKind:n,originalSeq:a,totalChunks:b,chunkIndex:v,data:o.slice(w,E)})}return{chunks:p,totalChunks:b}}let y0=1;function qI(){const o=y0;return y0=y0%4294967295+1,o}function GI(o){const n=dI.deserialize(o),a={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:n.deviceId,type:a[n.eventType]??"error",errorType:n.errorType??void 0,message:n.message??void 0,rawMessage:n.rawMessage??void 0}}function XI(o){const n=yI.deserialize(o),s={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output"}[n.eventType]??"output";return{deviceId:n.deviceId,type:s,data:QI(s,n.eventData)}}function QI(o,n){if(n.length===0)return{};try{switch(o){case"window-add":return AI.deserialize(n);case"window-close":return NI.deserialize(n);case"window-renamed":return MI.deserialize(n);case"window-active":return _I.deserialize(n);case"pane-add":return kI.deserialize(n);case"pane-close":return LI.deserialize(n);case"pane-active":return UI.deserialize(n);case"layout-change":return zI.deserialize(n);case"bell":{const a=jI.deserialize(n);return{windowId:a.windowId??void 0,paneId:a.paneId??void 0,windowIndex:a.windowIndex??void 0,paneIndex:a.paneIndex??void 0,paneUrl:a.paneUrl??void 0}}default:return{}}}catch{return{}}}function WI(o){const n=DI.deserialize(o);return{deviceId:n.deviceId,session:n.session?KI(n.session):null}}function KI(o){return{id:o.id,name:o.name,windows:o.windows.map(JI)}}function JI(o){return{id:o.id,name:o.name,index:o.index,active:o.active,panes:o.panes.map(ZI)}}function ZI(o){return{id:o.id,windowId:o.windowId,index:o.index,title:o.title??void 0,active:o.active,width:o.width,height:o.height}}function e5(){const o=navigator.language;return o.startsWith("zh")?"zh_CN":o.startsWith("ja")?"ja_JP":$S}lo.use(iH).init({resources:pH,lng:e5(),fallbackLng:$S,interpolation:{escapeValue:!1},returnNull:!1});const t5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,n5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class o5{constructor(n={}){We(this,"ws",null);We(this,"options");We(this,"state","IDLE");We(this,"seq",0);We(this,"chunkReassembler",new YI);We(this,"reconnectAttempts",0);We(this,"reconnectTimer",null);We(this,"heartbeatTimer",null);We(this,"messageHandlers",new Set);We(this,"stateChangeHandlers",new Set);We(this,"errorHandlers",new Set);We(this,"pendingMessages",[]);We(this,"maxPendingMessages",100);this.options={...n5,...n}}setState(n){if(this.state!==n){console.log(`[borsh-client] State: ${this.state} -> ${n}`),this.state=n;for(const a of this.stateChangeHandlers)try{a(n)}catch(s){console.error("[borsh-client] State change handler error:",s)}n==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(n){return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}onStateChange(n){return this.stateChangeHandlers.add(n),()=>this.stateChangeHandlers.delete(n)}onError(n){return this.errorHandlers.add(n),()=>this.errorHandlers.delete(n)}connect(){var n,a;if(!(((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN||((a=this.ws)==null?void 0:a.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(t5),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=s=>{this.handleMessage(s.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(s){this.handleError(s instanceof Error?s:new Error(String(s)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(n){if(typeof n=="string")return;const a=new Uint8Array(n);if(!VI(a)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const s=HI(a);if(s.kind===$H){const l=BI(s.payload),c=this.chunkReassembler.addChunk(l);c&&this.dispatchMessage({kind:c.kind,seq:c.seq,payload:c.payload});return}if(s.kind===wH){this.handleHelloS2C(s.payload);return}if(s.kind===xH)return;this.dispatchMessage({kind:s.kind,seq:s.seq,payload:s.payload})}catch(s){console.error("[borsh-client] Failed to decode message:",s)}}dispatchMessage(n){for(const a of this.messageHandlers)try{a(n)}catch(s){console.error("[borsh-client] Message handler error:",s)}}handleHelloS2C(n){try{const a=Ol(aI,n);console.log("[borsh-client] HELLO_S2C received:",a),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(a){console.error("[borsh-client] Failed to decode HELLO_S2C:",a),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(n){console.error("[borsh-client] Error:",n);for(const a of this.errorHandlers)try{a(n)}catch(s){console.error("[borsh-client] Error handler error:",s)}}sendHello(){const n={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},a=hr(rI,n),s=this.nextSeq(),l=Um(SH,a,s);this.sendRaw(l),this.setState("HELLO_NEGOTIATING")}send(n,a){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:n,payload:a}),!1;const s=this.nextSeq(),l=$I(a,n,s,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:qI()});if(l.totalChunks===0){const c=Um(n,a,s);this.sendRaw(c)}else for(const c of l.chunks){const f=II(c,this.nextSeq());this.sendRaw(f)}return!0}sendRaw(n){var a;((a=this.ws)==null?void 0:a.readyState)===WebSocket.OPEN&&this.ws.send(n)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const n=this.pendingMessages.shift();n&&this.send(n.kind,n.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const n={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},a=hr(sI,n),s=this.nextSeq(),l=Um(EH,a,s);this.sendRaw(l)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const n=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${n}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let b0=null;function lr(){return b0||(b0=new o5),b0}class r5{constructor(n={}){We(this,"transactions",new Map);We(this,"outputGates",new Map);We(this,"deferredHistories",new Map);We(this,"deferredFlushes",new Map);We(this,"deferredOutputs",new Map);We(this,"callbacks");We(this,"ackTimeoutMs",1500);We(this,"liveResumeTimeoutMs",2e3);We(this,"timers",new Map);this.callbacks=n}setCallbacks(n){this.callbacks=n;for(const a of this.transactions.keys())this.replayDeferred(a);for(const a of this.deferredHistories.keys())this.replayDeferred(a);for(const a of this.deferredFlushes.keys())this.replayDeferred(a);for(const a of this.deferredOutputs.keys())this.replayDeferred(a)}getTransaction(n){return this.transactions.get(n)}getState(n){var a;return((a=this.transactions.get(n))==null?void 0:a.state)??"STABLE"}isStable(n){return this.getState(n)==="STABLE"}isBuffering(n){var a;return((a=this.outputGates.get(n))==null?void 0:a.state)==="BUFFERING"}dispatch(n){switch(n.type){case"SELECT_START":this.handleSelectStart(n);break;case"SWITCH_ACK":this.handleSwitchAck(n);break;case"HISTORY":this.handleHistory(n);break;case"LIVE_RESUME":this.handleLiveResume(n);break;case"OUTPUT":this.handleOutput(n);break;case"SELECT_FAILED":this.handleSelectFailed(n);break}}handleSelectStart(n){const{deviceId:a,windowId:s,paneId:l,selectToken:c,wantHistory:f}=n;this.cancelTransaction(a),this.clearDeferred(a);const h={state:"SELECTING",deviceId:a,windowId:s,paneId:l,selectToken:new Uint8Array(c),wantHistory:f,startedAt:Date.now()};this.transactions.set(a,h),this.startOutputBuffering(a),this.setTimer(a,()=>{this.handleTimeout(a,"ack")},this.ackTimeoutMs)}handleSwitchAck(n){var c,f;const{deviceId:a,selectToken:s}=n,l=this.transactions.get(a);!l||!this.validateToken(l.selectToken,s)||l.state==="SELECTING"&&(this.clearTimer(a),l.state="ACKED",(f=(c=this.callbacks).onResetTerminal)==null||f.call(c,a),this.setTimer(a,()=>{this.handleTimeout(a,"live")},this.liveResumeTimeoutMs))}handleHistory(n){const{deviceId:a,selectToken:s,data:l}=n,c=this.transactions.get(a);!c||!this.validateToken(c.selectToken,s)||c.state==="ACKED"&&(c.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(a,l,n.alternateScreen):this.deferredHistories.set(a,{data:l,alternateScreen:n.alternateScreen}),this.setTimer(a,()=>{this.handleTimeout(a,"live")},this.liveResumeTimeoutMs))}handleLiveResume(n){const{deviceId:a,selectToken:s}=n,l=this.transactions.get(a);if(!l||!this.validateToken(l.selectToken,s)||l.state!=="ACKED"&&l.state!=="HISTORY_APPLIED")return;this.clearTimer(a),l.state="LIVE";const c=this.stopOutputBuffering(a);this.completeTransaction(a),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(a,c):c.length>0&&this.deferredFlushes.set(a,c),this.replayDeferred(a)}handleOutput(n){const{deviceId:a,paneId:s,data:l}=n,c=this.transactions.get(a);if(c&&c.paneId!==s)return;if(this.isBuffering(a)){this.bufferOutput(a,l);return}if(this.callbacks.onOutput){this.callbacks.onOutput(a,s,l);return}const f=this.deferredOutputs.get(a)??[];f.push({paneId:s,data:new Uint8Array(l)}),this.deferredOutputs.set(a,f)}handleSelectFailed(n){const{deviceId:a}=n;this.failTransaction(a)}handleTimeout(n,a){console.warn(`[select-sm] Timeout at ${a} for ${n}`),this.failTransaction(n)}completeTransaction(n){const a=this.transactions.get(n);a&&(a.state="STABLE",this.transactions.delete(n))}failTransaction(n){var s,l;const a=this.transactions.get(n);a&&(a.state="SELECT_FAILED",this.stopOutputBuffering(n),(l=(s=this.callbacks).onSelectFailed)==null||l.call(s,n),this.transactions.delete(n),this.clearTimer(n),this.clearDeferred(n))}cancelTransaction(n){this.transactions.get(n)&&(this.stopOutputBuffering(n),this.transactions.delete(n),this.clearTimer(n),this.clearDeferred(n))}startOutputBuffering(n){this.outputGates.set(n,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(n){const a=this.outputGates.get(n);if(!a)return[];const s=[...a.buffer];return this.outputGates.delete(n),s}bufferOutput(n,a){const s=this.outputGates.get(n);s&&(s.buffer.length>=1e3&&s.buffer.shift(),s.buffer.push(new Uint8Array(a)))}validateToken(n,a){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++)if(n[s]!==a[s])return!1;return!0}replayDeferred(n){const a=this.deferredHistories.get(n);a!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(n,a.data,a.alternateScreen),this.deferredHistories.delete(n));const s=this.deferredFlushes.get(n);s&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(n,s),this.deferredFlushes.delete(n));const l=this.deferredOutputs.get(n);if(l&&this.callbacks.onOutput){for(const c of l)this.callbacks.onOutput(n,c.paneId,c.data);this.deferredOutputs.delete(n)}}clearDeferred(n){this.deferredHistories.delete(n),this.deferredFlushes.delete(n),this.deferredOutputs.delete(n)}setTimer(n,a,s){this.clearTimer(n);const l=setTimeout(a,s);this.timers.set(n,l)}clearTimer(n){const a=this.timers.get(n);a&&(clearTimeout(a),this.timers.delete(n))}cleanup(n){this.cancelTransaction(n),this.outputGates.delete(n),this.clearDeferred(n)}cleanupAll(){for(const n of this.transactions.keys())this.cleanup(n);this.transactions.clear(),this.outputGates.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const n of this.timers.values())clearTimeout(n);this.timers.clear()}}let cf=null;function _f(o){return cf?(o&&cf.setCallbacks(o),cf):(cf=new r5(o),cf)}function a5(){return crypto.getRandomValues(new Uint8Array(16))}function UN(o){const n=hr(iI,{deviceId:o});return{kind:TH,payload:n}}function s5(o){const n=hr(cI,{deviceId:o});return{kind:OH,payload:n}}function i5(o){const n=hr(fI,{deviceId:o.deviceId,windowId:o.windowId??null,paneId:o.paneId??null,selectToken:o.selectToken,wantHistory:o.wantHistory,cols:o.cols??null,rows:o.rows??null});return{kind:NH,payload:n}}function l5(o,n){const a=hr(hI,{deviceId:o,windowId:n});return{kind:MH,payload:a}}function c5(o,n){const a=hr(pI,{deviceId:o,name:n??null});return{kind:_H,payload:a}}function u5(o,n){const a=hr(mI,{deviceId:o,windowId:n});return{kind:kH,payload:a}}function d5(o,n){const a=hr(gI,{deviceId:o,paneId:n});return{kind:LH,payload:a}}function f5(o,n,a,s=!1){const l=new TextEncoder,c=hr(bI,{deviceId:o,paneId:n,encoding:2,data:l.encode(a),isComposing:s});return{kind:jH,payload:c}}function h5(o,n,a){const s=new TextEncoder,l=hr(vI,{deviceId:o,paneId:n,encoding:2,data:s.encode(a),isComposing:!1});return{kind:PH,payload:l}}function p5(o,n,a,s){const l=hr(kN,{deviceId:o,paneId:n,cols:a,rows:s});return{kind:HH,payload:l}}function m5(o,n,a,s){const l=hr(SI,{deviceId:o,paneId:n,cols:a,rows:s});return{kind:IH,payload:l}}const vD=o=>{let n;const a=new Set,s=(m,b)=>{const p=typeof m=="function"?m(n):m;if(!Object.is(p,n)){const v=n;n=b??(typeof p!="object"||p===null)?p:Object.assign({},n,p),a.forEach(w=>w(n,v))}},l=()=>n,h={setState:s,getState:l,getInitialState:()=>g,subscribe:m=>(a.add(m),()=>a.delete(m))},g=n=o(s,l,h);return h},g5=(o=>o?vD(o):vD),y5=o=>o;function b5(o,n=y5){const a=_e.useSyncExternalStore(o.subscribe,_e.useCallback(()=>n(o.getState()),[o,n]),_e.useCallback(()=>n(o.getInitialState()),[o,n]));return _e.useDebugValue(a),a}const SD=o=>{const n=g5(o),a=s=>b5(n,s);return Object.assign(a,n),a},qS=(o=>o?SD(o):SD),v0={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,enableBrowserBellToast:!0,enableTelegramBellPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:$S,updatedAt:new Date(0).toISOString()};async function wD(){const o=await fetch("/api/settings/site");if(!o.ok)throw new Error("Failed to load site settings");return(await o.json()).settings}const qm=qS((o,n)=>({settings:null,loading:!1,fetchSettings:async()=>{const a=n().settings;if(a)return a;o({loading:!0});try{const s=await wD();return o({settings:s,loading:!1}),lo.changeLanguage(s.language),s}catch(s){return console.error("[site] failed to fetch settings:",s),o({settings:v0,loading:!1}),lo.changeLanguage(v0.language),v0}},refreshSettings:async()=>{o({loading:!0});try{const a=await wD();return o({settings:a,loading:!1}),lo.changeLanguage(a.language),a}catch(a){throw console.error("[site] failed to refresh settings:",a),o({loading:!1}),a}}})),v5=500,ED=new Map,S0=new Map;function zN(o){const n=Date.now(),a=ED.get(o);return a!==void 0&&n-a<v5?!0:(ED.set(o,n),!1)}let xD=!1;function w0(o,n){if(typeof o!="number"||typeof n!="number")return null;const a=Math.max(2,Math.floor(o)),s=Math.max(2,Math.floor(n));return{cols:a,rows:s}}function S5(o,n){if(xD)return;xD=!0;const a=lr(),s=l=>{const c=n().selectedPanes[l];!c||_f().getTransaction(l)||n().selectPane(l,c.windowId,c.paneId)};a.onStateChange(l=>{o({socketReady:l==="READY"})}),a.onMessage(l=>{const c=_f();switch(l.kind){case CH:{const f=Ol(lI,l.payload);o(h=>({deviceConnected:{...h.deviceConnected,[f.deviceId]:!0},deviceErrors:{...h.deviceErrors,[f.deviceId]:void 0}})),s(f.deviceId);return}case DH:{const f=Ol(uI,l.payload);c.cleanup(f.deviceId),o(h=>({deviceConnected:{...h.deviceConnected,[f.deviceId]:!1}}));return}case AH:{const f=GI(l.payload);w5(o,f),f.type==="reconnected"&&s(f.deviceId);return}case zH:{const f=WI(l.payload);o(h=>({snapshots:{...h.snapshots,[f.deviceId]:f}}));return}case UH:{const f=XI(l.payload);E5(o,f);return}case FH:{const f=Ol(xI,l.payload);c.dispatch({type:"SWITCH_ACK",deviceId:f.deviceId,selectToken:f.selectToken});return}case VH:{const f=Ol(EI,l.payload),h=new TextDecoder().decode(f.data);c.dispatch({type:"HISTORY",deviceId:f.deviceId,selectToken:f.selectToken,data:h,alternateScreen:f.alternateScreen});return}case YH:{const f=Ol(RI,l.payload);c.dispatch({type:"LIVE_RESUME",deviceId:f.deviceId,selectToken:f.selectToken});return}case BH:{const f=Ol(wI,l.payload);c.dispatch({type:"OUTPUT",deviceId:f.deviceId,paneId:f.paneId,data:f.data});return}case RH:return}}),a.onError(l=>{console.error("[tmux] borsh ws error:",l),o({socketReady:!1}),window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:"WebSocket Connection Error",description:"Please check Gateway status"}}))}),a.onStateChange(l=>{if(l!=="READY")return;const c=n().connectedDevices;for(const f of c){if(zN(f))continue;const h=UN(f);a.send(h.kind,h.payload)}})}function w5(o,n){if(n.type==="error"){const a=n.message??"Device Error";o(s=>{const l=s.deviceErrors[n.deviceId];return(l==null?void 0:l.message)===a&&(l==null?void 0:l.type)===n.errorType?{}:{deviceErrors:{...s.deviceErrors,[n.deviceId]:{message:a,type:n.errorType}}}});return}if(n.type==="disconnected"){_f().cleanup(n.deviceId),o(a=>({deviceConnected:{...a.deviceConnected,[n.deviceId]:!1}}));return}n.type==="reconnected"&&o(a=>({deviceConnected:{...a.deviceConnected,[n.deviceId]:!0},deviceErrors:{...a.deviceErrors,[n.deviceId]:void 0}}))}function E5(o,n){if(n.type==="bell"){const a=qm.getState().settings;if((a==null?void 0:a.enableBrowserBellToast)===!1)return;const s=n.data??{},l="Terminal Bell",c=[typeof s.windowIndex=="number"?`Window ${s.windowIndex}`:void 0,typeof s.paneIndex=="number"?`Pane ${s.paneIndex}`:void 0].filter(Boolean).join(" · ");window.dispatchEvent(new CustomEvent("tmex:sonner",{detail:{title:l,description:c||"Received tmux bell",paneUrl:typeof s.paneUrl=="string"?s.paneUrl:void 0}}))}if(n.type==="pane-active"){const a=n.data;a!=null&&a.windowId&&(a!=null&&a.paneId)&&o(s=>({activePaneFromEvent:{...s.activePaneFromEvent,[n.deviceId]:{windowId:a.windowId,paneId:a.paneId}}}))}}const Es=qS((o,n)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},selectedPanes:{},activePaneFromEvent:{},ensureSocketConnected(){S5(o,n),lr().connect()},connectDevice(a){if(!a||(o(l=>{const c=new Set(l.connectedDevices);return c.add(a),{connectedDevices:c}}),n().ensureSocketConnected(),zN(a)))return;const s=UN(a);lr().send(s.kind,s.payload)},disconnectDevice(a){if(!a)return;o(l=>{const c=new Set(l.connectedDevices);return c.delete(a),{connectedDevices:c}}),_f().cleanup(a);const s=s5(a);lr().send(s.kind,s.payload)},clearDeviceError(a){o(s=>({deviceErrors:{...s.deviceErrors,[a]:void 0}}))},selectPane(a,s,l,c){if(!a||!s||!l)return;o(b=>({selectedPanes:{...b.selectedPanes,[a]:{windowId:s,paneId:l}}}));const f=a5(),h=!0;_f().dispatch({type:"SELECT_START",deviceId:a,windowId:s,paneId:l,selectToken:f,wantHistory:h});const g=w0(c==null?void 0:c.cols,c==null?void 0:c.rows)??S0.get(a)??null,m=i5({deviceId:a,windowId:s,paneId:l,selectToken:f,wantHistory:h,cols:g==null?void 0:g.cols,rows:g==null?void 0:g.rows});lr().send(m.kind,m.payload)},selectWindow(a,s){if(!a||!s)return;const l=l5(a,s);lr().send(l.kind,l.payload)},sendInput(a,s,l,c=!1){if(!a||!s)return;const f=f5(a,s,l,c);lr().send(f.kind,f.payload)},resizePane(a,s,l,c){if(!a||!s)return;const f=w0(l,c);f&&S0.set(a,{...f,at:Date.now()});const h=p5(a,s,l,c);lr().send(h.kind,h.payload)},syncPaneSize(a,s,l,c){if(!a||!s)return;const f=w0(l,c);f&&S0.set(a,{...f,at:Date.now()});const h=m5(a,s,l,c);lr().send(h.kind,h.payload)},paste(a,s,l){if(!a||!s)return;const c=h5(a,s,l);lr().send(c.kind,c.payload)},createWindow(a,s){if(!a)return;const l=c5(a,s);lr().send(l.kind,l.payload)},closeWindow(a,s){if(!a||!s)return;const l=u5(a,s);lr().send(l.kind,l.payload)},closePane(a,s){if(!a||!s)return;const l=d5(a,s);lr().send(l.kind,l.payload)}})),RD="tmex:connectedDevices",jN=x.createContext(null);function x5(){const o=x.useContext(jN);if(!o)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return o}function R5({children:o}){const n=Ns(),[a,s]=x.useState(()=>{try{const p=localStorage.getItem(RD);if(p){const v=JSON.parse(p);return new Set(v)}}catch{}return new Set}),l=Es(p=>p.connectDevice),c=Es(p=>p.disconnectDevice),f=Es(p=>p.connectedDevices);x.useEffect(()=>{try{localStorage.setItem(RD,JSON.stringify([...a]))}catch{}},[a]),x.useEffect(()=>{const p=n.pathname.match(/^\/devices\/([^/]+)/),v=p==null?void 0:p[1];v&&!f.has(v)&&l(v)},[n.pathname,f,l]);const h=x.useCallback(p=>{s(v=>{const w=new Set(v);return w.add(p),w}),f.has(p)||l(p)},[f,l]),g=x.useCallback(p=>{s(v=>{const w=new Set(v);return w.delete(p),w}),f.has(p)&&c(p)},[f,c]),m=x.useCallback((p,v)=>{v?g(p):h(p)},[h,g]),b=x.useMemo(()=>({persistedDevices:a,connectDevice:h,disconnectDevice:g,toggleDevice:m}),[a,h,g,m]);return re.jsxDEV(jN.Provider,{value:b,children:o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/global-device-provider.tsx",lineNumber:117,columnNumber:10},this)}/**
322
322
  * @license lucide-react v0.564.0 - ISC
323
323
  *
324
324
  * This source code is licensed under the ISC license.
@@ -416,10 +416,10 @@ Bot:{{botName}}
416
416
  */const Q5=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],IN=ta("x",Q5),CD={};function mr(o,n){const a=x.useRef(CD);return a.current===CD&&(a.current=o(n)),a}const E0=NS[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],W5=E0&&E0!==x.useLayoutEffect?E0:o=>o();function st(o){const n=mr(K5).current;return n.next=o,W5(n.effect),n.trampoline}function K5(){const o={next:void 0,callback:J5,trampoline:(...n)=>{var a;return(a=o.callback)==null?void 0:a.call(o,...n)},effect:()=>{o.callback=o.next}};return o}function J5(){throw new Error("Base UI: Cannot call an event handler while rendering.")}function kf(o,n,a,s){const l=mr(BN).current;return eB(l,o,n,a,s)&&VN(l,[o,n,a,s]),l.callback}function Z5(o){const n=mr(BN).current;return tB(n,o)&&VN(n,o),n.callback}function BN(){return{callback:null,cleanup:null,refs:[]}}function eB(o,n,a,s,l){return o.refs[0]!==n||o.refs[1]!==a||o.refs[2]!==s||o.refs[3]!==l}function tB(o,n){return o.refs.length!==n.length||o.refs.some((a,s)=>a!==n[s])}function VN(o,n){if(o.refs=n,n.every(a=>a==null)){o.callback=null;return}o.callback=a=>{if(o.cleanup&&(o.cleanup(),o.cleanup=null),a!=null){const s=Array(n.length).fill(null);for(let l=0;l<n.length;l+=1){const c=n[l];if(c!=null)switch(typeof c){case"function":{const f=c(a);typeof f=="function"&&(s[l]=f);break}case"object":{c.current=a;break}}}o.cleanup=()=>{for(let l=0;l<n.length;l+=1){const c=n[l];if(c!=null)switch(typeof c){case"function":{const f=s[l];typeof f=="function"?f():c(null);break}case"object":{c.current=null;break}}}}}}}const nB=parseInt(x.version,10);function GS(o){return nB>=o}function OD(o){if(!x.isValidElement(o))return null;const n=o,a=n.props;return(GS(19)?a==null?void 0:a.ref:n.ref)??null}function iS(o,n){if(o&&!n)return o;if(!o&&n)return n;if(o||n)return{...o,...n}}function oB(o,n){const a={};for(const s in o){const l=o[s];if(n!=null&&n.hasOwnProperty(s)){const c=n[s](l);c!=null&&Object.assign(a,c);continue}l===!0?a[`data-${s.toLowerCase()}`]="":l&&(a[`data-${s.toLowerCase()}`]=l.toString())}return a}function rB(o,n){return typeof o=="function"?o(n):o}function aB(o,n){return typeof o=="function"?o(n):o}const wf={};function Ql(o,n,a,s,l){let c={...lS(o,wf)};return n&&(c=yf(c,n)),a&&(c=yf(c,a)),s&&(c=yf(c,s)),l&&(c=yf(c,l)),c}function sB(o){if(o.length===0)return wf;if(o.length===1)return lS(o[0],wf);let n={...lS(o[0],wf)};for(let a=1;a<o.length;a+=1)n=yf(n,o[a]);return n}function yf(o,n){return FN(n)?n(o):iB(o,n)}function iB(o,n){if(!n)return o;for(const a in n){const s=n[a];switch(a){case"style":{o[a]=iS(o.style,s);break}case"className":{o[a]=YN(o.className,s);break}default:lB(a,s)?o[a]=cB(o[a],s):o[a]=s}}return o}function lB(o,n){const a=o.charCodeAt(0),s=o.charCodeAt(1),l=o.charCodeAt(2);return a===111&&s===110&&l>=65&&l<=90&&(typeof n=="function"||typeof n>"u")}function FN(o){return typeof o=="function"}function lS(o,n){return FN(o)?o(n):o??wf}function cB(o,n){return n?o?a=>{if(uB(a)){const l=a;cS(l);const c=n(l);return l.baseUIHandlerPrevented||o==null||o(l),c}const s=n(a);return o==null||o(a),s}:n:o}function cS(o){return o.preventBaseUIHandler=()=>{o.baseUIHandlerPrevented=!0},o}function YN(o,n){return n?o?n+" "+o:n:o}function uB(o){return o!=null&&typeof o=="object"&&"nativeEvent"in o}function $N(){}const TY=Object.freeze([]),fr=Object.freeze({}),CY=500,OY=500,dB={style:{transition:"none"}},fB="data-base-ui-click-trigger",DY={fallbackAxisSide:"none"},hB={fallbackAxisSide:"end"},pB={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ln(o,n,a={}){const s=n.render,l=mB(n,a);if(a.enabled===!1)return null;const c=a.state??fr;return yB(o,s,l,c)}function mB(o,n={}){const{className:a,style:s,render:l}=o,{state:c=fr,ref:f,props:h,stateAttributesMapping:g,enabled:m=!0}=n,b=m?rB(a,c):void 0,p=m?aB(s,c):void 0,v=m?oB(c,g):fr,w=m?iS(v,Array.isArray(h)?sB(h):h)??fr:fr;return typeof document<"u"&&(m?Array.isArray(f)?w.ref=Z5([w.ref,OD(l),...f]):w.ref=kf(w.ref,OD(l),f):kf(null,null)),m?(b!==void 0&&(w.className=YN(w.className,b)),p!==void 0&&(w.style=iS(w.style,p)),w):fr}const gB=Symbol.for("react.lazy");function yB(o,n,a,s){if(n){if(typeof n=="function")return n(a,s);const l=Ql(a,n.props);l.ref=a.ref;let c=n;if((c==null?void 0:c.$$typeof)===gB&&(c=x.Children.toArray(n)[0]),!x.isValidElement(c))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
417
417
  `));return x.cloneElement(c,l)}if(o&&typeof o=="string")return bB(o,a);throw new Error("Base UI: Render element or function are not defined.")}function bB(o,n){return o==="button"?x.createElement("button",{type:"button",...n,key:n.key}):o==="img"?x.createElement("img",{alt:"",...n,key:n.key}):x.createElement(o,n)}function vB({controlled:o,default:n,name:a,state:s="value"}){const{current:l}=x.useRef(o!==void 0),[c,f]=x.useState(n),h=l?o:c;{x.useEffect(()=>{l!==(o!==void 0)&&console.error([`Base UI: A component is changing the ${l?"":"un"}controlled ${s} state of ${a} to be ${l?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
418
418
  `))},[s,a,o]);const{current:m}=x.useRef(n);x.useEffect(()=>{!l&&JSON.stringify(m)!==JSON.stringify(n)&&console.error([`Base UI: A component is changing the default ${s} state of an uncontrolled ${a} after being initialized. To suppress this warning opt to use a controlled ${a}.`].join(`
419
- `))},[JSON.stringify(n)])}const g=x.useCallback(m=>{l||f(m)},[]);return[h,g]}const SB=()=>{},pt=typeof document<"u"?x.useLayoutEffect:SB,Dl={...NS};let DD=0;function wB(o,n="mui"){const[a,s]=x.useState(o),l=o||a;return x.useEffect(()=>{a==null&&(DD+=1,s(`${n}-${DD}`))},[a,n]),l}const AD=Dl.useId;function wu(o,n){if(AD!==void 0){const a=AD();return o??(n?`${n}-${a}`:a)}return wB(o,n)}function Xf(o){return wu(o,"base-ui")}const fg="none",Lf="trigger-press",Zr="trigger-hover",zm="trigger-focus",qN="outside-press",AY="item-press",EB="close-press",GN="focus-out",XS="escape-key",NY="list-navigation",MY="cancel-open",_Y="sibling-open",xB="disabled",XN="imperative-action",kY="window-resize";function yn(o,n,a,s){let l=!1,c=!1;const f=fr;return{reason:o,event:n??new Event("base-ui"),cancel(){l=!0},allowPropagation(){c=!0},get isCanceled(){return l},get isPropagationAllowed(){return c},trigger:a,...f}}const RB=[];function hg(o){x.useEffect(o,RB)}const vm=null;let ND=globalThis.requestAnimationFrame;class TB{constructor(){We(this,"callbacks",[]);We(this,"callbacksCount",0);We(this,"nextId",1);We(this,"startId",1);We(this,"isScheduled",!1);We(this,"tick",n=>{var l;this.isScheduled=!1;const a=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let c=0;c<a.length;c+=1)(l=a[c])==null||l.call(a,n)})}request(n){const a=this.nextId;this.nextId+=1,this.callbacks.push(n),this.callbacksCount+=1;const s=ND!==requestAnimationFrame&&(ND=requestAnimationFrame,!0);return(!this.isScheduled||s)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(n){const a=n-this.startId;a<0||a>=this.callbacks.length||(this.callbacks[a]=null,this.callbacksCount-=1)}}const Sm=new TB;class Nn{constructor(){We(this,"currentId",vm);We(this,"cancel",()=>{this.currentId!==vm&&(Sm.cancel(this.currentId),this.currentId=vm)});We(this,"disposeEffect",()=>this.cancel)}static create(){return new Nn}static request(n){return Sm.request(n)}static cancel(n){return Sm.cancel(n)}request(n){this.cancel(),this.currentId=Sm.request(()=>{this.currentId=vm,n()})}}function QS(){const o=mr(Nn.create).current;return hg(o.disposeEffect),o}function ws(o){return o==null?o:"current"in o?o.current:o}let $l=(function(o){return o.startingStyle="data-starting-style",o.endingStyle="data-ending-style",o})({});const CB={[$l.startingStyle]:""},OB={[$l.endingStyle]:""},Qf={transitionStatus(o){return o==="starting"?CB:o==="ending"?OB:null}};function QN(o,n=!1,a=!0){const s=QS();return st((l,c=null)=>{s.cancel();function f(){zi.flushSync(l)}const h=ws(o);if(h==null)return;const g=h;if(typeof g.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)l();else{let m=function(){const p=$l.startingStyle;if(!g.hasAttribute(p)){s.request(b);return}const v=new MutationObserver(()=>{g.hasAttribute(p)||(v.disconnect(),b())});v.observe(g,{attributes:!0,attributeFilter:[p]}),c==null||c.addEventListener("abort",()=>v.disconnect(),{once:!0})},b=function(){Promise.all(g.getAnimations().map(p=>p.finished)).then(()=>{c!=null&&c.aborted||f()}).catch(()=>{const p=g.getAnimations();if(a){if(c!=null&&c.aborted)return;f()}else p.length>0&&p.some(v=>v.pending||v.playState!=="finished")&&b()})};if(n){m();return}s.request(b)}})}function WN(o,n=!1,a=!1){const[s,l]=x.useState(o&&n?"idle":void 0),[c,f]=x.useState(o);return o&&!c&&(f(!0),l("starting")),!o&&c&&s!=="ending"&&!a&&l("ending"),!o&&!c&&s==="ending"&&l(void 0),pt(()=>{if(!o&&c&&s!=="ending"&&a){const h=Nn.request(()=>{l("ending")});return()=>{Nn.cancel(h)}}},[o,c,s,a]),pt(()=>{if(!o||n)return;const h=Nn.request(()=>{l(void 0)});return()=>{Nn.cancel(h)}},[n,o]),pt(()=>{if(!o||!n)return;o&&c&&s!=="idle"&&l("starting");const h=Nn.request(()=>{l("idle")});return()=>{Nn.cancel(h)}},[n,o,c,l,s]),x.useMemo(()=>({mounted:c,setMounted:f,transitionStatus:s}),[c,s])}function DB(o){const{open:n,defaultOpen:a,onOpenChange:s,disabled:l}=o,c=n!==void 0,[f,h]=vB({controlled:n,default:a,name:"Collapsible",state:"open"}),{mounted:g,setMounted:m,transitionStatus:b}=WN(f,!0,!0),[p,v]=x.useState(f),[{height:w,width:E},T]=x.useState({height:void 0,width:void 0}),C=Xf(),[A,k]=x.useState(),U=A??C,[M,Y]=x.useState(!1),[$,_]=x.useState(!1),z=x.useRef(null),te=x.useRef(null),H=x.useRef(null),J=x.useRef(null),N=QN(J,!1),P=st(ne=>{const Z=!f,j=yn(Lf,ne.nativeEvent);if(s(Z,j),j.isCanceled)return;const oe=J.current;te.current==="css-animation"&&oe!=null&&oe.style.removeProperty("animation-name"),!M&&!$&&(te.current!=null&&te.current!=="css-animation"&&!g&&Z&&m(!0),te.current==="css-animation"&&(!p&&Z&&v(!0),!g&&Z&&m(!0))),h(Z),te.current==="none"&&g&&!Z&&m(!1)});return pt(()=>{c&&te.current==="none"&&!$&&!f&&m(!1)},[c,$,f,n,m]),x.useMemo(()=>({abortControllerRef:z,animationTypeRef:te,disabled:l,handleTrigger:P,height:w,mounted:g,open:f,panelId:U,panelRef:J,runOnceAnimationsFinish:N,setDimensions:T,setHiddenUntilFound:Y,setKeepMounted:_,setMounted:m,setOpen:h,setPanelIdState:k,setVisible:v,transitionDimensionRef:H,transitionStatus:b,visible:p,width:E}),[z,te,l,P,w,g,f,U,J,N,T,Y,_,m,h,v,H,b,p,E])}const WS=x.createContext(void 0);WS.displayName="CollapsibleRootContext";function KN(){const o=x.useContext(WS);if(o===void 0)throw new Error("Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");return o}let Ef=(function(o){return o.open="data-open",o.closed="data-closed",o[o.startingStyle=$l.startingStyle]="startingStyle",o[o.endingStyle=$l.endingStyle]="endingStyle",o})({}),AB=(function(o){return o.panelOpen="data-panel-open",o})({});const NB={[Ef.open]:""},MB={[Ef.closed]:""},_B={open(o){return o?{[AB.panelOpen]:""}:null}},kB={open(o){return o?NB:MB}},JN={...kB,...Qf},ZN=x.forwardRef(function(n,a){const{render:s,className:l,defaultOpen:c=!1,disabled:f=!1,onOpenChange:h,open:g,...m}=n,b=st(h),p=DB({open:g,defaultOpen:c,onOpenChange:b,disabled:f}),v=x.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),w=x.useMemo(()=>({...p,onOpenChange:b,state:v}),[p,b,v]),E=Ln("div",n,{state:v,ref:a,props:m,stateAttributesMapping:JN});return nn.jsx(WS.Provider,{value:w,children:E})});ZN.displayName="CollapsibleRoot";function pg(){return typeof window<"u"}function ji(o){return KS(o)?(o.nodeName||"").toLowerCase():"#document"}function Gn(o){var n;return(o==null||(n=o.ownerDocument)==null?void 0:n.defaultView)||window}function Ya(o){var n;return(n=(KS(o)?o.ownerDocument:o.document)||window.document)==null?void 0:n.documentElement}function KS(o){return pg()?o instanceof Node||o instanceof Gn(o).Node:!1}function qt(o){return pg()?o instanceof Element||o instanceof Gn(o).Element:!1}function $n(o){return pg()?o instanceof HTMLElement||o instanceof Gn(o).HTMLElement:!1}function uS(o){return!pg()||typeof ShadowRoot>"u"?!1:o instanceof ShadowRoot||o instanceof Gn(o).ShadowRoot}const LB=new Set(["inline","contents"]);function Pi(o){const{overflow:n,overflowX:a,overflowY:s,display:l}=pr(o);return/auto|scroll|overlay|hidden|clip/.test(n+s+a)&&!LB.has(l)}const UB=new Set(["table","td","th"]);function zB(o){return UB.has(ji(o))}const jB=[":popover-open",":modal"];function mg(o){return jB.some(n=>{try{return o.matches(n)}catch{return!1}})}const PB=["transform","translate","scale","rotate","perspective"],HB=["transform","translate","scale","rotate","perspective","filter"],IB=["paint","layout","strict","content"];function JS(o){const n=gg(),a=qt(o)?pr(o):o;return PB.some(s=>a[s]?a[s]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!n&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!n&&(a.filter?a.filter!=="none":!1)||HB.some(s=>(a.willChange||"").includes(s))||IB.some(s=>(a.contain||"").includes(s))}function BB(o){let n=Os(o);for(;$n(n)&&!Cs(n);){if(JS(n))return n;if(mg(n))return null;n=Os(n)}return null}function gg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const VB=new Set(["html","body","#document"]);function Cs(o){return VB.has(ji(o))}function pr(o){return Gn(o).getComputedStyle(o)}function yg(o){return qt(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function Os(o){if(ji(o)==="html")return o;const n=o.assignedSlot||o.parentNode||uS(o)&&o.host||Ya(o);return uS(n)?n.host:n}function eM(o){const n=Os(o);return Cs(n)?o.ownerDocument?o.ownerDocument.body:o.body:$n(n)&&Pi(n)?n:eM(n)}function Li(o,n,a){var s;n===void 0&&(n=[]),a===void 0&&(a=!0);const l=eM(o),c=l===((s=o.ownerDocument)==null?void 0:s.body),f=Gn(l);if(c){const h=dS(f);return n.concat(f,f.visualViewport||[],Pi(l)?l:[],h&&a?Li(h):[])}return n.concat(l,Li(l,[],a))}function dS(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}let fS;fS=new Set;function MD(...o){{const n=o.join(" ");fS.has(n)||(fS.add(n),console.error(`Base UI: ${n}`))}}const tM=x.createContext(void 0);tM.displayName="CompositeRootContext";function FB(o=!1){const n=x.useContext(tM);if(n===void 0&&!o)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return n}function YB(o){const{focusableWhenDisabled:n,disabled:a,composite:s=!1,tabIndex:l=0,isNativeButton:c}=o,f=s&&n!==!1,h=s&&n===!1;return{props:x.useMemo(()=>{const m={onKeyDown(b){a&&n&&b.key!=="Tab"&&b.preventDefault()}};return s||(m.tabIndex=l,!c&&a&&(m.tabIndex=n?l:-1)),(c&&(n||f)||!c&&a)&&(m["aria-disabled"]=a),c&&(!n||h)&&(m.disabled=a),m},[s,a,n,f,h,c,l])}}function ZS(o={}){const{disabled:n=!1,focusableWhenDisabled:a,tabIndex:s=0,native:l=!0}=o,c=x.useRef(null),f=FB(!0)!==void 0,h=st(()=>{const v=c.current;return!!((v==null?void 0:v.tagName)==="A"&&(v!=null&&v.href))}),{props:g}=YB({focusableWhenDisabled:a,disabled:n,composite:f,tabIndex:s,isNativeButton:l});x.useEffect(()=>{var w,E;if(!c.current)return;const v=c.current.tagName==="BUTTON";if(l){if(!v){const T=((w=Dl.captureOwnerStack)==null?void 0:w.call(Dl))||"";MD(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${T}`)}}else if(v){const T=((E=Dl.captureOwnerStack)==null?void 0:E.call(Dl))||"";MD(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${T}`)}},[l]);const m=x.useCallback(()=>{const v=c.current;$B(v)&&f&&n&&g.disabled===void 0&&v.disabled&&(v.disabled=!1)},[n,g.disabled,f]);pt(m,[m]);const b=x.useCallback((v={})=>{const{onClick:w,onMouseDown:E,onKeyUp:T,onKeyDown:C,onPointerDown:A,...k}=v;return Ql({type:l?"button":void 0,onClick(M){if(n){M.preventDefault();return}w==null||w(M)},onMouseDown(M){n||E==null||E(M)},onKeyDown(M){if(n||(cS(M),C==null||C(M)),M.baseUIHandlerPrevented)return;const Y=M.target===M.currentTarget&&!l&&!h()&&!n,$=M.key==="Enter",_=M.key===" ";Y&&((_||$)&&M.preventDefault(),$&&(w==null||w(M)))},onKeyUp(M){n||(cS(M),T==null||T(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!l&&!n&&M.key===" "&&(w==null||w(M))},onPointerDown(M){if(n){M.preventDefault();return}A==null||A(M)}},l?void 0:{role:"button"},g,k)},[n,g,l,h]),p=st(v=>{c.current=v,m()});return{getButtonProps:b,buttonRef:p}}function $B(o){return $n(o)&&o.tagName==="BUTTON"}const qB={..._B,...Qf},nM=x.forwardRef(function(n,a){const{panelId:s,open:l,handleTrigger:c,state:f,disabled:h}=KN(),{className:g,disabled:m=h,id:b,render:p,nativeButton:v=!0,...w}=n,{getButtonProps:E,buttonRef:T}=ZS({disabled:m,focusableWhenDisabled:!0,native:v}),C=x.useMemo(()=>({"aria-controls":l?s:void 0,"aria-expanded":l,onClick:c}),[s,l,c]);return Ln("button",n,{state:f,ref:[a,T],props:[C,w,E],stateAttributesMapping:qB})});nM.displayName="CollapsibleTrigger";let hS;hS=new Set;function oM(...o){{const n=o.join(" ");hS.has(n)||(hS.add(n),console.warn(`Base UI: ${n}`))}}let GB=(function(o){return o.disabled="data-disabled",o.orientation="data-orientation",o})({});function XB(o){const{abortControllerRef:n,animationTypeRef:a,externalRef:s,height:l,hiddenUntilFound:c,keepMounted:f,id:h,mounted:g,onOpenChange:m,open:b,panelRef:p,runOnceAnimationsFinish:v,setDimensions:w,setMounted:E,setOpen:T,setVisible:C,transitionDimensionRef:A,visible:k,width:U}=o,M=x.useRef(!1),Y=x.useRef(null),$=x.useRef(b),_=x.useRef(b),z=QS(),te=x.useMemo(()=>a.current==="css-animation"?!k:!b&&!g,[b,g,k,a]),H=st(N=>{if(!N)return;if(a.current==null||A.current==null){const Z=getComputedStyle(N),j=Z.animationName!=="none"&&Z.animationName!=="",oe=Z.transitionDuration!=="0s"&&Z.transitionDuration!=="";j&&oe?oM("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):Z.animationName==="none"&&Z.transitionDuration!=="0s"?a.current="css-transition":Z.animationName!=="none"&&Z.transitionDuration==="0s"?a.current="css-animation":a.current="none",N.getAttribute(GB.orientation)==="horizontal"||Z.transitionProperty.indexOf("width")>-1?A.current="width":A.current="height"}if(a.current!=="css-transition")return;(l===void 0||U===void 0)&&(w({height:N.scrollHeight,width:N.scrollWidth}),_.current&&N.style.setProperty("transition-duration","0s"));let P=-1,ne=-1;return P=Nn.request(()=>{_.current=!1,ne=Nn.request(()=>{setTimeout(()=>{N.style.removeProperty("transition-duration")})})}),()=>{Nn.cancel(P),Nn.cancel(ne)}}),J=kf(s,p,H);return pt(()=>{if(a.current!=="css-transition")return;const N=p.current;if(!N)return;let P=-1;if(n.current!=null&&(n.current.abort(),n.current=null),b){const ne={"justify-content":N.style.justifyContent,"align-items":N.style.alignItems,"align-content":N.style.alignContent,"justify-items":N.style.justifyItems};Object.keys(ne).forEach(Z=>{N.style.setProperty(Z,"initial","important")}),!_.current&&!f&&N.setAttribute(Ef.startingStyle,""),w({height:N.scrollHeight,width:N.scrollWidth}),P=Nn.request(()=>{Object.entries(ne).forEach(([Z,j])=>{j===""?N.style.removeProperty(Z):N.style.setProperty(Z,j)})})}else{if(N.scrollHeight===0&&N.scrollWidth===0)return;w({height:N.scrollHeight,width:N.scrollWidth});const ne=new AbortController;n.current=ne;const Z=ne.signal;let j=null;const oe=Ef.endingStyle;return j=new MutationObserver(I=>{I.some(pe=>pe.type==="attributes"&&pe.attributeName===oe)&&(j==null||j.disconnect(),j=null,v(()=>{w({height:0,width:0}),N.style.removeProperty("content-visibility"),E(!1),n.current===ne&&(n.current=null)},Z))}),j.observe(N,{attributes:!0,attributeFilter:[oe]}),()=>{j==null||j.disconnect(),z.cancel(),n.current===ne&&(ne.abort(),n.current=null)}}return()=>{Nn.cancel(P)}},[n,a,z,c,f,g,b,p,v,w,E]),pt(()=>{if(a.current!=="css-animation")return;const N=p.current;N&&(Y.current=N.style.animationName||Y.current,N.style.setProperty("animation-name","none"),w({height:N.scrollHeight,width:N.scrollWidth}),!$.current&&!M.current&&N.style.removeProperty("animation-name"),b?(n.current!=null&&(n.current.abort(),n.current=null),E(!0),C(!0)):(n.current=new AbortController,v(()=>{E(!1),C(!1),n.current=null},n.current.signal)))},[n,a,b,p,v,w,E,C,k]),hg(()=>{const N=Nn.request(()=>{$.current=!1});return()=>Nn.cancel(N)}),pt(()=>{if(!c)return;const N=p.current;if(!N)return;let P=-1,ne=-1;return b&&M.current&&(N.style.transitionDuration="0s",w({height:N.scrollHeight,width:N.scrollWidth}),P=Nn.request(()=>{M.current=!1,ne=Nn.request(()=>{setTimeout(()=>{N.style.removeProperty("transition-duration")})})})),()=>{Nn.cancel(P),Nn.cancel(ne)}},[c,b,p,w]),pt(()=>{const N=p.current;N&&c&&te&&(N.setAttribute("hidden","until-found"),a.current==="css-transition"&&N.setAttribute(Ef.startingStyle,""))},[c,te,a,p]),x.useEffect(function(){const P=p.current;if(!P)return;function ne(Z){M.current=!0,T(!0),m(!0,yn(fg,Z))}return P.addEventListener("beforematch",ne),()=>{P.removeEventListener("beforematch",ne)}},[m,p,T]),x.useMemo(()=>({props:{hidden:te,id:h,ref:J}}),[te,h,J])}let _D=(function(o){return o.collapsiblePanelHeight="--collapsible-panel-height",o.collapsiblePanelWidth="--collapsible-panel-width",o})({});function bg(o){const{enabled:n=!0,open:a,ref:s,onComplete:l}=o,c=st(l),f=QN(s,a,!1);x.useEffect(()=>{if(!n)return;const h=new AbortController;return f(c,h.signal),()=>{h.abort()}},[n,a,c,f])}const rM=x.forwardRef(function(n,a){const{className:s,hiddenUntilFound:l,keepMounted:c,render:f,id:h,...g}=n;pt(()=>{l&&c===!1&&oM("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[l,c]);const{abortControllerRef:m,animationTypeRef:b,height:p,mounted:v,onOpenChange:w,open:E,panelId:T,panelRef:C,runOnceAnimationsFinish:A,setDimensions:k,setHiddenUntilFound:U,setKeepMounted:M,setMounted:Y,setPanelIdState:$,setOpen:_,setVisible:z,state:te,transitionDimensionRef:H,visible:J,width:N,transitionStatus:P}=KN(),ne=l??!1,Z=c??!1;pt(()=>{if(h)return $(h),()=>{$(void 0)}},[h,$]),pt(()=>{U(ne)},[U,ne]),pt(()=>{M(Z)},[M,Z]);const{props:j}=XB({abortControllerRef:m,animationTypeRef:b,externalRef:a,height:p,hiddenUntilFound:ne,id:T,keepMounted:Z,mounted:v,onOpenChange:w,open:E,panelRef:C,runOnceAnimationsFinish:A,setDimensions:k,setMounted:Y,setOpen:_,setVisible:z,transitionDimensionRef:H,visible:J,width:N});bg({open:E&&P==="idle",ref:C,onComplete(){E&&k({height:void 0,width:void 0})}});const oe=x.useMemo(()=>({...te,transitionStatus:P}),[te,P]),I=Ln("div",n,{state:oe,ref:[a,C],props:[j,{style:{[_D.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[_D.collapsiblePanelWidth]:N===void 0?"auto":`${N}px`}},g],stateAttributesMapping:JN});return Z||ne||!Z&&v?I:null});rM.displayName="CollapsiblePanel";function QB({...o}){return re.jsxDEV(ZN,{"data-slot":"collapsible",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:4,columnNumber:10},this)}function WB({...o}){return re.jsxDEV(nM,{"data-slot":"collapsible-trigger",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:9,columnNumber:5},this)}function KB({...o}){return re.jsxDEV(rM,{"data-slot":"collapsible-content",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:15,columnNumber:5},this)}function Wf(o){return Ln(o.defaultTagName??"div",o,o)}function aM(o){var n,a,s="";if(typeof o=="string"||typeof o=="number")s+=o;else if(typeof o=="object")if(Array.isArray(o)){var l=o.length;for(n=0;n<l;n++)o[n]&&(a=aM(o[n]))&&(s&&(s+=" "),s+=a)}else for(a in o)o[a]&&(s&&(s+=" "),s+=a);return s}function sM(){for(var o,n,a=0,s="",l=arguments.length;a<l;a++)(o=arguments[a])&&(n=aM(o))&&(s&&(s+=" "),s+=n);return s}const kD=o=>typeof o=="boolean"?`${o}`:o===0?"0":o,LD=sM,ew=(o,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return LD(o,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:l,defaultVariants:c}=n,f=Object.keys(l).map(m=>{const b=a==null?void 0:a[m],p=c==null?void 0:c[m];if(b===null)return null;const v=kD(b)||kD(p);return l[m][v]}),h=a&&Object.entries(a).reduce((m,b)=>{let[p,v]=b;return v===void 0||(m[p]=v),m},{}),g=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((m,b)=>{let{class:p,className:v,...w}=b;return Object.entries(w).every(E=>{let[T,C]=E;return Array.isArray(C)?C.includes({...c,...h}[T]):{...c,...h}[T]===C})?[...m,p,v]:m},[]);return LD(o,f,g,a==null?void 0:a.class,a==null?void 0:a.className)},x0=768;function JB(){const[o,n]=x.useState(void 0);return x.useEffect(()=>{const a=window.matchMedia(`(max-width: ${x0-1}px)`),s=()=>{n(window.innerWidth<x0)};return a.addEventListener("change",s),n(window.innerWidth<x0),()=>a.removeEventListener("change",s)},[]),!!o}const ZB=(o,n)=>{const a=new Array(o.length+n.length);for(let s=0;s<o.length;s++)a[s]=o[s];for(let s=0;s<n.length;s++)a[o.length+s]=n[s];return a},e6=(o,n)=>({classGroupId:o,validator:n}),iM=(o=new Map,n=null,a)=>({nextPart:o,validators:n,classGroupId:a}),Gm="-",UD=[],t6="arbitrary..",n6=o=>{const n=r6(o),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=o;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return o6(f);const h=f.split(Gm),g=h[0]===""&&h.length>1?1:0;return lM(h,g,n)},getConflictingClassGroupIds:(f,h)=>{if(h){const g=s[f],m=a[f];return g?m?ZB(m,g):g:m||UD}return a[f]||UD}}},lM=(o,n,a)=>{if(o.length-n===0)return a.classGroupId;const l=o[n],c=a.nextPart.get(l);if(c){const m=lM(o,n+1,c);if(m)return m}const f=a.validators;if(f===null)return;const h=n===0?o.join(Gm):o.slice(n).join(Gm),g=f.length;for(let m=0;m<g;m++){const b=f[m];if(b.validator(h))return b.classGroupId}},o6=o=>o.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=o.slice(1,-1),a=n.indexOf(":"),s=n.slice(0,a);return s?t6+s:void 0})(),r6=o=>{const{theme:n,classGroups:a}=o;return a6(a,n)},a6=(o,n)=>{const a=iM();for(const s in o){const l=o[s];tw(l,a,s,n)}return a},tw=(o,n,a,s)=>{const l=o.length;for(let c=0;c<l;c++){const f=o[c];s6(f,n,a,s)}},s6=(o,n,a,s)=>{if(typeof o=="string"){i6(o,n,a);return}if(typeof o=="function"){l6(o,n,a,s);return}c6(o,n,a,s)},i6=(o,n,a)=>{const s=o===""?n:cM(n,o);s.classGroupId=a},l6=(o,n,a,s)=>{if(u6(o)){tw(o(s),n,a,s);return}n.validators===null&&(n.validators=[]),n.validators.push(e6(a,o))},c6=(o,n,a,s)=>{const l=Object.entries(o),c=l.length;for(let f=0;f<c;f++){const[h,g]=l[f];tw(g,cM(n,h),a,s)}},cM=(o,n)=>{let a=o;const s=n.split(Gm),l=s.length;for(let c=0;c<l;c++){const f=s[c];let h=a.nextPart.get(f);h||(h=iM(),a.nextPart.set(f,h)),a=h}return a},u6=o=>"isThemeGetter"in o&&o.isThemeGetter===!0,d6=o=>{if(o<1)return{get:()=>{},set:()=>{}};let n=0,a=Object.create(null),s=Object.create(null);const l=(c,f)=>{a[c]=f,n++,n>o&&(n=0,s=a,a=Object.create(null))};return{get(c){let f=a[c];if(f!==void 0)return f;if((f=s[c])!==void 0)return l(c,f),f},set(c,f){c in a?a[c]=f:l(c,f)}}},pS="!",zD=":",f6=[],jD=(o,n,a,s,l)=>({modifiers:o,hasImportantModifier:n,baseClassName:a,maybePostfixModifierPosition:s,isExternal:l}),h6=o=>{const{prefix:n,experimentalParseClassName:a}=o;let s=l=>{const c=[];let f=0,h=0,g=0,m;const b=l.length;for(let T=0;T<b;T++){const C=l[T];if(f===0&&h===0){if(C===zD){c.push(l.slice(g,T)),g=T+1;continue}if(C==="/"){m=T;continue}}C==="["?f++:C==="]"?f--:C==="("?h++:C===")"&&h--}const p=c.length===0?l:l.slice(g);let v=p,w=!1;p.endsWith(pS)?(v=p.slice(0,-1),w=!0):p.startsWith(pS)&&(v=p.slice(1),w=!0);const E=m&&m>g?m-g:void 0;return jD(c,w,v,E)};if(n){const l=n+zD,c=s;s=f=>f.startsWith(l)?c(f.slice(l.length)):jD(f6,!1,f,void 0,!0)}if(a){const l=s;s=c=>a({className:c,parseClassName:l})}return s},p6=o=>{const n=new Map;return o.orderSensitiveModifiers.forEach((a,s)=>{n.set(a,1e6+s)}),a=>{const s=[];let l=[];for(let c=0;c<a.length;c++){const f=a[c],h=f[0]==="[",g=n.has(f);h||g?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(f)):l.push(f)}return l.length>0&&(l.sort(),s.push(...l)),s}},m6=o=>({cache:d6(o.cacheSize),parseClassName:h6(o),sortModifiers:p6(o),...n6(o)}),g6=/\s+/,y6=(o,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:c}=n,f=[],h=o.trim().split(g6);let g="";for(let m=h.length-1;m>=0;m-=1){const b=h[m],{isExternal:p,modifiers:v,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:T}=a(b);if(p){g=b+(g.length>0?" "+g:g);continue}let C=!!T,A=s(C?E.substring(0,T):E);if(!A){if(!C){g=b+(g.length>0?" "+g:g);continue}if(A=s(E),!A){g=b+(g.length>0?" "+g:g);continue}C=!1}const k=v.length===0?"":v.length===1?v[0]:c(v).join(":"),U=w?k+pS:k,M=U+A;if(f.indexOf(M)>-1)continue;f.push(M);const Y=l(A,C);for(let $=0;$<Y.length;++$){const _=Y[$];f.push(U+_)}g=b+(g.length>0?" "+g:g)}return g},b6=(...o)=>{let n=0,a,s,l="";for(;n<o.length;)(a=o[n++])&&(s=uM(a))&&(l&&(l+=" "),l+=s);return l},uM=o=>{if(typeof o=="string")return o;let n,a="";for(let s=0;s<o.length;s++)o[s]&&(n=uM(o[s]))&&(a&&(a+=" "),a+=n);return a},v6=(o,...n)=>{let a,s,l,c;const f=g=>{const m=n.reduce((b,p)=>p(b),o());return a=m6(m),s=a.cache.get,l=a.cache.set,c=h,h(g)},h=g=>{const m=s(g);if(m)return m;const b=y6(g,a);return l(g,b),b};return c=f,(...g)=>c(b6(...g))},S6=[],Jn=o=>{const n=a=>a[o]||S6;return n.isThemeGetter=!0,n},dM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,w6=/^\d+\/\d+$/,E6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,x6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,T6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jc=o=>w6.test(o),At=o=>!!o&&!Number.isNaN(Number(o)),vi=o=>!!o&&Number.isInteger(Number(o)),R0=o=>o.endsWith("%")&&At(o.slice(0,-1)),bs=o=>E6.test(o),O6=()=>!0,D6=o=>x6.test(o)&&!R6.test(o),hM=()=>!1,A6=o=>T6.test(o),N6=o=>C6.test(o),M6=o=>!qe(o)&&!Ge(o),_6=o=>Eu(o,gM,hM),qe=o=>dM.test(o),Cl=o=>Eu(o,yM,D6),T0=o=>Eu(o,j6,At),PD=o=>Eu(o,pM,hM),k6=o=>Eu(o,mM,N6),wm=o=>Eu(o,bM,A6),Ge=o=>fM.test(o),uf=o=>xu(o,yM),L6=o=>xu(o,P6),HD=o=>xu(o,pM),U6=o=>xu(o,gM),z6=o=>xu(o,mM),Em=o=>xu(o,bM,!0),Eu=(o,n,a)=>{const s=dM.exec(o);return s?s[1]?n(s[1]):a(s[2]):!1},xu=(o,n,a=!1)=>{const s=fM.exec(o);return s?s[1]?n(s[1]):a:!1},pM=o=>o==="position"||o==="percentage",mM=o=>o==="image"||o==="url",gM=o=>o==="length"||o==="size"||o==="bg-size",yM=o=>o==="length",j6=o=>o==="number",P6=o=>o==="family-name",bM=o=>o==="shadow",H6=()=>{const o=Jn("color"),n=Jn("font"),a=Jn("text"),s=Jn("font-weight"),l=Jn("tracking"),c=Jn("leading"),f=Jn("breakpoint"),h=Jn("container"),g=Jn("spacing"),m=Jn("radius"),b=Jn("shadow"),p=Jn("inset-shadow"),v=Jn("text-shadow"),w=Jn("drop-shadow"),E=Jn("blur"),T=Jn("perspective"),C=Jn("aspect"),A=Jn("ease"),k=Jn("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...M(),Ge,qe],$=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],z=()=>[Ge,qe,g],te=()=>[Jc,"full","auto",...z()],H=()=>[vi,"none","subgrid",Ge,qe],J=()=>["auto",{span:["full",vi,Ge,qe]},vi,Ge,qe],N=()=>[vi,"auto",Ge,qe],P=()=>["auto","min","max","fr",Ge,qe],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...z()],oe=()=>[Jc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],I=()=>[o,Ge,qe],ie=()=>[...M(),HD,PD,{position:[Ge,qe]}],pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",U6,_6,{size:[Ge,qe]}],ce=()=>[R0,uf,Cl],ae=()=>["","none","full",m,Ge,qe],me=()=>["",At,uf,Cl],Te=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[At,R0,HD,PD],ze=()=>["","none",E,Ge,qe],je=()=>["none",At,Ge,qe],at=()=>["none",At,Ge,qe],xe=()=>[At,Ge,qe],he=()=>[Jc,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bs],breakpoint:[bs],color:[O6],container:[bs],"drop-shadow":[bs],ease:["in","out","in-out"],font:[M6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bs],shadow:[bs],spacing:["px",At],text:[bs],"text-shadow":[bs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jc,qe,Ge,C]}],container:["container"],columns:[{columns:[At,qe,Ge,h]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",Ge,qe]}],basis:[{basis:[Jc,"full","auto",h,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Jc,"auto","initial","none",qe]}],grow:[{grow:["",At,Ge,qe]}],shrink:[{shrink:["",At,Ge,qe]}],order:[{order:[vi,"first","last","none",Ge,qe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],w:[{w:[h,"screen",...oe()]}],"min-w":[{"min-w":[h,"screen","none",...oe()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",a,uf,Cl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ge,T0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",R0,qe]}],"font-family":[{font:[L6,qe,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ge,qe]}],"line-clamp":[{"line-clamp":[At,"none",Ge,T0]}],leading:[{leading:[c,...z()]}],"list-image":[{"list-image":["none",Ge,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Te(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ge,Cl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[At,"auto",Ge,qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,Ge,qe],radial:["",Ge,qe],conic:[vi,Ge,qe]},z6,k6]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Te(),"hidden","none"]}],"divide-style":[{divide:[...Te(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ge,qe]}],"outline-w":[{outline:["",At,uf,Cl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",b,Em,wm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",p,Em,wm]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[At,Cl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",v,Em,wm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[At,Ge,qe]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ge,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,qe]}],filter:[{filter:["","none",Ge,qe]}],blur:[{blur:ze()}],brightness:[{brightness:[At,Ge,qe]}],contrast:[{contrast:[At,Ge,qe]}],"drop-shadow":[{"drop-shadow":["","none",w,Em,wm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",At,Ge,qe]}],"hue-rotate":[{"hue-rotate":[At,Ge,qe]}],invert:[{invert:["",At,Ge,qe]}],saturate:[{saturate:[At,Ge,qe]}],sepia:[{sepia:["",At,Ge,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,qe]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ge,qe]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ge,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ge,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ge,qe]}],"backdrop-invert":[{"backdrop-invert":["",At,Ge,qe]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ge,qe]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ge,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ge,qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ge,qe]}],ease:[{ease:["linear","initial",A,Ge,qe]}],delay:[{delay:[At,Ge,qe]}],animate:[{animate:["none",k,Ge,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Ge,qe]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Ge,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge,qe]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[At,uf,Cl,T0]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},I6=v6(H6);function jt(...o){return I6(sM(o))}const vM=x.forwardRef(function(n,a){const{render:s,className:l,disabled:c=!1,focusableWhenDisabled:f=!1,nativeButton:h=!0,...g}=n,{getButtonProps:m,buttonRef:b}=ZS({disabled:c,focusableWhenDisabled:f,native:h});return Ln("button",n,{state:{disabled:c},ref:[a,b],props:[g,m]})});vM.displayName="Button";const B6=ew("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function nw({className:o,variant:n="default",size:a="default",...s}){return re.jsxDEV(vM,{"data-slot":"button",className:jt(B6({variant:n,size:a,className:o})),...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/button.tsx",lineNumber:43,columnNumber:5},this)}const df=0;class Fa{constructor(){We(this,"currentId",df);We(this,"clear",()=>{this.currentId!==df&&(clearTimeout(this.currentId),this.currentId=df)});We(this,"disposeEffect",()=>this.clear)}static create(){return new Fa}start(n,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=df,a()},n)}isStarted(){return this.currentId!==df}}function Ds(){const o=mr(Fa.create).current;return hg(o.disposeEffect),o}function fn(o){return(o==null?void 0:o.ownerDocument)||document}const Ru=typeof navigator<"u",C0=F6(),SM=$6(),wM=Y6(),ow=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),EM=C0.platform==="MacIntel"&&C0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(C0.platform),xM=Ru&&/apple/i.test(navigator.vendor),mS=Ru&&/android/i.test(SM)||/android/i.test(wM),V6=Ru&&SM.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,RM=wM.includes("jsdom/");function F6(){if(!Ru)return{platform:"",maxTouchPoints:-1};const o=navigator.userAgentData;return o!=null&&o.platform?{platform:o.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Y6(){if(!Ru)return"";const o=navigator.userAgentData;return o&&Array.isArray(o.brands)?o.brands.map(({brand:n,version:a})=>`${n}/${a}`).join(" "):navigator.userAgent}function $6(){if(!Ru)return"";const o=navigator.userAgentData;return o!=null&&o.platform?o.platform:navigator.platform??""}const gS="data-base-ui-focusable",TM="active",CM="selected",OM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",LY="ArrowLeft",UY="ArrowRight",zY="ArrowUp",jY="ArrowDown";function xs(o){var a;let n=o.activeElement;for(;((a=n==null?void 0:n.shadowRoot)==null?void 0:a.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function Yt(o,n){var s;if(!o||!n)return!1;const a=(s=n.getRootNode)==null?void 0:s.call(n);if(o.contains(n))return!0;if(a&&uS(a)){let l=n;for(;l;){if(o===l)return!0;l=l.parentNode||l.host}}return!1}function Xm(o,n){if(!qt(o))return!1;const a=o;if(n.hasElement(a))return!a.hasAttribute("data-trigger-disabled");for(const[,s]of n.entries())if(Yt(s,a))return!s.hasAttribute("data-trigger-disabled");return!1}function qo(o){return"composedPath"in o?o.composedPath()[0]:o.target}function Wr(o,n){if(n==null)return!1;if("composedPath"in o)return o.composedPath().includes(n);const a=o;return a.target!=null&&n.contains(a.target)}function q6(o){return o.matches("html,body")}function rw(o){return $n(o)&&o.matches(OM)}function ID(o){return o?o.getAttribute("role")==="combobox"&&rw(o):!1}function G6(o){if(!o||RM)return!0;try{return o.matches(":focus-visible")}catch{return!0}}function yS(o){return o?o.hasAttribute(gS)?o:o.querySelector(`[${gS}]`)||o:null}function Vl(o,n,a=!0){return o.filter(l=>{var c;return l.parentId===n&&(!a||((c=l.context)==null?void 0:c.open))}).flatMap(l=>[l,...Vl(o,l.id,a)])}function BD(o,n){var l;let a=[],s=(l=o.find(c=>c.id===n))==null?void 0:l.parentId;for(;s;){const c=o.find(f=>f.id===s);s=c==null?void 0:c.parentId,c&&(a=a.concat(c))}return a}function X6(o){o.preventDefault(),o.stopPropagation()}function Q6(o){return"nativeEvent"in o}function W6(o){return o.pointerType===""&&o.isTrusted?!0:mS&&o.pointerType?o.type==="click"&&o.buttons===1:o.detail===0&&!o.pointerType}function K6(o){return RM?!1:!mS&&o.width===0&&o.height===0||mS&&o.width===1&&o.height===1&&o.pressure===0&&o.detail===0&&o.pointerType==="mouse"||o.width<1&&o.height<1&&o.pressure===0&&o.detail===0&&o.pointerType==="touch"}function Uf(o,n){const a=["mouse","pen"];return n||a.push("",void 0),a.includes(o)}function J6(o){const n=o.type;return n==="click"||n==="mousedown"||n==="keydown"||n==="keyup"}const Z6=["top","right","bottom","left"],bu=Math.min,dr=Math.max,Qm=Math.round,xm=Math.floor,Ba=o=>({x:o,y:o}),e8={left:"right",right:"left",bottom:"top",top:"bottom"},t8={start:"end",end:"start"};function bS(o,n,a){return dr(o,bu(n,a))}function As(o,n){return typeof o=="function"?o(n):o}function Go(o){return o.split("-")[0]}function Hi(o){return o.split("-")[1]}function aw(o){return o==="x"?"y":"x"}function sw(o){return o==="y"?"height":"width"}const n8=new Set(["top","bottom"]);function Lr(o){return n8.has(Go(o))?"y":"x"}function iw(o){return aw(Lr(o))}function o8(o,n,a){a===void 0&&(a=!1);const s=Hi(o),l=iw(o),c=sw(l);let f=l==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(f=Wm(f)),[f,Wm(f)]}function r8(o){const n=Wm(o);return[vS(o),n,vS(n)]}function vS(o){return o.replace(/start|end/g,n=>t8[n])}const VD=["left","right"],FD=["right","left"],a8=["top","bottom"],s8=["bottom","top"];function i8(o,n,a){switch(o){case"top":case"bottom":return a?n?FD:VD:n?VD:FD;case"left":case"right":return n?a8:s8;default:return[]}}function l8(o,n,a,s){const l=Hi(o);let c=i8(Go(o),a==="start",s);return l&&(c=c.map(f=>f+"-"+l),n&&(c=c.concat(c.map(vS)))),c}function Wm(o){return o.replace(/left|right|bottom|top/g,n=>e8[n])}function c8(o){return{top:0,right:0,bottom:0,left:0,...o}}function DM(o){return typeof o!="number"?c8(o):{top:o,right:o,bottom:o,left:o}}function Km(o){const{x:n,y:a,width:s,height:l}=o;return{width:s,height:l,top:a,left:n,right:n+s,bottom:a+l,x:n,y:a}}/*!
419
+ `))},[JSON.stringify(n)])}const g=x.useCallback(m=>{l||f(m)},[]);return[h,g]}const SB=()=>{},pt=typeof document<"u"?x.useLayoutEffect:SB,Dl={...NS};let DD=0;function wB(o,n="mui"){const[a,s]=x.useState(o),l=o||a;return x.useEffect(()=>{a==null&&(DD+=1,s(`${n}-${DD}`))},[a,n]),l}const AD=Dl.useId;function wu(o,n){if(AD!==void 0){const a=AD();return o??(n?`${n}-${a}`:a)}return wB(o,n)}function Xf(o){return wu(o,"base-ui")}const fg="none",Lf="trigger-press",Zr="trigger-hover",zm="trigger-focus",qN="outside-press",AY="item-press",EB="close-press",GN="focus-out",XS="escape-key",NY="list-navigation",MY="cancel-open",_Y="sibling-open",xB="disabled",XN="imperative-action",kY="window-resize";function yn(o,n,a,s){let l=!1,c=!1;const f=fr;return{reason:o,event:n??new Event("base-ui"),cancel(){l=!0},allowPropagation(){c=!0},get isCanceled(){return l},get isPropagationAllowed(){return c},trigger:a,...f}}const RB=[];function hg(o){x.useEffect(o,RB)}const vm=null;let ND=globalThis.requestAnimationFrame;class TB{constructor(){We(this,"callbacks",[]);We(this,"callbacksCount",0);We(this,"nextId",1);We(this,"startId",1);We(this,"isScheduled",!1);We(this,"tick",n=>{var l;this.isScheduled=!1;const a=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let c=0;c<a.length;c+=1)(l=a[c])==null||l.call(a,n)})}request(n){const a=this.nextId;this.nextId+=1,this.callbacks.push(n),this.callbacksCount+=1;const s=ND!==requestAnimationFrame&&(ND=requestAnimationFrame,!0);return(!this.isScheduled||s)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),a}cancel(n){const a=n-this.startId;a<0||a>=this.callbacks.length||(this.callbacks[a]=null,this.callbacksCount-=1)}}const Sm=new TB;class Nn{constructor(){We(this,"currentId",vm);We(this,"cancel",()=>{this.currentId!==vm&&(Sm.cancel(this.currentId),this.currentId=vm)});We(this,"disposeEffect",()=>this.cancel)}static create(){return new Nn}static request(n){return Sm.request(n)}static cancel(n){return Sm.cancel(n)}request(n){this.cancel(),this.currentId=Sm.request(()=>{this.currentId=vm,n()})}}function QS(){const o=mr(Nn.create).current;return hg(o.disposeEffect),o}function ws(o){return o==null?o:"current"in o?o.current:o}let $l=(function(o){return o.startingStyle="data-starting-style",o.endingStyle="data-ending-style",o})({});const CB={[$l.startingStyle]:""},OB={[$l.endingStyle]:""},Qf={transitionStatus(o){return o==="starting"?CB:o==="ending"?OB:null}};function QN(o,n=!1,a=!0){const s=QS();return st((l,c=null)=>{s.cancel();function f(){zi.flushSync(l)}const h=ws(o);if(h==null)return;const g=h;if(typeof g.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)l();else{let m=function(){const p=$l.startingStyle;if(!g.hasAttribute(p)){s.request(b);return}const v=new MutationObserver(()=>{g.hasAttribute(p)||(v.disconnect(),b())});v.observe(g,{attributes:!0,attributeFilter:[p]}),c==null||c.addEventListener("abort",()=>v.disconnect(),{once:!0})},b=function(){Promise.all(g.getAnimations().map(p=>p.finished)).then(()=>{c!=null&&c.aborted||f()}).catch(()=>{const p=g.getAnimations();if(a){if(c!=null&&c.aborted)return;f()}else p.length>0&&p.some(v=>v.pending||v.playState!=="finished")&&b()})};if(n){m();return}s.request(b)}})}function WN(o,n=!1,a=!1){const[s,l]=x.useState(o&&n?"idle":void 0),[c,f]=x.useState(o);return o&&!c&&(f(!0),l("starting")),!o&&c&&s!=="ending"&&!a&&l("ending"),!o&&!c&&s==="ending"&&l(void 0),pt(()=>{if(!o&&c&&s!=="ending"&&a){const h=Nn.request(()=>{l("ending")});return()=>{Nn.cancel(h)}}},[o,c,s,a]),pt(()=>{if(!o||n)return;const h=Nn.request(()=>{l(void 0)});return()=>{Nn.cancel(h)}},[n,o]),pt(()=>{if(!o||!n)return;o&&c&&s!=="idle"&&l("starting");const h=Nn.request(()=>{l("idle")});return()=>{Nn.cancel(h)}},[n,o,c,l,s]),x.useMemo(()=>({mounted:c,setMounted:f,transitionStatus:s}),[c,s])}function DB(o){const{open:n,defaultOpen:a,onOpenChange:s,disabled:l}=o,c=n!==void 0,[f,h]=vB({controlled:n,default:a,name:"Collapsible",state:"open"}),{mounted:g,setMounted:m,transitionStatus:b}=WN(f,!0,!0),[p,v]=x.useState(f),[{height:w,width:E},T]=x.useState({height:void 0,width:void 0}),C=Xf(),[A,k]=x.useState(),U=A??C,[M,Y]=x.useState(!1),[$,_]=x.useState(!1),z=x.useRef(null),te=x.useRef(null),H=x.useRef(null),J=x.useRef(null),N=QN(J,!1),P=st(ne=>{const Z=!f,j=yn(Lf,ne.nativeEvent);if(s(Z,j),j.isCanceled)return;const oe=J.current;te.current==="css-animation"&&oe!=null&&oe.style.removeProperty("animation-name"),!M&&!$&&(te.current!=null&&te.current!=="css-animation"&&!g&&Z&&m(!0),te.current==="css-animation"&&(!p&&Z&&v(!0),!g&&Z&&m(!0))),h(Z),te.current==="none"&&g&&!Z&&m(!1)});return pt(()=>{c&&te.current==="none"&&!$&&!f&&m(!1)},[c,$,f,n,m]),x.useMemo(()=>({abortControllerRef:z,animationTypeRef:te,disabled:l,handleTrigger:P,height:w,mounted:g,open:f,panelId:U,panelRef:J,runOnceAnimationsFinish:N,setDimensions:T,setHiddenUntilFound:Y,setKeepMounted:_,setMounted:m,setOpen:h,setPanelIdState:k,setVisible:v,transitionDimensionRef:H,transitionStatus:b,visible:p,width:E}),[z,te,l,P,w,g,f,U,J,N,T,Y,_,m,h,v,H,b,p,E])}const WS=x.createContext(void 0);WS.displayName="CollapsibleRootContext";function KN(){const o=x.useContext(WS);if(o===void 0)throw new Error("Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>.");return o}let Ef=(function(o){return o.open="data-open",o.closed="data-closed",o[o.startingStyle=$l.startingStyle]="startingStyle",o[o.endingStyle=$l.endingStyle]="endingStyle",o})({}),AB=(function(o){return o.panelOpen="data-panel-open",o})({});const NB={[Ef.open]:""},MB={[Ef.closed]:""},_B={open(o){return o?{[AB.panelOpen]:""}:null}},kB={open(o){return o?NB:MB}},JN={...kB,...Qf},ZN=x.forwardRef(function(n,a){const{render:s,className:l,defaultOpen:c=!1,disabled:f=!1,onOpenChange:h,open:g,...m}=n,b=st(h),p=DB({open:g,defaultOpen:c,onOpenChange:b,disabled:f}),v=x.useMemo(()=>({open:p.open,disabled:p.disabled,transitionStatus:p.transitionStatus}),[p.open,p.disabled,p.transitionStatus]),w=x.useMemo(()=>({...p,onOpenChange:b,state:v}),[p,b,v]),E=Ln("div",n,{state:v,ref:a,props:m,stateAttributesMapping:JN});return nn.jsx(WS.Provider,{value:w,children:E})});ZN.displayName="CollapsibleRoot";function pg(){return typeof window<"u"}function ji(o){return KS(o)?(o.nodeName||"").toLowerCase():"#document"}function Gn(o){var n;return(o==null||(n=o.ownerDocument)==null?void 0:n.defaultView)||window}function Ya(o){var n;return(n=(KS(o)?o.ownerDocument:o.document)||window.document)==null?void 0:n.documentElement}function KS(o){return pg()?o instanceof Node||o instanceof Gn(o).Node:!1}function qt(o){return pg()?o instanceof Element||o instanceof Gn(o).Element:!1}function $n(o){return pg()?o instanceof HTMLElement||o instanceof Gn(o).HTMLElement:!1}function uS(o){return!pg()||typeof ShadowRoot>"u"?!1:o instanceof ShadowRoot||o instanceof Gn(o).ShadowRoot}const LB=new Set(["inline","contents"]);function Pi(o){const{overflow:n,overflowX:a,overflowY:s,display:l}=pr(o);return/auto|scroll|overlay|hidden|clip/.test(n+s+a)&&!LB.has(l)}const UB=new Set(["table","td","th"]);function zB(o){return UB.has(ji(o))}const jB=[":popover-open",":modal"];function mg(o){return jB.some(n=>{try{return o.matches(n)}catch{return!1}})}const PB=["transform","translate","scale","rotate","perspective"],HB=["transform","translate","scale","rotate","perspective","filter"],IB=["paint","layout","strict","content"];function JS(o){const n=gg(),a=qt(o)?pr(o):o;return PB.some(s=>a[s]?a[s]!=="none":!1)||(a.containerType?a.containerType!=="normal":!1)||!n&&(a.backdropFilter?a.backdropFilter!=="none":!1)||!n&&(a.filter?a.filter!=="none":!1)||HB.some(s=>(a.willChange||"").includes(s))||IB.some(s=>(a.contain||"").includes(s))}function BB(o){let n=Os(o);for(;$n(n)&&!Cs(n);){if(JS(n))return n;if(mg(n))return null;n=Os(n)}return null}function gg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const VB=new Set(["html","body","#document"]);function Cs(o){return VB.has(ji(o))}function pr(o){return Gn(o).getComputedStyle(o)}function yg(o){return qt(o)?{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}:{scrollLeft:o.scrollX,scrollTop:o.scrollY}}function Os(o){if(ji(o)==="html")return o;const n=o.assignedSlot||o.parentNode||uS(o)&&o.host||Ya(o);return uS(n)?n.host:n}function eM(o){const n=Os(o);return Cs(n)?o.ownerDocument?o.ownerDocument.body:o.body:$n(n)&&Pi(n)?n:eM(n)}function Li(o,n,a){var s;n===void 0&&(n=[]),a===void 0&&(a=!0);const l=eM(o),c=l===((s=o.ownerDocument)==null?void 0:s.body),f=Gn(l);if(c){const h=dS(f);return n.concat(f,f.visualViewport||[],Pi(l)?l:[],h&&a?Li(h):[])}return n.concat(l,Li(l,[],a))}function dS(o){return o.parent&&Object.getPrototypeOf(o.parent)?o.frameElement:null}let fS;fS=new Set;function MD(...o){{const n=o.join(" ");fS.has(n)||(fS.add(n),console.error(`Base UI: ${n}`))}}const tM=x.createContext(void 0);tM.displayName="CompositeRootContext";function FB(o=!1){const n=x.useContext(tM);if(n===void 0&&!o)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return n}function YB(o){const{focusableWhenDisabled:n,disabled:a,composite:s=!1,tabIndex:l=0,isNativeButton:c}=o,f=s&&n!==!1,h=s&&n===!1;return{props:x.useMemo(()=>{const m={onKeyDown(b){a&&n&&b.key!=="Tab"&&b.preventDefault()}};return s||(m.tabIndex=l,!c&&a&&(m.tabIndex=n?l:-1)),(c&&(n||f)||!c&&a)&&(m["aria-disabled"]=a),c&&(!n||h)&&(m.disabled=a),m},[s,a,n,f,h,c,l])}}function ZS(o={}){const{disabled:n=!1,focusableWhenDisabled:a,tabIndex:s=0,native:l=!0}=o,c=x.useRef(null),f=FB(!0)!==void 0,h=st(()=>{const v=c.current;return!!((v==null?void 0:v.tagName)==="A"&&(v!=null&&v.href))}),{props:g}=YB({focusableWhenDisabled:a,disabled:n,composite:f,tabIndex:s,isNativeButton:l});x.useEffect(()=>{var w,E;if(!c.current)return;const v=c.current.tagName==="BUTTON";if(l){if(!v){const T=((w=Dl.captureOwnerStack)==null?void 0:w.call(Dl))||"";MD(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${T}`)}}else if(v){const T=((E=Dl.captureOwnerStack)==null?void 0:E.call(Dl))||"";MD(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${T}`)}},[l]);const m=x.useCallback(()=>{const v=c.current;$B(v)&&f&&n&&g.disabled===void 0&&v.disabled&&(v.disabled=!1)},[n,g.disabled,f]);pt(m,[m]);const b=x.useCallback((v={})=>{const{onClick:w,onMouseDown:E,onKeyUp:T,onKeyDown:C,onPointerDown:A,...k}=v;return Ql({type:l?"button":void 0,onClick(M){if(n){M.preventDefault();return}w==null||w(M)},onMouseDown(M){n||E==null||E(M)},onKeyDown(M){if(n||(cS(M),C==null||C(M)),M.baseUIHandlerPrevented)return;const Y=M.target===M.currentTarget&&!l&&!h()&&!n,$=M.key==="Enter",_=M.key===" ";Y&&((_||$)&&M.preventDefault(),$&&(w==null||w(M)))},onKeyUp(M){n||(cS(M),T==null||T(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!l&&!n&&M.key===" "&&(w==null||w(M))},onPointerDown(M){if(n){M.preventDefault();return}A==null||A(M)}},l?void 0:{role:"button"},g,k)},[n,g,l,h]),p=st(v=>{c.current=v,m()});return{getButtonProps:b,buttonRef:p}}function $B(o){return $n(o)&&o.tagName==="BUTTON"}const qB={..._B,...Qf},nM=x.forwardRef(function(n,a){const{panelId:s,open:l,handleTrigger:c,state:f,disabled:h}=KN(),{className:g,disabled:m=h,id:b,render:p,nativeButton:v=!0,...w}=n,{getButtonProps:E,buttonRef:T}=ZS({disabled:m,focusableWhenDisabled:!0,native:v}),C=x.useMemo(()=>({"aria-controls":l?s:void 0,"aria-expanded":l,onClick:c}),[s,l,c]);return Ln("button",n,{state:f,ref:[a,T],props:[C,w,E],stateAttributesMapping:qB})});nM.displayName="CollapsibleTrigger";let hS;hS=new Set;function oM(...o){{const n=o.join(" ");hS.has(n)||(hS.add(n),console.warn(`Base UI: ${n}`))}}let GB=(function(o){return o.disabled="data-disabled",o.orientation="data-orientation",o})({});function XB(o){const{abortControllerRef:n,animationTypeRef:a,externalRef:s,height:l,hiddenUntilFound:c,keepMounted:f,id:h,mounted:g,onOpenChange:m,open:b,panelRef:p,runOnceAnimationsFinish:v,setDimensions:w,setMounted:E,setOpen:T,setVisible:C,transitionDimensionRef:A,visible:k,width:U}=o,M=x.useRef(!1),Y=x.useRef(null),$=x.useRef(b),_=x.useRef(b),z=QS(),te=x.useMemo(()=>a.current==="css-animation"?!k:!b&&!g,[b,g,k,a]),H=st(N=>{if(!N)return;if(a.current==null||A.current==null){const Z=getComputedStyle(N),j=Z.animationName!=="none"&&Z.animationName!=="",oe=Z.transitionDuration!=="0s"&&Z.transitionDuration!=="";j&&oe?oM("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.","Only one of either animation type should be used."):Z.animationName==="none"&&Z.transitionDuration!=="0s"?a.current="css-transition":Z.animationName!=="none"&&Z.transitionDuration==="0s"?a.current="css-animation":a.current="none",N.getAttribute(GB.orientation)==="horizontal"||Z.transitionProperty.indexOf("width")>-1?A.current="width":A.current="height"}if(a.current!=="css-transition")return;(l===void 0||U===void 0)&&(w({height:N.scrollHeight,width:N.scrollWidth}),_.current&&N.style.setProperty("transition-duration","0s"));let P=-1,ne=-1;return P=Nn.request(()=>{_.current=!1,ne=Nn.request(()=>{setTimeout(()=>{N.style.removeProperty("transition-duration")})})}),()=>{Nn.cancel(P),Nn.cancel(ne)}}),J=kf(s,p,H);return pt(()=>{if(a.current!=="css-transition")return;const N=p.current;if(!N)return;let P=-1;if(n.current!=null&&(n.current.abort(),n.current=null),b){const ne={"justify-content":N.style.justifyContent,"align-items":N.style.alignItems,"align-content":N.style.alignContent,"justify-items":N.style.justifyItems};Object.keys(ne).forEach(Z=>{N.style.setProperty(Z,"initial","important")}),!_.current&&!f&&N.setAttribute(Ef.startingStyle,""),w({height:N.scrollHeight,width:N.scrollWidth}),P=Nn.request(()=>{Object.entries(ne).forEach(([Z,j])=>{j===""?N.style.removeProperty(Z):N.style.setProperty(Z,j)})})}else{if(N.scrollHeight===0&&N.scrollWidth===0)return;w({height:N.scrollHeight,width:N.scrollWidth});const ne=new AbortController;n.current=ne;const Z=ne.signal;let j=null;const oe=Ef.endingStyle;return j=new MutationObserver(I=>{I.some(pe=>pe.type==="attributes"&&pe.attributeName===oe)&&(j==null||j.disconnect(),j=null,v(()=>{w({height:0,width:0}),N.style.removeProperty("content-visibility"),E(!1),n.current===ne&&(n.current=null)},Z))}),j.observe(N,{attributes:!0,attributeFilter:[oe]}),()=>{j==null||j.disconnect(),z.cancel(),n.current===ne&&(ne.abort(),n.current=null)}}return()=>{Nn.cancel(P)}},[n,a,z,c,f,g,b,p,v,w,E]),pt(()=>{if(a.current!=="css-animation")return;const N=p.current;N&&(Y.current=N.style.animationName||Y.current,N.style.setProperty("animation-name","none"),w({height:N.scrollHeight,width:N.scrollWidth}),!$.current&&!M.current&&N.style.removeProperty("animation-name"),b?(n.current!=null&&(n.current.abort(),n.current=null),E(!0),C(!0)):(n.current=new AbortController,v(()=>{E(!1),C(!1),n.current=null},n.current.signal)))},[n,a,b,p,v,w,E,C,k]),hg(()=>{const N=Nn.request(()=>{$.current=!1});return()=>Nn.cancel(N)}),pt(()=>{if(!c)return;const N=p.current;if(!N)return;let P=-1,ne=-1;return b&&M.current&&(N.style.transitionDuration="0s",w({height:N.scrollHeight,width:N.scrollWidth}),P=Nn.request(()=>{M.current=!1,ne=Nn.request(()=>{setTimeout(()=>{N.style.removeProperty("transition-duration")})})})),()=>{Nn.cancel(P),Nn.cancel(ne)}},[c,b,p,w]),pt(()=>{const N=p.current;N&&c&&te&&(N.setAttribute("hidden","until-found"),a.current==="css-transition"&&N.setAttribute(Ef.startingStyle,""))},[c,te,a,p]),x.useEffect(function(){const P=p.current;if(!P)return;function ne(Z){M.current=!0,T(!0),m(!0,yn(fg,Z))}return P.addEventListener("beforematch",ne),()=>{P.removeEventListener("beforematch",ne)}},[m,p,T]),x.useMemo(()=>({props:{hidden:te,id:h,ref:J}}),[te,h,J])}let _D=(function(o){return o.collapsiblePanelHeight="--collapsible-panel-height",o.collapsiblePanelWidth="--collapsible-panel-width",o})({});function bg(o){const{enabled:n=!0,open:a,ref:s,onComplete:l}=o,c=st(l),f=QN(s,a,!1);x.useEffect(()=>{if(!n)return;const h=new AbortController;return f(c,h.signal),()=>{h.abort()}},[n,a,c,f])}const rM=x.forwardRef(function(n,a){const{className:s,hiddenUntilFound:l,keepMounted:c,render:f,id:h,...g}=n;pt(()=>{l&&c===!1&&oM("The `keepMounted={false}` prop on a Collapsible will be ignored when using `hiddenUntilFound` since it requires the Panel to remain mounted even when closed.")},[l,c]);const{abortControllerRef:m,animationTypeRef:b,height:p,mounted:v,onOpenChange:w,open:E,panelId:T,panelRef:C,runOnceAnimationsFinish:A,setDimensions:k,setHiddenUntilFound:U,setKeepMounted:M,setMounted:Y,setPanelIdState:$,setOpen:_,setVisible:z,state:te,transitionDimensionRef:H,visible:J,width:N,transitionStatus:P}=KN(),ne=l??!1,Z=c??!1;pt(()=>{if(h)return $(h),()=>{$(void 0)}},[h,$]),pt(()=>{U(ne)},[U,ne]),pt(()=>{M(Z)},[M,Z]);const{props:j}=XB({abortControllerRef:m,animationTypeRef:b,externalRef:a,height:p,hiddenUntilFound:ne,id:T,keepMounted:Z,mounted:v,onOpenChange:w,open:E,panelRef:C,runOnceAnimationsFinish:A,setDimensions:k,setMounted:Y,setOpen:_,setVisible:z,transitionDimensionRef:H,visible:J,width:N});bg({open:E&&P==="idle",ref:C,onComplete(){E&&k({height:void 0,width:void 0})}});const oe=x.useMemo(()=>({...te,transitionStatus:P}),[te,P]),I=Ln("div",n,{state:oe,ref:[a,C],props:[j,{style:{[_D.collapsiblePanelHeight]:p===void 0?"auto":`${p}px`,[_D.collapsiblePanelWidth]:N===void 0?"auto":`${N}px`}},g],stateAttributesMapping:JN});return Z||ne||!Z&&v?I:null});rM.displayName="CollapsiblePanel";function QB({...o}){return re.jsxDEV(ZN,{"data-slot":"collapsible",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:4,columnNumber:10},this)}function WB({...o}){return re.jsxDEV(nM,{"data-slot":"collapsible-trigger",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:9,columnNumber:5},this)}function KB({...o}){return re.jsxDEV(rM,{"data-slot":"collapsible-content",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/collapsible.tsx",lineNumber:15,columnNumber:5},this)}function Wf(o){return Ln(o.defaultTagName??"div",o,o)}function aM(o){var n,a,s="";if(typeof o=="string"||typeof o=="number")s+=o;else if(typeof o=="object")if(Array.isArray(o)){var l=o.length;for(n=0;n<l;n++)o[n]&&(a=aM(o[n]))&&(s&&(s+=" "),s+=a)}else for(a in o)o[a]&&(s&&(s+=" "),s+=a);return s}function sM(){for(var o,n,a=0,s="",l=arguments.length;a<l;a++)(o=arguments[a])&&(n=aM(o))&&(s&&(s+=" "),s+=n);return s}const kD=o=>typeof o=="boolean"?`${o}`:o===0?"0":o,LD=sM,ew=(o,n)=>a=>{var s;if((n==null?void 0:n.variants)==null)return LD(o,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:l,defaultVariants:c}=n,f=Object.keys(l).map(m=>{const b=a==null?void 0:a[m],p=c==null?void 0:c[m];if(b===null)return null;const v=kD(b)||kD(p);return l[m][v]}),h=a&&Object.entries(a).reduce((m,b)=>{let[p,v]=b;return v===void 0||(m[p]=v),m},{}),g=n==null||(s=n.compoundVariants)===null||s===void 0?void 0:s.reduce((m,b)=>{let{class:p,className:v,...w}=b;return Object.entries(w).every(E=>{let[T,C]=E;return Array.isArray(C)?C.includes({...c,...h}[T]):{...c,...h}[T]===C})?[...m,p,v]:m},[]);return LD(o,f,g,a==null?void 0:a.class,a==null?void 0:a.className)},x0=768;function JB(){const[o,n]=x.useState(void 0);return x.useEffect(()=>{const a=window.matchMedia(`(max-width: ${x0-1}px)`),s=()=>{n(window.innerWidth<x0)};return a.addEventListener("change",s),n(window.innerWidth<x0),()=>a.removeEventListener("change",s)},[]),!!o}const ZB=(o,n)=>{const a=new Array(o.length+n.length);for(let s=0;s<o.length;s++)a[s]=o[s];for(let s=0;s<n.length;s++)a[o.length+s]=n[s];return a},e6=(o,n)=>({classGroupId:o,validator:n}),iM=(o=new Map,n=null,a)=>({nextPart:o,validators:n,classGroupId:a}),Gm="-",UD=[],t6="arbitrary..",n6=o=>{const n=r6(o),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=o;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return o6(f);const h=f.split(Gm),g=h[0]===""&&h.length>1?1:0;return lM(h,g,n)},getConflictingClassGroupIds:(f,h)=>{if(h){const g=s[f],m=a[f];return g?m?ZB(m,g):g:m||UD}return a[f]||UD}}},lM=(o,n,a)=>{if(o.length-n===0)return a.classGroupId;const l=o[n],c=a.nextPart.get(l);if(c){const m=lM(o,n+1,c);if(m)return m}const f=a.validators;if(f===null)return;const h=n===0?o.join(Gm):o.slice(n).join(Gm),g=f.length;for(let m=0;m<g;m++){const b=f[m];if(b.validator(h))return b.classGroupId}},o6=o=>o.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=o.slice(1,-1),a=n.indexOf(":"),s=n.slice(0,a);return s?t6+s:void 0})(),r6=o=>{const{theme:n,classGroups:a}=o;return a6(a,n)},a6=(o,n)=>{const a=iM();for(const s in o){const l=o[s];tw(l,a,s,n)}return a},tw=(o,n,a,s)=>{const l=o.length;for(let c=0;c<l;c++){const f=o[c];s6(f,n,a,s)}},s6=(o,n,a,s)=>{if(typeof o=="string"){i6(o,n,a);return}if(typeof o=="function"){l6(o,n,a,s);return}c6(o,n,a,s)},i6=(o,n,a)=>{const s=o===""?n:cM(n,o);s.classGroupId=a},l6=(o,n,a,s)=>{if(u6(o)){tw(o(s),n,a,s);return}n.validators===null&&(n.validators=[]),n.validators.push(e6(a,o))},c6=(o,n,a,s)=>{const l=Object.entries(o),c=l.length;for(let f=0;f<c;f++){const[h,g]=l[f];tw(g,cM(n,h),a,s)}},cM=(o,n)=>{let a=o;const s=n.split(Gm),l=s.length;for(let c=0;c<l;c++){const f=s[c];let h=a.nextPart.get(f);h||(h=iM(),a.nextPart.set(f,h)),a=h}return a},u6=o=>"isThemeGetter"in o&&o.isThemeGetter===!0,d6=o=>{if(o<1)return{get:()=>{},set:()=>{}};let n=0,a=Object.create(null),s=Object.create(null);const l=(c,f)=>{a[c]=f,n++,n>o&&(n=0,s=a,a=Object.create(null))};return{get(c){let f=a[c];if(f!==void 0)return f;if((f=s[c])!==void 0)return l(c,f),f},set(c,f){c in a?a[c]=f:l(c,f)}}},pS="!",zD=":",f6=[],jD=(o,n,a,s,l)=>({modifiers:o,hasImportantModifier:n,baseClassName:a,maybePostfixModifierPosition:s,isExternal:l}),h6=o=>{const{prefix:n,experimentalParseClassName:a}=o;let s=l=>{const c=[];let f=0,h=0,g=0,m;const b=l.length;for(let T=0;T<b;T++){const C=l[T];if(f===0&&h===0){if(C===zD){c.push(l.slice(g,T)),g=T+1;continue}if(C==="/"){m=T;continue}}C==="["?f++:C==="]"?f--:C==="("?h++:C===")"&&h--}const p=c.length===0?l:l.slice(g);let v=p,w=!1;p.endsWith(pS)?(v=p.slice(0,-1),w=!0):p.startsWith(pS)&&(v=p.slice(1),w=!0);const E=m&&m>g?m-g:void 0;return jD(c,w,v,E)};if(n){const l=n+zD,c=s;s=f=>f.startsWith(l)?c(f.slice(l.length)):jD(f6,!1,f,void 0,!0)}if(a){const l=s;s=c=>a({className:c,parseClassName:l})}return s},p6=o=>{const n=new Map;return o.orderSensitiveModifiers.forEach((a,s)=>{n.set(a,1e6+s)}),a=>{const s=[];let l=[];for(let c=0;c<a.length;c++){const f=a[c],h=f[0]==="[",g=n.has(f);h||g?(l.length>0&&(l.sort(),s.push(...l),l=[]),s.push(f)):l.push(f)}return l.length>0&&(l.sort(),s.push(...l)),s}},m6=o=>({cache:d6(o.cacheSize),parseClassName:h6(o),sortModifiers:p6(o),...n6(o)}),g6=/\s+/,y6=(o,n)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:l,sortModifiers:c}=n,f=[],h=o.trim().split(g6);let g="";for(let m=h.length-1;m>=0;m-=1){const b=h[m],{isExternal:p,modifiers:v,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:T}=a(b);if(p){g=b+(g.length>0?" "+g:g);continue}let C=!!T,A=s(C?E.substring(0,T):E);if(!A){if(!C){g=b+(g.length>0?" "+g:g);continue}if(A=s(E),!A){g=b+(g.length>0?" "+g:g);continue}C=!1}const k=v.length===0?"":v.length===1?v[0]:c(v).join(":"),U=w?k+pS:k,M=U+A;if(f.indexOf(M)>-1)continue;f.push(M);const Y=l(A,C);for(let $=0;$<Y.length;++$){const _=Y[$];f.push(U+_)}g=b+(g.length>0?" "+g:g)}return g},b6=(...o)=>{let n=0,a,s,l="";for(;n<o.length;)(a=o[n++])&&(s=uM(a))&&(l&&(l+=" "),l+=s);return l},uM=o=>{if(typeof o=="string")return o;let n,a="";for(let s=0;s<o.length;s++)o[s]&&(n=uM(o[s]))&&(a&&(a+=" "),a+=n);return a},v6=(o,...n)=>{let a,s,l,c;const f=g=>{const m=n.reduce((b,p)=>p(b),o());return a=m6(m),s=a.cache.get,l=a.cache.set,c=h,h(g)},h=g=>{const m=s(g);if(m)return m;const b=y6(g,a);return l(g,b),b};return c=f,(...g)=>c(b6(...g))},S6=[],Jn=o=>{const n=a=>a[o]||S6;return n.isThemeGetter=!0,n},dM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,fM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,w6=/^\d+\/\d+$/,E6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,x6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,T6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jc=o=>w6.test(o),At=o=>!!o&&!Number.isNaN(Number(o)),vi=o=>!!o&&Number.isInteger(Number(o)),R0=o=>o.endsWith("%")&&At(o.slice(0,-1)),bs=o=>E6.test(o),O6=()=>!0,D6=o=>x6.test(o)&&!R6.test(o),hM=()=>!1,A6=o=>T6.test(o),N6=o=>C6.test(o),M6=o=>!qe(o)&&!Ge(o),_6=o=>Eu(o,gM,hM),qe=o=>dM.test(o),Cl=o=>Eu(o,yM,D6),T0=o=>Eu(o,j6,At),PD=o=>Eu(o,pM,hM),k6=o=>Eu(o,mM,N6),wm=o=>Eu(o,bM,A6),Ge=o=>fM.test(o),uf=o=>xu(o,yM),L6=o=>xu(o,P6),HD=o=>xu(o,pM),U6=o=>xu(o,gM),z6=o=>xu(o,mM),Em=o=>xu(o,bM,!0),Eu=(o,n,a)=>{const s=dM.exec(o);return s?s[1]?n(s[1]):a(s[2]):!1},xu=(o,n,a=!1)=>{const s=fM.exec(o);return s?s[1]?n(s[1]):a:!1},pM=o=>o==="position"||o==="percentage",mM=o=>o==="image"||o==="url",gM=o=>o==="length"||o==="size"||o==="bg-size",yM=o=>o==="length",j6=o=>o==="number",P6=o=>o==="family-name",bM=o=>o==="shadow",H6=()=>{const o=Jn("color"),n=Jn("font"),a=Jn("text"),s=Jn("font-weight"),l=Jn("tracking"),c=Jn("leading"),f=Jn("breakpoint"),h=Jn("container"),g=Jn("spacing"),m=Jn("radius"),b=Jn("shadow"),p=Jn("inset-shadow"),v=Jn("text-shadow"),w=Jn("drop-shadow"),E=Jn("blur"),T=Jn("perspective"),C=Jn("aspect"),A=Jn("ease"),k=Jn("animate"),U=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],Y=()=>[...M(),Ge,qe],$=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto","contain","none"],z=()=>[Ge,qe,g],te=()=>[Jc,"full","auto",...z()],H=()=>[vi,"none","subgrid",Ge,qe],J=()=>["auto",{span:["full",vi,Ge,qe]},vi,Ge,qe],N=()=>[vi,"auto",Ge,qe],P=()=>["auto","min","max","fr",Ge,qe],ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...z()],oe=()=>[Jc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...z()],I=()=>[o,Ge,qe],ie=()=>[...M(),HD,PD,{position:[Ge,qe]}],pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",U6,_6,{size:[Ge,qe]}],ce=()=>[R0,uf,Cl],se=()=>["","none","full",m,Ge,qe],me=()=>["",At,uf,Cl],Te=()=>["solid","dashed","dotted","double"],Ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ve=()=>[At,R0,HD,PD],ze=()=>["","none",E,Ge,qe],je=()=>["none",At,Ge,qe],at=()=>["none",At,Ge,qe],xe=()=>[At,Ge,qe],he=()=>[Jc,"full",...z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[bs],breakpoint:[bs],color:[O6],container:[bs],"drop-shadow":[bs],ease:["in","out","in-out"],font:[M6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[bs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[bs],shadow:[bs],spacing:["px",At],text:[bs],"text-shadow":[bs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jc,qe,Ge,C]}],container:["container"],columns:[{columns:[At,qe,Ge,h]}],"break-after":[{"break-after":U()}],"break-before":[{"break-before":U()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:Y()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:_()}],"overscroll-x":[{"overscroll-x":_()}],"overscroll-y":[{"overscroll-y":_()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{start:te()}],end:[{end:te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:["visible","invisible","collapse"],z:[{z:[vi,"auto",Ge,qe]}],basis:[{basis:[Jc,"full","auto",h,...z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Jc,"auto","initial","none",qe]}],grow:[{grow:["",At,Ge,qe]}],shrink:[{shrink:["",At,Ge,qe]}],order:[{order:[vi,"first","last","none",Ge,qe]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:z()}],"gap-x":[{"gap-x":z()}],"gap-y":[{"gap-y":z()}],"justify-content":[{justify:[...ne(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...ne()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:z()}],px:[{px:z()}],py:[{py:z()}],ps:[{ps:z()}],pe:[{pe:z()}],pt:[{pt:z()}],pr:[{pr:z()}],pb:[{pb:z()}],pl:[{pl:z()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":z()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],w:[{w:[h,"screen",...oe()]}],"min-w":[{"min-w":[h,"screen","none",...oe()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",a,uf,Cl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ge,T0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",R0,qe]}],"font-family":[{font:[L6,qe,n]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ge,qe]}],"line-clamp":[{"line-clamp":[At,"none",Ge,T0]}],leading:[{leading:[c,...z()]}],"list-image":[{"list-image":["none",Ge,qe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,qe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Te(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ge,Cl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[At,"auto",Ge,qe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,qe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ge,qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vi,Ge,qe],radial:["",Ge,qe],conic:[vi,Ge,qe]},z6,k6]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ce()}],"gradient-via-pos":[{via:ce()}],"gradient-to-pos":[{to:ce()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Te(),"hidden","none"]}],"divide-style":[{divide:[...Te(),"hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...Te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ge,qe]}],"outline-w":[{outline:["",At,uf,Cl]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",b,Em,wm]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",p,Em,wm]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[At,Cl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",v,Em,wm]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[At,Ge,qe]}],"mix-blend":[{"mix-blend":[...Ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ue()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":ve()}],"mask-image-linear-to-pos":[{"mask-linear-to":ve()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ve()}],"mask-image-t-to-pos":[{"mask-t-to":ve()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ve()}],"mask-image-r-to-pos":[{"mask-r-to":ve()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ve()}],"mask-image-b-to-pos":[{"mask-b-to":ve()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ve()}],"mask-image-l-to-pos":[{"mask-l-to":ve()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ve()}],"mask-image-x-to-pos":[{"mask-x-to":ve()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ve()}],"mask-image-y-to-pos":[{"mask-y-to":ve()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[Ge,qe]}],"mask-image-radial-from-pos":[{"mask-radial-from":ve()}],"mask-image-radial-to-pos":[{"mask-radial-to":ve()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":ve()}],"mask-image-conic-to-pos":[{"mask-conic-to":ve()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,qe]}],filter:[{filter:["","none",Ge,qe]}],blur:[{blur:ze()}],brightness:[{brightness:[At,Ge,qe]}],contrast:[{contrast:[At,Ge,qe]}],"drop-shadow":[{"drop-shadow":["","none",w,Em,wm]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",At,Ge,qe]}],"hue-rotate":[{"hue-rotate":[At,Ge,qe]}],invert:[{invert:["",At,Ge,qe]}],saturate:[{saturate:[At,Ge,qe]}],sepia:[{sepia:["",At,Ge,qe]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,qe]}],"backdrop-blur":[{"backdrop-blur":ze()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ge,qe]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ge,qe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ge,qe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ge,qe]}],"backdrop-invert":[{"backdrop-invert":["",At,Ge,qe]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ge,qe]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ge,qe]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ge,qe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":z()}],"border-spacing-x":[{"border-spacing-x":z()}],"border-spacing-y":[{"border-spacing-y":z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,qe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ge,qe]}],ease:[{ease:["linear","initial",A,Ge,qe]}],delay:[{delay:[At,Ge,qe]}],animate:[{animate:["none",k,Ge,qe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Ge,qe]}],"perspective-origin":[{"perspective-origin":Y()}],rotate:[{rotate:je()}],"rotate-x":[{"rotate-x":je()}],"rotate-y":[{"rotate-y":je()}],"rotate-z":[{"rotate-z":je()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[Ge,qe,"","none","gpu","cpu"]}],"transform-origin":[{origin:Y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ge,qe]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ge,qe]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[At,uf,Cl,T0]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},I6=v6(H6);function jt(...o){return I6(sM(o))}const vM=x.forwardRef(function(n,a){const{render:s,className:l,disabled:c=!1,focusableWhenDisabled:f=!1,nativeButton:h=!0,...g}=n,{getButtonProps:m,buttonRef:b}=ZS({disabled:c,focusableWhenDisabled:f,native:h});return Ln("button",n,{state:{disabled:c},ref:[a,b],props:[g,m]})});vM.displayName="Button";const B6=ew("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function nw({className:o,variant:n="default",size:a="default",...s}){return re.jsxDEV(vM,{"data-slot":"button",className:jt(B6({variant:n,size:a,className:o})),...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/button.tsx",lineNumber:43,columnNumber:5},this)}const df=0;class Fa{constructor(){We(this,"currentId",df);We(this,"clear",()=>{this.currentId!==df&&(clearTimeout(this.currentId),this.currentId=df)});We(this,"disposeEffect",()=>this.clear)}static create(){return new Fa}start(n,a){this.clear(),this.currentId=setTimeout(()=>{this.currentId=df,a()},n)}isStarted(){return this.currentId!==df}}function Ds(){const o=mr(Fa.create).current;return hg(o.disposeEffect),o}function fn(o){return(o==null?void 0:o.ownerDocument)||document}const Ru=typeof navigator<"u",C0=F6(),SM=$6(),wM=Y6(),ow=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),EM=C0.platform==="MacIntel"&&C0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(C0.platform),xM=Ru&&/apple/i.test(navigator.vendor),mS=Ru&&/android/i.test(SM)||/android/i.test(wM),V6=Ru&&SM.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,RM=wM.includes("jsdom/");function F6(){if(!Ru)return{platform:"",maxTouchPoints:-1};const o=navigator.userAgentData;return o!=null&&o.platform?{platform:o.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Y6(){if(!Ru)return"";const o=navigator.userAgentData;return o&&Array.isArray(o.brands)?o.brands.map(({brand:n,version:a})=>`${n}/${a}`).join(" "):navigator.userAgent}function $6(){if(!Ru)return"";const o=navigator.userAgentData;return o!=null&&o.platform?o.platform:navigator.platform??""}const gS="data-base-ui-focusable",TM="active",CM="selected",OM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",LY="ArrowLeft",UY="ArrowRight",zY="ArrowUp",jY="ArrowDown";function xs(o){var a;let n=o.activeElement;for(;((a=n==null?void 0:n.shadowRoot)==null?void 0:a.activeElement)!=null;)n=n.shadowRoot.activeElement;return n}function Yt(o,n){var s;if(!o||!n)return!1;const a=(s=n.getRootNode)==null?void 0:s.call(n);if(o.contains(n))return!0;if(a&&uS(a)){let l=n;for(;l;){if(o===l)return!0;l=l.parentNode||l.host}}return!1}function Xm(o,n){if(!qt(o))return!1;const a=o;if(n.hasElement(a))return!a.hasAttribute("data-trigger-disabled");for(const[,s]of n.entries())if(Yt(s,a))return!s.hasAttribute("data-trigger-disabled");return!1}function qo(o){return"composedPath"in o?o.composedPath()[0]:o.target}function Wr(o,n){if(n==null)return!1;if("composedPath"in o)return o.composedPath().includes(n);const a=o;return a.target!=null&&n.contains(a.target)}function q6(o){return o.matches("html,body")}function rw(o){return $n(o)&&o.matches(OM)}function ID(o){return o?o.getAttribute("role")==="combobox"&&rw(o):!1}function G6(o){if(!o||RM)return!0;try{return o.matches(":focus-visible")}catch{return!0}}function yS(o){return o?o.hasAttribute(gS)?o:o.querySelector(`[${gS}]`)||o:null}function Vl(o,n,a=!0){return o.filter(l=>{var c;return l.parentId===n&&(!a||((c=l.context)==null?void 0:c.open))}).flatMap(l=>[l,...Vl(o,l.id,a)])}function BD(o,n){var l;let a=[],s=(l=o.find(c=>c.id===n))==null?void 0:l.parentId;for(;s;){const c=o.find(f=>f.id===s);s=c==null?void 0:c.parentId,c&&(a=a.concat(c))}return a}function X6(o){o.preventDefault(),o.stopPropagation()}function Q6(o){return"nativeEvent"in o}function W6(o){return o.pointerType===""&&o.isTrusted?!0:mS&&o.pointerType?o.type==="click"&&o.buttons===1:o.detail===0&&!o.pointerType}function K6(o){return RM?!1:!mS&&o.width===0&&o.height===0||mS&&o.width===1&&o.height===1&&o.pressure===0&&o.detail===0&&o.pointerType==="mouse"||o.width<1&&o.height<1&&o.pressure===0&&o.detail===0&&o.pointerType==="touch"}function Uf(o,n){const a=["mouse","pen"];return n||a.push("",void 0),a.includes(o)}function J6(o){const n=o.type;return n==="click"||n==="mousedown"||n==="keydown"||n==="keyup"}const Z6=["top","right","bottom","left"],bu=Math.min,dr=Math.max,Qm=Math.round,xm=Math.floor,Ba=o=>({x:o,y:o}),e8={left:"right",right:"left",bottom:"top",top:"bottom"},t8={start:"end",end:"start"};function bS(o,n,a){return dr(o,bu(n,a))}function As(o,n){return typeof o=="function"?o(n):o}function Go(o){return o.split("-")[0]}function Hi(o){return o.split("-")[1]}function aw(o){return o==="x"?"y":"x"}function sw(o){return o==="y"?"height":"width"}const n8=new Set(["top","bottom"]);function Lr(o){return n8.has(Go(o))?"y":"x"}function iw(o){return aw(Lr(o))}function o8(o,n,a){a===void 0&&(a=!1);const s=Hi(o),l=iw(o),c=sw(l);let f=l==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return n.reference[c]>n.floating[c]&&(f=Wm(f)),[f,Wm(f)]}function r8(o){const n=Wm(o);return[vS(o),n,vS(n)]}function vS(o){return o.replace(/start|end/g,n=>t8[n])}const VD=["left","right"],FD=["right","left"],a8=["top","bottom"],s8=["bottom","top"];function i8(o,n,a){switch(o){case"top":case"bottom":return a?n?FD:VD:n?VD:FD;case"left":case"right":return n?a8:s8;default:return[]}}function l8(o,n,a,s){const l=Hi(o);let c=i8(Go(o),a==="start",s);return l&&(c=c.map(f=>f+"-"+l),n&&(c=c.concat(c.map(vS)))),c}function Wm(o){return o.replace(/left|right|bottom|top/g,n=>e8[n])}function c8(o){return{top:0,right:0,bottom:0,left:0,...o}}function DM(o){return typeof o!="number"?c8(o):{top:o,right:o,bottom:o,left:o}}function Km(o){const{x:n,y:a,width:s,height:l}=o;return{width:s,height:l,top:a,left:n,right:n+s,bottom:a+l,x:n,y:a}}/*!
420
420
  * tabbable 6.4.0
421
421
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
422
- */var u8=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Jm=u8.join(","),AM=typeof Element>"u",vu=AM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zm=!AM&&Element.prototype.getRootNode?function(o){var n;return o==null||(n=o.getRootNode)===null||n===void 0?void 0:n.call(o)}:function(o){return o==null?void 0:o.ownerDocument},eg=function(n,a){var s;a===void 0&&(a=!0);var l=n==null||(s=n.getAttribute)===null||s===void 0?void 0:s.call(n,"inert"),c=l===""||l==="true",f=c||a&&n&&(typeof n.closest=="function"?n.closest("[inert]"):eg(n.parentNode));return f},d8=function(n){var a,s=n==null||(a=n.getAttribute)===null||a===void 0?void 0:a.call(n,"contenteditable");return s===""||s==="true"},NM=function(n,a,s){if(eg(n))return[];var l=Array.prototype.slice.apply(n.querySelectorAll(Jm));return a&&vu.call(n,Jm)&&l.unshift(n),l=l.filter(s),l},tg=function(n,a,s){for(var l=[],c=Array.from(n);c.length;){var f=c.shift();if(!eg(f,!1))if(f.tagName==="SLOT"){var h=f.assignedElements(),g=h.length?h:f.children,m=tg(g,!0,s);s.flatten?l.push.apply(l,m):l.push({scopeParent:f,candidates:m})}else{var b=vu.call(f,Jm);b&&s.filter(f)&&(a||!n.includes(f))&&l.push(f);var p=f.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(f),v=!eg(p,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(f));if(p&&v){var w=tg(p===!0?f.children:p.children,!0,s);s.flatten?l.push.apply(l,w):l.push({scopeParent:f,candidates:w})}else c.unshift.apply(c,f.children)}}return l},MM=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},_M=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||d8(n))&&!MM(n)?0:n.tabIndex},f8=function(n,a){var s=_M(n);return s<0&&a&&!MM(n)?0:s},h8=function(n,a){return n.tabIndex===a.tabIndex?n.documentOrder-a.documentOrder:n.tabIndex-a.tabIndex},kM=function(n){return n.tagName==="INPUT"},p8=function(n){return kM(n)&&n.type==="hidden"},m8=function(n){var a=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(s){return s.tagName==="SUMMARY"});return a},g8=function(n,a){for(var s=0;s<n.length;s++)if(n[s].checked&&n[s].form===a)return n[s]},y8=function(n){if(!n.name)return!0;var a=n.form||Zm(n),s=function(h){return a.querySelectorAll('input[type="radio"][name="'+h+'"]')},l;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")l=s(window.CSS.escape(n.name));else try{l=s(n.name)}catch(f){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",f.message),!1}var c=g8(l,n.form);return!c||c===n},b8=function(n){return kM(n)&&n.type==="radio"},v8=function(n){return b8(n)&&!y8(n)},S8=function(n){var a,s=n&&Zm(n),l=(a=s)===null||a===void 0?void 0:a.host,c=!1;if(s&&s!==n){var f,h,g;for(c=!!((f=l)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(l)||n!=null&&(g=n.ownerDocument)!==null&&g!==void 0&&g.contains(n));!c&&l;){var m,b,p;s=Zm(l),l=(m=s)===null||m===void 0?void 0:m.host,c=!!((b=l)!==null&&b!==void 0&&(p=b.ownerDocument)!==null&&p!==void 0&&p.contains(l))}}return c},YD=function(n){var a=n.getBoundingClientRect(),s=a.width,l=a.height;return s===0&&l===0},w8=function(n,a){var s=a.displayCheck,l=a.getShadowRoot;if(s==="full-native"&&"checkVisibility"in n){var c=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!c}if(getComputedStyle(n).visibility==="hidden")return!0;var f=vu.call(n,"details>summary:first-of-type"),h=f?n.parentElement:n;if(vu.call(h,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof l=="function"){for(var g=n;n;){var m=n.parentElement,b=Zm(n);if(m&&!m.shadowRoot&&l(m)===!0)return YD(n);n.assignedSlot?n=n.assignedSlot:!m&&b!==n.ownerDocument?n=b.host:n=m}n=g}if(S8(n))return!n.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return YD(n);return!1},E8=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var a=n.parentElement;a;){if(a.tagName==="FIELDSET"&&a.disabled){for(var s=0;s<a.children.length;s++){var l=a.children.item(s);if(l.tagName==="LEGEND")return vu.call(a,"fieldset[disabled] *")?!0:!l.contains(n)}return!0}a=a.parentElement}return!1},SS=function(n,a){return!(a.disabled||p8(a)||w8(a,n)||m8(a)||E8(a))},wS=function(n,a){return!(v8(a)||_M(a)<0||!SS(n,a))},x8=function(n){var a=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(a)||a>=0)},LM=function(n){var a=[],s=[];return n.forEach(function(l,c){var f=!!l.scopeParent,h=f?l.scopeParent:l,g=f8(h,f),m=f?LM(l.candidates):h;g===0?f?a.push.apply(a,m):a.push(h):s.push({documentOrder:c,tabIndex:g,item:l,isScope:f,content:m})}),s.sort(h8).reduce(function(l,c){return c.isScope?l.push.apply(l,c.content):l.push(c.content),l},[]).concat(a)},Kf=function(n,a){a=a||{};var s;return a.getShadowRoot?s=tg([n],a.includeContainer,{filter:wS.bind(null,a),flatten:!1,getShadowRoot:a.getShadowRoot,shadowRootFilter:x8}):s=NM(n,a.includeContainer,wS.bind(null,a)),LM(s)},R8=function(n,a){a=a||{};var s;return a.getShadowRoot?s=tg([n],a.includeContainer,{filter:SS.bind(null,a),flatten:!0,getShadowRoot:a.getShadowRoot}):s=NM(n,a.includeContainer,SS.bind(null,a)),s},UM=function(n,a){if(a=a||{},!n)throw new Error("No node provided");return vu.call(n,Jm)===!1?!1:wS(a,n)};const Tu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function zM(o,n){const a=Kf(o,Tu()),s=a.length;if(s===0)return;const l=xs(fn(o)),c=a.indexOf(l),f=c===-1?n===1?0:s-1:c+n;return a[f]}function jM(o){return zM(fn(o).body,1)||o}function PM(o){return zM(fn(o).body,-1)||o}function HM(o,n){if(!o)return null;const a=Kf(fn(o).body,Tu()),s=a.length;if(s===0)return null;const l=a.indexOf(o);if(l===-1)return null;const c=(l+n+s)%s;return a[c]}function PY(o){return HM(o,1)}function HY(o){return HM(o,-1)}function xf(o,n){const a=n||o.currentTarget,s=o.relatedTarget;return!s||!Yt(a,s)}function T8(o){Kf(o,Tu()).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function $D(o){o.querySelectorAll("[data-tabindex]").forEach(a=>{const s=a.dataset.tabindex;delete a.dataset.tabindex,s?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")})}const IM=x.forwardRef(function(n,a){const{className:s,render:l,orientation:c="horizontal",...f}=n;return Ln("div",n,{state:{orientation:c},ref:a,props:[{role:"separator","aria-orientation":c},f]})});IM.displayName="Separator";function C8({className:o,orientation:n="horizontal",...a}){return re.jsxDEV(IM,{"data-slot":"separator",orientation:n,className:jt("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",o),...a},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/separator.tsx",lineNumber:13,columnNumber:5},this)}const lw=x.createContext(void 0);lw.displayName="DialogRootContext";function Wl(o){const n=x.useContext(lw);if(o===!1&&n===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return n}let Ml=(function(o){return o.open="data-open",o.closed="data-closed",o[o.startingStyle=$l.startingStyle]="startingStyle",o[o.endingStyle=$l.endingStyle]="endingStyle",o.anchorHidden="data-anchor-hidden",o.side="data-side",o.align="data-align",o})({}),ng=(function(o){return o.popupOpen="data-popup-open",o.pressed="data-pressed",o})({});const O8={[ng.popupOpen]:""},D8={[ng.popupOpen]:"",[ng.pressed]:""},A8={[Ml.open]:""},N8={[Ml.closed]:""},M8={[Ml.anchorHidden]:""},_8={open(o){return o?O8:null}},IY={open(o){return o?D8:null}},Jf={open(o){return o?A8:N8},anchorHidden(o){return o?M8:null}},k8={...Jf,...Qf},BM=x.forwardRef(function(n,a){const{render:s,className:l,forceRender:c=!1,...f}=n,{store:h}=Wl(),g=h.useState("open"),m=h.useState("nested"),b=h.useState("mounted"),p=h.useState("transitionStatus");return Ln("div",n,{state:{open:g,transitionStatus:p},ref:[h.context.backdropRef,a],stateAttributesMapping:k8,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:c||!m})});BM.displayName="DialogBackdrop";const VM=x.forwardRef(function(n,a){const{render:s,className:l,disabled:c=!1,nativeButton:f=!0,...h}=n,{store:g}=Wl(),m=g.useState("open");function b(E){m&&g.setOpen(!1,yn(EB,E.nativeEvent))}const{getButtonProps:p,buttonRef:v}=ZS({disabled:c,native:f});return Ln("button",n,{state:{disabled:c},ref:[a,v],props:[{onClick:b},h,p]})});VM.displayName="DialogClose";const FM=x.forwardRef(function(n,a){const{render:s,className:l,id:c,...f}=n,{store:h}=Wl(),g=Xf(c);return h.useSyncedValueWithCleanup("descriptionElementId",g),Ln("p",n,{ref:a,props:[{id:g},f]})});FM.displayName="DialogDescription";function Pa(o){const n=mr(L8,o).current;return n.next=o,pt(n.effect),n}function L8(o){const n={current:o,next:o,effect:()=>{n.current=n.next}};return n}function YM(){const o=new Map;return{emit(n,a){var s;(s=o.get(n))==null||s.forEach(l=>l(a))},on(n,a){o.has(n)||o.set(n,new Set),o.get(n).add(a)},off(n,a){var s;(s=o.get(n))==null||s.delete(a)}}}class U8{constructor(){We(this,"nodesRef",{current:[]});We(this,"events",YM())}addNode(n){this.nodesRef.current.push(n)}removeNode(n){const a=this.nodesRef.current.findIndex(s=>s===n);a!==-1&&this.nodesRef.current.splice(a,1)}}const cw=x.createContext(null);cw.displayName="FloatingNodeContext";const uw=x.createContext(null);uw.displayName="FloatingTreeContext";const Cu=()=>{var o;return((o=x.useContext(cw))==null?void 0:o.id)||null},Ou=o=>{const n=x.useContext(uw);return o??n};function BY(o){const n=wu(),a=Ou(o),s=Cu();return pt(()=>{if(!n)return;const l={id:n,parentId:s};return a==null||a.addNode(l),()=>{a==null||a.removeNode(l)}},[a,n,s]),n}function VY(o){const{children:n,id:a}=o,s=Cu();return nn.jsx(cw.Provider,{value:x.useMemo(()=>({id:a,parentId:s}),[a,s]),children:n})}function FY(o){const{children:n,externalTree:a}=o,s=mr(()=>a??new U8).current;return nn.jsx(uw.Provider,{value:s,children:n})}function Su(o){return`data-base-ui-${o}`}function jm(o,n,a){if(a&&!Uf(a))return 0;if(typeof o=="number")return o;if(typeof o=="function"){const s=o();return typeof s=="number"?s:s==null?void 0:s[n]}return o==null?void 0:o[n]}const $M=x.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Fa,currentIdRef:{current:null},currentContextRef:{current:null}});$M.displayName="FloatingDelayGroupContext";function z8(o,n={open:!1}){const a="rootStore"in o?o.rootStore:o,s=a.useState("floatingId"),{open:l}=n,c=x.useContext($M),{currentIdRef:f,delayRef:h,timeoutMs:g,initialDelayRef:m,currentContextRef:b,hasProvider:p,timeout:v}=c,[w,E]=x.useState(!1);return pt(()=>{function T(){var C;E(!1),(C=b.current)==null||C.setIsInstantPhase(!1),f.current=null,b.current=null,h.current=m.current}if(f.current&&!l&&f.current===s){if(E(!1),g){const C=s;return v.start(g,()=>{a.select("open")||f.current&&f.current!==C||T()}),()=>{v.clear()}}T()}},[l,s,f,h,g,m,b,v,a]),pt(()=>{if(!l)return;const T=b.current,C=f.current;v.clear(),b.current={onOpenChange:a.setOpen,setIsInstantPhase:E},f.current=s,h.current={open:0,close:jm(m.current,"close")},C!==null&&C!==s?(E(!0),T==null||T.setIsInstantPhase(!0),T==null||T.onOpenChange(!1,yn(fg))):(E(!1),T==null||T.setIsInstantPhase(!1))},[l,s,a,f,h,g,m,b,v]),pt(()=>()=>{b.current=null},[b]),x.useMemo(()=>({hasProvider:p,delayRef:h,isInstantPhase:w}),[p,h,w])}const qM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},GM={...qM,position:"fixed",top:0,left:0},YY={...qM,position:"absolute"},zf=x.forwardRef(function(n,a){const[s,l]=x.useState();pt(()=>{xM&&l("button")},[]);const c={tabIndex:0,role:s};return nn.jsx("span",{...n,ref:a,style:GM,"aria-hidden":s?void 0:!0,...c,"data-base-ui-focus-guard":""})});zf.displayName="FocusGuard";let qD=0;function O0(o,n={}){const{preventScroll:a=!1,cancelPrevious:s=!0,sync:l=!1}=n;s&&cancelAnimationFrame(qD);const c=()=>o==null?void 0:o.focus({preventScroll:a});l?c():qD=requestAnimationFrame(c)}const ru={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function GD(o){return o==="inert"?ru.inert:o==="aria-hidden"?ru["aria-hidden"]:ru.none}let Rm=new WeakSet,Tm={},D0=0;const XM=o=>o&&(o.host||XM(o.parentNode)),j8=(o,n)=>n.map(a=>{if(o.contains(a))return a;const s=XM(a);return o.contains(s)?s:null}).filter(a=>a!=null);function P8(o,n,a,s){const l="data-base-ui-inert",c=s?"inert":a?"aria-hidden":null,f=j8(n,o),h=new Set,g=new Set(f),m=[];Tm[l]||(Tm[l]=new WeakMap);const b=Tm[l];f.forEach(p),v(n),h.clear();function p(w){!w||h.has(w)||(h.add(w),w.parentNode&&p(w.parentNode))}function v(w){!w||g.has(w)||[].forEach.call(w.children,E=>{if(ji(E)!=="script")if(h.has(E))v(E);else{const T=c?E.getAttribute(c):null,C=T!==null&&T!=="false",A=GD(c),k=(A.get(E)||0)+1,U=(b.get(E)||0)+1;A.set(E,k),b.set(E,U),m.push(E),k===1&&C&&Rm.add(E),U===1&&E.setAttribute(l,""),!C&&c&&E.setAttribute(c,c==="inert"?"":"true")}})}return D0+=1,()=>{m.forEach(w=>{const E=GD(c),C=(E.get(w)||0)-1,A=(b.get(w)||0)-1;E.set(w,C),b.set(w,A),C||(!Rm.has(w)&&c&&w.removeAttribute(c),Rm.delete(w)),A||w.removeAttribute(l)}),D0-=1,D0||(ru.inert=new WeakMap,ru["aria-hidden"]=new WeakMap,ru.none=new WeakMap,Rm=new WeakSet,Tm={})}}function H8(o,n=!1,a=!1){const s=fn(o[0]).body;return P8(o.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,n,a)}const dw=x.createContext(null);dw.displayName="PortalContext";const QM=()=>x.useContext(dw),I8=Su("portal");function WM(o={}){const{ref:n,container:a,componentProps:s=fr,elementProps:l}=o,c=wu(),f=QM(),h=f==null?void 0:f.portalNode,[g,m]=x.useState(null),[b,p]=x.useState(null),v=st(C=>{C!==null&&p(C)}),w=x.useRef(null);pt(()=>{if(a===null){w.current&&(w.current=null,p(null),m(null));return}if(c==null)return;const C=(a&&(KS(a)?a:a.current))??h??document.body;if(C==null){w.current&&(w.current=null,p(null),m(null));return}w.current!==C&&(w.current=C,p(null),m(C))},[a,h,c]);const E=Ln("div",s,{ref:[n,v],props:[{id:c,[I8]:""},l]});return{portalNode:b,portalSubtree:g&&E?zi.createPortal(E,g):null}}const KM=x.forwardRef(function(n,a){const{children:s,container:l,className:c,render:f,renderGuards:h,...g}=n,{portalNode:m,portalSubtree:b}=WM({container:l,ref:a,componentProps:n,elementProps:g}),p=x.useRef(null),v=x.useRef(null),w=x.useRef(null),E=x.useRef(null),[T,C]=x.useState(null),A=T==null?void 0:T.modal,k=T==null?void 0:T.open,U=typeof h=="boolean"?h:!!T&&!T.modal&&T.open&&!!m;x.useEffect(()=>{if(!m||A)return;function Y($){m&&$.relatedTarget&&xf($)&&($.type==="focusin"?$D:T8)(m)}return m.addEventListener("focusin",Y,!0),m.addEventListener("focusout",Y,!0),()=>{m.removeEventListener("focusin",Y,!0),m.removeEventListener("focusout",Y,!0)}},[m,A]),x.useEffect(()=>{!m||k||$D(m)},[k,m]);const M=x.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:v,beforeInsideRef:w,afterInsideRef:E,portalNode:m,setFocusManagerState:C}),[m]);return nn.jsxs(x.Fragment,{children:[b,nn.jsxs(dw.Provider,{value:M,children:[U&&m&&nn.jsx(zf,{"data-type":"outside",ref:p,onFocus:Y=>{var $;if(xf(Y,m))($=w.current)==null||$.focus();else{const _=T?T.domReference:null,z=PM(_);z==null||z.focus()}}}),U&&m&&nn.jsx("span",{"aria-owns":m.id,style:pB}),m&&zi.createPortal(s,m),U&&m&&nn.jsx(zf,{"data-type":"outside",ref:v,onFocus:Y=>{var $;if(xf(Y,m))($=E.current)==null||$.focus();else{const _=T?T.domReference:null,z=jM(_);z==null||z.focus(),T!=null&&T.closeOnFocusOut&&(T==null||T.onOpenChange(!1,yn(GN,Y.nativeEvent)))}}})]})]})});KM.displayName="FloatingPortal";function B8(o,n){const a=Gn(o.target);return o instanceof a.KeyboardEvent?"keyboard":o instanceof a.FocusEvent?n||"keyboard":"pointerType"in o?o.pointerType||"keyboard":"touches"in o?"touch":o instanceof a.MouseEvent?n||(o.detail===0?"keyboard":"mouse"):""}const XD=20;let Mi=[];function fw(){Mi=Mi.filter(o=>{var n;return(n=o.deref())==null?void 0:n.isConnected})}function V8(o){fw(),o&&ji(o)!=="body"&&(Mi.push(new WeakRef(o)),Mi.length>XD&&(Mi=Mi.slice(-XD)))}function A0(){var o;return fw(),(o=Mi[Mi.length-1])==null?void 0:o.deref()}function F8(o){if(!o)return null;const n=Tu();return UM(o,n)?o:Kf(o,n)[0]||o}function Y8(o){return!o||!o.isConnected?!1:typeof o.checkVisibility=="function"?o.checkVisibility():pr(o).display!=="none"}function QD(o,n){var f;if(!n.current.includes("floating")&&!((f=o.getAttribute("role"))!=null&&f.includes("dialog")))return;const a=Tu(),l=R8(o,a).filter(h=>{const g=h.getAttribute("data-tabindex")||"";return UM(h,a)||h.hasAttribute("data-tabindex")&&!g.startsWith("-")}),c=o.getAttribute("tabindex");n.current.includes("floating")||l.length===0?c!=="0"&&o.setAttribute("tabindex","0"):(c!=="-1"||o.hasAttribute("data-tabindex")&&o.getAttribute("data-tabindex")!=="-1")&&(o.setAttribute("tabindex","-1"),o.setAttribute("data-tabindex","-1"))}function $8(o){const{context:n,children:a,disabled:s=!1,initialFocus:l=!0,returnFocus:c=!0,restoreFocus:f=!1,modal:h=!0,closeOnFocusOut:g=!0,openInteractionType:m="",nextFocusableElement:b,previousFocusableElement:p,beforeContentFocusGuardRef:v,externalTree:w}=o,E="rootStore"in n?n.rootStore:n,T=E.useState("open"),C=E.useState("domReferenceElement"),A=E.useState("floatingElement"),{events:k,dataRef:U}=E.context,M=st(()=>{var we;return(we=U.current.floatingContext)==null?void 0:we.nodeId}),Y=l===!1,$=ID(C)&&Y,_=x.useRef(["content"]),z=Pa(l),te=Pa(c),H=Pa(m),J=Ou(w),N=QM(),P=x.useRef(null),ne=x.useRef(null),Z=x.useRef(!1),j=x.useRef(!1),oe=x.useRef(!1),I=x.useRef(-1),ie=x.useRef(""),pe=x.useRef(""),L=x.useRef(null),ce=x.useRef(null),ae=kf(L,v,N==null?void 0:N.beforeInsideRef),me=kf(ce,N==null?void 0:N.afterInsideRef),Te=Ds(),Ue=Ds(),ve=QS(),ze=N!=null,je=yS(A),at=st((we=je)=>we?Kf(we,Tu()):[]),xe=st(we=>{const De=at(we);return _.current.map(()=>De).filter(Boolean).flat()});x.useEffect(()=>{if(s||!h)return;function we(Ye){Ye.key==="Tab"&&Yt(je,xs(fn(je)))&&at().length===0&&!$&&X6(Ye)}const De=fn(je);return De.addEventListener("keydown",we),()=>{De.removeEventListener("keydown",we)}},[s,C,je,h,_,$,at,xe]),x.useEffect(()=>{if(s||!T)return;const we=fn(je);function De(){oe.current=!1}function Ye(Ae){const Le=qo(Ae),tt=Yt(A,Le)||Yt(C,Le)||Yt(N==null?void 0:N.portalNode,Le);oe.current=!tt,pe.current=Ae.pointerType||"keyboard",Le!=null&&Le.closest(`[${fB}]`)&&(j.current=!0)}function Re(){pe.current="keyboard"}return we.addEventListener("pointerdown",Ye,!0),we.addEventListener("pointerup",De,!0),we.addEventListener("pointercancel",De,!0),we.addEventListener("keydown",Re,!0),()=>{we.removeEventListener("pointerdown",Ye,!0),we.removeEventListener("pointerup",De,!0),we.removeEventListener("pointercancel",De,!0),we.removeEventListener("keydown",Re,!0)}},[s,A,C,je,T,N]),x.useEffect(()=>{if(s||!g)return;const we=fn(je);function De(){j.current=!0,Ue.start(0,()=>{j.current=!1})}function Ye(Ce){const ot=qo(Ce),yt=at().indexOf(ot);yt!==-1&&(I.current=yt)}function Re(Ce){const ot=Ce.relatedTarget,gt=Ce.currentTarget,yt=qo(Ce);queueMicrotask(()=>{const ht=M(),$t=E.context.triggerElements,on=(ot==null?void 0:ot.hasAttribute(Su("focus-guard")))&&[L.current,ce.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ws(p),ws(b)].includes(ot),bn=!(Yt(C,ot)||Yt(A,ot)||Yt(ot,A)||Yt(N==null?void 0:N.portalNode,ot)||ot!=null&&$t.hasElement(ot)||$t.hasMatchingElement(bt=>Yt(bt,ot))||on||J&&(Vl(J.nodesRef.current,ht).find(bt=>{var Pt,Ft;return Yt((Pt=bt.context)==null?void 0:Pt.elements.floating,ot)||Yt((Ft=bt.context)==null?void 0:Ft.elements.domReference,ot)})||BD(J.nodesRef.current,ht).find(bt=>{var Pt,Ft,vn;return[(Pt=bt.context)==null?void 0:Pt.elements.floating,yS((Ft=bt.context)==null?void 0:Ft.elements.floating)].includes(ot)||((vn=bt.context)==null?void 0:vn.elements.domReference)===ot})));if(gt===C&&je&&QD(je,_),f&&gt!==C&&!Y8(yt)&&xs(we)===we.body){if($n(je)&&(je.focus(),f==="popup")){ve.request(()=>{je.focus()});return}const bt=I.current,Pt=at(),Ft=Pt[bt]||Pt[Pt.length-1]||je;$n(Ft)&&Ft.focus()}if(U.current.insideReactTree){U.current.insideReactTree=!1;return}($||!h)&&ot&&bn&&!j.current&&($||ot!==A0())&&(Z.current=!0,E.setOpen(!1,yn(GN,Ce)))})}function Ae(){oe.current||(U.current.insideReactTree=!0,Te.start(0,()=>{U.current.insideReactTree=!1}))}const Le=$n(C)?C:null,tt=[];if(!(!A&&!Le))return Le&&(Le.addEventListener("focusout",Re),Le.addEventListener("pointerdown",De),tt.push(()=>{Le.removeEventListener("focusout",Re),Le.removeEventListener("pointerdown",De)})),A&&(A.addEventListener("focusin",Ye),A.addEventListener("focusout",Re),N&&(A.addEventListener("focusout",Ae,!0),tt.push(()=>{A.removeEventListener("focusout",Ae,!0)})),tt.push(()=>{A.removeEventListener("focusin",Ye),A.removeEventListener("focusout",Re)})),()=>{tt.forEach(Ce=>{Ce()})}},[s,C,A,je,h,J,N,E,g,f,at,$,M,_,U,Te,Ue,ve,b,p]),x.useEffect(()=>{var Ae,Le,tt;if(s||!A||!T)return;const we=Array.from(((Ae=N==null?void 0:N.portalNode)==null?void 0:Ae.querySelectorAll(`[${Su("portal")}]`))||[]),Ye=(tt=(Le=(J?BD(J.nodesRef.current,M()):[]).find(Ce=>{var ot;return ID(((ot=Ce.context)==null?void 0:ot.elements.domReference)||null)}))==null?void 0:Le.context)==null?void 0:tt.elements.domReference,Re=[A,Ye,...we,P.current,ne.current,L.current,ce.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ws(p),ws(b),$?C:null].filter(Ce=>Ce!=null);return H8(Re,h||$)},[T,s,C,A,h,_,N,$,J,M,b,p]),pt(()=>{if(!T||s||!$n(je))return;const we=fn(je),De=xs(we);queueMicrotask(()=>{const Ye=xe(je),Re=z.current,Ae=typeof Re=="function"?Re(H.current||""):Re;if(Ae===void 0||Ae===!1)return;let Le;Ae===!0||Ae===null?Le=Ye[0]||je:Le=ws(Ae),Le=Le||Ye[0]||je,!Yt(je,De)&&O0(Le,{preventScroll:Le===je})})},[s,T,je,Y,xe,z,H]),pt(()=>{if(s||!je)return;const we=fn(je),De=xs(we);V8(De);function Ye(Le){if(Le.open||(ie.current=B8(Le.nativeEvent,pe.current)),Le.reason===Zr&&Le.nativeEvent.type==="mouseleave"&&(Z.current=!0),Le.reason===qN)if(Le.nested)Z.current=!1;else if(W6(Le.nativeEvent)||K6(Le.nativeEvent))Z.current=!1;else{let tt=!1;document.createElement("div").focus({get preventScroll(){return tt=!0,!1}}),tt?Z.current=!1:Z.current=!0}}k.on("openchange",Ye);const Re=we.createElement("span");Re.setAttribute("tabindex","-1"),Re.setAttribute("aria-hidden","true"),Object.assign(Re.style,GM),ze&&C&&C.insertAdjacentElement("afterend",Re);function Ae(){const Le=te.current;let tt=typeof Le=="function"?Le(ie.current):Le;if(tt===void 0||tt===!1)return null;if(tt===null&&(tt=!0),typeof tt=="boolean"){const ot=C||A0();return ot&&ot.isConnected?ot:Re}const Ce=C||A0()||Re;return ws(tt)||Ce}return()=>{k.off("openchange",Ye);const Le=xs(we),tt=Yt(A,Le)||J&&Vl(J.nodesRef.current,M(),!1).some(ot=>{var gt;return Yt((gt=ot.context)==null?void 0:gt.elements.floating,Le)}),Ce=Ae();queueMicrotask(()=>{const ot=F8(Ce),gt=typeof te.current!="boolean";te.current&&!Z.current&&$n(ot)&&(!(!gt&&ot!==Le&&Le!==we.body)||tt)&&ot.focus({preventScroll:!0}),Re.remove(),Z.current=!1})}},[s,A,je,te,U,k,J,ze,C,M]),pt(()=>{if(!ow||T||!A)return;const we=xs(fn(A));!$n(we)||!rw(we)||Yt(A,we)&&we.blur()},[T,A]),pt(()=>{if(!(s||!N))return N.setFocusManagerState({modal:h,closeOnFocusOut:g,open:T,onOpenChange:E.setOpen,domReference:C}),()=>{N.setFocusManagerState(null)}},[s,N,h,T,E,g,C]),pt(()=>{if(!(s||!je))return QD(je,_),()=>{queueMicrotask(fw)}},[s,je,_]);const he=!s&&(h?!$:!0)&&(ze||h);return nn.jsxs(x.Fragment,{children:[he&&nn.jsx(zf,{"data-type":"inside",ref:ae,onFocus:we=>{var De;if(h){const Ye=xe();O0(Ye[Ye.length-1])}else if(N!=null&&N.portalNode)if(Z.current=!1,xf(we,N.portalNode)){const Ye=jM(C);Ye==null||Ye.focus()}else(De=ws(p??N.beforeOutsideRef))==null||De.focus()}}),a,he&&nn.jsx(zf,{"data-type":"inside",ref:me,onFocus:we=>{var De;if(h)O0(xe()[0]);else if(N!=null&&N.portalNode)if(g&&(Z.current=!0),xf(we,N.portalNode)){const Ye=PM(C);Ye==null||Ye.focus()}else(De=ws(b??N.afterOutsideRef))==null||De.focus()}})]})}function q8(o,n){let a=null,s=null,l=!1;return{contextElement:o||void 0,getBoundingClientRect(){var w;const c=(o==null?void 0:o.getBoundingClientRect())||{width:0,height:0,x:0,y:0},f=n.axis==="x"||n.axis==="both",h=n.axis==="y"||n.axis==="both",g=["mouseenter","mousemove"].includes(((w=n.dataRef.current.openEvent)==null?void 0:w.type)||"")&&n.pointerType!=="touch";let m=c.width,b=c.height,p=c.x,v=c.y;return a==null&&n.x&&f&&(a=c.x-n.x),s==null&&n.y&&h&&(s=c.y-n.y),p-=a||0,v-=s||0,m=0,b=0,!l||g?(m=n.axis==="y"?c.width:0,b=n.axis==="x"?c.height:0,p=f&&n.x!=null?n.x:p,v=h&&n.y!=null?n.y:v):l&&!g&&(b=n.axis==="x"?c.height:b,m=n.axis==="y"?c.width:m),l=!0,{width:m,height:b,x:p,y:v,top:v,right:p+m,bottom:v+b,left:p}}}}function WD(o){return o!=null&&o.clientX!=null}function G8(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("domReferenceElement"),f=a.context.dataRef,{enabled:h=!0,axis:g="both"}=n,m=x.useRef(!1),b=x.useRef(null),[p,v]=x.useState(),[w,E]=x.useState([]),T=st((M,Y,$)=>{m.current||f.current.openEvent&&!WD(f.current.openEvent)||a.set("positionReference",q8($??c,{x:M,y:Y,axis:g,dataRef:f,pointerType:p}))}),C=st(M=>{s?b.current||E([]):T(M.clientX,M.clientY,M.currentTarget)}),A=Uf(p)?l:s,k=x.useCallback(()=>{if(!A||!h)return;const M=Gn(l);function Y($){const _=qo($);Yt(l,_)?(M.removeEventListener("mousemove",Y),b.current=null):T($.clientX,$.clientY)}if(!f.current.openEvent||WD(f.current.openEvent)){M.addEventListener("mousemove",Y);const $=()=>{M.removeEventListener("mousemove",Y),b.current=null};return b.current=$,$}a.set("positionReference",c)},[A,h,l,f,c,a,T]);x.useEffect(()=>k(),[k,w]),x.useEffect(()=>{h&&!l&&(m.current=!1)},[h,l]),x.useEffect(()=>{!h&&s&&(m.current=!0)},[h,s]);const U=x.useMemo(()=>{function M(Y){v(Y.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return x.useMemo(()=>h?{reference:U,trigger:U}:{},[h,U])}function KD(o,n,a){let{reference:s,floating:l}=o;const c=Lr(n),f=iw(n),h=sw(f),g=Go(n),m=c==="y",b=s.x+s.width/2-l.width/2,p=s.y+s.height/2-l.height/2,v=s[h]/2-l[h]/2;let w;switch(g){case"top":w={x:b,y:s.y-l.height};break;case"bottom":w={x:b,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:p};break;case"left":w={x:s.x-l.width,y:p};break;default:w={x:s.x,y:s.y}}switch(Hi(n)){case"start":w[f]-=v*(a&&m?-1:1);break;case"end":w[f]+=v*(a&&m?-1:1);break}return w}async function X8(o,n){var a;n===void 0&&(n={});const{x:s,y:l,platform:c,rects:f,elements:h,strategy:g}=o,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:p="floating",altBoundary:v=!1,padding:w=0}=As(n,o),E=DM(w),C=h[v?p==="floating"?"reference":"floating":p],A=Km(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(C)))==null||a?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:m,rootBoundary:b,strategy:g})),k=p==="floating"?{x:s,y:l,width:f.floating.width,height:f.floating.height}:f.reference,U=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),M=await(c.isElement==null?void 0:c.isElement(U))?await(c.getScale==null?void 0:c.getScale(U))||{x:1,y:1}:{x:1,y:1},Y=Km(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:k,offsetParent:U,strategy:g}):k);return{top:(A.top-Y.top+E.top)/M.y,bottom:(Y.bottom-A.bottom+E.bottom)/M.y,left:(A.left-Y.left+E.left)/M.x,right:(Y.right-A.right+E.right)/M.x}}const Q8=async(o,n,a)=>{const{placement:s="bottom",strategy:l="absolute",middleware:c=[],platform:f}=a,h=c.filter(Boolean),g=await(f.isRTL==null?void 0:f.isRTL(n));let m=await f.getElementRects({reference:o,floating:n,strategy:l}),{x:b,y:p}=KD(m,s,g),v=s,w={},E=0;for(let C=0;C<h.length;C++){var T;const{name:A,fn:k}=h[C],{x:U,y:M,data:Y,reset:$}=await k({x:b,y:p,initialPlacement:s,placement:v,strategy:l,middlewareData:w,rects:m,platform:{...f,detectOverflow:(T=f.detectOverflow)!=null?T:X8},elements:{reference:o,floating:n}});b=U??b,p=M??p,w={...w,[A]:{...w[A],...Y}},$&&E<=50&&(E++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(m=$.rects===!0?await f.getElementRects({reference:o,floating:n,strategy:l}):$.rects),{x:b,y:p}=KD(m,v,g)),C=-1)}return{x:b,y:p,placement:v,strategy:l,middlewareData:w}},W8=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(n){var a,s;const{placement:l,middlewareData:c,rects:f,initialPlacement:h,platform:g,elements:m}=n,{mainAxis:b=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...C}=As(o,n);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const A=Go(l),k=Lr(h),U=Go(h)===h,M=await(g.isRTL==null?void 0:g.isRTL(m.floating)),Y=v||(U||!T?[Wm(h)]:r8(h)),$=E!=="none";!v&&$&&Y.push(...l8(h,T,E,M));const _=[h,...Y],z=await g.detectOverflow(n,C),te=[];let H=((s=c.flip)==null?void 0:s.overflows)||[];if(b&&te.push(z[A]),p){const ne=o8(l,f,M);te.push(z[ne[0]],z[ne[1]])}if(H=[...H,{placement:l,overflows:te}],!te.every(ne=>ne<=0)){var J,N;const ne=(((J=c.flip)==null?void 0:J.index)||0)+1,Z=_[ne];if(Z&&(!(p==="alignment"?k!==Lr(Z):!1)||H.every(I=>Lr(I.placement)===k?I.overflows[0]>0:!0)))return{data:{index:ne,overflows:H},reset:{placement:Z}};let j=(N=H.filter(oe=>oe.overflows[0]<=0).sort((oe,I)=>oe.overflows[1]-I.overflows[1])[0])==null?void 0:N.placement;if(!j)switch(w){case"bestFit":{var P;const oe=(P=H.filter(I=>{if($){const ie=Lr(I.placement);return ie===k||ie==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(ie=>ie>0).reduce((ie,pe)=>ie+pe,0)]).sort((I,ie)=>I[1]-ie[1])[0])==null?void 0:P[0];oe&&(j=oe);break}case"initialPlacement":j=h;break}if(l!==j)return{reset:{placement:j}}}return{}}}};function JD(o,n){return{top:o.top-n.height,right:o.right-n.width,bottom:o.bottom-n.height,left:o.left-n.width}}function ZD(o){return Z6.some(n=>o[n]>=0)}const K8=function(o){return o===void 0&&(o={}),{name:"hide",options:o,async fn(n){const{rects:a,platform:s}=n,{strategy:l="referenceHidden",...c}=As(o,n);switch(l){case"referenceHidden":{const f=await s.detectOverflow(n,{...c,elementContext:"reference"}),h=JD(f,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:ZD(h)}}}case"escaped":{const f=await s.detectOverflow(n,{...c,altBoundary:!0}),h=JD(f,a.floating);return{data:{escapedOffsets:h,escaped:ZD(h)}}}default:return{}}}}},JM=new Set(["left","top"]);async function J8(o,n){const{placement:a,platform:s,elements:l}=o,c=await(s.isRTL==null?void 0:s.isRTL(l.floating)),f=Go(a),h=Hi(a),g=Lr(a)==="y",m=JM.has(f)?-1:1,b=c&&g?-1:1,p=As(n,o);let{mainAxis:v,crossAxis:w,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return h&&typeof E=="number"&&(w=h==="end"?E*-1:E),g?{x:w*b,y:v*m}:{x:v*m,y:w*b}}const Z8=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(n){var a,s;const{x:l,y:c,placement:f,middlewareData:h}=n,g=await J8(n,o);return f===((a=h.offset)==null?void 0:a.placement)&&(s=h.arrow)!=null&&s.alignmentOffset?{}:{x:l+g.x,y:c+g.y,data:{...g,placement:f}}}}},eV=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(n){const{x:a,y:s,placement:l,platform:c}=n,{mainAxis:f=!0,crossAxis:h=!1,limiter:g={fn:A=>{let{x:k,y:U}=A;return{x:k,y:U}}},...m}=As(o,n),b={x:a,y:s},p=await c.detectOverflow(n,m),v=Lr(Go(l)),w=aw(v);let E=b[w],T=b[v];if(f){const A=w==="y"?"top":"left",k=w==="y"?"bottom":"right",U=E+p[A],M=E-p[k];E=bS(U,E,M)}if(h){const A=v==="y"?"top":"left",k=v==="y"?"bottom":"right",U=T+p[A],M=T-p[k];T=bS(U,T,M)}const C=g.fn({...n,[w]:E,[v]:T});return{...C,data:{x:C.x-a,y:C.y-s,enabled:{[w]:f,[v]:h}}}}}},tV=function(o){return o===void 0&&(o={}),{options:o,fn(n){const{x:a,y:s,placement:l,rects:c,middlewareData:f}=n,{offset:h=0,mainAxis:g=!0,crossAxis:m=!0}=As(o,n),b={x:a,y:s},p=Lr(l),v=aw(p);let w=b[v],E=b[p];const T=As(h,n),C=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:0,crossAxis:0,...T};if(g){const U=v==="y"?"height":"width",M=c.reference[v]-c.floating[U]+C.mainAxis,Y=c.reference[v]+c.reference[U]-C.mainAxis;w<M?w=M:w>Y&&(w=Y)}if(m){var A,k;const U=v==="y"?"width":"height",M=JM.has(Go(l)),Y=c.reference[p]-c.floating[U]+(M&&((A=f.offset)==null?void 0:A[p])||0)+(M?0:C.crossAxis),$=c.reference[p]+c.reference[U]+(M?0:((k=f.offset)==null?void 0:k[p])||0)-(M?C.crossAxis:0);E<Y?E=Y:E>$&&(E=$)}return{[v]:w,[p]:E}}}},nV=function(o){return o===void 0&&(o={}),{name:"size",options:o,async fn(n){var a,s;const{placement:l,rects:c,platform:f,elements:h}=n,{apply:g=()=>{},...m}=As(o,n),b=await f.detectOverflow(n,m),p=Go(l),v=Hi(l),w=Lr(l)==="y",{width:E,height:T}=c.floating;let C,A;p==="top"||p==="bottom"?(C=p,A=v===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(A=p,C=v==="end"?"top":"bottom");const k=T-b.top-b.bottom,U=E-b.left-b.right,M=bu(T-b[C],k),Y=bu(E-b[A],U),$=!n.middlewareData.shift;let _=M,z=Y;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(z=U),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(_=k),$&&!v){const H=dr(b.left,0),J=dr(b.right,0),N=dr(b.top,0),P=dr(b.bottom,0);w?z=E-2*(H!==0||J!==0?H+J:dr(b.left,b.right)):_=T-2*(N!==0||P!==0?N+P:dr(b.top,b.bottom))}await g({...n,availableWidth:z,availableHeight:_});const te=await f.getDimensions(h.floating);return E!==te.width||T!==te.height?{reset:{rects:!0}}:{}}}};function ZM(o){const n=pr(o);let a=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const l=$n(o),c=l?o.offsetWidth:a,f=l?o.offsetHeight:s,h=Qm(a)!==c||Qm(s)!==f;return h&&(a=c,s=f),{width:a,height:s,$:h}}function hw(o){return qt(o)?o:o.contextElement}function au(o){const n=hw(o);if(!$n(n))return Ba(1);const a=n.getBoundingClientRect(),{width:s,height:l,$:c}=ZM(n);let f=(c?Qm(a.width):a.width)/s,h=(c?Qm(a.height):a.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const oV=Ba(0);function e_(o){const n=Gn(o);return!gg()||!n.visualViewport?oV:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function rV(o,n,a){return n===void 0&&(n=!1),!a||n&&a!==Gn(o)?!1:n}function ql(o,n,a,s){n===void 0&&(n=!1),a===void 0&&(a=!1);const l=o.getBoundingClientRect(),c=hw(o);let f=Ba(1);n&&(s?qt(s)&&(f=au(s)):f=au(o));const h=rV(c,a,s)?e_(c):Ba(0);let g=(l.left+h.x)/f.x,m=(l.top+h.y)/f.y,b=l.width/f.x,p=l.height/f.y;if(c){const v=Gn(c),w=s&&qt(s)?Gn(s):s;let E=v,T=dS(E);for(;T&&s&&w!==E;){const C=au(T),A=T.getBoundingClientRect(),k=pr(T),U=A.left+(T.clientLeft+parseFloat(k.paddingLeft))*C.x,M=A.top+(T.clientTop+parseFloat(k.paddingTop))*C.y;g*=C.x,m*=C.y,b*=C.x,p*=C.y,g+=U,m+=M,E=Gn(T),T=dS(E)}}return Km({width:b,height:p,x:g,y:m})}function vg(o,n){const a=yg(o).scrollLeft;return n?n.left+a:ql(Ya(o)).left+a}function t_(o,n){const a=o.getBoundingClientRect(),s=a.left+n.scrollLeft-vg(o,a),l=a.top+n.scrollTop;return{x:s,y:l}}function aV(o){let{elements:n,rect:a,offsetParent:s,strategy:l}=o;const c=l==="fixed",f=Ya(s),h=n?mg(n.floating):!1;if(s===f||h&&c)return a;let g={scrollLeft:0,scrollTop:0},m=Ba(1);const b=Ba(0),p=$n(s);if((p||!p&&!c)&&((ji(s)!=="body"||Pi(f))&&(g=yg(s)),$n(s))){const w=ql(s);m=au(s),b.x=w.x+s.clientLeft,b.y=w.y+s.clientTop}const v=f&&!p&&!c?t_(f,g):Ba(0);return{width:a.width*m.x,height:a.height*m.y,x:a.x*m.x-g.scrollLeft*m.x+b.x+v.x,y:a.y*m.y-g.scrollTop*m.y+b.y+v.y}}function sV(o){return Array.from(o.getClientRects())}function iV(o){const n=Ya(o),a=yg(o),s=o.ownerDocument.body,l=dr(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),c=dr(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let f=-a.scrollLeft+vg(o);const h=-a.scrollTop;return pr(s).direction==="rtl"&&(f+=dr(n.clientWidth,s.clientWidth)-l),{width:l,height:c,x:f,y:h}}const eA=25;function lV(o,n){const a=Gn(o),s=Ya(o),l=a.visualViewport;let c=s.clientWidth,f=s.clientHeight,h=0,g=0;if(l){c=l.width,f=l.height;const b=gg();(!b||b&&n==="fixed")&&(h=l.offsetLeft,g=l.offsetTop)}const m=vg(s);if(m<=0){const b=s.ownerDocument,p=b.body,v=getComputedStyle(p),w=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,E=Math.abs(s.clientWidth-p.clientWidth-w);E<=eA&&(c-=E)}else m<=eA&&(c+=m);return{width:c,height:f,x:h,y:g}}const cV=new Set(["absolute","fixed"]);function uV(o,n){const a=ql(o,!0,n==="fixed"),s=a.top+o.clientTop,l=a.left+o.clientLeft,c=$n(o)?au(o):Ba(1),f=o.clientWidth*c.x,h=o.clientHeight*c.y,g=l*c.x,m=s*c.y;return{width:f,height:h,x:g,y:m}}function tA(o,n,a){let s;if(n==="viewport")s=lV(o,a);else if(n==="document")s=iV(Ya(o));else if(qt(n))s=uV(n,a);else{const l=e_(o);s={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return Km(s)}function n_(o,n){const a=Os(o);return a===n||!qt(a)||Cs(a)?!1:pr(a).position==="fixed"||n_(a,n)}function dV(o,n){const a=n.get(o);if(a)return a;let s=Li(o,[],!1).filter(h=>qt(h)&&ji(h)!=="body"),l=null;const c=pr(o).position==="fixed";let f=c?Os(o):o;for(;qt(f)&&!Cs(f);){const h=pr(f),g=JS(f);!g&&h.position==="fixed"&&(l=null),(c?!g&&!l:!g&&h.position==="static"&&!!l&&cV.has(l.position)||Pi(f)&&!g&&n_(o,f))?s=s.filter(b=>b!==f):l=h,f=Os(f)}return n.set(o,s),s}function fV(o){let{element:n,boundary:a,rootBoundary:s,strategy:l}=o;const f=[...a==="clippingAncestors"?mg(n)?[]:dV(n,this._c):[].concat(a),s],h=f[0],g=f.reduce((m,b)=>{const p=tA(n,b,l);return m.top=dr(p.top,m.top),m.right=bu(p.right,m.right),m.bottom=bu(p.bottom,m.bottom),m.left=dr(p.left,m.left),m},tA(n,h,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function hV(o){const{width:n,height:a}=ZM(o);return{width:n,height:a}}function pV(o,n,a){const s=$n(n),l=Ya(n),c=a==="fixed",f=ql(o,!0,c,n);let h={scrollLeft:0,scrollTop:0};const g=Ba(0);function m(){g.x=vg(l)}if(s||!s&&!c)if((ji(n)!=="body"||Pi(l))&&(h=yg(n)),s){const w=ql(n,!0,c,n);g.x=w.x+n.clientLeft,g.y=w.y+n.clientTop}else l&&m();c&&!s&&l&&m();const b=l&&!s&&!c?t_(l,h):Ba(0),p=f.left+h.scrollLeft-g.x-b.x,v=f.top+h.scrollTop-g.y-b.y;return{x:p,y:v,width:f.width,height:f.height}}function N0(o){return pr(o).position==="static"}function nA(o,n){if(!$n(o)||pr(o).position==="fixed")return null;if(n)return n(o);let a=o.offsetParent;return Ya(o)===a&&(a=a.ownerDocument.body),a}function o_(o,n){const a=Gn(o);if(mg(o))return a;if(!$n(o)){let l=Os(o);for(;l&&!Cs(l);){if(qt(l)&&!N0(l))return l;l=Os(l)}return a}let s=nA(o,n);for(;s&&zB(s)&&N0(s);)s=nA(s,n);return s&&Cs(s)&&N0(s)&&!JS(s)?a:s||BB(o)||a}const mV=async function(o){const n=this.getOffsetParent||o_,a=this.getDimensions,s=await a(o.floating);return{reference:pV(o.reference,await n(o.floating),o.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function gV(o){return pr(o).direction==="rtl"}const yV={convertOffsetParentRelativeRectToViewportRelativeRect:aV,getDocumentElement:Ya,getClippingRect:fV,getOffsetParent:o_,getElementRects:mV,getClientRects:sV,getDimensions:hV,getScale:au,isElement:qt,isRTL:gV};function r_(o,n){return o.x===n.x&&o.y===n.y&&o.width===n.width&&o.height===n.height}function bV(o,n){let a=null,s;const l=Ya(o);function c(){var h;clearTimeout(s),(h=a)==null||h.disconnect(),a=null}function f(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),c();const m=o.getBoundingClientRect(),{left:b,top:p,width:v,height:w}=m;if(h||n(),!v||!w)return;const E=xm(p),T=xm(l.clientWidth-(b+v)),C=xm(l.clientHeight-(p+w)),A=xm(b),U={rootMargin:-E+"px "+-T+"px "+-C+"px "+-A+"px",threshold:dr(0,bu(1,g))||1};let M=!0;function Y($){const _=$[0].intersectionRatio;if(_!==g){if(!M)return f();_?f(!1,_):s=setTimeout(()=>{f(!1,1e-7)},1e3)}_===1&&!r_(m,o.getBoundingClientRect())&&f(),M=!1}try{a=new IntersectionObserver(Y,{...U,root:l.ownerDocument})}catch{a=new IntersectionObserver(Y,U)}a.observe(o)}return f(!0),c}function oA(o,n,a,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=s,m=hw(o),b=l||c?[...m?Li(m):[],...Li(n)]:[];b.forEach(A=>{l&&A.addEventListener("scroll",a,{passive:!0}),c&&A.addEventListener("resize",a)});const p=m&&h?bV(m,a):null;let v=-1,w=null;f&&(w=new ResizeObserver(A=>{let[k]=A;k&&k.target===m&&w&&(w.unobserve(n),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var U;(U=w)==null||U.observe(n)})),a()}),m&&!g&&w.observe(m),w.observe(n));let E,T=g?ql(o):null;g&&C();function C(){const A=ql(o);T&&!r_(T,A)&&a(),T=A,E=requestAnimationFrame(C)}return a(),()=>{var A;b.forEach(k=>{l&&k.removeEventListener("scroll",a),c&&k.removeEventListener("resize",a)}),p==null||p(),(A=w)==null||A.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const vV=Z8,SV=eV,wV=W8,EV=nV,xV=K8,RV=tV,TV=(o,n,a)=>{const s=new Map,l={platform:yV,...a},c={...l.platform,_c:s};return Q8(o,n,{...l,platform:c})};var CV=typeof document<"u",OV=function(){},Pm=CV?x.useLayoutEffect:OV;function og(o,n){if(o===n)return!0;if(typeof o!=typeof n)return!1;if(typeof o=="function"&&o.toString()===n.toString())return!0;let a,s,l;if(o&&n&&typeof o=="object"){if(Array.isArray(o)){if(a=o.length,a!==n.length)return!1;for(s=a;s--!==0;)if(!og(o[s],n[s]))return!1;return!0}if(l=Object.keys(o),a=l.length,a!==Object.keys(n).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(n,l[s]))return!1;for(s=a;s--!==0;){const c=l[s];if(!(c==="_owner"&&o.$$typeof)&&!og(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}function a_(o){return typeof window>"u"?1:(o.ownerDocument.defaultView||window).devicePixelRatio||1}function rA(o,n){const a=a_(o);return Math.round(n*a)/a}function M0(o){const n=x.useRef(o);return Pm(()=>{n.current=o}),n}function DV(o){o===void 0&&(o={});const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:l,elements:{reference:c,floating:f}={},transform:h=!0,whileElementsMounted:g,open:m}=o,[b,p]=x.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[v,w]=x.useState(s);og(v,s)||w(s);const[E,T]=x.useState(null),[C,A]=x.useState(null),k=x.useCallback(I=>{I!==$.current&&($.current=I,T(I))},[]),U=x.useCallback(I=>{I!==_.current&&(_.current=I,A(I))},[]),M=c||E,Y=f||C,$=x.useRef(null),_=x.useRef(null),z=x.useRef(b),te=g!=null,H=M0(g),J=M0(l),N=M0(m),P=x.useCallback(()=>{if(!$.current||!_.current)return;const I={placement:n,strategy:a,middleware:v};J.current&&(I.platform=J.current),TV($.current,_.current,I).then(ie=>{const pe={...ie,isPositioned:N.current!==!1};ne.current&&!og(z.current,pe)&&(z.current=pe,zi.flushSync(()=>{p(pe)}))})},[v,n,a,J,N]);Pm(()=>{m===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[m]);const ne=x.useRef(!1);Pm(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Pm(()=>{if(M&&($.current=M),Y&&(_.current=Y),M&&Y){if(H.current)return H.current(M,Y,P);P()}},[M,Y,P,H,te]);const Z=x.useMemo(()=>({reference:$,floating:_,setReference:k,setFloating:U}),[k,U]),j=x.useMemo(()=>({reference:M,floating:Y}),[M,Y]),oe=x.useMemo(()=>{const I={position:a,left:0,top:0};if(!j.floating)return I;const ie=rA(j.floating,b.x),pe=rA(j.floating,b.y);return h?{...I,transform:"translate("+ie+"px, "+pe+"px)",...a_(j.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ie,top:pe}},[a,h,j.floating,b.x,b.y]);return x.useMemo(()=>({...b,update:P,refs:Z,elements:j,floatingStyles:oe}),[b,P,Z,j,oe])}const AV=(o,n)=>({...vV(o),options:[o,n]}),NV=(o,n)=>({...SV(o),options:[o,n]}),MV=(o,n)=>({...RV(o),options:[o,n]}),_V=(o,n)=>({...wV(o),options:[o,n]}),kV=(o,n)=>({...EV(o),options:[o,n]}),LV=(o,n)=>({...xV(o),options:[o,n]}),UV={intentional:"onClick",sloppy:"onPointerDown"};function zV(o){return{escapeKey:typeof o=="boolean"?o:(o==null?void 0:o.escapeKey)??!1,outsidePress:typeof o=="boolean"?o:(o==null?void 0:o.outsidePress)??!0}}function s_(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("referenceElement"),f=a.useState("domReferenceElement"),{onOpenChange:h,dataRef:g}=a.context,{enabled:m=!0,escapeKey:b=!0,outsidePress:p=!0,outsidePressEvent:v="sloppy",referencePress:w=!1,referencePressEvent:E="sloppy",ancestorScroll:T=!1,bubbles:C,externalTree:A}=n,k=Ou(A),U=st(typeof p=="function"?p:()=>!1),M=typeof p=="function"?U:p,Y=x.useRef(!1),{escapeKey:$,outsidePress:_}=zV(C),z=x.useRef(null),te=Ds(),H=Ds(),J=st(()=>{H.clear(),g.current.insideReactTree=!1}),N=x.useRef(!1),P=x.useRef(""),ne=st(he=>{P.current=he.pointerType}),Z=st(()=>{const he=P.current,we=he==="pen"||!he?"mouse":he,De=typeof v=="function"?v():v;return typeof De=="string"?De:De[we]}),j=st(he=>{var Ae;if(!s||!m||!b||he.key!=="Escape"||N.current)return;const we=(Ae=g.current.floatingContext)==null?void 0:Ae.nodeId,De=k?Vl(k.nodesRef.current,we):[];if(!$&&De.length>0){let Le=!0;if(De.forEach(tt=>{var Ce;(Ce=tt.context)!=null&&Ce.open&&!tt.context.dataRef.current.__escapeKeyBubbles&&(Le=!1)}),!Le)return}const Ye=Q6(he)?he.nativeEvent:he,Re=yn(XS,Ye);a.setOpen(!1,Re),!$&&!Re.isPropagationAllowed&&he.stopPropagation()}),oe=st(he=>{const we=Z();return we==="intentional"&&he.type!=="click"||we==="sloppy"&&he.type==="click"}),I=st(()=>{g.current.insideReactTree=!0,H.start(0,J)}),ie=st((he,we=!1)=>{var gt;if(oe(he)){J();return}if(g.current.insideReactTree){J();return}if(Z()==="intentional"&&we||typeof M=="function"&&!M(he))return;const De=qo(he),Ye=`[${Su("inert")}]`,Re=fn(a.select("floatingElement")).querySelectorAll(Ye),Ae=a.context.triggerElements;if(De&&(Ae.hasElement(De)||Ae.hasMatchingElement(yt=>Yt(yt,De))))return;let Le=qt(De)?De:null;for(;Le&&!Cs(Le);){const yt=Os(Le);if(Cs(yt)||!qt(yt))break;Le=yt}if(Re.length&&qt(De)&&!q6(De)&&!Yt(De,a.select("floatingElement"))&&Array.from(Re).every(yt=>!Yt(Le,yt)))return;if($n(De)&&!("touches"in he)){const yt=Cs(De),ht=pr(De),$t=/auto|scroll/,on=yt||$t.test(ht.overflowX),bn=yt||$t.test(ht.overflowY),bt=on&&De.clientWidth>0&&De.scrollWidth>De.clientWidth,Pt=bn&&De.clientHeight>0&&De.scrollHeight>De.clientHeight,Ft=ht.direction==="rtl",vn=Pt&&(Ft?he.offsetX<=De.offsetWidth-De.clientWidth:he.offsetX>De.clientWidth),ln=bt&&he.offsetY>De.clientHeight;if(vn||ln)return}const tt=(gt=g.current.floatingContext)==null?void 0:gt.nodeId,Ce=k&&Vl(k.nodesRef.current,tt).some(yt=>{var ht;return Wr(he,(ht=yt.context)==null?void 0:ht.elements.floating)});if(Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||Ce)return;const ot=k?Vl(k.nodesRef.current,tt):[];if(ot.length>0){let yt=!0;if(ot.forEach(ht=>{var $t;($t=ht.context)!=null&&$t.open&&!ht.context.dataRef.current.__outsidePressBubbles&&(yt=!1)}),!yt)return}a.setOpen(!1,yn(qN,he)),J()}),pe=st(he=>{Z()!=="sloppy"||he.pointerType==="touch"||!a.select("open")||!m||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||ie(he)}),L=st(he=>{if(Z()!=="sloppy"||!a.select("open")||!m||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement")))return;const we=he.touches[0];we&&(z.current={startTime:Date.now(),startX:we.clientX,startY:we.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},te.start(1e3,()=>{z.current&&(z.current.dismissOnTouchEnd=!1,z.current.dismissOnMouseDown=!1)}))}),ce=st(he=>{const we=qo(he);function De(){L(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)}),ae=st(he=>{const we=Y.current;if(Y.current=!1,te.clear(),he.type==="mousedown"&&z.current&&!z.current.dismissOnMouseDown)return;const De=qo(he);function Ye(){he.type==="pointerdown"?pe(he):ie(he,we),De==null||De.removeEventListener(he.type,Ye)}De==null||De.addEventListener(he.type,Ye)}),me=st(he=>{if(Z()!=="sloppy"||!z.current||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement")))return;const we=he.touches[0];if(!we)return;const De=Math.abs(we.clientX-z.current.startX),Ye=Math.abs(we.clientY-z.current.startY),Re=Math.sqrt(De*De+Ye*Ye);Re>5&&(z.current.dismissOnTouchEnd=!0),Re>10&&(ie(he),te.clear(),z.current=null)}),Te=st(he=>{const we=qo(he);function De(){me(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)}),Ue=st(he=>{Z()!=="sloppy"||!z.current||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||(z.current.dismissOnTouchEnd&&ie(he),te.clear(),z.current=null)}),ve=st(he=>{const we=qo(he);function De(){Ue(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)});x.useEffect(()=>{if(!s||!m)return;g.current.__escapeKeyBubbles=$,g.current.__outsidePressBubbles=_;const he=new Fa;function we(Le){a.setOpen(!1,yn(fg,Le))}function De(){he.clear(),N.current=!0}function Ye(){he.start(gg()?5:0,()=>{N.current=!1})}const Re=fn(l);Re.addEventListener("pointerdown",ne,!0),b&&(Re.addEventListener("keydown",j),Re.addEventListener("compositionstart",De),Re.addEventListener("compositionend",Ye)),M&&(Re.addEventListener("click",ae,!0),Re.addEventListener("pointerdown",ae,!0),Re.addEventListener("touchstart",ce,!0),Re.addEventListener("touchmove",Te,!0),Re.addEventListener("touchend",ve,!0),Re.addEventListener("mousedown",ae,!0));let Ae=[];return T&&(qt(f)&&(Ae=Li(f)),qt(l)&&(Ae=Ae.concat(Li(l))),!qt(c)&&c&&c.contextElement&&(Ae=Ae.concat(Li(c.contextElement)))),Ae=Ae.filter(Le=>{var tt;return Le!==((tt=Re.defaultView)==null?void 0:tt.visualViewport)}),Ae.forEach(Le=>{Le.addEventListener("scroll",we,{passive:!0})}),()=>{Re.removeEventListener("pointerdown",ne,!0),b&&(Re.removeEventListener("keydown",j),Re.removeEventListener("compositionstart",De),Re.removeEventListener("compositionend",Ye)),M&&(Re.removeEventListener("click",ae,!0),Re.removeEventListener("pointerdown",ae,!0),Re.removeEventListener("touchstart",ce,!0),Re.removeEventListener("touchmove",Te,!0),Re.removeEventListener("touchend",ve,!0),Re.removeEventListener("mousedown",ae,!0)),Ae.forEach(Le=>{Le.removeEventListener("scroll",we)}),he.clear(),Y.current=!1}},[g,l,c,f,b,M,s,h,T,m,$,_,j,ie,ae,pe,ce,Te,ve,ne,a]),x.useEffect(J,[M,J]);const ze=x.useMemo(()=>({onKeyDown:j,...w&&{[UV[E]]:he=>{a.setOpen(!1,yn(Lf,he.nativeEvent))},...E!=="intentional"&&{onClick(he){a.setOpen(!1,yn(Lf,he.nativeEvent))}}}}),[j,a,w,E]),je=st(he=>{const we=qo(he.nativeEvent);!Yt(a.select("floatingElement"),we)||he.button!==0||(Y.current=!0)}),at=st(he=>{!s||!m||he.button!==0||(Y.current=!0)}),xe=x.useMemo(()=>({onKeyDown:j,onPointerDown:je,onMouseDown:je,onMouseUp:je,onClickCapture:I,onMouseDownCapture(he){I(),at(he)},onPointerDownCapture(he){I(),at(he)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[j,je,I,at]);return x.useMemo(()=>m?{reference:ze,floating:xe,trigger:ze}:{},[m,ze,xe])}var jV=(o,n,a)=>{if(n.length===1&&n[0]===a){let s=!1;try{const l={};o(l)===l&&(s=!0)}catch{}if(s){let l;try{throw new Error}catch(c){({stack:l}=c)}console.warn(`The result function returned its own inputs without modification. e.g
422
+ */var u8=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Jm=u8.join(","),AM=typeof Element>"u",vu=AM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Zm=!AM&&Element.prototype.getRootNode?function(o){var n;return o==null||(n=o.getRootNode)===null||n===void 0?void 0:n.call(o)}:function(o){return o==null?void 0:o.ownerDocument},eg=function(n,a){var s;a===void 0&&(a=!0);var l=n==null||(s=n.getAttribute)===null||s===void 0?void 0:s.call(n,"inert"),c=l===""||l==="true",f=c||a&&n&&(typeof n.closest=="function"?n.closest("[inert]"):eg(n.parentNode));return f},d8=function(n){var a,s=n==null||(a=n.getAttribute)===null||a===void 0?void 0:a.call(n,"contenteditable");return s===""||s==="true"},NM=function(n,a,s){if(eg(n))return[];var l=Array.prototype.slice.apply(n.querySelectorAll(Jm));return a&&vu.call(n,Jm)&&l.unshift(n),l=l.filter(s),l},tg=function(n,a,s){for(var l=[],c=Array.from(n);c.length;){var f=c.shift();if(!eg(f,!1))if(f.tagName==="SLOT"){var h=f.assignedElements(),g=h.length?h:f.children,m=tg(g,!0,s);s.flatten?l.push.apply(l,m):l.push({scopeParent:f,candidates:m})}else{var b=vu.call(f,Jm);b&&s.filter(f)&&(a||!n.includes(f))&&l.push(f);var p=f.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(f),v=!eg(p,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(f));if(p&&v){var w=tg(p===!0?f.children:p.children,!0,s);s.flatten?l.push.apply(l,w):l.push({scopeParent:f,candidates:w})}else c.unshift.apply(c,f.children)}}return l},MM=function(n){return!isNaN(parseInt(n.getAttribute("tabindex"),10))},_M=function(n){if(!n)throw new Error("No node provided");return n.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(n.tagName)||d8(n))&&!MM(n)?0:n.tabIndex},f8=function(n,a){var s=_M(n);return s<0&&a&&!MM(n)?0:s},h8=function(n,a){return n.tabIndex===a.tabIndex?n.documentOrder-a.documentOrder:n.tabIndex-a.tabIndex},kM=function(n){return n.tagName==="INPUT"},p8=function(n){return kM(n)&&n.type==="hidden"},m8=function(n){var a=n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(s){return s.tagName==="SUMMARY"});return a},g8=function(n,a){for(var s=0;s<n.length;s++)if(n[s].checked&&n[s].form===a)return n[s]},y8=function(n){if(!n.name)return!0;var a=n.form||Zm(n),s=function(h){return a.querySelectorAll('input[type="radio"][name="'+h+'"]')},l;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")l=s(window.CSS.escape(n.name));else try{l=s(n.name)}catch(f){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",f.message),!1}var c=g8(l,n.form);return!c||c===n},b8=function(n){return kM(n)&&n.type==="radio"},v8=function(n){return b8(n)&&!y8(n)},S8=function(n){var a,s=n&&Zm(n),l=(a=s)===null||a===void 0?void 0:a.host,c=!1;if(s&&s!==n){var f,h,g;for(c=!!((f=l)!==null&&f!==void 0&&(h=f.ownerDocument)!==null&&h!==void 0&&h.contains(l)||n!=null&&(g=n.ownerDocument)!==null&&g!==void 0&&g.contains(n));!c&&l;){var m,b,p;s=Zm(l),l=(m=s)===null||m===void 0?void 0:m.host,c=!!((b=l)!==null&&b!==void 0&&(p=b.ownerDocument)!==null&&p!==void 0&&p.contains(l))}}return c},YD=function(n){var a=n.getBoundingClientRect(),s=a.width,l=a.height;return s===0&&l===0},w8=function(n,a){var s=a.displayCheck,l=a.getShadowRoot;if(s==="full-native"&&"checkVisibility"in n){var c=n.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!c}if(getComputedStyle(n).visibility==="hidden")return!0;var f=vu.call(n,"details>summary:first-of-type"),h=f?n.parentElement:n;if(vu.call(h,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof l=="function"){for(var g=n;n;){var m=n.parentElement,b=Zm(n);if(m&&!m.shadowRoot&&l(m)===!0)return YD(n);n.assignedSlot?n=n.assignedSlot:!m&&b!==n.ownerDocument?n=b.host:n=m}n=g}if(S8(n))return!n.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return YD(n);return!1},E8=function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var a=n.parentElement;a;){if(a.tagName==="FIELDSET"&&a.disabled){for(var s=0;s<a.children.length;s++){var l=a.children.item(s);if(l.tagName==="LEGEND")return vu.call(a,"fieldset[disabled] *")?!0:!l.contains(n)}return!0}a=a.parentElement}return!1},SS=function(n,a){return!(a.disabled||p8(a)||w8(a,n)||m8(a)||E8(a))},wS=function(n,a){return!(v8(a)||_M(a)<0||!SS(n,a))},x8=function(n){var a=parseInt(n.getAttribute("tabindex"),10);return!!(isNaN(a)||a>=0)},LM=function(n){var a=[],s=[];return n.forEach(function(l,c){var f=!!l.scopeParent,h=f?l.scopeParent:l,g=f8(h,f),m=f?LM(l.candidates):h;g===0?f?a.push.apply(a,m):a.push(h):s.push({documentOrder:c,tabIndex:g,item:l,isScope:f,content:m})}),s.sort(h8).reduce(function(l,c){return c.isScope?l.push.apply(l,c.content):l.push(c.content),l},[]).concat(a)},Kf=function(n,a){a=a||{};var s;return a.getShadowRoot?s=tg([n],a.includeContainer,{filter:wS.bind(null,a),flatten:!1,getShadowRoot:a.getShadowRoot,shadowRootFilter:x8}):s=NM(n,a.includeContainer,wS.bind(null,a)),LM(s)},R8=function(n,a){a=a||{};var s;return a.getShadowRoot?s=tg([n],a.includeContainer,{filter:SS.bind(null,a),flatten:!0,getShadowRoot:a.getShadowRoot}):s=NM(n,a.includeContainer,SS.bind(null,a)),s},UM=function(n,a){if(a=a||{},!n)throw new Error("No node provided");return vu.call(n,Jm)===!1?!1:wS(a,n)};const Tu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function zM(o,n){const a=Kf(o,Tu()),s=a.length;if(s===0)return;const l=xs(fn(o)),c=a.indexOf(l),f=c===-1?n===1?0:s-1:c+n;return a[f]}function jM(o){return zM(fn(o).body,1)||o}function PM(o){return zM(fn(o).body,-1)||o}function HM(o,n){if(!o)return null;const a=Kf(fn(o).body,Tu()),s=a.length;if(s===0)return null;const l=a.indexOf(o);if(l===-1)return null;const c=(l+n+s)%s;return a[c]}function PY(o){return HM(o,1)}function HY(o){return HM(o,-1)}function xf(o,n){const a=n||o.currentTarget,s=o.relatedTarget;return!s||!Yt(a,s)}function T8(o){Kf(o,Tu()).forEach(a=>{a.dataset.tabindex=a.getAttribute("tabindex")||"",a.setAttribute("tabindex","-1")})}function $D(o){o.querySelectorAll("[data-tabindex]").forEach(a=>{const s=a.dataset.tabindex;delete a.dataset.tabindex,s?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")})}const IM=x.forwardRef(function(n,a){const{className:s,render:l,orientation:c="horizontal",...f}=n;return Ln("div",n,{state:{orientation:c},ref:a,props:[{role:"separator","aria-orientation":c},f]})});IM.displayName="Separator";function C8({className:o,orientation:n="horizontal",...a}){return re.jsxDEV(IM,{"data-slot":"separator",orientation:n,className:jt("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",o),...a},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/separator.tsx",lineNumber:13,columnNumber:5},this)}const lw=x.createContext(void 0);lw.displayName="DialogRootContext";function Wl(o){const n=x.useContext(lw);if(o===!1&&n===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return n}let Ml=(function(o){return o.open="data-open",o.closed="data-closed",o[o.startingStyle=$l.startingStyle]="startingStyle",o[o.endingStyle=$l.endingStyle]="endingStyle",o.anchorHidden="data-anchor-hidden",o.side="data-side",o.align="data-align",o})({}),ng=(function(o){return o.popupOpen="data-popup-open",o.pressed="data-pressed",o})({});const O8={[ng.popupOpen]:""},D8={[ng.popupOpen]:"",[ng.pressed]:""},A8={[Ml.open]:""},N8={[Ml.closed]:""},M8={[Ml.anchorHidden]:""},_8={open(o){return o?O8:null}},IY={open(o){return o?D8:null}},Jf={open(o){return o?A8:N8},anchorHidden(o){return o?M8:null}},k8={...Jf,...Qf},BM=x.forwardRef(function(n,a){const{render:s,className:l,forceRender:c=!1,...f}=n,{store:h}=Wl(),g=h.useState("open"),m=h.useState("nested"),b=h.useState("mounted"),p=h.useState("transitionStatus");return Ln("div",n,{state:{open:g,transitionStatus:p},ref:[h.context.backdropRef,a],stateAttributesMapping:k8,props:[{role:"presentation",hidden:!b,style:{userSelect:"none",WebkitUserSelect:"none"}},f],enabled:c||!m})});BM.displayName="DialogBackdrop";const VM=x.forwardRef(function(n,a){const{render:s,className:l,disabled:c=!1,nativeButton:f=!0,...h}=n,{store:g}=Wl(),m=g.useState("open");function b(E){m&&g.setOpen(!1,yn(EB,E.nativeEvent))}const{getButtonProps:p,buttonRef:v}=ZS({disabled:c,native:f});return Ln("button",n,{state:{disabled:c},ref:[a,v],props:[{onClick:b},h,p]})});VM.displayName="DialogClose";const FM=x.forwardRef(function(n,a){const{render:s,className:l,id:c,...f}=n,{store:h}=Wl(),g=Xf(c);return h.useSyncedValueWithCleanup("descriptionElementId",g),Ln("p",n,{ref:a,props:[{id:g},f]})});FM.displayName="DialogDescription";function Pa(o){const n=mr(L8,o).current;return n.next=o,pt(n.effect),n}function L8(o){const n={current:o,next:o,effect:()=>{n.current=n.next}};return n}function YM(){const o=new Map;return{emit(n,a){var s;(s=o.get(n))==null||s.forEach(l=>l(a))},on(n,a){o.has(n)||o.set(n,new Set),o.get(n).add(a)},off(n,a){var s;(s=o.get(n))==null||s.delete(a)}}}class U8{constructor(){We(this,"nodesRef",{current:[]});We(this,"events",YM())}addNode(n){this.nodesRef.current.push(n)}removeNode(n){const a=this.nodesRef.current.findIndex(s=>s===n);a!==-1&&this.nodesRef.current.splice(a,1)}}const cw=x.createContext(null);cw.displayName="FloatingNodeContext";const uw=x.createContext(null);uw.displayName="FloatingTreeContext";const Cu=()=>{var o;return((o=x.useContext(cw))==null?void 0:o.id)||null},Ou=o=>{const n=x.useContext(uw);return o??n};function BY(o){const n=wu(),a=Ou(o),s=Cu();return pt(()=>{if(!n)return;const l={id:n,parentId:s};return a==null||a.addNode(l),()=>{a==null||a.removeNode(l)}},[a,n,s]),n}function VY(o){const{children:n,id:a}=o,s=Cu();return nn.jsx(cw.Provider,{value:x.useMemo(()=>({id:a,parentId:s}),[a,s]),children:n})}function FY(o){const{children:n,externalTree:a}=o,s=mr(()=>a??new U8).current;return nn.jsx(uw.Provider,{value:s,children:n})}function Su(o){return`data-base-ui-${o}`}function jm(o,n,a){if(a&&!Uf(a))return 0;if(typeof o=="number")return o;if(typeof o=="function"){const s=o();return typeof s=="number"?s:s==null?void 0:s[n]}return o==null?void 0:o[n]}const $M=x.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Fa,currentIdRef:{current:null},currentContextRef:{current:null}});$M.displayName="FloatingDelayGroupContext";function z8(o,n={open:!1}){const a="rootStore"in o?o.rootStore:o,s=a.useState("floatingId"),{open:l}=n,c=x.useContext($M),{currentIdRef:f,delayRef:h,timeoutMs:g,initialDelayRef:m,currentContextRef:b,hasProvider:p,timeout:v}=c,[w,E]=x.useState(!1);return pt(()=>{function T(){var C;E(!1),(C=b.current)==null||C.setIsInstantPhase(!1),f.current=null,b.current=null,h.current=m.current}if(f.current&&!l&&f.current===s){if(E(!1),g){const C=s;return v.start(g,()=>{a.select("open")||f.current&&f.current!==C||T()}),()=>{v.clear()}}T()}},[l,s,f,h,g,m,b,v,a]),pt(()=>{if(!l)return;const T=b.current,C=f.current;v.clear(),b.current={onOpenChange:a.setOpen,setIsInstantPhase:E},f.current=s,h.current={open:0,close:jm(m.current,"close")},C!==null&&C!==s?(E(!0),T==null||T.setIsInstantPhase(!0),T==null||T.onOpenChange(!1,yn(fg))):(E(!1),T==null||T.setIsInstantPhase(!1))},[l,s,a,f,h,g,m,b,v]),pt(()=>()=>{b.current=null},[b]),x.useMemo(()=>({hasProvider:p,delayRef:h,isInstantPhase:w}),[p,h,w])}const qM={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},GM={...qM,position:"fixed",top:0,left:0},YY={...qM,position:"absolute"},zf=x.forwardRef(function(n,a){const[s,l]=x.useState();pt(()=>{xM&&l("button")},[]);const c={tabIndex:0,role:s};return nn.jsx("span",{...n,ref:a,style:GM,"aria-hidden":s?void 0:!0,...c,"data-base-ui-focus-guard":""})});zf.displayName="FocusGuard";let qD=0;function O0(o,n={}){const{preventScroll:a=!1,cancelPrevious:s=!0,sync:l=!1}=n;s&&cancelAnimationFrame(qD);const c=()=>o==null?void 0:o.focus({preventScroll:a});l?c():qD=requestAnimationFrame(c)}const ru={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function GD(o){return o==="inert"?ru.inert:o==="aria-hidden"?ru["aria-hidden"]:ru.none}let Rm=new WeakSet,Tm={},D0=0;const XM=o=>o&&(o.host||XM(o.parentNode)),j8=(o,n)=>n.map(a=>{if(o.contains(a))return a;const s=XM(a);return o.contains(s)?s:null}).filter(a=>a!=null);function P8(o,n,a,s){const l="data-base-ui-inert",c=s?"inert":a?"aria-hidden":null,f=j8(n,o),h=new Set,g=new Set(f),m=[];Tm[l]||(Tm[l]=new WeakMap);const b=Tm[l];f.forEach(p),v(n),h.clear();function p(w){!w||h.has(w)||(h.add(w),w.parentNode&&p(w.parentNode))}function v(w){!w||g.has(w)||[].forEach.call(w.children,E=>{if(ji(E)!=="script")if(h.has(E))v(E);else{const T=c?E.getAttribute(c):null,C=T!==null&&T!=="false",A=GD(c),k=(A.get(E)||0)+1,U=(b.get(E)||0)+1;A.set(E,k),b.set(E,U),m.push(E),k===1&&C&&Rm.add(E),U===1&&E.setAttribute(l,""),!C&&c&&E.setAttribute(c,c==="inert"?"":"true")}})}return D0+=1,()=>{m.forEach(w=>{const E=GD(c),C=(E.get(w)||0)-1,A=(b.get(w)||0)-1;E.set(w,C),b.set(w,A),C||(!Rm.has(w)&&c&&w.removeAttribute(c),Rm.delete(w)),A||w.removeAttribute(l)}),D0-=1,D0||(ru.inert=new WeakMap,ru["aria-hidden"]=new WeakMap,ru.none=new WeakMap,Rm=new WeakSet,Tm={})}}function H8(o,n=!1,a=!1){const s=fn(o[0]).body;return P8(o.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,n,a)}const dw=x.createContext(null);dw.displayName="PortalContext";const QM=()=>x.useContext(dw),I8=Su("portal");function WM(o={}){const{ref:n,container:a,componentProps:s=fr,elementProps:l}=o,c=wu(),f=QM(),h=f==null?void 0:f.portalNode,[g,m]=x.useState(null),[b,p]=x.useState(null),v=st(C=>{C!==null&&p(C)}),w=x.useRef(null);pt(()=>{if(a===null){w.current&&(w.current=null,p(null),m(null));return}if(c==null)return;const C=(a&&(KS(a)?a:a.current))??h??document.body;if(C==null){w.current&&(w.current=null,p(null),m(null));return}w.current!==C&&(w.current=C,p(null),m(C))},[a,h,c]);const E=Ln("div",s,{ref:[n,v],props:[{id:c,[I8]:""},l]});return{portalNode:b,portalSubtree:g&&E?zi.createPortal(E,g):null}}const KM=x.forwardRef(function(n,a){const{children:s,container:l,className:c,render:f,renderGuards:h,...g}=n,{portalNode:m,portalSubtree:b}=WM({container:l,ref:a,componentProps:n,elementProps:g}),p=x.useRef(null),v=x.useRef(null),w=x.useRef(null),E=x.useRef(null),[T,C]=x.useState(null),A=T==null?void 0:T.modal,k=T==null?void 0:T.open,U=typeof h=="boolean"?h:!!T&&!T.modal&&T.open&&!!m;x.useEffect(()=>{if(!m||A)return;function Y($){m&&$.relatedTarget&&xf($)&&($.type==="focusin"?$D:T8)(m)}return m.addEventListener("focusin",Y,!0),m.addEventListener("focusout",Y,!0),()=>{m.removeEventListener("focusin",Y,!0),m.removeEventListener("focusout",Y,!0)}},[m,A]),x.useEffect(()=>{!m||k||$D(m)},[k,m]);const M=x.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:v,beforeInsideRef:w,afterInsideRef:E,portalNode:m,setFocusManagerState:C}),[m]);return nn.jsxs(x.Fragment,{children:[b,nn.jsxs(dw.Provider,{value:M,children:[U&&m&&nn.jsx(zf,{"data-type":"outside",ref:p,onFocus:Y=>{var $;if(xf(Y,m))($=w.current)==null||$.focus();else{const _=T?T.domReference:null,z=PM(_);z==null||z.focus()}}}),U&&m&&nn.jsx("span",{"aria-owns":m.id,style:pB}),m&&zi.createPortal(s,m),U&&m&&nn.jsx(zf,{"data-type":"outside",ref:v,onFocus:Y=>{var $;if(xf(Y,m))($=E.current)==null||$.focus();else{const _=T?T.domReference:null,z=jM(_);z==null||z.focus(),T!=null&&T.closeOnFocusOut&&(T==null||T.onOpenChange(!1,yn(GN,Y.nativeEvent)))}}})]})]})});KM.displayName="FloatingPortal";function B8(o,n){const a=Gn(o.target);return o instanceof a.KeyboardEvent?"keyboard":o instanceof a.FocusEvent?n||"keyboard":"pointerType"in o?o.pointerType||"keyboard":"touches"in o?"touch":o instanceof a.MouseEvent?n||(o.detail===0?"keyboard":"mouse"):""}const XD=20;let Mi=[];function fw(){Mi=Mi.filter(o=>{var n;return(n=o.deref())==null?void 0:n.isConnected})}function V8(o){fw(),o&&ji(o)!=="body"&&(Mi.push(new WeakRef(o)),Mi.length>XD&&(Mi=Mi.slice(-XD)))}function A0(){var o;return fw(),(o=Mi[Mi.length-1])==null?void 0:o.deref()}function F8(o){if(!o)return null;const n=Tu();return UM(o,n)?o:Kf(o,n)[0]||o}function Y8(o){return!o||!o.isConnected?!1:typeof o.checkVisibility=="function"?o.checkVisibility():pr(o).display!=="none"}function QD(o,n){var f;if(!n.current.includes("floating")&&!((f=o.getAttribute("role"))!=null&&f.includes("dialog")))return;const a=Tu(),l=R8(o,a).filter(h=>{const g=h.getAttribute("data-tabindex")||"";return UM(h,a)||h.hasAttribute("data-tabindex")&&!g.startsWith("-")}),c=o.getAttribute("tabindex");n.current.includes("floating")||l.length===0?c!=="0"&&o.setAttribute("tabindex","0"):(c!=="-1"||o.hasAttribute("data-tabindex")&&o.getAttribute("data-tabindex")!=="-1")&&(o.setAttribute("tabindex","-1"),o.setAttribute("data-tabindex","-1"))}function $8(o){const{context:n,children:a,disabled:s=!1,initialFocus:l=!0,returnFocus:c=!0,restoreFocus:f=!1,modal:h=!0,closeOnFocusOut:g=!0,openInteractionType:m="",nextFocusableElement:b,previousFocusableElement:p,beforeContentFocusGuardRef:v,externalTree:w}=o,E="rootStore"in n?n.rootStore:n,T=E.useState("open"),C=E.useState("domReferenceElement"),A=E.useState("floatingElement"),{events:k,dataRef:U}=E.context,M=st(()=>{var we;return(we=U.current.floatingContext)==null?void 0:we.nodeId}),Y=l===!1,$=ID(C)&&Y,_=x.useRef(["content"]),z=Pa(l),te=Pa(c),H=Pa(m),J=Ou(w),N=QM(),P=x.useRef(null),ne=x.useRef(null),Z=x.useRef(!1),j=x.useRef(!1),oe=x.useRef(!1),I=x.useRef(-1),ie=x.useRef(""),pe=x.useRef(""),L=x.useRef(null),ce=x.useRef(null),se=kf(L,v,N==null?void 0:N.beforeInsideRef),me=kf(ce,N==null?void 0:N.afterInsideRef),Te=Ds(),Ue=Ds(),ve=QS(),ze=N!=null,je=yS(A),at=st((we=je)=>we?Kf(we,Tu()):[]),xe=st(we=>{const De=at(we);return _.current.map(()=>De).filter(Boolean).flat()});x.useEffect(()=>{if(s||!h)return;function we(Ye){Ye.key==="Tab"&&Yt(je,xs(fn(je)))&&at().length===0&&!$&&X6(Ye)}const De=fn(je);return De.addEventListener("keydown",we),()=>{De.removeEventListener("keydown",we)}},[s,C,je,h,_,$,at,xe]),x.useEffect(()=>{if(s||!T)return;const we=fn(je);function De(){oe.current=!1}function Ye(Ae){const Le=qo(Ae),tt=Yt(A,Le)||Yt(C,Le)||Yt(N==null?void 0:N.portalNode,Le);oe.current=!tt,pe.current=Ae.pointerType||"keyboard",Le!=null&&Le.closest(`[${fB}]`)&&(j.current=!0)}function Re(){pe.current="keyboard"}return we.addEventListener("pointerdown",Ye,!0),we.addEventListener("pointerup",De,!0),we.addEventListener("pointercancel",De,!0),we.addEventListener("keydown",Re,!0),()=>{we.removeEventListener("pointerdown",Ye,!0),we.removeEventListener("pointerup",De,!0),we.removeEventListener("pointercancel",De,!0),we.removeEventListener("keydown",Re,!0)}},[s,A,C,je,T,N]),x.useEffect(()=>{if(s||!g)return;const we=fn(je);function De(){j.current=!0,Ue.start(0,()=>{j.current=!1})}function Ye(Ce){const ot=qo(Ce),yt=at().indexOf(ot);yt!==-1&&(I.current=yt)}function Re(Ce){const ot=Ce.relatedTarget,gt=Ce.currentTarget,yt=qo(Ce);queueMicrotask(()=>{const ht=M(),$t=E.context.triggerElements,on=(ot==null?void 0:ot.hasAttribute(Su("focus-guard")))&&[L.current,ce.current,N==null?void 0:N.beforeInsideRef.current,N==null?void 0:N.afterInsideRef.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ws(p),ws(b)].includes(ot),bn=!(Yt(C,ot)||Yt(A,ot)||Yt(ot,A)||Yt(N==null?void 0:N.portalNode,ot)||ot!=null&&$t.hasElement(ot)||$t.hasMatchingElement(bt=>Yt(bt,ot))||on||J&&(Vl(J.nodesRef.current,ht).find(bt=>{var Pt,Ft;return Yt((Pt=bt.context)==null?void 0:Pt.elements.floating,ot)||Yt((Ft=bt.context)==null?void 0:Ft.elements.domReference,ot)})||BD(J.nodesRef.current,ht).find(bt=>{var Pt,Ft,vn;return[(Pt=bt.context)==null?void 0:Pt.elements.floating,yS((Ft=bt.context)==null?void 0:Ft.elements.floating)].includes(ot)||((vn=bt.context)==null?void 0:vn.elements.domReference)===ot})));if(gt===C&&je&&QD(je,_),f&&gt!==C&&!Y8(yt)&&xs(we)===we.body){if($n(je)&&(je.focus(),f==="popup")){ve.request(()=>{je.focus()});return}const bt=I.current,Pt=at(),Ft=Pt[bt]||Pt[Pt.length-1]||je;$n(Ft)&&Ft.focus()}if(U.current.insideReactTree){U.current.insideReactTree=!1;return}($||!h)&&ot&&bn&&!j.current&&($||ot!==A0())&&(Z.current=!0,E.setOpen(!1,yn(GN,Ce)))})}function Ae(){oe.current||(U.current.insideReactTree=!0,Te.start(0,()=>{U.current.insideReactTree=!1}))}const Le=$n(C)?C:null,tt=[];if(!(!A&&!Le))return Le&&(Le.addEventListener("focusout",Re),Le.addEventListener("pointerdown",De),tt.push(()=>{Le.removeEventListener("focusout",Re),Le.removeEventListener("pointerdown",De)})),A&&(A.addEventListener("focusin",Ye),A.addEventListener("focusout",Re),N&&(A.addEventListener("focusout",Ae,!0),tt.push(()=>{A.removeEventListener("focusout",Ae,!0)})),tt.push(()=>{A.removeEventListener("focusin",Ye),A.removeEventListener("focusout",Re)})),()=>{tt.forEach(Ce=>{Ce()})}},[s,C,A,je,h,J,N,E,g,f,at,$,M,_,U,Te,Ue,ve,b,p]),x.useEffect(()=>{var Ae,Le,tt;if(s||!A||!T)return;const we=Array.from(((Ae=N==null?void 0:N.portalNode)==null?void 0:Ae.querySelectorAll(`[${Su("portal")}]`))||[]),Ye=(tt=(Le=(J?BD(J.nodesRef.current,M()):[]).find(Ce=>{var ot;return ID(((ot=Ce.context)==null?void 0:ot.elements.domReference)||null)}))==null?void 0:Le.context)==null?void 0:tt.elements.domReference,Re=[A,Ye,...we,P.current,ne.current,L.current,ce.current,N==null?void 0:N.beforeOutsideRef.current,N==null?void 0:N.afterOutsideRef.current,ws(p),ws(b),$?C:null].filter(Ce=>Ce!=null);return H8(Re,h||$)},[T,s,C,A,h,_,N,$,J,M,b,p]),pt(()=>{if(!T||s||!$n(je))return;const we=fn(je),De=xs(we);queueMicrotask(()=>{const Ye=xe(je),Re=z.current,Ae=typeof Re=="function"?Re(H.current||""):Re;if(Ae===void 0||Ae===!1)return;let Le;Ae===!0||Ae===null?Le=Ye[0]||je:Le=ws(Ae),Le=Le||Ye[0]||je,!Yt(je,De)&&O0(Le,{preventScroll:Le===je})})},[s,T,je,Y,xe,z,H]),pt(()=>{if(s||!je)return;const we=fn(je),De=xs(we);V8(De);function Ye(Le){if(Le.open||(ie.current=B8(Le.nativeEvent,pe.current)),Le.reason===Zr&&Le.nativeEvent.type==="mouseleave"&&(Z.current=!0),Le.reason===qN)if(Le.nested)Z.current=!1;else if(W6(Le.nativeEvent)||K6(Le.nativeEvent))Z.current=!1;else{let tt=!1;document.createElement("div").focus({get preventScroll(){return tt=!0,!1}}),tt?Z.current=!1:Z.current=!0}}k.on("openchange",Ye);const Re=we.createElement("span");Re.setAttribute("tabindex","-1"),Re.setAttribute("aria-hidden","true"),Object.assign(Re.style,GM),ze&&C&&C.insertAdjacentElement("afterend",Re);function Ae(){const Le=te.current;let tt=typeof Le=="function"?Le(ie.current):Le;if(tt===void 0||tt===!1)return null;if(tt===null&&(tt=!0),typeof tt=="boolean"){const ot=C||A0();return ot&&ot.isConnected?ot:Re}const Ce=C||A0()||Re;return ws(tt)||Ce}return()=>{k.off("openchange",Ye);const Le=xs(we),tt=Yt(A,Le)||J&&Vl(J.nodesRef.current,M(),!1).some(ot=>{var gt;return Yt((gt=ot.context)==null?void 0:gt.elements.floating,Le)}),Ce=Ae();queueMicrotask(()=>{const ot=F8(Ce),gt=typeof te.current!="boolean";te.current&&!Z.current&&$n(ot)&&(!(!gt&&ot!==Le&&Le!==we.body)||tt)&&ot.focus({preventScroll:!0}),Re.remove(),Z.current=!1})}},[s,A,je,te,U,k,J,ze,C,M]),pt(()=>{if(!ow||T||!A)return;const we=xs(fn(A));!$n(we)||!rw(we)||Yt(A,we)&&we.blur()},[T,A]),pt(()=>{if(!(s||!N))return N.setFocusManagerState({modal:h,closeOnFocusOut:g,open:T,onOpenChange:E.setOpen,domReference:C}),()=>{N.setFocusManagerState(null)}},[s,N,h,T,E,g,C]),pt(()=>{if(!(s||!je))return QD(je,_),()=>{queueMicrotask(fw)}},[s,je,_]);const he=!s&&(h?!$:!0)&&(ze||h);return nn.jsxs(x.Fragment,{children:[he&&nn.jsx(zf,{"data-type":"inside",ref:se,onFocus:we=>{var De;if(h){const Ye=xe();O0(Ye[Ye.length-1])}else if(N!=null&&N.portalNode)if(Z.current=!1,xf(we,N.portalNode)){const Ye=jM(C);Ye==null||Ye.focus()}else(De=ws(p??N.beforeOutsideRef))==null||De.focus()}}),a,he&&nn.jsx(zf,{"data-type":"inside",ref:me,onFocus:we=>{var De;if(h)O0(xe()[0]);else if(N!=null&&N.portalNode)if(g&&(Z.current=!0),xf(we,N.portalNode)){const Ye=PM(C);Ye==null||Ye.focus()}else(De=ws(b??N.afterOutsideRef))==null||De.focus()}})]})}function q8(o,n){let a=null,s=null,l=!1;return{contextElement:o||void 0,getBoundingClientRect(){var w;const c=(o==null?void 0:o.getBoundingClientRect())||{width:0,height:0,x:0,y:0},f=n.axis==="x"||n.axis==="both",h=n.axis==="y"||n.axis==="both",g=["mouseenter","mousemove"].includes(((w=n.dataRef.current.openEvent)==null?void 0:w.type)||"")&&n.pointerType!=="touch";let m=c.width,b=c.height,p=c.x,v=c.y;return a==null&&n.x&&f&&(a=c.x-n.x),s==null&&n.y&&h&&(s=c.y-n.y),p-=a||0,v-=s||0,m=0,b=0,!l||g?(m=n.axis==="y"?c.width:0,b=n.axis==="x"?c.height:0,p=f&&n.x!=null?n.x:p,v=h&&n.y!=null?n.y:v):l&&!g&&(b=n.axis==="x"?c.height:b,m=n.axis==="y"?c.width:m),l=!0,{width:m,height:b,x:p,y:v,top:v,right:p+m,bottom:v+b,left:p}}}}function WD(o){return o!=null&&o.clientX!=null}function G8(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("domReferenceElement"),f=a.context.dataRef,{enabled:h=!0,axis:g="both"}=n,m=x.useRef(!1),b=x.useRef(null),[p,v]=x.useState(),[w,E]=x.useState([]),T=st((M,Y,$)=>{m.current||f.current.openEvent&&!WD(f.current.openEvent)||a.set("positionReference",q8($??c,{x:M,y:Y,axis:g,dataRef:f,pointerType:p}))}),C=st(M=>{s?b.current||E([]):T(M.clientX,M.clientY,M.currentTarget)}),A=Uf(p)?l:s,k=x.useCallback(()=>{if(!A||!h)return;const M=Gn(l);function Y($){const _=qo($);Yt(l,_)?(M.removeEventListener("mousemove",Y),b.current=null):T($.clientX,$.clientY)}if(!f.current.openEvent||WD(f.current.openEvent)){M.addEventListener("mousemove",Y);const $=()=>{M.removeEventListener("mousemove",Y),b.current=null};return b.current=$,$}a.set("positionReference",c)},[A,h,l,f,c,a,T]);x.useEffect(()=>k(),[k,w]),x.useEffect(()=>{h&&!l&&(m.current=!1)},[h,l]),x.useEffect(()=>{!h&&s&&(m.current=!0)},[h,s]);const U=x.useMemo(()=>{function M(Y){v(Y.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return x.useMemo(()=>h?{reference:U,trigger:U}:{},[h,U])}function KD(o,n,a){let{reference:s,floating:l}=o;const c=Lr(n),f=iw(n),h=sw(f),g=Go(n),m=c==="y",b=s.x+s.width/2-l.width/2,p=s.y+s.height/2-l.height/2,v=s[h]/2-l[h]/2;let w;switch(g){case"top":w={x:b,y:s.y-l.height};break;case"bottom":w={x:b,y:s.y+s.height};break;case"right":w={x:s.x+s.width,y:p};break;case"left":w={x:s.x-l.width,y:p};break;default:w={x:s.x,y:s.y}}switch(Hi(n)){case"start":w[f]-=v*(a&&m?-1:1);break;case"end":w[f]+=v*(a&&m?-1:1);break}return w}async function X8(o,n){var a;n===void 0&&(n={});const{x:s,y:l,platform:c,rects:f,elements:h,strategy:g}=o,{boundary:m="clippingAncestors",rootBoundary:b="viewport",elementContext:p="floating",altBoundary:v=!1,padding:w=0}=As(n,o),E=DM(w),C=h[v?p==="floating"?"reference":"floating":p],A=Km(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(C)))==null||a?C:C.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(h.floating)),boundary:m,rootBoundary:b,strategy:g})),k=p==="floating"?{x:s,y:l,width:f.floating.width,height:f.floating.height}:f.reference,U=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h.floating)),M=await(c.isElement==null?void 0:c.isElement(U))?await(c.getScale==null?void 0:c.getScale(U))||{x:1,y:1}:{x:1,y:1},Y=Km(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:k,offsetParent:U,strategy:g}):k);return{top:(A.top-Y.top+E.top)/M.y,bottom:(Y.bottom-A.bottom+E.bottom)/M.y,left:(A.left-Y.left+E.left)/M.x,right:(Y.right-A.right+E.right)/M.x}}const Q8=async(o,n,a)=>{const{placement:s="bottom",strategy:l="absolute",middleware:c=[],platform:f}=a,h=c.filter(Boolean),g=await(f.isRTL==null?void 0:f.isRTL(n));let m=await f.getElementRects({reference:o,floating:n,strategy:l}),{x:b,y:p}=KD(m,s,g),v=s,w={},E=0;for(let C=0;C<h.length;C++){var T;const{name:A,fn:k}=h[C],{x:U,y:M,data:Y,reset:$}=await k({x:b,y:p,initialPlacement:s,placement:v,strategy:l,middlewareData:w,rects:m,platform:{...f,detectOverflow:(T=f.detectOverflow)!=null?T:X8},elements:{reference:o,floating:n}});b=U??b,p=M??p,w={...w,[A]:{...w[A],...Y}},$&&E<=50&&(E++,typeof $=="object"&&($.placement&&(v=$.placement),$.rects&&(m=$.rects===!0?await f.getElementRects({reference:o,floating:n,strategy:l}):$.rects),{x:b,y:p}=KD(m,v,g)),C=-1)}return{x:b,y:p,placement:v,strategy:l,middlewareData:w}},W8=function(o){return o===void 0&&(o={}),{name:"flip",options:o,async fn(n){var a,s;const{placement:l,middlewareData:c,rects:f,initialPlacement:h,platform:g,elements:m}=n,{mainAxis:b=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...C}=As(o,n);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const A=Go(l),k=Lr(h),U=Go(h)===h,M=await(g.isRTL==null?void 0:g.isRTL(m.floating)),Y=v||(U||!T?[Wm(h)]:r8(h)),$=E!=="none";!v&&$&&Y.push(...l8(h,T,E,M));const _=[h,...Y],z=await g.detectOverflow(n,C),te=[];let H=((s=c.flip)==null?void 0:s.overflows)||[];if(b&&te.push(z[A]),p){const ne=o8(l,f,M);te.push(z[ne[0]],z[ne[1]])}if(H=[...H,{placement:l,overflows:te}],!te.every(ne=>ne<=0)){var J,N;const ne=(((J=c.flip)==null?void 0:J.index)||0)+1,Z=_[ne];if(Z&&(!(p==="alignment"?k!==Lr(Z):!1)||H.every(I=>Lr(I.placement)===k?I.overflows[0]>0:!0)))return{data:{index:ne,overflows:H},reset:{placement:Z}};let j=(N=H.filter(oe=>oe.overflows[0]<=0).sort((oe,I)=>oe.overflows[1]-I.overflows[1])[0])==null?void 0:N.placement;if(!j)switch(w){case"bestFit":{var P;const oe=(P=H.filter(I=>{if($){const ie=Lr(I.placement);return ie===k||ie==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(ie=>ie>0).reduce((ie,pe)=>ie+pe,0)]).sort((I,ie)=>I[1]-ie[1])[0])==null?void 0:P[0];oe&&(j=oe);break}case"initialPlacement":j=h;break}if(l!==j)return{reset:{placement:j}}}return{}}}};function JD(o,n){return{top:o.top-n.height,right:o.right-n.width,bottom:o.bottom-n.height,left:o.left-n.width}}function ZD(o){return Z6.some(n=>o[n]>=0)}const K8=function(o){return o===void 0&&(o={}),{name:"hide",options:o,async fn(n){const{rects:a,platform:s}=n,{strategy:l="referenceHidden",...c}=As(o,n);switch(l){case"referenceHidden":{const f=await s.detectOverflow(n,{...c,elementContext:"reference"}),h=JD(f,a.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:ZD(h)}}}case"escaped":{const f=await s.detectOverflow(n,{...c,altBoundary:!0}),h=JD(f,a.floating);return{data:{escapedOffsets:h,escaped:ZD(h)}}}default:return{}}}}},JM=new Set(["left","top"]);async function J8(o,n){const{placement:a,platform:s,elements:l}=o,c=await(s.isRTL==null?void 0:s.isRTL(l.floating)),f=Go(a),h=Hi(a),g=Lr(a)==="y",m=JM.has(f)?-1:1,b=c&&g?-1:1,p=As(n,o);let{mainAxis:v,crossAxis:w,alignmentAxis:E}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return h&&typeof E=="number"&&(w=h==="end"?E*-1:E),g?{x:w*b,y:v*m}:{x:v*m,y:w*b}}const Z8=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(n){var a,s;const{x:l,y:c,placement:f,middlewareData:h}=n,g=await J8(n,o);return f===((a=h.offset)==null?void 0:a.placement)&&(s=h.arrow)!=null&&s.alignmentOffset?{}:{x:l+g.x,y:c+g.y,data:{...g,placement:f}}}}},eV=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(n){const{x:a,y:s,placement:l,platform:c}=n,{mainAxis:f=!0,crossAxis:h=!1,limiter:g={fn:A=>{let{x:k,y:U}=A;return{x:k,y:U}}},...m}=As(o,n),b={x:a,y:s},p=await c.detectOverflow(n,m),v=Lr(Go(l)),w=aw(v);let E=b[w],T=b[v];if(f){const A=w==="y"?"top":"left",k=w==="y"?"bottom":"right",U=E+p[A],M=E-p[k];E=bS(U,E,M)}if(h){const A=v==="y"?"top":"left",k=v==="y"?"bottom":"right",U=T+p[A],M=T-p[k];T=bS(U,T,M)}const C=g.fn({...n,[w]:E,[v]:T});return{...C,data:{x:C.x-a,y:C.y-s,enabled:{[w]:f,[v]:h}}}}}},tV=function(o){return o===void 0&&(o={}),{options:o,fn(n){const{x:a,y:s,placement:l,rects:c,middlewareData:f}=n,{offset:h=0,mainAxis:g=!0,crossAxis:m=!0}=As(o,n),b={x:a,y:s},p=Lr(l),v=aw(p);let w=b[v],E=b[p];const T=As(h,n),C=typeof T=="number"?{mainAxis:T,crossAxis:0}:{mainAxis:0,crossAxis:0,...T};if(g){const U=v==="y"?"height":"width",M=c.reference[v]-c.floating[U]+C.mainAxis,Y=c.reference[v]+c.reference[U]-C.mainAxis;w<M?w=M:w>Y&&(w=Y)}if(m){var A,k;const U=v==="y"?"width":"height",M=JM.has(Go(l)),Y=c.reference[p]-c.floating[U]+(M&&((A=f.offset)==null?void 0:A[p])||0)+(M?0:C.crossAxis),$=c.reference[p]+c.reference[U]+(M?0:((k=f.offset)==null?void 0:k[p])||0)-(M?C.crossAxis:0);E<Y?E=Y:E>$&&(E=$)}return{[v]:w,[p]:E}}}},nV=function(o){return o===void 0&&(o={}),{name:"size",options:o,async fn(n){var a,s;const{placement:l,rects:c,platform:f,elements:h}=n,{apply:g=()=>{},...m}=As(o,n),b=await f.detectOverflow(n,m),p=Go(l),v=Hi(l),w=Lr(l)==="y",{width:E,height:T}=c.floating;let C,A;p==="top"||p==="bottom"?(C=p,A=v===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(A=p,C=v==="end"?"top":"bottom");const k=T-b.top-b.bottom,U=E-b.left-b.right,M=bu(T-b[C],k),Y=bu(E-b[A],U),$=!n.middlewareData.shift;let _=M,z=Y;if((a=n.middlewareData.shift)!=null&&a.enabled.x&&(z=U),(s=n.middlewareData.shift)!=null&&s.enabled.y&&(_=k),$&&!v){const H=dr(b.left,0),J=dr(b.right,0),N=dr(b.top,0),P=dr(b.bottom,0);w?z=E-2*(H!==0||J!==0?H+J:dr(b.left,b.right)):_=T-2*(N!==0||P!==0?N+P:dr(b.top,b.bottom))}await g({...n,availableWidth:z,availableHeight:_});const te=await f.getDimensions(h.floating);return E!==te.width||T!==te.height?{reset:{rects:!0}}:{}}}};function ZM(o){const n=pr(o);let a=parseFloat(n.width)||0,s=parseFloat(n.height)||0;const l=$n(o),c=l?o.offsetWidth:a,f=l?o.offsetHeight:s,h=Qm(a)!==c||Qm(s)!==f;return h&&(a=c,s=f),{width:a,height:s,$:h}}function hw(o){return qt(o)?o:o.contextElement}function au(o){const n=hw(o);if(!$n(n))return Ba(1);const a=n.getBoundingClientRect(),{width:s,height:l,$:c}=ZM(n);let f=(c?Qm(a.width):a.width)/s,h=(c?Qm(a.height):a.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const oV=Ba(0);function e_(o){const n=Gn(o);return!gg()||!n.visualViewport?oV:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function rV(o,n,a){return n===void 0&&(n=!1),!a||n&&a!==Gn(o)?!1:n}function ql(o,n,a,s){n===void 0&&(n=!1),a===void 0&&(a=!1);const l=o.getBoundingClientRect(),c=hw(o);let f=Ba(1);n&&(s?qt(s)&&(f=au(s)):f=au(o));const h=rV(c,a,s)?e_(c):Ba(0);let g=(l.left+h.x)/f.x,m=(l.top+h.y)/f.y,b=l.width/f.x,p=l.height/f.y;if(c){const v=Gn(c),w=s&&qt(s)?Gn(s):s;let E=v,T=dS(E);for(;T&&s&&w!==E;){const C=au(T),A=T.getBoundingClientRect(),k=pr(T),U=A.left+(T.clientLeft+parseFloat(k.paddingLeft))*C.x,M=A.top+(T.clientTop+parseFloat(k.paddingTop))*C.y;g*=C.x,m*=C.y,b*=C.x,p*=C.y,g+=U,m+=M,E=Gn(T),T=dS(E)}}return Km({width:b,height:p,x:g,y:m})}function vg(o,n){const a=yg(o).scrollLeft;return n?n.left+a:ql(Ya(o)).left+a}function t_(o,n){const a=o.getBoundingClientRect(),s=a.left+n.scrollLeft-vg(o,a),l=a.top+n.scrollTop;return{x:s,y:l}}function aV(o){let{elements:n,rect:a,offsetParent:s,strategy:l}=o;const c=l==="fixed",f=Ya(s),h=n?mg(n.floating):!1;if(s===f||h&&c)return a;let g={scrollLeft:0,scrollTop:0},m=Ba(1);const b=Ba(0),p=$n(s);if((p||!p&&!c)&&((ji(s)!=="body"||Pi(f))&&(g=yg(s)),$n(s))){const w=ql(s);m=au(s),b.x=w.x+s.clientLeft,b.y=w.y+s.clientTop}const v=f&&!p&&!c?t_(f,g):Ba(0);return{width:a.width*m.x,height:a.height*m.y,x:a.x*m.x-g.scrollLeft*m.x+b.x+v.x,y:a.y*m.y-g.scrollTop*m.y+b.y+v.y}}function sV(o){return Array.from(o.getClientRects())}function iV(o){const n=Ya(o),a=yg(o),s=o.ownerDocument.body,l=dr(n.scrollWidth,n.clientWidth,s.scrollWidth,s.clientWidth),c=dr(n.scrollHeight,n.clientHeight,s.scrollHeight,s.clientHeight);let f=-a.scrollLeft+vg(o);const h=-a.scrollTop;return pr(s).direction==="rtl"&&(f+=dr(n.clientWidth,s.clientWidth)-l),{width:l,height:c,x:f,y:h}}const eA=25;function lV(o,n){const a=Gn(o),s=Ya(o),l=a.visualViewport;let c=s.clientWidth,f=s.clientHeight,h=0,g=0;if(l){c=l.width,f=l.height;const b=gg();(!b||b&&n==="fixed")&&(h=l.offsetLeft,g=l.offsetTop)}const m=vg(s);if(m<=0){const b=s.ownerDocument,p=b.body,v=getComputedStyle(p),w=b.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,E=Math.abs(s.clientWidth-p.clientWidth-w);E<=eA&&(c-=E)}else m<=eA&&(c+=m);return{width:c,height:f,x:h,y:g}}const cV=new Set(["absolute","fixed"]);function uV(o,n){const a=ql(o,!0,n==="fixed"),s=a.top+o.clientTop,l=a.left+o.clientLeft,c=$n(o)?au(o):Ba(1),f=o.clientWidth*c.x,h=o.clientHeight*c.y,g=l*c.x,m=s*c.y;return{width:f,height:h,x:g,y:m}}function tA(o,n,a){let s;if(n==="viewport")s=lV(o,a);else if(n==="document")s=iV(Ya(o));else if(qt(n))s=uV(n,a);else{const l=e_(o);s={x:n.x-l.x,y:n.y-l.y,width:n.width,height:n.height}}return Km(s)}function n_(o,n){const a=Os(o);return a===n||!qt(a)||Cs(a)?!1:pr(a).position==="fixed"||n_(a,n)}function dV(o,n){const a=n.get(o);if(a)return a;let s=Li(o,[],!1).filter(h=>qt(h)&&ji(h)!=="body"),l=null;const c=pr(o).position==="fixed";let f=c?Os(o):o;for(;qt(f)&&!Cs(f);){const h=pr(f),g=JS(f);!g&&h.position==="fixed"&&(l=null),(c?!g&&!l:!g&&h.position==="static"&&!!l&&cV.has(l.position)||Pi(f)&&!g&&n_(o,f))?s=s.filter(b=>b!==f):l=h,f=Os(f)}return n.set(o,s),s}function fV(o){let{element:n,boundary:a,rootBoundary:s,strategy:l}=o;const f=[...a==="clippingAncestors"?mg(n)?[]:dV(n,this._c):[].concat(a),s],h=f[0],g=f.reduce((m,b)=>{const p=tA(n,b,l);return m.top=dr(p.top,m.top),m.right=bu(p.right,m.right),m.bottom=bu(p.bottom,m.bottom),m.left=dr(p.left,m.left),m},tA(n,h,l));return{width:g.right-g.left,height:g.bottom-g.top,x:g.left,y:g.top}}function hV(o){const{width:n,height:a}=ZM(o);return{width:n,height:a}}function pV(o,n,a){const s=$n(n),l=Ya(n),c=a==="fixed",f=ql(o,!0,c,n);let h={scrollLeft:0,scrollTop:0};const g=Ba(0);function m(){g.x=vg(l)}if(s||!s&&!c)if((ji(n)!=="body"||Pi(l))&&(h=yg(n)),s){const w=ql(n,!0,c,n);g.x=w.x+n.clientLeft,g.y=w.y+n.clientTop}else l&&m();c&&!s&&l&&m();const b=l&&!s&&!c?t_(l,h):Ba(0),p=f.left+h.scrollLeft-g.x-b.x,v=f.top+h.scrollTop-g.y-b.y;return{x:p,y:v,width:f.width,height:f.height}}function N0(o){return pr(o).position==="static"}function nA(o,n){if(!$n(o)||pr(o).position==="fixed")return null;if(n)return n(o);let a=o.offsetParent;return Ya(o)===a&&(a=a.ownerDocument.body),a}function o_(o,n){const a=Gn(o);if(mg(o))return a;if(!$n(o)){let l=Os(o);for(;l&&!Cs(l);){if(qt(l)&&!N0(l))return l;l=Os(l)}return a}let s=nA(o,n);for(;s&&zB(s)&&N0(s);)s=nA(s,n);return s&&Cs(s)&&N0(s)&&!JS(s)?a:s||BB(o)||a}const mV=async function(o){const n=this.getOffsetParent||o_,a=this.getDimensions,s=await a(o.floating);return{reference:pV(o.reference,await n(o.floating),o.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function gV(o){return pr(o).direction==="rtl"}const yV={convertOffsetParentRelativeRectToViewportRelativeRect:aV,getDocumentElement:Ya,getClippingRect:fV,getOffsetParent:o_,getElementRects:mV,getClientRects:sV,getDimensions:hV,getScale:au,isElement:qt,isRTL:gV};function r_(o,n){return o.x===n.x&&o.y===n.y&&o.width===n.width&&o.height===n.height}function bV(o,n){let a=null,s;const l=Ya(o);function c(){var h;clearTimeout(s),(h=a)==null||h.disconnect(),a=null}function f(h,g){h===void 0&&(h=!1),g===void 0&&(g=1),c();const m=o.getBoundingClientRect(),{left:b,top:p,width:v,height:w}=m;if(h||n(),!v||!w)return;const E=xm(p),T=xm(l.clientWidth-(b+v)),C=xm(l.clientHeight-(p+w)),A=xm(b),U={rootMargin:-E+"px "+-T+"px "+-C+"px "+-A+"px",threshold:dr(0,bu(1,g))||1};let M=!0;function Y($){const _=$[0].intersectionRatio;if(_!==g){if(!M)return f();_?f(!1,_):s=setTimeout(()=>{f(!1,1e-7)},1e3)}_===1&&!r_(m,o.getBoundingClientRect())&&f(),M=!1}try{a=new IntersectionObserver(Y,{...U,root:l.ownerDocument})}catch{a=new IntersectionObserver(Y,U)}a.observe(o)}return f(!0),c}function oA(o,n,a,s){s===void 0&&(s={});const{ancestorScroll:l=!0,ancestorResize:c=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:g=!1}=s,m=hw(o),b=l||c?[...m?Li(m):[],...Li(n)]:[];b.forEach(A=>{l&&A.addEventListener("scroll",a,{passive:!0}),c&&A.addEventListener("resize",a)});const p=m&&h?bV(m,a):null;let v=-1,w=null;f&&(w=new ResizeObserver(A=>{let[k]=A;k&&k.target===m&&w&&(w.unobserve(n),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var U;(U=w)==null||U.observe(n)})),a()}),m&&!g&&w.observe(m),w.observe(n));let E,T=g?ql(o):null;g&&C();function C(){const A=ql(o);T&&!r_(T,A)&&a(),T=A,E=requestAnimationFrame(C)}return a(),()=>{var A;b.forEach(k=>{l&&k.removeEventListener("scroll",a),c&&k.removeEventListener("resize",a)}),p==null||p(),(A=w)==null||A.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const vV=Z8,SV=eV,wV=W8,EV=nV,xV=K8,RV=tV,TV=(o,n,a)=>{const s=new Map,l={platform:yV,...a},c={...l.platform,_c:s};return Q8(o,n,{...l,platform:c})};var CV=typeof document<"u",OV=function(){},Pm=CV?x.useLayoutEffect:OV;function og(o,n){if(o===n)return!0;if(typeof o!=typeof n)return!1;if(typeof o=="function"&&o.toString()===n.toString())return!0;let a,s,l;if(o&&n&&typeof o=="object"){if(Array.isArray(o)){if(a=o.length,a!==n.length)return!1;for(s=a;s--!==0;)if(!og(o[s],n[s]))return!1;return!0}if(l=Object.keys(o),a=l.length,a!==Object.keys(n).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(n,l[s]))return!1;for(s=a;s--!==0;){const c=l[s];if(!(c==="_owner"&&o.$$typeof)&&!og(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}function a_(o){return typeof window>"u"?1:(o.ownerDocument.defaultView||window).devicePixelRatio||1}function rA(o,n){const a=a_(o);return Math.round(n*a)/a}function M0(o){const n=x.useRef(o);return Pm(()=>{n.current=o}),n}function DV(o){o===void 0&&(o={});const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:l,elements:{reference:c,floating:f}={},transform:h=!0,whileElementsMounted:g,open:m}=o,[b,p]=x.useState({x:0,y:0,strategy:a,placement:n,middlewareData:{},isPositioned:!1}),[v,w]=x.useState(s);og(v,s)||w(s);const[E,T]=x.useState(null),[C,A]=x.useState(null),k=x.useCallback(I=>{I!==$.current&&($.current=I,T(I))},[]),U=x.useCallback(I=>{I!==_.current&&(_.current=I,A(I))},[]),M=c||E,Y=f||C,$=x.useRef(null),_=x.useRef(null),z=x.useRef(b),te=g!=null,H=M0(g),J=M0(l),N=M0(m),P=x.useCallback(()=>{if(!$.current||!_.current)return;const I={placement:n,strategy:a,middleware:v};J.current&&(I.platform=J.current),TV($.current,_.current,I).then(ie=>{const pe={...ie,isPositioned:N.current!==!1};ne.current&&!og(z.current,pe)&&(z.current=pe,zi.flushSync(()=>{p(pe)}))})},[v,n,a,J,N]);Pm(()=>{m===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,p(I=>({...I,isPositioned:!1})))},[m]);const ne=x.useRef(!1);Pm(()=>(ne.current=!0,()=>{ne.current=!1}),[]),Pm(()=>{if(M&&($.current=M),Y&&(_.current=Y),M&&Y){if(H.current)return H.current(M,Y,P);P()}},[M,Y,P,H,te]);const Z=x.useMemo(()=>({reference:$,floating:_,setReference:k,setFloating:U}),[k,U]),j=x.useMemo(()=>({reference:M,floating:Y}),[M,Y]),oe=x.useMemo(()=>{const I={position:a,left:0,top:0};if(!j.floating)return I;const ie=rA(j.floating,b.x),pe=rA(j.floating,b.y);return h?{...I,transform:"translate("+ie+"px, "+pe+"px)",...a_(j.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:ie,top:pe}},[a,h,j.floating,b.x,b.y]);return x.useMemo(()=>({...b,update:P,refs:Z,elements:j,floatingStyles:oe}),[b,P,Z,j,oe])}const AV=(o,n)=>({...vV(o),options:[o,n]}),NV=(o,n)=>({...SV(o),options:[o,n]}),MV=(o,n)=>({...RV(o),options:[o,n]}),_V=(o,n)=>({...wV(o),options:[o,n]}),kV=(o,n)=>({...EV(o),options:[o,n]}),LV=(o,n)=>({...xV(o),options:[o,n]}),UV={intentional:"onClick",sloppy:"onPointerDown"};function zV(o){return{escapeKey:typeof o=="boolean"?o:(o==null?void 0:o.escapeKey)??!1,outsidePress:typeof o=="boolean"?o:(o==null?void 0:o.outsidePress)??!0}}function s_(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("referenceElement"),f=a.useState("domReferenceElement"),{onOpenChange:h,dataRef:g}=a.context,{enabled:m=!0,escapeKey:b=!0,outsidePress:p=!0,outsidePressEvent:v="sloppy",referencePress:w=!1,referencePressEvent:E="sloppy",ancestorScroll:T=!1,bubbles:C,externalTree:A}=n,k=Ou(A),U=st(typeof p=="function"?p:()=>!1),M=typeof p=="function"?U:p,Y=x.useRef(!1),{escapeKey:$,outsidePress:_}=zV(C),z=x.useRef(null),te=Ds(),H=Ds(),J=st(()=>{H.clear(),g.current.insideReactTree=!1}),N=x.useRef(!1),P=x.useRef(""),ne=st(he=>{P.current=he.pointerType}),Z=st(()=>{const he=P.current,we=he==="pen"||!he?"mouse":he,De=typeof v=="function"?v():v;return typeof De=="string"?De:De[we]}),j=st(he=>{var Ae;if(!s||!m||!b||he.key!=="Escape"||N.current)return;const we=(Ae=g.current.floatingContext)==null?void 0:Ae.nodeId,De=k?Vl(k.nodesRef.current,we):[];if(!$&&De.length>0){let Le=!0;if(De.forEach(tt=>{var Ce;(Ce=tt.context)!=null&&Ce.open&&!tt.context.dataRef.current.__escapeKeyBubbles&&(Le=!1)}),!Le)return}const Ye=Q6(he)?he.nativeEvent:he,Re=yn(XS,Ye);a.setOpen(!1,Re),!$&&!Re.isPropagationAllowed&&he.stopPropagation()}),oe=st(he=>{const we=Z();return we==="intentional"&&he.type!=="click"||we==="sloppy"&&he.type==="click"}),I=st(()=>{g.current.insideReactTree=!0,H.start(0,J)}),ie=st((he,we=!1)=>{var gt;if(oe(he)){J();return}if(g.current.insideReactTree){J();return}if(Z()==="intentional"&&we||typeof M=="function"&&!M(he))return;const De=qo(he),Ye=`[${Su("inert")}]`,Re=fn(a.select("floatingElement")).querySelectorAll(Ye),Ae=a.context.triggerElements;if(De&&(Ae.hasElement(De)||Ae.hasMatchingElement(yt=>Yt(yt,De))))return;let Le=qt(De)?De:null;for(;Le&&!Cs(Le);){const yt=Os(Le);if(Cs(yt)||!qt(yt))break;Le=yt}if(Re.length&&qt(De)&&!q6(De)&&!Yt(De,a.select("floatingElement"))&&Array.from(Re).every(yt=>!Yt(Le,yt)))return;if($n(De)&&!("touches"in he)){const yt=Cs(De),ht=pr(De),$t=/auto|scroll/,on=yt||$t.test(ht.overflowX),bn=yt||$t.test(ht.overflowY),bt=on&&De.clientWidth>0&&De.scrollWidth>De.clientWidth,Pt=bn&&De.clientHeight>0&&De.scrollHeight>De.clientHeight,Ft=ht.direction==="rtl",vn=Pt&&(Ft?he.offsetX<=De.offsetWidth-De.clientWidth:he.offsetX>De.clientWidth),ln=bt&&he.offsetY>De.clientHeight;if(vn||ln)return}const tt=(gt=g.current.floatingContext)==null?void 0:gt.nodeId,Ce=k&&Vl(k.nodesRef.current,tt).some(yt=>{var ht;return Wr(he,(ht=yt.context)==null?void 0:ht.elements.floating)});if(Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||Ce)return;const ot=k?Vl(k.nodesRef.current,tt):[];if(ot.length>0){let yt=!0;if(ot.forEach(ht=>{var $t;($t=ht.context)!=null&&$t.open&&!ht.context.dataRef.current.__outsidePressBubbles&&(yt=!1)}),!yt)return}a.setOpen(!1,yn(qN,he)),J()}),pe=st(he=>{Z()!=="sloppy"||he.pointerType==="touch"||!a.select("open")||!m||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||ie(he)}),L=st(he=>{if(Z()!=="sloppy"||!a.select("open")||!m||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement")))return;const we=he.touches[0];we&&(z.current={startTime:Date.now(),startX:we.clientX,startY:we.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},te.start(1e3,()=>{z.current&&(z.current.dismissOnTouchEnd=!1,z.current.dismissOnMouseDown=!1)}))}),ce=st(he=>{const we=qo(he);function De(){L(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)}),se=st(he=>{const we=Y.current;if(Y.current=!1,te.clear(),he.type==="mousedown"&&z.current&&!z.current.dismissOnMouseDown)return;const De=qo(he);function Ye(){he.type==="pointerdown"?pe(he):ie(he,we),De==null||De.removeEventListener(he.type,Ye)}De==null||De.addEventListener(he.type,Ye)}),me=st(he=>{if(Z()!=="sloppy"||!z.current||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement")))return;const we=he.touches[0];if(!we)return;const De=Math.abs(we.clientX-z.current.startX),Ye=Math.abs(we.clientY-z.current.startY),Re=Math.sqrt(De*De+Ye*Ye);Re>5&&(z.current.dismissOnTouchEnd=!0),Re>10&&(ie(he),te.clear(),z.current=null)}),Te=st(he=>{const we=qo(he);function De(){me(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)}),Ue=st(he=>{Z()!=="sloppy"||!z.current||Wr(he,a.select("floatingElement"))||Wr(he,a.select("domReferenceElement"))||(z.current.dismissOnTouchEnd&&ie(he),te.clear(),z.current=null)}),ve=st(he=>{const we=qo(he);function De(){Ue(he),we==null||we.removeEventListener(he.type,De)}we==null||we.addEventListener(he.type,De)});x.useEffect(()=>{if(!s||!m)return;g.current.__escapeKeyBubbles=$,g.current.__outsidePressBubbles=_;const he=new Fa;function we(Le){a.setOpen(!1,yn(fg,Le))}function De(){he.clear(),N.current=!0}function Ye(){he.start(gg()?5:0,()=>{N.current=!1})}const Re=fn(l);Re.addEventListener("pointerdown",ne,!0),b&&(Re.addEventListener("keydown",j),Re.addEventListener("compositionstart",De),Re.addEventListener("compositionend",Ye)),M&&(Re.addEventListener("click",se,!0),Re.addEventListener("pointerdown",se,!0),Re.addEventListener("touchstart",ce,!0),Re.addEventListener("touchmove",Te,!0),Re.addEventListener("touchend",ve,!0),Re.addEventListener("mousedown",se,!0));let Ae=[];return T&&(qt(f)&&(Ae=Li(f)),qt(l)&&(Ae=Ae.concat(Li(l))),!qt(c)&&c&&c.contextElement&&(Ae=Ae.concat(Li(c.contextElement)))),Ae=Ae.filter(Le=>{var tt;return Le!==((tt=Re.defaultView)==null?void 0:tt.visualViewport)}),Ae.forEach(Le=>{Le.addEventListener("scroll",we,{passive:!0})}),()=>{Re.removeEventListener("pointerdown",ne,!0),b&&(Re.removeEventListener("keydown",j),Re.removeEventListener("compositionstart",De),Re.removeEventListener("compositionend",Ye)),M&&(Re.removeEventListener("click",se,!0),Re.removeEventListener("pointerdown",se,!0),Re.removeEventListener("touchstart",ce,!0),Re.removeEventListener("touchmove",Te,!0),Re.removeEventListener("touchend",ve,!0),Re.removeEventListener("mousedown",se,!0)),Ae.forEach(Le=>{Le.removeEventListener("scroll",we)}),he.clear(),Y.current=!1}},[g,l,c,f,b,M,s,h,T,m,$,_,j,ie,se,pe,ce,Te,ve,ne,a]),x.useEffect(J,[M,J]);const ze=x.useMemo(()=>({onKeyDown:j,...w&&{[UV[E]]:he=>{a.setOpen(!1,yn(Lf,he.nativeEvent))},...E!=="intentional"&&{onClick(he){a.setOpen(!1,yn(Lf,he.nativeEvent))}}}}),[j,a,w,E]),je=st(he=>{const we=qo(he.nativeEvent);!Yt(a.select("floatingElement"),we)||he.button!==0||(Y.current=!0)}),at=st(he=>{!s||!m||he.button!==0||(Y.current=!0)}),xe=x.useMemo(()=>({onKeyDown:j,onPointerDown:je,onMouseDown:je,onMouseUp:je,onClickCapture:I,onMouseDownCapture(he){I(),at(he)},onPointerDownCapture(he){I(),at(he)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[j,je,I,at]);return x.useMemo(()=>m?{reference:ze,floating:xe,trigger:ze}:{},[m,ze,xe])}var jV=(o,n,a)=>{if(n.length===1&&n[0]===a){let s=!1;try{const l={};o(l)===l&&(s=!0)}catch{}if(s){let l;try{throw new Error}catch(c){({stack:l}=c)}console.warn(`The result function returned its own inputs without modification. e.g
423
423
  \`createSelector([state => state.todos], todos => todos)\`
424
424
  This could lead to inefficient memoization and unnecessary re-renders.
425
425
  Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:l})}}},PV=(o,n,a)=>{const{memoize:s,memoizeOptions:l}=n,{inputSelectorResults:c,inputSelectorResultsCopy:f}=o,h=s(()=>({}),...l);if(!(h.apply(null,c)===h.apply(null,f))){let m;try{throw new Error}catch(b){({stack:m}=b)}console.warn(`An input selector returned a different result when passed same arguments.
@@ -433,7 +433,7 @@ Avoid returning a new reference inside your input selector, e.g.
433
433
  *
434
434
  * This source code is licensed under the MIT license found in the
435
435
  * LICENSE file in the root directory of this source tree.
436
- */return(function(){function o(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=Gl(),a=NN(),s=typeof Object.is=="function"?Object.is:o,l=a.useSyncExternalStore,c=n.useRef,f=n.useEffect,h=n.useMemo,g=n.useDebugValue;k0.useSyncExternalStoreWithSelector=function(m,b,p,v,w){var E=c(null);if(E.current===null){var T={hasValue:!1,value:null};E.current=T}else T=E.current;E=h(function(){function A($){if(!k){if(k=!0,U=$,$=v($),w!==void 0&&T.hasValue){var _=T.value;if(w(_,$))return M=_}return M=$}if(_=M,s(U,$))return _;var z=v($);return w!==void 0&&w(_,z)?(U=$,_):(U=$,M=z)}var k=!1,U,M,Y=p===void 0?null:p;return[function(){return A(b())},Y===null?void 0:function(){return A(Y())}]},[b,p,v,w]);var C=l(m,E[0],E[1]);return f(function(){T.hasValue=!0,T.value=C},[C]),g(C),C},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),k0}var cA;function nF(){return cA||(cA=1,_0.exports=tF()),_0.exports}var oF=nF();const ES=[];let xS;function rF(){return xS}function aF(o){ES.push(o)}function c_(o){const n=(a,s)=>{const l=mr(iF).current;let c;try{xS=l;for(const f of ES)f.before(l);c=o(a,s);for(const f of ES)f.after(l);l.didInitialize=!0}finally{xS=void 0}return c};return n.displayName=o.displayName||o.name,n}function sF(o){return x.forwardRef(c_(o))}function iF(){return{didInitialize:!1}}const lF=GS(19),cF=lF?dF:fF;function u_(o,n,a,s,l){return cF(o,n,a,s,l)}function uF(o,n,a,s,l){const c=x.useCallback(()=>n(o.getSnapshot(),a,s,l),[o,n,a,s,l]);return YS.useSyncExternalStore(o.subscribe,c,c)}aF({before(o){o.syncIndex=0,o.didInitialize||(o.syncTick=1,o.syncHooks=[],o.didChangeStore=!0,o.getSnapshot=()=>{let n=!1;for(let a=0;a<o.syncHooks.length;a+=1){const s=o.syncHooks[a],l=s.selector(s.store.state,s.a1,s.a2,s.a3);(s.didChange||!Object.is(s.value,l))&&(n=!0,s.value=l,s.didChange=!1)}return n&&(o.syncTick+=1),o.syncTick})},after(o){o.syncHooks.length>0&&(o.didChangeStore&&(o.didChangeStore=!1,o.subscribe=n=>{const a=new Set;for(const l of o.syncHooks)a.add(l.store);const s=[];for(const l of a)s.push(l.subscribe(n));return()=>{for(const l of s)l()}}),YS.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot))}});function dF(o,n,a,s,l){const c=rF();if(!c)return uF(o,n,a,s,l);const f=c.syncIndex;c.syncIndex+=1;let h;return c.didInitialize?(h=c.syncHooks[f],(h.store!==o||h.selector!==n||!Object.is(h.a1,a)||!Object.is(h.a2,s)||!Object.is(h.a3,l))&&(h.store!==o&&(c.didChangeStore=!0),h.store=o,h.selector=n,h.a1=a,h.a2=s,h.a3=l,h.didChange=!0)):(h={store:o,selector:n,a1:a,a2:s,a3:l,value:n(o.getSnapshot(),a,s,l),didChange:!1},c.syncHooks.push(h)),h.value}function fF(o,n,a,s,l){return oF.useSyncExternalStoreWithSelector(o.subscribe,o.getSnapshot,o.getSnapshot,c=>n(c,a,s,l))}class hF{constructor(n){We(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));We(this,"getSnapshot",()=>this.state);this.state=n,this.listeners=new Set,this.updateTick=0}setState(n){if(this.state===n)return;this.state=n,this.updateTick+=1;const a=this.updateTick;for(const s of this.listeners){if(a!==this.updateTick)return;s(n)}}update(n){for(const a in n)if(!Object.is(this.state[a],n[a])){this.setState({...this.state,...n});return}}set(n,a){Object.is(this.state[n],a)||this.setState({...this.state,[n]:a})}notifyAll(){const n={...this.state};this.setState(n)}use(n,a,s,l){return u_(this,n,a,s,l)}}class pw extends hF{constructor(n,a={},s){super(n),this.context=a,this.selectors=s}useSyncedValue(n,a){x.useDebugValue(n),pt(()=>{this.state[n]!==a&&this.set(n,a)},[n,a])}useSyncedValueWithCleanup(n,a){const s=this;pt(()=>(s.state[n]!==a&&s.set(n,a),()=>{s.set(n,void 0)}),[s,n,a])}useSyncedValues(n){const a=this;{x.useDebugValue(n,f=>Object.keys(f));const l=x.useRef(Object.keys(n)).current,c=Object.keys(n);(l.length!==c.length||l.some((f,h)=>f!==c[h]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const s=Object.values(n);pt(()=>{a.update(n)},[a,...s])}useControlledProp(n,a){x.useDebugValue(n);const s=a!==void 0;pt(()=>{s&&!Object.is(this.state[n],a)&&super.setState({...this.state,[n]:a})},[n,a,s]);{const l=this.controlledValues??(this.controlledValues=new Map);l.has(n)||l.set(n,s);const c=l.get(n);c!==void 0&&c!==s&&console.error(`A component is changing the ${s?"":"un"}controlled state of ${n.toString()} to be ${s?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(n,a,s,l){const c=this.selectors[n];return c(this.state,a,s,l)}useState(n,a,s,l){return x.useDebugValue(n),u_(this,this.selectors[n],a,s,l)}useContextCallback(n,a){x.useDebugValue(n);const s=st(a??$N);this.context[n]=s}useStateSetter(n){const a=x.useRef(void 0);return a.current===void 0&&(a.current=s=>{this.set(n,s)}),a.current}observe(n,a){let s;typeof n=="function"?s=n:s=this.selectors[n];let l=s(this.state);return a(l,l,this),this.subscribe(c=>{const f=s(c);if(!Object.is(l,f)){const h=l;l=f,a(f,h,this)}})}}const pF={open:zt(o=>o.open),domReferenceElement:zt(o=>o.domReferenceElement),referenceElement:zt(o=>o.positionReference??o.referenceElement),floatingElement:zt(o=>o.floatingElement),floatingId:zt(o=>o.floatingId)};class mw extends pw{constructor(a){const{nested:s,noEmit:l,onOpenChange:c,triggerElements:f,...h}=a;super({...h,positionReference:h.referenceElement,domReferenceElement:h.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:YM(),nested:s,noEmit:l,triggerElements:f},pF);We(this,"setOpen",(a,s)=>{var l,c;if((!a||!this.state.open||J6(s.event))&&(this.context.dataRef.current.openEvent=a?s.event:void 0),!this.context.noEmit){const f={open:a,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",f)}(c=(l=this.context).onOpenChange)==null||c.call(l,a,s)})}}function mF(o,n){const a=x.useRef(null),s=x.useRef(null);return x.useCallback(l=>{if(o!==void 0){if(a.current!==null){const c=a.current,f=s.current,h=n.context.triggerElements.getById(c);f&&h===f&&n.context.triggerElements.delete(c),a.current=null,s.current=null}l!==null&&(a.current=o,s.current=l,n.context.triggerElements.add(o,l))}},[n,o])}function gF(o,n,a,s){const l=a.useState("isMountedByTrigger",o),c=mF(o,a),f=st(h=>{if(c(h),!h||!a.select("open"))return;const g=a.select("activeTriggerId");if(g===o){a.update({activeTriggerElement:h,...s});return}g==null&&a.update({activeTriggerId:o,activeTriggerElement:h,...s})});return pt(()=>{l&&a.update({activeTriggerElement:n.current,...s})},[l,a,n,...Object.values(s)]),{registerTrigger:f,isMountedByThisTrigger:l}}function d_(o){const n=o.useState("open");pt(()=>{if(n&&!o.select("activeTriggerId")&&o.context.triggerElements.size===1){const a=o.context.triggerElements.entries().next();if(!a.done){const[s,l]=a.value;o.update({activeTriggerId:s,activeTriggerElement:l})}}},[n,o])}function f_(o,n,a){const{mounted:s,setMounted:l,transitionStatus:c}=WN(o);n.useSyncedValues({mounted:s,transitionStatus:c});const f=st(()=>{var g,m;l(!1),n.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),a==null||a(),(m=(g=n.context).onOpenChangeComplete)==null||m.call(g,!1)}),h=n.useState("preventUnmountingOnClose");return bg({enabled:!h,open:o,ref:n.context.popupRef,onComplete(){o||f()}}),{forceUnmount:f,transitionStatus:c}}class Sg{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(n,a){const s=this.idMap.get(n);if(s!==a&&(s!==void 0&&this.elementsSet.delete(s),this.elementsSet.add(a),this.idMap.set(n,a),this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(n){const a=this.idMap.get(n);a&&(this.elementsSet.delete(a),this.idMap.delete(n))}hasElement(n){return this.elementsSet.has(n)}hasMatchingElement(n){for(const a of this.elementsSet)if(n(a))return!0;return!1}getById(n){return this.idMap.get(n)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function yF(){return new mw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Sg,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function h_(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:yF(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fr,inactiveTriggerProps:fr,popupProps:fr}}const Om=zt(o=>o.triggerIdProp??o.activeTriggerId),p_={open:zt(o=>o.openProp??o.open),mounted:zt(o=>o.mounted),transitionStatus:zt(o=>o.transitionStatus),floatingRootContext:zt(o=>o.floatingRootContext),preventUnmountingOnClose:zt(o=>o.preventUnmountingOnClose),payload:zt(o=>o.payload),activeTriggerId:Om,activeTriggerElement:zt(o=>o.mounted?o.activeTriggerElement:null),isTriggerActive:zt((o,n)=>n!==void 0&&Om(o)===n),isOpenedByTrigger:zt((o,n)=>n!==void 0&&Om(o)===n&&o.open),isMountedByTrigger:zt((o,n)=>n!==void 0&&Om(o)===n&&o.mounted),triggerProps:zt((o,n)=>n?o.activeTriggerProps:o.inactiveTriggerProps),popupProps:zt(o=>o.popupProps),popupElement:zt(o=>o.popupElement),positionerElement:zt(o=>o.positionerElement)};function bF(o){const{open:n=!1,onOpenChange:a,elements:s={}}=o,l=wu(),c=Cu()!=null;{const h=s.reference;h&&!qt(h)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const f=mr(()=>new mw({open:n,onOpenChange:a,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new Sg,floatingId:l,nested:c,noEmit:!1})).current;return pt(()=>{const h={open:n,floatingId:l};s.reference!==void 0&&(h.referenceElement=s.reference,h.domReferenceElement=qt(s.reference)?s.reference:null),s.floating!==void 0&&(h.floatingElement=s.floating),f.update(h)},[n,l,s.reference,s.floating,f]),f.context.onOpenChange=a,f.context.nested=c,f.context.noEmit=!1,f}function vF(o={}){const{nodeId:n,externalTree:a}=o,s=bF(o),l=o.rootContext||s,c={reference:l.useState("referenceElement"),floating:l.useState("floatingElement"),domReference:l.useState("domReferenceElement")},[f,h]=x.useState(null),g=x.useRef(null),m=Ou(a);pt(()=>{c.domReference&&(g.current=c.domReference)},[c.domReference]);const b=DV({...o,elements:{...c,...f&&{reference:f}}}),p=x.useCallback(_=>{const z=qt(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;h(z),b.refs.setReference(z)},[b.refs]),[v,w]=x.useState(null),[E,T]=x.useState(null);l.useSyncedValue("referenceElement",v),l.useSyncedValue("domReferenceElement",qt(v)?v:null),l.useSyncedValue("floatingElement",E);const C=x.useCallback(_=>{(qt(_)||_===null)&&(g.current=_,w(_)),(qt(b.refs.reference.current)||b.refs.reference.current===null||_!==null&&!qt(_))&&b.refs.setReference(_)},[b.refs,w]),A=x.useCallback(_=>{T(_),b.refs.setFloating(_)},[b.refs]),k=x.useMemo(()=>({...b.refs,setReference:C,setFloating:A,setPositionReference:p,domReference:g}),[b.refs,C,A,p]),U=x.useMemo(()=>({...b.elements,domReference:c.domReference}),[b.elements,c.domReference]),M=l.useState("open"),Y=l.useState("floatingId"),$=x.useMemo(()=>({...b,dataRef:l.context.dataRef,open:M,onOpenChange:l.setOpen,events:l.context.events,floatingId:Y,refs:k,elements:U,nodeId:n,rootStore:l}),[b,k,U,n,l,M,Y]);return pt(()=>{l.context.dataRef.current.floatingContext=$;const _=m==null?void 0:m.nodesRef.current.find(z=>z.id===n);_&&(_.context=$)}),x.useMemo(()=>({...b,context:$,refs:k,elements:U,rootStore:l}),[b,k,U,$,l])}function m_(o){const{popupStore:n,noEmit:a=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:l}=o,c=wu(),f=Cu()!=null,h=n.useState("open"),g=n.useState("activeTriggerElement"),m=n.useState(s?"popupElement":"positionerElement"),b=n.context.triggerElements,p=mr(()=>new mw({open:h,referenceElement:g,floatingElement:m,triggerElements:b,onOpenChange:l,floatingId:c,nested:f,noEmit:a})).current;return pt(()=>{const v={open:h,floatingId:c,referenceElement:g,floatingElement:m};qt(g)&&(v.domReferenceElement=g),p.state.positionReference===p.state.referenceElement&&(v.positionReference=g),p.update(v)},[h,c,g,m,p]),p.context.onOpenChange=l,p.context.nested=f,p.context.noEmit=a,p}const L0=V6&&xM;function SF(o,n={}){const a="rootStore"in o?o.rootStore:o,{events:s,dataRef:l}=a.context,{enabled:c=!0,delay:f}=n,h=x.useRef(!1),g=x.useRef(null),m=Ds(),b=x.useRef(!0);x.useEffect(()=>{const v=a.select("domReferenceElement");if(!c)return;const w=Gn(v);function E(){const A=a.select("domReferenceElement");!a.select("open")&&$n(A)&&A===xs(fn(A))&&(h.current=!0)}function T(){b.current=!0}function C(){b.current=!1}return w.addEventListener("blur",E),L0&&(w.addEventListener("keydown",T,!0),w.addEventListener("pointerdown",C,!0)),()=>{w.removeEventListener("blur",E),L0&&(w.removeEventListener("keydown",T,!0),w.removeEventListener("pointerdown",C,!0))}},[a,c]),x.useEffect(()=>{if(!c)return;function v(w){if(w.reason===Lf||w.reason===XS){const E=a.select("domReferenceElement");qt(E)&&(g.current=E,h.current=!0)}}return s.on("openchange",v),()=>{s.off("openchange",v)}},[s,c,a]);const p=x.useMemo(()=>({onMouseLeave(){h.current=!1,g.current=null},onFocus(v){const w=v.currentTarget;if(h.current){if(g.current===w)return;h.current=!1,g.current=null}const E=qo(v.nativeEvent);if(qt(E)){if(L0&&!v.relatedTarget){if(!b.current&&!rw(E))return}else if(!G6(E))return}const T=Xm(v.relatedTarget,a.context.triggerElements),{nativeEvent:C,currentTarget:A}=v,k=typeof f=="function"?f():f;if(a.select("open")&&T||k===0||k===void 0){a.setOpen(!0,yn(zm,C,A));return}m.start(k,()=>{h.current||a.setOpen(!0,yn(zm,C,A))})},onBlur(v){h.current=!1,g.current=null;const w=v.relatedTarget,E=v.nativeEvent,T=qt(w)&&w.hasAttribute(Su("focus-guard"))&&w.getAttribute("data-type")==="outside";m.start(0,()=>{var U;const C=a.select("domReferenceElement"),A=xs(C?C.ownerDocument:document);!w&&A===C||Yt((U=l.current.floatingContext)==null?void 0:U.refs.floating.current,A)||Yt(C,A)||T||Xm(w??A,a.context.triggerElements)||a.setOpen(!1,yn(zm,E))})}}),[l,a,m,f]);return x.useMemo(()=>c?{reference:p,trigger:p}:{},[c,p])}const RS=Su("safe-polygon"),wF=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${OM}`;function EF(o){return o?!!o.closest(wF):!1}class gw{constructor(){We(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});We(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new Fa,this.restTimeout=new Fa,this.handleCloseOptions=void 0}static create(){return new gw}}function g_(o){const n=mr(gw.create).current,a=o.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState=n),hg(a.hoverInteractionState.disposeEffect),a.hoverInteractionState}const xF=new Set(["click","mousedown"]);function RF(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("domReferenceElement"),{dataRef:f}=a.context,{enabled:h=!0,closeDelay:g=0}=n,m=g_(a),b=Ou(),p=Cu(),v=st(()=>m.interactedInside?!0:f.current.openEvent?xF.has(f.current.openEvent.type):!1),w=st(()=>{var M;const U=(M=f.current.openEvent)==null?void 0:M.type;return(U==null?void 0:U.includes("mouse"))&&U!=="mousedown"}),E=st(U=>Xm(U,a.context.triggerElements)),T=x.useCallback((U,M=!0)=>{const Y=TF(g,m.pointerType);Y&&!m.handler?m.openChangeTimeout.start(Y,()=>a.setOpen(!1,yn(Zr,U))):M&&(m.openChangeTimeout.clear(),a.setOpen(!1,yn(Zr,U)))},[g,a,m]),C=st(()=>{m.unbindMouseMove(),m.handler=void 0}),A=st(()=>{if(m.performedPointerEventsMutation){const U=fn(l).body;U.style.pointerEvents="",U.removeAttribute(RS),m.performedPointerEventsMutation=!1}}),k=st(U=>{const M=qo(U);if(!EF(M)){m.interactedInside=!1;return}m.interactedInside=!0});pt(()=>{s||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,C(),A())},[s,m,C,A]),x.useEffect(()=>()=>{C()},[C]),x.useEffect(()=>A,[A]),pt(()=>{var U,M,Y;if(h&&s&&(U=m.handleCloseOptions)!=null&&U.blockPointerEvents&&w()&&qt(c)&&l){m.performedPointerEventsMutation=!0;const $=fn(l).body;$.setAttribute(RS,"");const _=c,z=l,te=(Y=(M=b==null?void 0:b.nodesRef.current.find(H=>H.id===p))==null?void 0:M.context)==null?void 0:Y.elements.floating;return te&&(te.style.pointerEvents=""),$.style.pointerEvents="none",_.style.pointerEvents="auto",z.style.pointerEvents="auto",()=>{$.style.pointerEvents="",_.style.pointerEvents="",z.style.pointerEvents=""}}},[h,s,c,l,m,w,b,p]),x.useEffect(()=>{if(!h)return;function U(_){v()||!f.current.floatingContext||!a.select("open")||E(_.relatedTarget)||(A(),C(),v()||T(_))}function M(_){var z;m.openChangeTimeout.clear(),A(),(z=m.handler)==null||z.call(m,_),C()}function Y(_){v()||T(_,!1)}const $=l;return $&&($.addEventListener("mouseleave",U),$.addEventListener("mouseenter",M),$.addEventListener("mouseleave",Y),$.addEventListener("pointerdown",k,!0)),()=>{$&&($.removeEventListener("mouseleave",U),$.removeEventListener("mouseenter",M),$.removeEventListener("mouseleave",Y),$.removeEventListener("pointerdown",k,!0))}},[h,l,a,f,v,E,T,A,C,k,m])}function TF(o,n){return n&&!Uf(n)?0:typeof o=="function"?o():o}function U0(o){return typeof o=="function"?o():o}const CF={current:null};function OF(o,n={}){var H;const a="rootStore"in o?o.rootStore:o,{dataRef:s,events:l}=a.context,{enabled:c=!0,delay:f=0,handleClose:h=null,mouseOnly:g=!1,restMs:m=0,move:b=!0,triggerElementRef:p=CF,externalTree:v,isActiveTrigger:w=!0}=n,E=Ou(v),T=g_(a),C=Pa(h),A=Pa(f),k=Pa(m),U=Pa(c);w&&(T.handleCloseOptions=(H=C.current)==null?void 0:H.__options);const M=st(()=>T.interactedInside?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),Y=st(J=>Xm(J,a.context.triggerElements)),$=x.useCallback((J,N=!0)=>{const P=jm(A.current,"close",T.pointerType);P&&!T.handler?T.openChangeTimeout.start(P,()=>a.setOpen(!1,yn(Zr,J))):N&&(T.openChangeTimeout.clear(),a.setOpen(!1,yn(Zr,J)))},[A,a,T]),_=st(()=>{T.unbindMouseMove(),T.handler=void 0}),z=st(()=>{if(T.performedPointerEventsMutation){const J=fn(a.select("domReferenceElement")).body;J.style.pointerEvents="",J.removeAttribute(RS),T.performedPointerEventsMutation=!1}});x.useEffect(()=>{if(!c)return;function J(N){N.open||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return l.on("openchange",J),()=>{l.off("openchange",J)}},[c,l,T]);const te=st(J=>{var P;if(M()||!s.current.floatingContext||Y(J.relatedTarget))return;const N=p.current;(P=C.current)==null||P.call(C,{...s.current.floatingContext,tree:E,x:J.clientX,y:J.clientY,onClose(){z(),_(),!M()&&N===a.select("domReferenceElement")&&$(J)}})(J)});return x.useEffect(()=>{if(!c)return;const J=p.current??(w?a.select("domReferenceElement"):null);if(!qt(J))return;function N(Z){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,g&&!Uf(T.pointerType)||U0(k.current)>0&&!jm(A.current,"open"))return;const j=jm(A.current,"open",T.pointerType),oe=a.select("domReferenceElement"),I=a.context.triggerElements,ie=(I.hasElement(Z.target)||I.hasMatchingElement(ae=>Yt(ae,Z.target)))&&(!oe||!Yt(oe,Z.target)),pe=Z.currentTarget??null,L=a.select("open"),ce=!L||ie;ie&&L?a.setOpen(!0,yn(Zr,Z,pe)):j?T.openChangeTimeout.start(j,()=>{ce&&a.setOpen(!0,yn(Zr,Z,pe))}):ce&&a.setOpen(!0,yn(Zr,Z,pe))}function P(Z){if(M()){z();return}T.unbindMouseMove();const j=a.select("domReferenceElement"),oe=fn(j);if(T.restTimeout.clear(),T.restTimeoutPending=!1,Y(Z.relatedTarget))return;if(C.current&&s.current.floatingContext){a.select("open")||T.openChangeTimeout.clear();const ie=p.current;T.handler=C.current({...s.current.floatingContext,tree:E,x:Z.clientX,y:Z.clientY,onClose(){z(),_(),U.current&&!M()&&ie===a.select("domReferenceElement")&&$(Z,!0)}});const pe=T.handler;pe(Z),oe.addEventListener("mousemove",pe),T.unbindMouseMove=()=>{oe.removeEventListener("mousemove",pe)};return}(T.pointerType==="touch"?!Yt(a.select("floatingElement"),Z.relatedTarget):!0)&&$(Z)}function ne(Z){te(Z)}return a.select("open")&&J.addEventListener("mouseleave",ne),b&&J.addEventListener("mousemove",N,{once:!0}),J.addEventListener("mouseenter",N),J.addEventListener("mouseleave",P),()=>{J.removeEventListener("mouseleave",ne),b&&J.removeEventListener("mousemove",N),J.removeEventListener("mouseenter",N),J.removeEventListener("mouseleave",P)}},[_,z,s,A,$,a,c,C,te,T,w,M,Y,g,b,k,p,E,U]),x.useMemo(()=>{if(!c)return;function J(N){T.pointerType=N.pointerType}return{onPointerDown:J,onPointerEnter:J,onMouseMove(N){const{nativeEvent:P}=N,ne=N.currentTarget,Z=a.select("domReferenceElement"),j=a.context.triggerElements,oe=a.select("open"),I=(j.hasElement(N.target)||j.hasMatchingElement(pe=>Yt(pe,N.target)))&&(!Z||!Yt(Z,N.target));if(g&&!Uf(T.pointerType)||oe&&!I||U0(k.current)===0||!I&&T.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;T.restTimeout.clear();function ie(){if(T.restTimeoutPending=!1,M())return;const pe=a.select("open");!T.blockMouseMove&&(!pe||I)&&a.setOpen(!0,yn(Zr,P,ne))}T.pointerType==="touch"?zi.flushSync(()=>{ie()}):I&&oe?ie():(T.restTimeoutPending=!0,T.restTimeout.start(U0(k.current),ie))}}},[c,T,M,g,a,k])}function y_(o=[]){const n=o.map(m=>m==null?void 0:m.reference),a=o.map(m=>m==null?void 0:m.floating),s=o.map(m=>m==null?void 0:m.item),l=o.map(m=>m==null?void 0:m.trigger),c=x.useCallback(m=>Dm(m,o,"reference"),n),f=x.useCallback(m=>Dm(m,o,"floating"),a),h=x.useCallback(m=>Dm(m,o,"item"),s),g=x.useCallback(m=>Dm(m,o,"trigger"),l);return x.useMemo(()=>({getReferenceProps:c,getFloatingProps:f,getItemProps:h,getTriggerProps:g}),[c,f,h,g])}function Dm(o,n,a){var f;const s=new Map,l=a==="item",c={};a==="floating"&&(c.tabIndex=-1,c[gS]="");for(const h in o)l&&o&&(h===TM||h===CM)||(c[h]=o[h]);for(let h=0;h<n.length;h+=1){let g;const m=(f=n[h])==null?void 0:f[a];typeof m=="function"?g=o?m(o):null:g=m,g&&uA(c,g,l,s)}return uA(c,o,l,s),c}function uA(o,n,a,s){var l;for(const c in n){const f=n[c];a&&(c===TM||c===CM)||(c.startsWith("on")?(s.has(c)||s.set(c,[]),typeof f=="function"&&((l=s.get(c))==null||l.push(f),o[c]=(...h)=>{var g;return(g=s.get(c))==null?void 0:g.map(m=>m(...h)).find(m=>m!==void 0)})):o[c]=f)}}const DF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function AF(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingId"),c=a.useState("domReferenceElement"),f=a.useState("floatingElement"),{role:h="dialog"}=n,g=wu(),m=(c==null?void 0:c.id)||g,b=x.useMemo(()=>{var k;return((k=yS(f))==null?void 0:k.id)||l},[f,l]),p=DF.get(h)??h,w=Cu()!=null,E=x.useMemo(()=>p==="tooltip"||h==="label"?fr:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&w&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[p,w,h]),T=x.useMemo(()=>p==="tooltip"||h==="label"?{[`aria-${h==="label"?"labelledby":"describedby"}`]:s?b:void 0}:{...E,"aria-expanded":s?"true":"false","aria-controls":s?b:void 0,...p==="menu"&&{id:m}},[p,b,s,m,h,E]),C=x.useMemo(()=>{const k={id:b,...p&&{role:p}};return p==="tooltip"||h==="label"?k:{...k,...p==="menu"&&{"aria-labelledby":m}}},[p,b,m,h]),A=x.useCallback(({active:k,selected:U})=>{const M={role:"option",...k&&{id:`${b}-fui-option`}};switch(h){case"select":case"combobox":return{...M,"aria-selected":U}}return{}},[b,h]);return x.useMemo(()=>({reference:T,floating:C,item:A,trigger:E}),[T,C,E,A])}function dA(o,n){const[a,s]=o;let l=!1;const c=n.length;for(let f=0,h=c-1;f<c;h=f++){const[g,m]=n[f]||[0,0],[b,p]=n[h]||[0,0];m>=s!=p>=s&&a<=(b-g)*(s-m)/(p-m)+g&&(l=!l)}return l}function NF(o,n){return o[0]>=n.x&&o[0]<=n.x+n.width&&o[1]>=n.y&&o[1]<=n.y+n.height}function MF(o={}){const{buffer:n=.5,blockPointerEvents:a=!1,requireIntent:s=!0}=o,l=new Fa;let c=!1,f=null,h=null,g=typeof performance<"u"?performance.now():0;function m(p,v){const w=performance.now(),E=w-g;if(f===null||h===null||E===0)return f=p,h=v,g=w,null;const T=p-f,C=v-h,k=Math.sqrt(T*T+C*C)/E;return f=p,h=v,g=w,k}const b=({x:p,y:v,placement:w,elements:E,onClose:T,nodeId:C,tree:A})=>function(U){function M(){l.clear(),T()}if(l.clear(),!E.domReference||!E.floating||w==null||p==null||v==null)return;const{clientX:Y,clientY:$}=U,_=[Y,$],z=qo(U),te=U.type==="mouseleave",H=Yt(E.floating,z),J=Yt(E.domReference,z),N=E.domReference.getBoundingClientRect(),P=E.floating.getBoundingClientRect(),ne=w.split("-")[0],Z=p>P.right-P.width/2,j=v>P.bottom-P.height/2,oe=NF(_,N),I=P.width>N.width,ie=P.height>N.height,pe=(I?N:P).left,L=(I?N:P).right,ce=(ie?N:P).top,ae=(ie?N:P).bottom;if(H&&(c=!0,!te))return;if(J&&(c=!1),J&&!te){c=!0;return}if(te&&qt(U.relatedTarget)&&Yt(E.floating,U.relatedTarget)||A&&Vl(A.nodesRef.current,C).some(({context:Ue})=>Ue==null?void 0:Ue.open))return;if(ne==="top"&&v>=N.bottom-1||ne==="bottom"&&v<=N.top+1||ne==="left"&&p>=N.right-1||ne==="right"&&p<=N.left+1)return M();let me=[];switch(ne){case"top":me=[[pe,N.top+1],[pe,P.bottom-1],[L,P.bottom-1],[L,N.top+1]];break;case"bottom":me=[[pe,P.top+1],[pe,N.bottom-1],[L,N.bottom-1],[L,P.top+1]];break;case"left":me=[[P.right-1,ae],[P.right-1,ce],[N.left+1,ce],[N.left+1,ae]];break;case"right":me=[[N.right-1,ae],[N.right-1,ce],[P.left+1,ce],[P.left+1,ae]];break}function Te([Ue,ve]){switch(ne){case"top":{const ze=[I?Ue+n/2:Z?Ue+n*4:Ue-n*4,ve+n+1],je=[I?Ue-n/2:Z?Ue+n*4:Ue-n*4,ve+n+1],at=[[P.left,Z||I?P.bottom-n:P.top],[P.right,Z?I?P.bottom-n:P.top:P.bottom-n]];return[ze,je,...at]}case"bottom":{const ze=[I?Ue+n/2:Z?Ue+n*4:Ue-n*4,ve-n],je=[I?Ue-n/2:Z?Ue+n*4:Ue-n*4,ve-n],at=[[P.left,Z||I?P.top+n:P.bottom],[P.right,Z?I?P.top+n:P.bottom:P.top+n]];return[ze,je,...at]}case"left":{const ze=[Ue+n+1,ie?ve+n/2:j?ve+n*4:ve-n*4],je=[Ue+n+1,ie?ve-n/2:j?ve+n*4:ve-n*4];return[...[[j||ie?P.right-n:P.left,P.top],[j?ie?P.right-n:P.left:P.right-n,P.bottom]],ze,je]}case"right":{const ze=[Ue-n,ie?ve+n/2:j?ve+n*4:ve-n*4],je=[Ue-n,ie?ve-n/2:j?ve+n*4:ve-n*4],at=[[j||ie?P.left+n:P.right,P.top],[j?ie?P.left+n:P.right:P.left+n,P.bottom]];return[ze,je,...at]}default:return[]}}if(!dA([Y,$],me)){if(c&&!oe)return M();if(!te&&s){const Ue=m(U.clientX,U.clientY);if(Ue!==null&&Ue<.1)return M()}dA([Y,$],Te([p,v]))?!c&&s&&l.start(40,M):M()}};return b.__options={blockPointerEvents:a},b}let _F=(function(o){return o.nestedDialogs="--nested-dialogs",o})({}),kF=(function(o){return o[o.open=Ml.open]="open",o[o.closed=Ml.closed]="closed",o[o.startingStyle=Ml.startingStyle]="startingStyle",o[o.endingStyle=Ml.endingStyle]="endingStyle",o.nested="data-nested",o.nestedDialogOpen="data-nested-dialog-open",o})({});const yw=x.createContext(void 0);yw.displayName="DialogPortalContext";function LF(){const o=x.useContext(yw);if(o===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return o}const b_="ArrowUp",v_="ArrowDown",S_="ArrowLeft",w_="ArrowRight",E_="Home",x_="End",UF=new Set([S_,w_]),zF=new Set([b_,v_]),jF=new Set([...UF,...zF]);[...jF];const PF=new Set([b_,v_,S_,w_,E_,x_]),HF={...Jf,...Qf,nestedDialogOpen(o){return o?{[kF.nestedDialogOpen]:""}:null}},R_=x.forwardRef(function(n,a){const{className:s,finalFocus:l,initialFocus:c,render:f,...h}=n,{store:g}=Wl(),m=g.useState("descriptionElementId"),b=g.useState("disablePointerDismissal"),p=g.useState("floatingRootContext"),v=g.useState("popupProps"),w=g.useState("modal"),E=g.useState("mounted"),T=g.useState("nested"),C=g.useState("nestedOpenDialogCount"),A=g.useState("open"),k=g.useState("openMethod"),U=g.useState("titleElementId"),M=g.useState("transitionStatus"),Y=g.useState("role");LF(),bg({open:A,ref:g.context.popupRef,onComplete(){var J,N;A&&((N=(J=g.context).onOpenChangeComplete)==null||N.call(J,!0))}});function $(J){return J==="touch"?g.context.popupRef.current:!0}const _=c===void 0?$:c,z=C>0,H=Ln("div",n,{state:{open:A,nested:T,transitionStatus:M,nestedDialogOpen:z},props:[v,{"aria-labelledby":U??void 0,"aria-describedby":m??void 0,role:Y,tabIndex:-1,hidden:!E,onKeyDown(J){PF.has(J.key)&&J.stopPropagation()},style:{[_F.nestedDialogs]:C}},h],ref:[a,g.context.popupRef,g.useStateSetter("popupElement")],stateAttributesMapping:HF});return nn.jsx($8,{context:p,openInteractionType:k,disabled:!E,closeOnFocusOut:!b,initialFocus:_,returnFocus:l,modal:w!==!1,restoreFocus:"popup",children:H})});R_.displayName="DialogPopup";function IF(o){return GS(19)?o:o?"true":void 0}const T_=x.forwardRef(function(n,a){const{cutout:s,...l}=n;let c;if(s){const f=s==null?void 0:s.getBoundingClientRect();c=`polygon(
436
+ */return(function(){function o(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=Gl(),a=NN(),s=typeof Object.is=="function"?Object.is:o,l=a.useSyncExternalStore,c=n.useRef,f=n.useEffect,h=n.useMemo,g=n.useDebugValue;k0.useSyncExternalStoreWithSelector=function(m,b,p,v,w){var E=c(null);if(E.current===null){var T={hasValue:!1,value:null};E.current=T}else T=E.current;E=h(function(){function A($){if(!k){if(k=!0,U=$,$=v($),w!==void 0&&T.hasValue){var _=T.value;if(w(_,$))return M=_}return M=$}if(_=M,s(U,$))return _;var z=v($);return w!==void 0&&w(_,z)?(U=$,_):(U=$,M=z)}var k=!1,U,M,Y=p===void 0?null:p;return[function(){return A(b())},Y===null?void 0:function(){return A(Y())}]},[b,p,v,w]);var C=l(m,E[0],E[1]);return f(function(){T.hasValue=!0,T.value=C},[C]),g(C),C},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})(),k0}var cA;function nF(){return cA||(cA=1,_0.exports=tF()),_0.exports}var oF=nF();const ES=[];let xS;function rF(){return xS}function aF(o){ES.push(o)}function c_(o){const n=(a,s)=>{const l=mr(iF).current;let c;try{xS=l;for(const f of ES)f.before(l);c=o(a,s);for(const f of ES)f.after(l);l.didInitialize=!0}finally{xS=void 0}return c};return n.displayName=o.displayName||o.name,n}function sF(o){return x.forwardRef(c_(o))}function iF(){return{didInitialize:!1}}const lF=GS(19),cF=lF?dF:fF;function u_(o,n,a,s,l){return cF(o,n,a,s,l)}function uF(o,n,a,s,l){const c=x.useCallback(()=>n(o.getSnapshot(),a,s,l),[o,n,a,s,l]);return YS.useSyncExternalStore(o.subscribe,c,c)}aF({before(o){o.syncIndex=0,o.didInitialize||(o.syncTick=1,o.syncHooks=[],o.didChangeStore=!0,o.getSnapshot=()=>{let n=!1;for(let a=0;a<o.syncHooks.length;a+=1){const s=o.syncHooks[a],l=s.selector(s.store.state,s.a1,s.a2,s.a3);(s.didChange||!Object.is(s.value,l))&&(n=!0,s.value=l,s.didChange=!1)}return n&&(o.syncTick+=1),o.syncTick})},after(o){o.syncHooks.length>0&&(o.didChangeStore&&(o.didChangeStore=!1,o.subscribe=n=>{const a=new Set;for(const l of o.syncHooks)a.add(l.store);const s=[];for(const l of a)s.push(l.subscribe(n));return()=>{for(const l of s)l()}}),YS.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot))}});function dF(o,n,a,s,l){const c=rF();if(!c)return uF(o,n,a,s,l);const f=c.syncIndex;c.syncIndex+=1;let h;return c.didInitialize?(h=c.syncHooks[f],(h.store!==o||h.selector!==n||!Object.is(h.a1,a)||!Object.is(h.a2,s)||!Object.is(h.a3,l))&&(h.store!==o&&(c.didChangeStore=!0),h.store=o,h.selector=n,h.a1=a,h.a2=s,h.a3=l,h.didChange=!0)):(h={store:o,selector:n,a1:a,a2:s,a3:l,value:n(o.getSnapshot(),a,s,l),didChange:!1},c.syncHooks.push(h)),h.value}function fF(o,n,a,s,l){return oF.useSyncExternalStoreWithSelector(o.subscribe,o.getSnapshot,o.getSnapshot,c=>n(c,a,s,l))}class hF{constructor(n){We(this,"subscribe",n=>(this.listeners.add(n),()=>{this.listeners.delete(n)}));We(this,"getSnapshot",()=>this.state);this.state=n,this.listeners=new Set,this.updateTick=0}setState(n){if(this.state===n)return;this.state=n,this.updateTick+=1;const a=this.updateTick;for(const s of this.listeners){if(a!==this.updateTick)return;s(n)}}update(n){for(const a in n)if(!Object.is(this.state[a],n[a])){this.setState({...this.state,...n});return}}set(n,a){Object.is(this.state[n],a)||this.setState({...this.state,[n]:a})}notifyAll(){const n={...this.state};this.setState(n)}use(n,a,s,l){return u_(this,n,a,s,l)}}class pw extends hF{constructor(n,a={},s){super(n),this.context=a,this.selectors=s}useSyncedValue(n,a){x.useDebugValue(n),pt(()=>{this.state[n]!==a&&this.set(n,a)},[n,a])}useSyncedValueWithCleanup(n,a){const s=this;pt(()=>(s.state[n]!==a&&s.set(n,a),()=>{s.set(n,void 0)}),[s,n,a])}useSyncedValues(n){const a=this;{x.useDebugValue(n,f=>Object.keys(f));const l=x.useRef(Object.keys(n)).current,c=Object.keys(n);(l.length!==c.length||l.some((f,h)=>f!==c[h]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const s=Object.values(n);pt(()=>{a.update(n)},[a,...s])}useControlledProp(n,a){x.useDebugValue(n);const s=a!==void 0;pt(()=>{s&&!Object.is(this.state[n],a)&&super.setState({...this.state,[n]:a})},[n,a,s]);{const l=this.controlledValues??(this.controlledValues=new Map);l.has(n)||l.set(n,s);const c=l.get(n);c!==void 0&&c!==s&&console.error(`A component is changing the ${s?"":"un"}controlled state of ${n.toString()} to be ${s?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(n,a,s,l){const c=this.selectors[n];return c(this.state,a,s,l)}useState(n,a,s,l){return x.useDebugValue(n),u_(this,this.selectors[n],a,s,l)}useContextCallback(n,a){x.useDebugValue(n);const s=st(a??$N);this.context[n]=s}useStateSetter(n){const a=x.useRef(void 0);return a.current===void 0&&(a.current=s=>{this.set(n,s)}),a.current}observe(n,a){let s;typeof n=="function"?s=n:s=this.selectors[n];let l=s(this.state);return a(l,l,this),this.subscribe(c=>{const f=s(c);if(!Object.is(l,f)){const h=l;l=f,a(f,h,this)}})}}const pF={open:zt(o=>o.open),domReferenceElement:zt(o=>o.domReferenceElement),referenceElement:zt(o=>o.positionReference??o.referenceElement),floatingElement:zt(o=>o.floatingElement),floatingId:zt(o=>o.floatingId)};class mw extends pw{constructor(a){const{nested:s,noEmit:l,onOpenChange:c,triggerElements:f,...h}=a;super({...h,positionReference:h.referenceElement,domReferenceElement:h.referenceElement},{onOpenChange:c,dataRef:{current:{}},events:YM(),nested:s,noEmit:l,triggerElements:f},pF);We(this,"setOpen",(a,s)=>{var l,c;if((!a||!this.state.open||J6(s.event))&&(this.context.dataRef.current.openEvent=a?s.event:void 0),!this.context.noEmit){const f={open:a,reason:s.reason,nativeEvent:s.event,nested:this.context.nested,triggerElement:s.trigger};this.context.events.emit("openchange",f)}(c=(l=this.context).onOpenChange)==null||c.call(l,a,s)})}}function mF(o,n){const a=x.useRef(null),s=x.useRef(null);return x.useCallback(l=>{if(o!==void 0){if(a.current!==null){const c=a.current,f=s.current,h=n.context.triggerElements.getById(c);f&&h===f&&n.context.triggerElements.delete(c),a.current=null,s.current=null}l!==null&&(a.current=o,s.current=l,n.context.triggerElements.add(o,l))}},[n,o])}function gF(o,n,a,s){const l=a.useState("isMountedByTrigger",o),c=mF(o,a),f=st(h=>{if(c(h),!h||!a.select("open"))return;const g=a.select("activeTriggerId");if(g===o){a.update({activeTriggerElement:h,...s});return}g==null&&a.update({activeTriggerId:o,activeTriggerElement:h,...s})});return pt(()=>{l&&a.update({activeTriggerElement:n.current,...s})},[l,a,n,...Object.values(s)]),{registerTrigger:f,isMountedByThisTrigger:l}}function d_(o){const n=o.useState("open");pt(()=>{if(n&&!o.select("activeTriggerId")&&o.context.triggerElements.size===1){const a=o.context.triggerElements.entries().next();if(!a.done){const[s,l]=a.value;o.update({activeTriggerId:s,activeTriggerElement:l})}}},[n,o])}function f_(o,n,a){const{mounted:s,setMounted:l,transitionStatus:c}=WN(o);n.useSyncedValues({mounted:s,transitionStatus:c});const f=st(()=>{var g,m;l(!1),n.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),a==null||a(),(m=(g=n.context).onOpenChangeComplete)==null||m.call(g,!1)}),h=n.useState("preventUnmountingOnClose");return bg({enabled:!h,open:o,ref:n.context.popupRef,onComplete(){o||f()}}),{forceUnmount:f,transitionStatus:c}}class Sg{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(n,a){const s=this.idMap.get(n);if(s!==a&&(s!==void 0&&this.elementsSet.delete(s),this.elementsSet.add(a),this.idMap.set(n,a),this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(n){const a=this.idMap.get(n);a&&(this.elementsSet.delete(a),this.idMap.delete(n))}hasElement(n){return this.elementsSet.has(n)}hasMatchingElement(n){for(const a of this.elementsSet)if(n(a))return!0;return!1}getById(n){return this.idMap.get(n)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function yF(){return new mw({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Sg,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function h_(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:yF(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:fr,inactiveTriggerProps:fr,popupProps:fr}}const Om=zt(o=>o.triggerIdProp??o.activeTriggerId),p_={open:zt(o=>o.openProp??o.open),mounted:zt(o=>o.mounted),transitionStatus:zt(o=>o.transitionStatus),floatingRootContext:zt(o=>o.floatingRootContext),preventUnmountingOnClose:zt(o=>o.preventUnmountingOnClose),payload:zt(o=>o.payload),activeTriggerId:Om,activeTriggerElement:zt(o=>o.mounted?o.activeTriggerElement:null),isTriggerActive:zt((o,n)=>n!==void 0&&Om(o)===n),isOpenedByTrigger:zt((o,n)=>n!==void 0&&Om(o)===n&&o.open),isMountedByTrigger:zt((o,n)=>n!==void 0&&Om(o)===n&&o.mounted),triggerProps:zt((o,n)=>n?o.activeTriggerProps:o.inactiveTriggerProps),popupProps:zt(o=>o.popupProps),popupElement:zt(o=>o.popupElement),positionerElement:zt(o=>o.positionerElement)};function bF(o){const{open:n=!1,onOpenChange:a,elements:s={}}=o,l=wu(),c=Cu()!=null;{const h=s.reference;h&&!qt(h)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const f=mr(()=>new mw({open:n,onOpenChange:a,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new Sg,floatingId:l,nested:c,noEmit:!1})).current;return pt(()=>{const h={open:n,floatingId:l};s.reference!==void 0&&(h.referenceElement=s.reference,h.domReferenceElement=qt(s.reference)?s.reference:null),s.floating!==void 0&&(h.floatingElement=s.floating),f.update(h)},[n,l,s.reference,s.floating,f]),f.context.onOpenChange=a,f.context.nested=c,f.context.noEmit=!1,f}function vF(o={}){const{nodeId:n,externalTree:a}=o,s=bF(o),l=o.rootContext||s,c={reference:l.useState("referenceElement"),floating:l.useState("floatingElement"),domReference:l.useState("domReferenceElement")},[f,h]=x.useState(null),g=x.useRef(null),m=Ou(a);pt(()=>{c.domReference&&(g.current=c.domReference)},[c.domReference]);const b=DV({...o,elements:{...c,...f&&{reference:f}}}),p=x.useCallback(_=>{const z=qt(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;h(z),b.refs.setReference(z)},[b.refs]),[v,w]=x.useState(null),[E,T]=x.useState(null);l.useSyncedValue("referenceElement",v),l.useSyncedValue("domReferenceElement",qt(v)?v:null),l.useSyncedValue("floatingElement",E);const C=x.useCallback(_=>{(qt(_)||_===null)&&(g.current=_,w(_)),(qt(b.refs.reference.current)||b.refs.reference.current===null||_!==null&&!qt(_))&&b.refs.setReference(_)},[b.refs,w]),A=x.useCallback(_=>{T(_),b.refs.setFloating(_)},[b.refs]),k=x.useMemo(()=>({...b.refs,setReference:C,setFloating:A,setPositionReference:p,domReference:g}),[b.refs,C,A,p]),U=x.useMemo(()=>({...b.elements,domReference:c.domReference}),[b.elements,c.domReference]),M=l.useState("open"),Y=l.useState("floatingId"),$=x.useMemo(()=>({...b,dataRef:l.context.dataRef,open:M,onOpenChange:l.setOpen,events:l.context.events,floatingId:Y,refs:k,elements:U,nodeId:n,rootStore:l}),[b,k,U,n,l,M,Y]);return pt(()=>{l.context.dataRef.current.floatingContext=$;const _=m==null?void 0:m.nodesRef.current.find(z=>z.id===n);_&&(_.context=$)}),x.useMemo(()=>({...b,context:$,refs:k,elements:U,rootStore:l}),[b,k,U,$,l])}function m_(o){const{popupStore:n,noEmit:a=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:l}=o,c=wu(),f=Cu()!=null,h=n.useState("open"),g=n.useState("activeTriggerElement"),m=n.useState(s?"popupElement":"positionerElement"),b=n.context.triggerElements,p=mr(()=>new mw({open:h,referenceElement:g,floatingElement:m,triggerElements:b,onOpenChange:l,floatingId:c,nested:f,noEmit:a})).current;return pt(()=>{const v={open:h,floatingId:c,referenceElement:g,floatingElement:m};qt(g)&&(v.domReferenceElement=g),p.state.positionReference===p.state.referenceElement&&(v.positionReference=g),p.update(v)},[h,c,g,m,p]),p.context.onOpenChange=l,p.context.nested=f,p.context.noEmit=a,p}const L0=V6&&xM;function SF(o,n={}){const a="rootStore"in o?o.rootStore:o,{events:s,dataRef:l}=a.context,{enabled:c=!0,delay:f}=n,h=x.useRef(!1),g=x.useRef(null),m=Ds(),b=x.useRef(!0);x.useEffect(()=>{const v=a.select("domReferenceElement");if(!c)return;const w=Gn(v);function E(){const A=a.select("domReferenceElement");!a.select("open")&&$n(A)&&A===xs(fn(A))&&(h.current=!0)}function T(){b.current=!0}function C(){b.current=!1}return w.addEventListener("blur",E),L0&&(w.addEventListener("keydown",T,!0),w.addEventListener("pointerdown",C,!0)),()=>{w.removeEventListener("blur",E),L0&&(w.removeEventListener("keydown",T,!0),w.removeEventListener("pointerdown",C,!0))}},[a,c]),x.useEffect(()=>{if(!c)return;function v(w){if(w.reason===Lf||w.reason===XS){const E=a.select("domReferenceElement");qt(E)&&(g.current=E,h.current=!0)}}return s.on("openchange",v),()=>{s.off("openchange",v)}},[s,c,a]);const p=x.useMemo(()=>({onMouseLeave(){h.current=!1,g.current=null},onFocus(v){const w=v.currentTarget;if(h.current){if(g.current===w)return;h.current=!1,g.current=null}const E=qo(v.nativeEvent);if(qt(E)){if(L0&&!v.relatedTarget){if(!b.current&&!rw(E))return}else if(!G6(E))return}const T=Xm(v.relatedTarget,a.context.triggerElements),{nativeEvent:C,currentTarget:A}=v,k=typeof f=="function"?f():f;if(a.select("open")&&T||k===0||k===void 0){a.setOpen(!0,yn(zm,C,A));return}m.start(k,()=>{h.current||a.setOpen(!0,yn(zm,C,A))})},onBlur(v){h.current=!1,g.current=null;const w=v.relatedTarget,E=v.nativeEvent,T=qt(w)&&w.hasAttribute(Su("focus-guard"))&&w.getAttribute("data-type")==="outside";m.start(0,()=>{var U;const C=a.select("domReferenceElement"),A=xs(C?C.ownerDocument:document);!w&&A===C||Yt((U=l.current.floatingContext)==null?void 0:U.refs.floating.current,A)||Yt(C,A)||T||Xm(w??A,a.context.triggerElements)||a.setOpen(!1,yn(zm,E))})}}),[l,a,m,f]);return x.useMemo(()=>c?{reference:p,trigger:p}:{},[c,p])}const RS=Su("safe-polygon"),wF=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${OM}`;function EF(o){return o?!!o.closest(wF):!1}class gw{constructor(){We(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});We(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new Fa,this.restTimeout=new Fa,this.handleCloseOptions=void 0}static create(){return new gw}}function g_(o){const n=mr(gw.create).current,a=o.context.dataRef.current;return a.hoverInteractionState||(a.hoverInteractionState=n),hg(a.hoverInteractionState.disposeEffect),a.hoverInteractionState}const xF=new Set(["click","mousedown"]);function RF(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingElement"),c=a.useState("domReferenceElement"),{dataRef:f}=a.context,{enabled:h=!0,closeDelay:g=0}=n,m=g_(a),b=Ou(),p=Cu(),v=st(()=>m.interactedInside?!0:f.current.openEvent?xF.has(f.current.openEvent.type):!1),w=st(()=>{var M;const U=(M=f.current.openEvent)==null?void 0:M.type;return(U==null?void 0:U.includes("mouse"))&&U!=="mousedown"}),E=st(U=>Xm(U,a.context.triggerElements)),T=x.useCallback((U,M=!0)=>{const Y=TF(g,m.pointerType);Y&&!m.handler?m.openChangeTimeout.start(Y,()=>a.setOpen(!1,yn(Zr,U))):M&&(m.openChangeTimeout.clear(),a.setOpen(!1,yn(Zr,U)))},[g,a,m]),C=st(()=>{m.unbindMouseMove(),m.handler=void 0}),A=st(()=>{if(m.performedPointerEventsMutation){const U=fn(l).body;U.style.pointerEvents="",U.removeAttribute(RS),m.performedPointerEventsMutation=!1}}),k=st(U=>{const M=qo(U);if(!EF(M)){m.interactedInside=!1;return}m.interactedInside=!0});pt(()=>{s||(m.pointerType=void 0,m.restTimeoutPending=!1,m.interactedInside=!1,C(),A())},[s,m,C,A]),x.useEffect(()=>()=>{C()},[C]),x.useEffect(()=>A,[A]),pt(()=>{var U,M,Y;if(h&&s&&(U=m.handleCloseOptions)!=null&&U.blockPointerEvents&&w()&&qt(c)&&l){m.performedPointerEventsMutation=!0;const $=fn(l).body;$.setAttribute(RS,"");const _=c,z=l,te=(Y=(M=b==null?void 0:b.nodesRef.current.find(H=>H.id===p))==null?void 0:M.context)==null?void 0:Y.elements.floating;return te&&(te.style.pointerEvents=""),$.style.pointerEvents="none",_.style.pointerEvents="auto",z.style.pointerEvents="auto",()=>{$.style.pointerEvents="",_.style.pointerEvents="",z.style.pointerEvents=""}}},[h,s,c,l,m,w,b,p]),x.useEffect(()=>{if(!h)return;function U(_){v()||!f.current.floatingContext||!a.select("open")||E(_.relatedTarget)||(A(),C(),v()||T(_))}function M(_){var z;m.openChangeTimeout.clear(),A(),(z=m.handler)==null||z.call(m,_),C()}function Y(_){v()||T(_,!1)}const $=l;return $&&($.addEventListener("mouseleave",U),$.addEventListener("mouseenter",M),$.addEventListener("mouseleave",Y),$.addEventListener("pointerdown",k,!0)),()=>{$&&($.removeEventListener("mouseleave",U),$.removeEventListener("mouseenter",M),$.removeEventListener("mouseleave",Y),$.removeEventListener("pointerdown",k,!0))}},[h,l,a,f,v,E,T,A,C,k,m])}function TF(o,n){return n&&!Uf(n)?0:typeof o=="function"?o():o}function U0(o){return typeof o=="function"?o():o}const CF={current:null};function OF(o,n={}){var H;const a="rootStore"in o?o.rootStore:o,{dataRef:s,events:l}=a.context,{enabled:c=!0,delay:f=0,handleClose:h=null,mouseOnly:g=!1,restMs:m=0,move:b=!0,triggerElementRef:p=CF,externalTree:v,isActiveTrigger:w=!0}=n,E=Ou(v),T=g_(a),C=Pa(h),A=Pa(f),k=Pa(m),U=Pa(c);w&&(T.handleCloseOptions=(H=C.current)==null?void 0:H.__options);const M=st(()=>T.interactedInside?!0:s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1),Y=st(J=>Xm(J,a.context.triggerElements)),$=x.useCallback((J,N=!0)=>{const P=jm(A.current,"close",T.pointerType);P&&!T.handler?T.openChangeTimeout.start(P,()=>a.setOpen(!1,yn(Zr,J))):N&&(T.openChangeTimeout.clear(),a.setOpen(!1,yn(Zr,J)))},[A,a,T]),_=st(()=>{T.unbindMouseMove(),T.handler=void 0}),z=st(()=>{if(T.performedPointerEventsMutation){const J=fn(a.select("domReferenceElement")).body;J.style.pointerEvents="",J.removeAttribute(RS),T.performedPointerEventsMutation=!1}});x.useEffect(()=>{if(!c)return;function J(N){N.open||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return l.on("openchange",J),()=>{l.off("openchange",J)}},[c,l,T]);const te=st(J=>{var P;if(M()||!s.current.floatingContext||Y(J.relatedTarget))return;const N=p.current;(P=C.current)==null||P.call(C,{...s.current.floatingContext,tree:E,x:J.clientX,y:J.clientY,onClose(){z(),_(),!M()&&N===a.select("domReferenceElement")&&$(J)}})(J)});return x.useEffect(()=>{if(!c)return;const J=p.current??(w?a.select("domReferenceElement"):null);if(!qt(J))return;function N(Z){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,g&&!Uf(T.pointerType)||U0(k.current)>0&&!jm(A.current,"open"))return;const j=jm(A.current,"open",T.pointerType),oe=a.select("domReferenceElement"),I=a.context.triggerElements,ie=(I.hasElement(Z.target)||I.hasMatchingElement(se=>Yt(se,Z.target)))&&(!oe||!Yt(oe,Z.target)),pe=Z.currentTarget??null,L=a.select("open"),ce=!L||ie;ie&&L?a.setOpen(!0,yn(Zr,Z,pe)):j?T.openChangeTimeout.start(j,()=>{ce&&a.setOpen(!0,yn(Zr,Z,pe))}):ce&&a.setOpen(!0,yn(Zr,Z,pe))}function P(Z){if(M()){z();return}T.unbindMouseMove();const j=a.select("domReferenceElement"),oe=fn(j);if(T.restTimeout.clear(),T.restTimeoutPending=!1,Y(Z.relatedTarget))return;if(C.current&&s.current.floatingContext){a.select("open")||T.openChangeTimeout.clear();const ie=p.current;T.handler=C.current({...s.current.floatingContext,tree:E,x:Z.clientX,y:Z.clientY,onClose(){z(),_(),U.current&&!M()&&ie===a.select("domReferenceElement")&&$(Z,!0)}});const pe=T.handler;pe(Z),oe.addEventListener("mousemove",pe),T.unbindMouseMove=()=>{oe.removeEventListener("mousemove",pe)};return}(T.pointerType==="touch"?!Yt(a.select("floatingElement"),Z.relatedTarget):!0)&&$(Z)}function ne(Z){te(Z)}return a.select("open")&&J.addEventListener("mouseleave",ne),b&&J.addEventListener("mousemove",N,{once:!0}),J.addEventListener("mouseenter",N),J.addEventListener("mouseleave",P),()=>{J.removeEventListener("mouseleave",ne),b&&J.removeEventListener("mousemove",N),J.removeEventListener("mouseenter",N),J.removeEventListener("mouseleave",P)}},[_,z,s,A,$,a,c,C,te,T,w,M,Y,g,b,k,p,E,U]),x.useMemo(()=>{if(!c)return;function J(N){T.pointerType=N.pointerType}return{onPointerDown:J,onPointerEnter:J,onMouseMove(N){const{nativeEvent:P}=N,ne=N.currentTarget,Z=a.select("domReferenceElement"),j=a.context.triggerElements,oe=a.select("open"),I=(j.hasElement(N.target)||j.hasMatchingElement(pe=>Yt(pe,N.target)))&&(!Z||!Yt(Z,N.target));if(g&&!Uf(T.pointerType)||oe&&!I||U0(k.current)===0||!I&&T.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;T.restTimeout.clear();function ie(){if(T.restTimeoutPending=!1,M())return;const pe=a.select("open");!T.blockMouseMove&&(!pe||I)&&a.setOpen(!0,yn(Zr,P,ne))}T.pointerType==="touch"?zi.flushSync(()=>{ie()}):I&&oe?ie():(T.restTimeoutPending=!0,T.restTimeout.start(U0(k.current),ie))}}},[c,T,M,g,a,k])}function y_(o=[]){const n=o.map(m=>m==null?void 0:m.reference),a=o.map(m=>m==null?void 0:m.floating),s=o.map(m=>m==null?void 0:m.item),l=o.map(m=>m==null?void 0:m.trigger),c=x.useCallback(m=>Dm(m,o,"reference"),n),f=x.useCallback(m=>Dm(m,o,"floating"),a),h=x.useCallback(m=>Dm(m,o,"item"),s),g=x.useCallback(m=>Dm(m,o,"trigger"),l);return x.useMemo(()=>({getReferenceProps:c,getFloatingProps:f,getItemProps:h,getTriggerProps:g}),[c,f,h,g])}function Dm(o,n,a){var f;const s=new Map,l=a==="item",c={};a==="floating"&&(c.tabIndex=-1,c[gS]="");for(const h in o)l&&o&&(h===TM||h===CM)||(c[h]=o[h]);for(let h=0;h<n.length;h+=1){let g;const m=(f=n[h])==null?void 0:f[a];typeof m=="function"?g=o?m(o):null:g=m,g&&uA(c,g,l,s)}return uA(c,o,l,s),c}function uA(o,n,a,s){var l;for(const c in n){const f=n[c];a&&(c===TM||c===CM)||(c.startsWith("on")?(s.has(c)||s.set(c,[]),typeof f=="function"&&((l=s.get(c))==null||l.push(f),o[c]=(...h)=>{var g;return(g=s.get(c))==null?void 0:g.map(m=>m(...h)).find(m=>m!==void 0)})):o[c]=f)}}const DF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function AF(o,n={}){const a="rootStore"in o?o.rootStore:o,s=a.useState("open"),l=a.useState("floatingId"),c=a.useState("domReferenceElement"),f=a.useState("floatingElement"),{role:h="dialog"}=n,g=wu(),m=(c==null?void 0:c.id)||g,b=x.useMemo(()=>{var k;return((k=yS(f))==null?void 0:k.id)||l},[f,l]),p=DF.get(h)??h,w=Cu()!=null,E=x.useMemo(()=>p==="tooltip"||h==="label"?fr:{"aria-haspopup":p==="alertdialog"?"dialog":p,"aria-expanded":"false",...p==="listbox"&&{role:"combobox"},...p==="menu"&&w&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[p,w,h]),T=x.useMemo(()=>p==="tooltip"||h==="label"?{[`aria-${h==="label"?"labelledby":"describedby"}`]:s?b:void 0}:{...E,"aria-expanded":s?"true":"false","aria-controls":s?b:void 0,...p==="menu"&&{id:m}},[p,b,s,m,h,E]),C=x.useMemo(()=>{const k={id:b,...p&&{role:p}};return p==="tooltip"||h==="label"?k:{...k,...p==="menu"&&{"aria-labelledby":m}}},[p,b,m,h]),A=x.useCallback(({active:k,selected:U})=>{const M={role:"option",...k&&{id:`${b}-fui-option`}};switch(h){case"select":case"combobox":return{...M,"aria-selected":U}}return{}},[b,h]);return x.useMemo(()=>({reference:T,floating:C,item:A,trigger:E}),[T,C,E,A])}function dA(o,n){const[a,s]=o;let l=!1;const c=n.length;for(let f=0,h=c-1;f<c;h=f++){const[g,m]=n[f]||[0,0],[b,p]=n[h]||[0,0];m>=s!=p>=s&&a<=(b-g)*(s-m)/(p-m)+g&&(l=!l)}return l}function NF(o,n){return o[0]>=n.x&&o[0]<=n.x+n.width&&o[1]>=n.y&&o[1]<=n.y+n.height}function MF(o={}){const{buffer:n=.5,blockPointerEvents:a=!1,requireIntent:s=!0}=o,l=new Fa;let c=!1,f=null,h=null,g=typeof performance<"u"?performance.now():0;function m(p,v){const w=performance.now(),E=w-g;if(f===null||h===null||E===0)return f=p,h=v,g=w,null;const T=p-f,C=v-h,k=Math.sqrt(T*T+C*C)/E;return f=p,h=v,g=w,k}const b=({x:p,y:v,placement:w,elements:E,onClose:T,nodeId:C,tree:A})=>function(U){function M(){l.clear(),T()}if(l.clear(),!E.domReference||!E.floating||w==null||p==null||v==null)return;const{clientX:Y,clientY:$}=U,_=[Y,$],z=qo(U),te=U.type==="mouseleave",H=Yt(E.floating,z),J=Yt(E.domReference,z),N=E.domReference.getBoundingClientRect(),P=E.floating.getBoundingClientRect(),ne=w.split("-")[0],Z=p>P.right-P.width/2,j=v>P.bottom-P.height/2,oe=NF(_,N),I=P.width>N.width,ie=P.height>N.height,pe=(I?N:P).left,L=(I?N:P).right,ce=(ie?N:P).top,se=(ie?N:P).bottom;if(H&&(c=!0,!te))return;if(J&&(c=!1),J&&!te){c=!0;return}if(te&&qt(U.relatedTarget)&&Yt(E.floating,U.relatedTarget)||A&&Vl(A.nodesRef.current,C).some(({context:Ue})=>Ue==null?void 0:Ue.open))return;if(ne==="top"&&v>=N.bottom-1||ne==="bottom"&&v<=N.top+1||ne==="left"&&p>=N.right-1||ne==="right"&&p<=N.left+1)return M();let me=[];switch(ne){case"top":me=[[pe,N.top+1],[pe,P.bottom-1],[L,P.bottom-1],[L,N.top+1]];break;case"bottom":me=[[pe,P.top+1],[pe,N.bottom-1],[L,N.bottom-1],[L,P.top+1]];break;case"left":me=[[P.right-1,se],[P.right-1,ce],[N.left+1,ce],[N.left+1,se]];break;case"right":me=[[N.right-1,se],[N.right-1,ce],[P.left+1,ce],[P.left+1,se]];break}function Te([Ue,ve]){switch(ne){case"top":{const ze=[I?Ue+n/2:Z?Ue+n*4:Ue-n*4,ve+n+1],je=[I?Ue-n/2:Z?Ue+n*4:Ue-n*4,ve+n+1],at=[[P.left,Z||I?P.bottom-n:P.top],[P.right,Z?I?P.bottom-n:P.top:P.bottom-n]];return[ze,je,...at]}case"bottom":{const ze=[I?Ue+n/2:Z?Ue+n*4:Ue-n*4,ve-n],je=[I?Ue-n/2:Z?Ue+n*4:Ue-n*4,ve-n],at=[[P.left,Z||I?P.top+n:P.bottom],[P.right,Z?I?P.top+n:P.bottom:P.top+n]];return[ze,je,...at]}case"left":{const ze=[Ue+n+1,ie?ve+n/2:j?ve+n*4:ve-n*4],je=[Ue+n+1,ie?ve-n/2:j?ve+n*4:ve-n*4];return[...[[j||ie?P.right-n:P.left,P.top],[j?ie?P.right-n:P.left:P.right-n,P.bottom]],ze,je]}case"right":{const ze=[Ue-n,ie?ve+n/2:j?ve+n*4:ve-n*4],je=[Ue-n,ie?ve-n/2:j?ve+n*4:ve-n*4],at=[[j||ie?P.left+n:P.right,P.top],[j?ie?P.left+n:P.right:P.left+n,P.bottom]];return[ze,je,...at]}default:return[]}}if(!dA([Y,$],me)){if(c&&!oe)return M();if(!te&&s){const Ue=m(U.clientX,U.clientY);if(Ue!==null&&Ue<.1)return M()}dA([Y,$],Te([p,v]))?!c&&s&&l.start(40,M):M()}};return b.__options={blockPointerEvents:a},b}let _F=(function(o){return o.nestedDialogs="--nested-dialogs",o})({}),kF=(function(o){return o[o.open=Ml.open]="open",o[o.closed=Ml.closed]="closed",o[o.startingStyle=Ml.startingStyle]="startingStyle",o[o.endingStyle=Ml.endingStyle]="endingStyle",o.nested="data-nested",o.nestedDialogOpen="data-nested-dialog-open",o})({});const yw=x.createContext(void 0);yw.displayName="DialogPortalContext";function LF(){const o=x.useContext(yw);if(o===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return o}const b_="ArrowUp",v_="ArrowDown",S_="ArrowLeft",w_="ArrowRight",E_="Home",x_="End",UF=new Set([S_,w_]),zF=new Set([b_,v_]),jF=new Set([...UF,...zF]);[...jF];const PF=new Set([b_,v_,S_,w_,E_,x_]),HF={...Jf,...Qf,nestedDialogOpen(o){return o?{[kF.nestedDialogOpen]:""}:null}},R_=x.forwardRef(function(n,a){const{className:s,finalFocus:l,initialFocus:c,render:f,...h}=n,{store:g}=Wl(),m=g.useState("descriptionElementId"),b=g.useState("disablePointerDismissal"),p=g.useState("floatingRootContext"),v=g.useState("popupProps"),w=g.useState("modal"),E=g.useState("mounted"),T=g.useState("nested"),C=g.useState("nestedOpenDialogCount"),A=g.useState("open"),k=g.useState("openMethod"),U=g.useState("titleElementId"),M=g.useState("transitionStatus"),Y=g.useState("role");LF(),bg({open:A,ref:g.context.popupRef,onComplete(){var J,N;A&&((N=(J=g.context).onOpenChangeComplete)==null||N.call(J,!0))}});function $(J){return J==="touch"?g.context.popupRef.current:!0}const _=c===void 0?$:c,z=C>0,H=Ln("div",n,{state:{open:A,nested:T,transitionStatus:M,nestedDialogOpen:z},props:[v,{"aria-labelledby":U??void 0,"aria-describedby":m??void 0,role:Y,tabIndex:-1,hidden:!E,onKeyDown(J){PF.has(J.key)&&J.stopPropagation()},style:{[_F.nestedDialogs]:C}},h],ref:[a,g.context.popupRef,g.useStateSetter("popupElement")],stateAttributesMapping:HF});return nn.jsx($8,{context:p,openInteractionType:k,disabled:!E,closeOnFocusOut:!b,initialFocus:_,returnFocus:l,modal:w!==!1,restoreFocus:"popup",children:H})});R_.displayName="DialogPopup";function IF(o){return GS(19)?o:o?"true":void 0}const T_=x.forwardRef(function(n,a){const{cutout:s,...l}=n;let c;if(s){const f=s==null?void 0:s.getBoundingClientRect();c=`polygon(
437
437
  0% 0%,
438
438
  100% 0%,
439
439
  100% 100%,
@@ -444,5 +444,5 @@ Avoid returning a new reference inside your input selector, e.g.
444
444
  ${f.right}px ${f.bottom}px,
445
445
  ${f.right}px ${f.top}px,
446
446
  ${f.left}px ${f.top}px
447
- )`}return nn.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});T_.displayName="InternalBackdrop";const C_=x.forwardRef(function(n,a){const{keepMounted:s=!1,...l}=n,{store:c}=Wl(),f=c.useState("mounted"),h=c.useState("modal"),g=c.useState("open");return f||s?nn.jsx(yw.Provider,{value:s,children:nn.jsxs(KM,{ref:a,...l,children:[f&&h===!0&&nn.jsx(T_,{ref:c.context.internalBackdropRef,inert:IF(!g)}),n.children]})}):null});C_.displayName="DialogPortal";function O_(o){const n=x.useRef(!0);n.current&&(n.current=!1,o())}let fA={},hA={},pA="";function BF(o){if(typeof document>"u")return!1;const n=fn(o);return Gn(n).innerWidth-n.documentElement.clientWidth>0}function VF(o){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=fn(o),s=a.documentElement,l=a.body,c=Pi(s)?s:l,f=c.style.overflowY,h=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",c.style.overflowY="scroll";const g=c.offsetWidth;c.style.overflowY="hidden";const m=c.offsetWidth;return c.style.overflowY=f,s.style.scrollbarGutter=h,g===m}function FF(o){const n=fn(o),a=n.documentElement,s=n.body,l=Pi(a)?a:s,c={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,c)}}function YF(o){var v;const n=fn(o),a=n.documentElement,s=n.body,l=Gn(a);let c=0,f=0,h=!1;const g=Nn.create();if(ow&&(((v=l.visualViewport)==null?void 0:v.scale)??1)!==1)return()=>{};function m(){const w=l.getComputedStyle(a),E=l.getComputedStyle(s),A=(w.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=a.scrollTop,f=a.scrollLeft,fA={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},pA=a.style.scrollBehavior,hA={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const k=a.scrollHeight>a.clientHeight,U=a.scrollWidth>a.clientWidth,M=w.overflowY==="scroll"||E.overflowY==="scroll",Y=w.overflowX==="scroll"||E.overflowX==="scroll",$=Math.max(0,l.innerWidth-s.clientWidth),_=Math.max(0,l.innerHeight-s.clientHeight),z=parseFloat(E.marginTop)+parseFloat(E.marginBottom),te=parseFloat(E.marginLeft)+parseFloat(E.marginRight),H=Pi(a)?a:s;if(h=VF(o),h){a.style.scrollbarGutter=A,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),(k||M)&&(a.style.overflowY="scroll"),(U||Y)&&(a.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:z||_?`calc(100dvh - ${z+_}px)`:"100dvh",width:te||$?`calc(100vw - ${te+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=c,s.scrollLeft=f,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function b(){Object.assign(a.style,fA),Object.assign(s.style,hA),h||(a.scrollTop=c,a.scrollLeft=f,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=pA)}function p(){b(),g.request(m)}return m(),l.addEventListener("resize",p),()=>{g.cancel(),b(),typeof l.removeEventListener=="function"&&l.removeEventListener("resize",p)}}class $F{constructor(){We(this,"lockCount",0);We(this,"restore",null);We(this,"timeoutLock",Fa.create());We(this,"timeoutUnlock",Fa.create());We(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});We(this,"unlock",()=>{var n;this.lockCount===0&&this.restore&&((n=this.restore)==null||n.call(this),this.restore=null)})}acquire(n){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(n)),this.release}lock(n){if(this.lockCount===0||this.restore!==null)return;const s=fn(n).documentElement,l=Gn(s).getComputedStyle(s).overflowY;if(l==="hidden"||l==="clip"){this.restore=$N;return}const c=EM||!BF(n);this.restore=c?FF(n):YF(n)}}const qF=new $F;function GF(o=!0,n=null){pt(()=>{if(o)return qF.acquire(n)},[o,n])}function XF(o){const n=x.useRef(""),a=x.useCallback(l=>{l.defaultPrevented||(n.current=l.pointerType,o(l,l.pointerType))},[o]);return{onClick:x.useCallback(l=>{if(l.detail===0){o(l,"keyboard");return}"pointerType"in l?o(l,l.pointerType):o(l,n.current),n.current=""},[o]),onPointerDown:a}}function QF(o){const[n,a]=x.useState(null),s=st((h,g)=>{o||a(g||(EM?"touch":""))}),l=x.useCallback(()=>{a(null)},[]),{onClick:c,onPointerDown:f}=XF(s);return x.useMemo(()=>({openMethod:n,reset:l,triggerProps:{onClick:c,onPointerDown:f}}),[n,l,c,f])}function WF(o){const{store:n,parentContext:a,actionsRef:s}=o,l=n.useState("open"),c=n.useState("disablePointerDismissal"),f=n.useState("modal"),h=n.useState("popupElement"),{openMethod:g,triggerProps:m,reset:b}=QF(l);d_(n);const{forceUnmount:p}=f_(l,n,()=>{b()}),v=st(H=>{const J=yn(H);return J.preventUnmountOnClose=()=>{n.set("preventUnmountingOnClose",!0)},J}),w=x.useCallback(()=>{n.setOpen(!1,v(XN))},[n,v]);x.useImperativeHandle(s,()=>({unmount:p,close:w}),[p,w]);const E=m_({popupStore:n,onOpenChange:n.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[T,C]=x.useState(0),A=T===0,k=AF(E),U=s_(E,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?"intentional":{mouse:f==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if(!n.context.outsidePressEnabledRef.current||"button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const J=qo(H);if(A&&!c){const N=J;return f&&(n.context.internalBackdropRef.current||n.context.backdropRef.current)?n.context.internalBackdropRef.current===N||n.context.backdropRef.current===N||Yt(N,h)&&!(N!=null&&N.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:A});GF(l&&f===!0,h);const{getReferenceProps:M,getFloatingProps:Y,getTriggerProps:$}=y_([k,U]);n.useContextCallback("onNestedDialogOpen",H=>{C(H+1)}),n.useContextCallback("onNestedDialogClose",()=>{C(0)}),x.useEffect(()=>(a!=null&&a.onNestedDialogOpen&&l&&a.onNestedDialogOpen(T),a!=null&&a.onNestedDialogClose&&!l&&a.onNestedDialogClose(),()=>{a!=null&&a.onNestedDialogClose&&l&&a.onNestedDialogClose()}),[l,a,T]);const _=x.useMemo(()=>M(m),[M,m]),z=x.useMemo(()=>$(m),[$,m]),te=x.useMemo(()=>Y(),[Y]);n.useSyncedValues({openMethod:g,activeTriggerProps:_,inactiveTriggerProps:z,popupProps:te,floatingRootContext:E,nestedOpenDialogCount:T})}const KF={...p_,modal:zt(o=>o.modal),nested:zt(o=>o.nested),nestedOpenDialogCount:zt(o=>o.nestedOpenDialogCount),disablePointerDismissal:zt(o=>o.disablePointerDismissal),openMethod:zt(o=>o.openMethod),descriptionElementId:zt(o=>o.descriptionElementId),titleElementId:zt(o=>o.titleElementId),viewportElement:zt(o=>o.viewportElement),role:zt(o=>o.role)};class JF extends pw{constructor(a){super(ZF(a),{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Sg,onOpenChange:void 0,onOpenChangeComplete:void 0},KF);We(this,"setOpen",(a,s)=>{var h,g,m,b;if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!a&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),(g=(h=this.context).onOpenChange)==null||g.call(h,a,s),s.isCanceled)return;const l={open:a,nativeEvent:s.event,reason:s.reason,nested:this.state.nested};(m=this.state.floatingRootContext.context.events)==null||m.emit("openchange",l);const c={open:a},f=((b=s.trigger)==null?void 0:b.id)??null;(f||a)&&(c.activeTriggerId=f,c.activeTriggerElement=s.trigger??null),this.update(c)})}}function ZF(o={}){return{...h_(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...o}}function e7(o){const{children:n,open:a,defaultOpen:s=!1,onOpenChange:l,onOpenChangeComplete:c,disablePointerDismissal:f=!1,modal:h=!0,actionsRef:g,handle:m,triggerId:b,defaultTriggerId:p=null}=o,v=Wl(!0),w=!!v,E=mr(()=>(m==null?void 0:m.store)??new JF({open:s,openProp:a,activeTriggerId:p,triggerIdProp:b,modal:h,disablePointerDismissal:f,nested:w})).current;O_(()=>{a===void 0&&E.state.open===!1&&s===!0&&E.update({open:!0,activeTriggerId:p})}),E.useControlledProp("openProp",a),E.useControlledProp("triggerIdProp",b),E.useSyncedValues({disablePointerDismissal:f,nested:w,modal:h}),E.useContextCallback("onOpenChange",l),E.useContextCallback("onOpenChangeComplete",c);const T=E.useState("payload");WF({store:E,actionsRef:g,parentContext:v==null?void 0:v.store.context});const C=x.useMemo(()=>({store:E}),[E]);return nn.jsx(lw.Provider,{value:C,children:typeof n=="function"?n({payload:T}):n})}const D_=x.forwardRef(function(n,a){const{render:s,className:l,id:c,...f}=n,{store:h}=Wl(),g=Xf(c);return h.useSyncedValueWithCleanup("titleElementId",g),Ln("h2",n,{ref:a,props:[{id:g},f]})});D_.displayName="DialogTitle";function t7({...o}){return re.jsxDEV(e7,{"data-slot":"sheet",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:11,columnNumber:10},this)}function n7({...o}){return re.jsxDEV(C_,{"data-slot":"sheet-portal",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:23,columnNumber:10},this)}function o7({className:o,...n}){return re.jsxDEV(BM,{"data-slot":"sheet-overlay",className:jt("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:28,columnNumber:5},this)}function r7({className:o,children:n,side:a="right",showCloseButton:s=!0,...l}){return re.jsxDEV(n7,{children:[re.jsxDEV(o7,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:48,columnNumber:7},this),re.jsxDEV(R_,{"data-slot":"sheet-content","data-side":a,className:jt("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o),...l,children:[n,s&&re.jsxDEV(VM,{"data-slot":"sheet-close",render:re.jsxDEV(nw,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:60,columnNumber:15},this),children:[re.jsxDEV(IN,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:67,columnNumber:13},this),re.jsxDEV("span",{className:"sr-only",children:"Close"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:69,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:47,columnNumber:5},this)}function a7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sheet-header",className:jt("gap-0.5 p-4 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:79,columnNumber:5},this)}function s7({className:o,...n}){return re.jsxDEV(D_,{"data-slot":"sheet-title",className:jt("text-foreground text-base font-medium",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:99,columnNumber:5},this)}function i7({className:o,...n}){return re.jsxDEV(FM,{"data-slot":"sheet-description",className:jt("text-muted-foreground text-sm",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:112,columnNumber:5},this)}const bw=x.createContext(void 0);bw.displayName="TooltipRootContext";function Zf(o){const n=x.useContext(bw);if(n===void 0&&!o)throw new Error("Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.");return n}const l7={...p_,disabled:zt(o=>o.disabled),instantType:zt(o=>o.instantType),isInstantPhase:zt(o=>o.isInstantPhase),trackCursorAxis:zt(o=>o.trackCursorAxis),disableHoverablePopup:zt(o=>o.disableHoverablePopup),lastOpenChangeReason:zt(o=>o.openChangeReason),closeDelay:zt(o=>o.closeDelay),hasViewport:zt(o=>o.hasViewport)};class vw extends pw{constructor(a){super({...c7(),...a},{popupRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Sg},l7);We(this,"setOpen",(a,s)=>{var m,b;const l=s.reason,c=l===Zr,f=a&&l===zm,h=!a&&(l===Lf||l===XS);if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(b=(m=this.context).onOpenChange)==null||b.call(m,a,s),s.isCanceled)return;const g=()=>{var w;const p={open:a,openChangeReason:l};f?p.instantType="focus":h?p.instantType="dismiss":l===Zr&&(p.instantType=void 0);const v=((w=s.trigger)==null?void 0:w.id)??null;(v||a)&&(p.activeTriggerId=v,p.activeTriggerElement=s.trigger??null),this.update(p)};c?zi.flushSync(g):g()})}static useStore(a,s){const l=mr(()=>new vw(s)).current,c=a??l,f=m_({popupStore:c,onOpenChange:c.setOpen});return c.state.floatingRootContext=f,c}}function c7(){return{...h_(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const A_=c_(function(n){const{disabled:a=!1,defaultOpen:s=!1,open:l,disableHoverablePopup:c=!1,trackCursorAxis:f="none",actionsRef:h,onOpenChange:g,onOpenChangeComplete:m,handle:b,triggerId:p,defaultTriggerId:v=null,children:w}=n,E=vw.useStore(b==null?void 0:b.store,{open:s,openProp:l,activeTriggerId:v,triggerIdProp:p});O_(()=>{l===void 0&&E.state.open===!1&&s===!0&&E.update({open:!0,activeTriggerId:v})}),E.useControlledProp("openProp",l),E.useControlledProp("triggerIdProp",p),E.useContextCallback("onOpenChange",g),E.useContextCallback("onOpenChangeComplete",m);const T=E.useState("open"),C=!a&&T,A=E.useState("activeTriggerId"),k=E.useState("payload");E.useSyncedValues({trackCursorAxis:f,disableHoverablePopup:c}),pt(()=>{T&&a&&E.setOpen(!1,yn(xB))},[T,a,E]),E.useSyncedValue("disabled",a),d_(E);const{forceUnmount:U,transitionStatus:M}=f_(C,E),Y=E.useState("isInstantPhase"),$=E.useState("instantType"),_=E.useState("lastOpenChangeReason"),z=x.useRef(null);pt(()=>{M==="ending"&&_===fg||M!=="ending"&&Y?($!=="delay"&&(z.current=$),E.set("instantType","delay")):z.current!==null&&(E.set("instantType",z.current),z.current=null)},[M,Y,_,$,E]),pt(()=>{C&&A==null&&E.set("payload",void 0)},[E,A,C]);const te=x.useCallback(()=>{E.setOpen(!1,u7(E,XN))},[E]);x.useImperativeHandle(h,()=>({unmount:U,close:te}),[U,te]);const H=E.useState("floatingRootContext"),J=s_(H,{enabled:!a,referencePress:!0}),N=G8(H,{enabled:!a&&f!=="none",axis:f==="none"?void 0:f}),{getReferenceProps:P,getFloatingProps:ne,getTriggerProps:Z}=y_([J,N]),j=x.useMemo(()=>P(),[P]),oe=x.useMemo(()=>Z(),[Z]),I=x.useMemo(()=>ne(),[ne]);return E.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:oe,popupProps:I}),nn.jsx(bw.Provider,{value:E,children:typeof w=="function"?w({payload:k}):w})});A_.displayName="TooltipRoot";function u7(o,n){const a=yn(n);return a.preventUnmountOnClose=()=>{o.set("preventUnmountingOnClose",!0)},a}const N_=x.createContext(void 0);N_.displayName="TooltipProviderContext";function d7(){return x.useContext(N_)}let f7=(function(o){return o[o.popupOpen=ng.popupOpen]="popupOpen",o.triggerDisabled="data-trigger-disabled",o})({});const h7=600,M_=sF(function(n,a){const{className:s,render:l,handle:c,payload:f,disabled:h,delay:g,closeDelay:m,id:b,...p}=n,v=Zf(!0),w=(c==null?void 0:c.store)??v;if(!w)throw new Error("Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.");const E=Xf(b),T=w.useState("isTriggerActive",E),C=w.useState("isOpenedByTrigger",E),A=w.useState("floatingRootContext"),k=x.useRef(null),U=g??h7,M=m??0,{registerTrigger:Y,isMountedByThisTrigger:$}=gF(E,k,w,{payload:f,closeDelay:M}),_=d7(),{delayRef:z,isInstantPhase:te,hasProvider:H}=z8(A,{open:C});w.useSyncedValue("isInstantPhase",te);const J=w.useState("disabled"),N=h??J,P=w.useState("trackCursorAxis"),ne=w.useState("disableHoverablePopup"),Z=OF(A,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!ne&&P!=="both"?MF():null,restMs(){const pe=_==null?void 0:_.delay,L=typeof z.current=="object"?z.current.open:void 0;let ce=U;return H&&(L!==0?ce=g??pe??U:ce=0),ce},delay(){const pe=typeof z.current=="object"?z.current.close:void 0;let L=M;return m==null&&H&&(L=pe),{close:L}},triggerElementRef:k,isActiveTrigger:T}),j=SF(A,{enabled:!N}).reference,oe={open:C},I=w.useState("triggerProps",$);return Ln("button",n,{state:oe,ref:[a,Y,k],props:[Z,j,I,{id:E,[f7.triggerDisabled]:N?"":void 0},p],stateAttributesMapping:_8})});M_.displayName="TooltipTrigger";const Sw=x.createContext(void 0);Sw.displayName="TooltipPortalContext";function p7(){const o=x.useContext(Sw);if(o===void 0)throw new Error("Base UI: <Tooltip.Portal> is missing.");return o}const __=x.forwardRef(function(n,a){const{children:s,container:l,className:c,render:f,...h}=n,{portalNode:g,portalSubtree:m}=WM({container:l,ref:a,componentProps:n,elementProps:h});return!m&&!g?null:nn.jsxs(x.Fragment,{children:[m,g&&zi.createPortal(s,g)]})});__.displayName="FloatingPortalLite";const k_=x.forwardRef(function(n,a){const{keepMounted:s=!1,...l}=n;return Zf().useState("mounted")||s?nn.jsx(Sw.Provider,{value:s,children:nn.jsx(__,{ref:a,...l})}):null});k_.displayName="TooltipPortal";const ww=x.createContext(void 0);ww.displayName="TooltipPositionerContext";function L_(){const o=x.useContext(ww);if(o===void 0)throw new Error("Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.");return o}const U_=x.createContext(void 0);U_.displayName="DirectionContext";function Ew(){const o=x.useContext(U_);return(o==null?void 0:o.direction)??"ltr"}const m7=o=>({name:"arrow",options:o,async fn(n){var ie,pe;const{x:a,y:s,placement:l,rects:c,platform:f,elements:h,middlewareData:g}=n,{element:m,padding:b=0,offsetParent:p="real"}=As(o,n)||{};if(m==null)return{};const v=DM(b),w={x:a,y:s},E=iw(l),T=sw(E),C=await f.getDimensions(m),A=E==="y",k=A?"top":"left",U=A?"bottom":"right",M=A?"clientHeight":"clientWidth",Y=c.reference[T]+c.reference[E]-w[E]-c.floating[T],$=w[E]-c.reference[E],_=p==="real"?await((ie=f.getOffsetParent)==null?void 0:ie.call(f,m)):h.floating;let z=h.floating[M]||c.floating[T];(!z||!await((pe=f.isElement)==null?void 0:pe.call(f,_)))&&(z=h.floating[M]||c.floating[T]);const te=Y/2-$/2,H=z/2-C[T]/2-1,J=Math.min(v[k],H),N=Math.min(v[U],H),P=J,ne=z-C[T]-N,Z=z/2-C[T]/2+te,j=bS(P,Z,ne),oe=!g.arrow&&Hi(l)!=null&&Z!==j&&c.reference[T]/2-(Z<P?J:N)-C[T]/2<0,I=oe?Z<P?Z-P:Z-ne:0;return{[E]:w[E]+I,data:{[E]:j,centerOffset:Z-j-I,...oe&&{alignmentOffset:I}},reset:oe}}}),g7=(o,n)=>({...m7(o),options:[o,n]}),y7={name:"hide",async fn(o){var h;const{width:n,height:a,x:s,y:l}=o.rects.reference,c=n===0&&a===0&&s===0&&l===0;return{data:{referenceHidden:((h=(await LV().fn(o)).data)==null?void 0:h.referenceHidden)||c}}}},Hm={sideX:"left",sideY:"top"},b7={name:"adaptiveOrigin",async fn(o){var k,U;const{x:n,y:a,rects:{floating:s},elements:{floating:l},platform:c,strategy:f,placement:h}=o,g=Gn(l),m=g.getComputedStyle(l);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:n,y:a,data:Hm};const p=await((k=c.getOffsetParent)==null?void 0:k.call(c,l));let v={width:0,height:0};if(f==="fixed"&&(g!=null&&g.visualViewport))v={width:g.visualViewport.width,height:g.visualViewport.height};else if(p===g){const M=fn(l);v={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((U=c.isElement)==null?void 0:U.call(c,p))&&(v=await c.getDimensions(p));const w=Go(h);let E=n,T=a;w==="left"&&(E=v.width-(n+s.width)),w==="top"&&(T=v.height-(a+s.height));const C=w==="left"?"right":Hm.sideX,A=w==="top"?"bottom":Hm.sideY;return{x:E,y:T,data:{sideX:C,sideY:A}}}};function z_(o,n,a){const s=o==="inline-start"||o==="inline-end";return{top:"top",right:s?a?"inline-start":"inline-end":"right",bottom:"bottom",left:s?a?"inline-end":"inline-start":"left"}[n]}function mA(o,n,a){const{rects:s,placement:l}=o;return{side:z_(n,Go(l),a),align:Hi(l)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function v7(o){var Un,D;const{anchor:n,positionMethod:a="absolute",side:s="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,collisionBoundary:h,collisionPadding:g=5,sticky:m=!1,arrowPadding:b=5,disableAnchorTracking:p=!1,keepMounted:v=!1,floatingRootContext:w,mounted:E,collisionAvoidance:T,shiftCrossAxis:C=!1,nodeId:A,adaptiveOrigin:k,lazyFlip:U=!1,externalTree:M}=o,[Y,$]=x.useState(null);!E&&Y!==null&&$(null);const _=T.side||"flip",z=T.align||"flip",te=T.fallbackAxisSide||"end",H=typeof n=="function"?n:void 0,J=st(H),N=H?J:n,P=Pa(n),Z=Ew()==="rtl",j=Y||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Z?"left":"right","inline-start":Z?"right":"left"}[s],oe=c==="center"?j:`${j}-${c}`;let I=g;const ie=1,pe=s==="bottom"?ie:0,L=s==="top"?ie:0,ce=s==="right"?ie:0,ae=s==="left"?ie:0;typeof I=="number"?I={top:I+pe,right:I+ae,bottom:I+L,left:I+ce}:I&&(I={top:(I.top||0)+pe,right:(I.right||0)+ae,bottom:(I.bottom||0)+L,left:(I.left||0)+ce});const me={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:I},Te=x.useRef(null),Ue=Pa(l),ve=Pa(f),at=[AV(G=>{const ge=mA(G,s,Z),ye=typeof Ue.current=="function"?Ue.current(ge):Ue.current,Ne=typeof ve.current=="function"?ve.current(ge):ve.current;return{mainAxis:ye,crossAxis:Ne,alignmentAxis:Ne}},[typeof l!="function"?l:0,typeof f!="function"?f:0,Z,s])],xe=z==="none"&&_!=="shift",he=!xe&&(m||C||_==="shift"),we=_==="none"?null:_V({...me,padding:{top:I.top+ie,right:I.right+ie,bottom:I.bottom+ie,left:I.left+ie},mainAxis:!C&&_==="flip",crossAxis:z==="flip"?"alignment":!1,fallbackAxisSideDirection:te}),De=xe?null:NV(G=>{const ge=fn(G.elements.floating).documentElement;return{...me,rootBoundary:C?{x:0,y:0,width:ge.clientWidth,height:ge.clientHeight}:void 0,mainAxis:z!=="none",crossAxis:he,limiter:m||C?void 0:MV(ye=>{if(!Te.current)return{};const{width:Ne,height:$e}=Te.current.getBoundingClientRect(),Se=Lr(Go(ye.placement)),Ke=Se==="y"?Ne:$e,Ve=Se==="y"?I.left+I.right:I.top+I.bottom;return{offset:Ke/2+Ve/2}})}},[me,m,C,I,z]);_==="shift"||z==="shift"||c==="center"?at.push(De,we):at.push(we,De),at.push(kV({...me,apply({elements:{floating:G},rects:{reference:ge},availableWidth:ye,availableHeight:Ne}){const $e=G.style;$e.setProperty("--available-width",`${ye}px`),$e.setProperty("--available-height",`${Ne}px`),$e.setProperty("--anchor-width",`${ge.width}px`),$e.setProperty("--anchor-height",`${ge.height}px`)}}),g7(()=>({element:Te.current||document.createElement("div"),padding:b,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(G){var Fe,Xe,ut;const{elements:ge,middlewareData:ye,placement:Ne,rects:$e,y:Se}=G,Ke=Go(Ne),Ve=Lr(Ke),Rt=Te.current,Cn=((Fe=ye.arrow)==null?void 0:Fe.x)||0,rn=((Xe=ye.arrow)==null?void 0:Xe.y)||0,xn=(Rt==null?void 0:Rt.clientWidth)||0,Xo=(Rt==null?void 0:Rt.clientHeight)||0,B=Cn+xn/2,Q=rn+Xo/2,ue=Math.abs(((ut=ye.shift)==null?void 0:ut.y)||0),Ee=$e.reference.height/2,Me=typeof l=="function"?l(mA(G,s,Z)):l,Je=ue>Me,Ze={top:`${B}px calc(100% + ${Me}px)`,bottom:`${B}px ${-Me}px`,left:`calc(100% + ${Me}px) ${Q}px`,right:`${-Me}px ${Q}px`}[Ke],Pe=`${B}px ${$e.reference.y+Ee-Se}px`;return ge.floating.style.setProperty("--transform-origin",he&&Ve==="y"&&Je?Pe:Ze),{}}},y7,k),pt(()=>{!E&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[E,w]);const Ye=x.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Re,elements:Ae,x:Le,y:tt,middlewareData:Ce,update:ot,placement:gt,context:yt,isPositioned:ht,floatingStyles:$t}=vF({rootContext:w,placement:oe,middleware:at,strategy:a,whileElementsMounted:v?void 0:(...G)=>oA(...G,Ye),nodeId:A,externalTree:M}),{sideX:on,sideY:bn}=Ce.adaptiveOrigin||Hm,bt=ht?a:"fixed",Pt=x.useMemo(()=>{const G=k?{position:bt,[on]:Le,[bn]:tt}:{position:bt,...$t};return ht||(G.opacity=0),G},[k,bt,on,Le,bn,tt,$t,ht]),Ft=x.useRef(null);pt(()=>{if(!E)return;const G=P.current,ge=typeof G=="function"?G():G,Ne=(gA(ge)?ge.current:ge)||null||null;Ne!==Ft.current&&(Re.setPositionReference(Ne),Ft.current=Ne)},[E,Re,N,P]),x.useEffect(()=>{if(!E)return;const G=P.current;typeof G!="function"&&gA(G)&&G.current!==Ft.current&&(Re.setPositionReference(G.current),Ft.current=G.current)},[E,Re,N,P]),x.useEffect(()=>{if(v&&E&&Ae.domReference&&Ae.floating)return oA(Ae.domReference,Ae.floating,ot,Ye)},[v,E,Ae,ot,Ye]);const vn=Go(gt),ln=z_(s,vn,Z),Zn=Hi(gt)||"center",hn=!!((Un=Ce.hide)!=null&&Un.referenceHidden);pt(()=>{U&&E&&ht&&$(vn)},[U,E,ht,vn]);const co=x.useMemo(()=>{var G,ge;return{position:"absolute",top:(G=Ce.arrow)==null?void 0:G.y,left:(ge=Ce.arrow)==null?void 0:ge.x}},[Ce.arrow]),uo=((D=Ce.arrow)==null?void 0:D.centerOffset)!==0;return x.useMemo(()=>({positionerStyles:Pt,arrowStyles:co,arrowRef:Te,arrowUncentered:uo,side:ln,align:Zn,physicalSide:vn,anchorHidden:hn,refs:Re,context:yt,isPositioned:ht,update:ot}),[Pt,co,Te,uo,ln,Zn,vn,hn,Re,yt,ht,ot])}function gA(o){return o!=null&&"current"in o}function j_(o){return o==="starting"?dB:fr}const P_=x.forwardRef(function(n,a){const{render:s,className:l,anchor:c,positionMethod:f="absolute",side:h="top",align:g="center",sideOffset:m=0,alignOffset:b=0,collisionBoundary:p="clipping-ancestors",collisionPadding:v=5,arrowPadding:w=5,sticky:E=!1,disableAnchorTracking:T=!1,collisionAvoidance:C=hB,...A}=n,k=Zf(),U=p7(),M=k.useState("open"),Y=k.useState("mounted"),$=k.useState("trackCursorAxis"),_=k.useState("disableHoverablePopup"),z=k.useState("floatingRootContext"),te=k.useState("instantType"),H=k.useState("transitionStatus"),J=k.useState("hasViewport"),N=v7({anchor:c,positionMethod:f,floatingRootContext:z,mounted:Y,side:h,sideOffset:m,align:g,alignOffset:b,collisionBoundary:p,collisionPadding:v,sticky:E,arrowPadding:w,disableAnchorTracking:T,keepMounted:U,collisionAvoidance:C,adaptiveOrigin:J?b7:void 0}),P=x.useMemo(()=>{const oe={};return(!M||$==="both"||_)&&(oe.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...N.positionerStyles,...oe}}},[M,$,_,Y,N.positionerStyles]),ne=x.useMemo(()=>({open:M,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:$!=="none"?"tracking-cursor":te}),[M,N.side,N.align,N.anchorHidden,$,te]),Z=x.useMemo(()=>({...ne,arrowRef:N.arrowRef,arrowStyles:N.arrowStyles,arrowUncentered:N.arrowUncentered}),[ne,N.arrowRef,N.arrowStyles,N.arrowUncentered]),j=Ln("div",n,{state:ne,props:[P,j_(H),A],ref:[a,k.useStateSetter("positionerElement")],stateAttributesMapping:Jf});return nn.jsx(ww.Provider,{value:Z,children:j})});P_.displayName="TooltipPositioner";const S7={...Jf,...Qf},H_=x.forwardRef(function(n,a){const{className:s,render:l,...c}=n,f=Zf(),{side:h,align:g}=L_(),m=f.useState("open"),b=f.useState("instantType"),p=f.useState("transitionStatus"),v=f.useState("popupProps"),w=f.useState("floatingRootContext");bg({open:m,ref:f.context.popupRef,onComplete(){var k,U;m&&((U=(k=f.context).onOpenChangeComplete)==null||U.call(k,!0))}});const E=f.useState("disabled"),T=f.useState("closeDelay");return RF(w,{enabled:!E,closeDelay:T}),Ln("div",n,{state:{open:m,side:h,align:g,instant:b,transitionStatus:p},ref:[a,f.context.popupRef,f.useStateSetter("popupElement")],props:[v,j_(p),c],stateAttributesMapping:S7})});H_.displayName="TooltipPopup";const I_=x.forwardRef(function(n,a){const{className:s,render:l,...c}=n,h=Zf().useState("instantType"),{open:g,arrowRef:m,side:b,align:p,arrowUncentered:v,arrowStyles:w}=L_();return Ln("div",n,{state:{open:g,side:b,align:p,uncentered:v,instant:h},ref:[a,m],props:[{style:w,"aria-hidden":!0},c],stateAttributesMapping:Jf})});I_.displayName="TooltipArrow";function w7({...o}){return re.jsxDEV(A_,{"data-slot":"tooltip",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:19,columnNumber:10},this)}function E7({...o}){return re.jsxDEV(M_,{"data-slot":"tooltip-trigger",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:23,columnNumber:10},this)}function x7({className:o,side:n="top",sideOffset:a=4,align:s="center",alignOffset:l=0,children:c,...f}){return re.jsxDEV(k_,{children:re.jsxDEV(P_,{align:s,alignOffset:l,side:n,sideOffset:a,className:"isolate z-50",children:re.jsxDEV(H_,{"data-slot":"tooltip-content",className:jt("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",o),...f,children:[c,re.jsxDEV(I_,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:48,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:41,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:40,columnNumber:5},this)}const R7="sidebar_state",T7=3600*24*7,C7="16rem",O7="18rem",D7="3rem",A7="b",B_=x.createContext(null);function Du(){const o=x.useContext(B_);if(!o)throw new Error("useSidebar must be used within a SidebarProvider.");return o}function N7({defaultOpen:o=!0,open:n,onOpenChange:a,className:s,style:l,children:c,...f}){const h=JB(),[g,m]=x.useState(!1),[b,p]=x.useState(o),v=n??b,w=x.useCallback(A=>{const k=typeof A=="function"?A(v):A;a?a(k):p(k),document.cookie=`${R7}=${k}; path=/; max-age=${T7}`},[a,v]),E=x.useCallback(()=>h?m(A=>!A):w(A=>!A),[h,w,m]);x.useEffect(()=>{const A=k=>{k.key===A7&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[E]);const T=v?"expanded":"collapsed",C=x.useMemo(()=>({state:T,open:v,setOpen:w,isMobile:h,openMobile:g,setOpenMobile:m,toggleSidebar:E}),[T,v,w,h,g,m,E]);return re.jsxDEV(B_.Provider,{value:C,children:re.jsxDEV("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":C7,"--sidebar-width-icon":D7,...l},className:jt("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...f,children:c},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:129,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:128,columnNumber:5},this)}function M7({side:o="left",variant:n="sidebar",collapsible:a="offcanvas",className:s,children:l,dir:c,...f}){const{isMobile:h,state:g,openMobile:m,setOpenMobile:b}=Du();return a==="none"?re.jsxDEV("div",{"data-slot":"sidebar",className:jt("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...f,children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:167,columnNumber:7},this):h?re.jsxDEV(t7,{open:m,onOpenChange:b,...f,children:re.jsxDEV(r7,{dir:c,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":O7},side:o,children:[re.jsxDEV(a7,{className:"sr-only",children:[re.jsxDEV(s7,{children:"Sidebar"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:198,columnNumber:13},this),re.jsxDEV(i7,{children:"Displays the mobile sidebar."},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:199,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:197,columnNumber:11},this),re.jsxDEV("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:201,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:183,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:182,columnNumber:7},this):re.jsxDEV("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":g,"data-collapsible":g==="collapsed"?a:"","data-variant":n,"data-side":o,"data-slot":"sidebar",children:[re.jsxDEV("div",{"data-slot":"sidebar-gap",className:jt("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:223,columnNumber:7},this),re.jsxDEV("div",{"data-slot":"sidebar-container","data-side":o,className:jt("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...f,children:re.jsxDEV("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:247,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:234,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:214,columnNumber:5},this)}function _7({className:o,onClick:n,...a}){const{toggleSidebar:s}=Du();return re.jsxDEV(nw,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:jt(o),onClick:l=>{n==null||n(l),s()},...a,children:[re.jsxDEV(P5,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:282,columnNumber:7},this),re.jsxDEV("span",{className:"sr-only",children:"Toggle Sidebar"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:283,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:270,columnNumber:5},this)}function k7({className:o,...n}){return re.jsxDEV("main",{"data-slot":"sidebar-inset",className:jt("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:315,columnNumber:5},this)}function L7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:jt("gap-2 p-2 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:342,columnNumber:5},this)}function U7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:jt("gap-2 p-2 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:353,columnNumber:5},this)}function z7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:jt("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:378,columnNumber:5},this)}function V_({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:jt("p-2 relative flex w-full min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:392,columnNumber:5},this)}function j7({className:o,render:n,...a}){return Wf({defaultTagName:"div",props:Ql({className:jt("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",o)},a),render:n,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function P7({className:o,...n}){return re.jsxDEV("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:jt("gap-0 flex w-full min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:468,columnNumber:5},this)}function H7({className:o,...n}){return re.jsxDEV("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:jt("group/menu-item relative",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:479,columnNumber:5},this)}const I7=ew("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function B7({render:o,isActive:n=!1,variant:a="default",size:s="default",tooltip:l,className:c,...f}){const{isMobile:h,state:g}=Du(),m=Wf({defaultTagName:"button",props:Ql({className:jt(I7({variant:a,size:s}),c)},f),render:l?E7:o,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:s,active:n}});return l?(typeof l=="string"&&(l={children:l}),re.jsxDEV(w7,{children:[m,re.jsxDEV(x7,{side:"right",align:"center",hidden:g!=="collapsed"||h,...l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:553,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:551,columnNumber:5},this)):m}function V7({className:o,render:n,showOnHover:a=!1,...s}){return Wf({defaultTagName:"button",props:Ql({className:jt("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",a&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",o)},s),render:n,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function F7({className:o,...n}){return re.jsxDEV("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:jt("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:650,columnNumber:5},this)}function Y7({className:o,...n}){return re.jsxDEV("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:jt("group/menu-sub-item relative",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:664,columnNumber:5},this)}function $7({render:o,size:n="md",isActive:a=!1,className:s,...l}){return Wf({defaultTagName:"a",props:Ql({className:jt("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",s)},l),render:o,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:n,active:a}})}function ag({children:o,onClick:n,...a}){const{isMobile:s,setOpenMobile:l}=Du(),c=f=>{s&&l(!1),n==null||n(f)};return re.jsxDEV(FS,{...a,onClick:c,children:o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-link.tsx",lineNumber:19,columnNumber:5},this)}function q7({items:o}){const{t:n}=dg();return re.jsxDEV(V_,{children:re.jsxDEV(P7,{children:o.map(a=>{var s,l;return re.jsxDEV(QB,{defaultOpen:a.isActive,render:re.jsxDEV(H7,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:35,columnNumber:77},this),children:[re.jsxDEV(ag,{to:a.url,children:re.jsxDEV(B7,{tooltip:n(a.title),children:[re.jsxDEV(a.icon,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:38,columnNumber:17},this),re.jsxDEV("span",{children:n(a.title)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:39,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:37,columnNumber:15},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:36,columnNumber:13},this),(s=a.items)!=null&&s.length?re.jsxDEV(re.Fragment,{children:[re.jsxDEV(WB,{render:re.jsxDEV(V7,{className:"data-[state=open]:rotate-90"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:44,columnNumber:45},this),children:[re.jsxDEV(M5,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:45,columnNumber:19},this),re.jsxDEV("span",{className:"sr-only",children:"Toggle"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:46,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:44,columnNumber:17},this),re.jsxDEV(KB,{children:re.jsxDEV(F7,{children:(l=a.items)==null?void 0:l.map(c=>re.jsxDEV(Y7,{children:re.jsxDEV(ag,{to:c.url,children:re.jsxDEV($7,{children:re.jsxDEV("span",{children:n(c.title)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:54,columnNumber:29},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:53,columnNumber:27},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:52,columnNumber:25},this)},c.title,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:51,columnNumber:23},this))},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:49,columnNumber:19},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:48,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:43,columnNumber:15},this):null]},a.title,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:35,columnNumber:11},this)})},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:33,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:32,columnNumber:5},this)}const G7=ew("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function X7({className:o,variant:n="default",render:a,...s}){return Wf({defaultTagName:"span",props:Ql({className:jt(G7({className:o,variant:n}))},s),render:a,state:{slot:"badge",variant:n}})}const xw=x.createContext(void 0);xw.displayName="ScrollAreaRootContext";function wg(){const o=x.useContext(xw);if(o===void 0)throw new Error("Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");return o}let sg=(function(o){return o.scrollAreaCornerHeight="--scroll-area-corner-height",o.scrollAreaCornerWidth="--scroll-area-corner-width",o})({});const Am=500,yA=16;function Ur(o,n,a){if(!o)return 0;const s=getComputedStyle(o),l=a==="x"?"Inline":"Block";return a==="x"&&n==="margin"?parseFloat(s[`${n}InlineStart`])*2:parseFloat(s[`${n}${l}Start`])+parseFloat(s[`${n}${l}End`])}let Q7=(function(o){return o.orientation="data-orientation",o.hovering="data-hovering",o.scrolling="data-scrolling",o.hasOverflowX="data-has-overflow-x",o.hasOverflowY="data-has-overflow-y",o.overflowXStart="data-overflow-x-start",o.overflowXEnd="data-overflow-x-end",o.overflowYStart="data-overflow-y-start",o.overflowYEnd="data-overflow-y-end",o})({});const Nm="base-ui-disable-scrollbar",Rw={className:Nm,getElement(o){return nn.jsx("style",{nonce:o,href:Nm,precedence:"base-ui:low",children:`.${Nm}{scrollbar-width:none}.${Nm}::-webkit-scrollbar{display:none}`})}};Rw.getElement.displayName="styleDisableScrollbar.getElement";let Zc=(function(o){return o.scrolling="data-scrolling",o.hasOverflowX="data-has-overflow-x",o.hasOverflowY="data-has-overflow-y",o.overflowXStart="data-overflow-x-start",o.overflowXEnd="data-overflow-x-end",o.overflowYStart="data-overflow-y-start",o.overflowYEnd="data-overflow-y-end",o})({});const Tw={hasOverflowX:o=>o?{[Zc.hasOverflowX]:""}:null,hasOverflowY:o=>o?{[Zc.hasOverflowY]:""}:null,overflowXStart:o=>o?{[Zc.overflowXStart]:""}:null,overflowXEnd:o=>o?{[Zc.overflowXEnd]:""}:null,overflowYStart:o=>o?{[Zc.overflowYStart]:""}:null,overflowYEnd:o=>o?{[Zc.overflowYEnd]:""}:null,cornerHidden:()=>null},F_=x.createContext(void 0);F_.displayName="CSPContext";const W7={disableStyleElements:!1};function K7(){return x.useContext(F_)??W7}const J7={x:0,y:0},bA={width:0,height:0},Z7={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},eY={x:!1,y:!1,corner:!1},Y_=x.forwardRef(function(n,a){const{render:s,className:l,overflowEdgeThreshold:c,...f}=n,h=tY(c),g=Xf(),m=Ds(),b=Ds(),{nonce:p,disableStyleElements:v}=K7(),[w,E]=x.useState(!1),[T,C]=x.useState(!1),[A,k]=x.useState(!1),[U,M]=x.useState(!1),[Y,$]=x.useState(bA),[_,z]=x.useState(bA),[te,H]=x.useState(Z7),[J,N]=x.useState(eY),P=x.useRef(null),ne=x.useRef(null),Z=x.useRef(null),j=x.useRef(null),oe=x.useRef(null),I=x.useRef(null),ie=x.useRef(null),pe=x.useRef(!1),L=x.useRef(0),ce=x.useRef(0),ae=x.useRef(0),me=x.useRef(0),Te=x.useRef("vertical"),Ue=x.useRef(J7),ve=st(Ae=>{const Le=Ae.x-Ue.current.x,tt=Ae.y-Ue.current.y;Ue.current=Ae,tt!==0&&(k(!0),m.start(Am,()=>{k(!1)})),Le!==0&&(C(!0),b.start(Am,()=>{C(!1)}))}),ze=st(Ae=>{Ae.button===0&&(pe.current=!0,L.current=Ae.clientY,ce.current=Ae.clientX,Te.current=Ae.currentTarget.getAttribute(Q7.orientation),ne.current&&(ae.current=ne.current.scrollTop,me.current=ne.current.scrollLeft),oe.current&&Te.current==="vertical"&&oe.current.setPointerCapture(Ae.pointerId),I.current&&Te.current==="horizontal"&&I.current.setPointerCapture(Ae.pointerId))}),je=st(Ae=>{if(!pe.current)return;const Le=Ae.clientY-L.current,tt=Ae.clientX-ce.current;if(ne.current){const Ce=ne.current.scrollHeight,ot=ne.current.clientHeight,gt=ne.current.scrollWidth,yt=ne.current.clientWidth;if(oe.current&&Z.current&&Te.current==="vertical"){const ht=Ur(Z.current,"padding","y"),$t=Ur(oe.current,"margin","y"),on=oe.current.offsetHeight,bn=Z.current.offsetHeight-on-ht-$t,bt=Le/bn;ne.current.scrollTop=ae.current+bt*(Ce-ot),Ae.preventDefault(),k(!0),m.start(Am,()=>{k(!1)})}if(I.current&&j.current&&Te.current==="horizontal"){const ht=Ur(j.current,"padding","x"),$t=Ur(I.current,"margin","x"),on=I.current.offsetWidth,bn=j.current.offsetWidth-on-ht-$t,bt=tt/bn;ne.current.scrollLeft=me.current+bt*(gt-yt),Ae.preventDefault(),C(!0),b.start(Am,()=>{C(!1)})}}}),at=st(Ae=>{pe.current=!1,oe.current&&Te.current==="vertical"&&oe.current.releasePointerCapture(Ae.pointerId),I.current&&Te.current==="horizontal"&&I.current.releasePointerCapture(Ae.pointerId)});function xe(Ae){M(Ae.pointerType==="touch")}function he(Ae){if(xe(Ae),Ae.pointerType!=="touch"){const Le=Yt(P.current,Ae.target);E(Le)}}const we=x.useMemo(()=>({scrolling:T||A,hasOverflowX:!J.x,hasOverflowY:!J.y,overflowXStart:te.xStart,overflowXEnd:te.xEnd,overflowYStart:te.yStart,overflowYEnd:te.yEnd,cornerHidden:J.corner}),[T,A,J.x,J.y,J.corner,te]),De={role:"presentation",onPointerEnter:he,onPointerMove:he,onPointerDown:xe,onPointerLeave(){E(!1)},style:{position:"relative",[sg.scrollAreaCornerHeight]:`${Y.height}px`,[sg.scrollAreaCornerWidth]:`${Y.width}px`}},Ye=Ln("div",n,{state:we,ref:[a,P],props:[De,f],stateAttributesMapping:Tw}),Re=x.useMemo(()=>({handlePointerDown:ze,handlePointerMove:je,handlePointerUp:at,handleScroll:ve,cornerSize:Y,setCornerSize:$,thumbSize:_,setThumbSize:z,touchModality:U,cornerRef:ie,scrollingX:T,setScrollingX:C,scrollingY:A,setScrollingY:k,hovering:w,setHovering:E,viewportRef:ne,rootRef:P,scrollbarYRef:Z,scrollbarXRef:j,thumbYRef:oe,thumbXRef:I,rootId:g,hiddenState:J,setHiddenState:N,overflowEdges:te,setOverflowEdges:H,viewportState:we,overflowEdgeThreshold:h}),[ze,je,at,ve,Y,_,U,T,C,A,k,w,E,g,J,te,we,h]);return nn.jsxs(xw.Provider,{value:Re,children:[!v&&Rw.getElement(p),Ye]})});Y_.displayName="ScrollAreaRoot";function tY(o){if(typeof o=="number"){const n=Math.max(0,o);return{xStart:n,xEnd:n,yStart:n,yEnd:n}}return{xStart:Math.max(0,(o==null?void 0:o.xStart)||0),xEnd:Math.max(0,(o==null?void 0:o.xEnd)||0),yStart:Math.max(0,(o==null?void 0:o.yStart)||0),yEnd:Math.max(0,(o==null?void 0:o.yEnd)||0)}}const $_=x.createContext(void 0);$_.displayName="ScrollAreaViewportContext";function tu(o,n=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(o,a))}function nY(o,n){if(typeof IntersectionObserver>"u")return()=>{};const a=new IntersectionObserver(s=>{s.forEach(l=>{l.intersectionRatio>0&&(n(),a.disconnect())})});return a.observe(o),()=>{a.disconnect()}}let _i=(function(o){return o.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",o.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",o.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",o.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",o})({});const vA=1;function SA(o,n){if(n<=0)return 0;const a=tu(o,0,n),s=a,l=n-a,c=s<=vA,f=l<=vA;return c&&f?s<=l?0:n:c?0:f?n:a}let wA=!1;function oY(){wA||ow||(typeof CSS<"u"&&"registerProperty"in CSS&&[_i.scrollAreaOverflowXStart,_i.scrollAreaOverflowXEnd,_i.scrollAreaOverflowYStart,_i.scrollAreaOverflowYEnd].forEach(o=>{try{CSS.registerProperty({name:o,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),wA=!0)}const q_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{viewportRef:f,scrollbarYRef:h,scrollbarXRef:g,thumbYRef:m,thumbXRef:b,cornerRef:p,cornerSize:v,setCornerSize:w,setThumbSize:E,rootId:T,setHiddenState:C,hiddenState:A,handleScroll:k,setHovering:U,setOverflowEdges:M,overflowEdges:Y,overflowEdgeThreshold:$,scrollingX:_,scrollingY:z}=wg(),te=Ew(),H=x.useRef(!0),J=Ds(),N=Ds(),P=st(()=>{const ie=f.current,pe=h.current,L=g.current,ce=m.current,ae=b.current,me=p.current;if(!ie)return;const Te=ie.scrollHeight,Ue=ie.scrollWidth,ve=ie.clientHeight,ze=ie.clientWidth,je=ie.scrollTop,at=ie.scrollLeft;if(Te===0||Ue===0)return;const xe=ve>=Te,he=ze>=Ue,we=ze/Ue,De=ve/Te,Ye=Math.max(0,Ue-ze),Re=Math.max(0,Te-ve);let Ae=0,Le=0;if(!he){let ye=0;te==="rtl"?ye=tu(-at,0,Ye):ye=tu(at,0,Ye),Ae=SA(ye,Ye),Le=Ye-Ae}const tt=xe?0:tu(je,0,Re),Ce=xe?0:SA(tt,Re),ot=xe?0:Re-Ce,gt=he?0:ze,yt=xe?0:ve;let ht=0,$t=0;!he&&!xe&&(ht=(pe==null?void 0:pe.offsetWidth)||0,$t=(L==null?void 0:L.offsetHeight)||0);const on=v.width===0&&v.height===0,bn=on?ht:0,bt=on?$t:0,Pt=Ur(L,"padding","x"),Ft=Ur(pe,"padding","y"),vn=Ur(ae,"margin","x"),ln=Ur(ce,"margin","y"),Zn=gt-Pt-vn,hn=yt-Ft-ln,co=L?Math.min(L.offsetWidth-bn,Zn):Zn,uo=pe?Math.min(pe.offsetHeight-bt,hn):hn,Un=Math.max(yA,co*we),D=Math.max(yA,uo*De);if(E(ye=>ye.height===D&&ye.width===Un?ye:{width:Un,height:D}),pe&&ce){const ye=pe.offsetHeight-D-Ft-ln,Ne=Te-ve,$e=Ne===0?0:je/Ne,Se=Math.min(ye,Math.max(0,$e*ye));ce.style.transform=`translate3d(0,${Se}px,0)`}if(L&&ae){const ye=L.offsetWidth-Un-Pt-vn,Ne=Ue-ze,$e=Ne===0?0:at/Ne,Se=te==="rtl"?tu($e*ye,-ye,0):tu($e*ye,0,ye);ae.style.transform=`translate3d(${Se}px,0,0)`}const G=[[_i.scrollAreaOverflowXStart,Ae],[_i.scrollAreaOverflowXEnd,Le],[_i.scrollAreaOverflowYStart,Ce],[_i.scrollAreaOverflowYEnd,ot]];for(const[ye,Ne]of G)ie.style.setProperty(ye,`${Ne}px`);me&&(he||xe?w({width:0,height:0}):!he&&!xe&&w({width:ht,height:$t})),C(ye=>{const Ne=xe||he;return ye.y===xe&&ye.x===he&&ye.corner===Ne?ye:{y:xe,x:he,corner:Ne}});const ge={xStart:!he&&Ae>$.xStart,xEnd:!he&&Le>$.xEnd,yStart:!xe&&Ce>$.yStart,yEnd:!xe&&ot>$.yEnd};M(ye=>ye.xStart===ge.xStart&&ye.xEnd===ge.xEnd&&ye.yStart===ge.yStart&&ye.yEnd===ge.yEnd?ye:ge)});pt(()=>{if(!f.current)return;oY();let ie=!1;return nY(f.current,()=>{if(!ie){ie=!0;return}P()})},[P,f]),pt(()=>{queueMicrotask(P)},[P,A,te]),pt(()=>{var ie;(ie=f.current)!=null&&ie.matches(":hover")&&U(!0)},[f,U]),x.useEffect(()=>{const ie=f.current;if(typeof ResizeObserver>"u"||!ie)return;let pe=!1;const L=new ResizeObserver(()=>{if(!pe){pe=!0;return}P()});return L.observe(ie),N.start(0,()=>{const ce=ie.getAnimations({subtree:!0});ce.length!==0&&Promise.allSettled(ce.map(ae=>ae.finished)).then(P).catch(()=>{})}),()=>{L.disconnect(),N.clear()}},[P,f,N]);function ne(){H.current=!1}const Z={role:"presentation",...T&&{"data-id":`${T}-viewport`},...(!A.x||!A.y)&&{tabIndex:0},className:Rw.className,style:{overflow:"scroll"},onScroll(){f.current&&(P(),H.current||k({x:f.current.scrollLeft,y:f.current.scrollTop}),J.start(100,()=>{H.current=!0}))},onWheel:ne,onTouchMove:ne,onPointerMove:ne,onPointerEnter:ne,onKeyDown:ne},j=x.useMemo(()=>({scrolling:_||z,hasOverflowX:!A.x,hasOverflowY:!A.y,overflowXStart:Y.xStart,overflowXEnd:Y.xEnd,overflowYStart:Y.yStart,overflowYEnd:Y.yEnd,cornerHidden:A.corner}),[_,z,A.x,A.y,A.corner,Y]),oe=Ln("div",n,{ref:[a,f],state:j,props:[Z,c],stateAttributesMapping:Tw}),I=x.useMemo(()=>({computeThumbPosition:P}),[P]);return nn.jsx($_.Provider,{value:I,children:oe})});q_.displayName="ScrollAreaViewport";const Cw=x.createContext(void 0);Cw.displayName="ScrollAreaScrollbarContext";function rY(){const o=x.useContext(Cw);if(o===void 0)throw new Error("Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");return o}let ig=(function(o){return o.scrollAreaThumbHeight="--scroll-area-thumb-height",o.scrollAreaThumbWidth="--scroll-area-thumb-width",o})({});const G_=x.forwardRef(function(n,a){const{render:s,className:l,orientation:c="vertical",keepMounted:f=!1,...h}=n,{hovering:g,scrollingX:m,scrollingY:b,hiddenState:p,overflowEdges:v,scrollbarYRef:w,scrollbarXRef:E,viewportRef:T,thumbYRef:C,thumbXRef:A,handlePointerDown:k,handlePointerUp:U,rootId:M,thumbSize:Y}=wg(),$={hovering:g,scrolling:{horizontal:m,vertical:b}[c],orientation:c,hasOverflowX:!p.x,hasOverflowY:!p.y,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:p.corner},_=Ew();x.useEffect(()=>{const P=T.current,ne=c==="vertical"?w.current:E.current;if(!ne)return;function Z(j){if(!(!P||!ne||j.ctrlKey)){if(j.preventDefault(),c==="vertical"){if(P.scrollTop===0&&j.deltaY<0)return}else if(P.scrollLeft===0&&j.deltaX<0)return;if(c==="vertical"){if(P.scrollTop===P.scrollHeight-P.clientHeight&&j.deltaY>0)return}else if(P.scrollLeft===P.scrollWidth-P.clientWidth&&j.deltaX>0)return;c==="vertical"?P.scrollTop+=j.deltaY:P.scrollLeft+=j.deltaX}}return ne.addEventListener("wheel",Z,{passive:!1}),()=>{ne.removeEventListener("wheel",Z)}},[c,E,w,T]);const z={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(P){if(P.button===0&&P.currentTarget===P.target&&T.current){if(C.current&&w.current&&c==="vertical"){const ne=Ur(C.current,"margin","y"),Z=Ur(w.current,"padding","y"),j=C.current.offsetHeight,oe=w.current.getBoundingClientRect(),I=P.clientY-oe.top-j/2-Z+ne/2,ie=T.current.scrollHeight,pe=T.current.clientHeight,L=w.current.offsetHeight-j-Z-ne,ae=I/L*(ie-pe);T.current.scrollTop=ae}if(A.current&&E.current&&c==="horizontal"){const ne=Ur(A.current,"margin","x"),Z=Ur(E.current,"padding","x"),j=A.current.offsetWidth,oe=E.current.getBoundingClientRect(),I=P.clientX-oe.left-j/2-Z+ne/2,ie=T.current.scrollWidth,pe=T.current.clientWidth,L=E.current.offsetWidth-j-Z-ne,ce=I/L;let ae;_==="rtl"?(ae=(1-ce)*(ie-pe),T.current.scrollLeft<=0&&(ae=-ae)):ae=ce*(ie-pe),T.current.scrollLeft=ae}k(P)}},onPointerUp:U,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...c==="vertical"&&{top:0,bottom:`var(${sg.scrollAreaCornerHeight})`,insetInlineEnd:0,[ig.scrollAreaThumbHeight]:`${Y.height}px`},...c==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${sg.scrollAreaCornerWidth})`,bottom:0,[ig.scrollAreaThumbWidth]:`${Y.width}px`}}},te=Ln("div",n,{ref:[a,c==="vertical"?w:E],state:$,props:[z,h],stateAttributesMapping:Tw}),H=x.useMemo(()=>({orientation:c}),[c]),J=c==="vertical"?p.y:p.x;return f||!J?nn.jsx(Cw.Provider,{value:H,children:te}):null});G_.displayName="ScrollAreaScrollbar";const X_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{thumbYRef:f,thumbXRef:h,handlePointerDown:g,handlePointerMove:m,handlePointerUp:b,setScrollingX:p,setScrollingY:v}=wg(),{orientation:w}=rY();return Ln("div",n,{ref:[a,w==="vertical"?f:h],state:{orientation:w},props:[{onPointerDown:g,onPointerMove:m,onPointerUp(C){w==="vertical"&&v(!1),w==="horizontal"&&p(!1),b(C)},style:{...w==="vertical"&&{height:`var(${ig.scrollAreaThumbHeight})`},...w==="horizontal"&&{width:`var(${ig.scrollAreaThumbWidth})`}}},c]})});X_.displayName="ScrollAreaThumb";const Q_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{cornerRef:f,cornerSize:h,hiddenState:g}=wg(),m=Ln("div",n,{ref:[a,f],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:h.width,height:h.height}},c]});return g.corner?null:m});Q_.displayName="ScrollAreaCorner";function aY({className:o,children:n,...a}){return re.jsxDEV(Y_,{"data-slot":"scroll-area",className:jt("relative",o),...a,children:[re.jsxDEV(q_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:16,columnNumber:7},this),re.jsxDEV(sY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:22,columnNumber:7},this),re.jsxDEV(Q_,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:23,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:11,columnNumber:5},this)}function sY({className:o,orientation:n="vertical",...a}){return re.jsxDEV(G_,{"data-slot":"scroll-area-scrollbar","data-orientation":n,orientation:n,className:jt("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",o),...a,children:re.jsxDEV(X_,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:45,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:34,columnNumber:5},this)}function $Y(o){return o}function iY(o){return encodeURIComponent(o)}function lY(){const{t:o}=dg(),n=Ns(),a=yN(),{isMobile:s,setOpenMobile:l}=Du(),{toggleDevice:c}=x5(),f=Df("/devices/:deviceId/windows/:windowId/panes/:paneId",n.pathname),h=f==null?void 0:f.params.deviceId,g=f==null?void 0:f.params.windowId,m=f==null?void 0:f.params.paneId,b=Es(H=>H.snapshots),p=Es(H=>H.connectedDevices),v=Es(H=>H.closeWindow),w=Es(H=>H.closePane),E=qm(H=>{var J;return((J=H.settings)==null?void 0:J.language)??"en_US"}),{data:T}=x3({queryKey:["devices"],queryFn:async()=>{const H=await fetch("/api/devices");if(!H.ok)throw new Error("Failed to fetch devices");return H.json()},throwOnError:!1}),C=x.useCallback((H,J)=>{a(H,{replace:(J==null?void 0:J.replace)??!0}),s&&l(!1)},[a,s,l]),A=x.useCallback((H,J,N)=>{U.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:H,windowId:J,paneId:N}})),C(`/devices/${H}/windows/${J}/panes/${iY(N)}`)},[C]),k=Es(H=>H.selectWindow),U=x.useRef(null);x.useEffect(()=>{var oe,I;const H=U.current;if(!H)return;if(Date.now()-H.at>5e3){U.current=null;return}const{deviceId:J,windowId:N}=H,P=b[J],ne=(oe=P==null?void 0:P.session)==null?void 0:oe.windows;if(!ne)return;const Z=ne.find(ie=>ie.id===N);if(!((I=Z==null?void 0:Z.panes)!=null&&I.length))return;U.current=null;const j=Z.panes.find(ie=>ie.active)??Z.panes[0];A(J,N,j.id)},[b,A]);const M=x.useCallback((H,J,N)=>{k(H,J);const P=N.find(ne=>ne.active)??N[0];P?(A(H,J,P.id),U.current=null):U.current={deviceId:H,windowId:J,at:Date.now()}},[A,k]),Y=x.useCallback((H,J)=>{J?H===h&&C("/devices"):C(`/devices/${H}`),c(H,J)},[c,h,C]),$=x.useCallback((H,J)=>{H===h&&J===g&&C("/devices"),v(H,J)},[v,h,g,C]),_=x.useCallback(H=>{Es.getState().createWindow(H)},[]),z=(T==null?void 0:T.devices)??[],te=x.useMemo(()=>[...z].sort((H,J)=>H.name.localeCompare(J.name,mH(E),{numeric:!0,sensitivity:"base"})),[z,E]);return re.jsxDEV(V_,{className:"flex flex-col flex-1 min-h-0",children:[re.jsxDEV(j7,{children:o("device.devices")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:170,columnNumber:7},this),re.jsxDEV(aY,{className:"flex-1 min-h-0",children:re.jsxDEV("div",{className:"space-y-1.5 py-2",children:[te.map(H=>{var J,N;return re.jsxDEV(cY,{device:H,windows:((N=(J=b[H.id])==null?void 0:J.session)==null?void 0:N.windows)??null,isConnected:p.has(H.id),selectedWindowId:g,selectedPaneId:m,onConnectToggle:()=>Y(H.id,p.has(H.id)),onCreateWindow:_,onCloseWindow:$,onClosePane:w,onPaneClick:A,onWindowClick:M},H.id,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:174,columnNumber:13},this)}),te.length===0&&re.jsxDEV("div",{className:"text-center text-sm text-muted-foreground py-4",children:o("sidebar.noDevices")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:192,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:172,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:171,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:169,columnNumber:5},this)}function cY({device:o,windows:n,isConnected:a,selectedWindowId:s,selectedPaneId:l,onConnectToggle:c,onCreateWindow:f,onCloseWindow:h,onClosePane:g,onPaneClick:m,onWindowClick:b}){const{t:p}=dg(),v=o.type==="local"?HN:k5;return re.jsxDEV("div",{"data-testid":`device-item-${o.id}`,className:jt("rounded-lg border overflow-hidden text-select-none",a?"bg-card/50":"bg-muted/20"),onClick:a?void 0:c,children:[re.jsxDEV("div",{className:"px-3 py-1 bg-muted/30 border-b",children:re.jsxDEV("div",{className:"flex items-center gap-2",children:[re.jsxDEV(v,{className:"ml-1 h-4 w-4 text-muted-foreground shrink-0"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:244,columnNumber:11},this),re.jsxDEV("span",{className:"flex-1 truncate text-sm font-medium text-select-none",children:o.name},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:245,columnNumber:11},this),re.jsxDEV("div",{className:jt("h-2 w-2 rounded-full shrink-0",a?"bg-emerald-500":"bg-gray-400")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:250,columnNumber:11},this),re.jsxDEV(nw,{variant:"ghost",size:"icon-xs",onClick:w=>{w.stopPropagation(),c()},"data-testid":a?`device-disconnect-${o.id}`:`device-connect-${o.id}`,title:p(a?"device.disconnect":"device.connect"),children:a?re.jsxDEV(V5,{className:"h-3.5 w-3.5 text-orange-500"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:271,columnNumber:15},this):re.jsxDEV(Y5,{className:"h-3.5 w-3.5 text-emerald-500"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:273,columnNumber:15},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:258,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:243,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:242,columnNumber:7},this),a&&re.jsxDEV("div",{className:"p-1 space-y-0.5",children:[!n&&re.jsxDEV("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:p("device.connecting")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:283,columnNumber:13},this),(n==null?void 0:n.length)===0&&re.jsxDEV("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:p("window.noWindows")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:289,columnNumber:13},this),n==null?void 0:n.map(w=>re.jsxDEV(uY,{deviceId:o.id,window:w,isSelected:w.id===s,selectedPaneId:l,onPaneClick:m,onWindowClick:b,onCloseWindow:h,onClosePane:g},w.id,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:295,columnNumber:13},this)),re.jsxDEV("button",{type:"button",onClick:()=>f(o.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[re.jsxDEV(I5,{className:"h-3.5 w-3.5 shrink-0"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:314,columnNumber:13},this),re.jsxDEV("span",{className:"text-xs",children:p("window.new")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:315,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:309,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:281,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:233,columnNumber:5},this)}function uY({deviceId:o,window:n,isSelected:a,selectedPaneId:s,onPaneClick:l,onWindowClick:c,onCloseWindow:f,onClosePane:h}){const g=n.panes.length>1,m=n.panes.find(p=>p.id===s),b=a&&!!m;return re.jsxDEV("div",{className:"space-y-0.5",children:[re.jsxDEV("div",{className:"group relative",children:[re.jsxDEV("button",{type:"button",onClick:()=>c(o,n.id,n.panes),"data-testid":`window-item-${n.id}`,className:jt("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors pr-7",b?"bg-primary/15 text-primary border border-primary/30":"hover:bg-accent/50 text-foreground border border-transparent"),children:[re.jsxDEV(X7,{variant:b?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:n.index},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:365,columnNumber:11},this),re.jsxDEV("span",{className:"flex-1 truncate text-xs font-medium",children:n.name},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:372,columnNumber:11},this),n.active&&re.jsxDEV("span",{className:jt("h-1.5 w-1.5 rounded-full shrink-0",b?"bg-foreground/80":"bg-foreground/50")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:375,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:354,columnNumber:9},this),re.jsxDEV("button",{type:"button",onClick:p=>{p.stopPropagation(),f(o,n.id)},className:jt("absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",b?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Close window",children:re.jsxDEV("span",{className:"text-xs leading-none",children:"×"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:397,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:385,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:353,columnNumber:7},this),g&&re.jsxDEV("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-0.5",children:n.panes.map(p=>{const v=p.id===s;return re.jsxDEV("div",{className:"group relative",children:[re.jsxDEV("button",{type:"button",onClick:()=>l(o,n.id,p.id),"data-testid":`pane-item-${p.id}`,className:jt("w-full flex items-center gap-2 px-2 py-1 rounded-md text-left transition-colors pr-7",v?"bg-primary/10 text-primary border border-primary/20":"hover:bg-accent/30 text-muted-foreground border border-transparent"),children:[re.jsxDEV("span",{className:"text-[10px] font-mono opacity-60 w-4",children:p.index},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:420,columnNumber:19},this),re.jsxDEV("span",{className:"flex-1 truncate text-xs",children:p.title||`Pane ${p.index}`},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:422,columnNumber:19},this),p.active&&re.jsxDEV("span",{className:jt("h-1 w-1 rounded-full shrink-0",v?"bg-foreground/80":"bg-foreground/50")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:427,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:409,columnNumber:17},this),re.jsxDEV("button",{type:"button",onClick:w=>{w.stopPropagation(),h(o,n.id,p.id,n.panes.length)},className:jt("absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",v?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Close pane",children:re.jsxDEV("span",{className:"text-xs leading-none",children:"×"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:449,columnNumber:19},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:437,columnNumber:17},this)]},p.id,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:408,columnNumber:15},this)})},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:403,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:351,columnNumber:5},this)}function dY(o,n){let a;try{a=o()}catch{return}return{getItem:l=>{var c;const f=g=>g===null?null:JSON.parse(g,void 0),h=(c=a.getItem(l))!=null?c:null;return h instanceof Promise?h.then(f):f(h)},setItem:(l,c)=>a.setItem(l,JSON.stringify(c,void 0)),removeItem:l=>a.removeItem(l)}}const TS=o=>n=>{try{const a=o(n);return a instanceof Promise?a:{then(s){return TS(s)(a)},catch(s){return this}}}catch(a){return{then(s){return this},catch(s){return TS(s)(a)}}}},fY=(o,n)=>(a,s,l)=>{let c={storage:dY(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,A)=>({...A,...C}),...n},f=!1,h=0;const g=new Set,m=new Set;let b=c.storage;if(!b)return o((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),a(...C)},s,l);const p=()=>{const C=c.partialize({...s()});return b.setItem(c.name,{state:C,version:c.version})},v=l.setState;l.setState=(C,A)=>(v(C,A),p());const w=o((...C)=>(a(...C),p()),s,l);l.getInitialState=()=>w;let E;const T=()=>{var C,A;if(!b)return;const k=++h;f=!1,g.forEach(M=>{var Y;return M((Y=s())!=null?Y:w)});const U=((A=c.onRehydrateStorage)==null?void 0:A.call(c,(C=s())!=null?C:w))||void 0;return TS(b.getItem.bind(b))(c.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==c.version){if(c.migrate){const Y=c.migrate(M.state,M.version);return Y instanceof Promise?Y.then($=>[!0,$]):[!0,Y]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var Y;if(k!==h)return;const[$,_]=M;if(E=c.merge(_,(Y=s())!=null?Y:w),a(E,!0),$)return p()}).then(()=>{k===h&&(U==null||U(E,void 0),E=s(),f=!0,m.forEach(M=>M(E)))}).catch(M=>{k===h&&(U==null||U(void 0,M))})};return l.persist={setOptions:C=>{c={...c,...C},C.storage&&(b=C.storage)},clearStorage:()=>{b==null||b.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>T(),hasHydrated:()=>f,onHydrate:C=>(g.add(C),()=>{g.delete(C)}),onFinishHydration:C=>(m.add(C),()=>{m.delete(C)})},c.skipHydration||T(),E||w},hY=fY,EA=qS()(hY(o=>({sidebarCollapsed:!1,inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:n=>o({sidebarCollapsed:n}),setInputMode:n=>o({inputMode:n}),setEditorSendWithEnter:n=>o({editorSendWithEnter:n}),setTheme:n=>o({theme:n}),addEditorHistory:n=>o(a=>({editorHistory:[n,...a.editorHistory.slice(0,49)]})),setEditorDraft:(n,a)=>o(s=>({editorDrafts:{...s.editorDrafts,[n]:a}})),removeEditorDraft:n=>o(a=>{if(!(n in a.editorDrafts))return a;const s={...a.editorDrafts};return delete s[n],{editorDrafts:s}})}),{name:"tmex-ui",partialize:o=>({sidebarCollapsed:o.sidebarCollapsed,inputMode:o.inputMode,editorSendWithEnter:o.editorSendWithEnter,theme:o.theme,editorHistory:o.editorHistory,editorDrafts:o.editorDrafts})}));function pY(){const{t:o}=dg(),{isMobile:n,setOpenMobile:a}=Du(),s=qm(b=>{var p;return(p=b.settings)==null?void 0:p.siteName}),l=qm(b=>b.fetchSettings);x.useEffect(()=>{l()},[l]);const c=s??"tmex",f=EA(b=>b.theme),h=EA(b=>b.setTheme),g=f==="dark",m=()=>{const b=g?"light":"dark";h(b),document.documentElement.classList.toggle("dark",b==="dark")};return re.jsxDEV("div",{className:"flex items-center gap-2 px-2",children:[re.jsxDEV(ag,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[re.jsxDEV("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:re.jsxDEV("img",{src:"/logo.png",alt:c,className:"h-full w-full object-cover"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:37,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:36,columnNumber:9},this),re.jsxDEV("span",{className:"truncate text-sm font-semibold tracking-tight",children:c},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:43,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:35,columnNumber:7},this),re.jsxDEV("button",{type:"button",onClick:m,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o(g?"settings.themeLight":"settings.themeDark"),title:o(g?"settings.themeLight":"settings.themeDark"),children:g?re.jsxDEV(X5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:54,columnNumber:19},this):re.jsxDEV(z5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:54,columnNumber:49},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:47,columnNumber:7},this),re.jsxDEV(ag,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o("sidebar.settings"),title:o("sidebar.settings"),children:re.jsxDEV(q5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:62,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:56,columnNumber:7},this),n&&re.jsxDEV("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>a(!1),className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o("nav.closeSidebar"),title:o("nav.closeSidebar"),children:re.jsxDEV(IN,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:73,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:65,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:34,columnNumber:5},this)}const mY=[{title:"nav.manageDevices",url:"/devices",icon:HN}];function gY({...o}){return re.jsxDEV(M7,{variant:"inset",...o,children:[re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-top)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:25,columnNumber:7},this),re.jsxDEV(L7,{className:"py-3",children:re.jsxDEV(pY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:27,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:26,columnNumber:7},this),re.jsxDEV(z7,{className:"flex flex-col",children:re.jsxDEV(lY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:30,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:29,columnNumber:7},this),re.jsxDEV(U7,{children:[re.jsxDEV(q7,{items:mY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:33,columnNumber:9},this),re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-bottom)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:32,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:24,columnNumber:5},this)}function yY(){var o;try{const n=localStorage.getItem("tmex-ui");if(!n){document.documentElement.classList.add("dark");return}const a=JSON.parse(n),s=(o=a==null?void 0:a.state)==null?void 0:o.theme,l=s==="dark"||s===void 0;document.documentElement.classList.toggle("dark",l)}catch{document.documentElement.classList.add("dark")}}yY();const bY=new i3({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function vY(){return re.jsxDEV(R5,{children:re.jsxDEV(N7,{children:[re.jsxDEV(gY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:50,columnNumber:9},this),re.jsxDEV(k7,{className:"h-dvh overflow-hidden",children:[re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-top)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:52,columnNumber:11},this),re.jsxDEV(v4,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:53,columnNumber:11},this),re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-bottom)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:54,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:51,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:49,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:48,columnNumber:5},this)}function ff({moduleLoader:o}){const[n,a]=x.useState(null),s=Kj();x.useEffect(()=>{o().then(a)},[o]);const l=n==null?void 0:n.default,c=n==null?void 0:n.PageTitle,f=n==null?void 0:n.PageActions;return re.jsxDEV(re.Fragment,{children:[re.jsxDEV("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[re.jsxDEV("div",{className:"flex items-center gap-2 px-4",children:[re.jsxDEV(_7,{className:"-ml-1","data-testid":"mobile-sidebar-open"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:81,columnNumber:11},this),re.jsxDEV(C8,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:82,columnNumber:11},this),re.jsxDEV("span",{className:"truncate text-sm font-semibold",children:c?re.jsxDEV(c,{...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:84,columnNumber:26},this):""},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:83,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:80,columnNumber:9},this),re.jsxDEV("div",{className:"flex shrink-0 items-center gap-1 px-4",children:f&&re.jsxDEV(f,{...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:88,columnNumber:27},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:87,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:76,columnNumber:7},this),re.jsxDEV("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4 mb-2",children:re.jsxDEV("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:l?re.jsxDEV(l,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:95,columnNumber:19},this):null},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:94,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:93,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:75,columnNumber:5},this)}const SY=()=>CS(()=>import("./SettingsPage-BDVq_Akt.js"),__vite__mapDeps([0,1,2,3])),xA=()=>CS(()=>import("./DevicesPage-BTB6mlBW.js"),__vite__mapDeps([4,1,2])),RA=()=>CS(()=>import("./DevicePage-BE5Hlzny.js"),__vite__mapDeps([5,2,3])),wY=Y4([{path:"/",Component:vY,children:[{index:!0,element:re.jsxDEV(ff,{moduleLoader:xA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:115,columnNumber:18},void 0)},{path:"devices",element:re.jsxDEV(ff,{moduleLoader:xA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:119,columnNumber:18},void 0)},{path:"devices/:deviceId",element:re.jsxDEV(ff,{moduleLoader:RA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:123,columnNumber:18},void 0)},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:re.jsxDEV(ff,{moduleLoader:RA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:127,columnNumber:18},void 0)},{path:"settings",element:re.jsxDEV(ff,{moduleLoader:SY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:131,columnNumber:18},void 0)}]}]),W_=document.getElementById("root");if(!W_)throw new Error("Root element not found");A3.createRoot(W_).render(re.jsxDEV(x.StrictMode,{children:re.jsxDEV(d3,{client:bY,children:[re.jsxDEV(g4,{router:wY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:146,columnNumber:7},void 0),re.jsxDEV(AP,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + var(--tmex-safe-area-top))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + var(--tmex-safe-area-top))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:147,columnNumber:7},void 0)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:145,columnNumber:5},void 0)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:144,columnNumber:3},void 0));export{h_ as $,qN as A,nw as B,nn as C,e7 as D,yn as E,$8 as F,Qf as G,Jf as H,RY as I,PF as J,j_ as K,KM as L,DY as M,v7 as N,Zr as O,hB as P,T_ as Q,IF as R,VY as S,_Y as T,pw as U,Sg as V,p_ as W,IN as X,mr as Y,fr as Z,U8 as _,u3 as a,zY as a$,zt as a0,c_ as a1,O_ as a2,BY as a3,Cu as a4,pt as a5,wu as a6,QF as a7,d_ as a8,f_ as a9,MY as aA,OF as aB,MF as aC,SF as aD,zi as aE,HY as aF,xf as aG,PY as aH,jM as aI,IY as aJ,zf as aK,OY as aL,IM as aM,HN as aN,I5 as aO,k5 as aP,X7 as aQ,C8 as aR,FS as aS,B6 as aT,Vf as aU,P0 as aV,Rf as aW,r3 as aX,yo as aY,$o as aZ,PA as a_,Ds as aa,GF as ab,st as ac,zm as ad,Lf as ae,XS as af,GN as ag,NY as ah,XN as ai,m_ as aj,s_ as ak,AF as al,Ew as am,TY as an,CY as ao,y_ as ap,FY as aq,FB as ar,$n as as,Cs as at,Os as au,fn as av,sF as aw,Ou as ax,gF as ay,Yt as az,qm as b,X6 as b0,jY as b1,LY as b2,UY as b3,xm as b4,xs as b5,vB as b6,fg as b7,QS as b8,Uf as b9,$Y as bA,iY as bB,$N as bC,qt as bD,Wl as bE,WF as bF,lw as bG,JF as bH,J6 as ba,rw as bb,yS as bc,Pa as bd,ID as be,O0 as bf,qo as bg,W6 as bh,K6 as bi,WN as bj,u_ as bk,bF as bl,YY as bm,GM as bn,hF as bo,_8 as bp,K7 as bq,tu as br,Gn as bs,ow as bt,Rw as bu,kY as bv,Es as bw,_f as bx,Kj as by,yN as bz,ta as c,EA as d,x3 as e,xY as f,R_ as g,VM as h,lo as i,re as j,jt as k,D_ as l,FM as m,C_ as n,BM as o,AY as p,ZS as q,x as r,Ql as s,mH as t,dg as u,kf as v,Xf as w,Ln as x,bg as y,RF as z};
448
- //# sourceMappingURL=index-Chps0Pui.js.map
447
+ )`}return nn.jsx("div",{ref:a,role:"presentation","data-base-ui-inert":"",...l,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:c}})});T_.displayName="InternalBackdrop";const C_=x.forwardRef(function(n,a){const{keepMounted:s=!1,...l}=n,{store:c}=Wl(),f=c.useState("mounted"),h=c.useState("modal"),g=c.useState("open");return f||s?nn.jsx(yw.Provider,{value:s,children:nn.jsxs(KM,{ref:a,...l,children:[f&&h===!0&&nn.jsx(T_,{ref:c.context.internalBackdropRef,inert:IF(!g)}),n.children]})}):null});C_.displayName="DialogPortal";function O_(o){const n=x.useRef(!0);n.current&&(n.current=!1,o())}let fA={},hA={},pA="";function BF(o){if(typeof document>"u")return!1;const n=fn(o);return Gn(n).innerWidth-n.documentElement.clientWidth>0}function VF(o){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const a=fn(o),s=a.documentElement,l=a.body,c=Pi(s)?s:l,f=c.style.overflowY,h=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",c.style.overflowY="scroll";const g=c.offsetWidth;c.style.overflowY="hidden";const m=c.offsetWidth;return c.style.overflowY=f,s.style.scrollbarGutter=h,g===m}function FF(o){const n=fn(o),a=n.documentElement,s=n.body,l=Pi(a)?a:s,c={overflowY:l.style.overflowY,overflowX:l.style.overflowX};return Object.assign(l.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(l.style,c)}}function YF(o){var v;const n=fn(o),a=n.documentElement,s=n.body,l=Gn(a);let c=0,f=0,h=!1;const g=Nn.create();if(ow&&(((v=l.visualViewport)==null?void 0:v.scale)??1)!==1)return()=>{};function m(){const w=l.getComputedStyle(a),E=l.getComputedStyle(s),A=(w.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";c=a.scrollTop,f=a.scrollLeft,fA={scrollbarGutter:a.style.scrollbarGutter,overflowY:a.style.overflowY,overflowX:a.style.overflowX},pA=a.style.scrollBehavior,hA={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const k=a.scrollHeight>a.clientHeight,U=a.scrollWidth>a.clientWidth,M=w.overflowY==="scroll"||E.overflowY==="scroll",Y=w.overflowX==="scroll"||E.overflowX==="scroll",$=Math.max(0,l.innerWidth-s.clientWidth),_=Math.max(0,l.innerHeight-s.clientHeight),z=parseFloat(E.marginTop)+parseFloat(E.marginBottom),te=parseFloat(E.marginLeft)+parseFloat(E.marginRight),H=Pi(a)?a:s;if(h=VF(o),h){a.style.scrollbarGutter=A,H.style.overflowY="hidden",H.style.overflowX="hidden";return}Object.assign(a.style,{scrollbarGutter:A,overflowY:"hidden",overflowX:"hidden"}),(k||M)&&(a.style.overflowY="scroll"),(U||Y)&&(a.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:z||_?`calc(100dvh - ${z+_}px)`:"100dvh",width:te||$?`calc(100vw - ${te+$}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=c,s.scrollLeft=f,a.setAttribute("data-base-ui-scroll-locked",""),a.style.scrollBehavior="unset"}function b(){Object.assign(a.style,fA),Object.assign(s.style,hA),h||(a.scrollTop=c,a.scrollLeft=f,a.removeAttribute("data-base-ui-scroll-locked"),a.style.scrollBehavior=pA)}function p(){b(),g.request(m)}return m(),l.addEventListener("resize",p),()=>{g.cancel(),b(),typeof l.removeEventListener=="function"&&l.removeEventListener("resize",p)}}class $F{constructor(){We(this,"lockCount",0);We(this,"restore",null);We(this,"timeoutLock",Fa.create());We(this,"timeoutUnlock",Fa.create());We(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});We(this,"unlock",()=>{var n;this.lockCount===0&&this.restore&&((n=this.restore)==null||n.call(this),this.restore=null)})}acquire(n){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(n)),this.release}lock(n){if(this.lockCount===0||this.restore!==null)return;const s=fn(n).documentElement,l=Gn(s).getComputedStyle(s).overflowY;if(l==="hidden"||l==="clip"){this.restore=$N;return}const c=EM||!BF(n);this.restore=c?FF(n):YF(n)}}const qF=new $F;function GF(o=!0,n=null){pt(()=>{if(o)return qF.acquire(n)},[o,n])}function XF(o){const n=x.useRef(""),a=x.useCallback(l=>{l.defaultPrevented||(n.current=l.pointerType,o(l,l.pointerType))},[o]);return{onClick:x.useCallback(l=>{if(l.detail===0){o(l,"keyboard");return}"pointerType"in l?o(l,l.pointerType):o(l,n.current),n.current=""},[o]),onPointerDown:a}}function QF(o){const[n,a]=x.useState(null),s=st((h,g)=>{o||a(g||(EM?"touch":""))}),l=x.useCallback(()=>{a(null)},[]),{onClick:c,onPointerDown:f}=XF(s);return x.useMemo(()=>({openMethod:n,reset:l,triggerProps:{onClick:c,onPointerDown:f}}),[n,l,c,f])}function WF(o){const{store:n,parentContext:a,actionsRef:s}=o,l=n.useState("open"),c=n.useState("disablePointerDismissal"),f=n.useState("modal"),h=n.useState("popupElement"),{openMethod:g,triggerProps:m,reset:b}=QF(l);d_(n);const{forceUnmount:p}=f_(l,n,()=>{b()}),v=st(H=>{const J=yn(H);return J.preventUnmountOnClose=()=>{n.set("preventUnmountingOnClose",!0)},J}),w=x.useCallback(()=>{n.setOpen(!1,v(XN))},[n,v]);x.useImperativeHandle(s,()=>({unmount:p,close:w}),[p,w]);const E=m_({popupStore:n,onOpenChange:n.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[T,C]=x.useState(0),A=T===0,k=AF(E),U=s_(E,{outsidePressEvent(){return n.context.internalBackdropRef.current||n.context.backdropRef.current?"intentional":{mouse:f==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(H){if(!n.context.outsidePressEnabledRef.current||"button"in H&&H.button!==0||"touches"in H&&H.touches.length!==1)return!1;const J=qo(H);if(A&&!c){const N=J;return f&&(n.context.internalBackdropRef.current||n.context.backdropRef.current)?n.context.internalBackdropRef.current===N||n.context.backdropRef.current===N||Yt(N,h)&&!(N!=null&&N.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:A});GF(l&&f===!0,h);const{getReferenceProps:M,getFloatingProps:Y,getTriggerProps:$}=y_([k,U]);n.useContextCallback("onNestedDialogOpen",H=>{C(H+1)}),n.useContextCallback("onNestedDialogClose",()=>{C(0)}),x.useEffect(()=>(a!=null&&a.onNestedDialogOpen&&l&&a.onNestedDialogOpen(T),a!=null&&a.onNestedDialogClose&&!l&&a.onNestedDialogClose(),()=>{a!=null&&a.onNestedDialogClose&&l&&a.onNestedDialogClose()}),[l,a,T]);const _=x.useMemo(()=>M(m),[M,m]),z=x.useMemo(()=>$(m),[$,m]),te=x.useMemo(()=>Y(),[Y]);n.useSyncedValues({openMethod:g,activeTriggerProps:_,inactiveTriggerProps:z,popupProps:te,floatingRootContext:E,nestedOpenDialogCount:T})}const KF={...p_,modal:zt(o=>o.modal),nested:zt(o=>o.nested),nestedOpenDialogCount:zt(o=>o.nestedOpenDialogCount),disablePointerDismissal:zt(o=>o.disablePointerDismissal),openMethod:zt(o=>o.openMethod),descriptionElementId:zt(o=>o.descriptionElementId),titleElementId:zt(o=>o.titleElementId),viewportElement:zt(o=>o.viewportElement),role:zt(o=>o.role)};class JF extends pw{constructor(a){super(ZF(a),{popupRef:x.createRef(),backdropRef:x.createRef(),internalBackdropRef:x.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Sg,onOpenChange:void 0,onOpenChangeComplete:void 0},KF);We(this,"setOpen",(a,s)=>{var h,g,m,b;if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!a&&s.trigger==null&&this.state.activeTriggerId!=null&&(s.trigger=this.state.activeTriggerElement??void 0),(g=(h=this.context).onOpenChange)==null||g.call(h,a,s),s.isCanceled)return;const l={open:a,nativeEvent:s.event,reason:s.reason,nested:this.state.nested};(m=this.state.floatingRootContext.context.events)==null||m.emit("openchange",l);const c={open:a},f=((b=s.trigger)==null?void 0:b.id)??null;(f||a)&&(c.activeTriggerId=f,c.activeTriggerElement=s.trigger??null),this.update(c)})}}function ZF(o={}){return{...h_(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...o}}function e7(o){const{children:n,open:a,defaultOpen:s=!1,onOpenChange:l,onOpenChangeComplete:c,disablePointerDismissal:f=!1,modal:h=!0,actionsRef:g,handle:m,triggerId:b,defaultTriggerId:p=null}=o,v=Wl(!0),w=!!v,E=mr(()=>(m==null?void 0:m.store)??new JF({open:s,openProp:a,activeTriggerId:p,triggerIdProp:b,modal:h,disablePointerDismissal:f,nested:w})).current;O_(()=>{a===void 0&&E.state.open===!1&&s===!0&&E.update({open:!0,activeTriggerId:p})}),E.useControlledProp("openProp",a),E.useControlledProp("triggerIdProp",b),E.useSyncedValues({disablePointerDismissal:f,nested:w,modal:h}),E.useContextCallback("onOpenChange",l),E.useContextCallback("onOpenChangeComplete",c);const T=E.useState("payload");WF({store:E,actionsRef:g,parentContext:v==null?void 0:v.store.context});const C=x.useMemo(()=>({store:E}),[E]);return nn.jsx(lw.Provider,{value:C,children:typeof n=="function"?n({payload:T}):n})}const D_=x.forwardRef(function(n,a){const{render:s,className:l,id:c,...f}=n,{store:h}=Wl(),g=Xf(c);return h.useSyncedValueWithCleanup("titleElementId",g),Ln("h2",n,{ref:a,props:[{id:g},f]})});D_.displayName="DialogTitle";function t7({...o}){return re.jsxDEV(e7,{"data-slot":"sheet",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:11,columnNumber:10},this)}function n7({...o}){return re.jsxDEV(C_,{"data-slot":"sheet-portal",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:23,columnNumber:10},this)}function o7({className:o,...n}){return re.jsxDEV(BM,{"data-slot":"sheet-overlay",className:jt("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:28,columnNumber:5},this)}function r7({className:o,children:n,side:a="right",showCloseButton:s=!0,...l}){return re.jsxDEV(n7,{children:[re.jsxDEV(o7,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:48,columnNumber:7},this),re.jsxDEV(R_,{"data-slot":"sheet-content","data-side":a,className:jt("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",o),...l,children:[n,s&&re.jsxDEV(VM,{"data-slot":"sheet-close",render:re.jsxDEV(nw,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:60,columnNumber:15},this),children:[re.jsxDEV(IN,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:67,columnNumber:13},this),re.jsxDEV("span",{className:"sr-only",children:"Close"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:69,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:49,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:47,columnNumber:5},this)}function a7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sheet-header",className:jt("gap-0.5 p-4 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:79,columnNumber:5},this)}function s7({className:o,...n}){return re.jsxDEV(D_,{"data-slot":"sheet-title",className:jt("text-foreground text-base font-medium",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:99,columnNumber:5},this)}function i7({className:o,...n}){return re.jsxDEV(FM,{"data-slot":"sheet-description",className:jt("text-muted-foreground text-sm",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sheet.tsx",lineNumber:112,columnNumber:5},this)}const bw=x.createContext(void 0);bw.displayName="TooltipRootContext";function Zf(o){const n=x.useContext(bw);if(n===void 0&&!o)throw new Error("Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>.");return n}const l7={...p_,disabled:zt(o=>o.disabled),instantType:zt(o=>o.instantType),isInstantPhase:zt(o=>o.isInstantPhase),trackCursorAxis:zt(o=>o.trackCursorAxis),disableHoverablePopup:zt(o=>o.disableHoverablePopup),lastOpenChangeReason:zt(o=>o.openChangeReason),closeDelay:zt(o=>o.closeDelay),hasViewport:zt(o=>o.hasViewport)};class vw extends pw{constructor(a){super({...c7(),...a},{popupRef:x.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Sg},l7);We(this,"setOpen",(a,s)=>{var m,b;const l=s.reason,c=l===Zr,f=a&&l===zm,h=!a&&(l===Lf||l===XS);if(s.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(b=(m=this.context).onOpenChange)==null||b.call(m,a,s),s.isCanceled)return;const g=()=>{var w;const p={open:a,openChangeReason:l};f?p.instantType="focus":h?p.instantType="dismiss":l===Zr&&(p.instantType=void 0);const v=((w=s.trigger)==null?void 0:w.id)??null;(v||a)&&(p.activeTriggerId=v,p.activeTriggerElement=s.trigger??null),this.update(p)};c?zi.flushSync(g):g()})}static useStore(a,s){const l=mr(()=>new vw(s)).current,c=a??l,f=m_({popupStore:c,onOpenChange:c.setOpen});return c.state.floatingRootContext=f,c}}function c7(){return{...h_(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const A_=c_(function(n){const{disabled:a=!1,defaultOpen:s=!1,open:l,disableHoverablePopup:c=!1,trackCursorAxis:f="none",actionsRef:h,onOpenChange:g,onOpenChangeComplete:m,handle:b,triggerId:p,defaultTriggerId:v=null,children:w}=n,E=vw.useStore(b==null?void 0:b.store,{open:s,openProp:l,activeTriggerId:v,triggerIdProp:p});O_(()=>{l===void 0&&E.state.open===!1&&s===!0&&E.update({open:!0,activeTriggerId:v})}),E.useControlledProp("openProp",l),E.useControlledProp("triggerIdProp",p),E.useContextCallback("onOpenChange",g),E.useContextCallback("onOpenChangeComplete",m);const T=E.useState("open"),C=!a&&T,A=E.useState("activeTriggerId"),k=E.useState("payload");E.useSyncedValues({trackCursorAxis:f,disableHoverablePopup:c}),pt(()=>{T&&a&&E.setOpen(!1,yn(xB))},[T,a,E]),E.useSyncedValue("disabled",a),d_(E);const{forceUnmount:U,transitionStatus:M}=f_(C,E),Y=E.useState("isInstantPhase"),$=E.useState("instantType"),_=E.useState("lastOpenChangeReason"),z=x.useRef(null);pt(()=>{M==="ending"&&_===fg||M!=="ending"&&Y?($!=="delay"&&(z.current=$),E.set("instantType","delay")):z.current!==null&&(E.set("instantType",z.current),z.current=null)},[M,Y,_,$,E]),pt(()=>{C&&A==null&&E.set("payload",void 0)},[E,A,C]);const te=x.useCallback(()=>{E.setOpen(!1,u7(E,XN))},[E]);x.useImperativeHandle(h,()=>({unmount:U,close:te}),[U,te]);const H=E.useState("floatingRootContext"),J=s_(H,{enabled:!a,referencePress:!0}),N=G8(H,{enabled:!a&&f!=="none",axis:f==="none"?void 0:f}),{getReferenceProps:P,getFloatingProps:ne,getTriggerProps:Z}=y_([J,N]),j=x.useMemo(()=>P(),[P]),oe=x.useMemo(()=>Z(),[Z]),I=x.useMemo(()=>ne(),[ne]);return E.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:oe,popupProps:I}),nn.jsx(bw.Provider,{value:E,children:typeof w=="function"?w({payload:k}):w})});A_.displayName="TooltipRoot";function u7(o,n){const a=yn(n);return a.preventUnmountOnClose=()=>{o.set("preventUnmountingOnClose",!0)},a}const N_=x.createContext(void 0);N_.displayName="TooltipProviderContext";function d7(){return x.useContext(N_)}let f7=(function(o){return o[o.popupOpen=ng.popupOpen]="popupOpen",o.triggerDisabled="data-trigger-disabled",o})({});const h7=600,M_=sF(function(n,a){const{className:s,render:l,handle:c,payload:f,disabled:h,delay:g,closeDelay:m,id:b,...p}=n,v=Zf(!0),w=(c==null?void 0:c.store)??v;if(!w)throw new Error("Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle.");const E=Xf(b),T=w.useState("isTriggerActive",E),C=w.useState("isOpenedByTrigger",E),A=w.useState("floatingRootContext"),k=x.useRef(null),U=g??h7,M=m??0,{registerTrigger:Y,isMountedByThisTrigger:$}=gF(E,k,w,{payload:f,closeDelay:M}),_=d7(),{delayRef:z,isInstantPhase:te,hasProvider:H}=z8(A,{open:C});w.useSyncedValue("isInstantPhase",te);const J=w.useState("disabled"),N=h??J,P=w.useState("trackCursorAxis"),ne=w.useState("disableHoverablePopup"),Z=OF(A,{enabled:!N,mouseOnly:!0,move:!1,handleClose:!ne&&P!=="both"?MF():null,restMs(){const pe=_==null?void 0:_.delay,L=typeof z.current=="object"?z.current.open:void 0;let ce=U;return H&&(L!==0?ce=g??pe??U:ce=0),ce},delay(){const pe=typeof z.current=="object"?z.current.close:void 0;let L=M;return m==null&&H&&(L=pe),{close:L}},triggerElementRef:k,isActiveTrigger:T}),j=SF(A,{enabled:!N}).reference,oe={open:C},I=w.useState("triggerProps",$);return Ln("button",n,{state:oe,ref:[a,Y,k],props:[Z,j,I,{id:E,[f7.triggerDisabled]:N?"":void 0},p],stateAttributesMapping:_8})});M_.displayName="TooltipTrigger";const Sw=x.createContext(void 0);Sw.displayName="TooltipPortalContext";function p7(){const o=x.useContext(Sw);if(o===void 0)throw new Error("Base UI: <Tooltip.Portal> is missing.");return o}const __=x.forwardRef(function(n,a){const{children:s,container:l,className:c,render:f,...h}=n,{portalNode:g,portalSubtree:m}=WM({container:l,ref:a,componentProps:n,elementProps:h});return!m&&!g?null:nn.jsxs(x.Fragment,{children:[m,g&&zi.createPortal(s,g)]})});__.displayName="FloatingPortalLite";const k_=x.forwardRef(function(n,a){const{keepMounted:s=!1,...l}=n;return Zf().useState("mounted")||s?nn.jsx(Sw.Provider,{value:s,children:nn.jsx(__,{ref:a,...l})}):null});k_.displayName="TooltipPortal";const ww=x.createContext(void 0);ww.displayName="TooltipPositionerContext";function L_(){const o=x.useContext(ww);if(o===void 0)throw new Error("Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>.");return o}const U_=x.createContext(void 0);U_.displayName="DirectionContext";function Ew(){const o=x.useContext(U_);return(o==null?void 0:o.direction)??"ltr"}const m7=o=>({name:"arrow",options:o,async fn(n){var ie,pe;const{x:a,y:s,placement:l,rects:c,platform:f,elements:h,middlewareData:g}=n,{element:m,padding:b=0,offsetParent:p="real"}=As(o,n)||{};if(m==null)return{};const v=DM(b),w={x:a,y:s},E=iw(l),T=sw(E),C=await f.getDimensions(m),A=E==="y",k=A?"top":"left",U=A?"bottom":"right",M=A?"clientHeight":"clientWidth",Y=c.reference[T]+c.reference[E]-w[E]-c.floating[T],$=w[E]-c.reference[E],_=p==="real"?await((ie=f.getOffsetParent)==null?void 0:ie.call(f,m)):h.floating;let z=h.floating[M]||c.floating[T];(!z||!await((pe=f.isElement)==null?void 0:pe.call(f,_)))&&(z=h.floating[M]||c.floating[T]);const te=Y/2-$/2,H=z/2-C[T]/2-1,J=Math.min(v[k],H),N=Math.min(v[U],H),P=J,ne=z-C[T]-N,Z=z/2-C[T]/2+te,j=bS(P,Z,ne),oe=!g.arrow&&Hi(l)!=null&&Z!==j&&c.reference[T]/2-(Z<P?J:N)-C[T]/2<0,I=oe?Z<P?Z-P:Z-ne:0;return{[E]:w[E]+I,data:{[E]:j,centerOffset:Z-j-I,...oe&&{alignmentOffset:I}},reset:oe}}}),g7=(o,n)=>({...m7(o),options:[o,n]}),y7={name:"hide",async fn(o){var h;const{width:n,height:a,x:s,y:l}=o.rects.reference,c=n===0&&a===0&&s===0&&l===0;return{data:{referenceHidden:((h=(await LV().fn(o)).data)==null?void 0:h.referenceHidden)||c}}}},Hm={sideX:"left",sideY:"top"},b7={name:"adaptiveOrigin",async fn(o){var k,U;const{x:n,y:a,rects:{floating:s},elements:{floating:l},platform:c,strategy:f,placement:h}=o,g=Gn(l),m=g.getComputedStyle(l);if(!(m.transitionDuration!=="0s"&&m.transitionDuration!==""))return{x:n,y:a,data:Hm};const p=await((k=c.getOffsetParent)==null?void 0:k.call(c,l));let v={width:0,height:0};if(f==="fixed"&&(g!=null&&g.visualViewport))v={width:g.visualViewport.width,height:g.visualViewport.height};else if(p===g){const M=fn(l);v={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((U=c.isElement)==null?void 0:U.call(c,p))&&(v=await c.getDimensions(p));const w=Go(h);let E=n,T=a;w==="left"&&(E=v.width-(n+s.width)),w==="top"&&(T=v.height-(a+s.height));const C=w==="left"?"right":Hm.sideX,A=w==="top"?"bottom":Hm.sideY;return{x:E,y:T,data:{sideX:C,sideY:A}}}};function z_(o,n,a){const s=o==="inline-start"||o==="inline-end";return{top:"top",right:s?a?"inline-start":"inline-end":"right",bottom:"bottom",left:s?a?"inline-end":"inline-start":"left"}[n]}function mA(o,n,a){const{rects:s,placement:l}=o;return{side:z_(n,Go(l),a),align:Hi(l)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function v7(o){var Un,D;const{anchor:n,positionMethod:a="absolute",side:s="bottom",sideOffset:l=0,align:c="center",alignOffset:f=0,collisionBoundary:h,collisionPadding:g=5,sticky:m=!1,arrowPadding:b=5,disableAnchorTracking:p=!1,keepMounted:v=!1,floatingRootContext:w,mounted:E,collisionAvoidance:T,shiftCrossAxis:C=!1,nodeId:A,adaptiveOrigin:k,lazyFlip:U=!1,externalTree:M}=o,[Y,$]=x.useState(null);!E&&Y!==null&&$(null);const _=T.side||"flip",z=T.align||"flip",te=T.fallbackAxisSide||"end",H=typeof n=="function"?n:void 0,J=st(H),N=H?J:n,P=Pa(n),Z=Ew()==="rtl",j=Y||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":Z?"left":"right","inline-start":Z?"right":"left"}[s],oe=c==="center"?j:`${j}-${c}`;let I=g;const ie=1,pe=s==="bottom"?ie:0,L=s==="top"?ie:0,ce=s==="right"?ie:0,se=s==="left"?ie:0;typeof I=="number"?I={top:I+pe,right:I+se,bottom:I+L,left:I+ce}:I&&(I={top:(I.top||0)+pe,right:(I.right||0)+se,bottom:(I.bottom||0)+L,left:(I.left||0)+ce});const me={boundary:h==="clipping-ancestors"?"clippingAncestors":h,padding:I},Te=x.useRef(null),Ue=Pa(l),ve=Pa(f),at=[AV(G=>{const ge=mA(G,s,Z),ye=typeof Ue.current=="function"?Ue.current(ge):Ue.current,Ne=typeof ve.current=="function"?ve.current(ge):ve.current;return{mainAxis:ye,crossAxis:Ne,alignmentAxis:Ne}},[typeof l!="function"?l:0,typeof f!="function"?f:0,Z,s])],xe=z==="none"&&_!=="shift",he=!xe&&(m||C||_==="shift"),we=_==="none"?null:_V({...me,padding:{top:I.top+ie,right:I.right+ie,bottom:I.bottom+ie,left:I.left+ie},mainAxis:!C&&_==="flip",crossAxis:z==="flip"?"alignment":!1,fallbackAxisSideDirection:te}),De=xe?null:NV(G=>{const ge=fn(G.elements.floating).documentElement;return{...me,rootBoundary:C?{x:0,y:0,width:ge.clientWidth,height:ge.clientHeight}:void 0,mainAxis:z!=="none",crossAxis:he,limiter:m||C?void 0:MV(ye=>{if(!Te.current)return{};const{width:Ne,height:$e}=Te.current.getBoundingClientRect(),Se=Lr(Go(ye.placement)),Ke=Se==="y"?Ne:$e,Ve=Se==="y"?I.left+I.right:I.top+I.bottom;return{offset:Ke/2+Ve/2}})}},[me,m,C,I,z]);_==="shift"||z==="shift"||c==="center"?at.push(De,we):at.push(we,De),at.push(kV({...me,apply({elements:{floating:G},rects:{reference:ge},availableWidth:ye,availableHeight:Ne}){const $e=G.style;$e.setProperty("--available-width",`${ye}px`),$e.setProperty("--available-height",`${Ne}px`),$e.setProperty("--anchor-width",`${ge.width}px`),$e.setProperty("--anchor-height",`${ge.height}px`)}}),g7(()=>({element:Te.current||document.createElement("div"),padding:b,offsetParent:"floating"}),[b]),{name:"transformOrigin",fn(G){var Fe,Xe,ut;const{elements:ge,middlewareData:ye,placement:Ne,rects:$e,y:Se}=G,Ke=Go(Ne),Ve=Lr(Ke),Rt=Te.current,Cn=((Fe=ye.arrow)==null?void 0:Fe.x)||0,rn=((Xe=ye.arrow)==null?void 0:Xe.y)||0,xn=(Rt==null?void 0:Rt.clientWidth)||0,Xo=(Rt==null?void 0:Rt.clientHeight)||0,B=Cn+xn/2,Q=rn+Xo/2,ue=Math.abs(((ut=ye.shift)==null?void 0:ut.y)||0),Ee=$e.reference.height/2,Me=typeof l=="function"?l(mA(G,s,Z)):l,Je=ue>Me,Ze={top:`${B}px calc(100% + ${Me}px)`,bottom:`${B}px ${-Me}px`,left:`calc(100% + ${Me}px) ${Q}px`,right:`${-Me}px ${Q}px`}[Ke],Pe=`${B}px ${$e.reference.y+Ee-Se}px`;return ge.floating.style.setProperty("--transform-origin",he&&Ve==="y"&&Je?Pe:Ze),{}}},y7,k),pt(()=>{!E&&w&&w.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[E,w]);const Ye=x.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:Re,elements:Ae,x:Le,y:tt,middlewareData:Ce,update:ot,placement:gt,context:yt,isPositioned:ht,floatingStyles:$t}=vF({rootContext:w,placement:oe,middleware:at,strategy:a,whileElementsMounted:v?void 0:(...G)=>oA(...G,Ye),nodeId:A,externalTree:M}),{sideX:on,sideY:bn}=Ce.adaptiveOrigin||Hm,bt=ht?a:"fixed",Pt=x.useMemo(()=>{const G=k?{position:bt,[on]:Le,[bn]:tt}:{position:bt,...$t};return ht||(G.opacity=0),G},[k,bt,on,Le,bn,tt,$t,ht]),Ft=x.useRef(null);pt(()=>{if(!E)return;const G=P.current,ge=typeof G=="function"?G():G,Ne=(gA(ge)?ge.current:ge)||null||null;Ne!==Ft.current&&(Re.setPositionReference(Ne),Ft.current=Ne)},[E,Re,N,P]),x.useEffect(()=>{if(!E)return;const G=P.current;typeof G!="function"&&gA(G)&&G.current!==Ft.current&&(Re.setPositionReference(G.current),Ft.current=G.current)},[E,Re,N,P]),x.useEffect(()=>{if(v&&E&&Ae.domReference&&Ae.floating)return oA(Ae.domReference,Ae.floating,ot,Ye)},[v,E,Ae,ot,Ye]);const vn=Go(gt),ln=z_(s,vn,Z),Zn=Hi(gt)||"center",hn=!!((Un=Ce.hide)!=null&&Un.referenceHidden);pt(()=>{U&&E&&ht&&$(vn)},[U,E,ht,vn]);const co=x.useMemo(()=>{var G,ge;return{position:"absolute",top:(G=Ce.arrow)==null?void 0:G.y,left:(ge=Ce.arrow)==null?void 0:ge.x}},[Ce.arrow]),uo=((D=Ce.arrow)==null?void 0:D.centerOffset)!==0;return x.useMemo(()=>({positionerStyles:Pt,arrowStyles:co,arrowRef:Te,arrowUncentered:uo,side:ln,align:Zn,physicalSide:vn,anchorHidden:hn,refs:Re,context:yt,isPositioned:ht,update:ot}),[Pt,co,Te,uo,ln,Zn,vn,hn,Re,yt,ht,ot])}function gA(o){return o!=null&&"current"in o}function j_(o){return o==="starting"?dB:fr}const P_=x.forwardRef(function(n,a){const{render:s,className:l,anchor:c,positionMethod:f="absolute",side:h="top",align:g="center",sideOffset:m=0,alignOffset:b=0,collisionBoundary:p="clipping-ancestors",collisionPadding:v=5,arrowPadding:w=5,sticky:E=!1,disableAnchorTracking:T=!1,collisionAvoidance:C=hB,...A}=n,k=Zf(),U=p7(),M=k.useState("open"),Y=k.useState("mounted"),$=k.useState("trackCursorAxis"),_=k.useState("disableHoverablePopup"),z=k.useState("floatingRootContext"),te=k.useState("instantType"),H=k.useState("transitionStatus"),J=k.useState("hasViewport"),N=v7({anchor:c,positionMethod:f,floatingRootContext:z,mounted:Y,side:h,sideOffset:m,align:g,alignOffset:b,collisionBoundary:p,collisionPadding:v,sticky:E,arrowPadding:w,disableAnchorTracking:T,keepMounted:U,collisionAvoidance:C,adaptiveOrigin:J?b7:void 0}),P=x.useMemo(()=>{const oe={};return(!M||$==="both"||_)&&(oe.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...N.positionerStyles,...oe}}},[M,$,_,Y,N.positionerStyles]),ne=x.useMemo(()=>({open:M,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:$!=="none"?"tracking-cursor":te}),[M,N.side,N.align,N.anchorHidden,$,te]),Z=x.useMemo(()=>({...ne,arrowRef:N.arrowRef,arrowStyles:N.arrowStyles,arrowUncentered:N.arrowUncentered}),[ne,N.arrowRef,N.arrowStyles,N.arrowUncentered]),j=Ln("div",n,{state:ne,props:[P,j_(H),A],ref:[a,k.useStateSetter("positionerElement")],stateAttributesMapping:Jf});return nn.jsx(ww.Provider,{value:Z,children:j})});P_.displayName="TooltipPositioner";const S7={...Jf,...Qf},H_=x.forwardRef(function(n,a){const{className:s,render:l,...c}=n,f=Zf(),{side:h,align:g}=L_(),m=f.useState("open"),b=f.useState("instantType"),p=f.useState("transitionStatus"),v=f.useState("popupProps"),w=f.useState("floatingRootContext");bg({open:m,ref:f.context.popupRef,onComplete(){var k,U;m&&((U=(k=f.context).onOpenChangeComplete)==null||U.call(k,!0))}});const E=f.useState("disabled"),T=f.useState("closeDelay");return RF(w,{enabled:!E,closeDelay:T}),Ln("div",n,{state:{open:m,side:h,align:g,instant:b,transitionStatus:p},ref:[a,f.context.popupRef,f.useStateSetter("popupElement")],props:[v,j_(p),c],stateAttributesMapping:S7})});H_.displayName="TooltipPopup";const I_=x.forwardRef(function(n,a){const{className:s,render:l,...c}=n,h=Zf().useState("instantType"),{open:g,arrowRef:m,side:b,align:p,arrowUncentered:v,arrowStyles:w}=L_();return Ln("div",n,{state:{open:g,side:b,align:p,uncentered:v,instant:h},ref:[a,m],props:[{style:w,"aria-hidden":!0},c],stateAttributesMapping:Jf})});I_.displayName="TooltipArrow";function w7({...o}){return re.jsxDEV(A_,{"data-slot":"tooltip",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:19,columnNumber:10},this)}function E7({...o}){return re.jsxDEV(M_,{"data-slot":"tooltip-trigger",...o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:23,columnNumber:10},this)}function x7({className:o,side:n="top",sideOffset:a=4,align:s="center",alignOffset:l=0,children:c,...f}){return re.jsxDEV(k_,{children:re.jsxDEV(P_,{align:s,alignOffset:l,side:n,sideOffset:a,className:"isolate z-50",children:re.jsxDEV(H_,{"data-slot":"tooltip-content",className:jt("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",o),...f,children:[c,re.jsxDEV(I_,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:57,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:48,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:41,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/tooltip.tsx",lineNumber:40,columnNumber:5},this)}const R7="sidebar_state",T7=3600*24*7,C7="16rem",O7="18rem",D7="3rem",A7="b",B_=x.createContext(null);function Du(){const o=x.useContext(B_);if(!o)throw new Error("useSidebar must be used within a SidebarProvider.");return o}function N7({defaultOpen:o=!0,open:n,onOpenChange:a,className:s,style:l,children:c,...f}){const h=JB(),[g,m]=x.useState(!1),[b,p]=x.useState(o),v=n??b,w=x.useCallback(A=>{const k=typeof A=="function"?A(v):A;a?a(k):p(k),document.cookie=`${R7}=${k}; path=/; max-age=${T7}`},[a,v]),E=x.useCallback(()=>h?m(A=>!A):w(A=>!A),[h,w,m]);x.useEffect(()=>{const A=k=>{k.key===A7&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),E())};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[E]);const T=v?"expanded":"collapsed",C=x.useMemo(()=>({state:T,open:v,setOpen:w,isMobile:h,openMobile:g,setOpenMobile:m,toggleSidebar:E}),[T,v,w,h,g,m,E]);return re.jsxDEV(B_.Provider,{value:C,children:re.jsxDEV("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":C7,"--sidebar-width-icon":D7,...l},className:jt("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...f,children:c},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:129,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:128,columnNumber:5},this)}function M7({side:o="left",variant:n="sidebar",collapsible:a="offcanvas",className:s,children:l,dir:c,...f}){const{isMobile:h,state:g,openMobile:m,setOpenMobile:b}=Du();return a==="none"?re.jsxDEV("div",{"data-slot":"sidebar",className:jt("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...f,children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:167,columnNumber:7},this):h?re.jsxDEV(t7,{open:m,onOpenChange:b,...f,children:re.jsxDEV(r7,{dir:c,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":O7},side:o,children:[re.jsxDEV(a7,{className:"sr-only",children:[re.jsxDEV(s7,{children:"Sidebar"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:198,columnNumber:13},this),re.jsxDEV(i7,{children:"Displays the mobile sidebar."},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:199,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:197,columnNumber:11},this),re.jsxDEV("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:201,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:183,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:182,columnNumber:7},this):re.jsxDEV("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":g,"data-collapsible":g==="collapsed"?a:"","data-variant":n,"data-side":o,"data-slot":"sidebar",children:[re.jsxDEV("div",{"data-slot":"sidebar-gap",className:jt("transition-[width] duration-200 ease-linear relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",n==="floating"||n==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:223,columnNumber:7},this),re.jsxDEV("div",{"data-slot":"sidebar-container","data-side":o,className:jt("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",n==="floating"||n==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...f,children:re.jsxDEV("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:247,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:234,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:214,columnNumber:5},this)}function _7({className:o,onClick:n,...a}){const{toggleSidebar:s}=Du();return re.jsxDEV(nw,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:jt(o),onClick:l=>{n==null||n(l),s()},...a,children:[re.jsxDEV(P5,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:282,columnNumber:7},this),re.jsxDEV("span",{className:"sr-only",children:"Toggle Sidebar"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:283,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:270,columnNumber:5},this)}function k7({className:o,...n}){return re.jsxDEV("main",{"data-slot":"sidebar-inset",className:jt("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:315,columnNumber:5},this)}function L7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:jt("gap-2 p-2 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:342,columnNumber:5},this)}function U7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:jt("gap-2 p-2 flex flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:353,columnNumber:5},this)}function z7({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:jt("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:378,columnNumber:5},this)}function V_({className:o,...n}){return re.jsxDEV("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:jt("p-2 relative flex w-full min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:392,columnNumber:5},this)}function j7({className:o,render:n,...a}){return Wf({defaultTagName:"div",props:Ql({className:jt("text-sidebar-foreground/70 ring-sidebar-ring h-8 rounded-md px-2 text-xs font-medium transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",o)},a),render:n,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function P7({className:o,...n}){return re.jsxDEV("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:jt("gap-0 flex w-full min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:468,columnNumber:5},this)}function H7({className:o,...n}){return re.jsxDEV("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:jt("group/menu-item relative",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:479,columnNumber:5},this)}const I7=ew("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function B7({render:o,isActive:n=!1,variant:a="default",size:s="default",tooltip:l,className:c,...f}){const{isMobile:h,state:g}=Du(),m=Wf({defaultTagName:"button",props:Ql({className:jt(I7({variant:a,size:s}),c)},f),render:l?E7:o,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:s,active:n}});return l?(typeof l=="string"&&(l={children:l}),re.jsxDEV(w7,{children:[m,re.jsxDEV(x7,{side:"right",align:"center",hidden:g!=="collapsed"||h,...l},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:553,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:551,columnNumber:5},this)):m}function V7({className:o,render:n,showOnHover:a=!1,...s}){return Wf({defaultTagName:"button",props:Ql({className:jt("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",a&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",o)},s),render:n,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function F7({className:o,...n}){return re.jsxDEV("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:jt("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:650,columnNumber:5},this)}function Y7({className:o,...n}){return re.jsxDEV("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:jt("group/menu-sub-item relative",o),...n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/sidebar.tsx",lineNumber:664,columnNumber:5},this)}function $7({render:o,size:n="md",isActive:a=!1,className:s,...l}){return Wf({defaultTagName:"a",props:Ql({className:jt("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",s)},l),render:o,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:n,active:a}})}function ag({children:o,onClick:n,...a}){const{isMobile:s,setOpenMobile:l}=Du(),c=f=>{s&&l(!1),n==null||n(f)};return re.jsxDEV(FS,{...a,onClick:c,children:o},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-link.tsx",lineNumber:19,columnNumber:5},this)}function q7({items:o}){const{t:n}=dg();return re.jsxDEV(V_,{children:re.jsxDEV(P7,{children:o.map(a=>{var s,l;return re.jsxDEV(QB,{defaultOpen:a.isActive,render:re.jsxDEV(H7,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:35,columnNumber:77},this),children:[re.jsxDEV(ag,{to:a.url,children:re.jsxDEV(B7,{tooltip:n(a.title),children:[re.jsxDEV(a.icon,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:38,columnNumber:17},this),re.jsxDEV("span",{children:n(a.title)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:39,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:37,columnNumber:15},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:36,columnNumber:13},this),(s=a.items)!=null&&s.length?re.jsxDEV(re.Fragment,{children:[re.jsxDEV(WB,{render:re.jsxDEV(V7,{className:"data-[state=open]:rotate-90"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:44,columnNumber:45},this),children:[re.jsxDEV(M5,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:45,columnNumber:19},this),re.jsxDEV("span",{className:"sr-only",children:"Toggle"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:46,columnNumber:19},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:44,columnNumber:17},this),re.jsxDEV(KB,{children:re.jsxDEV(F7,{children:(l=a.items)==null?void 0:l.map(c=>re.jsxDEV(Y7,{children:re.jsxDEV(ag,{to:c.url,children:re.jsxDEV($7,{children:re.jsxDEV("span",{children:n(c.title)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:54,columnNumber:29},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:53,columnNumber:27},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:52,columnNumber:25},this)},c.title,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:51,columnNumber:23},this))},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:49,columnNumber:19},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:48,columnNumber:17},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:43,columnNumber:15},this):null]},a.title,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:35,columnNumber:11},this)})},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:33,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/nav-main.tsx",lineNumber:32,columnNumber:5},this)}const G7=ew("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function X7({className:o,variant:n="default",render:a,...s}){return Wf({defaultTagName:"span",props:Ql({className:jt(G7({className:o,variant:n}))},s),render:a,state:{slot:"badge",variant:n}})}const xw=x.createContext(void 0);xw.displayName="ScrollAreaRootContext";function wg(){const o=x.useContext(xw);if(o===void 0)throw new Error("Base UI: ScrollAreaRootContext is missing. ScrollArea parts must be placed within <ScrollArea.Root>.");return o}let sg=(function(o){return o.scrollAreaCornerHeight="--scroll-area-corner-height",o.scrollAreaCornerWidth="--scroll-area-corner-width",o})({});const Am=500,yA=16;function Ur(o,n,a){if(!o)return 0;const s=getComputedStyle(o),l=a==="x"?"Inline":"Block";return a==="x"&&n==="margin"?parseFloat(s[`${n}InlineStart`])*2:parseFloat(s[`${n}${l}Start`])+parseFloat(s[`${n}${l}End`])}let Q7=(function(o){return o.orientation="data-orientation",o.hovering="data-hovering",o.scrolling="data-scrolling",o.hasOverflowX="data-has-overflow-x",o.hasOverflowY="data-has-overflow-y",o.overflowXStart="data-overflow-x-start",o.overflowXEnd="data-overflow-x-end",o.overflowYStart="data-overflow-y-start",o.overflowYEnd="data-overflow-y-end",o})({});const Nm="base-ui-disable-scrollbar",Rw={className:Nm,getElement(o){return nn.jsx("style",{nonce:o,href:Nm,precedence:"base-ui:low",children:`.${Nm}{scrollbar-width:none}.${Nm}::-webkit-scrollbar{display:none}`})}};Rw.getElement.displayName="styleDisableScrollbar.getElement";let Zc=(function(o){return o.scrolling="data-scrolling",o.hasOverflowX="data-has-overflow-x",o.hasOverflowY="data-has-overflow-y",o.overflowXStart="data-overflow-x-start",o.overflowXEnd="data-overflow-x-end",o.overflowYStart="data-overflow-y-start",o.overflowYEnd="data-overflow-y-end",o})({});const Tw={hasOverflowX:o=>o?{[Zc.hasOverflowX]:""}:null,hasOverflowY:o=>o?{[Zc.hasOverflowY]:""}:null,overflowXStart:o=>o?{[Zc.overflowXStart]:""}:null,overflowXEnd:o=>o?{[Zc.overflowXEnd]:""}:null,overflowYStart:o=>o?{[Zc.overflowYStart]:""}:null,overflowYEnd:o=>o?{[Zc.overflowYEnd]:""}:null,cornerHidden:()=>null},F_=x.createContext(void 0);F_.displayName="CSPContext";const W7={disableStyleElements:!1};function K7(){return x.useContext(F_)??W7}const J7={x:0,y:0},bA={width:0,height:0},Z7={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},eY={x:!1,y:!1,corner:!1},Y_=x.forwardRef(function(n,a){const{render:s,className:l,overflowEdgeThreshold:c,...f}=n,h=tY(c),g=Xf(),m=Ds(),b=Ds(),{nonce:p,disableStyleElements:v}=K7(),[w,E]=x.useState(!1),[T,C]=x.useState(!1),[A,k]=x.useState(!1),[U,M]=x.useState(!1),[Y,$]=x.useState(bA),[_,z]=x.useState(bA),[te,H]=x.useState(Z7),[J,N]=x.useState(eY),P=x.useRef(null),ne=x.useRef(null),Z=x.useRef(null),j=x.useRef(null),oe=x.useRef(null),I=x.useRef(null),ie=x.useRef(null),pe=x.useRef(!1),L=x.useRef(0),ce=x.useRef(0),se=x.useRef(0),me=x.useRef(0),Te=x.useRef("vertical"),Ue=x.useRef(J7),ve=st(Ae=>{const Le=Ae.x-Ue.current.x,tt=Ae.y-Ue.current.y;Ue.current=Ae,tt!==0&&(k(!0),m.start(Am,()=>{k(!1)})),Le!==0&&(C(!0),b.start(Am,()=>{C(!1)}))}),ze=st(Ae=>{Ae.button===0&&(pe.current=!0,L.current=Ae.clientY,ce.current=Ae.clientX,Te.current=Ae.currentTarget.getAttribute(Q7.orientation),ne.current&&(se.current=ne.current.scrollTop,me.current=ne.current.scrollLeft),oe.current&&Te.current==="vertical"&&oe.current.setPointerCapture(Ae.pointerId),I.current&&Te.current==="horizontal"&&I.current.setPointerCapture(Ae.pointerId))}),je=st(Ae=>{if(!pe.current)return;const Le=Ae.clientY-L.current,tt=Ae.clientX-ce.current;if(ne.current){const Ce=ne.current.scrollHeight,ot=ne.current.clientHeight,gt=ne.current.scrollWidth,yt=ne.current.clientWidth;if(oe.current&&Z.current&&Te.current==="vertical"){const ht=Ur(Z.current,"padding","y"),$t=Ur(oe.current,"margin","y"),on=oe.current.offsetHeight,bn=Z.current.offsetHeight-on-ht-$t,bt=Le/bn;ne.current.scrollTop=se.current+bt*(Ce-ot),Ae.preventDefault(),k(!0),m.start(Am,()=>{k(!1)})}if(I.current&&j.current&&Te.current==="horizontal"){const ht=Ur(j.current,"padding","x"),$t=Ur(I.current,"margin","x"),on=I.current.offsetWidth,bn=j.current.offsetWidth-on-ht-$t,bt=tt/bn;ne.current.scrollLeft=me.current+bt*(gt-yt),Ae.preventDefault(),C(!0),b.start(Am,()=>{C(!1)})}}}),at=st(Ae=>{pe.current=!1,oe.current&&Te.current==="vertical"&&oe.current.releasePointerCapture(Ae.pointerId),I.current&&Te.current==="horizontal"&&I.current.releasePointerCapture(Ae.pointerId)});function xe(Ae){M(Ae.pointerType==="touch")}function he(Ae){if(xe(Ae),Ae.pointerType!=="touch"){const Le=Yt(P.current,Ae.target);E(Le)}}const we=x.useMemo(()=>({scrolling:T||A,hasOverflowX:!J.x,hasOverflowY:!J.y,overflowXStart:te.xStart,overflowXEnd:te.xEnd,overflowYStart:te.yStart,overflowYEnd:te.yEnd,cornerHidden:J.corner}),[T,A,J.x,J.y,J.corner,te]),De={role:"presentation",onPointerEnter:he,onPointerMove:he,onPointerDown:xe,onPointerLeave(){E(!1)},style:{position:"relative",[sg.scrollAreaCornerHeight]:`${Y.height}px`,[sg.scrollAreaCornerWidth]:`${Y.width}px`}},Ye=Ln("div",n,{state:we,ref:[a,P],props:[De,f],stateAttributesMapping:Tw}),Re=x.useMemo(()=>({handlePointerDown:ze,handlePointerMove:je,handlePointerUp:at,handleScroll:ve,cornerSize:Y,setCornerSize:$,thumbSize:_,setThumbSize:z,touchModality:U,cornerRef:ie,scrollingX:T,setScrollingX:C,scrollingY:A,setScrollingY:k,hovering:w,setHovering:E,viewportRef:ne,rootRef:P,scrollbarYRef:Z,scrollbarXRef:j,thumbYRef:oe,thumbXRef:I,rootId:g,hiddenState:J,setHiddenState:N,overflowEdges:te,setOverflowEdges:H,viewportState:we,overflowEdgeThreshold:h}),[ze,je,at,ve,Y,_,U,T,C,A,k,w,E,g,J,te,we,h]);return nn.jsxs(xw.Provider,{value:Re,children:[!v&&Rw.getElement(p),Ye]})});Y_.displayName="ScrollAreaRoot";function tY(o){if(typeof o=="number"){const n=Math.max(0,o);return{xStart:n,xEnd:n,yStart:n,yEnd:n}}return{xStart:Math.max(0,(o==null?void 0:o.xStart)||0),xEnd:Math.max(0,(o==null?void 0:o.xEnd)||0),yStart:Math.max(0,(o==null?void 0:o.yStart)||0),yEnd:Math.max(0,(o==null?void 0:o.yEnd)||0)}}const $_=x.createContext(void 0);$_.displayName="ScrollAreaViewportContext";function tu(o,n=Number.MIN_SAFE_INTEGER,a=Number.MAX_SAFE_INTEGER){return Math.max(n,Math.min(o,a))}function nY(o,n){if(typeof IntersectionObserver>"u")return()=>{};const a=new IntersectionObserver(s=>{s.forEach(l=>{l.intersectionRatio>0&&(n(),a.disconnect())})});return a.observe(o),()=>{a.disconnect()}}let _i=(function(o){return o.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",o.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",o.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",o.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",o})({});const vA=1;function SA(o,n){if(n<=0)return 0;const a=tu(o,0,n),s=a,l=n-a,c=s<=vA,f=l<=vA;return c&&f?s<=l?0:n:c?0:f?n:a}let wA=!1;function oY(){wA||ow||(typeof CSS<"u"&&"registerProperty"in CSS&&[_i.scrollAreaOverflowXStart,_i.scrollAreaOverflowXEnd,_i.scrollAreaOverflowYStart,_i.scrollAreaOverflowYEnd].forEach(o=>{try{CSS.registerProperty({name:o,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),wA=!0)}const q_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{viewportRef:f,scrollbarYRef:h,scrollbarXRef:g,thumbYRef:m,thumbXRef:b,cornerRef:p,cornerSize:v,setCornerSize:w,setThumbSize:E,rootId:T,setHiddenState:C,hiddenState:A,handleScroll:k,setHovering:U,setOverflowEdges:M,overflowEdges:Y,overflowEdgeThreshold:$,scrollingX:_,scrollingY:z}=wg(),te=Ew(),H=x.useRef(!0),J=Ds(),N=Ds(),P=st(()=>{const ie=f.current,pe=h.current,L=g.current,ce=m.current,se=b.current,me=p.current;if(!ie)return;const Te=ie.scrollHeight,Ue=ie.scrollWidth,ve=ie.clientHeight,ze=ie.clientWidth,je=ie.scrollTop,at=ie.scrollLeft;if(Te===0||Ue===0)return;const xe=ve>=Te,he=ze>=Ue,we=ze/Ue,De=ve/Te,Ye=Math.max(0,Ue-ze),Re=Math.max(0,Te-ve);let Ae=0,Le=0;if(!he){let ye=0;te==="rtl"?ye=tu(-at,0,Ye):ye=tu(at,0,Ye),Ae=SA(ye,Ye),Le=Ye-Ae}const tt=xe?0:tu(je,0,Re),Ce=xe?0:SA(tt,Re),ot=xe?0:Re-Ce,gt=he?0:ze,yt=xe?0:ve;let ht=0,$t=0;!he&&!xe&&(ht=(pe==null?void 0:pe.offsetWidth)||0,$t=(L==null?void 0:L.offsetHeight)||0);const on=v.width===0&&v.height===0,bn=on?ht:0,bt=on?$t:0,Pt=Ur(L,"padding","x"),Ft=Ur(pe,"padding","y"),vn=Ur(se,"margin","x"),ln=Ur(ce,"margin","y"),Zn=gt-Pt-vn,hn=yt-Ft-ln,co=L?Math.min(L.offsetWidth-bn,Zn):Zn,uo=pe?Math.min(pe.offsetHeight-bt,hn):hn,Un=Math.max(yA,co*we),D=Math.max(yA,uo*De);if(E(ye=>ye.height===D&&ye.width===Un?ye:{width:Un,height:D}),pe&&ce){const ye=pe.offsetHeight-D-Ft-ln,Ne=Te-ve,$e=Ne===0?0:je/Ne,Se=Math.min(ye,Math.max(0,$e*ye));ce.style.transform=`translate3d(0,${Se}px,0)`}if(L&&se){const ye=L.offsetWidth-Un-Pt-vn,Ne=Ue-ze,$e=Ne===0?0:at/Ne,Se=te==="rtl"?tu($e*ye,-ye,0):tu($e*ye,0,ye);se.style.transform=`translate3d(${Se}px,0,0)`}const G=[[_i.scrollAreaOverflowXStart,Ae],[_i.scrollAreaOverflowXEnd,Le],[_i.scrollAreaOverflowYStart,Ce],[_i.scrollAreaOverflowYEnd,ot]];for(const[ye,Ne]of G)ie.style.setProperty(ye,`${Ne}px`);me&&(he||xe?w({width:0,height:0}):!he&&!xe&&w({width:ht,height:$t})),C(ye=>{const Ne=xe||he;return ye.y===xe&&ye.x===he&&ye.corner===Ne?ye:{y:xe,x:he,corner:Ne}});const ge={xStart:!he&&Ae>$.xStart,xEnd:!he&&Le>$.xEnd,yStart:!xe&&Ce>$.yStart,yEnd:!xe&&ot>$.yEnd};M(ye=>ye.xStart===ge.xStart&&ye.xEnd===ge.xEnd&&ye.yStart===ge.yStart&&ye.yEnd===ge.yEnd?ye:ge)});pt(()=>{if(!f.current)return;oY();let ie=!1;return nY(f.current,()=>{if(!ie){ie=!0;return}P()})},[P,f]),pt(()=>{queueMicrotask(P)},[P,A,te]),pt(()=>{var ie;(ie=f.current)!=null&&ie.matches(":hover")&&U(!0)},[f,U]),x.useEffect(()=>{const ie=f.current;if(typeof ResizeObserver>"u"||!ie)return;let pe=!1;const L=new ResizeObserver(()=>{if(!pe){pe=!0;return}P()});return L.observe(ie),N.start(0,()=>{const ce=ie.getAnimations({subtree:!0});ce.length!==0&&Promise.allSettled(ce.map(se=>se.finished)).then(P).catch(()=>{})}),()=>{L.disconnect(),N.clear()}},[P,f,N]);function ne(){H.current=!1}const Z={role:"presentation",...T&&{"data-id":`${T}-viewport`},...(!A.x||!A.y)&&{tabIndex:0},className:Rw.className,style:{overflow:"scroll"},onScroll(){f.current&&(P(),H.current||k({x:f.current.scrollLeft,y:f.current.scrollTop}),J.start(100,()=>{H.current=!0}))},onWheel:ne,onTouchMove:ne,onPointerMove:ne,onPointerEnter:ne,onKeyDown:ne},j=x.useMemo(()=>({scrolling:_||z,hasOverflowX:!A.x,hasOverflowY:!A.y,overflowXStart:Y.xStart,overflowXEnd:Y.xEnd,overflowYStart:Y.yStart,overflowYEnd:Y.yEnd,cornerHidden:A.corner}),[_,z,A.x,A.y,A.corner,Y]),oe=Ln("div",n,{ref:[a,f],state:j,props:[Z,c],stateAttributesMapping:Tw}),I=x.useMemo(()=>({computeThumbPosition:P}),[P]);return nn.jsx($_.Provider,{value:I,children:oe})});q_.displayName="ScrollAreaViewport";const Cw=x.createContext(void 0);Cw.displayName="ScrollAreaScrollbarContext";function rY(){const o=x.useContext(Cw);if(o===void 0)throw new Error("Base UI: ScrollAreaScrollbarContext is missing. ScrollAreaScrollbar parts must be placed within <ScrollArea.Scrollbar>.");return o}let ig=(function(o){return o.scrollAreaThumbHeight="--scroll-area-thumb-height",o.scrollAreaThumbWidth="--scroll-area-thumb-width",o})({});const G_=x.forwardRef(function(n,a){const{render:s,className:l,orientation:c="vertical",keepMounted:f=!1,...h}=n,{hovering:g,scrollingX:m,scrollingY:b,hiddenState:p,overflowEdges:v,scrollbarYRef:w,scrollbarXRef:E,viewportRef:T,thumbYRef:C,thumbXRef:A,handlePointerDown:k,handlePointerUp:U,rootId:M,thumbSize:Y}=wg(),$={hovering:g,scrolling:{horizontal:m,vertical:b}[c],orientation:c,hasOverflowX:!p.x,hasOverflowY:!p.y,overflowXStart:v.xStart,overflowXEnd:v.xEnd,overflowYStart:v.yStart,overflowYEnd:v.yEnd,cornerHidden:p.corner},_=Ew();x.useEffect(()=>{const P=T.current,ne=c==="vertical"?w.current:E.current;if(!ne)return;function Z(j){if(!(!P||!ne||j.ctrlKey)){if(j.preventDefault(),c==="vertical"){if(P.scrollTop===0&&j.deltaY<0)return}else if(P.scrollLeft===0&&j.deltaX<0)return;if(c==="vertical"){if(P.scrollTop===P.scrollHeight-P.clientHeight&&j.deltaY>0)return}else if(P.scrollLeft===P.scrollWidth-P.clientWidth&&j.deltaX>0)return;c==="vertical"?P.scrollTop+=j.deltaY:P.scrollLeft+=j.deltaX}}return ne.addEventListener("wheel",Z,{passive:!1}),()=>{ne.removeEventListener("wheel",Z)}},[c,E,w,T]);const z={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(P){if(P.button===0&&P.currentTarget===P.target&&T.current){if(C.current&&w.current&&c==="vertical"){const ne=Ur(C.current,"margin","y"),Z=Ur(w.current,"padding","y"),j=C.current.offsetHeight,oe=w.current.getBoundingClientRect(),I=P.clientY-oe.top-j/2-Z+ne/2,ie=T.current.scrollHeight,pe=T.current.clientHeight,L=w.current.offsetHeight-j-Z-ne,se=I/L*(ie-pe);T.current.scrollTop=se}if(A.current&&E.current&&c==="horizontal"){const ne=Ur(A.current,"margin","x"),Z=Ur(E.current,"padding","x"),j=A.current.offsetWidth,oe=E.current.getBoundingClientRect(),I=P.clientX-oe.left-j/2-Z+ne/2,ie=T.current.scrollWidth,pe=T.current.clientWidth,L=E.current.offsetWidth-j-Z-ne,ce=I/L;let se;_==="rtl"?(se=(1-ce)*(ie-pe),T.current.scrollLeft<=0&&(se=-se)):se=ce*(ie-pe),T.current.scrollLeft=se}k(P)}},onPointerUp:U,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...c==="vertical"&&{top:0,bottom:`var(${sg.scrollAreaCornerHeight})`,insetInlineEnd:0,[ig.scrollAreaThumbHeight]:`${Y.height}px`},...c==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${sg.scrollAreaCornerWidth})`,bottom:0,[ig.scrollAreaThumbWidth]:`${Y.width}px`}}},te=Ln("div",n,{ref:[a,c==="vertical"?w:E],state:$,props:[z,h],stateAttributesMapping:Tw}),H=x.useMemo(()=>({orientation:c}),[c]),J=c==="vertical"?p.y:p.x;return f||!J?nn.jsx(Cw.Provider,{value:H,children:te}):null});G_.displayName="ScrollAreaScrollbar";const X_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{thumbYRef:f,thumbXRef:h,handlePointerDown:g,handlePointerMove:m,handlePointerUp:b,setScrollingX:p,setScrollingY:v}=wg(),{orientation:w}=rY();return Ln("div",n,{ref:[a,w==="vertical"?f:h],state:{orientation:w},props:[{onPointerDown:g,onPointerMove:m,onPointerUp(C){w==="vertical"&&v(!1),w==="horizontal"&&p(!1),b(C)},style:{...w==="vertical"&&{height:`var(${ig.scrollAreaThumbHeight})`},...w==="horizontal"&&{width:`var(${ig.scrollAreaThumbWidth})`}}},c]})});X_.displayName="ScrollAreaThumb";const Q_=x.forwardRef(function(n,a){const{render:s,className:l,...c}=n,{cornerRef:f,cornerSize:h,hiddenState:g}=wg(),m=Ln("div",n,{ref:[a,f],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:h.width,height:h.height}},c]});return g.corner?null:m});Q_.displayName="ScrollAreaCorner";function aY({className:o,children:n,...a}){return re.jsxDEV(Y_,{"data-slot":"scroll-area",className:jt("relative",o),...a,children:[re.jsxDEV(q_,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:n},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:16,columnNumber:7},this),re.jsxDEV(sY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:22,columnNumber:7},this),re.jsxDEV(Q_,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:23,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:11,columnNumber:5},this)}function sY({className:o,orientation:n="vertical",...a}){return re.jsxDEV(G_,{"data-slot":"scroll-area-scrollbar","data-orientation":n,orientation:n,className:jt("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",o),...a,children:re.jsxDEV(X_,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:45,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/ui/scroll-area.tsx",lineNumber:34,columnNumber:5},this)}function $Y(o){return o}function iY(o){return encodeURIComponent(o)}function lY(){const{t:o}=dg(),n=Ns(),a=yN(),{isMobile:s,setOpenMobile:l}=Du(),{toggleDevice:c}=x5(),f=Df("/devices/:deviceId/windows/:windowId/panes/:paneId",n.pathname),h=f==null?void 0:f.params.deviceId,g=f==null?void 0:f.params.windowId,m=f==null?void 0:f.params.paneId,b=Es(H=>H.snapshots),p=Es(H=>H.connectedDevices),v=Es(H=>H.closeWindow),w=Es(H=>H.closePane),E=qm(H=>{var J;return((J=H.settings)==null?void 0:J.language)??"en_US"}),{data:T}=x3({queryKey:["devices"],queryFn:async()=>{const H=await fetch("/api/devices");if(!H.ok)throw new Error("Failed to fetch devices");return H.json()},throwOnError:!1}),C=x.useCallback((H,J)=>{a(H,{replace:(J==null?void 0:J.replace)??!0}),s&&l(!1)},[a,s,l]),A=x.useCallback((H,J,N)=>{U.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:H,windowId:J,paneId:N}})),C(`/devices/${H}/windows/${J}/panes/${iY(N)}`)},[C]),k=Es(H=>H.selectWindow),U=x.useRef(null);x.useEffect(()=>{var oe,I;const H=U.current;if(!H)return;if(Date.now()-H.at>5e3){U.current=null;return}const{deviceId:J,windowId:N}=H,P=b[J],ne=(oe=P==null?void 0:P.session)==null?void 0:oe.windows;if(!ne)return;const Z=ne.find(ie=>ie.id===N);if(!((I=Z==null?void 0:Z.panes)!=null&&I.length))return;U.current=null;const j=Z.panes.find(ie=>ie.active)??Z.panes[0];A(J,N,j.id)},[b,A]);const M=x.useCallback((H,J,N)=>{k(H,J);const P=N.find(ne=>ne.active)??N[0];P?(A(H,J,P.id),U.current=null):U.current={deviceId:H,windowId:J,at:Date.now()}},[A,k]),Y=x.useCallback((H,J)=>{J?H===h&&C("/devices"):C(`/devices/${H}`),c(H,J)},[c,h,C]),$=x.useCallback((H,J)=>{H===h&&J===g&&C("/devices"),v(H,J)},[v,h,g,C]),_=x.useCallback(H=>{Es.getState().createWindow(H)},[]),z=(T==null?void 0:T.devices)??[],te=x.useMemo(()=>[...z].sort((H,J)=>H.name.localeCompare(J.name,mH(E),{numeric:!0,sensitivity:"base"})),[z,E]);return re.jsxDEV(V_,{className:"flex flex-col flex-1 min-h-0",children:[re.jsxDEV(j7,{children:o("device.devices")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:170,columnNumber:7},this),re.jsxDEV(aY,{className:"flex-1 min-h-0",children:re.jsxDEV("div",{className:"space-y-1.5 py-2",children:[te.map(H=>{var J,N;return re.jsxDEV(cY,{device:H,windows:((N=(J=b[H.id])==null?void 0:J.session)==null?void 0:N.windows)??null,isConnected:p.has(H.id),selectedWindowId:g,selectedPaneId:m,onConnectToggle:()=>Y(H.id,p.has(H.id)),onCreateWindow:_,onCloseWindow:$,onClosePane:w,onPaneClick:A,onWindowClick:M},H.id,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:174,columnNumber:13},this)}),te.length===0&&re.jsxDEV("div",{className:"text-center text-sm text-muted-foreground py-4",children:o("sidebar.noDevices")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:192,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:172,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:171,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:169,columnNumber:5},this)}function cY({device:o,windows:n,isConnected:a,selectedWindowId:s,selectedPaneId:l,onConnectToggle:c,onCreateWindow:f,onCloseWindow:h,onClosePane:g,onPaneClick:m,onWindowClick:b}){const{t:p}=dg(),v=o.type==="local"?HN:k5;return re.jsxDEV("div",{"data-testid":`device-item-${o.id}`,className:jt("rounded-lg border overflow-hidden text-select-none",a?"bg-card/50":"bg-muted/20"),onClick:a?void 0:c,children:[re.jsxDEV("div",{className:"px-3 py-1 bg-muted/30 border-b",children:re.jsxDEV("div",{className:"flex items-center gap-2",children:[re.jsxDEV(v,{className:"ml-1 h-4 w-4 text-muted-foreground shrink-0"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:244,columnNumber:11},this),re.jsxDEV("span",{className:"flex-1 truncate text-sm font-medium text-select-none",children:o.name},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:245,columnNumber:11},this),re.jsxDEV("div",{className:jt("h-2 w-2 rounded-full shrink-0",a?"bg-emerald-500":"bg-gray-400")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:250,columnNumber:11},this),re.jsxDEV(nw,{variant:"ghost",size:"icon-xs",onClick:w=>{w.stopPropagation(),c()},"data-testid":a?`device-disconnect-${o.id}`:`device-connect-${o.id}`,title:p(a?"device.disconnect":"device.connect"),children:a?re.jsxDEV(V5,{className:"h-3.5 w-3.5 text-orange-500"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:271,columnNumber:15},this):re.jsxDEV(Y5,{className:"h-3.5 w-3.5 text-emerald-500"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:273,columnNumber:15},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:258,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:243,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:242,columnNumber:7},this),a&&re.jsxDEV("div",{className:"p-1 space-y-0.5",children:[!n&&re.jsxDEV("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:p("device.connecting")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:283,columnNumber:13},this),(n==null?void 0:n.length)===0&&re.jsxDEV("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:p("window.noWindows")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:289,columnNumber:13},this),n==null?void 0:n.map(w=>re.jsxDEV(uY,{deviceId:o.id,window:w,isSelected:w.id===s,selectedPaneId:l,onPaneClick:m,onWindowClick:b,onCloseWindow:h,onClosePane:g},w.id,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:295,columnNumber:13},this)),re.jsxDEV("button",{type:"button",onClick:()=>f(o.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[re.jsxDEV(I5,{className:"h-3.5 w-3.5 shrink-0"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:314,columnNumber:13},this),re.jsxDEV("span",{className:"text-xs",children:p("window.new")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:315,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:309,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:281,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:233,columnNumber:5},this)}function uY({deviceId:o,window:n,isSelected:a,selectedPaneId:s,onPaneClick:l,onWindowClick:c,onCloseWindow:f,onClosePane:h}){const g=n.panes.length>1,m=n.panes.find(p=>p.id===s),b=a&&!!m;return re.jsxDEV("div",{className:"space-y-0.5",children:[re.jsxDEV("div",{className:"group relative",children:[re.jsxDEV("button",{type:"button",onClick:()=>c(o,n.id,n.panes),"data-testid":`window-item-${n.id}`,className:jt("w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors pr-7",b?"bg-primary/15 text-primary border border-primary/30":"hover:bg-accent/50 text-foreground border border-transparent"),children:[re.jsxDEV(X7,{variant:b?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:n.index},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:365,columnNumber:11},this),re.jsxDEV("span",{className:"flex-1 truncate text-xs font-medium",children:n.name},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:372,columnNumber:11},this),n.active&&re.jsxDEV("span",{className:jt("h-1.5 w-1.5 rounded-full shrink-0",b?"bg-foreground/80":"bg-foreground/50")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:375,columnNumber:13},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:354,columnNumber:9},this),re.jsxDEV("button",{type:"button",onClick:p=>{p.stopPropagation(),f(o,n.id)},className:jt("absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",b?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Close window",children:re.jsxDEV("span",{className:"text-xs leading-none",children:"×"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:397,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:385,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:353,columnNumber:7},this),g&&re.jsxDEV("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-0.5",children:n.panes.map(p=>{const v=p.id===s;return re.jsxDEV("div",{className:"group relative",children:[re.jsxDEV("button",{type:"button",onClick:()=>l(o,n.id,p.id),"data-testid":`pane-item-${p.id}`,className:jt("w-full flex items-center gap-2 px-2 py-1 rounded-md text-left transition-colors pr-7",v?"bg-primary/10 text-primary border border-primary/20":"hover:bg-accent/30 text-muted-foreground border border-transparent"),children:[re.jsxDEV("span",{className:"text-[10px] font-mono opacity-60 w-4",children:p.index},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:420,columnNumber:19},this),re.jsxDEV("span",{className:"flex-1 truncate text-xs",children:p.title||`Pane ${p.index}`},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:422,columnNumber:19},this),p.active&&re.jsxDEV("span",{className:jt("h-1 w-1 rounded-full shrink-0",v?"bg-foreground/80":"bg-foreground/50")},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:427,columnNumber:21},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:409,columnNumber:17},this),re.jsxDEV("button",{type:"button",onClick:w=>{w.stopPropagation(),h(o,n.id,p.id,n.panes.length)},className:jt("absolute right-1.5 top-1/2 -translate-y-1/2 h-5 w-5 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",v?"opacity-100":"opacity-0 group-hover:opacity-100"),title:"Close pane",children:re.jsxDEV("span",{className:"text-xs leading-none",children:"×"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:449,columnNumber:19},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:437,columnNumber:17},this)]},p.id,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:408,columnNumber:15},this)})},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:403,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-device-list.tsx",lineNumber:351,columnNumber:5},this)}function dY(o,n){let a;try{a=o()}catch{return}return{getItem:l=>{var c;const f=g=>g===null?null:JSON.parse(g,void 0),h=(c=a.getItem(l))!=null?c:null;return h instanceof Promise?h.then(f):f(h)},setItem:(l,c)=>a.setItem(l,JSON.stringify(c,void 0)),removeItem:l=>a.removeItem(l)}}const TS=o=>n=>{try{const a=o(n);return a instanceof Promise?a:{then(s){return TS(s)(a)},catch(s){return this}}}catch(a){return{then(s){return this},catch(s){return TS(s)(a)}}}},fY=(o,n)=>(a,s,l)=>{let c={storage:dY(()=>window.localStorage),partialize:C=>C,version:0,merge:(C,A)=>({...A,...C}),...n},f=!1,h=0;const g=new Set,m=new Set;let b=c.storage;if(!b)return o((...C)=>{console.warn(`[zustand persist middleware] Unable to update item '${c.name}', the given storage is currently unavailable.`),a(...C)},s,l);const p=()=>{const C=c.partialize({...s()});return b.setItem(c.name,{state:C,version:c.version})},v=l.setState;l.setState=(C,A)=>(v(C,A),p());const w=o((...C)=>(a(...C),p()),s,l);l.getInitialState=()=>w;let E;const T=()=>{var C,A;if(!b)return;const k=++h;f=!1,g.forEach(M=>{var Y;return M((Y=s())!=null?Y:w)});const U=((A=c.onRehydrateStorage)==null?void 0:A.call(c,(C=s())!=null?C:w))||void 0;return TS(b.getItem.bind(b))(c.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==c.version){if(c.migrate){const Y=c.migrate(M.state,M.version);return Y instanceof Promise?Y.then($=>[!0,$]):[!0,Y]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var Y;if(k!==h)return;const[$,_]=M;if(E=c.merge(_,(Y=s())!=null?Y:w),a(E,!0),$)return p()}).then(()=>{k===h&&(U==null||U(E,void 0),E=s(),f=!0,m.forEach(M=>M(E)))}).catch(M=>{k===h&&(U==null||U(void 0,M))})};return l.persist={setOptions:C=>{c={...c,...C},C.storage&&(b=C.storage)},clearStorage:()=>{b==null||b.removeItem(c.name)},getOptions:()=>c,rehydrate:()=>T(),hasHydrated:()=>f,onHydrate:C=>(g.add(C),()=>{g.delete(C)}),onFinishHydration:C=>(m.add(C),()=>{m.delete(C)})},c.skipHydration||T(),E||w},hY=fY,EA=qS()(hY(o=>({sidebarCollapsed:!1,inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:n=>o({sidebarCollapsed:n}),setInputMode:n=>o({inputMode:n}),setEditorSendWithEnter:n=>o({editorSendWithEnter:n}),setTheme:n=>o({theme:n}),addEditorHistory:n=>o(a=>({editorHistory:[n,...a.editorHistory.slice(0,49)]})),setEditorDraft:(n,a)=>o(s=>({editorDrafts:{...s.editorDrafts,[n]:a}})),removeEditorDraft:n=>o(a=>{if(!(n in a.editorDrafts))return a;const s={...a.editorDrafts};return delete s[n],{editorDrafts:s}})}),{name:"tmex-ui",partialize:o=>({sidebarCollapsed:o.sidebarCollapsed,inputMode:o.inputMode,editorSendWithEnter:o.editorSendWithEnter,theme:o.theme,editorHistory:o.editorHistory,editorDrafts:o.editorDrafts})}));function pY(){const{t:o}=dg(),{isMobile:n,setOpenMobile:a}=Du(),s=qm(b=>{var p;return(p=b.settings)==null?void 0:p.siteName}),l=qm(b=>b.fetchSettings);x.useEffect(()=>{l()},[l]);const c=s??"tmex",f=EA(b=>b.theme),h=EA(b=>b.setTheme),g=f==="dark",m=()=>{const b=g?"light":"dark";h(b),document.documentElement.classList.toggle("dark",b==="dark")};return re.jsxDEV("div",{className:"flex items-center gap-2 px-2",children:[re.jsxDEV(ag,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[re.jsxDEV("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:re.jsxDEV("img",{src:"/logo.png",alt:c,className:"h-full w-full object-cover"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:37,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:36,columnNumber:9},this),re.jsxDEV("span",{className:"truncate text-sm font-semibold tracking-tight",children:c},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:43,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:35,columnNumber:7},this),re.jsxDEV("button",{type:"button",onClick:m,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o(g?"settings.themeLight":"settings.themeDark"),title:o(g?"settings.themeLight":"settings.themeDark"),children:g?re.jsxDEV(X5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:54,columnNumber:19},this):re.jsxDEV(z5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:54,columnNumber:49},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:47,columnNumber:7},this),re.jsxDEV(ag,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o("sidebar.settings"),title:o("sidebar.settings"),children:re.jsxDEV(q5,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:62,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:56,columnNumber:7},this),n&&re.jsxDEV("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>a(!1),className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":o("nav.closeSidebar"),title:o("nav.closeSidebar"),children:re.jsxDEV(IN,{className:"h-4 w-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:73,columnNumber:11},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:65,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/sidebar-title.tsx",lineNumber:34,columnNumber:5},this)}const mY=[{title:"nav.manageDevices",url:"/devices",icon:HN}];function gY({...o}){return re.jsxDEV(M7,{variant:"inset",...o,children:[re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-top)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:25,columnNumber:7},this),re.jsxDEV(L7,{className:"py-3",children:re.jsxDEV(pY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:27,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:26,columnNumber:7},this),re.jsxDEV(z7,{className:"flex flex-col",children:re.jsxDEV(lY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:30,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:29,columnNumber:7},this),re.jsxDEV(U7,{children:[re.jsxDEV(q7,{items:mY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:33,columnNumber:9},this),re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-bottom)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:34,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:32,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/components/page-layouts/components/app-sidebar.tsx",lineNumber:24,columnNumber:5},this)}function yY(){var o;try{const n=localStorage.getItem("tmex-ui");if(!n){document.documentElement.classList.add("dark");return}const a=JSON.parse(n),s=(o=a==null?void 0:a.state)==null?void 0:o.theme,l=s==="dark"||s===void 0;document.documentElement.classList.toggle("dark",l)}catch{document.documentElement.classList.add("dark")}}yY();const bY=new i3({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function vY(){return re.jsxDEV(R5,{children:re.jsxDEV(N7,{children:[re.jsxDEV(gY,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:50,columnNumber:9},this),re.jsxDEV(k7,{className:"h-dvh overflow-hidden",children:[re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-top)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:52,columnNumber:11},this),re.jsxDEV(v4,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:53,columnNumber:11},this),re.jsxDEV("div",{className:"h-[var(--tmex-safe-area-bottom)]"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:54,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:51,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:49,columnNumber:7},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:48,columnNumber:5},this)}function ff({moduleLoader:o}){const[n,a]=x.useState(null),s=Kj();x.useEffect(()=>{o().then(a)},[o]);const l=n==null?void 0:n.default,c=n==null?void 0:n.PageTitle,f=n==null?void 0:n.PageActions;return re.jsxDEV(re.Fragment,{children:[re.jsxDEV("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[re.jsxDEV("div",{className:"flex items-center gap-2 px-4",children:[re.jsxDEV(_7,{className:"-ml-1","data-testid":"mobile-sidebar-open"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:81,columnNumber:11},this),re.jsxDEV(C8,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:82,columnNumber:11},this),re.jsxDEV("span",{className:"truncate text-sm font-semibold",children:c?re.jsxDEV(c,{...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:84,columnNumber:26},this):""},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:83,columnNumber:11},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:80,columnNumber:9},this),re.jsxDEV("div",{className:"flex shrink-0 items-center gap-1 px-4",children:f&&re.jsxDEV(f,{...s},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:88,columnNumber:27},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:87,columnNumber:9},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:76,columnNumber:7},this),re.jsxDEV("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4 mb-2",children:re.jsxDEV("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:l?re.jsxDEV(l,{},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:95,columnNumber:19},this):null},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:94,columnNumber:9},this)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:93,columnNumber:7},this)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:75,columnNumber:5},this)}const SY=()=>CS(()=>import("./SettingsPage-DQ9W4fOo.js"),__vite__mapDeps([0,1,2,3])),xA=()=>CS(()=>import("./DevicesPage-C76Xejy5.js"),__vite__mapDeps([4,1,2])),RA=()=>CS(()=>import("./DevicePage-BTbDSWYN.js"),__vite__mapDeps([5,2,3])),wY=Y4([{path:"/",Component:vY,children:[{index:!0,element:re.jsxDEV(ff,{moduleLoader:xA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:115,columnNumber:18},void 0)},{path:"devices",element:re.jsxDEV(ff,{moduleLoader:xA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:119,columnNumber:18},void 0)},{path:"devices/:deviceId",element:re.jsxDEV(ff,{moduleLoader:RA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:123,columnNumber:18},void 0)},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:re.jsxDEV(ff,{moduleLoader:RA},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:127,columnNumber:18},void 0)},{path:"settings",element:re.jsxDEV(ff,{moduleLoader:SY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:131,columnNumber:18},void 0)}]}]),W_=document.getElementById("root");if(!W_)throw new Error("Root element not found");A3.createRoot(W_).render(re.jsxDEV(x.StrictMode,{children:re.jsxDEV(d3,{client:bY,children:[re.jsxDEV(g4,{router:wY},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:146,columnNumber:7},void 0),re.jsxDEV(AP,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + var(--tmex-safe-area-top))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + var(--tmex-safe-area-top))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:147,columnNumber:7},void 0)]},void 0,!0,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:145,columnNumber:5},void 0)},void 0,!1,{fileName:"/Users/krhougs/LocalCodes/tmex/apps/fe/src/main.tsx",lineNumber:144,columnNumber:3},void 0));export{h_ as $,qN as A,nw as B,nn as C,e7 as D,yn as E,$8 as F,Qf as G,Jf as H,RY as I,PF as J,j_ as K,KM as L,DY as M,v7 as N,Zr as O,hB as P,T_ as Q,IF as R,VY as S,_Y as T,pw as U,Sg as V,p_ as W,IN as X,mr as Y,fr as Z,U8 as _,u3 as a,zY as a$,zt as a0,c_ as a1,O_ as a2,BY as a3,Cu as a4,pt as a5,wu as a6,QF as a7,d_ as a8,f_ as a9,MY as aA,OF as aB,MF as aC,SF as aD,zi as aE,HY as aF,xf as aG,PY as aH,jM as aI,IY as aJ,zf as aK,OY as aL,IM as aM,HN as aN,I5 as aO,k5 as aP,X7 as aQ,C8 as aR,FS as aS,B6 as aT,Vf as aU,P0 as aV,Rf as aW,r3 as aX,yo as aY,$o as aZ,PA as a_,Ds as aa,GF as ab,st as ac,zm as ad,Lf as ae,XS as af,GN as ag,NY as ah,XN as ai,m_ as aj,s_ as ak,AF as al,Ew as am,TY as an,CY as ao,y_ as ap,FY as aq,FB as ar,$n as as,Cs as at,Os as au,fn as av,sF as aw,Ou as ax,gF as ay,Yt as az,qm as b,X6 as b0,jY as b1,LY as b2,UY as b3,xm as b4,xs as b5,vB as b6,fg as b7,QS as b8,Uf as b9,$Y as bA,iY as bB,$N as bC,qt as bD,Wl as bE,WF as bF,lw as bG,JF as bH,J6 as ba,rw as bb,yS as bc,Pa as bd,ID as be,O0 as bf,qo as bg,W6 as bh,K6 as bi,WN as bj,u_ as bk,bF as bl,YY as bm,GM as bn,hF as bo,_8 as bp,K7 as bq,tu as br,Gn as bs,ow as bt,Rw as bu,kY as bv,Es as bw,_f as bx,Kj as by,yN as bz,ta as c,EA as d,x3 as e,xY as f,R_ as g,VM as h,lo as i,re as j,jt as k,D_ as l,FM as m,C_ as n,BM as o,AY as p,ZS as q,x as r,Ql as s,mH as t,dg as u,kf as v,Xf as w,Ln as x,bg as y,RF as z};
448
+ //# sourceMappingURL=index-Bmahx5fj.js.map